Package org.apache.nifi.processor
Interface ProcessContext
- All Superinterfaces:
ClusterContext
,PropertyContext
Provides a bridge between a Processor and the NiFi Framework
Note: Implementations of this interface are NOT necessarily thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptionint
getName()
getProperty
(String propertyName) Retrieves the current value set for the given descriptor, if a value is set - else uses the descriptor to determine the appropriate default valueint
boolean
hasConnection
(Relationship relationship) boolean
boolean
boolean
boolean
isRelationshipRetried
(Relationship relationship) newPropertyValue
(String rawValue) Creates and returns aPropertyValue
object that can be used for evaluating the value of the given Stringvoid
yield()
Causes the Processor not to be scheduled for some pre-configured amount of time.Methods inherited from interface org.apache.nifi.context.ClusterContext
isConnectedToCluster
Methods inherited from interface org.apache.nifi.context.PropertyContext
getAllProperties, getProperty
-
Method Details
-
getProperty
Retrieves the current value set for the given descriptor, if a value is set - else uses the descriptor to determine the appropriate default value- Parameters:
propertyName
- of the property to lookup the value for- Returns:
- property value as retrieved by property name
-
newPropertyValue
Creates and returns aPropertyValue
object that can be used for evaluating the value of the given String- Parameters:
rawValue
- the raw input before any property evaluation has occurred- Returns:
- a
PropertyValue
object that can be used for evaluating the value of the given String
-
yield
void yield()Causes the Processor not to be scheduled for some pre-configured amount of time. The duration of time for which the processor will not be scheduled is configured in the same manner as the processor's scheduling period.
Note: This is NOT a blocking call and does not suspend execution of the current thread.
-
getMaxConcurrentTasks
int getMaxConcurrentTasks()- Returns:
- the maximum number of threads that may be executing this processor's code at any given time
-
getExecutionNode
ExecutionNode getExecutionNode()- Returns:
- the Nodes where this processor will be scheduled to run.
-
getAnnotationData
String getAnnotationData()- Returns:
- the annotation data configured for this processor
-
getProperties
Map<PropertyDescriptor,String> getProperties()- Returns:
- a Map of all PropertyDescriptors to their configured values. This Map may or may not be modifiable, but modifying its values will not change the values of the processor's properties
-
getControllerServiceLookup
ControllerServiceLookup getControllerServiceLookup()- Returns:
- a
ControllerServiceLookup
that can be used to obtain a Controller Service
-
getAvailableRelationships
Set<Relationship> getAvailableRelationships()- Returns:
- the set of all relationships for which space is available to receive new objects
-
hasIncomingConnection
boolean hasIncomingConnection()- Returns:
- true if the processor has one or more incoming connections, false otherwise
-
hasNonLoopConnection
boolean hasNonLoopConnection()- Returns:
true
if the processor has one or more incoming connections for which the source of the connection is NOT the processor; returnsfalse
if the processor has no incoming connections or if all incoming connections are self-loops (i.e., the processor is also the source of all incoming connections).
-
hasConnection
- Parameters:
relationship
- a relationship to check for connections- Returns:
- true if the relationship has one or more outbound connections, false otherwise
-
isExpressionLanguagePresent
- Parameters:
property
- the Property whose value should be inspected to determined if it contains an Expression Language Expression- Returns:
true
if the value of the given Property contains a NiFi Expression Language Expression,false
if it does not. Note thatfalse
will be returned if the Property Descriptor does not allow the Expression Language, even if a seemingly valid Expression is present in the value.
-
getStateManager
StateManager getStateManager()- Returns:
- the StateManager that can be used to store and retrieve state for this component
-
getName
String getName()- Returns:
- the configured name of this processor
-
isRelationshipRetried
- Returns:
- the configured relationships to be retried of this processor
-
getRetryCount
int getRetryCount()- Returns:
- the max number of times that the Processor will retry a FlowFile that is routed to a Relationship that is marked for Retry
-