KAFKA-3502: move RocksDB options construction to init()#2381
KAFKA-3502: move RocksDB options construction to init()#2381guozhangwang wants to merge 7 commits intoapache:trunkfrom
Conversation
|
ping @enothereska @dguy @mjsax for reviews. |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
mjsax
left a comment
There was a problem hiding this comment.
This fix seems to be incomplete:
org.apache.kafka.streams.state.internals.SegmentIteratorTest > shouldOnlyIterateOverSegmentsInRange PASSED
pure virtual method called
terminate called without an active exception
Looking into it. |
|
Found another issue with |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
dguy
left a comment
There was a problem hiding this comment.
1 minor comment, otherwise LGTM
| private static final String APP_ID = "app-id"; | ||
|
|
||
| private KStreamTestDriver driver = null; | ||
| private KStreamBuilder builder = null; |
There was a problem hiding this comment.
The KStreamBuilder could be created here. Can also be final
…into K3502-pure-virtual-function-unit-tests
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
| final MockProcessorContext context = new MockProcessorContext(null, | ||
| stateDir, | ||
| final MockProcessorContext context = new MockProcessorContext( | ||
| stateDir, |
There was a problem hiding this comment.
nit: the alignment got messed up on a bunch of these.
| return topology; | ||
| } | ||
|
|
||
| public ProcessorTopology globalTopology() { |
There was a problem hiding this comment.
nit: seems this is unused?
|
@guozhangwang Other than a couple nitpicks, LGTM. |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
In RocksDBStore, options / wOptions / fOptions are constructed in the constructor, which needs to be dismissed in the close() call; however in some tests, the generated topology is not initialized at all, and hence the corresponding state stores are supposed to not be able to be closed as well since their `init` function is not called. This could cause the above option objects to be not released. This is fixed in this patch to move the logic out of constructor and inside `init` functions, so that no RocksDB objects will be created in the constructor only. Also some minor cleanups: 1. In KStreamTestDriver.close(), we lost the logic to close the state stores but only call `flush`; it is now changed back to call both. 2. Moved the forwarding logic from KStreamTestDriver to MockProcessorContext to remove the mutual dependency: these functions should really be in ProcessorContext, not the test driver. Author: Guozhang Wang <wangguoz@gmail.com> Reviewers: Damian Guy <damian.guy@gmail.com>, Matthias J. Sax <matthias@confluent.io>, Jason Gustafson <jason@confluent.io> Closes #2381 from guozhangwang/K3502-pure-virtual-function-unit-tests (cherry picked from commit 1974e1b) Signed-off-by: Jason Gustafson <jason@confluent.io>
|
Thanks for the patch! Fixed one more alignment nit when merging. |
In RocksDBStore, options / wOptions / fOptions are constructed in the constructor, which needs to be dismissed in the close() call; however in some tests, the generated topology is not initialized at all, and hence the corresponding state stores are supposed to not be able to be closed as well since their `init` function is not called. This could cause the above option objects to be not released. This is fixed in this patch to move the logic out of constructor and inside `init` functions, so that no RocksDB objects will be created in the constructor only. Also some minor cleanups: 1. In KStreamTestDriver.close(), we lost the logic to close the state stores but only call `flush`; it is now changed back to call both. 2. Moved the forwarding logic from KStreamTestDriver to MockProcessorContext to remove the mutual dependency: these functions should really be in ProcessorContext, not the test driver. Author: Guozhang Wang <wangguoz@gmail.com> Reviewers: Damian Guy <damian.guy@gmail.com>, Matthias J. Sax <matthias@confluent.io>, Jason Gustafson <jason@confluent.io> Closes apache#2381 from guozhangwang/K3502-pure-virtual-function-unit-tests
In RocksDBStore, options / wOptions / fOptions are constructed in the constructor, which needs to be dismissed in the close() call; however in some tests, the generated topology is not initialized at all, and hence the corresponding state stores are supposed to not be able to be closed as well since their
initfunction is not called. This could cause the above option objects to be not released.This is fixed in this patch to move the logic out of constructor and inside
initfunctions, so that no RocksDB objects will be created in the constructor only. Also some minor cleanups:flush; it is now changed back to call both.