Skip to content

Commit

Permalink
Adding db pool config to settings, in earlier commit default was set …
Browse files Browse the repository at this point in the history
…to 10 form 100
  • Loading branch information
dileepbapat committed Jan 13, 2022
1 parent 37addbf commit f9a2662
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class DBConnectionInfo {
private String uri;
private String username;
private String password;
private int maxPoolSize;
private boolean profilerEnabled = false;

public String getShardId() {
Expand Down Expand Up @@ -57,4 +58,11 @@ public void setShardLabel(String shardLabel) {
this.shardLabel = shardLabel;
}

public int getMaxPoolSize() {
return maxPoolSize;
}

public void setMaxPoolSize(int maxPoolSize) {
this.maxPoolSize = maxPoolSize;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ default SearchQuery getSearchQuery(JsonNode inputQueryNode, int offset, int limi
searchQuery.setLimit(inputQueryNode.get("limit").asInt());
searchQuery.setOffset(inputQueryNode.get("offset").asInt());
} catch (Exception e) {
logger.error("Populates SearchQuery for limit/offset(optional): {}", e.getMessage());
logger.warn("Populates SearchQuery for limit/offset(optional): {}", e.getMessage());
}

searchQuery.setFilters(filterList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public SqlgProvider(DBConnectionInfo connectionInfo, String uuidPropertyName) {
config.setProperty("jdbc.url", connectionInfo.getUri());
config.setProperty("jdbc.username", connectionInfo.getUsername());
config.setProperty("jdbc.password", connectionInfo.getPassword());
config.setProperty("maxPoolSize", 10);
config.setProperty("maxPoolSize", connectionInfo.getMaxPoolSize());
setProvider(Constants.GraphDatabaseProvider.SQLG);
setUuidPropertyName(uuidPropertyName);
graph = SqlgGraph.open(config);
Expand Down
1 change: 1 addition & 0 deletions java/registry/src/main/resources/application.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ database:

username: ${connectionInfo_username:postgres}
password: ${connectionInfo_password:postgres}
maxPoolSize: ${connectionInfo_maxPoolSize:100}

# Any other shard information follows...
#-
Expand Down

0 comments on commit f9a2662

Please sign in to comment.