public boolean next() throws IOException { if (atEnd) return false; boolean b = delegate.next(); if (!b) { return b; } // constrain the bottom. if (!top) { ByteBuffer bb = getKey(); if (getComparator().compareFlatKey(bb.array(), bb.arrayOffset(), bb.limit(), splitkey, 0, splitkey.length) >= 0) { atEnd = true; return false; } } return true; }
public boolean next() throws IOException { if (atEnd) return false; boolean b = delegate.next(); if (!b) { return b; } // constrain the bottom. if (!top) { ByteBuffer bb = getKey(); if (getComparator().compare(bb.array(), bb.arrayOffset(), bb.limit(), splitkey, 0, splitkey.length) >= 0) { atEnd = true; return false; } } return true; }
@Override public int reseekTo(byte[] key) throws IOException { return reseekTo(key, 0, key.length); }
@Override public boolean seekBefore(byte[] key) throws IOException { return seekBefore(key, 0, key.length); }
public int seekTo(byte[] key) throws IOException { return seekTo(key, 0, key.length); }
@Override public int seekTo(byte[] key) throws IOException { return seekTo(key, 0, key.length); }
public boolean seekBefore(byte[] key) throws IOException { return seekBefore(key, 0, key.length); }
@Override public int reseekTo(byte[] key, int offset, int length) throws IOException { //This function is identical to the corresponding seekTo function except //that we call reseekTo (and not seekTo) on the delegate. return reseekTo(new KeyValue.KeyOnlyKeyValue(key, offset, length)); }
@Override public int reseekTo(byte[] key) throws IOException { return reseekTo(key, 0, key.length); }
@Override public boolean seekBefore(byte [] key, int offset, int length) throws IOException { return seekBefore(new KeyValue.KeyOnlyKeyValue(key, offset, length)); }
@Override public int seekTo(byte[] key, int offset, int length) throws IOException { return seekTo(new KeyValue.KeyOnlyKeyValue(key, offset, length)); }
@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; }
@Override public boolean next() throws IOException { if (atEnd) return false; boolean b = delegate.next(); if (!b) { return b; } // constrain the bottom. if (!top) { if (getComparator().compare(splitCell, getKey()) <= 0) { atEnd = true; return false; } } return true; }