@Override public Map<String, String> getCompressionOptions(String cf) throws BackendException { CFMetaData cfm = Schema.instance.getCFMetaData(keySpaceName, cf); if (cfm == null) return null; return ImmutableMap.copyOf(cfm.compressionParameters().asThriftOptions()); }
columnfamilyName, CompressionParameters.SSTABLE_COMPRESSION); cfm.compressionParameters(cp);
public Map<String,String> getCompressionParameters() { return metadata.compressionParameters().asThriftOptions(); }
@Override public Map<String, String> getCompressionOptions(String cf) throws BackendException { CFMetaData cfm = Schema.instance.getCFMetaData(keySpaceName, cf); if (cfm == null) return null; return ImmutableMap.copyOf(cfm.compressionParameters().asThriftOptions()); }
private static Set<Component> components(CFMetaData metadata) { Set<Component> components = new HashSet<Component>(Arrays.asList(Component.DATA, Component.PRIMARY_INDEX, Component.STATS, Component.SUMMARY, Component.TOC, Component.DIGEST)); if (metadata.getBloomFilterFpChance() < 1.0) components.add(Component.FILTER); if (metadata.compressionParameters().sstableCompressor != null) { components.add(Component.COMPRESSION_INFO); } else { // it would feel safer to actually add this component later in maybeWriteDigest(), // but the components are unmodifiable after construction components.add(Component.CRC); } return components; }
@Override public Map<String, String> getCompressionOptions(String cf) throws BackendException { CFMetaData cfm = Schema.instance.getCFMetaData(keySpaceName, cf); if (cfm == null) return null; return ImmutableMap.copyOf(cfm.compressionParameters().asThriftOptions()); }
public CFMetaData reloadSecondaryIndexMetadata(CFMetaData parent) { minCompactionThreshold(parent.minCompactionThreshold); maxCompactionThreshold(parent.maxCompactionThreshold); compactionStrategyClass(parent.compactionStrategyClass); compactionStrategyOptions(parent.compactionStrategyOptions); compressionParameters(parent.compressionParameters); return this; }
columnfamilyName, CompressionParameters.SSTABLE_COMPRESSION); cfm.compressionParameters(cp);
columnfamilyName, CompressionParameters.SSTABLE_COMPRESSION); cfm.compressionParameters(cp);
CompressionParameters compressParameters) this(directory, CFMetaData.denseCFMetaData(keyspace, columnFamily, comparator, subComparator).compressionParameters(compressParameters), partitioner, bufferSizeInMB);
public SSTableWriter(String filename, long keyCount, long repairedAt, CFMetaData metadata, IPartitioner partitioner, MetadataCollector sstableMetadataCollector) { super(Descriptor.fromFilename(filename), components(metadata), metadata, partitioner); this.repairedAt = repairedAt; if (compression) { dataFile = SequentialWriter.open(getFilename(), descriptor.filenameFor(Component.COMPRESSION_INFO), metadata.compressionParameters(), sstableMetadataCollector); dbuilder = SegmentedFile.getCompressedBuilder((CompressedSequentialWriter) dataFile); } else { dataFile = SequentialWriter.open(new File(getFilename()), new File(descriptor.filenameFor(Component.CRC))); dbuilder = SegmentedFile.getBuilder(DatabaseDescriptor.getDiskAccessMode()); } iwriter = new IndexWriter(keyCount, dataFile); this.sstableMetadataCollector = sstableMetadataCollector; }
cfm.compressionParameters(CompressionParameters.create(cfProps.compressionParameters));
public void applyToCFMetadata(CFMetaData cfm) throws ConfigurationException, SyntaxException { if (hasProperty(KW_COMMENT)) cfm.comment(getString(KW_COMMENT, "")); cfm.readRepairChance(getDouble(KW_READREPAIRCHANCE, cfm.getReadRepairChance())); cfm.dcLocalReadRepairChance(getDouble(KW_DCLOCALREADREPAIRCHANCE, cfm.getDcLocalReadRepair())); cfm.gcGraceSeconds(getInt(KW_GCGRACESECONDS, cfm.getGcGraceSeconds())); int minCompactionThreshold = toInt(KW_MINCOMPACTIONTHRESHOLD, getCompactionOptions().get(KW_MINCOMPACTIONTHRESHOLD), cfm.getMinCompactionThreshold()); int maxCompactionThreshold = toInt(KW_MAXCOMPACTIONTHRESHOLD, getCompactionOptions().get(KW_MAXCOMPACTIONTHRESHOLD), cfm.getMaxCompactionThreshold()); if (minCompactionThreshold <= 0 || maxCompactionThreshold <= 0) throw new ConfigurationException("Disabling compaction by setting compaction thresholds to 0 has been deprecated, set the compaction option 'enabled' to false instead."); cfm.minCompactionThreshold(minCompactionThreshold); cfm.maxCompactionThreshold(maxCompactionThreshold); cfm.defaultTimeToLive(getInt(KW_DEFAULT_TIME_TO_LIVE, cfm.getDefaultTimeToLive())); cfm.speculativeRetry(CFMetaData.SpeculativeRetry.fromString(getString(KW_SPECULATIVE_RETRY, cfm.getSpeculativeRetry().toString()))); cfm.memtableFlushPeriod(getInt(KW_MEMTABLE_FLUSH_PERIOD, cfm.getMemtableFlushPeriod())); cfm.minIndexInterval(getInt(KW_MIN_INDEX_INTERVAL, cfm.getMinIndexInterval())); cfm.maxIndexInterval(getInt(KW_MAX_INDEX_INTERVAL, cfm.getMaxIndexInterval())); if (compactionStrategyClass != null) { cfm.compactionStrategyClass(compactionStrategyClass); cfm.compactionStrategyOptions(new HashMap<>(getCompactionOptions())); } cfm.bloomFilterFpChance(getDouble(KW_BF_FP_CHANCE, cfm.getBloomFilterFpChance())); if (!getCompressionOptions().isEmpty()) cfm.compressionParameters(CompressionParameters.create(getCompressionOptions())); CachingOptions cachingOptions = getCachingOptions(); if (cachingOptions != null) cfm.caching(cachingOptions); }
.compactionStrategyClass(cfProps.compactionStrategyClass) .compactionStrategyOptions(cfProps.compactionStrategyOptions) .compressionParameters(CompressionParameters.create(cfProps.compressionParameters)) .caching(CachingOptions.fromString(getPropertyString(CFPropDefs.KW_CACHING, CFMetaData.DEFAULT_CACHING_STRATEGY.toString()))) .speculativeRetry(CFMetaData.SpeculativeRetry.fromString(getPropertyString(CFPropDefs.KW_SPECULATIVE_RETRY, CFMetaData.DEFAULT_SPECULATIVE_RETRY.toString())))
.compressionParameters(CompressionParameters.create(cf_def.compression_options)) .rebuild();
cfm.speculativeRetry(SpeculativeRetry.fromString(result.getString("speculative_retry"))); cfm.compactionStrategyClass(createCompactionStrategy(result.getString("compaction_strategy_class"))); cfm.compressionParameters(CompressionParameters.create(fromJsonMap(result.getString("compression_parameters")))); cfm.compactionStrategyOptions(fromJsonMap(result.getString("compaction_strategy_options")));