camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject camel git commit: CAMEL-9909: Camel-Cassandraql: Supports missing Load Balancing policies
Date Wed, 27 Apr 2016 06:19:43 GMT
Repository: camel
Updated Branches:
  refs/heads/master 45c375c38 -> eb7439438


CAMEL-9909: Camel-Cassandraql: Supports missing Load Balancing policies


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/eb743943
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eb743943
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eb743943

Branch: refs/heads/master
Commit: eb743943832b35e4d77ec5dda43b9be3dd190e98
Parents: 45c375c
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Wed Apr 27 08:18:44 2016 +0200
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Wed Apr 27 08:19:09 2016 +0200

----------------------------------------------------------------------
 .../camel/utils/cassandra/CassandraLoadBalancingPolicies.java   | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/eb743943/components/camel-cassandraql/src/main/java/org/apache/camel/utils/cassandra/CassandraLoadBalancingPolicies.java
----------------------------------------------------------------------
diff --git a/components/camel-cassandraql/src/main/java/org/apache/camel/utils/cassandra/CassandraLoadBalancingPolicies.java
b/components/camel-cassandraql/src/main/java/org/apache/camel/utils/cassandra/CassandraLoadBalancingPolicies.java
index d6225bd..b5cefa8 100644
--- a/components/camel-cassandraql/src/main/java/org/apache/camel/utils/cassandra/CassandraLoadBalancingPolicies.java
+++ b/components/camel-cassandraql/src/main/java/org/apache/camel/utils/cassandra/CassandraLoadBalancingPolicies.java
@@ -17,6 +17,7 @@
 package org.apache.camel.utils.cassandra;
 
 import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy;
+import com.datastax.driver.core.policies.LatencyAwarePolicy;
 import com.datastax.driver.core.policies.LoadBalancingPolicy;
 import com.datastax.driver.core.policies.RoundRobinPolicy;
 import com.datastax.driver.core.policies.TokenAwarePolicy;
@@ -26,6 +27,7 @@ public class CassandraLoadBalancingPolicies {
     public final String roundRobinPolicy = "RoundRobinPolicy";
     public final String tokenAwarePolicy = "TokenAwarePolicy";
     public final String dcAwareRoundRobinPolicy = "DcAwareRoundRobinPolicy";
+    public final String latencyAwarePolicy = "LatencyAwarePolicy";
     
     public LoadBalancingPolicy getLoadBalancingPolicy(String policy) {
         LoadBalancingPolicy loadBalancingPolicy = new RoundRobinPolicy();
@@ -39,6 +41,9 @@ public class CassandraLoadBalancingPolicies {
         case dcAwareRoundRobinPolicy:
             loadBalancingPolicy = DCAwareRoundRobinPolicy.builder().build();
             break;
+        case latencyAwarePolicy:
+            loadBalancingPolicy = LatencyAwarePolicy.builder(new RoundRobinPolicy()).build();
+            break;
         default:
             throw new IllegalArgumentException("Cassandra load balancing policy can be "
+ roundRobinPolicy + " ," + tokenAwarePolicy 
                    + " ," + dcAwareRoundRobinPolicy);


Mime
View raw message