Class BasicCompactionStrategy


  • public class BasicCompactionStrategy
    extends DefaultCompactionStrategy
    A compaction strategy that covers the following uses cases.
    • Filtering out input files larger than a specified size. These are never considered for compaction.
    • Compressing output files differently when the sum of the input files exceeds a specified size.

    To filter out input files based on size set table.majc.compaction.strategy.opts.filter.size to the desired size.

    To use a different compression for larger inputs set table.majc.compaction.strategy.opts.large.compress.threshold to bytes and table.majc.compaction.strategy.opts.large.compress.type to a compression type like gz or snappy. When setting one of these properties then the other must be set. When the total size of files being compacted is larger than the threshold then the specified compression type is used.

    To use this strategy with Minor Compactions set table.file.compress.type=snappy and set a different compress type in table.majc.compaction.strategy.opts.large.compress.type for larger files.

    The options that take sizes are in bytes and the suffixes K,M,and G can be used.