NodeIDType
- public class ReconfigurationRecord<NodeIDType>
extends org.json.JSONObject
Modifier and Type | Class and Description |
---|---|
protected static class |
ReconfigurationRecord.Keys |
static class |
ReconfigurationRecord.RCStates
RC record states.
|
Constructor and Description |
---|
ReconfigurationRecord(org.json.JSONObject json,
Stringifiable<NodeIDType> unstringer) |
ReconfigurationRecord(java.lang.String name,
int epoch,
java.util.Set<NodeIDType> newActives) |
ReconfigurationRecord(java.lang.String name,
int epoch,
java.util.Set<NodeIDType> newActives,
ReconfigurationConfig.ReconfigureUponActivesChange policy) |
ReconfigurationRecord(java.lang.String name,
int epoch,
java.util.Set<NodeIDType> actives,
java.util.Set<NodeIDType> newActives,
ReconfigurationConfig.ReconfigureUponActivesChange policy) |
Modifier and Type | Method and Description |
---|---|
boolean |
addToMerge(java.lang.String s) |
boolean |
areMergesAllDone() |
void |
clearMerged() |
boolean |
clearMerged(java.lang.String mergee) |
java.util.Set<NodeIDType> |
getActiveReplicas() |
java.util.Set<NodeIDType> |
getActiveReplicas(java.lang.String name,
int epoch) |
long |
getDeleteTime() |
int |
getEpoch() |
java.lang.String |
getName() |
java.util.Set<NodeIDType> |
getNewActives() |
java.lang.Integer |
getRCEpoch(NodeIDType rcGroupName) |
java.lang.Integer |
getRCEpoch(java.lang.String rcGroupName)
To get the RC epoch upon a node config change completion.
|
java.lang.String |
getRCGroupName() |
ReconfigurationConfig.ReconfigureUponActivesChange |
getReconfigureUponActivesChangePolicy() |
ReconfigurationRecord.RCStates |
getState() |
java.lang.String |
getSummary() |
int |
getUnclean() |
boolean |
hasBeenMerged(java.util.Set<java.lang.String> mergees) |
boolean |
hasBeenMerged(java.lang.String s) |
boolean |
incrEpoch(int epoch) |
boolean |
insertMerged(java.lang.String s) |
boolean |
isDeletable() |
boolean |
isDeletePending() |
boolean |
isReady() |
boolean |
isReconfigurationReady() |
ReconfigurationRecord<NodeIDType> |
putActiveReplicas(java.lang.String name,
int epoch,
java.util.Set<NodeIDType> arSet) |
void |
setActivesToNewActives() |
void |
setActivesToNewActives(java.util.Set<NodeIDType> newActives) |
boolean |
setDropPreviousEpochCompleted() |
boolean |
setEpoch(int epoch) |
void |
setRCEpochs(java.util.Set<NodeIDType> affectedRCs,
java.util.Set<NodeIDType> addNodes,
java.util.Set<NodeIDType> deleteNodes) |
ReconfigurationRecord<NodeIDType> |
setRCGroupName(java.lang.String groupName) |
ReconfigurationRecord<NodeIDType> |
setState(java.lang.String name,
int epoch,
ReconfigurationRecord.RCStates state) |
void |
setState(java.lang.String name,
int epoch,
ReconfigurationRecord.RCStates state,
java.util.Set<NodeIDType> newActives) |
void |
setStateMerge(java.lang.String name,
int epoch,
ReconfigurationRecord.RCStates state,
java.util.Set<java.lang.String> mergees) |
org.json.JSONObject |
toJSONObject() |
boolean |
toMergeContains(java.lang.String s) |
java.lang.String |
toString()
Make a JSON text of this JSONObject.
|
void |
trimRCEpochs()
Needed to trim the rcEpochs map when reconfigurator nodes get deleted.
|
boolean |
updateStats(DemandReport<NodeIDType> report) |
accumulate, append, doubleToString, ellipsize, get, getBoolean, getDouble, getInt, getJSONArray, getJSONObject, getLong, getNames, getNames, getString, has, increment, isNull, keys, length, names, numberToString, opt, optBoolean, optBoolean, optDouble, optDouble, optInt, optInt, optJSONArray, optJSONObject, optLong, optLong, optString, optString, put, put, put, put, put, put, put, putOnce, putOpt, quote, remove, stringToValue, testValidity, toJSONArray, toReasonableString, toString, valueToReasonableString, valueToString, wrap, write
public ReconfigurationRecord(java.lang.String name, int epoch, java.util.Set<NodeIDType> newActives)
name
- epoch
- newActives
- public ReconfigurationRecord(java.lang.String name, int epoch, java.util.Set<NodeIDType> newActives, ReconfigurationConfig.ReconfigureUponActivesChange policy)
name
- epoch
- newActives
- policy
- public ReconfigurationRecord(java.lang.String name, int epoch, java.util.Set<NodeIDType> actives, java.util.Set<NodeIDType> newActives, ReconfigurationConfig.ReconfigureUponActivesChange policy)
name
- epoch
- actives
- newActives
- policy
- public ReconfigurationRecord(org.json.JSONObject json, Stringifiable<NodeIDType> unstringer) throws org.json.JSONException
json
- unstringer
- org.json.JSONException
public org.json.JSONObject toJSONObject() throws org.json.JSONException
org.json.JSONException
public java.lang.String toString()
org.json.JSONObject
Warning: This method assumes that the data structure is acyclical.
toString
in class org.json.JSONObject
{
(left brace) and ending
with }
(right brace).public int getEpoch()
public boolean setEpoch(int epoch)
epoch
- public boolean incrEpoch(int epoch)
epoch
- public java.util.Set<NodeIDType> getActiveReplicas(java.lang.String name, int epoch)
name
- epoch
- name:epoch
public java.util.Set<NodeIDType> getActiveReplicas()
public ReconfigurationRecord<NodeIDType> putActiveReplicas(java.lang.String name, int epoch, java.util.Set<NodeIDType> arSet)
name
- epoch
- arSet
- public ReconfigurationRecord.RCStates getState()
public boolean isReady()
public boolean isReconfigurationReady()
public void setActivesToNewActives(java.util.Set<NodeIDType> newActives)
newActives
- public void setActivesToNewActives()
public java.util.Set<NodeIDType> getNewActives()
public boolean insertMerged(java.lang.String s)
s
- public boolean addToMerge(java.lang.String s)
s
- public void clearMerged()
public boolean clearMerged(java.lang.String mergee)
mergee
- mergee
was removed.public boolean hasBeenMerged(java.lang.String s)
s
- s
.public boolean hasBeenMerged(java.util.Set<java.lang.String> mergees)
mergees
- mergees
.public boolean areMergesAllDone()
public boolean toMergeContains(java.lang.String s)
s
- public boolean isDeletePending()
public boolean updateStats(DemandReport<NodeIDType> report)
report
- public boolean setDropPreviousEpochCompleted()
public ReconfigurationRecord<NodeIDType> setState(java.lang.String name, int epoch, ReconfigurationRecord.RCStates state)
name
- epoch
- state
- this
public void setStateMerge(java.lang.String name, int epoch, ReconfigurationRecord.RCStates state, java.util.Set<java.lang.String> mergees)
name
- epoch
- state
- mergees
- public boolean isDeletable()
public int getUnclean()
public void setState(java.lang.String name, int epoch, ReconfigurationRecord.RCStates state, java.util.Set<NodeIDType> newActives)
name
- epoch
- state
- newActives
- public java.lang.String getName()
public java.lang.Integer getRCEpoch(java.lang.String rcGroupName)
rcGroupName
- public java.lang.Integer getRCEpoch(NodeIDType rcGroupName)
rcGroupName
- public void setRCEpochs(java.util.Set<NodeIDType> affectedRCs, java.util.Set<NodeIDType> addNodes, java.util.Set<NodeIDType> deleteNodes)
affectedRCs
- addNodes
- deleteNodes
- public void trimRCEpochs()
public long getDeleteTime()
public ReconfigurationRecord<NodeIDType> setRCGroupName(java.lang.String groupName)
groupName
- this
public java.lang.String getRCGroupName()
public java.lang.String getSummary()
public ReconfigurationConfig.ReconfigureUponActivesChange getReconfigureUponActivesChangePolicy()