swamirishi commented on code in PR #9526:
URL: https://github.com/apache/ozone/pull/9526#discussion_r2642899560
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBBatchOperation.java:
##########
@@ -17,669 +17,44 @@
package org.apache.hadoop.hdds.utils.db;
-import static org.apache.hadoop.hdds.StringUtils.bytes2String;
-
-import com.google.common.base.Preconditions;
-import com.google.common.primitives.UnsignedBytes;
-import java.io.Closeable;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
-import org.apache.commons.lang3.tuple.Pair;
-import org.apache.hadoop.hdds.utils.IOUtils;
import org.apache.hadoop.hdds.utils.db.RocksDatabase.ColumnFamily;
import org.apache.hadoop.hdds.utils.db.managed.ManagedWriteBatch;
import org.apache.hadoop.hdds.utils.db.managed.ManagedWriteOptions;
-import org.apache.ratis.util.TraditionalBinaryPrefix;
-import org.apache.ratis.util.UncheckedAutoCloseable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
- * Batch operation implementation for rocks db.
- * Note that a {@link RDBBatchOperation} object only for one batch.
- * Also, this class is not threadsafe.
+ * Interface for performing batch operations on a RocksDB database.
+ *
+ * Provides methods to perform operations on a specific column family within
+ * a database, such as inserting or deleting a key-value pair or deleting
+ * a range of keys. These batch operations are designed for use in scenarios
+ * where multiple database modifications need to be grouped together, ensuring
+ * efficiency and atomicity.
+ *
+ * This interface extends {@link BatchOperation}, inheriting functionality for
+ * managing batch sizes and allowing cleanup of batch resources via the
+ * {@link #close()} method.
*/
-public final class RDBBatchOperation implements BatchOperation {
- static final Logger LOG = LoggerFactory.getLogger(RDBBatchOperation.class);
+public abstract class RDBBatchOperation implements BatchOperation {
Review Comment:
It can be only abstact classes since interfaces don't allow package private
methods. The methods should not be exposed outside the db package
--
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]