api for specifying update state for activate() and voteToHalt()
diff --git a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/Vertex.java b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/Vertex.java
index a42b411..8135479 100644
--- a/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/Vertex.java
+++ b/pregelix/pregelix-api/src/main/java/edu/uci/ics/pregelix/api/graph/Vertex.java
@@ -234,19 +234,44 @@
/**
* Vote to halt. Once all vertex vote to halt and no more messages, a
* Pregelix job will terminate.
+ *
+ * The state of the current vertex value is saved.
*/
public final void voteToHalt() {
halt = true;
updated = true;
}
+
+ /**
+ * Vote to halt. Once all vertex vote to halt and no more messages, a
+ * Pregelix job will terminate.
+ *
+ * @param update whether or not to save the vertex value
+ */
+ public final void voteToHalt(boolean update) {
+ halt = true;
+ updated = update;
+ }
/**
* Activate a halted vertex such that it is alive again.
+ *
+ * The state of the current vertex value is saved.
*/
public final void activate() {
halt = false;
updated = true;
}
+
+ /**
+ * Activate a halted vertex such that it is alive again.
+ *
+ * @param update whether or not to save the vertex value
+ */
+ public final void activate(boolean update) {
+ halt = false;
+ updated = update;
+ }
/**
* @return the vertex is halted (true) or not (false)