/** * @return default UFS configuration */ public static UnderFileSystemConfiguration defaults() { return new UnderFileSystemConfiguration(ConfigurationUtils.defaults()); }
/** * Console program that validates the configuration. * * @param args there are no arguments needed */ public static void main(String[] args) { LOG.info("Validating configuration."); try { new InstancedConfiguration(ConfigurationUtils.defaults()).validate(); LOG.info("Configuration is valid."); } catch (IllegalStateException e) { LOG.error("Configuration is invalid: {}", e.getMessage()); System.exit(-1); } System.exit(0); }
/** * Sets or gets log level of master and worker through their REST API. * * @param args same arguments as {@link LogLevel} */ public static void main(String[] args) { int exitCode = 1; try { logLevel(args, new InstancedConfiguration(ConfigurationUtils.defaults())); exitCode = 0; } catch (ParseException e) { printHelp("Unable to parse input args: " + e.getMessage()); } catch (IOException e) { e.printStackTrace(); System.err.println(String.format("Failed to set log level: %s", e.getMessage())); } System.exit(exitCode); }
/** * Resets the {@link AlluxioConfiguration} back the defaults and values from * alluxio-site properties. */ public static void reset() { ConfigurationUtils.reloadProperties(); sConf = new InstancedConfiguration(ConfigurationUtils.defaults()); }
protected AbstractFileSystemCommand(@Nullable FileSystemContext fsContext) { if (fsContext == null) { fsContext = FileSystemContext.create(new InstancedConfiguration(ConfigurationUtils.defaults())); } mFsContext = fsContext; mFileSystem = FileSystem.Factory.get(fsContext); }
/** * Prints Alluxio configuration. * * @param args the arguments to specify the unit (optional) and configuration key (optional) */ public static void main(String[] args) { System.exit(getConf( ClientContext.create(new InstancedConfiguration(ConfigurationUtils.defaults())), args)); }
/** * 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()); HealthCheckClient client = new MasterHealthCheckClient.Builder(alluxioConf).build(); if (!client.isServing()) { System.exit(1); } System.exit(0); }
private ClientContext(@Nullable Subject subject, @Nullable AlluxioConfiguration alluxioConf) { if (subject != null) { mSubject = subject; } else { mSubject = new Subject(); } // Copy the properties so that future modification doesn't affect this ClientContext. if (alluxioConf != null) { mConf = new InstancedConfiguration(alluxioConf.copyProperties(), alluxioConf.clusterDefaultsLoaded()); } else { mConf = new InstancedConfiguration(ConfigurationUtils.defaults()); } }
/** * Example program for using checkpoints. * Usage: {@code java -cp <ALLUXIO-VERSION> alluxio.examples.BasicCheckpoint <FileFolder> <Files>} * * @param args the folder for the files and the files to use */ public static void main(String[] args) throws IOException { if (args.length != 2) { System.out.println("java -cp " + RuntimeConstants.ALLUXIO_JAR + " alluxio.examples.BasicCheckpoint <FileFolder> <Files>"); System.exit(-1); } FileSystemContext fsContext = FileSystemContext.create(new InstancedConfiguration(ConfigurationUtils.defaults())); boolean result = CliUtils.runExample(new BasicCheckpoint(args[0], Integer.parseInt(args[1]), fsContext)); System.exit(result ? 0 : 1); } }
/** * Return an instanced configuration with default value from the site properties file. * @return the default configuration */ public static InstancedConfiguration defaults() { return new InstancedConfiguration(ConfigurationUtils.defaults()); }
/** * Tool for running an operation multiple times. * * @param args command-line arguments */ public static void main(String[] args) { System.exit(new RunOperation(new InstancedConfiguration(ConfigurationUtils.defaults())) .run(args)); }
/** * Manage Alluxio file system. * * @param args array of arguments given by the user's input from the terminal */ public static void main(String[] args) { InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults()); if (!ConfigurationUtils.masterHostConfigured(conf) && args.length > 0) { System.out.println("Cannot run alluxio fsadmin shell as master hostname is not configured."); 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); FileSystemAdminShell fsAdminShell = new FileSystemAdminShell(conf); System.exit(fsAdminShell.run(args)); }
@Before public void before() { mConfiguration = new InstancedConfiguration(ConfigurationUtils.defaults()); }
@Before public void before() { mConfiguration = new InstancedConfiguration(ConfigurationUtils.defaults()); }
@Before public void before() { mConfiguration = new InstancedConfiguration(ConfigurationUtils.defaults()); }
@Before public void before() { mConfiguration = new InstancedConfiguration(ConfigurationUtils.defaults()); }
@Before public void before() { mConfiguration = new InstancedConfiguration(ConfigurationUtils.defaults()); }
/** * Main entry for this util class. * * @param args arguments for command line */ public static void main(String[] args) throws IOException { Collection<? extends PropertyKey> defaultKeys = PropertyKey.defaultKeys(); defaultKeys.removeIf(key -> key.isHidden()); String homeDir = new InstancedConfiguration(ConfigurationUtils.defaults()) .get(PropertyKey.HOME); // generate CSV files String filePath = PathUtils.concatPath(homeDir, CSV_FILE_DIR); writeCSVFile(defaultKeys, filePath); // generate YML files filePath = PathUtils.concatPath(homeDir, YML_FILE_DIR); writeYMLFile(defaultKeys, filePath); } }
protected BaseTestClient() { super(ClientContext.create(new InstancedConfiguration(ConfigurationUtils.defaults())), null, () -> new CountingRetry(1)); }
/** * Tests the {@link GroupMappingService#getGroups(String)} method. */ @Test public void group() throws Throwable { String userName = "alluxio-user1"; InstancedConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults()); try (Closeable mConfigurationRule = new ConfigurationRule(PropertyKey.SECURITY_GROUP_MAPPING_CLASS, IdentityUserGroupsMapping.class.getName(), conf).toResource()) { GroupMappingService groups = GroupMappingService.Factory.get(conf); assertNotNull(groups); assertNotNull(groups.getGroups(userName)); assertEquals(groups.getGroups(userName).size(), 1); assertEquals(groups.getGroups(userName).get(0), userName); } } }