@Override protected Set<StepField> getUsedFields( final JsonInputMeta meta ) { Set<StepField> usedFields = new HashSet<>(); if ( meta.isAcceptingFilenames() && StringUtils.isNotEmpty( meta.getAcceptingField() ) ) { final Set<String> inpusStepNames = getInputStepNames( meta, meta.getAcceptingField() ); for ( final String inpusStepName : inpusStepNames ) { final StepField stepField = new StepField( inpusStepName, meta.getAcceptingField() ); usedFields.add( stepField ); } } return usedFields; }
@Override public Set<ComponentDerivationRecord> getChangeRecords( GetXMLDataMeta meta ) throws MetaverseAnalyzerException { Set<ComponentDerivationRecord> changes = new HashSet<>(); boolean isInFields = meta.isInFields(); boolean isAFile = meta.getIsAFile(); boolean isAUrl = meta.isReadUrl(); // if we are getting xml from a field, we need to add the "derives" links from the xml to the output fields if ( isInFields && !isAFile && !isAUrl ) { GetXMLDataField[] fields = baseStepMeta.getInputFields(); if ( getInputs() != null ) { Set<StepField> inputFields = getInputs().getFieldNames(); for ( StepField inputField : inputFields ) { if ( inputField.getFieldName().equals( meta.getXMLField() ) ) { // link this to all of the outputs that come from the xml for ( GetXMLDataField field : fields ) { ComponentDerivationRecord change = new ComponentDerivationRecord( meta.getXMLField(), field.getName() ); changes.add( change ); } break; } } } } return changes; }
HashSet<StepField> stepFields = new HashSet<>(); for ( KafkaConsumerField.Name kafkaField : KafkaConsumerField.Name.values() ) { stepFields.add( new StepField( RESOURCE, kafkaField.toString() ) ); IMetaverseNode inputNode = this.getInputs().findNode( stepField ); String outputName = baseStepMeta.getFieldDefinitions().stream() .filter( kcf -> kcf.getKafkaName().toString().equals( stepField.getFieldName() ) ) .map( KafkaConsumerField::getOutputName ) .findFirst().orElse( "" );
@Override public Set<ComponentDerivationRecord> getChangeRecords( KafkaProducerOutputMeta meta ) { LinkedHashSet<ComponentDerivationRecord> changes = new LinkedHashSet<>(); Set<String> stepNames = getInputs().getStepNames(); for ( String stepName : stepNames ) { changes.add( new ComponentDerivationRecord( new StepField( stepName, meta.getKeyField() ), new StepField( RESOURCE, KEY ) ) ); changes.add( new ComponentDerivationRecord( new StepField( stepName, meta.getMessageField() ), new StepField( RESOURCE, MESSAGE ) ) ); } return changes; }
@Override protected Set<StepField> getUsedFields( KafkaProducerOutputMeta meta ) { LinkedHashSet<StepField> usedFields = new LinkedHashSet<>(); Set<String> stepNames = getInputs().getStepNames(); for ( String stepName : stepNames ) { if ( meta.getKeyField() != null ) { usedFields.add( new StepField( stepName, meta.getKeyField() ) ); } if ( meta.getMessageField() != null ) { usedFields.add( new StepField( stepName, meta.getMessageField() ) ); } } return usedFields; }