Class: Couchbase::SamplingScan
- Inherits:
-
Object
- Object
- Couchbase::SamplingScan
- Defined in:
- lib/couchbase/key_value_scan.rb
Overview
A sampling scan performs a scan that randomly selects documents up to a configured limit
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(limit, seed = nil) ⇒ SamplingScan
constructor
Creates an instance of a SamplingScan scan type.
- #to_backend ⇒ Object private
Constructor Details
#initialize(limit, seed = nil) ⇒ SamplingScan
Creates an instance of a SamplingScan scan type
103 104 105 106 |
# File 'lib/couchbase/key_value_scan.rb', line 103 def initialize(limit, seed = nil) @limit = limit @seed = seed end |
Instance Attribute Details
#limit ⇒ Integer
95 96 97 |
# File 'lib/couchbase/key_value_scan.rb', line 95 def limit @limit end |
#seed ⇒ Integer?
96 97 98 |
# File 'lib/couchbase/key_value_scan.rb', line 96 def seed @seed end |
Instance Method Details
#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.
109 110 111 112 113 114 115 |
# File 'lib/couchbase/key_value_scan.rb', line 109 def to_backend { scan_type: :sampling, limit: @limit, seed: @seed, } end |