Freigeben über


CosmosPagedIterable<T> Class

Type Parameters

T

The type of elements in a ContinuablePage<C,T>

public final class CosmosPagedIterable
extends ContinuablePagedIterable<String,T,FeedResponse<T>>

Cosmos implementation of ContinuablePagedIterable<C,T,P>.

This type is a IterableStream<T> that provides the ability to operate on pages of type FeedResponse<T> and individual items in such pages. This type supports String type continuation tokens, allowing for restarting from a previously-retrieved continuation token.

For more information on the base type, refer ContinuablePagedIterable<C,T,P>

Constructor Summary

Constructor Description
CosmosPagedIterable(CosmosPagedFlux<T> cosmosPagedFlux)

Creates instance given CosmosPagedFlux<T>.

CosmosPagedIterable(CosmosPagedFlux<T> cosmosPagedFlux, int pageSize)

Creates instance given CosmosPagedFlux<T>.

CosmosPagedIterable(CosmosPagedFlux<T> cosmosPagedFlux, int pageSize, int pagePrefetchCount)

Creates instance given CosmosPagedFlux<T>.

Method Summary

Modifier and Type Method and Description
CosmosPagedIterable<T> handle(Consumer<FeedResponse<T>> feedResponseConsumer)

Handle for invoking "side-effects" on each FeedResponse returned by CosmosPagedIterable

Methods inherited from IterableStream

Methods inherited from ContinuablePagedIterable

Methods inherited from java.lang.Object

Constructor Details

CosmosPagedIterable

public CosmosPagedIterable(CosmosPagedFlux cosmosPagedFlux)

Creates instance given CosmosPagedFlux<T>.

Parameters:

cosmosPagedFlux - the paged flux use as iterable

CosmosPagedIterable

public CosmosPagedIterable(CosmosPagedFlux cosmosPagedFlux, int pageSize)

Creates instance given CosmosPagedFlux<T>.

Parameters:

cosmosPagedFlux - the paged flux use as iterable
pageSize - the preferred pageSize to be used when pulling data from the service

CosmosPagedIterable

public CosmosPagedIterable(CosmosPagedFlux cosmosPagedFlux, int pageSize, int pagePrefetchCount)

Creates instance given CosmosPagedFlux<T>.

Parameters:

cosmosPagedFlux - the paged flux use as iterable
pageSize - the preferred pageSize to be used when pulling data from the service
pagePrefetchCount - the number of pages prefetched from the paged flux - note that this might be interpolated by Reactor - for example all numbers > 1 but < 8 will result in at least prefetching 8 pages. See reactor.util.concurrent.Queues.get(int) for more details

Method Details

handle

public CosmosPagedIterable handle(Consumer> feedResponseConsumer)

Handle for invoking "side-effects" on each FeedResponse returned by CosmosPagedIterable

Parameters:

feedResponseConsumer - handler

Returns:

CosmosPagedIterable instance with attached handler

Applies to