reader.checkTFileDataIndex(); if (blockCnt > 0) { String blkID = "Data-Block";
/** * if greater is true then returns the beginning location of the block * containing the key strictly greater than input key. if greater is false * then returns the beginning location of the block greater than equal to * the input key * * @param key * the input key * @param greater * boolean flag * @return * @throws IOException */ Location getBlockContainsKey(RawComparable key, boolean greater) throws IOException { if (!isSorted()) { throw new RuntimeException("Seeking in unsorted TFile"); } checkTFileDataIndex(); int blkIndex = (greater) ? tfileIndex.upperBound(key) : tfileIndex.lowerBound(key); if (blkIndex < 0) return end; return new Location(blkIndex, 0); }
this.reader = reader; reader.checkTFileDataIndex(); beginLocation = begin; endLocation = end;
Location getLocationByRecordNum(long recNum) throws IOException { checkTFileDataIndex(); return tfileIndex.getLocationByRecordNum(recNum); }
long getRecordNumByLocation(Location location) throws IOException { checkTFileDataIndex(); return tfileIndex.getRecordNumByLocation(location); }
/** * Get the first key in the TFile. * * @return The first key in the TFile. * @throws IOException */ public RawComparable getFirstKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getFirstKey(); }
/** * Get the first key in the TFile. * * @return The first key in the TFile. * @throws IOException */ public RawComparable getFirstKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getFirstKey(); }
/** * Get the last key in the TFile. * * @return The last key in the TFile. * @throws IOException */ public RawComparable getLastKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getLastKey(); }
/** * Get the last key in the TFile. * * @return The last key in the TFile. * @throws IOException */ public RawComparable getLastKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getLastKey(); }
/** * Get the first key in the TFile. * * @return The first key in the TFile. * @throws IOException */ public RawComparable getFirstKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getFirstKey(); }
/** * Get the last key in the TFile. * * @return The last key in the TFile. * @throws IOException */ public RawComparable getLastKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getLastKey(); }
/** * Get the first key in the TFile. * * @return The first key in the TFile. * @throws IOException */ public RawComparable getFirstKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getFirstKey(); }
/** * Get the first key in the TFile. * * @return The first key in the TFile. * @throws IOException */ public RawComparable getFirstKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getFirstKey(); }
/** * Get the last key in the TFile. * * @return The last key in the TFile. * @throws IOException */ public RawComparable getLastKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getLastKey(); }
/** * Get the last key in the TFile. * * @return The last key in the TFile. * @throws IOException */ public RawComparable getLastKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getLastKey(); }
/** * Get a sample key that is within a block whose starting offset is greater * than or equal to the specified offset. * * @param offset * The file offset. * @return the key that fits the requirement; or null if no such key exists * (which could happen if the offset is close to the end of the * TFile). * @throws IOException */ public RawComparable getKeyNear(long offset) throws IOException { int blockIndex = readerBCF.getBlockIndexNear(offset); if (blockIndex == -1) return null; checkTFileDataIndex(); return new ByteArray(tfileIndex.getEntry(blockIndex).key); }
Location getLocationByRecordNum(long recNum) throws IOException { checkTFileDataIndex(); return tfileIndex.getLocationByRecordNum(recNum); }
long getRecordNumByLocation(Location location) throws IOException { checkTFileDataIndex(); return tfileIndex.getRecordNumByLocation(location); }
/** * Get the last key in the TFile. * * @return The last key in the TFile. * @throws IOException */ public RawComparable getLastKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getLastKey(); }
/** * Get the first key in the TFile. * * @return The first key in the TFile. * @throws IOException */ public RawComparable getFirstKey() throws IOException { checkTFileDataIndex(); return tfileIndex.getFirstKey(); }