couchbase 3.8.2-aarch64-linux → 3.9.0-aarch64-linux
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/lib/active_support/cache/couchbase_store.rb +77 -12
- data/lib/couchbase/3.2/libcouchbase.so +0 -0
- data/lib/couchbase/3.3/libcouchbase.so +0 -0
- data/lib/couchbase/3.4/libcouchbase.so +0 -0
- data/lib/couchbase/4.0/libcouchbase.so +0 -0
- data/lib/couchbase/bucket.rb +20 -0
- data/lib/couchbase/cluster.rb +17 -0
- data/lib/couchbase/collection.rb +36 -1
- data/lib/couchbase/errors.rb +18 -0
- data/lib/couchbase/fork_hooks.rb +16 -7
- data/lib/couchbase/get_replica_strategy.rb +89 -0
- data/lib/couchbase/logger.rb +1 -1
- data/lib/couchbase/management/analytics_index_manager.rb +15 -15
- data/lib/couchbase/management/bucket_manager.rb +6 -6
- data/lib/couchbase/management/collection_manager.rb +6 -6
- data/lib/couchbase/management/query_index_manager.rb +7 -7
- data/lib/couchbase/management/search_index_manager.rb +13 -13
- data/lib/couchbase/management/user_manager.rb +10 -10
- data/lib/couchbase/management/view_index_manager.rb +5 -5
- data/lib/couchbase/options.rb +174 -42
- data/lib/couchbase/protostellar/bucket.rb +4 -0
- data/lib/couchbase/protostellar/cluster.rb +4 -0
- data/lib/couchbase/protostellar/collection.rb +4 -0
- data/lib/couchbase/protostellar/error_handling.rb +2 -1
- data/lib/couchbase/protostellar/request.rb +1 -0
- data/lib/couchbase/protostellar/request_generator/kv.rb +16 -2
- data/lib/couchbase/protostellar/request_generator/search.rb +17 -1
- data/lib/couchbase/protostellar/retry/orchestrator.rb +3 -2
- data/lib/couchbase/protostellar/retry/strategies/fail_fast.rb +33 -0
- data/lib/couchbase/protostellar/retry/strategies.rb +1 -0
- data/lib/couchbase/search_options.rb +95 -6
- data/lib/couchbase/version.rb +1 -1
- metadata +7 -5
|
@@ -138,6 +138,10 @@ module Couchbase
|
|
|
138
138
|
ResponseConverter::KV.to_get_any_replica_result(resp, options)
|
|
139
139
|
end
|
|
140
140
|
|
|
141
|
+
def get_replica(_id, _strategy, _options = Couchbase::Options::GetReplica::DEFAULT)
|
|
142
|
+
raise Couchbase::Error::FeatureNotAvailable, "The #{Protostellar::NAME} protocol does not support get replica"
|
|
143
|
+
end
|
|
144
|
+
|
|
141
145
|
def get_all_replicas(id, options = Couchbase::Options::GetAllReplicas::DEFAULT)
|
|
142
146
|
req = @kv_request_generator.get_all_replicas_request(id, options)
|
|
143
147
|
resp = @client.send_request(req)
|
|
@@ -144,7 +144,8 @@ module Couchbase
|
|
|
144
144
|
when Google::Rpc::Code::FAILED_PRECONDITION
|
|
145
145
|
case detail_block[:precondition_failure].violations[0].type
|
|
146
146
|
when "LOCKED"
|
|
147
|
-
Retry::Orchestrator.maybe_retry(request, Retry::Reason::KV_LOCKED
|
|
147
|
+
Retry::Orchestrator.maybe_retry(request, Retry::Reason::KV_LOCKED,
|
|
148
|
+
Couchbase::Error::DocumentLocked.new(message, request.error_context))
|
|
148
149
|
when "DOC_TOO_DEEP"
|
|
149
150
|
RequestBehaviour.fail(Couchbase::Error::PathTooDeep.new(message, request.error_context))
|
|
150
151
|
when "DOC_NOT_JSON"
|
|
@@ -347,7 +347,8 @@ module Couchbase
|
|
|
347
347
|
**location,
|
|
348
348
|
)
|
|
349
349
|
|
|
350
|
-
create_kv_request(proto_req, :get_all_replicas, options,
|
|
350
|
+
create_kv_request(proto_req, :get_all_replicas, options,
|
|
351
|
+
idempotent: true, retry_strategy: Retry::Strategies::BestEffort::DEFAULT)
|
|
351
352
|
end
|
|
352
353
|
|
|
353
354
|
def get_any_replica_request(id, options)
|
|
@@ -357,16 +358,29 @@ module Couchbase
|
|
|
357
358
|
|
|
358
359
|
private
|
|
359
360
|
|
|
360
|
-
def create_kv_request(proto_request, rpc, options, idempotent: false
|
|
361
|
+
def create_kv_request(proto_request, rpc, options, idempotent: false,
|
|
362
|
+
retry_strategy: kv_retry_strategy(options.retry_strategy))
|
|
361
363
|
Request.new(
|
|
362
364
|
service: :kv,
|
|
363
365
|
rpc: rpc,
|
|
364
366
|
proto_request: proto_request,
|
|
365
367
|
timeout: options.timeout,
|
|
368
|
+
retry_strategy: retry_strategy,
|
|
366
369
|
idempotent: idempotent,
|
|
367
370
|
)
|
|
368
371
|
end
|
|
369
372
|
|
|
373
|
+
def kv_retry_strategy(name)
|
|
374
|
+
case name
|
|
375
|
+
when nil, :best_effort
|
|
376
|
+
Retry::Strategies::BestEffort::DEFAULT
|
|
377
|
+
when :fail_fast
|
|
378
|
+
Retry::Strategies::FailFast::DEFAULT
|
|
379
|
+
else
|
|
380
|
+
raise Error::InvalidArgument, "retry_strategy must be :best_effort or :fail_fast, but given #{name.inspect}"
|
|
381
|
+
end
|
|
382
|
+
end
|
|
383
|
+
|
|
370
384
|
def get_expiry(options_or_expiry)
|
|
371
385
|
if options_or_expiry.respond_to?(:expiry)
|
|
372
386
|
type, time_or_duration = Couchbase::Utils::Time.extract_expiry_time(options_or_expiry.expiry)
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
require "google/protobuf/well_known_types"
|
|
18
18
|
|
|
19
|
+
require "couchbase/errors"
|
|
19
20
|
require "couchbase/search_options"
|
|
20
21
|
|
|
21
22
|
require "couchbase/protostellar/generated/search/v1/search_pb"
|
|
@@ -48,7 +49,7 @@ module Couchbase
|
|
|
48
49
|
scan_consistency: SCAN_CONSISTENCY_MAP[options.scan_consistency],
|
|
49
50
|
include_explanation: options.explain,
|
|
50
51
|
highlight_style: HIGHLIGHT_STYLE_MAP[options.highlight_style],
|
|
51
|
-
disable_scoring: options
|
|
52
|
+
disable_scoring: get_disable_scoring(options),
|
|
52
53
|
include_locations: options.include_locations,
|
|
53
54
|
}
|
|
54
55
|
|
|
@@ -344,6 +345,21 @@ module Couchbase
|
|
|
344
345
|
end
|
|
345
346
|
end
|
|
346
347
|
|
|
348
|
+
# The only scoring mode supported by the protocol is {Couchbase::SearchScoring.none}.
|
|
349
|
+
# This will be updated to support all types of scoring once the protostellar protocol supports them.
|
|
350
|
+
def get_disable_scoring(options)
|
|
351
|
+
return options.disable_scoring if options.scoring.nil?
|
|
352
|
+
|
|
353
|
+
options.validate_scoring
|
|
354
|
+
|
|
355
|
+
unless options.scoring.is_a?(Couchbase::SearchScoring::SearchScoringNone)
|
|
356
|
+
raise Couchbase::Error::FeatureNotAvailable,
|
|
357
|
+
"The #{Protostellar::NAME} protocol does not support #{options.scoring.class} scoring"
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
true
|
|
361
|
+
end
|
|
362
|
+
|
|
347
363
|
def get_facets(options)
|
|
348
364
|
return {} if options.facets.nil?
|
|
349
365
|
|
|
@@ -24,7 +24,8 @@ module Couchbase
|
|
|
24
24
|
module Retry
|
|
25
25
|
# @api private
|
|
26
26
|
class Orchestrator
|
|
27
|
-
|
|
27
|
+
# @param [Couchbase::Error::CouchbaseError, nil] cause raised when the strategy declines the retry
|
|
28
|
+
def self.maybe_retry(request, reason, cause = nil)
|
|
28
29
|
if reason.always_retry
|
|
29
30
|
retry_duration = get_controlled_backoff(request)
|
|
30
31
|
request.add_retry_attempt(reason)
|
|
@@ -35,7 +36,7 @@ module Couchbase
|
|
|
35
36
|
duration = retry_action.duration
|
|
36
37
|
if duration.nil?
|
|
37
38
|
# TODO: Log not retried
|
|
38
|
-
RequestBehaviour.fail(Couchbase::Error::RequestCanceled.new('Cannot retry request', request.error_context))
|
|
39
|
+
RequestBehaviour.fail(cause || Couchbase::Error::RequestCanceled.new('Cannot retry request', request.error_context))
|
|
39
40
|
else
|
|
40
41
|
request.add_retry_attempt(reason)
|
|
41
42
|
# TODO: Log retry
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Copyright 2023. Couchbase, Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
# frozen_string_literal: true
|
|
16
|
+
|
|
17
|
+
require_relative "../action"
|
|
18
|
+
|
|
19
|
+
module Couchbase
|
|
20
|
+
module Protostellar
|
|
21
|
+
module Retry
|
|
22
|
+
module Strategies
|
|
23
|
+
class FailFast
|
|
24
|
+
def retry_after(_request, _reason)
|
|
25
|
+
Retry::Action.no_retry
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
DEFAULT = FailFast.new.freeze
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -25,8 +25,6 @@ module Couchbase
|
|
|
25
25
|
# @overload new(vector_search)
|
|
26
26
|
# Will run a +VectorSearch+
|
|
27
27
|
# @param [VectorSearch] vector_search
|
|
28
|
-
#
|
|
29
|
-
# @!macro uncommitted
|
|
30
28
|
def initialize(search)
|
|
31
29
|
case search
|
|
32
30
|
when SearchQuery
|
|
@@ -57,8 +55,6 @@ module Couchbase
|
|
|
57
55
|
# @param [VectorSearch] query
|
|
58
56
|
#
|
|
59
57
|
# @return [SearchRequest] for chaining purposes
|
|
60
|
-
#
|
|
61
|
-
# @!macro uncommitted
|
|
62
58
|
def vector_search(query)
|
|
63
59
|
raise Error::InvalidArgument, "A VectorSearch has already been specified" unless @vector_search.nil?
|
|
64
60
|
|
|
@@ -1046,7 +1042,6 @@ module Couchbase
|
|
|
1046
1042
|
end
|
|
1047
1043
|
end
|
|
1048
1044
|
|
|
1049
|
-
# @!macro uncommitted
|
|
1050
1045
|
class VectorSearch
|
|
1051
1046
|
# Constructs a +VectorSearch+ instance, which allows one or more individual vector queries to be executed.
|
|
1052
1047
|
#
|
|
@@ -1065,7 +1060,6 @@ module Couchbase
|
|
|
1065
1060
|
end
|
|
1066
1061
|
end
|
|
1067
1062
|
|
|
1068
|
-
# @!macro uncommitted
|
|
1069
1063
|
class VectorQuery
|
|
1070
1064
|
# @return [Integer, nil]
|
|
1071
1065
|
attr_accessor :num_candidates
|
|
@@ -1259,6 +1253,101 @@ module Couchbase
|
|
|
1259
1253
|
end
|
|
1260
1254
|
end
|
|
1261
1255
|
|
|
1256
|
+
# +SearchScoring+ specifies the scoring mode used for a search request. For a hybrid search (a traditional FTS
|
|
1257
|
+
# query combined with one or more vector queries) a fusion strategy controls how the FTS and vector result
|
|
1258
|
+
# sets are merged into a single ranked list.
|
|
1259
|
+
#
|
|
1260
|
+
class SearchScoring
|
|
1261
|
+
# @yieldparam [SearchScoringReciprocalRankFusion]
|
|
1262
|
+
#
|
|
1263
|
+
# @!macro uncommitted
|
|
1264
|
+
#
|
|
1265
|
+
# @return [SearchScoringReciprocalRankFusion]
|
|
1266
|
+
def self.reciprocal_rank_fusion(&)
|
|
1267
|
+
SearchScoringReciprocalRankFusion.new(&)
|
|
1268
|
+
end
|
|
1269
|
+
|
|
1270
|
+
# @yieldparam [SearchScoringRelativeScoreFusion]
|
|
1271
|
+
#
|
|
1272
|
+
# @!macro uncommitted
|
|
1273
|
+
#
|
|
1274
|
+
# @return [SearchScoringRelativeScoreFusion]
|
|
1275
|
+
def self.relative_score_fusion(&)
|
|
1276
|
+
SearchScoringRelativeScoreFusion.new(&)
|
|
1277
|
+
end
|
|
1278
|
+
|
|
1279
|
+
# @return [SearchScoringNone]
|
|
1280
|
+
def self.none
|
|
1281
|
+
SearchScoringNone.new
|
|
1282
|
+
end
|
|
1283
|
+
|
|
1284
|
+
# +SearchScoringReciprocalRankFusion+ merges the FTS and vector result sets of a hybrid search by rank rather
|
|
1285
|
+
# than raw score.
|
|
1286
|
+
#
|
|
1287
|
+
# @!macro uncommitted
|
|
1288
|
+
class SearchScoringReciprocalRankFusion < SearchScoring
|
|
1289
|
+
# @return [Integer, nil] the rank constant used when merging the result sets (the server defaults this to 60)
|
|
1290
|
+
attr_accessor :rank_constant
|
|
1291
|
+
|
|
1292
|
+
# @return [Integer, nil] how many results per list are considered for fusion (the server defaults this to the
|
|
1293
|
+
# request limit)
|
|
1294
|
+
attr_accessor :window_size
|
|
1295
|
+
|
|
1296
|
+
# @yieldparam [SearchScoringReciprocalRankFusion]
|
|
1297
|
+
def initialize
|
|
1298
|
+
super
|
|
1299
|
+
yield self if block_given?
|
|
1300
|
+
end
|
|
1301
|
+
|
|
1302
|
+
# @api private
|
|
1303
|
+
def to_backend
|
|
1304
|
+
{
|
|
1305
|
+
mode: :reciprocal_rank_fusion,
|
|
1306
|
+
params: {
|
|
1307
|
+
rank_constant: @rank_constant,
|
|
1308
|
+
window_size: @window_size,
|
|
1309
|
+
}.compact,
|
|
1310
|
+
}
|
|
1311
|
+
end
|
|
1312
|
+
end
|
|
1313
|
+
|
|
1314
|
+
# +SearchScoringRelativeScoreFusion+ merges the FTS and vector result sets of a hybrid search by normalized
|
|
1315
|
+
# score.
|
|
1316
|
+
#
|
|
1317
|
+
# @!macro uncommitted
|
|
1318
|
+
class SearchScoringRelativeScoreFusion < SearchScoring
|
|
1319
|
+
# @return [Integer, nil] how many results per list are considered for fusion (the server defaults this to the
|
|
1320
|
+
# request limit)
|
|
1321
|
+
attr_accessor :window_size
|
|
1322
|
+
|
|
1323
|
+
# @yieldparam [SearchScoringRelativeScoreFusion]
|
|
1324
|
+
def initialize
|
|
1325
|
+
super
|
|
1326
|
+
yield self if block_given?
|
|
1327
|
+
end
|
|
1328
|
+
|
|
1329
|
+
# @api private
|
|
1330
|
+
def to_backend
|
|
1331
|
+
{
|
|
1332
|
+
mode: :relative_score_fusion,
|
|
1333
|
+
params: {
|
|
1334
|
+
window_size: @window_size,
|
|
1335
|
+
}.compact,
|
|
1336
|
+
}
|
|
1337
|
+
end
|
|
1338
|
+
end
|
|
1339
|
+
|
|
1340
|
+
# +SearchScoringNone+ disables scoring.
|
|
1341
|
+
class SearchScoringNone < SearchScoring
|
|
1342
|
+
# @api private
|
|
1343
|
+
def to_backend
|
|
1344
|
+
{
|
|
1345
|
+
mode: :none,
|
|
1346
|
+
}
|
|
1347
|
+
end
|
|
1348
|
+
end
|
|
1349
|
+
end
|
|
1350
|
+
|
|
1262
1351
|
class SearchFacet
|
|
1263
1352
|
# @param [String] field_name
|
|
1264
1353
|
# @return [SearchFacetTerm]
|
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.9.0")
|
|
25
25
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: couchbase
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.9.0
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Sergey Avseyev
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-10-21 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: concurrent-ruby
|
|
@@ -73,6 +73,7 @@ files:
|
|
|
73
73
|
- lib/couchbase/diagnostics.rb
|
|
74
74
|
- lib/couchbase/errors.rb
|
|
75
75
|
- lib/couchbase/fork_hooks.rb
|
|
76
|
+
- lib/couchbase/get_replica_strategy.rb
|
|
76
77
|
- lib/couchbase/json_transcoder.rb
|
|
77
78
|
- lib/couchbase/key_value_scan.rb
|
|
78
79
|
- lib/couchbase/libcouchbase.rb
|
|
@@ -161,6 +162,7 @@ files:
|
|
|
161
162
|
- lib/couchbase/protostellar/retry/reason.rb
|
|
162
163
|
- lib/couchbase/protostellar/retry/strategies.rb
|
|
163
164
|
- lib/couchbase/protostellar/retry/strategies/best_effort.rb
|
|
165
|
+
- lib/couchbase/protostellar/retry/strategies/fail_fast.rb
|
|
164
166
|
- lib/couchbase/protostellar/scope.rb
|
|
165
167
|
- lib/couchbase/protostellar/timeout_defaults.rb
|
|
166
168
|
- lib/couchbase/protostellar/timeouts.rb
|
|
@@ -196,9 +198,9 @@ metadata:
|
|
|
196
198
|
homepage_uri: https://docs.couchbase.com/ruby-sdk/current/hello-world/start-using-sdk.html
|
|
197
199
|
bug_tracker_uri: https://jira.issues.couchbase.com/browse/RCBC
|
|
198
200
|
mailing_list_uri: https://www.couchbase.com/forums/c/ruby-sdk
|
|
199
|
-
source_code_uri: https://github.com/couchbase/couchbase-ruby-client/tree/3.
|
|
200
|
-
changelog_uri: https://github.com/couchbase/couchbase-ruby-client/releases/tag/3.
|
|
201
|
-
documentation_uri: https://docs.couchbase.com/sdk-api/couchbase-ruby-client-3.
|
|
201
|
+
source_code_uri: https://github.com/couchbase/couchbase-ruby-client/tree/3.9.0
|
|
202
|
+
changelog_uri: https://github.com/couchbase/couchbase-ruby-client/releases/tag/3.9.0
|
|
203
|
+
documentation_uri: https://docs.couchbase.com/sdk-api/couchbase-ruby-client-3.9.0/index.html
|
|
202
204
|
github_repo: https://github.com/couchbase/couchbase-ruby-client
|
|
203
205
|
rubygems_mfa_required: 'true'
|
|
204
206
|
rdoc_options:
|