Hello all,

I am currently working on creating a new InMemoryWindowStore, by extending the 
default in memory window store. One of the roadblocks I’ve run into is finding 
a way to add some custom logic when the state store is being restored from the 
changelog. I know that this is possible if I completely write the store logic 
from scratch, but we really only want to add a tiny bit of custom logic, and do 
not want to have to replicate all the existing logic.

Is there a simple way for this to be done? I see the default implementation in 
the InMemoryWindowStore :

context.register(
    root,
    (RecordBatchingStateRestoreCallback) records -> {
        for (final ConsumerRecord<byte[], byte[]> record : records) {
            put(
                Bytes.wrap(extractStoreKeyBytes(record.key())),
                record.value(),
                extractStoreTimestamp(record.key())
            );
            ChangelogRecordDeserializationHelper.applyChecksAndUpdatePosition(
                record,
                consistencyEnabled,
                position
            );
        }
    }
);


Thanks in advance!
Upesh

Upesh Desai
Senior Software Developer
ude...@itrsgroup.com
www.itrsgroup.com
Internet communications are not secure and therefore the ITRS Group does not 
accept legal responsibility for the contents of this message. Any view or 
opinions presented are solely those of the author and do not necessarily 
represent those of the ITRS Group unless otherwise specifically stated.
[itrs.email.signature]

Reply via email to