szetszwo commented on code in PR #4424:
URL: https://github.com/apache/ozone/pull/4424#discussion_r1147943711
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBBatchOperation.java:
##########
@@ -18,18 +18,225 @@
*/
package org.apache.hadoop.hdds.utils.db;
+import com.google.common.base.Preconditions;
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.StringUtils;
+import org.apache.ratis.util.TraditionalBinaryPrefix;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Supplier;
/**
* Batch operation implementation for rocks db.
*/
public class RDBBatchOperation implements BatchOperation {
Review Comment:
Hey, `org.rocksdb.WriteBatch` itself is not thread safe, see
https://github.com/facebook/rocksdb/wiki/Basic-Operations
> However other objects (like Iterator and WriteBatch) may require external
synchronization. If two threads share such an object, they must protect access
to it using their own locking protocol.
Indeed, making a *batch* operation thread safe does not sound right since a
batch is supposed to be sequential. Making it thread safe decreases the
performance.
--
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]