Package org.apache.helix.api.accessor

Examples of org.apache.helix.api.accessor.ResourceAccessor.readResource()


    String partitionName = optValues[2];

    ResourceId resourceId = ResourceId.from(resourceName);
    PartitionId partitionId = PartitionId.from(partitionName);
    ResourceAccessor accessor = resourceAccessor(clusterName);
    Resource resource = accessor.readResource(resourceId);

    StringBuilder sb = new StringBuilder();
    Map<ParticipantId, State> stateMap = resource.getExternalView().getStateMap(partitionId);
    sb.append(resourceName + "/" + partitionName + ", externalView: " + stateMap);
    PartitionedRebalancerContext partitionedContext =
View Full Code Here


  void listResourceInfo(String[] optValues) {
    String clusterName = optValues[0];
    String resourceName = optValues[1];
    ResourceAccessor accessor = resourceAccessor(clusterName);
    ResourceId resourceId = ResourceId.from(resourceName);
    Resource resource = accessor.readResource(resourceId);
    StringBuilder sb =
        new StringBuilder("Resource ").append(resourceName).append(" in cluster ")
            .append(clusterName).append(":\n").append("externalView: ")
            .append(resource.getExternalView()).append(", userConfig: ")
            .append(resource.getUserConfig()).append(", rebalancerContext: ")
View Full Code Here

    }
  }

  private void expandResource(ClusterId clusterId, ResourceId resourceId) {
    ResourceAccessor accessor = resourceAccessor(clusterId.stringify());
    Resource resource = accessor.readResource(resourceId);
    SemiAutoRebalancerContext context =
        resource.getRebalancerConfig().getRebalancerContext(SemiAutoRebalancerContext.class);
    if (context == null) {
      LOG.info("Only SEMI_AUTO mode supported for resource expansion");
      return;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.