@DELETE
    public void delete() throws Exception {
        LOGGER.info("delete: {}", key);

        try {
            ListenableFuture<Void> deleteFuture = distributedStore.delete(key);
            deleteFuture.get(ResourceConstants.COMMAND_TIMEOUT, ResourceConstants.COMMAND_TIMEOUT_TIME_UNIT);
        } catch (ExecutionException e) {
            Throwable cause = e.getCause();

            if (cause instanceof NotLeaderException) {
                throw createCannotSubmitCommandException((NotLeaderException) cause);
            } else {
                throw e;
            }
        }
    }
@ DELETE public void delete ( ) throws Exception { LOGGER . info ( "delete: {}" , key ) ; try { ListenableFuture < Void > deleteFuture = distributedStore . delete ( key ) ; deleteFuture . get ( ResourceConstants . COMMAND_TIMEOUT , ResourceConstants . COMMAND_TIMEOUT_TIME_UNIT ) ; } catch ( ExecutionException e ) { Throwable cause = e . getCause ( ) ; if ( cause instanceof NotLeaderException ) { throw createCannotSubmitCommandException ( ( NotLeaderException ) cause ) ; } else { throw e ; } } }
Delete the {@link KeyResource#key} represented by this resource.

@throws CannotSubmitCommandException if this server is not the
leader of the Raft cluster and cannot submit commands to the cluster
@throws Exception if this operation cannot be replicated to the Raft cluster. If an exception is
thrown this operation is in an <strong>unknown</strong> state, and should be retried