@Override protected void initAfterCompression() throws IOException { initAfterCompression(null); }
private String initInternal(FSDataInputStream stream, boolean isFirst) throws IOException { close(); long expectedPos = PB_WAL_MAGIC.length; if (stream == null) { WALHdrContext hdrCtxt = readHeader(builder, stream); WALHdrResult walHdrRes = hdrCtxt.getResult(); if (walHdrRes == WALHdrResult.EOF) { this.walEditsStopOffset = this.fileLength; long currentPosition = stream.getPos(); trailerPresent = setTrailerIfPresent(); this.seekOnFs(currentPosition); if (LOG.isTraceEnabled()) { LOG.trace("After reading the trailer: walEditsStopOffset: " + this.walEditsStopOffset
@Override protected void initAfterCompression(String cellCodecClsName) throws IOException { WALCellCodec codec = getCodec(this.conf, cellCodecClsName, this.compressionContext); this.cellDecoder = codec.getDecoder(this.inputStream); if (this.hasCompression) { this.byteStringUncompressor = codec.getByteStringUncompressor(); } else { this.byteStringUncompressor = WALCellCodec.getNoneUncompressor(); } }
@Override public void reset() throws IOException { String clsName = initInternal(null, false); initAfterCompression(clsName); // We need a new decoder (at least). }
List<String> writerClsNames = ((ProtobufLogReader) log).getWriterClsNames(); if (writerClsNames != null && writerClsNames.size() > 0) { out.print("Writer Classes: "); String cellCodecClsName = ((ProtobufLogReader) log).getCodecClsName(); if (cellCodecClsName != null) { out.println("Cell Codec Class: " + cellCodecClsName);
this.inputStream.getPos()); seekOnFs(originalPosition); return false; IOException realEofEx = extractHiddenEof(ex); throw (EOFException) new EOFException("EOF " + message). initCause(realEofEx != null ? realEofEx : ex); + "current position and original position match at " + originalPosition); seekOnFs(0); } else { + "from " + inputStream.getPos()+" to " + originalPosition, eof); seekOnFs(originalPosition);
@Override protected String initReader(FSDataInputStream stream) throws IOException { return initInternal(stream, true); }
protected WALHdrContext readHeader(Builder builder, FSDataInputStream stream) throws IOException { boolean res = builder.mergeDelimitedFrom(stream); if (!res) return new WALHdrContext(WALHdrResult.EOF, null); if (builder.hasWriterClsName() && !getWriterClsNames().contains(builder.getWriterClsName())) { return new WALHdrContext(WALHdrResult.UNKNOWN_WRITER_CLS, null); } String clsName = null; if (builder.hasCellCodecClsName()) { clsName = builder.getCellCodecClsName(); } return new WALHdrContext(WALHdrResult.SUCCESS, clsName); }
@Override protected WALHdrContext readHeader(WALHeader.Builder builder, FSDataInputStream stream) throws IOException { WALHdrContext hdrCtxt = super.readHeader(builder, stream); WALHdrResult result = hdrCtxt.getResult();
@Override public void reset() throws IOException { String clsName = initInternal(null, false); initAfterCompression(clsName); // We need a new decoder (at least). }
List<String> writerClsNames = ((ProtobufLogReader) log).getWriterClsNames(); if (writerClsNames != null && writerClsNames.size() > 0) { out.print("Writer Classes: "); String cellCodecClsName = ((ProtobufLogReader) log).getCodecClsName(); if (cellCodecClsName != null) { out.println("Cell Codec Class: " + cellCodecClsName);
IOException realEofEx = extractHiddenEof(ex); throw (EOFException) new EOFException("EOF " + message). initCause(realEofEx != null ? realEofEx : ex); seekOnFs(originalPosition); return false;
@Override protected String initReader(FSDataInputStream stream) throws IOException { return initInternal(stream, true); }
protected WALHdrContext readHeader(Builder builder, FSDataInputStream stream) throws IOException { boolean res = builder.mergeDelimitedFrom(stream); if (!res) return new WALHdrContext(WALHdrResult.EOF, null); if (builder.hasWriterClsName() && !getWriterClsNames().contains(builder.getWriterClsName())) { return new WALHdrContext(WALHdrResult.UNKNOWN_WRITER_CLS, null); } String clsName = null; if (builder.hasCellCodecClsName()) { clsName = builder.getCellCodecClsName(); } return new WALHdrContext(WALHdrResult.SUCCESS, clsName); }
@Override protected WALHdrContext readHeader(WALHeader.Builder builder, FSDataInputStream stream) throws IOException { WALHdrContext hdrCtxt = super.readHeader(builder, stream); WALHdrResult result = hdrCtxt.getResult();
private String initInternal(FSDataInputStream stream, boolean isFirst) throws IOException { close(); long expectedPos = PB_WAL_MAGIC.length; if (stream == null) { WALHdrContext hdrCtxt = readHeader(builder, stream); WALHdrResult walHdrRes = hdrCtxt.getResult(); if (walHdrRes == WALHdrResult.EOF) { this.walEditsStopOffset = this.fileLength; long currentPosition = stream.getPos(); trailerPresent = setTrailerIfPresent(); this.seekOnFs(currentPosition); if (LOG.isTraceEnabled()) { LOG.trace("After reading the trailer: walEditsStopOffset: " + this.walEditsStopOffset
@Override protected void initAfterCompression(String cellCodecClsName) throws IOException { if (decryptor != null && cellCodecClsName.equals(SecureWALCellCodec.class.getName())) { WALCellCodec codec = SecureWALCellCodec.getCodec(this.conf, decryptor); this.cellDecoder = codec.getDecoder(this.inputStream); // We do not support compression with WAL encryption this.compressionContext = null; this.byteStringUncompressor = WALCellCodec.getNoneUncompressor(); this.hasCompression = false; } else { super.initAfterCompression(cellCodecClsName); } }