pradeepbn commented on a change in pull request #2868:
URL: https://github.com/apache/bookkeeper/pull/2868#discussion_r743272475



##########
File path: stream/bk-grpc-name-resolver/build.gradle
##########
@@ -29,6 +29,7 @@ dependencies {
     implementation project(':stream:common')
     implementation depLibs.grpc
     implementation depLibs.slf4j
+    implementation depLibs.log4jSlf4jImpl

Review comment:
       This is moved to separate PR #2877 

##########
File path: bookkeeper-benchmark/build.gradle
##########
@@ -42,6 +42,8 @@ dependencies {
     implementation depLibs.nettyTransportNativeEpoll
     implementation depLibs.zookeeper
     implementation depLibs.log4j12api
+    implementation depLibs.log4jCore

Review comment:
       This is moved to separate PR #2877 

##########
File path: bookkeeper-benchmark/build.gradle
##########
@@ -42,6 +42,8 @@ dependencies {
     implementation depLibs.nettyTransportNativeEpoll
     implementation depLibs.zookeeper
     implementation depLibs.log4j12api
+    implementation depLibs.log4jCore
+    implementation depLibs.log4jSlf4jImpl

Review comment:
       This is moved to separate PR #2877 

##########
File path: 
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/ReadCache.java
##########
@@ -76,18 +82,24 @@ public ReadCache(ByteBufAllocator allocator, long 
maxCacheSize, int maxSegmentSi
             cacheSegments.add(Unpooled.directBuffer(segmentSize, segmentSize));
             cacheIndexes.add(new ConcurrentLongLongPairHashMap(4096, 2 * 
Runtime.getRuntime().availableProcessors()));
         }
+        isStorageShutdown = false;
     }
 
     @Override
     public void close() {
         cacheSegments.forEach(ByteBuf::release);
+        isStorageShutdown = true;
     }
 
-    public void put(long ledgerId, long entryId, ByteBuf entry) {
+    public void put(long ledgerId, long entryId, ByteBuf entry) throws 
IOException {
         int entrySize = entry.readableBytes();
         int alignedSize = align64(entrySize);
 
         lock.readLock().lock();
+        if (isStorageShutdown) {
+            LOG.error("Read cache has shutdown, not allowing put cache 
operation");
+            throw new IOException();

Review comment:
       Makes sense. Changed the logic to reflect this comment.




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