Class: Couchbase::Options::Scan

Inherits:
Base
  • Object
show all
Defined in:
lib/couchbase/options.rb

Overview

Options for Collection#scan

Constant Summary collapse

DEFAULT =
Scan.new.freeze

Instance Attribute Summary collapse

Attributes inherited from Base

#client_context, #parent_span, #retry_strategy, #timeout

Instance Method Summary collapse

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

Yield Parameters:



1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
# File 'lib/couchbase/options.rb', line 1161

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_limitInteger?



1139
1140
1141
# File 'lib/couchbase/options.rb', line 1139

def batch_byte_limit
  @batch_byte_limit
end

#batch_item_limitInteger?



1140
1141
1142
# File 'lib/couchbase/options.rb', line 1140

def batch_item_limit
  @batch_item_limit
end

#concurrencyInteger?



1141
1142
1143
# File 'lib/couchbase/options.rb', line 1141

def concurrency
  @concurrency
end

#ids_onlyBoolean



1136
1137
1138
# File 'lib/couchbase/options.rb', line 1136

def ids_only
  @ids_only
end

#mutation_stateMutationState?



1138
1139
1140
# File 'lib/couchbase/options.rb', line 1138

def mutation_state
  @mutation_state
end

#transcoderJsonTranscoder, #decode(String)



1137
1138
1139
# File 'lib/couchbase/options.rb', line 1137

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



1186
1187
1188
# File 'lib/couchbase/options.rb', line 1186

def consistent_with(mutation_state)
  @mutation_state = mutation_state
end

#to_backendObject

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.



1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
# File 'lib/couchbase/options.rb', line 1191

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