use of alluxio.conf.PropertyKey in project alluxio by Alluxio.
the class ConfigurationRule method before.
@Override
public void before() {
for (Map.Entry<PropertyKey, Object> entry : mKeyValuePairs.entrySet()) {
PropertyKey key = entry.getKey();
Object value = entry.getValue();
if (mConfiguration.isSet(key)) {
mStashedProperties.put(key, mConfiguration.get(key));
} else {
mStashedProperties.put(key, null);
}
if (value != null) {
mConfiguration.set(key, value);
} else {
mConfiguration.unset(key);
}
}
}
use of alluxio.conf.PropertyKey in project alluxio by Alluxio.
the class UfsJournalConfTest method nonEmptyConfiguration.
@Test
public void nonEmptyConfiguration() throws Exception {
PropertyKey key = PropertyKey.Template.MASTER_JOURNAL_UFS_OPTION_PROPERTY.format(PropertyKey.UNDERFS_LISTING_LENGTH.toString());
String value = "10000";
ServerConfiguration.set(key, value);
UnderFileSystemConfiguration conf = UfsJournal.getJournalUfsConf();
Assert.assertEquals(value, conf.get(PropertyKey.UNDERFS_LISTING_LENGTH));
Assert.assertEquals(1, conf.getMountSpecificConf().size());
}
use of alluxio.conf.PropertyKey in project alluxio by Alluxio.
the class AddCommandIntegrationTest method nonClientScopeKey.
@Test
public void nonClientScopeKey() throws Exception {
try (FileSystemAdminShell shell = new FileSystemAdminShell(ServerConfiguration.global())) {
PropertyKey key = PropertyKey.NETWORK_CONNECTION_SERVER_SHUTDOWN_TIMEOUT;
int ret = shell.run("pathConf", "add", "--property", format(key, "10ms"), "/");
Assert.assertEquals(-1, ret);
String output = mOutput.toString();
Assert.assertEquals(AddCommand.nonClientScopePropertyException(key) + "\n", output);
}
}
use of alluxio.conf.PropertyKey in project alluxio by Alluxio.
the class S3AUnderFileSystemTest method createCredentialsFromConf.
@Test
public void createCredentialsFromConf() throws Exception {
Map<PropertyKey, Object> conf = new HashMap<>();
conf.put(PropertyKey.S3A_ACCESS_KEY, "key1");
conf.put(PropertyKey.S3A_SECRET_KEY, "key2");
try (Closeable c = new ConfigurationRule(conf, sConf).toResource()) {
UnderFileSystemConfiguration ufsConf = UnderFileSystemConfiguration.defaults(sConf);
AWSCredentialsProvider credentialsProvider = S3AUnderFileSystem.createAwsCredentialsProvider(ufsConf);
Assert.assertEquals("key1", credentialsProvider.getCredentials().getAWSAccessKeyId());
Assert.assertEquals("key2", credentialsProvider.getCredentials().getAWSSecretKey());
Assert.assertTrue(credentialsProvider instanceof AWSStaticCredentialsProvider);
}
}
use of alluxio.conf.PropertyKey in project alluxio by Alluxio.
the class S3AUnderFileSystemTest method createCredentialsFromDefault.
@Test
public void createCredentialsFromDefault() throws Exception {
// Unset AWS properties if present
Map<PropertyKey, Object> conf = new HashMap<>();
conf.put(PropertyKey.S3A_ACCESS_KEY, null);
conf.put(PropertyKey.S3A_SECRET_KEY, null);
try (Closeable c = new ConfigurationRule(conf, sConf).toResource()) {
UnderFileSystemConfiguration ufsConf = UnderFileSystemConfiguration.defaults(sConf);
AWSCredentialsProvider credentialsProvider = S3AUnderFileSystem.createAwsCredentialsProvider(ufsConf);
Assert.assertTrue(credentialsProvider instanceof DefaultAWSCredentialsProviderChain);
}
}
Aggregations