Refactoring datastore package
Preparation to make datastore replacable
- Extract datastore interfaces
- Add multi Read/Write/Remove
- Add a method to walk over RCTable
- Refactor serialize/deserialize RCObject
- Localize dependency to JRAMCloud
- Separate RAMCloud specific code into ramcloud package
- Remove dependency to RAMCloud exception classes
- Remove RC prefix from non RAMCloud specific code
- Cosmetics and update sample/test code
- reflect Naoki's comment
- more cosmetic fixes
- reordered OPERATION enums
- removed no longer used code
- follow pmd, etc. where easily possible
Change-Id: I6f9153d705600447acf48a64f713c654c9f26713
diff --git a/src/main/java/net/onrc/onos/datastore/internal/IModifiableMultiEntryOperation.java b/src/main/java/net/onrc/onos/datastore/internal/IModifiableMultiEntryOperation.java
new file mode 100644
index 0000000..8a23330
--- /dev/null
+++ b/src/main/java/net/onrc/onos/datastore/internal/IModifiableMultiEntryOperation.java
@@ -0,0 +1,44 @@
+package net.onrc.onos.datastore.internal;
+
+import net.onrc.onos.datastore.IMultiEntryOperation;
+
+/**
+ * Interface for backend to realize IMultiEntryOperation.
+ *
+ * Backend implementation must use these interfaces to update IMultiEntryOperation
+ * in order to support KVObject.
+ */
+public interface IModifiableMultiEntryOperation extends IMultiEntryOperation {
+
+ /**
+ * Set value and version.
+ *
+ * Expected to be called on multiRead implementations.
+ * @param value
+ * @param version
+ */
+ public void setValue(final byte[] value, final long version);
+
+ /**
+ * Update version of the value.
+ *
+ * Expected to be called on multiWrite, multiRead implementations.
+ * @param version
+ */
+ public void setVersion(long version);
+
+ /**
+ * Update status.
+ *
+ * Backend implementation is expected to update to SUCCESS or FAILED after
+ * datastore operation.
+ * @param status
+ */
+ public void setStatus(STATUS status);
+
+ /**
+ * Return actual IModifiableMultiEntryOperation if is a wrapper, this otherwise.
+ * @return actual IModifiableMultiEntryOperation directly interact with data store
+ */
+ public IModifiableMultiEntryOperation getActualOperation();
+}