You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2013/01/11 08:05:21 UTC

svn commit: r1431916 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java

Author: stack
Date: Fri Jan 11 07:05:21 2013
New Revision: 1431916

URL: http://svn.apache.org/viewvc?rev=1431916&view=rev
Log:
HBASE-7387 StoreScanner need to be able to be subclassed

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java?rev=1431916&r1=1431915&r2=1431916&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java Fri Jan 11 07:05:21 2013
@@ -44,38 +44,38 @@ import org.apache.hadoop.hbase.util.Envi
 public class StoreScanner extends NonLazyKeyValueScanner
     implements KeyValueScanner, InternalScanner, ChangedReadersObserver {
   static final Log LOG = LogFactory.getLog(StoreScanner.class);
-  private HStore store;
-  private ScanQueryMatcher matcher;
-  private KeyValueHeap heap;
-  private boolean cacheBlocks;
-
-  private int countPerRow = 0;
-  private int storeLimit = -1;
-  private int storeOffset = 0;
+  protected HStore store;
+  protected ScanQueryMatcher matcher;
+  protected KeyValueHeap heap;
+  protected boolean cacheBlocks;
+
+  protected int countPerRow = 0;
+  protected int storeLimit = -1;
+  protected int storeOffset = 0;
 
   // Used to indicate that the scanner has closed (see HBASE-1107)
   // Doesnt need to be volatile because it's always accessed via synchronized methods
-  private boolean closing = false;
-  private final boolean isGet;
-  private final boolean explicitColumnQuery;
-  private final boolean useRowColBloom;
-  private final Scan scan;
-  private final NavigableSet<byte[]> columns;
-  private final long oldestUnexpiredTS;
-  private final int minVersions;
+  protected boolean closing = false;
+  protected final boolean isGet;
+  protected final boolean explicitColumnQuery;
+  protected final boolean useRowColBloom;
+  protected final Scan scan;
+  protected final NavigableSet<byte[]> columns;
+  protected final long oldestUnexpiredTS;
+  protected final int minVersions;
 
   /** We don't ever expect to change this, the constant is just for clarity. */
   static final boolean LAZY_SEEK_ENABLED_BY_DEFAULT = true;
 
   /** Used during unit testing to ensure that lazy seek does save seek ops */
-  private static boolean lazySeekEnabledGlobally =
+  protected static boolean lazySeekEnabledGlobally =
       LAZY_SEEK_ENABLED_BY_DEFAULT;
 
   // if heap == null and lastTop != null, you need to reseek given the key below
-  private KeyValue lastTop = null;
+  protected KeyValue lastTop = null;
 
   /** An internal constructor. */
-  private StoreScanner(HStore store, boolean cacheBlocks, Scan scan,
+  protected StoreScanner(HStore store, boolean cacheBlocks, Scan scan,
       final NavigableSet<byte[]> columns, long ttl, int minVersions) {
     this.store = store;
     this.cacheBlocks = cacheBlocks;
@@ -203,7 +203,7 @@ public class StoreScanner extends NonLaz
    * Get a filtered list of scanners. Assumes we are not in a compaction.
    * @return list of scanners to seek
    */
-  private List<KeyValueScanner> getScannersNoCompaction() throws IOException {
+  protected List<KeyValueScanner> getScannersNoCompaction() throws IOException {
     final boolean isCompaction = false;
     return selectScannersFrom(store.getScanners(cacheBlocks, isGet,
         isCompaction, matcher));
@@ -213,7 +213,7 @@ public class StoreScanner extends NonLaz
    * Filters the given list of scanners using Bloom filter, time range, and
    * TTL.
    */
-  private List<KeyValueScanner> selectScannersFrom(
+  protected List<KeyValueScanner> selectScannersFrom(
       final List<? extends KeyValueScanner> allScanners) {
     boolean memOnly;
     boolean filesOnly;
@@ -486,7 +486,7 @@ public class StoreScanner extends NonLaz
    *         next KV)
    * @throws IOException
    */
-  private boolean checkReseek() throws IOException {
+  protected boolean checkReseek() throws IOException {
     if (this.heap == null && this.lastTop != null) {
       resetScannerStack(this.lastTop);
       if (this.heap.peek() == null
@@ -502,7 +502,7 @@ public class StoreScanner extends NonLaz
     return false;
   }
 
-  private void resetScannerStack(KeyValue lastTopKey) throws IOException {
+  protected void resetScannerStack(KeyValue lastTopKey) throws IOException {
     if (heap != null) {
       throw new RuntimeException("StoreScanner.reseek run on an existing heap!");
     }