- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.griddynamics.jagger.coordinator.zookeeper.ZNodeParameters
类的一些代码示例,展示了ZNodeParameters
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZNodeParameters
类的具体详情如下:
包路径:com.griddynamics.jagger.coordinator.zookeeper.ZNodeParameters
类名称:ZNodeParameters
[英]Parameters used when znode is creating.
[中]znode创建时使用的参数。
代码示例来源:origin: griddynamics/jagger
@Override
public ZNode createChild(ZNodeParameters parameters) {
String path = checkNotNull(parameters.getPath());
parameters.withPath(this.path + "/" + path);
return ZNodeCreator.of(zooKeeper).create(parameters);
}
代码示例来源:origin: griddynamics/jagger
public static ZNodeParameters znode() {
return new ZNodeParameters();
}
代码示例来源:origin: griddynamics/jagger
public ZNode create(ZNodeParameters parameters) {
try {
String path = zooKeeper.create(parameters.getPath(), parameters.getData(), parameters.getAcl(), parameters.getCreateMode());
return new ZNodeImpl(zooKeeper, path);
} catch (KeeperException e) {
throw new ZooException("Exception during node creation", e);
} catch (InterruptedException e) {
throw new ZooException("Exception during node creation", e);
}
}
}
代码示例来源:origin: griddynamics/jagger
typeNode.child(nodeContext.getId().getIdentifier()).removeWithChildren();
ZNode node = typeNode.createChild(znode().withPath(nodeContext.getId().getIdentifier()));
statuses.createChild(znode().ephemeralSequential().withDataObject(nodeContext.getId()));
node.createChild(znode().withPath(CoordinationUtil.AVAILABLE_NODE_NAME));
代码示例来源:origin: griddynamics/jagger
@Override
public void makeLockable() {
node.createChild(znode().withPath(lockPath));
}
代码示例来源:origin: griddynamics/jagger
ZNode resultNode = commandNode.child("result");
final ZNode outputNode = resultNode.createChild(znode().persistentSequential());
queueNode.createChild(
znode()
.persistentSequential()
.withDataObject(new QueueEntry<C, R>(command, listener, outputNode.getPath()))
);
log.debug("command {} is ready to be executed", command);
代码示例来源:origin: griddynamics/jagger
@Override
public void lock() {
while (true) {
ZNode node = lockDir().createChild(znode().ephemeralSequential());
代码示例来源:origin: griddynamics/jagger
@Override
public void initialize() {
log.info("Going to initialize required znode structure in zookeeper");
for (NodeType type : NodeType.values()) {
String child = CoordinationUtil.nodeNameOf(type);
if (!rootNode.hasChild(child)) {
rootNode.createChild(znode().withPath(child));
log.info("Created Zookeeper node {}", child);
}
}
if (!rootNode.hasChild(CoordinationUtil.STATUSES_NODE_NAME)) {
rootNode.createChild(znode().withPath(CoordinationUtil.STATUSES_NODE_NAME));
log.info("Created Zookeeper node {}", CoordinationUtil.STATUSES_NODE_NAME);
}
log.info("Successfully initialized");
}
代码示例来源:origin: griddynamics/jagger
private <C extends Command<R>, R extends Serializable> void registerExecutor(final NodeContext nodeContext, final CommandExecutor<C, R> executor, ZNode node) {
final ZNode executorNode = node.createChild(znode().withPath(nodeNameOf(executor.getQualifier())));
final ZNode queueNode = executorNode.createChild(znode().withPath("queue"));
executorNode.createChild(znode().withPath("result"));
log.debug("Created znodes for executor {}", executorNode.getPath());
queueNode.addChildrenWatcher(new Watcher() {
@Override
public void process(WatchedEvent event) {
if (event.getType() != Event.EventType.NodeChildrenChanged) {
return;
}
synchronized (lock) {
if (log.isDebugEnabled()) {
log.debug("Children changed {} event type {}", queueNode.getPath(), event.getType());
}
List<QueueEntry<C, R>> entries = getEntries(queueNode, this);
for (final QueueEntry<C, R> entry : entries) {
Runnable run = new Runnable() {
@Override
public void run() {
executeCommand(executor, executorNode, entry, nodeContext);
}
};
ZookeeperCoordinator.this.executor.execute(run);
}
}
}
});
}
代码示例来源:origin: griddynamics/jagger
public void initialize() {
ZooKeeperFactory zooKeeperFactory = new ZooKeeperFactory();
zooKeeperFactory.setConnectString(endpoint);
zooKeeperFactory.setSessionTimeout(sessionTimeout);
log.info("Connect to {} endpoint with timeout {}", endpoint, sessionTimeout);
IZookeeper zooKeeper = null;
try {
zooKeeper = zooKeeperFactory.create();
zoo = new Zoo(zooKeeperFactory.create());
// TODO: timeout only 40000. svi.
if (zoo.root().hasChild(rootNode)) {
log.info("ZNode [" + rootNode + "] was found.");
zoo.root().child(rootNode).removeWithChildren();
log.info("ZNode [" + rootNode + "] with children nodes were removed.");
}
zoo.root().createChild(znode().withPath(rootNode));
log.info("ZNode [" + rootNode + "] was created.");
} finally {
if (zooKeeper != null) {
try {
zooKeeper.close();
} catch (InterruptedException e) {
// do nothing
}
}
}
}
本文整理了Java中com.griddynamics.jagger.coordinator.zookeeper.ZNode类的一些代码示例,展示了ZNode类的具体用法。这些代码示例主要来源于Gith
本文整理了Java中com.griddynamics.jagger.coordinator.zookeeper.ZNodeParameters类的一些代码示例,展示了ZNodeParameters类的
本文整理了Java中com.griddynamics.jagger.coordinator.zookeeper.ZNodeParameters.withPath()方法的一些代码示例,展示了ZNode
本文整理了Java中com.griddynamics.jagger.coordinator.zookeeper.ZNode.child()方法的一些代码示例,展示了ZNode.child()的具体用法
本文整理了Java中com.griddynamics.jagger.coordinator.zookeeper.ZNode.removeWithChildren()方法的一些代码示例,展示了ZNode
本文整理了Java中com.griddynamics.jagger.coordinator.zookeeper.ZNode.hasChild()方法的一些代码示例,展示了ZNode.hasChild(
本文整理了Java中com.griddynamics.jagger.coordinator.zookeeper.ZNode.createChild()方法的一些代码示例,展示了ZNode.create
我是一名优秀的程序员,十分优秀!