Пример #1
0
 def _on_changelog_sent(self, fut: FutureMessage) -> None:
     # This is what keeps the offset in RocksDB so that at startup
     # we know what offsets we already have data for in the database.
     #
     # Kafka Streams has a global ".checkpoint" file, but we store
     # it in each individual RocksDB database file.
     # Eevery partition in the table will have its own database file,
     #  this is required as partitions can easily move from and to
     #  machine as nodes die and recover.
     res: RecordMetadata = fut.result()
     self.data.set_persisted_offset(res.topic_partition, res.offset)
Пример #2
0
 def _on_changelog_sent(self, fut: FutureMessage) -> None:
     # This is what keeps the offset in RocksDB so that at startup
     # we know what offsets we already have data for in the database.
     #
     # Kafka Streams has a global ".checkpoint" file, but we store
     # it in each individual RocksDB database file.
     # Every partition in the table will have its own database file,
     #  this is required as partitions can easily move from and to
     #  machine as nodes die and recover.
     res: RecordMetadata = fut.result()
     if self.app.in_transaction:
         # for exactly-once semantics we only write the
         # persisted offset to RocksDB on disk when that partition
         # is committed.
         self.app.tables.persist_offset_on_commit(
             self.data, res.topic_partition, res.offset)
     else:
         # for normal processing (at-least-once) we just write
         # the persisted offset immediately.
         self.data.set_persisted_offset(res.topic_partition, res.offset)