class Cassandra::ColumnContainer::Options

Encapsulates all of the configuration options of a column-container.

Attributes

bloom_filter_fp_chance[R]

@return [Float] the false positive chance for the Bloom filter of this column-container.

caching[R]

@return [Hash] the caching options for this column-container.

cdc[R]

@return whether or not change data capture is enabled on this table.

comment[R]

@return [String] the comment attribute of this column-container.

compaction_strategy[R]

@return [ColumnContainer::Compaction] the compaction strategy of this column-container.

compression[R]

@return [Hash] compression settings

crc_check_chance[R]

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.

default_time_to_live[R]

@return [Integer] the default TTL for this column-container.

extensions[R]

@return [Hash] the extension options of this column-container.

gc_grace_seconds[R]

@return [Integer] the tombstone garbage collection grace time in seconds for this column-container.

index_interval[R]

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.

local_read_repair_chance[R]

@return [Float] the cluster local read repair chance for this column-container.

memtable_flush_period_in_ms[R]

@return [Integer] how often (in milliseconds) to flush the memtable of this column-container.

read_repair_chance[R]

@return [Float] the chance with which a read repair is triggered for this column-container.

speculative_retry[R]

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

new(comment, read_repair_chance, local_read_repair_chance, gc_grace_seconds, caching, bloom_filter_fp_chance, populate_io_cache_on_flush, memtable_flush_period_in_ms, default_time_to_live, speculative_retry, index_interval, replicate_on_write, min_index_interval, max_index_interval, compaction_strategy, compression, compact_storage, crc_check_chance, extensions, cdc) click to toggle source

@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

==(other)
Alias for: eql?
compact_storage?() click to toggle source

@return [Boolean] whether this column-container uses compact storage.

    # File lib/cassandra/column_container.rb
124 def compact_storage?
125   @compact_storage
126 end
eql?(other) click to toggle source

@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
Also aliased as: ==
populate_io_cache_on_flush?() click to toggle source

@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
replicate_on_write?() click to toggle source

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
to_cql() click to toggle source

@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