Provides a code example for using timestamps on HPE Ezmeral Data Fabric Event Store streams and topics.
Log compaction is enabled through the HPE Ezmeral Data Fabric Event Store
StreamDescriptor interface with the setCompact method
where the compact value is set to true. Additionally, use the
setDeleteRetentionMS and setMinCompactionLagMS methods
to set the time delay before compacting records and the time that deleted records are
retained.
min.compaction.lag.ms
and delete.retention.ms can be set when both creating and editing
streams.// Creates a stream
// Sets log compaction on the stream
// Sets the minimum time for a message to stay uncompacted
// Sets the time that deleted records are retained.
(Admin streamAdmin = Streams.newAdmin(conf))
StreamDescriptor streamDescriptor = Streams.newStreamDescriptor();
streamDescriptor.setCompact(true);
streamDescriptor.setDeleteRetentionMS(deleteRetentionMs);
streamDescriptor.setMinCompactionLagMS(minCompactionLagMs);
streamAdmin.editStream(streamName, streamDesc);
}