- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.ignite.spi.discovery.zk.internal.ZookeeperClient.getChildren()
方法的一些代码示例,展示了ZookeeperClient.getChildren()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZookeeperClient.getChildren()
方法的具体详情如下:
包路径:org.apache.ignite.spi.discovery.zk.internal.ZookeeperClient
类名称:ZookeeperClient
方法名:getChildren
暂无
代码示例来源:origin: apache/ignite
/**
* Get children paths.
*
* @param path Path.
* @return Children paths.
* @throws ZookeeperClientFailedException If connection to zk was lost.
* @throws InterruptedException If interrupted.
*/
List<String> getChildrenPaths(String path) throws ZookeeperClientFailedException, InterruptedException {
List<String> children = getChildren(path);
ArrayList<String> paths = new ArrayList(children.size());
for (String child : children)
paths.add(path + "/" + child);
return paths;
}
代码示例来源:origin: apache/ignite
/**
* @param startInternalOrder Starting internal order for cluster (znodes having lower order belong
* to clients from previous cluster and should be removed).
* @throws Exception If failed.
*/
private void cleanupPreviousClusterData(long startInternalOrder) throws Exception {
long start = System.currentTimeMillis();
ZookeeperClient client = rtState.zkClient;
List<String> batch = new LinkedList<>();
List<String> evtChildren = client.getChildrenPaths(zkPaths.evtsPath);
for (String evtPath : evtChildren)
batch.addAll(client.getChildrenPaths(evtPath));
batch.addAll(evtChildren);
batch.addAll(client.getChildrenPaths(zkPaths.customEvtsDir));
batch.addAll(client.getChildrenPaths(zkPaths.customEvtsPartsDir));
batch.addAll(client.getChildrenPaths(zkPaths.customEvtsAcksDir));
client.deleteAll(batch, -1);
if (startInternalOrder > 0) {
for (String alive : client.getChildren(zkPaths.aliveNodesDir)) {
if (ZkIgnitePaths.aliveInternalId(alive) < startInternalOrder)
client.deleteIfExists(zkPaths.aliveNodesDir + "/" + alive, -1);
}
}
long time = System.currentTimeMillis() - start;
if (time > 0) {
if (log.isInfoEnabled())
log.info("Previous cluster data cleanup time: " + time);
}
}
代码示例来源:origin: apache/ignite
aliveNodes = rtState.zkClient.getChildren(zkPaths.aliveNodesDir);
代码示例来源:origin: apache/ignite
/**
* @param internalIds Nodes internal IDs.
* @throws Exception If failed.
*/
private void deleteAliveNodes(@Nullable GridLongList internalIds) throws Exception {
if (internalIds == null)
return;
List<String> alives = rtState.zkClient.getChildren(zkPaths.aliveNodesDir);
for (int i = 0; i < alives.size(); i++) {
String alive = alives.get(i);
if (internalIds.contains(ZkIgnitePaths.aliveInternalId(alive)))
rtState.zkClient.deleteIfExistsAsync(zkPaths.aliveNodesDir + "/" + alive);
}
}
代码示例来源:origin: apache/ignite
/**
* @param internalId Node internal ID.
* @throws Exception If failed.
*/
private void deleteAliveNode(long internalId) throws Exception {
for (String child : rtState.zkClient.getChildren(zkPaths.aliveNodesDir)) {
if (ZkIgnitePaths.aliveInternalId(child) == internalId) {
// Need use sync delete to do not process again join of this node again.
rtState.zkClient.deleteIfExists(zkPaths.aliveNodesDir + "/" + child, -1);
return;
}
}
}
代码示例来源:origin: apache/ignite
List<String> createdDirs = client.getChildren(zkPaths.clusterDir);
代码示例来源:origin: apache/ignite
/**
* @param nodeId Node ID.
* @return {@code True} if node joined or joining topology.
*/
public boolean knownNode(UUID nodeId) {
while (!busyLock.enterBusy())
checkState();
try {
List<String> children = rtState.zkClient.getChildren(zkPaths.aliveNodesDir);
for (int i = 0; i < children.size(); i++) {
UUID id = ZkIgnitePaths.aliveNodeId(children.get(i));
if (nodeId.equals(id))
return true;
}
return false;
}
catch (ZookeeperClientFailedException e) {
if (clientReconnectEnabled)
throw new IgniteClientDisconnectedException(null, "Client is disconnected.");
throw new IgniteException(e);
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IgniteInterruptedException(e);
}
finally {
busyLock.leaveBusy();
}
}
代码示例来源:origin: apache/ignite
/**
* @throws Exception If failed.
*/
@Test
public void testCreateAll() throws Exception {
startZK(1);
ZookeeperClient client = createClient(SES_TIMEOUT);
client.createIfNeeded("/apacheIgnite", null, CreateMode.PERSISTENT);
List<String> paths = new ArrayList<>();
paths.add("/apacheIgnite/1");
paths.add("/apacheIgnite/2");
paths.add("/apacheIgnite/3");
client.createAll(paths, CreateMode.PERSISTENT);
assertEquals(3, client.getChildren("/apacheIgnite").size());
}
代码示例来源:origin: apache/ignite
@Override protected void run0() throws Exception {
if (checkNodeAndState()) {
try {
for (String path : rtState.zkClient.getChildren(zkPaths.aliveNodesDir)) {
if (node.internalId() == ZkIgnitePaths.aliveInternalId(path)) {
onDone(true);
return;
}
}
onDone(false);
}
catch (Exception e) {
onDone(e);
throw e;
}
}
}
代码示例来源:origin: apache/ignite
/**
* @throws Exception If failed.
*/
@Test
public void testCreateAllNodeExists() throws Exception {
startZK(1);
ZookeeperClient client = createClient(SES_TIMEOUT);
client.createIfNeeded("/apacheIgnite", null, CreateMode.PERSISTENT);
client.createIfNeeded("/apacheIgnite/1", null, CreateMode.PERSISTENT);
List<String> paths = new ArrayList<>();
paths.add("/apacheIgnite/1");
paths.add("/apacheIgnite/2");
paths.add("/apacheIgnite/3");
client.createAll(paths, CreateMode.PERSISTENT);
assertEquals(3, client.getChildren("/apacheIgnite").size());
}
代码示例来源:origin: apache/ignite
/**
* @throws Exception If failed.
*/
@Test
public void testDeleteAll() throws Exception {
startZK(1);
ZookeeperClient client = createClient(SES_TIMEOUT);
client.createIfNeeded("/apacheIgnite", null, CreateMode.PERSISTENT);
client.createIfNeeded("/apacheIgnite/1", null, CreateMode.PERSISTENT);
client.createIfNeeded("/apacheIgnite/2", null, CreateMode.PERSISTENT);
client.deleteAll(Arrays.asList("/apacheIgnite/1", "/apacheIgnite/2"), -1);
assertTrue(client.getChildren("/apacheIgnite").isEmpty());
client.createIfNeeded("/apacheIgnite/1", null, CreateMode.PERSISTENT);
client.deleteAll(Collections.singletonList("/apacheIgnite/1"), -1);
assertTrue(client.getChildren("/apacheIgnite").isEmpty());
}
代码示例来源:origin: apache/ignite
/**
* @throws Exception If failed.
*/
@Test
public void testDeleteAllNoNode() throws Exception {
startZK(1);
ZookeeperClient client = createClient(SES_TIMEOUT);
client.createIfNeeded("/apacheIgnite", null, CreateMode.PERSISTENT);
client.createIfNeeded("/apacheIgnite/1", null, CreateMode.PERSISTENT);
client.createIfNeeded("/apacheIgnite/2", null, CreateMode.PERSISTENT);
client.deleteAll(Arrays.asList("/apacheIgnite/1", "/apacheIgnite/2", "/apacheIgnite/3"), -1);
assertTrue(client.getChildren("/apacheIgnite").isEmpty());
}
这就是我的代码中的全部内容。这只是使用 Ignite 的典型方式: Ignite ignite = Ignition.ignite(); 我看到的错误信息是: WARNING: An illegal
有时我会不断地对节点进行分段。它发生在一个大约有 40 个节点的集群中——它一次只发生在一个节点上。有几次它发生在正在进行一些繁重的 GC 工作时。另一方面,我看到类似的繁重的 GC 工作正在进行并且
我有 2 个服务器节点和一个客户端节点。我正在使用 TopologyValidator 来验证拓扑。 如果任何服务器节点离开集群,我想禁用所有操作。 TopologyValidator 仅禁用更新操作
我有一个用例,我必须为我的 ignite 集群支持多个持久性存储,例如缓存 A1 应该从数据库 db1 启动,缓存 B1 应该从数据库 db2 启动。这可以完成吗?。在 ignite 配置 XML 中
我对分区模式下的 Ignite Cache 有几个问题 1)当Ignite集群中的节点发生故障时,如果故障节点是某个 key 的主节点,那么该节点的备份是否会成为新的主节点? 2) 故障节点中的备份副
在页面 https://ignite.apache.org/features/datagrid.html我找到了以下信息: “与其他键值存储不同,Ignite 使用可插入哈希算法确定数据局部性。每个客
可以说我下面有一个对象Employee,它存储在ignite缓存中。 Employee{ int id; String name; List marksInorder;/
我正在尝试使用基于集群的执行器服务。 //获取启用集群的执行器服务。ExecutorService exec = ignite.executorService(); 是否有办法设置执行程序服务池中的线
我在 Linux 节点上的 Kubernetes 集群中运行 Apache Ignite .Net。 最近我将我的 ignite 2.8.1 集群更新到了 v2.9。更新后,作为集群一部分的某些服务无
我有一个 3 节点的 ignite 集群和 1 个创建缓存的客户端。在开发和测试过程中,我不得不多次停止集群或中断缓存构建,现在整个系统都崩溃了。只有一个节点启动,其他节点崩溃。客户端被阻止,它什么也
任何人都可以告诉我 Apache Ignite 中是否有可用的基于时间的触发策略? 我有一个对象在那个日期(时间戳)过期时有过期日期我想更新这个值并在缓存中覆盖它是否可以在 Apache Ignite
用例 这是我们正在研究的拓扑 Server - 1 --> marketData缓存,保存不同的股价信息 客户端 - 1 --> 将数据推送到缓存 Client - 2 --> 持续查询,监听市场上的
我无法理解 Apache Ignite 和 GridGain 平台之间的区别。他们是平等的?或者 GridGain 是 Apache Ignite 实现的标准? 最佳答案 来自 the website
我们正在探索在我们的项目中使用 Apache Ignite。基本上,我们有几十个 oracle 表。我们想将每个表加载到 Ignite Cache 中,然后在这些缓存之间进行连接。我们的表之间有很多连
我无法在 Quarkus 中找到 Apache Ignite 依赖项,也无法在任何有人将 Apache Ignite 与 Quarkus 结合使用的示例中找到它。如果 Quarkus 当前不支持 Ap
有没有人试过使用 IgniteSet 或类似的数据结构在连续查询上设置远程过滤器?没有太多关于 IgniteSet 如何工作的文档,因此这个问题。基本上我的用例如下: 我有一个使用 Ignite 实现
我在 Ignite 中创建了一个缓存,现在我正尝试通过 ignite 包中提供的 sqlline 查询它。在文档中,它只讨论创建表、索引、查询这些表等。但没有讨论以这种方式通过 ignite.getO
我编写了下面的代码来从 JSON 文件中读取数据并将其推送到 Ignite 分布式缓存中,这段代码工作正常,但是,创建“ContainerAgg”类的要求对我来说是个问题。我们的数据结构不是预定义的,
我正在寻找一种方法将具有给定键的所有实体从一个 Ignite 缓存复制到另一个。虽然不断获取新数据,但每 x 秒所有数据都必须复制到缓存 2。我尝试使用 EntryProcessor,因为我只需要就地
我们使用的是 Apache Ignite 2.9.0。它是一个带有 Zookeeper 发现的 5 节点集群。 我们通过从 Intellij 执行 DDL 语句在 Ignite 中创建表。然后我们可以
我是一名优秀的程序员,十分优秀!