fresh-borzoni commented on code in PR #631:
URL: https://github.com/apache/fluss-rust/pull/631#discussion_r3474302514
##########
crates/fluss/src/client/admin.rs:
##########
@@ -483,4 +496,380 @@ impl FlussAdmin {
}
Ok(tasks)
}
+
+ /// List database summaries (name, created_time, table_count).
+ pub async fn list_database_summaries(&self) ->
Result<Vec<DatabaseSummary>> {
+ let response = self
+ .admin_gateway()
+ .await?
+ .request(ListDatabaseSummariesRequest::new())
+ .await?;
+ Ok(response
+ .database_summary
+ .iter()
+ .map(DatabaseSummary::from_pb)
+ .collect())
+ }
+
+ /// Alter a database's configuration.
+ pub async fn alter_database(
+ &self,
+ name: &str,
+ config_changes: Vec<AlterConfig>,
+ ignore_if_not_exists: bool,
+ ) -> Result<()> {
+ let _response = self
+ .admin_gateway()
+ .await?
+ .request(AlterDatabaseRequest::new(
+ name,
+ ignore_if_not_exists,
+ config_changes,
+ ))
+ .await?;
+ Ok(())
+ }
+
+ /// Alter a table: config changes plus any combination of
add/drop/rename/modify columns.
+ /// Bundle the column-level edits in [`AlterTableChanges`].
+ pub async fn alter_table(
+ &self,
+ table_path: &TablePath,
+ ignore_if_not_exists: bool,
+ changes: AlterTableChanges,
+ ) -> Result<()> {
+ let _response = self
+ .admin_gateway()
+ .await?
+ .request(AlterTableRequest::new(
+ table_path,
+ ignore_if_not_exists,
+ changes.config_changes,
+ changes.add_columns,
+ changes.drop_columns,
+ changes.rename_columns,
+ changes.modify_columns,
+ ))
+ .await?;
+ Ok(())
+ }
+
+ /// Get table statistics for buckets. Pass empty `target_columns` to
request stats for all columns.
+ pub async fn get_table_stats(
+ &self,
+ table_id: TableId,
+ buckets_req: Vec<crate::metadata::BucketStatsRequest>,
Review Comment:
why do we have FQ paths here and in some other parts(AlterConfig,
PbDatabaseSummary) as well?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]