cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject [1/2] git commit: don't declare throwing exceptions that aren't thrown
Date Sun, 05 May 2013 23:23:38 GMT
Updated Branches:
  refs/heads/trunk 6e7018a90 -> 5b0ec50cc


don't declare throwing exceptions that aren't thrown


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/5b0ec50c
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5b0ec50c
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5b0ec50c

Branch: refs/heads/trunk
Commit: 5b0ec50cc389d1ca27eebe18256fcc2c1f91f8a2
Parents: b638370
Author: Dave Brosius <dbrosius@apache.org>
Authored: Sun May 5 17:06:12 2013 -0400
Committer: Dave Brosius <dbrosius@apache.org>
Committed: Sun May 5 19:22:44 2013 -0400

----------------------------------------------------------------------
 .../cassandra/config/DatabaseDescriptor.java       |    2 +-
 .../cql3/statements/CreateKeyspaceStatement.java   |    2 +-
 .../cassandra/cql3/statements/SelectStatement.java |   19 +++-----------
 .../apache/cassandra/service/CassandraDaemon.java  |   10 +-------
 .../org/apache/cassandra/service/ClientState.java  |    2 +-
 .../cassandra/service/RangeSliceVerbHandler.java   |    8 +-----
 .../org/apache/cassandra/service/StorageProxy.java |    6 ++--
 .../org/apache/cassandra/tools/SSTableExport.java  |    2 +-
 .../org/apache/cassandra/tools/SSTableImport.java  |    2 +-
 .../apache/cassandra/tools/StandaloneScrubber.java |    2 +-
 .../cassandra/config/DatabaseDescriptorTest.java   |    2 +-
 11 files changed, 16 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index aad4dd3..89f4c77 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -485,7 +485,7 @@ public class DatabaseDescriptor
     }
 
     /** 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);
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/src/java/org/apache/cassandra/cql3/statements/CreateKeyspaceStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateKeyspaceStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateKeyspaceStatement.java
index 0c4d9ca..71b22d8 100644
--- a/src/java/org/apache/cassandra/cql3/statements/CreateKeyspaceStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/CreateKeyspaceStatement.java
@@ -58,7 +58,7 @@ public class CreateKeyspaceStatement extends SchemaAlteringStatement
         return name;
     }
 
-    public void checkAccess(ClientState state) throws UnauthorizedException, InvalidRequestException
+    public void checkAccess(ClientState state) throws UnauthorizedException
     {
         state.hasAllKeyspacesAccess(Permission.CREATE);
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 6f33309..93571fa 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -147,22 +147,11 @@ public class SelectStatement implements CQLStatement
 
     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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/src/java/org/apache/cassandra/service/CassandraDaemon.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index 3d5240f..ae8e2cc 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -226,15 +226,7 @@ public class CassandraDaemon
         }
 
         // 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())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/src/java/org/apache/cassandra/service/ClientState.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/ClientState.java b/src/java/org/apache/cassandra/service/ClientState.java
index e6b0f97..b6769a3 100644
--- a/src/java/org/apache/cassandra/service/ClientState.java
+++ b/src/java/org/apache/cassandra/service/ClientState.java
@@ -128,7 +128,7 @@ public class ClientState
         this.user = user;
     }
 
-    public void hasAllKeyspacesAccess(Permission perm) throws UnauthorizedException, InvalidRequestException
+    public void hasAllKeyspacesAccess(Permission perm) throws UnauthorizedException
     {
         if (internalCall)
             return;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java b/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java
index a095680..b6f257e 100644
--- a/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java
+++ b/src/java/org/apache/cassandra/service/RangeSliceVerbHandler.java
@@ -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 @@ import org.apache.cassandra.tracing.Tracing;
 
 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))

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/src/java/org/apache/cassandra/service/StorageProxy.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index 8d2dc60..58fa6e3 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -294,7 +294,7 @@ public class StorageProxy implements StorageProxyMBean
      * 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 @@ public class StorageProxy implements StorageProxyMBean
     }
 
     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 @@ public class StorageProxy implements StorageProxyMBean
             this.handler = handler;
         }
 
-        protected void runMayThrow() throws ExecutionException, InterruptedException
+        protected void runMayThrow()
         {
             logger.trace("LocalReadRunnable reading {}", command);
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/src/java/org/apache/cassandra/tools/SSTableExport.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/SSTableExport.java b/src/java/org/apache/cassandra/tools/SSTableExport.java
index 4b91dd8..9e8bb3e 100644
--- a/src/java/org/apache/cassandra/tools/SSTableExport.java
+++ b/src/java/org/apache/cassandra/tools/SSTableExport.java
@@ -399,7 +399,7 @@ public class SSTableExport
      * @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());
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/src/java/org/apache/cassandra/tools/SSTableImport.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/SSTableImport.java b/src/java/org/apache/cassandra/tools/SSTableImport.java
index 8c58d70..f25a60b 100644
--- a/src/java/org/apache/cassandra/tools/SSTableImport.java
+++ b/src/java/org/apache/cassandra/tools/SSTableImport.java
@@ -487,7 +487,7 @@ public class SSTableImport
      * @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();
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/StandaloneScrubber.java b/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
index 9db565d..4ff06db 100644
--- a/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
@@ -51,7 +51,7 @@ public class StandaloneScrubber
     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

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b0ec50c/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
index 513b808..4433b57 100644
--- a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
+++ b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
@@ -67,7 +67,7 @@ public class DatabaseDescriptorTest
 
     // this came as a result of CASSANDRA-995
     @Test
-    public void testTransKsMigration() throws IOException, ConfigurationException
+    public void testTransKsMigration() throws ConfigurationException
     {
         SchemaLoader.cleanupAndLeaveDirs();
         DatabaseDescriptor.loadSchemas();


Mime
View raw message