NodeIDType - This class is the main wrapper around active replicas of
reconfigurable app instances. It processes requests both from the
Reconfigurator as well as the underlying app's clients. This class
is also use to wrap the Reconfigurator itself in order to
reconfigure Reconfigurators (to correctly perform reconfigurator
add/remove operations).
This class handles the following ReconfigurationPackets:
STOP_EPOCH,
START_EPOCH, REQUEST_EPOCH_FINAL_STATE, DROP_EPOCH as also listed
in ActiveReplicaProtocolTask. It
relies upon the app's implementation of AbstractDemandProfile in
order to determine how frequenltly to report demand statistics to
Reconfigurators and whether and how to reconfigure the current
active replica placement.
public class ActiveReplica<NodeIDType> extends java.lang.Object implements ReconfiguratorCallback, PacketDemultiplexer<Request>
| Modifier | Constructor and Description |
|---|---|
protected |
ActiveReplica(AbstractReplicaCoordinator<NodeIDType> appC,
ReconfigurableNodeConfig<NodeIDType> nodeConfig,
SSLMessenger<NodeIDType,?> messenger) |
protected ActiveReplica(AbstractReplicaCoordinator<NodeIDType> appC, ReconfigurableNodeConfig<NodeIDType> nodeConfig, SSLMessenger<NodeIDType,?> messenger)
protected static AbstractReplicaCoordinator<?> wrapCoordinator(AbstractReplicaCoordinator<?> coordinator)
public java.lang.String preCheckpoint(java.lang.String name)
preCheckpoint in interface ReconfiguratorCallbackname - Replicable.checkpoint(String).public boolean preRestore(java.lang.String name,
java.lang.String state)
preRestore in interface ReconfiguratorCallbackprotected void initInstrumenter()
public boolean handleMessage(Request incoming, NIOHeader header)
handleMessage in interface PacketDemultiplexer<Request>public void executed(Request request, boolean handled)
executed in interface ExecutedCallbackprotected java.util.Set<IntegerPacketType> getPacketTypes(boolean allow)
protected java.util.Set<IntegerPacketType> getPacketTypes()
public void close()
public GenericMessagingTask<NodeIDType,?>[] handleStartEpoch(StartEpoch<NodeIDType> event, ProtocolTask<NodeIDType,ReconfigurationPacket.PacketType,java.lang.String>[] ptasks)
event - ptasks - public GenericMessagingTask<NodeIDType,?>[] handleStopEpoch(StopEpoch<NodeIDType> stopEpoch, ProtocolTask<NodeIDType,ReconfigurationPacket.PacketType,java.lang.String>[] ptasks)
stopEpoch - ptasks - StopEpoch.public GenericMessagingTask<NodeIDType,?>[] handleDropEpochFinalState(DropEpochFinalState<NodeIDType> event, ProtocolTask<NodeIDType,ReconfigurationPacket.PacketType,java.lang.String>[] ptasks)
event - ptasks - public GenericMessagingTask<NodeIDType,?>[] handleEchoRequest(EchoRequest echo, ProtocolTask<NodeIDType,ReconfigurationPacket.PacketType,java.lang.String>[] ptasks)
echo - ptasks - public GenericMessagingTask<NodeIDType,?>[] handleRequestEpochFinalState(RequestEpochFinalState<NodeIDType> event, ProtocolTask<NodeIDType,ReconfigurationPacket.PacketType,java.lang.String>[] ptasks)
event - ptasks - public java.lang.String toString()
toString in class java.lang.Objectpublic static final int getClientFacingPort(int port)
port - public static final int getClientFacingClearPort(int port)
port - public static final int getClientFacingSSLPort(int port)
port - public boolean preExecuted(Request request)
preExecuted in interface ReconfiguratorCallback