cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r979437 - in /cassandra/trunk/contrib/word_count: bin/word_count_setup src/WordCountSetup.java
Date Mon, 26 Jul 2010 21:01:24 GMT
Author: jbellis
Date: Mon Jul 26 21:01:23 2010
New Revision: 979437

URL: http://svn.apache.org/viewvc?rev=979437&view=rev
Log:
fix formatting, default framed mode

Modified:
    cassandra/trunk/contrib/word_count/bin/word_count_setup
    cassandra/trunk/contrib/word_count/src/WordCountSetup.java

Modified: cassandra/trunk/contrib/word_count/bin/word_count_setup
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/word_count/bin/word_count_setup?rev=979437&r1=979436&r2=979437&view=diff
==============================================================================
--- cassandra/trunk/contrib/word_count/bin/word_count_setup (original)
+++ cassandra/trunk/contrib/word_count/bin/word_count_setup Mon Jul 26 21:01:23 2010
@@ -55,6 +55,6 @@ fi
 
 HOST=localhost
 PORT=9160
-FRAMED=false
+FRAMED=true
 
 $JAVA -Xmx1G -ea -Dcassandra.host=$HOST -Dcassandra.port=$PORT -Dcassandra.framed=$FRAMED
-cp $CLASSPATH WordCountSetup

Modified: cassandra/trunk/contrib/word_count/src/WordCountSetup.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/contrib/word_count/src/WordCountSetup.java?rev=979437&r1=979436&r2=979437&view=diff
==============================================================================
--- cassandra/trunk/contrib/word_count/src/WordCountSetup.java (original)
+++ cassandra/trunk/contrib/word_count/src/WordCountSetup.java Mon Jul 26 21:01:23 2010
@@ -73,7 +73,8 @@ public class WordCountSetup
         System.exit(0);
     }
 
-    private static Map<byte[],Map<String,List<Mutation>>> getMutationMap(byte[]
key, String cf, Column c) {
+    private static Map<byte[],Map<String,List<Mutation>>> getMutationMap(byte[]
key, String cf, Column c)
+    {
         Map<byte[],Map<String,List<Mutation>>> mutationMap = new HashMap<byte[],Map<String,List<Mutation>>>();
         addToMutationMap(mutationMap, key, cf, c);
         return mutationMap;
@@ -104,25 +105,19 @@ public class WordCountSetup
 
     private static Cassandra.Iface createConnection() throws TTransportException
     {
-        if(System.getProperty("cassandra.host") == null || System.getProperty("cassandra.port")
== null)
+        if (System.getProperty("cassandra.host") == null || System.getProperty("cassandra.port")
== null)
         {
            logger.warn("cassandra.host or cassandra.port is not defined, using default");
         }
         return createConnection( System.getProperty("cassandra.host","localhost"),
                                  Integer.valueOf(System.getProperty("cassandra.port","9160")),
-                                 Boolean.valueOf(System.getProperty("cassandra.framed", "false"))
);
+                                 Boolean.valueOf(System.getProperty("cassandra.framed", "true"))
);
     }
 
     private static Cassandra.Client createConnection(String host, Integer port, boolean framed)
throws TTransportException
     {
         TSocket socket = new TSocket(host, port);
-        TTransport trans;
-
-        if(framed)
-            trans = new TFramedTransport(socket);
-        else
-            trans = socket;
-
+        TTransport trans = framed ? new TFramedTransport(socket) : socket;
         trans.open();
         TProtocol protocol = new TBinaryProtocol(trans);
 



Mime
View raw message