public class FlowController extends java.lang.Object implements EventAccess, ControllerServiceProvider, ReportingTaskProvider, QueueProvider, Authorizable, ProvenanceAuthorizableFactory, NodeTypeProvider, IdentifierLookup, ReloadComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_COMPONENT_STATUS_REPO_IMPLEMENTATION |
static java.lang.String |
DEFAULT_CONTENT_REPO_IMPLEMENTATION |
static java.lang.String |
DEFAULT_FLOWFILE_REPO_IMPLEMENTATION |
static long |
DEFAULT_GRACEFUL_SHUTDOWN_SECONDS |
static double |
DEFAULT_POSITION_SCALE_FACTOR_X |
static double |
DEFAULT_POSITION_SCALE_FACTOR_Y |
static java.lang.String |
DEFAULT_PROVENANCE_REPO_IMPLEMENTATION |
static java.lang.String |
DEFAULT_ROOT_GROUP_NAME |
static java.lang.String |
DEFAULT_SWAP_MANAGER_IMPLEMENTATION |
static java.lang.String |
GRACEFUL_SHUTDOWN_PERIOD |
static int |
METRICS_RESERVOIR_SIZE |
static java.lang.String |
ROOT_GROUP_ID_ALIAS |
static java.lang.String |
SCHEDULE_MINIMUM_NANOSECONDS |
EMPTY
Modifier and Type | Method and Description |
---|---|
void |
addRootControllerService(ControllerServiceNode serviceNode) |
boolean |
areGroupsSame(java.lang.String id1,
java.lang.String id2)
Indicates whether or not the two ID's point to the same ProcessGroup.
|
static FlowController |
createClusteredInstance(FlowFileEventRepository flowFileEventRepo,
NiFiProperties properties,
Authorizer authorizer,
AuditService auditService,
StringEncryptor encryptor,
NodeProtocolSender protocolSender,
BulletinRepository bulletinRepo,
ClusterCoordinator clusterCoordinator,
HeartbeatMonitor heartbeatMonitor,
LeaderElectionManager leaderElectionManager,
VariableRegistry variableRegistry) |
Connection |
createConnection(java.lang.String id,
java.lang.String name,
Connectable source,
Connectable destination,
java.util.Collection<java.lang.String> relationshipNames)
Creates a connection between two Connectable objects.
|
ControllerServiceNode |
createControllerService(java.lang.String type,
java.lang.String id,
BundleCoordinate bundleCoordinate,
java.util.Set<java.net.URL> additionalUrls,
boolean firstTimeAdded)
Creates a new Controller Service of the specified type and assigns it the
given id.
|
Funnel |
createFunnel(java.lang.String id)
Creates a funnel
|
Label |
createLabel(java.lang.String id,
java.lang.String text)
Creates a new Label
|
Authorizable |
createLocalDataAuthorizable(java.lang.String componentId)
Generates an Authorizable object for the Data of the component with the given ID.
|
Port |
createLocalInputPort(java.lang.String id,
java.lang.String name)
Creates a Port to use as an Input Port for a Process Group
|
Port |
createLocalOutputPort(java.lang.String id,
java.lang.String name)
Creates a Port to use as an Output Port for a Process Group
|
FlowFilePrioritizer |
createPrioritizer(java.lang.String type) |
ProcessGroup |
createProcessGroup(java.lang.String id)
Creates a ProcessGroup with the given ID
|
ProcessorNode |
createProcessor(java.lang.String type,
java.lang.String id,
BundleCoordinate coordinate)
Creates a new ProcessorNode with the given type and identifier and
initializes it invoking the methods annotated with
OnAdded . |
ProcessorNode |
createProcessor(java.lang.String type,
java.lang.String id,
BundleCoordinate coordinate,
boolean firstTimeAdded)
Creates a new ProcessorNode with the given type and identifier and
optionally initializes it.
|
ProcessorNode |
createProcessor(java.lang.String type,
java.lang.String id,
BundleCoordinate coordinate,
java.util.Set<java.net.URL> additionalUrls,
boolean firstTimeAdded,
boolean registerLogObserver)
Creates a new ProcessorNode with the given type and identifier and
optionally initializes it.
|
Authorizable |
createRemoteDataAuthorizable(java.lang.String remoteGroupPortId)
Generates an Authorizable object for the Data of the remote group port with the given ID.
|
Port |
createRemoteInputPort(java.lang.String id,
java.lang.String name)
Creates a Port to use as an Input Port for the root Process Group, which
is used for Site-to-Site communications
|
Port |
createRemoteOutputPort(java.lang.String id,
java.lang.String name)
Creates a Port to use as an Output Port for the root Process Group, which
is used for Site-to-Site communications and will queue flow files waiting
to be delivered to remote instances
|
RemoteProcessGroup |
createRemoteProcessGroup(java.lang.String id,
java.lang.String uris)
Creates a new Remote Process Group with the given ID that points to the
given URI
|
ReportingTaskNode |
createReportingTask(java.lang.String type,
BundleCoordinate bundleCoordinate) |
ReportingTaskNode |
createReportingTask(java.lang.String type,
BundleCoordinate bundleCoordinate,
boolean firstTimeAdded) |
ReportingTaskNode |
createReportingTask(java.lang.String type,
java.lang.String id,
BundleCoordinate bundleCoordinate,
boolean firstTimeAdded)
Creates a new instance of a reporting task
|
ReportingTaskNode |
createReportingTask(java.lang.String type,
java.lang.String id,
BundleCoordinate bundleCoordinate,
java.util.Set<java.net.URL> additionalUrls,
boolean firstTimeAdded,
boolean register) |
static FlowController |
createStandaloneInstance(FlowFileEventRepository flowFileEventRepo,
NiFiProperties properties,
Authorizer authorizer,
AuditService auditService,
StringEncryptor encryptor,
BulletinRepository bulletinRepo,
VariableRegistry variableRegistry) |
java.util.concurrent.CompletableFuture<java.lang.Void> |
disableControllerService(ControllerServiceNode serviceNode)
Disables the given controller service so that it cannot be used by other
components.
|
java.util.Set<ConfiguredComponent> |
disableReferencingServices(ControllerServiceNode serviceNode)
Disables any Controller Service that references the provided Controller
Service.
|
void |
disableReportingTask(ReportingTaskNode reportingTaskNode)
Disables the ability to schedul the reporting task to run
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
enableControllerService(ControllerServiceNode serviceNode)
Enables the given controller service that it can be used by other
components.
|
void |
enableControllerServices(java.util.Collection<ControllerServiceNode> serviceNodes)
Enables the collection of services.
|
java.util.Set<ConfiguredComponent> |
enableReferencingServices(ControllerServiceNode serviceNode)
Enables all Controller Services that are referencing the given service.
|
void |
enableReportingTask(ReportingTaskNode reportingTaskNode)
Enables the reporting task to be scheduled to run
|
int |
getActiveThreadCount() |
java.util.Set<ControllerServiceNode> |
getAllControllerServices() |
java.util.Collection<FlowFileQueue> |
getAllQueues() |
java.util.Set<ReportingTaskNode> |
getAllReportingTasks() |
Authorizer |
getAuthorizer() |
BulletinRepository |
getBulletinRepository() |
java.lang.String |
getComments() |
java.util.List<java.lang.String> |
getComponentIdentifiers() |
java.util.List<java.lang.String> |
getComponentTypes() |
Connection |
getConnection(java.lang.String id) |
StatusHistoryDTO |
getConnectionStatusHistory(java.lang.String connectionId) |
StatusHistoryDTO |
getConnectionStatusHistory(java.lang.String connectionId,
java.util.Date startTime,
java.util.Date endTime,
int preferredDataPoints) |
java.io.InputStream |
getContent(FlowFileRecord flowFile,
java.lang.String requestor,
java.lang.String requestUri) |
java.io.InputStream |
getContent(ProvenanceEventRecord provEvent,
ContentDirection direction,
java.lang.String requestor,
java.lang.String requestUri) |
ContentAvailability |
getContentAvailability(ProvenanceEventRecord event) |
ControllerService |
getControllerService(java.lang.String serviceIdentifier) |
ControllerService |
getControllerServiceForComponent(java.lang.String serviceIdentifier,
java.lang.String componentId) |
java.util.Set<java.lang.String> |
getControllerServiceIdentifiers(java.lang.Class<? extends ControllerService> serviceType) |
java.util.Set<java.lang.String> |
getControllerServiceIdentifiers(java.lang.Class<? extends ControllerService> serviceType,
java.lang.String groupId) |
java.lang.String |
getControllerServiceName(java.lang.String serviceIdentifier) |
ControllerServiceNode |
getControllerServiceNode(java.lang.String serviceIdentifier) |
ProcessGroupStatus |
getControllerStatus()
Returns the status of all components in the controller.
|
java.util.List<Counter> |
getCounters() |
ExtensionManager |
getExtensionManager() |
java.util.List<Action> |
getFlowChanges(int firstActionId,
int maxActions)
Obtains flow changes starting with (and including) the given action ID.
|
java.util.Set<java.lang.Class> |
getFlowFileComparatorClasses() |
java.util.Set<java.lang.Class> |
getFlowFileProcessorClasses() |
Funnel |
getFunnel(java.lang.String id) |
ProcessGroup |
getGroup(java.lang.String id)
Returns the ProcessGroup with the given ID
|
ProcessGroupStatus |
getGroupStatus(ProcessGroup group,
RepositoryStatusReport statusReport,
org.apache.commons.collections4.Predicate<Authorizable> isAuthorized)
Returns the status for the components in the specified group with the
specified report.
|
ProcessGroupStatus |
getGroupStatus(java.lang.String groupId)
Returns the status of all components in the specified group.
|
ProcessGroupStatus |
getGroupStatus(java.lang.String groupId,
NiFiUser user)
Returns the status for components in the specified group.
|
ProcessGroupStatus |
getGroupStatus(java.lang.String groupId,
RepositoryStatusReport statusReport)
Returns the status for the components in the specified group with the
specified report.
|
ProcessGroupStatus |
getGroupStatus(java.lang.String groupId,
RepositoryStatusReport statusReport,
NiFiUser user)
Returns the status for the components in the specified group with the
specified report.
|
int |
getHeartbeatDelaySeconds() |
Heartbeater |
getHeartbeater() |
Port |
getInputPort(java.lang.String id) |
java.lang.String |
getInstanceId() |
int |
getMaxEventDrivenThreadCount() |
int |
getMaxTimerDrivenThreadCount() |
java.lang.String |
getName() |
NodeIdentifier |
getNodeId()
The node identifier of this instance.
|
Port |
getOutputPort(java.lang.String id) |
Authorizable |
getParentAuthorizable()
The parent for this Authorizable.
|
StatusHistoryDTO |
getProcessGroupStatusHistory(java.lang.String processGroupId) |
StatusHistoryDTO |
getProcessGroupStatusHistory(java.lang.String processGroupId,
java.util.Date startTime,
java.util.Date endTime,
int preferredDataPoints) |
ProcessorNode |
getProcessorNode(java.lang.String id) |
StatusHistoryDTO |
getProcessorStatusHistory(java.lang.String processorId,
boolean includeCounters) |
StatusHistoryDTO |
getProcessorStatusHistory(java.lang.String processorId,
java.util.Date startTime,
java.util.Date endTime,
int preferredDataPoints,
boolean includeCounters) |
ProcessScheduler |
getProcessScheduler() |
java.util.List<ProvenanceEventRecord> |
getProvenanceEvents(long firstEventId,
int maxRecords)
Convenience method to obtain Provenance Events starting with (and
including) the given ID.
|
ProvenanceRepository |
getProvenanceRepository() |
java.util.List<java.lang.String> |
getQueueIdentifiers() |
StatusHistoryDTO |
getRemoteProcessGroupStatusHistory(java.lang.String remoteGroupId) |
StatusHistoryDTO |
getRemoteProcessGroupStatusHistory(java.lang.String remoteGroupId,
java.util.Date startTime,
java.util.Date endTime,
int preferredDataPoints) |
java.lang.Integer |
getRemoteSiteListeningHttpPort() |
java.lang.Integer |
getRemoteSiteListeningPort() |
ReportingTaskNode |
getReportingTaskNode(java.lang.String taskId) |
Resource |
getResource()
The Resource for this Authorizable.
|
ControllerServiceNode |
getRootControllerService(java.lang.String serviceIdentifier) |
java.util.Set<ControllerServiceNode> |
getRootControllerServices() |
ProcessGroup |
getRootGroup() |
java.lang.String |
getRootGroupId() |
SnippetManager |
getSnippetManager() |
StateManagerProvider |
getStateManagerProvider() |
SystemDiagnostics |
getSystemDiagnostics() |
QueueSize |
getTotalFlowFileCount(ProcessGroup group) |
void |
heartbeat() |
void |
initializeFlow() |
void |
instantiateSnippet(ProcessGroup group,
FlowSnippetDTO dto)
Creates an instance of the given snippet and adds the components to the
given group
|
boolean |
isClustered() |
boolean |
isConfiguredForClustering() |
boolean |
isConnected() |
boolean |
isControllerServiceEnabled(ControllerService service) |
boolean |
isControllerServiceEnabled(java.lang.String serviceIdentifier) |
boolean |
isControllerServiceEnabling(java.lang.String serviceIdentifier) |
boolean |
isFlowSynchronized() |
boolean |
isHeartbeating() |
boolean |
isInitialized() |
boolean |
isPrimary() |
java.lang.Boolean |
isRemoteSiteCommsSecure() |
boolean |
isTerminated() |
void |
onConnectionAdded(Connection connection) |
void |
onConnectionRemoved(Connection connection) |
void |
onFlowInitialized(boolean startDelayedComponents)
Causes any processors that were added to the flow with a 'delayStart'
flag of true to now start
|
void |
onFunnelAdded(Funnel funnel) |
void |
onFunnelRemoved(Funnel funnel) |
void |
onInputPortAdded(Port inputPort) |
void |
onInputPortRemoved(Port inputPort) |
void |
onOutputPortAdded(Port outputPort) |
void |
onOutputPortRemoved(Port outputPort) |
void |
onProcessGroupAdded(ProcessGroup group) |
void |
onProcessGroupRemoved(ProcessGroup group) |
void |
onProcessorAdded(ProcessorNode procNode) |
void |
onProcessorRemoved(ProcessorNode procNode) |
void |
reload(ControllerServiceNode existingNode,
java.lang.String newType,
BundleCoordinate bundleCoordinate,
java.util.Set<java.net.URL> additionalUrls)
Changes the underlying ControllerService held by the node to an instance of the new type.
|
void |
reload(ProcessorNode existingNode,
java.lang.String newType,
BundleCoordinate bundleCoordinate,
java.util.Set<java.net.URL> additionalUrls)
Changes the underlying Processor held by the node to an instance of the new type.
|
void |
reload(ReportingTaskNode existingNode,
java.lang.String newType,
BundleCoordinate bundleCoordinate,
java.util.Set<java.net.URL> additionalUrls)
Changes the underlying ReportingTask held by the node to an instance of the new type.
|
void |
removeControllerService(ControllerServiceNode serviceNode)
Removes the given Controller Service from the flow.
|
void |
removeReportingTask(ReportingTaskNode reportingTaskNode)
Removes the given reporting task from the flow
|
void |
removeRootControllerService(ControllerServiceNode service) |
ProvenanceEventRecord |
replayFlowFile(long provenanceEventRecordId,
NiFiUser user) |
ProvenanceEventRecord |
replayFlowFile(ProvenanceEventRecord event,
NiFiUser user) |
Counter |
resetCounter(java.lang.String identifier) |
void |
resumeHeartbeats()
Notifies controller that the sending of heartbeats should be re-enabled.
|
java.util.Set<ConfiguredComponent> |
scheduleReferencingComponents(ControllerServiceNode serviceNode)
Schedules any schedulable component (Processor, ReportingTask) that is
referencing the given Controller Service to run.
|
void |
serialize(FlowSerializer serializer,
java.io.OutputStream os)
Serializes the current state of the controller to the given OutputStream
|
void |
setClustered(boolean clustered,
java.lang.String clusterInstanceId)
Sets whether this instance is clustered.
|
void |
setComments(java.lang.String comments)
Sets the comments
|
void |
setConnectionStatus(NodeConnectionStatus connectionStatus) |
void |
setMaxEventDrivenThreadCount(int maxThreadCount) |
void |
setMaxTimerDrivenThreadCount(int maxThreadCount) |
void |
setName(java.lang.String name)
Sets the name for the Root Group, which also changes the name for the
controller.
|
void |
setNodeId(NodeIdentifier nodeId)
Sets the node identifier for this instance.
|
void |
setPrimary(boolean primary) |
void |
shutdown(boolean kill)
Triggers the controller to begin shutdown, stopping all processors and
terminating the scheduling engine.
|
void |
startConnectable(Connectable connectable) |
void |
startHeartbeating()
Starts heartbeating to the cluster.
|
void |
startProcessGroup(java.lang.String groupId) |
void |
startProcessor(java.lang.String parentGroupId,
java.lang.String processorId) |
void |
startReportingTask(ReportingTaskNode reportingTaskNode)
Begins scheduling the reporting task to run and invokes appropriate
lifecycle methods
|
void |
startTransmitting(RemoteGroupPort remoteGroupPort) |
void |
stopAllProcessors() |
void |
stopConnectable(Connectable connectable) |
void |
stopHeartbeating()
Stops heartbeating to the cluster.
|
void |
stopProcessGroup(java.lang.String groupId) |
void |
stopProcessor(java.lang.String parentGroupId,
java.lang.String processorId) |
void |
stopReportingTask(ReportingTaskNode reportingTaskNode)
Stops scheduling the reporting task to run and invokes appropriate
lifecycle methods
|
void |
suspendHeartbeats()
Notifies controller that the sending of heartbeats should be temporarily
suspended.
|
void |
synchronize(FlowSynchronizer synchronizer,
DataFlow dataFlow)
Synchronizes this controller with the proposed flow.
|
java.util.Set<ConfiguredComponent> |
unscheduleReferencingComponents(ControllerServiceNode serviceNode)
Recursively unschedules all schedulable components (Processors and
Reporting Tasks) that reference the given Controller Service.
|
PortDTO |
updateInputPort(java.lang.String parentGroupId,
PortDTO dto) |
PortDTO |
updateOutputPort(java.lang.String parentGroupId,
PortDTO dto) |
void |
updateProcessGroup(ProcessGroupDTO dto)
Updates the process group corresponding to the specified DTO.
|
void |
verifyCanDisableReferencingServices(ControllerServiceNode serviceNode)
Verifies that all Controller Services referencing the provided Controller
Service can be disabled.
|
void |
verifyCanEnableReferencingServices(ControllerServiceNode serviceNode)
Verifies that all Controller Services referencing the provided
ControllerService can be enabled.
|
void |
verifyCanScheduleReferencingComponents(ControllerServiceNode serviceNode)
Verifies that all enabled Processors referencing the ControllerService
(or a service that depends on the provided service) can be scheduled to
run.
|
void |
verifyCanStopReferencingComponents(ControllerServiceNode serviceNode)
Verifies that all running Processors and Reporting Tasks referencing the
Controller Service (or a service that depends on the provided service)
can be stopped.
|
void |
verifyComponentTypesInSnippet(FlowSnippetDTO templateContents) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authorize, authorize, checkAuthorization, checkAuthorization, getRequestedResource, isAuthorized
invertComponentIdentifiers, invertComponentTypes, invertList, invertQueueIdentifiers
public static final java.lang.String DEFAULT_FLOWFILE_REPO_IMPLEMENTATION
public static final java.lang.String DEFAULT_CONTENT_REPO_IMPLEMENTATION
public static final java.lang.String DEFAULT_PROVENANCE_REPO_IMPLEMENTATION
public static final java.lang.String DEFAULT_SWAP_MANAGER_IMPLEMENTATION
public static final java.lang.String DEFAULT_COMPONENT_STATUS_REPO_IMPLEMENTATION
public static final java.lang.String SCHEDULE_MINIMUM_NANOSECONDS
public static final java.lang.String GRACEFUL_SHUTDOWN_PERIOD
public static final long DEFAULT_GRACEFUL_SHUTDOWN_SECONDS
public static final int METRICS_RESERVOIR_SIZE
public static final java.lang.String ROOT_GROUP_ID_ALIAS
public static final java.lang.String DEFAULT_ROOT_GROUP_NAME
public static final double DEFAULT_POSITION_SCALE_FACTOR_X
public static final double DEFAULT_POSITION_SCALE_FACTOR_Y
public static FlowController createStandaloneInstance(FlowFileEventRepository flowFileEventRepo, NiFiProperties properties, Authorizer authorizer, AuditService auditService, StringEncryptor encryptor, BulletinRepository bulletinRepo, VariableRegistry variableRegistry)
public static FlowController createClusteredInstance(FlowFileEventRepository flowFileEventRepo, NiFiProperties properties, Authorizer authorizer, AuditService auditService, StringEncryptor encryptor, NodeProtocolSender protocolSender, BulletinRepository bulletinRepo, ClusterCoordinator clusterCoordinator, HeartbeatMonitor heartbeatMonitor, LeaderElectionManager leaderElectionManager, VariableRegistry variableRegistry)
public Authorizable getParentAuthorizable()
Authorizable
getParentAuthorizable
in interface Authorizable
public Resource getResource()
Authorizable
getResource
in interface Authorizable
public void initializeFlow() throws java.io.IOException
java.io.IOException
public void onFlowInitialized(boolean startDelayedComponents)
Causes any processors that were added to the flow with a 'delayStart' flag of true to now start
startDelayedComponents
- true if startpublic Connection createConnection(java.lang.String id, java.lang.String name, Connectable source, Connectable destination, java.util.Collection<java.lang.String> relationshipNames)
id
- required ID of the connectionname
- the name of the connection, or null
to leave the
connection unnamedsource
- required sourcedestination
- required destinationrelationshipNames
- required collection of relationship namesjava.lang.NullPointerException
- if the ID, source, destination, or set of
relationships is null.java.lang.IllegalArgumentException
- if relationships
is an
empty collectionpublic Label createLabel(java.lang.String id, java.lang.String text)
id
- identifiertext
- label textjava.lang.NullPointerException
- if either argument is nullpublic Funnel createFunnel(java.lang.String id)
id
- funnel idpublic Port createLocalInputPort(java.lang.String id, java.lang.String name)
id
- port identifiername
- port namejava.lang.NullPointerException
- if the ID or name is not uniquejava.lang.IllegalStateException
- if an Input Port already exists with the
same name or id.public Port createLocalOutputPort(java.lang.String id, java.lang.String name)
id
- port idname
- port namejava.lang.NullPointerException
- if the ID or name is not uniquejava.lang.IllegalStateException
- if an Input Port already exists with the
same name or id.public ProcessGroup createProcessGroup(java.lang.String id)
id
- group idjava.lang.NullPointerException
- if the argument is nullpublic ProcessorNode createProcessor(java.lang.String type, java.lang.String id, BundleCoordinate coordinate) throws ProcessorInstantiationException
Creates a new ProcessorNode with the given type and identifier and
initializes it invoking the methods annotated with OnAdded
.
type
- processor typeid
- processor idcoordinate
- the coordinate of the bundle for this processorjava.lang.NullPointerException
- if either arg is nullProcessorInstantiationException
- if the processor cannot be
instantiated for any reasonpublic ProcessorNode createProcessor(java.lang.String type, java.lang.String id, BundleCoordinate coordinate, boolean firstTimeAdded) throws ProcessorInstantiationException
Creates a new ProcessorNode with the given type and identifier and optionally initializes it.
type
- the fully qualified Processor class nameid
- the unique ID of the Processorcoordinate
- the bundle coordinate for this processorfirstTimeAdded
- whether or not this is the first time this
Processor is added to the graph. If true
, will invoke methods
annotated with the OnAdded
annotation.java.lang.NullPointerException
- if either arg is nullProcessorInstantiationException
- if the processor cannot be
instantiated for any reasonpublic ProcessorNode createProcessor(java.lang.String type, java.lang.String id, BundleCoordinate coordinate, java.util.Set<java.net.URL> additionalUrls, boolean firstTimeAdded, boolean registerLogObserver) throws ProcessorInstantiationException
Creates a new ProcessorNode with the given type and identifier and optionally initializes it.
type
- the fully qualified Processor class nameid
- the unique ID of the Processorcoordinate
- the bundle coordinate for this processorfirstTimeAdded
- whether or not this is the first time this
Processor is added to the graph. If true
, will invoke methods
annotated with the OnAdded
annotation.java.lang.NullPointerException
- if either arg is nullProcessorInstantiationException
- if the processor cannot be
instantiated for any reasonpublic void reload(ProcessorNode existingNode, java.lang.String newType, BundleCoordinate bundleCoordinate, java.util.Set<java.net.URL> additionalUrls) throws ProcessorInstantiationException
ReloadComponent
reload
in interface ReloadComponent
existingNode
- the node being being updatednewType
- the fully qualified class name of the new typebundleCoordinate
- the bundle coordinate of the new typeadditionalUrls
- additional URLs to be added to the instance class loader of the new componentProcessorInstantiationException
public ExtensionManager getExtensionManager()
public java.lang.String getInstanceId()
public Heartbeater getHeartbeater()
public BulletinRepository getBulletinRepository()
public SnippetManager getSnippetManager()
public StateManagerProvider getStateManagerProvider()
public Authorizer getAuthorizer()
public Port createRemoteInputPort(java.lang.String id, java.lang.String name)
id
- port idname
- port namejava.lang.NullPointerException
- if the ID or name is not uniquejava.lang.IllegalStateException
- if an Input Port already exists with the
same name or id.public Port createRemoteOutputPort(java.lang.String id, java.lang.String name)
id
- port idname
- port namejava.lang.NullPointerException
- if the ID or name is not uniquejava.lang.IllegalStateException
- if an Input Port already exists with the
same name or id.public RemoteProcessGroup createRemoteProcessGroup(java.lang.String id, java.lang.String uris)
id
- group iduris
- group uris, multiple url can be specified in comma-separated formatjava.lang.NullPointerException
- if either argument is nulljava.lang.IllegalArgumentException
- if uri
is not a valid URI.public ProcessGroup getRootGroup()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- of root grouppublic java.lang.String getComments()
public void setComments(java.lang.String comments)
comments
- for the Root Group, which also changes the comment for
the controllerpublic boolean isTerminated()
true
if the scheduling engine for this controller
has been terminated.public void shutdown(boolean kill)
isTerminated()
method will indicate whether or not the shutdown
has finished.kill
- if true
, attempts to stop all active threads,
but makes no guarantee that this will happenjava.lang.IllegalStateException
- if the controller is already stopped or
currently in the processor of stoppingpublic void serialize(FlowSerializer serializer, java.io.OutputStream os) throws FlowSerializationException
serializer
- serializeros
- streamFlowSerializationException
- if serialization of the flow fails for
any reasonpublic void synchronize(FlowSynchronizer synchronizer, DataFlow dataFlow) throws FlowSerializationException, FlowSynchronizationException, UninheritableFlowException, MissingBundleException
FlowSynchronizer.sync(FlowController, DataFlow, StringEncryptor)
.synchronizer
- synchronizerdataFlow
- the flow to load the controller with. If the flow is null
or zero length, then the controller must not have a flow or else an
UninheritableFlowException will be thrown.FlowSerializationException
- if proposed flow is not a valid flow
configuration fileUninheritableFlowException
- if the proposed flow cannot be loaded
by the controller because in doing so would risk orphaning flow filesFlowSynchronizationException
- if updates to the controller failed.
If this exception is thrown, then the controller should be considered
unsafe to be usedMissingBundleException
- if the proposed flow cannot be loaded by the
controller because it contains a bundle that does not exist in the controllerpublic int getMaxTimerDrivenThreadCount()
public int getMaxEventDrivenThreadCount()
public void setMaxTimerDrivenThreadCount(int maxThreadCount)
public void setMaxEventDrivenThreadCount(int maxThreadCount)
public java.lang.String getRootGroupId()
public SystemDiagnostics getSystemDiagnostics()
public void updateProcessGroup(ProcessGroupDTO dto) throws ProcessorInstantiationException
null
(with the exception of the required ID)
will be ignored.dto
- groupProcessorInstantiationException
java.lang.IllegalStateException
- if no process group can be found with the
ID of DTO or with the ID of the DTO's parentGroupId, if the template ID
specified is invalid, or if the DTO's Parent Group ID changes but the
parent group has incoming or outgoing connectionsjava.lang.NullPointerException
- if the DTO or its ID is nullpublic void instantiateSnippet(ProcessGroup group, FlowSnippetDTO dto) throws ProcessorInstantiationException
group
- groupdto
- dtojava.lang.NullPointerException
- if either argument is nulljava.lang.IllegalStateException
- if the snippet is not valid because a
component in the snippet has an ID that is not unique to this flow, or
because it shares an Input Port or Output Port at the root level whose
name already exists in the given ProcessGroup, or because the Template
contains a Processor or a Prioritizer whose class is not valid within
this instance of NiFi.ProcessorInstantiationException
- if unable to instantiate a
processorpublic void verifyComponentTypesInSnippet(FlowSnippetDTO templateContents)
public boolean areGroupsSame(java.lang.String id1, java.lang.String id2)
false
.id1
- group idid2
- other group idpublic FlowFilePrioritizer createPrioritizer(java.lang.String type) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
public java.util.Set<java.lang.Class> getFlowFileProcessorClasses()
public java.util.Set<java.lang.Class> getFlowFileComparatorClasses()
public ProcessGroup getGroup(java.lang.String id)
id
- group idpublic void onProcessGroupAdded(ProcessGroup group)
public void onProcessGroupRemoved(ProcessGroup group)
public void onProcessorAdded(ProcessorNode procNode)
public void onProcessorRemoved(ProcessorNode procNode)
public ProcessorNode getProcessorNode(java.lang.String id)
public void onConnectionAdded(Connection connection)
public void onConnectionRemoved(Connection connection)
public Connection getConnection(java.lang.String id)
public void onInputPortAdded(Port inputPort)
public void onInputPortRemoved(Port inputPort)
public Port getInputPort(java.lang.String id)
public void onOutputPortAdded(Port outputPort)
public void onOutputPortRemoved(Port outputPort)
public Port getOutputPort(java.lang.String id)
public void onFunnelAdded(Funnel funnel)
public void onFunnelRemoved(Funnel funnel)
public Funnel getFunnel(java.lang.String id)
public ProcessGroupStatus getControllerStatus()
getControllerStatus
in interface EventAccess
public ProcessGroupStatus getGroupStatus(java.lang.String groupId)
getGroupStatus
in interface EventAccess
groupId
- group idpublic ProcessGroupStatus getGroupStatus(java.lang.String groupId, NiFiUser user)
groupId
- group iduser
- user making requestpublic ProcessGroupStatus getGroupStatus(java.lang.String groupId, RepositoryStatusReport statusReport)
groupId
- group idstatusReport
- reportpublic ProcessGroupStatus getGroupStatus(java.lang.String groupId, RepositoryStatusReport statusReport, NiFiUser user)
groupId
- group idstatusReport
- reportuser
- user making requestpublic ProcessGroupStatus getGroupStatus(ProcessGroup group, RepositoryStatusReport statusReport, org.apache.commons.collections4.Predicate<Authorizable> isAuthorized)
group
- group idstatusReport
- reportisAuthorized
- is authorized checkpublic void startProcessor(java.lang.String parentGroupId, java.lang.String processorId)
public boolean isInitialized()
public boolean isFlowSynchronized()
public void startConnectable(Connectable connectable)
public void stopConnectable(Connectable connectable)
public void startTransmitting(RemoteGroupPort remoteGroupPort)
public void stopProcessor(java.lang.String parentGroupId, java.lang.String processorId)
public void stopAllProcessors()
public void startProcessGroup(java.lang.String groupId)
public void stopProcessGroup(java.lang.String groupId)
public ReportingTaskNode createReportingTask(java.lang.String type, BundleCoordinate bundleCoordinate) throws ReportingTaskInstantiationException
public ReportingTaskNode createReportingTask(java.lang.String type, BundleCoordinate bundleCoordinate, boolean firstTimeAdded) throws ReportingTaskInstantiationException
public ReportingTaskNode createReportingTask(java.lang.String type, java.lang.String id, BundleCoordinate bundleCoordinate, boolean firstTimeAdded) throws ReportingTaskInstantiationException
ReportingTaskProvider
createReportingTask
in interface ReportingTaskProvider
type
- the type (fully qualified class name) of the reporting task
to instantiateid
- the identifier for the Reporting TaskbundleCoordinate
- the bundle coordinate for the type of reporting taskfirstTimeAdded
- whether or not this is the first time that the
reporting task is being added to the flow. I.e., this will be true only
when the user adds the reporting task to the flow, not when the flow is
being restored after a restart of the softwareReportingTaskInstantiationException
- if unable to create the
Reporting Taskpublic ReportingTaskNode createReportingTask(java.lang.String type, java.lang.String id, BundleCoordinate bundleCoordinate, java.util.Set<java.net.URL> additionalUrls, boolean firstTimeAdded, boolean register) throws ReportingTaskInstantiationException
public void reload(ReportingTaskNode existingNode, java.lang.String newType, BundleCoordinate bundleCoordinate, java.util.Set<java.net.URL> additionalUrls) throws ReportingTaskInstantiationException
ReloadComponent
reload
in interface ReloadComponent
existingNode
- the ReportingTaskNode being updatednewType
- the fully qualified class name of the new typebundleCoordinate
- the bundle coordinate of the new typeadditionalUrls
- additional URLs to be added to the instance class loader of the new componentReportingTaskInstantiationException
- if unable to create an instance of the new typepublic ReportingTaskNode getReportingTaskNode(java.lang.String taskId)
getReportingTaskNode
in interface ReportingTaskProvider
taskId
- of nodenull
if no reporting task exists with that IDpublic void startReportingTask(ReportingTaskNode reportingTaskNode)
ReportingTaskProvider
startReportingTask
in interface ReportingTaskProvider
public void stopReportingTask(ReportingTaskNode reportingTaskNode)
ReportingTaskProvider
stopReportingTask
in interface ReportingTaskProvider
public void removeReportingTask(ReportingTaskNode reportingTaskNode)
ReportingTaskProvider
removeReportingTask
in interface ReportingTaskProvider
public java.util.Set<ReportingTaskNode> getAllReportingTasks()
getAllReportingTasks
in interface ReportingTaskProvider
public ControllerServiceNode createControllerService(java.lang.String type, java.lang.String id, BundleCoordinate bundleCoordinate, java.util.Set<java.net.URL> additionalUrls, boolean firstTimeAdded)
ControllerServiceProvider
firstTimeadded
is true, calls any methods that
are annotated with OnAdded
createControllerService
in interface ControllerServiceProvider
type
- of serviceid
- of servicebundleCoordinate
- the coordinate of the bundle for the serviceadditionalUrls
- optional additional URL resources to add to the class loader of the componentfirstTimeAdded
- for servicepublic void reload(ControllerServiceNode existingNode, java.lang.String newType, BundleCoordinate bundleCoordinate, java.util.Set<java.net.URL> additionalUrls) throws ControllerServiceInstantiationException
ReloadComponent
reload
in interface ReloadComponent
existingNode
- the node being being updatednewType
- the fully qualified class name of the new typebundleCoordinate
- the bundle coordinate of the new typeadditionalUrls
- additional URLs to be added to the instance class loader of the new componentControllerServiceInstantiationException
- if unable to create an instance of the new typepublic void enableReportingTask(ReportingTaskNode reportingTaskNode)
ReportingTaskProvider
enableReportingTask
in interface ReportingTaskProvider
public void disableReportingTask(ReportingTaskNode reportingTaskNode)
ReportingTaskProvider
disableReportingTask
in interface ReportingTaskProvider
public java.util.Set<ConfiguredComponent> disableReferencingServices(ControllerServiceNode serviceNode)
ControllerServiceProvider
disableReferencingServices
in interface ControllerServiceProvider
serviceNode
- the nodepublic java.util.Set<ConfiguredComponent> enableReferencingServices(ControllerServiceNode serviceNode)
ControllerServiceProvider
enableReferencingServices
in interface ControllerServiceProvider
serviceNode
- the nodepublic java.util.Set<ConfiguredComponent> scheduleReferencingComponents(ControllerServiceNode serviceNode)
ControllerServiceProvider
scheduleReferencingComponents
in interface ControllerServiceProvider
serviceNode
- the nodepublic java.util.Set<ConfiguredComponent> unscheduleReferencingComponents(ControllerServiceNode serviceNode)
ControllerServiceProvider
unscheduleReferencingComponents
in interface ControllerServiceProvider
serviceNode
- the nodepublic java.util.concurrent.CompletableFuture<java.lang.Void> enableControllerService(ControllerServiceNode serviceNode)
ControllerServiceProvider
enableControllerService
in interface ControllerServiceProvider
serviceNode
- the service nodepublic void enableControllerServices(java.util.Collection<ControllerServiceNode> serviceNodes)
ControllerServiceProvider
enableControllerServices
in interface ControllerServiceProvider
serviceNodes
- the nodespublic java.util.concurrent.CompletableFuture<java.lang.Void> disableControllerService(ControllerServiceNode serviceNode)
ControllerServiceProvider
disableControllerService
in interface ControllerServiceProvider
serviceNode
- the nodepublic void verifyCanEnableReferencingServices(ControllerServiceNode serviceNode)
ControllerServiceProvider
verifyCanEnableReferencingServices
in interface ControllerServiceProvider
serviceNode
- the nodepublic void verifyCanScheduleReferencingComponents(ControllerServiceNode serviceNode)
ControllerServiceProvider
verifyCanScheduleReferencingComponents
in interface ControllerServiceProvider
serviceNode
- the nodepublic void verifyCanDisableReferencingServices(ControllerServiceNode serviceNode)
ControllerServiceProvider
verifyCanDisableReferencingServices
in interface ControllerServiceProvider
serviceNode
- the nodepublic void verifyCanStopReferencingComponents(ControllerServiceNode serviceNode)
ControllerServiceProvider
verifyCanStopReferencingComponents
in interface ControllerServiceProvider
serviceNode
- the nodepublic ControllerService getControllerService(java.lang.String serviceIdentifier)
getControllerService
in interface ControllerServiceLookup
serviceIdentifier
- of controller servicepublic ControllerService getControllerServiceForComponent(java.lang.String serviceIdentifier, java.lang.String componentId)
getControllerServiceForComponent
in interface ControllerServiceProvider
serviceIdentifier
- the identifier of the controller servicecomponentId
- the identifier of the component that is referencing the service.null
if that
identifier does not exist for any controller service or if the controller service with that identifier is
not accessible from the component with the given componentId, or if no component exists with the given
identifierpublic java.util.Set<java.lang.String> getControllerServiceIdentifiers(java.lang.Class<? extends ControllerService> serviceType) throws java.lang.IllegalArgumentException
getControllerServiceIdentifiers
in interface ControllerServiceLookup
serviceType
- type of service to get identifiers forjava.lang.IllegalArgumentException
- if the given class is not an interfacepublic ControllerServiceNode getControllerServiceNode(java.lang.String serviceIdentifier)
getControllerServiceNode
in interface ControllerServiceProvider
serviceIdentifier
- of the servicenull
if the identifier does not match a known servicepublic java.util.Set<ControllerServiceNode> getRootControllerServices()
public void addRootControllerService(ControllerServiceNode serviceNode)
public ControllerServiceNode getRootControllerService(java.lang.String serviceIdentifier)
public void removeRootControllerService(ControllerServiceNode service)
public boolean isControllerServiceEnabled(ControllerService service)
isControllerServiceEnabled
in interface ControllerServiceLookup
service
- service to checktrue
if the given Controller Service is enabled,
false
otherwise. If the given Controller Service is not
known by this ControllerServiceLookup, returns false
public boolean isControllerServiceEnabled(java.lang.String serviceIdentifier)
isControllerServiceEnabled
in interface ControllerServiceLookup
serviceIdentifier
- identifier of service to checktrue
if the Controller Service with the given
identifier is enabled, false
otherwise. If the given
identifier is not known by this ControllerServiceLookup, returns
false
public boolean isControllerServiceEnabling(java.lang.String serviceIdentifier)
isControllerServiceEnabling
in interface ControllerServiceLookup
serviceIdentifier
- identifier of service to checktrue
if the Controller Service with the given
identifier has been enabled but is still in the transitioning state,
otherwise returns false
. If the given identifier is not
known by this ControllerServiceLookup, returns false
public java.lang.String getControllerServiceName(java.lang.String serviceIdentifier)
getControllerServiceName
in interface ControllerServiceLookup
serviceIdentifier
- identifier to look upnull
public void removeControllerService(ControllerServiceNode serviceNode)
ControllerServiceProvider
removeControllerService
in interface ControllerServiceProvider
serviceNode
- the controller service to removepublic java.util.Set<ControllerServiceNode> getAllControllerServices()
getAllControllerServices
in interface ControllerServiceProvider
public java.util.List<Counter> getCounters()
public Counter resetCounter(java.lang.String identifier)
public QueueSize getTotalFlowFileCount(ProcessGroup group)
public int getActiveThreadCount()
public void startHeartbeating() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if not configured for clusteringpublic void suspendHeartbeats()
stopHeartbeating()
and does not require any lock on the
FlowController. Background tasks will still generate heartbeat messages
and any background task currently in the process of sending a Heartbeat
to the cluster will continue.public void resumeHeartbeats()
startHeartbeating()
and does not require any lock on the
FlowController.public void stopHeartbeating() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if not clusteredpublic boolean isHeartbeating()
public int getHeartbeatDelaySeconds()
public NodeIdentifier getNodeId()
public void setNodeId(NodeIdentifier nodeId)
nodeId
- the node identifier, which may be nullpublic boolean isClustered()
isClustered
in interface NodeTypeProvider
public boolean isConfiguredForClustering()
public void setClustered(boolean clustered, java.lang.String clusterInstanceId)
clustered
- true if clusteredclusterInstanceId
- if clustered is true, indicates the InstanceID
of the Cluster Managerpublic boolean isPrimary()
isPrimary
in interface NodeTypeProvider
public void setPrimary(boolean primary)
public ContentAvailability getContentAvailability(ProvenanceEventRecord event)
public java.io.InputStream getContent(ProvenanceEventRecord provEvent, ContentDirection direction, java.lang.String requestor, java.lang.String requestUri) throws java.io.IOException
java.io.IOException
public java.io.InputStream getContent(FlowFileRecord flowFile, java.lang.String requestor, java.lang.String requestUri) throws java.io.IOException
java.io.IOException
public ProvenanceEventRecord replayFlowFile(long provenanceEventRecordId, NiFiUser user) throws java.io.IOException
java.io.IOException
public ProvenanceEventRecord replayFlowFile(ProvenanceEventRecord event, NiFiUser user) throws java.io.IOException
java.io.IOException
public java.util.List<java.lang.String> getComponentIdentifiers()
getComponentIdentifiers
in interface IdentifierLookup
public java.util.List<java.lang.String> getComponentTypes()
getComponentTypes
in interface IdentifierLookup
public java.util.List<java.lang.String> getQueueIdentifiers()
getQueueIdentifiers
in interface IdentifierLookup
public boolean isConnected()
public void setConnectionStatus(NodeConnectionStatus connectionStatus)
public void heartbeat()
public java.util.List<ProvenanceEventRecord> getProvenanceEvents(long firstEventId, int maxRecords) throws java.io.IOException
EventAccess
firstEventId
.getProvenanceEvents
in interface EventAccess
firstEventId
- the ID of the first event to obtainmaxRecords
- the maximum number of records to obtainjava.io.IOException
- if unable to get recordspublic Authorizable createLocalDataAuthorizable(java.lang.String componentId)
ProvenanceAuthorizableFactory
createLocalDataAuthorizable
in interface ProvenanceAuthorizableFactory
componentId
- the ID of the component to which the Data belongspublic Authorizable createRemoteDataAuthorizable(java.lang.String remoteGroupPortId)
ProvenanceAuthorizableFactory
createRemoteDataAuthorizable
in interface ProvenanceAuthorizableFactory
remoteGroupPortId
- the ID of the remote group port to which the data belongspublic java.util.List<Action> getFlowChanges(int firstActionId, int maxActions)
EventAccess
firstActionId
.getFlowChanges
in interface EventAccess
firstActionId
- the id of the first action to obtainmaxActions
- the maximum number of actions to obtainpublic java.lang.Integer getRemoteSiteListeningPort()
public java.lang.Integer getRemoteSiteListeningHttpPort()
public java.lang.Boolean isRemoteSiteCommsSecure()
public ProcessScheduler getProcessScheduler()
public java.util.Set<java.lang.String> getControllerServiceIdentifiers(java.lang.Class<? extends ControllerService> serviceType, java.lang.String groupId)
getControllerServiceIdentifiers
in interface ControllerServiceProvider
serviceType
- type of service to get identifiers forgroupId
- the ID of the Process Group to look in for Controller Servicespublic ProvenanceRepository getProvenanceRepository()
getProvenanceRepository
in interface EventAccess
public StatusHistoryDTO getConnectionStatusHistory(java.lang.String connectionId)
public StatusHistoryDTO getConnectionStatusHistory(java.lang.String connectionId, java.util.Date startTime, java.util.Date endTime, int preferredDataPoints)
public StatusHistoryDTO getProcessorStatusHistory(java.lang.String processorId, boolean includeCounters)
public StatusHistoryDTO getProcessorStatusHistory(java.lang.String processorId, java.util.Date startTime, java.util.Date endTime, int preferredDataPoints, boolean includeCounters)
public StatusHistoryDTO getProcessGroupStatusHistory(java.lang.String processGroupId)
public StatusHistoryDTO getProcessGroupStatusHistory(java.lang.String processGroupId, java.util.Date startTime, java.util.Date endTime, int preferredDataPoints)
public StatusHistoryDTO getRemoteProcessGroupStatusHistory(java.lang.String remoteGroupId)
public StatusHistoryDTO getRemoteProcessGroupStatusHistory(java.lang.String remoteGroupId, java.util.Date startTime, java.util.Date endTime, int preferredDataPoints)
public java.util.Collection<FlowFileQueue> getAllQueues()
getAllQueues
in interface QueueProvider
FlowFileQueue
s that currently exist in the flow