From 99d9149e3f1ab2a0dbf80dc0cd243ab1159c0e93 Mon Sep 17 00:00:00 2001 From: "Christopher L. Shannon" Date: Sat, 24 Aug 2024 15:07:55 -0400 Subject: [PATCH] Mark member variables as final in server-base (#4833) See #4830 --- .../ProvisionalCompactionPlanner.java | 2 +- .../server/data/ServerColumnUpdate.java | 2 +- .../data/ServerConditionalMutation.java | 4 ++-- .../accumulo/server/fs/FileManager.java | 16 +++++++------- .../accumulo/server/fs/VolumeManager.java | 2 +- .../apache/accumulo/server/fs/VolumeUtil.java | 4 ++-- .../server/init/FileSystemInitializer.java | 10 +++++---- .../accumulo/server/log/SortedLogState.java | 2 +- .../server/manager/LiveTServerSet.java | 6 ++--- .../state/LoggingTabletStateStore.java | 2 +- .../manager/state/TabletServerState.java | 4 ++-- .../ConditionalTabletsMutatorImpl.java | 6 ++--- .../metadata/ScanServerRefStoreImpl.java | 2 +- .../server/metadata/ServerAmpleImpl.java | 2 +- .../server/problems/ProblemReport.java | 6 ++--- .../problems/ProblemReportingIterator.java | 4 ++-- .../server/problems/ProblemReports.java | 2 +- .../AuthenticationTokenKeyManager.java | 4 ++-- .../ZooAuthenticationKeyDistributor.java | 2 +- .../tablets/ConditionCheckerContext.java | 22 +++++++++---------- .../accumulo/server/tablets/TabletTime.java | 2 +- .../accumulo/server/util/RandomWriter.java | 8 +++---- .../accumulo/server/util/TableDiskUsage.java | 10 ++++----- .../server/util/time/BaseRelativeTime.java | 2 +- .../server/util/time/RelativeTime.java | 2 +- .../zookeeper/DistributedWorkQueue.java | 11 +++++----- 26 files changed, 71 insertions(+), 68 deletions(-) diff --git a/server/base/src/main/java/org/apache/accumulo/server/compaction/ProvisionalCompactionPlanner.java b/server/base/src/main/java/org/apache/accumulo/server/compaction/ProvisionalCompactionPlanner.java index e3e870eb92b..efef42c11f2 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/compaction/ProvisionalCompactionPlanner.java +++ b/server/base/src/main/java/org/apache/accumulo/server/compaction/ProvisionalCompactionPlanner.java @@ -33,7 +33,7 @@ public class ProvisionalCompactionPlanner implements CompactionPlanner { private final CompactionServiceId serviceId; - private AtomicLong lastWarnNanoTime = new AtomicLong(System.nanoTime()); + private final AtomicLong lastWarnNanoTime = new AtomicLong(System.nanoTime()); public ProvisionalCompactionPlanner(CompactionServiceId serviceId) { this.serviceId = serviceId; diff --git a/server/base/src/main/java/org/apache/accumulo/server/data/ServerColumnUpdate.java b/server/base/src/main/java/org/apache/accumulo/server/data/ServerColumnUpdate.java index 8d91c1e92d4..76f1f3bbfee 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/data/ServerColumnUpdate.java +++ b/server/base/src/main/java/org/apache/accumulo/server/data/ServerColumnUpdate.java @@ -22,7 +22,7 @@ public class ServerColumnUpdate extends ColumnUpdate { - ServerMutation parent; + final ServerMutation parent; public ServerColumnUpdate(byte[] cf, byte[] cq, byte[] cv, boolean hasts, long ts, boolean deleted, byte[] val, ServerMutation serverMutation) { diff --git a/server/base/src/main/java/org/apache/accumulo/server/data/ServerConditionalMutation.java b/server/base/src/main/java/org/apache/accumulo/server/data/ServerConditionalMutation.java index 849ee828412..6c70089787e 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/data/ServerConditionalMutation.java +++ b/server/base/src/main/java/org/apache/accumulo/server/data/ServerConditionalMutation.java @@ -25,8 +25,8 @@ public class ServerConditionalMutation extends ServerMutation { - private long cmid; - private List conditions; + private final long cmid; + private final List conditions; public ServerConditionalMutation(TConditionalMutation input) { super(input.mutation); diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/FileManager.java b/server/base/src/main/java/org/apache/accumulo/server/fs/FileManager.java index 5dc8868d068..1885e67cd3d 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/fs/FileManager.java +++ b/server/base/src/main/java/org/apache/accumulo/server/fs/FileManager.java @@ -68,9 +68,9 @@ public class FileManager { private int maxOpen; private static class OpenReader implements Comparable { - long releaseTime; - FileSKVIterator reader; - StoredTabletFile file; + final long releaseTime; + final FileSKVIterator reader; + final StoredTabletFile file; public OpenReader(StoredTabletFile file, FileSKVIterator reader) { this.file = file; @@ -383,7 +383,7 @@ private void releaseReaders(KeyExtent tablet, List readers, static class FileDataSource implements DataSource { private SortedKeyValueIterator iter; - private ArrayList deepCopies; + private final ArrayList deepCopies; private boolean current = true; private IteratorEnvironment env; private StoredTabletFile file; @@ -456,11 +456,11 @@ public void setInterruptFlag(AtomicBoolean flag) { public class ScanFileManager { - private ArrayList dataSources; - private ArrayList tabletReservedReaders; - private KeyExtent tablet; + private final ArrayList dataSources; + private final ArrayList tabletReservedReaders; + private final KeyExtent tablet; private boolean continueOnFailure; - private CacheProvider cacheProvider; + private final CacheProvider cacheProvider; ScanFileManager(KeyExtent tablet, CacheProvider cacheProvider) { tabletReservedReaders = new ArrayList<>(); diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java index bac4d3d4cc1..ca16e4872b2 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java +++ b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java @@ -53,7 +53,7 @@ public interface VolumeManager extends AutoCloseable { enum FileType { TABLE(Constants.TABLE_DIR), WAL(Constants.WAL_DIR), RECOVERY(Constants.RECOVERY_DIR); - private String dir; + private final String dir; FileType(String dir) { this.dir = dir; diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java index 66c527b6d49..7cbc312b4ee 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java +++ b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java @@ -88,8 +88,8 @@ public static LogEntry switchVolume(LogEntry le, Map replacements) { public static class TabletFiles { public String dirName; - public List logEntries; - public SortedMap datafiles; + public final List logEntries; + public final SortedMap datafiles; public TabletFiles() { logEntries = new ArrayList<>(); diff --git a/server/base/src/main/java/org/apache/accumulo/server/init/FileSystemInitializer.java b/server/base/src/main/java/org/apache/accumulo/server/init/FileSystemInitializer.java index 066a48161c4..b315f1a58c3 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/init/FileSystemInitializer.java +++ b/server/base/src/main/java/org/apache/accumulo/server/init/FileSystemInitializer.java @@ -73,10 +73,12 @@ public FileSystemInitializer(InitialConfiguration initConfig) { } public static class InitialTablet { - TableId tableId; - String dirName; - Text prevEndRow, endRow, extent; - String[] files; + final TableId tableId; + final String dirName; + final Text prevEndRow; + final Text endRow; + final Text extent; + final String[] files; InitialTablet(TableId tableId, String dirName, Text prevEndRow, Text endRow, String... files) { this.tableId = tableId; diff --git a/server/base/src/main/java/org/apache/accumulo/server/log/SortedLogState.java b/server/base/src/main/java/org/apache/accumulo/server/log/SortedLogState.java index c7cd6cf006d..86560344c98 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/log/SortedLogState.java +++ b/server/base/src/main/java/org/apache/accumulo/server/log/SortedLogState.java @@ -28,7 +28,7 @@ public enum SortedLogState { FINISHED("finished"), FAILED("failed"); - private String marker; + private final String marker; private SortedLogState(String marker) { this.marker = marker; diff --git a/server/base/src/main/java/org/apache/accumulo/server/manager/LiveTServerSet.java b/server/base/src/main/java/org/apache/accumulo/server/manager/LiveTServerSet.java index 78b89b58e2b..5f67c827ba3 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/manager/LiveTServerSet.java +++ b/server/base/src/main/java/org/apache/accumulo/server/manager/LiveTServerSet.java @@ -184,9 +184,9 @@ public void flush(ServiceLock lock, TableId tableId, byte[] startRow, byte[] end } static class TServerInfo { - TServerConnection connection; - TServerInstance instance; - String resourceGroup; + final TServerConnection connection; + final TServerInstance instance; + final String resourceGroup; TServerInfo(TServerInstance instance, TServerConnection connection, String resourceGroup) { this.connection = connection; diff --git a/server/base/src/main/java/org/apache/accumulo/server/manager/state/LoggingTabletStateStore.java b/server/base/src/main/java/org/apache/accumulo/server/manager/state/LoggingTabletStateStore.java index 0c60389848b..b5da85b3ad9 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/manager/state/LoggingTabletStateStore.java +++ b/server/base/src/main/java/org/apache/accumulo/server/manager/state/LoggingTabletStateStore.java @@ -40,7 +40,7 @@ */ class LoggingTabletStateStore implements TabletStateStore { - private TabletStateStore wrapped; + private final TabletStateStore wrapped; LoggingTabletStateStore(TabletStateStore tss) { this.wrapped = tss; diff --git a/server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletServerState.java b/server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletServerState.java index 43446f89146..78c3393e8be 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletServerState.java +++ b/server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletServerState.java @@ -43,8 +43,8 @@ public enum TabletServerState { private byte id; - private static HashMap mapping; - private static HashSet badStates; + private static final HashMap mapping; + private static final HashSet badStates; static { mapping = new HashMap<>(TabletServerState.values().length); diff --git a/server/base/src/main/java/org/apache/accumulo/server/metadata/ConditionalTabletsMutatorImpl.java b/server/base/src/main/java/org/apache/accumulo/server/metadata/ConditionalTabletsMutatorImpl.java index 3dbdfb58421..ffb47918bdd 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/metadata/ConditionalTabletsMutatorImpl.java +++ b/server/base/src/main/java/org/apache/accumulo/server/metadata/ConditionalTabletsMutatorImpl.java @@ -59,13 +59,13 @@ public class ConditionalTabletsMutatorImpl implements Ample.ConditionalTabletsMu private final ServerContext context; private Ample.DataLevel dataLevel = null; - private List mutations = new ArrayList<>(); + private final List mutations = new ArrayList<>(); - private Map extents = new HashMap<>(); + private final Map extents = new HashMap<>(); private boolean active = true; - Map rejectedHandlers = new HashMap<>(); + final Map rejectedHandlers = new HashMap<>(); private final Function tableMapper; public ConditionalTabletsMutatorImpl(ServerContext context) { diff --git a/server/base/src/main/java/org/apache/accumulo/server/metadata/ScanServerRefStoreImpl.java b/server/base/src/main/java/org/apache/accumulo/server/metadata/ScanServerRefStoreImpl.java index c3c5056a46d..7b7dd77aabd 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/metadata/ScanServerRefStoreImpl.java +++ b/server/base/src/main/java/org/apache/accumulo/server/metadata/ScanServerRefStoreImpl.java @@ -40,7 +40,7 @@ public class ScanServerRefStoreImpl implements ScanServerRefStore { - private static Logger log = LoggerFactory.getLogger(ScanServerRefStoreImpl.class); + private static final Logger log = LoggerFactory.getLogger(ScanServerRefStoreImpl.class); private final ClientContext context; private final String tableName; diff --git a/server/base/src/main/java/org/apache/accumulo/server/metadata/ServerAmpleImpl.java b/server/base/src/main/java/org/apache/accumulo/server/metadata/ServerAmpleImpl.java index 7cc3dd1de4a..2b39641b5e4 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/metadata/ServerAmpleImpl.java +++ b/server/base/src/main/java/org/apache/accumulo/server/metadata/ServerAmpleImpl.java @@ -62,7 +62,7 @@ public class ServerAmpleImpl extends AmpleImpl implements Ample { - private static Logger log = LoggerFactory.getLogger(ServerAmpleImpl.class); + private static final Logger log = LoggerFactory.getLogger(ServerAmpleImpl.class); private final ServerContext context; private final ScanServerRefStore scanServerRefStore; diff --git a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java index 8f9205663f2..cd221e436db 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java +++ b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java @@ -44,9 +44,9 @@ import org.apache.zookeeper.KeeperException; public class ProblemReport { - private TableId tableId; - private ProblemType problemType; - private String resource; + private final TableId tableId; + private final ProblemType problemType; + private final String resource; private String exception; private String server; private long creationTime; diff --git a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReportingIterator.java b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReportingIterator.java index fe89690dfe8..4344c6ba975 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReportingIterator.java +++ b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReportingIterator.java @@ -37,8 +37,8 @@ public class ProblemReportingIterator implements InterruptibleIterator { private final SortedKeyValueIterator source; private boolean sawError = false; private final boolean continueOnError; - private String resource; - private TableId tableId; + private final String resource; + private final TableId tableId; private final ServerContext context; public ProblemReportingIterator(ServerContext context, TableId tableId, String resource, diff --git a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java index 0e89806fb19..4672c279a83 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java +++ b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReports.java @@ -192,7 +192,7 @@ private static boolean isMeta(TableId tableId) { public Iterator iterator(final TableId table) { return new Iterator<>() { - ZooReaderWriter zoo = context.getZooReaderWriter(); + final ZooReaderWriter zoo = context.getZooReaderWriter(); private int iter1Count = 0; private Iterator iter1; diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenKeyManager.java b/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenKeyManager.java index ac7d3563eac..73816d2bbf2 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenKeyManager.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenKeyManager.java @@ -36,8 +36,8 @@ public class AuthenticationTokenKeyManager implements Runnable { private final ZooAuthenticationKeyDistributor keyDistributor; private long lastKeyUpdate = 0; - private long keyUpdateInterval; - private long tokenMaxLifetime; + private final long keyUpdateInterval; + private final long tokenMaxLifetime; private int idSeq = 0; private volatile boolean keepRunning = true, initialized = false; diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyDistributor.java b/server/base/src/main/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyDistributor.java index d2d04fa469c..ef4a1e204de 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyDistributor.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyDistributor.java @@ -49,7 +49,7 @@ public class ZooAuthenticationKeyDistributor { private final ZooReaderWriter zk; private final String baseNode; - private AtomicBoolean initialized = new AtomicBoolean(false); + private final AtomicBoolean initialized = new AtomicBoolean(false); public ZooAuthenticationKeyDistributor(ZooReaderWriter zk, String baseNode) { requireNonNull(zk); diff --git a/server/base/src/main/java/org/apache/accumulo/server/tablets/ConditionCheckerContext.java b/server/base/src/main/java/org/apache/accumulo/server/tablets/ConditionCheckerContext.java index a16df5143c8..dac390623d3 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/tablets/ConditionCheckerContext.java +++ b/server/base/src/main/java/org/apache/accumulo/server/tablets/ConditionCheckerContext.java @@ -51,16 +51,16 @@ import org.apache.hadoop.io.Text; public class ConditionCheckerContext { - private CompressedIterators compressedIters; + private final CompressedIterators compressedIters; - private List tableIters; - private Map> tableIterOpts; - private TabletIteratorEnvironment tie; - private String context; + private final List tableIters; + private final Map> tableIterOpts; + private final TabletIteratorEnvironment tie; + private final String context; private static class MergedIterConfig { - List mergedIters; - Map> mergedItersOpts; + final List mergedIters; + final Map> mergedItersOpts; MergedIterConfig(List mergedIters, Map> mergedItersOpts) { this.mergedIters = mergedIters; @@ -68,7 +68,7 @@ private static class MergedIterConfig { } } - private Map mergedIterCache = new HashMap<>(); + private final Map mergedIterCache = new HashMap<>(); public ConditionCheckerContext(ServerContext context, CompressedIterators compressedIters, TableConfiguration tableConf) { @@ -144,9 +144,9 @@ boolean checkConditions(SortedKeyValueIterator systemIter, public class ConditionChecker { - private List conditionsToCheck; - private List okMutations; - private List results; + private final List conditionsToCheck; + private final List okMutations; + private final List results; private boolean checked = false; public ConditionChecker(List conditionsToCheck, diff --git a/server/base/src/main/java/org/apache/accumulo/server/tablets/TabletTime.java b/server/base/src/main/java/org/apache/accumulo/server/tablets/TabletTime.java index ab882625c7e..ae6c249ada0 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/tablets/TabletTime.java +++ b/server/base/src/main/java/org/apache/accumulo/server/tablets/TabletTime.java @@ -148,7 +148,7 @@ public long getAndUpdateTime() { } static class LogicalTime extends TabletTime { - AtomicLong nextTime; + final AtomicLong nextTime; private LogicalTime(Long time) { this.nextTime = new AtomicLong(time + 1); diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java b/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java index 4bc52c38757..59378e2b22e 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/RandomWriter.java @@ -42,12 +42,12 @@ public class RandomWriter { - private static int num_columns_per_row = 1; - private static int num_payload_bytes = 1024; + private static final int num_columns_per_row = 1; + private static final int num_payload_bytes = 1024; private static final Logger log = LoggerFactory.getLogger(RandomWriter.class); public static class RandomMutationGenerator implements Iterable, Iterator { - private long max_mutations; + private final long max_mutations; private int mutations_so_far = 0; private static final Logger log = LoggerFactory.getLogger(RandomMutationGenerator.class); @@ -93,7 +93,7 @@ static class Opts extends ClientOpts { @Parameter(names = "--count", description = "number of mutations to write", required = true) long count; @Parameter(names = "--table", description = "table to use") - String tableName = "test_write_table"; + final String tableName = "test_write_table"; } public static void main(String[] args) throws Exception { diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java b/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java index ee670a210f0..e09ac1b7de3 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/TableDiskUsage.java @@ -79,10 +79,10 @@ public class TableDiskUsage { private static final Logger log = LoggerFactory.getLogger(TableDiskUsage.class); private int nextInternalId = 0; - private Map internalIds = new HashMap<>(); - private Map externalIds = new HashMap<>(); - private Map tableFiles = new HashMap<>(); - private Map fileSizes = new HashMap<>(); + private final Map internalIds = new HashMap<>(); + private final Map externalIds = new HashMap<>(); + private final Map tableFiles = new HashMap<>(); + private final Map fileSizes = new HashMap<>(); void addTable(TableId tableId) { if (internalIds.containsKey(tableId)) { @@ -329,7 +329,7 @@ public static void printDiskUsage(Collection tableNames, AccumuloClient static class Opts extends ServerUtilOpts { @Parameter(description = " {
... } ") - List tables = new ArrayList<>(); + final List tables = new ArrayList<>(); } public static void main(String[] args) throws Exception { diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/time/BaseRelativeTime.java b/server/base/src/main/java/org/apache/accumulo/server/util/time/BaseRelativeTime.java index 46ee1654b0f..227e27e1594 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/time/BaseRelativeTime.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/time/BaseRelativeTime.java @@ -28,7 +28,7 @@ public class BaseRelativeTime implements ProvidesTime { private long diff = 0; private long lastReportedTime = 0; - ProvidesTime local; + final ProvidesTime local; BaseRelativeTime(ProvidesTime real, long lastReportedTime) { this.local = real; diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/time/RelativeTime.java b/server/base/src/main/java/org/apache/accumulo/server/util/time/RelativeTime.java index d7a52a05ad3..82acc2adee0 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/time/RelativeTime.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/time/RelativeTime.java @@ -29,7 +29,7 @@ private RelativeTime() { super(new SystemTime()); } - private static BaseRelativeTime instance = new RelativeTime(); + private static final BaseRelativeTime instance = new RelativeTime(); public static BaseRelativeTime getInstance() { return instance; diff --git a/server/base/src/main/java/org/apache/accumulo/server/zookeeper/DistributedWorkQueue.java b/server/base/src/main/java/org/apache/accumulo/server/zookeeper/DistributedWorkQueue.java index 2263e02af4f..73c9796ab32 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/zookeeper/DistributedWorkQueue.java +++ b/server/base/src/main/java/org/apache/accumulo/server/zookeeper/DistributedWorkQueue.java @@ -58,12 +58,13 @@ public class DistributedWorkQueue { private static final Logger log = LoggerFactory.getLogger(DistributedWorkQueue.class); - private ZooReaderWriter zoo; - private String path; - private ServerContext context; - private long timerInitialDelay, timerPeriod; + private final ZooReaderWriter zoo; + private final String path; + private final ServerContext context; + private final long timerInitialDelay; + private final long timerPeriod; - private AtomicInteger numTask = new AtomicInteger(0); + private final AtomicInteger numTask = new AtomicInteger(0); /** * Finds a child in {@code children} that is not currently being processed and adds a Runnable to