sashapolo commented on code in PR #4200:
URL: https://github.com/apache/ignite-3/pull/4200#discussion_r1719432866


##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbMvPartitionStorage.java:
##########
@@ -116,9 +136,17 @@
  */
 public class RocksDbMvPartitionStorage implements MvPartitionStorage {
     /** Thread-local on-heap byte buffer instance to use for key 
manipulations. */
-    private static final ThreadLocal<ByteBuffer> HEAP_KEY_BUFFER = 
withInitial(() -> allocate(MAX_KEY_SIZE).order(KEY_BYTE_ORDER));
+    private static final ThreadLocal<ByteBuffer> 
HEAP_COMMITTED_DATA_ID_KEY_BUFFER =
+            withInitial(() -> allocate(MAX_KEY_SIZE).order(KEY_BYTE_ORDER));
 
-    private static final ThreadLocal<ByteBuffer> DIRECT_KEY_BUFFER = 
withInitial(() -> allocateDirect(MAX_KEY_SIZE).order(KEY_BYTE_ORDER));
+    private static final ThreadLocal<ByteBuffer> HEAP_DATA_ID_KEY_BUFFER =
+            withInitial(() -> allocate(ROW_PREFIX_SIZE).order(KEY_BYTE_ORDER));
+
+    private static final ThreadLocal<ByteBuffer> DIRECT_DATA_ID_KEY_BUFFER =

Review Comment:
   > we have exactly the same buffers here and in GarbageCollector, is it 
intentional? We can't reuse them?
   
   Sometimes it's possible, sometimes it's not, because GC methods can be 
called from the Partition Storage code. It makes it tricky to always remember 
which buffers can be used by which components (e.g. GC can overwrite a buffer 
that Partition Storage was using). I prefer to fully encapsulate these buffers 
and not to share state between two components.
   
   > And in GC we have javadocs for buffers, let's add javadocs here?
   
   Sure



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

Reply via email to