ascherbakoff commented on code in PR #5096: URL: https://github.com/apache/ignite-3/pull/5096#discussion_r1928511876
########## modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java: ########## @@ -80,66 +78,35 @@ * <p>Additionally limits the lock map size. */ public class HeapLockManager extends AbstractEventProducer<LockEvent, LockEventParameters> implements LockManager { - /** Throttled logger. */ - private static final IgniteLogger THROTTLED_LOG = Loggers.toThrottledLogger( - Loggers.forClass(HeapLockManager.class), - // TODO: IGNITE-24181 Get rid of Common thread pool. - ForkJoinPool.commonPool() - ); - - /** - * Table size. - */ + /** Table size. */ public static final int DEFAULT_SLOTS = 1_048_576; private static final String LOCK_MAP_SIZE_PROPERTY_NAME = "lockMapSize"; - private static final String RAW_SLOTS_MAX_SIZE_PROPERTY_NAME = "rawSlotsMaxSize"; - - /** - * Striped lock concurrency. - */ + /** Striped lock concurrency. */ private static final int CONCURRENCY = Math.max(1, Runtime.getRuntime().availableProcessors() / 2); - /** Lock map size. */ - private final int lockMapSize; + private final AtomicInteger lockTableSize = new AtomicInteger(); - /** Raw slots size. */ - private final int rawSlotsMaxSize; + /** An unused state to avoid concurrent allocation. */ + private LockState removedLockState; Review Comment: Why it's not static ? ########## modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItLockTableTest.java: ########## @@ -184,7 +184,7 @@ public void testCollision() { RecordView<Tuple> view = testTable.recordView(); int i = 0; - final int count = 1000; + final int count = 100; Review Comment: Collisions no longer possible. What is this test for ? ########## modules/transactions/src/main/java/org/apache/ignite/internal/tx/impl/HeapLockManager.java: ########## @@ -80,66 +78,35 @@ * <p>Additionally limits the lock map size. */ public class HeapLockManager extends AbstractEventProducer<LockEvent, LockEventParameters> implements LockManager { - /** Throttled logger. */ - private static final IgniteLogger THROTTLED_LOG = Loggers.toThrottledLogger( - Loggers.forClass(HeapLockManager.class), - // TODO: IGNITE-24181 Get rid of Common thread pool. - ForkJoinPool.commonPool() - ); - - /** - * Table size. - */ + /** Table size. */ public static final int DEFAULT_SLOTS = 1_048_576; private static final String LOCK_MAP_SIZE_PROPERTY_NAME = "lockMapSize"; - private static final String RAW_SLOTS_MAX_SIZE_PROPERTY_NAME = "rawSlotsMaxSize"; - - /** - * Striped lock concurrency. - */ + /** Striped lock concurrency. */ private static final int CONCURRENCY = Math.max(1, Runtime.getRuntime().availableProcessors() / 2); - /** Lock map size. */ - private final int lockMapSize; + private final AtomicInteger lockTableSize = new AtomicInteger(); Review Comment: Use LongAdder for approximate counting. -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org