public int getHFileMinorVersion() { return reader.getTrailer().getMinorVersion(); }
/** * File version check is a little sloppy. We read v3 files but can also read v2 files if their * content has been pb'd; files written with 0.98. */ private void checkFileVersion() { int majorVersion = trailer.getMajorVersion(); if (majorVersion == getMajorVersion()) return; int minorVersion = trailer.getMinorVersion(); if (majorVersion == 2 && minorVersion >= MIN_V2_MINOR_VERSION_WITH_PB) return; // We can read v3 or v2 versions of hfile. throw new IllegalArgumentException("Invalid HFile version: major=" + trailer.getMajorVersion() + ", minor=" + trailer.getMinorVersion() + ": expected at least " + "major=2 and minor=" + MAX_MINOR_VERSION); }
private void serializeAsWritable(DataOutputStream output, FixedFileTrailer fft) throws IOException { BlockType.TRAILER.write(output); output.writeLong(fft.getFileInfoOffset()); output.writeLong(fft.getLoadOnOpenDataOffset()); output.writeInt(fft.getDataIndexCount()); output.writeLong(fft.getUncompressedDataIndexSize()); output.writeInt(fft.getMetaIndexCount()); output.writeLong(fft.getTotalUncompressedBytes()); output.writeLong(fft.getEntryCount()); output.writeInt(fft.getCompressionCodec().ordinal()); output.writeInt(fft.getNumDataIndexLevels()); output.writeLong(fft.getFirstDataBlockOffset()); output.writeLong(fft.getLastDataBlockOffset()); Bytes.writeStringFixedSize(output, fft.getComparatorClassName(), MAX_COMPARATOR_NAME_LENGTH); output.writeInt(FixedFileTrailer.materializeVersion(fft.getMajorVersion(), fft.getMinorVersion())); }
public int getHFileMinorVersion() { return reader.getTrailer().getMinorVersion(); }
protected HFileContext createHFileContext(FSDataInputStreamWrapper fsdis, long fileSize, HFileSystem hfs, Path path, FixedFileTrailer trailer) throws IOException { return new HFileContextBuilder() .withIncludesMvcc(this.includesMemstoreTS) .withCompression(this.compressAlgo) .withHBaseCheckSum(trailer.getMinorVersion() >= MINOR_VERSION_WITH_CHECKSUM) .build(); }
readKeyValueLen(); if (lastKeyValueSize == -1 && blockBuffer.position() == 0 && this.reader.trailer.getMinorVersion() >= MINOR_VERSION_WITH_FAKED_KEY) { return HConstants.INDEX_KEY_MAGIC;
private void serializeAsWritable(DataOutputStream output, FixedFileTrailer fft) throws IOException { BlockType.TRAILER.write(output); output.writeLong(fft.getFileInfoOffset()); output.writeLong(fft.getLoadOnOpenDataOffset()); output.writeInt(fft.getDataIndexCount()); output.writeLong(fft.getUncompressedDataIndexSize()); output.writeInt(fft.getMetaIndexCount()); output.writeLong(fft.getTotalUncompressedBytes()); output.writeLong(fft.getEntryCount()); output.writeInt(fft.getCompressionCodec().ordinal()); output.writeInt(fft.getNumDataIndexLevels()); output.writeLong(fft.getFirstDataBlockOffset()); output.writeLong(fft.getLastDataBlockOffset()); Bytes.writeStringFixedSize(output, fft.getComparatorClassName(), MAX_COMPARATOR_NAME_LENGTH); output.writeInt(FixedFileTrailer.materializeVersion(fft.getMajorVersion(), fft.getMinorVersion())); }
closeIStream, cacheConf, hfs); trailer.expectMajorVersion(2); validateMinorVersion(path, trailer.getMinorVersion()); HFileBlock.FSReaderV2 fsBlockReaderV2 = new HFileBlock.FSReaderV2(fsdis, fsdisNoFsChecksum, compressAlgo, fileSize, trailer.getMinorVersion(), hfs, path); this.fsBlockReader = fsBlockReaderV2; // upcast
this.conf = conf; trailer.expectMajorVersion(getMajorVersion()); validateMinorVersion(path, trailer.getMinorVersion()); this.hfileContext = createHFileContext(fsdis, fileSize, hfs, path, trailer); HFileBlock.FSReaderImpl fsBlockReaderV2 =