Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-542

Decide whether ComponentDefinition.getRuntimeInfo() should return null or throw exception in case of wrong connector/engine is passed

Apply templateInsert Lucidchart Diagram
    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Major
    • 0.24.0
    • None
    • None
    • None
    • All
    • Hide

      no more relevant

      Show
      no more relevant
    • Small

    Description

      Current javadoc is following

      /**
           * this will create the runtime the information required for running the component. They can depend an the given
           * <code>properties</code> parameter and the connector topology. The <code>connectorTopology</code> shall be one of
           * supported topologies returned by {@link #getSupportedConnectorTopologies()}
           *
           * @param engine the engine to get a runtime for.
           * @param properties may be used to compute the runtime dependencies or class, may be null.
           * @param connectorTopology the topology of connectors you want to get the Runtime from.
           * 
           * @return the runtime information related to this component and <code>connectorTopology</code>. Should return null if the
           *         <code>componentType</code> is not par of the supported types returned by {@link #getSupportedConnectorTopologies()}
           */
      

      However suggested default implementation is following

          @Override
          public RuntimeInfo getRuntimeInfo(ExecutionEngine engine, ComponentProperties properties, ConnectorTopology connectorTopology) {
              assertEngineCompatibility(engine);
              assertConnectorTopologyCompatibility(connectorTopology);
              return RuntimeInfoProvider.provideInputRuntimeInfo();
          }
      

      This implementation throws exception if wrong engine or connectorTopology is passed.
      Example:

      org.talend.daikon.exception.TalendRuntimeException: WRONG_CONNECTOR:{component=TableInput}
      	at org.talend.daikon.exception.TalendRuntimeException$TalendRuntimeExceptionBuilder.create(TalendRuntimeException.java:304)
      	at org.talend.daikon.exception.TalendRuntimeException$TalendRuntimeExceptionBuilder.throwIt(TalendRuntimeException.java:290)
      	at org.talend.components.api.component.AbstractComponentDefinition.throwIncompatibleConnectorTopologyException(AbstractComponentDefinition.java:118)
      	at org.talend.components.api.component.AbstractComponentDefinition.assertConnectorTopologyCompatibility(AbstractComponentDefinition.java:109)
      	at org.talend.components.table.ttableinput.TableInputDefinition.getRuntimeInfo(TableInputDefinition.java:69)
              ...
      
      

      It is supposed that client code calls
      getSupportedConnectorTopologies()
      getSupportedExecutionEngines()

      before calling
      getRuntimeInfo()

      This issue is to decide which approach is correct and modify code according it.

      Attachments

        Activity

          People

            igonchar Ivan Gonchar
            igonchar Ivan Gonchar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m