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 |
|---|---|
private List<FlowFile> |
binContents |
private Set<String> |
binIndexSet |
private long |
creationMomentEpochNs |
private String |
fileCountAttribute |
static String |
FRAGMENT_INDEX_ATTRIBUTE |
private static Pattern |
intPattern |
private static org.slf4j.Logger |
logger |
private int |
maximumEntries |
private long |
maximumSizeBytes |
private int |
minimumEntries |
private long |
minimumSizeBytes |
private ProcessSession |
session |
private long |
size |
private int |
successiveFailedOfferings |
| Constructor and Description |
|---|
Bin(ProcessSession session,
long minSizeBytes,
long maxSizeBytes,
int minEntries,
int maxEntries,
String fileCountAttribute)
Constructs a new bin
|
| Modifier and Type | Method and Description |
|---|---|
long |
getBinAge() |
List<FlowFile> |
getContents() |
ProcessSession |
getSession() |
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 static final org.slf4j.Logger logger
public static final String FRAGMENT_INDEX_ATTRIBUTE
private final ProcessSession session
private final long creationMomentEpochNs
private final long minimumSizeBytes
private final long maximumSizeBytes
private volatile int minimumEntries
private volatile int maximumEntries
private final String fileCountAttribute
private long size
private int successiveFailedOfferings
private static final Pattern intPattern
public Bin(ProcessSession session, long minSizeBytes, long maxSizeBytes, int minEntries, int maxEntries, String fileCountAttribute)
session - the sessionminSizeBytes - min bytesmaxSizeBytes - max bytesminEntries - min entriesmaxEntries - max entriesfileCountAttribute - num filesIllegalArgumentException - if the min is not less than or equal to the max.public ProcessSession getSession()
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<FlowFile> getContents()
public long getBinAge()
Copyright © 2019 Apache NiFi Project. All rights reserved.