Repository navigation
SAMZA-2516: Migrate BaseKeyValueStorageEngineFactory to be an abstract class instead of trait - #1352
Merged
Conversation
…t class instead of trait
PanTheMan
suggested changes
Apr 28, 2020
PawasChhokra
approved these changes
May 12, 2020
PawasChhokra
left a comment
Contributor
There was a problem hiding this comment.
Just left a few minor comments. Otherwise looks good to me.
rmatharu-zz
reviewed
May 26, 2020
rmatharu-zz
reviewed
May 26, 2020
rmatharu-zz
reviewed
May 26, 2020
rmatharu-zz
reviewed
May 26, 2020
PawasChhokra
approved these changes
May 30, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues:
Changes:
BaseKeyValueStorageEngineFactoryis now an abstract class written in Java.BaseKeyValueStorageEngineFactory.Tests:
API changes:
BaseKeyValueStorageEngineFactoryis no longer a Scala trait, so that could potentially impact existing inheritors:withsyntax to mix inBaseKeyValueStorageEngineFactorywill need to be updated to useBaseKeyValueStorageEngineFactoryas an abstract class instead. If an existing Scala class usedextends BaseKeyValueStorageEngineFactory(such as howInMemoryKeyValueStorageEngineFactoryandRocksDbKeyValueStorageEngineFactoryusesBaseKeyValueStorageEngineFactory), then it should not need to change.BaseKeyValueStorageEngineFactorywon't be able to use it as an interface. A Java class will need to useBaseKeyValueStorageEngineFactoryas an abstract class. I supposeBaseKeyValueStorageEngineFactorycould work as an interface with a default implementation forgetStorageEngine, but it seems like abstract class fits the pattern better, sincegetKVStoreshouldn't be a public method.Upgrade instructions:
Any custom implementation of
BaseKeyValueStorageEngineFactoryneeds to treat it as an abstract class, not a trait/interface. If it is necessary to make changes, only class inheritance structure should need to be changed. The functionality/signature ofgetStorageEngineand the usage of thegetKVStoreabstract method are the same, so those pieces should stay the same.