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

Set the default loadBalance to LoadBalanceType.FALSE #23

Merged
merged 3 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ kotlin.parallel.tasks.in.project=true
# This is version for PgJdbc itself
# Note: it should not include "-SNAPSHOT" as it is automatically added by build.gradle.kts
# Release version can be generated by using -Prelease or -Prc=<int> arguments
pgjdbc.version=42.3.5-yb-7
pgjdbc.version=42.3.5-yb-8

# The options below configures the use of local clone (e.g. testing development versions)
# You can pass un-comment it, or pass option -PlocalReleasePlugins, or -PlocalReleasePlugins=<path>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ public int getRefreshListSeconds() {
protected int refreshListSeconds = LoadBalanceProperties.DEFAULT_REFRESH_INTERVAL;

public ClusterAwareLoadBalancer(LoadBalanceService.LoadBalanceType lb, int refreshInterval) {
this.loadBalance = lb;
if (lb != null) {
this.loadBalance = lb;
} else {
this.loadBalance = LoadBalanceType.FALSE;
}
this.refreshListSeconds = refreshInterval;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class LoadBalanceProperties {
new ConcurrentHashMap<>();
private final String originalUrl;
private final Properties originalProperties;
private LoadBalanceService.LoadBalanceType loadBalance;
private LoadBalanceService.LoadBalanceType loadBalance = LoadBalanceService.LoadBalanceType.FALSE;
private final String ybURL;
private String placements = null;
private int refreshInterval = -1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ public class TopologyAwareLoadBalancer implements LoadBalancer {
private byte requestFlags;

public TopologyAwareLoadBalancer(LoadBalanceType lb, String placementValues, boolean onlyExplicitFallback) {
loadBalance = lb;
if (lb != null) {
loadBalance = lb;
} else {
loadBalance = LoadBalanceType.FALSE;
}
placements = placementValues;
explicitFallbackOnly = onlyExplicitFallback;
refreshIntervalSeconds = Integer.getInteger(REFRESH_INTERVAL_KEY, DEFAULT_REFRESH_INTERVAL);
Expand Down
Loading