use of io.trino.plugin.hive.authentication.HdfsAuthenticationConfig in project trino by trinodb.
the class TestRubixCaching method testCoordinatorNotJoining.
@Test
public void testCoordinatorNotJoining() {
RubixConfig rubixConfig = new RubixConfig().setCacheLocation("/tmp/not/existing/dir");
HdfsConfigurationInitializer configurationInitializer = new HdfsConfigurationInitializer(config, ImmutableSet.of());
InternalNode workerNode = new InternalNode("worker", URI.create("http://127.0.0.2:8080"), UNKNOWN, false);
RubixInitializer rubixInitializer = new RubixInitializer(retry().maxAttempts(1), rubixConfig.setStartServerOnCoordinator(true), new TestingNodeManager(ImmutableList.of(workerNode)), new CatalogName("catalog"), configurationInitializer, new DefaultRubixHdfsInitializer(new HdfsAuthenticationConfig()));
assertThatThrownBy(rubixInitializer::initializeRubix).hasMessage("No coordinator node available");
}
use of io.trino.plugin.hive.authentication.HdfsAuthenticationConfig in project trino by trinodb.
the class TestRubixCaching method initializeRubix.
private void initializeRubix(RubixConfig rubixConfig, List<Node> nodes) throws Exception {
tempDirectory = createTempDirectory(getClass().getSimpleName());
// create cache directories
List<java.nio.file.Path> cacheDirectories = ImmutableList.of(tempDirectory.resolve("cache1"), tempDirectory.resolve("cache2"));
for (java.nio.file.Path directory : cacheDirectories) {
createDirectories(directory);
}
// initialize rubix in master-only mode
rubixConfig.setStartServerOnCoordinator(true);
rubixConfig.setCacheLocation(Joiner.on(",").join(cacheDirectories.stream().map(java.nio.file.Path::toString).collect(toImmutableList())));
HdfsConfigurationInitializer configurationInitializer = new HdfsConfigurationInitializer(config, ImmutableSet.of(// fetch data immediately in async mode
config -> setRemoteFetchProcessInterval(config, 0)));
TestingNodeManager nodeManager = new TestingNodeManager(nodes);
rubixInitializer = new RubixInitializer(rubixConfig, nodeManager, new CatalogName("catalog"), configurationInitializer, new DefaultRubixHdfsInitializer(new HdfsAuthenticationConfig()));
rubixConfigInitializer = new RubixConfigurationInitializer(rubixInitializer);
rubixInitializer.initializeRubix();
retry().run("wait for rubix to startup", () -> {
if (!rubixInitializer.isServerUp()) {
throw new IllegalStateException("Rubix server has not started");
}
return null;
});
}
Aggregations