Skip to content

Commit 7657877

Browse files
Luke OsborneLuke Osborne
authored andcommitted
readyset-client: Rename ReadySetStatus
Rename the struct ReadySetStatus, which has the controller specific fields the end up getting combined with other information at the adapter layer to provide the response to a Show::ReadySetStatus request, so that we can consolidate the fields together in a new struct named ReadySetStatus that matches the full information for the `show readyset status` request. Change-Id: I3ee2b4d36d35680831c6040648df1912c465c8cb Reviewed-on: https://gerrit.readyset.name/c/readyset/+/6398 Tested-by: Buildkite CI Reviewed-by: Jason Brown <[email protected]>
1 parent 3b015b2 commit 7657877

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

readyset-client/src/controller.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::internal::{DomainIndex, ReplicaAddress};
3030
use crate::metrics::MetricsDump;
3131
use crate::recipe::changelist::ChangeList;
3232
use crate::recipe::{ExtendRecipeResult, ExtendRecipeSpec, MigrationStatus};
33-
use crate::status::ReadySetStatus;
33+
use crate::status::ReadySetControllerStatus;
3434
use crate::table::{PersistencePoint, Table, TableBuilder, TableRpc};
3535
use crate::view::{View, ViewBuilder, ViewRpc};
3636
use crate::{
@@ -920,8 +920,8 @@ impl ReadySetHandle {
920920
);
921921

922922
simple_request!(
923-
/// Returns the ReadySetStatus struct returned by the leader.
924-
status() -> ReadySetStatus
923+
/// Returns the ReadySetControllerStatus struct returned by the leader.
924+
status() -> ReadySetControllerStatus
925925
);
926926

927927
simple_request!(

readyset-client/src/status.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//! System status information that can sent to a noria-client.
22
//!
3-
//! When introducing new fields to the [`ReadySetStatus`] type, be sure to
3+
//! When introducing new fields to the [`ReadySetControllerStatus`] type, be sure to
44
//! update support for converting the object to strings:
5-
//! * `ReadySetStatus::try_from(_: Vec<(String, String)>)`
6-
//! * `Vec<(String, String)>::from(_: ReadySetStatus)`
5+
//! * `ReadySetControllerStatus::try_from(_: Vec<(String, String)>)`
6+
//! * `Vec<(String, String)>::from(_: ReadySetControllerStatus)`
77
//!
8-
//! These two conversions are used to convert the [`ReadySetStatus`] structs to a format
8+
//! These two conversions are used to convert the [`ReadySetControllerStatus`] structs to a format
99
//! that can be passed to various SQL clients.
1010
use std::fmt::{self, Display};
1111

@@ -18,12 +18,14 @@ const SNAPSHOT_STATUS_VARIABLE: &str = "Snapshot Status";
1818
const MAX_REPLICATION_OFFSET: &str = "Maximum Replication Offset";
1919
const MIN_REPLICATION_OFFSET: &str = "Minimum Replication Offset";
2020

21-
/// ReadySetStatus holds information regarding the status of ReadySet, similar to
21+
/// ReadySetControllerStatus holds information regarding the controller status of ReadySet, similar
22+
/// to
23+
///
2224
/// [`SHOW STATUS`](https://dev.mysql.com/doc/refman/8.0/en/show-status.html) in MySQL.
2325
///
2426
/// Returned via the /status RPC and SHOW READYSET STATUS.
2527
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone)]
26-
pub struct ReadySetStatus {
28+
pub struct ReadySetControllerStatus {
2729
/// The snapshot status of the current leader.
2830
pub snapshot_status: SnapshotStatus,
2931
/// The current maximum replication offset known by the leader.
@@ -32,8 +34,8 @@ pub struct ReadySetStatus {
3234
pub min_replication_offset: Option<ReplicationOffset>,
3335
}
3436

35-
impl From<ReadySetStatus> for Vec<(String, String)> {
36-
fn from(status: ReadySetStatus) -> Vec<(String, String)> {
37+
impl From<ReadySetControllerStatus> for Vec<(String, String)> {
38+
fn from(status: ReadySetControllerStatus) -> Vec<(String, String)> {
3739
let mut res = vec![(
3840
SNAPSHOT_STATUS_VARIABLE.to_string(),
3941
status.snapshot_status.to_string(),

readyset-server/src/controller/inner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use readyset_client::debug::stats::PersistentStats;
2525
use readyset_client::internal::ReplicaAddress;
2626
use readyset_client::metrics::recorded;
2727
use readyset_client::recipe::{ExtendRecipeResult, ExtendRecipeSpec, MigrationStatus};
28-
use readyset_client::status::{ReadySetStatus, SnapshotStatus};
28+
use readyset_client::status::{ReadySetControllerStatus, SnapshotStatus};
2929
use readyset_client::{GraphvizOptions, SingleKeyEviction, ViewCreateRequest, WorkerDescriptor};
3030
use readyset_errors::{internal_err, ReadySetError, ReadySetResult};
3131
use readyset_telemetry_reporter::TelemetrySender;
@@ -495,7 +495,7 @@ impl Leader {
495495
None
496496
};
497497

498-
let status = ReadySetStatus {
498+
let status = ReadySetControllerStatus {
499499
// Use whether the leader is ready or not as a proxy for if we have
500500
// completed snapshotting.
501501
snapshot_status: if leader_ready {

0 commit comments

Comments
 (0)