needsReset = false; bufferedIn = new BufferedInputStream(super.in); this.startingPos = super.getPos(); this.readMode = readMode; long numSkipped = 0;
public void close() throws IOException { if (!needsReset) { try { input.close(); needsReset = true; } finally { super.close(); } } }
/** * Inits the reader helper. This method must be called by * an implementor. * * @throws IOException Signals that an I/O exception has occurred. */ protected void init() throws IOException { reader = createReader(streamsHolder.getStream()); if (codec != null && inputSplit != null) { inputContext.setStart(((SplitCompressionInputStream)streamsHolder.getStream()).getAdjustedStart()); inputContext.setEnd(((SplitCompressionInputStream)streamsHolder.getStream()).getAdjustedEnd()); } }
codec.createInputStream(fs.open(infile.getPath()), dcmp, pos, flen, SplittableCompressionCodec.READ_MODE.BYBLOCK); if (in.getAdjustedStart() >= flen) { break; LOG.info("SAMPLE " + in.getAdjustedStart() + "," + in.getAdjustedEnd()); final LineReader lreader = new LineReader(in); if (in.getPos() >= flen) { break; final int seq1 = readLeadingInt(line); lreader.readLine(line); if (in.getPos() >= flen) { break;
@Override public int readDefaultLine(NonSyncByteArrayOutputStream str, ArrayList<Integer> offsets, int maxLineLength , int maxBytesToConsume) throws IOException { int bytesRead = 0; if (!finished) { // only allow at most one more record to be read after the stream // reports the split ended if (scin.getPos() > scin.getAdjustedEnd()) { finished = true; } bytesRead = super.readDefaultLine(str, offsets, maxLineLength, maxBytesToConsume); } return bytesRead; }
keyDecompressBuffer, keyDecompressor, 0, compressedKeyLen, SplittableCompressionCodec.READ_MODE.BYBLOCK); keyDecompressBuffer.seek(deflatFilter.getAdjustedStart()); is = new DataInputStream(deflatFilter); } else {
SplittableCompressionCodec.READ_MODE.BYBLOCK); in = cIn; start = cIn.getAdjustedStart(); end = cIn.getAdjustedEnd();
codec.createInputStream(fs.open(infile.getPath()), dcmp, pos, flen, SplittableCompressionCodec.READ_MODE.BYBLOCK); if (in.getAdjustedStart() >= flen) { break; LOG.info("SAMPLE " + in.getAdjustedStart() + "," + in.getAdjustedEnd()); final LineReader lreader = new LineReader(in); if (in.getPos() >= flen) { break; final int seq1 = readLeadingInt(line); lreader.readLine(line); if (in.getPos() >= flen) { break;
@Override public int readLine(Text str, int maxLineLength, int maxBytesToConsume) throws IOException { int bytesRead = 0; if (!finished) { // only allow at most one more record to be read after the stream // reports the split ended if (scin.getPos() > scin.getAdjustedEnd()) { finished = true; } bytesRead = super.readLine(str, maxLineLength, maxBytesToConsume); } return bytesRead; }
keyDecompressBuffer, keyDecompressor, 0, compressedKeyLen, SplittableCompressionCodec.READ_MODE.BYBLOCK); keyDecompressBuffer.seek(deflatFilter.getAdjustedStart()); is = new DataInputStream(deflatFilter); } else {
final SplitCompressionInputStream cIn =((SplittableCompressionCodec)codec).createInputStream(fileIn, decompressor, start, end,SplittableCompressionCodec.READ_MODE.CONTINUOUS); ebr = new EthereumBlockReader(cIn, this.maxSizeEthereumBlock,this.bufferSize,this.useDirectBuffer); start = cIn.getAdjustedStart(); end = cIn.getAdjustedEnd();
codec.createInputStream(fs.open(infile.getPath()), dcmp, pos, flen, SplittableCompressionCodec.READ_MODE.BYBLOCK); if (in.getAdjustedStart() >= flen) { break; LOG.info("SAMPLE " + in.getAdjustedStart() + "," + in.getAdjustedEnd()); final LineReader lreader = new LineReader(in); if (in.getPos() >= flen) { break; final int seq1 = readLeadingInt(line); lreader.readLine(line); if (in.getPos() >= flen) { break;
@Override public int readLine(Text str, int maxLineLength, int maxBytesToConsume) throws IOException { int bytesRead = 0; if (!finished) { // only allow at most one more record to be read after the stream // reports the split ended if (scin.getPos() > scin.getAdjustedEnd()) { finished = true; } bytesRead = super.readLine(str, maxLineLength, maxBytesToConsume); } return bytesRead; }
public BGZFSplitCompressionInputStream(InputStream in, long start, long end) throws IOException { super(in, start, end); bufferedIn = new BufferedInputStream(super.in); this.startingPos = super.getPos(); input = new BlockCompressedInputStream(bufferedIn); this.updatePos(false); }
keyDecompressBuffer, keyDecompressor, 0, compressedKeyLen, SplittableCompressionCodec.READ_MODE.BYBLOCK); keyDecompressBuffer.seek(deflatFilter.getAdjustedStart()); is = new DataInputStream(deflatFilter); } else {
public void close() throws IOException { if (!needsReset) { try { input.close(); needsReset = true; } finally { super.close(); } } }
SplittableCompressionCodec.READ_MODE.BYBLOCK); startOffset = cIn.getAdjustedStart(); length = cIn.getAdjustedEnd() - startOffset; filePosition = cIn; is = cIn;
@Override public int readLine(Text str, int maxLineLength, int maxBytesToConsume) throws IOException { int bytesRead = 0; if (!finished) { // only allow at most one more record to be read after the stream // reports the split ended if (scin.getPos() > scin.getAdjustedEnd()) { finished = true; } bytesRead = super.readLine(str, maxLineLength, maxBytesToConsume); } return bytesRead; }
public BGZFSplitCompressionInputStream(InputStream in, long start, long end) throws IOException { super(in, start, end); bufferedIn = new BufferedInputStream(super.in); this.startingPos = super.getPos(); input = new BlockCompressedInputStream(bufferedIn); this.updatePos(false); }
public void close() throws IOException { if (!needsReset) { try { input.close(); needsReset = true; } finally { super.close(); } } }