Package org.I0Itec.zkclient

Examples of org.I0Itec.zkclient.ZkConnection


  {
    LOG.info("START " + getShortClassName() + " at " + new Date(System.currentTimeMillis()));

    PropertyJsonSerializer<String> serializer = new PropertyJsonSerializer<String>(String.class);

    ZkConnection zkConn = new ZkConnection(ZK_ADDR);

    final String propertyStoreRoot = "/" + getShortClassName();
    if (_zkClient.exists(propertyStoreRoot))
    {
      _zkClient.deleteRecursive(propertyStoreRoot);
View Full Code Here


  public void handleStateChanged(KeeperState keeperState) throws Exception
  {
    switch (keeperState)
    {
    case SyncConnected:
      ZkConnection zkConnection =
          ((ZkConnection) _zkHelixManager._zkClient.getConnection());
      logger.info("KeeperState: " + keeperState + ", zookeeper:" + zkConnection.getZookeeper());
      _isConnected = true;
      break;
    case Disconnected:
      logger.info("KeeperState:" + keeperState + ", disconnectedSessionId: "
          + _zkHelixManager._sessionId + ", instance: "
View Full Code Here

  }

  public ZkClient(String zkServers, int sessionTimeout, int connectionTimeout,
                  ZkSerializer zkSerializer)
  {
    this(new ZkConnection(zkServers, sessionTimeout), connectionTimeout, zkSerializer);
  }
View Full Code Here

  }

  public ZkClient(String zkServers, int sessionTimeout, int connectionTimeout,
                  PathBasedZkSerializer zkSerializer)
  {
    this(new ZkConnection(zkServers, sessionTimeout), connectionTimeout, zkSerializer);
  }
View Full Code Here

    this(new ZkConnection(zkServers, sessionTimeout), connectionTimeout, zkSerializer);
  }

  public ZkClient(String zkServers, int sessionTimeout, int connectionTimeout)
  {
    this(new ZkConnection(zkServers, sessionTimeout),
         connectionTimeout,
         new SerializableSerializer());
  }
View Full Code Here

         new SerializableSerializer());
  }

  public ZkClient(String zkServers, int connectionTimeout)
  {
    this(new ZkConnection(zkServers), connectionTimeout, new SerializableSerializer());
  }
View Full Code Here

    this(new ZkConnection(zkServers), connectionTimeout, new SerializableSerializer());
  }

  public ZkClient(String zkServers)
  {
    this(new ZkConnection(zkServers), Integer.MAX_VALUE, new SerializableSerializer());
  }
View Full Code Here

  }

  @Override
  public void handleNewSession() throws Exception
  {
    ZkConnection connection = ((ZkConnection) _zkClient.getConnection());
    ZooKeeper zookeeper = connection.getZookeeper();
    LOG.info("handleNewSession: " + zookeeper.getSessionId());

    synchronized (_callbackMap)
    {
      for (String path : _callbackMap.keySet())
View Full Code Here

          + _zkConnectString + ", expiredSessionId: " + _sessionId + ", clusterName: "
          + _clusterName);
      isConnected = _zkClient.waitUntilConnected(CONNECTIONTIMEOUT, TimeUnit.MILLISECONDS);
    }

    ZkConnection zkConnection = ((ZkConnection) _zkClient.getConnection());
   
    synchronized (this)
    {
      _sessionId = Long.toHexString(zkConnection.getZookeeper().getSessionId());
    }
    _accessor.reset();
    _baseDataAccessor.reset();

    // reset all handlers so they have a chance to unsubscribe zk changes from zkclient
    // and remove all handlers since we will create new ones
    resetHandlers();
    // _handlers.clear();
    // abandon all callback-handlers added in expired session
    _handlers = new ArrayList<CallbackHandler>();

    logger.info("Handling new session, session id:" + _sessionId + ", instance:"
        + _instanceName + ", instanceTye: " + _instanceType + ", cluster: " + _clusterName);

    logger.info(zkConnection.getZookeeper());

    if (!ZKUtil.isClusterSetup(_clusterName, _zkClient))
    {
      throw new HelixException("Initial cluster structure is not set up for cluster:"
          + _clusterName);
View Full Code Here

  public void handleStateChanged(KeeperState keeperState) throws Exception
  {
    switch (keeperState)
    {
    case SyncConnected:
      ZkConnection zkConnection =
          ((ZkConnection) _zkHelixManager._zkClient.getConnection());
      logger.info("KeeperState: " + keeperState + ", zookeeper:" + zkConnection.getZookeeper());
      _isConnected = true;
      break;
    case Disconnected:
      logger.info("KeeperState:" + keeperState + ", disconnectedSessionId: "
          + _zkHelixManager._sessionId + ", instance: "
View Full Code Here

TOP

Related Classes of org.I0Itec.zkclient.ZkConnection

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.