资源简介

zookeeper 客户端 curator 源文件

资源截图

代码片段和文件信息

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License Version 2.0 (the
 * “License“); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing
 * software distributed under the License is distributed on an
 * “AS IS“ BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.curator;

import org.apache.curator.connection.ConnectionHandlingPolicy;
import org.apache.curator.drivers.TracerDriver;
import org.apache.curator.ensemble.EnsembleProvider;
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.utils.DebugUtils;
import org.apache.curator.utils.ThreadUtils;
import org.apache.curator.utils.ZookeeperFactory;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.Closeable;
import java.io.IOException;
import java.util.Queue;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentlinkedQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;

class ConnectionState implements Watcher Closeable
{
    private static final int MAX_BACKGROUND_EXCEPTIONS = 10;
    private static final boolean LOG_EVENTS = Boolean.getBoolean(DebugUtils.PROPERTY_LOG_EVENTS);
    private static final Logger log = LoggerFactory.getLogger(ConnectionState.class);
    private final HandleHolder zooKeeper;
    private final AtomicBoolean isConnected = new AtomicBoolean(false);
    private final AtomicInteger lastNegotiatedSessionTimeoutMs = new AtomicInteger(0);
    private final EnsembleProvider ensembleProvider;
    private final int sessionTimeoutMs;
    private final int connectionTimeoutMs;
    private final AtomicReference tracer;
    private final ConnectionHandlingPolicy connectionHandlingPolicy;
    private final Queue backgroundExceptions = new ConcurrentlinkedQueue();
    private final Queue parentWatchers = new ConcurrentlinkedQueue();
    private final AtomicLong instanceIndex = new AtomicLong();
    private volatile long connectionstartMs = 0;

    ConnectionState(ZookeeperFactory zookeeperFactory EnsembleProvider ensembleProvider int sessionTimeoutMs int connectionTimeoutMs Watcher parentWatcher Atom

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-06-20 09:37  apache-curator-3.2.0\
     目录           0  2016-06-20 09:36  apache-curator-3.2.0\curator-client\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\main\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\main\java\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\main\java\org\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\main\java\org\apache\
     目录           0  2016-06-20 09:36  apache-curator-3.2.0\curator-client\src\main\java\org\apache\curator\
     目录           0  2016-06-20 09:36  apache-curator-3.2.0\curator-client\src\main\java\org\apache\curator\connection\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\main\java\org\apache\curator\drivers\
     目录           0  2016-06-20 09:36  apache-curator-3.2.0\curator-client\src\main\java\org\apache\curator\ensemble\
     目录           0  2016-06-20 09:36  apache-curator-3.2.0\curator-client\src\main\java\org\apache\curator\ensemble\exhibitor\
     目录           0  2016-06-20 09:36  apache-curator-3.2.0\curator-client\src\main\java\org\apache\curator\ensemble\fixed\
     目录           0  2016-05-25 08:36  apache-curator-3.2.0\curator-client\src\main\java\org\apache\curator\retry\
     目录           0  2016-06-20 09:36  apache-curator-3.2.0\curator-client\src\main\java\org\apache\curator\utils\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\site\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\site\confluence\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\test\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\test\java\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\test\java\org\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\test\java\org\apache\
     目录           0  2016-06-20 09:36  apache-curator-3.2.0\curator-client\src\test\java\org\apache\curator\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\test\java\org\apache\curator\ensemble\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\test\java\org\apache\curator\ensemble\exhibitor\
     目录           0  2015-08-25 14:06  apache-curator-3.2.0\curator-client\src\test\java\org\apache\curator\utils\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-client\src\test\resources\
     目录           0  2016-06-20 09:36  apache-curator-3.2.0\curator-examples\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-examples\src\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-examples\src\main\
     目录           0  2015-07-22 08:25  apache-curator-3.2.0\curator-examples\src\main\java\
     目录           0  2015-08-25 14:06  apache-curator-3.2.0\curator-examples\src\main\java\cache\
............此处省略850个文件信息

评论

共有 条评论