Search in sources :

Example 1 with ExistsArrayListener

use of com.aerospike.client.listener.ExistsArrayListener in project aerospike-client-java by aerospike.

the class TestAsyncBatch method asyncBatchExistsArray.

@Test
public void asyncBatchExistsArray() {
    client.exists(eventLoop, new ExistsArrayListener() {

        public void onSuccess(Key[] keys, boolean[] existsArray) {
            for (int i = 0; i < existsArray.length; i++) {
                if (!assertEquals(true, existsArray[i])) {
                    break;
                }
            }
            notifyComplete();
        }

        public void onFailure(AerospikeException e) {
            setError(e);
            notifyComplete();
        }
    }, null, sendKeys);
    waitTillComplete();
}
Also used : AerospikeException(com.aerospike.client.AerospikeException) ExistsArrayListener(com.aerospike.client.listener.ExistsArrayListener) Key(com.aerospike.client.Key) Test(org.junit.Test)

Aggregations

AerospikeException (com.aerospike.client.AerospikeException)1 Key (com.aerospike.client.Key)1 ExistsArrayListener (com.aerospike.client.listener.ExistsArrayListener)1 Test (org.junit.Test)1