Class: Couchbase::Management::BucketSettings

Inherits:
Object
  • Object
show all
Extended by:
Gem::Deprecate
Defined in:
lib/couchbase/management/bucket_manager.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/management/bucket_manager.rb
more...

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|self| ... } ⇒ BucketSettings

Returns a new instance of BucketSettings.

Yield Parameters:

[View source]

275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/couchbase/management/bucket_manager.rb', line 275

def initialize
  @bucket_type = :couchbase
  @name = nil
  @minimum_durability_level = nil
  @healthy = true
  @flush_enabled = false
  @ram_quota_mb = 100
  @num_replicas = 1
  @replica_indexes = false
  @max_expiry = 0
  @compression_mode = :passive
  @conflict_resolution_type = :sequence_number
  @eviction_policy = :value_only
  yield self if block_given?
end

Instance Attribute Details

#bucket_type:couchbase, ...

Returns the type of the bucket. Defaults to :couchbase.

Returns:

  • (:couchbase, :memcached, :ephemeral)

    the type of the bucket. Defaults to :couchbase


222
223
224
# File 'lib/couchbase/management/bucket_manager.rb', line 222

def bucket_type
  @bucket_type
end

#compression_mode:off, ...

Returns the compression mode to use.

Returns:

  • (:off, :passive, :active)

    the compression mode to use


248
249
250
# File 'lib/couchbase/management/bucket_manager.rb', line 248

def compression_mode
  @compression_mode
end

#conflict_resolution_type:timestamp, :sequence_number

Returns conflict resolution policy.

Returns:

  • (:timestamp, :sequence_number)

    conflict resolution policy


251
252
253
# File 'lib/couchbase/management/bucket_manager.rb', line 251

def conflict_resolution_type
  @conflict_resolution_type
end

#eviction_policy:full, ...

Eviction policy to use

:full

During ejection, only the value will be ejected (key and metadata will remain in memory). Value Ejection needs more system memory, but provides better performance than Full Ejection. This value is only valid for buckets of type :couchbase.

:value_only

During ejection, everything (including key, metadata, and value) will be ejected. Full Ejection reduces the memory overhead requirement, at the cost of performance. This value is only valid for buckets of type :couchbase.

:no_eviction

Couchbase Server keeps all data until explicitly deleted, but will reject any new data if you reach the quota (dedicated memory) you set for your bucket. This value is only valid for buckets of type :ephemeral.

:not_recently_used

When the memory quota is reached, Couchbase Server ejects data that has not been used recently. This value is only valid for buckets of type :ephemeral.

Returns:

  • (:full, :value_only, :no_eviction, :not_recently_used)

    the eviction policy to use


242
243
244
# File 'lib/couchbase/management/bucket_manager.rb', line 242

def eviction_policy
  @eviction_policy
end

#flush_enabledBoolean

Returns whether or not flush should be enabled on the bucket. Defaults to false.

Returns:

  • (Boolean)

    whether or not flush should be enabled on the bucket. Defaults to false.


210
211
212
# File 'lib/couchbase/management/bucket_manager.rb', line 210

def flush_enabled
  @flush_enabled
end

#max_expiryInteger

Returns value of TTL (expiration) in seconds for new documents created without expiration.

Returns:

  • (Integer)

    value of TTL (expiration) in seconds for new documents created without expiration


245
246
247
# File 'lib/couchbase/management/bucket_manager.rb', line 245

def max_expiry
  @max_expiry
end

#minimum_durability_levelnil, ...

Returns the minimum durability level.

Returns:

  • (nil, :none, :majority, :majority_and_persist_to_active, :persist_to_majority)

    the minimum durability level


254
255
256
# File 'lib/couchbase/management/bucket_manager.rb', line 254

def minimum_durability_level
  @minimum_durability_level
end

#nameString

Returns name of the bucket.

Returns:

  • (String)

    name of the bucket


207
208
209
# File 'lib/couchbase/management/bucket_manager.rb', line 207

def name
  @name
end

#num_replicasInteger

Returns number of replicas for documents.

Returns:

  • (Integer)

    number of replicas for documents


216
217
218
# File 'lib/couchbase/management/bucket_manager.rb', line 216

def num_replicas
  @num_replicas
end

#ram_quota_mbInteger

Returns RAM quota in megabytes for the bucket.

Returns:

  • (Integer)

    RAM quota in megabytes for the bucket


213
214
215
# File 'lib/couchbase/management/bucket_manager.rb', line 213

def ram_quota_mb
  @ram_quota_mb
end

#replica_indexesBoolean

Returns whether replica indexes should be enabled for the bucket.

Returns:

  • (Boolean)

    whether replica indexes should be enabled for the bucket


219
220
221
# File 'lib/couchbase/management/bucket_manager.rb', line 219

def replica_indexes
  @replica_indexes
end

Instance Method Details

#ejection_policyObject

Deprecated.

Use #eviction_policy instead

[View source]

263
264
265
# File 'lib/couchbase/management/bucket_manager.rb', line 263

def ejection_policy
  @eviction_policy
end

#ejection_policy=(val) ⇒ Object

Deprecated.

Use #eviction_policy= instead

[View source]

269
270
271
# File 'lib/couchbase/management/bucket_manager.rb', line 269

def ejection_policy=(val)
  @eviction_policy = val
end