Avoid user having to call 2 APIs when using PercentileSpeculativeExecutionPolicy

Description

When user wants to use PercentileSpeculativeExecutionPolicy, 2 APIs need to be called on cluster.

cluster = Cluster.builder().withSpeculativeExecutionPolicy(policy).build();

and

cluster.register(perHostPercentileTracker);

http://docs.datastax.com/en/drivers/java/2.0/com/datastax/driver/core/PerHostPercentileTracker.html

The reason to do this way is because there may be other sub systems (such as QueryLogger) that also can register perHostPercentileTracker. Instead of user having to call 2 APIs, can the driver do some thing smart to auto register the tracker that is part of PercentileSpeculativeExecutionPolicy in case the perHostPercentileTracker is not already registered.


Resolution:
Components that use PercentileTracker instances now register them automatically, and will take care not to register them twice.

Environment

None

Pull Requests

None

Status

Assignee

Olivier Michallat

Reporter

Vishy Kasar

Labels

None

PM Priority

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Sprint

Priority

Major
Configure