use of alluxio.conf.ConfigurationValueOptions in project alluxio by Alluxio.
the class ConfigurationUtils method getConfiguration.
/**
* Gets all configuration properties filtered by the specified scope.
*
* @param conf the configuration to use
* @param scope the scope to filter by
* @return the properties
*/
public static List<ConfigProperty> getConfiguration(AlluxioConfiguration conf, Scope scope) {
ConfigurationValueOptions useRawDisplayValue = ConfigurationValueOptions.defaults().useDisplayValue(true);
List<ConfigProperty> configs = new ArrayList<>();
List<PropertyKey> selectedKeys = conf.keySet().stream().filter(key -> GrpcUtils.contains(key.getScope(), scope)).filter(key -> key.isValid(key.getName())).collect(toList());
for (PropertyKey key : selectedKeys) {
ConfigProperty.Builder configProp = ConfigProperty.newBuilder().setName(key.getName()).setSource(conf.getSource(key).toString());
if (conf.isSet(key)) {
configProp.setValue(String.valueOf(conf.get(key, useRawDisplayValue)));
}
configs.add(configProp.build());
}
return configs;
}
Aggregations