use of alluxio.conf.PropertyKey in project alluxio by Alluxio.
the class ConfigurationDocGeneratorTest method checkYMLFile.
@Test
public void checkYMLFile() throws Exception {
if (mFileType != TYPE.YML) {
return;
}
Collection<PropertyKey> defaultKeys = new ArrayList<>();
PropertyKey pKey = mTestConf.getFirst();
String description = pKey.getDescription();
defaultKeys.add(pKey);
ConfigurationDocGenerator.writeYMLFile(defaultKeys, mLocation);
String filePath = PathUtils.concatPath(mLocation, mTestConf.getSecond());
Path p = Paths.get(filePath);
assertTrue(Files.exists(p));
// assert file contents
List<String> keyDescription = Files.readAllLines(p, StandardCharsets.UTF_8);
String expected = pKey + ":\n '" + description.replace("'", "''") + "'";
checkFileContents(expected, keyDescription, mFileType);
}
use of alluxio.conf.PropertyKey in project alluxio by Alluxio.
the class ConfigurationDocGeneratorTest method checkCSVFile.
@Test
public void checkCSVFile() throws Exception {
if (mFileType != TYPE.CSV) {
return;
}
Collection<PropertyKey> defaultKeys = new ArrayList<>();
PropertyKey pKey = mTestConf.getFirst();
defaultKeys.add(pKey);
ConfigurationDocGenerator.writeCSVFile(defaultKeys, mLocation);
String filePath = PathUtils.concatPath(mLocation, mTestConf.getSecond());
Path p = Paths.get(filePath);
assertTrue(Files.exists(p));
// assert file contents
List<String> userFile = Files.readAllLines(p, StandardCharsets.UTF_8);
Object defaultValue = ServerConfiguration.get(pKey);
checkFileContents(String.format("%s,\"%s\"", pKey, defaultValue), userFile, mFileType);
}
use of alluxio.conf.PropertyKey in project alluxio by Alluxio.
the class GetConfTest method getConfByAlias.
@Test
public void getConfByAlias() {
PropertyKey testProperty = new PropertyKey.Builder("alluxio.test.property").setAlias(new String[] { "alluxio.test.property.alias" }).setDefaultValue("testValue").build();
ClientContext ctx = ClientContext.create(ServerConfiguration.global());
assertEquals(0, GetConf.getConf(ctx, "alluxio.test.property.alias"));
assertEquals("testValue\n", mOutputStream.toString());
mOutputStream.reset();
assertEquals(0, GetConf.getConf(ctx, "alluxio.test.property"));
assertEquals("testValue\n", mOutputStream.toString());
PropertyKey.unregister(testProperty);
}
use of alluxio.conf.PropertyKey in project alluxio by Alluxio.
the class LocalAlluxioClusterResource method start.
/**
* Explicitly starts the {@link LocalAlluxioCluster}.
*/
public void start() throws Exception {
AuthenticatedClientUser.remove();
// Create a new cluster.
mLocalAlluxioCluster = new LocalAlluxioCluster(mNumWorkers, mIncludeSecondary);
// Init configuration for integration test
mLocalAlluxioCluster.initConfiguration(mTestName);
// Overwrite the test configuration with test specific parameters
for (Entry<PropertyKey, Object> entry : mConfiguration.entrySet()) {
ServerConfiguration.set(entry.getKey(), entry.getValue());
}
ServerConfiguration.global().validate();
// Start the cluster
mLocalAlluxioCluster.start();
}
use of alluxio.conf.PropertyKey in project alluxio by Alluxio.
the class LocalAlluxioClusterResource method overrideConfiguration.
/**
* @param config the array of strings for the configuration values to override
*/
private void overrideConfiguration(String[] config) {
// Override the configuration parameters with any configuration params
for (int i = 0; i < config.length; i += 2) {
PropertyKey key = PropertyKey.fromString(config[i]);
mConfiguration.put(key, key.parseValue(config[i + 1]));
}
}
Aggregations