@Override public org.apache.hadoop.hbase.io.hfile.HFile.Reader getReader() { return this.delegate.getReader(); }
@Override public boolean seekTo() throws IOException { if (top) { int r = this.delegate.seekTo(splitCell); if (r == HConstants.INDEX_KEY_MAGIC) { return true; } if (r < 0) { // midkey is < first key in file return this.delegate.seekTo(); } if (r > 0) { return this.delegate.next(); } return true; } boolean b = delegate.seekTo(); if (!b) { return b; } // Check key. return (this.delegate.getReader().getComparator().compare(splitCell, getKey())) > 0; }
key = ByteBuffer.wrap(((KeyValue) topScanner.getKey()).getKey()); if ((PrivateCellUtil.compare(topScanner.getReader().getComparator(), midKV, key.array(), key.arrayOffset(), key.limit())) > 0) { fail("key=" + Bytes.toStringBinary(key) + " < midkey=" + key = ByteBuffer.wrap(((KeyValue) topScanner.getKey()).getKey()); keyOnlyKV.setKey(key.array(), 0 + key.arrayOffset(), key.limit()); assertTrue(PrivateCellUtil.compare(topScanner.getReader().getComparator(), keyOnlyKV, badmidkey, 0, badmidkey.length) >= 0); if (first) {
public org.apache.hadoop.hbase.io.hfile.HFile.Reader getReader() { return this.delegate.getReader(); }
public org.apache.hadoop.hbase.io.hfile.HFile.Reader getReader() { return this.delegate.getReader(); }
private void populateKV(long nextStartTime, boolean scanSuccessful) { if (!scanSuccessful) { //end of file reached. collect stats and return scanStat.endIteration(0, nextStartTime); return; } prefetchedKey = scan.getKey(); prefetchedValue = scan.getValue(); if (to != null) { // TODO Optimization? Perform int comparison instead of byte[]. Identify // offset of key greater than two. int compare = -1; compare = scan.getReader().getComparator().compare (prefetchedKey.array(), prefetchedKey.arrayOffset(), prefetchedKey.remaining(), to, 0, to.length); if (compare > 0 || (compare == 0 && !toInclusive)) { prefetchedKey = null; prefetchedValue = null; return; } } // account for bytes read and time spent int byteCount = prefetchedKey.remaining() + prefetchedValue.remaining(); scanStat.endIteration(byteCount, nextStartTime); }
private void populateKV(long nextStartTime, boolean scanSuccessful) { if (!scanSuccessful) { //end of file reached. collect stats and return scanStat.endIteration(0, nextStartTime); return; } prefetchedKey = scan.getKey(); prefetchedValue = scan.getValue(); if (to != null) { // TODO Optimization? Perform int comparison instead of byte[]. Identify // offset of key greater than two. int compare = -1; compare = scan.getReader().getComparator().compare (prefetchedKey.array(), prefetchedKey.arrayOffset(), prefetchedKey.remaining(), to, 0, to.length); if (compare > 0 || (compare == 0 && !toInclusive)) { prefetchedKey = null; prefetchedValue = null; return; } } // account for bytes read and time spent int byteCount = prefetchedKey.remaining() + prefetchedValue.remaining(); scanStat.endIteration(byteCount, nextStartTime); }
public boolean seekTo() throws IOException { if (top) { int r = this.delegate.seekTo(splitkey); if (r < 0) { // midkey is < first key in file return this.delegate.seekTo(); } if (r > 0) { return this.delegate.next(); } return true; } boolean b = delegate.seekTo(); if (!b) { return b; } // Check key. ByteBuffer k = this.delegate.getKey(); return this.delegate.getReader().getComparator(). compare(k.array(), k.arrayOffset(), k.limit(), splitkey, 0, splitkey.length) < 0; }
@Override public boolean seekTo() throws IOException { if (top) { int r = this.delegate.seekTo(new KeyValue.KeyOnlyKeyValue(splitkey, 0, splitkey.length)); if (r == HConstants.INDEX_KEY_MAGIC) { return true; } if (r < 0) { // midkey is < first key in file return this.delegate.seekTo(); } if (r > 0) { return this.delegate.next(); } return true; } boolean b = delegate.seekTo(); if (!b) { return b; } // Check key. ByteBuffer k = this.delegate.getKey(); return this.delegate.getReader().getComparator(). compareFlatKey(k.array(), k.arrayOffset(), k.limit(), splitkey, 0, splitkey.length) < 0; }
public HFileSortedIterator(HFileScanner scan, byte[] from, boolean fromInclusive, byte[] to, boolean toInclusive) throws IOException { this.scan = scan; this.from = from; this.fromInclusive = fromInclusive; this.to = to; this.toInclusive = toInclusive; scanStat = (stats == null) ? new SortedOplogStatistics("", "").new ScanOperation( 0, 0, 0, 0, 0, 0, 0) : stats.getScan(); scanStart = scanStat.begin(); if (scan == null) { return; } assert from == null || to == null || scan.getReader().getComparator().compare( from, 0, from.length, to, 0, to.length) <= 0; initIterator(); }
public HFileSortedIterator(HFileScanner scan, byte[] from, boolean fromInclusive, byte[] to, boolean toInclusive) throws IOException { this.scan = scan; this.from = from; this.fromInclusive = fromInclusive; this.to = to; this.toInclusive = toInclusive; scanStat = (stats == null) ? new SortedOplogStatistics("", "").new ScanOperation( 0, 0, 0, 0, 0, 0, 0) : stats.getScan(); scanStart = scanStat.begin(); if (scan == null) { return; } assert from == null || to == null || scan.getReader().getComparator().compare(from, to) <= 0; initIterator(); }
key = ByteBuffer.wrap(((KeyValue) topScanner.getKey()).getKey()); if ((PrivateCellUtil.compare(topScanner.getReader().getComparator(), midKV, key.array(), key.arrayOffset(), key.limit())) > 0) { fail("key=" + Bytes.toStringBinary(key) + " < midkey=" + key = ByteBuffer.wrap(((KeyValue) topScanner.getKey()).getKey()); keyOnlyKV.setKey(key.array(), 0 + key.arrayOffset(), key.limit()); assertTrue(PrivateCellUtil.compare(topScanner.getReader().getComparator(), keyOnlyKV, badmidkey, 0, badmidkey.length) >= 0); if (first) {