FSReaderImpl(FSDataInputStreamWrapper stream, long fileSize, HFileSystem hfs, Path path, HFileContext fileContext) throws IOException { this.fileSize = fileSize; this.hfs = hfs; if (path != null) { this.pathName = path.toString(); } this.fileContext = fileContext; this.hdrSize = headerSize(fileContext.isUseHBaseChecksum()); this.streamWrapper = stream; // Older versions of HBase didn't support checksum. this.streamWrapper.prepareForBlockReader(!fileContext.isUseHBaseChecksum()); defaultDecodingCtx = new HFileBlockDefaultDecodingContext(fileContext); encodedBlockDecodingCtx = defaultDecodingCtx; }
@Override public HFileBlockDecodingContext newDataBlockDecodingContext(HFileContext fileContext) { DataBlockEncoder encoder = encoding.getEncoder(); if (encoder != null) { return encoder.newDataBlockDecodingContext(fileContext); } return new HFileBlockDefaultDecodingContext(fileContext); }
public FSReaderImpl(FSDataInputStreamWrapper stream, long fileSize, HFileSystem hfs, Path path, HFileContext fileContext) throws IOException { super(fileSize, hfs, path, fileContext); this.streamWrapper = stream; // Older versions of HBase didn't support checksum. this.streamWrapper.prepareForBlockReader(!fileContext.isUseHBaseChecksum()); defaultDecodingCtx = new HFileBlockDefaultDecodingContext(fileContext); encodedBlockDecodingCtx = defaultDecodingCtx; }
public FSReaderV2(FSDataInputStreamWrapper stream, long fileSize, HFileSystem hfs, Path path, HFileContext fileContext) throws IOException { super(fileSize, hfs, path, fileContext); this.streamWrapper = stream; // Older versions of HBase didn't support checksum. this.streamWrapper.prepareForBlockReader(!fileContext.isUseHBaseChecksum()); defaultDecodingCtx = new HFileBlockDefaultDecodingContext(fileContext); encodedBlockDecodingCtx = new HFileBlockDefaultDecodingContext(fileContext); }
@Override public HFileBlockDecodingContext newDataBlockDecodingContext( Algorithm compressionAlgorithm) { DataBlockEncoder encoder = encoding.getEncoder(); if (encoder != null) { return encoder.newDataBlockDecodingContext(compressionAlgorithm); } return new HFileBlockDefaultDecodingContext(compressionAlgorithm); }
public FSReaderV2(FSDataInputStreamWrapper stream, Algorithm compressAlgo, long fileSize, int minorVersion, HFileSystem hfs, Path path) throws IOException { super(compressAlgo, fileSize, minorVersion, hfs, path); this.streamWrapper = stream; // Older versions of HBase didn't support checksum. boolean forceNoHBaseChecksum = (this.getMinorVersion() < MINOR_VERSION_WITH_CHECKSUM); this.streamWrapper.prepareForBlockReader(forceNoHBaseChecksum); defaultDecodingCtx = new HFileBlockDefaultDecodingContext(compressAlgo); encodedBlockDecodingCtx = new HFileBlockDefaultDecodingContext(compressAlgo); }
@Override public HFileBlockDecodingContext newOnDiskDataBlockDecodingContext( Algorithm compressionAlgorithm) { if (onDisk != null) { DataBlockEncoder encoder = onDisk.getEncoder(); if (encoder != null) { return encoder.newDataBlockDecodingContext( compressionAlgorithm); } } return new HFileBlockDefaultDecodingContext(compressionAlgorithm); }
public FSReaderV2(FSDataInputStream istream, FSDataInputStream istreamNoFsChecksum, Algorithm compressAlgo, long fileSize, int minorVersion, HFileSystem hfs, Path path) throws IOException { super(istream, istreamNoFsChecksum, compressAlgo, fileSize, minorVersion, hfs, path); if (hfs != null) { // Check the configuration to determine whether hbase-level // checksum verification is needed or not. useHBaseChecksum = hfs.useHBaseChecksum(); } else { // The configuration does not specify anything about hbase checksum // validations. Set it to true here assuming that we will verify // hbase checksums for all reads. For older files that do not have // stored checksums, this flag will be reset later. useHBaseChecksum = true; } // for older versions, hbase did not store checksums. if (getMinorVersion() < MINOR_VERSION_WITH_CHECKSUM) { useHBaseChecksum = false; } this.useHBaseChecksumConfigured = useHBaseChecksum; defaultDecodingCtx = new HFileBlockDefaultDecodingContext(compressAlgo); encodedBlockDecodingCtx = new HFileBlockDefaultDecodingContext(compressAlgo); }
@Override public HFileBlockDecodingContext newDataBlockDecodingContext(HFileContext meta) { return new HFileBlockDefaultDecodingContext(meta); }
@Override public HFileBlockDecodingContext newDataBlockDecodingContext( Algorithm compressionAlgorithm) { return new HFileBlockDefaultDecodingContext(compressionAlgorithm); }
@Override public HFileBlockDecodingContext newDataBlockDecodingContext(Algorithm compressionAlgorithm) { return new HFileBlockDefaultDecodingContext(compressionAlgorithm); }
@Override public HFileBlockDecodingContext newOnDiskDataBlockDecodingContext( Algorithm compressionAlgorithm) { return new HFileBlockDefaultDecodingContext(compressionAlgorithm); }