/** * Get the current position in the input stream. * * @return current position in the input stream */ @Override public long getPos() throws IOException { return ((Seekable)in).getPos(); }
/** * If input stream is {@link org.apache.hadoop.fs.Seekable}, return it's * current position, otherwise return 0; */ public static long getInputStreamOffset(InputStream in) throws IOException { if (in instanceof Seekable) { return ((Seekable) in).getPos(); } return 0; } }
/** * This method returns the current position in the stream. * * @return Current position in stream as a long */ @Override public long getPos() throws IOException { if (!(in instanceof Seekable) || !(in instanceof PositionedReadable)){ //This way of getting the current position will not work for file //size which can be fit in an int and hence can not be returned by //available method. return (this.maxAvailableData - this.in.available()); } else{ return ((Seekable)this.in).getPos(); } }
private synchronized long getFilePosition() throws IOException { long retVal; if (isCompressedInput() && filePosition != null) { retVal = filePosition.getPos(); } else { retVal = getPos(); } return retVal; }
@Override public long getPos() throws IOException { return ((Seekable) in).getPos(); }
@Override public long getPos() throws IOException { return ((Seekable) in).getPos(); }
private long getFilePosition() throws IOException { long retVal; if (isCompressedInput && null != filePosition) { retVal = filePosition.getPos(); } else { retVal = pos; } return retVal; }
public long getPos() { if (in instanceof Seekable) { try { return ((Seekable) in).getPos(); } catch (IOException e) {} } return pos; }
/** * Get the current file position in a compressed or uncompressed file. * * @return file position * * @throws java.io.IOException in case of errors reading from the filestream provided by Hadoop * */ public long getFilePosition() throws IOException { return filePosition.getPos(); }
/** * Get the current position in the input stream. * * @return current position in the input stream */ @Override public long getPos() throws IOException { return ((Seekable)in).getPos(); }
/** * Get the current position in the input stream. * * @return current position in the input stream */ @Override public long getPos() throws IOException { return ((Seekable)in).getPos(); }
/** * If input stream is {@link org.apache.hadoop.fs.Seekable}, return it's * current position, otherwise return 0; */ public static long getInputStreamOffset(InputStream in) throws IOException { if (in instanceof Seekable) { return ((Seekable) in).getPos(); } return 0; } }
private long getFilePosition() throws IOException { long retVal; if (isCompressedInput && null != filePosition) { retVal = filePosition.getPos(); } else { retVal = pos; } return retVal; }
private long getFilePosition() throws IOException { long retVal; if (isCompressedInput && null != filePosition) { retVal = filePosition.getPos(); } else { retVal = pos; } return retVal; }
private long getFilePosition() throws IOException { long retVal; if (isCompressedInput() && null != filePosition) { retVal = filePosition.getPos(); } else { retVal = pos; } return retVal; }
private long getPos() throws IOException { long retVal = start; if (null != boundedInputStream) { retVal = end - boundedInputStream.getRemaining(); } else if (isCompressedInput && null != filePosition) { retVal = filePosition.getPos(); } return retVal; }
private long getFilePosition() throws IOException { long retVal; if (isCompressedInput() && null != filePosition) { retVal = filePosition.getPos(); } else { retVal = pos; } return retVal; }
private long getFilePosition() throws IOException { long retVal; if (isCompressedInput() && null != filePosition) { retVal = filePosition.getPos(); } else { retVal = pos; } return retVal; }
@Override protected long getFilePosition() throws IOException { long retVal; if (filePosition != null) { retVal = filePosition.getPos(); } else { retVal = sin.getPos(); } return retVal; }
public SampleIterable(InputStream in, long start, long end, float ratio, long seed) throws IOException { this.in = in; this.pos = in instanceof Seekable ? ((Seekable) in).getPos() : start; this.start = start; this.end = end; this.currentValue = new Text2(); this.nextValue = new Text2(); this.random = new Random(seed); this.ratio = ratio; this.eosReached = false; prefetchNext(); }