public class ZooKeeperService extends Object
Constructor and Description |
---|
ZooKeeperService() |
Modifier and Type | Method and Description |
---|---|
static void |
close(String contextPath)
Close the ZooKeeper session and remove it from the internal maps
|
static void |
close(String contextPath,
String session)
Close the ZooKeeper session and remove it
|
static void |
closeAll()
Close all the ZooKeeper sessions and remove them from the internal maps
|
static ZooKeeper |
getClient(String contextPath)
Return a ZooKeeper client not tied to a specific session.
|
static ZooKeeper |
getClient(String contextPath,
String session)
Return a ZooKeeper client for a session with a default expire time
|
static ZooKeeper |
getClient(String contextPath,
String session,
int expireTime)
Return a ZooKeeper client which may or may not be connected, but it will
not be expired.
|
static boolean |
isConnected(String contextPath,
String session)
Is there an active connection for this session?
|
static void |
mapContext(String contextPath,
Endpoint e)
Specify ZooKeeper host:port for a particular context path.
|
static void |
resetTimer(String contextPath,
String session)
Reset timer for a session
|
public static void mapContext(String contextPath, Endpoint e)
public static void resetTimer(String contextPath, String session)
public static void close(String contextPath)
public static void close(String contextPath, String session)
public static void closeAll()
public static boolean isConnected(String contextPath, String session)
public static ZooKeeper getClient(String contextPath) throws IOException
IOException
public static ZooKeeper getClient(String contextPath, String session) throws IOException
IOException
public static ZooKeeper getClient(String contextPath, String session, int expireTime) throws IOException
IOException
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.