Class: Couchbase::Options::Scan
Overview
Options for Collection#scan
Constant Summary collapse
- DEFAULT =
Scan.new.freeze
Instance Attribute Summary collapse
- #batch_byte_limit ⇒ Integer?
- #batch_item_limit ⇒ Integer?
- #concurrency ⇒ Integer?
- #ids_only ⇒ Boolean
- #mutation_state ⇒ MutationState?
- #transcoder ⇒ JsonTranscoder, #decode(String)
Attributes inherited from Base
#client_context, #parent_span, #retry_strategy, #timeout
Instance Method Summary collapse
-
#consistent_with(mutation_state) ⇒ Object
Sets the mutation tokens this query should be consistent with.
-
#initialize(ids_only: false, transcoder: JsonTranscoder.new, mutation_state: nil, batch_byte_limit: nil, batch_item_limit: nil, concurrency: nil, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ Scan
constructor
Creates an instance of options for Collection#scan.
- #to_backend ⇒ Object private
Constructor Details
#initialize(ids_only: false, transcoder: JsonTranscoder.new, mutation_state: nil, batch_byte_limit: nil, batch_item_limit: nil, concurrency: nil, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|self| ... } ⇒ Scan
Creates an instance of options for Collection#scan
1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 |
# File 'lib/couchbase/options.rb', line 1131 def initialize(ids_only: false, transcoder: JsonTranscoder.new, mutation_state: nil, batch_byte_limit: nil, batch_item_limit: nil, concurrency: nil, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span) @ids_only = ids_only @transcoder = transcoder @mutation_state = mutation_state @batch_byte_limit = batch_byte_limit @batch_item_limit = batch_item_limit @concurrency = concurrency yield self if block_given? end |
Instance Attribute Details
#batch_byte_limit ⇒ Integer?
1109 1110 1111 |
# File 'lib/couchbase/options.rb', line 1109 def batch_byte_limit @batch_byte_limit end |
#batch_item_limit ⇒ Integer?
1110 1111 1112 |
# File 'lib/couchbase/options.rb', line 1110 def batch_item_limit @batch_item_limit end |
#concurrency ⇒ Integer?
1111 1112 1113 |
# File 'lib/couchbase/options.rb', line 1111 def concurrency @concurrency end |
#ids_only ⇒ Boolean
1106 1107 1108 |
# File 'lib/couchbase/options.rb', line 1106 def ids_only @ids_only end |
#mutation_state ⇒ MutationState?
1108 1109 1110 |
# File 'lib/couchbase/options.rb', line 1108 def mutation_state @mutation_state end |
#transcoder ⇒ JsonTranscoder, #decode(String)
1107 1108 1109 |
# File 'lib/couchbase/options.rb', line 1107 def transcoder @transcoder end |
Instance Method Details
#consistent_with(mutation_state) ⇒ Object
Note:
overrides consistency level set by #scan_consistency=
Sets the mutation tokens this query should be consistent with
1156 1157 1158 |
# File 'lib/couchbase/options.rb', line 1156 def consistent_with(mutation_state) @mutation_state = mutation_state end |
#to_backend ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 |
# File 'lib/couchbase/options.rb', line 1161 def to_backend { timeout: Utils::Time.extract_duration(@timeout), ids_only: @ids_only, mutation_state: @mutation_state.to_a, batch_byte_limit: @batch_byte_limit, batch_item_limit: @batch_item_limit, concurrency: @concurrency, } end |