/** * Blocks until the command in buffer has been committed or the timeout has expired. * After this call, this command object can be used again. * * @param timeout If -1, timeout is disabled. * @throws NotLeaderException if the member is not currently the leader. */ public void commit(byte[] buf, int bufOffset, int bufLen, int timeout) throws InterruptedException, GondolaException, TimeoutException { ccmd.commit(buf, bufOffset, bufLen, timeout); }
/** * Blocks until the command in buffer has been committed or the timeout has expired. * After this call, this command object can be used again. * * @param timeout If -1, timeout is disabled. * @return 0 if successful. * @throws NotLeaderException if the member is not currently the leader. */ public void commit(byte[] buf, int bufOffset, int bufLen, int timeout) throws InterruptedException, NotLeaderException, TimeoutException { ccmd.commit(buf, bufOffset, bufLen, timeout); }
/** * Equivalent to commit(buf, buffOffset, bufLen, -1). * * @throws NotLeaderException if the member is not currently the leader. */ public void commit(byte[] buf, int bufOffset, int bufLen) throws InterruptedException, GondolaException { try { ccmd.commit(buf, bufOffset, bufLen, -1); } catch (TimeoutException e) { throw new IllegalStateException(e); // Can't happen } }
/** * Equivalent to commit(buf, buffOffset, bufLen, -1); * * @return 0 if successful. * @throws NotLeaderException if the member is not currently the leader. */ public void commit(byte[] buf, int bufOffset, int bufLen) throws InterruptedException, NotLeaderException { try { ccmd.commit(buf, bufOffset, bufLen, -1); } catch (TimeoutException e) { throw new IllegalStateException(e); // Can't happen } }