/** * get the compressor name from chunk meta * before 1.5.0, we only support snappy and do not have compressor_name field; * after 1.5.0, we directly get the compressor from the compressor_name field */ public static String getCompressorNameFromChunkMeta(ChunkCompressionMeta chunkCompressionMeta) { if (chunkCompressionMeta.isSetCompressor_name()) { return chunkCompressionMeta.getCompressor_name(); } else { // this is for legacy store before 1.5.0 return CompressorFactory.NativeSupportedCompressor.SNAPPY.getName(); } } /**
public Object getFieldValue(_Fields field) { switch (field) { case COMPRESSION_CODEC: return getCompression_codec(); case TOTAL_UNCOMPRESSED_SIZE: return getTotal_uncompressed_size(); case TOTAL_COMPRESSED_SIZE: return getTotal_compressed_size(); case COMPRESSOR_NAME: return getCompressor_name(); } throw new IllegalStateException(); }