public abstract class Backlog
extends java.lang.Object
byte[] representations must be lexicographically comparable. Backlog byte[]
representations should preferably represent a linear space and be comparable within the same
partition.
It is up to each restriction tracker to convert between their natural representation of outstanding work and this representation. For example:
messages / bytes that have not been processed represented
as a big endian 64 bit unsigned integer.
RestrictionTrackers should implement Backlogs.HasBacklog to report a backlog
where the element and restriction pair uniquely identify the resource. Otherwise RestrictionTrackers should implement Backlogs.HasPartitionedBacklog to report a backlog
for a shared resource such as a message queue.
See Bundles w/ SplittableDoFns: Backlog & Splitting for further details.
| Constructor and Description |
|---|
Backlog() |
| Modifier and Type | Method and Description |
|---|---|
java.math.BigDecimal |
backlog()
Returns the
byte[] representation of the backlog if it is known. |
protected abstract java.math.BigDecimal |
backlogInternal() |
boolean |
isUnknown()
Returns whether this backlog is known or unknown.
|
static Backlog |
of(java.math.BigDecimal backlog)
Returns a backlog represented by the specified bytes.
|
static Backlog |
unknown()
Returns an unknown backlog.
|
public static Backlog of(java.math.BigDecimal backlog)
public static Backlog unknown()
public boolean isUnknown()
public java.math.BigDecimal backlog()
byte[] representation of the backlog if it is known.java.lang.IllegalStateException - if the backlog is unknown.@Nullable protected abstract java.math.BigDecimal backlogInternal()