Permalink
Browse files

don't declare throwing exceptions that aren't thrown

  • Loading branch information...
1 parent b638370 commit 5b0ec50cc389d1ca27eebe18256fcc2c1f91f8a2 @mebigfatguy mebigfatguy committed May 5, 2013
@@ -485,7 +485,7 @@ private static IEndpointSnitch createEndpointSnitch(String snitchClassName) thro
}
/** load keyspace (table) definitions, but do not initialize the table instances. */
- public static void loadSchemas() throws IOException
+ public static void loadSchemas()
{
ColumnFamilyStore schemaCFS = SystemTable.schemaCFS(SystemTable.SCHEMA_KEYSPACES_CF);
@@ -58,7 +58,7 @@ public String keyspace()
return name;
}
- public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
+ public void checkAccess(ClientState state) throws UnauthorizedException
{
state.hasAllKeyspacesAccess(Permission.CREATE);
}
@@ -147,22 +147,11 @@ public void validate(ClientState state) throws InvalidRequestException
public ResultMessage.Rows executeInternal(QueryState state) throws RequestExecutionException, RequestValidationException
{
- try
- {
- List<Row> rows = isKeyRange || usesSecondaryIndexing
- ? RangeSliceVerbHandler.executeLocally(getRangeCommand(Collections.<ByteBuffer>emptyList()))
- : readLocally(keyspace(), getSliceCommands(Collections.<ByteBuffer>emptyList()));
+ List<Row> rows = isKeyRange || usesSecondaryIndexing
+ ? RangeSliceVerbHandler.executeLocally(getRangeCommand(Collections.<ByteBuffer>emptyList()))
+ : readLocally(keyspace(), getSliceCommands(Collections.<ByteBuffer>emptyList()));
- return processResults(rows, Collections.<ByteBuffer>emptyList());
- }
- catch (ExecutionException e)
- {
- throw new RuntimeException(e);
- }
- catch (InterruptedException e)
- {
- throw new RuntimeException(e);
- }
+ return processResults(rows, Collections.<ByteBuffer>emptyList());
}
public ResultSet process(List<Row> rows) throws InvalidRequestException
@@ -226,15 +226,7 @@ public void uncaughtException(Thread t, Throwable e)
}
// load keyspace descriptions.
- try
- {
- DatabaseDescriptor.loadSchemas();
- }
- catch (IOException e)
- {
- logger.error("Fatal exception during initialization", e);
- System.exit(100);
- }
+ DatabaseDescriptor.loadSchemas();
// clean up debris in the rest of the tables
for (String table : Schema.instance.getTables())
@@ -128,7 +128,7 @@ public void login(Map<String, String> credentials) throws AuthenticationExceptio
this.user = user;
}
- public void hasAllKeyspacesAccess(Permission perm) throws UnauthorizedException, InvalidRequestException
+ public void hasAllKeyspacesAccess(Permission perm) throws UnauthorizedException
{
if (internalCall)
return;
@@ -18,10 +18,6 @@
package org.apache.cassandra.service;
import java.util.List;
-import java.util.concurrent.ExecutionException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.cassandra.db.ColumnFamilyStore;
import org.apache.cassandra.db.RangeSliceCommand;
@@ -35,9 +31,7 @@
public class RangeSliceVerbHandler implements IVerbHandler<RangeSliceCommand>
{
- private static final Logger logger = LoggerFactory.getLogger(RangeSliceVerbHandler.class);
-
- public static List<Row> executeLocally(RangeSliceCommand command) throws ExecutionException, InterruptedException
+ public static List<Row> executeLocally(RangeSliceCommand command)
{
ColumnFamilyStore cfs = Table.open(command.keyspace).getColumnFamilyStore(command.column_family);
if (cfs.indexManager.hasIndexFor(command.row_filter))
@@ -294,7 +294,7 @@ else if (!hasLiveColumns(current))
* nodes have seen the mostRecentCommit. Otherwise, return null.
*/
private static UUID beginAndRepairPaxos(ByteBuffer key, CFMetaData metadata, List<InetAddress> liveEndpoints, int requiredParticipants)
- throws WriteTimeoutException, UnavailableException
+ throws WriteTimeoutException
{
UUID ballot = UUIDGen.getTimeUUID();
@@ -344,7 +344,7 @@ private static UUID beginAndRepairPaxos(ByteBuffer key, CFMetaData metadata, Lis
}
private static PrepareCallback preparePaxos(Commit toPrepare, List<InetAddress> endpoints, int requiredParticipants)
- throws WriteTimeoutException, UnavailableException
+ throws WriteTimeoutException
{
PrepareCallback callback = new PrepareCallback(toPrepare.key, toPrepare.update.metadata(), requiredParticipants);
MessageOut<Commit> message = new MessageOut<Commit>(MessagingService.Verb.PAXOS_PREPARE, toPrepare, Commit.serializer);
@@ -1244,7 +1244,7 @@ protected void runMayThrow()
this.handler = handler;
}
- protected void runMayThrow() throws ExecutionException, InterruptedException
+ protected void runMayThrow()
{
logger.trace("LocalReadRunnable reading {}", command);
@@ -399,7 +399,7 @@ public static void export(Descriptor desc, String[] excludes) throws IOException
* @throws IOException on failure to open/read/write files or output streams
* @throws ConfigurationException on configuration failure (wrong params given)
*/
- public static void main(String[] args) throws IOException, ConfigurationException
+ public static void main(String[] args) throws ConfigurationException
{
String usage = String.format("Usage: %s <sstable> [-k key [-k key [...]] -x key [-x key [...]]]%n", SSTableExport.class.getName());
@@ -487,7 +487,7 @@ private JsonParser getParser(String fileName) throws IOException
* @throws ParseException on failure to parse JSON input
* @throws ConfigurationException on configuration error.
*/
- public static void main(String[] args) throws IOException, ParseException, ConfigurationException
+ public static void main(String[] args) throws ParseException, ConfigurationException
{
CommandLineParser parser = new PosixParser();
@@ -51,7 +51,7 @@
private static final String HELP_OPTION = "help";
private static final String MANIFEST_CHECK_OPTION = "manifest-check";
- public static void main(String args[]) throws IOException
+ public static void main(String args[])
{
Options options = Options.parseArgs(args);
try
@@ -67,7 +67,7 @@ public void testKSMetaDataSerialization() throws IOException, ConfigurationExcep
// this came as a result of CASSANDRA-995
@Test
- public void testTransKsMigration() throws IOException, ConfigurationException
+ public void testTransKsMigration() throws ConfigurationException
{
SchemaLoader.cleanupAndLeaveDirs();
DatabaseDescriptor.loadSchemas();

0 comments on commit 5b0ec50

Please sign in to comment.