aboutsummaryrefslogtreecommitdiff
path: root/src/table
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-21 17:18:16 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-21 17:18:16 +0200
commit10c886111e304a53be24b29194f2127d91121929 (patch)
treebd61e98beeccfe338c1ae41a8c1322493f618dd2 /src/table
parent14337d2a561887b94ea165727dd49263717cb478 (diff)
downloadgarage-10c886111e304a53be24b29194f2127d91121929.tar.gz
garage-10c886111e304a53be24b29194f2127d91121929.zip
Rename things, garage worker list cmd
Diffstat (limited to 'src/table')
-rw-r--r--src/table/gc.rs11
-rw-r--r--src/table/merkle.rs11
-rw-r--r--src/table/sync.rs11
3 files changed, 30 insertions, 3 deletions
diff --git a/src/table/gc.rs b/src/table/gc.rs
index 36124c2f..d088a11c 100644
--- a/src/table/gc.rs
+++ b/src/table/gc.rs
@@ -332,7 +332,16 @@ where
R: TableReplication + 'static,
{
fn name(&self) -> String {
- format!("Table GC: {}", F::TABLE_NAME)
+ format!("{} GC", F::TABLE_NAME)
+ }
+
+ fn info(&self) -> Option<String> {
+ let l = self.gc.data.gc_todo_len().unwrap_or(0);
+ if l > 0 {
+ Some(format!("{} items in queue", l))
+ } else {
+ None
+ }
}
async fn work(
diff --git a/src/table/merkle.rs b/src/table/merkle.rs
index d4d2717f..06d131cb 100644
--- a/src/table/merkle.rs
+++ b/src/table/merkle.rs
@@ -310,7 +310,16 @@ where
R: TableReplication + 'static,
{
fn name(&self) -> String {
- format!("Merkle tree updater: {}", F::TABLE_NAME)
+ format!("{} Merkle tree updater", F::TABLE_NAME)
+ }
+
+ fn info(&self) -> Option<String> {
+ let l = self.0.todo_len().unwrap_or(0);
+ if l > 0 {
+ Some(format!("{} items in queue", l))
+ } else {
+ None
+ }
}
async fn work(
diff --git a/src/table/sync.rs b/src/table/sync.rs
index be081d96..bdf88782 100644
--- a/src/table/sync.rs
+++ b/src/table/sync.rs
@@ -574,7 +574,16 @@ impl<F: TableSchema + 'static, R: TableReplication + 'static> SyncWorker<F, R> {
#[async_trait]
impl<F: TableSchema + 'static, R: TableReplication + 'static> Worker for SyncWorker<F, R> {
fn name(&self) -> String {
- format!("Table sync worker for {}", F::TABLE_NAME)
+ format!("{} sync", F::TABLE_NAME)
+ }
+
+ fn info(&self) -> Option<String> {
+ let l = self.todo.len();
+ if l > 0 {
+ Some(format!("{} partitions remaining", l))
+ } else {
+ None
+ }
}
async fn work(&mut self, must_exit: &mut watch::Receiver<bool>) -> Result<WorkerStatus, Error> {