Skip to content

Commit

Permalink
0003798: Allow a trigger router to be considered for common batches that
Browse files Browse the repository at this point in the history
sync in one direction even though ...
  • Loading branch information
chenson42 committed Nov 19, 2018
1 parent ce80314 commit 76cac1e
Showing 1 changed file with 8 additions and 6 deletions.
Expand Up @@ -589,12 +589,14 @@ protected boolean producesCommonBatches(Channel channel, String nodeGroupId, Lis
if (producesCommonBatches && triggerRouters != null) {
List<TriggerRouter> testableTriggerRouters = new ArrayList<TriggerRouter>();
for (TriggerRouter triggerRouter : triggerRouters) {
if (triggerRouter.getTrigger().getChannelId().equals(channel.getChannelId())) {
if (triggerRouter.getTrigger().getChannelId().equals(channelId)) {
testableTriggerRouters.add(triggerRouter);
} else {
/*
* Add any trigger router that is in another channel, but is
* for a table that is in the current channel
* This trigger is not on this channel. If there is
* another trigger on this channel for the same table
* AND this trigger is syncing to this node, then
* consider it to check on common batch mode
*/
String anotherChannelTableName = triggerRouter.getTrigger()
.getFullyQualifiedSourceTableName();
Expand All @@ -603,14 +605,14 @@ protected boolean producesCommonBatches(Channel channel, String nodeGroupId, Lis
.getTrigger()
.getFullyQualifiedSourceTableName();
String currentChannelId = triggerRouter2.getTrigger().getChannelId();
if (anotherChannelTableName
.equals(currentTableName) && currentChannelId.equals(channelId)) {
if (anotherChannelTableName.equals(currentTableName) && currentChannelId.equals(channelId)
&& triggerRouter.getRouter().getNodeGroupLink().getTargetNodeGroupId()
.equals(triggerRouter2.getRouter().getNodeGroupLink().getSourceNodeGroupId())) {
testableTriggerRouters.add(triggerRouter);
}
}
}
}

for (TriggerRouter triggerRouter : testableTriggerRouters) {
boolean isDefaultRouter = "default".equals(triggerRouter.getRouter().getRouterType());
/*
Expand Down

0 comments on commit 76cac1e

Please sign in to comment.