NodeIDType - public class SQLReconfiguratorDB<NodeIDType> extends AbstractReconfiguratorDB<NodeIDType> implements ReconfiguratorDB<NodeIDType>
AbstractReconfiguratorDB.RecordNames| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
logDirectory |
consistentNodeConfig, myID, recovering, TWO_PAXOS_RC| Constructor and Description |
|---|
SQLReconfiguratorDB(NodeIDType myID,
ConsistentReconfigurableNodeConfig<NodeIDType> nc) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addActiveReplica(NodeIDType node,
java.net.InetSocketAddress sockAddr,
int version) |
boolean |
addReconfigurator(NodeIDType node,
java.net.InetSocketAddress sockAddr,
int version) |
java.lang.String |
checkpoint(java.lang.String rcGroup)
Incomplete paxos methods below
|
void |
clearMerged(java.lang.String rcGroupName,
int epoch)
Clear all merged state in RC record.
|
void |
close()
Close gracefully.
|
boolean |
closeReadActiveRecords() |
ReconfigurationRecord<NodeIDType> |
createReconfigurationRecord(ReconfigurationRecord<NodeIDType> record) |
boolean |
createReconfigurationRecords(java.util.Map<java.lang.String,java.lang.String> nameStates,
java.util.Set<NodeIDType> newActives,
ReconfigurationConfig.ReconfigureUponActivesChange policy) |
void |
delayedDeleteComplete() |
boolean |
deleteReconfigurationRecord(java.lang.String name,
int epoch) |
static void |
dropState(java.lang.String myID,
ConsistentReconfigurableNodeConfig<java.lang.String> nc) |
java.lang.String |
fetchAndAggregateMergeeStates(java.util.Map<java.lang.String,java.lang.String> finalStates,
java.lang.String mergerGroup,
int mergerGroupEpoch) |
void |
garbageCollectedDeletedNode(NodeIDType node) |
boolean |
garbageCollectOldReconfigurators(int version) |
java.lang.String |
getDemandStats(java.lang.String name) |
protected java.lang.String |
getNodeConfigRecords(ConsistentReconfigurableNodeConfig<NodeIDType> nc) |
java.lang.String[] |
getPendingReconfigurations()
Names for which reconfiguration is incomplete, needed for recovery
|
java.util.Set<java.lang.String> |
getRCGroupNames() |
java.util.Map<java.lang.String,java.util.Set<NodeIDType>> |
getRCGroups()
Get current RC group names from the DB
|
protected java.lang.String |
getRCTableString() |
ReconfigurationRecord<NodeIDType> |
getReconfigurationRecord(java.lang.String name)
Start of overridden methods
|
boolean |
initiateReadActiveRecords(NodeIDType active) |
static void |
main(java.lang.String[] args) |
boolean |
markDeleteReconfigurationRecord(java.lang.String name,
int epoch) |
boolean |
mergeIntent(java.lang.String name,
int epoch,
java.lang.String mergee) |
boolean |
mergeState(java.lang.String rcGroupName,
int epoch,
java.lang.String mergee,
int mergeeEpoch,
java.lang.String state)
Merge state, i.e., append instead of replacing state, exactly once.
|
protected void |
printRCTable() |
ReconfigurationRecord<NodeIDType> |
readNextActiveRecord(boolean add) |
void |
removePending(java.lang.String name) |
boolean |
restore(java.lang.String rcGroup,
java.lang.String state)
Resets the current application state for
name to state. |
void |
setRCEpochs(ReconfigurationRecord<NodeIDType> ncRecord)
Sets RC epochs so that we know the epoch numbers for each reconfigurator
group.
|
boolean |
setState(java.lang.String name,
int epoch,
ReconfigurationRecord.RCStates state)
Set epoch and state as specified.
|
boolean |
setStateInitReconfiguration(java.util.Map<java.lang.String,java.lang.String> nameStates,
int epoch,
ReconfigurationRecord.RCStates state,
java.util.Set<NodeIDType> newActives) |
boolean |
setStateInitReconfiguration(java.lang.String name,
int epoch,
ReconfigurationRecord.RCStates state,
java.util.Set<NodeIDType> newActives)
Set epoch, state, newActives, primary only if current state is READY
|
boolean |
setStateMerge(java.util.Map<java.lang.String,java.lang.String> nameStates,
int epoch,
ReconfigurationRecord.RCStates state,
java.util.Set<NodeIDType> newActives) |
boolean |
setStateMerge(java.lang.String name,
int epoch,
ReconfigurationRecord.RCStates state,
java.util.Set<NodeIDType> newActives,
java.util.Set<java.lang.String> mergees) |
java.lang.String |
toString() |
boolean |
updateDemandStats(DemandReport<NodeIDType> report)
Update demand statistics.
|
areRCChangesCompleteDebug, autoInvokeMethod, deleteFinalState, execute, execute, getEpoch, getFinalState, getMergeList, getMergeLists, getNewConsistentHashRing, getNewRCGroups, getNoopRequest, getOldConsistentHashRing, getOldRCGroups, getRCGroupName, getRCGroupName, getRCGroups, getRCGroups, getReconfigurationRecord, getRequest, getRequestTypes, getStopRequest, handleDemandReport, handleRCRecordRequest, handleRequestActiveReplicas, handleStopEpoch, isAffected, isRCGroupName, putInitialState, setCallback, setRCEpochs, updateActiveDBNodeConfig, updateDBNodeConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetCallbackgetMutualAuthRequestTypes, getRequest, getServerAuthRequestTypespublic SQLReconfiguratorDB(NodeIDType myID, ConsistentReconfigurableNodeConfig<NodeIDType> nc)
myID - nc - public static final void dropState(java.lang.String myID,
ConsistentReconfigurableNodeConfig<java.lang.String> nc)
myID - nc - public ReconfigurationRecord<NodeIDType> getReconfigurationRecord(java.lang.String name)
getReconfigurationRecord in interface ReconfiguratorDB<NodeIDType>name.public boolean updateDemandStats(DemandReport<NodeIDType> report)
ReconfiguratorDBupdateDemandStats in interface ReconfiguratorDB<NodeIDType>public boolean setState(java.lang.String name,
int epoch,
ReconfigurationRecord.RCStates state)
ReconfiguratorDBsetState in interface ReconfiguratorDB<NodeIDType>public boolean setStateMerge(java.lang.String name,
int epoch,
ReconfigurationRecord.RCStates state,
java.util.Set<NodeIDType> newActives,
java.util.Set<java.lang.String> mergees)
setStateMerge in interface ReconfiguratorDB<NodeIDType>public boolean setStateInitReconfiguration(java.lang.String name,
int epoch,
ReconfigurationRecord.RCStates state,
java.util.Set<NodeIDType> newActives)
ReconfiguratorDBsetStateInitReconfiguration in interface ReconfiguratorDB<NodeIDType>protected void printRCTable()
protected java.lang.String getRCTableString()
public boolean deleteReconfigurationRecord(java.lang.String name,
int epoch)
deleteReconfigurationRecord in interface ReconfiguratorDB<NodeIDType>public boolean markDeleteReconfigurationRecord(java.lang.String name,
int epoch)
markDeleteReconfigurationRecord in interface ReconfiguratorDB<NodeIDType>public ReconfigurationRecord<NodeIDType> createReconfigurationRecord(ReconfigurationRecord<NodeIDType> record)
createReconfigurationRecord in interface ReconfiguratorDB<NodeIDType>public java.lang.String checkpoint(java.lang.String rcGroup)
checkpoint in interface Replicable
Note that state may simply be an app-specific handle,
e.g., a file name, representing the state as opposed to the
actual state. The application is responsible for interpreting the
state returned by Replicable.checkpoint(String) and that supplied
in Replicable.restore(String, String) in a consistent manner.
public boolean restore(java.lang.String rcGroup,
java.lang.String state)
Replicablename to state.
Note that state may simply be an app-specific handle, e.g., a
file name, representing the state as opposed to the actual state. The
application is responsible for interpreting the state returned by
Replicable.checkpoint(String) and that supplied in
Replicable.restore(String, String) in a consistent manner.
restore in interface Replicablepublic java.lang.String getDemandStats(java.lang.String name)
getDemandStats in interface ReconfiguratorDB<NodeIDType>public java.lang.String[] getPendingReconfigurations()
ReconfiguratorDBgetPendingReconfigurations in interface ReconfiguratorDB<NodeIDType>public void removePending(java.lang.String name)
removePending in interface ReconfiguratorDB<NodeIDType>protected java.lang.String getNodeConfigRecords(ConsistentReconfigurableNodeConfig<NodeIDType> nc)
public java.lang.String fetchAndAggregateMergeeStates(java.util.Map<java.lang.String,java.lang.String> finalStates,
java.lang.String mergerGroup,
int mergerGroupEpoch)
fetchAndAggregateMergeeStates in interface ReconfiguratorDB<NodeIDType>finalStates - mergerGroup - mergerGroupEpoch - public java.util.Map<java.lang.String,java.util.Set<NodeIDType>> getRCGroups()
ReconfiguratorDBgetRCGroups in interface ReconfiguratorDB<NodeIDType>public java.util.Set<java.lang.String> getRCGroupNames()
getRCGroupNames in interface ReconfiguratorDB<NodeIDType>public void close()
ReconfiguratorDBclose in interface ReconfiguratorDB<NodeIDType>public java.lang.String toString()
toString in class AbstractReconfiguratorDB<NodeIDType>public boolean addActiveReplica(NodeIDType node, java.net.InetSocketAddress sockAddr, int version)
addActiveReplica in interface ReconfiguratorDB<NodeIDType>public boolean addReconfigurator(NodeIDType node, java.net.InetSocketAddress sockAddr, int version)
addReconfigurator in interface ReconfiguratorDB<NodeIDType>public boolean garbageCollectOldReconfigurators(int version)
garbageCollectOldReconfigurators in interface ReconfiguratorDB<NodeIDType>public boolean mergeState(java.lang.String rcGroupName,
int epoch,
java.lang.String mergee,
int mergeeEpoch,
java.lang.String state)
ReconfiguratorDBmergeState in interface ReconfiguratorDB<NodeIDType>public void clearMerged(java.lang.String rcGroupName,
int epoch)
ReconfiguratorDBclearMerged in interface ReconfiguratorDB<NodeIDType>public void setRCEpochs(ReconfigurationRecord<NodeIDType> ncRecord)
ReconfiguratorDBsetRCEpochs in interface ReconfiguratorDB<NodeIDType>public boolean mergeIntent(java.lang.String name,
int epoch,
java.lang.String mergee)
mergeIntent in interface ReconfiguratorDB<NodeIDType>public void delayedDeleteComplete()
delayedDeleteComplete in interface ReconfiguratorDB<NodeIDType>public void garbageCollectedDeletedNode(NodeIDType node)
garbageCollectedDeletedNode in interface ReconfiguratorDB<NodeIDType>public boolean createReconfigurationRecords(java.util.Map<java.lang.String,java.lang.String> nameStates,
java.util.Set<NodeIDType> newActives,
ReconfigurationConfig.ReconfigureUponActivesChange policy)
createReconfigurationRecords in interface ReconfiguratorDB<NodeIDType>public boolean setStateInitReconfiguration(java.util.Map<java.lang.String,java.lang.String> nameStates,
int epoch,
ReconfigurationRecord.RCStates state,
java.util.Set<NodeIDType> newActives)
setStateInitReconfiguration in interface ReconfiguratorDB<NodeIDType>public boolean setStateMerge(java.util.Map<java.lang.String,java.lang.String> nameStates,
int epoch,
ReconfigurationRecord.RCStates state,
java.util.Set<NodeIDType> newActives)
setStateMerge in interface ReconfiguratorDB<NodeIDType>public boolean initiateReadActiveRecords(NodeIDType active)
initiateReadActiveRecords in interface ReconfiguratorDB<NodeIDType>public ReconfigurationRecord<NodeIDType> readNextActiveRecord(boolean add)
readNextActiveRecord in interface ReconfiguratorDB<NodeIDType>public boolean closeReadActiveRecords()
closeReadActiveRecords in interface ReconfiguratorDB<NodeIDType>public static void main(java.lang.String[] args)
args -