GitHub user guozhangwang opened a pull request:
https://github.com/apache/kafka/pull/2381
KAFKA-3502: move RocksDB options construction to init()
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.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/guozhangwang/kafka
K3502-pure-virtual-function-unit-tests
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/kafka/pull/2381.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2381
----
commit 78870f73fbdc6c4e708b5ebe9d9c4c1e495e5a5d
Author: Guozhang Wang <[email protected]>
Date: 2017-01-15T06:22:37Z
move options construction to init()
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---