couchbase 3.7.0-aarch64-linux → 3.8.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 +3 -3
- data/lib/active_support/cache/couchbase_store.rb +6 -6
- 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/{3.1 → 4.0}/libcouchbase.so +0 -0
- data/lib/couchbase/authenticator.rb +14 -0
- data/lib/couchbase/binary_collection.rb +37 -22
- data/lib/couchbase/bucket.rb +46 -31
- data/lib/couchbase/cluster.rb +146 -61
- data/lib/couchbase/collection.rb +257 -186
- data/lib/couchbase/datastructures/couchbase_list.rb +81 -50
- data/lib/couchbase/datastructures/couchbase_map.rb +86 -50
- data/lib/couchbase/datastructures/couchbase_queue.rb +64 -38
- data/lib/couchbase/datastructures/couchbase_set.rb +57 -41
- data/lib/couchbase/deprecations.rb +1 -1
- data/lib/couchbase/diagnostics.rb +8 -8
- data/lib/couchbase/errors.rb +6 -0
- data/lib/couchbase/libcouchbase.rb +1 -1
- data/lib/couchbase/management/analytics_index_manager.rb +90 -59
- data/lib/couchbase/management/bucket_manager.rb +73 -45
- data/lib/couchbase/management/collection_manager.rb +86 -43
- data/lib/couchbase/management/collection_query_index_manager.rb +56 -33
- data/lib/couchbase/management/query_index_manager.rb +88 -36
- data/lib/couchbase/management/scope_search_index_manager.rb +119 -52
- data/lib/couchbase/management/search_index_manager.rb +401 -178
- data/lib/couchbase/management/user_manager.rb +343 -174
- data/lib/couchbase/management/view_index_manager.rb +166 -73
- data/lib/couchbase/metrics/logging_meter.rb +108 -0
- data/lib/couchbase/metrics/logging_value_recorder.rb +50 -0
- data/lib/couchbase/metrics/meter.rb +27 -0
- data/lib/couchbase/metrics/noop_meter.rb +30 -0
- data/lib/couchbase/metrics/noop_value_recorder.rb +27 -0
- data/lib/couchbase/metrics/value_recorder.rb +25 -0
- data/lib/couchbase/options.rb +69 -3
- data/lib/couchbase/protostellar/cluster.rb +3 -0
- data/lib/couchbase/scope.rb +62 -48
- data/lib/couchbase/search_options.rb +18 -18
- data/lib/couchbase/tracing/noop_span.rb +29 -0
- data/lib/couchbase/tracing/noop_tracer.rb +29 -0
- data/lib/couchbase/tracing/request_span.rb +34 -0
- data/lib/couchbase/tracing/request_tracer.rb +28 -0
- data/lib/couchbase/tracing/threshold_logging_span.rb +112 -0
- data/lib/couchbase/tracing/threshold_logging_tracer.rb +231 -0
- data/lib/couchbase/utils/hdr_histogram.rb +55 -0
- data/lib/couchbase/utils/observability.rb +257 -0
- data/lib/couchbase/utils/observability_constants.rb +200 -0
- data/lib/couchbase/utils/stdlib_logger_adapter.rb +1 -3
- data/lib/couchbase/version.rb +1 -1
- data/lib/couchbase.rb +2 -2
- metadata +37 -8
|
@@ -37,6 +37,7 @@ module Couchbase
|
|
|
37
37
|
@collection = collection
|
|
38
38
|
@options = options
|
|
39
39
|
@cas = 0
|
|
40
|
+
@observability = @collection.instance_variable_get(:@observability)
|
|
40
41
|
end
|
|
41
42
|
|
|
42
43
|
# Calls the given block once for each element in the set, passing that element as a parameter.
|
|
@@ -44,49 +45,58 @@ module Couchbase
|
|
|
44
45
|
# @yieldparam [Object] item
|
|
45
46
|
#
|
|
46
47
|
# @return [CouchbaseSet, Enumerable]
|
|
47
|
-
def each(&)
|
|
48
|
+
def each(parent_span: nil, &)
|
|
48
49
|
if block_given?
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
current =
|
|
51
|
+
@observability.record_operation(Observability::OP_SET_EACH, parent_span, self) do |obs_handler|
|
|
52
|
+
options = @options.get_options.clone
|
|
53
|
+
options.parent_span = obs_handler.op_span
|
|
54
|
+
result = @collection.get(@id, options)
|
|
55
|
+
@cas = result.cas
|
|
56
|
+
result.content
|
|
57
|
+
rescue Error::DocumentNotFound
|
|
58
|
+
@cas = 0
|
|
59
|
+
[]
|
|
60
|
+
end
|
|
57
61
|
current.each(&)
|
|
58
62
|
self
|
|
59
63
|
else
|
|
60
|
-
enum_for(:each)
|
|
64
|
+
enum_for(:each, parent_span: parent_span)
|
|
61
65
|
end
|
|
62
66
|
end
|
|
63
67
|
|
|
64
68
|
# @return [Integer] returns the number of elements in the set.
|
|
65
|
-
def length
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
def length(parent_span: nil)
|
|
70
|
+
@observability.record_operation(Observability::OP_SET_LENGTH, parent_span, self) do |obs_handler|
|
|
71
|
+
options = @options.lookup_in_options.clone
|
|
72
|
+
options.parent_span = obs_handler.op_span
|
|
73
|
+
result = @collection.lookup_in(@id, [
|
|
74
|
+
LookupInSpec.count(""),
|
|
75
|
+
], options)
|
|
76
|
+
result.content(0)
|
|
77
|
+
rescue Error::DocumentNotFound
|
|
78
|
+
0
|
|
79
|
+
end
|
|
72
80
|
end
|
|
73
81
|
|
|
74
82
|
alias size length
|
|
75
83
|
|
|
76
84
|
# @return [Boolean] returns true if set is empty
|
|
77
|
-
def empty?
|
|
78
|
-
size.zero?
|
|
85
|
+
def empty?(parent_span: nil)
|
|
86
|
+
size(parent_span: parent_span).zero?
|
|
79
87
|
end
|
|
80
88
|
|
|
81
89
|
# Adds the given value to the set
|
|
82
90
|
#
|
|
83
91
|
# @param [Object] obj
|
|
84
92
|
# @return [CouchbaseSet]
|
|
85
|
-
def add(obj)
|
|
86
|
-
|
|
93
|
+
def add(obj, parent_span: nil)
|
|
94
|
+
@observability.record_operation(Observability::OP_SET_ADD, parent_span, self) do |obs_handler|
|
|
95
|
+
options = @options.mutate_in_options.clone
|
|
96
|
+
options.parent_span = obs_handler.op_span
|
|
87
97
|
@collection.mutate_in(@id, [
|
|
88
98
|
MutateInSpec.array_add_unique("", obj),
|
|
89
|
-
],
|
|
99
|
+
], options)
|
|
90
100
|
rescue Error::PathExists
|
|
91
101
|
# ignore
|
|
92
102
|
end
|
|
@@ -94,31 +104,37 @@ module Couchbase
|
|
|
94
104
|
end
|
|
95
105
|
|
|
96
106
|
# Removes all elements from the set
|
|
97
|
-
def clear
|
|
98
|
-
@
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
107
|
+
def clear(parent_span: nil)
|
|
108
|
+
@observability.record_operation(Observability::OP_SET_CLEAR, parent_span, self) do |obs_handler|
|
|
109
|
+
options = @options.remove_options.clone
|
|
110
|
+
options.parent_span = obs_handler.op_span
|
|
111
|
+
@collection.remove(@id, options)
|
|
112
|
+
nil
|
|
113
|
+
rescue Error::DocumentNotFound
|
|
114
|
+
nil
|
|
115
|
+
end
|
|
102
116
|
end
|
|
103
117
|
|
|
104
118
|
# Deletes the given object from the set.
|
|
105
119
|
#
|
|
106
120
|
# @return [Boolean] true if the value has been removed
|
|
107
|
-
def delete(obj)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
121
|
+
def delete(obj, parent_span: nil)
|
|
122
|
+
@observability.record_operation(Observability::OP_SET_DELETE, parent_span, self) do |obs_handler|
|
|
123
|
+
result = @collection.get(@id, Options::Get.new(parent_span: obs_handler.op_span))
|
|
124
|
+
idx = result.content.index(obj)
|
|
125
|
+
return false unless idx
|
|
111
126
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
127
|
+
options = Options::MutateIn.new(parent_span: obs_handler.op_span)
|
|
128
|
+
options.cas = result.cas
|
|
129
|
+
@collection.mutate_in(@id, [
|
|
130
|
+
MutateInSpec.remove("[#{idx}]"),
|
|
131
|
+
], options)
|
|
132
|
+
true
|
|
133
|
+
rescue Error::CasMismatch
|
|
134
|
+
retry
|
|
135
|
+
rescue Error::DocumentNotFound
|
|
136
|
+
false
|
|
137
|
+
end
|
|
122
138
|
end
|
|
123
139
|
end
|
|
124
140
|
|
|
@@ -19,7 +19,7 @@ module Couchbase
|
|
|
19
19
|
def self.deprecate_constants(removed_in_version, parent, constants)
|
|
20
20
|
deprecator = Module.new do
|
|
21
21
|
define_method(:const_missing) do |old_name|
|
|
22
|
-
return super unless constants.key?(old_name)
|
|
22
|
+
return super(old_name) unless constants.key?(old_name)
|
|
23
23
|
|
|
24
24
|
new_name = constants[old_name]
|
|
25
25
|
|
|
@@ -47,7 +47,7 @@ module Couchbase
|
|
|
47
47
|
yield self if block_given?
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
def to_json(*
|
|
50
|
+
def to_json(*)
|
|
51
51
|
data = {
|
|
52
52
|
id: @id,
|
|
53
53
|
state: @state,
|
|
@@ -56,7 +56,7 @@ module Couchbase
|
|
|
56
56
|
}
|
|
57
57
|
data[:details] = @details if @details
|
|
58
58
|
data[:last_activity_us] = @last_activity_us if @last_activity_us
|
|
59
|
-
data.to_json(*
|
|
59
|
+
data.to_json(*)
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
|
|
@@ -88,13 +88,13 @@ module Couchbase
|
|
|
88
88
|
# @return [Integer] version
|
|
89
89
|
attr_accessor :version
|
|
90
90
|
|
|
91
|
-
def to_json(*
|
|
91
|
+
def to_json(*)
|
|
92
92
|
{
|
|
93
93
|
version: @version,
|
|
94
94
|
id: @id,
|
|
95
95
|
sdk: @sdk,
|
|
96
96
|
services: @services,
|
|
97
|
-
}.to_json(*
|
|
97
|
+
}.to_json(*)
|
|
98
98
|
end
|
|
99
99
|
end
|
|
100
100
|
|
|
@@ -130,7 +130,7 @@ module Couchbase
|
|
|
130
130
|
yield self if block_given?
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
-
def to_json(*
|
|
133
|
+
def to_json(*)
|
|
134
134
|
data = {
|
|
135
135
|
id: @id,
|
|
136
136
|
state: @state,
|
|
@@ -139,7 +139,7 @@ module Couchbase
|
|
|
139
139
|
latency: @latency,
|
|
140
140
|
}
|
|
141
141
|
data[:error] = @error if @error
|
|
142
|
-
data.to_json(*
|
|
142
|
+
data.to_json(*)
|
|
143
143
|
end
|
|
144
144
|
end
|
|
145
145
|
|
|
@@ -171,13 +171,13 @@ module Couchbase
|
|
|
171
171
|
# @return [Integer] version
|
|
172
172
|
attr_accessor :version
|
|
173
173
|
|
|
174
|
-
def to_json(*
|
|
174
|
+
def to_json(*)
|
|
175
175
|
{
|
|
176
176
|
version: @version,
|
|
177
177
|
id: @id,
|
|
178
178
|
sdk: @sdk,
|
|
179
179
|
services: @services,
|
|
180
|
-
}.to_json(*
|
|
180
|
+
}.to_json(*)
|
|
181
181
|
end
|
|
182
182
|
end
|
|
183
183
|
end
|
data/lib/couchbase/errors.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
begin
|
|
2
2
|
require_relative "#{RUBY_VERSION[/(\d+\.\d+)/]}/libcouchbase"
|
|
3
3
|
rescue LoadError
|
|
4
|
-
raise LoadError, "unable to load couchbase extension for Ruby #{RUBY_VERSION}. Only available for 3.
|
|
4
|
+
raise LoadError, "unable to load couchbase extension for Ruby #{RUBY_VERSION}. Only available for 3.2, 3.3, 3.4, 4.0. " \
|
|
5
5
|
"Try to install couchbase from sources with 'gem install --platform ruby couchbase'"
|
|
6
6
|
end
|
|
@@ -629,8 +629,9 @@ module Couchbase
|
|
|
629
629
|
alias inspect to_s
|
|
630
630
|
|
|
631
631
|
# @param [Couchbase::Backend] backend
|
|
632
|
-
def initialize(backend)
|
|
632
|
+
def initialize(backend, observability)
|
|
633
633
|
@backend = backend
|
|
634
|
+
@observability = observability
|
|
634
635
|
end
|
|
635
636
|
|
|
636
637
|
# Creates a new dataverse
|
|
@@ -643,7 +644,9 @@ module Couchbase
|
|
|
643
644
|
# @raise [ArgumentError]
|
|
644
645
|
# @raise [Error::DataverseExists]
|
|
645
646
|
def create_dataverse(dataverse_name, options = Options::Analytics::CreateDataverse.new)
|
|
646
|
-
@
|
|
647
|
+
@observability.record_operation(Observability::OP_AM_CREATE_DATAVERSE, options.parent_span, self, :analytics) do |obs_handler|
|
|
648
|
+
@backend.analytics_dataverse_create(dataverse_name, options.to_backend, obs_handler)
|
|
649
|
+
end
|
|
647
650
|
end
|
|
648
651
|
|
|
649
652
|
# Drops a dataverse
|
|
@@ -656,7 +659,9 @@ module Couchbase
|
|
|
656
659
|
# @raise [ArgumentError]
|
|
657
660
|
# @raise [Error::DataverseNotFound]
|
|
658
661
|
def drop_dataverse(dataverse_name, options = Options::Analytics::DropDataverse.new)
|
|
659
|
-
@
|
|
662
|
+
@observability.record_operation(Observability::OP_AM_DROP_DATAVERSE, options.parent_span, self, :analytics) do |obs_handler|
|
|
663
|
+
@backend.analytics_dataverse_drop(dataverse_name, options.to_backend, obs_handler)
|
|
664
|
+
end
|
|
660
665
|
end
|
|
661
666
|
|
|
662
667
|
# Creates a new dataset
|
|
@@ -671,7 +676,9 @@ module Couchbase
|
|
|
671
676
|
# @raise [Error::DatasetExists]
|
|
672
677
|
# @raise [Error::LinkNotFound]
|
|
673
678
|
def create_dataset(dataset_name, bucket_name, options = Options::Analytics::CreateDataset.new)
|
|
674
|
-
@
|
|
679
|
+
@observability.record_operation(Observability::OP_AM_CREATE_DATASET, options.parent_span, self, :analytics) do |_obs_handler|
|
|
680
|
+
@backend.analytics_dataset_create(dataset_name, bucket_name, options.to_backend)
|
|
681
|
+
end
|
|
675
682
|
end
|
|
676
683
|
|
|
677
684
|
# Drops a dataset
|
|
@@ -684,7 +691,9 @@ module Couchbase
|
|
|
684
691
|
# @raise [ArgumentError]
|
|
685
692
|
# @raise [Error::DatasetNotFound]
|
|
686
693
|
def drop_dataset(dataset_name, options = Options::Analytics::DropDataset.new)
|
|
687
|
-
@
|
|
694
|
+
@observability.record_operation(Observability::OP_AM_DROP_DATASET, options.parent_span, self, :analytics) do |obs_handler|
|
|
695
|
+
@backend.analytics_dataset_drop(dataset_name, options.to_backend, obs_handler)
|
|
696
|
+
end
|
|
688
697
|
end
|
|
689
698
|
|
|
690
699
|
# Gets all datasets
|
|
@@ -693,13 +702,15 @@ module Couchbase
|
|
|
693
702
|
#
|
|
694
703
|
# @return [Array<AnalyticsDataset>]
|
|
695
704
|
def get_all_datasets(options = Options::Analytics::GetAllDatasets.new)
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
705
|
+
@observability.record_operation(Observability::OP_AM_GET_ALL_DATASETS, options.parent_span, self, :analytics) do |obs_handler|
|
|
706
|
+
resp = @backend.analytics_dataset_get_all(options.to_backend, obs_handler)
|
|
707
|
+
resp.map do |entry|
|
|
708
|
+
AnalyticsDataset.new do |dataset|
|
|
709
|
+
dataset.name = entry[:name]
|
|
710
|
+
dataset.dataverse_name = entry[:dataverse_name]
|
|
711
|
+
dataset.link_name = entry[:link_name]
|
|
712
|
+
dataset.bucket_name = entry[:bucket_name]
|
|
713
|
+
end
|
|
703
714
|
end
|
|
704
715
|
end
|
|
705
716
|
end
|
|
@@ -716,7 +727,9 @@ module Couchbase
|
|
|
716
727
|
# @raise [ArgumentError]
|
|
717
728
|
# @raise [Error::IndexExists]
|
|
718
729
|
def create_index(index_name, dataset_name, fields, options = Options::Analytics::CreateIndex.new)
|
|
719
|
-
@
|
|
730
|
+
@observability.record_operation(Observability::OP_AM_CREATE_INDEX, options.parent_span, self, :analytics) do |obs_handler|
|
|
731
|
+
@backend.analytics_index_create(index_name, dataset_name, fields.entries, options.to_backend, obs_handler)
|
|
732
|
+
end
|
|
720
733
|
end
|
|
721
734
|
|
|
722
735
|
# Drops an index
|
|
@@ -730,7 +743,9 @@ module Couchbase
|
|
|
730
743
|
# @raise [ArgumentError]
|
|
731
744
|
# @raise [Error::IndexNotFound]
|
|
732
745
|
def drop_index(index_name, dataset_name, options = Options::Analytics::DropIndex.new)
|
|
733
|
-
@
|
|
746
|
+
@observability.record_operation(Observability::OP_AM_DROP_INDEX, options.parent_span, self, :analytics) do |obs_handler|
|
|
747
|
+
@backend.analytics_index_drop(index_name, dataset_name, options.to_backend, obs_handler)
|
|
748
|
+
end
|
|
734
749
|
end
|
|
735
750
|
|
|
736
751
|
# Gets all indexes
|
|
@@ -739,13 +754,15 @@ module Couchbase
|
|
|
739
754
|
#
|
|
740
755
|
# @return [Array<AnalyticsIndex>]
|
|
741
756
|
def get_all_indexes(options = Options::Analytics::GetAllIndexes.new)
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
757
|
+
@observability.record_operation(Observability::OP_AM_GET_ALL_INDEXES, options.parent_span, self, :analytics) do |obs_handler|
|
|
758
|
+
resp = @backend.analytics_index_get_all(options.to_backend, obs_handler)
|
|
759
|
+
resp.map do |entry|
|
|
760
|
+
AnalyticsIndex.new do |dataset|
|
|
761
|
+
dataset.name = entry[:name]
|
|
762
|
+
dataset.dataverse_name = entry[:dataverse_name]
|
|
763
|
+
dataset.dataset_name = entry[:dataset_name]
|
|
764
|
+
dataset.is_primary = entry[:is_primary]
|
|
765
|
+
end
|
|
749
766
|
end
|
|
750
767
|
end
|
|
751
768
|
end
|
|
@@ -759,7 +776,9 @@ module Couchbase
|
|
|
759
776
|
# @raise [ArgumentError]
|
|
760
777
|
# @raise [Error::LinkNotFound]
|
|
761
778
|
def connect_link(options = Options::Analytics::ConnectLink.new)
|
|
762
|
-
@
|
|
779
|
+
@observability.record_operation(Observability::OP_AM_CONNECT_LINK, options.parent_span, self, :analytics) do |obs_handler|
|
|
780
|
+
@backend.analytics_link_connect(options.to_backend, obs_handler)
|
|
781
|
+
end
|
|
763
782
|
end
|
|
764
783
|
|
|
765
784
|
# Disconnects a link,
|
|
@@ -771,7 +790,9 @@ module Couchbase
|
|
|
771
790
|
# @raise [ArgumentError]
|
|
772
791
|
# @raise [Error::LinkNotFound]
|
|
773
792
|
def disconnect_link(options = Options::Analytics::DisconnectLink.new)
|
|
774
|
-
@
|
|
793
|
+
@observability.record_operation(Observability::OP_AM_DISCONNECT_LINK, options.parent_span, self, :analytics) do |obs_handler|
|
|
794
|
+
@backend.analytics_link_disconnect(options.to_backend, obs_handler)
|
|
795
|
+
end
|
|
775
796
|
end
|
|
776
797
|
|
|
777
798
|
# Gets the pending mutations for all datasets.
|
|
@@ -784,7 +805,9 @@ module Couchbase
|
|
|
784
805
|
# @return [Hash<String => Integer>] dictionary, where keys are dataset coordinates encoded as +"dataverse.dataset"+
|
|
785
806
|
# and values are number of mutations for given dataset.
|
|
786
807
|
def get_pending_mutations(options = Options::Analytics::GetPendingMutations.new)
|
|
787
|
-
@
|
|
808
|
+
@observability.record_operation(Observability::OP_AM_GET_PENDING_MUTATIONS, options.parent_span, self, :analytics) do |obs_handler|
|
|
809
|
+
@backend.analytics_get_pending_mutations(options.to_backend, obs_handler)
|
|
810
|
+
end
|
|
788
811
|
end
|
|
789
812
|
|
|
790
813
|
# Creates a link
|
|
@@ -797,7 +820,9 @@ module Couchbase
|
|
|
797
820
|
# @raise [ArgumentError]
|
|
798
821
|
# @raise [Error::LinkExists]
|
|
799
822
|
def create_link(link, options = Options::Analytics::CreateLink.new)
|
|
800
|
-
@
|
|
823
|
+
@observability.record_operation(Observability::OP_AM_CREATE_LINK, options.parent_span, self, :analytics) do |obs_handler|
|
|
824
|
+
@backend.analytics_link_create(link.to_backend, options.to_backend, obs_handler)
|
|
825
|
+
end
|
|
801
826
|
end
|
|
802
827
|
|
|
803
828
|
# Replaces the link
|
|
@@ -810,7 +835,9 @@ module Couchbase
|
|
|
810
835
|
# @raise [ArgumentError]
|
|
811
836
|
# @raise [Error::LinkNotFound]
|
|
812
837
|
def replace_link(link, options = Options::Analytics::ReplaceLink.new)
|
|
813
|
-
@
|
|
838
|
+
@observability.record_operation(Observability::OP_AM_REPLACE_LINK, options.parent_span, self, :analytics) do |obs_handler|
|
|
839
|
+
@backend.analytics_link_replace(link.to_backend, options.to_backend, obs_handler)
|
|
840
|
+
end
|
|
814
841
|
end
|
|
815
842
|
|
|
816
843
|
# Drops the link
|
|
@@ -824,7 +851,9 @@ module Couchbase
|
|
|
824
851
|
# @raise [ArgumentError]
|
|
825
852
|
# @raise [Error::LinkNotFound]
|
|
826
853
|
def drop_link(link_name, dataverse_name, options = Options::Analytics::DropLink.new)
|
|
827
|
-
@
|
|
854
|
+
@observability.record_operation(Observability::OP_AM_DROP_LINK, options.parent_span, self, :analytics) do |obs_handler|
|
|
855
|
+
@backend.analytics_link_drop(link_name, dataverse_name, options.to_backend, obs_handler)
|
|
856
|
+
end
|
|
828
857
|
end
|
|
829
858
|
|
|
830
859
|
# Retrieves the links
|
|
@@ -836,38 +865,40 @@ module Couchbase
|
|
|
836
865
|
# @raise [ArgumentError]
|
|
837
866
|
# @raise [Error::LinkNotFound]
|
|
838
867
|
def get_links(options = Options::Analytics::GetLinks.new)
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
868
|
+
@observability.record_operation(Observability::OP_AM_GET_LINKS, options.parent_span, self, :analytics) do |obs_handler|
|
|
869
|
+
resp = @backend.analytics_link_get_all(options.to_backend, obs_handler)
|
|
870
|
+
resp.map do |entry|
|
|
871
|
+
case entry[:type]
|
|
872
|
+
when :s3
|
|
873
|
+
S3ExternalAnalyticsLink.new(
|
|
874
|
+
entry[:link_name],
|
|
875
|
+
entry[:dataverse],
|
|
876
|
+
entry[:access_key_id],
|
|
877
|
+
nil,
|
|
878
|
+
entry[:region],
|
|
879
|
+
service_endpoint: entry[:service_endpoint],
|
|
880
|
+
)
|
|
881
|
+
when :couchbase
|
|
882
|
+
CouchbaseRemoteAnalyticsLink.new(
|
|
883
|
+
entry[:link_name],
|
|
884
|
+
entry[:dataverse],
|
|
885
|
+
entry[:hostname],
|
|
886
|
+
username: entry[:username],
|
|
887
|
+
encryption: EncryptionSettings.new(
|
|
888
|
+
level: entry[:encryption_level],
|
|
889
|
+
certificate: entry[:certificate],
|
|
890
|
+
client_certificate: entry[:client_certificate],
|
|
891
|
+
),
|
|
892
|
+
)
|
|
893
|
+
when :azureblob
|
|
894
|
+
AzureBlobExternalAnalyticsLink.new(
|
|
895
|
+
entry[:link_name],
|
|
896
|
+
entry[:dataverse],
|
|
897
|
+
account_name: entry[:account_name],
|
|
898
|
+
blob_endpoint: entry[:blob_endpoint],
|
|
899
|
+
endpoint_suffix: entry[:endpoint_suffix],
|
|
900
|
+
)
|
|
901
|
+
end
|
|
871
902
|
end
|
|
872
903
|
end
|
|
873
904
|
end
|