public class VolatileFlowFileRepository extends java.lang.Object implements FlowFileRepository
An in-memory implementation of the FlowFileRepository
. Upon restart, all FlowFiles will be discarded, including those that have been swapped out by a FlowFileSwapManager
.
Constructor and Description |
---|
VolatileFlowFileRepository() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
long |
getMaxFlowFileIdentifier() |
long |
getNextFlowFileSequence() |
long |
getStorageCapacity() |
long |
getUsableStorageSpace() |
void |
initialize(ResourceClaimManager claimManager)
Initializes the Content Repository, providing to it the
ContentClaimManager that is to be used for interacting with Content
Claims
|
boolean |
isVolatile() |
long |
loadFlowFiles(QueueProvider queueProvider,
long minimumSequenceNumber)
Loads all flow files found within the repository, establishes the content
claims and their reference count
|
void |
swapFlowFilesIn(java.lang.String swapLocation,
java.util.List<FlowFileRecord> flowFileRecords,
FlowFileQueue queue)
Updates the Repository to indicate that the given FlowFileRecords were
Swapped In to memory
|
void |
swapFlowFilesOut(java.util.List<FlowFileRecord> swappedOut,
FlowFileQueue queue,
java.lang.String swapLocation)
Updates the Repository to indicate that the given FlowFileRecords were
Swapped Out of memory
|
void |
updateRepository(java.util.Collection<RepositoryRecord> records)
Updates the repository with the given RepositoryRecords.
|
public void initialize(ResourceClaimManager claimManager)
FlowFileRepository
initialize
in interface FlowFileRepository
claimManager
- for handling claimspublic boolean isVolatile()
isVolatile
in interface FlowFileRepository
true
if the Repository is volatile (i.e., its data
is lost upon application restart), false
otherwisepublic long getStorageCapacity() throws java.io.IOException
getStorageCapacity
in interface FlowFileRepository
java.io.IOException
- if computing capacity failspublic long getUsableStorageSpace() throws java.io.IOException
getUsableStorageSpace
in interface FlowFileRepository
java.io.IOException
- if computing usable space failspublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public void updateRepository(java.util.Collection<RepositoryRecord> records) throws java.io.IOException
FlowFileRepository
updateRepository
in interface FlowFileRepository
records
- the records to update the repository withjava.io.IOException
- if update failspublic long loadFlowFiles(QueueProvider queueProvider, long minimumSequenceNumber) throws java.io.IOException
FlowFileRepository
loadFlowFiles
in interface FlowFileRepository
queueProvider
- the provider of FlowFile Queues into which the
FlowFiles should be enqueuedminimumSequenceNumber
- specifies the minimum value that should be
returned by a call to FlowFileRepository.getNextFlowFileSequence()
java.io.IOException
- if load failspublic long getNextFlowFileSequence()
getNextFlowFileSequence
in interface FlowFileRepository
FlowFile
s.public long getMaxFlowFileIdentifier() throws java.io.IOException
getMaxFlowFileIdentifier
in interface FlowFileRepository
FlowFile
s that currently exist in
the repository.java.io.IOException
- if computing max identifier failspublic void swapFlowFilesIn(java.lang.String swapLocation, java.util.List<FlowFileRecord> flowFileRecords, FlowFileQueue queue) throws java.io.IOException
FlowFileRepository
swapFlowFilesIn
in interface FlowFileRepository
swapLocation
- the location (e.g., a filename) from which FlowFiles
were recoveredflowFileRecords
- the records that were swapped inqueue
- the queue that the FlowFiles belong tojava.io.IOException
- if swap failspublic void swapFlowFilesOut(java.util.List<FlowFileRecord> swappedOut, FlowFileQueue queue, java.lang.String swapLocation) throws java.io.IOException
FlowFileRepository
swapFlowFilesOut
in interface FlowFileRepository
swappedOut
- the FlowFiles that were swapped out of memoryqueue
- the queue that the FlowFiles belong toswapLocation
- the location to which the FlowFiles were swappedjava.io.IOException
- if swap fails