Examples of liveInstance()


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

        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_gZkClient));
    Builder keyBuilder = new Builder(clusterName);
    LiveInstance liveInstance = new LiveInstance("localhost_12918");
    liveInstance.setSessionId("session_0");
    liveInstance.setHelixVersion("version_0");
    accessor.setProperty(keyBuilder.liveInstance("localhost_12918"), liveInstance);

    // drop without stop the process, should throw exception
    try
    {
      ClusterSetup.processCommandLineArgs(new String[] { "--zkSvr", ZK_ADDR,
View Full Code Here

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

    }
    catch (Exception e)
    {
      // OK
    }
    accessor.removeProperty(keyBuilder.liveInstance("localhost_12918"));

    // drop without disable, should throw exception
    try
    {
      ClusterSetup.processCommandLineArgs(new String[] { "--zkSvr", ZK_ADDR,
View Full Code Here

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

    String sessionId = UUID.randomUUID().toString();
    liveInstance.setSessionId(sessionId);
   
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    Builder keyBuilder = accessor.keyBuilder();
    accessor.setProperty(keyBuilder.liveInstance(instanceName),
                                          liveInstance);

    String oldResource = "testResourceOld";
    CurrentState currentState = new CurrentState(oldResource);
    currentState.setState("testResourceOld_0", "OFFLINE");
View Full Code Here

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

    {
      record.setSimpleField(LiveInstanceProperty.HELIX_VERSION.toString(), participantVersion);
    }
    LiveInstance liveInstance = new LiveInstance(record);
    liveInstance.setSessionId("session_0");
    accessor.setProperty(keyBuilder.liveInstance("localhost_0"), liveInstance);

    if (controllerVersion != null)
    {
      ((Mocks.MockManager)manager).setVersion(controllerVersion);
    }
View Full Code Here

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

    // dummyRecord = new ZNRecord("localhost_9801");
    LiveInstance liveInstance = new LiveInstance("localhost_9801");
    liveInstance.setSessionId(UUID.randomUUID().toString());
    liveInstance.setHelixVersion(UUID.randomUUID().toString());
    accessor.setProperty(keyBuilder.liveInstance("localhost_9801"), liveInstance);
    Thread.sleep(500);
    AssertJUnit.assertTrue(testListener.liveInstanceChangeReceived);
    testListener.Reset();

    // dataAccessor.setNodeConfigs(recList); Thread.sleep(100);
View Full Code Here

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

    Builder keyBuilder = accessor.keyBuilder();

    LiveInstance newLiveIns = new LiveInstance("newLiveInstance");
    newLiveIns.setHelixVersion("0.0.0");
    newLiveIns.setSessionId("randomSessionId");
    accessor.setProperty(keyBuilder.liveInstance("newLiveInstance"), newLiveIns);

    Thread.sleep(1000)// wait for the CALLBACK type callback to finish
    Assert.assertTrue(_callback._isCallbackInvoked);

    System.out.println("END " + _clusterName + " at " + new Date(System.currentTimeMillis()));
View Full Code Here

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

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

    LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance(instance));
    accessor.removeProperty(keyBuilder.stateTransitionStatus(instance,
                                                             liveInstance.getSessionId(),
                                                             resource,
                                                             partition));
View Full Code Here

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

    for (int i = 0; i < liveInstances.length; i++) {
      String instance = "localhost_" + liveInstances[i];
      LiveInstance liveInstance = new LiveInstance(instance);
      liveInstance.setSessionId("session_" + liveInstances[i]);
      liveInstance.setHelixVersion("0.0.0");
      accessor.setProperty(keyBuilder.liveInstance(instance), liveInstance);
    }
  }

  protected void setupInstances(String clusterName, int[] instances) {
    HelixAdmin admin = new ZKHelixAdmin(_gZkClient);
View Full Code Here

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

    // old errors
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_gZkClient));
    Builder keyBuilder = accessor.keyBuilder();

    LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance(instance));
    accessor.removeProperty(keyBuilder.stateTransitionStatus(instance, liveInstance.getSessionId(),
        resource, partition));

  }
View Full Code Here

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

      MockAccessor accessor = new MockAccessor();
      Builder keyBuilder = accessor.keyBuilder();
      for (String node : _liveNodes) {
        LiveInstance liveInstance = new LiveInstance(node);
        liveInstance.setSessionId("testSession");
        accessor.setProperty(keyBuilder.liveInstance(node), liveInstance);
      }
      cache.refresh(accessor);
      for (String partition : _partitions) {
        List<String> preferenceList = listResult.get(partition);
        Map<String, String> currentStateMap = _currentMapping.get(partition);
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.