Skip to content

Commit

Permalink
ReadySetHandle: rename simple_get_request to simple_post_request
Browse files Browse the repository at this point in the history
ReadySetHandle::simple_get_request() in fact issues a POST request. This
CL changes the naming to reflect that.

Change-Id: Ia60901cba90432ad8ff2a32deacca0d2e55345fe
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/5180
Tested-by: Buildkite CI
Reviewed-by: Luke Osborne <luke@readyset.io>
  • Loading branch information
Dan Wilbanks committed Aug 4, 2023
1 parent 0491795 commit 86dc80b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions readyset-client/src/controller.rs
Expand Up @@ -299,7 +299,8 @@ impl ReadySetHandle {
Self::make(authority.into(), request_timeout, migration_timeout)
}

async fn simple_get_request<R>(&mut self, path: &'static str) -> ReadySetResult<R>
/// Issues a POST request to the given path with no body.
async fn simple_post_request<R>(&mut self, path: &'static str) -> ReadySetResult<R>
where
R: DeserializeOwned,
{
Expand All @@ -322,12 +323,12 @@ impl ReadySetHandle {
///
/// These have all been created in response to a `CREATE TABLE` statement in a recipe.
pub async fn tables(&mut self) -> ReadySetResult<BTreeMap<Relation, NodeIndex>> {
self.simple_get_request("tables").await
self.simple_post_request("tables").await
}

/// Query the status of all known tables, including those not replicated by ReadySet
pub async fn table_statuses(&mut self) -> ReadySetResult<BTreeMap<Relation, TableStatus>> {
self.simple_get_request("table_statuses").await?
self.simple_post_request("table_statuses").await?
}

/// Return a list of all relations (tables or views) which are known to exist in the upstream
Expand All @@ -336,7 +337,7 @@ impl ReadySetHandle {
///
/// [`Change::AddNonReplicatedRelation`]: readyset_client::recipe::changelist::Change::AddNonReplicatedRelation
pub async fn non_replicated_relations(&mut self) -> ReadySetResult<HashSet<Relation>> {
self.simple_get_request("non_replicated_relations").await
self.simple_post_request("non_replicated_relations").await
}

/// Enumerate all known external views.
Expand All @@ -346,7 +347,7 @@ impl ReadySetHandle {
///
/// `Self::poll_ready` must have returned `Async::Ready` before you call this method.
pub async fn views(&mut self) -> ReadySetResult<BTreeMap<Relation, NodeIndex>> {
self.simple_get_request("views").await
self.simple_post_request("views").await
}

/// Enumerate all known external views. Includes the SqlQuery that created the view
Expand All @@ -355,7 +356,7 @@ impl ReadySetHandle {
pub async fn verbose_views(
&mut self,
) -> ReadySetResult<BTreeMap<Relation, (SelectStatement, bool)>> {
self.simple_get_request("verbose_views").await
self.simple_post_request("verbose_views").await
}

/// For each of the given list of queries, determine whether that query (or a semantically
Expand Down

0 comments on commit 86dc80b

Please sign in to comment.