Class TopicStatsClientImpl
java.lang.Object
com.google.cloud.pubsublite.internal.ApiResourceAggregation
com.google.cloud.pubsublite.internal.TopicStatsClientImpl
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource,ApiBackgroundResource,TopicStatsClient,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionTopicStatsClientImpl(CloudRegion region, TopicStatsServiceClient serviceClient) -
Method Summary
Modifier and TypeMethodDescriptioncomputeCursorForEventTime(TopicPath path, Partition partition, com.google.protobuf.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.computeCursorForPublishTime(TopicPath path, Partition partition, com.google.protobuf.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.com.google.api.core.ApiFuture<Cursor>computeHeadCursor(TopicPath path, Partition partition) Compute the head cursor for the partition.com.google.api.core.ApiFuture<ComputeMessageStatsResponse>computeMessageStats(TopicPath path, Partition partition, Offset start, Offset end) Compute statistics about the messages between two cursors in a topic partition.region()The Google Cloud region this client operates on.Methods inherited from class com.google.cloud.pubsublite.internal.ApiResourceAggregation
awaitTermination, close, isShutdown, isTerminated, shutdown, shutdownNowMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.cloud.pubsublite.internal.ApiBackgroundResource
closeMethods inherited from interface com.google.api.gax.core.BackgroundResource
awaitTermination, isShutdown, isTerminated, shutdown, shutdownNow
-
Constructor Details
-
TopicStatsClientImpl
-
-
Method Details
-
region
Description copied from interface:TopicStatsClientThe Google Cloud region this client operates on.- Specified by:
regionin interfaceTopicStatsClient
-
computeMessageStats
public com.google.api.core.ApiFuture<ComputeMessageStatsResponse> computeMessageStats(TopicPath path, Partition partition, Offset start, Offset end) Description copied from interface:TopicStatsClientCompute statistics about the messages between two cursors in a topic partition.- Specified by:
computeMessageStatsin interfaceTopicStatsClient- Parameters:
path- The topic to compute statistics onpartition- The partition to compute statistics forstart- The start cursorend- The end cursor- Returns:
- A future that will have either an error
ApiExceptionor the ComputeMessageStatistics on success.
-
computeHeadCursor
Description copied from interface:TopicStatsClientCompute 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.- Specified by:
computeHeadCursorin interfaceTopicStatsClient- Parameters:
path- The topic to compute head cursor onpartition- The partition to compute head cursor for- Returns:
- A future that will have either an error
ApiExceptionor the head cursor on success.
-
computeCursorForPublishTime
public com.google.api.core.ApiFuture<Optional<Cursor>> computeCursorForPublishTime(TopicPath path, Partition partition, com.google.protobuf.Timestamp publishTime) Description copied from interface:TopicStatsClientCompute 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.
- Specified by:
computeCursorForPublishTimein interfaceTopicStatsClient- Parameters:
path- The topic to compute cursor forpartition- The partition to compute cursor forpublishTime- The target publish time- Returns:
- A future that will have either an error
ApiException, an empty Optional or a non-nullCursor.
-
computeCursorForEventTime
public com.google.api.core.ApiFuture<Optional<Cursor>> computeCursorForEventTime(TopicPath path, Partition partition, com.google.protobuf.Timestamp eventTime) Description copied from interface:TopicStatsClientCompute 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.
- Specified by:
computeCursorForEventTimein interfaceTopicStatsClient- Parameters:
path- The topic to compute cursor forpartition- The partition to compute cursor foreventTime- The target event time- Returns:
- A future that will have either an error
ApiException, an empty Optional or a non-nullCursor.
-