hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r791923 - in /hadoop/hbase/trunk: CHANGES.txt src/java/org/apache/hadoop/hbase/regionserver/Store.java src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
Date Tue, 07 Jul 2009 18:09:50 GMT
Author: stack
Date: Tue Jul  7 18:09:50 2009
New Revision: 791923

URL: http://svn.apache.org/viewvc?rev=791923&view=rev
Log:
HBASE-1620 Need to use special StoreScanner constructor for major compactions (passed sf,
no caching, etc)

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Store.java
    hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=791923&r1=791922&r2=791923&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Tue Jul  7 18:09:50 2009
@@ -443,6 +443,8 @@
    HBASE-1218  Implement in-memory column (Jon Gray via Stack)
    HBASE-1606  Remove zoo.cfg, put config options into hbase-site.xml
    HBASE-1575  HMaster does not handle ZK session expiration
+   HBASE-1620  Need to use special StoreScanner constructor for major compactions
+               (passed sf, no caching, etc) (Jon Gray via Stack)
 
   OPTIMIZATIONS
    HBASE-1412  Change values for delete column and column family in KeyValue

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=791923&r1=791922&r2=791923&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Store.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/Store.java Tue Jul  7
18:09:50 2009
@@ -859,8 +859,7 @@
       try {
         Scan scan = new Scan();
         scan.setMaxVersions(family.getMaxVersions());
-        // TODO pass in the scanners/store files.
-        scanner = new StoreScanner(this, scan, null);
+        scanner = new StoreScanner(this, scan, scanners);
 
         // since scanner.next() can return 'false' but still be delivering data,
         // we have to use a do/while loop.

Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java?rev=791923&r1=791922&r2=791923&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java Tue
Jul  7 18:09:50 2009
@@ -70,6 +70,26 @@
     this.store.addChangedReaderObserver(this);
   }
 
+  /**
+   * Used for major compactions.<p>
+   * 
+   * Opens a scanner across specified StoreFiles.
+   */
+  StoreScanner(Store store, Scan scan, KeyValueScanner [] scanners) {
+    this.store = store;
+    matcher = new ScanQueryMatcher(scan, store.getFamily().getName(),
+        null, store.ttl, store.comparator.getRawComparator(),
+        store.versionsToReturn(scan.getMaxVersions()));
+
+    // Seek all scanners to the initial key
+    for(KeyValueScanner scanner : scanners) {
+      scanner.seek(matcher.getStartKey());
+    }
+
+    // Combine all seeked scanners with a heap
+    heap = new KeyValueHeap(scanners, store.comparator);
+  }
+
   // Constructor for testing.
   StoreScanner(final Scan scan, final byte [] colFamily, final long ttl,
       final KeyValue.KVComparator comparator,



Mime
View raw message