public abstract class AbstractGrid extends java.lang.Object implements Grid
Grid base implementation.| Constructor and Description |
|---|
AbstractGrid() |
| Modifier and Type | Method and Description |
|---|---|
void |
addGridListener(GridListener listener)
Adds a listener to be notified of grid members events.
|
void |
addInterceptor(GridMemberInterceptor interceptor)
Add a channel interceptor to the end of the list.
|
boolean |
addMember(GridMember node)
Adds a new grid member.
|
protected GridMemberInterceptorChain |
getInterceptorChain()
Exposes the interceptor chain for subclasses.
|
java.util.List<GridMemberInterceptor> |
getInterceptors()
Return a read-only list of the configured interceptors.
|
GridMember |
getMember(org.apache.hadoop.yarn.api.records.ContainerId id)
Gets a grid member.
|
java.util.Collection<GridMember> |
getMembers()
Gets collection of grid members know to the grid system or
empty collection if there are no known members.
|
protected void |
notifyMemberAdded(GridMember member)
Notifies registered
ContainerGridListeners that
a ContainerNode has been added to a ContainerGrid. |
protected void |
notifyMemberRemoved(GridMember member)
Notifies registered
ContainerGridListeners that
a ContainerNode has been removed from a ContainerGrid. |
boolean |
removeMember(org.apache.hadoop.yarn.api.records.ContainerId id)
Removes a grid member.
|
void |
setInterceptors(java.util.List<GridMemberInterceptor> interceptors)
Set the list of channel interceptors.
|
public java.util.Collection<GridMember> getMembers()
GridgetMembers in interface Gridpublic GridMember getMember(org.apache.hadoop.yarn.api.records.ContainerId id)
Gridpublic boolean addMember(GridMember node)
GridIf a grid refuses to add a particular member for any reason other than that it already contains the member, it must throw an exception (rather than returning false). This preserves the invariant that a grid always contains the specified node after this call returns.
public boolean removeMember(org.apache.hadoop.yarn.api.records.ContainerId id)
GridRemoves a single instance of the specified member from this grid, if it is present.
removeMember in interface Gridid - the container id identifierpublic void addGridListener(GridListener listener)
GridaddGridListener in interface Gridlistener - the grid listenerpublic void setInterceptors(java.util.List<GridMemberInterceptor> interceptors)
interceptors - list of interceptorspublic void addInterceptor(GridMemberInterceptor interceptor)
addInterceptor in interface Gridinterceptor - the interceptorpublic java.util.List<GridMemberInterceptor> getInterceptors()
protected GridMemberInterceptorChain getInterceptorChain()
protected void notifyMemberAdded(GridMember member)
ContainerGridListeners that
a ContainerNode has been added to a ContainerGrid.member - the nodeprotected void notifyMemberRemoved(GridMember member)
ContainerGridListeners that
a ContainerNode has been removed from a ContainerGrid.member - the node