Support Questions
Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

Difference between CompactionCompression and compression type in HBase Column Family

Expert Contributor

What is the difference between getCompactionCompressionType and getCompressionType?

In , the description look same for both APIs.

094   * @return Compression type setting.
095   */
096  Compression.Algorithm getCompactionCompressionType();
097  /**
098   * @return Compression type setting.
099   */
100  Compression.Algorithm getCompressionType();

Super Collaborator

Compactor calls getCompactionCompressionType() and uses it during compaction:

this.compactionCompression = ( == null) ?
Compression.Algorithm.NONE :;

While getCompressionType() is used by the flusher - see code in DefaultStoreFlusher#flushSnapshot():

writer = store.createWriterInTmp(cellsCount,
store.getColumnFamilyDescriptor().getCompressionType(), false, true,
snapshot.isTagsPresent(), false);