use of alluxio.conf.AlluxioConfiguration in project alluxio by Alluxio.
the class ConfigurationUtilsTest method getJobMasterRpcAddressesDefault.
@Test
public void getJobMasterRpcAddressesDefault() {
AlluxioConfiguration conf = createConf(Collections.emptyMap());
String host = NetworkAddressUtils.getLocalHostName(5 * Constants.SECOND_MS);
assertEquals(Arrays.asList(InetSocketAddress.createUnresolved(host, 20001)), ConfigurationUtils.getJobMasterRpcAddresses(conf));
}
use of alluxio.conf.AlluxioConfiguration in project alluxio by Alluxio.
the class ConfigurationUtilsTest method getJobMasterRpcAddresses.
@Test
public void getJobMasterRpcAddresses() {
AlluxioConfiguration conf = createConf(ImmutableMap.of(PropertyKey.JOB_MASTER_RPC_ADDRESSES, "host1:99,host2:100"));
assertEquals(Arrays.asList(InetSocketAddress.createUnresolved("host1", 99), InetSocketAddress.createUnresolved("host2", 100)), ConfigurationUtils.getJobMasterRpcAddresses(conf));
}
use of alluxio.conf.AlluxioConfiguration in project alluxio by Alluxio.
the class ConfigurationUtilsTest method getJobMasterRpcAddressesMasterRpcFallback.
@Test
public void getJobMasterRpcAddressesMasterRpcFallback() {
AlluxioConfiguration conf = createConf(ImmutableMap.of(PropertyKey.MASTER_RPC_ADDRESSES, "host1:99,host2:100", PropertyKey.JOB_MASTER_RPC_PORT, "50"));
assertEquals(Arrays.asList(InetSocketAddress.createUnresolved("host1", 50), InetSocketAddress.createUnresolved("host2", 50)), ConfigurationUtils.getJobMasterRpcAddresses(conf));
}
use of alluxio.conf.AlluxioConfiguration in project alluxio by Alluxio.
the class ConfigurationUtilsTest method getMasterRpcAddressesDefault.
@Test
public void getMasterRpcAddressesDefault() {
AlluxioConfiguration conf = createConf(Collections.emptyMap());
String host = NetworkAddressUtils.getLocalHostName(5 * Constants.SECOND_MS);
assertEquals(Arrays.asList(InetSocketAddress.createUnresolved(host, 19998)), ConfigurationUtils.getMasterRpcAddresses(conf));
}
use of alluxio.conf.AlluxioConfiguration in project alluxio by Alluxio.
the class ValidateEnv method validate.
/**
* Validates environment.
*
* @param argv list of arguments
* @return 0 on success, -1 on validation failures, -2 on invalid arguments
*/
public static int validate(String... argv) throws InterruptedException {
if (argv.length < 1) {
printHelp("Target not specified.");
return -2;
}
String command = argv[0];
String name = null;
String[] args;
int argsLength = 0;
// Find all non-option command line arguments.
while (argsLength < argv.length && !argv[argsLength].startsWith("-")) {
argsLength++;
}
if (argsLength > 1) {
name = argv[1];
args = Arrays.copyOfRange(argv, 2, argv.length);
} else {
args = Arrays.copyOfRange(argv, 1, argv.length);
}
CommandLine cmd;
try {
cmd = parseArgsAndOptions(OPTIONS, args);
} catch (InvalidArgumentException e) {
System.err.format("Invalid argument: %s.%n", e.getMessage());
return -1;
}
if (command.equals("list")) {
// Validate against root path
AlluxioConfiguration conf = InstancedConfiguration.defaults();
String rootPath = conf.getString(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS);
ValidateEnv task = new ValidateEnv(rootPath, conf);
task.printTasks();
return 0;
}
return runTasks(command, name, cmd);
}
Aggregations