CheckpointCloseableIterableImpl.Builder

public static class CheckpointCloseableIterableImpl.Builder extends Object

Builder object for CheckpointCloseableIterableImpl

Public Constructor Summary

CheckpointCloseableIterableImpl.Builder(CheckpointCloseableIterable<T> delegate)
Constructs a builder that clones the given CheckpointCloseableIterable.
CheckpointCloseableIterableImpl.Builder(Collection<T> operations)
Constructs a CheckpointCloseableIterableImpl.Builder that wraps given collection.

Public Method Summary

CheckpointCloseableIterableImpl<T>
build()
Builds an instance of CheckpointCloseableIterableImpl
Builder<T>
setCheckpoint(byte[] checkpoint)
Sets checkpoint to be committed after processing of all items returned in current iterable.
Builder<T>
setCheckpoint(Supplier<byte[]> checkpoint)
Sets Supplier for checkpoint to be committed after processing of all items.
Builder<T>
setHasMore(Supplier<Boolean> hasMore)
Sets Supplier for flag to indicate if more items are available for processing beyond items returned in current Iterable.
Builder<T>
setHasMore(boolean hasMore)
Sets flag to indicate if more items are available for processing beyond items returned in current Iterable.

Inherited Method Summary

Public Constructors

public CheckpointCloseableIterableImpl.Builder (CheckpointCloseableIterable<T> delegate)

Constructs a builder that clones the given CheckpointCloseableIterable. This constructor should rarely be needed, but exists to avoid hard-to-debug errors if the CloseableIterable overload were used instead, since that would ignore the checkpoint and more items flag.

Changes to delegate are reflected in the constructed CheckpointCloseableIterable by default, unless the setCheckpoint(byte[]) or setHasMore(boolean) methods are called on this builder.

Parameters
delegate

public CheckpointCloseableIterableImpl.Builder (CloseableIterable<T> delegate)

Parameters
delegate

public CheckpointCloseableIterableImpl.Builder (Iterator<T> delegate)

Constructs a CheckpointCloseableIterableImpl.Builder that wraps given Iterator

Parameters
delegate

public CheckpointCloseableIterableImpl.Builder (Collection<T> operations)

Constructs a CheckpointCloseableIterableImpl.Builder that wraps given collection.

Parameters
operations

Public Methods

public CheckpointCloseableIterableImpl<T> build ()

Builds an instance of CheckpointCloseableIterableImpl

public Builder<T> setCheckpoint (byte[] checkpoint)

Sets checkpoint to be committed after processing of all items returned in current iterable.

Parameters
checkpoint to be committed after processing of all items.

public Builder<T> setCheckpoint (Supplier<byte[]> checkpoint)

Sets Supplier for checkpoint to be committed after processing of all items. get() is invoked only after iterating over all items.

Parameters
checkpoint to be committed after processing of all items.

public Builder<T> setHasMore (Supplier<Boolean> hasMore)

Sets Supplier for flag to indicate if more items are available for processing beyond items returned in current Iterable. get() is invoked only after iterating over all items.

Parameters
hasMore flag to indicate if more items are available for processing.

public Builder<T> setHasMore (boolean hasMore)

Sets flag to indicate if more items are available for processing beyond items returned in current Iterable.

Parameters
hasMore flag to indicate if more items are available for processing.