Apache9 commented on a change in pull request #1737:
URL: https://github.com/apache/hbase/pull/1737#discussion_r429532144



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/SequenceIdAccounting.java
##########
@@ -440,27 +440,27 @@ boolean areAllLower(Map<byte[], Long> sequenceids, 
Collection<byte[]> keysBlocki
    * {@link #lowestUnflushedSequenceIds} has a sequence id less than that 
passed in
    * <code>sequenceids</code> then return it.
    * @param sequenceids Sequenceids keyed by encoded region name.
-   * @return regions found in this instance with sequence ids less than those 
passed in.
+   * @return stores of regions found in this instance with sequence ids less 
than those passed in.
    */
-  byte[][] findLower(Map<byte[], Long> sequenceids) {
-    List<byte[]> toFlush = null;
+  Map<byte[], List<byte[]>> findLower(Map<byte[], Long> sequenceids) {
+    Map<byte[], List<byte[]>> toFlush = null;
     // Keeping the old behavior of iterating unflushedSeqNums under 
oldestSeqNumsLock.
     synchronized (tieLock) {
       for (Map.Entry<byte[], Long> e : sequenceids.entrySet()) {
         Map<ImmutableByteArray, Long> m = 
this.lowestUnflushedSequenceIds.get(e.getKey());
         if (m == null) {
           continue;
         }
-        // The lowest sequence id outstanding for this region.
-        long lowest = getLowestSequenceId(m);
-        if (lowest != HConstants.NO_SEQNUM && lowest <= e.getValue()) {
-          if (toFlush == null) {
-            toFlush = new ArrayList<>();
+        for (Map.Entry<ImmutableByteArray, Long> me : m.entrySet()) {
+          if (me.getValue() <= e.getValue()) {
+            if (toFlush == null) {
+              toFlush = new HashMap<>();

Review comment:
       Better use a TreeMap with BytesComparator?

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/LogRoller.java
##########
@@ -59,7 +61,7 @@ protected void scheduleFlush(String encodedRegionName) {
       return;
     }
     // force flushing all stores to clean old logs

Review comment:
       Change the 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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to