Parcourir la source

ZOOKEEPER-4346: remove never used field

remove some never used field

Author: zhongxiong.zeng <zhongxiong.zeng@za.group>

Reviewers: Enrico Olivelli <eolivelli@apache.org>, Damien Diederen <ddiederen@apache.org>, rainsbaby, maoling <maoling@apache.org>

Closes #1721 from zhongxiongzeng/remove_unused_code and squashes the following commits:

54dd870e6 [zhongxiong.zeng] 1 fix with ZooTrace.java
39279c78a [zhongxiong.zeng] remove never used field
zhongxiong.zeng il y a 3 ans
Parent
commit
f72ef97b66

+ 1 - 1
zookeeper-server/src/main/java/org/apache/zookeeper/server/RequestThrottler.java

@@ -68,7 +68,7 @@ public class RequestThrottler extends ZooKeeperCriticalThread {
     private volatile boolean killed;
 
     private static final String SHUTDOWN_TIMEOUT = "zookeeper.request_throttler.shutdownTimeout";
-    private static int shutdownTimeout = 10000;
+    private static int shutdownTimeout;
 
     static {
         shutdownTimeout = Integer.getInteger(SHUTDOWN_TIMEOUT, 10000);

+ 0 - 3
zookeeper-server/src/main/java/org/apache/zookeeper/server/ServerCnxn.java

@@ -62,8 +62,6 @@ public abstract class ServerCnxn implements Stats, Watcher {
 
     private Set<Id> authInfo = Collections.newSetFromMap(new ConcurrentHashMap<Id, Boolean>());
 
-    private static final byte[] fourBytes = new byte[4];
-
     /**
      * If the client is of old version, we don't send r-o mode info to it.
      * The reason is that if we would, old C client doesn't read it, which
@@ -388,7 +386,6 @@ public abstract class ServerCnxn implements Stats, Watcher {
 
     protected long count;
     protected long totalLatency;
-    protected long requestsProcessedCount;
     protected DisconnectReason disconnectReason = DisconnectReason.UNKNOWN;
 
     public synchronized void resetStats() {

+ 0 - 1
zookeeper-server/src/main/java/org/apache/zookeeper/server/WorkerService.java

@@ -52,7 +52,6 @@ public class WorkerService {
     private final String threadNamePrefix;
     private int numWorkerThreads;
     private boolean threadsAreAssignable;
-    private long shutdownTimeoutMS = 5000;
 
     private volatile boolean stopped = true;
 

+ 0 - 1
zookeeper-server/src/main/java/org/apache/zookeeper/server/ZKDatabase.java

@@ -90,7 +90,6 @@ public class ZKDatabase {
     public static final String COMMIT_LOG_COUNT = "zookeeper.commitLogCount";
     public static final int DEFAULT_COMMIT_LOG_COUNT = 500;
     public int commitLogCount;
-    protected static int commitLogBuffer = 700;
     protected Queue<Proposal> committedLog = new ArrayDeque<>();
     protected ReentrantReadWriteLock logLock = new ReentrantReadWriteLock();
     private volatile boolean initialized = false;

+ 8 - 0
zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooTrace.java

@@ -33,6 +33,10 @@ public class ZooTrace {
 
     public static final long CLIENT_REQUEST_TRACE_MASK = 1 << 1;
 
+    /**
+     * this field is obsolete
+     */
+    @Deprecated
     public static final long CLIENT_DATA_PACKET_TRACE_MASK = 1 << 2;
 
     public static final long CLIENT_PING_TRACE_MASK = 1 << 3;
@@ -47,6 +51,10 @@ public class ZooTrace {
 
     public static final long WARNING_TRACE_MASK = 1 << 8;
 
+    /**
+     * this field is obsolete
+     */
+    @Deprecated
     public static final long JMX_TRACE_MASK = 1 << 9;
 
     private static long traceMask = CLIENT_REQUEST_TRACE_MASK | SERVER_PACKET_TRACE_MASK | SESSION_TRACE_MASK | WARNING_TRACE_MASK;