.addColumn("a", ks.getUserType("atype").copy(true)) .withOptions() .compactionOptions(SchemaBuilder.leveledStrategy().ssTableSizeInMB(95))); } else { .addColumn("a", DataType.cint()) .withOptions() .compactionOptions(SchemaBuilder.leveledStrategy().ssTableSizeInMB(95)));
.caching(Caching.ROWS_ONLY) .comment("This is a comment") .compactionOptions(leveledStrategy().ssTableSizeInMB(160)) .compressionOptions(lz4()) .dcLocalReadRepairChance(0.21)
private static void initializeTable(final Session session, final String keyspaceName, final String tableName, final Configuration configuration, final boolean allowCompactStorage) { final Options createTable = createTable(keyspaceName, tableName) .ifNotExists() .addPartitionKey(KEY_COLUMN_NAME, DataType.blob()) .addClusteringColumn(COLUMN_COLUMN_NAME, DataType.blob()) .addColumn(VALUE_COLUMN_NAME, DataType.blob()) .withOptions() .compressionOptions(compressionOptions(configuration)) .compactionOptions(compactionOptions(configuration)); // COMPACT STORAGE is allowed on Cassandra 2 or earlier // when COMPACT STORAGE is allowed, the default is to enable it final boolean useCompactStorage = (allowCompactStorage && configuration.has(CF_COMPACT_STORAGE)) ? configuration.get(CF_COMPACT_STORAGE) : allowCompactStorage; session.execute(useCompactStorage ? createTable.compactStorage() : createTable); }
.addColumn("a", ks.getUserType("atype").copy(true)) .withOptions() .compactionOptions(SchemaBuilder.leveledStrategy().ssTableSizeInMB(95))); } else { .addColumn("a", DataType.cint()) .withOptions() .compactionOptions(SchemaBuilder.leveledStrategy().ssTableSizeInMB(95)));
.caching(Caching.ROWS_ONLY) .comment("This is a comment") .compactionOptions(leveledStrategy().ssTableSizeInMB(160)) .compressionOptions(lz4()) .dcLocalReadRepairChance(0.21)
.bloomFilterFPChance(falsePositive(tableMetadata.hasNegativeLookups(), appendHeavyReadLight)) .caching(SchemaBuilder.Caching.KEYS_ONLY) .compactionOptions(getCompaction(appendHeavyReadLight)) .compactStorage() .compressionOptions(getCompression(tableMetadata.getExplicitCompressionBlockSizeKB()))
.bloomFilterFPChance(falsePositive(tableMetadata.hasNegativeLookups(), appendHeavyReadLight)) .caching(SchemaBuilder.Caching.KEYS_ONLY) .compactionOptions(getCompaction(appendHeavyReadLight)) .compactStorage() .compressionOptions(getCompression(tableMetadata.getExplicitCompressionBlockSizeKB()))