-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom compactionFilter and mergeOperator in rocksdb engine #75
Conversation
Build succeeded. |
src/kvstore/test/KVStoreTest.cpp
Outdated
KVOptions options; | ||
options.local_ = HostAddr(0, 0); | ||
options.dataPaths_ = std::move(paths); | ||
KVStoreImpl* kv = reinterpret_cast<KVStoreImpl*>(KVStore::instance(std::move(options))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI. This is not the case where reinterpret_cast
should be used. In principle, dynamic_cast
is the right choice. While if you know the exact type, you could use static_cast
for the sake of performance.
The same to other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. static_cast will be better here.
src/kvstore/KVStoreImpl.cpp
Outdated
KVStore* KVStore::instance(HostAddr local, std::vector<std::string> paths) { | ||
auto* instance = new KVStoreImpl(local, std::move(paths)); | ||
KVStore* KVStore::instance(KVOptions options) { | ||
auto* instance = new KVStoreImpl(options); | ||
reinterpret_cast<KVStoreImpl*>(instance)->init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instance
IS of type KVStoreImpl*
, right?
The same to other places.
Build failed. |
1 similar comment
Build failed. |
Build succeeded. |
Build succeeded. |
…soft-inc#75) This reverts commit b82b870. Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com>
Patch for issue #64