Skip to content

Commit

Permalink
0002665: Reduce number of times parameters are reread during startup
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Jul 2, 2016
1 parent 709c2fc commit 338745c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Expand Up @@ -409,7 +409,6 @@ public String getEngineName() {
}

public void setup() {
getParameterService().rereadParameters();
if (!setup) {
setupDatabase(false);
parameterService.setDatabaseHasBeenInitialized(true);
Expand All @@ -428,7 +427,6 @@ public void setupDatabase(boolean force) {
clusterService.init();
sequenceService.init();
autoConfigRegistrationServer();
parameterService.rereadParameters();
log.info("Done initializing SymmetricDS database");
}

Expand All @@ -438,6 +436,7 @@ protected void autoConfigRegistrationServer() {
if (node == null) {
buildTablesFromDdlUtilXmlIfProvided();
loadFromScriptIfProvided();
parameterService.rereadParameters();
}

node = nodeService.findIdentity();
Expand Down
Expand Up @@ -204,8 +204,10 @@ public String getEngineName() {
}

public void setDatabaseHasBeenInitialized(boolean databaseHasBeenInitialized) {
this.databaseHasBeenInitialized = databaseHasBeenInitialized;
this.parameters = null;
if (this.databaseHasBeenInitialized != databaseHasBeenInitialized) {
this.databaseHasBeenInitialized = databaseHasBeenInitialized;
this.parameters = null;
}
}

abstract public TypedProperties getDatabaseParameters(String externalId, String nodeGroupId);
Expand Down

0 comments on commit 338745c

Please sign in to comment.