public class Policies
extends java.lang.Object
Constructor and Description |
---|
Policies() |
Modifier and Type | Method and Description |
---|---|
static <T,K,L extends java.util.List<T>> |
alwaysInsert()
Returns an insertion policy that indicates the tuple
is to be inserted into the partition.
|
static <T,K,L extends java.util.List<T>> |
countContentsPolicy(int count)
Returns a count-based contents policy.
|
static <T,K,L extends java.util.List<T>> |
doNothing()
A
BiConsumer policy which does nothing. |
static <T,K,L extends java.util.List<T>> |
evictAll()
Returns a Consumer representing an evict determiner that evict all tuples
from the window.
|
static <T,K> Consumer<Partition<T,K,java.util.List<T>>> |
evictAllAndScheduleEvictWithProcess(long time,
java.util.concurrent.TimeUnit unit)
An eviction policy which processes the window, evicts all tuples, and
schedules the next eviction after the appropriate interval.
|
static <T,K> Consumer<Partition<T,K,InsertionTimeList<T>>> |
evictOlderWithProcess(long time,
java.util.concurrent.TimeUnit unit)
An eviction policy which evicts all tuples that are older than a specified time.
|
static <T,K,L extends java.util.List<T>> |
evictOldest()
Returns an evict determiner that evicts the oldest tuple.
|
static <T> Supplier<InsertionTimeList<T>> |
insertionTimeList() |
static <T,K,L extends java.util.List<T>> |
processOnInsert()
Returns a trigger policy that triggers
processing on every insert.
|
static <T,K,L extends java.util.List<T>> |
processWhenFullAndEvict(int size)
Returns a trigger policy that triggers when the size of a partition
equals or exceeds a value, and then evicts its contents.
|
static <T,K,L extends java.util.List<T>> |
scheduleEvictIfEmpty(long time,
java.util.concurrent.TimeUnit unit)
A policy which schedules a future partition eviction if the partition is empty.
|
static <T,K,L extends java.util.List<T>> |
scheduleEvictOnFirstInsert(long time,
java.util.concurrent.TimeUnit unit)
A policy which schedules a future partition eviction on the first insert.
|
public static <T,K,L extends java.util.List<T>> BiConsumer<Partition<T,K,L>,T> scheduleEvictIfEmpty(long time, java.util.concurrent.TimeUnit unit)
T
- Tuple TypeK
- Key typeL
- List type for the partition contents.time
- The time span in which tuple are permitted in the partition.unit
- The units of time.public static <T,K,L extends java.util.List<T>> BiConsumer<Partition<T,K,L>,T> scheduleEvictOnFirstInsert(long time, java.util.concurrent.TimeUnit unit)
T
- Tuple TypeK
- Key typeL
- List type for the partition contents.time
- The time span in which tuple are permitted in the partition.unit
- The units of time.public static <T,K> Consumer<Partition<T,K,InsertionTimeList<T>>> evictOlderWithProcess(long time, java.util.concurrent.TimeUnit unit)
T
- Tuple TypeK
- Key typetime
- The timespan in which tuple are permitted in the partition.unit
- The units of time.public static <T,K> Consumer<Partition<T,K,java.util.List<T>>> evictAllAndScheduleEvictWithProcess(long time, java.util.concurrent.TimeUnit unit)
T
- Tuple TypeK
- Key typetime
- The timespan in which tuple are permitted in the partition.unit
- The units of time.public static <T,K,L extends java.util.List<T>> BiFunction<Partition<T,K,L>,T,java.lang.Boolean> alwaysInsert()
T
- Tuple typeK
- Key typeL
- List type for the partition contents.public static <T,K,L extends java.util.List<T>> BiConsumer<Partition<T,K,L>,T> countContentsPolicy(int count)
count
then partition.evict()
is called.T
- Tuple typeK
- Key typeL
- List type for the partition contents.count
- the countpublic static <T,K,L extends java.util.List<T>> Consumer<Partition<T,K,L>> evictAll()
T
- Tuple typeK
- Key typeL
- List type for the partition contents.public static <T,K,L extends java.util.List<T>> Consumer<Partition<T,K,L>> evictOldest()
T
- Tuple typeK
- Key typeL
- List type for the partition contents.public static <T,K,L extends java.util.List<T>> BiConsumer<Partition<T,K,L>,T> processOnInsert()
T
- Tuple typeK
- Key typeL
- List type for the partition contents.public static <T,K,L extends java.util.List<T>> BiConsumer<Partition<T,K,L>,T> processWhenFullAndEvict(int size)
T
- Tuple typeK
- Key typeL
- List type for the partition contents.size
- partition sizepublic static <T,K,L extends java.util.List<T>> BiConsumer<Partition<T,K,L>,T> doNothing()
BiConsumer
policy which does nothing.T
- Tuple typeK
- Key typeL
- List type for the partition contents.public static <T> Supplier<InsertionTimeList<T>> insertionTimeList()
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641