ramkrish86 commented on a change in pull request #939: HBASE-23349 : Notify 
readers if archival of compacted store files is stuck due to scanners
URL: https://github.com/apache/hbase/pull/939#discussion_r358170559
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
 ##########
 @@ -934,6 +950,39 @@ public void updateReaders(List<HStoreFile> sfs, 
List<KeyValueScanner> memStoreSc
     // Let the next() call handle re-creating and seeking
   }
 
+  // Implementation of ChangedReadersObserver
+  // reset current scanners
+  @Override
+  public void updateReaders(List<HStoreFile> storeFiles) throws IOException {
+    if (CollectionUtils.isEmpty(storeFiles)) {
+      return;
+    }
+    try {
+      if (this.closing) {
+        if (LOG.isDebugEnabled()) {
+          LOG.debug("StoreScanner already closing. There is no need to 
re-create scanners");
+        }
+        return;
+      }
+      SCANNER_RESET_LOCK.lock();
+      // let next(), seek() take care of resetting scanners
+      this.scannersToBeReset = true;
+      final boolean usePRead = get || scanUsePread;
+      final boolean isCompaction = false;
+      final boolean includeMemstoreScanner = false;
+      List<KeyValueScanner> scanners = store.getScanners(storeFiles, 
cacheBlocks, get, usePRead,
 
 Review comment:
   Shall we unify the code in both updateReaders? also the reopenCode- if not 
it will lead to duplicate code and logic is almost similar? 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to