Package org.apache.beam.fn.harness
Interface Cache.Shrinkable<V>
-
- All Known Implementing Classes:
PrecombineGroupingTable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@ThreadSafe @FunctionalInterface public static interface Cache.Shrinkable<V>An interface that marks an object that can be reduced in size instead of being evicted completely.Types should consider implementing
Weightedto not invoke the overhead of using thedefault weighermultiple times.This interface may be invoked from any other thread that manipulates the cache causing this value to be shrunk. Implementers must ensure thread safety with respect to any side effects caused.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Vshrink()Returns a new object that is smaller than the object being evicted.
-
-
-
Method Detail
-
shrink
@Nullable V shrink()
Returns a new object that is smaller than the object being evicted.It is recommended to return an object that is at most half as large as the one being evicted. If
nullis returned then the object will be evicted.
-
-