swamirishi commented on code in PR #9555:
URL: https://github.com/apache/ozone/pull/9555#discussion_r2649468124
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBBatchOperation.java:
##########
@@ -135,6 +132,118 @@ public String toString() {
}
}
+ private abstract static class Op implements Closeable {
+
+ private Op() {
+ }
+
+ abstract void apply(ColumnFamily family, ManagedWriteBatch batch) throws
RocksDatabaseException;
+
+ abstract int keyLen();
+
+ int valLen() {
+ return 0;
+ }
+
+ int totalLength() {
+ return keyLen() + valLen();
+ }
+
+ @Override
+ public void close() {
+ }
+ }
+
+ /**
+ * Delete operation to be applied to a {@link ColumnFamily} batch.
+ */
+ private static final class DeleteOp extends Op {
+ private final byte[] key;
+
+ private DeleteOp(byte[] key) {
+ super();
+ this.key = Objects.requireNonNull(key, "key == null");
+ }
+
+ @Override
+ public void apply(ColumnFamily family, ManagedWriteBatch batch) throws
RocksDatabaseException {
+ family.batchDelete(batch, this.key);
+ }
+
+ @Override
+ public int keyLen() {
+ return key.length;
+ }
+ }
+
+ /**
+ * Put operation to be applied to a {@link ColumnFamily} batch using the
CodecBuffer api.
+ */
+ private final class CodecBufferPutOp extends Op {
Review Comment:
I would rename this in the next patch
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]