properties.sort(Comparator.comparing(ConfigProperty::getName)); for (ConfigProperty property : properties) { String value = ConfigurationUtils.valueAsString(property.getValue()); output.append(String.format("%s=%s", property.getName(), value)); if (cmd.hasOption(SOURCE_OPTION_NAME)) {
/** * Gets Web UI ServerConfiguration page data. * * @return the response object */ @GET @Path(WEBUI_CONFIG) @ReturnType("alluxio.wire.MasterWebUIConfiguration") public Response getWebUIConfiguration() { return RestUtils.call(() -> { MasterWebUIConfiguration response = new MasterWebUIConfiguration(); response.setWhitelist(mFileSystemMaster.getWhiteList()); TreeSet<Triple<String, String, String>> sortedProperties = new TreeSet<>(); Set<String> alluxioConfExcludes = Sets.newHashSet(PropertyKey.MASTER_WHITELIST.toString()); for (ConfigProperty configProperty : mMetaMaster .getConfiguration(GetConfigurationPOptions.newBuilder().setRawValue(true).build())) { String confName = configProperty.getName(); if (!alluxioConfExcludes.contains(confName)) { sortedProperties.add(new ImmutableTriple<>(confName, ConfigurationUtils.valueAsString(configProperty.getValue()), configProperty.getSource())); } } response.setConfiguration(sortedProperties); return response; }, ServerConfiguration.global()); }
private SortedSet<Triple<String, String, String>> getSortedProperties() { TreeSet<Triple<String, String, String>> rtn = new TreeSet<>(); Set<String> alluxioConfExcludes = Sets.newHashSet( PropertyKey.MASTER_WHITELIST.toString()); for (ConfigProperty configProperty : mMetaMaster.getConfiguration(GetConfigurationOptions.defaults().setRawValue(true))) { String confName = configProperty.getName(); if (!alluxioConfExcludes.contains(confName)) { rtn.add(new ImmutableTriple<>(confName, ConfigurationUtils.valueAsString(configProperty.getValue()), configProperty.getSource())); } } return rtn; } }