Search in sources :

Example 31 with AlluxioConfiguration

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

the class AbfsUnderFileSystemFactoryTest method factory.

/**
 * Tests the
 * {@link UnderFileSystemFactoryRegistry#find(String, alluxio.conf.AlluxioConfiguration)} method.
 */
@Test
public void factory() {
    AlluxioConfiguration conf = ConfigurationTestUtils.defaults();
    UnderFileSystemFactory factory = UnderFileSystemFactoryRegistry.find("abfs://localhost/test/path", conf);
    Assert.assertNotNull("A UnderFileSystemFactory should exist for abfs paths when using this module", factory);
    factory = UnderFileSystemFactoryRegistry.find("abfss://localhost/test/path", conf);
    Assert.assertNotNull("A UnderFileSystemFactory should exist for abfss 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 32 with AlluxioConfiguration

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

the class WebUnderFileSystemFactoryTest method factory.

/**
 * This test ensures the web UFS module correctly accepts paths that begin with / or file://.
 */
@Test
public void factory() {
    AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults());
    UnderFileSystemFactory factory = UnderFileSystemFactoryRegistry.find("https://downloads.alluxio.io/downloads/files/2.0.0-preview/", conf);
    UnderFileSystemFactory factory2 = UnderFileSystemFactoryRegistry.find("http://downloads.alluxio.org/", conf);
    UnderFileSystemFactory factory3 = UnderFileSystemFactoryRegistry.find("httpx://path", conf);
    Assert.assertNotNull("A UnderFileSystemFactory should exist for http paths when using this module", factory);
    Assert.assertNotNull("A UnderFileSystemFactory should exist for http paths when using this module", factory2);
    Assert.assertNull("A UnderFileSystemFactory should not exist for non http paths when using this module", factory3);
}
Also used : InstancedConfiguration(alluxio.conf.InstancedConfiguration) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) UnderFileSystemFactory(alluxio.underfs.UnderFileSystemFactory) Test(org.junit.Test)

Example 33 with AlluxioConfiguration

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

the class WasbUnderFileSystemFactoryTest method factory.

/**
 * Tests the
 * {@link UnderFileSystemFactoryRegistry#find(String, alluxio.conf.AlluxioConfiguration)} method.
 */
@Test
public void factory() {
    AlluxioConfiguration conf = ConfigurationTestUtils.defaults();
    UnderFileSystemFactory factory = UnderFileSystemFactoryRegistry.find("wasb://localhost/test/path", conf);
    Assert.assertNotNull("A UnderFileSystemFactory should exist for wasb paths when using this module", factory);
    factory = UnderFileSystemFactoryRegistry.find("wasbs://localhost/test/path", conf);
    Assert.assertNotNull("A UnderFileSystemFactory should exist for wasbs 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 34 with AlluxioConfiguration

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

the class ConfigurationUtilsTest method getMasterRpcAddressesFallback.

@Test
public void getMasterRpcAddressesFallback() {
    AlluxioConfiguration conf = createConf(ImmutableMap.of(PropertyKey.MASTER_EMBEDDED_JOURNAL_ADDRESSES, "host1:99,host2:100", PropertyKey.MASTER_RPC_PORT, "50"));
    assertEquals(Arrays.asList(InetSocketAddress.createUnresolved("host1", 50), InetSocketAddress.createUnresolved("host2", 50)), ConfigurationUtils.getMasterRpcAddresses(conf));
}
Also used : AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) Test(org.junit.Test)

Example 35 with AlluxioConfiguration

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

the class ConfigurationUtilsTest method getSingleMasterRpcAddress.

@Test
public void getSingleMasterRpcAddress() {
    AlluxioConfiguration conf = createConf(ImmutableMap.of(PropertyKey.MASTER_HOSTNAME, "testhost", PropertyKey.MASTER_RPC_PORT, "1000"));
    assertEquals(Arrays.asList(InetSocketAddress.createUnresolved("testhost", 1000)), ConfigurationUtils.getMasterRpcAddresses(conf));
}
Also used : AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) 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