use of org.apache.curator.test.TestingServer 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");
}
}
use of org.apache.curator.test.TestingServer in project Gaffer by gchq.
the class AddElementsFromKafkaHandlerIT method before.
@BeforeEach
public void before() throws Exception {
bootstrapServers = "localhost:" + getOpenPort();
// Create zookeeper server
zkServer = new TestingServer(-1, createTemporaryDirectory("zkTmpDir"));
zkServer.start();
testFileSink = createTestFileSink();
// Create kafka server
kafkaServer = TestUtils.createServer(new KafkaConfig(serverProperties()), new MockTime());
MapStore.resetStaticMap();
}
use of org.apache.curator.test.TestingServer in project pinpoint by naver.
the class ZookeeperClusterTest method createZookeeperServer.
private static TestingServer createZookeeperServer(int port) throws Exception {
TestingServer mockZookeeperServer = new TestingServer(port);
mockZookeeperServer.start();
return mockZookeeperServer;
}
use of org.apache.curator.test.TestingServer in project flink by apache.
the class YARNHighAvailabilityITCase method setup.
@BeforeClass
public static void setup() throws Exception {
zkServer = new TestingServer();
storageDir = FOLDER.newFolder().getAbsolutePath();
// startYARNWithConfig should be implemented by subclass
YARN_CONFIGURATION.setClass(YarnConfiguration.RM_SCHEDULER, CapacityScheduler.class, ResourceScheduler.class);
YARN_CONFIGURATION.set(YarnTestBase.TEST_CLUSTER_NAME_KEY, LOG_DIR);
YARN_CONFIGURATION.setInt(YarnConfiguration.NM_PMEM_MB, 4096);
startYARNWithConfig(YARN_CONFIGURATION);
}
use of org.apache.curator.test.TestingServer in project flink by apache.
the class ResumeCheckpointManuallyITCase method testExternalizedIncrementalRocksDBCheckpointsZookeeper.
@Test
public void testExternalizedIncrementalRocksDBCheckpointsZookeeper() throws Exception {
TestingServer zkServer = new TestingServer();
zkServer.start();
try {
final File checkpointDir = temporaryFolder.newFolder();
testExternalizedCheckpoints(checkpointDir, zkServer.getConnectString(), createRocksDBStateBackend(checkpointDir, true), false);
} finally {
zkServer.stop();
}
}
Aggregations