Search in sources :

Example 1 with LINK_OUTPUTS

use of org.pentaho.dictionary.DictionaryConst.LINK_OUTPUTS in project pentaho-metaverse by pentaho.

the class AnnotationDrivenStepMetaAnalyzer method getOutputRowMetaInterfaces.

/**
 * Adds any linked resource nodes to the output row meta.
 * Applicable to something like a Message field being sent to an external queue.
 */
@Override
protected Map<String, RowMetaInterface> getOutputRowMetaInterfaces(BaseStepMeta meta) {
    Map<String, RowMetaInterface> rowMetas = super.getOutputRowMetaInterfaces(meta);
    AnnotatedClassFields nodeTree = new AnnotatedClassFields(meta);
    RowMeta resourceRowMeta = new RowMeta();
    new AnnotatedClassFields(meta).links().filter(field -> nodeTree.node(field.annotation.nodeName()).get().annotation.link().equals(LINK_OUTPUTS)).forEach(field -> resourceRowMeta.addValueMeta(new ValueMetaNone(field.name)));
    if (resourceRowMeta.size() > 0) {
        rowMetas.put(RESOURCE, resourceRowMeta);
    }
    return rowMetas;
}
Also used : RowMeta(org.pentaho.di.core.row.RowMeta) KettleAnalyzerUtil(org.pentaho.metaverse.api.analyzer.kettle.KettleAnalyzerUtil) KettleException(org.pentaho.di.core.exception.KettleException) IMetaverseNode(org.pentaho.metaverse.api.IMetaverseNode) Messages(org.pentaho.metaverse.api.messages.Messages) SubtransAnalyzer(org.pentaho.metaverse.api.analyzer.kettle.step.SubtransAnalyzer) LoggerFactory(org.slf4j.LoggerFactory) StepField(org.pentaho.metaverse.api.StepField) LINK_OUTPUTS(org.pentaho.dictionary.DictionaryConst.LINK_OUTPUTS) TransExecutorMeta(org.pentaho.di.trans.steps.transexecutor.TransExecutorMeta) MetaverseComponentDescriptor(org.pentaho.metaverse.api.MetaverseComponentDescriptor) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) PROPERTY_TYPE(org.pentaho.dictionary.DictionaryConst.PROPERTY_TYPE) StepWithMappingMeta(org.pentaho.di.trans.StepWithMappingMeta) TransMeta(org.pentaho.di.trans.TransMeta) Collectors.toMap(java.util.stream.Collectors.toMap) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) StepNodes(org.pentaho.metaverse.api.analyzer.kettle.step.StepNodes) VariableSpace(org.pentaho.di.core.variables.VariableSpace) StepAnalyzer(org.pentaho.metaverse.api.analyzer.kettle.step.StepAnalyzer) Collectors.toSet(java.util.stream.Collectors.toSet) Logger(org.slf4j.Logger) DictionaryHelper(org.pentaho.dictionary.DictionaryHelper) ValueMetaNone(org.pentaho.di.core.row.value.ValueMetaNone) Set(java.util.Set) BaseStreamStepMeta(org.pentaho.di.trans.streaming.common.BaseStreamStepMeta) Collectors(java.util.stream.Collectors) ISubTransAwareMeta(org.pentaho.di.trans.ISubTransAwareMeta) IClonableStepAnalyzer(org.pentaho.metaverse.api.analyzer.kettle.step.IClonableStepAnalyzer) List(java.util.List) MetaverseAnalyzerException(org.pentaho.metaverse.api.MetaverseAnalyzerException) Optional(java.util.Optional) BaseStepMeta(org.pentaho.di.trans.step.BaseStepMeta) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Direction(com.tinkerpop.blueprints.Direction) Collections(java.util.Collections) Arrays.stream(java.util.Arrays.stream) RESOURCE(org.pentaho.metaverse.api.analyzer.kettle.step.ExternalResourceStepAnalyzer.RESOURCE) ValueMetaNone(org.pentaho.di.core.row.value.ValueMetaNone) RowMeta(org.pentaho.di.core.row.RowMeta) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Direction (com.tinkerpop.blueprints.Direction)1 Arrays.asList (java.util.Arrays.asList)1 Arrays.stream (java.util.Arrays.stream)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Collectors.toMap (java.util.stream.Collectors.toMap)1 Collectors.toSet (java.util.stream.Collectors.toSet)1 KettleException (org.pentaho.di.core.exception.KettleException)1 RowMeta (org.pentaho.di.core.row.RowMeta)1 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)1 ValueMetaNone (org.pentaho.di.core.row.value.ValueMetaNone)1 VariableSpace (org.pentaho.di.core.variables.VariableSpace)1 ISubTransAwareMeta (org.pentaho.di.trans.ISubTransAwareMeta)1 StepWithMappingMeta (org.pentaho.di.trans.StepWithMappingMeta)1 TransMeta (org.pentaho.di.trans.TransMeta)1