use of org.apache.storm.shade.org.apache.curator.retry.ExponentialBackoffRetry in project storm by apache.
the class LocalFsBlobStoreSynchronizerTest method testNimbodesWithLatestVersionOfBlob.
@Test
public void testNimbodesWithLatestVersionOfBlob() throws Exception {
try (TestingServer server = new TestingServer();
CuratorFramework zkClient = CuratorFrameworkFactory.newClient(server.getConnectString(), new ExponentialBackoffRetry(1000, 3))) {
zkClient.start();
// Creating nimbus hosts containing latest version of blob
zkClient.create().creatingParentContainersIfNeeded().forPath("/blobstore/key1/nimbus1:7800-1");
zkClient.create().creatingParentContainersIfNeeded().forPath("/blobstore/key1/nimbus2:7800-2");
Set<NimbusInfo> set = BlobStoreUtils.getNimbodesWithLatestSequenceNumberOfBlob(zkClient, "key1");
assertEquals("Failed to get the correct nimbus hosts with latest blob version", (set.iterator().next()).getHost(), "nimbus2");
zkClient.delete().deletingChildrenIfNeeded().forPath("/blobstore/key1/nimbus1:7800-1");
zkClient.delete().deletingChildrenIfNeeded().forPath("/blobstore/key1/nimbus2:7800-2");
}
}
Aggregations