Interface TopicStatsClient
-
- All Superinterfaces:
ApiBackgroundResource
,AutoCloseable
,com.google.api.gax.core.BackgroundResource
- All Known Implementing Classes:
TopicStatsClientImpl
public interface TopicStatsClient extends ApiBackgroundResource
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description com.google.api.core.ApiFuture<Optional<Cursor>>
computeCursorForEventTime(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.com.google.api.core.ApiFuture<Optional<Cursor>>
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.static TopicStatsClient
create(TopicStatsClientSettings settings)
CloudRegion
region()
The Google Cloud region this client operates on.-
Methods inherited from interface com.google.cloud.pubsublite.internal.ApiBackgroundResource
close
-
-
-
-
Method Detail
-
create
static TopicStatsClient create(TopicStatsClientSettings settings) throws com.google.api.gax.rpc.ApiException
- Throws:
com.google.api.gax.rpc.ApiException
-
region
CloudRegion region()
The Google Cloud region this client operates on.
-
computeMessageStats
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.- 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
ApiException
or the ComputeMessageStatistics on success.
-
computeHeadCursor
com.google.api.core.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:
path
- The topic to compute head cursor onpartition
- The partition to compute head cursor for- Returns:
- A future that will have either an error
ApiException
or the head cursor on success.
-
computeCursorForPublishTime
com.google.api.core.ApiFuture<Optional<Cursor>> 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. 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:
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
com.google.api.core.ApiFuture<Optional<Cursor>> computeCursorForEventTime(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. 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:
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
.
-
-