options.add("compression = " + compressionOptions.get().build());
@Test(groups = "unit") public void should_create_no_compressions_options() throws Exception { // When final String built = noCompression().withChunkLengthInKb(128).withCRCCheckChance(0.6D).build(); // Then assertThat(built).isEqualTo("{'sstable_compression' : ''}"); } }
options.add("compression = " + compressionOptions.get().build());
options.add("compression = " + compressionOptions.get().build());
options.add("compression = " + compressionOptions.get().build());
private CompressionOptions getCompression(int blockSize) { int chunkLength = blockSize != 0 ? blockSize : AtlasDbConstants.MINIMUM_COMPRESSION_BLOCK_SIZE_KB; return SchemaBuilder.lz4().withChunkLengthInKb(chunkLength); }
/** * Create options for the Deflate compression strategy, to use in a CREATE or ALTER TABLE statement. * * @return the options. */ public static TableOptions.CompressionOptions deflate() { return new TableOptions.CompressionOptions(TableOptions.CompressionOptions.Algorithm.DEFLATE); }
/** * Create options for the Snappy compression strategy, to use in a CREATE or ALTER TABLE statement. * * @return the options. */ public static TableOptions.CompressionOptions snappy() { return new TableOptions.CompressionOptions(TableOptions.CompressionOptions.Algorithm.SNAPPY); }
/** * Create options for the Deflate compression strategy, to use in a CREATE or ALTER TABLE statement. * * @return the options. */ public static TableOptions.CompressionOptions deflate() { return new TableOptions.CompressionOptions(TableOptions.CompressionOptions.Algorithm.DEFLATE); }
/** * Create options for the LZ4 compression strategy, to use in a CREATE or ALTER TABLE statement. * * @return the options. */ public static TableOptions.CompressionOptions lz4() { return new TableOptions.CompressionOptions(TableOptions.CompressionOptions.Algorithm.LZ4); }
/** * Create options for the Snappy compression strategy, to use in a CREATE or ALTER TABLE statement. * * @return the options. */ public static TableOptions.CompressionOptions snappy() { return new TableOptions.CompressionOptions(TableOptions.CompressionOptions.Algorithm.SNAPPY); }
/** * Create options for the LZ4 compression strategy, to use in a CREATE or ALTER TABLE statement. * * @return the options. */ public static TableOptions.CompressionOptions lz4() { return new TableOptions.CompressionOptions(TableOptions.CompressionOptions.Algorithm.LZ4); }
@Test(groups = "unit") public void should_build_compressions_options_for_lz4() throws Exception { // When final String built = lz4().withChunkLengthInKb(128).withCRCCheckChance(0.6D).build(); // Then assertThat(built) .isEqualTo( "{'sstable_compression' : 'LZ4Compressor', 'chunk_length_kb' : 128, 'crc_check_chance' : 0.6}"); }
@Test(groups = "unit") public void should_create_no_compressions_options() throws Exception { // When final String built = noCompression().withChunkLengthInKb(128).withCRCCheckChance(0.6D).build(); // Then assertThat(built).isEqualTo("{'sstable_compression' : ''}"); } }
private static CompressionOptions compressionOptions(final Configuration configuration) { if (!configuration.get(CF_COMPRESSION)) { // No compression return noCompression(); } return Match(configuration.get(CF_COMPRESSION_TYPE)).of( Case($("LZ4Compressor"), lz4()), Case($("SnappyCompressor"), snappy()), Case($("DeflateCompressor"), deflate())) .withChunkLengthInKb(configuration.get(CF_COMPRESSION_BLOCK_SIZE)); }
/** * Create options for the LZ4 compression strategy, to use in a CREATE or ALTER TABLE statement. * * @return the options. */ public static TableOptions.CompressionOptions lz4() { return new TableOptions.CompressionOptions(TableOptions.CompressionOptions.Algorithm.LZ4); }
/** * Create options for the Deflate compression strategy, to use in a CREATE or ALTER TABLE statement. * * @return the options. */ public static TableOptions.CompressionOptions deflate() { return new TableOptions.CompressionOptions(TableOptions.CompressionOptions.Algorithm.DEFLATE); }
/** * Create options for the Snappy compression strategy, to use in a CREATE or ALTER TABLE statement. * * @return the options. */ public static TableOptions.CompressionOptions snappy() { return new TableOptions.CompressionOptions(TableOptions.CompressionOptions.Algorithm.SNAPPY); }
@Test(groups = "unit") public void should_create_deflate_compressions_options() throws Exception { // When final String built = deflate().withChunkLengthInKb(128).withCRCCheckChance(0.6D).build(); // Then assertThat(built) .isEqualTo( "{'sstable_compression' : 'DeflateCompressor', 'chunk_length_kb' : 128, 'crc_check_chance' : 0.6}"); }
@Test(groups = "unit") public void should_create_snappy_compressions_options() throws Exception { // When final String built = snappy().withChunkLengthInKb(128).withCRCCheckChance(0.6D).build(); // Then assertThat(built) .isEqualTo( "{'sstable_compression' : 'SnappyCompressor', 'chunk_length_kb' : 128, 'crc_check_chance' : 0.6}"); }