Search in sources :

Example 1 with MasterWebUIConfiguration

use of alluxio.wire.MasterWebUIConfiguration in project alluxio by Alluxio.

the class AlluxioMasterRestServiceHandler method getWebUIConfiguration.

/**
 * Gets Web UI ServerConfiguration page data.
 *
 * @return the response object
 */
@GET
@Path(WEBUI_CONFIG)
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()).toProto().getClusterConfigsList()) {
            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());
}
Also used : Triple(org.apache.commons.lang3.tuple.Triple) ImmutableTriple(org.apache.commons.lang3.tuple.ImmutableTriple) TreeSet(java.util.TreeSet) ConfigProperty(alluxio.grpc.ConfigProperty) MasterWebUIConfiguration(alluxio.wire.MasterWebUIConfiguration) Path(javax.ws.rs.Path) GET(javax.ws.rs.GET)

Aggregations

ConfigProperty (alluxio.grpc.ConfigProperty)1 MasterWebUIConfiguration (alluxio.wire.MasterWebUIConfiguration)1 TreeSet (java.util.TreeSet)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 ImmutableTriple (org.apache.commons.lang3.tuple.ImmutableTriple)1 Triple (org.apache.commons.lang3.tuple.Triple)1