valueDataInputStream = new DataInputStream(valueBufferInputStream); if (beginLocation.compareTo(endLocation) >= 0) { currentLocation = new Location(endLocation); } else {
if (l.compareTo(beginLocation) < 0) { throw new IllegalArgumentException( "Attempt to seek before the begin location."); if (l.compareTo(endLocation) > 0) { throw new IllegalArgumentException( "Attempt to seek after the end location."); if (l.compareTo(endLocation) == 0) { parkCursorAtEnd(); return;
private boolean seekTo(RawComparable key, boolean beyond) throws IOException { Location l = reader.getBlockContainsKey(key, beyond); if (l.compareTo(beginLocation) < 0) { l = beginLocation; } else if (l.compareTo(endLocation) >= 0) { seekTo(endLocation); return false; } // check if what we are seeking is in the later part of the current // block. if (atEnd() || (l.getBlockIndex() != currentLocation.getBlockIndex()) || (compareCursorKeyTo(key) >= 0)) { // sorry, we must seek to a different location first. seekTo(l); } return inBlockAdvance(key, beyond); }
private boolean seekTo(RawComparable key, boolean beyond) throws IOException { Location l = reader.getBlockContainsKey(key, beyond); if (l.compareTo(beginLocation) < 0) { l = beginLocation; } else if (l.compareTo(endLocation) >= 0) { seekTo(endLocation); return false; } // check if what we are seeking is in the later part of the current // block. if (atEnd() || (l.getBlockIndex() != currentLocation.getBlockIndex()) || (compareCursorKeyTo(key) >= 0)) { // sorry, we must seek to a different location first. seekTo(l); } return inBlockAdvance(key, beyond); }
private boolean seekTo(RawComparable key, boolean beyond) throws IOException { Location l = reader.getBlockContainsKey(key, beyond); if (l.compareTo(beginLocation) < 0) { l = beginLocation; } else if (l.compareTo(endLocation) >= 0) { seekTo(endLocation); return false; } // check if what we are seeking is in the later part of the current // block. if (atEnd() || (l.getBlockIndex() != currentLocation.getBlockIndex()) || (compareCursorKeyTo(key) >= 0)) { // sorry, we must seek to a different location first. seekTo(l); } return inBlockAdvance(key, beyond); }
private boolean seekTo(RawComparable key, boolean beyond) throws IOException { Location l = reader.getBlockContainsKey(key, beyond); if (l.compareTo(beginLocation) < 0) { l = beginLocation; } else if (l.compareTo(endLocation) >= 0) { seekTo(endLocation); return false; } // check if what we are seeking is in the later part of the current // block. if (atEnd() || (l.getBlockIndex() != currentLocation.getBlockIndex()) || (compareCursorKeyTo(key) >= 0)) { // sorry, we must seek to a different location first. seekTo(l); } return inBlockAdvance(key, beyond); }
/** * Is cursor at the end location? * * @return true if the cursor is at the end location. */ public boolean atEnd() { return (currentLocation.compareTo(endLocation) >= 0); }
/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override public int compareTo(Location other) { return compareTo(other.blockIndex, other.recordIndex); }
/** * Is cursor at the end location? * * @return true if the cursor is at the end location. */ public boolean atEnd() { return (currentLocation.compareTo(endLocation) >= 0); }
/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override public int compareTo(Location other) { return compareTo(other.blockIndex, other.recordIndex); }
/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override public int compareTo(Location other) { return compareTo(other.blockIndex, other.recordIndex); }
/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override public int compareTo(Location other) { return compareTo(other.blockIndex, other.recordIndex); }
/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override public int compareTo(Location other) { return compareTo(other.blockIndex, other.recordIndex); }
/** * Is cursor at the end location? * * @return true if the cursor is at the end location. */ public boolean atEnd() { return (currentLocation.compareTo(endLocation) >= 0); }
/** * Is cursor at the end location? * * @return true if the cursor is at the end location. */ public boolean atEnd() { return (currentLocation.compareTo(endLocation) >= 0); }
/** * Is cursor at the end location? * * @return true if the cursor is at the end location. */ public boolean atEnd() { return (currentLocation.compareTo(endLocation) >= 0); }
/** * Move the cursor to the next key-value pair. The entry returned by the * previous entry() call will be invalid. * * @return true if the cursor successfully moves. False when cursor is * already at the end location and cannot be advanced. * @throws IOException */ public boolean advance() throws IOException { if (atEnd()) { return false; } int curBid = currentLocation.getBlockIndex(); long curRid = currentLocation.getRecordIndex(); long entriesInBlock = reader.getBlockEntryCount(curBid); if (curRid + 1 >= entriesInBlock) { if (endLocation.compareTo(curBid + 1, 0) <= 0) { // last entry in TFile. parkCursorAtEnd(); } else { // last entry in Block. initBlock(curBid + 1); } } else { inBlockAdvance(1); } return true; }
private boolean seekTo(RawComparable key, boolean beyond) throws IOException { Location l = reader.getBlockContainsKey(key, beyond); if (l.compareTo(beginLocation) < 0) { l = beginLocation; } else if (l.compareTo(endLocation) >= 0) { seekTo(endLocation); return false; } // check if what we are seeking is in the later part of the current // block. if (atEnd() || (l.getBlockIndex() != currentLocation.getBlockIndex()) || (compareCursorKeyTo(key) >= 0)) { // sorry, we must seek to a different location first. seekTo(l); } return inBlockAdvance(key, beyond); }
/** * Is cursor at the end location? * * @return true if the cursor is at the end location. */ public boolean atEnd() { return (currentLocation.compareTo(endLocation) >= 0); }
/** * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override public int compareTo(Location other) { return compareTo(other.blockIndex, other.recordIndex); }