You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by mw...@apache.org on 2018/05/04 16:47:20 UTC
[accumulo] branch master updated: Removed redundant local variables
(#462)
This is an automated email from the ASF dual-hosted git repository.
mwalch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/master by this push:
new b056117 Removed redundant local variables (#462)
b056117 is described below
commit b05611758b0ee0cb3ac14ed4eaeec116b92d8378
Author: Mike Walch <mw...@apache.org>
AuthorDate: Fri May 4 12:47:16 2018 -0400
Removed redundant local variables (#462)
---
.../accumulo/core/client/impl/Credentials.java | 4 +--
.../accumulo/core/client/impl/MasterClient.java | 5 ++--
.../core/client/impl/ReplicationClient.java | 5 ++--
.../core/client/impl/TableOperationsImpl.java | 3 +-
.../accumulo/core/client/mock/MockScannerBase.java | 6 ++--
.../apache/accumulo/core/data/impl/KeyExtent.java | 3 +-
.../accumulo/core/file/rfile/RFileOperations.java | 4 +--
.../accumulo/core/file/rfile/bcfile/BCFile.java | 3 +-
.../core/file/rfile/bcfile/Compression.java | 21 ++++----------
.../CachingHDFSSecretKeyEncryptionStrategy.java | 3 +-
.../NonCachingSecretKeyEncryptionStrategy.java | 3 +-
.../accumulo/core/summary/SummarizerFactory.java | 3 +-
.../accumulo/core/util/LocalityGroupUtil.java | 3 +-
.../java/org/apache/accumulo/core/util/Merge.java | 7 ++---
.../util/ratelimit/SharedRateLimiterFactory.java | 3 +-
.../apache/accumulo/core/zookeeper/ZooUtil.java | 3 +-
.../accumulo/core/client/rfile/RFileTest.java | 3 +-
.../system/SourceSwitchingIteratorTest.java | 9 ++----
.../accumulo/core/security/crypto/CryptoTest.java | 3 +-
.../main/java/org/apache/accumulo/fate/Fate.java | 3 +-
.../main/java/org/apache/accumulo/proxy/Proxy.java | 8 ++----
.../accumulo/server/client/HdfsZooInstance.java | 3 +-
.../accumulo/server/problems/ProblemReport.java | 3 +-
.../server/replication/proto/Replication.java | 3 +-
.../apache/accumulo/server/rpc/TServerUtils.java | 3 +-
.../accumulo/server/rpc/UGIAssumingProcessor.java | 3 +-
.../accumulo/server/tables/TableManager.java | 4 +--
.../accumulo/server/util/SystemPropUtil.java | 5 ++--
.../master/balancer/ChaoticLoadBalancerTest.java | 3 +-
.../master/balancer/DefaultLoadBalancerTest.java | 6 ++--
.../apache/accumulo/gc/GarbageCollectionTest.java | 7 ++---
.../rest/tservers/TabletServerResource.java | 5 +---
.../org/apache/accumulo/tracer/ZooTraceClient.java | 3 +-
.../accumulo/tracer/AsyncSpanReceiverTest.java | 3 +-
.../apache/accumulo/tserver/CompactionQueue.java | 3 +-
.../org/apache/accumulo/tserver/FileManager.java | 3 +-
.../tserver/TabletIteratorEnvironment.java | 5 ++--
.../org/apache/accumulo/tserver/TabletServer.java | 10 ++-----
.../tserver/TabletServerResourceManager.java | 3 +-
.../tserver/compaction/MajorCompactionRequest.java | 6 ++--
.../apache/accumulo/tserver/InMemoryMapTest.java | 3 +-
.../accumulo/shell/commands/CreateUserCommand.java | 3 +-
.../java/org/apache/accumulo/shell/ShellTest.java | 3 +-
.../main/java/org/apache/accumulo/start/Main.java | 10 ++-----
.../start/classloader/AccumuloClassLoader.java | 4 +--
.../accumulo/harness/AccumuloClusterHarness.java | 4 +--
.../apache/accumulo/test/MetaGetsReadersIT.java | 32 ++++++++++------------
.../test/functional/BatchWriterFlushIT.java | 5 ++--
.../test/functional/FunctionalTestUtils.java | 5 ++--
.../accumulo/test/functional/KerberosIT.java | 3 +-
.../test/functional/MasterAssignmentIT.java | 3 +-
.../accumulo/test/functional/NativeMapIT.java | 5 ++--
.../accumulo/test/functional/ScanRangeIT.java | 9 ++----
.../apache/accumulo/test/functional/SummaryIT.java | 8 ++----
54 files changed, 96 insertions(+), 187 deletions(-)
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java b/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java
index 0967a91..b0772ca 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/Credentials.java
@@ -167,9 +167,7 @@ public class Credentials {
: (getPrincipal().equals(other.getPrincipal()));
if (!pEq)
return false;
- boolean tEq = getToken() == null ? (other.getToken() == null)
- : (getToken().equals(other.getToken()));
- return tEq;
+ return getToken() == null ? (other.getToken() == null) : (getToken().equals(other.getToken()));
}
@Override
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java b/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
index dfe29e5..63d721a 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
@@ -67,9 +67,8 @@ public class MasterClient {
try {
// Master requests can take a long time: don't ever time out
- MasterClientService.Client client = ThriftUtil
- .getClientNoTimeout(new MasterClientService.Client.Factory(), master, context);
- return client;
+ return ThriftUtil.getClientNoTimeout(new MasterClientService.Client.Factory(), master,
+ context);
} catch (TTransportException tte) {
Throwable cause = tte.getCause();
if (null != cause && cause instanceof UnknownHostException) {
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java
index 6eb1fd0..ef26037 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java
@@ -109,9 +109,8 @@ public class ReplicationClient {
try {
// Master requests can take a long time: don't ever time out
- ReplicationCoordinator.Client client = ThriftUtil.getClientNoTimeout(
- new ReplicationCoordinator.Client.Factory(), coordinatorAddr, context);
- return client;
+ return ThriftUtil.getClientNoTimeout(new ReplicationCoordinator.Client.Factory(),
+ coordinatorAddr, context);
} catch (TTransportException tte) {
log.debug("Failed to connect to master coordinator service ({})", coordinatorAddr, tte);
return null;
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
index 30ebcdc..db453d0 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
@@ -354,8 +354,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
opid = null;
return null;
}
- String ret = waitForFateOperation(opid);
- return ret;
+ return waitForFateOperation(opid);
} catch (ThriftSecurityException e) {
switch (e.getCode()) {
case TABLE_DOESNT_EXIST:
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
index 8cb6064..059821c 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
@@ -142,10 +142,8 @@ public class MockScannerBase extends ScannerOptions implements ScannerBase {
SortedKeyValueIterator<Key,Value> vf = VisibilityFilter.wrap(cqf, auths, defaultLabels);
AccumuloConfiguration conf = new MockConfiguration(table.settings);
MockIteratorEnvironment iterEnv = new MockIteratorEnvironment(auths);
- SortedKeyValueIterator<Key,Value> result = iterEnv
- .getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, vf, null, conf,
- serverSideIteratorList, serverSideIteratorOptions, iterEnv, false));
- return result;
+ return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, vf, null,
+ conf, serverSideIteratorList, serverSideIteratorOptions, iterEnv, false));
}
@Override
diff --git a/core/src/main/java/org/apache/accumulo/core/data/impl/KeyExtent.java b/core/src/main/java/org/apache/accumulo/core/data/impl/KeyExtent.java
index afef944..97cd24b 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/impl/KeyExtent.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/impl/KeyExtent.java
@@ -607,8 +607,7 @@ public class KeyExtent implements WritableComparable<KeyExtent> {
metadataPrevRow.append(getPrevEndRow().getBytes(), 0, getPrevEndRow().getLength());
}
- Range range = new Range(metadataPrevRow, getPrevEndRow() == null, getMetadataEntry(), true);
- return range;
+ return new Range(metadataPrevRow, getPrevEndRow() == null, getMetadataEntry(), true);
}
public static SortedSet<KeyExtent> findChildren(KeyExtent ke, SortedSet<KeyExtent> tablets) {
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java
index 6a9e543..0054db2 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java
@@ -132,8 +132,6 @@ public class RFileOperations extends FileOperations {
new RateLimitedOutputStream(outputStream, options.getRateLimiter()), compression, conf,
acuconf);
- RFile.Writer writer = new RFile.Writer(_cbw, (int) blockSize, (int) indexBlockSize,
- samplerConfig, sampler);
- return writer;
+ return new RFile.Writer(_cbw, (int) blockSize, (int) indexBlockSize, samplerConfig, sampler);
}
}
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
index 5871761..f367ed0 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BCFile.java
@@ -232,8 +232,7 @@ public final class BCFile {
* Current size of compressed data.
*/
long getCompressedSize() throws IOException {
- long ret = getCurrentPos() - posStart;
- return ret;
+ return getCurrentPos() - posStart;
}
/**
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java
index b979fcd..0e6234a 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Compression.java
@@ -192,8 +192,7 @@ public final class Compression {
bis1 = downStream;
}
CompressionInputStream cis = codec.createInputStream(bis1, decompressor);
- BufferedInputStream bis2 = new BufferedInputStream(cis, DATA_IBUF_SIZE);
- return bis2;
+ return new BufferedInputStream(cis, DATA_IBUF_SIZE);
}
@Override
@@ -210,9 +209,7 @@ public final class Compression {
bos1 = downStream;
}
CompressionOutputStream cos = codec.createOutputStream(bos1, compressor);
- BufferedOutputStream bos2 = new BufferedOutputStream(
- new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
- return bos2;
+ return new BufferedOutputStream(new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
}
},
@@ -275,8 +272,7 @@ public final class Compression {
}
}
CompressionInputStream cis = decomCodec.createInputStream(downStream, decompressor);
- BufferedInputStream bis2 = new BufferedInputStream(cis, DATA_IBUF_SIZE);
- return bis2;
+ return new BufferedInputStream(cis, DATA_IBUF_SIZE);
}
@Override
@@ -290,9 +286,7 @@ public final class Compression {
}
// always uses the default buffer size
CompressionOutputStream cos = codec.createOutputStream(bos1, compressor);
- BufferedOutputStream bos2 = new BufferedOutputStream(
- new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
- return bos2;
+ return new BufferedOutputStream(new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
}
@Override
@@ -422,9 +416,7 @@ public final class Compression {
}
// use the default codec
CompressionOutputStream cos = snappyCodec.createOutputStream(bos1, compressor);
- BufferedOutputStream bos2 = new BufferedOutputStream(
- new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
- return bos2;
+ return new BufferedOutputStream(new FinishOnFlushCompressionStream(cos), DATA_OBUF_SIZE);
}
@Override
@@ -447,8 +439,7 @@ public final class Compression {
}
CompressionInputStream cis = decomCodec.createInputStream(downStream, decompressor);
- BufferedInputStream bis2 = new BufferedInputStream(cis, DATA_IBUF_SIZE);
- return bis2;
+ return new BufferedInputStream(cis, DATA_IBUF_SIZE);
}
@Override
diff --git a/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java b/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java
index 6bdc2e3..923ea0b 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/crypto/CachingHDFSSecretKeyEncryptionStrategy.java
@@ -219,8 +219,7 @@ public class CachingHDFSSecretKeyEncryptionStrategy implements SecretKeyEncrypti
pathToKeyName = "/" + pathToKeyName;
}
- String fullPath = instanceDirectory + pathToKeyName;
- return fullPath;
+ return instanceDirectory + pathToKeyName;
}
public byte[] getKeyEncryptionKey() {
diff --git a/core/src/main/java/org/apache/accumulo/core/security/crypto/NonCachingSecretKeyEncryptionStrategy.java b/core/src/main/java/org/apache/accumulo/core/security/crypto/NonCachingSecretKeyEncryptionStrategy.java
index 09fc87b..7e2cef2 100644
--- a/core/src/main/java/org/apache/accumulo/core/security/crypto/NonCachingSecretKeyEncryptionStrategy.java
+++ b/core/src/main/java/org/apache/accumulo/core/security/crypto/NonCachingSecretKeyEncryptionStrategy.java
@@ -150,8 +150,7 @@ public class NonCachingSecretKeyEncryptionStrategy implements SecretKeyEncryptio
pathToKeyName = "/" + pathToKeyName;
}
- String fullPath = instanceDirectory + pathToKeyName;
- return fullPath;
+ return instanceDirectory + pathToKeyName;
}
@SuppressWarnings("deprecation")
diff --git a/core/src/main/java/org/apache/accumulo/core/summary/SummarizerFactory.java b/core/src/main/java/org/apache/accumulo/core/summary/SummarizerFactory.java
index cc20606..09cb583 100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/SummarizerFactory.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/SummarizerFactory.java
@@ -56,8 +56,7 @@ public class SummarizerFactory {
public Summarizer getSummarizer(SummarizerConfiguration conf) {
try {
- Summarizer summarizer = newSummarizer(conf.getClassName());
- return summarizer;
+ return newSummarizer(conf.getClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException
| IOException e) {
throw new RuntimeException(e);
diff --git a/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java b/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
index eb6a5e0..d8ef378 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
@@ -203,8 +203,7 @@ public class LocalityGroupUtil {
sb.append("\\x").append(String.format("%02X", c));
}
- String ecf = sb.toString();
- return ecf;
+ return sb.toString();
}
public static class PartitionedMutation extends Mutation {
diff --git a/core/src/main/java/org/apache/accumulo/core/util/Merge.java b/core/src/main/java/org/apache/accumulo/core/util/Merge.java
index 078ba57..2431c8f 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/Merge.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/Merge.java
@@ -230,7 +230,7 @@ public class Merge {
TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.fetch(scanner);
final Iterator<Entry<Key,Value>> iterator = scanner.iterator();
- Iterator<Size> result = new Iterator<Size>() {
+ return new Iterator<Size>() {
Size next = fetch();
@Override
@@ -255,9 +255,9 @@ public class Merge {
@Override
public Size next() {
- Size result = next;
+ Size result1 = next;
next = fetch();
- return result;
+ return result1;
}
@Override
@@ -265,7 +265,6 @@ public class Merge {
throw new UnsupportedOperationException();
}
};
- return result;
}
}
diff --git a/core/src/main/java/org/apache/accumulo/core/util/ratelimit/SharedRateLimiterFactory.java b/core/src/main/java/org/apache/accumulo/core/util/ratelimit/SharedRateLimiterFactory.java
index 86b8b09..85a93f1 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/ratelimit/SharedRateLimiterFactory.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/ratelimit/SharedRateLimiterFactory.java
@@ -90,8 +90,7 @@ public class SharedRateLimiterFactory {
public RateLimiter create(String name, RateProvider rateProvider) {
synchronized (activeLimiters) {
if (activeLimiters.containsKey(name)) {
- SharedRateLimiter limiter = activeLimiters.get(name);
- return limiter;
+ return activeLimiters.get(name);
} else {
long initialRate;
initialRate = rateProvider.getDesiredRate();
diff --git a/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java b/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
index d5ddb9b..18c24fc 100644
--- a/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooUtil.java
@@ -72,8 +72,7 @@ public class ZooUtil extends org.apache.accumulo.fate.zookeeper.ZooUtil {
throw new RuntimeException(
"Accumulo found multiple possible instance ids in " + instanceDirectory);
} else {
- String result = files[0].getPath().getName();
- return result;
+ return files[0].getPath().getName();
}
} catch (IOException e) {
log.error("Problem reading instance id out of hdfs at " + instanceDirectory, e);
diff --git a/core/src/test/java/org/apache/accumulo/core/client/rfile/RFileTest.java b/core/src/test/java/org/apache/accumulo/core/client/rfile/RFileTest.java
index 4a82919..f8f8289 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/rfile/RFileTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/rfile/RFileTest.java
@@ -809,10 +809,9 @@ public class RFileTest {
}
private Reader getReader(LocalFileSystem localFs, String testFile) throws IOException {
- Reader reader = (Reader) FileOperations.getInstance().newReaderBuilder().forFile(testFile)
+ return (Reader) FileOperations.getInstance().newReaderBuilder().forFile(testFile)
.inFileSystem(localFs, localFs.getConf())
.withTableConfiguration(DefaultConfiguration.getInstance()).build();
- return reader;
}
@Test
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java
index 392d697..ef41aac 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/system/SourceSwitchingIteratorTest.java
@@ -153,8 +153,7 @@ public class SourceSwitchingIteratorTest extends TestCase {
put(tm2, "r2", "cf1", "cq1", 5, "v6");
SortedMapIterator smi2 = new SortedMapIterator(tm2);
- TestDataSource tds2 = new TestDataSource(smi2);
- tds.next = tds2;
+ tds.next = new TestDataSource(smi2);
testAndCallNext(ssi, "r1", "cf1", "cq3", 5, "v2", true);
testAndCallNext(ssi, "r2", "cf1", "cq1", 5, "v6", true);
@@ -186,8 +185,7 @@ public class SourceSwitchingIteratorTest extends TestCase {
// setup a new data source, but it should not switch until the current row is finished
SortedMapIterator smi2 = new SortedMapIterator(tm2);
- TestDataSource tds2 = new TestDataSource(smi2);
- tds.next = tds2;
+ tds.next = new TestDataSource(smi2);
testAndCallNext(ssi, "r1", "cf1", "cq2", 5, "v2", true);
testAndCallNext(ssi, "r1", "cf1", "cq3", 5, "v3", true);
@@ -213,8 +211,7 @@ public class SourceSwitchingIteratorTest extends TestCase {
put(tm2, "r1", "cf1", "cq2", 6, "v4");
SortedMapIterator smi2 = new SortedMapIterator(tm2);
- TestDataSource tds2 = new TestDataSource(smi2);
- tds.next = tds2;
+ tds.next = new TestDataSource(smi2);
ssi.seek(new Range(), new ArrayList<>(), false);
diff --git a/core/src/test/java/org/apache/accumulo/core/security/crypto/CryptoTest.java b/core/src/test/java/org/apache/accumulo/core/security/crypto/CryptoTest.java
index e49dbef..465162f 100644
--- a/core/src/test/java/org/apache/accumulo/core/security/crypto/CryptoTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/security/crypto/CryptoTest.java
@@ -619,8 +619,7 @@ public class CryptoTest {
encryptedDataStream.writeUTF(MARKER_STRING);
encryptedDataStream.writeInt(MARKER_INT);
encryptedDataStream.close();
- byte[] encryptedBytes = encryptedByteStream.toByteArray();
- return (encryptedBytes);
+ return (encryptedByteStream.toByteArray());
}
/**
diff --git a/fate/src/main/java/org/apache/accumulo/fate/Fate.java b/fate/src/main/java/org/apache/accumulo/fate/Fate.java
index 4af32e5..5569d55 100644
--- a/fate/src/main/java/org/apache/accumulo/fate/Fate.java
+++ b/fate/src/main/java/org/apache/accumulo/fate/Fate.java
@@ -194,8 +194,7 @@ public class Fate<T> {
// get a transaction id back to the requester before doing any work
public long startTransaction() {
- long dir = store.create();
- return dir;
+ return store.create();
}
// start work in the transaction.. it is safe to call this
diff --git a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
index 14c669c..6c206c1 100644
--- a/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
+++ b/proxy/src/main/java/org/apache/accumulo/proxy/Proxy.java
@@ -275,11 +275,9 @@ public class Proxy implements KeywordExecutable {
threadName);
// Create the thrift server with our processor and properties
- ServerAddress serverAddr = TServerUtils.startTServer(serverType, timedProcessor,
- protocolFactory, serverName, threadName, numThreads, simpleTimerThreadpoolSize,
- threadpoolResizeInterval, maxFrameSize, sslParams, saslParams, serverSocketTimeout,
- address);
- return serverAddr;
+ return TServerUtils.startTServer(serverType, timedProcessor, protocolFactory, serverName,
+ threadName, numThreads, simpleTimerThreadpoolSize, threadpoolResizeInterval, maxFrameSize,
+ sslParams, saslParams, serverSocketTimeout, address);
}
}
diff --git a/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java b/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
index d0a17ad..b9ec2ae 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
@@ -156,8 +156,7 @@ public class HdfsZooInstance implements Instance {
}
Path instanceIdPath = Accumulo.getAccumuloInstanceIdPath(fs);
log.trace("Looking for instanceId from {}", instanceIdPath);
- String instanceIdFromFile = ZooUtil.getInstanceIDFromHdfs(instanceIdPath, acuConf);
- instanceId = instanceIdFromFile;
+ instanceId = ZooUtil.getInstanceIDFromHdfs(instanceIdPath, acuConf);
}
}
diff --git a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java
index a54c002..3524bc8 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/problems/ProblemReport.java
@@ -180,9 +180,8 @@ public class ProblemReport {
dos.close();
baos.close();
- String zpath = ZooUtil.getRoot(instance) + Constants.ZPROBLEMS + "/"
+ return ZooUtil.getRoot(instance) + Constants.ZPROBLEMS + "/"
+ Encoding.encodeAsBase64FileName(new Text(baos.toByteArray()));
- return zpath;
}
static ProblemReport decodeZooKeeperEntry(String node) throws Exception {
diff --git a/server/base/src/main/java/org/apache/accumulo/server/replication/proto/Replication.java b/server/base/src/main/java/org/apache/accumulo/server/replication/proto/Replication.java
index b36958d..534a2af 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/replication/proto/Replication.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/replication/proto/Replication.java
@@ -491,8 +491,7 @@ package org.apache.accumulo.server.replication.proto;
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
+ return new Builder(parent);
}
/**
* Protobuf type {@code Status}
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 959dfff..ff5756f 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
@@ -162,8 +162,7 @@ public class TServerUtils {
HostAndPort last = addresses[addresses.length - 1];
// Attempt to allocate a port outside of the specified port property
// Search sequentially over the next 1000 ports
- for (int i = last.getPort() + 1; i < last.getPort() + 1001; i++) {
- int port = i;
+ for (int port = last.getPort() + 1; port < last.getPort() + 1001; port++) {
if (port > 65535) {
break;
}
diff --git a/server/base/src/main/java/org/apache/accumulo/server/rpc/UGIAssumingProcessor.java b/server/base/src/main/java/org/apache/accumulo/server/rpc/UGIAssumingProcessor.java
index 6009279..cfe6b5d 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/rpc/UGIAssumingProcessor.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/rpc/UGIAssumingProcessor.java
@@ -80,8 +80,7 @@ public class UGIAssumingProcessor implements TProcessor {
}
TSaslServerTransport saslTrans = (TSaslServerTransport) trans;
SaslServer saslServer = saslTrans.getSaslServer();
- String authId = saslServer.getAuthorizationID();
- String endUser = authId;
+ String endUser = saslServer.getAuthorizationID();
SaslMechanism mechanism;
try {
diff --git a/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
index 8ee7887..82439fd 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
@@ -135,9 +135,7 @@ public class TableManager {
if (StringUtils.isNotEmpty(message))
this.message = message;
else {
- String defaultMessage = "Error transitioning from " + oldState + " state to " + newState
- + " state";
- this.message = defaultMessage;
+ this.message = "Error transitioning from " + oldState + " state to " + newState + " state";
}
}
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java
index b7231d8..252708d 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/SystemPropUtil.java
@@ -63,10 +63,9 @@ public class SystemPropUtil {
// create the zk node for this property and set it's data to the specified value
String zPath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + Constants.ZCONFIG + "/"
+ property;
- boolean result = ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(UTF_8),
- NodeExistsPolicy.OVERWRITE);
- return result;
+ return ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(UTF_8),
+ NodeExistsPolicy.OVERWRITE);
}
public static void removeSystemProperty(String property)
diff --git a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancerTest.java b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancerTest.java
index e6423ee..7c36acd 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancerTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/ChaoticLoadBalancerTest.java
@@ -131,8 +131,7 @@ public class ChaoticLoadBalancerTest {
for (char c : "abcdefghijklmnopqrstuvwxyz".toCharArray()) {
String cString = Character.toString(c);
HostAndPort fakeAddress = HostAndPort.fromParts("127.0.0.1", c);
- String fakeInstance = cString;
- TServerInstance tsi = new TServerInstance(fakeAddress, fakeInstance);
+ TServerInstance tsi = new TServerInstance(fakeAddress, cString);
FakeTServer fakeTServer = new FakeTServer();
servers.put(tsi, fakeTServer);
fakeTServer.extents.add(makeExtent(cString, null, null));
diff --git a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
index f6bbc67..dfe690d 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
@@ -176,8 +176,7 @@ public class DefaultLoadBalancerTest {
for (char c : "abcdefghijklmnopqrstuvwxyz".toCharArray()) {
String cString = Character.toString(c);
HostAndPort fakeAddress = HostAndPort.fromParts("127.0.0.1", c);
- String fakeInstance = cString;
- TServerInstance tsi = new TServerInstance(fakeAddress, fakeInstance);
+ TServerInstance tsi = new TServerInstance(fakeAddress, cString);
FakeTServer fakeTServer = new FakeTServer();
servers.put(tsi, fakeTServer);
fakeTServer.extents.add(makeExtent(cString, null, null));
@@ -217,8 +216,7 @@ public class DefaultLoadBalancerTest {
for (char c : "abcdefghijklmnopqrstuvwxyz".toCharArray()) {
String cString = Character.toString(c);
HostAndPort fakeAddress = HostAndPort.fromParts("127.0.0.1", c);
- String fakeInstance = cString;
- TServerInstance tsi = new TServerInstance(fakeAddress, fakeInstance);
+ TServerInstance tsi = new TServerInstance(fakeAddress, cString);
FakeTServer fakeTServer = new FakeTServer();
servers.put(tsi, fakeTServer);
}
diff --git a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
index bf44e3d..7b0f130 100644
--- a/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
+++ b/server/gc/src/test/java/org/apache/accumulo/gc/GarbageCollectionTest.java
@@ -96,9 +96,7 @@ public class GarbageCollectionTest {
String row = new KeyExtent(Table.ID.of(tableId), endRow == null ? null : new Text(endRow),
null).getMetadataEntry().toString();
String cf = MetadataSchema.TabletsSection.DataFileColumnFamily.NAME.toString();
- String cq = file;
- Key key = new Key(row, cf, cq);
- return key;
+ return new Key(row, cf, file);
}
public Value addFileReference(String tableId, String endRow, String file) {
@@ -118,8 +116,7 @@ public class GarbageCollectionTest {
.getColumnFamily().toString();
String cq = MetadataSchema.TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN
.getColumnQualifier().toString();
- Key key = new Key(row, cf, cq);
- return key;
+ return new Key(row, cf, cq);
}
public Value addDirReference(String tableId, String endRow, String dir) {
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/TabletServerResource.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/TabletServerResource.java
index e4025e6..d3c0987 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/TabletServerResource.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/rest/tservers/TabletServerResource.java
@@ -232,10 +232,7 @@ public class TabletServerResource {
CurrentTabletResults currentRes = doCurrentTabletResults(currentMinorAvg, currentMinorStdDev,
currentMajorAvg, currentMajorStdDev);
- TabletServerSummary tserverDetails = new TabletServerSummary(details, allTime, currentRes,
- currentOps);
-
- return tserverDetails;
+ return new TabletServerSummary(details, allTime, currentRes, currentOps);
}
private static final int concurrentScans = Monitor.getContext().getConfiguration()
diff --git a/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java b/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java
index fb6b6dc..e340cfb 100644
--- a/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java
+++ b/server/tracer/src/main/java/org/apache/accumulo/tracer/ZooTraceClient.java
@@ -77,8 +77,7 @@ public class ZooTraceClient extends SendSpansViaThrift implements Watcher {
@Override
synchronized protected String getSpanKey(Map<String,String> data) {
if (hosts.size() > 0) {
- String host = hosts.get(random.nextInt(hosts.size()));
- return host;
+ return hosts.get(random.nextInt(hosts.size()));
}
return null;
}
diff --git a/server/tracer/src/test/java/org/apache/accumulo/tracer/AsyncSpanReceiverTest.java b/server/tracer/src/test/java/org/apache/accumulo/tracer/AsyncSpanReceiverTest.java
index 05ab02d..5785c1c 100644
--- a/server/tracer/src/test/java/org/apache/accumulo/tracer/AsyncSpanReceiverTest.java
+++ b/server/tracer/src/test/java/org/apache/accumulo/tracer/AsyncSpanReceiverTest.java
@@ -66,9 +66,8 @@ public class AsyncSpanReceiverTest {
Span createSpan(long length) {
long time = System.currentTimeMillis();
- Span span = new MilliSpan.Builder().begin(time).end(time + length).description("desc")
+ return new MilliSpan.Builder().begin(time).end(time + length).description("desc")
.parents(Collections.emptyList()).spanId(1).traceId(2).build();
- return span;
}
@Test
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
index e8caaf1..2b40616 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/CompactionQueue.java
@@ -65,8 +65,7 @@ class CompactionQueue extends AbstractQueue<TraceRunnable> implements BlockingQu
if (task.size() == 0)
return null;
- TraceRunnable min = Collections.min(task, comparator);
- return min;
+ return Collections.min(task, comparator);
}
@Override
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
index 17384c0..0bbf3ee 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/FileManager.java
@@ -601,8 +601,7 @@ public class FileManager {
}
for (FileDataSource fds : dataSources) {
- FileSKVIterator reader = map.get(fds.file).remove(0);
- FileSKVIterator source = reader;
+ FileSKVIterator source = map.get(fds.file).remove(0);
if (samplerConfig != null) {
source = source.getSample(samplerConfig);
if (source == null) {
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
index d7673a9..d3c13b7 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
@@ -180,8 +180,7 @@ public class TabletIteratorEnvironment implements IteratorEnvironment {
throw new SampleNotPresentException();
}
- TabletIteratorEnvironment te = new TabletIteratorEnvironment(scope, config, trm, files,
- authorizations, sci, topLevelIterators);
- return te;
+ return new TabletIteratorEnvironment(scope, config, trm, files, authorizations, sci,
+ topLevelIterators);
}
}
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index c4b4c3c..d7d3506 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -847,8 +847,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
UpdateSession us = new UpdateSession(new TservConstraintEnv(security, credentials),
credentials, durability);
- long sid = sessionManager.createSession(us, false);
- return sid;
+ return sessionManager.createSession(us, false);
}
private void setUpdateTablet(UpdateSession us, KeyExtent keyExtent) {
@@ -2587,10 +2586,8 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
if (address == null) {
return null;
}
- MasterClientService.Client client = ThriftUtil
- .getClient(new MasterClientService.Client.Factory(), address, this);
// log.info("Listener API to master has been opened");
- return client;
+ return ThriftUtil.getClient(new MasterClientService.Client.Factory(), address, this);
} catch (Exception e) {
log.warn("Issue with masterConnection (" + address + ") " + e, e);
}
@@ -3322,8 +3319,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
} else {
conf = confFactory.getTableConfiguration(MetadataTable.ID);
}
- Durability durability = DurabilityImpl.fromString(conf.get(Property.TABLE_DURABILITY));
- return durability;
+ return DurabilityImpl.fromString(conf.get(Property.TABLE_DURABILITY));
}
public void minorCompactionFinished(CommitSession tablet, String newDatafile, long walogSeq)
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
index 92e6777..187d8d1 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
@@ -600,8 +600,7 @@ public class TabletServerResourceManager {
public synchronized TabletResourceManager createTabletResourceManager(KeyExtent extent,
AccumuloConfiguration conf) {
- TabletResourceManager trm = new TabletResourceManager(extent, conf);
- return trm;
+ return new TabletResourceManager(extent, conf);
}
public class TabletResourceManager {
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/MajorCompactionRequest.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/MajorCompactionRequest.java
index 6a7ffcb..4390e15 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/MajorCompactionRequest.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/compaction/MajorCompactionRequest.java
@@ -171,10 +171,8 @@ public class MajorCompactionRequest implements Cloneable {
// @TODO ensure these files are always closed?
FileOperations fileFactory = FileOperations.getInstance();
FileSystem ns = volumeManager.getVolumeByPath(ref.path()).getFileSystem();
- FileSKVIterator openReader = fileFactory.newReaderBuilder()
- .forFile(ref.path().toString(), ns, ns.getConf()).withTableConfiguration(tableConfig)
- .seekToBeginning().build();
- return openReader;
+ return fileFactory.newReaderBuilder().forFile(ref.path().toString(), ns, ns.getConf())
+ .withTableConfiguration(tableConfig).seekToBeginning().build();
}
public Map<String,String> getTableProperties() {
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
index 1e92ef2..87b62fe 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
@@ -130,8 +130,7 @@ public class InMemoryMapTest {
static Key newKey(String row, String column, long ts) {
String[] sa = column.split(":");
- Key k = new Key(new Text(row), new Text(sa[0]), new Text(sa[1]), ts);
- return k;
+ return new Key(new Text(row), new Text(sa[0]), new Text(sa[1]), ts);
}
static void testAndCallNext(SortedKeyValueIterator<Key,Value> dc, String row, String column,
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java
index 05f57c4..7655c28 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/CreateUserCommand.java
@@ -78,8 +78,7 @@ public class CreateUserCommand extends Command {
@Override
public Options getOptions() {
- final Options o = new Options();
- return o;
+ return new Options();
}
@Override
diff --git a/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java b/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java
index 93cd707..b0ca604 100644
--- a/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java
+++ b/shell/src/test/java/org/apache/accumulo/shell/ShellTest.java
@@ -327,13 +327,12 @@ public class ShellTest {
org.apache.accumulo.core.util.format.DateStringFormatter.DATE_FORMAT);
String expected = String.format("r f:q [] %s v", dateFormat.format(new Date(0)));
// historically, showing few did not pertain to ColVis or Timestamp
- String expectedFew = expected;
String expectedNoTimestamp = String.format("r f:q [] v");
exec("scan -fm org.apache.accumulo.core.util.format.DateStringFormatter -st", true, expected);
exec("scan -fm org.apache.accumulo.core.util.format.DateStringFormatter -st -f 1000", true,
expected);
exec("scan -fm org.apache.accumulo.core.util.format.DateStringFormatter -st -f 5", true,
- expectedFew);
+ expected);
exec("scan -fm org.apache.accumulo.core.util.format.DateStringFormatter", true,
expectedNoTimestamp);
exec("deletetable t -f", true, "Table: [t] has been deleted");
diff --git a/start/src/main/java/org/apache/accumulo/start/Main.java b/start/src/main/java/org/apache/accumulo/start/Main.java
index a30c4b4..fa3d1dc 100644
--- a/start/src/main/java/org/apache/accumulo/start/Main.java
+++ b/start/src/main/java/org/apache/accumulo/start/Main.java
@@ -101,9 +101,7 @@ public class Main {
public static synchronized ClassLoader getClassLoader() {
if (classLoader == null) {
try {
- ClassLoader clTmp = (ClassLoader) getVFSClassLoader().getMethod("getClassLoader")
- .invoke(null);
- classLoader = clTmp;
+ classLoader = (ClassLoader) getVFSClassLoader().getMethod("getClassLoader").invoke(null);
Thread.currentThread().setContextClassLoader(classLoader);
} catch (ClassNotFoundException | IOException | IllegalAccessException
| IllegalArgumentException | InvocationTargetException | NoSuchMethodException
@@ -119,9 +117,8 @@ public class Main {
throws IOException, ClassNotFoundException {
if (vfsClassLoader == null) {
Thread.currentThread().setContextClassLoader(AccumuloClassLoader.getClassLoader());
- Class<?> vfsClassLoaderTmp = AccumuloClassLoader.getClassLoader()
+ vfsClassLoader = AccumuloClassLoader.getClassLoader()
.loadClass("org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader");
- vfsClassLoader = vfsClassLoaderTmp;
}
return vfsClassLoader;
}
@@ -166,8 +163,7 @@ public class Main {
final Method finalMain = main;
Runnable r = () -> {
try {
- final Object thisIsJustOneArgument = args;
- finalMain.invoke(null, thisIsJustOneArgument);
+ finalMain.invoke(null, (Object) args);
} catch (InvocationTargetException e) {
if (e.getCause() != null) {
die(e.getCause());
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java b/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
index c09c03f..7df70f0 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
@@ -249,8 +249,7 @@ public class AccumuloClassLoader {
ClassLoader parentClassLoader = AccumuloClassLoader.class.getClassLoader();
log.debug("Create 2nd tier ClassLoader using URLs: {}", urls.toString());
- URLClassLoader aClassLoader = new URLClassLoader(urls.toArray(new URL[urls.size()]),
- parentClassLoader) {
+ classloader = new URLClassLoader(urls.toArray(new URL[urls.size()]), parentClassLoader) {
@Override
protected synchronized Class<?> loadClass(String name, boolean resolve)
throws ClassNotFoundException {
@@ -267,7 +266,6 @@ public class AccumuloClassLoader {
return super.loadClass(name, resolve);
}
};
- classloader = aClassLoader;
}
return classloader;
diff --git a/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java b/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
index 3939af6..42c1d4c 100644
--- a/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
+++ b/test/src/main/java/org/apache/accumulo/harness/AccumuloClusterHarness.java
@@ -39,7 +39,6 @@ import org.apache.accumulo.core.security.TablePermission;
import org.apache.accumulo.harness.conf.AccumuloClusterConfiguration;
import org.apache.accumulo.harness.conf.AccumuloClusterPropertyConfiguration;
import org.apache.accumulo.harness.conf.StandaloneAccumuloClusterConfiguration;
-import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
import org.apache.accumulo.test.categories.StandaloneCapableClusterTests;
import org.apache.hadoop.conf.Configuration;
@@ -120,8 +119,7 @@ public abstract class AccumuloClusterHarness extends AccumuloITBase
MiniClusterHarness miniClusterHarness = new MiniClusterHarness();
// Intrinsically performs the callback to let tests alter MiniAccumuloConfig and
// core-site.xml
- MiniAccumuloClusterImpl impl = miniClusterHarness.create(this, getAdminToken(), krb);
- cluster = impl;
+ cluster = miniClusterHarness.create(this, getAdminToken(), krb);
// Login as the "root" user
if (null != krb) {
ClusterUser rootUser = krb.getRootUser();
diff --git a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java b/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
index b0a7dbc..1d50513 100644
--- a/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/MetaGetsReadersIT.java
@@ -56,28 +56,24 @@ public class MetaGetsReadersIT extends ConfigurableMacBase {
private static Thread slowScan(final Connector c, final String tableName,
final AtomicBoolean stop) {
- Thread thread = new Thread() {
- @Override
- public void run() {
- try {
- while (!stop.get()) {
- try (Scanner s = c.createScanner(tableName, Authorizations.EMPTY)) {
- IteratorSetting is = new IteratorSetting(50, SlowIterator.class);
- SlowIterator.setSleepTime(is, 10);
- s.addScanIterator(is);
- Iterator<Entry<Key,Value>> iterator = s.iterator();
- while (iterator.hasNext() && !stop.get()) {
- iterator.next();
- }
+ return new Thread(() -> {
+ try {
+ while (!stop.get()) {
+ try (Scanner s = c.createScanner(tableName, Authorizations.EMPTY)) {
+ IteratorSetting is = new IteratorSetting(50, SlowIterator.class);
+ SlowIterator.setSleepTime(is, 10);
+ s.addScanIterator(is);
+ Iterator<Entry<Key,Value>> iterator = s.iterator();
+ while (iterator.hasNext() && !stop.get()) {
+ iterator.next();
}
}
- } catch (Exception ex) {
- log.trace("{}", ex.getMessage(), ex);
- stop.set(true);
}
+ } catch (Exception ex) {
+ log.trace("{}", ex.getMessage(), ex);
+ stop.set(true);
}
- };
- return thread;
+ });
}
@Test(timeout = 2 * 60 * 1000)
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java b/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
index 440c146..bfb416f 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BatchWriterFlushIT.java
@@ -193,11 +193,10 @@ public class BatchWriterFlushIT extends AccumuloClusterHarness {
final List<Set<Mutation>> allMuts = new LinkedList<>();
List<Mutation> data = new ArrayList<>();
for (int i = 0; i < NUM_THREADS; i++) {
- final int thread = i;
for (int j = 0; j < NUM_TO_FLUSH; j++) {
- int row = thread * NUM_TO_FLUSH + j;
+ int row = i * NUM_TO_FLUSH + j;
Mutation m = new Mutation(new Text(String.format("%10d", row)));
- m.put(new Text("cf" + thread), new Text("cq"), new Value(("" + row).getBytes()));
+ m.put(new Text("cf" + i), new Text("cq"), new Value(("" + row).getBytes()));
data.add(m);
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java b/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java
index 393c193..eca5e0b 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTestUtils.java
@@ -220,9 +220,8 @@ public class FunctionalTestUtils {
IZooReaderWriter zk = new ZooReaderWriterFactory().getZooReaderWriter(
instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut(), secret);
ZooStore<String> zs = new ZooStore<>(ZooUtil.getRoot(instance) + Constants.ZFATE, zk);
- FateStatus fateStatus = admin.getStatus(zs, zk,
- ZooUtil.getRoot(instance) + Constants.ZTABLE_LOCKS, null, null);
- return fateStatus;
+ return admin.getStatus(zs, zk, ZooUtil.getRoot(instance) + Constants.ZTABLE_LOCKS, null,
+ null);
} catch (KeeperException | InterruptedException e) {
throw new RuntimeException(e);
}
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 6636f0e..01712af 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
@@ -454,8 +454,7 @@ public class KerberosIT extends AccumuloITBase {
try (BatchScanner bs = conn.createBatchScanner(tableName, Authorizations.EMPTY, 2)) {
bs.setRanges(Collections.singleton(new Range()));
- int recordsSeen = Iterables.size(bs);
- return recordsSeen;
+ return Iterables.size(bs);
}
}
});
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java b/test/src/main/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
index 7c877b1..b9f757d 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
@@ -93,8 +93,7 @@ public class MasterAssignmentIT extends AccumuloClusterHarness {
ClientContext context = new ClientContext(getConnectionInfo());
try (MetaDataTableScanner s = new MetaDataTableScanner(context,
new Range(KeyExtent.getMetadataEntry(Table.ID.of(tableId), null)))) {
- TabletLocationState tlState = s.next();
- return tlState;
+ return s.next();
}
}
}
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java b/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java
index f19e777..70a7a4b 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/NativeMapIT.java
@@ -69,9 +69,8 @@ public class NativeMapIT {
public static File nativeMapLocation() {
File projectDir = new File(System.getProperty("user.dir")).getParentFile();
- File nativeMapDir = new File(projectDir, "server/native/target/accumulo-native-"
- + Constants.VERSION + "/accumulo-native-" + Constants.VERSION);
- return nativeMapDir;
+ return new File(projectDir, "server/native/target/accumulo-native-" + Constants.VERSION
+ + "/accumulo-native-" + Constants.VERSION);
}
@BeforeClass
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java
index e0fd12d..36ebdf1 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ScanRangeIT.java
@@ -213,18 +213,15 @@ public class ScanRangeIT extends AccumuloClusterHarness {
}
private static Text createCF(int cf) {
- Text tcf = new Text(String.format("cf_%03d", cf));
- return tcf;
+ return new Text(String.format("cf_%03d", cf));
}
private static Text createCQ(int cf) {
- Text tcf = new Text(String.format("cq_%03d", cf));
- return tcf;
+ return new Text(String.format("cq_%03d", cf));
}
private static Text createRow(int row) {
- Text trow = new Text(String.format("r_%06d", row));
- return trow;
+ return new Text(String.format("r_%06d", row));
}
private void insertData(Connector c, String table) throws Exception {
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
index 50ff90e..66d3689 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
@@ -99,9 +99,7 @@ public class SummaryIT extends AccumuloClusterHarness {
throws TableNotFoundException {
try (Scanner scanner = c.createScanner(table, Authorizations.EMPTY)) {
Stream<Entry<Key,Value>> stream = StreamSupport.stream(scanner.spliterator(), false);
- LongSummaryStatistics stats = stream.mapToLong(e -> e.getKey().getTimestamp())
- .summaryStatistics();
- return stats;
+ return stream.mapToLong(e -> e.getKey().getTimestamp()).summaryStatistics();
}
}
@@ -110,9 +108,7 @@ public class SummaryIT extends AccumuloClusterHarness {
try (Scanner scanner = c.createScanner(table, Authorizations.EMPTY)) {
scanner.setRange(new Range(startRow, false, endRow, true));
Stream<Entry<Key,Value>> stream = StreamSupport.stream(scanner.spliterator(), false);
- LongSummaryStatistics stats = stream.mapToLong(e -> e.getKey().getTimestamp())
- .summaryStatistics();
- return stats;
+ return stream.mapToLong(e -> e.getKey().getTimestamp()).summaryStatistics();
}
}
--
To stop receiving notification emails like this one, please contact
mwalch@apache.org.