use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class AlluxioMasterMonitor method main.
/**
* Starts the Alluxio master monitor.
*
* @param args command line arguments, should be empty
*/
public static void main(String[] args) {
if (args.length != 0) {
LOG.warn("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioMasterMonitor.class.getCanonicalName());
LOG.warn("ignoring arguments");
}
AlluxioConfiguration alluxioConf = new InstancedConfiguration(ConfigurationUtils.defaults());
MasterHealthCheckClient.Builder builder = new MasterHealthCheckClient.Builder(alluxioConf);
if (ConfigurationUtils.isHaMode(alluxioConf)) {
builder.withProcessCheck(true);
} else {
builder.withProcessCheck(false);
}
HealthCheckClient client = builder.build();
if (!client.isServing()) {
System.exit(1);
}
System.exit(0);
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class AlluxioJobMasterMonitor method main.
/**
* Starts the Alluxio job_master monitor.
*
* @param args command line arguments, should be empty
*/
public static void main(String[] args) {
if (args.length != 0) {
LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioJobMasterMonitor.class.getCanonicalName());
LOG.warn("ignoring arguments");
}
AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults());
HealthCheckClient client;
// checking for the running process.
if (ConfigurationUtils.isHaMode(conf)) {
client = new MasterHealthCheckClient.Builder(conf).withAlluxioMasterType(MasterHealthCheckClient.MasterType.JOB_MASTER).build();
} else {
client = new JobMasterRpcHealthCheckClient(NetworkAddressUtils.getConnectAddress(NetworkAddressUtils.ServiceType.JOB_MASTER_RPC, conf), AlluxioMasterMonitor.TWO_MIN_EXP_BACKOFF, conf);
}
if (!client.isServing()) {
System.exit(1);
}
System.exit(0);
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class FileSystemAdminShell method main.
/**
* Manage Alluxio file system.
*
* @param args array of arguments given by the user's input from the terminal
*/
public static void main(String[] args) throws IOException {
int ret;
InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults());
if (!ConfigurationUtils.masterHostConfigured(conf) && args.length > 0) {
System.out.println(ConfigurationUtils.getMasterHostNotConfiguredMessage("Alluxio fsadmin shell"));
System.exit(1);
}
// Reduce the RPC retry max duration to fall earlier for CLIs
conf.set(PropertyKey.USER_RPC_RETRY_MAX_DURATION, "5s", Source.DEFAULT);
try (FileSystemAdminShell fsAdminShell = new FileSystemAdminShell(conf)) {
ret = fsAdminShell.run(args);
}
System.exit(ret);
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class JobServiceMaxThroughput method runSuite.
@Override
public JobServiceMaxThroughputSummary runSuite(String[] args) throws Exception {
try (JobMasterClient client = JobMasterClient.Factory.create(JobMasterClientContext.newBuilder(ClientContext.create(new InstancedConfiguration(ConfigurationUtils.defaults()))).build())) {
mNumWorkers = client.getAllWorkerHealth().size();
}
if (mNumWorkers <= 0) {
throw new IllegalStateException("No workers available for testing!");
}
JobServiceMaxThroughputSummary summary = new JobServiceMaxThroughputSummary();
summary.setParameters(mParameters);
List<String> baseArgs = new ArrayList<>(Arrays.asList(args));
int best = getBestThroughput(mParameters.mTargetThroughput, summary, baseArgs, mNumWorkers);
LOG.info("max throughput: " + best);
summary.setEndTimeMs(CommonUtils.getCurrentMs());
summary.setMaxThroughput(best);
return summary;
}
use of alluxio.conf.InstancedConfiguration in project alluxio by Alluxio.
the class CpCommandIntegrationTest method copyFileWithPreservedAttributes.
/**
* Tests copying a file with attributes preserved.
*/
@Test
public void copyFileWithPreservedAttributes() throws Exception {
InstancedConfiguration conf = new InstancedConfiguration(ServerConfiguration.global());
// avoid chown on UFS since test might not be run with root
conf.set(PropertyKey.USER_FILE_WRITE_TYPE_DEFAULT, "MUST_CACHE");
try (FileSystemShell fsShell = new FileSystemShell(conf)) {
String testDir = FileSystemShellUtilsTest.resetFileHierarchy(sFileSystem);
AlluxioURI srcFile = new AlluxioURI(testDir + "/foobar4");
String owner = TEST_USER_1.getUser();
String group = "staff";
short mode = 0422;
List<AclEntry> entries = new ArrayList<>();
entries.add(new AclEntry.Builder().setType(AclEntryType.NAMED_USER).setSubject(TEST_USER_2.getUser()).addAction(AclAction.READ).addAction(AclAction.WRITE).addAction(AclAction.EXECUTE).build());
entries.add(new AclEntry.Builder().setType(AclEntryType.NAMED_GROUP).setSubject(group).addAction(AclAction.WRITE).addAction(AclAction.EXECUTE).build());
sFileSystem.setAttribute(srcFile, SetAttributePOptions.newBuilder().setOwner(owner).setGroup(group).setMode(new Mode(mode).toProto()).setPinned(true).setReplicationMin(2).setReplicationMax(4).setCommonOptions(FileSystemMasterCommonPOptions.newBuilder().setTtl(12345)).build());
sFileSystem.setAcl(srcFile, SetAclAction.MODIFY, entries);
int ret = fsShell.run("cp", "-p", testDir + "/foobar4", testDir + "/bar");
AlluxioURI dstFile = new AlluxioURI(testDir + "/bar/foobar4");
Assert.assertEquals(0, ret);
Assert.assertTrue(sFileSystem.exists(dstFile));
verifyPreservedAttributes(srcFile, dstFile);
}
}
Aggregations