dataIndex = new DataIndex(blockR); } finally { blockR.close();
/** * check whether we have already successfully obtained the key. It also * initializes the valueInputStream. */ void checkKey() throws IOException { if (klen >= 0) return; if (atEnd()) { throw new EOFException("No key-value to read"); } klen = -1; vlen = -1; valueChecked = false; klen = Utils.readVInt(blkReader); blkReader.readFully(keyBuffer, 0, klen); valueBufferInputStream.reset(blkReader); if (valueBufferInputStream.isLastChunk()) { vlen = valueBufferInputStream.getRemain(); } }
dataIndex = new DataIndex(blockR); } finally { blockR.close();
dataIndex = new DataIndex(blockR); } finally { blockR.close();
dataIndex = new DataIndex(blockR); } finally { blockR.close();
dataIndex = new DataIndex(blockR); } finally { blockR.close();
dataIndex = new DataIndex(blockR); } finally { blockR.close();
/** * 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); }
/** * 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); }
/** * 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); }
/** * check whether we have already successfully obtained the key. It also * initializes the valueInputStream. */ void checkKey() throws IOException { if (klen >= 0) return; if (atEnd()) { throw new EOFException("No key-value to read"); } klen = -1; vlen = -1; valueChecked = false; klen = Utils.readVInt(blkReader); blkReader.readFully(keyBuffer, 0, klen); valueBufferInputStream.reset(blkReader); if (valueBufferInputStream.isLastChunk()) { vlen = valueBufferInputStream.getRemain(); } }
/** * check whether we have already successfully obtained the key. It also * initializes the valueInputStream. */ void checkKey() throws IOException { if (klen >= 0) return; if (atEnd()) { throw new EOFException("No key-value to read"); } klen = -1; vlen = -1; valueChecked = false; klen = Utils.readVInt(blkReader); blkReader.readFully(keyBuffer, 0, klen); valueBufferInputStream.reset(blkReader); if (valueBufferInputStream.isLastChunk()) { vlen = valueBufferInputStream.getRemain(); } }
/** * check whether we have already successfully obtained the key. It also * initializes the valueInputStream. */ void checkKey() throws IOException { if (klen >= 0) return; if (atEnd()) { throw new EOFException("No key-value to read"); } klen = -1; vlen = -1; valueChecked = false; klen = Utils.readVInt(blkReader); blkReader.readFully(keyBuffer, 0, klen); valueBufferInputStream.reset(blkReader); if (valueBufferInputStream.isLastChunk()) { vlen = valueBufferInputStream.getRemain(); } }
/** * Load a compressed block for reading. Expecting blockIndex is valid. * * @throws IOException */ private void initBlock(int blockIndex) throws IOException { klen = -1; if (blkReader != null) { try { blkReader.close(); } finally { blkReader = null; } } blkReader = reader.getBlockReader(blockIndex); currentLocation.set(blockIndex, 0); }
/** * Lazily loading the TFile index. * * @throws IOException */ synchronized void checkTFileDataIndex() throws IOException { if (tfileIndex == null) { BlockReader brIndex = readerBCF.getMetaBlock(TFileIndex.BLOCK_NAME); try { tfileIndex = new TFileIndex(readerBCF.getBlockCount(), brIndex, tfileMeta .getComparator()); } finally { brIndex.close(); } } }
/** * check whether we have already successfully obtained the key. It also * initializes the valueInputStream. */ void checkKey() throws IOException { if (klen >= 0) return; if (atEnd()) { throw new EOFException("No key-value to read"); } klen = -1; vlen = -1; valueChecked = false; klen = Utils.readVInt(blkReader); blkReader.readFully(keyBuffer, 0, klen); valueBufferInputStream.reset(blkReader); if (valueBufferInputStream.isLastChunk()) { vlen = valueBufferInputStream.getRemain(); } }
/** * check whether we have already successfully obtained the key. It also * initializes the valueInputStream. */ void checkKey() throws IOException { if (klen >= 0) return; if (atEnd()) { throw new EOFException("No key-value to read"); } klen = -1; vlen = -1; valueChecked = false; klen = Utils.readVInt(blkReader); blkReader.readFully(keyBuffer, 0, klen); valueBufferInputStream.reset(blkReader); if (valueBufferInputStream.isLastChunk()) { vlen = valueBufferInputStream.getRemain(); } }
/** * Lazily loading the TFile index. * * @throws IOException */ synchronized void checkTFileDataIndex() throws IOException { if (tfileIndex == null) { BlockReader brIndex = readerBCF.getMetaBlock(TFileIndex.BLOCK_NAME); try { tfileIndex = new TFileIndex(readerBCF.getBlockCount(), brIndex, tfileMeta .getComparator()); } finally { brIndex.close(); } } }