if (tfileMeta.isSorted() && tfileMeta.getRecordCount()>0) { byte[] lastKey = lastKeyBufferOS.getBuffer(); int lastLen = lastKeyBufferOS.size(); if (tfileMeta.getComparator().compare(key, 0, len, lastKey, 0, lastLen) < 0) { throw new IOException("Keys are not added in sorted order");
@Override public void close() throws IOException { if (closed == true) { return; } try { ++errorCount; super.close(); blkRecordCount++; // bump up the total record count in the whole file tfileMeta.incRecordCount(); finishDataBlock(false); --errorCount; } finally { closed = true; state = State.READY; } } }
public TFileMeta(DataInput in) throws IOException { version = new Version(in); if (!version.compatibleWith(TFile.API_VERSION)) { throw new RuntimeException("Incompatible TFile fileVersion."); } recordCount = Utils.readVLong(in); strComparator = Utils.readString(in); comparator = makeComparator(strComparator); }
.prepareMetaBlock(TFileMeta.BLOCK_NAME, COMPRESSION_NONE); try { tfileMeta.write(outMeta); } finally { outMeta.close();
throws IOException { sizeMinBlock = minBlockSize; tfileMeta = new TFileMeta(comparator); tfileIndex = new TFileIndex(tfileMeta.getComparator());
throws IOException { sizeMinBlock = minBlockSize; tfileMeta = new TFileMeta(comparator); tfileIndex = new TFileIndex(tfileMeta.getComparator());
throws IOException { sizeMinBlock = minBlockSize; tfileMeta = new TFileMeta(comparator); tfileIndex = new TFileIndex(tfileMeta.getComparator());
throws IOException { sizeMinBlock = minBlockSize; tfileMeta = new TFileMeta(comparator); tfileIndex = new TFileIndex(tfileMeta.getComparator());
.prepareMetaBlock(TFileMeta.BLOCK_NAME, COMPRESSION_NONE); try { tfileMeta.write(outMeta); } finally { outMeta.close();
throws IOException { sizeMinBlock = minBlockSize; tfileMeta = new TFileMeta(comparator); tfileIndex = new TFileIndex(tfileMeta.getComparator());
.prepareMetaBlock(TFileMeta.BLOCK_NAME, COMPRESSION_NONE); try { tfileMeta.write(outMeta); } finally { outMeta.close();
.prepareMetaBlock(TFileMeta.BLOCK_NAME, COMPRESSION_NONE); try { tfileMeta.write(outMeta); } finally { outMeta.close();
.prepareMetaBlock(TFileMeta.BLOCK_NAME, COMPRESSION_NONE); try { tfileMeta.write(outMeta); } finally { outMeta.close();
if (tfileMeta.isSorted() && tfileMeta.getRecordCount()>0) { byte[] lastKey = lastKeyBufferOS.getBuffer(); int lastLen = lastKeyBufferOS.size(); if (tfileMeta.getComparator().compare(key, 0, len, lastKey, 0, lastLen) < 0) { throw new IOException("Keys are not added in sorted order");
if (tfileMeta.isSorted() && tfileMeta.getRecordCount()>0) { byte[] lastKey = lastKeyBufferOS.getBuffer(); int lastLen = lastKeyBufferOS.size(); if (tfileMeta.getComparator().compare(key, 0, len, lastKey, 0, lastLen) < 0) { throw new IOException("Keys are not added in sorted order");
if (tfileMeta.isSorted()) { byte[] lastKey = lastKeyBufferOS.getBuffer(); int lastLen = lastKeyBufferOS.size(); if (tfileMeta.getComparator().compare(key, 0, len, lastKey, 0, lastLen) < 0) { throw new IOException("Keys are not added in sorted order");
if (tfileMeta.isSorted() && tfileMeta.getRecordCount()>0) { byte[] lastKey = lastKeyBufferOS.getBuffer(); int lastLen = lastKeyBufferOS.size(); if (tfileMeta.getComparator().compare(key, 0, len, lastKey, 0, lastLen) < 0) { throw new IOException("Keys are not added in sorted order");
if (tfileMeta.isSorted() && tfileMeta.getRecordCount()>0) { byte[] lastKey = lastKeyBufferOS.getBuffer(); int lastLen = lastKeyBufferOS.size(); if (tfileMeta.getComparator().compare(key, 0, len, lastKey, 0, lastLen) < 0) { throw new IOException("Keys are not added in sorted order");
/** * Constructor * * @param fsdis * FS input stream of the TFile. * @param fileLength * The length of TFile. This is required because we have no easy * way of knowing the actual size of the input file through the * File input stream. * @param conf * @throws IOException */ public Reader(FSDataInputStream fsdis, long fileLength, Configuration conf) throws IOException { readerBCF = new BCFile.Reader(fsdis, fileLength, conf); // first, read TFile meta BlockReader brMeta = readerBCF.getMetaBlock(TFileMeta.BLOCK_NAME); try { tfileMeta = new TFileMeta(brMeta); } finally { brMeta.close(); } comparator = tfileMeta.getComparator(); // Set begin and end locations. begin = new Location(0, 0); end = new Location(readerBCF.getBlockCount(), 0); }
/** * Constructor * * @param fsdis * FS input stream of the TFile. * @param fileLength * The length of TFile. This is required because we have no easy * way of knowing the actual size of the input file through the * File input stream. * @param conf * @throws IOException */ public Reader(FSDataInputStream fsdis, long fileLength, Configuration conf) throws IOException { readerBCF = new BCFile.Reader(fsdis, fileLength, conf); // first, read TFile meta BlockReader brMeta = readerBCF.getMetaBlock(TFileMeta.BLOCK_NAME); try { tfileMeta = new TFileMeta(brMeta); } finally { brMeta.close(); } comparator = tfileMeta.getComparator(); // Set begin and end locations. begin = new Location(0, 0); end = new Location(readerBCF.getBlockCount(), 0); }