Consider the following method:
def truncate(startTimes: Seq[Long], durableDelete: Boolean): Unit = {
logger.info(s"[AerospikeService] - truncate($startTimes) Triggered")
for ((client, startTime) <- clients.zip(startTimes)) {
val policy = new WritePolicy()
policy.durableDelete = durableDelete
val calendar = Calendar.getInstance()
calendar.setTimeInMillis(startTime + 1262304000000L) // uses CITRUSLEAF_EPOCH - see https://discuss.aerospike.com/t/how-to-use-view-and-calulate-last-update-time-lut-for-the-truncate-command/4330
for ((namespace, sets) <- config.sets.groupBy(_.namespace)) {
policy.filterExp = Exp.build(
Exp.and(
Exp.le(Exp.lastUpdate(), Exp.`val`(calendar)),
if (sets.size == 1) {
Exp.eq(Exp.setName(), Exp.`val`(sets.head.name))
} else {
Exp.or(sets.map(x => Exp.eq(Exp.setName(), Exp.`val`(x.name))): _*)
}))
val statement = new Statement
statement.setNamespace(namespace)
client.execute(policy, statement, Operation.delete())
}
}
}
I want to find out the number of records which deleted on client.execute(policy, statement, Operation.delete())
, is it possible to wait and get this information?