This tool was tested only with driver version 3.4. This means your application should be using driver version 3.4 to allow the tool to work correctly. The tool may compile and work with other driver version but you have to test it yourself to make sure everything is ok.
The usage is very simple. Having a
Cluster.Builder, we pass it to
ClusterOptimizer.buildWithPagingOptimized instead of calling
.build() on it.
Cluster.Builder builder = ... Cluster cluster = ClusterOptimizer.buildWithPagingOptimized(builder);
This will make sure that when a query results in multiple pages then all of those pages are obtained from the same node (if possible). This makes locality of the query much better and allows better usage of caches.
Instumenting existing application
If you can't or don't want to modify your code, you can use a java agent that will instrument your existing code and apply the same optimization as if you had changed all invocations of
To instrument your application you need to run it with the following command:
JAVA_TOOL_OPTIONS="-javaagent:<path to scylla-java-driver-tools-agent-1.0.0-jar-with-dependencies.jar>" <command starting your application>
Copyright (C) 2018 ScyllaDB
This project is distributed under the Apache 2.0 license. See the LICENSE file for details. It contains software from:
- datastax java-driver project, licensed under the Apache License Version 2.0 license
Apache®, Apache Cassandra®, are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries. No endorsement by The Apache Software Foundation is implied by the use of these marks.