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/12/21 18:00:28 UTC
[accumulo] branch master updated: Remove unnecessary exceptions in
core module (#853)
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 6f47590 Remove unnecessary exceptions in core module (#853)
6f47590 is described below
commit 6f47590896755a454e8b48b465923724e396f81b
Author: Mike Walch <mw...@apache.org>
AuthorDate: Fri Dec 21 13:00:24 2018 -0500
Remove unnecessary exceptions in core module (#853)
---
.../accumulo/core/clientImpl/BulkImport.java | 4 +-
.../core/clientImpl/ClientConfConverter.java | 25 ++--
.../core/clientImpl/ConcurrentKeyExtentCache.java | 3 +-
.../core/clientImpl/ConditionalWriterImpl.java | 3 +-
.../core/clientImpl/MultiTableBatchWriterImpl.java | 5 +-
.../accumulo/core/clientImpl/OfflineIterator.java | 7 +-
.../core/clientImpl/ReplicationClient.java | 2 +-
.../core/clientImpl/ReplicationOperationsImpl.java | 12 +-
.../core/clientImpl/RootTabletLocator.java | 11 +-
.../core/clientImpl/TableOperationsHelper.java | 4 +-
.../core/clientImpl/TableOperationsImpl.java | 7 +-
.../core/clientImpl/TabletServerBatchDeleter.java | 6 +-
.../core/clientImpl/TabletServerBatchWriter.java | 11 +-
.../accumulo/core/clientImpl/ThriftScanner.java | 2 +-
.../core/clientImpl/ZookeeperLockChecker.java | 7 +-
.../lexicoder/FixedByteArrayOutputStream.java | 5 +-
.../core/clientImpl/mapreduce/BatchInputSplit.java | 2 +-
.../clientImpl/mapreduce/DelegationTokenStub.java | 9 +-
.../core/clientImpl/mapreduce/SplitUtils.java | 3 +-
.../clientImpl/mapreduce/lib/ConfiguratorBase.java | 3 +-
.../mapreduce/lib/InputConfigurator.java | 3 +-
.../core/conf/CredentialProviderFactoryShim.java | 6 +-
.../core/crypto/streams/BlockedInputStream.java | 2 +-
.../accumulo/core/file/BloomFilterLayer.java | 4 +-
.../file/blockfile/impl/CachableBlockFile.java | 12 +-
.../accumulo/core/file/map/MapFileOperations.java | 4 +-
.../org/apache/accumulo/core/file/rfile/RFile.java | 20 ++--
.../accumulo/core/file/rfile/bcfile/BCFile.java | 6 +-
.../core/file/rfile/bcfile/Compression.java | 14 +--
.../file/streams/BoundedRangeFileInputStream.java | 4 +-
.../core/file/streams/RateLimitedOutputStream.java | 2 +-
.../core/metadata/MetadataLocationObtainer.java | 6 -
.../core/metadata/ServicerForRootTable.java | 6 +-
.../core/metadata/TableMetadataServicer.java | 3 +-
.../core/sample/impl/DataoutputHasher.java | 29 +++--
.../org/apache/accumulo/core/summary/Gatherer.java | 14 +--
.../java/org/apache/accumulo/core/util/Help.java | 2 +-
.../apache/accumulo/fate/zookeeper/ZooLock.java | 3 +-
.../core/client/lexicoder/DateLexicoderTest.java | 2 +-
.../client/lexicoder/ReverseLexicoderTest.java | 3 +-
.../core/client/lexicoder/StringLexicoderTest.java | 2 +-
.../core/client/lexicoder/TextLexicoderTest.java | 2 +-
.../mapred/AccumuloFileOutputFormatTest.java | 4 +-
.../client/mapred/AccumuloInputFormatTest.java | 8 +-
.../mapred/AccumuloMultiTableInputFormatTest.java | 3 +-
.../client/mapred/AccumuloOutputFormatTest.java | 2 +-
.../mapreduce/AccumuloFileOutputFormatTest.java | 2 +-
.../client/mapreduce/AccumuloOutputFormatTest.java | 2 +-
.../tokens/CredentialProviderTokenTest.java | 8 +-
.../security/tokens/DelegationTokenImplTest.java | 2 +-
.../core/clientImpl/ClientContextTest.java | 2 +-
.../clientImpl/ConcurrentKeyExtentCacheTest.java | 6 +-
.../core/clientImpl/ScannerOptionsTest.java | 2 +-
.../core/clientImpl/TableOperationsHelperTest.java | 126 +++++++--------------
.../core/clientImpl/TabletLocatorImplTest.java | 7 +-
.../core/clientImpl/lexicoder/ByteUtilsTest.java | 2 +-
.../mapreduce/lib/ConfiguratorBaseTest.java | 4 +-
.../core/conf/ConfigurationTypeHelperTest.java | 12 +-
.../conf/CredentialProviderFactoryShimTest.java | 18 ++-
.../apache/accumulo/core/data/ConditionTest.java | 2 +-
.../core/data/ConditionalMutationTest.java | 2 +-
.../org/apache/accumulo/core/data/ValueTest.java | 2 +-
.../blockfile/cache/BlockCacheManagerTest.java | 2 +-
.../file/blockfile/cache/TestCachedBlockQueue.java | 4 +-
.../apache/accumulo/core/file/rfile/RFileTest.java | 10 +-
.../core/file/rfile/bcfile/CompressionTest.java | 12 +-
.../file/streams/RateLimitedInputStreamTest.java | 9 +-
.../file/streams/RateLimitedOutputStreamTest.java | 3 +-
.../accumulo/core/iterators/IteratorUtilTest.java | 2 +-
.../core/iterators/user/ColumnSliceFilterTest.java | 8 +-
.../accumulo/core/iterators/user/CombinerTest.java | 2 +-
.../iterators/user/IntersectingIteratorTest.java | 7 +-
.../core/iterators/user/RowFilterTest.java | 6 +-
.../core/iterators/user/TestCfCqSlice.java | 18 +--
.../iterators/user/TransformingIteratorTest.java | 4 +-
.../core/metadata/MetadataServicerTest.java | 7 +-
.../core/security/AuthenticationTokenTest.java | 4 +-
.../accumulo/core/security/CredentialsTest.java | 4 +-
.../core/security/VisibilityConstraintTest.java | 2 +-
.../core/util/format/DateFormatSupplierTest.java | 4 +-
.../core/util/format/FormatterConfigTest.java | 2 +-
.../java/org/apache/accumulo/fate/SimpleStore.java | 2 +-
.../accumulo/fate/zookeeper/ZooCacheTest.java | 2 +-
.../org/apache/accumulo/server/util/Admin.java | 12 +-
84 files changed, 242 insertions(+), 380 deletions(-)
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/BulkImport.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/BulkImport.java
index 5e5b8bb..cfa0083 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/BulkImport.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/BulkImport.java
@@ -261,7 +261,7 @@ public class BulkImport implements ImportDestinationArguments, ImportMappingOpti
public interface KeyExtentCache {
KeyExtent lookup(Text row)
- throws IOException, AccumuloException, AccumuloSecurityException, TableNotFoundException;
+ throws AccumuloException, AccumuloSecurityException, TableNotFoundException;
}
public static List<KeyExtent> findOverlappingTablets(KeyExtentCache extentCache,
@@ -396,7 +396,7 @@ public class BulkImport implements ImportDestinationArguments, ImportMappingOpti
private Set<KeyExtent> mapDesitnationsToExtents(Table.ID tableId, KeyExtentCache kec,
List<Destination> destinations)
- throws IOException, AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
Set<KeyExtent> extents = new HashSet<>();
for (Destination dest : destinations) {
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientConfConverter.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientConfConverter.java
index 55372f3..50f5d21 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientConfConverter.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ClientConfConverter.java
@@ -16,7 +16,6 @@
*/
package org.apache.accumulo.core.clientImpl;
-import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -227,23 +226,17 @@ public class ClientConfConverter {
// Attempt to load sensitive properties from a CredentialProvider, if configured
org.apache.hadoop.conf.Configuration hadoopConf = getHadoopConfiguration();
if (hadoopConf != null) {
- try {
- for (String key : CredentialProviderFactoryShim.getKeys(hadoopConf)) {
- if (!Property.isValidPropertyKey(key) || !Property.isSensitive(key)) {
- continue;
- }
-
- if (filter.test(key)) {
- char[] value = CredentialProviderFactoryShim
- .getValueFromCredentialProvider(hadoopConf, key);
- if (value != null) {
- props.put(key, new String(value));
- }
+ for (String key : CredentialProviderFactoryShim.getKeys(hadoopConf)) {
+ if (!Property.isValidPropertyKey(key) || !Property.isSensitive(key)) {
+ continue;
+ }
+ if (filter.test(key)) {
+ char[] value = CredentialProviderFactoryShim
+ .getValueFromCredentialProvider(hadoopConf, key);
+ if (value != null) {
+ props.put(key, new String(value));
}
}
- } catch (IOException e) {
- log.warn("Failed to extract sensitive properties from Hadoop CredentialProvider, "
- + "falling back to accumulo.properties", e);
}
}
}
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/ConcurrentKeyExtentCache.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/ConcurrentKeyExtentCache.java
index 90093b2..35830e3 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ConcurrentKeyExtentCache.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ConcurrentKeyExtentCache.java
@@ -16,7 +16,6 @@
*/
package org.apache.accumulo.core.clientImpl;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -91,7 +90,7 @@ class ConcurrentKeyExtentCache implements KeyExtentCache {
@Override
public KeyExtent lookup(Text row)
- throws IOException, AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
while (true) {
KeyExtent ke = getFromCache(row);
if (ke != null)
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/ConditionalWriterImpl.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/ConditionalWriterImpl.java
index 6fa3c2a..71a6e11 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ConditionalWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ConditionalWriterImpl.java
@@ -47,7 +47,6 @@ import org.apache.accumulo.core.client.ConditionalWriter;
import org.apache.accumulo.core.client.ConditionalWriterConfig;
import org.apache.accumulo.core.client.Durability;
import org.apache.accumulo.core.client.TableDeletedException;
-import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.TableOfflineException;
import org.apache.accumulo.core.client.TimedOutException;
import org.apache.accumulo.core.clientImpl.TabletLocator.TabletServerMutations;
@@ -678,7 +677,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
* to finish... unless this exceeds timeout.
*/
private void invalidateSession(SessionID sessionId, HostAndPort location)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ throws AccumuloException {
long sleepTime = 50;
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/MultiTableBatchWriterImpl.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/MultiTableBatchWriterImpl.java
index 2f1d93f..f2e972c 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/MultiTableBatchWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/MultiTableBatchWriterImpl.java
@@ -21,8 +21,6 @@ import static com.google.common.base.Preconditions.checkArgument;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
import org.apache.accumulo.core.client.MultiTableBatchWriter;
@@ -142,8 +140,7 @@ public class MultiTableBatchWriterImpl implements MultiTableBatchWriter {
}
@Override
- public BatchWriter getBatchWriter(String tableName)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ public BatchWriter getBatchWriter(String tableName) throws TableNotFoundException {
checkArgument(tableName != null, "tableName is null");
Table.ID tableId = getId(tableName);
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/OfflineIterator.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/OfflineIterator.java
index 10bb2ea..d5ed87f 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/OfflineIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/OfflineIterator.java
@@ -29,7 +29,6 @@ import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.SampleNotPresentException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.sample.SamplerConfiguration;
@@ -83,8 +82,7 @@ class OfflineIterator implements Iterator<Entry<Key,Value>> {
}
@Override
- public SortedKeyValueIterator<Key,Value> reserveMapFileReader(String mapFileName)
- throws IOException {
+ public SortedKeyValueIterator<Key,Value> reserveMapFileReader(String mapFileName) {
throw new NotImplementedException();
}
@@ -208,8 +206,7 @@ class OfflineIterator implements Iterator<Entry<Key,Value>> {
}
}
- private void nextTablet()
- throws TableNotFoundException, AccumuloException, IOException, AccumuloSecurityException {
+ private void nextTablet() throws TableNotFoundException, AccumuloException, IOException {
Range nextRange = null;
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/ReplicationClient.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/ReplicationClient.java
index 43ba4ba..f8310dd 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ReplicationClient.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ReplicationClient.java
@@ -191,7 +191,7 @@ public class ReplicationClient {
public static <T> T executeServicerWithReturn(ClientContext context, HostAndPort tserver,
ClientExecReturn<T,ReplicationServicer.Client> exec, long timeout)
- throws AccumuloException, AccumuloSecurityException, TTransportException {
+ throws AccumuloException, AccumuloSecurityException {
ReplicationServicer.Client client = null;
while (true) {
try {
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/ReplicationOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/ReplicationOperationsImpl.java
index 8474a15..f098990 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ReplicationOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ReplicationOperationsImpl.java
@@ -32,8 +32,6 @@ import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.ReplicationOperations;
import org.apache.accumulo.core.client.admin.TableOperations;
-import org.apache.accumulo.core.client.replication.PeerExistsException;
-import org.apache.accumulo.core.client.replication.PeerNotFoundException;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
@@ -63,7 +61,7 @@ public class ReplicationOperationsImpl implements ReplicationOperations {
@Override
public void addPeer(final String name, final String replicaType)
- throws AccumuloException, AccumuloSecurityException, PeerExistsException {
+ throws AccumuloException, AccumuloSecurityException {
requireNonNull(name);
requireNonNull(replicaType);
context.instanceOperations().setProperty(Property.REPLICATION_PEERS.getKey() + name,
@@ -71,8 +69,7 @@ public class ReplicationOperationsImpl implements ReplicationOperations {
}
@Override
- public void removePeer(final String name)
- throws AccumuloException, AccumuloSecurityException, PeerNotFoundException {
+ public void removePeer(final String name) throws AccumuloException, AccumuloSecurityException {
requireNonNull(name);
context.instanceOperations().removeProperty(Property.REPLICATION_PEERS.getKey() + name);
}
@@ -120,7 +117,7 @@ public class ReplicationOperationsImpl implements ReplicationOperations {
}
protected Table.ID getTableId(AccumuloClient client, String tableName)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ throws TableNotFoundException {
TableOperations tops = client.tableOperations();
if (!client.tableOperations().exists(tableName)) {
@@ -139,8 +136,7 @@ public class ReplicationOperationsImpl implements ReplicationOperations {
}
@Override
- public Set<String> referencedFiles(String tableName)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ public Set<String> referencedFiles(String tableName) throws TableNotFoundException {
requireNonNull(tableName);
log.debug("Collecting referenced files for replication of table {}", tableName);
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/RootTabletLocator.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/RootTabletLocator.java
index 9ffa852..e4e9d2e 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/RootTabletLocator.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/RootTabletLocator.java
@@ -25,9 +25,6 @@ import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.clientImpl.TabletLocatorImpl.TabletServerLockChecker;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
@@ -49,8 +46,7 @@ public class RootTabletLocator extends TabletLocator {
@Override
public <T extends Mutation> void binMutations(ClientContext context, List<T> mutations,
- Map<String,TabletServerMutations<T>> binnedMutations, List<T> failures)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ Map<String,TabletServerMutations<T>> binnedMutations, List<T> failures) {
TabletLocation rootTabletLocation = getRootTabletLocation(context);
if (rootTabletLocation != null) {
TabletServerMutations<T> tsm = new TabletServerMutations<>(rootTabletLocation.tablet_session);
@@ -65,8 +61,7 @@ public class RootTabletLocator extends TabletLocator {
@Override
public List<Range> binRanges(ClientContext context, List<Range> ranges,
- Map<String,Map<KeyExtent,List<Range>>> binnedRanges)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ Map<String,Map<KeyExtent,List<Range>>> binnedRanges) {
TabletLocation rootTabletLocation = getRootTabletLocation(context);
if (rootTabletLocation != null) {
@@ -132,7 +127,7 @@ public class RootTabletLocator extends TabletLocator {
@Override
public TabletLocation locateTablet(ClientContext context, Text row, boolean skipRow,
- boolean retry) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ boolean retry) {
TabletLocation location = getRootTabletLocation(context);
// Always retry when finding the root tablet
while (retry && location == null) {
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsHelper.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsHelper.java
index 01ffa8a..f5f1446 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsHelper.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsHelper.java
@@ -78,7 +78,7 @@ public abstract class TableOperationsHelper implements TableOperations {
@Override
public IteratorSetting getIteratorSetting(String tableName, String name, IteratorScope scope)
- throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
+ throws AccumuloException, TableNotFoundException {
checkArgument(tableName != null, "tableName is null");
checkArgument(name != null, "name is null");
checkArgument(scope != null, "scope is null");
@@ -109,7 +109,7 @@ public abstract class TableOperationsHelper implements TableOperations {
@Override
public Map<String,EnumSet<IteratorScope>> listIterators(String tableName)
- throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
+ throws AccumuloException, TableNotFoundException {
Map<String,EnumSet<IteratorScope>> result = new TreeMap<>();
for (Entry<String,String> property : this.getProperties(tableName)) {
String name = property.getKey();
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
index bb9033b..853b8b1 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
@@ -1163,7 +1163,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
}
private void waitForTableStateTransition(Table.ID tableId, TableState expectedState)
- throws AccumuloException, TableNotFoundException, AccumuloSecurityException {
+ throws AccumuloException, TableNotFoundException {
Text startRow = null;
Text lastRow = null;
@@ -1343,8 +1343,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
@Override
public Text getMaxRow(String tableName, Authorizations auths, Text startRow,
- boolean startInclusive, Text endRow, boolean endInclusive)
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
+ boolean startInclusive, Text endRow, boolean endInclusive) throws TableNotFoundException {
checkArgument(tableName != null, "tableName is null");
checkArgument(auths != null, "auths is null");
Scanner scanner = context.createScanner(tableName, auths);
@@ -1863,7 +1862,7 @@ public class TableOperationsImpl extends TableOperationsHelper {
@Override
public List<SummarizerConfiguration> listSummarizers(String tableName)
- throws AccumuloException, TableNotFoundException, AccumuloSecurityException {
+ throws AccumuloException, TableNotFoundException {
return new ArrayList<>(SummarizerConfiguration.fromTableProperties(getProperties(tableName)));
}
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchDeleter.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchDeleter.java
index 8975609..b338f25 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchDeleter.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchDeleter.java
@@ -24,7 +24,6 @@ import org.apache.accumulo.core.client.BatchWriter;
import org.apache.accumulo.core.client.BatchWriterConfig;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.MutationsRejectedException;
-import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Value;
@@ -39,8 +38,7 @@ public class TabletServerBatchDeleter extends TabletServerBatchReader implements
private BatchWriterConfig bwConfig;
public TabletServerBatchDeleter(ClientContext context, Table.ID tableId,
- Authorizations authorizations, int numQueryThreads, BatchWriterConfig bwConfig)
- throws TableNotFoundException {
+ Authorizations authorizations, int numQueryThreads, BatchWriterConfig bwConfig) {
super(context, tableId, authorizations, numQueryThreads);
this.context = context;
this.tableId = tableId;
@@ -50,7 +48,7 @@ public class TabletServerBatchDeleter extends TabletServerBatchReader implements
}
@Override
- public void delete() throws MutationsRejectedException, TableNotFoundException {
+ public void delete() throws MutationsRejectedException {
BatchWriter bw = null;
try {
bw = new BatchWriterImpl(context, tableId, bwConfig);
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchWriter.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchWriter.java
index 1fcef72..0cd9d97 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchWriter.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchWriter.java
@@ -226,12 +226,7 @@ public class TabletServerBatchWriter {
if (mutations.getMemoryUsed() == 0)
return;
lastProcessingStartTime = System.currentTimeMillis();
- try {
- writer.queueMutations(mutations);
- } catch (InterruptedException e) {
- log.warn("Mutations rejected from binning thread, retrying...");
- failedMutations.add(mutations);
- }
+ writer.queueMutations(mutations);
mutations = new MutationSet();
}
@@ -580,7 +575,7 @@ public class TabletServerBatchWriter {
/**
* Add mutations that previously failed back into the mix
*/
- private synchronized void addFailedMutations(MutationSet failedMutations) throws Exception {
+ private synchronized void addFailedMutations(MutationSet failedMutations) {
mutations.addAll(failedMutations);
if (mutations.getMemoryUsed() >= maxMem / 2 || closed || flushing) {
startProcessing();
@@ -723,7 +718,7 @@ public class TabletServerBatchWriter {
}
- void queueMutations(final MutationSet mutationsToSend) throws InterruptedException {
+ void queueMutations(final MutationSet mutationsToSend) {
if (mutationsToSend == null)
return;
binningThreadPool.execute(Trace.wrap(() -> {
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftScanner.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftScanner.java
index 1a56d3a..61af620 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftScanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ThriftScanner.java
@@ -91,7 +91,7 @@ public class ThriftScanner {
List<IterInfo> serverSideIteratorList,
Map<String,Map<String,String>> serverSideIteratorOptions, int size,
Authorizations authorizations, long batchTimeOut, String classLoaderContext)
- throws AccumuloException, AccumuloSecurityException, NotServingTabletException {
+ throws AccumuloException, AccumuloSecurityException {
if (server == null)
throw new AccumuloException(new IOException());
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/ZookeeperLockChecker.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/ZookeeperLockChecker.java
index fc57b3a..1ba38ca 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/ZookeeperLockChecker.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/ZookeeperLockChecker.java
@@ -20,7 +20,6 @@ import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.clientImpl.TabletLocatorImpl.TabletServerLockChecker;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.accumulo.fate.zookeeper.ZooLock;
-import org.apache.zookeeper.KeeperException;
public class ZookeeperLockChecker implements TabletServerLockChecker {
@@ -34,11 +33,7 @@ public class ZookeeperLockChecker implements TabletServerLockChecker {
@Override
public boolean isLockHeld(String tserver, String session) {
- try {
- return ZooLock.getSessionId(zc, root + "/" + tserver) == Long.parseLong(session, 16);
- } catch (KeeperException | InterruptedException e) {
- throw new RuntimeException(e);
- }
+ return ZooLock.getSessionId(zc, root + "/" + tserver) == Long.parseLong(session, 16);
}
@Override
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/lexicoder/FixedByteArrayOutputStream.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/lexicoder/FixedByteArrayOutputStream.java
index 6eab48b..63b509c 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/lexicoder/FixedByteArrayOutputStream.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/lexicoder/FixedByteArrayOutputStream.java
@@ -16,7 +16,6 @@
*/
package org.apache.accumulo.core.clientImpl.lexicoder;
-import java.io.IOException;
import java.io.OutputStream;
/**
@@ -33,12 +32,12 @@ public class FixedByteArrayOutputStream extends OutputStream {
}
@Override
- public void write(int b) throws IOException {
+ public void write(int b) {
out[i++] = (byte) b;
}
@Override
- public void write(byte b[], int off, int len) throws IOException {
+ public void write(byte b[], int off, int len) {
System.arraycopy(b, off, out, i, len);
i += len;
}
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/BatchInputSplit.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/BatchInputSplit.java
index 6277586..5f929a9 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/BatchInputSplit.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/BatchInputSplit.java
@@ -106,7 +106,7 @@ public class BatchInputSplit extends org.apache.accumulo.core.client.mapreduce.R
* have your code rely on this return value.
*/
@Override
- public long getLength() throws IOException {
+ public long getLength() {
long sum = 0;
for (Range range : ranges)
sum += SplitUtils.getRangeLength(range);
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/DelegationTokenStub.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/DelegationTokenStub.java
index 4d687c9..100b023 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/DelegationTokenStub.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/DelegationTokenStub.java
@@ -20,11 +20,8 @@ import static java.util.Objects.requireNonNull;
import java.io.DataInput;
import java.io.DataOutput;
-import java.io.IOException;
import java.util.Set;
-import javax.security.auth.DestroyFailedException;
-
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
/**
@@ -48,17 +45,17 @@ public class DelegationTokenStub implements AuthenticationToken {
}
@Override
- public void write(DataOutput out) throws IOException {
+ public void write(DataOutput out) {
throw new UnsupportedOperationException();
}
@Override
- public void readFields(DataInput in) throws IOException {
+ public void readFields(DataInput in) {
throw new UnsupportedOperationException();
}
@Override
- public void destroy() throws DestroyFailedException {
+ public void destroy() {
throw new UnsupportedOperationException();
}
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/SplitUtils.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/SplitUtils.java
index 887ffaa..fa55305 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/SplitUtils.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/SplitUtils.java
@@ -17,7 +17,6 @@
package org.apache.accumulo.core.clientImpl.mapreduce;
-import java.io.IOException;
import java.math.BigInteger;
import org.apache.accumulo.core.data.ByteSequence;
@@ -52,7 +51,7 @@ public class SplitUtils {
/ endBI.subtract(startBI).doubleValue());
}
- public static long getRangeLength(Range range) throws IOException {
+ public static long getRangeLength(Range range) {
Text startRow = range.isInfiniteStartKey() ? new Text(new byte[] {Byte.MIN_VALUE})
: range.getStartKey().getRow();
Text stopRow = range.isInfiniteStopKey() ? new Text(new byte[] {Byte.MAX_VALUE})
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/ConfiguratorBase.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/ConfiguratorBase.java
index 9b78ecf..cfccdb4 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/ConfiguratorBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/ConfiguratorBase.java
@@ -32,7 +32,6 @@ import java.util.Scanner;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Accumulo;
import org.apache.accumulo.core.client.AccumuloClient;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.admin.DelegationTokenConfig;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.KerberosToken;
@@ -259,7 +258,7 @@ public class ConfiguratorBase {
* @since 1.6.0
*/
public static void setConnectorInfo(Class<?> implementingClass, Configuration conf,
- String principal, String tokenFile) throws AccumuloSecurityException {
+ String principal, String tokenFile) {
if (isConnectorInfoSet(implementingClass, conf))
throw new IllegalStateException("Connector info for " + implementingClass.getSimpleName()
+ " can only be set once per job");
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/InputConfigurator.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/InputConfigurator.java
index 80c3cf3..d1915ba 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/InputConfigurator.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/InputConfigurator.java
@@ -809,8 +809,7 @@ public class InputConfigurator extends ConfiguratorBase {
}
public static Map<String,Map<KeyExtent,List<Range>>> binOffline(Table.ID tableId,
- List<Range> ranges, ClientInfo clientInfo)
- throws AccumuloException, TableNotFoundException, AccumuloSecurityException {
+ List<Range> ranges, ClientInfo clientInfo) throws AccumuloException, TableNotFoundException {
try (ClientContext context = new ClientContext(clientInfo)) {
Map<String,Map<KeyExtent,List<Range>>> binnedRanges = new HashMap<>();
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java b/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
index 33e9ab6..457be13 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
@@ -368,10 +368,8 @@ public class CredentialProviderFactoryShim {
* Configuration for the CredentialProvider
* @return A list of aliases. An empty list if no CredentialProviders are configured, or the
* providers are empty.
- * @throws IOException
- * On errors reading a CredentialProvider
*/
- public static List<String> getKeys(Configuration conf) throws IOException {
+ public static List<String> getKeys(Configuration conf) {
requireNonNull(conf);
if (isHadoopCredentialProviderAvailable()) {
@@ -430,7 +428,7 @@ public class CredentialProviderFactoryShim {
* The credential to store
*/
public static void createEntryInProvider(Object credentialProvider, String name,
- char[] credential) throws IOException {
+ char[] credential) {
requireNonNull(credentialProvider);
requireNonNull(name);
requireNonNull(credential);
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 f7cb251..6a0f3a5 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
@@ -147,7 +147,7 @@ public class BlockedInputStream extends InputStream {
}
@Override
- public long skip(long n) throws IOException {
+ public long skip(long n) {
throw new UnsupportedOperationException();
// available(n);
// bb.position(bb.position()+(int)n);
diff --git a/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java b/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
index 9c9d417..22faf55 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
@@ -331,7 +331,7 @@ public class BloomFilterLayer {
* range of keys to check
* @return false iff key doesn't exist, true if key probably exists.
*/
- boolean probablyHasKey(Range range) throws IOException {
+ boolean probablyHasKey(Range range) {
if (bloomFilter == null) {
initiateLoad(maxLoadThreads);
if (bloomFilter == null)
@@ -419,7 +419,7 @@ public class BloomFilterLayer {
@Override
public void init(SortedKeyValueIterator<org.apache.accumulo.core.data.Key,Value> source,
- Map<String,String> options, IteratorEnvironment env) throws IOException {
+ Map<String,String> options, IteratorEnvironment env) {
throw new UnsupportedOperationException();
}
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java b/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
index b59fa45..f0f5aca 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
@@ -319,15 +319,14 @@ public class CachableBlockFile {
}
public Reader(FileSystem fs, Path dataFile, Configuration conf, BlockCache data,
- BlockCache index, AccumuloConfiguration accumuloConfiguration, CryptoService cryptoService)
- throws IOException {
+ BlockCache index, AccumuloConfiguration accumuloConfiguration,
+ CryptoService cryptoService) {
this(fs, dataFile, conf, null, data, index, null, accumuloConfiguration, cryptoService);
}
public Reader(FileSystem fs, Path dataFile, Configuration conf, Cache<String,Long> fileLenCache,
BlockCache data, BlockCache index, RateLimiter readLimiter,
- AccumuloConfiguration accumuloConfiguration, CryptoService cryptoService)
- throws IOException {
+ AccumuloConfiguration accumuloConfiguration, CryptoService cryptoService) {
this(pathToCacheId(dataFile), () -> fs.open(dataFile),
() -> fs.getFileStatus(dataFile).getLen(), fileLenCache, data, index, readLimiter, conf,
accumuloConfiguration, cryptoService);
@@ -335,15 +334,14 @@ public class CachableBlockFile {
public <InputStreamType extends InputStream & Seekable> Reader(String cacheId,
InputStreamType fsin, long len, Configuration conf, BlockCache data, BlockCache index,
- AccumuloConfiguration accumuloConfiguration, CryptoService cryptoService)
- throws IOException {
+ AccumuloConfiguration accumuloConfiguration, CryptoService cryptoService) {
this(cacheId, () -> fsin, () -> len, null, data, index, null, conf, accumuloConfiguration,
cryptoService);
}
public <InputStreamType extends InputStream & Seekable> Reader(InputStreamType fsin, long len,
Configuration conf, AccumuloConfiguration accumuloConfiguration,
- CryptoService cryptoService) throws IOException {
+ CryptoService cryptoService) {
this(null, () -> fsin, () -> len, null, null, null, null, conf, accumuloConfiguration,
cryptoService);
}
diff --git a/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java b/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java
index 7198efb..2feef6c 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java
@@ -96,7 +96,7 @@ public class MapFileOperations extends FileOperations {
@Override
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options,
- IteratorEnvironment env) throws IOException {
+ IteratorEnvironment env) {
throw new UnsupportedOperationException();
}
@@ -148,7 +148,7 @@ public class MapFileOperations extends FileOperations {
}
@Override
- protected FileSKVWriter openWriter(FileOptions options) throws IOException {
+ protected FileSKVWriter openWriter(FileOptions options) {
throw new UnsupportedOperationException();
}
diff --git a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
index 044284c..f6bbd82 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
@@ -385,7 +385,7 @@ public class RFile {
this.sampler = sampler;
}
- public void append(Key key, Value value) throws IOException {
+ public void append(Key key, Value value) {
if (sampler.accept(key)) {
entries.add(new SampleEntry(key, value));
dataSize += key.getSize() + value.getSize();
@@ -581,7 +581,7 @@ public class RFile {
}
public Writer(BCFile.Writer bfw, int blockSize, int indexBlockSize,
- SamplerConfigurationImpl samplerConfig, Sampler sampler) throws IOException {
+ SamplerConfigurationImpl samplerConfig, Sampler sampler) {
this.blockSize = blockSize;
this.maxBlockSize = (long) (blockSize * MAX_BLOCK_MULTIPLIER);
this.indexBlockSize = indexBlockSize;
@@ -735,7 +735,7 @@ public class RFile {
}
@Override
- public long getLength() throws IOException {
+ public long getLength() {
if (!closed) {
return fileWriter.getLength();
}
@@ -755,7 +755,7 @@ public class RFile {
private boolean checkRange = true;
private LocalityGroupReader(CachableBlockFile.Reader reader, LocalityGroupMetadata lgm,
- int version) throws IOException {
+ int version) {
super(lgm.columnFamilies, lgm.isDefaultLG);
this.firstKey = lgm.firstKey;
this.index = lgm.indexReader;
@@ -1074,12 +1074,12 @@ public class RFile {
}
@Override
- public Key getFirstKey() throws IOException {
+ public Key getFirstKey() {
return firstKey;
}
@Override
- public Key getLastKey() throws IOException {
+ public Key getLastKey() {
if (index.size() == 0)
return null;
return index.getLastKey();
@@ -1091,18 +1091,18 @@ public class RFile {
}
@Override
- public void closeDeepCopies() throws IOException {
+ public void closeDeepCopies() {
throw new UnsupportedOperationException();
}
@Override
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options,
- IteratorEnvironment env) throws IOException {
+ IteratorEnvironment env) {
throw new UnsupportedOperationException();
}
@Override
- public DataInputStream getMetaStore(String name) throws IOException {
+ public DataInputStream getMetaStore(String name) {
throw new UnsupportedOperationException();
}
@@ -1373,7 +1373,7 @@ public class RFile {
@Override
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options,
- IteratorEnvironment env) throws IOException {
+ IteratorEnvironment env) {
throw new UnsupportedOperationException();
}
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 bfe8dc3..6e9dda1 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
@@ -172,7 +172,7 @@ public final class BCFile {
*
* @return The current byte offset in underlying file.
*/
- long getCurrentPos() throws IOException {
+ long getCurrentPos() {
return fsOut.position() + fsBufferedOutput.size();
}
@@ -183,7 +183,7 @@ public final class BCFile {
/**
* Current size of compressed data.
*/
- long getCompressedSize() throws IOException {
+ long getCompressedSize() {
return getCurrentPos() - posStart;
}
@@ -255,7 +255,7 @@ public final class BCFile {
*
* @return the number of uncompressed bytes written through the BlockAppender so far.
*/
- public long getRawSize() throws IOException {
+ public long getRawSize() {
return size() & 0x00000000ffffffffL;
}
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 6841613..4234df4 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
@@ -176,7 +176,7 @@ public final class Compression {
}
@Override
- CompressionCodec getCodec() throws IOException {
+ CompressionCodec getCodec() {
return codec;
}
@@ -305,7 +305,7 @@ public final class Compression {
@Override
public InputStream createDecompressionStream(InputStream downStream,
- Decompressor decompressor, int downStreamBufferSize) throws IOException {
+ Decompressor decompressor, int downStreamBufferSize) {
if (downStreamBufferSize > 0) {
return new BufferedInputStream(downStream, downStreamBufferSize);
}
@@ -324,7 +324,7 @@ public final class Compression {
@Override
public OutputStream createCompressionStream(OutputStream downStream, Compressor compressor,
- int downStreamBufferSize) throws IOException {
+ int downStreamBufferSize) {
if (downStreamBufferSize > 0) {
return new BufferedOutputStream(downStream, downStreamBufferSize);
}
@@ -358,7 +358,7 @@ public final class Compression {
private static final int DEFAULT_BUFFER_SIZE = 64 * 1024;
@Override
- public CompressionCodec getCodec() throws IOException {
+ public CompressionCodec getCodec() {
return snappyCodec;
}
@@ -617,7 +617,7 @@ public final class Compression {
this.compressName = name;
}
- abstract CompressionCodec getCodec() throws IOException;
+ abstract CompressionCodec getCodec();
/**
* function to create the default codec object.
@@ -642,7 +642,7 @@ public final class Compression {
public abstract boolean isSupported();
- public Compressor getCompressor() throws IOException {
+ public Compressor getCompressor() {
CompressionCodec codec = getCodec();
if (codec != null) {
Compressor compressor = CodecPool.getCompressor(codec);
@@ -672,7 +672,7 @@ public final class Compression {
}
}
- public Decompressor getDecompressor() throws IOException {
+ public Decompressor getDecompressor() {
CompressionCodec codec = getCodec();
if (codec != null) {
Decompressor decompressor = CodecPool.getDecompressor(codec);
diff --git a/core/src/main/java/org/apache/accumulo/core/file/streams/BoundedRangeFileInputStream.java b/core/src/main/java/org/apache/accumulo/core/file/streams/BoundedRangeFileInputStream.java
index d7fbb8f..34bd8b4 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/streams/BoundedRangeFileInputStream.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/streams/BoundedRangeFileInputStream.java
@@ -61,7 +61,7 @@ public class BoundedRangeFileInputStream extends InputStream {
}
@Override
- public int available() throws IOException {
+ public int available() {
return (int) (end - pos);
}
@@ -108,7 +108,7 @@ public class BoundedRangeFileInputStream extends InputStream {
/*
* We may skip beyond the end of the file.
*/
- public long skip(long n) throws IOException {
+ public long skip(long n) {
long len = Math.min(n, end - pos);
pos += len;
return len;
diff --git a/core/src/main/java/org/apache/accumulo/core/file/streams/RateLimitedOutputStream.java b/core/src/main/java/org/apache/accumulo/core/file/streams/RateLimitedOutputStream.java
index b83b898..0397092 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/streams/RateLimitedOutputStream.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/streams/RateLimitedOutputStream.java
@@ -52,7 +52,7 @@ public class RateLimitedOutputStream extends DataOutputStream {
out.close();
}
- public long position() throws IOException {
+ public long position() {
return ((FSDataOutputStream) out).getPos();
}
}
diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java b/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
index 28e54db..b6284bf 100644
--- a/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
+++ b/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
@@ -53,7 +53,6 @@ import org.apache.accumulo.core.dataImpl.thrift.IterInfo;
import org.apache.accumulo.core.iterators.user.WholeRowIterator;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.tabletserver.thrift.NotServingTabletException;
import org.apache.accumulo.core.util.OpTimer;
import org.apache.accumulo.core.util.TextUtil;
import org.apache.hadoop.io.Text;
@@ -135,11 +134,6 @@ public class MetadataLocationObtainer implements TabletLocationObtainer {
log.trace("{} lookup failed, {} server side exception", src.tablet_extent.getTableId(),
src.tablet_location);
throw ase;
- } catch (NotServingTabletException e) {
- if (log.isTraceEnabled())
- log.trace("{} lookup failed, {} not serving {}", src.tablet_extent.getTableId(),
- src.tablet_location, src.tablet_extent);
- parent.invalidateCache(src.tablet_extent);
} catch (AccumuloException e) {
if (log.isTraceEnabled())
log.trace("{} lookup failed", src.tablet_extent.getTableId(), e);
diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/ServicerForRootTable.java b/core/src/main/java/org/apache/accumulo/core/metadata/ServicerForRootTable.java
index 66ed4f9..15c701c 100644
--- a/core/src/main/java/org/apache/accumulo/core/metadata/ServicerForRootTable.java
+++ b/core/src/main/java/org/apache/accumulo/core/metadata/ServicerForRootTable.java
@@ -18,9 +18,6 @@ package org.apache.accumulo.core.metadata;
import java.util.SortedMap;
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.clientImpl.Table;
import org.apache.accumulo.core.dataImpl.KeyExtent;
@@ -43,8 +40,7 @@ class ServicerForRootTable extends MetadataServicer {
}
@Override
- public void getTabletLocations(SortedMap<KeyExtent,String> tablets)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ public void getTabletLocations(SortedMap<KeyExtent,String> tablets) {
tablets.put(RootTable.EXTENT, context.getRootTabletLocation());
}
}
diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/TableMetadataServicer.java b/core/src/main/java/org/apache/accumulo/core/metadata/TableMetadataServicer.java
index f2c7891..9689f29 100644
--- a/core/src/main/java/org/apache/accumulo/core/metadata/TableMetadataServicer.java
+++ b/core/src/main/java/org/apache/accumulo/core/metadata/TableMetadataServicer.java
@@ -22,7 +22,6 @@ import java.util.SortedMap;
import java.util.SortedSet;
import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.clientImpl.ClientContext;
@@ -61,7 +60,7 @@ abstract class TableMetadataServicer extends MetadataServicer {
@Override
public void getTabletLocations(SortedMap<KeyExtent,String> tablets)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ throws AccumuloException, TableNotFoundException {
Scanner scanner = context.createScanner(getServicingTableName(), Authorizations.EMPTY);
diff --git a/core/src/main/java/org/apache/accumulo/core/sample/impl/DataoutputHasher.java b/core/src/main/java/org/apache/accumulo/core/sample/impl/DataoutputHasher.java
index 185de80..32170cd 100644
--- a/core/src/main/java/org/apache/accumulo/core/sample/impl/DataoutputHasher.java
+++ b/core/src/main/java/org/apache/accumulo/core/sample/impl/DataoutputHasher.java
@@ -20,7 +20,6 @@ package org.apache.accumulo.core.sample.impl;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.DataOutput;
-import java.io.IOException;
import com.google.common.hash.Hasher;
@@ -33,76 +32,76 @@ public class DataoutputHasher implements DataOutput {
}
@Override
- public void write(int b) throws IOException {
+ public void write(int b) {
hasher.putByte((byte) (0xff & b));
}
@Override
- public void write(byte[] b) throws IOException {
+ public void write(byte[] b) {
hasher.putBytes(b);
}
@Override
- public void write(byte[] b, int off, int len) throws IOException {
+ public void write(byte[] b, int off, int len) {
hasher.putBytes(b, off, len);
}
@Override
- public void writeBoolean(boolean v) throws IOException {
+ public void writeBoolean(boolean v) {
hasher.putBoolean(v);
}
@Override
- public void writeByte(int v) throws IOException {
+ public void writeByte(int v) {
hasher.putByte((byte) (0xff & v));
}
@Override
- public void writeShort(int v) throws IOException {
+ public void writeShort(int v) {
hasher.putShort((short) (0xffff & v));
}
@Override
- public void writeChar(int v) throws IOException {
+ public void writeChar(int v) {
hasher.putChar((char) v);
}
@Override
- public void writeInt(int v) throws IOException {
+ public void writeInt(int v) {
hasher.putInt(v);
}
@Override
- public void writeLong(long v) throws IOException {
+ public void writeLong(long v) {
hasher.putLong(v);
}
@Override
- public void writeFloat(float v) throws IOException {
+ public void writeFloat(float v) {
hasher.putDouble(v);
}
@Override
- public void writeDouble(double v) throws IOException {
+ public void writeDouble(double v) {
hasher.putDouble(v);
}
@Override
- public void writeBytes(String s) throws IOException {
+ public void writeBytes(String s) {
for (int i = 0; i < s.length(); i++) {
hasher.putByte((byte) (0xff & s.charAt(i)));
}
}
@Override
- public void writeChars(String s) throws IOException {
+ public void writeChars(String s) {
hasher.putString(s, UTF_8);
}
@Override
- public void writeUTF(String s) throws IOException {
+ public void writeUTF(String s) {
hasher.putInt(s.length());
hasher.putBytes(s.getBytes(UTF_8));
}
diff --git a/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java b/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
index dcce4e6..2caf03f 100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
@@ -43,7 +43,6 @@ import java.util.stream.Collectors;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.summary.SummarizerConfiguration;
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.clientImpl.ServerClient;
@@ -163,8 +162,7 @@ public class Gatherer {
* associated with a file represent the tablets that use the file.
*/
private Map<String,Map<String,List<TRowRange>>> getFilesGroupedByLocation(
- Predicate<String> fileSelector)
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
+ Predicate<String> fileSelector) {
Iterable<TabletMetadata> tmi = TabletsMetadata.builder().forTable(tableId)
.overlapping(startRow, endRow).fetchFiles().fetchLocation().fetchLast().fetchPrev()
@@ -522,8 +520,7 @@ public class Gatherer {
(sc1, sc2) -> SummaryCollection.merge(sc1, sc2, factory), SummaryCollection::new);
}
- private int countFiles()
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
+ private int countFiles() {
// TODO use a batch scanner + iterator to parallelize counting files
return TabletsMetadata.builder().forTable(tableId).overlapping(startRow, endRow).fetchFiles()
.fetchPrev().build(ctx).stream().mapToInt(tm -> tm.getFiles().size()).sum();
@@ -570,12 +567,7 @@ public class Gatherer {
}
public Future<SummaryCollection> gather(ExecutorService es) {
- int numFiles;
- try {
- numFiles = countFiles();
- } catch (TableNotFoundException | AccumuloException | AccumuloSecurityException e) {
- throw new RuntimeException(e);
- }
+ int numFiles = countFiles();
log.debug("Gathering summaries from {} files", numFiles);
diff --git a/core/src/main/java/org/apache/accumulo/core/util/Help.java b/core/src/main/java/org/apache/accumulo/core/util/Help.java
index 960265c..c57338e 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/Help.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/Help.java
@@ -39,7 +39,7 @@ public class Help implements KeywordExecutable {
}
@Override
- public void execute(final String[] args) throws Exception {
+ public void execute(final String[] args) {
Main.printUsage();
}
}
diff --git a/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java b/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
index a897bbf..db71de3 100644
--- a/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
+++ b/core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooLock.java
@@ -464,8 +464,7 @@ public class ZooLock implements Watcher {
return zc.get(path + "/" + lockNode, stat);
}
- public static long getSessionId(ZooCache zc, String path)
- throws KeeperException, InterruptedException {
+ public static long getSessionId(ZooCache zc, String path) {
List<String> children = zc.getChildren(path);
if (children == null || children.size() == 0) {
diff --git a/core/src/test/java/org/apache/accumulo/core/client/lexicoder/DateLexicoderTest.java b/core/src/test/java/org/apache/accumulo/core/client/lexicoder/DateLexicoderTest.java
index 0ad3974..d90ae97 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/lexicoder/DateLexicoderTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/lexicoder/DateLexicoderTest.java
@@ -24,7 +24,7 @@ import org.junit.Test;
public class DateLexicoderTest extends AbstractLexicoderTest {
@Test
- public void testDecode() throws Exception {
+ public void testDecode() {
assertDecodes(new DateLexicoder(), new Date());
assertDecodes(new DateLexicoder(), new Date(0));
assertDecodes(new DateLexicoder(), new Date(Long.MAX_VALUE));
diff --git a/core/src/test/java/org/apache/accumulo/core/client/lexicoder/ReverseLexicoderTest.java b/core/src/test/java/org/apache/accumulo/core/client/lexicoder/ReverseLexicoderTest.java
index 641e39e..7a254cd 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/lexicoder/ReverseLexicoderTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/lexicoder/ReverseLexicoderTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.accumulo.core.client.lexicoder;
-import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
@@ -47,7 +46,7 @@ public class ReverseLexicoderTest extends AbstractLexicoderTest {
* Just a simple test verifying reverse indexed dates
*/
@Test
- public void testReverseSortDates() throws UnsupportedEncodingException {
+ public void testReverseSortDates() {
ReverseLexicoder<Date> revLex = new ReverseLexicoder<>(new DateLexicoder());
diff --git a/core/src/test/java/org/apache/accumulo/core/client/lexicoder/StringLexicoderTest.java b/core/src/test/java/org/apache/accumulo/core/client/lexicoder/StringLexicoderTest.java
index 3bb0b65..fb24ad6 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/lexicoder/StringLexicoderTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/lexicoder/StringLexicoderTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
public class StringLexicoderTest extends AbstractLexicoderTest {
@Test
- public void testDecode() throws Exception {
+ public void testDecode() {
assertDecodes(new StringLexicoder(), "");
assertDecodes(new StringLexicoder(), "0");
assertDecodes(new StringLexicoder(), "accumulo");
diff --git a/core/src/test/java/org/apache/accumulo/core/client/lexicoder/TextLexicoderTest.java b/core/src/test/java/org/apache/accumulo/core/client/lexicoder/TextLexicoderTest.java
index 2e5fb02..1ab0f55 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/lexicoder/TextLexicoderTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/lexicoder/TextLexicoderTest.java
@@ -23,7 +23,7 @@ import org.junit.Test;
public class TextLexicoderTest extends AbstractLexicoderTest {
@Test
- public void testDecode() throws Exception {
+ public void testDecode() {
assertDecodes(new TextLexicoder(), new Text(""));
assertDecodes(new TextLexicoder(), new Text("accumulo"));
}
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
index 41c24dc..6adf2df 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloFileOutputFormatTest.java
@@ -18,8 +18,6 @@ package org.apache.accumulo.core.client.mapred;
import static org.junit.Assert.assertEquals;
-import java.io.IOException;
-
import org.apache.accumulo.core.client.sample.RowSampler;
import org.apache.accumulo.core.client.sample.SamplerConfiguration;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
@@ -35,7 +33,7 @@ import org.junit.Test;
public class AccumuloFileOutputFormatTest {
@Test
- public void validateConfiguration() throws IOException, InterruptedException {
+ public void validateConfiguration() {
int a = 7;
long b = 300L;
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormatTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormatTest.java
index 8aa94d4..9539a59 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormatTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormatTest.java
@@ -64,7 +64,7 @@ public class AccumuloInputFormatTest {
}
@Test
- public void testAddIterator() throws IOException {
+ public void testAddIterator() {
AccumuloInputFormat.addIterator(job,
new IteratorSetting(1, "WholeRow", WholeRowIterator.class));
AccumuloInputFormat.addIterator(job, new IteratorSetting(2, "Versions",
@@ -113,7 +113,7 @@ public class AccumuloInputFormatTest {
* expected.
*/
@Test
- public void testIteratorOptionEncoding() throws Throwable {
+ public void testIteratorOptionEncoding() {
String key = "colon:delimited:key";
String value = "comma,delimited,value";
IteratorSetting someSetting = new IteratorSetting(1, "iterator", "Iterator.class");
@@ -142,7 +142,7 @@ public class AccumuloInputFormatTest {
* Test getting iterator settings for multiple iterators set
*/
@Test
- public void testGetIteratorSettings() throws IOException {
+ public void testGetIteratorSettings() {
AccumuloInputFormat.addIterator(job,
new IteratorSetting(1, "WholeRow", "org.apache.accumulo.core.iterators.WholeRowIterator"));
AccumuloInputFormat.addIterator(job, new IteratorSetting(2, "Versions",
@@ -175,7 +175,7 @@ public class AccumuloInputFormatTest {
}
@Test
- public void testSetRegex() throws IOException {
+ public void testSetRegex() {
String regex = ">\"*%<>\'\\";
IteratorSetting is = new IteratorSetting(50, regex, RegExFilter.class);
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloMultiTableInputFormatTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloMultiTableInputFormatTest.java
index 93ac682..5b716ab 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloMultiTableInputFormatTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloMultiTableInputFormatTest.java
@@ -18,7 +18,6 @@ package org.apache.accumulo.core.client.mapred;
import static org.junit.Assert.assertEquals;
-import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -46,7 +45,7 @@ public class AccumuloMultiTableInputFormatTest {
* serialized in the JobContext.
*/
@Test
- public void testTableQueryConfigSerialization() throws IOException {
+ public void testTableQueryConfigSerialization() {
String table1Name = testName.getMethodName() + "1";
String table2Name = testName.getMethodName() + "2";
JobConf job = new JobConf();
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormatTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormatTest.java
index fd42942..099668d 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormatTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormatTest.java
@@ -53,7 +53,7 @@ public class AccumuloOutputFormatTest {
AccumuloOutputFormat myAOF = new AccumuloOutputFormat() {
@Override
- public void checkOutputSpecs(FileSystem ignored, JobConf job) throws IOException {
+ public void checkOutputSpecs(FileSystem ignored, JobConf job) {
BatchWriterConfig bwOpts = getBatchWriterOptions(job);
// passive check
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
index 4ec28e8..6221a65 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloFileOutputFormatTest.java
@@ -35,7 +35,7 @@ import org.junit.Test;
public class AccumuloFileOutputFormatTest {
@Test
- public void validateConfiguration() throws IOException, InterruptedException {
+ public void validateConfiguration() throws IOException {
int a = 7;
long b = 300L;
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
index 232ac0b..d7799af 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
@@ -53,7 +53,7 @@ public class AccumuloOutputFormatTest {
AccumuloOutputFormat myAOF = new AccumuloOutputFormat() {
@Override
- public void checkOutputSpecs(JobContext job) throws IOException {
+ public void checkOutputSpecs(JobContext job) {
BatchWriterConfig bwOpts = getBatchWriterOptions(job);
// passive check
diff --git a/core/src/test/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderTokenTest.java b/core/src/test/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderTokenTest.java
index a60c336..5423fb2 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderTokenTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/security/tokens/CredentialProviderTokenTest.java
@@ -89,7 +89,7 @@ public class CredentialProviderTokenTest {
}
@Test
- public void testMissingClassesThrowsException() throws Exception {
+ public void testMissingClassesThrowsException() {
if (isCredentialProviderAvailable) {
return;
}
@@ -116,13 +116,13 @@ public class CredentialProviderTokenTest {
}
@Test(expected = IllegalArgumentException.class)
- public void missingProperties() throws Exception {
+ public void missingProperties() {
CredentialProviderToken token = new CredentialProviderToken();
token.init(new Properties());
}
@Test(expected = IllegalArgumentException.class)
- public void missingNameProperty() throws Exception {
+ public void missingNameProperty() {
CredentialProviderToken token = new CredentialProviderToken();
Properties props = new Properties();
props.put(CredentialProviderToken.NAME_PROPERTY, "root.password");
@@ -130,7 +130,7 @@ public class CredentialProviderTokenTest {
}
@Test(expected = IllegalArgumentException.class)
- public void missingProviderProperty() throws Exception {
+ public void missingProviderProperty() {
CredentialProviderToken token = new CredentialProviderToken();
Properties props = new Properties();
props.put(CredentialProviderToken.CREDENTIAL_PROVIDERS_PROPERTY, keystorePath);
diff --git a/core/src/test/java/org/apache/accumulo/core/client/security/tokens/DelegationTokenImplTest.java b/core/src/test/java/org/apache/accumulo/core/client/security/tokens/DelegationTokenImplTest.java
index 87c0484..c633dea 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/security/tokens/DelegationTokenImplTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/security/tokens/DelegationTokenImplTest.java
@@ -52,7 +52,7 @@ public class DelegationTokenImplTest {
}
@Test
- public void testEquality() throws IOException {
+ public void testEquality() {
AuthenticationTokenIdentifier identifier = new AuthenticationTokenIdentifier("user", 1, 1000L,
2000L, "instanceid");
// We don't need a real serialized Token for the password
diff --git a/core/src/test/java/org/apache/accumulo/core/clientImpl/ClientContextTest.java b/core/src/test/java/org/apache/accumulo/core/clientImpl/ClientContextTest.java
index 997e4aa..d76fbe6 100644
--- a/core/src/test/java/org/apache/accumulo/core/clientImpl/ClientContextTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/clientImpl/ClientContextTest.java
@@ -46,7 +46,7 @@ public class ClientContextTest {
@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN",
justification = "provided keystoreUrl path isn't user provided")
@BeforeClass
- public static void setUpBeforeClass() throws Exception {
+ public static void setUpBeforeClass() {
try {
Class.forName(CredentialProviderFactoryShim.HADOOP_CRED_PROVIDER_CLASS_NAME);
isCredentialProviderAvailable = true;
diff --git a/core/src/test/java/org/apache/accumulo/core/clientImpl/ConcurrentKeyExtentCacheTest.java b/core/src/test/java/org/apache/accumulo/core/clientImpl/ConcurrentKeyExtentCacheTest.java
index a7a967a..4e635bb 100644
--- a/core/src/test/java/org/apache/accumulo/core/clientImpl/ConcurrentKeyExtentCacheTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/clientImpl/ConcurrentKeyExtentCacheTest.java
@@ -19,7 +19,6 @@ package org.apache.accumulo.core.clientImpl;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import java.io.IOException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.HashSet;
@@ -94,8 +93,7 @@ public class ConcurrentKeyExtentCacheTest {
KeyExtent extent = tc.lookup(lookupRow);
assertTrue(extent.contains(lookupRow));
assertTrue(extentsSet.contains(extent));
- } catch (IOException | AccumuloException | AccumuloSecurityException
- | TableNotFoundException e) {
+ } catch (AccumuloException | AccumuloSecurityException | TableNotFoundException e) {
throw new RuntimeException(e);
}
}
@@ -118,7 +116,7 @@ public class ConcurrentKeyExtentCacheTest {
}
@Test
- public void testRandom() throws Exception {
+ public void testRandom() {
TestCache tc = new TestCache();
Random rand = new SecureRandom();
diff --git a/core/src/test/java/org/apache/accumulo/core/clientImpl/ScannerOptionsTest.java b/core/src/test/java/org/apache/accumulo/core/clientImpl/ScannerOptionsTest.java
index de7e446..c16c9dc 100644
--- a/core/src/test/java/org/apache/accumulo/core/clientImpl/ScannerOptionsTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/clientImpl/ScannerOptionsTest.java
@@ -37,7 +37,7 @@ public class ScannerOptionsTest {
* Test that you properly add and remove iterators from a scanner
*/
@Test
- public void testAddRemoveIterator() throws Throwable {
+ public void testAddRemoveIterator() {
try (ScannerOptions options = new ScannerOptions()) {
options.addScanIterator(new IteratorSetting(1, "NAME", WholeRowIterator.class));
assertEquals(1, options.serverSideIteratorList.size());
diff --git a/core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java b/core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java
index 5e6dc6c..81d4141 100644
--- a/core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java
@@ -21,7 +21,6 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
@@ -35,10 +34,7 @@ import java.util.TreeMap;
import java.util.function.Predicate;
import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.IteratorSetting;
-import org.apache.accumulo.core.client.TableExistsException;
-import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.CompactionConfig;
import org.apache.accumulo.core.client.admin.DiskUsage;
import org.apache.accumulo.core.client.admin.Locations;
@@ -68,98 +64,80 @@ public class TableOperationsHelperTest {
}
@Override
- public void create(String tableName)
- throws AccumuloException, AccumuloSecurityException, TableExistsException {}
+ public void create(String tableName) {}
@Override
- public void create(String tableName, NewTableConfiguration ntc)
- throws AccumuloException, AccumuloSecurityException, TableExistsException {}
+ public void create(String tableName, NewTableConfiguration ntc) {}
@Override
- public void addSplits(String tableName, SortedSet<Text> partitionKeys)
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {}
+ public void addSplits(String tableName, SortedSet<Text> partitionKeys) {}
@Override
- public Collection<Text> listSplits(String tableName) throws TableNotFoundException {
+ public Collection<Text> listSplits(String tableName) {
return null;
}
@Override
- public Collection<Text> listSplits(String tableName, int maxSplits)
- throws TableNotFoundException {
+ public Collection<Text> listSplits(String tableName, int maxSplits) {
return null;
}
@Override
public Text getMaxRow(String tableName, Authorizations auths, Text startRow,
- boolean startInclusive, Text endRow, boolean endInclusive)
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
+ boolean startInclusive, Text endRow, boolean endInclusive) {
return null;
}
@Override
- public void merge(String tableName, Text start, Text end)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ public void merge(String tableName, Text start, Text end) {
}
@Override
- public void deleteRows(String tableName, Text start, Text end)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {}
+ public void deleteRows(String tableName, Text start, Text end) {}
@Override
- public void compact(String tableName, Text start, Text end, boolean flush, boolean wait)
- throws AccumuloSecurityException, TableNotFoundException, AccumuloException {}
+ public void compact(String tableName, Text start, Text end, boolean flush, boolean wait) {}
@Override
public void compact(String tableName, Text start, Text end, List<IteratorSetting> iterators,
- boolean flush, boolean wait)
- throws AccumuloSecurityException, TableNotFoundException, AccumuloException {}
+ boolean flush, boolean wait) {}
@Override
- public void compact(String tableName, CompactionConfig config)
- throws AccumuloSecurityException, TableNotFoundException, AccumuloException {}
+ public void compact(String tableName, CompactionConfig config) {}
@Override
- public void delete(String tableName)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {}
+ public void delete(String tableName) {}
@Override
public void clone(String srcTableName, String newTableName, boolean flush,
- Map<String,String> propertiesToSet, Set<String> propertiesToExclude)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException,
- TableExistsException {}
+ Map<String,String> propertiesToSet, Set<String> propertiesToExclude) {}
@Override
- public void rename(String oldTableName, String newTableName) throws AccumuloSecurityException,
- TableNotFoundException, AccumuloException, TableExistsException {}
+ public void rename(String oldTableName, String newTableName) {}
@Override
- public void flush(String tableName) throws AccumuloException, AccumuloSecurityException {}
+ public void flush(String tableName) {}
@Override
- public void flush(String tableName, Text start, Text end, boolean wait)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {}
+ public void flush(String tableName, Text start, Text end, boolean wait) {}
@Override
- public void setProperty(String tableName, String property, String value)
- throws AccumuloException, AccumuloSecurityException {
+ public void setProperty(String tableName, String property, String value) {
if (!settings.containsKey(tableName))
settings.put(tableName, new TreeMap<>());
settings.get(tableName).put(property, value);
}
@Override
- public void removeProperty(String tableName, String property)
- throws AccumuloException, AccumuloSecurityException {
+ public void removeProperty(String tableName, String property) {
if (!settings.containsKey(tableName))
return;
settings.get(tableName).remove(property);
}
@Override
- public Iterable<Entry<String,String>> getProperties(String tableName)
- throws AccumuloException, TableNotFoundException {
+ public Iterable<Entry<String,String>> getProperties(String tableName) {
Map<String,String> empty = Collections.emptyMap();
if (!settings.containsKey(tableName))
return empty.entrySet();
@@ -167,48 +145,40 @@ public class TableOperationsHelperTest {
}
@Override
- public void setLocalityGroups(String tableName, Map<String,Set<Text>> groups)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {}
+ public void setLocalityGroups(String tableName, Map<String,Set<Text>> groups) {}
@Override
- public Map<String,Set<Text>> getLocalityGroups(String tableName)
- throws AccumuloException, TableNotFoundException {
+ public Map<String,Set<Text>> getLocalityGroups(String tableName) {
return null;
}
@Override
- public Set<Range> splitRangeByTablets(String tableName, Range range, int maxSplits)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ public Set<Range> splitRangeByTablets(String tableName, Range range, int maxSplits) {
return null;
}
@Override
@Deprecated
- public void importDirectory(String tableName, String dir, String failureDir, boolean setTime)
- throws TableNotFoundException, IOException, AccumuloException, AccumuloSecurityException {}
+ public void importDirectory(String tableName, String dir, String failureDir, boolean setTime) {}
@Override
- public void offline(String tableName)
- throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
+ public void offline(String tableName) {
}
@Override
- public void online(String tableName)
- throws AccumuloSecurityException, AccumuloException, TableNotFoundException {}
+ public void online(String tableName) {}
@Override
- public void offline(String tableName, boolean wait)
- throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
+ public void offline(String tableName, boolean wait) {
}
@Override
- public void online(String tableName, boolean wait)
- throws AccumuloSecurityException, AccumuloException, TableNotFoundException {}
+ public void online(String tableName, boolean wait) {}
@Override
- public void clearLocatorCache(String tableName) throws TableNotFoundException {}
+ public void clearLocatorCache(String tableName) {}
@Override
public Map<String,String> tableIdMap() {
@@ -216,75 +186,63 @@ public class TableOperationsHelperTest {
}
@Override
- public List<DiskUsage> getDiskUsage(Set<String> tables)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ public List<DiskUsage> getDiskUsage(Set<String> tables) {
return null;
}
@Override
- public void importTable(String tableName, String exportDir)
- throws TableExistsException, AccumuloException, AccumuloSecurityException {}
+ public void importTable(String tableName, String exportDir) {}
@Override
- public void exportTable(String tableName, String exportDir)
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {}
+ public void exportTable(String tableName, String exportDir) {}
@Override
- public void cancelCompaction(String tableName)
- throws AccumuloSecurityException, TableNotFoundException, AccumuloException {}
+ public void cancelCompaction(String tableName) {}
@Override
- public boolean testClassLoad(String tableName, String className, String asTypeName)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ public boolean testClassLoad(String tableName, String className, String asTypeName) {
return false;
}
@Override
- public void setSamplerConfiguration(String tableName, SamplerConfiguration samplerConfiguration)
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
+ public void setSamplerConfiguration(String tableName,
+ SamplerConfiguration samplerConfiguration) {
throw new UnsupportedOperationException();
}
@Override
- public void clearSamplerConfiguration(String tableName)
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
+ public void clearSamplerConfiguration(String tableName) {
throw new UnsupportedOperationException();
}
@Override
- public SamplerConfiguration getSamplerConfiguration(String tableName)
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
+ public SamplerConfiguration getSamplerConfiguration(String tableName) {
throw new UnsupportedOperationException();
}
@Override
- public Locations locate(String tableName, Collection<Range> ranges)
- throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
+ public Locations locate(String tableName, Collection<Range> ranges) {
throw new UnsupportedOperationException();
}
@Override
- public SummaryRetriever summaries(String tableName)
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
+ public SummaryRetriever summaries(String tableName) {
throw new UnsupportedOperationException();
}
@Override
- public void addSummarizers(String tableName, SummarizerConfiguration... summarizerConf)
- throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
+ public void addSummarizers(String tableName, SummarizerConfiguration... summarizerConf) {
throw new UnsupportedOperationException();
}
@Override
- public void removeSummarizers(String tableName, Predicate<SummarizerConfiguration> predicate)
- throws AccumuloException, TableNotFoundException, AccumuloSecurityException {
+ public void removeSummarizers(String tableName, Predicate<SummarizerConfiguration> predicate) {
throw new UnsupportedOperationException();
}
@Override
- public List<SummarizerConfiguration> listSummarizers(String tableName)
- throws AccumuloException, TableNotFoundException, AccumuloSecurityException {
+ public List<SummarizerConfiguration> listSummarizers(String tableName) {
throw new UnsupportedOperationException();
}
}
diff --git a/core/src/test/java/org/apache/accumulo/core/clientImpl/TabletLocatorImplTest.java b/core/src/test/java/org/apache/accumulo/core/clientImpl/TabletLocatorImplTest.java
index 5c7420f..4ef8b88 100644
--- a/core/src/test/java/org/apache/accumulo/core/clientImpl/TabletLocatorImplTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/clientImpl/TabletLocatorImplTest.java
@@ -34,7 +34,6 @@ import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.clientImpl.TabletLocator.TabletLocation;
import org.apache.accumulo.core.clientImpl.TabletLocator.TabletLocations;
import org.apache.accumulo.core.clientImpl.TabletLocator.TabletServerMutations;
@@ -415,7 +414,7 @@ public class TabletLocatorImplTest {
@Override
public TabletLocations lookupTablet(ClientContext context, TabletLocation src, Text row,
- Text stopRow, TabletLocator parent) throws AccumuloSecurityException {
+ Text stopRow, TabletLocator parent) {
// System.out.println("lookupTablet("+src+","+row+","+stopRow+","+ parent+")");
// System.out.println(tservers);
@@ -447,7 +446,7 @@ public class TabletLocatorImplTest {
@Override
public List<TabletLocation> lookupTablets(ClientContext context, String tserver,
- Map<KeyExtent,List<Range>> map, TabletLocator parent) throws AccumuloSecurityException {
+ Map<KeyExtent,List<Range>> map, TabletLocator parent) {
ArrayList<TabletLocation> list = new ArrayList<>();
@@ -1292,7 +1291,7 @@ public class TabletLocatorImplTest {
}
@Test
- public void testAccumulo1248() throws Exception {
+ public void testAccumulo1248() {
TServers tservers = new TServers();
TabletLocatorImpl metaCache = createLocators(tservers, "tserver1", "tserver2", "foo");
diff --git a/core/src/test/java/org/apache/accumulo/core/clientImpl/lexicoder/ByteUtilsTest.java b/core/src/test/java/org/apache/accumulo/core/clientImpl/lexicoder/ByteUtilsTest.java
index a96d8ca..cf044d8 100644
--- a/core/src/test/java/org/apache/accumulo/core/clientImpl/lexicoder/ByteUtilsTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/clientImpl/lexicoder/ByteUtilsTest.java
@@ -28,7 +28,7 @@ public class ByteUtilsTest {
private final byte[] splitAt5 = ("1234" + (char) 0x00 + "56789").getBytes();
@Test
- public void testSplit() throws Exception {
+ public void testSplit() {
byte[][] result;
// always returns the original array itself
diff --git a/core/src/test/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/ConfiguratorBaseTest.java b/core/src/test/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/ConfiguratorBaseTest.java
index 46c4ecd..c465005 100644
--- a/core/src/test/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/ConfiguratorBaseTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/clientImpl/mapreduce/lib/ConfiguratorBaseTest.java
@@ -24,7 +24,6 @@ import static org.junit.Assert.assertTrue;
import java.util.Properties;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.clientImpl.ClientInfo;
@@ -67,8 +66,7 @@ public class ConfiguratorBaseTest {
}
@Test
- public void testSetConnectorInfoClassOfQConfigurationStringString()
- throws AccumuloSecurityException {
+ public void testSetConnectorInfoClassOfQConfigurationStringString() {
Configuration conf = new Configuration();
assertFalse(ConfiguratorBase.isConnectorInfoSet(this.getClass(), conf));
ConfiguratorBase.setConnectorInfo(this.getClass(), conf, "testUser",
diff --git a/core/src/test/java/org/apache/accumulo/core/conf/ConfigurationTypeHelperTest.java b/core/src/test/java/org/apache/accumulo/core/conf/ConfigurationTypeHelperTest.java
index 1a386f6..bed14e1 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/ConfigurationTypeHelperTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/ConfigurationTypeHelperTest.java
@@ -26,7 +26,7 @@ import org.junit.Test;
public class ConfigurationTypeHelperTest {
@Test
- public void testGetMemoryInBytes() throws Exception {
+ public void testGetMemoryInBytes() {
Arrays.<Function<String,Long>> asList(ConfigurationTypeHelper::getFixedMemoryAsBytes,
ConfigurationTypeHelper::getMemoryAsBytes).stream().forEach(memFunc -> {
assertEquals(42L, memFunc.apply("42").longValue());
@@ -46,27 +46,27 @@ public class ConfigurationTypeHelperTest {
}
@Test(expected = IllegalArgumentException.class)
- public void testGetFixedMemoryAsBytesFailureCases1() throws Exception {
+ public void testGetFixedMemoryAsBytesFailureCases1() {
ConfigurationTypeHelper.getFixedMemoryAsBytes("42x");
}
@Test(expected = IllegalArgumentException.class)
- public void testGetFixedMemoryAsBytesFailureCases2() throws Exception {
+ public void testGetFixedMemoryAsBytesFailureCases2() {
ConfigurationTypeHelper.getFixedMemoryAsBytes("FooBar");
}
@Test(expected = IllegalArgumentException.class)
- public void testGetFixedMemoryAsBytesFailureCases3() throws Exception {
+ public void testGetFixedMemoryAsBytesFailureCases3() {
ConfigurationTypeHelper.getFixedMemoryAsBytes("40%");
}
@Test(expected = IllegalArgumentException.class)
- public void testGetMemoryAsBytesFailureCases1() throws Exception {
+ public void testGetMemoryAsBytesFailureCases1() {
ConfigurationTypeHelper.getMemoryAsBytes("42x");
}
@Test(expected = IllegalArgumentException.class)
- public void testGetMemoryAsBytesFailureCases2() throws Exception {
+ public void testGetMemoryAsBytesFailureCases2() {
ConfigurationTypeHelper.getMemoryAsBytes("FooBar");
}
diff --git a/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java b/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java
index 051e623..5e82bfb 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShimTest.java
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import java.io.File;
-import java.io.IOException;
import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
@@ -78,17 +77,16 @@ public class CredentialProviderFactoryShimTest {
}
@Test(expected = NullPointerException.class)
- public void testNullConfigOnGetValue() throws IOException {
+ public void testNullConfigOnGetValue() {
CredentialProviderFactoryShim.getValueFromCredentialProvider(null, "alias");
}
@Test(expected = NullPointerException.class)
- public void testNullAliasOnGetValue() throws IOException {
+ public void testNullAliasOnGetValue() {
CredentialProviderFactoryShim.getValueFromCredentialProvider(new Configuration(false), null);
}
- protected void checkCredentialProviders(Configuration conf, Map<String,String> expectation)
- throws IOException {
+ protected void checkCredentialProviders(Configuration conf, Map<String,String> expectation) {
List<String> keys = CredentialProviderFactoryShim.getKeys(conf);
assertNotNull(keys);
@@ -102,7 +100,7 @@ public class CredentialProviderFactoryShimTest {
}
@Test
- public void testExtractFromProvider() throws IOException {
+ public void testExtractFromProvider() {
String absPath = getKeyStoreUrl(populatedKeyStore);
Configuration conf = new Configuration();
conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, absPath);
@@ -114,7 +112,7 @@ public class CredentialProviderFactoryShimTest {
}
@Test
- public void testEmptyKeyStoreParses() throws IOException {
+ public void testEmptyKeyStoreParses() {
String absPath = getKeyStoreUrl(emptyKeyStore);
Configuration conf = new Configuration();
conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, absPath);
@@ -123,7 +121,7 @@ public class CredentialProviderFactoryShimTest {
}
@Test
- public void testEmptyAndPopulatedKeyStores() throws IOException {
+ public void testEmptyAndPopulatedKeyStores() {
String populatedAbsPath = getKeyStoreUrl(populatedKeyStore),
emptyAbsPath = getKeyStoreUrl(emptyKeyStore);
Configuration conf = new Configuration();
@@ -137,7 +135,7 @@ public class CredentialProviderFactoryShimTest {
}
@Test
- public void testNonExistentClassesDoesntFail() throws IOException {
+ public void testNonExistentClassesDoesntFail() {
Configuration conf = new Configuration();
conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, "jceks://file/foo/bar.jceks");
List<String> keys = CredentialProviderFactoryShim.getKeys(conf);
@@ -148,7 +146,7 @@ public class CredentialProviderFactoryShimTest {
}
@Test
- public void testConfigurationCreation() throws IOException {
+ public void testConfigurationCreation() {
final String path = "jceks://file/tmp/foo.jks";
final Configuration actualConf = CredentialProviderFactoryShim.getConfiguration(path);
assertNotNull(actualConf);
diff --git a/core/src/test/java/org/apache/accumulo/core/data/ConditionTest.java b/core/src/test/java/org/apache/accumulo/core/data/ConditionTest.java
index b0d3f62..3af0938 100644
--- a/core/src/test/java/org/apache/accumulo/core/data/ConditionTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/data/ConditionTest.java
@@ -48,7 +48,7 @@ public class ConditionTest {
private Condition c;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
c = new Condition(FAMILY, QUALIFIER);
}
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 cf63437..b378e50 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
@@ -40,7 +40,7 @@ public class ConditionalMutationTest {
private ConditionalMutation cm;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
c1 = new Condition(FAMILY, QUALIFIER);
c2 = new Condition(FAMILY, QUALIFIER2);
assertNotEquals(c1, c2);
diff --git a/core/src/test/java/org/apache/accumulo/core/data/ValueTest.java b/core/src/test/java/org/apache/accumulo/core/data/ValueTest.java
index 3257530..849c106 100644
--- a/core/src/test/java/org/apache/accumulo/core/data/ValueTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/data/ValueTest.java
@@ -50,7 +50,7 @@ public class ValueTest {
}
@Before
- public void setUp() throws Exception {
+ public void setUp() {
DATABUFF.rewind();
}
diff --git a/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManagerTest.java b/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManagerTest.java
index f906c4b..6323999 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManagerTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/BlockCacheManagerTest.java
@@ -26,7 +26,7 @@ import org.junit.Test;
public class BlockCacheManagerTest {
@Test
- public void testGetPropertyPrefix() throws Exception {
+ public void testGetPropertyPrefix() {
assertEquals("tserver.cache.config.lru.data.",
BlockCacheManager.getFullyQualifiedPropertyPrefix("lru", CacheType.DATA));
assertEquals("tserver.cache.config.lru.index.",
diff --git a/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/TestCachedBlockQueue.java b/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/TestCachedBlockQueue.java
index 1dbfd70..88b1429 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/TestCachedBlockQueue.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/blockfile/cache/TestCachedBlockQueue.java
@@ -27,7 +27,7 @@ import org.junit.Test;
public class TestCachedBlockQueue {
@Test
- public void testQueue() throws Exception {
+ public void testQueue() {
CachedBlock cb1 = new CachedBlock(1000, "cb1", 1);
CachedBlock cb2 = new CachedBlock(1500, "cb2", 2);
@@ -73,7 +73,7 @@ public class TestCachedBlockQueue {
}
@Test
- public void testQueueSmallBlockEdgeCase() throws Exception {
+ public void testQueueSmallBlockEdgeCase() {
CachedBlock cb1 = new CachedBlock(1000, "cb1", 1);
CachedBlock cb2 = new CachedBlock(1500, "cb2", 2);
diff --git a/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java b/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
index a13e4f3..e955239 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
@@ -140,7 +140,7 @@ public class RFileTest {
}
@Override
- public long getPos() throws IOException {
+ public long getPos() {
return pos;
}
@@ -157,12 +157,12 @@ public class RFileTest {
}
@Override
- public boolean seekToNewSource(long targetPos) throws IOException {
+ public boolean seekToNewSource(long targetPos) {
return false;
}
@Override
- public int read(long position, byte[] buffer, int offset, int length) throws IOException {
+ public int read(long position, byte[] buffer, int offset, int length) {
if (position >= buf.length)
throw new IllegalArgumentException();
@@ -176,13 +176,13 @@ public class RFileTest {
}
@Override
- public void readFully(long position, byte[] buffer) throws IOException {
+ public void readFully(long position, byte[] buffer) {
read(position, buffer, 0, buffer.length);
}
@Override
- public void readFully(long position, byte[] buffer, int offset, int length) throws IOException {
+ public void readFully(long position, byte[] buffer, int offset, int length) {
read(position, buffer, offset, length);
}
diff --git a/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java b/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java
index 33b4afa..fcbfc01 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java
@@ -21,7 +21,6 @@ import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -80,7 +79,7 @@ public class CompressionTest {
}
@Test
- public void testSingle() throws IOException {
+ public void testSingle() {
for (final Algorithm al : Algorithm.values()) {
if (isSupported.get(al) != null && isSupported.get(al)) {
@@ -96,7 +95,7 @@ public class CompressionTest {
}
@Test
- public void testSingleNoSideEffect() throws IOException {
+ public void testSingleNoSideEffect() {
for (final Algorithm al : Algorithm.values()) {
if (isSupported.get(al) != null && isSupported.get(al)) {
@@ -115,7 +114,7 @@ public class CompressionTest {
}
@Test(timeout = 60 * 1000)
- public void testManyStartNotNull() throws IOException, InterruptedException, ExecutionException {
+ public void testManyStartNotNull() throws InterruptedException, ExecutionException {
for (final Algorithm al : Algorithm.values()) {
if (isSupported.get(al) != null && isSupported.get(al)) {
@@ -157,8 +156,7 @@ public class CompressionTest {
// don't start until we have created the codec
@Test(timeout = 60 * 1000)
- public void testManyDontStartUntilThread()
- throws IOException, InterruptedException, ExecutionException {
+ public void testManyDontStartUntilThread() throws InterruptedException, ExecutionException {
for (final Algorithm al : Algorithm.values()) {
if (isSupported.get(al) != null && isSupported.get(al)) {
@@ -194,7 +192,7 @@ public class CompressionTest {
}
@Test(timeout = 60 * 1000)
- public void testThereCanBeOnlyOne() throws IOException, InterruptedException, ExecutionException {
+ public void testThereCanBeOnlyOne() throws InterruptedException, ExecutionException {
for (final Algorithm al : Algorithm.values()) {
if (isSupported.get(al) != null && isSupported.get(al)) {
diff --git a/core/src/test/java/org/apache/accumulo/core/file/streams/RateLimitedInputStreamTest.java b/core/src/test/java/org/apache/accumulo/core/file/streams/RateLimitedInputStreamTest.java
index 2554ddf..a1d5130 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/streams/RateLimitedInputStreamTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/streams/RateLimitedInputStreamTest.java
@@ -18,7 +18,6 @@ package org.apache.accumulo.core.file.streams;
import static org.junit.Assert.assertEquals;
-import java.io.IOException;
import java.io.InputStream;
import java.security.SecureRandom;
import java.util.Random;
@@ -48,26 +47,26 @@ public class RateLimitedInputStreamTest {
private final Random r = new SecureRandom();
@Override
- public int read() throws IOException {
+ public int read() {
return r.nextInt() & 0xff;
}
@Override
- public void seek(long pos) throws IOException {
+ public void seek(long pos) {
throw new UnsupportedOperationException("Not supported yet."); // To change body of generated
// methods, choose Tools |
// Templates.
}
@Override
- public long getPos() throws IOException {
+ public long getPos() {
throw new UnsupportedOperationException("Not supported yet."); // To change body of generated
// methods, choose Tools |
// Templates.
}
@Override
- public boolean seekToNewSource(long targetPos) throws IOException {
+ public boolean seekToNewSource(long targetPos) {
throw new UnsupportedOperationException("Not supported yet."); // To change body of generated
// methods, choose Tools |
// Templates.
diff --git a/core/src/test/java/org/apache/accumulo/core/file/streams/RateLimitedOutputStreamTest.java b/core/src/test/java/org/apache/accumulo/core/file/streams/RateLimitedOutputStreamTest.java
index 7e66253..2ba1702 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/streams/RateLimitedOutputStreamTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/streams/RateLimitedOutputStreamTest.java
@@ -18,7 +18,6 @@ package org.apache.accumulo.core.file.streams;
import static org.junit.Assert.assertEquals;
-import java.io.IOException;
import java.security.SecureRandom;
import java.util.Random;
@@ -48,7 +47,7 @@ public class RateLimitedOutputStreamTest {
}
public static class NullOutputStream extends FSDataOutputStream {
- public NullOutputStream() throws IOException {
+ public NullOutputStream() {
super(new CountingOutputStream(ByteStreams.nullOutputStream()), null);
}
}
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/IteratorUtilTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/IteratorUtilTest.java
index 510ced0..407816b 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/IteratorUtilTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/IteratorUtilTest.java
@@ -307,7 +307,7 @@ public class IteratorUtilTest {
}
@Test
- public void onlyReadsRelevantIteratorScopeConfigurations() throws Exception {
+ public void onlyReadsRelevantIteratorScopeConfigurations() {
Map<String,String> data = new HashMap<>();
// Make some configuration items, one with a bogus scope
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/ColumnSliceFilterTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/ColumnSliceFilterTest.java
index 94681a3..69fa96f 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/ColumnSliceFilterTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/ColumnSliceFilterTest.java
@@ -68,7 +68,7 @@ public class ColumnSliceFilterTest {
}
@Before
- public void setUp() throws Exception {
+ public void setUp() {
columnSliceFilter.describeOptions();
iteratorEnvironment = new DefaultIteratorEnvironment();
is = new IteratorSetting(1, ColumnSliceFilter.class);
@@ -233,7 +233,7 @@ public class ColumnSliceFilterTest {
}
@Test
- public void testStartAfterEnd() throws IOException {
+ public void testStartAfterEnd() {
try {
ColumnSliceFilter.setSlice(is, "20080204", "20080202");
fail("IllegalArgumentException expected but not thrown");
@@ -243,7 +243,7 @@ public class ColumnSliceFilterTest {
}
@Test
- public void testStartEqualToEndStartInclusiveEndExclusive() throws IOException {
+ public void testStartEqualToEndStartInclusiveEndExclusive() {
try {
ColumnSliceFilter.setSlice(is, "20080202", "20080202");
fail("IllegalArgumentException expected but not thrown");
@@ -253,7 +253,7 @@ public class ColumnSliceFilterTest {
}
@Test
- public void testStartEqualToEndStartExclusiveEndInclusive() throws IOException {
+ public void testStartEqualToEndStartExclusiveEndInclusive() {
try {
ColumnSliceFilter.setSlice(is, "20080202", false, "20080202", true);
fail("IllegalArgumentException expected but not thrown");
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
index 127a57f..580fc40 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/CombinerTest.java
@@ -943,7 +943,7 @@ public class CombinerTest {
* generate error.
*/
@Test
- public void testLossyOption() throws IOException, IllegalAccessException, InstantiationException {
+ public void testLossyOption() throws IOException {
Encoder<List<Long>> encoder = new SummingArrayCombiner.VarLongArrayEncoder();
TreeMap<Key,Value> tm1 = new TreeMap<>();
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
index 135b9df..af867f3 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
@@ -103,8 +103,7 @@ public class IntersectingIteratorTest {
}
private SortedKeyValueIterator<Key,Value> createIteratorStack(float hitRatio, int numRows,
- int numDocsPerRow, Text[] columnFamilies, Text[] otherColumnFamilies, HashSet<Text> docs)
- throws IOException {
+ int numDocsPerRow, Text[] columnFamilies, Text[] otherColumnFamilies, HashSet<Text> docs) {
Text nullText[] = new Text[0];
return createIteratorStack(hitRatio, numRows, numDocsPerRow, columnFamilies,
otherColumnFamilies, docs, nullText);
@@ -112,13 +111,13 @@ public class IntersectingIteratorTest {
private SortedKeyValueIterator<Key,Value> createIteratorStack(float hitRatio, int numRows,
int numDocsPerRow, Text[] columnFamilies, Text[] otherColumnFamilies, HashSet<Text> docs,
- Text[] negatedColumns) throws IOException {
+ Text[] negatedColumns) {
TreeMap<Key,Value> inMemoryMap = createSortedMap(hitRatio, numRows, numDocsPerRow,
columnFamilies, otherColumnFamilies, docs, negatedColumns);
return new SortedMapIterator(inMemoryMap);
}
- private void cleanup() throws IOException {
+ private void cleanup() {
docid = 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 a98b647..6f3d513 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
@@ -88,7 +88,7 @@ public class RowFilterTest {
private static final Set<String> passRows = new HashSet<>(Arrays.asList("0", "1"));
@Override
- public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException {
+ public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) {
return rowIterator.hasTop() && passRows.contains(rowIterator.getTopKey().getRow().toString());
}
}
@@ -97,14 +97,14 @@ public class RowFilterTest {
private static final Set<String> passRows = new HashSet<>(Arrays.asList("1", "2"));
@Override
- public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException {
+ public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) {
return rowIterator.hasTop() && passRows.contains(rowIterator.getTopKey().getRow().toString());
}
}
public static class TrueFilter extends RowFilter {
@Override
- public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) throws IOException {
+ public boolean acceptRow(SortedKeyValueIterator<Key,Value> rowIterator) {
return true;
}
}
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/TestCfCqSlice.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/TestCfCqSlice.java
index 55b45f4..0f8360c 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/TestCfCqSlice.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/TestCfCqSlice.java
@@ -69,7 +69,7 @@ public abstract class TestCfCqSlice {
}
@Test
- public void testAllRowsFullSlice() throws Exception {
+ public void testAllRowsFullSlice() {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
loadKvs(foundKvs, EMPTY_OPTS, INFINITY);
for (int i = 0; i < LR_DIM; i++) {
@@ -83,7 +83,7 @@ public abstract class TestCfCqSlice {
}
@Test
- public void testSingleRowFullSlice() throws Exception {
+ public void testSingleRowFullSlice() {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
int rowId = LR_DIM / 2;
loadKvs(foundKvs, EMPTY_OPTS, Range.exact(new Text(LONG_LEX.encode((long) rowId))));
@@ -104,7 +104,7 @@ public abstract class TestCfCqSlice {
}
@Test
- public void testAllRowsSlice() throws Exception {
+ public void testAllRowsSlice() {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
long sliceMinCf = 20;
long sliceMinCq = 30;
@@ -137,7 +137,7 @@ public abstract class TestCfCqSlice {
}
@Test
- public void testSingleColumnSlice() throws Exception {
+ public void testSingleColumnSlice() {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
long sliceMinCf = 20;
long sliceMinCq = 20;
@@ -166,7 +166,7 @@ public abstract class TestCfCqSlice {
}
@Test
- public void testSingleColumnSliceByExclude() throws Exception {
+ public void testSingleColumnSliceByExclude() {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
long sliceMinCf = 20;
long sliceMinCq = 20;
@@ -197,7 +197,7 @@ public abstract class TestCfCqSlice {
}
@Test
- public void testAllCfsCqSlice() throws Exception {
+ public void testAllCfsCqSlice() {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
long sliceMinCq = 10;
long sliceMaxCq = 30;
@@ -222,7 +222,7 @@ public abstract class TestCfCqSlice {
}
@Test
- public void testSliceCfsAllCqs() throws Exception {
+ public void testSliceCfsAllCqs() {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
long sliceMinCf = 10;
long sliceMaxCf = 30;
@@ -247,7 +247,7 @@ public abstract class TestCfCqSlice {
}
@Test
- public void testEmptySlice() throws Exception {
+ public void testEmptySlice() {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
long sliceMinCf = LR_DIM + 1;
long sliceMinCq = LR_DIM + 1;
@@ -308,7 +308,7 @@ public abstract class TestCfCqSlice {
}
@Test
- public void testSeekMinExclusive() throws Exception {
+ public void testSeekMinExclusive() {
boolean[][][] foundKvs = new boolean[LR_DIM][LR_DIM][LR_DIM];
long sliceMinCf = 20;
long sliceMinCq = 30;
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java
index 72bee5c..7b6eda7 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java
@@ -68,7 +68,7 @@ public class TransformingIteratorTest {
private TreeMap<Key,Value> data = new TreeMap<>();
@Before
- public void createData() throws Exception {
+ public void createData() {
data.clear();
generateRow(data, "row1");
generateRow(data, "row2");
@@ -245,7 +245,7 @@ public class TransformingIteratorTest {
}
@Test
- public void testReplaceKeyParts() throws Exception {
+ public void testReplaceKeyParts() {
TransformingIterator it = new IdentityKeyTransformingIterator();
Key originalKey = new Key("r", "cf", "cq", "cv", 42);
originalKey.setDeleted(true);
diff --git a/core/src/test/java/org/apache/accumulo/core/metadata/MetadataServicerTest.java b/core/src/test/java/org/apache/accumulo/core/metadata/MetadataServicerTest.java
index 34d608d..905ba49 100644
--- a/core/src/test/java/org/apache/accumulo/core/metadata/MetadataServicerTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/metadata/MetadataServicerTest.java
@@ -25,8 +25,6 @@ import java.util.HashMap;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
-import org.apache.accumulo.core.client.TableExistsException;
-import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.TableOperations;
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.clientImpl.Table;
@@ -42,7 +40,7 @@ public class MetadataServicerTest {
private static ClientContext context;
@BeforeClass
- public static void setupContext() throws Exception {
+ public static void setupContext() {
HashMap<String,String> tableNameToIdMap = new HashMap<>();
tableNameToIdMap.put(RootTable.NAME, RootTable.ID.canonicalID());
tableNameToIdMap.put(MetadataTable.NAME, MetadataTable.ID.canonicalID());
@@ -63,8 +61,7 @@ public class MetadataServicerTest {
}
@Test
- public void testGetCorrectServicer() throws AccumuloException, AccumuloSecurityException,
- TableExistsException, TableNotFoundException {
+ public void testGetCorrectServicer() throws AccumuloException, AccumuloSecurityException {
MetadataServicer ms = MetadataServicer.forTableId(context, RootTable.ID);
assertTrue(ms instanceof ServicerForRootTable);
assertFalse(ms instanceof TableMetadataServicer);
diff --git a/core/src/test/java/org/apache/accumulo/core/security/AuthenticationTokenTest.java b/core/src/test/java/org/apache/accumulo/core/security/AuthenticationTokenTest.java
index 57abe0b..e311789 100644
--- a/core/src/test/java/org/apache/accumulo/core/security/AuthenticationTokenTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/security/AuthenticationTokenTest.java
@@ -20,11 +20,9 @@ import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
-import java.io.IOException;
import java.security.SecureRandom;
import java.util.Random;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken.AuthenticationTokenSerializer;
import org.apache.accumulo.core.client.security.tokens.NullToken;
@@ -33,7 +31,7 @@ import org.junit.Test;
public class AuthenticationTokenTest {
@Test
- public void testSerializeDeserializeToken() throws AccumuloSecurityException, IOException {
+ public void testSerializeDeserializeToken() {
Random random = new SecureRandom();
byte[] randomBytes = new byte[12];
random.nextBytes(randomBytes);
diff --git a/core/src/test/java/org/apache/accumulo/core/security/CredentialsTest.java b/core/src/test/java/org/apache/accumulo/core/security/CredentialsTest.java
index a5c8c5d..ce2884c 100644
--- a/core/src/test/java/org/apache/accumulo/core/security/CredentialsTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/security/CredentialsTest.java
@@ -68,7 +68,7 @@ public class CredentialsTest {
}
@Test
- public void roundtripThrift() throws DestroyFailedException {
+ public void roundtripThrift() {
Credentials creds = new Credentials("test", new PasswordToken("testing"));
TCredentials tCreds = creds.toThrift(instanceID);
Credentials roundtrip = Credentials.fromThrift(tCreds);
@@ -101,7 +101,7 @@ public class CredentialsTest {
}
@Test
- public void testCredentialsSerialization() throws AccumuloSecurityException {
+ public void testCredentialsSerialization() {
Credentials creds = new Credentials("a:b-c", new PasswordToken("d-e-f".getBytes(UTF_8)));
String serialized = creds.serialize();
Credentials result = Credentials.deserialize(serialized);
diff --git a/core/src/test/java/org/apache/accumulo/core/security/VisibilityConstraintTest.java b/core/src/test/java/org/apache/accumulo/core/security/VisibilityConstraintTest.java
index 6a33801..7ed639e 100644
--- a/core/src/test/java/org/apache/accumulo/core/security/VisibilityConstraintTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/security/VisibilityConstraintTest.java
@@ -49,7 +49,7 @@ public class VisibilityConstraintTest {
static final List<Short> ENOAUTH = Arrays.asList((short) 2);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
vc = new VisibilityConstraint();
mutation = new Mutation("r");
diff --git a/core/src/test/java/org/apache/accumulo/core/util/format/DateFormatSupplierTest.java b/core/src/test/java/org/apache/accumulo/core/util/format/DateFormatSupplierTest.java
index 844fb8e..a3ea65b 100644
--- a/core/src/test/java/org/apache/accumulo/core/util/format/DateFormatSupplierTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/util/format/DateFormatSupplierTest.java
@@ -44,14 +44,14 @@ public class DateFormatSupplierTest {
}
@Test
- public void testCreateDefaultFormatSupplier() throws Exception {
+ public void testCreateDefaultFormatSupplier() {
ThreadLocal<DateFormat> supplierA = DateFormatSupplier.createDefaultFormatSupplier();
ThreadLocal<DateFormat> supplierB = DateFormatSupplier.createDefaultFormatSupplier();
assertSuppliersIndependent(supplierA, supplierB);
}
@Test
- public void testCreateSimpleFormatSupplier() throws Exception {
+ public void testCreateSimpleFormatSupplier() {
final String format = DateFormatSupplier.HUMAN_READABLE_FORMAT;
DateFormatSupplier supplierA = DateFormatSupplier.createSimpleFormatSupplier(format);
DateFormatSupplier supplierB = DateFormatSupplier.createSimpleFormatSupplier(format);
diff --git a/core/src/test/java/org/apache/accumulo/core/util/format/FormatterConfigTest.java b/core/src/test/java/org/apache/accumulo/core/util/format/FormatterConfigTest.java
index 6d979e6..5db8d3d 100644
--- a/core/src/test/java/org/apache/accumulo/core/util/format/FormatterConfigTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/util/format/FormatterConfigTest.java
@@ -37,7 +37,7 @@ public class FormatterConfigTest {
}
@Test
- public void testSetShownLength() throws Exception {
+ public void testSetShownLength() {
FormatterConfig config = new FormatterConfig();
try {
config.setShownLength(-1);
diff --git a/core/src/test/java/org/apache/accumulo/fate/SimpleStore.java b/core/src/test/java/org/apache/accumulo/fate/SimpleStore.java
index aba81e1..03ffd8d 100644
--- a/core/src/test/java/org/apache/accumulo/fate/SimpleStore.java
+++ b/core/src/test/java/org/apache/accumulo/fate/SimpleStore.java
@@ -68,7 +68,7 @@ public class SimpleStore<T> implements TStore<T> {
}
@Override
- public void push(long tid, Repo<T> repo) throws StackOverflowException {
+ public void push(long tid, Repo<T> repo) {
throw new NotImplementedException();
}
diff --git a/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooCacheTest.java b/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooCacheTest.java
index 7459d25..ac5ee26 100644
--- a/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooCacheTest.java
+++ b/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooCacheTest.java
@@ -55,7 +55,7 @@ public class ZooCacheTest {
private ZooCache zc;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
zr = createMock(ZooReader.class);
zk = createStrictMock(ZooKeeper.class);
expect(zr.getZooKeeper()).andReturn(zk);
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 f581461..e905587 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
@@ -58,7 +58,6 @@ import org.apache.accumulo.server.ServerContext;
import org.apache.accumulo.server.cli.ServerUtilOpts;
import org.apache.accumulo.server.security.SecurityUtil;
import org.apache.accumulo.start.spi.KeywordExecutable;
-import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -396,16 +395,11 @@ public class Admin implements KeywordExecutable {
*/
static String qualifyWithZooKeeperSessionId(String zTServerRoot, ZooCache zooCache,
String hostAndPort) {
- try {
- long sessionId = ZooLock.getSessionId(zooCache, zTServerRoot + "/" + hostAndPort);
- if (sessionId == 0) {
- return hostAndPort;
- }
- return hostAndPort + "[" + Long.toHexString(sessionId) + "]";
- } catch (InterruptedException | KeeperException e) {
- log.warn("Failed to communicate with ZooKeeper to find session ID for TabletServer.");
+ long sessionId = ZooLock.getSessionId(zooCache, zTServerRoot + "/" + hostAndPort);
+ if (sessionId == 0) {
return hostAndPort;
}
+ return hostAndPort + "[" + Long.toHexString(sessionId) + "]";
}
private static final String ACCUMULO_SITE_BACKUP_FILE = "accumulo.properties.bak";