Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addresses github issue #9896 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Addresses github issue #9896 #13

wants to merge 1 commit into from

Conversation

kneeraj
Copy link
Contributor

@kneeraj kneeraj commented Sep 1, 2021

  • Include 'cloud' part of the placement as well in 'topology-keys'
    property value
  • Exception handling improvements while getting a balanced connection when refreshing 'server list'.
  • Add 'debug' parameter to examples.
  • Add more debug level logs to help troubleshooting.

All Submissions:

  • [✅] Have you followed the guidelines in our Contributing document?
  • [✅] Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. [✅] Does your submission pass tests?
  2. [✅] Does mvn checkstyle:check pass ?
  3. [✅] Have you added your new test classes to an existing test suite?

Changes to Existing Features:

  • [✅] Does this break existing behaviour? If so please explain.
    The value of property 'topology-keys' has to contain 'cloud' part also. App using previous version of the driver will have to change in how they specify topology-key value. Previously it was topology-keys=region1.zone1,region1.zone2 etc and now it is topology-keys=cloud1.region1.zone1,cloud1.region1.zone2
  • [✅] Have you added an explanation of what your changes do and why you'd like us to include them?
  • [✅] Have you written new tests for your core changes, as applicable?
  • [✅] Have you successfully run tests with your changes locally?

- Include 'cloud' part of the placement as well in 'topology-keys'
property value
- Exception handling improvements while getting a balanced connection when refreshing 'server list'.
- Add 'debug' parameter to examples.
- Add more debug level logs to help troubleshooting.
// Since it is just a demo app. Using some smaller values so that it can run
// on laptop
String numConnections = "6";
String controlHost = "127.0.0.1";
String controlPort = "5433";

controlUrl = "jdbc:postgresql://" + controlHost
+ ":" + controlPort + "/yugabyte?user=yugabyte&password=yugabyte&load-balance=true&topology-keys=region1.zone1";

+ ":" + controlPort + "/yugabyte?user=yugabyte&password=yugabyte&load-balance=true&topology-keys=cloud1.region1.zone1";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assignment to controlUrl can be enclosed in else block of the if block below.

@@ -15,20 +15,27 @@
protected static String controlUrl = "";
protected static HikariDataSource hikariDataSource;
protected static Scanner scanner = new Scanner(System.in);
protected static List<Connection> borrowConnections = new ArrayList<>();
protected static List<Connection> connectionsCreatedFroamApi = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be a typo: connectionsCreatedFroamApi -> connectionsCreatedFromApi

Copy link

@ashetkar ashetkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.


+ ":" + controlPort + "/yugabyte?user=yugabyte&password=yugabyte&load-balance=true&topology-keys=cloud1.region1.zone1";
if (debugLogging) {
controlUrl = "jdbc:postgresql://" + controlHost
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: controlUrl = controlUrl + "&loggerLevel=debug";
Same in UniformLoadBalanceExample.java

Copy link
Contributor

@sanyamsinghal sanyamsinghal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants