Author: eevans
Date: Tue Jan  5 20:34:37 2010
New Revision: 896210

URL: http://svn.apache.org/viewvc?rev=896210&view=rev
Log:
cleanup test and contrib breakage from thrift upgrade

Patch by eevans for CASSANDRA-547

Modified:
    incubator/cassandra/trunk/contrib/client_only/ClientOnlyExample.java
    
incubator/cassandra/trunk/test/unit/org/apache/cassandra/client/TestRingCache.java

Modified: incubator/cassandra/trunk/contrib/client_only/ClientOnlyExample.java
URL: 
http://svn.apache.org/viewvc/incubator/cassandra/trunk/contrib/client_only/ClientOnlyExample.java?rev=896210&r1=896209&r2=896210&view=diff
==============================================================================
--- incubator/cassandra/trunk/contrib/client_only/ClientOnlyExample.java 
(original)
+++ incubator/cassandra/trunk/contrib/client_only/ClientOnlyExample.java Tue 
Jan  5 20:34:37 2010
@@ -20,6 +20,7 @@
 import org.apache.cassandra.db.filter.QueryPath;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.service.*;
+import static org.apache.cassandra.service.ThriftGlue.createColumnPath;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -47,7 +48,7 @@
         for (int i = 0; i < 100; i++)
         {
             RowMutation change = new RowMutation("Keyspace1", "key" + i);
-            ColumnPath cp = new ColumnPath("Standard1", null, 
("colb").getBytes());
+            ColumnPath cp = createColumnPath("Standard1", null, 
("colb").getBytes());
             change.add(new QueryPath(cp), ("value" + i).getBytes(), 0);
 
             // don't call change.apply().  The reason is that is makes a 
static call into Table, which will perform

Modified: 
incubator/cassandra/trunk/test/unit/org/apache/cassandra/client/TestRingCache.java
URL: 
http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/unit/org/apache/cassandra/client/TestRingCache.java?rev=896210&r1=896209&r2=896210&view=diff
==============================================================================
--- 
incubator/cassandra/trunk/test/unit/org/apache/cassandra/client/TestRingCache.java
 (original)
+++ 
incubator/cassandra/trunk/test/unit/org/apache/cassandra/client/TestRingCache.java
 Tue Jan  5 20:34:37 2010
@@ -23,6 +23,8 @@
 import org.apache.cassandra.service.Cassandra;
 import org.apache.cassandra.service.Column;
 import org.apache.cassandra.service.ColumnPath;
+import org.apache.cassandra.service.ConsistencyLevel;
+import static org.apache.cassandra.service.ThriftGlue.createColumnPath;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.transport.TSocket;
@@ -65,7 +67,7 @@
         for (int nRows=1; nRows<10; nRows++)
         {
             String row = "row" + nRows;
-            ColumnPath col = new ColumnPath("Standard1", null, 
"col1".getBytes());
+            ColumnPath col = createColumnPath("Standard1", null, 
"col1".getBytes());
 
             List<InetAddress> endPoints = ringCache.getEndPoint(row);
             String hosts="";
@@ -75,8 +77,8 @@
         
             // now, read the row back directly from the host owning the row 
locally
             setup(endPoints.get(0).getHostAddress(), 
DatabaseDescriptor.getThriftPort());
-            thriftClient.insert(table, row, col, "val1".getBytes(), 1, 1);
-            Column column=thriftClient.get(table, row, col, 1).column;
+            thriftClient.insert(table, row, col, "val1".getBytes(), 1, 
ConsistencyLevel.ONE);
+            Column column=thriftClient.get(table, row, col, 
ConsistencyLevel.ONE).column;
             System.out.println("read row " + row + " " + new 
String(column.name) + ":" + new String(column.value) + ":" + column.timestamp);
         }
         System.exit(1);


Reply via email to