Examples of keyBuilder()


Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

  {
    String instanceId = host + "_" + port;

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

    // ensure node is stopped
    LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance(instanceId));
    if (liveInstance != null)
    {
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

                           String oldInstanceName,
                           String newInstanceName)
  {
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(_zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    InstanceConfig oldConfig =
        accessor.getProperty(keyBuilder.instanceConfig(oldInstanceName));
    if (oldConfig == null)
    {
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

      _logger.warn(error);
      throw new HelixException(error);
    }
    // ensure old instance is down, otherwise fail
    List<String> liveInstanceNames =
        accessor.getChildNames(accessor.keyBuilder().liveInstances());

    if (liveInstanceNames.contains(oldInstanceName))
    {
      String error =
          "Old instance " + oldInstanceName
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

    }

    dropInstanceFromCluster(clusterName, oldInstanceName);

    List<IdealState> existingIdealStates =
        accessor.getChildValues(accessor.keyBuilder().idealStates());
    for (IdealState idealState : existingIdealStates)
    {
      swapInstanceInIdealState(idealState, oldInstanceName, newInstanceName);
      accessor.setProperty(accessor.keyBuilder()
                                   .idealStates(idealState.getResourceName()), idealState);
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

    List<IdealState> existingIdealStates =
        accessor.getChildValues(accessor.keyBuilder().idealStates());
    for (IdealState idealState : existingIdealStates)
    {
      swapInstanceInIdealState(idealState, oldInstanceName, newInstanceName);
      accessor.setProperty(accessor.keyBuilder()
                                   .idealStates(idealState.getResourceName()), idealState);
    }
  }

  void swapInstanceInIdealState(IdealState idealState,
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

    try
    {
      ZKHelixDataAccessor accessor =
          new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(zkClient));
      Builder keyBuilder = accessor.keyBuilder();

      for (String instanceName : instanceNames)
      {
        List<String> sessionIds =
            accessor.getChildNames(keyBuilder.sessions(instanceName));
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

    try
    {
      ZKHelixDataAccessor accessor =
          new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(zkClient));
      Builder keyBuilder = accessor.keyBuilder();

      for (String resGroupPartitionKey : stateMap.keySet())
      {
        Map<String, String> retMap = getResourceAndPartitionKey(resGroupPartitionKey);
        String resGroup = retMap.get("RESOURCE");
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

    admin.addInstance(className, instanceConfig);

    // oversized data should not create any new data on zk
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(className, new ZkBaseDataAccessor(zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    IdealState idealState = new IdealState("currentState");
    idealState.setStateModelDefRef("MasterSlave");
    idealState.setIdealStateMode("AUTO");
    idealState.setNumPartitions(10);
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

      // model

      zkClient = new ZkClient(_zkAddr, ZkClient.DEFAULT_CONNECTION_TIMEOUT);
      zkClient.setZkSerializer(new ZNRecordSerializer());
      HelixDataAccessor accessor = new ZKHelixDataAccessor(_manager.getClusterName(), new ZkBaseDataAccessor(zkClient));
      Builder keyBuilder = accessor.keyBuilder();

      IdealState idealState = new IdealState(_resourceName);
      idealState.setIdealStateMode(IdealStateModeProperty.AUTO.toString());
      idealState.setReplicas(StateModelToken.ANY_LIVEINSTANCE.toString());
      idealState.setNumPartitions(1);
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.keyBuilder()

  {
    boolean result = true;
    ZkBaseDataAccessor<ZNRecord> baseAccessor =
        new ZkBaseDataAccessor<ZNRecord>(zkclient);
    ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, baseAccessor);
    Builder keyBuilder = accessor.keyBuilder();

    ExternalView extView = accessor.getProperty(keyBuilder.externalView(resourceName));
    Map<String, Map<String, String>> actualStateMap = extView.getRecord().getMapFields();
    for (String partition : actualStateMap.keySet())
    {
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.