decaton
decaton copied to clipboard
Cleanup CompactionProcessor metrics upon subscription close
refs: https://github.com/line/decaton/pull/95#issuecomment-797296705
- In principle, we close every Decaton's internal metrics by implementing https://github.com/line/decaton/blob/master/processor/src/main/java/com/linecorp/decaton/processor/metrics/Metrics.java#L64
- But
CompactionProcessor
is an exception- Since there's no way to pass
subscriptionId
uponCompactionProcessor
instantiation,CompactionProcessor
's metrics are registered every time per task, soAbstractMetrics
isn't useable- Though we confirmed it doesn't cause much overhead
- Since there's no way to pass
- Possible fix for this will be like below:
- Make
CompactionProcessor
constructor to receive subscriptionId- Or It'd better to pass information which is available on the processor scope (partition, threadId) in addition to subscriptionId
- Add
ProcessorsBuilder#thenProcess
overload that receivessupplier
of typeFunction<ScopeInfo, DecatonProcessor>
- Make