public final class ServiceUnitZkUtils extends Object
ServiceUnit related ZooKeeper operations| Modifier and Type | Field and Description |
|---|---|
static String |
OWNER_INFO_ROOT
ZooKeeper root path for namespace ownership info |
static String |
UTF8 |
| Constructor and Description |
|---|
ServiceUnitZkUtils() |
| Modifier and Type | Method and Description |
|---|---|
static NamespaceEphemeralData |
acquireNameSpace(ZooKeeper zkc,
String path,
NamespaceEphemeralData value)
Create name space Ephemeral node.
|
static org.apache.pulsar.common.policies.data.BundlesData |
createBundlesIfAbsent(ZooKeeper zkc,
String path,
org.apache.pulsar.common.policies.data.BundlesData initialBundles) |
static void |
initZK(ZooKeeper zkc,
String selfBrokerUrl)
initZK is only called when the NamespaceService is initialized.
|
static String |
path(NamespaceBundle suname) |
static NamespaceBundle |
suBundleFromPath(String path,
NamespaceBundleFactory factory) |
public static final String UTF8
public static final String OWNER_INFO_ROOT
ZooKeeper root path for namespace ownership infopublic static String path(NamespaceBundle suname)
public static NamespaceBundle suBundleFromPath(String path, NamespaceBundleFactory factory)
public static void initZK(ZooKeeper zkc, String selfBrokerUrl)
PulsarServerExceptionpublic static NamespaceEphemeralData acquireNameSpace(ZooKeeper zkc, String path, NamespaceEphemeralData value) throws KeeperException, InterruptedException, com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
zkc - the ZooKeeper connected session objectpath - the namespace pathvalue - the broker url that serves the name space.KeeperExceptionInterruptedExceptionIOExceptioncom.fasterxml.jackson.databind.JsonMappingExceptioncom.fasterxml.jackson.core.JsonGenerationExceptionpublic static org.apache.pulsar.common.policies.data.BundlesData createBundlesIfAbsent(ZooKeeper zkc, String path, org.apache.pulsar.common.policies.data.BundlesData initialBundles) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException, KeeperException, InterruptedException
com.fasterxml.jackson.core.JsonGenerationExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionKeeperExceptionInterruptedExceptionCopyright © 2017–2021 Apache Software Foundation. All rights reserved.