NodeIDType
- public abstract class AbstractReconfigurablePaxosApp<NodeIDType> extends java.lang.Object implements Replicable, Reconfigurable
Replicable
and yet be reconfigurable provided
PaxosReplicaCoordinator
is used as the replica coordinator.Constructor and Description |
---|
AbstractReconfigurablePaxosApp() |
Modifier and Type | Method and Description |
---|---|
boolean |
deleteFinalState(java.lang.String name,
int epoch)
Garbage-collects the final state for name, epoch.
|
boolean |
execute(Request request,
boolean doNotReplyToClient)
This method must handle the request atomically and return true if
successful or throw an exception or return false.
|
java.lang.Integer |
getEpoch(java.lang.String name)
Returns the current (unique) epoch for name.
|
java.lang.String |
getFinalState(java.lang.String name,
int epoch)
Return the final checkpointed state for name, epoch.
|
ReconfigurableRequest |
getStopRequest(java.lang.String name,
int epoch)
This class returns a default no-op stop request.
|
void |
putInitialState(java.lang.String name,
int epoch,
java.lang.String state)
Inserts the specified state as the initial state for name, epoch.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkpoint, restore
execute
getMutualAuthRequestTypes, getRequest, getRequest, getRequestTypes, getServerAuthRequestTypes
public ReconfigurableRequest getStopRequest(java.lang.String name, int epoch)
getStopRequest
in interface Reconfigurable
name:epoch
.public java.lang.String getFinalState(java.lang.String name, int epoch)
Reconfigurable
getFinalState
in interface Reconfigurable
public void putInitialState(java.lang.String name, int epoch, java.lang.String state)
Reconfigurable
putInitialState
in interface Reconfigurable
public boolean deleteFinalState(java.lang.String name, int epoch)
Reconfigurable
deleteFinalState
in interface Reconfigurable
name:epoch
was deleted or did not
exist to begin with.public java.lang.Integer getEpoch(java.lang.String name)
Reconfigurable
getEpoch
in interface Reconfigurable
name
.public boolean execute(Request request, boolean doNotReplyToClient)
Replicable
execute
in interface Replicable
doNotReplyToClient
- If true, the application is expected to not send a response
back to the originating client (say, because this request is
part of a post-crash roll-forward or only the "entry replica"
that received the request from the client is expected to
respond back. If false, the application is expected to either
send a response (if any) back to the client via the
ClientMessenger
interface or delegate response
messaging to paxos via the ClientRequest.getResponse()
interface.request.getServiceName()
) altogether after a limited
number of retries, so the replica group may get stuck unless it
returns true after a limited number of retries. Thus, with paxos
as the replica coordination protocol, returning false is not
really an option as paxos has no way to "roll back" a request
whose global order has already been agreed upon.
With replica coordination protocols other than paxos, the boolean
return value could be used in protocol-specific ways, e.g., a
primary-backup protocol might normally execute a request at just
one replica but relay the request to one or more backups if the
return value of Application.execute(Request)
is false.