use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class ManagerProcessContext method getConfWithHubTlsEnabled.
private AlluxioConfiguration getConfWithHubTlsEnabled() {
InstancedConfiguration modifiedConfig = InstancedConfiguration.defaults();
Map<String, Object> properties = new HashMap<>(mConf.toMap());
properties.put(PropertyKey.NETWORK_TLS_ENABLED.getName(), mConf.get(PropertyKey.HUB_NETWORK_TLS_ENABLED));
properties.put(PropertyKey.NETWORK_TLS_SSL_CONTEXT_PROVIDER_CLASSNAME.getName(), HubSslContextProvider.class.getName());
modifiedConfig.merge(properties, Source.RUNTIME);
return modifiedConfig;
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class AgentProcessContextTest method getTestSpecificConfig.
public InstancedConfiguration getTestSpecificConfig() throws Exception {
InstancedConfiguration c = getTestConfig();
c.set(PropertyKey.HUB_AGENT_RPC_PORT, 5555);
c.set(PropertyKey.HUB_AGENT_HEARTBEAT_INTERVAL, "1s");
mTemp.newFolder("bin");
mTemp.newFile("bin/alluxio-start.sh");
c.set(PropertyKey.HOME, mTemp.getRoot().getAbsolutePath());
return c;
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class AgentProcessContextTest method testRegisterAgentSuccess.
@Test
public void testRegisterAgentSuccess() throws Exception {
assertEquals(0, mContext.getHubCluster().size());
InstancedConfiguration config = getTestSpecificConfig();
AgentProcessContext ctx = new AgentProcessContext(config, mClient);
RetryPolicy retry = new ExponentialBackoffRetry(5, 50, 10);
ctx.registerAgent(retry);
assertEquals(1, mContext.getHubCluster().size());
HubNodeStatus node = mContext.getHubCluster().toProto().getNode(0);
String host = NetworkAddressUtils.getConnectHost(NetworkAddressUtils.ServiceType.HUB_AGENT_RPC, config);
assertEquals(host, node.getNode().getHostname());
assertEquals(config.getInt(PropertyKey.HUB_AGENT_RPC_PORT), node.getNode().getRpcPort());
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class ManagerProcessContextTest method testClusterId.
@Test
public void testClusterId() throws Exception {
assertTrue(ManagerProcessContext.checkClusterId("abcd"));
assertTrue(ManagerProcessContext.checkClusterId("ab12"));
assertTrue(ManagerProcessContext.checkClusterId("1234"));
assertFalse(ManagerProcessContext.checkClusterId("ABCD"));
assertFalse(ManagerProcessContext.checkClusterId("abc!"));
assertFalse(ManagerProcessContext.checkClusterId("123A"));
assertFalse(ManagerProcessContext.checkClusterId("abcde"));
assertFalse(ManagerProcessContext.checkClusterId("!@#$"));
InstancedConfiguration conf = getTestConfig();
getTestManagerContext(conf);
// invalid cluster id throws exception
conf.set(PropertyKey.HUB_CLUSTER_ID, "abcde");
assertThrows(RuntimeException.class, () -> getTestManagerContext(conf));
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class BaseHubTest method getTestConfig.
protected static InstancedConfiguration getTestConfig() throws Exception {
InstancedConfiguration c = new InstancedConfiguration(ServerConfiguration.global().copyProperties());
c.set(PropertyKey.HUB_CLUSTER_ID, "0000");
c.set(PropertyKey.HUB_MANAGER_REGISTER_RETRY_TIME, "1sec");
c.set(PropertyKey.HUB_MANAGER_RPC_PORT, 0);
c.set(PropertyKey.HUB_MANAGER_EXECUTOR_THREADS_MIN, 0);
c.set(PropertyKey.HUB_AGENT_RPC_PORT, 0);
c.set(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.NOSASL.getAuthName());
c.set(PropertyKey.CONF_DIR, TEST_CONF_DIR.getRoot().getCanonicalPath());
c.set(PropertyKey.HUB_MANAGER_PRESTO_CONF_PATH, TEST_PRESTO_CONF_DIR.getRoot().getCanonicalPath());
return c;
}
Aggregations