Package org.apache.helix.manager.zk

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


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

    // System.out.println("remove current-state");
    LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance("localhost_12918"));
    accessor.removeProperty(keyBuilder.currentState("localhost_12918", liveInstance.getSessionId(),
        "TestDB0"));
    liveInstance = accessor.getProperty(keyBuilder.liveInstance("localhost_12919"));
    accessor.removeProperty(keyBuilder.currentState("localhost_12919", liveInstance.getSessionId(),
        "TestDB0"));
View Full Code Here


    // System.out.println("remove current-state");
    LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance("localhost_12918"));
    accessor.removeProperty(keyBuilder.currentState("localhost_12918", liveInstance.getSessionId(),
        "TestDB0"));
    liveInstance = accessor.getProperty(keyBuilder.liveInstance("localhost_12919"));
    accessor.removeProperty(keyBuilder.currentState("localhost_12919", liveInstance.getSessionId(),
        "TestDB0"));

    // re-enable controller shall remove orphan external-view
    // System.out.println("re-enabling controller");
    admin.enableCluster(clusterName, true);
View Full Code Here

    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));

  }

  // TODO: throw exception in reset()
View Full Code Here

    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));

  }
  // TODO: throw exception in reset()
}
View Full Code Here

      });
      Assert.fail("Should throw exception since localhost_12918 is still in LIVEINSTANCES/");
    } catch (Exception e) {
      // OK
    }
    accessor.removeProperty(keyBuilder.liveInstance("localhost_12918"));

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

      });
      Assert.fail("Should throw exception since localhost_12918 is still in LIVEINSTANCES/");
    } catch (Exception e) {
      // OK
    }
    accessor.removeProperty(keyBuilder.liveInstance("localhost_12918"));

    // drop without disable, should throw exception
    try {
      ClusterSetup.processCommandLineArgs(new String[] {
          "--zkSvr", _zkaddr, "--dropNode", clusterName, "localhost:12918"
View Full Code Here

    // create a cluster with the same id
    boolean created2 = createCluster(clusterId, accessor, MODIFIER, 2);
    Assert.assertFalse(created2); // should fail since cluster exists

    // remove a required property
    helixAccessor.removeProperty(helixAccessor.keyBuilder().liveInstances());

    // try again, should work this time
    created2 = createCluster(clusterId, accessor, MODIFIER, 2);
    Assert.assertTrue(created2);
View Full Code Here

    // create a participant with the same id
    boolean created2 = createParticipant(participantId, accessor, MODIFIER, 2);
    Assert.assertFalse(created2); // should fail since participant exists

    // remove a required property
    helixAccessor.removeProperty(helixAccessor.keyBuilder().messages(participantId.stringify()));

    // try again, should work this time
    created2 = createParticipant(participantId, accessor, MODIFIER, 2);
    Assert.assertTrue(created2);
View Full Code Here

        new ZKHelixDataAccessor(clusterName, _baseAccessor);
    PropertyKey.Builder keyBuilder = accessor.keyBuilder();

    // System.out.println("remove current-state");
    LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance("localhost_12918"));
    accessor.removeProperty(keyBuilder.currentState("localhost_12918", liveInstance
        .getTypedSessionId().stringify(), "TestDB0"));
    liveInstance = accessor.getProperty(keyBuilder.liveInstance("localhost_12919"));
    accessor.removeProperty(keyBuilder.currentState("localhost_12919", liveInstance
        .getTypedSessionId().stringify(), "TestDB0"));
View Full Code Here

    // System.out.println("remove current-state");
    LiveInstance liveInstance = accessor.getProperty(keyBuilder.liveInstance("localhost_12918"));
    accessor.removeProperty(keyBuilder.currentState("localhost_12918", liveInstance
        .getTypedSessionId().stringify(), "TestDB0"));
    liveInstance = accessor.getProperty(keyBuilder.liveInstance("localhost_12919"));
    accessor.removeProperty(keyBuilder.currentState("localhost_12919", liveInstance
        .getTypedSessionId().stringify(), "TestDB0"));

    // re-enable controller shall remove orphan external-view
    // System.out.println("re-enabling controller");
    admin.enableCluster(clusterName, true);
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.