Source:
static CfDef getCfDef(String keyspace, TableReference tableRef, int gcGraceSeconds, byte[] rawMetadata) { CfDef cf = getStandardCfDef(keyspace, AbstractKeyValueService.internalTableName(tableRef)); Optional<TableMetadata> tableMetadata = CassandraKeyValueServices.isEmptyOrInvalidMetadata(rawMetadata) ? Optional.empty() : Optional.of(TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(rawMetadata)); Map<String, String> compressionOptions = getCompressionOptions(tableMetadata); cf.setCompression_options(compressionOptions); if (tableMetadata.map(TableMetadata::isAppendHeavyAndReadLight).orElse(false)) { cf.setCompaction_strategy(CassandraConstants.SIZE_TIERED_COMPACTION_STRATEGY); cf.setCompaction_strategy_optionsIsSet(false); } TableMetadataPersistence.CachePriority cachePriority = tableMetadata.map(TableMetadata::getCachePriority) .orElse(TableMetadataPersistence.CachePriority.WARM); switch (cachePriority) { case COLDEST: break; case COLD: break; case WARM: break; case HOT: break; case HOTTEST: cf.setPopulate_io_cache_on_flushIsSet(true); break; default: throw new PalantirRuntimeException("Unknown cache priority: " + cachePriority); } cf.setGc_grace_seconds(gcGraceSeconds); cf.setBloom_filter_fp_chance( tableMetadata.map(CassandraTableOptions::bloomFilterFpChance) .orElse(CassandraConstants.DEFAULT_LEVELED_COMPACTION_BLOOM_FILTER_FP_CHANCE)); cf.setMin_index_interval( tableMetadata.map(CassandraTableOptions::minIndexInterval) .orElse(CassandraConstants.DEFAULT_MIN_INDEX_INTERVAL)); cf.setMax_index_interval( tableMetadata.map(CassandraTableOptions::maxIndexInterval) .orElse(CassandraConstants.DEFAULT_MAX_INDEX_INTERVAL)); return cf; }

Target:
static CfDef getCfDef(String keyspace, TableReference tableRef, int gcGraceSeconds, byte[] rawMetadata) { CfDef cf = getStandardCfDef(keyspace, AbstractKeyValueService.internalTableName(tableRef)); Optional<TableMetadata> tableMetadata = CassandraKeyValueServices.isEmptyOrInvalidMetadata(rawMetadata) ? Optional.empty() : Optional.of(TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(rawMetadata)); Map<String, String> compressionOptions = getCompressionOptions(tableMetadata); cf.setCompression_options(compressionOptions); boolean appendHeavyAndReadLight = tableMetadata.map(TableMetadata::isAppendHeavyAndReadLight).orElse(false); if (appendHeavyAndReadLight) { cf.setCompaction_strategy(CassandraConstants.SIZE_TIERED_COMPACTION_STRATEGY); cf.setCompaction_strategy_optionsIsSet(false); } TableMetadataPersistence.CachePriority cachePriority = tableMetadata.map(TableMetadata::getCachePriority) .orElse(TableMetadataPersistence.CachePriority.WARM); switch (cachePriority) { case COLDEST: break; case COLD: break; case WARM: break; case HOT: break; case HOTTEST: cf.setPopulate_io_cache_on_flushIsSet(true); break; default: throw new PalantirRuntimeException("Unknown cache priority: " + cachePriority); } cf.setGc_grace_seconds(gcGraceSeconds); double bloomFilterFpChance = tableMetadata.map(CassandraTableOptions::bloomFilterFpChance) .orElse(CassandraConstants.DEFAULT_LEVELED_COMPACTION_BLOOM_FILTER_FP_CHANCE); cf.setBloom_filter_fp_chance(bloomFilterFpChance); int minIndexInterval = tableMetadata.map(CassandraTableOptions::minIndexInterval) .orElse(CassandraConstants.DEFAULT_MIN_INDEX_INTERVAL); cf.setMin_index_interval(minIndexInterval); int maxIndexInterval = tableMetadata.map(CassandraTableOptions::maxIndexInterval) .orElse(CassandraConstants.DEFAULT_MAX_INDEX_INTERVAL); cf.setMax_index_interval(maxIndexInterval); return cf; }