taegeonum commented on a change in pull request #131: [Nemo-238] Optimize
processElement in TaskExecutor
URL: https://github.com/apache/incubator-nemo/pull/131#discussion_r228419931
##########
File path:
runtime/executor/src/main/java/org/apache/nemo/runtime/executor/task/TaskExecutor.java
##########
@@ -234,23 +235,9 @@ public TaskExecutor(final Task task,
/**
* Process a data element down the DAG dependency.
- *
- * @param vertexHarness VertexHarness of a vertex to execute.
- * @param dataElement input data element to process.
*/
- 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");
- }
+ private void processElement(final OutputCollector outputCollector, final
Object dataElement) {
Review comment:
@johnyangk I think it would be good to leave this method because the name is
explicit
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services