cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1052356 - in /cassandra/trunk: ./ interface/thrift/gen-java/org/apache/cassandra/thrift/ src/java/org/apache/cassandra/cli/ src/java/org/apache/cassandra/db/ src/java/org/apache/cassandra/locator/ src/java/org/apache/cassandra/service/ src...
Date Thu, 23 Dec 2010 19:06:51 GMT
Author: jbellis
Date: Thu Dec 23 19:06:50 2010
New Revision: 1052356

URL: http://svn.apache.org/viewvc?rev=1052356&view=rev
Log:
merge from 0.7

Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java 
 (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java   (props
changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
  (props changed)
    cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
  (props changed)
    cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
    cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
    cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
    cassandra/trunk/src/java/org/apache/cassandra/locator/SimpleSnitch.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java
    cassandra/trunk/test/unit/org/apache/cassandra/cli/CliTest.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 23 19:06:50 2010
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6:922689-1051640,1051662
-/cassandra/branches/cassandra-0.7:1026517-1052104
+/cassandra/branches/cassandra-0.7:1026517-1052355
 /incubator/cassandra/branches/cassandra-0.3:774578-796573
 /incubator/cassandra/branches/cassandra-0.4:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5:888872-915439

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1052356&r1=1052355&r2=1052356&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Thu Dec 23 19:06:50 2010
@@ -8,6 +8,9 @@
  * count timeouts in storageproxy latencies, and include latency 
    histograms in StorageProxyMBean (CASSANDRA-1893)
  * check log4j configuration for changes every 10s (CASSANDRA-1525)
+ * More-efficient cross-DC replication (CASSANDRA-1530)
+ * upgrade to TFastFramedTransport (CASSANDRA-1743)
+ * fix CLI get recognition of supercolumns (CASSANDRA-1899)
 
 
 0.7.0-rc3

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 23 19:06:50 2010
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1051640,1051662
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026517-1052104
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026517-1052355
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Cassandra.java:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Cassandra.java:888872-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 23 19:06:50 2010
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1051640,1051662
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026517-1052104
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026517-1052355
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/Column.java:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/Column.java:888872-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 23 19:06:50 2010
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1051640,1051662
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026517-1052104
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026517-1052355
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:888872-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 23 19:06:50 2010
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1051640,1051662
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026517-1052104
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026517-1052355
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:888872-903502

Propchange: cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 23 19:06:50 2010
@@ -1,5 +1,5 @@
 /cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1051640,1051662
-/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026517-1052104
+/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026517-1052355
 /incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198
 /incubator/cassandra/branches/cassandra-0.4/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:810145-834239,834349-834350
 /incubator/cassandra/branches/cassandra-0.5/interface/gen-java/org/apache/cassandra/service/SuperColumn.java:888872-903502

Modified: cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java?rev=1052356&r1=1052355&r2=1052356&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/cli/CliClient.java Thu Dec 23 19:06:50 2010
@@ -376,7 +376,7 @@ public class CliClient extends CliUserHe
         ByteBuffer key = getKeyAsBytes(columnFamily, columnFamilySpec.getChild(1));
         int columnSpecCnt = CliCompiler.numColumnSpecifiers(columnFamilySpec);
         CfDef cfDef = getCfDef(columnFamily);
-        boolean isSuper = cfDef.comparator_type.equals("Super");
+        boolean isSuper = cfDef.column_type.equals("Super");
         
         byte[] superColumnName = null;
         ByteBuffer columnName;

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java?rev=1052356&r1=1052355&r2=1052356&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/RowMutation.java Thu Dec 23 19:06:50
2010
@@ -55,6 +55,7 @@ public class RowMutation
 {
     private static RowMutationSerializer serializer_;
     public static final String HINT = "HINT";
+    public static final String FORWARD_HEADER = "FORWARD";
 
     static
     {

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java?rev=1052356&r1=1052355&r2=1052356&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/RowMutationVerbHandler.java Thu Dec 23
19:06:50 2010
@@ -18,16 +18,14 @@
 
 package org.apache.cassandra.db;
 
-import java.io.*;
-
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
 import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.nio.ByteBuffer;
 
 import com.google.common.base.Charsets;
-
-import org.apache.cassandra.net.IVerbHandler;
-import org.apache.cassandra.net.Message;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -37,8 +35,6 @@ import org.apache.cassandra.net.*;
 import org.apache.cassandra.utils.ByteBufferUtil;
 import org.apache.cassandra.utils.FBUtilities;
 
-import static com.google.common.base.Charsets.UTF_8;
-
 
 public class RowMutationVerbHandler implements IVerbHandler
 {
@@ -68,6 +64,11 @@ public class RowMutationVerbHandler impl
                     hintedMutation.apply();
                 }
             }
+        
+            // Check if there were any forwarding headers in this message
+            byte[] forwardBytes = message.getHeader(RowMutation.FORWARD_HEADER);
+            if (forwardBytes != null)
+                forwardToLocalNodes(message, forwardBytes);
 
             Table.open(rm.getTable()).apply(rm, true);
 
@@ -85,5 +86,34 @@ public class RowMutationVerbHandler impl
         {
             logger_.error("Error in row mutation", e);
         }
+    }  
+    
+    private void forwardToLocalNodes(Message message, byte[] forwardBytes) throws UnknownHostException
+    {
+        // remove fwds from message to avoid infinite loop
+        message.setHeader(RowMutation.FORWARD_HEADER, null);
+
+        int bytesPerInetAddress = FBUtilities.getLocalAddress().getAddress().length;
+        assert forwardBytes.length >= bytesPerInetAddress;
+        assert forwardBytes.length % bytesPerInetAddress == 0;
+
+        int offset = 0;
+        byte[] addressBytes = new byte[bytesPerInetAddress];
+
+        // Send a message to each of the addresses on our Forward List
+        while (offset < forwardBytes.length)
+        {
+            System.arraycopy(forwardBytes, offset, addressBytes, 0, bytesPerInetAddress);
+            InetAddress address = InetAddress.getByAddress(addressBytes);
+
+            if (logger_.isDebugEnabled())
+                logger_.debug("Forwarding message to " + address);
+
+            // Send the original message to the address specified by the FORWARD_HINT
+            // Let the response go back to the coordinator
+            MessagingService.instance.sendOneWay(message, message.getFrom());
+
+            offset += bytesPerInetAddress;
+        }
     }
 }

Modified: cassandra/trunk/src/java/org/apache/cassandra/locator/SimpleSnitch.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/SimpleSnitch.java?rev=1052356&r1=1052355&r2=1052356&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/SimpleSnitch.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/SimpleSnitch.java Thu Dec 23 19:06:50
2010
@@ -32,12 +32,12 @@ public class SimpleSnitch extends Abstra
 {
     public String getRack(InetAddress endpoint)
     {
-        throw new UnsupportedOperationException();
+        return "rack1";
     }
 
     public String getDatacenter(InetAddress endpoint)
     {
-        throw new UnsupportedOperationException();
+        return "datacenter1";
     }
     
     public List<InetAddress> getSortedListByProximity(final InetAddress address, Collection<InetAddress>
addresses)

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1052356&r1=1052355&r2=1052356&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java Thu Dec 23 19:06:50
2010
@@ -27,15 +27,12 @@ import java.util.concurrent.*;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Multimap;
-import static com.google.common.base.Charsets.UTF_8;
+import com.google.common.collect.*;
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 import org.apache.cassandra.concurrent.Stage;
 import org.apache.cassandra.concurrent.StageManager;
 import org.apache.cassandra.config.CFMetaData;
@@ -44,6 +41,11 @@ import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.marshal.AbstractCommutativeType;
 import org.apache.cassandra.dht.*;
+import org.apache.cassandra.db.filter.QueryFilter;
+import org.apache.cassandra.dht.AbstractBounds;
+import org.apache.cassandra.dht.Bounds;
+import org.apache.cassandra.dht.IPartitioner;
+import org.apache.cassandra.dht.Token;
 import org.apache.cassandra.gms.Gossiper;
 import org.apache.cassandra.locator.AbstractReplicationStrategy;
 import org.apache.cassandra.locator.TokenMetadata;
@@ -56,7 +58,8 @@ import org.apache.cassandra.utils.FBUtil
 import org.apache.cassandra.utils.LatencyTracker;
 import org.apache.cassandra.utils.Pair;
 import org.apache.cassandra.utils.WrappedRunnable;
-import org.apache.cassandra.db.filter.QueryFilter;
+
+import static com.google.common.base.Charsets.UTF_8;
 
 public class StorageProxy implements StorageProxyMBean
 {
@@ -96,10 +99,11 @@ public class StorageProxy implements Sto
     public static void mutate(List<RowMutation> mutations, ConsistencyLevel consistency_level)
throws UnavailableException, TimeoutException
     {
         long startTime = System.nanoTime();
-        ArrayList<IWriteResponseHandler> responseHandlers = new ArrayList<IWriteResponseHandler>();
+        List<IWriteResponseHandler> responseHandlers = new ArrayList<IWriteResponseHandler>();
 
         RowMutation mostRecentRowMutation = null;
         StorageService ss = StorageService.instance;
+        String localDataCenter = DatabaseDescriptor.getEndpointSnitch().getDatacenter(FBUtilities.getLocalAddress());
         
         try
         {
@@ -113,11 +117,15 @@ public class StorageProxy implements Sto
                 Collection<InetAddress> writeEndpoints = ss.getTokenMetadata().getWriteEndpoints(StorageService.getPartitioner().getToken(rm.key()),
table, naturalEndpoints);
                 Multimap<InetAddress, InetAddress> hintedEndpoints = rs.getHintedEndpoints(writeEndpoints);
                 
-                // send out the writes, as in mutate() above, but this time with a callback
that tracks responses
                 final IWriteResponseHandler responseHandler = rs.getWriteResponseHandler(writeEndpoints,
hintedEndpoints, consistency_level);
+                
+                // exit early if we can't fulfill the CL at this time
                 responseHandler.assureSufficientLiveNodes();
-
+                
                 responseHandlers.add(responseHandler);
+                
+                // Multimap that holds onto all the messages and addresses meant for a specific
datacenter
+                Multimap<String, Pair<Message, InetAddress>> dcMessages = HashMultimap.create(hintedEndpoints.size(),
10);
                 Message unhintedMessage = null;
 
                 //XXX: if commutative value, only allow CL.ONE write
@@ -128,6 +136,8 @@ public class StorageProxy implements Sto
                     InetAddress destination = entry.getKey();
                     Collection<InetAddress> targets = entry.getValue();
 
+                    String dc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(destination);
+
                     if (targets.size() == 1 && targets.iterator().next().equals(destination))
                     {
                         // only non-hinted writes are supported
@@ -140,7 +150,7 @@ public class StorageProxy implements Sto
                         }
                         else
                         {
-                            // belongs on a different server.  send it there.
+                            // belongs on a different server
                             if (unhintedMessage == null)
                             {
                                 unhintedMessage = rm.makeRowMutationMessage();
@@ -148,7 +158,7 @@ public class StorageProxy implements Sto
                             }
                             if (logger.isDebugEnabled())
                                 logger.debug("insert writing key " + FBUtilities.bytesToHex(rm.key())
+ " to " + unhintedMessage.getMessageId() + "@" + destination);
-                            MessagingService.instance.sendOneWay(unhintedMessage, destination);
+                            dcMessages.put(dc, new Pair<Message, InetAddress>(unhintedMessage,
destination));
                         }
                     }
                     else
@@ -165,15 +175,16 @@ public class StorageProxy implements Sto
                             }
                         }
                         responseHandler.addHintCallback(hintedMessage, destination);
-                        MessagingService.instance.sendOneWay(hintedMessage, destination);
+                        dcMessages.put(dc, new Pair<Message, InetAddress>(hintedMessage,
destination));
                     }
                 }
+
+                sendMessages(localDataCenter, dcMessages);
             }
+                        
             // wait for writes.  throws timeoutexception if necessary
             for (IWriteResponseHandler responseHandler : responseHandlers)
-            {
                 responseHandler.get();
-            }
         }
         catch (IOException e)
         {
@@ -222,6 +233,59 @@ public class StorageProxy implements Sto
         }
     }
 
+    /**
+     * for each datacenter, send a message to one node to relay the write to other replicas
+     */
+    private static void sendMessages(String localDataCenter, Multimap<String, Pair<Message,
InetAddress>> dcMessages)
+    throws IOException
+    {
+        for (Map.Entry<String, Collection<Pair<Message, InetAddress>>>
entry : dcMessages.asMap().entrySet())
+        {
+            String dataCenter = entry.getKey();
+
+            // Grab a set of all the messages bound for this dataCenter and create an iterator
over this set.
+            Collection<Pair<Message, InetAddress>> messagesForDataCenter = entry.getValue();
+            Iterator<Pair<Message, InetAddress>> iter = messagesForDataCenter.iterator();
+            assert iter.hasNext();
+
+            // First endpoint in list is the destination for this group
+            Pair<Message, InetAddress> messageAndDestination = iter.next();
+
+            Message primaryMessage = messageAndDestination.left;
+            InetAddress target = messageAndDestination.right;
+
+            // Add all the other destinations that are bound for the same dataCenter as a
header in the primary message.
+            while (iter.hasNext())
+            {
+                messageAndDestination = iter.next();
+                assert messageAndDestination.left == primaryMessage;
+
+                if (dataCenter.equals(localDataCenter))
+                {
+                    // direct write to local DC
+                    assert primaryMessage.getHeader(RowMutation.FORWARD_HEADER) == null;
+                    MessagingService.instance.sendOneWay(primaryMessage, target);
+                }
+                else
+                {
+                    // group all nodes in this DC as forward headers on the primary message
+                    ByteArrayOutputStream bos = new ByteArrayOutputStream();
+                    DataOutputStream dos = new DataOutputStream(bos);
+
+                    // append to older addresses
+                    byte[] previousHints = primaryMessage.getHeader(RowMutation.FORWARD_HEADER);
+                    if (previousHints != null)
+                        dos.write(previousHints);
+
+                    dos.write(messageAndDestination.right.getAddress());
+                    primaryMessage.setHeader(RowMutation.FORWARD_HEADER, bos.toByteArray());
+                }
+            }
+
+            MessagingService.instance.sendOneWay(primaryMessage, target);
+        }
+    }
+
     private static void addHintHeader(Message message, InetAddress target) throws IOException
     {
         ByteArrayOutputStream bos = new ByteArrayOutputStream();

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java?rev=1052356&r1=1052355&r2=1052356&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraDaemon.java Thu Dec 23 19:06:50
2010
@@ -25,13 +25,12 @@ import java.util.concurrent.ExecutorServ
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.cassandra.config.ConfigurationException;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.thrift.TProcessorFactory;
 import org.apache.thrift.protocol.TBinaryProtocol;
 import org.apache.thrift.protocol.TProtocolFactory;
 import org.apache.thrift.server.TServer;
-import org.apache.thrift.transport.TFramedTransport;
+import org.apache.thrift.transport.TFastFramedTransport;
 import org.apache.thrift.transport.TServerSocket;
 import org.apache.thrift.transport.TTransportException;
 import org.apache.thrift.transport.TTransportFactory;
@@ -86,9 +85,9 @@ public class CassandraDaemon extends org
         if (DatabaseDescriptor.isThriftFramed())
         {
             int tFramedTransportSize = DatabaseDescriptor.getThriftFramedTransportSize();
-            inTransportFactory = new TFramedTransport.Factory(tFramedTransportSize);
-            outTransportFactory = new TFramedTransport.Factory(tFramedTransportSize);
-            logger.info("Using TFramedTransport with a max frame size of {} bytes.", tFramedTransportSize);
+            inTransportFactory  = new TFastFramedTransport.Factory(64 * 1024, tFramedTransportSize);
+            outTransportFactory = new TFastFramedTransport.Factory(64 * 1024, tFramedTransportSize);
+            logger.info("Using TFastFramedTransport with a max frame size of {} bytes.",
tFramedTransportSize);
         }
         else
         {

Modified: cassandra/trunk/test/unit/org/apache/cassandra/cli/CliTest.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/test/unit/org/apache/cassandra/cli/CliTest.java?rev=1052356&r1=1052355&r2=1052356&view=diff
==============================================================================
--- cassandra/trunk/test/unit/org/apache/cassandra/cli/CliTest.java (original)
+++ cassandra/trunk/test/unit/org/apache/cassandra/cli/CliTest.java Thu Dec 23 19:06:50 2010
@@ -108,6 +108,9 @@ public class CliTest extends CleanupHelp
         "drop column family cF8;",
         "create keyspace TESTIN;",
         "drop keyspace tesTIN;",
+        "create column family myCF with column_type='Super' and comparator='UTF8Type' AND
subcomparator='UTF8Type';",
+        "set myCF['key']['scName']['firstname'] = 'John';",
+        "get myCF['key']['scName']",
         "use TestKEYSpace;",
     };
     



Mime
View raw message