Java Code Examples for org.apache.helix.HelixAdmin#getConfigKeys()

The following examples show how to use org.apache.helix.HelixAdmin#getConfigKeys() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PinotClusterConfigs.java    From incubator-pinot with Apache License 2.0 6 votes vote down vote up
@GET
@Path("/cluster/configs")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "List cluster configurations", notes = "List cluster level configurations")
@ApiResponses(value = {@ApiResponse(code = 200, message = "Success"), @ApiResponse(code = 500, message = "Internal server error")})
public String listClusterConfigs() {
  HelixAdmin helixAdmin = pinotHelixResourceManager.getHelixAdmin();
  HelixConfigScope configScope = new HelixConfigScopeBuilder(HelixConfigScope.ConfigScopeProperty.CLUSTER)
      .forCluster(pinotHelixResourceManager.getHelixClusterName()).build();
  List<String> configKeys = helixAdmin.getConfigKeys(configScope);
  ObjectNode ret = JsonUtils.newObjectNode();
  Map<String, String> configs = helixAdmin.getConfig(configScope, configKeys);
  for (String key : configs.keySet()) {
    ret.put(key, configs.get(key));
  }
  return ret.toString();
}
 
Example 2
Source File: HelixHelper.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
public static Map<String, String> getInstanceConfigsMapFor(String instanceName, String clusterName,
    HelixAdmin admin) {
  final HelixConfigScope scope = getInstanceScopefor(clusterName, instanceName);
  final List<String> keys = admin.getConfigKeys(scope);
  return admin.getConfig(scope, keys);
}
 
Example 3
Source File: HelixHelper.java    From incubator-pinot with Apache License 2.0 4 votes vote down vote up
public static Map<String, String> getResourceConfigsFor(String clusterName, String resourceName, HelixAdmin admin) {
  final HelixConfigScope scope = getResourceScopeFor(clusterName, resourceName);
  final List<String> keys = admin.getConfigKeys(scope);
  return admin.getConfig(scope, keys);
}