Package org.apache.helix.manager.zk

Examples of org.apache.helix.manager.zk.ZkBaseDataAccessor


  public void swapInstance(String clusterName,
                           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


    zkClient.setZkSerializer(new ZNRecordSerializer());

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

      for (String instanceName : instanceNames)
      {
        List<String> sessionIds =
View Full Code Here

    zkClient.setZkSerializer(new ZNRecordSerializer());

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

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

      // manually add ideal state for participant leader using LeaderStandby
      // 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());
View Full Code Here

    InstanceConfig instanceConfig = new InstanceConfig("localhost_12918");
    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");
View Full Code Here

    InstanceConfig instanceConfig = new InstanceConfig("localhost_12918");
    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();

//    ZNRecord statusUpdates = new ZNRecord("statusUpdates");
    IdealState idealState = new IdealState("currentState");
    idealState.setStateModelDefRef("MasterSlave");
View Full Code Here

  public static void main(String[] args)
  {
    ZkClient zkClient = new ZkClient("localhost:2181");
    zkClient.waitUntilConnected(10, TimeUnit.SECONDS);
    BaseDataAccessor baseDataAccessor = new ZkBaseDataAccessor(zkClient);
    HelixDataAccessor accessor =
        new ZKHelixDataAccessor("test-cluster", baseDataAccessor);
    Builder builder = new PropertyKey.Builder("test-cluster");
    HelixProperty value = new IdealState("test-resource");
    accessor.createProperty(builder.idealStates("test-resource"), value);
View Full Code Here

  }

  public void createExternalView(List<String> instanceNames, int partitions,
      int replicas, String dbName, long randomSeed)
  {
    ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(client));
    Builder keyBuilder = accessor.keyBuilder();

    ExternalView externalView = new ExternalView(computeRoutingTable(instanceNames, partitions,
                                                                     replicas, dbName, randomSeed));
View Full Code Here

                            String clusterName,
                            String instance,
                            boolean wantEnabled)
  {
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    InstanceConfig config = accessor.getProperty(keyBuilder.instanceConfig(instance));
    AssertJUnit.assertEquals(wantEnabled, config.getInstanceEnabled());
  }
View Full Code Here

                                String clusterName,
                                String resource,
                                int repl)
  {
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    IdealState idealState = accessor.getProperty(keyBuilder.idealStates(resource));
    for (String partitionName : idealState.getPartitionSet())
    {
View Full Code Here

TOP

Related Classes of org.apache.helix.manager.zk.ZkBaseDataAccessor

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.