You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2011/12/07 05:24:26 UTC
svn commit: r1211295 - in /cassandra/branches/cassandra-1.0: CHANGES.txt
src/java/org/apache/cassandra/service/StorageProxy.java
Author: jbellis
Date: Wed Dec 7 04:24:26 2011
New Revision: 1211295
URL: http://svn.apache.org/viewvc?rev=1211295&view=rev
Log:
merge from 0.8
Modified:
cassandra/branches/cassandra-1.0/CHANGES.txt
cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/service/StorageProxy.java
Modified: cassandra/branches/cassandra-1.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/CHANGES.txt?rev=1211295&r1=1211294&r2=1211295&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/CHANGES.txt (original)
+++ cassandra/branches/cassandra-1.0/CHANGES.txt Wed Dec 7 04:24:26 2011
@@ -18,6 +18,8 @@
(CASSANDRA-3558)
Merged from 0.8:
* use cannonical host for local node in nodetool info (CASSANDRA-3556)
+ * remove nonlocal DC write optimization since it only worked with
+ CL.ONE or CL.LOCAL_QUORUM (CASSANDRA-3577)
1.0.5
Modified: cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1211295&r1=1211294&r2=1211295&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/service/StorageProxy.java (original)
+++ cassandra/branches/cassandra-1.0/src/java/org/apache/cassandra/service/StorageProxy.java Wed Dec 7 04:24:26 2011
@@ -389,8 +389,6 @@ public class StorageProxy implements Sto
{
for (Map.Entry<String, Multimap<Message, InetAddress>> entry: dcMessages.entrySet())
{
- String dataCenter = entry.getKey();
-
// send the messages corresponding to this datacenter
for (Map.Entry<Message, Collection<InetAddress>> messages: entry.getValue().asMap().entrySet())
{
@@ -399,32 +397,10 @@ public class StorageProxy implements Sto
// from previous loop iterations
message = message.withHeaderRemoved(RowMutation.FORWARD_HEADER);
- if (dataCenter.equals(localDataCenter))
- {
- // direct writes to local DC or old Cassadra versions
- for (InetAddress destination : messages.getValue())
- MessagingService.instance().sendRR(message, destination, handler);
- }
- else
- {
- // Non-local DC. First endpoint in list is the destination for this group
- Iterator<InetAddress> iter = messages.getValue().iterator();
- InetAddress target = iter.next();
- // Add all the other destinations of the same message as a header in the primary message.
- if (iter.hasNext())
- {
- FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
- DataOutputStream dos = new DataOutputStream(bos);
- while (iter.hasNext())
- {
- InetAddress destination = iter.next();
- dos.write(destination.getAddress());
- }
- message = message.withHeaderAdded(RowMutation.FORWARD_HEADER, bos.toByteArray());
- }
- // send the combined message + forward headers
- MessagingService.instance().sendRR(message, target, handler);
- }
+ // direct writes to everything -- optimized nonlocal DC writes are
+ // postponed to 1.1; see CASSANDRA-3577
+ for (InetAddress destination : messages.getValue())
+ MessagingService.instance().sendRR(message, destination, handler);
}
}
}