Class PartitionMetadata.Builder

  • Enclosing class:
    PartitionMetadata

    public static class PartitionMetadata.Builder
    extends java.lang.Object
    Partition metadata builder for better user experience. Defaults for all fields are nulls.
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setPartitionToken

        public PartitionMetadata.Builder setPartitionToken​(java.lang.String partitionToken)
        Sets the unique partition identifier.
      • setParentTokens

        public PartitionMetadata.Builder setParentTokens​(@Nullable
                                                         java.util.HashSet<java.lang.String> parentTokens)
        Sets the collection of parent partition identifiers.
      • setStartTimestamp

        public PartitionMetadata.Builder setStartTimestamp​(com.google.cloud.Timestamp startTimestamp)
        Sets the start time of the partition.
      • setEndTimestamp

        public PartitionMetadata.Builder setEndTimestamp​(com.google.cloud.Timestamp endTimestamp)
        Sets the end time of the partition.
      • setHeartbeatMillis

        public PartitionMetadata.Builder setHeartbeatMillis​(long heartbeatMillis)
        Sets the heartbeat interval in millis.
      • setWatermark

        public PartitionMetadata.Builder setWatermark​(com.google.cloud.Timestamp watermark)
        Sets the watermark (last processed timestamp) for the partition.
      • setCreatedAt

        public PartitionMetadata.Builder setCreatedAt​(com.google.cloud.Timestamp createdAt)
        Sets the time at which the partition was created.
      • setScheduledAt

        public PartitionMetadata.Builder setScheduledAt​(@Nullable
                                                        com.google.cloud.Timestamp scheduledAt)
        Sets the time at which the partition was scheduled.
      • setRunningAt

        public PartitionMetadata.Builder setRunningAt​(@Nullable
                                                      com.google.cloud.Timestamp runningAt)
        Sets the time at which the partition started running.
      • setFinishedAt

        public PartitionMetadata.Builder setFinishedAt​(@Nullable
                                                       com.google.cloud.Timestamp finishedAt)
        Sets the time at which the partition finished running.
      • build

        public PartitionMetadata build()
        Builds a PartitionMetadata from the given fields. Mandatory fields are:
        • partition token
        • parent tokens
        • start timestamp
        • heartbeat millis
        • state
        • watermark