Hello Olivier,

    Thank you so much for your reply. However, the new TokenAwarePolicy wrapped 
with DCAwareRoundRobin definitely works. Also wrapping with RoundRobin policy 
works. However, when I use LatencyAwarePolicy wrapping with DCAwareRoundRobin 
and RoundRobin. It shows error.

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
        The constructor LatencyAwarePolicy(LoadBalancingPolicy, double, long, 
long, long, int) is not visible

        at PreparedStatementsClient.connect(PreparedStatementsClient.java:27)
        at PreparedStatementsClient.main(PreparedStatementsClient.java:84)

where the code is 
cluster = Cluster.builder().addContactPoint(node)
        .withLoadBalancingPolicy(new LatencyAwarePolicy(new 
DCAwareRoundRobinPolicy(), 0, 0, 0, 0, 0))
        .build();

for the last five 0s, I have to add them, according to the code in java driver:
 private LatencyAwarePolicy(LoadBalancingPolicy childPolicy,
double exclusionThreshold,
long scale,
long retryPeriod,
long updateRate,
int minMeasure)


    From the explanation in datastax java driver, DCAwareRoundRobin and 
RoundRobin policies implement closeableLoadBalancing policy, while LatencyAware 
and TokenAware and WhiteList policies implement chainableloadbalancing policy, 
which means these three needs to warp child policy to get distance and other 
information.

    What I want to dig is to try LatancyAware and TokenAware wrapping with 
DCAwareRoundRobin (in multi Data center) and RoundRobin(in single data center) 
policy and test the different performance, such as read latency, write latency, 
etc.

    Do you have any suggestions on it?

    Thanks!

Jun

    
> On Oct 2, 2015, at 13:44, Olivier Michallat <olivier.michal...@datastax.com> 
> wrote:
> 
> Hi,
> 
> I'm not sure if I understand your question correctly, but existing policies
> can be combined by chaining them, as in `new TokenAwarePolicy(new
> DCAwareRoundRobinPolicy())`.
> 
> --
> 
> Olivier Michallat
> 
> Driver & tools engineer, DataStax
> 
> On Tue, Sep 22, 2015 at 7:15 PM, Jun Wu <wuxiaomi...@hotmail.com> wrote:
> 
>> Dear All,
>> 
>> 
>> 
>>    I’m doing some experiment on load balancing policy of Cassandra
>> (version 2.1.8) and I’m using datastax java driver (version 2.1.7).
>> Basically, I want test the reading and writing latency or other performance
>> metrics (I’m not sure which more could be available. If possible, could
>> someone give me some hints?), using different load balancing policies. The
>> default policy should be tokenaware wrapped with dcawareroundrobin.
>> However, there’ll be more like latencyaware and roundrobin. I know
>> dcawareroundrobin and roundrobin are suitable for multi-DC and single DC.
>> I’d like to know how to combine different policies to get different
>> results. Currently I’ve deployed Cassandra in Amazon EC2 in single region
>> and multiple region. And I’ve used maven to work on java driver on one of
>> the ec2 instance and write different number of rows, ranging from 1000 to
>> 10000, 1000000, 1000000 with the default policy. But I don’t know how to
>> wrap different policies.
>> 
>> 
>> 
>>    Anyone could give some hints?
>> 
>> 
>> 
>>    Thanks!
>> 
>> 
>> 
>> Steven
>> 

Reply via email to