Package com.linkedin.helix.manager.zk

Examples of com.linkedin.helix.manager.zk.ZkClient


    if (_gZkClient.exists(propertyStoreRoot))
    {
      _gZkClient.deleteRecursive(propertyStoreRoot);
    }

    ZkClient zkclient = new ZkClient(ZK_ADDR);
    zkclient.setZkSerializer(new ByteArraySerializer());
    ZKPropertyStore<ZNRecord> store =
        new ZKPropertyStore<ZNRecord>(zkclient,
                                      new PropertyJsonSerializer<ZNRecord>(ZNRecord.class),
                                      propertyStoreRoot);
View Full Code Here


  ZkClient _zkClient;

  @BeforeClass
  public void beforeClass() throws Exception
  {
    _zkClient = new ZkClient(ZK_ADDR);
    _zkClient.setZkSerializer(new ZNRecordSerializer());
  }
View Full Code Here

                                   int nodesNb,
                                   int replica,
                                   String stateModelDef,
                                   boolean doRebalance) throws Exception
  {
    ZkClient zkClient = new ZkClient(ZkAddr);
    if (zkClient.exists("/" + clusterName))
    {
      LOG.warn("Cluster already exists:" + clusterName + ". Deleting it");
      zkClient.deleteRecursive("/" + clusterName);
    }

    ClusterSetup setupTool = new ClusterSetup(ZkAddr);
    setupTool.addCluster(clusterName, true);
    setupTool.addStateModelDef(clusterName,
                               "Bootstrap",
                               TestHelper.generateStateModelDefForBootstrap());

    for (int i = 0; i < nodesNb; i++)
    {
      int port = startPort + i;
      setupTool.addInstanceToCluster(clusterName, participantNamePrefix + ":" + port);
    }

    for (int i = 0; i < resourceNb; i++)
    {
      String dbName = resourceNamePrefix + i;
      setupTool.addResourceToCluster(clusterName, dbName, partitionNb, stateModelDef);
      if (doRebalance)
      {
        setupTool.rebalanceStorageCluster(clusterName, dbName, replica);
      }
    }
    zkClient.close();
  }
View Full Code Here

    public Boolean call()
    {
      try
      {
        ZKPropertyStore<ZNRecord> store
          = new ZKPropertyStore<ZNRecord>(new ZkClient(ZK_ADDR),
                                          new PropertyJsonSerializer<ZNRecord>(ZNRecord.class),
                                          _root);
        PropertyJsonComparator<ZNRecord> comparator = new PropertyJsonComparator<ZNRecord>(ZNRecord.class);
        long id = Thread.currentThread().getId();
View Full Code Here

    public Boolean call()
    {
      try
      {
        ZKPropertyStore<ZNRecord> store
          = new ZKPropertyStore<ZNRecord>(new ZkClient(ZK_ADDR),
                                          new PropertyJsonSerializer<ZNRecord>(ZNRecord.class),
                                          _root);

        store.setProperty("key2", _record);
        store.updatePropertyUntilSucceed("key2", new TestUpdater());
View Full Code Here

  ZkClient _zkClient;

  @BeforeClass
  public void beforeClass()
  {
    _zkClient = new ZkClient(ZK_ADDR);
    _zkClient.setZkSerializer(new ZNRecordSerializer());
  }
View Full Code Here

    {
      _zkClient.deleteRecursive(propertyStoreRoot);
    }

    ZKPropertyStore<String> zkPropertyStore
      = new ZKPropertyStore<String>(new ZkClient(zkConn), serializer, propertyStoreRoot);

    zkPropertyStore.setProperty("/child1/grandchild1", "grandchild1");
    zkPropertyStore.setProperty("/child1/grandchild2", "grandchild2");

    TestPropertyChangeListener listener = new TestPropertyChangeListener();
View Full Code Here

  @Override
  @BeforeClass()
  public void beforeClass() throws Exception
  {
    _zkClient = new ZkClient(ZK_ADDR);
  }
View Full Code Here

  protected final String _dbName = "TestDB0";

  @BeforeClass()
  public void beforeClass() throws Exception
  {
    _zkClient = new ZkClient(ZK_ADDR);
    _zkClient.setZkSerializer(new ZNRecordSerializer());

    _setupTool = new ClusterSetup(ZK_ADDR);
  }
View Full Code Here

      System.err.println("USAGE: ZkClientPerfTest zkServer");
      System.exit(1);
    }

    String zkServer = args[0];
    ZkClient zkclient = new ZkClient(zkServer, ZkClient.DEFAULT_SESSION_TIMEOUT,
        ZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer());
   
    final int n = 40;
    String clusterName = "ZkClientPerfTest";
    zkclient.deleteRecursive("/" + clusterName);
   
    for (int i = 0; i < n; i++)
    {
     
    }
View Full Code Here

TOP

Related Classes of com.linkedin.helix.manager.zk.ZkClient

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.