summaryrefslogtreecommitdiffstats
path: root/clustercontroller-reindexer
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-11-09 11:55:35 +0100
committerJon Marius Venstad <venstad@gmail.com>2020-11-09 11:55:35 +0100
commit215d8a7a446a37d74be3900061d4488a662b54cb (patch)
treebfd94bc65c8bb947cc2e99236717071d08d04961 /clustercontroller-reindexer
parentc662ac1850acc7f6d1dc61ef30592908f1d510c0 (diff)
Add some commeents about synchronisation in Reindexer
Diffstat (limited to 'clustercontroller-reindexer')
-rw-r--r--clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java b/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java
index cb22e209f19..9e7e2880036 100644
--- a/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java
+++ b/clustercontroller-reindexer/src/main/java/ai/vespa/reindexing/Reindexer.java
@@ -63,9 +63,9 @@ public class Reindexer {
this.clock = clock;
}
- /** Tells this to stop reindexing at its leisure. */
+ /** Lets the reindexere abort any ongoing visit session, wait for it to complete normally, then exit. */
public void shutdown() {
- phaser.forceTermination();
+ phaser.forceTermination(); // All parties waiting on this phaser are immediately allowed to proceed.
}
/** Starts and tracks reprocessing of ready document types until done, or interrupted. */
@@ -129,7 +129,7 @@ public class Reindexer {
@Override
public void onDone(CompletionCode code, String message) {
super.onDone(code, message);
- phaser.arriveAndAwaitAdvance();
+ phaser.arriveAndAwaitAdvance(); // Synchronize with the reindex thread.
}
};
visit(type, status.progress().orElse(null), control);
@@ -164,8 +164,8 @@ public class Reindexer {
throw new IllegalStateException(e);
}
- // Wait until done, or shut down, in which case we abort the visit and wait for it to complete.
- phaser.arriveAndAwaitAdvance();
+ // Wait until done; or until termination is forced, in which case we abort the visit and wait for it to complete.
+ phaser.arriveAndAwaitAdvance(); // Synchronize with the visitor completion thread.
session.destroy();
}
@@ -177,7 +177,7 @@ public class Reindexer {
parameters.setPriority(DocumentProtocol.Priority.LOW_1);
parameters.setRoute(cluster.route());
parameters.setBucketSpace(cluster.bucketSpaceOf(type));
- // parameters.setVisitorLibrary("ReindexVisitor");
+ // parameters.setVisitorLibrary("ReindexVisitor"); // TODO jonmv: Use when ready, or perhaps an argument to the DumpVisitor is enough?
return parameters;
}