Search in sources :

Example 76 with InstancedConfiguration

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;
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) HashMap(java.util.HashMap) ByteString(com.google.protobuf.ByteString) HubSslContextProvider(alluxio.hub.common.HubSslContextProvider)

Example 77 with InstancedConfiguration

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;
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration)

Example 78 with InstancedConfiguration

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());
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) ExponentialBackoffRetry(alluxio.retry.ExponentialBackoffRetry) HubNodeStatus(alluxio.hub.proto.HubNodeStatus) RetryPolicy(alluxio.retry.RetryPolicy) Test(org.junit.Test) BaseHubTest(alluxio.hub.test.BaseHubTest)

Example 79 with InstancedConfiguration

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));
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) BaseHubTest(alluxio.hub.test.BaseHubTest) Test(org.junit.Test)

Example 80 with InstancedConfiguration

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;
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration)

Aggregations

InstancedConfiguration (alluxio.conf.InstancedConfiguration)94 Test (org.junit.Test)35 AlluxioConfiguration (alluxio.conf.AlluxioConfiguration)16 AlluxioURI (alluxio.AlluxioURI)14 AlluxioProperties (alluxio.conf.AlluxioProperties)11 ArrayList (java.util.ArrayList)11 IOException (java.io.IOException)10 HashMap (java.util.HashMap)9 BaseHubTest (alluxio.hub.test.BaseHubTest)8 InetSocketAddress (java.net.InetSocketAddress)8 FileSystemShell (alluxio.cli.fs.FileSystemShell)6 FileSystemContext (alluxio.client.file.FileSystemContext)6 HealthCheckClient (alluxio.HealthCheckClient)5 AbstractFileSystemShellTest (alluxio.client.cli.fs.AbstractFileSystemShellTest)5 FileSystemShellUtilsTest (alluxio.client.cli.fs.FileSystemShellUtilsTest)5 MasterInquireClient (alluxio.master.MasterInquireClient)5 Properties (java.util.Properties)5 ParseException (org.apache.commons.cli.ParseException)5 ClientContext (alluxio.ClientContext)4 FileSystem (alluxio.client.file.FileSystem)4