Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't declare throwing exceptions that aren't thrown

  • Loading branch information...
commit f1c9bc612e2df5ffacec0debedb2021f1a9171e7 1 parent 08df0b8
@mebigfatguy mebigfatguy authored
Showing with 46 additions and 57 deletions.
  1. +1 −1  src/java/org/apache/cassandra/cli/CliMain.java
  2. +1 −1  src/java/org/apache/cassandra/cql/CFPropDefs.java
  3. +2 −2 src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
  4. +1 −1  src/java/org/apache/cassandra/cql/DropIndexStatement.java
  5. +1 −3 src/java/org/apache/cassandra/cql/QueryProcessor.java
  6. +1 −1  src/java/org/apache/cassandra/cql3/KSPropDefs.java
  7. +2 −2 src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
  8. +1 −1  src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java
  9. +1 −1  src/java/org/apache/cassandra/db/BatchlogManager.java
  10. +1 −1  src/java/org/apache/cassandra/db/ColumnFamilySerializer.java
  11. +2 −3 src/java/org/apache/cassandra/db/DefsTable.java
  12. +1 −1  src/java/org/apache/cassandra/db/HintedHandOffManager.java
  13. +4 −4 src/java/org/apache/cassandra/db/Table.java
  14. +3 −10 src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
  15. +1 −1  src/java/org/apache/cassandra/db/compaction/Scrubber.java
  16. +3 −3 src/java/org/apache/cassandra/hadoop/BulkRecordWriter.java
  17. +1 −1  src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java
  18. +1 −1  src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
  19. +3 −3 src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
  20. +1 −1  src/java/org/apache/cassandra/net/IncomingTcpConnection.java
  21. +2 −2 src/java/org/apache/cassandra/service/StorageService.java
  22. +1 −1  src/java/org/apache/cassandra/streaming/StreamIn.java
  23. +0 −1  src/java/org/apache/cassandra/thrift/TCustomServerSocket.java
  24. +1 −1  src/java/org/apache/cassandra/tools/BulkLoader.java
  25. +2 −2 src/java/org/apache/cassandra/tools/NodeCmd.java
  26. +6 −6 src/java/org/apache/cassandra/tools/NodeProbe.java
  27. +1 −1  src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java
  28. +1 −1  test/unit/org/apache/cassandra/cli/CliTest.java
View
2  src/java/org/apache/cassandra/cli/CliMain.java
@@ -198,7 +198,7 @@ public static void updateCompletor(Set<String> candidates)
completer.setCandidateStrings(strs);
}
- public static void processStatement(String query) throws CharacterCodingException, ClassNotFoundException, TException, TimedOutException, NotFoundException, InvalidRequestException, NoSuchFieldException, UnavailableException, IllegalAccessException, InstantiationException
+ public static void processStatement(String query) throws CharacterCodingException, TException, TimedOutException, NotFoundException, InvalidRequestException, NoSuchFieldException, UnavailableException, IllegalAccessException, InstantiationException
{
cliClient.executeCLIStatement(query);
}
View
2  src/java/org/apache/cassandra/cql/CFPropDefs.java
@@ -236,7 +236,7 @@ public String getPropertyString(String key, String defaultValue)
}
// Return a property value, typed as a Boolean
- public Boolean getPropertyBoolean(String key, Boolean defaultValue) throws InvalidRequestException
+ public Boolean getPropertyBoolean(String key, Boolean defaultValue)
{
String value = properties.get(key);
return (value == null) ? defaultValue : value.toLowerCase().matches("(1|true|yes)");
View
4 src/java/org/apache/cassandra/cql/CreateColumnFamilyStatement.java
@@ -161,7 +161,7 @@ public String getName()
* @return a CFMetaData instance corresponding to the values parsed from this statement
* @throws InvalidRequestException on failure to validate parsed parameters
*/
- public CFMetaData getCFMetaData(String keyspace, List<ByteBuffer> variables) throws InvalidRequestException, ConfigurationException
+ public CFMetaData getCFMetaData(String keyspace, List<ByteBuffer> variables) throws InvalidRequestException
{
validate(variables);
@@ -223,7 +223,7 @@ private String getPropertyString(String key, String defaultValue)
return cfProps.getPropertyString(key, defaultValue);
}
- private Boolean getPropertyBoolean(String key, Boolean defaultValue) throws InvalidRequestException
+ private Boolean getPropertyBoolean(String key, Boolean defaultValue)
{
return cfProps.getPropertyBoolean(key, defaultValue);
}
View
2  src/java/org/apache/cassandra/cql/DropIndexStatement.java
@@ -45,7 +45,7 @@ public CFMetaData generateCFMetadataUpdate() throws InvalidRequestException
return updateCFMetadata(findIndexedCF());
}
- private CFMetaData updateCFMetadata(CFMetaData cfm) throws InvalidRequestException
+ private CFMetaData updateCFMetadata(CFMetaData cfm)
{
ColumnDefinition column = findIndexedColumn(cfm);
assert column != null;
View
4 src/java/org/apache/cassandra/cql/QueryProcessor.java
@@ -23,8 +23,6 @@
import java.util.*;
import java.util.concurrent.TimeoutException;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -764,7 +762,7 @@ public static CqlResult process(String queryString, ThriftClientState clientStat
}
public static CqlPreparedResult prepare(String queryString, ThriftClientState clientState)
- throws InvalidRequestException, SyntaxException
+ throws SyntaxException
{
logger.trace("CQL QUERY: {}", queryString);
View
2  src/java/org/apache/cassandra/cql3/KSPropDefs.java
@@ -42,7 +42,7 @@
private String strategyClass;
- public void validate() throws ConfigurationException, SyntaxException
+ public void validate() throws SyntaxException
{
validate(keywords, obsoleteKeywords);
View
4 src/java/org/apache/cassandra/cql3/statements/CreateColumnFamilyStatement.java
@@ -79,7 +79,7 @@ public void checkAccess(ClientState state) throws UnauthorizedException, Invalid
}
// Column definitions
- private Map<ByteBuffer, ColumnDefinition> getColumns() throws InvalidRequestException
+ private Map<ByteBuffer, ColumnDefinition> getColumns()
{
Map<ByteBuffer, ColumnDefinition> columnDefs = new HashMap<ByteBuffer, ColumnDefinition>();
Integer componentIndex = null;
@@ -340,7 +340,7 @@ public RawStatement(CFName name)
return new ParsedStatement.Prepared(stmt);
}
- private AbstractType<?> getTypeAndRemove(Map<ColumnIdentifier, AbstractType> columns, ColumnIdentifier t) throws InvalidRequestException, ConfigurationException
+ private AbstractType<?> getTypeAndRemove(Map<ColumnIdentifier, AbstractType> columns, ColumnIdentifier t) throws InvalidRequestException
{
AbstractType type = columns.get(t);
if (type == null)
View
2  src/java/org/apache/cassandra/cql3/statements/DropIndexStatement.java
@@ -55,7 +55,7 @@ public void announceMigration() throws InvalidRequestException, ConfigurationExc
MigrationManager.announceColumnFamilyUpdate(updatedCfm, false);
}
- private CFMetaData updateCFMetadata(CFMetaData cfm) throws InvalidRequestException
+ private CFMetaData updateCFMetadata(CFMetaData cfm)
{
ColumnDefinition column = findIndexedColumn(cfm);
assert column != null;
View
2  src/java/org/apache/cassandra/db/BatchlogManager.java
@@ -225,7 +225,7 @@ private static void writeHintsForSerializedMutations(ByteBuffer data) throws IOE
writeHintsForMutation(RowMutation.serializer.deserialize(in, VERSION));
}
- private static void writeHintsForMutation(RowMutation mutation) throws IOException
+ private static void writeHintsForMutation(RowMutation mutation)
{
String table = mutation.getTable();
Token tk = StorageService.getPartitioner().getToken(mutation.key());
View
2  src/java/org/apache/cassandra/db/ColumnFamilySerializer.java
@@ -170,7 +170,7 @@ public ColumnFamily deserializeFromSSTable(DataInput in, Descriptor.Version vers
throw new UnsupportedOperationException();
}
- public void deserializeColumnsFromSSTable(DataInput in, ColumnFamily cf, int size, ColumnSerializer.Flag flag, int expireBefore, Descriptor.Version version) throws IOException
+ public void deserializeColumnsFromSSTable(DataInput in, ColumnFamily cf, int size, ColumnSerializer.Flag flag, int expireBefore, Descriptor.Version version)
{
Iterator<OnDiskAtom> iter = cf.metadata().getOnDiskIterator(in, size, flag, expireBefore, version);
while (iter.hasNext())
View
5 src/java/org/apache/cassandra/db/DefsTable.java
@@ -327,7 +327,6 @@ public static synchronized void mergeSchema(Collection<RowMutation> mutations) t
}
private static void mergeColumnFamilies(Map<DecoratedKey, ColumnFamily> old, Map<DecoratedKey, ColumnFamily> updated)
- throws ConfigurationException, IOException
{
// calculate the difference between old and new states (note that entriesOnlyLeft() will be always empty)
MapDifference<DecoratedKey, ColumnFamily> diff = Maps.difference(old, updated);
@@ -454,7 +453,7 @@ private static void updateColumnFamily(CFMetaData newState)
}
}
- private static void dropKeyspace(String ksName) throws IOException
+ private static void dropKeyspace(String ksName)
{
KSMetaData ksm = Schema.instance.getKSMetaData(ksName);
String snapshotName = Table.getTimestampedSnapshotName(ksName);
@@ -485,7 +484,7 @@ private static void dropKeyspace(String ksName) throws IOException
}
}
- private static void dropColumnFamily(String ksName, String cfName) throws IOException
+ private static void dropColumnFamily(String ksName, String cfName)
{
KSMetaData ksm = Schema.instance.getKSMetaData(ksName);
assert ksm != null;
View
2  src/java/org/apache/cassandra/db/HintedHandOffManager.java
@@ -210,7 +210,7 @@ public void run()
}
@VisibleForTesting
- protected Future<?> compact() throws ExecutionException, InterruptedException
+ protected Future<?> compact()
{
hintStore.forceBlockingFlush();
ArrayList<Descriptor> descriptors = new ArrayList<Descriptor>();
View
8 src/java/org/apache/cassandra/db/Table.java
@@ -118,12 +118,12 @@ private static Table open(String table, Schema schema, boolean loadSSTables)
return tableInstance;
}
- public static Table clear(String table) throws IOException
+ public static Table clear(String table)
{
return clear(table, Schema.instance);
}
- public static Table clear(String table, Schema schema) throws IOException
+ public static Table clear(String table, Schema schema)
{
synchronized (Table.class)
{
@@ -281,7 +281,7 @@ public void createReplicationStrategy(KSMetaData ksm)
}
// best invoked on the compaction mananger.
- public void dropCf(UUID cfId) throws IOException
+ public void dropCf(UUID cfId)
{
assert columnFamilyStores.containsKey(cfId);
ColumnFamilyStore cfs = columnFamilyStores.remove(cfId);
@@ -292,7 +292,7 @@ public void dropCf(UUID cfId) throws IOException
}
// disassociate a cfs from this table instance.
- private void unloadCf(ColumnFamilyStore cfs) throws IOException
+ private void unloadCf(ColumnFamilyStore cfs)
{
cfs.forceBlockingFlush();
cfs.invalidate();
View
13 src/java/org/apache/cassandra/db/compaction/PrecompactedRow.java
@@ -109,16 +109,9 @@ private static ColumnFamily merge(List<SSTableIdentityIterator> rows, Compaction
List<CloseableIterator<Column>> data = new ArrayList<CloseableIterator<Column>>(rows.size());
for (SSTableIdentityIterator row : rows)
{
- try
- {
- ColumnFamily cf = row.getColumnFamilyWithColumns(ArrayBackedSortedColumns.factory);
- returnCF.delete(cf);
- data.add(FBUtilities.closeableIterator(cf.iterator()));
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
+ ColumnFamily cf = row.getColumnFamilyWithColumns(ArrayBackedSortedColumns.factory);
+ returnCF.delete(cf);
+ data.add(FBUtilities.closeableIterator(cf.iterator()));
}
merge(returnCF, data, controller.cfs.indexManager.updaterFor(rows.get(0).getKey()));
View
2  src/java/org/apache/cassandra/db/compaction/Scrubber.java
@@ -98,7 +98,7 @@ public Scrubber(ColumnFamilyStore cfs, SSTableReader sstable, OutputHandler outp
this.scrubInfo = new ScrubInfo(dataFile, sstable);
}
- public void scrub() throws IOException
+ public void scrub()
{
outputHandler.output("Scrubbing " + sstable);
try
View
6 src/java/org/apache/cassandra/hadoop/BulkRecordWriter.java
@@ -79,20 +79,20 @@
private CFType cfType;
private ColType colType;
- BulkRecordWriter(TaskAttemptContext context) throws IOException
+ BulkRecordWriter(TaskAttemptContext context)
{
this(context.getConfiguration());
this.progress = new Progressable(context);
}
- BulkRecordWriter(Configuration conf, Progressable progress) throws IOException
+ BulkRecordWriter(Configuration conf, Progressable progress)
{
this(conf);
this.progress = progress;
}
- BulkRecordWriter(Configuration conf) throws IOException
+ BulkRecordWriter(Configuration conf)
{
Config.setClientMode(true);
Config.setOutboundBindAny(true);
View
2  src/java/org/apache/cassandra/hadoop/pig/CassandraStorage.java
@@ -516,7 +516,7 @@ private void setLocationFromUri(String location) throws IOException
}
}
- private void setConnectionInformation() throws IOException
+ private void setConnectionInformation()
{
if (System.getenv(PIG_RPC_PORT) != null)
{
View
2  src/java/org/apache/cassandra/io/sstable/SSTableIdentityIterator.java
@@ -200,7 +200,7 @@ public String getPath()
}
}
- public ColumnFamily getColumnFamilyWithColumns(ColumnFamily.Factory containerFactory) throws IOException
+ public ColumnFamily getColumnFamilyWithColumns(ColumnFamily.Factory containerFactory)
{
assert inputWithTracker.getBytesRead() == headerSize();
ColumnFamily cf = columnFamily.cloneMeShallow(containerFactory, false);
View
6 src/java/org/apache/cassandra/io/sstable/SSTableLoader.java
@@ -107,12 +107,12 @@ public boolean accept(File dir, String name)
return sstables;
}
- public LoaderFuture stream() throws IOException
+ public LoaderFuture stream()
{
return stream(Collections.<InetAddress>emptySet());
}
- public LoaderFuture stream(Set<InetAddress> toIgnore) throws IOException
+ public LoaderFuture stream(Set<InetAddress> toIgnore)
{
client.init(keyspace);
@@ -289,7 +289,7 @@ protected void setPartitioner(String partclass) throws ConfigurationException
setPartitioner(FBUtilities.newPartitioner(partclass));
}
- protected void setPartitioner(IPartitioner partitioner) throws ConfigurationException
+ protected void setPartitioner(IPartitioner partitioner)
{
this.partitioner = partitioner;
DatabaseDescriptor.setPartitioner(partitioner);
View
2  src/java/org/apache/cassandra/net/IncomingTcpConnection.java
@@ -136,7 +136,7 @@ private void handleModernVersion(int version, int header) throws IOException
}
}
- private void handleLegacyVersion(int version) throws IOException
+ private void handleLegacyVersion(int version)
{
throw new UnsupportedOperationException("Unable to read obsolete message version " + version + "; the earliest version supported is 1.2.0");
}
View
4 src/java/org/apache/cassandra/service/StorageService.java
@@ -374,7 +374,7 @@ public boolean isInitialized()
return initialized;
}
- public synchronized void initClient() throws IOException, ConfigurationException
+ public synchronized void initClient() throws ConfigurationException
{
// We don't wait, because we're going to actually try to work on
initClient(0);
@@ -407,7 +407,7 @@ public synchronized void initClient() throws IOException, ConfigurationException
}
}
- public synchronized void initClient(int ringDelay) throws IOException, ConfigurationException
+ public synchronized void initClient(int ringDelay) throws ConfigurationException
{
if (initialized)
{
View
2  src/java/org/apache/cassandra/streaming/StreamIn.java
@@ -69,7 +69,7 @@ public static void requestRanges(InetAddress source, String tableName, Collectio
}
/** Translates remote files to local files by creating a local sstable per remote sstable. */
- public static PendingFile getContextMapping(PendingFile remote) throws IOException
+ public static PendingFile getContextMapping(PendingFile remote)
{
/* Create a local sstable for each remote sstable */
Descriptor remotedesc = remote.desc;
View
1  src/java/org/apache/cassandra/thrift/TCustomServerSocket.java
@@ -81,7 +81,6 @@ public TCustomServerSocket(InetSocketAddress bindAddr, boolean keepAlive, Intege
}
public TCustomServerSocket(ServerSocket socket, boolean keepAlive, Integer sendBufferSize, Integer recvBufferSize)
- throws TTransportException
{
this.serverSocket = socket;
this.keepAlive = keepAlive;
View
2  src/java/org/apache/cassandra/tools/BulkLoader.java
@@ -56,7 +56,7 @@
private static final String PASSWD_OPTION = "password";
private static final String THROTTLE_MBITS = "throttle";
- public static void main(String args[]) throws IOException
+ public static void main(String args[])
{
LoaderOptions options = LoaderOptions.parseArgs(args);
try
View
4 src/java/org/apache/cassandra/tools/NodeCmd.java
@@ -922,7 +922,7 @@ private void printIsThriftServerRunning(PrintStream outs)
outs.println(probe.isThriftServerRunning() ? "running" : "not running");
}
- public static void main(String[] args) throws IOException, InterruptedException, ConfigurationException, ParseException
+ public static void main(String[] args) throws IOException, InterruptedException, ParseException
{
CommandLineParser parser = new PosixParser();
ToolCommandLine cmd = null;
@@ -1280,7 +1280,7 @@ private static void complainNonzeroArgs(String[] args, NodeCommand cmd)
}
}
- private static void handleSnapshots(NodeCommand nc, String tag, String[] cmdArgs, String columnFamily, NodeProbe probe) throws InterruptedException, IOException
+ private static void handleSnapshots(NodeCommand nc, String tag, String[] cmdArgs, String columnFamily, NodeProbe probe) throws IOException
{
String[] keyspaces = Arrays.copyOfRange(cmdArgs, 0, cmdArgs.length);
System.out.print("Requested snapshot for: ");
View
12 src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -88,7 +88,7 @@
* @param port TCP port of the remote JMX agent
* @throws IOException on connection failures
*/
- public NodeProbe(String host, int port, String username, String password) throws IOException, InterruptedException
+ public NodeProbe(String host, int port, String username, String password) throws IOException
{
assert username != null && !username.isEmpty() && password != null && !password.isEmpty()
: "neither username nor password can be blank";
@@ -107,7 +107,7 @@ public NodeProbe(String host, int port, String username, String password) throws
* @param port TCP port of the remote JMX agent
* @throws IOException on connection failures
*/
- public NodeProbe(String host, int port) throws IOException, InterruptedException
+ public NodeProbe(String host, int port) throws IOException
{
this.host = host;
this.port = port;
@@ -120,7 +120,7 @@ public NodeProbe(String host, int port) throws IOException, InterruptedException
* @param host hostname or IP address of the JMX agent
* @throws IOException on connection failures
*/
- public NodeProbe(String host) throws IOException, InterruptedException
+ public NodeProbe(String host) throws IOException
{
this.host = host;
this.port = defaultPort;
@@ -265,12 +265,12 @@ public void forceTableRepairRange(String beginToken, String endToken, String tab
ssProxy.forceTableRepairRange(beginToken, endToken, tableName, isSequential, isLocal, columnFamilies);
}
- public void invalidateKeyCache() throws IOException
+ public void invalidateKeyCache()
{
cacheService.invalidateKeyCache();
}
- public void invalidateRowCache() throws IOException
+ public void invalidateRowCache()
{
cacheService.invalidateRowCache();
}
@@ -456,7 +456,7 @@ public void decommission() throws InterruptedException
ssProxy.decommission();
}
- public void move(String newToken) throws IOException, InterruptedException
+ public void move(String newToken) throws IOException
{
ssProxy.move(newToken);
}
View
2  src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java
@@ -32,7 +32,7 @@
/**
* @param args a list of sstables whose metadata we're interested in
*/
- public static void main(String[] args) throws IOException, ConfigurationException
+ public static void main(String[] args) throws IOException
{
PrintStream out = System.out;
if (args.length == 0)
View
2  test/unit/org/apache/cassandra/cli/CliTest.java
@@ -217,7 +217,7 @@
};
@Test
- public void testCli() throws IOException, TException, ConfigurationException, ClassNotFoundException, TimedOutException, NotFoundException, SchemaDisagreementException, NoSuchFieldException, InvalidRequestException, UnavailableException, InstantiationException, IllegalAccessException
+ public void testCli() throws IOException, TException, TimedOutException, NotFoundException, SchemaDisagreementException, NoSuchFieldException, InvalidRequestException, UnavailableException, InstantiationException, IllegalAccessException
{
Schema.instance.clear(); // Schema are now written on disk and will be reloaded
new EmbeddedCassandraService().start();
Please sign in to comment.
Something went wrong with that request. Please try again.