Uploaded image for project: 'Apache Nemo'
  1. Apache Nemo
  2. NEMO-238

Optimize processElement in TaskExecutor

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.1
    • 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

          Activity

            People

              Unassigned Unassigned
              taegeonum Tae-Geon Um
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: