Package org.apache.helix.api.id

Examples of org.apache.helix.api.id.ClusterId


    }

    private Map<String, Map<String, String>> getMapping(final Map<String, List<String>> listResult) {
      final Map<PartitionId, Map<ParticipantId, State>> mapResult =
          new HashMap<PartitionId, Map<ParticipantId, State>>();
      ClusterId clusterId = ClusterId.from("clusterId");
      ClusterConfig.Builder clusterConfigBuilder =
          new ClusterConfig.Builder(clusterId).addStateModelDefinition(_stateModelDef);
      ClusterConfig clusterConfig = clusterConfigBuilder.build();
      for (String partition : _partitions) {
        PartitionId partitionId = PartitionId.from(partition);
View Full Code Here


    // create connection
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // start controller
    ClusterId clusterId = ClusterId.from(clusterName);
    ControllerId controllerId = ControllerId.from("controller");
    HelixController controller = connection.createController(clusterId, controllerId);
    controller.start();

    // check leader znode exists
View Full Code Here

    // create connection
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // start controller
    ClusterId clusterId = ClusterId.from(clusterName);
    final ControllerId controllerId = ControllerId.from("controller");

    // start controller
    HelixController controller = connection.createController(clusterId, controllerId);
    controller.start();
View Full Code Here

    System.out.println("START " + testName + " at " + new Date(System.currentTimeMillis()));

    ClusterAccessor clusterAccessor = new ClusterAccessor(_clusterId, _dataAccessor);
    Cluster cluster = clusterAccessor.readCluster();

    ClusterId id = cluster.getId();
    Assert.assertEquals(id, _clusterId);
    Map<ParticipantId, Participant> liveParticipantMap = cluster.getLiveParticipantMap();
    Assert.assertEquals(liveParticipantMap.size(), n);

    for (ParticipantId participantId : liveParticipantMap.keySet()) {
View Full Code Here

    // create connection
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // start participant
    ClusterId clusterId = ClusterId.from(clusterName);
    HelixParticipant[] participants = new HelixParticipant[n];
    for (int i = 0; i < n; i++) {
      int port = 12918 + i;
      ParticipantId participantId = ParticipantId.from("localhost_" + port);
View Full Code Here

    _zkclient.waitUntilConnected(TIMEOUT, TimeUnit.MILLISECONDS);
    final AtomicBoolean t1Locked = new AtomicBoolean(false);
    final AtomicBoolean t1Done = new AtomicBoolean(false);
    final AtomicInteger field1 = new AtomicInteger(0);
    final AtomicInteger field2 = new AtomicInteger(1);
    final ClusterId clusterId = ClusterId.from("testCluster");
    final HelixLock lock1 = new ZKHelixLock(clusterId, Scope.cluster(clusterId), _zkclient);
    final HelixLock lock2 = new ZKHelixLock(clusterId, Scope.cluster(clusterId), _zkclient);

    // thread 1: get a lock, set fields to 1
    Thread t1 = new Thread() {
View Full Code Here

    // add some state models
    addStateModels(accessor);

    // refresh the cache
    ClusterEvent event = new ClusterEvent("testEvent");
    ClusterId clusterId = new ClusterId("sampleClusterId");
    ClusterAccessor clusterAccessor = new MockClusterAccessor(clusterId, accessor);
    Cluster cluster = clusterAccessor.readCluster();
    event.addAttribute("Cluster", cluster);
    event.addAttribute(AttributeName.IDEAL_STATE_RULES.toString(),
        clusterConfiguration.getIdealStateRules());
View Full Code Here

    // add some state models
    addStateModels(accessor);

    // refresh the cache
    ClusterEvent event = new ClusterEvent("testEvent");
    ClusterId clusterId = new ClusterId("sampleClusterId");
    ClusterAccessor clusterAccessor = new MockClusterAccessor(clusterId, accessor);
    Cluster cluster = clusterAccessor.readCluster();
    event.addAttribute("Cluster", cluster);
    Map<String, Map<String, String>> emptyMap = Maps.newHashMap();
    event.addAttribute(AttributeName.IDEAL_STATE_RULES.toString(), emptyMap);
View Full Code Here

    // add some state models (but not leader standby)
    addStateModels(accessor);

    // refresh the cache
    ClusterEvent event = new ClusterEvent("testEvent");
    ClusterId clusterId = new ClusterId("sampleClusterId");
    ClusterAccessor clusterAccessor = new MockClusterAccessor(clusterId, accessor);
    Cluster cluster = clusterAccessor.readCluster();
    event.addAttribute("Cluster", cluster);
    Map<String, Map<String, String>> emptyMap = Maps.newHashMap();
    event.addAttribute(AttributeName.IDEAL_STATE_RULES.toString(), emptyMap);
View Full Code Here

    // create connection
    HelixConnection connection = new ZkHelixConnection(_zkaddr);
    connection.connect();

    // start multi-cluster-controller
    ClusterId clusterId = ClusterId.from(clusterName);
    final HelixMultiClusterController[] controllers = new HelixMultiClusterController[n];
    for (int i = 0; i < n; i++) {
      int port = 12918 + i;
      ControllerId controllerId = ControllerId.from("localhost_" + port);
      controllers[i] = connection.createMultiClusterController(clusterId, controllerId);
View Full Code Here

TOP

Related Classes of org.apache.helix.api.id.ClusterId

Copyright © 2018 www.massapicom. 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.