MCPcopy Create free account
hub / github.com/apache/paimon-rust / rollback_to_snapshot

Method rollback_to_snapshot

crates/paimon/src/api/rest_api.rs:482–499  ·  view source on GitHub ↗

Rollback a table to a specific snapshot.

(
        &self,
        identifier: &Identifier,
        snapshot_id: i64,
    )

Source from the content-addressed store, hash-verified

480
481 /// Rollback a table to a specific snapshot.
482 pub async fn rollback_to_snapshot(
483 &self,
484 identifier: &Identifier,
485 snapshot_id: i64,
486 ) -> Result<()> {
487 let database = identifier.database();
488 let table = identifier.object();
489 validate_non_empty_multi(&[(database, "database name"), (table, "table name")])?;
490 let path = self.resource_paths.rollback(database, table);
491 let request = serde_json::json!({
492 "instant": {
493 "type": "snapshot",
494 "snapshotId": snapshot_id,
495 }
496 });
497 let _resp: serde_json::Value = self.client.post(&path, &request).await?;
498 Ok(())
499 }
500
501 /// Rollback a table to a specific tag.
502 pub async fn rollback_to_tag(&self, identifier: &Identifier, tag_name: &str) -> Result<()> {

Callers 2

proc_rollback_toFunction · 0.80

Calls 5

validate_non_empty_multiFunction · 0.85
objectMethod · 0.80
rollbackMethod · 0.80
postMethod · 0.80
databaseMethod · 0.45

Tested by

no test coverage detected