[ 
https://issues.apache.org/jira/browse/KAFKA-7917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16765620#comment-16765620
 ] 

Guozhang Wang commented on KAFKA-7917:
--------------------------------------

Another related issue is https://issues.apache.org/jira/browse/KAFKA-3229: when 
we call `init` on wrapper we'd need to remember the "outer-most wrapper" store 
so that it can be returned in the `ProcessorContext#getStateStore`. So suppose 
we've done 7917 to collapse all the layers, we can remove the second `root` 
parameter and implement `init` as (i.e. we call context register in the outer 
store):

```
super.init();

context.register(batchingStateRestoreCallback);
```

Then there will be two cases:

1. the inner store is streams built-in, whose `init` not call 
context.register().
2. the inner store is user customized, which may already call 
context.register(); in this case we just need allow `ProcessorStateManager` to 
overwrite the inner store with the outer ones with the call on outer store.

> Streams store cleanup: collapse layers
> --------------------------------------
>
>                 Key: KAFKA-7917
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7917
>             Project: Kafka
>          Issue Type: Improvement
>          Components: streams
>            Reporter: John Roesler
>            Priority: Major
>
> Following on KAFKA-7916, we can consider collapsing the "streams management 
> layers" into one.
> Right now, we have:
>  * metering (also handles moving from pojo world to bytes world)
>  * change-logging
>  * caching
> This is good compositional style, but we also have some runtime overhead of 
> calling through all these layers, as well as some mental overhead of 
> understanding how many and which layers we are going through.
> Also, there are dependencies between the caching and change-logging layers.
> I _think_ it would simplify the code if we collapsed these into one layer 
> with boolean switches to turn on or off the different aspects. (rather than 
> wrapping the store with the different layers or not depending on the same 
> boolean conditions)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to