allow [LOCAL|EACH]_QUORUM to be used with non-NetworkTopology Strategies

patch by jbellis

git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.7@1053409 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2010-12-28 19:13:32 +00:00
parent 5995b48e82
commit 47f4c02caa
3 changed files with 6 additions and 14 deletions

View File

@ -14,6 +14,8 @@ dev
* count timeouts towards dynamicsnitch latencies (CASSANDRA-1905)
* Expose index-building status in JMX + cli schema description
(CASSANDRA-1871)
* allow [LOCAL|EACH]_QUORUM to be used with non-NetworkTopology
replication Strategies
0.7.0-rc3

View File

@ -224,6 +224,10 @@ public abstract class AbstractReplicationStrategy
public QuorumResponseHandler getQuorumResponseHandler(IResponseResolver responseResolver, ConsistencyLevel consistencyLevel)
{
if (consistencyLevel.equals(ConsistencyLevel.LOCAL_QUORUM) || consistencyLevel.equals(ConsistencyLevel.EACH_QUORUM))
{
return new DatacenterQuorumResponseHandler(responseResolver, consistencyLevel, table);
}
return new QuorumResponseHandler(responseResolver, consistencyLevel, table);
}

View File

@ -164,18 +164,4 @@ public class NetworkTopologyStrategy extends AbstractReplicationStrategy
}
return super.getWriteResponseHandler(writeEndpoints, hintedEndpoints, consistency_level);
}
/**
* This method will generate the WRH object and returns. If the Consistency
* level is LOCAL_QUORUM/EACH_QUORUM then it will return a DCQRH.
*/
@Override
public QuorumResponseHandler getQuorumResponseHandler(IResponseResolver responseResolver, ConsistencyLevel consistencyLevel)
{
if (consistencyLevel.equals(ConsistencyLevel.LOCAL_QUORUM) || consistencyLevel.equals(ConsistencyLevel.EACH_QUORUM))
{
return new DatacenterQuorumResponseHandler(responseResolver, consistencyLevel, table);
}
return super.getQuorumResponseHandler(responseResolver, consistencyLevel);
}
}