ibessonov commented on code in PR #1505:
URL: https://github.com/apache/ignite-3/pull/1505#discussion_r1065500751
##########
modules/storage-rocksdb/src/main/java/org/apache/ignite/internal/storage/rocksdb/RocksDbMvPartitionStorage.java:
##########
@@ -134,14 +137,14 @@ public class RocksDbMvPartitionStorage implements
MvPartitionStorage {
/** Thread-local direct buffer instance to read keys from RocksDB. */
private static final ThreadLocal<ByteBuffer> MV_KEY_BUFFER =
withInitial(() -> allocateDirect(MAX_KEY_SIZE).order(KEY_BYTE_ORDER));
- /** Thread-local write batch for {@link #runConsistently(WriteClosure)}. */
- private static final ThreadLocal<WriteBatchWithIndex> WRITE_BATCH = new
ThreadLocal<>();
-
/** Thread-local on-heap byte buffer instance to use for key
manipulations. */
private static final ThreadLocal<ByteBuffer> HEAP_KEY_BUFFER = withInitial(
() -> ByteBuffer.allocate(MAX_KEY_SIZE).order(KEY_BYTE_ORDER)
);
+ /** Thread-local write batch for {@link #runConsistently(WriteClosure)}. */
+ private final ThreadLocal<WriteBatchWithIndex> threadLocalWriteBatch = new
ThreadLocal<>();
Review Comment:
static would not allow us to operate with multiple partitions from the same
thread. No one would do that, but technically non-static field is a correct
solution here
--
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]