-
Notifications
You must be signed in to change notification settings - Fork 997
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node, store: Expose migrating and remapping schemas in graphman
- Loading branch information
Showing
5 changed files
with
78 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use std::time::Instant; | ||
|
||
use graph::prelude::anyhow; | ||
use graph_store_postgres::connection_pool::PoolCoordinator; | ||
|
||
pub async fn remap(coord: &PoolCoordinator) -> Result<(), anyhow::Error> { | ||
let pools = coord.pools(); | ||
let servers = coord.servers(); | ||
|
||
for server in servers.iter() { | ||
for pool in pools.iter() { | ||
let start = Instant::now(); | ||
print!( | ||
"Remapping imports from {} in shard {}", | ||
server.shard, pool.shard | ||
); | ||
pool.remap(server)?; | ||
println!(" (done in {}s)", start.elapsed().as_secs()); | ||
} | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters