@Override public final void onTrigger(final ProcessContext context, final ProcessSessionFactory sessionFactory) throws ProcessException { final ProcessSession session = sessionFactory.createSession(); try { onTrigger(context, session); session.commit(); } catch (final Throwable t) { session.rollback(true); throw t; } }
@Override public void yield() { if (processContext != null) { processContext.yield(); } }
private FlowFile transferToFailure(final ProcessSession processSession, FlowFile flowfile, final String value) { flowfile = processSession.putAttribute(flowfile, ATTR_WS_FAILURE_DETAIL, value); processSession.transfer(flowfile, REL_FAILURE); return flowfile; }
/** * Returns a ProvenanceReporter that is tied to this ProcessSession. * * @return the provenance reporter */ @Override public ProvenanceReporter getProvenanceReporter() { return s.getProvenanceReporter(); }
@Override public Builder setRelationship(Relationship relationship) { this.relationship = relationship.getName(); return this; }
@Override protected void init(final ProcessorInitializationContext context) { kerberosServicePrincipal = context.getKerberosServicePrincipal(); kerberosConfigFile = context.getKerberosConfigurationFile(); kerberosServiceKeytab = context.getKerberosServiceKeytab(); }
/** * @return the QueueSize that represents the number of FlowFiles and their combined data size for all FlowFiles waiting to be processed by the Processor that owns this ProcessSession, regardless * of which Connection the FlowFiles live on */ @Override public QueueSize getQueueSize() { return s.getQueueSize(); }
@Override public Map<PropertyDescriptor, String> getProperties() { verifyTaskActive(); return properties; }
@Override public double convert(double sourceSize, DataUnit sourceUnit) { return sourceUnit.toB(sourceSize); } },
@Override public double convert(double sourceSize, DataUnit sourceUnit) { return sourceUnit.toGB(sourceSize); } },
@Override public double convert(double sourceSize, DataUnit sourceUnit) { return sourceUnit.toMB(sourceSize); } },
@Override public ValidationContext newValidationContext(final Set<String> serviceIdentifiersToNotValidate, final Map<PropertyDescriptor, String> properties, final String annotationData, final String groupId, String componentId) { return new StandardValidationContext(serviceProvider, serviceIdentifiersToNotValidate, properties, annotationData, groupId, componentId,variableRegistry); } }
@Override public double convert(double sourceSize, DataUnit sourceUnit) { return sourceUnit.toKB(sourceSize); } },
@Override public double convert(double sourceSize, DataUnit sourceUnit) { return sourceUnit.toTB(sourceSize); } };
@Override public void yield() { if (processContext != null) { processContext.yield(); } }
@Override public StateManager getStateManager() { verifyTaskActive(); return stateManager; }
@Override public void yield() { if (processContext != null) { processContext.yield(); } }