Skip to content

Commit

Permalink
Merge branch '3.8' of https://github.com/JumpMind/symmetric-ds.git in…
Browse files Browse the repository at this point in the history
…to 3.8
  • Loading branch information
chenson42 committed Jun 13, 2017
2 parents b955d35 + b704508 commit 8146557
Showing 1 changed file with 13 additions and 0 deletions.
Expand Up @@ -95,6 +95,9 @@ public class ConfigurationChangedDataRouter extends AbstractDataRouter implement

final String CTX_KEY_FLUSHED_TRIGGER_ROUTERS = "FlushedTriggerRouters."
+ ConfigurationChangedDataRouter.class.getSimpleName() + hashCode();

final String CTX_KEY_FLUSH_NODE_GROUP_LINK_NEEDED = "FlushNodeGroupLink."
+ ConfigurationChangedDataRouter.class.getSimpleName() + hashCode();

public final static String KEY = "symconfig";

Expand Down Expand Up @@ -239,6 +242,10 @@ public Set<String> routeToNodes(SimpleRouterContext routingContext, DataMetaData
if (tableMatches(dataMetaData, TableConstants.SYM_NOTIFICATION)) {
routingContext.put(CTX_KEY_FLUSH_NOTIFICATIONS_NEEDED, Boolean.TRUE);
}

if (tableMatches(dataMetaData, TableConstants.SYM_NODE_GROUP_LINK)) {
routingContext.put(CTX_KEY_FLUSH_NODE_GROUP_LINK_NEEDED, Boolean.TRUE);
}
}
}

Expand Down Expand Up @@ -633,6 +640,12 @@ public void contextCommitted(SimpleRouterContext routingContext) {
log.info("About to refresh the cache of node security because new configuration came through the data router");
engine.getNodeService().flushNodeAuthorizedCache();
}

if (routingContext.get(CTX_KEY_FLUSH_NODE_GROUP_LINK_NEEDED) != null) {
log.info("About to refresh the cache of node group link because new configuration came through the data router");
engine.getConfigurationService().clearCache();
engine.getNodeService().flushNodeGroupCache();
}

}
}
Expand Down

0 comments on commit 8146557

Please sign in to comment.