Guess it depends what you actually want to achieve?
Also note: `InMemoryWindowStore` is an internal class, and thus might
change at any point, and it was never designed to be extended...
-Matthias
On 1/13/23 2:55 PM, Upesh Desai wrote:
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
<https://www.itrsgroup.com/>
Upesh Desai
Senior Software Developer
*ude...@itrsgroup.com* <mailto:ude...@itrsgroup.com>
*www.itrsgroup.com* <https://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]