/** * For internal use only. * @hidden */ @Override public OperationFailureException wrapSelf(String msg) { return new UnknownMasterException(msg, this); } }
/** * Ensures that the environment is currently a Master before proceeding * with an operation that requires it to be the master. * * @throws UnknownMasterException if the node is disconnected * @throws ReplicaWriteException if the node is currently a replica */ public void checkIfMaster(Locker locker) throws UnknownMasterException, ReplicaWriteException { final StateChangeEvent event = nodeState.getStateChangeEvent(); switch (nodeState.getRepEnvState()) { case MASTER: break; case REPLICA: throw new ReplicaWriteException(locker, event); case UNKNOWN: throw new UnknownMasterException(locker, event); case DETACHED: throw new UnknownMasterException(locker, event); default: throw EnvironmentFailureException.unexpectedState ("Unexpected state: " + nodeState.getRepEnvState()); } }
private void throwNotMaster(ReplicatedEnvironment.State nodeState) { if (nodeState.isReplica()) { throw new ReplicaWriteException (this, ((RepImpl)envImpl).getStateChangeEvent()); } throw new UnknownMasterException ("Transaction " + getId() + " cannot execute write operations because this node is" + " no longer a master"); }
throw new UnknownMasterException ("Problem communicating with master.", me.getException());
throw new UnknownMasterException ("Could not determine master from helpers at:" + learnerSockets.toString());
setOnlyAbortable(new UnknownMasterException (envImpl.getName() + " is no longer a master"));
throw exitException; throw new UnknownMasterException(null, repImpl.getStateChangeEvent());
"Master change: " + e.getMessage()); feederShutdownException = new UnknownMasterException("Node " + repNode.getRepImpl().getName() + " is not a master anymore");