Class TopicStatsClientImpl (1.14.2)

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
Name Description
region CloudRegion
serviceClient TopicStatsServiceClient

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
Name Description
path TopicPath
partition Partition
eventTime Timestamp
Returns
Type Description
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
Name Description
path TopicPath
partition Partition
publishTime Timestamp
Returns
Type Description
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
Name Description
path TopicPath
partition Partition
Returns
Type Description
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
Name Description
path TopicPath
partition Partition
start Offset
end Offset
Returns
Type Description
ApiFuture<ComputeMessageStatsResponse>

region()

public CloudRegion region()

The Google Cloud region this client operates on.

Returns
Type Description
CloudRegion