public interface Triggerable
Modifier and Type | Field and Description |
---|---|
static long |
MINIMUM_SCHEDULING_NANOS |
Modifier and Type | Method and Description |
---|---|
int |
getMaxConcurrentTasks() |
ScheduledState |
getScheduledState()
Indicates the
ScheduledState of this Triggerable . |
String |
getSchedulingPeriod() |
long |
getSchedulingPeriod(TimeUnit timeUnit) |
boolean |
isRunning()
Indicates whether or not this
Triggerable is "running". |
void |
onTrigger(ProcessContext context,
ProcessSessionFactory sessionFactory)
The method called when this processor is triggered to operate by the
controller.
|
void |
setMaxConcurrentTasks(int taskCount)
Determines the number of concurrent tasks that may be running for this
Triggerable . |
void |
setScheduldingPeriod(String schedulingPeriod)
Updates how often this Triggerable should be triggered to run
|
static final long MINIMUM_SCHEDULING_NANOS
void onTrigger(ProcessContext context, ProcessSessionFactory sessionFactory) throws ProcessException
The method called when this processor is triggered to operate by the controller. This method may be called concurrently from different threads. When this method is called depends on how this processor is configured within a controller to be triggered (timing or event based).
The processor may commit, roll back, or allow the framework to automatically manage the session. If the sessions are to be managed by the framework (recommended) then what it will do depends on several factors. If the method call returns due to an exception then the session will be rolled back. If the method returns normally then the session will be committed or the framework may use the session again for another processor down stream
context
- in which the component is triggeredsessionFactory
- used to generate ProcessSession
s to use for
operating on flow files within the repositoryProcessException
- if processing did not complete normally though
indicates the problem is an understood potential outcome of processing.
The controller/caller will handle these exceptions gracefully such as
logging, etc.. If another type of exception is allowed to propagate the
controller may no longer trigger this processor to operate as this would
indicate a probable coding defect.void setMaxConcurrentTasks(int taskCount)
Triggerable
.taskCount
- a number of concurrent tasks this processor may have
runningIllegalArgumentException
- if the given value is less than 1int getMaxConcurrentTasks()
Triggerable
.ScheduledState getScheduledState()
ScheduledState
of this Triggerable
. A
value of stopped does NOT indicate that the Triggerable
has
no active threads, only that it is not currently scheduled to be given
any more threads. To determine whether or not the
Triggerable
has any active threads, see
ProcessScheduler#getActiveThreadCount(nifi.connectable.Connectable)
.boolean isRunning()
Triggerable
is "running". It
is considered "running" if it is scheduled to run OR if it is no longer
scheduled to be given threads but the remaining threads from the last
invocation of onTrigger(ProcessContext, ProcessSessionFactory)
have not yet returnedlong getSchedulingPeriod(TimeUnit timeUnit)
timeUnit
- for the scheduling period of the componentString getSchedulingPeriod()
void setScheduldingPeriod(String schedulingPeriod)
schedulingPeriod
- to setCopyright © 2016 Apache NiFi Project. All rights reserved.