|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activecluster.group.GroupModel
Represents a collection of zero or more groups in a cluster. The default implementation will create groups as nodes are added to the cluster; filling the groups with its required number of buddies / slaves until a new group can be created.
Nodes which are not allowed to be master nodes will be kept around in a pool ready to be added as slaves when a new master arrives and forces the creation of a group.
Group
Constructor Summary | |
GroupModel()
|
Method Summary | |
protected void |
addGroup(Group group)
|
void |
addNode(Node node)
Adds the new node to this group model; we assume the node has not been added before. |
protected void |
addNodeToGroup(Group group,
Node node)
|
protected boolean |
addToExistingGroup(Node node)
Attempts to add the node to an incomplete group, or a not-full group and returns true if its possible - else returns false |
protected boolean |
addToIncompleteGroup(Node node)
|
protected boolean |
addToNotFullGroup(Node node)
|
protected boolean |
addToPendingGroup(LinkedList list,
Node node)
Adds the given node to the first pending group if possible |
protected void |
addToUnusedNodes(Node node)
|
protected boolean |
canBeMaster(Node node)
Returns true if the given node can be a master |
protected boolean |
canCreateGroup(Node node)
Returns true if we can add a new group to the cluster |
protected Group |
createGroup(Node node)
|
List |
getGroups()
Returns a snapshot of the groups currently available |
NodeFilter |
getMasterFilter()
|
int |
getMaximumGroups()
|
int |
getMaximumMemberCount()
|
int |
getMaximumWeighting()
|
int |
getMinimumMemberCount()
|
protected Group |
makeNewGroup(Node node)
Attempt to make a new group with the current node as the master or if the node cannot be a master node |
void |
removeNode(Node node)
Removes the node from the group model |
protected boolean |
removeNodeFromGroup(Group group,
Node node)
|
void |
setMasterFilter(NodeFilter masterFilter)
|
void |
setMaximumGroups(int maximumGroups)
|
void |
setMaximumMemberCount(int maximumMemberCount)
|
void |
setMaximumWeighting(int maximumWeighting)
|
void |
setMinimumMemberCount(int minimumMemberCount)
|
protected boolean |
tryToAddBuddy(Group group)
|
protected void |
tryToFillGroupWithBuddies(Group group)
|
protected void |
updateGroupCollections(Group group,
boolean wasFull,
boolean wasUsable)
Lets move the group from its current state collection to the new collection if its state has changed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GroupModel()
Method Detail |
public void addNode(Node node)
node
- public void removeNode(Node node)
node
- public List getGroups()
public NodeFilter getMasterFilter()
public void setMasterFilter(NodeFilter masterFilter)
public int getMaximumGroups()
public void setMaximumGroups(int maximumGroups)
public int getMaximumMemberCount()
public void setMaximumMemberCount(int maximumMemberCount)
public int getMinimumMemberCount()
public void setMinimumMemberCount(int minimumMemberCount)
public int getMaximumWeighting()
public void setMaximumWeighting(int maximumWeighting)
protected Group makeNewGroup(Node node)
protected void tryToFillGroupWithBuddies(Group group)
protected boolean tryToAddBuddy(Group group)
protected void updateGroupCollections(Group group, boolean wasFull, boolean wasUsable)
protected void addToUnusedNodes(Node node)
protected boolean addToExistingGroup(Node node)
protected boolean addToNotFullGroup(Node node)
protected boolean addToIncompleteGroup(Node node)
protected boolean addToPendingGroup(LinkedList list, Node node)
protected void addNodeToGroup(Group group, Node node)
protected boolean removeNodeFromGroup(Group group, Node node)
protected void addGroup(Group group)
protected Group createGroup(Node node)
protected boolean canCreateGroup(Node node)
protected boolean canBeMaster(Node node)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |