/** * Inherits the attributes from the given source flow file into another flow * file. The UUID of the source becomes the parent UUID of this flow file. * If a parent uuid had previously been established it will be replaced by * the uuid of the given source * * @param source the FlowFile from which to copy attributes * @param destination the FlowFile to which to copy attributes */ private FlowFile inheritAttributes(final FlowFile source, final FlowFile destination) { if (source == null || destination == null || source == destination) { return destination; // don't need to inherit from ourselves } final FlowFile updated = putAllAttributes(destination, source.getAttributes()); getProvenanceReporter().fork(source, Collections.singletonList(updated)); return updated; }
final FlowFile updated = putAllAttributes(destination, intersectAttributes(sources)); getProvenanceReporter().join(sources, updated); return updated;
@Override public MockFlowFile enqueue(final InputStream data, final Map<String, String> attributes) { final MockProcessSession session = new MockProcessSession(new SharedSessionState(processor, idGenerator), processor, enforceReadStreamsClosed); MockFlowFile flowFile = session.create(); flowFile = session.importFrom(data, flowFile); flowFile = session.putAllAttributes(flowFile, attributes); enqueue(flowFile); return flowFile; }
/** * Inherits the attributes from the given source flow file into another flow * file. The UUID of the source becomes the parent UUID of this flow file. * If a parent uuid had previously been established it will be replaced by * the uuid of the given source * * @param source the FlowFile from which to copy attributes * @param destination the FlowFile to which to copy attributes */ private FlowFile inheritAttributes(final FlowFile source, final FlowFile destination) { if (source == null || destination == null || source == destination) { return destination; // don't need to inherit from ourselves } final FlowFile updated = putAllAttributes(destination, source.getAttributes()); getProvenanceReporter().fork(source, Collections.singletonList(updated)); return updated; }
final FlowFile updated = putAllAttributes(destination, intersectAttributes(sources)); getProvenanceReporter().join(sources, updated); return updated;
@Override public MockFlowFile enqueue(final InputStream data, final Map<String, String> attributes) { final MockProcessSession session = new MockProcessSession(new SharedSessionState(processor, idGenerator), processor, enforceReadStreamsClosed); MockFlowFile flowFile = session.create(); flowFile = session.importFrom(data, flowFile); flowFile = session.putAllAttributes(flowFile, attributes); enqueue(flowFile); return flowFile; }