public class DataFlowManagementServiceImpl extends Object implements DataFlowManagementService
Modifier and Type | Class and Description |
---|---|
private class |
DataFlowManagementServiceImpl.FlowRetrieverTimerTask
A timer task for issuing FlowRequestMessage messages to nodes to retrieve an updated flow.
|
private static class |
DataFlowManagementServiceImpl.TimingReentrantLock |
Modifier and Type | Field and Description |
---|---|
private DataFlowDao |
flowDao |
private Timer |
flowRetriever |
private AtomicLong |
lastRetrievalTime |
private static org.slf4j.Logger |
logger |
private Set<NodeIdentifier> |
nodeIds |
private DataFlowManagementServiceImpl.TimingReentrantLock |
resourceLock |
private long |
retrievableAfterTime |
private AtomicInteger |
retrievalDelaySeconds |
private ClusterManagerProtocolSender |
sender |
private AtomicBoolean |
stopRequested |
Constructor and Description |
---|
DataFlowManagementServiceImpl(DataFlowDao flowDao,
ClusterManagerProtocolSender sender) |
Modifier and Type | Method and Description |
---|---|
long |
getLastRetrievalTime() |
Set<NodeIdentifier> |
getNodeIds()
Returns the set of node identifiers the service is using to retrieve the flow.
|
PersistedFlowState |
getPersistedFlowState() |
int |
getRetrievalDelaySeconds() |
ClusterManagerProtocolSender |
getSender() |
boolean |
isFlowCurrent() |
boolean |
isRunning() |
ClusterDataFlow |
loadDataFlow()
Loads the dataflow.
|
void |
setNodeIds(Set<NodeIdentifier> nodeIds)
Sets the node identifiers to use when attempting to retrieve the flow.
|
void |
setPersistedFlowState(PersistedFlowState flowState)
Sets the state of the flow.
|
void |
setRetrievalDelay(String retrievalDelay)
Sets the retrieval delay.
|
void |
start()
Starts the instance.
|
void |
stop()
Stops the instance.
|
void |
updateControllerServices(byte[] controllerServiceBytes)
Updates the dataflow with the given serialized form of the Controller Services that are to exist on the NCM.
|
void |
updatePrimaryNode(NodeIdentifier nodeId)
Updates the dataflow with the given primary node identifier.
|
void |
updateReportingTasks(byte[] reportingTaskBytes)
Updates the dataflow with the given serialized form of Reporting Tasks that are to exist on the NCM.
|
private static final org.slf4j.Logger logger
private final DataFlowDao flowDao
private final ClusterManagerProtocolSender sender
private final Set<NodeIdentifier> nodeIds
private final AtomicBoolean stopRequested
private final AtomicLong lastRetrievalTime
private Timer flowRetriever
private long retrievableAfterTime
private AtomicInteger retrievalDelaySeconds
private final DataFlowManagementServiceImpl.TimingReentrantLock resourceLock
public DataFlowManagementServiceImpl(DataFlowDao flowDao, ClusterManagerProtocolSender sender)
public void start()
DataFlowManagementService
start
in interface DataFlowManagementService
public boolean isRunning()
isRunning
in interface DataFlowManagementService
public void stop()
DataFlowManagementService
stop
in interface DataFlowManagementService
public ClusterDataFlow loadDataFlow() throws DaoException
DataFlowManagementService
loadDataFlow
in interface DataFlowManagementService
DaoException
public void updatePrimaryNode(NodeIdentifier nodeId)
DataFlowManagementService
updatePrimaryNode
in interface DataFlowManagementService
nodeId
- the node identifierpublic void updateControllerServices(byte[] controllerServiceBytes) throws DaoException
DataFlowManagementService
updateControllerServices
in interface DataFlowManagementService
controllerServiceBytes
- servicesDaoException
- expublic void updateReportingTasks(byte[] reportingTaskBytes) throws DaoException
DataFlowManagementService
updateReportingTasks
in interface DataFlowManagementService
reportingTaskBytes
- tasksDaoException
- expublic PersistedFlowState getPersistedFlowState()
getPersistedFlowState
in interface DataFlowManagementService
public boolean isFlowCurrent()
isFlowCurrent
in interface DataFlowManagementService
public void setPersistedFlowState(PersistedFlowState flowState)
DataFlowManagementService
setPersistedFlowState
in interface DataFlowManagementService
flowState
- the statePersistedFlowState
public Set<NodeIdentifier> getNodeIds()
DataFlowManagementService
getNodeIds
in interface DataFlowManagementService
public void setNodeIds(Set<NodeIdentifier> nodeIds)
DataFlowManagementService
setNodeIds
in interface DataFlowManagementService
nodeIds
- the node identifierspublic int getRetrievalDelaySeconds()
getRetrievalDelaySeconds
in interface DataFlowManagementService
public void setRetrievalDelay(String retrievalDelay)
DataFlowManagementService
setRetrievalDelay
in interface DataFlowManagementService
retrievalDelay
- the retrieval delay in secondspublic ClusterManagerProtocolSender getSender()
public long getLastRetrievalTime()
Copyright © 2016 Apache NiFi Project. All rights reserved.