diff --git a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java index 66af59395b7..ed42f18f8cb 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java +++ b/core/src/main/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderToken.java @@ -34,8 +34,8 @@ * An {@link AuthenticationToken} backed by a Hadoop CredentialProvider. */ public class CredentialProviderToken extends PasswordToken { - public static final String NAME_PROPERTY = "name", - CREDENTIAL_PROVIDERS_PROPERTY = "credentialProviders"; + public static final String NAME_PROPERTY = "name"; + public static final String CREDENTIAL_PROVIDERS_PROPERTY = "credentialProviders"; private String name; private String credentialProviders; @@ -104,8 +104,8 @@ public String getCredentialProviders() { @Override public void init(Properties properties) { - char[] nameCharArray = properties.get(NAME_PROPERTY), - credentialProvidersCharArray = properties.get(CREDENTIAL_PROVIDERS_PROPERTY); + char[] nameCharArray = properties.get(NAME_PROPERTY); + char[] credentialProvidersCharArray = properties.get(CREDENTIAL_PROVIDERS_PROPERTY); if (nameCharArray != null && credentialProvidersCharArray != null) { try { this.setWithCredentialProviders(new String(nameCharArray), diff --git a/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java b/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java index 857f00b245f..576e57ebb46 100644 --- a/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java +++ b/core/src/main/java/org/apache/accumulo/core/conf/PropertyType.java @@ -334,8 +334,10 @@ public boolean test(final String input) { private static class Bounds implements Predicate { - private final long lowerBound, upperBound; - private final boolean lowerInclusive, upperInclusive; + private final long lowerBound; + private final long upperBound; + private final boolean lowerInclusive; + private final boolean upperInclusive; public Bounds(final long lowerBound, final long upperBound) { this(lowerBound, true, upperBound, true); diff --git a/core/src/main/java/org/apache/accumulo/core/crypto/streams/BlockedInputStream.java b/core/src/main/java/org/apache/accumulo/core/crypto/streams/BlockedInputStream.java index f3dcceac3f2..bd5095320e6 100644 --- a/core/src/main/java/org/apache/accumulo/core/crypto/streams/BlockedInputStream.java +++ b/core/src/main/java/org/apache/accumulo/core/crypto/streams/BlockedInputStream.java @@ -31,7 +31,8 @@ public class BlockedInputStream extends InputStream { byte[] array; // ReadPos is where to start reading // WritePos is the last position written to - int readPos, writePos; + int readPos; + int writePos; DataInputStream in; int blockSize; boolean finished = false; diff --git a/core/src/main/java/org/apache/accumulo/core/data/Key.java b/core/src/main/java/org/apache/accumulo/core/data/Key.java index 6344d4bb707..10359591d5d 100644 --- a/core/src/main/java/org/apache/accumulo/core/data/Key.java +++ b/core/src/main/java/org/apache/accumulo/core/data/Key.java @@ -565,9 +565,20 @@ public Key(CharSequence row, CharSequence cf, CharSequence cq, ColumnVisibility * @since 3.1.0 */ public Key(ByteSequence row, ByteSequence cf, ByteSequence cq, ByteSequence cv, long ts) { - byte[] rowBytes, cfBytes, cqBytes, cvBytes; - int rowOffset, cfOffset, cqOffset, cvOffset; - int rowLen, cfLen, cqLen, cvLen; + byte[] rowBytes; + byte[] cfBytes; + byte[] cqBytes; + byte[] cvBytes; + + int rowOffset; + int cfOffset; + int cqOffset; + int cvOffset; + + int rowLen; + int cfLen; + int cqLen; + int cvLen; if (row.isBackedByArray()) { rowBytes = row.getBackingArray(); diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java index f1846d02339..37dd5a7a7b0 100644 --- a/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java +++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java @@ -172,7 +172,10 @@ public void readFields(DataInput in) throws IOException { fieldsPrefixed = 0; } - final byte[] row, cf, cq, cv; + final byte[] row; + final byte[] cf; + final byte[] cq; + final byte[] cv; final long ts; row = getData(in, ROW_SAME, ROW_COMMON_PREFIX, () -> prevKey.getRowData()); @@ -219,8 +222,15 @@ public static SkippR fastSkip(DataInput in, Key seekKey, ArrayByteSequence value Key currKey, int entriesLeft) throws IOException { // this method mostly avoids object allocation and only does compares when the row changes - ArrayByteSequence row, cf, cq, cv; - ArrayByteSequence prow, pcf, pcq, pcv; + ArrayByteSequence row; + ArrayByteSequence cf; + ArrayByteSequence cq; + ArrayByteSequence cv; + + ArrayByteSequence prow; + ArrayByteSequence pcf; + ArrayByteSequence pcq; + ArrayByteSequence pcv; ByteSequence stopRow = seekKey.getRowData(); ByteSequence stopCF = seekKey.getColumnFamilyData(); @@ -230,7 +240,9 @@ public static SkippR fastSkip(DataInput in, Key seekKey, ArrayByteSequence value long pts = -1; boolean pdel = false; - int rowCmp = -1, cfCmp = -1, cqCmp = -1; + int rowCmp = -1; + int cfCmp = -1; + int cqCmp = -1; if (currKey != null) { @@ -397,7 +409,10 @@ public static SkippR fastSkip(DataInput in, Key seekKey, ArrayByteSequence value } if (count > 1) { - ArrayByteSequence trow, tcf, tcq, tcv; + ArrayByteSequence trow; + ArrayByteSequence tcf; + ArrayByteSequence tcq; + ArrayByteSequence tcv; long tts; // when the current keys field is same as the last, then diff --git a/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java b/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java index 44c58923c1e..e7792e3b8d4 100644 --- a/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java +++ b/core/src/main/java/org/apache/accumulo/core/rpc/ThriftUtil.java @@ -58,7 +58,8 @@ public class ThriftUtil { new AccumuloTFramedTransportFactory(Integer.MAX_VALUE); private static final Map factoryCache = new HashMap<>(); - public static final String GSSAPI = "GSSAPI", DIGEST_MD5 = "DIGEST-MD5"; + public static final String GSSAPI = "GSSAPI"; + public static final String DIGEST_MD5 = "DIGEST-MD5"; private static final int RELOGIN_MAX_BACKOFF = 5000; diff --git a/core/src/main/java/org/apache/accumulo/core/util/DurationFormat.java b/core/src/main/java/org/apache/accumulo/core/util/DurationFormat.java index 16aff987c3c..2a914490b26 100644 --- a/core/src/main/java/org/apache/accumulo/core/util/DurationFormat.java +++ b/core/src/main/java/org/apache/accumulo/core/util/DurationFormat.java @@ -23,7 +23,12 @@ public class DurationFormat { public DurationFormat(long time, String space) { String dash = "-"; - long ms, sec, min, hr, day, yr; + long ms; + long sec; + long min; + long hr; + long day; + long yr; if (time == 0) { str = dash; diff --git a/core/src/test/java/org/apache/accumulo/core/client/BatchWriterConfigTest.java b/core/src/test/java/org/apache/accumulo/core/client/BatchWriterConfigTest.java index 2b72d3cac36..bc334c9da5a 100644 --- a/core/src/test/java/org/apache/accumulo/core/client/BatchWriterConfigTest.java +++ b/core/src/test/java/org/apache/accumulo/core/client/BatchWriterConfigTest.java @@ -180,7 +180,8 @@ public void testSerialize() throws IOException { @Test public void testDefaultEquality() { - BatchWriterConfig cfg1 = new BatchWriterConfig(), cfg2 = new BatchWriterConfig(); + BatchWriterConfig cfg1 = new BatchWriterConfig(); + BatchWriterConfig cfg2 = new BatchWriterConfig(); assertEquals(cfg1, cfg2); assertEquals(cfg1.hashCode(), cfg2.hashCode()); cfg2.setMaxMemory(1); @@ -193,7 +194,8 @@ public void testDefaultEquality() { @Test public void testManualEquality() { - BatchWriterConfig cfg1 = new BatchWriterConfig(), cfg2 = new BatchWriterConfig(); + BatchWriterConfig cfg1 = new BatchWriterConfig(); + BatchWriterConfig cfg2 = new BatchWriterConfig(); cfg1.setMaxLatency(10, SECONDS); cfg2.setMaxLatency(10000, MILLISECONDS); @@ -210,7 +212,9 @@ public void testManualEquality() { @Test public void testMerge() { - BatchWriterConfig cfg1 = new BatchWriterConfig(), cfg2 = new BatchWriterConfig(); + BatchWriterConfig cfg1 = new BatchWriterConfig(); + BatchWriterConfig cfg2 = new BatchWriterConfig(); + cfg1.setMaxMemory(1234); cfg2.setMaxMemory(5858); cfg2.setDurability(Durability.LOG); diff --git a/core/src/test/java/org/apache/accumulo/core/client/admin/DelegationTokenConfigTest.java b/core/src/test/java/org/apache/accumulo/core/client/admin/DelegationTokenConfigTest.java index 5da5e3793ca..d67d5f62437 100644 --- a/core/src/test/java/org/apache/accumulo/core/client/admin/DelegationTokenConfigTest.java +++ b/core/src/test/java/org/apache/accumulo/core/client/admin/DelegationTokenConfigTest.java @@ -30,8 +30,8 @@ public class DelegationTokenConfigTest { @Test public void testTimeUnit() { - DelegationTokenConfig config1 = new DelegationTokenConfig(), - config2 = new DelegationTokenConfig(); + DelegationTokenConfig config1 = new DelegationTokenConfig(); + DelegationTokenConfig config2 = new DelegationTokenConfig(); config1.setTokenLifetime(1000, MILLISECONDS); config2.setTokenLifetime(1, SECONDS); diff --git a/core/src/test/java/org/apache/accumulo/core/clientImpl/ThriftTransportKeyTest.java b/core/src/test/java/org/apache/accumulo/core/clientImpl/ThriftTransportKeyTest.java index 44fd5714898..858bb64771c 100644 --- a/core/src/test/java/org/apache/accumulo/core/clientImpl/ThriftTransportKeyTest.java +++ b/core/src/test/java/org/apache/accumulo/core/clientImpl/ThriftTransportKeyTest.java @@ -98,11 +98,10 @@ public void testConnectionCaching() throws IOException, InterruptedException { SaslConnectionParams saslParams2 = user1.doAs((PrivilegedExceptionAction) () -> createSaslParams(token)); - ThriftTransportKey ttk1 = - new ThriftTransportKey(ThriftClientTypes.CLIENT, HostAndPort.fromParts("localhost", 9997), - 1L, null, saslParams1), - ttk2 = new ThriftTransportKey(ThriftClientTypes.CLIENT, - HostAndPort.fromParts("localhost", 9997), 1L, null, saslParams2); + ThriftTransportKey ttk1 = new ThriftTransportKey(ThriftClientTypes.CLIENT, + HostAndPort.fromParts("localhost", 9997), 1L, null, saslParams1); + ThriftTransportKey ttk2 = new ThriftTransportKey(ThriftClientTypes.CLIENT, + HostAndPort.fromParts("localhost", 9997), 1L, null, saslParams2); // Should equals() and hashCode() to make sure we don't throw away thrift cnxns assertEquals(ttk1, ttk2); @@ -120,11 +119,10 @@ public void testSaslPrincipalIsSignificant() throws IOException, InterruptedExce SaslConnectionParams saslParams2 = user2.doAs((PrivilegedExceptionAction) () -> createSaslParams(token)); - ThriftTransportKey ttk1 = - new ThriftTransportKey(ThriftClientTypes.CLIENT, HostAndPort.fromParts("localhost", 9997), - 1L, null, saslParams1), - ttk2 = new ThriftTransportKey(ThriftClientTypes.CLIENT, - HostAndPort.fromParts("localhost", 9997), 1L, null, saslParams2); + ThriftTransportKey ttk1 = new ThriftTransportKey(ThriftClientTypes.CLIENT, + HostAndPort.fromParts("localhost", 9997), 1L, null, saslParams1); + ThriftTransportKey ttk2 = new ThriftTransportKey(ThriftClientTypes.CLIENT, + HostAndPort.fromParts("localhost", 9997), 1L, null, saslParams2); assertNotEquals(ttk1, ttk2); assertNotEquals(ttk1.hashCode(), ttk2.hashCode()); diff --git a/core/src/test/java/org/apache/accumulo/core/conf/HadoopCredentialProviderTest.java b/core/src/test/java/org/apache/accumulo/core/conf/HadoopCredentialProviderTest.java index 8ab5315b74e..6d3070f6534 100644 --- a/core/src/test/java/org/apache/accumulo/core/conf/HadoopCredentialProviderTest.java +++ b/core/src/test/java/org/apache/accumulo/core/conf/HadoopCredentialProviderTest.java @@ -49,15 +49,16 @@ public class HadoopCredentialProviderTest { private static final Configuration hadoopConf = new Configuration(); private static final Logger log = LoggerFactory.getLogger(HadoopCredentialProviderTest.class); - private static final String populatedKeyStoreName = "/accumulo.jceks", - emptyKeyStoreName = "/empty.jceks"; - private static File emptyKeyStore, populatedKeyStore; + private static final String populatedKeyStoreName = "/accumulo.jceks"; + private static final String emptyKeyStoreName = "/empty.jceks"; + private static File emptyKeyStore; + private static File populatedKeyStore; @BeforeAll public static void checkCredentialProviderAvailable() throws Exception { URL populatedKeyStoreUrl = - HadoopCredentialProviderTest.class.getResource(populatedKeyStoreName), - emptyKeyStoreUrl = HadoopCredentialProviderTest.class.getResource(emptyKeyStoreName); + HadoopCredentialProviderTest.class.getResource(populatedKeyStoreName); + URL emptyKeyStoreUrl = HadoopCredentialProviderTest.class.getResource(emptyKeyStoreName); assertNotNull(populatedKeyStoreUrl, "Could not find " + populatedKeyStoreName); assertNotNull(emptyKeyStoreUrl, "Could not find " + emptyKeyStoreName); @@ -117,8 +118,8 @@ public void testEmptyKeyStoreParses() { @Test public void testEmptyAndPopulatedKeyStores() { - String populatedAbsPath = getKeyStoreUrl(populatedKeyStore), - emptyAbsPath = getKeyStoreUrl(emptyKeyStore); + String populatedAbsPath = getKeyStoreUrl(populatedKeyStore); + String emptyAbsPath = getKeyStoreUrl(emptyKeyStore); Configuration conf = new Configuration(); HadoopCredentialProvider.setPath(conf, populatedAbsPath + "," + emptyAbsPath); Map expectations = new HashMap<>(); diff --git a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java index 4fce2c26e2d..25dc7275e10 100644 --- a/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java +++ b/core/src/test/java/org/apache/accumulo/core/conf/PropertyTest.java @@ -144,7 +144,8 @@ public void testPropertyValidation() { continue; } PropertyType propertyType = property.getType(); - String invalidValue, validValue = property.getDefaultValue(); + String invalidValue; + String validValue = property.getDefaultValue(); LOG.debug("Testing property: {} with type: {}", property.getKey(), propertyType); switch (propertyType) { diff --git a/core/src/test/java/org/apache/accumulo/core/data/ConditionalMutationTest.java b/core/src/test/java/org/apache/accumulo/core/data/ConditionalMutationTest.java index a563c6101b1..45d5bac1ed3 100644 --- a/core/src/test/java/org/apache/accumulo/core/data/ConditionalMutationTest.java +++ b/core/src/test/java/org/apache/accumulo/core/data/ConditionalMutationTest.java @@ -49,7 +49,8 @@ public class ConditionalMutationTest { private static final ColumnVisibility CVIS2 = new ColumnVisibility("B|C"); private static final long TIMESTAMP = 1234567890; - private Condition c1, c2; + private Condition c1; + private Condition c2; private ConditionalMutation cm; @BeforeEach diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java index 8bcf1dac763..6fd69d89709 100644 --- a/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java +++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/RegExFilterTest.java @@ -248,8 +248,11 @@ public void test1() throws IOException { public void testNullByteInKey() throws IOException { TreeMap tm = new TreeMap<>(); - String s1 = "first", s2 = "second"; - byte[] b1 = s1.getBytes(UTF_8), b2 = s2.getBytes(UTF_8), ball; + String s1 = "first"; + String s2 = "second"; + byte[] b1 = s1.getBytes(UTF_8); + byte[] b2 = s2.getBytes(UTF_8); + byte[] ball; ball = new byte[b1.length + b2.length + 1]; System.arraycopy(b1, 0, ball, 0, b1.length); ball[b1.length] = (byte) 0; diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java index 4c106559ecd..bb3faf341fb 100644 --- a/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java +++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java @@ -182,7 +182,8 @@ public TreeMap createKeyValues() { List mutations = createMutations(); TreeMap keyValues = new TreeMap<>(); - final Text cf = new Text(), cq = new Text(); + final Text cf = new Text(); + final Text cq = new Text(); for (Mutation m : mutations) { final Text row = new Text(m.getRow()); for (ColumnUpdate update : m.getUpdates()) { diff --git a/core/src/test/java/org/apache/accumulo/core/rpc/SaslClientDigestCallbackHandlerTest.java b/core/src/test/java/org/apache/accumulo/core/rpc/SaslClientDigestCallbackHandlerTest.java index f8d4d192356..fe4afe0e2be 100644 --- a/core/src/test/java/org/apache/accumulo/core/rpc/SaslClientDigestCallbackHandlerTest.java +++ b/core/src/test/java/org/apache/accumulo/core/rpc/SaslClientDigestCallbackHandlerTest.java @@ -27,8 +27,9 @@ public class SaslClientDigestCallbackHandlerTest { @Test public void testEquality() { SaslClientDigestCallbackHandler handler1 = - new SaslClientDigestCallbackHandler("user", "mypass".toCharArray()), - handler2 = new SaslClientDigestCallbackHandler("user", "mypass".toCharArray()); + new SaslClientDigestCallbackHandler("user", "mypass".toCharArray()); + SaslClientDigestCallbackHandler handler2 = + new SaslClientDigestCallbackHandler("user", "mypass".toCharArray()); assertEquals(handler1, handler2); assertEquals(handler1.hashCode(), handler2.hashCode()); } diff --git a/core/src/test/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancerTest.java b/core/src/test/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancerTest.java index 18ab400ac97..29acee35d8c 100644 --- a/core/src/test/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancerTest.java +++ b/core/src/test/java/org/apache/accumulo/core/spi/balancer/TableLoadBalancerTest.java @@ -135,8 +135,9 @@ public void test() { replay(environment); - String t1Id = TABLE_ID_MAP.get("t1"), t2Id = TABLE_ID_MAP.get("t2"), - t3Id = TABLE_ID_MAP.get("t3"); + String t1Id = TABLE_ID_MAP.get("t1"); + String t2Id = TABLE_ID_MAP.get("t2"); + String t3Id = TABLE_ID_MAP.get("t3"); state.clear(); TabletServerId svr = mkts("10.0.0.1", 1234, "0x01020304"); state.put(svr, status(t1Id, 10, t2Id, 10, t3Id, 10)); diff --git a/core/src/test/java/org/apache/accumulo/core/util/RetryTest.java b/core/src/test/java/org/apache/accumulo/core/util/RetryTest.java index c05189a5149..24fe64f49a1 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/RetryTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/RetryTest.java @@ -131,11 +131,13 @@ public void testBackOffFactor() throws InterruptedException { retry.setMaxRetries(MAX_RETRIES); retry.setBackOffFactor(1.5); retry.setStartWait(INITIAL_WAIT); - Duration waitIncrement, currentWait = INITIAL_WAIT; + Duration waitIncrement; + Duration currentWait = INITIAL_WAIT; retry.setWaitIncrement(WAIT_INC); retry.setMaxWait(Duration.ofSeconds(128).multipliedBy(MAX_RETRIES)); retry.setDoTimeJitter(false); - double backOfFactor = 1.5, originalBackoff = 1.5; + double backOfFactor = 1.5; + double originalBackoff = 1.5; for (int i = 1; i <= MAX_RETRIES; i++) { retry.sleep(currentWait); diff --git a/core/src/test/java/org/apache/accumulo/core/util/ValidatorTest.java b/core/src/test/java/org/apache/accumulo/core/util/ValidatorTest.java index 6bbf0182b6f..ab4d15b110e 100644 --- a/core/src/test/java/org/apache/accumulo/core/util/ValidatorTest.java +++ b/core/src/test/java/org/apache/accumulo/core/util/ValidatorTest.java @@ -29,7 +29,9 @@ public class ValidatorTest { - private Validator v, v2, v3; + private Validator v; + private Validator v2; + private Validator v3; private static final Pattern STARTSWITH_C = Pattern.compile("c.*"); @BeforeEach diff --git a/core/src/test/java/org/apache/accumulo/core/volume/VolumeImplTest.java b/core/src/test/java/org/apache/accumulo/core/volume/VolumeImplTest.java index 5851df4ab71..83725509c82 100644 --- a/core/src/test/java/org/apache/accumulo/core/volume/VolumeImplTest.java +++ b/core/src/test/java/org/apache/accumulo/core/volume/VolumeImplTest.java @@ -42,7 +42,8 @@ public class VolumeImplTest { @Test public void testFileSystemInequivalence() { Configuration hadoopConf = createMock(Configuration.class); - FileSystem fs = createMock(FileSystem.class), other = createMock(FileSystem.class); + FileSystem fs = createMock(FileSystem.class); + FileSystem other = createMock(FileSystem.class); String basePath = "/accumulo"; @@ -62,7 +63,8 @@ public void testFileSystemInequivalence() { @Test public void testFileSystemEquivalence() { Configuration hadoopConf = createMock(Configuration.class); - FileSystem fs = createMock(FileSystem.class), other = createMock(FileSystem.class); + FileSystem fs = createMock(FileSystem.class); + FileSystem other = createMock(FileSystem.class); String basePath = "/accumulo"; expect(fs.getConf()).andReturn(hadoopConf).anyTimes(); diff --git a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/RangeInputSplit.java b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/RangeInputSplit.java index 6aebc89d53b..d6fc0ce8f1e 100644 --- a/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/RangeInputSplit.java +++ b/hadoop-mapreduce/src/main/java/org/apache/accumulo/hadoopImpl/mapreduce/RangeInputSplit.java @@ -48,8 +48,11 @@ public class RangeInputSplit extends InputSplit implements Writable { private Range range; private String[] locations; - private String tableId, tableName; - private Boolean offline, isolatedScan, localIterators; + private String tableId; + private String tableName; + private Boolean offline; + private Boolean isolatedScan; + private Boolean localIterators; private Set fetchedColumns; private List iterators; private SamplerConfiguration samplerConfig; diff --git a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/mapreduce/partition/RangePartitionerTest.java b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/mapreduce/partition/RangePartitionerTest.java index 93e3699b6d2..b3e476bf2c2 100644 --- a/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/mapreduce/partition/RangePartitionerTest.java +++ b/hadoop-mapreduce/src/test/java/org/apache/accumulo/hadoop/mapreduce/partition/RangePartitionerTest.java @@ -79,7 +79,8 @@ private void checkExpectedRangeBins(int numSubBins, String[] strings, int[] rang private void checkExpectedBins(int numSubBins, String[] strings, int[] bins) throws IOException { assertEquals(strings.length, bins.length); for (int i = 0; i < strings.length; ++i) { - int bin = bins[i], part = + int bin = bins[i]; + int part = prepPartitioner(numSubBins).findPartition(new Text(strings[i]), cutArray, numSubBins); assertEquals(bin, part); } diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java index c9a62008f09..65090c21211 100644 --- a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java +++ b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneAccumuloCluster.java @@ -60,7 +60,10 @@ public class StandaloneAccumuloCluster implements AccumuloCluster { ServerType.GARBAGE_COLLECTOR, ServerType.MONITOR)); private final ClientInfo info; - private String accumuloHome, clientAccumuloConfDir, serverAccumuloConfDir, hadoopConfDir; + private String accumuloHome; + private String clientAccumuloConfDir; + private String serverAccumuloConfDir; + private String hadoopConfDir; private final Path tmp; private final List users; private String clientCmdPrefix; diff --git a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java index 6a39e384ddf..5ba36cca8f1 100644 --- a/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java +++ b/minicluster/src/main/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControl.java @@ -51,10 +51,12 @@ public class StandaloneClusterControl implements ClusterControl { private static final Logger log = LoggerFactory.getLogger(StandaloneClusterControl.class); - private static final String ACCUMULO_SERVICE_SCRIPT = "accumulo-service", - ACCUMULO_SCRIPT = "accumulo"; - private static final String MANAGER_HOSTS_FILE = "managers", GC_HOSTS_FILE = "gc", - TSERVER_HOSTS_FILE = "tservers", MONITOR_HOSTS_FILE = "monitor"; + private static final String ACCUMULO_SERVICE_SCRIPT = "accumulo-service"; + private static final String ACCUMULO_SCRIPT = "accumulo"; + private static final String MANAGER_HOSTS_FILE = "managers"; + private static final String GC_HOSTS_FILE = "gc"; + private static final String TSERVER_HOSTS_FILE = "tservers"; + private static final String MONITOR_HOSTS_FILE = "monitor"; String accumuloHome; String clientAccumuloConfDir; @@ -63,7 +65,8 @@ public class StandaloneClusterControl implements ClusterControl { private String serverCmdPrefix; protected RemoteShellOptions options; - protected String accumuloServicePath, accumuloPath; + protected String accumuloServicePath; + protected String accumuloPath; @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "code runs in same security context as user who provided input file name") diff --git a/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java b/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java index 33350213ba5..72e56dd64f2 100644 --- a/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java +++ b/minicluster/src/test/java/org/apache/accumulo/cluster/standalone/StandaloneClusterControlTest.java @@ -26,8 +26,9 @@ public class StandaloneClusterControlTest { @Test public void testPaths() { - String accumuloHome = "/usr/lib/accumulo", accumuloConfDir = "/etc/accumulo/conf", - accumuloServerConfDir = "/etc/accumulo/conf/server"; + String accumuloHome = "/usr/lib/accumulo"; + String accumuloConfDir = "/etc/accumulo/conf"; + String accumuloServerConfDir = "/etc/accumulo/conf/server"; StandaloneClusterControl control = new StandaloneClusterControl(accumuloHome, accumuloConfDir, accumuloServerConfDir, "", ""); diff --git a/server/base/src/main/java/org/apache/accumulo/server/ServerDirs.java b/server/base/src/main/java/org/apache/accumulo/server/ServerDirs.java index 062198ba4b8..2eecf88c80a 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/ServerDirs.java +++ b/server/base/src/main/java/org/apache/accumulo/server/ServerDirs.java @@ -163,7 +163,8 @@ private Map loadVolumeReplacements() { Property.INSTANCE_VOLUMES_REPLACEMENTS.getKey() + " contains malformed pair " + pair); } - Path p1, p2; + Path p1; + Path p2; try { // URI constructor handles hex escaping p1 = new Path(new URI(VolumeUtil.removeTrailingSlash(uris[0].trim()))); diff --git a/server/base/src/main/java/org/apache/accumulo/server/constraints/BulkFileColData.java b/server/base/src/main/java/org/apache/accumulo/server/constraints/BulkFileColData.java index 6533f8a19ae..ff160d0a7cc 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/constraints/BulkFileColData.java +++ b/server/base/src/main/java/org/apache/accumulo/server/constraints/BulkFileColData.java @@ -27,8 +27,10 @@ * Data needed to validate a BulkFileColumn update */ class BulkFileColData { - private boolean isSplitMutation, isLocationMutation; - private final Set dataFiles, loadedFiles; + private boolean isSplitMutation; + private boolean isLocationMutation; + private final Set dataFiles; + private final Set loadedFiles; private final Set tidsSeen; BulkFileColData() { diff --git a/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java b/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java index d641c417d97..f76ae15fa93 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java +++ b/server/base/src/main/java/org/apache/accumulo/server/init/Initialize.java @@ -220,8 +220,8 @@ private void checkSASL(InitialConfiguration initConfig) final UserGroupInformation ugi = UserGroupInformation.getCurrentUser(); // We don't have any valid creds to talk to HDFS if (!ugi.hasKerberosCredentials()) { - final String accumuloKeytab = initConfig.get(Property.GENERAL_KERBEROS_KEYTAB), - accumuloPrincipal = initConfig.get(Property.GENERAL_KERBEROS_PRINCIPAL); + final String accumuloKeytab = initConfig.get(Property.GENERAL_KERBEROS_KEYTAB); + final String accumuloPrincipal = initConfig.get(Property.GENERAL_KERBEROS_PRINCIPAL); // Fail if the site configuration doesn't contain appropriate credentials if (StringUtils.isBlank(accumuloKeytab) || StringUtils.isBlank(accumuloPrincipal)) { @@ -309,7 +309,8 @@ private String getInstanceNamePrefix() { private String getInstanceNamePath(ZooReaderWriter zoo, Opts opts) throws KeeperException, InterruptedException { // set up the instance name - String instanceName, instanceNamePath = null; + String instanceName; + String instanceNamePath = null; boolean exists = true; do { if (opts.cliInstanceName == null) { diff --git a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java index fd37e171a0b..09f28e25043 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java +++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/TServerUtils.java @@ -479,7 +479,8 @@ private static ServerAddress createSaslThreadPoolServer(HostAndPort address, TPr TServerSocket transport = new TServerSocket(args); - String hostname, fqdn; + String hostname; + String fqdn; try { hostname = InetAddress.getByName(address.getHost()).getCanonicalHostName(); fqdn = InetAddress.getLocalHost().getCanonicalHostName(); diff --git a/server/base/src/main/java/org/apache/accumulo/server/security/UserImpersonation.java b/server/base/src/main/java/org/apache/accumulo/server/security/UserImpersonation.java index 7c866dab515..c6acbcc6ab5 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/security/UserImpersonation.java +++ b/server/base/src/main/java/org/apache/accumulo/server/security/UserImpersonation.java @@ -120,8 +120,10 @@ public void clear() { } public static class UsersWithHosts { - private Set users = new HashSet<>(), hosts = new HashSet<>(); - private boolean allUsers, allHosts; + private Set users = new HashSet<>(); + private Set hosts = new HashSet<>(); + private boolean allUsers; + private boolean allHosts; public UsersWithHosts() { allUsers = allHosts = false; 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 73816d2bbf2..e3805bf20d0 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 @@ -39,7 +39,8 @@ public class AuthenticationTokenKeyManager implements Runnable { private final long keyUpdateInterval; private final long tokenMaxLifetime; private int idSeq = 0; - private volatile boolean keepRunning = true, initialized = false; + private volatile boolean keepRunning = true; + private volatile boolean initialized = false; /** * Construct the key manager which will generate new AuthenticationKeys to generate and verify 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 47ecefa9f88..253cc6d5a8a 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 @@ -69,7 +69,8 @@ public synchronized void initialize() throws KeeperException, InterruptedExcepti if (zrw.exists(baseNode)) { List acls = zrw.getACL(baseNode); if (acls.size() == 1) { - ACL actualAcl = acls.get(0), expectedAcl = ZooUtil.PRIVATE.get(0); + ACL actualAcl = acls.get(0); + ACL expectedAcl = ZooUtil.PRIVATE.get(0); Id actualId = actualAcl.getId(); // The expected outcome from ZooUtil.PRIVATE if (actualAcl.getPerms() == expectedAcl.getPerms() && actualId.getScheme().equals("digest") diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java index b01ffcb82fb..54ba60ddd5b 100644 --- a/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java +++ b/server/base/src/main/java/org/apache/accumulo/server/util/Admin.java @@ -757,7 +757,8 @@ static String qualifyWithZooKeeperSessionId(ClientContext context, ZooCache zooC new MessageFormat("setauths -u {0} -s {1}\n"); private DefaultConfiguration defaultConfig; - private Map siteConfig, systemConfig; + private Map siteConfig; + private Map systemConfig; private List localUsers; public void printConfig(ClientContext context, DumpConfigCommand opts) throws Exception { diff --git a/server/base/src/test/java/org/apache/accumulo/server/rpc/TCredentialsUpdatingInvocationHandlerTest.java b/server/base/src/test/java/org/apache/accumulo/server/rpc/TCredentialsUpdatingInvocationHandlerTest.java index 86583391169..a51894c382c 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/rpc/TCredentialsUpdatingInvocationHandlerTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/rpc/TCredentialsUpdatingInvocationHandlerTest.java @@ -165,7 +165,9 @@ public void testDisallowedImpersonationForMultipleUsers() { @Test public void testAllowedImpersonationFromSpecificHost() throws Exception { - final String proxyServer = "proxy", client = "client", host = "host.domain.com"; + final String proxyServer = "proxy"; + final String client = "client"; + final String host = "host.domain.com"; conf.set(Property.INSTANCE_RPC_SASL_ALLOWED_USER_IMPERSONATION, proxyServer + ":" + client); conf.set(Property.INSTANCE_RPC_SASL_ALLOWED_HOST_IMPERSONATION, host); proxy = new TCredentialsUpdatingInvocationHandler<>(new Object(), conf); @@ -178,7 +180,9 @@ public void testAllowedImpersonationFromSpecificHost() throws Exception { @Test public void testDisallowedImpersonationFromSpecificHost() { - final String proxyServer = "proxy", client = "client", host = "host.domain.com"; + final String proxyServer = "proxy"; + final String client = "client"; + final String host = "host.domain.com"; conf.set(Property.INSTANCE_RPC_SASL_ALLOWED_USER_IMPERSONATION, proxyServer + ":" + client); conf.set(Property.INSTANCE_RPC_SASL_ALLOWED_HOST_IMPERSONATION, host); proxy = new TCredentialsUpdatingInvocationHandler<>(new Object(), conf); diff --git a/server/base/src/test/java/org/apache/accumulo/server/security/UserImpersonationTest.java b/server/base/src/test/java/org/apache/accumulo/server/security/UserImpersonationTest.java index 3f0859f57c8..d1b834b49d1 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/security/UserImpersonationTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/security/UserImpersonationTest.java @@ -108,7 +108,9 @@ public void testNoUsersByDefault() { @Test public void testSingleUserAndHost() { - String server = "server", host = "single_host.domain.com", client = "single_client"; + String server = "server"; + String host = "single_host.domain.com"; + String client = "single_client"; setValidHosts(host); setValidUsers(server, client); UserImpersonation impersonation = new UserImpersonation(conf); @@ -131,7 +133,10 @@ public void testSingleUserAndHost() { @Test public void testMultipleExplicitUsers() { - String server = "server", client1 = "client1", client2 = "client2", client3 = "client3"; + String server = "server"; + String client1 = "client1"; + String client2 = "client2"; + String client3 = "client3"; setValidHosts("*"); setValidUsers(server, Joiner.on(',').join(client1, client2, client3)); UserImpersonation impersonation = new UserImpersonation(conf); @@ -153,7 +158,10 @@ public void testMultipleExplicitUsers() { @Test public void testMultipleExplicitHosts() { - String server = "server", host1 = "host1", host2 = "host2", host3 = "host3"; + String server = "server"; + String host1 = "host1"; + String host2 = "host2"; + String host3 = "host3"; setValidHosts(Joiner.on(',').join(host1, host2, host3)); setValidUsers(server, "*"); UserImpersonation impersonation = new UserImpersonation(conf); @@ -175,8 +183,13 @@ public void testMultipleExplicitHosts() { @Test public void testMultipleExplicitUsersHosts() { - String server = "server", host1 = "host1", host2 = "host2", host3 = "host3", - client1 = "client1", client2 = "client2", client3 = "client3"; + String server = "server"; + String host1 = "host1"; + String host2 = "host2"; + String host3 = "host3"; + String client1 = "client1"; + String client2 = "client2"; + String client3 = "client3"; setValidHosts(Joiner.on(',').join(host1, host2, host3)); setValidUsers(server, Joiner.on(',').join(client1, client2, client3)); UserImpersonation impersonation = new UserImpersonation(conf); @@ -203,8 +216,14 @@ public void testMultipleExplicitUsersHosts() { @Test public void testMultipleAllowedImpersonators() { - String server1 = "server1", server2 = "server2", host1 = "host1", host2 = "host2", - host3 = "host3", client1 = "client1", client2 = "client2", client3 = "client3"; + String server1 = "server1"; + String server2 = "server2"; + String host1 = "host1"; + String host2 = "host2"; + String host3 = "host3"; + String client1 = "client1"; + String client2 = "client2"; + String client3 = "client3"; // server1 can impersonate client1 and client2 from host1 or host2 // server2 can impersonate only client3 from host3 setValidHosts(Joiner.on(',').join(host1, host2), host3); @@ -255,7 +274,8 @@ public void testMultipleAllowedImpersonators() { @Test public void testSingleUser() { - final String server = "server/hostname@EXAMPLE.COM", client = "client@EXAMPLE.COM"; + final String server = "server/hostname@EXAMPLE.COM"; + final String client = "client@EXAMPLE.COM"; conf.set(Property.INSTANCE_RPC_SASL_ALLOWED_USER_IMPERSONATION, server + ":" + client); conf.set(Property.INSTANCE_RPC_SASL_ALLOWED_HOST_IMPERSONATION, "*"); UserImpersonation impersonation = new UserImpersonation(conf); diff --git a/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationKeyTest.java b/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationKeyTest.java index c8d9e175481..5ed864e3bc0 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationKeyTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationKeyTest.java @@ -56,7 +56,8 @@ public void testNullSecretKey() { public void testAuthKey() { SecretKey secretKey = keyGen.generateKey(); int keyId = 20; - long creationDate = 38383838L, expirationDate = 83838383L; + long creationDate = 38383838L; + long expirationDate = 83838383L; AuthenticationKey authKey = new AuthenticationKey(keyId, creationDate, expirationDate, secretKey); assertEquals(secretKey, authKey.getKey()); @@ -80,7 +81,8 @@ public void testAuthKey() { public void testWritable() throws IOException { SecretKey secretKey = keyGen.generateKey(); int keyId = 20; - long creationDate = 38383838L, expirationDate = 83838383L; + long creationDate = 38383838L; + long expirationDate = 83838383L; AuthenticationKey authKey = new AuthenticationKey(keyId, creationDate, expirationDate, secretKey); ByteArrayOutputStream baos = new ByteArrayOutputStream(); diff --git a/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenKeyManagerTest.java b/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenKeyManagerTest.java index b9ec08086c2..7bbb1e120c7 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenKeyManagerTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenKeyManagerTest.java @@ -187,10 +187,12 @@ public void testStopLoop() throws InterruptedException { public void testExistingKeysAreAddedAtStartup() throws Exception { long updateInterval = 0; long tokenLifetime = 100_000L; - SecretKey secretKey1 = keyGen.generateKey(), secretKey2 = keyGen.generateKey(); + SecretKey secretKey1 = keyGen.generateKey(); + SecretKey secretKey2 = keyGen.generateKey(); - AuthenticationKey authKey1 = new AuthenticationKey(1, 0, tokenLifetime, secretKey1), - authKey2 = new AuthenticationKey(2, tokenLifetime, tokenLifetime * 2, secretKey2); + AuthenticationKey authKey1 = new AuthenticationKey(1, 0, tokenLifetime, secretKey1); + AuthenticationKey authKey2 = + new AuthenticationKey(2, tokenLifetime, tokenLifetime * 2, secretKey2); AuthenticationTokenKeyManager keyManager = new AuthenticationTokenKeyManager(secretManager, zooDistributor, updateInterval, tokenLifetime); diff --git a/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManagerTest.java b/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManagerTest.java index 7198e16883b..ca1c4d0c14b 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManagerTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/security/delegation/AuthenticationTokenSecretManagerTest.java @@ -338,9 +338,9 @@ public void testManagerKeyExpiration() throws Exception { // Make 2 keys, and add only one. The second has double the expiration of the first AuthenticationKey authKey1 = - new AuthenticationKey(1, then, then + tokenLifetime, keyGen.generateKey()), - authKey2 = new AuthenticationKey(2, then + tokenLifetime, then + tokenLifetime * 2, - keyGen.generateKey()); + new AuthenticationKey(1, then, then + tokenLifetime, keyGen.generateKey()); + AuthenticationKey authKey2 = new AuthenticationKey(2, then + tokenLifetime, + then + tokenLifetime * 2, keyGen.generateKey()); secretManager.addKey(authKey1); keyDistributor.remove(authKey1); diff --git a/server/base/src/test/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyWatcherTest.java b/server/base/src/test/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyWatcherTest.java index be333bd1d1a..1cad32921b4 100644 --- a/server/base/src/test/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyWatcherTest.java +++ b/server/base/src/test/java/org/apache/accumulo/server/security/delegation/ZooAuthenticationKeyWatcherTest.java @@ -109,9 +109,11 @@ public void testBaseNodeCreated() throws Exception { public void testBaseNodeCreatedWithChildren() throws Exception { WatchedEvent event = new WatchedEvent(EventType.NodeCreated, null, Constants.ZDELEGATION_TOKEN_KEYS); - AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()), - key2 = new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); - byte[] serializedKey1 = serialize(key1), serializedKey2 = serialize(key2); + AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()); + AuthenticationKey key2 = + new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); + byte[] serializedKey1 = serialize(key1); + byte[] serializedKey2 = serialize(key2); List children = Arrays.asList("1", "2"); expect(zk.getChildren(Constants.ZDELEGATION_TOKEN_KEYS, keyWatcher)).andReturn(children); @@ -132,9 +134,11 @@ public void testBaseNodeCreatedWithChildren() throws Exception { public void testBaseNodeChildrenChanged() throws Exception { WatchedEvent event = new WatchedEvent(EventType.NodeChildrenChanged, null, Constants.ZDELEGATION_TOKEN_KEYS); - AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()), - key2 = new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); - byte[] serializedKey1 = serialize(key1), serializedKey2 = serialize(key2); + AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()); + AuthenticationKey key2 = + new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); + byte[] serializedKey1 = serialize(key1); + byte[] serializedKey2 = serialize(key2); List children = Arrays.asList("1", "2"); expect(zk.getChildren(Constants.ZDELEGATION_TOKEN_KEYS, keyWatcher)).andReturn(children); @@ -155,8 +159,9 @@ public void testBaseNodeChildrenChanged() throws Exception { public void testBaseNodeDeleted() { WatchedEvent event = new WatchedEvent(EventType.NodeDeleted, null, Constants.ZDELEGATION_TOKEN_KEYS); - AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()), - key2 = new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); + AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()); + AuthenticationKey key2 = + new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); secretManager.addKey(key1); secretManager.addKey(key2); @@ -187,8 +192,9 @@ public void testBaseNodeDataChanged() { public void testChildChanged() throws Exception { WatchedEvent event = new WatchedEvent(EventType.NodeCreated, null, Constants.ZDELEGATION_TOKEN_KEYS + "/2"); - AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()), - key2 = new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); + AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()); + AuthenticationKey key2 = + new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); secretManager.addKey(key1); assertEquals(1, secretManager.getKeys().size()); byte[] serializedKey2 = serialize(key2); @@ -208,8 +214,9 @@ public void testChildChanged() throws Exception { public void testChildDeleted() { WatchedEvent event = new WatchedEvent(EventType.NodeDeleted, null, Constants.ZDELEGATION_TOKEN_KEYS + "/1"); - AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()), - key2 = new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); + AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()); + AuthenticationKey key2 = + new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); secretManager.addKey(key1); secretManager.addKey(key2); assertEquals(2, secretManager.getKeys().size()); @@ -227,8 +234,10 @@ public void testChildDeleted() { public void testChildChildrenChanged() { WatchedEvent event = new WatchedEvent(EventType.NodeChildrenChanged, null, Constants.ZDELEGATION_TOKEN_KEYS + "/2"); - AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()), - key2 = new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); + AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()); + AuthenticationKey key2 = + new AuthenticationKey(2, key1.getExpirationDate(), 20000L, keyGen.generateKey()); + secretManager.addKey(key1); secretManager.addKey(key2); assertEquals(2, secretManager.getKeys().size()); @@ -259,8 +268,9 @@ public void testInitialUpdateNoNode() throws Exception { @Test public void testInitialUpdateWithKeys() throws Exception { List children = Arrays.asList("1", "5"); - AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()), - key2 = new AuthenticationKey(5, key1.getExpirationDate(), 20000L, keyGen.generateKey()); + AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()); + AuthenticationKey key2 = + new AuthenticationKey(5, key1.getExpirationDate(), 20000L, keyGen.generateKey()); expect(zk.exists(Constants.ZDELEGATION_TOKEN_KEYS, keyWatcher)).andReturn(new Stat()); expect(zk.getChildren(Constants.ZDELEGATION_TOKEN_KEYS, keyWatcher)).andReturn(children); @@ -294,8 +304,9 @@ private void lostZooKeeperBase(WatchedEvent disconnectEvent, WatchedEvent reconn throws Exception { List children = Arrays.asList("1", "5"); - AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()), - key2 = new AuthenticationKey(5, key1.getExpirationDate(), 20000L, keyGen.generateKey()); + AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()); + AuthenticationKey key2 = + new AuthenticationKey(5, key1.getExpirationDate(), 20000L, keyGen.generateKey()); expect(zk.exists(Constants.ZDELEGATION_TOKEN_KEYS, keyWatcher)).andReturn(new Stat()); expect(zk.getChildren(Constants.ZDELEGATION_TOKEN_KEYS, keyWatcher)).andReturn(children); diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CleanUp.java b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CleanUp.java index ce2a5f1ab37..6ddad0e44fd 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CleanUp.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/compact/CleanUp.java @@ -71,7 +71,10 @@ public long isReady(FateId fateId, Manager manager) throws Exception { } }; - long t1, t2, submitted = 0, total = 0; + long t1; + long t2; + long submitted = 0; + long total = 0; try ( var tablets = ample.readTablets().forTable(tableId).overlapping(startRow, endRow) diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/tableImport/PopulateMetadataTable.java b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/tableImport/PopulateMetadataTable.java index 0f1b65dc310..36944987cdd 100644 --- a/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/tableImport/PopulateMetadataTable.java +++ b/server/manager/src/main/java/org/apache/accumulo/manager/tableOps/tableImport/PopulateMetadataTable.java @@ -78,7 +78,8 @@ static void readMappingFile(VolumeManager fs, ImportedTableInfo tableInfo, Strin try (var fsDis = fs.open(new Path(importDir, IMPORT_MAPPINGS_FILE)); var isr = new InputStreamReader(fsDis, UTF_8); BufferedReader in = new BufferedReader(isr)) { - String line, prev; + String line; + String prev; while ((line = in.readLine()) != null) { String[] sa = line.split(":", 2); prev = fileNameMappings.put(sa[0], importDir + "/" + sa[1]); diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/SummaryInformation.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/SummaryInformation.java index 79d59df597a..3880c2e79f4 100644 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/SummaryInformation.java +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/SummaryInformation.java @@ -42,7 +42,8 @@ public class SummaryInformation { // Variable names become JSON keys public List servers = new ArrayList<>(); - public String managerGoalState, managerState; + public String managerGoalState; + public String managerState; public BadTabletServers badTabletServers; public ServersShuttingDown tabletServersShuttingDown; diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/ServerStat.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/ServerStat.java index fc19a18b7af..7b4d4af22ba 100644 --- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/ServerStat.java +++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/ServerStat.java @@ -29,7 +29,8 @@ public class ServerStat { public int max; public boolean adjustMax; public float significance; - public String description, name; + public String description; + public String name; public boolean derived; public ServerStat() {} diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java index 9dd1229fc54..cae47debefe 100644 --- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java +++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java @@ -583,7 +583,8 @@ boolean initiateMinorCompaction(long flushId, MinorCompactionReason mincReason) private MinorCompactionTask createMinorCompactionTask(long flushId, MinorCompactionReason mincReason) { MinorCompactionTask mct; - long t1, t2; + long t1; + long t2; StringBuilder logMessage = null; diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java index 2c634f8d856..78947874331 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java +++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java @@ -1107,7 +1107,8 @@ public void checkTableState() { private void printConstraintViolationException(ConstraintViolationException cve) { printException(cve, ""); - int COL1 = 50, COL2 = 14; + int COL1 = 50; + int COL2 = 14; int col3 = Math.max(1, Math.min(Integer.MAX_VALUE, terminal.getWidth() - COL1 - COL2 - 6)); logError(String.format("%" + COL1 + "s-+-%" + COL2 + "s-+-%" + col3 + "s%n", repeat("-", COL1), repeat("-", COL2), repeat("-", col3))); diff --git a/shell/src/main/java/org/apache/accumulo/shell/ShellCompletor.java b/shell/src/main/java/org/apache/accumulo/shell/ShellCompletor.java index 31111cabf26..12c4c40d638 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/ShellCompletor.java +++ b/shell/src/main/java/org/apache/accumulo/shell/ShellCompletor.java @@ -61,7 +61,9 @@ public void complete(LineReader reader, ParsedLine line, List candida } private int _complete(String fullBuffer, int cursor, List candidates) { - boolean inTableFlag = false, inUserFlag = false, inNamespaceFlag = false; + boolean inTableFlag = false; + boolean inUserFlag = false; + boolean inNamespaceFlag = false; // Only want to grab the buffer up to the cursor because // the user could be trying to tab complete in the middle // of the line diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/AddSplitsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/AddSplitsCommand.java index 84119f3dad0..ca7e6a45536 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/AddSplitsCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/AddSplitsCommand.java @@ -31,7 +31,8 @@ import org.apache.hadoop.io.Text; public class AddSplitsCommand extends Command { - private Option optSplitsFile, base64Opt; + private Option optSplitsFile; + private Option base64Opt; @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/CompactCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/CompactCommand.java index 9b09365a498..363475862ed 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/CompactCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/CompactCommand.java @@ -39,13 +39,30 @@ import org.apache.commons.cli.Options; public class CompactCommand extends TableOperation { - private Option noFlushOption, waitOpt, profileOpt, cancelOpt; + private Option noFlushOption; + private Option waitOpt; + private Option profileOpt; + private Option cancelOpt; // file selection and file output options - private Option enameOption, epathOption, sizeLtOption, sizeGtOption, minFilesOption, - outBlockSizeOpt, outHdfsBlockSizeOpt, outIndexBlockSizeOpt, outCompressionOpt, outReplication, - enoSampleOption, extraSummaryOption, enoSummaryOption, hintsOption, configurerOpt, - configurerConfigOpt, selectorOpt, selectorConfigOpt; + private Option enameOption; + private Option epathOption; + private Option sizeLtOption; + private Option sizeGtOption; + private Option minFilesOption; + private Option outBlockSizeOpt; + private Option outHdfsBlockSizeOpt; + private Option outIndexBlockSizeOpt; + private Option outCompressionOpt; + private Option outReplication; + private Option enoSampleOption; + private Option extraSummaryOption; + private Option enoSummaryOption; + private Option hintsOption; + private Option configurerOpt; + private Option configurerConfigOpt; + private Option selectorOpt; + private Option selectorConfigOpt; private CompactionConfig compactionConfig = null; diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java index 9be5d8fb5e0..3e4a5f6dd08 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java @@ -53,10 +53,18 @@ import com.google.common.collect.ImmutableSortedMap; public class ConfigCommand extends Command { - private Option tableOpt, deleteOpt, setOpt, forceOpt, filterOpt, filterWithValuesOpt, - disablePaginationOpt, outputFileOpt, namespaceOpt; - - private int COL1 = 10, COL2 = 7; + private Option tableOpt; + private Option deleteOpt; + private Option setOpt; + private Option forceOpt; + private Option filterOpt; + private Option filterWithValuesOpt; + private Option disablePaginationOpt; + private Option outputFileOpt; + private Option namespaceOpt; + + private int COL1 = 10; + private int COL2 = 7; private LineReader reader; @Override diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java index 9a768bf92c9..37e43fa8783 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DUCommand.java @@ -50,7 +50,9 @@ */ public class DUCommand extends Command { - private Option optTablePattern, optHumanReadble, optNamespace; + private Option optTablePattern; + private Option optHumanReadble; + private Option optNamespace; @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteCommand.java index 34917247580..e5d9b2a68db 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteCommand.java @@ -38,7 +38,8 @@ import org.apache.hadoop.io.Text; public class DeleteCommand extends Command { - private Option deleteOptAuths, timestampOpt; + private Option deleteOptAuths; + private Option timestampOpt; private Option timeoutOption; protected long getTimeout(final CommandLine cl) { diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteIterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteIterCommand.java index c90e1f45bf9..b4fff1e0498 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteIterCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteIterCommand.java @@ -29,7 +29,11 @@ import org.apache.commons.cli.Options; public class DeleteIterCommand extends Command { - private Option allScopeOpt, mincScopeOpt, majcScopeOpt, scanScopeOpt, nameOpt; + private Option allScopeOpt; + private Option mincScopeOpt; + private Option majcScopeOpt; + private Option scanScopeOpt; + private Option nameOpt; @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteShellIterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteShellIterCommand.java index a6f6f0082d2..8965a4316d2 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteShellIterCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteShellIterCommand.java @@ -30,7 +30,9 @@ import org.apache.commons.cli.Options; public class DeleteShellIterCommand extends Command { - private Option nameOpt, allOpt, profileOpt; + private Option nameOpt; + private Option allOpt; + private Option profileOpt; @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ExtensionCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ExtensionCommand.java index b48403659d9..e0f9f7d23db 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ExtensionCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ExtensionCommand.java @@ -32,7 +32,9 @@ public class ExtensionCommand extends Command { - protected Option enable, disable, list; + protected Option enable; + protected Option disable; + protected Option list; private ServiceLoader extensions = null; diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/GetSplitsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/GetSplitsCommand.java index 4a858d0aec1..e0bba10e552 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/GetSplitsCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/GetSplitsCommand.java @@ -47,7 +47,10 @@ public class GetSplitsCommand extends Command { - private Option outputFileOpt, maxSplitsOpt, base64Opt, verboseOpt; + private Option outputFileOpt; + private Option maxSplitsOpt; + private Option base64Opt; + private Option verboseOpt; @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/GrantCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/GrantCommand.java index b7021387d6d..023041bde46 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/GrantCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/GrantCommand.java @@ -39,7 +39,8 @@ public class GrantCommand extends TableOperation { disableUnflaggedTableOptions(); } - private Option systemOpt, userOpt; + private Option systemOpt; + private Option userOpt; private String user; private String[] permission; diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/InsertCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/InsertCommand.java index 5b183b8f044..2b76d338bdb 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/InsertCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/InsertCommand.java @@ -47,7 +47,8 @@ import org.apache.hadoop.io.Text; public class InsertCommand extends Command { - private Option insertOptAuths, timestampOpt; + private Option insertOptAuths; + private Option timestampOpt; private Option timeoutOption; private Option durabilityOption; diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ListBulkCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ListBulkCommand.java index 2f6625bbe1a..117747c4958 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ListBulkCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ListBulkCommand.java @@ -30,7 +30,8 @@ public class ListBulkCommand extends Command { - private Option tserverOption, disablePaginationOpt; + private Option tserverOption; + private Option disablePaginationOpt; @Override public String description() { diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ListCompactionsCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ListCompactionsCommand.java index 2aec7dfce68..8f6f3607e62 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ListCompactionsCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ListCompactionsCommand.java @@ -34,7 +34,11 @@ public class ListCompactionsCommand extends Command { - private Option serverOpt, tserverOption, rgOpt, disablePaginationOpt, filterOption; + private Option serverOpt; + private Option tserverOption; + private Option rgOpt; + private Option disablePaginationOpt; + private Option filterOption; @Override public String description() { diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ListIterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ListIterCommand.java index 588064f7af1..3075551eb3c 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ListIterCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ListIterCommand.java @@ -35,7 +35,8 @@ import org.apache.commons.cli.Options; public class ListIterCommand extends Command { - private Option nameOpt, allScopesOpt; + private Option nameOpt; + private Option allScopesOpt; private Map scopeOpts; @Override diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ListScansCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ListScansCommand.java index dbda36a8c0b..3daf90826a3 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ListScansCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ListScansCommand.java @@ -43,7 +43,10 @@ public class ListScansCommand extends Command { - private Option serverOpt, tserverOption, rgOpt, disablePaginationOpt; + private Option serverOpt; + private Option tserverOption; + private Option rgOpt; + private Option disablePaginationOpt; @Override public String description() { diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ListShellIterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ListShellIterCommand.java index 70f881ea138..42f08cc0128 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ListShellIterCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ListShellIterCommand.java @@ -31,7 +31,8 @@ public class ListShellIterCommand extends Command { - private Option nameOpt, profileOpt; + private Option nameOpt; + private Option profileOpt; @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/MergeCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/MergeCommand.java index d6a74fce231..846b1f73d86 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/MergeCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/MergeCommand.java @@ -28,7 +28,10 @@ import org.apache.hadoop.io.Text; public class MergeCommand extends Command { - private Option verboseOpt, forceOpt, sizeOpt, allOpt; + private Option verboseOpt; + private Option forceOpt; + private Option sizeOpt; + private Option allOpt; @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/NamespacesCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/NamespacesCommand.java index 2298b735d7b..e298886f9e1 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/NamespacesCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/NamespacesCommand.java @@ -35,7 +35,8 @@ import com.google.common.collect.Iterators; public class NamespacesCommand extends Command { - private Option disablePaginationOpt, namespaceIdOption; + private Option disablePaginationOpt; + private Option namespaceIdOption; private static final String DEFAULT_NAMESPACE_DISPLAY_NAME = "\"\""; diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/PingCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/PingCommand.java index fb73bd34d79..a2f8a0b0c3e 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/PingCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/PingCommand.java @@ -31,7 +31,9 @@ public class PingCommand extends Command { - private Option serverOption, tserverOption, disablePaginationOpt; + private Option serverOption; + private Option tserverOption; + private Option disablePaginationOpt; @Override public String description() { diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/RevokeCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/RevokeCommand.java index 5fb2fe4d650..4743d26a780 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/RevokeCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/RevokeCommand.java @@ -39,7 +39,8 @@ public class RevokeCommand extends TableOperation { disableUnflaggedTableOptions(); } - private Option systemOpt, userOpt; + private Option systemOpt; + private Option userOpt; private String user; private String[] permission; diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java index 11570b1d908..dbcd19c1a14 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java @@ -56,8 +56,13 @@ public class ScanCommand extends Command { - private Option scanOptAuths, scanOptRow, scanOptColumns, disablePaginationOpt, outputFileOpt, - scanOptCf, scanOptCq; + private Option scanOptAuths; + private Option scanOptRow; + private Option scanOptColumns; + private Option disablePaginationOpt; + private Option outputFileOpt; + private Option scanOptCf; + private Option scanOptCq; protected Option showFewOpt; protected Option timestampOpt; diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/SetIterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/SetIterCommand.java index 40816fa6519..686a1e3ff92 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/SetIterCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/SetIterCommand.java @@ -53,9 +53,18 @@ public class SetIterCommand extends Command { - private Option allScopeOpt, mincScopeOpt, majcScopeOpt, scanScopeOpt; - Option profileOpt, priorityOpt, nameOpt; - Option ageoffTypeOpt, regexTypeOpt, versionTypeOpt, reqvisTypeOpt, classnameTypeOpt; + private Option allScopeOpt; + private Option mincScopeOpt; + private Option majcScopeOpt; + private Option scanScopeOpt; + Option profileOpt; + Option priorityOpt; + Option nameOpt; + Option ageoffTypeOpt; + Option regexTypeOpt; + Option versionTypeOpt; + Option reqvisTypeOpt; + Option classnameTypeOpt; @Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java index 06e3dcd19b2..7f567700662 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java @@ -36,7 +36,9 @@ import org.apache.commons.cli.ParseException; public abstract class ShellPluginConfigurationCommand extends Command { - private Option removePluginOption, pluginClassOption, listPluginOption; + private Option removePluginOption; + private Option pluginClassOption; + private Option listPluginOption; private String pluginType; diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/TableOperation.java b/shell/src/main/java/org/apache/accumulo/shell/commands/TableOperation.java index cf17dcb3c49..02641531b2c 100644 --- a/shell/src/main/java/org/apache/accumulo/shell/commands/TableOperation.java +++ b/shell/src/main/java/org/apache/accumulo/shell/commands/TableOperation.java @@ -39,7 +39,9 @@ public abstract class TableOperation extends Command { - protected Option optTablePattern, optTableName, optNamespace; + protected Option optTablePattern; + protected Option optTableName; + protected Option optNamespace; private boolean force = true; private boolean useCommandLine = true; diff --git a/test/src/main/java/org/apache/accumulo/harness/MiniClusterHarness.java b/test/src/main/java/org/apache/accumulo/harness/MiniClusterHarness.java index 8f194971c3f..de1f612a8d6 100644 --- a/test/src/main/java/org/apache/accumulo/harness/MiniClusterHarness.java +++ b/test/src/main/java/org/apache/accumulo/harness/MiniClusterHarness.java @@ -152,8 +152,8 @@ protected void configureForSsl(MiniAccumuloConfigImpl cfg, File folder) { File rootKeystoreFile = sslDir.resolve("root-" + cfg.getInstanceName() + ".jks").toFile(); File localKeystoreFile = sslDir.resolve("local-" + cfg.getInstanceName() + ".jks").toFile(); File publicTruststoreFile = sslDir.resolve("public-" + cfg.getInstanceName() + ".jks").toFile(); - final String rootKeystorePassword = "root_keystore_password", - truststorePassword = "truststore_password"; + final String rootKeystorePassword = "root_keystore_password"; + final String truststorePassword = "truststore_password"; try { new CertUtils(Property.RPC_SSL_KEYSTORE_TYPE.getDefaultValue(), "o=Apache Accumulo,cn=MiniAccumuloCluster", "RSA", 4096, "SHA512WITHRSA").createAll( diff --git a/test/src/main/java/org/apache/accumulo/harness/TestingKdc.java b/test/src/main/java/org/apache/accumulo/harness/TestingKdc.java index 045c21621e2..361d3bb7245 100644 --- a/test/src/main/java/org/apache/accumulo/harness/TestingKdc.java +++ b/test/src/main/java/org/apache/accumulo/harness/TestingKdc.java @@ -46,10 +46,12 @@ public class TestingKdc { public static final long MAX_TICKET_LIFETIME_MILLIS = 86400000; // one day protected MiniKdc kdc = null; - protected ClusterUser accumuloServerUser = null, accumuloAdmin = null; + protected ClusterUser accumuloServerUser = null; + protected ClusterUser accumuloAdmin = null; protected List clientPrincipals = null; - public final String ORG_NAME = "EXAMPLE", ORG_DOMAIN = "COM"; + public final String ORG_NAME = "EXAMPLE"; + public final String ORG_DOMAIN = "COM"; private String hostname; private File keytabDir; diff --git a/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloClusterPropertyConfiguration.java b/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloClusterPropertyConfiguration.java index 74b45a0c7c8..69928bb8131 100644 --- a/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloClusterPropertyConfiguration.java +++ b/test/src/main/java/org/apache/accumulo/harness/conf/AccumuloClusterPropertyConfiguration.java @@ -55,7 +55,8 @@ public abstract class AccumuloClusterPropertyConfiguration implements AccumuloCl @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "path provided by test") public static AccumuloClusterPropertyConfiguration get() { - String clusterTypeValue = null, clientConf = null; + String clusterTypeValue = null; + String clientConf = null; String propertyFile = System.getProperty(ACCUMULO_IT_PROPERTIES_FILE); if (propertyFile != null) { diff --git a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java b/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java index 35ef803e566..c8a47dc939a 100644 --- a/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java +++ b/test/src/main/java/org/apache/accumulo/test/BadDeleteMarkersCreatedIT.java @@ -78,7 +78,8 @@ public void getTimeoutFactor() { timeoutFactor = Wait.getTimeoutFactor(e -> 1); } - private String gcCycleDelay, gcCycleStart; + private String gcCycleDelay; + private String gcCycleStart; @BeforeEach public void alterConfig() throws Exception { diff --git a/test/src/main/java/org/apache/accumulo/test/BatchWriterInTabletServerIT.java b/test/src/main/java/org/apache/accumulo/test/BatchWriterInTabletServerIT.java index 7e5bb5a60e3..0cf4f8658a7 100644 --- a/test/src/main/java/org/apache/accumulo/test/BatchWriterInTabletServerIT.java +++ b/test/src/main/java/org/apache/accumulo/test/BatchWriterInTabletServerIT.java @@ -63,7 +63,8 @@ public boolean canRunTest(ClusterType type) { @Test public void testNormalWrite() throws Exception { String[] uniqueNames = getUniqueNames(2); - String t1 = uniqueNames[0], t2 = uniqueNames[1]; + String t1 = uniqueNames[0]; + String t2 = uniqueNames[1]; try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) { int numEntriesToWritePerEntry = 50; IteratorSetting itset = BatchWriterIterator.iteratorSetting(6, 0, 15, 1000, @@ -83,7 +84,8 @@ public void testNormalWrite() throws Exception { @Test public void testClearLocatorAndSplitWrite() throws Exception { String[] uniqueNames = getUniqueNames(2); - String t1 = uniqueNames[0], t2 = uniqueNames[1]; + String t1 = uniqueNames[0]; + String t2 = uniqueNames[1]; try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) { int numEntriesToWritePerEntry = 50; IteratorSetting itset = BatchWriterIterator.iteratorSetting(6, 0, 15, 1000, diff --git a/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java b/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java index 901dba56dfb..3ae51fe40c3 100644 --- a/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java +++ b/test/src/main/java/org/apache/accumulo/test/BatchWriterIterator.java @@ -205,7 +205,9 @@ private void initBatchWriter() { private void processNext() { assert hasTop(); Key k = getTopKey(); - Text row = k.getRow(), cf = k.getColumnFamily(), cq = k.getColumnQualifier(); + Text row = k.getRow(); + Text cf = k.getColumnFamily(); + Text cq = k.getColumnQualifier(); Value v = super.getTopValue(); String failure = null; try { diff --git a/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java b/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java index d2d5dd2cc79..11d0351d0e2 100644 --- a/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java +++ b/test/src/main/java/org/apache/accumulo/test/ConditionalWriterIT.java @@ -1335,7 +1335,9 @@ public void testSecurity() throws Exception { } String[] tables = getUniqueNames(3); - String table1 = tables[0], table2 = tables[1], table3 = tables[2]; + String table1 = tables[0]; + String table2 = tables[1]; + String table3 = tables[2]; // Create three tables client.tableOperations().create(table1); diff --git a/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java b/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java index 21c0e6eac7e..90b884e249e 100644 --- a/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java +++ b/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java @@ -260,7 +260,8 @@ public void testExportImportOffline(boolean fenced) throws Exception { try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) { String[] tableNames = getUniqueNames(2); - String srcTable = tableNames[0], destTable = tableNames[1]; + String srcTable = tableNames[0]; + String destTable = tableNames[1]; client.tableOperations().create(srcTable); try (BatchWriter bw = client.createBatchWriter(srcTable)) { @@ -408,7 +409,8 @@ public void testImportedTableIsOnDemand() throws Exception { try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) { String[] tableNames = getUniqueNames(2); - String srcTable = tableNames[0], destTable = tableNames[1]; + String srcTable = tableNames[0]; + String destTable = tableNames[1]; client.tableOperations().create(srcTable); String srcTableId = client.tableOperations().tableIdMap().get(srcTable); @@ -602,13 +604,15 @@ public void importV2data() throws Exception { private void verifyTableEquality(AccumuloClient client, String srcTable, String destTable, int expected) throws Exception { Iterator> src = - client.createScanner(srcTable, Authorizations.EMPTY).iterator(), - dest = client.createScanner(destTable, Authorizations.EMPTY).iterator(); + client.createScanner(srcTable, Authorizations.EMPTY).iterator(); + Iterator> dest = + client.createScanner(destTable, Authorizations.EMPTY).iterator(); assertTrue(src.hasNext(), "Could not read any data from source table"); assertTrue(dest.hasNext(), "Could not read any data from destination table"); int entries = 0; while (src.hasNext() && dest.hasNext()) { - Entry orig = src.next(), copy = dest.next(); + Entry orig = src.next(); + Entry copy = dest.next(); assertEquals(orig.getKey(), copy.getKey()); assertEquals(orig.getValue(), copy.getValue()); entries++; diff --git a/test/src/main/java/org/apache/accumulo/test/KeyValueEqualityIT.java b/test/src/main/java/org/apache/accumulo/test/KeyValueEqualityIT.java index 044d243edc6..7642140a4b6 100644 --- a/test/src/main/java/org/apache/accumulo/test/KeyValueEqualityIT.java +++ b/test/src/main/java/org/apache/accumulo/test/KeyValueEqualityIT.java @@ -48,7 +48,8 @@ public void testEquality() throws Exception { try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) { final String[] tables = getUniqueNames(2); - final String table1 = tables[0], table2 = tables[1]; + final String table1 = tables[0]; + final String table2 = tables[1]; final TableOperations tops = client.tableOperations(); tops.create(table1); tops.create(table2); @@ -66,12 +67,13 @@ public void testEquality() throws Exception { } } - Iterator> t1 = client.createScanner(table1, Authorizations.EMPTY).iterator(), - t2 = client.createScanner(table2, Authorizations.EMPTY).iterator(); + Iterator> t1 = client.createScanner(table1, Authorizations.EMPTY).iterator(); + Iterator> t2 = client.createScanner(table2, Authorizations.EMPTY).iterator(); while (t1.hasNext() && t2.hasNext()) { // KeyValue, the implementation of Entry, should support equality and hashCode // properly - Entry e1 = t1.next(), e2 = t2.next(); + Entry e1 = t1.next(); + Entry e2 = t2.next(); assertEquals(e1, e2); assertEquals(e1.hashCode(), e2.hashCode()); } diff --git a/test/src/main/java/org/apache/accumulo/test/MultiTableBatchWriterIT_SimpleSuite.java b/test/src/main/java/org/apache/accumulo/test/MultiTableBatchWriterIT_SimpleSuite.java index d702811be32..bd1ba0e83cb 100644 --- a/test/src/main/java/org/apache/accumulo/test/MultiTableBatchWriterIT_SimpleSuite.java +++ b/test/src/main/java/org/apache/accumulo/test/MultiTableBatchWriterIT_SimpleSuite.java @@ -90,7 +90,8 @@ public void testTableRenameDataValidation() throws Exception { try { final String[] names = getUniqueNames(2); - final String table1 = names[0], table2 = names[1]; + final String table1 = names[0]; + final String table2 = names[1]; TableOperations tops = accumuloClient.tableOperations(); tops.create(table1); @@ -155,14 +156,17 @@ public void testTableRenameSameWriters() throws Exception { try { final String[] names = getUniqueNames(4); - final String table1 = names[0], table2 = names[1]; - final String newTable1 = names[2], newTable2 = names[3]; + final String table1 = names[0]; + final String table2 = names[1]; + final String newTable1 = names[2]; + final String newTable2 = names[3]; TableOperations tops = accumuloClient.tableOperations(); tops.create(table1); tops.create(table2); - BatchWriter bw1 = mtbw.getBatchWriter(table1), bw2 = mtbw.getBatchWriter(table2); + BatchWriter bw1 = mtbw.getBatchWriter(table1); + BatchWriter bw2 = mtbw.getBatchWriter(table2); Mutation m1 = new Mutation("foo"); m1.put("col1", "", "val1"); @@ -212,14 +216,17 @@ public void testTableRenameNewWriters() throws Exception { try { final String[] names = getUniqueNames(4); - final String table1 = names[0], table2 = names[1]; - final String newTable1 = names[2], newTable2 = names[3]; + final String table1 = names[0]; + final String table2 = names[1]; + final String newTable1 = names[2]; + final String newTable2 = names[3]; TableOperations tops = accumuloClient.tableOperations(); tops.create(table1); tops.create(table2); - BatchWriter bw1 = mtbw.getBatchWriter(table1), bw2 = mtbw.getBatchWriter(table2); + BatchWriter bw1 = mtbw.getBatchWriter(table1); + BatchWriter bw2 = mtbw.getBatchWriter(table2); Mutation m1 = new Mutation("foo"); m1.put("col1", "", "val1"); @@ -282,14 +289,17 @@ public void testTableRenameNewWritersNoCaching() throws Exception { try { final String[] names = getUniqueNames(4); - final String table1 = names[0], table2 = names[1]; - final String newTable1 = names[2], newTable2 = names[3]; + final String table1 = names[0]; + final String table2 = names[1]; + final String newTable1 = names[2]; + final String newTable2 = names[3]; TableOperations tops = accumuloClient.tableOperations(); tops.create(table1); tops.create(table2); - BatchWriter bw1 = mtbw.getBatchWriter(table1), bw2 = mtbw.getBatchWriter(table2); + BatchWriter bw1 = mtbw.getBatchWriter(table1); + BatchWriter bw2 = mtbw.getBatchWriter(table2); Mutation m1 = new Mutation("foo"); m1.put("col1", "", "val1"); @@ -319,13 +329,15 @@ public void testTableDelete() throws Exception { try { final String[] names = getUniqueNames(2); - final String table1 = names[0], table2 = names[1]; + final String table1 = names[0]; + final String table2 = names[1]; TableOperations tops = accumuloClient.tableOperations(); tops.create(table1); tops.create(table2); - BatchWriter bw1 = mtbw.getBatchWriter(table1), bw2 = mtbw.getBatchWriter(table2); + BatchWriter bw1 = mtbw.getBatchWriter(table1); + BatchWriter bw2 = mtbw.getBatchWriter(table2); Mutation m1 = new Mutation("foo"); m1.put("col1", "", "val1"); @@ -370,13 +382,15 @@ public void testOfflineTable() throws Exception { try { final String[] names = getUniqueNames(2); - final String table1 = names[0], table2 = names[1]; + final String table1 = names[0]; + final String table2 = names[1]; TableOperations tops = accumuloClient.tableOperations(); tops.create(table1); tops.create(table2); - BatchWriter bw1 = mtbw.getBatchWriter(table1), bw2 = mtbw.getBatchWriter(table2); + BatchWriter bw1 = mtbw.getBatchWriter(table1); + BatchWriter bw2 = mtbw.getBatchWriter(table2); Mutation m1 = new Mutation("foo"); m1.put("col1", "", "val1"); diff --git a/test/src/main/java/org/apache/accumulo/test/NamespacesIT_SimpleSuite.java b/test/src/main/java/org/apache/accumulo/test/NamespacesIT_SimpleSuite.java index c3e3bbbdc30..75f2d315622 100644 --- a/test/src/main/java/org/apache/accumulo/test/NamespacesIT_SimpleSuite.java +++ b/test/src/main/java/org/apache/accumulo/test/NamespacesIT_SimpleSuite.java @@ -679,7 +679,10 @@ private void loginAs(ClusterUser user) throws IOException { */ @Test public void testPermissions() throws Exception { - ClusterUser user1 = getUser(0), user2 = getUser(1), root = getAdminUser(); + ClusterUser user1 = getUser(0); + ClusterUser user2 = getUser(1); + ClusterUser root = getAdminUser(); + String u1 = user1.getPrincipal(); String u2 = user2.getPrincipal(); PasswordToken pass = diff --git a/test/src/main/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java b/test/src/main/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java index 90f81ee33d5..ae78d12d62c 100644 --- a/test/src/main/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java +++ b/test/src/main/java/org/apache/accumulo/test/TableConfigurationUpdateIT.java @@ -103,7 +103,8 @@ public static class TableConfRunner implements Callable { private static final Property prop = Property.TABLE_SPLIT_THRESHOLD; private AccumuloConfiguration tableConf; private CountDownLatch countDown; - private int iterations, randMax; + private int iterations; + private int randMax; public TableConfRunner(int randMax, int iterations, AccumuloConfiguration tableConf, CountDownLatch countDown) { diff --git a/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java b/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java index 5af6b261686..a31178ecae3 100644 --- a/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java +++ b/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java @@ -331,7 +331,8 @@ public void createMergeClonedTable() throws Exception { for (Entry entry : s) { final Key key = entry.getKey(); String row = key.getRow().toString(); - String cf = key.getColumnFamily().toString(), cq = key.getColumnQualifier().toString(); + String cf = key.getColumnFamily().toString(); + String cq = key.getColumnQualifier().toString(); String value = entry.getValue().toString(); if (rowCounts.containsKey(row)) { diff --git a/test/src/main/java/org/apache/accumulo/test/TestBinaryRows.java b/test/src/main/java/org/apache/accumulo/test/TestBinaryRows.java index 7fea8091c64..91ec13c8e9b 100644 --- a/test/src/main/java/org/apache/accumulo/test/TestBinaryRows.java +++ b/test/src/main/java/org/apache/accumulo/test/TestBinaryRows.java @@ -96,8 +96,10 @@ public static class Opts extends ServerUtilOpts { public static void runTest(AccumuloClient accumuloClient, Opts opts) throws Exception { - final Text CF = new Text("cf"), CQ = new Text("cq"); - final byte[] CF_BYTES = "cf".getBytes(UTF_8), CQ_BYTES = "cq".getBytes(UTF_8); + final Text CF = new Text("cf"); + final Text CQ = new Text("cq"); + final byte[] CF_BYTES = "cf".getBytes(UTF_8); + final byte[] CQ_BYTES = "cq".getBytes(UTF_8); if (opts.mode.equals("ingest") || opts.mode.equals("delete")) { try (BatchWriter bw = accumuloClient.createBatchWriter(opts.tableName)) { boolean delete = opts.mode.equals("delete"); diff --git a/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java b/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java index 30e8eb24269..190f97ebfa7 100644 --- a/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java +++ b/test/src/main/java/org/apache/accumulo/test/VolumeChooserIT.java @@ -81,7 +81,9 @@ static final String getPerTableProp(Scope scope) { private static final Text EMPTY = new Text(); private static final Value EMPTY_VALUE = new Value(); private File volDirBase; - private Path v1, v2, v3; + private Path v1; + private Path v2; + private Path v3; public static String[] alpha_rows = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z".split(","); private String namespace1; diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java index 84dc9cd7735..1a0276a9806 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java @@ -84,7 +84,8 @@ public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoo private static final int NUM_SPLITS = 200; - private String UNUSED_TABLE, TEST_TABLE; + private String UNUSED_TABLE; + private String TEST_TABLE; private AccumuloClient accumuloClient; @@ -189,7 +190,8 @@ public void test() throws Exception { List.of(tabletsPerServer)); continue; } - long min = NumberUtils.min(tabletsPerServer), max = NumberUtils.max(tabletsPerServer); + long min = NumberUtils.min(tabletsPerServer); + long max = NumberUtils.max(tabletsPerServer); log.debug("Min={}, Max={}", min, max); if ((min / ((double) max)) < 0.5) { log.debug( diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java index 40e17a9e614..d3666eba1d7 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/BloomFilterIT.java @@ -192,7 +192,9 @@ private long query(AccumuloClient c, String table, int depth, long start, long e HashSet expected = new HashSet<>(); List ranges = new ArrayList<>(num); Text key = new Text(); - Text row = new Text("row"), cq = new Text("cq"), cf = new Text("cf"); + Text row = new Text("row"); + Text cq = new Text("cq"); + Text cf = new Text("cf"); for (int i = 0; i < num; ++i) { Long k = ((RANDOM.get().nextLong() & 0x7fffffffffffffffL) % (end - start)) + start; diff --git a/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT_SimpleSuite.java b/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT_SimpleSuite.java index eaf94829978..dcabbcb9472 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT_SimpleSuite.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/CloneTestIT_SimpleSuite.java @@ -167,7 +167,8 @@ private void checkMetadata(String table, AccumuloClient client) throws Exception s.setRange(Range.prefix(tableId)); Key k; - Text cf = new Text(), cq = new Text(); + Text cf = new Text(); + Text cq = new Text(); int itemsInspected = 0; var pattern = Pattern.compile("[tc]-[0-9a-z]+"); for (Entry entry : s) { diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java b/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java index 05dbc77404b..8d2c5217256 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/ConfigurableMacBase.java @@ -99,8 +99,8 @@ protected static void configureForSsl(MiniAccumuloConfigImpl cfg, File sslDir) { File localKeystoreFile = sslDirPath.resolve("local-" + cfg.getInstanceName() + ".jks").toFile(); File publicTruststoreFile = sslDirPath.resolve("public-" + cfg.getInstanceName() + ".jks").toFile(); - final String rootKeystorePassword = "root_keystore_password", - truststorePassword = "truststore_password"; + final String rootKeystorePassword = "root_keystore_password"; + final String truststorePassword = "truststore_password"; try { String hostname = InetAddress.getLocalHost().getHostName(); new CertUtils(Property.RPC_SSL_KEYSTORE_TYPE.getDefaultValue(), diff --git a/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java b/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java index 06335da1777..2ef8a8b41cc 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/KerberosIT.java @@ -395,7 +395,8 @@ public void testDelegationToken() throws Exception { rootUser.getPrincipal(), rootUser.getKeytab().getAbsolutePath()); log.info("Logged in as {}", rootUser.getPrincipal()); - final int numRows = 100, numColumns = 10; + final int numRows = 100; + final int numColumns = 10; // As the "root" user, open up the connection and get a delegation token final AuthenticationToken delegationToken = diff --git a/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java b/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java index 7398126db1e..1009f874ca9 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/PermissionsIT.java @@ -95,7 +95,8 @@ private void loginAs(ClusterUser user) throws IOException { @Test public void systemPermissionsTest() throws Exception { - ClusterUser testUser = getUser(0), rootUser = getAdminUser(); + ClusterUser testUser = getUser(0); + ClusterUser rootUser = getAdminUser(); // verify that the test is being run by root try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) { @@ -149,7 +150,10 @@ static Map map(Iterable> i) { private void testMissingSystemPermission(String tableNamePrefix, AccumuloClient root_client, ClusterUser rootUser, AccumuloClient test_user_client, ClusterUser testUser, SystemPermission perm) throws Exception { - String tableName, user, password = "password", namespace; + String tableName; + String user; + String password = "password"; + String namespace; boolean passwordBased = testUser.getPassword() != null; log.debug("Confirming that the lack of the {} permission properly restricts the user", perm); @@ -459,7 +463,10 @@ private void testMissingSystemPermission(String tableNamePrefix, AccumuloClient private void testGrantedSystemPermission(String tableNamePrefix, AccumuloClient root_client, ClusterUser rootUser, AccumuloClient test_user_client, ClusterUser testUser, SystemPermission perm) throws Exception { - String tableName, user, password = "password", namespace; + String tableName; + String user; + String password = "password"; + String namespace; boolean passwordBased = testUser.getPassword() != null; log.debug("Confirming that the presence of the {} permission properly permits the user", perm); @@ -676,7 +683,8 @@ private void verifyHasNoSystemPermissions(AccumuloClient root_client, String use @Test public void tablePermissionTest() throws Exception { // create the test user - ClusterUser testUser = getUser(0), rootUser = getAdminUser(); + ClusterUser testUser = getUser(0); + ClusterUser rootUser = getAdminUser(); String principal = testUser.getPrincipal(); AuthenticationToken token = testUser.getToken(); diff --git a/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java b/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java index 530919f0106..f2e064877bc 100644 --- a/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java +++ b/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java @@ -251,7 +251,8 @@ private abstract static class Test implements Runnable { private int count; private long t1; private long t2; - private CountDownLatch startCdl, finishCdl; + private CountDownLatch startCdl; + private CountDownLatch finishCdl; private KeyExtent ke; Test(KeyExtent ke) { diff --git a/test/src/main/java/org/apache/accumulo/test/server/security/SystemCredentialsIT.java b/test/src/main/java/org/apache/accumulo/test/server/security/SystemCredentialsIT.java index 82c7576ca0d..90f15b42001 100644 --- a/test/src/main/java/org/apache/accumulo/test/server/security/SystemCredentialsIT.java +++ b/test/src/main/java/org/apache/accumulo/test/server/security/SystemCredentialsIT.java @@ -41,7 +41,8 @@ public class SystemCredentialsIT extends ConfigurableMacBase { - private static final int SCAN_FAILED = 7, AUTHENICATION_FAILED = 8; + private static final int SCAN_FAILED = 7; + private static final int AUTHENICATION_FAILED = 8; @Override protected Duration defaultTimeout() { diff --git a/test/src/main/java/org/apache/accumulo/test/shell/ShellIT_SimpleSuite.java b/test/src/main/java/org/apache/accumulo/test/shell/ShellIT_SimpleSuite.java index 1152f6daea1..731b6581abd 100644 --- a/test/src/main/java/org/apache/accumulo/test/shell/ShellIT_SimpleSuite.java +++ b/test/src/main/java/org/apache/accumulo/test/shell/ShellIT_SimpleSuite.java @@ -500,7 +500,8 @@ void configTest() throws IOException { for (Property property : Property.values()) { PropertyType propertyType = property.getType(); - String invalidValue, validValue = property.getDefaultValue(); + String invalidValue; + String validValue = property.getDefaultValue(); // Skip test if we can't set this property via shell if (!Property.isValidZooPropertyKey(property.getKey())) {