Class TopicStatsClientImpl (1.13.0)

public class TopicStatsClientImpl extends ApiResourceAggregation implements TopicStatsClient

Inheritance

java.lang.Object > ApiResourceAggregation > TopicStatsClientImpl

Implements

TopicStatsClient

Constructors

TopicStatsClientImpl(CloudRegion region, TopicStatsServiceClient serviceClient)

public TopicStatsClientImpl(CloudRegion region, TopicStatsServiceClient serviceClient)
Parameters
NameDescription
regionCloudRegion
serviceClientTopicStatsServiceClient

Methods

computeCursorForEventTime(TopicPath path, Partition partition, Timestamp eventTime)

public ApiFuture<Optional<Cursor>> computeCursorForEventTime(TopicPath path, Partition partition, Timestamp eventTime)

Compute the cursor of the first message with event time greater than or equal to the specified event time, for a topic partition. If messages are missing an event time, the publish time is used as a fallback. As event times are user supplied, subsequent messages may have event times less than the specified event time and should be filtered by the client, if necessary.

If such a message cannot be found, the returned Optional will be empty.

Parameters
NameDescription
pathTopicPath
partitionPartition
eventTimeTimestamp
Returns
TypeDescription
ApiFuture<Optional<Cursor>>

computeCursorForPublishTime(TopicPath path, Partition partition, Timestamp publishTime)

public ApiFuture<Optional<Cursor>> computeCursorForPublishTime(TopicPath path, Partition partition, Timestamp publishTime)

Compute the cursor of the first message with publish time greater than or equal to the specified publish time, for a topic partition. All messages thereafter are guaranteed to have publish times greater than or equal to the specified publish time.

If such a message cannot be found, the returned Optional will be empty.

Parameters
NameDescription
pathTopicPath
partitionPartition
publishTimeTimestamp
Returns
TypeDescription
ApiFuture<Optional<Cursor>>

computeHeadCursor(TopicPath path, Partition partition)

public ApiFuture<Cursor> computeHeadCursor(TopicPath path, Partition partition)

Compute the head cursor for the partition. The head cursor's offset is guaranteed to be before or equal to all messages which have not yet been acknowledged to be published, and greater than the offset of any message whose publish has already been acknowledged. It is 0 if there have never been messages on the partition.

Parameters
NameDescription
pathTopicPath
partitionPartition
Returns
TypeDescription
ApiFuture<Cursor>

computeMessageStats(TopicPath path, Partition partition, Offset start, Offset end)

public ApiFuture<ComputeMessageStatsResponse> computeMessageStats(TopicPath path, Partition partition, Offset start, Offset end)

Compute statistics about the messages between two cursors in a topic partition.

Parameters
NameDescription
pathTopicPath
partitionPartition
startOffset
endOffset
Returns
TypeDescription
ApiFuture<ComputeMessageStatsResponse>

region()

public CloudRegion region()

The Google Cloud region this client operates on.

Returns
TypeDescription
CloudRegion