Stamped — Orderable Value At Timestamp

Stamped represents a value at a given timestamp.

Stamped takes the following when created:

  • Value (of type V)

  • Timestamp

Stamped values can be compared (and hence ordered) by timestamp (in ascending order).

import org.apache.kafka.streams.processor.internals.Stamped

// three stampeds in ascending order
val s1 = new Stamped("a", 0)
val s2 = new Stamped("b", 1)
val s3 = new Stamped("c", 2)

// Adding the stampeds in a random order
// TreeSet is a concrete SortedSet
import java.util.TreeSet
import collection.JavaConverters._
val stampeds = new TreeSet(Seq(s3, s1, s2).asJava)

assert(stampeds.asScala == Set(s1, s2, s3))
Table 1. Stampeds
Stamped Description

StampedRecord

Uses Kafka ConsumerRecords for values

PunctuationSchedule

Uses ProcessorNodes for values

results matching ""

    No results matching ""