public class BinManager extends Object
| Modifier and Type | Field and Description |
|---|---|
private int |
binCount |
private AtomicReference<String> |
fileCountAttribute |
private Map<String,List<Bin>> |
groupBinMap |
private AtomicInteger |
maxBinAgeSeconds |
private AtomicInteger |
maxEntries |
private AtomicLong |
maxSizeBytes |
private AtomicInteger |
minEntries |
private AtomicLong |
minSizeBytes |
private Lock |
rLock |
private ReentrantReadWriteLock |
rwLock |
private Lock |
wLock |
| Constructor and Description |
|---|
BinManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsOldBins() |
int |
getBinCount() |
String |
getFileCountAttribute() |
Set<FlowFile> |
offer(String groupIdentifier,
Collection<FlowFile> flowFiles,
ProcessSession session,
ProcessSessionFactory sessionFactory)
Adds the given flowFiles to the first available bin in which it fits for the given group or creates a new bin in the specified group if necessary.
|
boolean |
offer(String groupIdentifier,
FlowFile flowFile,
ProcessSession session,
ProcessSessionFactory sessionFactory)
Adds the given flowFile to the first available bin in which it fits for the given group or creates a new bin in the specified group if necessary.
|
void |
purge() |
Bin |
removeOldestBin() |
Collection<Bin> |
removeReadyBins(boolean relaxFullnessConstraint)
Finds all bins that are considered full and removes them from the manager.
|
void |
setFileCountAttribute(String fileCountAttribute) |
void |
setMaxBinAge(int seconds) |
void |
setMaximumEntries(int maximumEntries) |
void |
setMaximumSize(long numBytes) |
void |
setMinimumEntries(int minimumEntries) |
void |
setMinimumSize(long numBytes) |
private final AtomicLong minSizeBytes
private final AtomicLong maxSizeBytes
private final AtomicInteger minEntries
private final AtomicInteger maxEntries
private final AtomicReference<String> fileCountAttribute
private final AtomicInteger maxBinAgeSeconds
private final ReentrantReadWriteLock rwLock
private final Lock rLock
private final Lock wLock
private int binCount
public void purge()
public void setFileCountAttribute(String fileCountAttribute)
public String getFileCountAttribute()
public void setMinimumEntries(int minimumEntries)
public void setMaximumEntries(int maximumEntries)
public int getBinCount()
public void setMinimumSize(long numBytes)
public void setMaximumSize(long numBytes)
public void setMaxBinAge(int seconds)
public boolean offer(String groupIdentifier, FlowFile flowFile, ProcessSession session, ProcessSessionFactory sessionFactory)
groupIdentifier - the group to which the flow file belongs; can be nullflowFile - the flow file to binsession - the ProcessSession to which the FlowFile belongssessionFactory - a ProcessSessionFactory that can be used to create a new ProcessSession in order to
create a new bin if necessarypublic Set<FlowFile> offer(String groupIdentifier, Collection<FlowFile> flowFiles, ProcessSession session, ProcessSessionFactory sessionFactory)
groupIdentifier - the group to which the flow file belongs; can be nullflowFiles - the flow files to binsession - the ProcessSession to which the FlowFiles belongsessionFactory - a ProcessSessionFactory that can be used to create a new ProcessSession in order to
create a new bin if necessarypublic Collection<Bin> removeReadyBins(boolean relaxFullnessConstraint)
relaxFullnessConstraint - if false will require bins to be full before considered ready; if true bins only have to meet their minimum size criteria or be 'old' and then they'll be
considered readypublic Bin removeOldestBin()
public boolean containsOldBins()
Copyright © 2019 Apache NiFi Project. All rights reserved.