nit0906 commented on code in PR #1734:
URL: https://github.com/apache/jackrabbit-oak/pull/1734#discussion_r1800644024
##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/incrementalstore/IncrementalStoreOperand.java:
##########
@@ -18,10 +18,44 @@
*/
package org.apache.jackrabbit.oak.index.indexer.document.incrementalstore;
+/**
+ * The operation to perform. Operations are generated by either running a
'diff'
+ * , or by 'top up' which is downloading the changes from MongoDB.
+ *
+ * When using the 'diff' command, we expect that the node doesn't exist yet for
+ * the 'add' case, and that the node exists for the 'delete' and 'modify' case
+ * (due to the nature of the 'diff'). The operations are then ADD, DELETE,
+ * MODIFY.
+ *
+ * When using the 'top up', we don't know whether the node existed before or
+ * not; we only get the updated state. That's why we use different operations:
+ * REMOVE_IF_EXISTS and INSERT_OR_UPDATE.
+ */
public enum IncrementalStoreOperand {
+
+ // add a new node;
+ // log a warning if it doesn't exist
+ // (this is used by the 'diff' command)
ADD("A"),
+
+ // delete an existing node;
+ // log a warning if it doesn't exist
+ // (this is used by the 'diff' command)
+ DELETE("D"),
+
+ // modify an existing node;
+ // log a warning if it doesn't exist
+ // (this is used by the 'diff' command)
MODIFY("M"),
- DELETE("D");
+
+ // remove a node that may or may not exist
+ // (this operation may be used by the 'top up' command)
+ REMOVE_IF_EXISTS("R"),
Review Comment:
But do we really need REMOVE_IF_EXISTS then - Is it just to avoid the
warning ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]