Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 00DF8200C63 for ; Thu, 11 May 2017 16:59:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F37CC160BD5; Thu, 11 May 2017 14:59:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F2382160BCC for ; Thu, 11 May 2017 16:59:27 +0200 (CEST) Received: (qmail 66421 invoked by uid 500); 11 May 2017 14:59:19 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 64953 invoked by uid 99); 11 May 2017 14:59:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 May 2017 14:59:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1BAA2E7DA2; Thu, 11 May 2017 14:59:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: git-site-role@apache.org To: commits@hbase.apache.org Date: Thu, 11 May 2017 14:59:42 -0000 Message-Id: <0cbc0e2f6f9b4b94804f593469ad23e2@git.apache.org> In-Reply-To: <86905630cc794122a7c38263748a012c@git.apache.org> References: <86905630cc794122a7c38263748a012c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [26/51] [partial] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd. archived-at: Thu, 11 May 2017 14:59:30 -0000 http://git-wip-us.apache.org/repos/asf/hbase-site/blob/1241ee85/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/KeyValueScanner.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/KeyValueScanner.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/KeyValueScanner.html index cc7046c..b0c7b40 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/KeyValueScanner.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/KeyValueScanner.html @@ -30,158 +30,165 @@ 022import java.io.IOException; 023 024import org.apache.hadoop.hbase.classification.InterfaceAudience; -025import org.apache.hadoop.hbase.Cell; -026import org.apache.hadoop.hbase.KeyValue; -027import org.apache.hadoop.hbase.client.Scan; -028 -029/** -030 * Scanner that returns the next KeyValue. -031 */ -032@InterfaceAudience.Private -033// TODO: Change name from KeyValueScanner to CellScanner only we already have a simple CellScanner -034// so this should be something else altogether, a decoration on our base CellScanner. TODO. -035// This class shows in CPs so do it all in one swell swoop. HBase-2.0.0. -036public interface KeyValueScanner extends Shipper, Closeable { -037 /** -038 * The byte array represents for NO_NEXT_INDEXED_KEY; -039 * The actual value is irrelevant because this is always compared by reference. -040 */ -041 public static final Cell NO_NEXT_INDEXED_KEY = new KeyValue(); -042 -043 /** -044 * Look at the next Cell in this scanner, but do not iterate scanner. -045 * NOTICE: The returned cell has not been passed into ScanQueryMatcher. So it may not be what the -046 * user need. -047 * @return the next Cell -048 */ -049 Cell peek(); -050 -051 /** -052 * Return the next Cell in this scanner, iterating the scanner -053 * @return the next Cell -054 */ -055 Cell next() throws IOException; -056 -057 /** -058 * Seek the scanner at or after the specified KeyValue. -059 * @param key seek value -060 * @return true if scanner has values left, false if end of scanner -061 */ -062 boolean seek(Cell key) throws IOException; -063 -064 /** -065 * Reseek the scanner at or after the specified KeyValue. -066 * This method is guaranteed to seek at or after the required key only if the -067 * key comes after the current position of the scanner. Should not be used -068 * to seek to a key which may come before the current position. -069 * @param key seek value (should be non-null) -070 * @return true if scanner has values left, false if end of scanner -071 */ -072 boolean reseek(Cell key) throws IOException; -073 -074 /** -075 * Get the order of this KeyValueScanner. This is only relevant for StoreFileScanners and -076 * MemStoreScanners (other scanners simply return 0). This is required for comparing multiple -077 * files to find out which one has the latest data. StoreFileScanners are ordered from 0 -078 * (oldest) to newest in increasing order. MemStoreScanner gets LONG.max since it always -079 * contains freshest data. -080 */ -081 long getScannerOrder(); -082 -083 /** -084 * Close the KeyValue scanner. -085 */ -086 void close(); -087 -088 /** -089 * Allows to filter out scanners (both StoreFile and memstore) that we don't -090 * want to use based on criteria such as Bloom filters and timestamp ranges. -091 * @param scan the scan that we are selecting scanners for -092 * @param store the store we are performing the scan on. -093 * @param oldestUnexpiredTS the oldest timestamp we are interested in for -094 * this query, based on TTL -095 * @return true if the scanner should be included in the query -096 */ -097 boolean shouldUseScanner(Scan scan, Store store, long oldestUnexpiredTS); -098 -099 // "Lazy scanner" optimizations -100 -101 /** -102 * Similar to {@link #seek} (or {@link #reseek} if forward is true) but only -103 * does a seek operation after checking that it is really necessary for the -104 * row/column combination specified by the kv parameter. This function was -105 * added to avoid unnecessary disk seeks by checking row-column Bloom filters -106 * before a seek on multi-column get/scan queries, and to optimize by looking -107 * up more recent files first. -108 * @param forward do a forward-only "reseek" instead of a random-access seek -109 * @param useBloom whether to enable multi-column Bloom filter optimization -110 */ -111 boolean requestSeek(Cell kv, boolean forward, boolean useBloom) -112 throws IOException; -113 -114 /** -115 * We optimize our store scanners by checking the most recent store file -116 * first, so we sometimes pretend we have done a seek but delay it until the -117 * store scanner bubbles up to the top of the key-value heap. This method is -118 * then used to ensure the top store file scanner has done a seek operation. -119 */ -120 boolean realSeekDone(); -121 -122 /** -123 * Does the real seek operation in case it was skipped by -124 * seekToRowCol(KeyValue, boolean) (TODO: Whats this?). Note that this function should -125 * be never called on scanners that always do real seek operations (i.e. most -126 * of the scanners). The easiest way to achieve this is to call -127 * {@link #realSeekDone()} first. -128 */ -129 void enforceSeek() throws IOException; -130 -131 /** -132 * @return true if this is a file scanner. Otherwise a memory scanner is -133 * assumed. -134 */ -135 boolean isFileScanner(); -136 -137 // Support for "Reversed Scanner" +025import org.apache.hadoop.fs.Path; +026import org.apache.hadoop.hbase.Cell; +027import org.apache.hadoop.hbase.KeyValue; +028import org.apache.hadoop.hbase.client.Scan; +029 +030/** +031 * Scanner that returns the next KeyValue. +032 */ +033@InterfaceAudience.Private +034// TODO: Change name from KeyValueScanner to CellScanner only we already have a simple CellScanner +035// so this should be something else altogether, a decoration on our base CellScanner. TODO. +036// This class shows in CPs so do it all in one swell swoop. HBase-2.0.0. +037public interface KeyValueScanner extends Shipper, Closeable { +038 /** +039 * The byte array represents for NO_NEXT_INDEXED_KEY; +040 * The actual value is irrelevant because this is always compared by reference. +041 */ +042 public static final Cell NO_NEXT_INDEXED_KEY = new KeyValue(); +043 +044 /** +045 * Look at the next Cell in this scanner, but do not iterate scanner. +046 * NOTICE: The returned cell has not been passed into ScanQueryMatcher. So it may not be what the +047 * user need. +048 * @return the next Cell +049 */ +050 Cell peek(); +051 +052 /** +053 * Return the next Cell in this scanner, iterating the scanner +054 * @return the next Cell +055 */ +056 Cell next() throws IOException; +057 +058 /** +059 * Seek the scanner at or after the specified KeyValue. +060 * @param key seek value +061 * @return true if scanner has values left, false if end of scanner +062 */ +063 boolean seek(Cell key) throws IOException; +064 +065 /** +066 * Reseek the scanner at or after the specified KeyValue. +067 * This method is guaranteed to seek at or after the required key only if the +068 * key comes after the current position of the scanner. Should not be used +069 * to seek to a key which may come before the current position. +070 * @param key seek value (should be non-null) +071 * @return true if scanner has values left, false if end of scanner +072 */ +073 boolean reseek(Cell key) throws IOException; +074 +075 /** +076 * Get the order of this KeyValueScanner. This is only relevant for StoreFileScanners and +077 * MemStoreScanners (other scanners simply return 0). This is required for comparing multiple +078 * files to find out which one has the latest data. StoreFileScanners are ordered from 0 +079 * (oldest) to newest in increasing order. MemStoreScanner gets LONG.max since it always +080 * contains freshest data. +081 */ +082 long getScannerOrder(); +083 +084 /** +085 * Close the KeyValue scanner. +086 */ +087 void close(); +088 +089 /** +090 * Allows to filter out scanners (both StoreFile and memstore) that we don't +091 * want to use based on criteria such as Bloom filters and timestamp ranges. +092 * @param scan the scan that we are selecting scanners for +093 * @param store the store we are performing the scan on. +094 * @param oldestUnexpiredTS the oldest timestamp we are interested in for +095 * this query, based on TTL +096 * @return true if the scanner should be included in the query +097 */ +098 boolean shouldUseScanner(Scan scan, Store store, long oldestUnexpiredTS); +099 +100 // "Lazy scanner" optimizations +101 +102 /** +103 * Similar to {@link #seek} (or {@link #reseek} if forward is true) but only +104 * does a seek operation after checking that it is really necessary for the +105 * row/column combination specified by the kv parameter. This function was +106 * added to avoid unnecessary disk seeks by checking row-column Bloom filters +107 * before a seek on multi-column get/scan queries, and to optimize by looking +108 * up more recent files first. +109 * @param forward do a forward-only "reseek" instead of a random-access seek +110 * @param useBloom whether to enable multi-column Bloom filter optimization +111 */ +112 boolean requestSeek(Cell kv, boolean forward, boolean useBloom) +113 throws IOException; +114 +115 /** +116 * We optimize our store scanners by checking the most recent store file +117 * first, so we sometimes pretend we have done a seek but delay it until the +118 * store scanner bubbles up to the top of the key-value heap. This method is +119 * then used to ensure the top store file scanner has done a seek operation. +120 */ +121 boolean realSeekDone(); +122 +123 /** +124 * Does the real seek operation in case it was skipped by +125 * seekToRowCol(KeyValue, boolean) (TODO: Whats this?). Note that this function should +126 * be never called on scanners that always do real seek operations (i.e. most +127 * of the scanners). The easiest way to achieve this is to call +128 * {@link #realSeekDone()} first. +129 */ +130 void enforceSeek() throws IOException; +131 +132 /** +133 * @return true if this is a file scanner. Otherwise a memory scanner is +134 * assumed. +135 */ +136 boolean isFileScanner(); +137 138 /** -139 * Seek the scanner at or before the row of specified Cell, it firstly -140 * tries to seek the scanner at or after the specified Cell, return if -141 * peek KeyValue of scanner has the same row with specified Cell, -142 * otherwise seek the scanner at the first Cell of the row which is the -143 * previous row of specified KeyValue -144 * -145 * @param key seek KeyValue -146 * @return true if the scanner is at the valid KeyValue, false if such -147 * KeyValue does not exist -148 * -149 */ -150 public boolean backwardSeek(Cell key) throws IOException; -151 -152 /** -153 * Seek the scanner at the first Cell of the row which is the previous row -154 * of specified key -155 * @param key seek value -156 * @return true if the scanner at the first valid Cell of previous row, -157 * false if not existing such Cell -158 */ -159 public boolean seekToPreviousRow(Cell key) throws IOException; -160 -161 /** -162 * Seek the scanner at the first KeyValue of last row -163 * -164 * @return true if scanner has values left, false if the underlying data is -165 * empty -166 * @throws IOException -167 */ -168 public boolean seekToLastRow() throws IOException; -169 -170 /** -171 * @return the next key in the index, usually the first key of next block OR a key that falls -172 * between last key of current block and first key of next block.. -173 * see HFileWriterImpl#getMidpoint, or null if not known. +139 * @return the file path if this is a file scanner, otherwise null. +140 * @see #isFileScanner() +141 */ +142 Path getFilePath(); +143 +144 // Support for "Reversed Scanner" +145 /** +146 * Seek the scanner at or before the row of specified Cell, it firstly +147 * tries to seek the scanner at or after the specified Cell, return if +148 * peek KeyValue of scanner has the same row with specified Cell, +149 * otherwise seek the scanner at the first Cell of the row which is the +150 * previous row of specified KeyValue +151 * +152 * @param key seek KeyValue +153 * @return true if the scanner is at the valid KeyValue, false if such +154 * KeyValue does not exist +155 * +156 */ +157 public boolean backwardSeek(Cell key) throws IOException; +158 +159 /** +160 * Seek the scanner at the first Cell of the row which is the previous row +161 * of specified key +162 * @param key seek value +163 * @return true if the scanner at the first valid Cell of previous row, +164 * false if not existing such Cell +165 */ +166 public boolean seekToPreviousRow(Cell key) throws IOException; +167 +168 /** +169 * Seek the scanner at the first KeyValue of last row +170 * +171 * @return true if scanner has values left, false if the underlying data is +172 * empty +173 * @throws IOException 174 */ -175 public Cell getNextIndexedKey(); -176} +175 public boolean seekToLastRow() throws IOException; +176 +177 /** +178 * @return the next key in the index, usually the first key of next block OR a key that falls +179 * between last key of current block and first key of next block.. +180 * see HFileWriterImpl#getMidpoint, or null if not known. +181 */ +182 public Cell getNextIndexedKey(); +183} http://git-wip-us.apache.org/repos/asf/hbase-site/blob/1241ee85/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.html index 8cb9d03..da6519a 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.html @@ -30,59 +30,68 @@ 022 023import org.apache.commons.lang.NotImplementedException; 024import org.apache.hadoop.hbase.classification.InterfaceAudience; -025import org.apache.hadoop.hbase.Cell; -026import org.apache.hadoop.hbase.client.Scan; -027 -028/** -029 * A "non-lazy" scanner which always does a real seek operation. Most scanners -030 * are inherited from this class. -031 */ -032@InterfaceAudience.Private -033public abstract class NonLazyKeyValueScanner implements KeyValueScanner { -034 -035 @Override -036 public boolean requestSeek(Cell kv, boolean forward, boolean useBloom) -037 throws IOException { -038 return doRealSeek(this, kv, forward); -039 } -040 -041 @Override -042 public boolean realSeekDone() { -043 return true; -044 } -045 -046 @Override -047 public void enforceSeek() throws IOException { -048 throw new NotImplementedException("enforceSeek must not be called on a " + -049 "non-lazy scanner"); -050 } -051 -052 public static boolean doRealSeek(KeyValueScanner scanner, -053 Cell kv, boolean forward) throws IOException { -054 return forward ? scanner.reseek(kv) : scanner.seek(kv); -055 } -056 -057 @Override -058 public boolean shouldUseScanner(Scan scan, Store store, long oldestUnexpiredTS) { -059 // No optimizations implemented by default. -060 return true; -061 } -062 -063 @Override -064 public boolean isFileScanner() { -065 // Not a file by default. -066 return false; -067 } -068 @Override -069 public Cell getNextIndexedKey() { -070 return null; -071 } -072 -073 @Override -074 public void shipped() throws IOException { -075 // do nothing -076 } -077} +025import org.apache.hadoop.fs.Path; +026import org.apache.hadoop.hbase.Cell; +027import org.apache.hadoop.hbase.client.Scan; +028 +029/** +030 * A "non-lazy" scanner which always does a real seek operation. Most scanners +031 * are inherited from this class. +032 */ +033@InterfaceAudience.Private +034public abstract class NonLazyKeyValueScanner implements KeyValueScanner { +035 +036 @Override +037 public boolean requestSeek(Cell kv, boolean forward, boolean useBloom) +038 throws IOException { +039 return doRealSeek(this, kv, forward); +040 } +041 +042 @Override +043 public boolean realSeekDone() { +044 return true; +045 } +046 +047 @Override +048 public void enforceSeek() throws IOException { +049 throw new NotImplementedException("enforceSeek must not be called on a " + +050 "non-lazy scanner"); +051 } +052 +053 public static boolean doRealSeek(KeyValueScanner scanner, +054 Cell kv, boolean forward) throws IOException { +055 return forward ? scanner.reseek(kv) : scanner.seek(kv); +056 } +057 +058 @Override +059 public boolean shouldUseScanner(Scan scan, Store store, long oldestUnexpiredTS) { +060 // No optimizations implemented by default. +061 return true; +062 } +063 +064 @Override +065 public boolean isFileScanner() { +066 // Not a file by default. +067 return false; +068 } +069 +070 +071 @Override +072 public Path getFilePath() { +073 // Not a file by default. +074 return null; +075 } +076 +077 @Override +078 public Cell getNextIndexedKey() { +079 return null; +080 } +081 +082 @Override +083 public void shipped() throws IOException { +084 // do nothing +085 } +086} http://git-wip-us.apache.org/repos/asf/hbase-site/blob/1241ee85/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/ReversedStoreScanner.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/ReversedStoreScanner.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/ReversedStoreScanner.html index a4e33c3..927ac5c 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/ReversedStoreScanner.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/ReversedStoreScanner.html @@ -131,18 +131,20 @@ 123 124 @Override 125 public boolean seekToPreviousRow(Cell key) throws IOException { -126 boolean flushed = checkFlushed(); -127 checkReseek(flushed); -128 return this.heap.seekToPreviousRow(key); -129 } -130 -131 @Override -132 public boolean backwardSeek(Cell key) throws IOException { -133 boolean flushed = checkFlushed(); -134 checkReseek(flushed); -135 return this.heap.backwardSeek(key); -136 } -137} +126 if (checkFlushed()) { +127 reopenAfterFlush(); +128 } +129 return this.heap.seekToPreviousRow(key); +130 } +131 +132 @Override +133 public boolean backwardSeek(Cell key) throws IOException { +134 if (checkFlushed()) { +135 reopenAfterFlush(); +136 } +137 return this.heap.backwardSeek(key); +138 } +139} http://git-wip-us.apache.org/repos/asf/hbase-site/blob/1241ee85/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/ScanInfo.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/ScanInfo.html b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/ScanInfo.html index 57b3ba8..bd0bb11 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/ScanInfo.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/ScanInfo.html @@ -56,108 +56,115 @@ 048 private boolean usePread; 049 private long cellsPerTimeoutCheck; 050 private boolean parallelSeekEnabled; -051 private final Configuration conf; -052 -053 public static final long FIXED_OVERHEAD = ClassSize.align(ClassSize.OBJECT -054 + (2 * ClassSize.REFERENCE) + (2 * Bytes.SIZEOF_INT) -055 + (4 * Bytes.SIZEOF_LONG) + (3 * Bytes.SIZEOF_BOOLEAN)); -056 -057 /** -058 * @param conf -059 * @param family {@link HColumnDescriptor} describing the column family -060 * @param ttl Store's TTL (in ms) -061 * @param timeToPurgeDeletes duration in ms after which a delete marker can -062 * be purged during a major compaction. -063 * @param comparator The store's comparator -064 */ -065 public ScanInfo(final Configuration conf, final HColumnDescriptor family, final long ttl, -066 final long timeToPurgeDeletes, final CellComparator comparator) { -067 this(conf, family.getName(), family.getMinVersions(), family.getMaxVersions(), ttl, family -068 .getKeepDeletedCells(), timeToPurgeDeletes, comparator); -069 } -070 -071 /** -072 * @param conf -073 * @param family Name of this store's column family -074 * @param minVersions Store's MIN_VERSIONS setting -075 * @param maxVersions Store's VERSIONS setting -076 * @param ttl Store's TTL (in ms) -077 * @param timeToPurgeDeletes duration in ms after which a delete marker can -078 * be purged during a major compaction. -079 * @param keepDeletedCells Store's keepDeletedCells setting -080 * @param comparator The store's comparator -081 */ -082 public ScanInfo(final Configuration conf, final byte[] family, final int minVersions, -083 final int maxVersions, final long ttl, final KeepDeletedCells keepDeletedCells, -084 final long timeToPurgeDeletes, final CellComparator comparator) { -085 this.family = family; -086 this.minVersions = minVersions; -087 this.maxVersions = maxVersions; -088 this.ttl = ttl; -089 this.keepDeletedCells = keepDeletedCells; -090 this.timeToPurgeDeletes = timeToPurgeDeletes; -091 this.comparator = comparator; -092 this.tableMaxRowSize = -093 conf.getLong(HConstants.TABLE_MAX_ROWSIZE_KEY, HConstants.TABLE_MAX_ROWSIZE_DEFAULT); -094 this.usePread = conf.getBoolean("hbase.storescanner.use.pread", false); -095 long perHeartbeat = -096 conf.getLong(StoreScanner.HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK, -097 StoreScanner.DEFAULT_HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK); -098 this.cellsPerTimeoutCheck = perHeartbeat > 0? -099 perHeartbeat: StoreScanner.DEFAULT_HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK; -100 this.parallelSeekEnabled = -101 conf.getBoolean(StoreScanner.STORESCANNER_PARALLEL_SEEK_ENABLE, false); -102 this.conf = conf; -103 } -104 -105 public Configuration getConfiguration() { -106 return this.conf; -107 } -108 -109 long getTableMaxRowSize() { -110 return this.tableMaxRowSize; -111 } -112 -113 boolean isUsePread() { -114 return this.usePread; -115 } -116 -117 long getCellsPerTimeoutCheck() { -118 return this.cellsPerTimeoutCheck; -119 } -120 -121 boolean isParallelSeekEnabled() { -122 return this.parallelSeekEnabled; -123 } -124 -125 public byte[] getFamily() { -126 return family; -127 } -128 -129 public int getMinVersions() { -130 return minVersions; -131 } -132 -133 public int getMaxVersions() { -134 return maxVersions; -135 } -136 -137 public long getTtl() { -138 return ttl; -139 } -140 -141 public KeepDeletedCells getKeepDeletedCells() { -142 return keepDeletedCells; -143 } -144 -145 public long getTimeToPurgeDeletes() { -146 return timeToPurgeDeletes; -147 } -148 -149 public CellComparator getComparator() { -150 return comparator; -151 } -152} +051 private final long preadMaxBytes; +052 private final Configuration conf; +053 +054 public static final long FIXED_OVERHEAD = ClassSize.align(ClassSize.OBJECT +055 + (2 * ClassSize.REFERENCE) + (2 * Bytes.SIZEOF_INT) +056 + (4 * Bytes.SIZEOF_LONG) + (3 * Bytes.SIZEOF_BOOLEAN)); +057 +058 /** +059 * @param conf +060 * @param family {@link HColumnDescriptor} describing the column family +061 * @param ttl Store's TTL (in ms) +062 * @param timeToPurgeDeletes duration in ms after which a delete marker can be purged during a +063 * major compaction. +064 * @param comparator The store's comparator +065 */ +066 public ScanInfo(final Configuration conf, final HColumnDescriptor family, final long ttl, +067 final long timeToPurgeDeletes, final CellComparator comparator) { +068 this(conf, family.getName(), family.getMinVersions(), family.getMaxVersions(), ttl, +069 family.getKeepDeletedCells(), family.getBlocksize(), timeToPurgeDeletes, comparator); +070 } +071 +072 /** +073 * @param conf +074 * @param family Name of this store's column family +075 * @param minVersions Store's MIN_VERSIONS setting +076 * @param maxVersions Store's VERSIONS setting +077 * @param ttl Store's TTL (in ms) +078 * @param blockSize Store's block size +079 * @param timeToPurgeDeletes duration in ms after which a delete marker can +080 * be purged during a major compaction. +081 * @param keepDeletedCells Store's keepDeletedCells setting +082 * @param comparator The store's comparator +083 */ +084 public ScanInfo(final Configuration conf, final byte[] family, final int minVersions, +085 final int maxVersions, final long ttl, final KeepDeletedCells keepDeletedCells, +086 final long blockSize, final long timeToPurgeDeletes, final CellComparator comparator) { +087 this.family = family; +088 this.minVersions = minVersions; +089 this.maxVersions = maxVersions; +090 this.ttl = ttl; +091 this.keepDeletedCells = keepDeletedCells; +092 this.timeToPurgeDeletes = timeToPurgeDeletes; +093 this.comparator = comparator; +094 this.tableMaxRowSize = +095 conf.getLong(HConstants.TABLE_MAX_ROWSIZE_KEY, HConstants.TABLE_MAX_ROWSIZE_DEFAULT); +096 this.usePread = conf.getBoolean("hbase.storescanner.use.pread", false); +097 long perHeartbeat = +098 conf.getLong(StoreScanner.HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK, +099 StoreScanner.DEFAULT_HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK); +100 this.cellsPerTimeoutCheck = perHeartbeat > 0? +101 perHeartbeat: StoreScanner.DEFAULT_HBASE_CELLS_SCANNED_PER_HEARTBEAT_CHECK; +102 this.parallelSeekEnabled = +103 conf.getBoolean(StoreScanner.STORESCANNER_PARALLEL_SEEK_ENABLE, false); +104 this.preadMaxBytes = conf.getLong(StoreScanner.STORESCANNER_PREAD_MAX_BYTES, 4 * blockSize); +105 this.conf = conf; +106 } +107 +108 public Configuration getConfiguration() { +109 return this.conf; +110 } +111 +112 long getTableMaxRowSize() { +113 return this.tableMaxRowSize; +114 } +115 +116 boolean isUsePread() { +117 return this.usePread; +118 } +119 +120 long getCellsPerTimeoutCheck() { +121 return this.cellsPerTimeoutCheck; +122 } +123 +124 boolean isParallelSeekEnabled() { +125 return this.parallelSeekEnabled; +126 } +127 +128 public byte[] getFamily() { +129 return family; +130 } +131 +132 public int getMinVersions() { +133 return minVersions; +134 } +135 +136 public int getMaxVersions() { +137 return maxVersions; +138 } +139 +140 public long getTtl() { +141 return ttl; +142 } +143 +144 public KeepDeletedCells getKeepDeletedCells() { +145 return keepDeletedCells; +146 } +147 +148 public long getTimeToPurgeDeletes() { +149 return timeToPurgeDeletes; +150 } +151 +152 public CellComparator getComparator() { +153 return comparator; +154 } +155 +156 long getPreadMaxBytes() { +157 return preadMaxBytes; +158 } +159}