BlockRegion region = reader.readerBCF.dataIndex.getBlockRegionList().get(i); TFileIndexEntry indexEntry = reader.tfileIndex.getEntry(i); out.printf("%s %s %s %s %s ", Align.format(Align.format(i, blkIDWidth2, Align.ZERO_PADDED), blkIDWidth, Align.LEFT), Align
if (tfileIndex.getFirstKey() == null) { tfileIndex.setFirstKey(key, 0, len);
/** * 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); }
BlockRegion region = reader.readerBCF.dataIndex.getBlockRegionList().get(i); TFileIndexEntry indexEntry = reader.tfileIndex.getEntry(i); out.printf("%s %s %s %s %s ", Align.format(Align.format(i, blkIDWidth2, Align.ZERO_PADDED), blkIDWidth, Align.LEFT), Align
BlockRegion region = reader.readerBCF.dataIndex.getBlockRegionList().get(i); TFileIndexEntry indexEntry = reader.tfileIndex.getEntry(i); out.printf("%s %s %s %s %s ", Align.format(Align.format(i, blkIDWidth2, Align.ZERO_PADDED), blkIDWidth, Align.LEFT), Align
BlockRegion region = reader.readerBCF.dataIndex.getBlockRegionList().get(i); TFileIndexEntry indexEntry = reader.tfileIndex.getEntry(i); out.printf("%s %s %s %s %s ", Align.format(Align.format(i, blkIDWidth2, Align.ZERO_PADDED), blkIDWidth, Align.LEFT), Align
BlockRegion region = reader.readerBCF.dataIndex.getBlockRegionList().get(i); TFileIndexEntry indexEntry = reader.tfileIndex.getEntry(i); out.printf("%s %s %s %s %s ", Align.format(Align.format(i, blkIDWidth2, Align.ZERO_PADDED), blkIDWidth, Align.LEFT), Align
BlockRegion region = reader.readerBCF.dataIndex.getBlockRegionList().get(i); TFileIndexEntry indexEntry = reader.tfileIndex.getEntry(i); out.printf("%s %s %s %s %s ", Align.format(Align.format(i, blkIDWidth2, Align.ZERO_PADDED), blkIDWidth, Align.LEFT), Align
sizeMinBlock = minBlockSize; tfileMeta = new TFileMeta(comparator); tfileIndex = new TFileIndex(tfileMeta.getComparator());
sizeMinBlock = minBlockSize; tfileMeta = new TFileMeta(comparator); tfileIndex = new TFileIndex(tfileMeta.getComparator());
sizeMinBlock = minBlockSize; tfileMeta = new TFileMeta(comparator); tfileIndex = new TFileIndex(tfileMeta.getComparator());
sizeMinBlock = minBlockSize; tfileMeta = new TFileMeta(comparator); tfileIndex = new TFileIndex(tfileMeta.getComparator());
sizeMinBlock = minBlockSize; tfileMeta = new TFileMeta(comparator); tfileIndex = new TFileIndex(tfileMeta.getComparator());
if (tfileIndex.getFirstKey() == null) { tfileIndex.setFirstKey(key, 0, len);
if (tfileIndex.getFirstKey() == null) { tfileIndex.setFirstKey(key, 0, len);
if (tfileIndex.getFirstKey() == null) { tfileIndex.setFirstKey(key, 0, len);
if (tfileIndex.getFirstKey() == null) { tfileIndex.setFirstKey(key, 0, len);
if (tfileIndex.getFirstKey() == null) { tfileIndex.setFirstKey(key, 0, len);
/** * Close the current data block if necessary. * * @param bForceFinish * Force the closure regardless of the block size. * @throws IOException */ void finishDataBlock(boolean bForceFinish) throws IOException { if (blkAppender == null) { return; } // exceeded the size limit, do the compression and finish the block if (bForceFinish || blkAppender.getCompressedSize() >= sizeMinBlock) { // keep tracks of the last key of each data block, no padding // for now TFileIndexEntry keyLast = new TFileIndexEntry(lastKeyBufferOS.getBuffer(), 0, lastKeyBufferOS .size(), blkRecordCount); tfileIndex.addEntry(keyLast); // close the appender blkAppender.close(); blkAppender = null; blkRecordCount = 0; } } }
/** * Close the current data block if necessary. * * @param bForceFinish * Force the closure regardless of the block size. * @throws IOException */ void finishDataBlock(boolean bForceFinish) throws IOException { if (blkAppender == null) { return; } // exceeded the size limit, do the compression and finish the block if (bForceFinish || blkAppender.getCompressedSize() >= sizeMinBlock) { // keep tracks of the last key of each data block, no padding // for now TFileIndexEntry keyLast = new TFileIndexEntry(lastKeyBufferOS.getBuffer(), 0, lastKeyBufferOS .size(), blkRecordCount); tfileIndex.addEntry(keyLast); // close the appender blkAppender.close(); blkAppender = null; blkRecordCount = 0; } } }