public abstract class ProcessSessionWrap extends Object implements ProcessSession
| Modifier and Type | Field and Description |
|---|---|
static String |
ERROR_MESSAGE |
static String |
ERROR_STACKTRACE |
private boolean |
failureOnError |
private ProcessSession |
session |
private Map<String,FlowFile> |
toDrop |
private List<FlowFile> |
toFail |
| Constructor and Description |
|---|
ProcessSessionWrap(ProcessSession session,
boolean toFailureOnError) |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustCounter(String name,
long delta,
boolean immediate)
Adjusts counter data for the given counter name and takes care of
registering the counter if not already present.
|
SessionFile |
append(FlowFile flowFile,
OutputStreamCallback writer)
Executes the given callback against the content corresponding to the
given FlowFile, such that any data written to the OutputStream of the
content will be appended to the end of FlowFile.
|
private void |
assertNotSessionFile(FlowFile f) |
void |
clearState(Scope scope) |
SessionFile |
clone(FlowFile example)
Creates a new FlowFile that is a clone of the given FlowFile as of the
time this is called, both in content and attributes.
|
SessionFile |
clone(FlowFile parent,
long offset,
long size)
Creates a new FlowFile whose parent is the given FlowFile.
|
void |
commit()
Commits the current session ensuring all operations against FlowFiles
within this session are atomically persisted.
|
void |
commitAsync() |
void |
commitAsync(Runnable onSuccess,
Consumer<Throwable> onFailure) |
SessionFile |
create()
Creates a new FlowFile in the repository with no content and without any
linkage to a parent FlowFile.
|
SessionFile |
create(Collection<FlowFile> parents)
Creates a new FlowFile in the repository with no content but with a
parent linkage to the FlowFiles specified by the parents Collection.
|
SessionFile |
create(FlowFile parent)
Creates a new FlowFile in the repository with no content but with a
parent linkage to
parent. |
void |
exportTo(FlowFile flowFile,
OutputStream destination)
Writes the content of the given FlowFile to the given destination stream
|
void |
exportTo(FlowFile flowFile,
Path destination,
boolean append)
Writes the content of the given FlowFile to the given destination path.
|
SessionFile |
get() |
List<FlowFile> |
get(FlowFileFilter filter)
Returns all FlowFiles from all of the incoming queues for which the given
FlowFileFilter indicates should be accepted. |
List<FlowFile> |
get(int maxResults)
Returns up to
maxResults FlowFiles from the work queue. |
ProvenanceReporter |
getProvenanceReporter()
Returns a ProvenanceReporter that is tied to this ProcessSession.
|
QueueSize |
getQueueSize() |
StateMap |
getState(Scope scope) |
SessionFile |
importFrom(InputStream source,
FlowFile flowFile)
Writes to the given FlowFile all content from the given content path.
|
SessionFile |
importFrom(Path source,
boolean keepSourceFile,
FlowFile flowFile)
Writes to the given FlowFile all content from the given content path.
|
SessionFile |
merge(Collection<FlowFile> sources,
FlowFile destination)
Combines the content of all given source FlowFiles into a single given
destination FlowFile.
|
SessionFile |
merge(Collection<FlowFile> sources,
FlowFile destination,
byte[] header,
byte[] footer,
byte[] demarcator)
Combines the content of all given source FlowFiles into a single given
destination FlowFile.
|
void |
migrate(ProcessSession newOwner) |
void |
migrate(ProcessSession newOwner,
Collection<FlowFile> flowFiles) |
private void |
onClear() |
private void |
onDrop(Collection<FlowFile> ff) |
private void |
onDrop(FlowFile f)
called when the file removed
|
private FlowFile |
onGet(FlowFile f)
called when got file from incoming queue
|
private List<FlowFile> |
onGet(List<FlowFile> ff) |
private FlowFile |
onMod(FlowFile f)
called when file created or modified
|
SessionFile |
penalize(FlowFile flowFile)
Sets a penalty for the given FlowFile which will make it unavailable to
be operated on any further during the penalty period.
|
SessionFile |
putAllAttributes(FlowFile flowFile,
Map<String,String> attributes)
Updates the given FlowFiles attributes with the given key/value pairs.
|
SessionFile |
putAttribute(FlowFile flowFile,
String key,
String value)
Updates the given FlowFiles attributes with the given key/value pair.
|
InputStream |
read(FlowFile flowFile)
Provides an InputStream that can be used to read the contents of the given FlowFile.
|
void |
read(FlowFile flowFile,
boolean allowSessionStreamManagement,
InputStreamCallback reader)
Executes the given callback against the contents corresponding to the
given FlowFile.
|
void |
read(FlowFile flowFile,
InputStreamCallback reader)
Executes the given callback against the contents corresponding to the
given FlowFile.
|
void |
remove(Collection<FlowFile> flowFiles)
Ends the managed persistence for the given FlowFiles.
|
void |
remove(FlowFile flowFile)
Ends the managed persistence for the given FlowFile.
|
SessionFile |
removeAllAttributes(FlowFile flowFile,
Pattern keyPattern)
Remove all attributes from the given FlowFile that have keys which match
the given pattern.
|
SessionFile |
removeAllAttributes(FlowFile flowFile,
Set<String> keys)
Removes the attributes with the given keys from the given FlowFile.
|
SessionFile |
removeAttribute(FlowFile flowFile,
String key)
Removes the given FlowFile attribute with the given key.
|
boolean |
replaceState(StateMap oldValue,
Map<String,String> newValue,
Scope scope) |
void |
revertReceivedTo(Relationship r,
Throwable t)
transfers all input files to relationship and drops other files.
|
void |
rollback()
Reverts any changes made during this session.
|
void |
rollback(boolean penalize)
Reverts any changes made during this session.
|
void |
setState(Map<String,String> state,
Scope scope) |
void |
transfer(Collection<FlowFile> flowFiles)
Transfers the given FlowFiles back to the work queues from which the
FlowFiles were pulled.
|
void |
transfer(Collection<FlowFile> flowFiles,
Relationship relationship)
Transfers the given FlowFile to the appropriate destination processor
work queue(s) based on the given relationship.
|
void |
transfer(FlowFile flowFile)
Transfers the given FlowFile back to the work queue from which it was
pulled.
|
void |
transfer(FlowFile flowFile,
Relationship relationship)
Transfers the given FlowFile to the appropriate destination processor
work queue(s) based on the given relationship.
|
List<FlowFile> |
unwrap(Collection<FlowFile> flowFiles) |
FlowFile |
unwrap(FlowFile f) |
abstract SessionFile |
wrap(FlowFile f)
function returns wrapped flowfile with session for the simplified script access.
|
List<FlowFile> |
wrap(List<FlowFile> ff) |
OutputStream |
write(FlowFile source)
Provides an OutputStream that can be used to write to the contents of the
given FlowFile.
|
SessionFile |
write(FlowFile flowFile,
OutputStreamCallback writer)
Executes the given callback against the content corresponding to the
given FlowFile.
|
SessionFile |
write(FlowFile flowFile,
StreamCallback writer)
Executes the given callback against the content corresponding to the
given flow file.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcommitAsyncpublic static final String ERROR_STACKTRACE
public static final String ERROR_MESSAGE
private ProcessSession session
private boolean failureOnError
public ProcessSessionWrap(ProcessSession session, boolean toFailureOnError)
public abstract SessionFile wrap(FlowFile f)
public SessionFile wrap(FlowFile f) {
if (f == null) {
return null;
}
if (f instanceof SessionFile) {
return ((SessionFile) f);
}
return new SessionFile(this, f);
}public List<FlowFile> unwrap(Collection<FlowFile> flowFiles)
private void assertNotSessionFile(FlowFile f)
private void onDrop(FlowFile f)
private void onDrop(Collection<FlowFile> ff)
private void onClear()
public void revertReceivedTo(Relationship r, Throwable t)
r - where to transfer flow files, when null then transfers to input with penalize.t - the cause why we do this transfer, when relationship specified then additional properties populated: ERROR_MESSAGE and ERROR_STACKTRACE.public void commit()
Commits the current session ensuring all operations against FlowFiles within this session are atomically persisted. All FlowFiles operated on within this session must be accounted for by transfer or removal or the commit will fail.
As soon as the commit completes the session is again ready to be used
commit in interface ProcessSessionIllegalStateException - if detected that this method is being called from within a callback of another method in this session.FlowFileHandlingException - if not all FlowFiles acted upon within this session are accounted for by user code such that they have a transfer identified or where marked for removal.
Automated rollback occurs.ProcessException - if some general fault occurs while persisting the session. Initiates automatic rollback. The root cause can be obtained via Exception.getCause()public void commitAsync()
commitAsync in interface ProcessSessionpublic void commitAsync(Runnable onSuccess, Consumer<Throwable> onFailure)
commitAsync in interface ProcessSessionpublic void rollback()
rollback(boolean) passing
false as the parameter.rollback in interface ProcessSessionpublic void rollback(boolean penalize)
rollback in interface ProcessSessionpenalize - whether or not the FlowFiles that are being restored back to their queues should be penalizedpublic void adjustCounter(String name, long delta, boolean immediate)
adjustCounter in interface ProcessSessionname - the name of the counterdelta - the delta by which to modify the counter (+ or -)immediate - if true, the counter will be updated immediately, without regard to whether the ProcessSession is commit or rolled back; otherwise, the counter will be incremented only if and
when the ProcessSession is committed.public SessionFile get()
get in interface ProcessSessionpublic List<FlowFile> get(int maxResults)
maxResults FlowFiles from the work queue. If
no FlowFiles are available, returns an empty list. Will not return null.
If multiple incoming queues are present, the behavior is unspecified in
terms of whether all queues or only a single queue will be polled in a
single call.get in interface ProcessSessionmaxResults - the maximum number of FlowFiles to returnmaxResults FlowFiles from the work queue. If no FlowFiles are available, returns an empty list. Will not return null.IllegalArgumentException - if maxResults is less than 0public List<FlowFile> get(FlowFileFilter filter)
Returns all FlowFiles from all of the incoming queues for which the given
FlowFileFilter indicates should be accepted. Calls to this method
provide exclusive access to the underlying queues. I.e., no other thread
will be permitted to pull FlowFiles from this Processor's queues or add
FlowFiles to this Processor's incoming queues until this method call has
returned.
get in interface ProcessSessionfilter - to limit which flow files are returnedFlowFileFilter indicates should be accepted.public QueueSize getQueueSize()
getQueueSize in interface ProcessSessionpublic SessionFile create()
create(FlowFile) or
create(Collection).
When this method is used, a Provenance CREATE or RECEIVE Event should be
generated. See the getProvenanceReporter() method and
ProvenanceReporter class for more information
create in interface ProcessSessionpublic SessionFile create(FlowFile parent)
parent. The newly created FlowFile will
inherit all of the parent's attributes except for the UUID. This method
will automatically generate a Provenance FORK event or a Provenance JOIN
event, depending on whether or not other FlowFiles are generated from the
same parent before the ProcessSession is committed.create in interface ProcessSessionparent - to base the new flowfile onpublic SessionFile create(Collection<FlowFile> parents)
create in interface ProcessSessionparents - which the new flowfile should inherit shared attributes frompublic SessionFile clone(FlowFile example)
clone in interface ProcessSessionexample - FlowFile to be the source of cloning - given FlowFile must be a part of the given sessionIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be reference, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing FlowFile contentNullPointerException - if the argument nullpublic SessionFile clone(FlowFile parent, long offset, long size)
clone in interface ProcessSessionparent - to base the new flowfile attributes onoffset - of the parent flowfile to base the child flowfile content onsize - of the new flowfile from the offsetIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFileFlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session, or if the specified offset + size exceeds that of the size of the
parent FlowFile. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be reference, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.public SessionFile penalize(FlowFile flowFile)
penalize in interface ProcessSessionflowFile - to penalizeIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.NullPointerException - if the argument nullpublic SessionFile putAttribute(FlowFile flowFile, String key, String value)
uuid, this attribute will be ignored.putAttribute in interface ProcessSessionflowFile - to updatekey - of attributevalue - of attributeFlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.NullPointerException - if an argument is nullpublic SessionFile putAllAttributes(FlowFile flowFile, Map<String,String> attributes)
uuid, this attribute will be
ignored.putAllAttributes in interface ProcessSessionflowFile - to updateattributes - the attributes to add to the given FlowFileIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.NullPointerException - if an argument is nullpublic SessionFile removeAttribute(FlowFile flowFile, String key)
uuid, this method will return the same FlowFile without
removing any attribute.removeAttribute in interface ProcessSessionflowFile - to updatekey - of attributeIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.NullPointerException - if the argument nullpublic SessionFile removeAllAttributes(FlowFile flowFile, Set<String> keys)
uuid, this key will be ignoredremoveAllAttributes in interface ProcessSessionflowFile - to updatekeys - of attributeIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.NullPointerException - if the argument nullpublic SessionFile removeAllAttributes(FlowFile flowFile, Pattern keyPattern)
uuid, this key
will not be removed.removeAllAttributes in interface ProcessSessionflowFile - to updatekeyPattern - may be null; if supplied is matched against each of the FlowFile attribute keyspublic void transfer(FlowFile flowFile, Relationship relationship)
transfer in interface ProcessSessionflowFile - to transferrelationship - to transfer toIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.NullPointerException - if the argument nullIllegalArgumentException - if given relationship is not a known or registered relationshippublic void transfer(FlowFile flowFile)
transfer in interface ProcessSessionflowFile - to transferIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.IllegalArgumentException - if the FlowFile was created by this processorNullPointerException - if the argument nullpublic void transfer(Collection<FlowFile> flowFiles)
transfer in interface ProcessSessionflowFiles - to transferIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFiles are already transferred or removed or don't belong to this session. Automatic rollback will occur.IllegalArgumentException - if the FlowFile was created by this processorNullPointerException - if the argument nullpublic void transfer(Collection<FlowFile> flowFiles, Relationship relationship)
transfer in interface ProcessSessionflowFiles - to transferrelationship - to transfer toIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.NullPointerException - if the argument nullIllegalArgumentException - if given relationship is not a known or registered relationshippublic void remove(FlowFile flowFile)
remove in interface ProcessSessionflowFile - to removeIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.public void remove(Collection<FlowFile> flowFiles)
remove in interface ProcessSessionflowFiles - to removeIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if any of the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.public void read(FlowFile flowFile, InputStreamCallback reader) throws FlowFileAccessException
read in interface ProcessSessionflowFile - flow file to retrieve content ofreader - callback that will be called to read the flow file contentFlowFileAccessException - if some IO problem occurs accessing FlowFile content; if an attempt is made to access the InputStream provided to the given InputStreamCallback after
this method completed its executionpublic InputStream read(FlowFile flowFile)
commit() or rollback()
is called, but the responsibility of doing so belongs to the caller. The InputStream will throw
an IOException if an attempt is made to read from the stream after the session is committed or
rolled back.read in interface ProcessSessionflowFile - the FlowFile to readIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be referenced, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.public void read(FlowFile flowFile, boolean allowSessionStreamManagement, InputStreamCallback reader) throws FlowFileAccessException
Note: The OutputStream provided to the given OutputStreamCallback will not be accessible once this method has completed its execution.
read in interface ProcessSessionflowFile - flow file to retrieve content ofallowSessionStreamManagement - allow session to hold the stream open for performance reasonsreader - that will be called to read the flow file contentIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be reference, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing FlowFile content; if an attempt is made to access the InputStream provided to the given InputStreamCallback after this
method completed its executionpublic SessionFile merge(Collection<FlowFile> sources, FlowFile destination)
merge in interface ProcessSessionsources - the flowfiles to mergedestination - the flowfile to use as the merged resultIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)IllegalArgumentException - if the given destination is contained within the sourcesFlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be reference, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing FlowFile content. The state of the destination will be as it was prior to this call.public SessionFile merge(Collection<FlowFile> sources, FlowFile destination, byte[] header, byte[] footer, byte[] demarcator)
merge in interface ProcessSessionsources - to merge togetherdestination - to merge toheader - bytes that will be added to the beginning of the merged output. May be null or empty.footer - bytes that will be added to the end of the merged output. May be null or empty.demarcator - bytes that will be placed in between each object merged together. May be null or empty.IllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)IllegalArgumentException - if the given destination is contained within the sourcesFlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be reference, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing FlowFile content. The state of the destination will be as it was prior to this call.public SessionFile write(FlowFile flowFile, OutputStreamCallback writer) throws FlowFileAccessException
Note: The OutputStream provided to the given OutputStreamCallback will not be accessible once this method has completed its execution.
write in interface ProcessSessionflowFile - to write towriter - used to write new contentIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be referenced, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing FlowFile content; if an attempt is made to access the OutputStream provided to the given OutputStreamCallback after this
method completed its executionpublic SessionFile write(FlowFile flowFile, StreamCallback writer) throws FlowFileAccessException
Note: The InputStream & OutputStream provided to the given StreamCallback will not be accessible once this method has completed its execution.
write in interface ProcessSessionflowFile - to read from and write towriter - used to read the old content and write new contentIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be reference, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing FlowFile content; if an attempt is made to access the InputStream or OutputStream provided to the given StreamCallback
after this method completed its executionpublic SessionFile append(FlowFile flowFile, OutputStreamCallback writer) throws FlowFileAccessException
Note: The OutputStream provided to the given OutputStreamCallback will not be accessible once this method has completed its execution.
append in interface ProcessSessionflowFile - the flowfile for which content should be appendedwriter - used to write new bytes to the flowfile contentFlowFileAccessException - if an attempt is made to access the OutputStream provided to the given OutputStreamCallback after this method completed its executionpublic SessionFile importFrom(Path source, boolean keepSourceFile, FlowFile flowFile)
importFrom in interface ProcessSessionsource - the file from which content will be obtainedkeepSourceFile - if true the content is simply copied; if false the original content might be used in a destructive way for efficiency such that the repository will have the data but the
original data will be gone. If false the source object will be removed or gone once imported. It will not be restored if the session is rolled back
so this must be used with caution. In some cases it can result in tremendous efficiency gains but is also dangerous.flowFile - the FlowFile whose content will be updatedIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be reference, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing FlowFile contentpublic SessionFile importFrom(InputStream source, FlowFile flowFile)
importFrom in interface ProcessSessionsource - the file from which content will be obtainedflowFile - the FlowFile whose content will be updatedIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be reference, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing FlowFile contentpublic void exportTo(FlowFile flowFile, Path destination, boolean append)
exportTo in interface ProcessSessionflowFile - to export the content ofdestination - to export the content toappend - if true will append to the current content at the given path; if false will replace any current contentIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be reference, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing FlowFile contentpublic void exportTo(FlowFile flowFile, OutputStream destination)
exportTo in interface ProcessSessionflowFile - to export the content ofdestination - to export the content toIllegalStateException - if detected that this method is being called from within a callback of another method in this session and for the given FlowFile(s)FlowFileHandlingException - if the given FlowFile is already transferred or removed or doesn't belong to this session. Automatic rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be found. The FlowFile should no longer be reference, will be internally destroyed, and the session is automatically
rolled back and what is left of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing FlowFile contentpublic ProvenanceReporter getProvenanceReporter()
getProvenanceReporter in interface ProcessSessionpublic void migrate(ProcessSession newOwner)
migrate in interface ProcessSessionpublic void migrate(ProcessSession newOwner, Collection<FlowFile> flowFiles)
migrate in interface ProcessSessionpublic OutputStream write(FlowFile source)
write in interface ProcessSessionsource - to write toIllegalStateException - if detected that this method is being
called from within a callback of another method in this session and for
the given FlowFile(s), or if there is an open InputStream or OutputStream for the FlowFile's content
(see read(FlowFile)).FlowFileHandlingException - if the given FlowFile is already
transferred or removed or doesn't belong to this session. Automatic
rollback will occur.MissingFlowFileException - if the given FlowFile content cannot be
found. The FlowFile should no longer be referenced, will be internally
destroyed, and the session is automatically rolled back and what is left
of the FlowFile is destroyed.FlowFileAccessException - if some IO problem occurs accessing
FlowFile content; if an attempt is made to access the OutputStream
provided to the given OutputStreamCallaback after this method completed
its executionpublic void setState(Map<String,String> state, Scope scope) throws IOException
setState in interface ProcessSessionIOExceptionpublic StateMap getState(Scope scope) throws IOException
getState in interface ProcessSessionIOExceptionpublic boolean replaceState(StateMap oldValue, Map<String,String> newValue, Scope scope) throws IOException
replaceState in interface ProcessSessionIOExceptionpublic void clearState(Scope scope) throws IOException
clearState in interface ProcessSessionIOExceptionCopyright © 2022 Apache NiFi Project. All rights reserved.