Skip to content

Commit

Permalink
0004346: detect collision only for common group mode
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Apr 21, 2020
1 parent 6b8c92f commit 88428e7
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -948,7 +948,7 @@ protected int insertDataEvents(ProcessInfo processInfo, ChannelRouterContext con
Map<String, OutgoingBatch> batches = null;
long loadId = -1;
boolean dataEventAdded = false;
boolean firstTimeForGroup = false;
boolean detectGroupCollision = false;
int numberOfDataEventsInserted = 0;
final List<OutgoingBatch> batchesToInsert = new ArrayList<OutgoingBatch>();
final List<OutgoingBatch> batchesToRoute = new ArrayList<OutgoingBatch>();
Expand All @@ -968,7 +968,8 @@ protected int insertDataEvents(ProcessInfo processInfo, ChannelRouterContext con
if (batches == null) {
batches = new HashMap<String, OutgoingBatch>();
batchesByGroups.put(groupKey, batches);
firstTimeForGroup = true;
} else {
detectGroupCollision = true;
}
} else {
batches = context.getBatchesByNodes();
Expand Down Expand Up @@ -1007,7 +1008,7 @@ protected int insertDataEvents(ProcessInfo processInfo, ChannelRouterContext con
nodeId, batch.getChannelId(), batches.values());
}

if (useCommonMode && !firstTimeForGroup) {
if (detectGroupCollision) {
throw new CommonBatchCollisionException("Collision detected for group " + nodeIds.hashCode()
+ " when routing nodes " + nodeIds);
}
Expand Down

0 comments on commit 88428e7

Please sign in to comment.