@Override public boolean markSupported() { return in.markSupported(); }
@Override public boolean markSupported() { return in.markSupported(); }
@Override public boolean markSupported() { return in.markSupported(); }
@Override public boolean markSupported() { return in.markSupported(); }
public StatArchiveFile(StatArchiveReader reader, File archiveName, boolean dump, ValueFilter[] filters) throws IOException { this.reader = reader; this.archiveName = archiveName; this.dump = dump; this.compressed = archiveName.getPath().endsWith(".gz"); this.is = new FileInputStream(this.archiveName); if (this.compressed) { this.dataIn = new DataInputStream( new BufferedInputStream(new GZIPInputStream(this.is, BUFFER_SIZE), BUFFER_SIZE)); } else { this.dataIn = new DataInputStream(new BufferedInputStream(this.is, BUFFER_SIZE)); } this.updateOK = this.dataIn.markSupported(); this.filters = createFilters(filters); }
/** * Parses an RegionInfo instance from the passed in stream. * Presumes the RegionInfo was serialized to the stream with * {@link #toDelimitedByteArray(RegionInfo)}. * @param in * @return An instance of RegionInfo. * @throws IOException */ static RegionInfo parseFrom(final DataInputStream in) throws IOException { // I need to be able to move back in the stream if this is not a pb // serialization so I can do the Writable decoding instead. int pblen = ProtobufUtil.lengthOfPBMagic(); byte [] pbuf = new byte[pblen]; if (in.markSupported()) { //read it with mark() in.mark(pblen); } //assumption: if Writable serialization, it should be longer than pblen. int read = in.read(pbuf); if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen); if (ProtobufUtil.isPBMagicPrefix(pbuf)) { return ProtobufUtil.toRegionInfo(HBaseProtos.RegionInfo.parseDelimitedFrom(in)); } else { throw new IOException("PB encoded RegionInfo expected"); } }
if (in.markSupported()) in.mark(pblen); int read = in.read(pbuf); if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen); parsePB(HFileProtos.FileInfoProto.parseDelimitedFrom(in)); } else { if (in.markSupported()) { in.reset(); parseWritable(in);
/** * Parses an HRegionInfo instance from the passed in stream. Presumes the HRegionInfo was * serialized to the stream with {@link #toDelimitedByteArray()} * @param in * @return An instance of HRegionInfo. * @throws IOException * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * Use {@link RegionInfo#parseFrom(DataInputStream)}. */ @Deprecated @InterfaceAudience.Private public static HRegionInfo parseFrom(final DataInputStream in) throws IOException { // I need to be able to move back in the stream if this is not a pb serialization so I can // do the Writable decoding instead. int pblen = ProtobufUtil.lengthOfPBMagic(); byte [] pbuf = new byte[pblen]; if (in.markSupported()) { //read it with mark() in.mark(pblen); } //assumption: if Writable serialization, it should be longer than pblen. int read = in.read(pbuf); if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen); if (ProtobufUtil.isPBMagicPrefix(pbuf)) { return convert(HBaseProtos.RegionInfo.parseDelimitedFrom(in)); } else { throw new IOException("PB encoded HRegionInfo expected"); } }
@Override public boolean markSupported() { return in.markSupported(); } }
/** * Parses an HRegionInfo instance from the passed in stream. Presumes the HRegionInfo was * serialized to the stream with {@link #toDelimitedByteArray()} * @param in * @return An instance of HRegionInfo. * @throws IOException * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * Use {@link RegionInfo#parseFrom(DataInputStream)}. */ @Deprecated @InterfaceAudience.Private public static HRegionInfo parseFrom(final DataInputStream in) throws IOException { // I need to be able to move back in the stream if this is not a pb serialization so I can // do the Writable decoding instead. int pblen = ProtobufUtil.lengthOfPBMagic(); byte [] pbuf = new byte[pblen]; if (in.markSupported()) { //read it with mark() in.mark(pblen); } //assumption: if Writable serialization, it should be longer than pblen. int read = in.read(pbuf); if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen); if (ProtobufUtil.isPBMagicPrefix(pbuf)) { return convert(HBaseProtos.RegionInfo.parseDelimitedFrom(in)); } else { throw new IOException("PB encoded HRegionInfo expected"); } }
/** * Parses an RegionInfo instance from the passed in stream. * Presumes the RegionInfo was serialized to the stream with * {@link #toDelimitedByteArray(RegionInfo)}. * @param in * @return An instance of RegionInfo. * @throws IOException */ static RegionInfo parseFrom(final DataInputStream in) throws IOException { // I need to be able to move back in the stream if this is not a pb // serialization so I can do the Writable decoding instead. int pblen = ProtobufUtil.lengthOfPBMagic(); byte [] pbuf = new byte[pblen]; if (in.markSupported()) { //read it with mark() in.mark(pblen); } //assumption: if Writable serialization, it should be longer than pblen. int read = in.read(pbuf); if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen); if (ProtobufUtil.isPBMagicPrefix(pbuf)) { return ProtobufUtil.toRegionInfo(HBaseProtos.RegionInfo.parseDelimitedFrom(in)); } else { throw new IOException("PB encoded RegionInfo expected"); } }
@Override public boolean markSupported() { return in.markSupported(); } }
@Override public boolean markSupported() { return in.markSupported(); } }
@Override public boolean markSupported() { return in.markSupported(); }
@Override public boolean markSupported() { return in.markSupported(); }
@Override public boolean markSupported() { return in.markSupported(); }
@Override public boolean markSupported() { return in.markSupported(); }
@Override public boolean markSupported() { return in.markSupported(); }
@Override public boolean markSupported() { return in.markSupported(); }
public MessageUnpacker(InputStream str) { if (str instanceof DataInputStream) { this.stream = (DataInputStream) str; } else { this.stream = new DataInputStream(str); } checkState(this.stream.markSupported()); }