public interface FlowFileQueue
Modifier and Type | Method and Description |
---|---|
void |
acknowledge(Collection<FlowFileRecord> flowFiles) |
void |
acknowledge(FlowFileRecord flowFile) |
DropFlowFileStatus |
cancelDropFlowFileRequest(String requestIdentifier)
Cancels the request to drop FlowFiles that has the given identifier.
|
ListFlowFileStatus |
cancelListFlowFileRequest(String requestIdentifier)
Cancels the request to list FlowFiles that has the given identifier.
|
long |
drainQueue(Queue<FlowFileRecord> sourceQueue,
List<FlowFileRecord> destination,
int maxResults,
Set<FlowFileRecord> expiredRecords)
Drains flow files from the given source queue into the given destination
list.
|
DropFlowFileStatus |
dropFlowFiles(String requestIdentifier,
String requestor)
Initiates a request to drop all FlowFiles in this queue.
|
String |
getBackPressureDataSizeThreshold() |
long |
getBackPressureObjectThreshold() |
DropFlowFileStatus |
getDropFlowFileStatus(String requestIdentifier)
Returns the current status of a Drop FlowFile Request that was initiated via the
#dropFlowFiles() method that has the given identifier |
FlowFileRecord |
getFlowFile(String flowFileUuid)
Returns the FlowFile with the given UUID or
null if no FlowFile can be found in this queue
with the given UUID |
String |
getFlowFileExpiration() |
int |
getFlowFileExpiration(TimeUnit timeUnit) |
String |
getIdentifier() |
ListFlowFileStatus |
getListFlowFileStatus(String requestIdentifier)
Returns the current status of a List FlowFile Request that was initiated via the
#listFlowFiles(String)
method that has the given identifier |
List<FlowFilePrioritizer> |
getPriorities() |
QueueSize |
getUnacknowledgedQueueSize()
Returns a QueueSize that represents all FlowFiles that are 'unacknowledged'.
|
boolean |
isActiveQueueEmpty() |
boolean |
isEmpty() |
boolean |
isFull() |
ListFlowFileStatus |
listFlowFiles(String requestIdentifier,
int maxResults)
Initiates a request to obtain a listing of FlowFiles in this queue.
|
List<FlowFileRecord> |
poll(FlowFileFilter filter,
Set<FlowFileRecord> expiredRecords) |
List<FlowFileRecord> |
poll(int maxResults,
Set<FlowFileRecord> expiredRecords) |
FlowFileRecord |
poll(Set<FlowFileRecord> expiredRecords) |
void |
purgeSwapFiles()
Destroys any Swap Files that exist for this queue without updating the FlowFile Repository
or Provenance Repository.
|
void |
put(FlowFileRecord file)
places the given file into the queue
|
void |
putAll(Collection<FlowFileRecord> files)
places the given files into the queue
|
SwapSummary |
recoverSwappedFlowFiles()
Reads any Swap Files that belong to this queue and returns a summary of what is swapped out.
|
void |
setBackPressureDataSizeThreshold(String maxDataSize) |
void |
setBackPressureObjectThreshold(long maxQueueSize)
Establishes this queue's preferred maximum work load.
|
void |
setFlowFileExpiration(String flowExpirationPeriod) |
void |
setPriorities(List<FlowFilePrioritizer> newPriorities)
Resets the comparator used by this queue to maintain order.
|
QueueSize |
size() |
void |
verifyCanList()
Ensures that a listing can be performed on the queue
|
String getIdentifier()
List<FlowFilePrioritizer> getPriorities()
SwapSummary recoverSwappedFlowFiles()
null
if no FlowFiles are swapped out for this queue.void purgeSwapFiles()
void setPriorities(List<FlowFilePrioritizer> newPriorities)
newPriorities
- the ordered list of prioritizers to use to determine
order within this queue.NullPointerException
- if arg is nullvoid setBackPressureObjectThreshold(long maxQueueSize)
maxQueueSize
- the maximum number of flow files this processor
recommends having in its work queue at any one timelong getBackPressureObjectThreshold()
void setBackPressureDataSizeThreshold(String maxDataSize)
maxDataSize
- Establishes this queue's preferred maximum data size.String getBackPressureDataSizeThreshold()
QueueSize size()
boolean isEmpty()
boolean isActiveQueueEmpty()
true
if the queue is empty or contains only FlowFiles that already are being processed
by others, false
if the queue contains at least one FlowFile that is available for processing,
regardless of whether that FlowFile(s) is in-memory or swapped out.QueueSize getUnacknowledgedQueueSize()
void acknowledge(FlowFileRecord flowFile)
void acknowledge(Collection<FlowFileRecord> flowFiles)
boolean isFull()
void put(FlowFileRecord file)
file
- to place into queuevoid putAll(Collection<FlowFileRecord> files)
files
- to place into queueFlowFileRecord poll(Set<FlowFileRecord> expiredRecords)
expiredRecords
- expired recordsList<FlowFileRecord> poll(int maxResults, Set<FlowFileRecord> expiredRecords)
maxResults
- limits how many results can be polledexpiredRecords
- for expired recordslong drainQueue(Queue<FlowFileRecord> sourceQueue, List<FlowFileRecord> destination, int maxResults, Set<FlowFileRecord> expiredRecords)
sourceQueue
- queue to drain fromdestination
- Collection to drain tomaxResults
- max number to drainexpiredRecords
- for expired recordsList<FlowFileRecord> poll(FlowFileFilter filter, Set<FlowFileRecord> expiredRecords)
String getFlowFileExpiration()
int getFlowFileExpiration(TimeUnit timeUnit)
void setFlowFileExpiration(String flowExpirationPeriod)
DropFlowFileStatus dropFlowFiles(String requestIdentifier, String requestor)
getDropFlowFileStatus(String)
and #cancelDropFlowFileStatus(String)
methods in order to obtain the status later or cancel a requestrequestIdentifier
- the identifier of the Drop FlowFile Requestrequestor
- the entity that is requesting that the FlowFiles be dropped; this will be
included in the Provenance Events that are generated.DropFlowFileStatus getDropFlowFileStatus(String requestIdentifier)
#dropFlowFiles()
method that has the given identifierrequestIdentifier
- the identifier of the Drop FlowFile Requestnull
if no
request status exists with that identifierDropFlowFileStatus cancelDropFlowFileRequest(String requestIdentifier)
getDropFlowFileStatus(String)
or
cancelDropFlowFileRequest(String)
will return null
requestIdentifier
- the identifier of the Drop FlowFile Requestnull
if no
request status exists with that identifierListFlowFileStatus listFlowFiles(String requestIdentifier, int maxResults)
Initiates a request to obtain a listing of FlowFiles in this queue. This method returns a
ListFlowFileStatus that can be used to obtain information about the FlowFiles that exist
within the queue. Additionally, the ListFlowFileStatus provides a request identifier that
can then be passed to the getListFlowFileStatus(String)
. The listing of FlowFiles
will be returned ordered by the position of the FlowFile in the queue.
Note that if maxResults is larger than the size of the "active queue" (i.e., the un-swapped queued, FlowFiles that are swapped out will not be returned.)
requestIdentifier
- the identifier of the List FlowFile RequestmaxResults
- the maximum number of FlowFileSummary objects to add to the ListFlowFileStatusIllegalStateException
- if either the source or the destination of the connection to which this queue belongs
is currently running.ListFlowFileStatus getListFlowFileStatus(String requestIdentifier)
#listFlowFiles(String)
method that has the given identifierrequestIdentifier
- the identifier of the Drop FlowFile Requestnull
if no
request status exists with that identifierListFlowFileStatus cancelListFlowFileRequest(String requestIdentifier)
getListFlowFileStatus(String)
or
cancelListFlowFileRequest(String)
will return null
requestIdentifier
- the identifier of the Drop FlowFile Requestnull
if no
request status exists with that identifierFlowFileRecord getFlowFile(String flowFileUuid) throws IOException
null
if no FlowFile can be found in this queue
with the given UUIDflowFileUuid
- the UUID of the FlowFile to retrievenull
if no FlowFile can be found in this queue
with the given UUIDIOException
- if unable to read FlowFiles that are stored on some external devicevoid verifyCanList() throws IllegalStateException
IllegalStateException
- if the queue is not in a state in which a listing can be performedCopyright © 2017 Apache NiFi Project. All rights reserved.