@Override public String status() throws TException { return txManager.isRunning() ? TxConstants.STATUS_OK : TxConstants.STATUS_NOTOK; }
@Override public String status() { return txManager.isRunning() ? TxConstants.STATUS_OK : TxConstants.STATUS_NOTOK; }
@Override public String status() { return txManager.isRunning() ? TxConstants.STATUS_OK : TxConstants.STATUS_NOTOK; }
@Override public String status() throws TException { return txManager.isRunning() ? TxConstants.STATUS_OK : TxConstants.STATUS_NOTOK; }
private void ensureAvailable() { Preconditions.checkState(isRunning(), "Transaction Manager is not running."); }
private void ensureAvailable() { Preconditions.checkState(isRunning(), "Transaction Manager is not running."); }
/** * Immediately shuts down the service, without going through the normal close process. * @param message A message describing the source of the failure. * @param error Any exception that caused the failure. */ private void abortService(String message, Throwable error) { if (isRunning()) { LOG.error("Aborting transaction manager due to: " + message, error); notifyFailed(error); } }
/** * Immediately shuts down the service, without going through the normal close process. * @param message A message describing the source of the failure. * @param error Any exception that caused the failure. */ private void abortService(String message, Throwable error) { if (isRunning()) { LOG.error("Aborting transaction manager due to: " + message, error); notifyFailed(error); } }
public synchronized TransactionSnapshot getSnapshot() throws IOException { TransactionSnapshot snapshot = null; if (!isRunning() && !isStopping()) { return null; } long now = System.currentTimeMillis(); // avoid duplicate snapshots at same timestamp if (now == lastSnapshotTime || (currentLog != null && now == currentLog.getTimestamp())) { try { TimeUnit.MILLISECONDS.sleep(1); } catch (InterruptedException ie) { } } // copy in memory state snapshot = getCurrentState(); LOG.debug("Starting snapshot of transaction state with timestamp {}", snapshot.getTimestamp()); LOG.debug("Returning snapshot of state: " + snapshot); return snapshot; }
public synchronized TransactionSnapshot getSnapshot() throws IOException { TransactionSnapshot snapshot = null; if (!isRunning() && !isStopping()) { return null; } long now = System.currentTimeMillis(); // avoid duplicate snapshots at same timestamp if (now == lastSnapshotTime || (currentLog != null && now == currentLog.getTimestamp())) { try { TimeUnit.MILLISECONDS.sleep(1); } catch (InterruptedException ie) { } } // copy in memory state snapshot = getCurrentState(); LOG.debug("Starting snapshot of transaction state with timestamp {}", snapshot.getTimestamp()); LOG.debug("Returning snapshot of state: " + snapshot); return snapshot; }
try { synchronized (this) { if (!isRunning()) { return;
try { synchronized (this) { if (!isRunning()) { return;