use of com.aerospike.client.listener.DeleteListener in project aerospike-client-java by aerospike.
the class TestAsyncOperate method asyncOperateList.
@Test
public void asyncOperateList() {
final Key key = new Key(args.namespace, args.set, "aoplkey1");
client.delete(eventLoop, new DeleteListener() {
public void onSuccess(Key key, boolean existed) {
List<Value> itemList = new ArrayList<Value>();
itemList.add(Value.get(55));
itemList.add(Value.get(77));
client.operate(eventLoop, new ReadHandler(), null, key, ListOperation.appendItems(binName, itemList), ListOperation.pop(binName, -1), ListOperation.size(binName));
}
public void onFailure(AerospikeException e) {
setError(e);
notifyComplete();
}
}, null, key);
waitTillComplete();
}
use of com.aerospike.client.listener.DeleteListener in project aerospike-client-java by aerospike.
the class TestAsyncOperate method asyncOperateMap.
@Test
public void asyncOperateMap() {
final Key key = new Key(args.namespace, args.set, "aopmkey1");
client.delete(eventLoop, new DeleteListener() {
public void onSuccess(Key key, boolean existed) {
Map<Value, Value> map = new HashMap<Value, Value>();
map.put(Value.get("a"), Value.get(1));
map.put(Value.get("b"), Value.get(2));
map.put(Value.get("c"), Value.get(3));
client.operate(eventLoop, new MapHandler(), null, key, MapOperation.putItems(MapPolicy.Default, binName, map), MapOperation.getByRankRange(binName, -1, 1, MapReturnType.KEY_VALUE));
}
public void onFailure(AerospikeException e) {
setError(e);
notifyComplete();
}
}, null, key);
waitTillComplete();
}
Aggregations