public class DelegateZooKeeperGroup<T extends NodeState> extends java.lang.Object implements Group<T>
| Constructor and Description |
|---|
DelegateZooKeeperGroup(java.lang.String path,
java.lang.Class<T> clazz) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(GroupListener<T> listener)
Registers a listener which will be called
when the cluster membership changes or
the group is connected or disconnected.
|
void |
close()
A member should be closed to release acquired resources used
to monitor the group membership.
|
static void |
closeQuietly(java.io.Closeable closeable) |
protected Group<T> |
createGroup(org.apache.curator.framework.CuratorFramework client,
java.lang.String path,
java.lang.Class<T> clazz) |
protected void |
doStart() |
protected void |
doStop() |
boolean |
isConnected()
Are we connected with the cluster?
|
boolean |
isMaster()
Check if we are the master.
|
T |
master()
Retrieve the master node.
|
java.util.Map<java.lang.String,T> |
members()
Get the list of members connected to this group.
|
void |
remove(GroupListener<T> listener)
Removes a previously added listener.
|
java.util.List<T> |
slaves()
Retrieve the list of slaves.
|
void |
start()
Start this member
|
void |
update(T state)
Update the state of this group member.
|
void |
useCurator(org.apache.curator.framework.CuratorFramework curator) |
public DelegateZooKeeperGroup(java.lang.String path,
java.lang.Class<T> clazz)
public void useCurator(org.apache.curator.framework.CuratorFramework curator)
protected Group<T> createGroup(org.apache.curator.framework.CuratorFramework client, java.lang.String path, java.lang.Class<T> clazz)
public void add(GroupListener<T> listener)
Grouppublic void remove(GroupListener<T> listener)
Grouppublic boolean isConnected()
GroupisConnected in interface Group<T extends NodeState>public void start()
Groupprotected void doStart()
public void close()
throws java.io.IOException
Groupprotected void doStop()
throws java.io.IOException
java.io.IOExceptionpublic void update(T state)
Grouppublic java.util.Map<java.lang.String,T> members()
Grouppublic boolean isMaster()
Grouppublic java.util.List<T> slaves()
Grouppublic static void closeQuietly(java.io.Closeable closeable)
Copyright © 2016 Red Hat. All Rights Reserved.