Examples of idealStates()


Examples of com.linkedin.helix.PropertyKey.Builder.idealStates()

          + partitionNames + " on " + instanceName + ", because " + instanceName
          + " is not alive");
    }

    // check resource group exists
    IdealState idealState = accessor.getProperty(keyBuilder.idealStates(resourceName));
    if (idealState == null)
    {
      throw new HelixException("Can't reset state for " + resourceName + "/"
          + partitionNames + " on " + instanceName + ", because " + resourceName
          + " is not added");
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.idealStates()

    List<ZNRecord> liveInstances = HelixProperty.convertToList(accessor.getChildValues(keyBuilder.liveInstances()));
    List<ZNRecord> stateModelDefs = HelixProperty.convertToList(accessor.getChildValues(keyBuilder.stateModelDefs()));
   
    // Idealstates are stored in a map from resource name to idealState ZNRecord
    List<ZNRecord> idealStateList = HelixProperty.convertToList(accessor.getChildValues(keyBuilder.idealStates()));
   
    Map<String, ZNRecord> idealStatesMap = new HashMap<String, ZNRecord>();
    for (ZNRecord idealState : idealStateList)
    {
      idealStatesMap.put(idealState.getId(), idealState);
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.idealStates()

                                                              Logger.getLogger(ClusterDataCache.class.getName());

  public boolean refresh(HelixDataAccessor accessor)
  {
    Builder keyBuilder = accessor.keyBuilder();
    _idealStateMap = accessor.getChildValuesMap(keyBuilder.idealStates());
    _liveInstanceMap = accessor.getChildValuesMap(keyBuilder.liveInstances());

    for (LiveInstance instance : _liveInstanceMap.values())
    {
      LOG.trace("live instance: " + instance.getInstanceName() + " "
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.idealStates()

          + partitionNames + " on " + instanceName + ", because " + instanceName
          + " is not alive");
    }

    // check resource group exists
    IdealState idealState = accessor.getProperty(keyBuilder.idealStates(resourceName));
    if (idealState == null)
    {
      throw new HelixException("Can't reset state for " + resourceName + "/"
          + partitionNames + " on " + instanceName + ", because " + resourceName
          + " is not added");
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.idealStates()

  {
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    return accessor.getProperty(keyBuilder.idealStates(dbName));
  }

  @Override
  public void setResourceIdealState(String clusterName,
                                    String dbName,
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.idealStates()

  {
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    accessor.setProperty(keyBuilder.idealStates(dbName), idealState);
  }

  @Override
  public ExternalView getResourceExternalView(String clusterName, String resourceName)
  {
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.idealStates()

  {
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    accessor.removeProperty(keyBuilder.idealStates(resourceName));
  }

  @Override
  public List<String> getStateModelDefs(String clusterName)
  {
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.idealStates()

  static boolean verifyMasterNbInExtView(HelixDataAccessor accessor)
  {
    Builder keyBuilder = accessor.keyBuilder();

    Map<String, IdealState> idealStates =
        accessor.getChildValuesMap(keyBuilder.idealStates());
    if (idealStates == null || idealStates.size() == 0)
    {
      LOG.info("No resource idealState");
      return true;
    }
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.idealStates()

    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(grandCluster, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    accessor.setProperty(keyBuilder.idealStates(idealState.getResourceName()), idealState);
  }

  @Override
  public void setConfig(ConfigScope scope, Map<String, String> properties)
  {
View Full Code Here

Examples of org.apache.helix.PropertyKey.Builder.idealStates()

        (ZkClient) getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);

    String message =
        ClusterRepresentationUtil.getClusterPropertyAsString(zkClient,
                                                             clusterName,
                                                             keyBuilder.idealStates(resourceName),
                                                             MediaType.APPLICATION_JSON);

    StringRepresentation representation =
        new StringRepresentation(message, MediaType.APPLICATION_JSON);
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.