Skip to content

Commit a2e5799

Browse files
authored
RCBC-516: Include storage_backend in get_bucket/get_all_buckets results (#173)
1 parent 177fbfe commit a2e5799

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

ext/couchbase

ext/rcb_buckets.cxx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,18 @@ cb_extract_bucket_settings(const core::management::cluster::bucket_settings& ent
506506
break;
507507
}
508508
}
509+
switch (entry.storage_backend) {
510+
case core::management::cluster::bucket_storage_backend::couchstore:
511+
rb_hash_aset(
512+
bucket, rb_id2sym(rb_intern("storage_backend")), rb_id2sym(rb_intern("couchstore")));
513+
break;
514+
case core::management::cluster::bucket_storage_backend::magma:
515+
rb_hash_aset(bucket, rb_id2sym(rb_intern("storage_backend")), rb_id2sym(rb_intern("magma")));
516+
break;
517+
case core::management::cluster::bucket_storage_backend::unknown:
518+
rb_hash_aset(bucket, rb_id2sym(rb_intern("storage_backend")), Qnil);
519+
break;
520+
}
509521
if (entry.history_retention_collection_default.has_value()) {
510522
rb_hash_aset(bucket,
511523
rb_id2sym(rb_intern("history_retention_collection_default")),

lib/couchbase/management/bucket_manager.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ def initialize(backend)
206206
def create_bucket(settings, options = Options::Bucket::CreateBucket.new)
207207
@backend.bucket_create(
208208
{
209-
210209
name: settings.name,
211210
flush_enabled: settings.flush_enabled,
212211
ram_quota_mb: settings.ram_quota_mb,
@@ -342,6 +341,7 @@ def extract_bucket_settings(entry)
342341
bucket.minimum_durability_level = entry[:minimum_durability_level]
343342
bucket.compression_mode = entry[:compression_mode]
344343
bucket.instance_variable_set(:@healthy, entry[:nodes].all? { |node| node[:status] == "healthy" })
344+
bucket.storage_backend = entry[:storage_backend]
345345
bucket.history_retention_collection_default = entry[:history_retention_collection_default]
346346
bucket.history_retention_bytes = entry[:history_retention_bytes]
347347
bucket.history_retention_duration = entry[:history_retention_duration]

0 commit comments

Comments
 (0)