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

public class TopicStatsClientImpl extends ApiResourceAggregation implements TopicStatsClient
  • Constructor Details

  • Method Details

    • region

      public CloudRegion region()
      Description copied from interface: TopicStatsClient
      The Google Cloud region this client operates on.
      Specified by:
      region in interface TopicStatsClient
    • computeMessageStats

      public com.google.api.core.ApiFuture<ComputeMessageStatsResponse> computeMessageStats(TopicPath path, Partition partition, Offset start, Offset end)
      Description copied from interface: TopicStatsClient
      Compute statistics about the messages between two cursors in a topic partition.
      Specified by:
      computeMessageStats in interface TopicStatsClient
      Parameters:
      path - The topic to compute statistics on
      partition - The partition to compute statistics for
      start - The start cursor
      end - The end cursor
      Returns:
      A future that will have either an error ApiException or the ComputeMessageStatistics on success.
    • computeHeadCursor

      public com.google.api.core.ApiFuture<Cursor> computeHeadCursor(TopicPath path, Partition partition)
      Description copied from interface: TopicStatsClient
      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.
      Specified by:
      computeHeadCursor in interface TopicStatsClient
      Parameters:
      path - The topic to compute head cursor on
      partition - The partition to compute head cursor for
      Returns:
      A future that will have either an error ApiException or 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: TopicStatsClient
      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.

      Specified by:
      computeCursorForPublishTime in interface TopicStatsClient
      Parameters:
      path - The topic to compute cursor for
      partition - The partition to compute cursor for
      publishTime - The target publish time
      Returns:
      A future that will have either an error ApiException, an empty Optional or a non-null Cursor.
    • computeCursorForEventTime

      public com.google.api.core.ApiFuture<Optional<Cursor>> computeCursorForEventTime(TopicPath path, Partition partition, com.google.protobuf.Timestamp eventTime)
      Description copied from interface: TopicStatsClient
      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.

      Specified by:
      computeCursorForEventTime in interface TopicStatsClient
      Parameters:
      path - The topic to compute cursor for
      partition - The partition to compute cursor for
      eventTime - The target event time
      Returns:
      A future that will have either an error ApiException, an empty Optional or a non-null Cursor.