Package org.apache.nifi.connectable
Class LocalPort
java.lang.Object
org.apache.nifi.controller.AbstractPort
org.apache.nifi.connectable.LocalPort
- All Implemented Interfaces:
Authorizable,ComponentAuthorizable,VersionedComponent,Connectable,Port,Positionable,Triggerable,GroupedComponent
Provides a mechanism by which
FlowFiles can be transferred into and out of a ProcessGroup to and/or from another ProcessGroup within the same instance of
NiFi.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.slf4j.Loggerprivate final intprivate final Lockprivate final ReadWriteLockprivate final LockFields inherited from class org.apache.nifi.controller.AbstractPort
PORT_RELATIONSHIPFields inherited from interface org.apache.nifi.controller.Triggerable
MINIMUM_SCHEDULING_NANOS -
Constructor Summary
ConstructorsConstructorDescriptionLocalPort(String id, String name, ConnectableType type, ProcessScheduler scheduler, int maxConcurrentTasks, int maxBatchSize, String boredYieldDuration) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnection(Connection connection) getConnections(org.apache.nifi.processor.Relationship relationship) org.apache.nifi.scheduling.SchedulingStrategybooleanprivate booleanprivate booleanAn Outbound Connection is required for a Local Port unless all of the following conditions are met:booleanprivate booleanbooleanbooleanisValid()voidonTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) voidremoveConnection(Connection connection) toString()private voidtransferInputBatch(org.apache.nifi.processor.ProcessSession session) private voidtransferSingleFlowFile(org.apache.nifi.processor.ProcessSession session) protected voidtransferUnboundedConcurrency(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) private voidtriggerInputPort(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) private voidtriggerOutputPort(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) voidupdateConnection(Connection connection) Methods inherited from class org.apache.nifi.controller.AbstractPort
disable, enable, evaluateParameters, getBackoffMechanism, getComments, getConnectableType, getIdentifier, getMaxBackoffPeriod, getMaxConcurrentTasks, getName, getParentAuthorizable, getPenalizationPeriod, getPenalizationPeriod, getPortFunction, getPosition, getProcessGroup, getProcessGroupIdentifier, getRelationship, getRelationships, getResource, getRetriedRelationships, getRetryCount, getScheduledState, getSchedulingPeriod, getSchedulingPeriod, getVersionedComponentId, getYieldExpiration, getYieldPeriod, getYieldPeriod, isAutoTerminated, isLossTolerant, isRelationshipRetried, isRunning, onSchedulingStart, onTrigger, setBackoffMechanism, setComments, setLossTolerant, setMaxBackoffPeriod, setMaxConcurrentTasks, setName, setPenalizationPeriod, setPortFunction, setPosition, setProcessGroup, setRetriedRelationships, setRetryCount, setSchedulingPeriod, setVersionedComponentId, setYieldPeriod, shutdown, verifyCanClearState, verifyCanDelete, verifyCanDelete, verifyCanDisable, verifyCanEnable, verifyCanStart, verifyCanStop, verifyCanUpdate, yield, yieldMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.nifi.authorization.resource.Authorizable
authorize, authorize, checkAuthorization, checkAuthorization, getRequestedResource, isAuthorizedMethods inherited from interface org.apache.nifi.connectable.Connectable
getRunDuration, getRunnableComponent, isIsolated, isSessionBatchingSupported, isTriggerWhenAnyDestinationAvailable
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
rwLock
-
readLock
-
writeLock
-
maxIterations
private final int maxIterations
-
-
Constructor Details
-
LocalPort
public LocalPort(String id, String name, ConnectableType type, ProcessScheduler scheduler, int maxConcurrentTasks, int maxBatchSize, String boredYieldDuration)
-
-
Method Details
-
isValid
public boolean isValid()- Specified by:
isValidin interfacePort- Specified by:
isValidin classAbstractPort
-
hasOutboundConnection
private boolean hasOutboundConnection() -
isOutboundConnectionRequired
private boolean isOutboundConnectionRequired()An Outbound Connection is required for a Local Port unless all of the following conditions are met:
- Group is using the Stateless Execution Engine
- There is no Input Port to the Group
- The Port is a failure port
Under these conditions, it is not necessary to have an outbound connection because anything that gets routed to the Port will end up being rolled back anyway, and since there is no Input Port, there is no input FlowFile to route to failure.
- Returns:
- true if an Outbound Connection is required in order for the Port to be valid,
falseotherwise
-
getValidationErrors
-
onTrigger
public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) - Specified by:
onTriggerin classAbstractPort
-
triggerOutputPort
private void triggerOutputPort(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) -
triggerInputPort
private void triggerInputPort(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) -
isTransferDataOut
private boolean isTransferDataOut() -
transferInputBatch
private void transferInputBatch(org.apache.nifi.processor.ProcessSession session) -
transferSingleFlowFile
private void transferSingleFlowFile(org.apache.nifi.processor.ProcessSession session) -
transferUnboundedConcurrency
protected void transferUnboundedConcurrency(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) -
updateConnection
- Specified by:
updateConnectionin interfaceConnectable- Overrides:
updateConnectionin classAbstractPort- Throws:
IllegalStateException
-
addConnection
- Specified by:
addConnectionin interfaceConnectable- Overrides:
addConnectionin classAbstractPort- Throws:
IllegalArgumentException
-
removeConnection
public void removeConnection(Connection connection) throws IllegalArgumentException, IllegalStateException - Specified by:
removeConnectionin interfaceConnectable- Overrides:
removeConnectionin classAbstractPort- Throws:
IllegalArgumentExceptionIllegalStateException
-
getConnections
- Specified by:
getConnectionsin interfaceConnectable- Overrides:
getConnectionsin classAbstractPort
-
getConnections
- Specified by:
getConnectionsin interfaceConnectable- Overrides:
getConnectionsin classAbstractPort
-
getIncomingConnections
- Specified by:
getIncomingConnectionsin interfaceConnectable- Overrides:
getIncomingConnectionsin classAbstractPort
-
hasIncomingConnection
public boolean hasIncomingConnection()- Specified by:
hasIncomingConnectionin interfaceConnectable- Overrides:
hasIncomingConnectionin classAbstractPort
-
isTriggerWhenEmpty
public boolean isTriggerWhenEmpty() -
getSchedulingStrategy
public org.apache.nifi.scheduling.SchedulingStrategy getSchedulingStrategy() -
isSideEffectFree
public boolean isSideEffectFree() -
getComponentType
-
toString
- Overrides:
toStringin classAbstractPort
-