Search in sources :

Example 46 with AlluxioConfiguration

use of alluxio.conf.AlluxioConfiguration in project alluxio by Alluxio.

the class SwiftUnderFileSystemFactoryTest method factory.

/**
 * This test ensures the Swift UFS module correctly accepts paths that begin with swift://.
 */
@Test
public void factory() {
    AlluxioConfiguration conf = ConfigurationTestUtils.defaults();
    UnderFileSystemFactory factory = UnderFileSystemFactoryRegistry.find("swift://localhost/test/path", conf);
    UnderFileSystemFactory factory2 = UnderFileSystemFactoryRegistry.find("file://localhost/test/path", conf);
    Assert.assertNotNull("A UnderFileSystemFactory should exist for swift paths when using this " + "module", factory);
    Assert.assertNull("A UnderFileSystemFactory should not exist for non supported paths when " + "using this module", factory2);
}
Also used : AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) UnderFileSystemFactory(alluxio.underfs.UnderFileSystemFactory) Test(org.junit.Test)

Example 47 with AlluxioConfiguration

use of alluxio.conf.AlluxioConfiguration in project alluxio by Alluxio.

the class ManagerProcessContext method getHostedAsyncStub.

private HostedManagerServiceGrpc.HostedManagerServiceStub getHostedAsyncStub() {
    AlluxioConfiguration modifiedConfig = getConfWithHubTlsEnabled();
    LOG.debug("Connecting to hosted hub with TLS enabled={}", modifiedConfig.getBoolean(PropertyKey.NETWORK_TLS_ENABLED));
    if (mHostedAsyncSub == null) {
        InetSocketAddress addr = NetworkAddressUtils.getConnectAddress(NetworkAddressUtils.ServiceType.HUB_HOSTED_RPC, modifiedConfig);
        try {
            GrpcChannel channel = RpcClient.createChannel(addr, modifiedConfig);
            channel.intercept(new HubAuthenticationInterceptor(HubAuthentication.newBuilder().setApiKey(modifiedConfig.getString(PropertyKey.HUB_AUTHENTICATION_API_KEY)).setSecretKey(modifiedConfig.getString(PropertyKey.HUB_AUTHENTICATION_SECRET_KEY)).build()));
            mHostedAsyncSub = HostedManagerServiceGrpc.newStub(channel);
        } catch (AlluxioStatusException e) {
            LOG.error("Error connecting to hosted hub {}", e);
        }
    }
    return mHostedAsyncSub;
}
Also used : InetSocketAddress(java.net.InetSocketAddress) AlluxioStatusException(alluxio.exception.status.AlluxioStatusException) HubAuthenticationInterceptor(alluxio.hub.manager.rpc.interceptor.HubAuthenticationInterceptor) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) GrpcChannel(alluxio.grpc.GrpcChannel)

Example 48 with AlluxioConfiguration

use of alluxio.conf.AlluxioConfiguration in project alluxio by Alluxio.

the class AgentRpcServerTest method testAwaitTermination.

@Test
public void testAwaitTermination() throws Exception {
    AlluxioConfiguration conf = getTestSpecificTestConfig();
    AgentProcessContext ctx = TestAgentProcessContextFactory.simpleContext(conf);
    AgentRpcServer server = new AgentRpcServer(conf, ctx);
    // shut down server once started.
    Thread t = new Thread(server::close);
    assertTrue(server.isServing());
    t.start();
    server.awaitTermination();
    t.join();
    assertFalse(server.isServing());
}
Also used : AgentProcessContext(alluxio.hub.agent.process.AgentProcessContext) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) Test(org.junit.Test) BaseHubTest(alluxio.hub.test.BaseHubTest)

Example 49 with AlluxioConfiguration

use of alluxio.conf.AlluxioConfiguration in project alluxio by Alluxio.

the class AdlUnderFileSystemFactoryTest method factory.

/**
 * Tests the
 * {@link UnderFileSystemFactoryRegistry#find(String, alluxio.conf.AlluxioConfiguration)} method.
 */
@Test
public void factory() {
    AlluxioConfiguration conf = ConfigurationTestUtils.defaults();
    UnderFileSystemFactory factory = UnderFileSystemFactoryRegistry.find("adl://localhost/test/path", conf);
    Assert.assertNotNull("A UnderFileSystemFactory should exist for adl paths when using this module", factory);
    factory = UnderFileSystemFactoryRegistry.find("adl://localhost/test/path", conf);
    Assert.assertNotNull("A UnderFileSystemFactory should exist for adl paths when using this module", factory);
    factory = UnderFileSystemFactoryRegistry.find("alluxio://localhost/test/path", conf);
    Assert.assertNull("A UnderFileSystemFactory should not exist for unsupported paths when using" + " this module.", factory);
}
Also used : AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) UnderFileSystemFactory(alluxio.underfs.UnderFileSystemFactory) Test(org.junit.Test)

Example 50 with AlluxioConfiguration

use of alluxio.conf.AlluxioConfiguration in project alluxio by Alluxio.

the class CosNUnderFileSystemFactoryTest method factory.

/**
 * Tests that the COSN UFS module correctly accepts paths that begin with cosn://.
 */
@Test
public void factory() {
    AlluxioConfiguration conf = ConfigurationTestUtils.defaults();
    UnderFileSystemFactory factory = UnderFileSystemFactoryRegistry.find("cosn://test-bucket/path", conf);
    Assert.assertNotNull("A UnderFileSystemFactory should exist for cosn paths when using this module", factory);
}
Also used : AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) UnderFileSystemFactory(alluxio.underfs.UnderFileSystemFactory) Test(org.junit.Test)

Aggregations

AlluxioConfiguration (alluxio.conf.AlluxioConfiguration)62 Test (org.junit.Test)20 InstancedConfiguration (alluxio.conf.InstancedConfiguration)17 IOException (java.io.IOException)11 AlluxioURI (alluxio.AlluxioURI)7 UnderFileSystemFactory (alluxio.underfs.UnderFileSystemFactory)7 ArrayList (java.util.ArrayList)7 AlluxioProperties (alluxio.conf.AlluxioProperties)5 PropertyKey (alluxio.conf.PropertyKey)5 OpenFilePOptions (alluxio.grpc.OpenFilePOptions)5 HealthCheckClient (alluxio.HealthCheckClient)4 FileSystemContext (alluxio.client.file.FileSystemContext)4 InStreamOptions (alluxio.client.file.options.InStreamOptions)4 InetSocketAddress (java.net.InetSocketAddress)4 Constants (alluxio.Constants)3 AlluxioBlockStore (alluxio.client.block.AlluxioBlockStore)3 FileSystem (alluxio.client.file.FileSystem)3 URIStatus (alluxio.client.file.URIStatus)3 ReadRequest (alluxio.grpc.ReadRequest)3 InputStream (java.io.InputStream)3