Method: Aerospike::BatchAttr#set_batch_delete

Defined in:
lib/aerospike/batch_attr.rb

#set_batch_delete(dp) ⇒ Object

[View source]

246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/aerospike/batch_attr.rb', line 246

def set_batch_delete(dp)
  @filter_exp = dp.filter_exp
  @read_attr = 0
  @write_attr = Aerospike::INFO2_WRITE | Aerospike::INFO2_RESPOND_ALL_OPS | Aerospike::INFO2_DELETE
  @info_attr = 0
  @expiration = 0
  @has_write = true
  @send_key = dp.send_key

  case dp.generation_policy
  when GenerationPolicy::NONE
    @generation = 0
  when GenerationPolicy::EXPECT_GEN_EQUAL
    @generation = dp.generation
    @write_attr |= Aerospike::INFO2_GENERATION
  when GenerationPolicy::EXPECT_GEN_GT
    @generation = dp.generation
    @write_attr |= Aerospike::INFO2_GENERATION_GT
  else
   @generation = 0
  end

  if dp.durable_delete
    @write_attr |= Aerospike::INFO2_DURABLE_DELETE
  end

  if dp.commit_level == CommitLevel::COMMIT_MASTER
    @info_attr |= Aerospike::INFO3_COMMIT_MASTER
  end
end