cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject git commit: warnings
Date Fri, 27 Dec 2013 22:13:08 GMT
Updated Branches:
  refs/heads/trunk b2933717c -> e60355563


warnings


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

Branch: refs/heads/trunk
Commit: e603555636bc04e5a87d0457f4f10824b6cf94be
Parents: b293371
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Fri Dec 27 17:12:46 2013 -0500
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Fri Dec 27 17:12:46 2013 -0500

----------------------------------------------------------------------
 .../generatedata/DataGenStringDictionary.java   | 32 +++++++++++---------
 .../stress/operations/CqlCounterAdder.java      |  2 +-
 .../stress/operations/CqlCounterGetter.java     |  2 +-
 .../stress/operations/CqlInserter.java          |  2 +-
 .../stress/operations/CqlRangeSlicer.java       |  2 +-
 .../cassandra/stress/operations/CqlReader.java  |  2 +-
 .../stress/settings/StressSettings.java         |  1 -
 7 files changed, 22 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e6035556/tools/stress/src/org/apache/cassandra/stress/generatedata/DataGenStringDictionary.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/generatedata/DataGenStringDictionary.java
b/tools/stress/src/org/apache/cassandra/stress/generatedata/DataGenStringDictionary.java
index 68c8034..e581232 100644
--- a/tools/stress/src/org/apache/cassandra/stress/generatedata/DataGenStringDictionary.java
+++ b/tools/stress/src/org/apache/cassandra/stress/generatedata/DataGenStringDictionary.java
@@ -61,24 +61,26 @@ public class DataGenStringDictionary extends DataGen
     public static DataGenFactory getFactory(File file) throws IOException
     {
         final List<Pair<byte[], Double>> words = new ArrayList<>();
-        final BufferedReader reader = new BufferedReader(new FileReader(file));
-        String line;
-        while ( null != (line = reader.readLine()) )
+        try (final BufferedReader reader = new BufferedReader(new FileReader(file)))
         {
-            String[] pair = line.split(" +");
-            if (pair.length != 2)
-                throw new IllegalArgumentException("Invalid record in dictionary: \"" + line
+ "\"");
-            words.add(new Pair<>(pair[1].getBytes(UTF_8), Double.parseDouble(pair[0])));
-        }
-        final EnumeratedDistribution<byte[]> dist = new EnumeratedDistribution<byte[]>(words);
-        return new DataGenFactory()
-        {
-            @Override
-            public DataGen get()
+            String line;
+            while ( null != (line = reader.readLine()) )
             {
-                return new DataGenStringDictionary(dist);
+                String[] pair = line.split(" +");
+                if (pair.length != 2)
+                    throw new IllegalArgumentException("Invalid record in dictionary: \""
+ line + "\"");
+                words.add(new Pair<>(pair[1].getBytes(UTF_8), Double.parseDouble(pair[0])));
             }
-        };
+            final EnumeratedDistribution<byte[]> dist = new EnumeratedDistribution<byte[]>(words);
+            return new DataGenFactory()
+            {
+                @Override
+                public DataGen get()
+                {
+                    return new DataGenStringDictionary(dist);
+                }
+            };
+        }
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e6035556/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
b/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
index 8e1f137..aae99b5 100644
--- a/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
+++ b/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterAdder.java
@@ -63,7 +63,7 @@ public class CqlCounterAdder extends CqlOperation<Integer>
     }
 
     @Override
-    protected CqlRunOp buildRunOp(ClientWrapper client, String query, Object queryId, List<ByteBuffer>
params, String keyid, ByteBuffer key)
+    protected CqlRunOp<Integer> buildRunOp(ClientWrapper client, String query, Object
queryId, List<ByteBuffer> params, String keyid, ByteBuffer key)
     {
         return new CqlRunOpAlwaysSucceed(client, query, queryId, params, keyid, key, 1);
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e6035556/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterGetter.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterGetter.java
b/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterGetter.java
index 0a0b05b..31fd20d 100644
--- a/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterGetter.java
+++ b/tools/stress/src/org/apache/cassandra/stress/operations/CqlCounterGetter.java
@@ -60,7 +60,7 @@ public class CqlCounterGetter extends CqlOperation<Integer>
     }
 
     @Override
-    protected CqlRunOp buildRunOp(ClientWrapper client, String query, Object queryId, List<ByteBuffer>
params, String keyid, ByteBuffer key)
+    protected CqlRunOp<Integer> buildRunOp(ClientWrapper client, String query, Object
queryId, List<ByteBuffer> params, String keyid, ByteBuffer key)
     {
         return new CqlRunOpTestNonEmpty(client, query, queryId, params, keyid, key);
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e6035556/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java b/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java
index 6b1577c..82f00aa 100644
--- a/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java
+++ b/tools/stress/src/org/apache/cassandra/stress/operations/CqlInserter.java
@@ -79,7 +79,7 @@ public class CqlInserter extends CqlOperation<Integer>
     }
 
     @Override
-    protected CqlRunOp buildRunOp(ClientWrapper client, String query, Object queryId, List<ByteBuffer>
params, String keyid, ByteBuffer key)
+    protected CqlRunOp<Integer> buildRunOp(ClientWrapper client, String query, Object
queryId, List<ByteBuffer> params, String keyid, ByteBuffer key)
     {
         return new CqlRunOpAlwaysSucceed(client, query, queryId, params, keyid, key, 1);
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e6035556/tools/stress/src/org/apache/cassandra/stress/operations/CqlRangeSlicer.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/CqlRangeSlicer.java b/tools/stress/src/org/apache/cassandra/stress/operations/CqlRangeSlicer.java
index 467e754..76ba966 100644
--- a/tools/stress/src/org/apache/cassandra/stress/operations/CqlRangeSlicer.java
+++ b/tools/stress/src/org/apache/cassandra/stress/operations/CqlRangeSlicer.java
@@ -51,7 +51,7 @@ public class CqlRangeSlicer extends CqlOperation<Integer>
     }
 
     @Override
-    protected CqlRunOp buildRunOp(ClientWrapper client, String query, Object queryId, List<ByteBuffer>
params, String keyid, ByteBuffer key)
+    protected CqlRunOp<Integer> buildRunOp(ClientWrapper client, String query, Object
queryId, List<ByteBuffer> params, String keyid, ByteBuffer key)
     {
         return new CqlRunOpTestNonEmpty(client, query, queryId, params, keyid, key);
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e6035556/tools/stress/src/org/apache/cassandra/stress/operations/CqlReader.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/CqlReader.java b/tools/stress/src/org/apache/cassandra/stress/operations/CqlReader.java
index 051fd18..749a482 100644
--- a/tools/stress/src/org/apache/cassandra/stress/operations/CqlReader.java
+++ b/tools/stress/src/org/apache/cassandra/stress/operations/CqlReader.java
@@ -79,7 +79,7 @@ public class CqlReader extends CqlOperation<Integer>
     }
 
     @Override
-    protected CqlRunOp buildRunOp(ClientWrapper client, String query, Object queryId, List<ByteBuffer>
params, String keyid, ByteBuffer key)
+    protected CqlRunOp<Integer> buildRunOp(ClientWrapper client, String query, Object
queryId, List<ByteBuffer> params, String keyid, ByteBuffer key)
     {
         return new CqlRunOpTestNonEmpty(client, query, queryId, params, keyid, key);
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e6035556/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java
----------------------------------------------------------------------
diff --git a/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java b/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java
index ec4db96..b3fe406 100644
--- a/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java
+++ b/tools/stress/src/org/apache/cassandra/stress/settings/StressSettings.java
@@ -9,7 +9,6 @@ import org.apache.cassandra.stress.util.SimpleThriftClient;
 import org.apache.cassandra.stress.util.SmartThriftClient;
 import org.apache.cassandra.thrift.Cassandra;
 import org.apache.cassandra.thrift.InvalidRequestException;
-import org.apache.cassandra.thrift.TFramedTransportFactory;
 import org.apache.cassandra.transport.SimpleClient;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.transport.TSocket;


Mime
View raw message