Skip to content

Commit

Permalink
Addressed comments
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Kondaka <[email protected]>
  • Loading branch information
Krishna Kondaka committed Mar 25, 2024
1 parent 78775e1 commit e23dc67
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ public class Router {
private final RouteEventEvaluator routeEventEvaluator;
private final DataFlowComponentRouter dataFlowComponentRouter;
private final Consumer<Event> noRouteHandler;
private Set<Record> recordsUnRouted;

Router(final RouteEventEvaluator routeEventEvaluator, final DataFlowComponentRouter dataFlowComponentRouter, final Consumer<Event> noRouteHandler) {
this.routeEventEvaluator = Objects.requireNonNull(routeEventEvaluator);
this.dataFlowComponentRouter = dataFlowComponentRouter;
this.noRouteHandler = noRouteHandler;
this.recordsUnRouted = null;
}

public <C> void route(
Expand All @@ -44,7 +42,6 @@ public <C> void route(
Objects.requireNonNull(componentRecordsConsumer);

final Map<Record, Set<String>> recordsToRoutes = routeEventEvaluator.evaluateEventRoutes(allRecords);
recordsUnRouted = null;

boolean allRecordsRouted = false;

Expand All @@ -55,9 +52,7 @@ public <C> void route(
}
}

if (!allRecordsRouted) {
recordsUnRouted = new HashSet<>(allRecords);
}
final Set<Record> recordsUnRouted = (allRecordsRouted) ? null : new HashSet<>(allRecords);

for (DataFlowComponent<C> dataFlowComponent : dataFlowComponents) {
dataFlowComponentRouter.route(allRecords, dataFlowComponent, recordsToRoutes, getRecordStrategy, (component, records) -> {
Expand Down

0 comments on commit e23dc67

Please sign in to comment.