aerospike 2.23.0 → 2.25.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,33 +14,28 @@
14
14
  # License for the specific language governing permissions and limitations under
15
15
  # the License.
16
16
 
17
- require 'aerospike/command/read_command'
17
+ require "aerospike/command/read_command"
18
18
 
19
19
  module Aerospike
20
-
21
20
  private
22
21
 
23
22
  class OperateCommand < ReadCommand #:nodoc:
23
+ def initialize(cluster, key, args)
24
+ super(cluster, args.write_policy, key, nil)
24
25
 
25
- def initialize(cluster, policy, key, operations)
26
- super(cluster, policy, key, nil)
27
-
28
- @operations = operations
26
+ @args = args
29
27
  end
30
28
 
31
29
  def get_node
32
30
  @cluster.master_node(@partition)
33
31
  end
34
32
 
35
-
36
33
  def write_bins
37
- @operations.select{|op| op.op_type == Aerospike::Operation::WRITE}.map(&:bin).compact
34
+ @operations.select { |op| op.op_type == Aerospike::Operation::WRITE }.map(&:bin).compact
38
35
  end
39
36
 
40
37
  def write_buffer
41
- set_operate(@policy, @key, @operations)
38
+ set_operate(@args.write_policy, @key, @args)
42
39
  end
43
-
44
40
  end # class
45
-
46
41
  end # module