public class Bin extends Object
Bin objects are NOT thread safe. If multiple threads access a Bin, the caller must synchronize
access.| Modifier and Type | Field and Description |
|---|---|
(package private) List<FlowFileSessionWrapper> |
binContents |
private long |
creationMomentEpochNs |
private String |
fileCountAttribute |
private static Pattern |
intPattern |
private int |
maximumEntries |
private long |
maximumSizeBytes |
private int |
minimumEntries |
private long |
minimumSizeBytes |
(package private) long |
size |
(package private) int |
successiveFailedOfferings |
| Constructor and Description |
|---|
Bin(long minSizeBytes,
long maxSizeBytes,
int minEntries,
int maxEntries,
String fileCountAttribute)
Constructs a new bin
|
| Modifier and Type | Method and Description |
|---|---|
long |
getBinAge() |
List<FlowFileSessionWrapper> |
getContents() |
boolean |
isFull()
Indicates whether the bin has enough items to be considered full.
|
boolean |
isFullEnough()
Indicates enough size exists to meet the minimum requirements
|
boolean |
isOlderThan(Bin other)
Determines if this bin is older than the specified bin
|
boolean |
isOlderThan(int duration,
TimeUnit unit)
Determines if this bin is older than the time specified.
|
boolean |
offer(FlowFile flowFile,
ProcessSession session)
If this bin has enough room for the size of the given flow file then it is added otherwise it is not
|
Integer |
toInteger(String value) |
private final long creationMomentEpochNs
private final long minimumSizeBytes
private final long maximumSizeBytes
private volatile int minimumEntries
private volatile int maximumEntries
private final String fileCountAttribute
final List<FlowFileSessionWrapper> binContents
long size
int successiveFailedOfferings
private static final Pattern intPattern
public Bin(long minSizeBytes,
long maxSizeBytes,
int minEntries,
int maxEntries,
String fileCountAttribute)
minSizeBytes - min bytesmaxSizeBytes - max bytesminEntries - min entriesmaxEntries - max entriesfileCountAttribute - num filesIllegalArgumentException - if the min is not less than or equal to the max.public boolean isFull()
public boolean isFullEnough()
public boolean isOlderThan(int duration,
TimeUnit unit)
duration - durationunit - unitpublic boolean isOlderThan(Bin other)
other - other binpublic boolean offer(FlowFile flowFile, ProcessSession session)
flowFile - flowfile to offersession - the ProcessSession to which the FlowFile belongspublic List<FlowFileSessionWrapper> getContents()
public long getBinAge()
Copyright © 2016 Apache NiFi Project. All rights reserved.