Example usage for org.apache.cassandra.hadoop ConfigHelper getOutputCompressionClass

List of usage examples for org.apache.cassandra.hadoop ConfigHelper getOutputCompressionClass

Introduction

In this page you can find the example usage for org.apache.cassandra.hadoop ConfigHelper getOutputCompressionClass.

Prototype

public static String getOutputCompressionClass(Configuration conf) 

Source Link

Usage

From source file:andromache.config.CassandraConfigHelper.java

License:Apache License

public static CompressionParameters getOutputCompressionParamaters(Configuration conf) {
    if (ConfigHelper.getOutputCompressionClass(conf) == null)
        return new CompressionParameters(null);

    Map<String, String> options = new HashMap<String, String>();
    options.put(CompressionParameters.SSTABLE_COMPRESSION, ConfigHelper.getOutputCompressionClass(conf));
    options.put(CompressionParameters.CHUNK_LENGTH_KB, ConfigHelper.getOutputCompressionChunkLength(conf));

    try {//www  .j a  v  a 2  s. c  o m
        return CompressionParameters.create(options);
    } catch (ConfigurationException e) {
        throw new RuntimeException(e);
    }
}