swamirishi commented on code in PR #9549:
URL: https://github.com/apache/ozone/pull/9549#discussion_r2648792824


##########
hadoop-hdds/managed-rocksdb/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedDirectSlice.java:
##########
@@ -17,98 +17,44 @@
 
 package org.apache.hadoop.hdds.utils.db.managed;
 
-import static org.apache.hadoop.hdds.utils.db.managed.ManagedRocksDB.NOT_FOUND;
+import static 
org.apache.hadoop.hdds.utils.db.managed.ManagedRocksObjectUtils.track;
 
-import com.google.common.annotations.VisibleForTesting;
 import java.nio.ByteBuffer;
-import org.apache.hadoop.hdds.utils.db.RocksDatabaseException;
-import org.apache.ratis.util.function.CheckedConsumer;
-import org.apache.ratis.util.function.CheckedFunction;
+import java.util.Objects;
+import org.apache.ratis.util.UncheckedAutoCloseable;
 import org.rocksdb.DirectSlice;
-import org.rocksdb.RocksDBException;
 
 /**
- * ManagedDirectSlice is a managed wrapper around the DirectSlice object. It 
ensures
- * proper handling of native resources associated with DirectSlice, utilizing
- * the ManagedObject infrastructure to prevent resource leaks. It works in 
tandem
- * with a ByteBuffer, which acts as the data source for the managed slice.
+ * Managed {@link DirectSlice} for leak detection.
  *
- * This class overrides certain operations to tightly control the lifecycle and
- * behavior of the DirectSlice it manages. It specifically caters to use cases
- * where the slice is used in RocksDB operations, providing methods for safely
- * interacting with the slice for put-like operations.
+ *  The {@link DirectSlice} class is designed to handle specific memory 
slicing operations while ensuring that the
+ *  provided ByteBuffer’s constraints are respected.
+ *
+ * NOTE: This class should be only with ByteBuffer whose position and limit is 
going be immutable in the lifetime of
+ *  this ManagedDirectSlice instance. This means that the ByteBuffer's 
position and limit should not be modified
+ *  externally while the ManagedDirectSlice is in use.

Review Comment:
   done



-- 
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]

Reply via email to