jojochuang commented on code in PR #7034: URL: https://github.com/apache/ozone/pull/7034#discussion_r1707565187
########## hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/helpers/ChunkUtils.java: ########## @@ -91,10 +90,29 @@ public final class ChunkUtils { StandardOpenOption.READ )); public static final FileAttribute<?>[] NO_ATTRIBUTES = {}; + public static final int DEFAULT_FILE_LOCK_STRIPED_SIZE = 2048; + private static Striped<ReadWriteLock> fileStripedLock = + Striped.readWriteLock(DEFAULT_FILE_LOCK_STRIPED_SIZE); /** Never constructed. **/ private ChunkUtils() { + } + + @VisibleForTesting + public static void setStripedLock(Striped<ReadWriteLock> stripedLock) { + fileStripedLock = stripedLock; + } + + private static ReadWriteLock getFileLock(Path filePath) { + return fileStripedLock.get(filePath); Review Comment: Striped.get() is based on the object's has code. Two Path objects with the same value will be equal. -- 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: issues-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org