Search in sources :

Example 1 with DeleteRangeResponse

use of com.ibm.etcd.api.DeleteRangeResponse in project etcd-java by IBM.

the class RangeCache method delete.

/**
 * Unconditional delete
 *
 * @param key
 * @return true if entry was deleted, false if already absent
 */
public boolean delete(ByteString key) {
    ListenableFuture<DeleteRangeResponse> df = kvClient.delete(key).async();
    // TODO -- async version
    DeleteRangeResponse drr = waitFor(df, TIMEOUT_MS);
    offerDelete(key, drr.getHeader().getRevision());
    return drr.getDeleted() > 0;
}
Also used : DeleteRangeResponse(com.ibm.etcd.api.DeleteRangeResponse)

Aggregations

DeleteRangeResponse (com.ibm.etcd.api.DeleteRangeResponse)1