- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.netflix.curator.utils.ZKPaths.makePath()
方法的一些代码示例,展示了ZKPaths.makePath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKPaths.makePath()
方法的具体详情如下:
包路径:com.netflix.curator.utils.ZKPaths
类名称:ZKPaths
方法名:makePath
[英]Given a parent path and a child node, create a combined full path
[中]给定父路径和子节点,创建一个组合的完整路径
代码示例来源:origin: com.netflix.curator/curator-recipes
@Override
public String apply(String child)
{
return ZKPaths.makePath(path, child);
}
}
代码示例来源:origin: com.netflix.curator/curator-recipes
@Override
public String apply(String name)
{
return ZKPaths.makePath(basePath, name);
}
}
代码示例来源:origin: com.netflix.curator/curator-recipes
String makeItemPath()
{
return ZKPaths.makePath(queuePath, QUEUE_ITEM_NAME);
}
代码示例来源:origin: com.netflix.curator/curator-client
/**
* Apply the namespace to the given path
*
* @param namespace namespace (can be null)
* @param path path
* @return adjusted path
*/
public static String fixForNamespace(String namespace, String path)
{
if ( namespace != null )
{
return makePath(namespace, path);
}
return path;
}
代码示例来源:origin: com.netflix.curator/curator-recipes
/**
* Creates the barrier abstraction. <code>memberQty</code> is the number of members in the
* barrier. When {@link #enter()} is called, it blocks until all members have entered. When
* {@link #leave()} is called, it blocks until all members have left.
*
* @param client the client
* @param barrierPath path to use
* @param memberQty the number of members in the barrier. NOTE: more than <code>memberQty</code>
* can enter the barrier. <code>memberQty</code> is a threshold, not a limit
*/
public DistributedDoubleBarrier(CuratorFramework client, String barrierPath, int memberQty)
{
Preconditions.checkState(memberQty > 0, "memberQty cannot be 0");
this.client = client;
this.barrierPath = barrierPath;
this.memberQty = memberQty;
ourPath = ZKPaths.makePath(barrierPath, UUID.randomUUID().toString());
readyPath = ZKPaths.makePath(barrierPath, READY_NODE);
}
代码示例来源:origin: com.netflix.curator/curator-framework
String unfixForNamespace(String path)
{
if ( (namespace != null) && (path != null) )
{
String namespacePath = ZKPaths.makePath(namespace, null);
if ( path.startsWith(namespacePath) )
{
path = (path.length() > namespacePath.length()) ? path.substring(namespacePath.length()) : "/";
}
}
return path;
}
代码示例来源:origin: com.netflix.curator/curator-recipes
LockInternals(CuratorFramework client, LockInternalsDriver driver, String path, String lockName, int maxLeases)
{
this.driver = driver;
this.lockName = lockName;
this.maxLeases = maxLeases;
PathUtils.validatePath(path);
this.client = client;
this.basePath = path;
this.path = ZKPaths.makePath(path, lockName);
}
代码示例来源:origin: com.netflix.curator/curator-recipes
private void addNewQueueIfNeeded(String newQueuePath) throws Exception
{
if ( newQueuePath == null )
{
newQueuePath = ZKPaths.makePath(queuePath, QUEUE_PREFIX + UUID.randomUUID().toString());
}
if ( !queues.containsKey(newQueuePath) )
{
T queue = queueAllocator.allocateQueue(client, newQueuePath);
if ( queues.putIfAbsent(newQueuePath, queue) == null )
{
queue.start();
preferredQueues.add(newQueuePath);
}
}
}
代码示例来源:origin: com.netflix.curator/curator-recipes
/**
* Return a list of all current nodes participating in the semaphore
*
* @return list of nodes
* @throws Exception ZK errors, interruptions, etc.
*/
public Collection<String> getParticipantNodes() throws Exception
{
return client.getChildren().forPath(ZKPaths.makePath(leasesPath, LEASE_BASE_NAME));
}
代码示例来源:origin: com.netflix.curator/curator-framework
NamespaceImpl(CuratorFrameworkImpl client, String namespace)
{
if ( namespace != null )
{
try
{
PathUtils.validatePath("/" + namespace);
}
catch ( IllegalArgumentException e )
{
throw new IllegalArgumentException("Invalid namespace: " + namespace);
}
}
this.client = client;
this.namespace = namespace;
ensurePath = (namespace != null) ? new EnsurePath(ZKPaths.makePath("/", namespace)) : null;
}
代码示例来源:origin: com.netflix.curator/curator-recipes
private InterProcessSemaphoreV2(CuratorFramework client, String path, int maxLeases, SharedCountReader count)
{
this.client = client;
lock = new InterProcessMutex(client, ZKPaths.makePath(path, LOCK_PARENT));
this.maxLeases = (count != null) ? count.getCount() : maxLeases;
leasesPath = ZKPaths.makePath(path, LEASE_PARENT);
if ( count != null )
{
count.addListener
(
new SharedCountListener()
{
@Override
public void countHasChanged(SharedCountReader sharedCount, int newCount) throws Exception
{
InterProcessSemaphoreV2.this.maxLeases = newCount;
}
@Override
public void stateChanged(CuratorFramework client, ConnectionState newState)
{
// no need to handle this here - clients should set their own connection state listener
}
}
);
}
}
代码示例来源:origin: com.netflix.curator/curator-recipes
String fullPath = ZKPaths.makePath(path, name);
代码示例来源:origin: com.netflix.curator/curator-recipes
private void getInitialQueues() throws Exception
{
List<String> children = client.getChildren().forPath(queuePath);
for ( String child : children )
{
String queuePath = ZKPaths.makePath(this.queuePath, child);
addNewQueueIfNeeded(queuePath);
}
if ( children.size() == 0 )
{
addNewQueueIfNeeded(null);
}
}
代码示例来源:origin: com.netflix.curator/curator-framework
private String adjustPath(String path) throws Exception
{
if ( doProtected )
{
ZKPaths.PathAndNode pathAndNode = ZKPaths.getPathAndNode(path);
String name = getProtectedPrefix() + pathAndNode.getNode();
path = ZKPaths.makePath(pathAndNode.getPath(), name);
}
return path;
}
}
代码示例来源:origin: com.netflix.curator/curator-framework
if ( foundNode != null )
foundNode = ZKPaths.makePath(pathAndNode.getPath(), foundNode);
代码示例来源:origin: com.netflix.curator/curator-recipes
/**
* Inserts data into queue.
*
* @param data the data
* @return true if data was successfully added
* @throws Exception errors
*/
public boolean offer(byte[] data) throws Exception
{
ensurePath.ensure(client.getZookeeperClient());
String thisPath = ZKPaths.makePath(path, PREFIX);
client.create().withMode(CreateMode.PERSISTENT_SEQUENTIAL).forPath(thisPath, data);
return true;
}
代码示例来源:origin: com.netflix.curator/curator-recipes
private void doWork()
{
try
{
List<String> children = client.getChildren().forPath(path);
for ( String name : children )
{
String thisPath = ZKPaths.makePath(path, name);
Stat stat = client.checkExists().forPath(thisPath);
if ( (stat != null) && (stat.getNumChildren() == 0) )
{
reaper.addPath(thisPath, mode);
}
}
}
catch ( Exception e )
{
log.error("Could not get children for path: " + path, e);
}
}
}
代码示例来源:origin: com.netflix.curator/curator-recipes
/**
* NOTE: this is a BLOCKING method. Completely rebuild the internal cache by querying
* for all needed data WITHOUT generating any events to send to listeners.
*
* @throws Exception errors
*/
public void rebuild() throws Exception
{
Preconditions.checkState(!executorService.isShutdown(), "cache has been closed");
ensurePath.ensure(client.getZookeeperClient());
clear();
List<String> children = client.getChildren().forPath(path);
for ( String child : children )
{
String fullPath = ZKPaths.makePath(path, child);
internalRebuildNode(fullPath);
if ( rebuildTestExchanger != null )
{
rebuildTestExchanger.exchange(new Object());
}
}
// this is necessary so that any updates that occurred while rebuilding are taken
offerOperation(new RefreshOperation(this, RefreshMode.FORCE_GET_DATA_AND_STAT));
}
代码示例来源:origin: com.netflix.curator/curator-recipes
String itemPath = ZKPaths.makePath(queuePath, itemNode);
Stat stat = new Stat();
代码示例来源:origin: com.netflix.curator/curator-recipes
private void reset() throws Exception
{
setLeadership(false);
deleteNode();
BackgroundCallback callback = new BackgroundCallback()
{
@Override
public void processResult(CuratorFramework client, CuratorEvent event) throws Exception
{
if ( event.getResultCode() == KeeperException.Code.OK.intValue() )
{
ourPath = event.getName();
getChildren();
}
else
{
log.error("getChildren() failed. rc = " + event.getResultCode());
}
}
};
client.create().creatingParentsIfNeeded().withProtection().withMode(CreateMode.EPHEMERAL_SEQUENTIAL).inBackground(callback).forPath(ZKPaths.makePath(latchPath, LOCK_NAME), LeaderSelector.getIdBytes(id));
}
本文整理了Java中io.fabric8.zookeeper.ZkPath.loadURL()方法的一些代码示例,展示了ZkPath.loadURL()的具体用法。这些代码示例主要来源于Github/
本文整理了Java中io.fabric8.zookeeper.ZkPath.getPath()方法的一些代码示例,展示了ZkPath.getPath()的具体用法。这些代码示例主要来源于Github/
本文整理了Java中org.apache.curator.utils.ZKPaths.makePath()方法的一些代码示例,展示了ZKPaths.makePath()的具体用法。这些代码示例主要来源
本文整理了Java中org.apache.curator.utils.ZKPaths.getNodeFromPath()方法的一些代码示例,展示了ZKPaths.getNodeFromPath()的具
本文整理了Java中org.apache.curator.utils.ZKPaths.fixForNamespace()方法的一些代码示例,展示了ZKPaths.fixForNamespace()的具
本文整理了Java中org.apache.curator.utils.ZKPaths.getPathAndNode()方法的一些代码示例,展示了ZKPaths.getPathAndNode()的具体用
本文整理了Java中org.apache.curator.utils.ZKPaths.deleteChildren()方法的一些代码示例,展示了ZKPaths.deleteChildren()的具体用
本文整理了Java中org.apache.curator.utils.ZKPaths.mkdirs()方法的一些代码示例,展示了ZKPaths.mkdirs()的具体用法。这些代码示例主要来源于Git
本文整理了Java中me.hao0.antares.common.util.ZkPaths.pathOfServer()方法的一些代码示例,展示了ZkPaths.pathOfServer()的具体用法
本文整理了Java中me.hao0.antares.common.util.ZkPaths.pathOfAppClients()方法的一些代码示例,展示了ZkPaths.pathOfAppClient
本文整理了Java中me.hao0.antares.common.util.ZkPaths.pathOfJobInstances()方法的一些代码示例,展示了ZkPaths.pathOfJobInst
本文整理了Java中me.hao0.antares.common.util.ZkPaths.pathOfJobInstance()方法的一些代码示例,展示了ZkPaths.pathOfJobInsta
本文整理了Java中me.hao0.antares.common.util.ZkPaths.lastNode()方法的一些代码示例,展示了ZkPaths.lastNode()的具体用法。这些代码示例主
本文整理了Java中com.netflix.curator.utils.ZKPaths.getNodeFromPath()方法的一些代码示例,展示了ZKPaths.getNodeFromPath()的
本文整理了Java中com.netflix.curator.utils.ZKPaths.makePath()方法的一些代码示例,展示了ZKPaths.makePath()的具体用法。这些代码示例主要来
本文整理了Java中com.netflix.curator.utils.ZKPaths.getPathAndNode()方法的一些代码示例,展示了ZKPaths.getPathAndNode()的具体
本文整理了Java中org.apache.flink.shaded.curator.org.apache.curator.utils.ZKPaths.getNodeFromPath()方法的一些代码示
本文整理了Java中org.apache.flink.shaded.curator.org.apache.curator.utils.ZKPaths.deleteChildren()方法的一些代码示例
我是一名优秀的程序员,十分优秀!