couchbase 3.5.7 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/cache/extconf_include.rb +3 -3
- data/ext/cache/mozilla-ca-bundle.crt +3 -165
- data/ext/cache/mozilla-ca-bundle.sha256 +1 -1
- data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/CMakeLists.txt +14 -10
- data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy.cc +7 -4
- data/ext/couchbase/CMakeLists.txt +12 -1
- data/ext/couchbase/cmake/Profiler.cmake +15 -0
- data/ext/couchbase/cmake/ThirdPartyDependencies.cmake +2 -2
- data/ext/couchbase/cmake/couchbase_cxx_client.pc.in +1 -1
- data/ext/couchbase/core/app_telemetry_address.cxx +55 -0
- data/ext/couchbase/core/app_telemetry_address.hxx +39 -0
- data/ext/couchbase/core/app_telemetry_meter.cxx +753 -0
- data/ext/couchbase/core/app_telemetry_meter.hxx +198 -0
- data/ext/couchbase/core/app_telemetry_reporter.cxx +895 -0
- data/ext/couchbase/core/app_telemetry_reporter.hxx +59 -0
- data/ext/couchbase/core/bucket.cxx +77 -35
- data/ext/couchbase/core/bucket.hxx +17 -10
- data/ext/couchbase/core/cluster.cxx +54 -16
- data/ext/couchbase/core/cluster_credentials.cxx +27 -0
- data/ext/couchbase/core/cluster_credentials.hxx +36 -0
- data/ext/couchbase/core/cluster_options.hxx +12 -0
- data/ext/couchbase/core/collections_component.cxx +7 -5
- data/ext/couchbase/core/http_component.cxx +6 -0
- data/ext/couchbase/core/impl/binary_collection.cxx +4 -0
- data/ext/couchbase/core/impl/bucket_manager.cxx +2 -0
- data/ext/couchbase/core/impl/cluster.cxx +9 -0
- data/ext/couchbase/core/impl/collection.cxx +2 -0
- data/ext/couchbase/core/impl/error.cxx +1 -0
- data/ext/couchbase/core/impl/logger.cxx +51 -0
- data/ext/couchbase/core/impl/replica_utils.cxx +1 -1
- data/ext/couchbase/core/impl/transaction_get_multi_replicas_from_preferred_server_group_spec.cxx +32 -0
- data/ext/couchbase/core/impl/transaction_get_multi_spec.cxx +30 -0
- data/ext/couchbase/core/impl/transaction_op_error_category.cxx +2 -0
- data/ext/couchbase/core/io/config_tracker.cxx +6 -6
- data/ext/couchbase/core/io/http_command.hxx +35 -11
- data/ext/couchbase/core/io/http_session.cxx +10 -0
- data/ext/couchbase/core/io/http_session.hxx +4 -0
- data/ext/couchbase/core/io/http_session_manager.hxx +83 -34
- data/ext/couchbase/core/io/mcbp_command.hxx +41 -2
- data/ext/couchbase/core/io/mcbp_session.cxx +52 -19
- data/ext/couchbase/core/io/mcbp_session.hxx +3 -0
- data/ext/couchbase/core/logger/logger.cxx +46 -0
- data/ext/couchbase/core/logger/logger.hxx +41 -1
- data/ext/couchbase/core/management/bucket_settings.hxx +1 -0
- data/ext/couchbase/core/management/bucket_settings_json.hxx +4 -0
- data/ext/couchbase/core/meta/features.hxx +32 -0
- data/ext/couchbase/core/operations/document_analytics.cxx +9 -9
- data/ext/couchbase/core/operations/document_append.cxx +1 -0
- data/ext/couchbase/core/operations/document_append.hxx +1 -0
- data/ext/couchbase/core/operations/document_get_all_replicas.hxx +10 -2
- data/ext/couchbase/core/operations/document_lookup_in.cxx +4 -0
- data/ext/couchbase/core/operations/document_lookup_in_all_replicas.hxx +14 -2
- data/ext/couchbase/core/operations/document_lookup_in_any_replica.hxx +4 -0
- data/ext/couchbase/core/operations/document_mutate_in.cxx +4 -0
- data/ext/couchbase/core/operations/document_mutate_in.hxx +1 -0
- data/ext/couchbase/core/operations/document_prepend.cxx +1 -0
- data/ext/couchbase/core/operations/document_prepend.hxx +1 -0
- data/ext/couchbase/core/operations/document_query.cxx +12 -10
- data/ext/couchbase/core/operations/http_noop.cxx +1 -0
- data/ext/couchbase/core/operations/management/bucket_create.cxx +3 -0
- data/ext/couchbase/core/operations/management/bucket_update.cxx +3 -0
- data/ext/couchbase/core/origin.cxx +0 -5
- data/ext/couchbase/core/origin.hxx +2 -11
- data/ext/couchbase/core/platform/random.cc +6 -3
- data/ext/couchbase/core/platform/random.h +2 -2
- data/ext/couchbase/core/protocol/cmd_mutate_in.hxx +9 -0
- data/ext/couchbase/core/timeout_defaults.hxx +4 -0
- data/ext/couchbase/core/topology/configuration.cxx +10 -13
- data/ext/couchbase/core/topology/configuration.hxx +14 -15
- data/ext/couchbase/core/topology/configuration_json.hxx +6 -0
- data/ext/couchbase/core/transactions/async_attempt_context.hxx +22 -2
- data/ext/couchbase/core/transactions/attempt_context.hxx +25 -7
- data/ext/couchbase/core/transactions/attempt_context_impl.cxx +688 -238
- data/ext/couchbase/core/transactions/attempt_context_impl.hxx +91 -12
- data/ext/couchbase/core/transactions/exceptions.cxx +5 -0
- data/ext/couchbase/core/transactions/exceptions.hxx +20 -0
- data/ext/couchbase/core/transactions/exceptions_fmt.hxx +3 -0
- data/ext/couchbase/core/transactions/forward_compat.cxx +71 -6
- data/ext/couchbase/core/transactions/forward_compat.hxx +45 -59
- data/ext/couchbase/core/transactions/get_multi_orchestrator.cxx +616 -0
- data/ext/couchbase/core/transactions/get_multi_orchestrator.hxx +61 -0
- data/ext/couchbase/core/transactions/internal/doc_record.cxx +8 -0
- data/ext/couchbase/core/transactions/internal/doc_record.hxx +16 -5
- data/ext/couchbase/core/transactions/internal/exceptions_internal.hxx +12 -0
- data/ext/couchbase/core/transactions/internal/transaction_context.hxx +13 -0
- data/ext/couchbase/core/transactions/internal/transaction_fields.hxx +1 -0
- data/ext/couchbase/core/transactions/staged_mutation.cxx +277 -96
- data/ext/couchbase/core/transactions/staged_mutation.hxx +28 -76
- data/ext/couchbase/core/transactions/transaction_context.cxx +33 -0
- data/ext/couchbase/core/transactions/transaction_get_multi_mode.hxx +28 -0
- data/ext/couchbase/core/transactions/transaction_get_multi_replicas_from_preferred_server_group_mode.hxx +27 -0
- data/ext/couchbase/core/transactions/transaction_get_multi_replicas_from_preferred_server_group_result.hxx +71 -0
- data/ext/couchbase/core/transactions/transaction_get_multi_result.hxx +66 -0
- data/ext/couchbase/core/transactions/transaction_links.hxx +10 -0
- data/ext/couchbase/core/transactions/transactions.cxx +8 -3
- data/ext/couchbase/core/utils/connection_string.cxx +4 -0
- data/ext/couchbase/core/utils/url_codec.cxx +26 -0
- data/ext/couchbase/core/utils/url_codec.hxx +11 -0
- data/ext/couchbase/core/websocket_codec.cxx +647 -0
- data/ext/couchbase/core/websocket_codec.hxx +77 -0
- data/ext/couchbase/couchbase/analytics_options.hxx +70 -6
- data/ext/couchbase/couchbase/application_telemetry_options.hxx +124 -0
- data/ext/couchbase/couchbase/cluster_options.hxx +17 -0
- data/ext/couchbase/couchbase/error_codes.hxx +1 -0
- data/ext/couchbase/couchbase/logger.hxx +16 -0
- data/ext/couchbase/couchbase/management/bucket_settings.hxx +1 -0
- data/ext/couchbase/couchbase/query_options.hxx +70 -6
- data/ext/couchbase/couchbase/transactions/async_attempt_context.hxx +29 -5
- data/ext/couchbase/couchbase/transactions/attempt_context.hxx +24 -7
- data/ext/couchbase/couchbase/transactions/transaction_get_multi_mode.hxx +47 -0
- data/ext/couchbase/couchbase/transactions/transaction_get_multi_options.hxx +44 -0
- data/ext/couchbase/couchbase/transactions/transaction_get_multi_replicas_from_preferred_server_group_mode.hxx +46 -0
- data/ext/couchbase/couchbase/transactions/transaction_get_multi_replicas_from_preferred_server_group_options.hxx +48 -0
- data/ext/couchbase/couchbase/transactions/transaction_get_multi_replicas_from_preferred_server_group_result.hxx +109 -0
- data/ext/couchbase/couchbase/transactions/transaction_get_multi_replicas_from_preferred_server_group_spec.hxx +47 -0
- data/ext/couchbase/couchbase/transactions/transaction_get_multi_result.hxx +102 -0
- data/ext/couchbase/couchbase/transactions/transaction_get_multi_spec.hxx +45 -0
- data/ext/rcb_buckets.cxx +26 -0
- data/lib/active_support/cache/couchbase_store.rb +1 -1
- data/lib/couchbase/cluster.rb +1 -1
- data/lib/couchbase/collection.rb +1 -1
- data/lib/couchbase/collection_options.rb +2 -2
- data/lib/couchbase/management/analytics_index_manager.rb +4 -4
- data/lib/couchbase/management/bucket_manager.rb +8 -2
- data/lib/couchbase/protostellar/cluster.rb +2 -2
- data/lib/couchbase/protostellar/collection.rb +1 -1
- data/lib/couchbase/protostellar/management/collection_query_index_manager.rb +1 -1
- data/lib/couchbase/protostellar/request_generator/admin/bucket.rb +4 -4
- data/lib/couchbase/protostellar/request_generator/admin/collection.rb +6 -6
- data/lib/couchbase/protostellar/request_generator/admin/query.rb +13 -13
- data/lib/couchbase/protostellar/request_generator/kv.rb +25 -25
- data/lib/couchbase/protostellar/request_generator/query.rb +4 -4
- data/lib/couchbase/protostellar/request_generator/search.rb +25 -25
- data/lib/couchbase/protostellar/response_converter/search.rb +1 -1
- data/lib/couchbase/protostellar/retry/reason.rb +1 -1
- data/lib/couchbase/protostellar/timeouts.rb +1 -1
- data/lib/couchbase/scope.rb +1 -1
- data/lib/couchbase/transcoder_flags.rb +1 -1
- data/lib/couchbase/utils/stdlib_logger_adapter.rb +1 -1
- data/lib/couchbase/version.rb +1 -1
- metadata +47 -19
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/COPYING +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/cmake/SnappyConfig.cmake.in +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/cmake/config.h.in +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-c.cc +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-c.h +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-internal.h +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-sinksource.cc +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-sinksource.h +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-stubs-internal.cc +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-stubs-internal.h +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy-stubs-public.h.in +0 -0
- /data/ext/cache/snappy/{585305c8dbb8f762f2c2e17f937f1cf3ac6cbc9c → 3cde171792b3607f75c14e5011eaf69da4857bd8}/snappy/snappy.h +0 -0
@@ -95,7 +95,7 @@ module Couchbase
|
|
95
95
|
username: username,
|
96
96
|
password: password,
|
97
97
|
timeouts: Protostellar::Timeouts.from_cluster_options(options),
|
98
|
-
root_certificates: params.key?("trust_certificate") ? File.read(params["trust_certificate"]) : nil
|
98
|
+
root_certificates: params.key?("trust_certificate") ? File.read(params["trust_certificate"]) : nil,
|
99
99
|
)
|
100
100
|
new(connection_string.split("://")[1].split("?")[0], connect_options)
|
101
101
|
end
|
@@ -160,7 +160,7 @@ module Couchbase
|
|
160
160
|
credentials: options.grpc_credentials,
|
161
161
|
channel_args: options.grpc_channel_args,
|
162
162
|
call_metadata: options.grpc_call_metadata,
|
163
|
-
timeouts: options.timeouts
|
163
|
+
timeouts: options.timeouts,
|
164
164
|
)
|
165
165
|
|
166
166
|
@query_request_generator = RequestGenerator::Query.new
|
@@ -29,7 +29,7 @@ module Couchbase
|
|
29
29
|
@scope_name = scope_name
|
30
30
|
@collection_name = collection_name
|
31
31
|
@request_generator = RequestGenerator::Admin::Query.new(
|
32
|
-
bucket_name: @bucket_name, scope_name: @scope_name, collection_name: @collection_name
|
32
|
+
bucket_name: @bucket_name, scope_name: @scope_name, collection_name: @collection_name,
|
33
33
|
)
|
34
34
|
end
|
35
35
|
|
@@ -62,21 +62,21 @@ module Couchbase
|
|
62
62
|
|
63
63
|
def create_bucket_request(settings, options)
|
64
64
|
proto_req = Generated::Admin::Bucket::V1::CreateBucketRequest.new(
|
65
|
-
extract_bucket_settings(settings, create: true)
|
65
|
+
extract_bucket_settings(settings, create: true),
|
66
66
|
)
|
67
67
|
create_request(proto_req, :create_bucket, options)
|
68
68
|
end
|
69
69
|
|
70
70
|
def update_bucket_request(settings, options)
|
71
71
|
proto_req = Generated::Admin::Bucket::V1::UpdateBucketRequest.new(
|
72
|
-
extract_bucket_settings(settings, create: false)
|
72
|
+
extract_bucket_settings(settings, create: false),
|
73
73
|
)
|
74
74
|
create_request(proto_req, :update_bucket, options)
|
75
75
|
end
|
76
76
|
|
77
77
|
def delete_bucket_request(bucket_name, options)
|
78
78
|
proto_req = Generated::Admin::Bucket::V1::DeleteBucketRequest.new(
|
79
|
-
bucket_name: bucket_name
|
79
|
+
bucket_name: bucket_name,
|
80
80
|
)
|
81
81
|
create_request(proto_req, :delete_bucket, options)
|
82
82
|
end
|
@@ -114,7 +114,7 @@ module Couchbase
|
|
114
114
|
rpc: rpc,
|
115
115
|
proto_request: proto_request,
|
116
116
|
idempotent: idempotent,
|
117
|
-
timeout: options.timeout
|
117
|
+
timeout: options.timeout,
|
118
118
|
)
|
119
119
|
end
|
120
120
|
end
|
@@ -30,7 +30,7 @@ module Couchbase
|
|
30
30
|
|
31
31
|
def list_collections_request(options)
|
32
32
|
proto_req = Generated::Admin::Collection::V1::ListCollectionsRequest.new(
|
33
|
-
bucket_name: @bucket_name
|
33
|
+
bucket_name: @bucket_name,
|
34
34
|
)
|
35
35
|
create_request(proto_req, :list_collections, options, idempotent: true)
|
36
36
|
end
|
@@ -38,7 +38,7 @@ module Couchbase
|
|
38
38
|
def create_scope_request(scope_name, options)
|
39
39
|
proto_req = Generated::Admin::Collection::V1::CreateScopeRequest.new(
|
40
40
|
bucket_name: @bucket_name,
|
41
|
-
scope_name: scope_name
|
41
|
+
scope_name: scope_name,
|
42
42
|
)
|
43
43
|
create_request(proto_req, :create_scope, options)
|
44
44
|
end
|
@@ -46,7 +46,7 @@ module Couchbase
|
|
46
46
|
def delete_scope_request(scope_name, options)
|
47
47
|
proto_req = Generated::Admin::Collection::V1::DeleteScopeRequest.new(
|
48
48
|
bucket_name: @bucket_name,
|
49
|
-
scope_name: scope_name
|
49
|
+
scope_name: scope_name,
|
50
50
|
)
|
51
51
|
create_request(proto_req, :delete_scope, options)
|
52
52
|
end
|
@@ -62,7 +62,7 @@ module Couchbase
|
|
62
62
|
bucket_name: @bucket_name,
|
63
63
|
scope_name: scope_name,
|
64
64
|
collection_name: collection_name,
|
65
|
-
**proto_opts
|
65
|
+
**proto_opts,
|
66
66
|
)
|
67
67
|
create_request(proto_req, :create_collection, options)
|
68
68
|
end
|
@@ -71,7 +71,7 @@ module Couchbase
|
|
71
71
|
proto_req = Generated::Admin::Collection::V1::DeleteCollectionRequest.new(
|
72
72
|
bucket_name: @bucket_name,
|
73
73
|
scope_name: scope_name,
|
74
|
-
collection_name: collection_name
|
74
|
+
collection_name: collection_name,
|
75
75
|
)
|
76
76
|
create_request(proto_req, :delete_collection, options)
|
77
77
|
end
|
@@ -84,7 +84,7 @@ module Couchbase
|
|
84
84
|
rpc: rpc,
|
85
85
|
proto_request: proto_request,
|
86
86
|
idempotent: idempotent,
|
87
|
-
timeout: options.timeout
|
87
|
+
timeout: options.timeout,
|
88
88
|
)
|
89
89
|
end
|
90
90
|
end
|
@@ -31,8 +31,8 @@ module Couchbase
|
|
31
31
|
def get_all_indexes_request(options, bucket_name = nil)
|
32
32
|
proto_req = Generated::Admin::Query::V1::GetAllIndexesRequest.new(
|
33
33
|
**location(
|
34
|
-
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name
|
35
|
-
)
|
34
|
+
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name,
|
35
|
+
),
|
36
36
|
)
|
37
37
|
|
38
38
|
create_request(proto_req, :get_all_indexes, options, idempotent: true)
|
@@ -47,9 +47,9 @@ module Couchbase
|
|
47
47
|
|
48
48
|
proto_req = Generated::Admin::Query::V1::CreatePrimaryIndexRequest.new(
|
49
49
|
**location(
|
50
|
-
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name
|
50
|
+
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name,
|
51
51
|
),
|
52
|
-
**proto_opts
|
52
|
+
**proto_opts,
|
53
53
|
)
|
54
54
|
|
55
55
|
create_request(proto_req, :create_primary_index, options)
|
@@ -63,11 +63,11 @@ module Couchbase
|
|
63
63
|
|
64
64
|
proto_req = Generated::Admin::Query::V1::CreateIndexRequest.new(
|
65
65
|
**location(
|
66
|
-
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name
|
66
|
+
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name,
|
67
67
|
),
|
68
68
|
name: index_name,
|
69
69
|
fields: fields,
|
70
|
-
**proto_opts
|
70
|
+
**proto_opts,
|
71
71
|
)
|
72
72
|
|
73
73
|
create_request(proto_req, :create_index, options)
|
@@ -76,8 +76,8 @@ module Couchbase
|
|
76
76
|
def drop_primary_index_request(options, bucket_name = nil)
|
77
77
|
proto_req = Generated::Admin::Query::V1::DropPrimaryIndexRequest.new(
|
78
78
|
**location(
|
79
|
-
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name
|
80
|
-
)
|
79
|
+
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name,
|
80
|
+
),
|
81
81
|
)
|
82
82
|
|
83
83
|
create_request(proto_req, :drop_primary_index, options)
|
@@ -86,9 +86,9 @@ module Couchbase
|
|
86
86
|
def drop_index_request(index_name, options, bucket_name = nil)
|
87
87
|
proto_req = Generated::Admin::Query::V1::DropIndexRequest.new(
|
88
88
|
**location(
|
89
|
-
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name
|
89
|
+
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name,
|
90
90
|
),
|
91
|
-
name: index_name
|
91
|
+
name: index_name,
|
92
92
|
)
|
93
93
|
|
94
94
|
create_request(proto_req, :drop_index, options)
|
@@ -97,8 +97,8 @@ module Couchbase
|
|
97
97
|
def build_deferred_indexes_request(options, bucket_name = nil)
|
98
98
|
proto_req = Generated::Admin::Query::V1::BuildDeferredIndexesRequest.new(
|
99
99
|
**location(
|
100
|
-
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name
|
101
|
-
)
|
100
|
+
bucket_name: bucket_name, scope_name: options.scope_name, collection_name: options.collection_name,
|
101
|
+
),
|
102
102
|
)
|
103
103
|
|
104
104
|
create_request(proto_req, :build_deferred_indexes, options)
|
@@ -120,7 +120,7 @@ module Couchbase
|
|
120
120
|
rpc: rpc,
|
121
121
|
proto_request: proto_request,
|
122
122
|
idempotent: idempotent,
|
123
|
-
timeout: options.timeout
|
123
|
+
timeout: options.timeout,
|
124
124
|
)
|
125
125
|
end
|
126
126
|
end
|
@@ -86,7 +86,7 @@ module Couchbase
|
|
86
86
|
proto_req = Generated::KV::V1::GetRequest.new(
|
87
87
|
key: id,
|
88
88
|
**location,
|
89
|
-
**proto_opts
|
89
|
+
**proto_opts,
|
90
90
|
)
|
91
91
|
|
92
92
|
create_kv_request(proto_req, :get, options, idempotent: true)
|
@@ -100,7 +100,7 @@ module Couchbase
|
|
100
100
|
proto_req = Generated::KV::V1::GetAndTouchRequest.new(
|
101
101
|
**{expiry_type => expiry_value},
|
102
102
|
**location,
|
103
|
-
key: id
|
103
|
+
key: id,
|
104
104
|
)
|
105
105
|
|
106
106
|
create_kv_request(proto_req, :get_and_touch, options)
|
@@ -110,7 +110,7 @@ module Couchbase
|
|
110
110
|
proto_req = Generated::KV::V1::GetAndLockRequest.new(
|
111
111
|
**location,
|
112
112
|
key: id,
|
113
|
-
lock_time: lock_time.respond_to?(:in_seconds) ? lock_time.in_seconds : lock_time
|
113
|
+
lock_time: lock_time.respond_to?(:in_seconds) ? lock_time.in_seconds : lock_time,
|
114
114
|
)
|
115
115
|
|
116
116
|
create_kv_request(proto_req, :get_and_lock, options)
|
@@ -120,7 +120,7 @@ module Couchbase
|
|
120
120
|
proto_req = Generated::KV::V1::UnlockRequest.new(
|
121
121
|
**location,
|
122
122
|
key: id,
|
123
|
-
cas: cas
|
123
|
+
cas: cas,
|
124
124
|
)
|
125
125
|
|
126
126
|
create_kv_request(proto_req, :unlock, options)
|
@@ -134,7 +134,7 @@ module Couchbase
|
|
134
134
|
proto_req = Generated::KV::V1::TouchRequest.new(
|
135
135
|
**{expiry_type => expiry_value},
|
136
136
|
**location,
|
137
|
-
key: id
|
137
|
+
key: id,
|
138
138
|
)
|
139
139
|
|
140
140
|
create_kv_request(proto_req, :touch, options)
|
@@ -156,7 +156,7 @@ module Couchbase
|
|
156
156
|
key: id,
|
157
157
|
content_uncompressed: encoded,
|
158
158
|
**location,
|
159
|
-
**proto_opts
|
159
|
+
**proto_opts,
|
160
160
|
)
|
161
161
|
|
162
162
|
create_kv_request(proto_req, :upsert, options)
|
@@ -177,7 +177,7 @@ module Couchbase
|
|
177
177
|
key: id,
|
178
178
|
content_uncompressed: encoded,
|
179
179
|
**location,
|
180
|
-
**proto_opts
|
180
|
+
**proto_opts,
|
181
181
|
)
|
182
182
|
|
183
183
|
create_kv_request(proto_req, :insert, options)
|
@@ -202,7 +202,7 @@ module Couchbase
|
|
202
202
|
key: id,
|
203
203
|
content_uncompressed: encoded,
|
204
204
|
**location,
|
205
|
-
**proto_opts
|
205
|
+
**proto_opts,
|
206
206
|
)
|
207
207
|
|
208
208
|
create_kv_request(proto_req, :replace, options)
|
@@ -217,7 +217,7 @@ module Couchbase
|
|
217
217
|
proto_req = Generated::KV::V1::RemoveRequest.new(
|
218
218
|
key: id,
|
219
219
|
**location,
|
220
|
-
**proto_opts
|
220
|
+
**proto_opts,
|
221
221
|
)
|
222
222
|
|
223
223
|
create_kv_request(proto_req, :remove, options)
|
@@ -229,7 +229,7 @@ module Couchbase
|
|
229
229
|
proto_req = Generated::KV::V1::ExistsRequest.new(
|
230
230
|
key: id,
|
231
231
|
**proto_opts,
|
232
|
-
**location
|
232
|
+
**location,
|
233
233
|
)
|
234
234
|
|
235
235
|
create_kv_request(proto_req, :exists, options)
|
@@ -256,7 +256,7 @@ module Couchbase
|
|
256
256
|
key: id,
|
257
257
|
**location,
|
258
258
|
specs: specs.map { |s| get_mutate_in_spec(s) },
|
259
|
-
**proto_opts
|
259
|
+
**proto_opts,
|
260
260
|
)
|
261
261
|
|
262
262
|
create_kv_request(proto_req, :mutate_in, options)
|
@@ -271,7 +271,7 @@ module Couchbase
|
|
271
271
|
key: id,
|
272
272
|
**location,
|
273
273
|
specs: specs.map { |s| get_lookup_in_spec(s) },
|
274
|
-
**proto_opts
|
274
|
+
**proto_opts,
|
275
275
|
)
|
276
276
|
|
277
277
|
create_kv_request(proto_req, :lookup_in, options, idempotent: true)
|
@@ -288,7 +288,7 @@ module Couchbase
|
|
288
288
|
proto_req = Generated::KV::V1::IncrementRequest.new(
|
289
289
|
key: id,
|
290
290
|
**location,
|
291
|
-
**proto_opts
|
291
|
+
**proto_opts,
|
292
292
|
)
|
293
293
|
|
294
294
|
create_kv_request(proto_req, :increment, options)
|
@@ -305,7 +305,7 @@ module Couchbase
|
|
305
305
|
proto_req = Generated::KV::V1::DecrementRequest.new(
|
306
306
|
key: id,
|
307
307
|
**location,
|
308
|
-
**proto_opts
|
308
|
+
**proto_opts,
|
309
309
|
)
|
310
310
|
|
311
311
|
create_kv_request(proto_req, :decrement, options)
|
@@ -320,7 +320,7 @@ module Couchbase
|
|
320
320
|
key: id,
|
321
321
|
content: content,
|
322
322
|
**location,
|
323
|
-
**proto_opts
|
323
|
+
**proto_opts,
|
324
324
|
)
|
325
325
|
|
326
326
|
create_kv_request(proto_req, :append, options)
|
@@ -335,7 +335,7 @@ module Couchbase
|
|
335
335
|
key: id,
|
336
336
|
content: content,
|
337
337
|
**location,
|
338
|
-
**proto_opts
|
338
|
+
**proto_opts,
|
339
339
|
)
|
340
340
|
|
341
341
|
create_kv_request(proto_req, :prepend, options)
|
@@ -344,7 +344,7 @@ module Couchbase
|
|
344
344
|
def get_all_replicas_request(id, options)
|
345
345
|
proto_req = Generated::KV::V1::GetAllReplicasRequest.new(
|
346
346
|
key: id,
|
347
|
-
**location
|
347
|
+
**location,
|
348
348
|
)
|
349
349
|
|
350
350
|
create_kv_request(proto_req, :get_all_replicas, options, idempotent: true)
|
@@ -363,7 +363,7 @@ module Couchbase
|
|
363
363
|
rpc: rpc,
|
364
364
|
proto_request: proto_request,
|
365
365
|
timeout: options.timeout,
|
366
|
-
idempotent: idempotent
|
366
|
+
idempotent: idempotent,
|
367
367
|
)
|
368
368
|
end
|
369
369
|
|
@@ -385,7 +385,7 @@ module Couchbase
|
|
385
385
|
[:expiry_secs, time_or_duration]
|
386
386
|
when :time_point
|
387
387
|
timestamp = Google::Protobuf::Timestamp.new(
|
388
|
-
seconds: time_or_duration
|
388
|
+
seconds: time_or_duration,
|
389
389
|
)
|
390
390
|
[:expiry_time, timestamp]
|
391
391
|
else
|
@@ -405,7 +405,7 @@ module Couchbase
|
|
405
405
|
Generated::KV::V1::LookupInRequest::Spec.new(
|
406
406
|
operation: get_lookup_in_operation(lookup_in_spec),
|
407
407
|
path: lookup_in_spec.path,
|
408
|
-
flags: get_lookup_in_spec_flags(lookup_in_spec)
|
408
|
+
flags: get_lookup_in_spec_flags(lookup_in_spec),
|
409
409
|
)
|
410
410
|
end
|
411
411
|
|
@@ -415,13 +415,13 @@ module Couchbase
|
|
415
415
|
|
416
416
|
def get_lookup_in_spec_flags(lookup_in_spec)
|
417
417
|
Generated::KV::V1::LookupInRequest::Spec::Flags.new(
|
418
|
-
xattr: lookup_in_spec.xattr
|
418
|
+
xattr: lookup_in_spec.xattr?,
|
419
419
|
)
|
420
420
|
end
|
421
421
|
|
422
422
|
def get_lookup_in_flags(options)
|
423
423
|
Generated::KV::V1::LookupInRequest::Flags.new(
|
424
|
-
access_deleted: options.access_deleted
|
424
|
+
access_deleted: options.access_deleted,
|
425
425
|
)
|
426
426
|
end
|
427
427
|
|
@@ -434,7 +434,7 @@ module Couchbase
|
|
434
434
|
operation: get_mutate_in_operation(mutate_in_spec),
|
435
435
|
path: mutate_in_spec.path,
|
436
436
|
content: mutate_in_spec.param.to_s,
|
437
|
-
flags: get_mutate_in_spec_flags(mutate_in_spec)
|
437
|
+
flags: get_mutate_in_spec_flags(mutate_in_spec),
|
438
438
|
)
|
439
439
|
end
|
440
440
|
|
@@ -445,13 +445,13 @@ module Couchbase
|
|
445
445
|
def get_mutate_in_spec_flags(mutate_in_spec)
|
446
446
|
Generated::KV::V1::MutateInRequest::Spec::Flags.new(
|
447
447
|
create_path: mutate_in_spec.create_path?,
|
448
|
-
xattr: mutate_in_spec.xattr
|
448
|
+
xattr: mutate_in_spec.xattr?,
|
449
449
|
)
|
450
450
|
end
|
451
451
|
|
452
452
|
def get_mutate_in_flags(options)
|
453
453
|
Generated::KV::V1::MutateInRequest::Flags.new(
|
454
|
-
access_deleted: options.access_deleted
|
454
|
+
access_deleted: options.access_deleted,
|
455
455
|
)
|
456
456
|
end
|
457
457
|
|
@@ -78,7 +78,7 @@ module Couchbase
|
|
78
78
|
|
79
79
|
proto_req = Generated::Query::V1::QueryRequest.new(
|
80
80
|
statement: statement,
|
81
|
-
**proto_opts
|
81
|
+
**proto_opts,
|
82
82
|
)
|
83
83
|
|
84
84
|
create_query_request(proto_req, :query, options, idempotent: options.readonly)
|
@@ -92,7 +92,7 @@ module Couchbase
|
|
92
92
|
rpc: rpc,
|
93
93
|
proto_request: proto_request,
|
94
94
|
timeout: options.timeout,
|
95
|
-
idempotent: idempotent
|
95
|
+
idempotent: idempotent,
|
96
96
|
)
|
97
97
|
end
|
98
98
|
|
@@ -105,7 +105,7 @@ module Couchbase
|
|
105
105
|
duration_millis = Utils::Time.extract_duration(options.scan_wait)
|
106
106
|
tuning_opts[:scan_wait] = Google::Protobuf::Duration.new(
|
107
107
|
seconds: duration_millis / 1000,
|
108
|
-
nanos: (duration_millis % 1000) * (10**6)
|
108
|
+
nanos: (duration_millis % 1000) * (10**6),
|
109
109
|
)
|
110
110
|
end
|
111
111
|
tuning_opts[:scan_cap] = options.scan_cap unless options.scan_cap.nil?
|
@@ -123,7 +123,7 @@ module Couchbase
|
|
123
123
|
bucket_name: t.bucket_name,
|
124
124
|
vbucket_id: t.partition_id,
|
125
125
|
vbucket_uuid: t.partition_uuid,
|
126
|
-
seq_no: t.sequence_number
|
126
|
+
seq_no: t.sequence_number,
|
127
127
|
)
|
128
128
|
end
|
129
129
|
end
|
@@ -62,7 +62,7 @@ module Couchbase
|
|
62
62
|
proto_req = Generated::Search::V1::SearchQueryRequest.new(
|
63
63
|
query: create_query(query),
|
64
64
|
index_name: index_name,
|
65
|
-
**proto_opts
|
65
|
+
**proto_opts,
|
66
66
|
)
|
67
67
|
|
68
68
|
# Set the search facets in the request
|
@@ -81,7 +81,7 @@ module Couchbase
|
|
81
81
|
rpc: rpc,
|
82
82
|
proto_request: proto_request,
|
83
83
|
timeout: options.timeout,
|
84
|
-
idempotent: idempotent
|
84
|
+
idempotent: idempotent,
|
85
85
|
)
|
86
86
|
end
|
87
87
|
|
@@ -188,11 +188,11 @@ module Couchbase
|
|
188
188
|
query_attrs = query.to_h
|
189
189
|
query_attrs[:top_left] = Generated::Search::V1::LatLng.new(
|
190
190
|
longitude: query_attrs[:top_left][0],
|
191
|
-
latitude: query_attrs[:top_left][1]
|
191
|
+
latitude: query_attrs[:top_left][1],
|
192
192
|
)
|
193
193
|
query_attrs[:bottom_right] = Generated::Search::V1::LatLng.new(
|
194
194
|
longitude: query_attrs[:bottom_right][0],
|
195
|
-
latitude: query_attrs[:bottom_right][1]
|
195
|
+
latitude: query_attrs[:bottom_right][1],
|
196
196
|
)
|
197
197
|
Generated::Search::V1::GeoBoundingBoxQuery.new(query_attrs)
|
198
198
|
end
|
@@ -202,7 +202,7 @@ module Couchbase
|
|
202
202
|
longitude, latitude = query_attrs.delete(:location)
|
203
203
|
query_attrs[:center] = Generated::Search::V1::LatLng.new(
|
204
204
|
longitude: longitude,
|
205
|
-
latitude: latitude
|
205
|
+
latitude: latitude,
|
206
206
|
)
|
207
207
|
Generated::Search::V1::GeoDistanceQuery.new(query_attrs)
|
208
208
|
end
|
@@ -213,7 +213,7 @@ module Couchbase
|
|
213
213
|
query_attrs[:vertices] = polygon_points.map do |lon, lat|
|
214
214
|
Generated::Search::V1::LatLng.new(
|
215
215
|
longitude: lon,
|
216
|
-
latitude: lat
|
216
|
+
latitude: lat,
|
217
217
|
)
|
218
218
|
end
|
219
219
|
Generated::Search::V1::GeoPolygonQuery.new(query_attrs)
|
@@ -288,20 +288,20 @@ module Couchbase
|
|
288
288
|
descending: s.desc,
|
289
289
|
missing: s.missing.to_s,
|
290
290
|
mode: s.mode.to_s,
|
291
|
-
type: s.type.to_s
|
292
|
-
)
|
291
|
+
type: s.type.to_s,
|
292
|
+
),
|
293
293
|
)
|
294
294
|
when Couchbase::Cluster::SearchSort::SearchSortId
|
295
295
|
Generated::Search::V1::Sorting.new(
|
296
296
|
id_sorting: Generated::Search::V1::IdSorting.new(
|
297
|
-
descending: s.desc
|
298
|
-
)
|
297
|
+
descending: s.desc,
|
298
|
+
),
|
299
299
|
)
|
300
300
|
when Couchbase::Cluster::SearchSort::SearchSortScore
|
301
301
|
Generated::Search::V1::Sorting.new(
|
302
302
|
score_sorting: Generated::Search::V1::ScoreSorting.new(
|
303
|
-
descending: s.desc
|
304
|
-
)
|
303
|
+
descending: s.desc,
|
304
|
+
),
|
305
305
|
)
|
306
306
|
when Couchbase::Cluster::SearchSort::SearchSortGeoDistance
|
307
307
|
Generated::Search::V1::Sorting.new(
|
@@ -310,10 +310,10 @@ module Couchbase
|
|
310
310
|
descending: s.desc,
|
311
311
|
center: Generated::Search::V1::LatLng.new(
|
312
312
|
latitude: s.latitude,
|
313
|
-
longitude: s.longitude
|
313
|
+
longitude: s.longitude,
|
314
314
|
),
|
315
|
-
unit: s.unit.to_s
|
316
|
-
)
|
315
|
+
unit: s.unit.to_s,
|
316
|
+
),
|
317
317
|
)
|
318
318
|
when String
|
319
319
|
if s[0] == "-"
|
@@ -326,16 +326,16 @@ module Couchbase
|
|
326
326
|
if field == "_score"
|
327
327
|
Generated::Search::V1::Sorting.new(
|
328
328
|
score_sorting: Generated::Search::V1::ScoreSorting.new(
|
329
|
-
descending: desc
|
330
|
-
)
|
329
|
+
descending: desc,
|
330
|
+
),
|
331
331
|
)
|
332
332
|
else
|
333
333
|
Generated::Search::V1::Sorting.new(
|
334
334
|
# TODO: What to do with the rest of the FieldSorting attributes?
|
335
335
|
core_sorting: Generated::Search::V1::FieldSorting.new(
|
336
336
|
field: field,
|
337
|
-
descending: desc
|
338
|
-
)
|
337
|
+
descending: desc,
|
338
|
+
),
|
339
339
|
)
|
340
340
|
end
|
341
341
|
else
|
@@ -353,8 +353,8 @@ module Couchbase
|
|
353
353
|
Generated::Search::V1::Facet.new(
|
354
354
|
term_facet: Generated::Search::V1::TermFacet.new(
|
355
355
|
field: facet.field,
|
356
|
-
size: facet.size
|
357
|
-
)
|
356
|
+
size: facet.size,
|
357
|
+
),
|
358
358
|
)
|
359
359
|
when Couchbase::Cluster::SearchFacet::SearchFacetNumericRange
|
360
360
|
Generated::Search::V1::Facet.new(
|
@@ -363,8 +363,8 @@ module Couchbase
|
|
363
363
|
size: facet.size,
|
364
364
|
numeric_ranges: facet.instance_variable_get(:@ranges).map do |r|
|
365
365
|
Generated::Search::V1::NumericRange(name: r[:name], min: r[:min], max: r[:max])
|
366
|
-
end
|
367
|
-
)
|
366
|
+
end,
|
367
|
+
),
|
368
368
|
)
|
369
369
|
when Couchbase::Cluster::SearchFacet::SearchFacetDateRange
|
370
370
|
Generated::Search::V1::Facet.new(
|
@@ -373,8 +373,8 @@ module Couchbase
|
|
373
373
|
size: facet.size,
|
374
374
|
date_ranges: facet.instance_variable_get(:@ranges).map do |r|
|
375
375
|
Generated::Search::V1::DateRange(name: r[:name], start: r[:start], end: r[:end])
|
376
|
-
end
|
377
|
-
)
|
376
|
+
end,
|
377
|
+
),
|
378
378
|
)
|
379
379
|
else
|
380
380
|
raise Couchbase::Error::CouchbaseError, "Unrecognised search facet type"
|
@@ -45,7 +45,7 @@ module Couchbase
|
|
45
45
|
r.score = proto_row.score.to_f
|
46
46
|
unless proto_row.locations.empty?
|
47
47
|
r.locations = Couchbase::Cluster::SearchRowLocations.new(
|
48
|
-
proto_row.locations.map { |loc| convert_search_row_location(loc) }
|
48
|
+
proto_row.locations.map { |loc| convert_search_row_location(loc) },
|
49
49
|
)
|
50
50
|
end
|
51
51
|
r.fragments = convert_fragments(proto_row.fragments)
|
@@ -75,7 +75,7 @@ module Couchbase
|
|
75
75
|
query_timeout: options.query_timeout,
|
76
76
|
analytics_timeout: options.analytics_timeout,
|
77
77
|
search_timeout: options.search_timeout,
|
78
|
-
management_timeout: options.management_timeout
|
78
|
+
management_timeout: options.management_timeout,
|
79
79
|
)
|
80
80
|
end
|
81
81
|
end
|
data/lib/couchbase/scope.rb
CHANGED
@@ -39,7 +39,7 @@ module Couchbase
|
|
39
39
|
payload += " at #{filename}:#{line} #{function}" if @verbose && filename
|
40
40
|
logdev.write(
|
41
41
|
@logger.send(:format_message, @logger.send(:format_severity, severity), ::Time.at(seconds, nanoseconds, :nanosecond), progname,
|
42
|
-
payload)
|
42
|
+
payload),
|
43
43
|
)
|
44
44
|
end
|
45
45
|
|
data/lib/couchbase/version.rb
CHANGED
@@ -21,5 +21,5 @@ module Couchbase
|
|
21
21
|
# $ ruby -rcouchbase -e 'pp Couchbase::VERSION'
|
22
22
|
# {:sdk=>"3.4.0", :ruby_abi=>"3.1.0", :revision=>"416fe68e6029ec8a4c40611cf6e6b30d3b90d20f"}
|
23
23
|
VERSION = {} unless defined?(VERSION) # rubocop:disable Style/MutableConstant
|
24
|
-
VERSION.update(:sdk => "3.
|
24
|
+
VERSION.update(:sdk => "3.6.0")
|
25
25
|
end
|