options.add("compaction = " + compactionOptions.get().build());
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions();
/** * Define a free-form option as a key/value pair. * * <p>This method is provided as a fallback if the SchemaBuilder is used with a more recent * version of Cassandra that has new, unsupported options. * * @param key the name of the option. * @param value the value of the option. If it's a {@code CharSequence}, it will be included in * single quotes, otherwise the result of invoking its {@code toString} method will be used * unquoted. * @return this object (for call chaining). */ public T freeformOption(String key, Object value) { if (Strings.isNullOrEmpty(key)) { throw new IllegalArgumentException("Key for custom option should not be null or blank"); } customOptions.add(buildCustomOption(key, value)); return self; }
options.add("compaction = " + compactionOptions.get().build());
options.add("compaction = " + compactionOptions.get().build());
options.add("compaction = " + compactionOptions.get().build());
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions(); List<String> options = new ArrayList<String>(generalOptions); if (bucketHigh.isPresent()) { options.add("'bucket_high' : " + bucketHigh.get()); } if (bucketLow.isPresent()) { options.add("'bucket_low' : " + bucketLow.get()); } if (coldReadsRatioToOmit.isPresent()) { options.add("'cold_reads_to_omit' : " + coldReadsRatioToOmit.get()); } if (minThreshold.isPresent()) { options.add("'min_threshold' : " + minThreshold.get()); } if (maxThreshold.isPresent()) { options.add("'max_threshold' : " + maxThreshold.get()); } if (minSSTableSizeInBytes.isPresent()) { options.add("'min_sstable_size' : " + minSSTableSizeInBytes.get()); } return "{" + Joiner.on(", ").join(options) + "}"; } }
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions(); List<String> options = new ArrayList<String>(generalOptions); if (bucketHigh.isPresent()) { options.add("'bucket_high' : " + bucketHigh.get()); } if (bucketLow.isPresent()) { options.add("'bucket_low' : " + bucketLow.get()); } if (coldReadsRatioToOmit.isPresent()) { options.add("'cold_reads_to_omit' : " + coldReadsRatioToOmit.get()); } if (minThreshold.isPresent()) { options.add("'min_threshold' : " + minThreshold.get()); } if (maxThreshold.isPresent()) { options.add("'max_threshold' : " + maxThreshold.get()); } if (minSSTableSizeInBytes.isPresent()) { options.add("'min_sstable_size' : " + minSSTableSizeInBytes.get()); } return "{" + Joiner.on(", ").join(options) + "}"; } }
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions(); List<String> options = new ArrayList<String>(generalOptions); if (baseTimeSeconds.isPresent()) { options.add("'base_time_seconds' : " + baseTimeSeconds.get()); } if (maxSSTableAgeDays.isPresent()) { options.add("'max_sstable_age_days' : " + maxSSTableAgeDays.get()); } if (minThreshold.isPresent()) { options.add("'min_threshold' : " + minThreshold.get()); } if (maxThreshold.isPresent()) { options.add("'max_threshold' : " + maxThreshold.get()); } if (timestampResolution.isPresent()) { options.add("'timestamp_resolution' : '" + timestampResolution.get() + "'"); } return "{" + Joiner.on(", ").join(options) + "}"; } }
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions(); List<String> options = new ArrayList<String>(generalOptions); if (bucketHigh.isPresent()) { options.add("'bucket_high' : " + bucketHigh.get()); } if (bucketLow.isPresent()) { options.add("'bucket_low' : " + bucketLow.get()); } if (coldReadsRatioToOmit.isPresent()) { options.add("'cold_reads_to_omit' : " + coldReadsRatioToOmit.get()); } if (minThreshold.isPresent()) { options.add("'min_threshold' : " + minThreshold.get()); } if (maxThreshold.isPresent()) { options.add("'max_threshold' : " + maxThreshold.get()); } if (minSSTableSizeInBytes.isPresent()) { options.add("'min_sstable_size' : " + minSSTableSizeInBytes.get()); } return "{" + Joiner.on(", ").join(options) + "}"; } }
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions(); List<String> options = new ArrayList<String>(generalOptions); if (baseTimeSeconds.isPresent()) { options.add("'base_time_seconds' : " + baseTimeSeconds.get()); } if (maxSSTableAgeDays.isPresent()) { options.add("'max_sstable_age_days' : " + maxSSTableAgeDays.get()); } if (minThreshold.isPresent()) { options.add("'min_threshold' : " + minThreshold.get()); } if (maxThreshold.isPresent()) { options.add("'max_threshold' : " + maxThreshold.get()); } if (timestampResolution.isPresent()) { options.add("'timestamp_resolution' : '" + timestampResolution.get() + "'"); } return "{" + Joiner.on(", ").join(options) + "}"; } }
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions(); List<String> options = new ArrayList<String>(generalOptions); if (baseTimeSeconds.isPresent()) { options.add("'base_time_seconds' : " + baseTimeSeconds.get()); } if (maxSSTableAgeDays.isPresent()) { options.add("'max_sstable_age_days' : " + maxSSTableAgeDays.get()); } if (minThreshold.isPresent()) { options.add("'min_threshold' : " + minThreshold.get()); } if (maxThreshold.isPresent()) { options.add("'max_threshold' : " + maxThreshold.get()); } if (timestampResolution.isPresent()) { options.add("'timestamp_resolution' : '" + timestampResolution.get() + "'"); } return "{" + Joiner.on(", ").join(options) + "}"; } }
/** * Define a free-form option as a key/value pair. * <p/> * This method is provided as a fallback if the SchemaBuilder is used with a more recent version of Cassandra that has new, unsupported options. * * @param key the name of the option. * @param value the value of the option. If it's a {@code CharSequence}, it will be included in single quotes, otherwise the result of invoking its * {@code toString} method will be used unquoted. * @return this object (for call chaining). */ public T freeformOption(String key, Object value) { if (Strings.isNullOrEmpty(key)) { throw new IllegalArgumentException("Key for custom option should not be null or blank"); } customOptions.add(buildCustomOption(key, value)); return self; }
/** * Define a free-form option as a key/value pair. * <p/> * This method is provided as a fallback if the SchemaBuilder is used with a more recent version of Cassandra that has new, unsupported options. * * @param key the name of the option. * @param value the value of the option. If it's a {@code CharSequence}, it will be included in single quotes, otherwise the result of invoking its * {@code toString} method will be used unquoted. * @return this object (for call chaining). */ public T freeformOption(String key, Object value) { if (Strings.isNullOrEmpty(key)) { throw new IllegalArgumentException("Key for custom option should not be null or blank"); } customOptions.add(buildCustomOption(key, value)); return self; }
/** * Define a free-form option as a key/value pair. * <p/> * This method is provided as a fallback if the SchemaBuilder is used with a more recent version of Cassandra that has new, unsupported options. * * @param key the name of the option. * @param value the value of the option. If it's a {@code CharSequence}, it will be included in single quotes, otherwise the result of invoking its * {@code toString} method will be used unquoted. * @return this object (for call chaining). */ public T freeformOption(String key, Object value) { if (Strings.isNullOrEmpty(key)) { throw new IllegalArgumentException("Key for custom option should not be null or blank"); } customOptions.add(buildCustomOption(key, value)); return self; }
private static CompactionOptions<?> compactionOptions(final Configuration configuration) { if (!configuration.has(COMPACTION_STRATEGY)) { return null; } final CompactionOptions<?> compactionOptions = Match(configuration.get(COMPACTION_STRATEGY)) .of( Case($("SizeTieredCompactionStrategy"), sizedTieredStategy()), Case($("DateTieredCompactionStrategy"), dateTieredStrategy()), Case($("LeveledCompactionStrategy"), leveledStrategy())); Array.of(configuration.get(COMPACTION_OPTIONS)) .grouped(2) .forEach(keyValue -> compactionOptions.freeformOption(keyValue.get(0), keyValue.get(1))); return compactionOptions; }
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions(); List<String> options = new ArrayList<String>(generalOptions); if (ssTableSizeInMB.isPresent()) { options.add("'sstable_size_in_mb' : " + ssTableSizeInMB.get()); } return "{" + Joiner.on(", ").join(options) + "}"; }
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions(); List<String> options = new ArrayList<String>(generalOptions); if (ssTableSizeInMB.isPresent()) { options.add("'sstable_size_in_mb' : " + ssTableSizeInMB.get()); } return "{" + Joiner.on(", ").join(options) + "}"; }
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions(); List<String> options = new ArrayList<String>(generalOptions); if (ssTableSizeInMB.isPresent()) { options.add("'sstable_size_in_mb' : " + ssTableSizeInMB.get()); } return "{" + Joiner.on(", ").join(options) + "}"; }
@Override public String build() { final List<String> generalOptions = super.buildCommonOptions(); List<String> options = new ArrayList<String>(generalOptions); if (bucketHigh.isPresent()) { options.add("'bucket_high' : " + bucketHigh.get()); } if (bucketLow.isPresent()) { options.add("'bucket_low' : " + bucketLow.get()); } if (coldReadsRatioToOmit.isPresent()) { options.add("'cold_reads_to_omit' : " + coldReadsRatioToOmit.get()); } if (minThreshold.isPresent()) { options.add("'min_threshold' : " + minThreshold.get()); } if (maxThreshold.isPresent()) { options.add("'max_threshold' : " + maxThreshold.get()); } if (minSSTableSizeInBytes.isPresent()) { options.add("'min_sstable_size' : " + minSSTableSizeInBytes.get()); } return "{" + Joiner.on(", ").join(options) + "}"; } }