bsglz commented on a change in pull request #2202:
URL: https://github.com/apache/hbase/pull/2202#discussion_r468348209



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java
##########
@@ -872,6 +874,33 @@ private IOException 
convertInterruptedExceptionToIOException(final InterruptedEx
     }
   }
 
+  public void archive(RegionServerServices services) throws IOException{
+    if (getNumRolledLogFiles() < 1) {
+      return;
+    }
+    // get the earliest log of this WAL instance
+    Map.Entry<Path, WalProps> firstWALEntry = this.walFile2Props.firstEntry();
+    // flush reigons if necessary
+    Map<byte[], List<byte[]>> regions =
+      
this.sequenceIdAccounting.findLower(firstWALEntry.getValue().encodedName2HighestSequenceId);
+    if (regions != null) {
+      for (Map.Entry<byte[], List<byte[]>> entry : regions.entrySet()) {
+        String encodedRegionName = Bytes.toString(entry.getKey());
+        HRegion r = (HRegion) services.getRegion(encodedRegionName);
+        if (r == null) {
+          LOG.warn("Failed to flush of {} when archive manually, because it is 
not online on us",
+            encodedRegionName);
+          return;

Review comment:
       Or throw an Exception to notice client?




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to