class Cassandra::ColumnContainer::Options
Encapsulates all of the configuration options of a column-container.
Attributes
@return [Float] the false positive chance for the Bloom filter of this column-container.
@return [Hash] the caching options for this column-container.
@return whether or not change data capture is enabled on this table.
@return [String] the comment attribute of this column-container.
@return [ColumnContainer::Compaction] the compaction strategy of this column-container.
@return [Hash] compression settings
When compression is enabled, this option defines the probability with which checksums for compressed blocks are checked during reads. @return [Float] the probability of checking checksums on compressed blocks.
@return [Integer] the default TTL for this column-container.
@return [Hash] the extension options of this column-container.
@return [Integer] the tombstone garbage collection grace time in seconds for this column-container.
Return the index interval of this column-container; Cassandra
will hold `1/index_interval` of row keys in memory. @return [Integer] the index interval of this column-container. May be nil, indicating a default value of 128.
@return [Float] the cluster local read repair chance for this column-container.
@return [Integer] how often (in milliseconds) to flush the memtable of this column-container.
@return [Float] the chance with which a read repair is triggered for this column-container.
Return the speculative retry setting of this column-container, which determines how much response delay the coordinator node will tolerate from the chosen replica before retrying the request on other replicas. This setting can be expressed as a fixed delay in ms (e.g. 10ms) or as a percentile indicating “when the response time has exceeded the Nth percentile of read response times for this object” (e.g. 99percentile). @return [String] the speculative retry setting of this column-container.
Public Class Methods
@private
# File lib/cassandra/column_container.rb 67 def initialize(comment, 68 read_repair_chance, 69 local_read_repair_chance, 70 gc_grace_seconds, 71 caching, 72 bloom_filter_fp_chance, 73 populate_io_cache_on_flush, 74 memtable_flush_period_in_ms, 75 default_time_to_live, 76 speculative_retry, 77 index_interval, 78 replicate_on_write, 79 min_index_interval, 80 max_index_interval, 81 compaction_strategy, 82 compression, 83 compact_storage, 84 crc_check_chance, 85 extensions, 86 cdc) 87 @comment = comment 88 @read_repair_chance = read_repair_chance 89 @local_read_repair_chance = local_read_repair_chance 90 @gc_grace_seconds = gc_grace_seconds 91 @caching = caching 92 @bloom_filter_fp_chance = bloom_filter_fp_chance 93 @populate_io_cache_on_flush = populate_io_cache_on_flush 94 @memtable_flush_period_in_ms = memtable_flush_period_in_ms 95 @default_time_to_live = default_time_to_live 96 @speculative_retry = speculative_retry 97 @index_interval = index_interval 98 @replicate_on_write = replicate_on_write 99 @min_index_interval = min_index_interval 100 @max_index_interval = max_index_interval 101 @compaction_strategy = compaction_strategy 102 @compression = compression 103 @compact_storage = compact_storage 104 @crc_check_chance = crc_check_chance 105 @extensions = extensions 106 @cdc = cdc 107 end
Public Instance Methods
@return [Boolean] whether this column-container uses compact storage.
# File lib/cassandra/column_container.rb 124 def compact_storage? 125 @compact_storage 126 end
@private
# File lib/cassandra/column_container.rb 165 def eql?(other) 166 other.is_a?(Options) && 167 @comment == other.comment && 168 @read_repair_chance == other.read_repair_chance && 169 @local_read_repair_chance == other.local_read_repair_chance && 170 @gc_grace_seconds == other.gc_grace_seconds && 171 @caching == other.caching && 172 @bloom_filter_fp_chance == other.bloom_filter_fp_chance && 173 @populate_io_cache_on_flush == other.populate_io_cache_on_flush? && 174 @memtable_flush_period_in_ms == other.memtable_flush_period_in_ms && 175 @default_time_to_live == other.default_time_to_live && 176 @speculative_retry == other.speculative_retry && 177 @index_interval == other.index_interval && 178 @replicate_on_write == other.replicate_on_write? && 179 @compaction_strategy == other.compaction_strategy && 180 @compression == other.compression && 181 @compact_storage == other.compact_storage? && 182 @crc_check_chance == other.crc_check_chance && 183 @extensions == other.extensions && 184 @cdc == other.cdc 185 end
@return [Boolean] whether to populate the I/O cache on flush of this
column-container. May be nil, indicating a default value of `false`.
# File lib/cassandra/column_container.rb 119 def populate_io_cache_on_flush? 120 @populate_io_cache_on_flush 121 end
Return whether to replicate counter updates to other replicas. It is strongly recommended that this setting be `true`. Otherwise, counter updates are only written to one replica and fault tolerance is sacrificed. @return [Boolean] whether to replicate counter updates to other replicas.
# File lib/cassandra/column_container.rb 113 def replicate_on_write? 114 @replicate_on_write 115 end
@private
# File lib/cassandra/column_container.rb 129 def to_cql 130 options = [] 131 132 options << 'COMPACT STORAGE' if @compact_storage 133 unless @bloom_filter_fp_chance.nil? 134 options << "bloom_filter_fp_chance = #{Util.encode_object(@bloom_filter_fp_chance)}" 135 end 136 options << "caching = #{Util.encode_object(@caching)}" unless @caching.nil? 137 options << 'cdc = true' if @cdc 138 options << "comment = #{Util.encode_object(@comment)}" unless @comment.nil? 139 options << "compaction = #{@compaction_strategy.to_cql}" unless @compaction_strategy.nil? 140 options << "compression = #{Util.encode_object(@compression)}" unless @compression.nil? 141 options << "crc_check_chance = #{Util.encode_object(@crc_check_chance)}" unless @crc_check_chance.nil? 142 unless @local_read_repair_chance.nil? 143 options << "dclocal_read_repair_chance = #{Util.encode_object(@local_read_repair_chance)}" 144 end 145 unless @default_time_to_live.nil? 146 options << "default_time_to_live = #{Util.encode_object(@default_time_to_live)}" 147 end 148 options << "gc_grace_seconds = #{Util.encode_object(@gc_grace_seconds)}" unless @gc_grace_seconds.nil? 149 options << "index_interval = #{Util.encode_object(@index_interval)}" unless @index_interval.nil? 150 options << "max_index_interval = #{Util.encode_object(@max_index_interval)}" unless @max_index_interval.nil? 151 unless @memtable_flush_period_in_ms.nil? 152 options << "memtable_flush_period_in_ms = #{Util.encode_object(@memtable_flush_period_in_ms)}" 153 end 154 options << "min_index_interval = #{Util.encode_object(@min_index_interval)}" unless @min_index_interval.nil? 155 unless @populate_io_cache_on_flush.nil? 156 options << "populate_io_cache_on_flush = '#{@populate_io_cache_on_flush}'" 157 end 158 options << "read_repair_chance = #{Util.encode_object(@read_repair_chance)}" unless @read_repair_chance.nil? 159 options << "replicate_on_write = '#{@replicate_on_write}'" unless @replicate_on_write.nil? 160 options << "speculative_retry = #{Util.encode_object(@speculative_retry)}" unless @speculative_retry.nil? 161 options.join("\nAND ") 162 end