Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
TaskExecutor checks every source element and branches them according to the type of the first IR vertex.
private void processElement(final VertexHarness vertexHarness, final Object dataElement) { final IRVertex irVertex = vertexHarness.getIRVertex(); final OutputCollector outputCollector = vertexHarness.getOutputCollector(); // TODO #XXX: optimize processElement (do not check instanceof for each data element) if (irVertex instanceof SourceVertex) { outputCollector.emit(dataElement); } else if (irVertex instanceof OperatorVertex) { final Transform transform = ((OperatorVertex) irVertex).getTransform(); transform.onData(dataElement); } else { throw new UnsupportedOperationException("This type of IRVertex is not supported"); } }
We can remove this checking because the IRvertex is determined statically and does not change.
Attachments
Issue Links
- is caused by
-
NEMO-235 Refactor TaskExecutor's data processing logic
- Resolved