Support alternate compression for major compactions

Review Request #821 — Created Sept. 12, 2010 and submitted

apurtell
old-hbase
trunk
HBASE-2988
hbase
Support alternate compression for major compactions.

This is expected to be an uncommmon configuration so I did not pollute the HColumnDescriptor constructor with the new option; instead only added convenience {get,set}ters.
Created table with LZO compression, inserted 10GB of data, altered schema with COMPRESSION_COMPACT of 'LZMA' (custom LZMA Hadoop compression plugin), initiated major compaction, confirmed the results by examining HFiles on local fs with the UNIX file utility.
apurtell
  1. 
      
  2. I thought MAJOR_COMPRESSION was worse.
  3. This is needed because the get*Compression() methods by convention return Compression.Algorithm.NONE if unset.
  4. 
      
todd
  1. 
      
  2. This will throw NPE if it's not set, right?
    Why not just make this return getCompression() if n == null, then you can get rid of the hasCompactionCompression() check down in StoreFile below and simplify things a bit?
    
    Also why redundant getCompactionCompression and getCompactionCompressionType?
    1. There is also getCompaction and getCompactionType.
  3. 
      
apurtell
todd
  1. 
      
  2. don't you want to return getCompression() in this type? ie compaction compression defaults to "same as the rest of the table" unless specifically overridden?
  3. this way you can't specify "I don't want to compress majors"... probably unlikely, but we should probably support it
  4. 
      
apurtell
Review request changed

Change Summary:

getCompactionCompression falls back to getCompression if COMPRESSION_COMPACT is unset

Diff:

Revision 3 (+69 -3)

Show changes

apurtell
todd
  1. +1
  2. 
      
Loading...