Review Board 1.7.22


fix for 4485

Review Request #2481 - Created Oct. 20, 2011 and updated

Amitanand Aiyer
0.92
hbase-4485
Reviewers
amitanand, jgray, kannanm, karthik.ranga, lhofhansl, nspiegelberg, stack, tedyu
hbase-git
Part of the 2856 diff split into 3 parts for easier review

The first part is v6 of the patch submitted to:
https://reviews.apache.org/r/2224/

This is the fix for HBase-4485


running mvn test with all 3 patches together.

Diff revision 1

This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.

1 2 3 4
1 2 3 4

  1. src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java: Loading...
  2. src/main/java/org/apache/hadoop/hbase/regionserver/Store.java: Loading...
  3. src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java: Loading...
src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java
Revision 34263e4 New Change
[20] 638 lines
[+20] [+] protected class MemStoreScanner extends NonLazyKeyValueScanner {
639

    
   
639

   
640
    // iterator based scanning.
640
    // iterator based scanning.
641
    private Iterator<KeyValue> kvsetIt;
641
    private Iterator<KeyValue> kvsetIt;
642
    private Iterator<KeyValue> snapshotIt;
642
    private Iterator<KeyValue> snapshotIt;
643

    
   
643

   

    
   
644
    // The kvset and snapshot at the time of creating this scanner

    
   
645
    volatile KeyValueSkipListSet kvsetAtCreation;

    
   
646
    volatile KeyValueSkipListSet snapshotAtCreation;

    
   
647

   
644
    // Sub lists on which we're iterating
648
    // Sub lists on which we're iterating
645
    private SortedSet<KeyValue> kvTail;
649
    private SortedSet<KeyValue> kvTail;
646
    private SortedSet<KeyValue> snapshotTail;
650
    private SortedSet<KeyValue> snapshotTail;
647

    
   
651

   
648
    // the pre-calculated KeyValue to be returned by peek() or next()
652
    // the pre-calculated KeyValue to be returned by peek() or next()
[+20] [20] 20 lines
[+20] protected class MemStoreScanner extends NonLazyKeyValueScanner {
669
      the adds to kvset in the MemStoreScanner.
673
      the adds to kvset in the MemStoreScanner.
670
    */
674
    */
671

    
   
675

   
672
    MemStoreScanner() {
676
    MemStoreScanner() {
673
      super();
677
      super();

    
   
678

   

    
   
679
      kvsetAtCreation = kvset;

    
   
680
      snapshotAtCreation = snapshot;
674
    }
681
    }
675

    
   
682

   
676
    protected KeyValue getNext(Iterator<KeyValue> it) {
683
    protected KeyValue getNext(Iterator<KeyValue> it) {
677
      long readPoint = ReadWriteConsistencyControl.getThreadReadPoint();
684
      long readPoint = ReadWriteConsistencyControl.getThreadReadPoint();
678

    
   
685

   
[+20] [20] 21 lines
[+20] [+] public synchronized boolean seek(KeyValue key) {
700
        return false;
707
        return false;
701
      }
708
      }
702

    
   
709

   
703
      // kvset and snapshot will never be null.
710
      // kvset and snapshot will never be null.
704
      // if tailSet can't find anything, SortedSet is empty (not null).
711
      // if tailSet can't find anything, SortedSet is empty (not null).
705
      kvTail = kvset.tailSet(key);
712
      kvTail = kvsetAtCreation.tailSet(key);
706
      snapshotTail = snapshot.tailSet(key);
713
      snapshotTail = snapshotAtCreation.tailSet(key);
707

    
   
714

   
708
      return seekInSubLists(key);
715
      return seekInSubLists(key);
709
    }
716
    }
710

    
   
717

   
711

    
   
718

   
[+20] [20] 194 lines
src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
Revision 7761c42 New Change
 
src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
Revision f5b5c4c New Change
 
  1. src/main/java/org/apache/hadoop/hbase/regionserver/MemStore.java: Loading...
  2. src/main/java/org/apache/hadoop/hbase/regionserver/Store.java: Loading...
  3. src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java: Loading...