Skip to content

add support for acquireHostListInterval #280

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

Merged
merged 2 commits into from
Jul 19, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions src/main/java/com/arangodb/ArangoDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,18 @@ public Builder acquireHostList(final Boolean acquireHostList) {
setAcquireHostList(acquireHostList);
return this;
}

/**
* Setting the Interval for acquireHostList
*
* @param acquireHostListInterval Interval in Seconds
*
* @return {@link ArangoDB.Builder}
*/
public Builder acquireHostListInterval(final Integer acquireHostListInterval) {
setAcquireHostListInterval(acquireHostListInterval);
return this;
}

/**
* Sets the load balancing strategy to be used in an ArangoDB cluster setup.
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/com/arangodb/internal/InternalArangoDBBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,22 @@ public InternalArangoDBBuilder() {
}

public InternalArangoDBBuilder loadProperties(final InputStream in) throws ArangoDBException {

final Properties properties = new Properties();

if (in != null) {
final Properties properties = new Properties();

try {
properties.load(in);
loadProperties(properties);
} catch (final IOException e) {
throw new ArangoDBException(e);
}
}

loadProperties(properties);

return this;

}

protected void loadProperties(final Properties properties) {
Expand Down Expand Up @@ -185,6 +191,10 @@ protected void setAcquireHostList(final Boolean acquireHostList) {
this.acquireHostList = acquireHostList;
}

protected void setAcquireHostListInterval(final Integer acquireHostListInterval) {
this.acquireHostListInterval = acquireHostListInterval;
}

protected void setLoadBalancingStrategy(final LoadBalancingStrategy loadBalancingStrategy) {
this.loadBalancingStrategy = loadBalancingStrategy;
}
Expand Down