forked from apache/cassandra-gocql-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speculative query execution (apache#1178)
* Rework metrics locking * Metrics are now split into: hostMetrics - for a list of metrics queryMetrics - for a map and a locker * Added functions to perform locked metrics updates/reads * Locking is private for the metrics only, so should have no performance effects. Signed-off-by: Alex Lourie <alex@instaclustr.com> * Introduce Speculative Policy * Define the speculative policy * Add NonSpeculative policy * Add SimpleSpeculative policy Signed-off-by: Alex Lourie <alex@instaclustr.com> * Add IsIdempotent to ExecutableQuery interface Signed-off-by: Alex Lourie <alex@instaclustr.com> * Implement speculative execution * Refactor executeQuery to execute main code in a separate goroutine * Handle speculative/non-speculative cases separately * Add TestSpeculativeExecution test Signed-off-by: Alex Lourie <alex@instaclustr.com> * Review comments * Make one code path for all executions * Simplify the results handling * Update the tests Signed-off-by: Alex Lourie <alex@instaclustr.com> * More review comments * Metric lock improvements * Style cleanups Signed-off-by: Alex Lourie <alex@instaclustr.com> * Fix Latency calc lock Signed-off-by: Alex Lourie <alex@instaclustr.com> * Fix session.go for new metrics Signed-off-by: Alex Lourie <alex@instaclustr.com>
- Loading branch information
Showing
7 changed files
with
374 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.