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() |
boolean |
offer(String groupIdentifier,
FlowFile flowFile,
ProcessSession session)
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 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)
groupIdentifier - the group to which the flow file belongs; can be nullflowFile - the flow file to binsession - the ProcessSession to which the FlowFile belongspublic 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 © 2016 Apache NiFi Project. All rights reserved.