Support Questions
Find answers, ask questions, and share your expertise
Announcements
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 https://hbase.apache.org/apidocs/src-html/org/apache/hadoop/hbase/client/ColumnFamilyDescriptor.html , 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();
1 REPLY 1

Super Collaborator

Compactor calls getCompactionCompressionType() and uses it during compaction:

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

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

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