Class TableOptions.CompressionOptions
- java.lang.Object
-
- com.datastax.driver.core.schemabuilder.TableOptions.CompressionOptions
-
- Direct Known Subclasses:
TableOptions.CompressionOptions.NoCompression
- Enclosing class:
- TableOptions<T extends TableOptions>
public static class TableOptions.CompressionOptions extends Object
The compression options for a CREATE or ALTER TABLE statement.To create instances, use
SchemaBuilder.noCompression(),SchemaBuilder.lz4(),SchemaBuilder.snappy()orSchemaBuilder.deflate().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTableOptions.CompressionOptions.AlgorithmCompression algorithms.static classTableOptions.CompressionOptions.NoCompression
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbuild()TableOptions.CompressionOptionswithChunkLengthInKb(Integer chunkLengthInKb)On disk, SSTables are compressed by block to allow random reads.TableOptions.CompressionOptionswithCRCCheckChance(Double crcCheckChance)When compression is enabled, each compressed block includes a checksum of that block for the purpose of detecting disk bitrate and avoiding the propagation of corruption to other replica.
-
-
-
Method Detail
-
withChunkLengthInKb
public TableOptions.CompressionOptions withChunkLengthInKb(Integer chunkLengthInKb)
On disk, SSTables are compressed by block to allow random reads. This subproperty of compression defines the size (in KB) of the block. Values larger than the default value might improve the compression rate, but increases the minimum size of data to be read from disk when a read occurs. The default value is a good middle-ground for compressing tables. Adjust compression size to account for read/write access patterns (how much data is typically requested at once) and the average size of rows in the table.If no call is made to this method, the default value set by Cassandra is 54.
- Parameters:
chunkLengthInKb- the new value.- Returns:
- this object (for call chaining).
-
withCRCCheckChance
public TableOptions.CompressionOptions withCRCCheckChance(Double crcCheckChance)
When compression is enabled, each compressed block includes a checksum of that block for the purpose of detecting disk bitrate and avoiding the propagation of corruption to other replica. This option defines the probability with which those checksums are checked during read. By default they are always checked. Set to 0 to disable checksum checking and to 0.5, for instance, to check them on every other read.If no call is made to this method, the default value set by Cassandra is 1.0 (always check).
- Parameters:
crcCheckChance- the new value.- Returns:
- this object (for call chaining).
-
build
public String build()
-
-