SAMZA-2562: [Scala cleanup] Clean up Scala in samza-kv-inmemory and samza-kv-couchbase#1404
Merged
cameronlee314 merged 2 commits intoapache:masterfrom Jul 28, 2020
Merged
Conversation
…amza-kv-couchbase
Contributor
Author
|
@bkonold Could you please review? |
bkonold
approved these changes
Jul 27, 2020
Contributor
bkonold
left a comment
There was a problem hiding this comment.
lgtm for the most part, minor comments
samza-kv-inmemory/src/main/java/org/apache/samza/storage/kv/inmemory/InMemoryKeyValueStore.java
Outdated
Show resolved
Hide resolved
samza-kv-inmemory/src/main/java/org/apache/samza/storage/kv/inmemory/InMemoryKeyValueStore.java
Outdated
Show resolved
Hide resolved
...v-inmemory/src/test/java/org/apache/samza/storage/kv/inmemory/TestInMemoryKeyValueStore.java
Outdated
Show resolved
Hide resolved
...v-inmemory/src/test/java/org/apache/samza/storage/kv/inmemory/TestInMemoryKeyValueStore.java
Outdated
Show resolved
Hide resolved
...v-inmemory/src/test/java/org/apache/samza/storage/kv/inmemory/TestInMemoryKeyValueStore.java
Show resolved
Hide resolved
lakshmi-manasa-g
pushed a commit
to lakshmi-manasa-g/samza
that referenced
this pull request
Feb 9, 2021
…amza-kv-couchbase (apache#1404) API changes: I don't think the InMemoryKeyValueStore is part of the Samza API, since InMemoryKeyValueStorageEngineFactory is supposed to be used, but the InMemoryKeyValueStore constructor did change from having one KeyValueStoreMetrics argument with a default value of new KeyValueStoreMetrics to having a required KeyValueStoreMetrics argument. I believe this only applies to Scala usage of InMemoryKeyValueStore, since Java usage requires all arguments (even ones with default values) to be passed anyways. Upgrade/usage instructions: If using the InMemoryKeyValueStore constructor in another Scala class, then add the KeyValueStoreMetrics argument. It's unlikely that anyone is depending on this constructor explicitly.
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:
samza-kv-couchbaseuses the Scala Gradle plugin but does not have Scala codesamza-kv-inmemoryis in Scala, but we are no longer using Scala in Samza, so it would be good to move to Java.samza-kv-inmemoryis missing unit testsChanges:
samza-kv-inmemoryin Java (no functional changes)samza-kv-couchbaseandsamza-kv-inmemoryInMemoryKeyValueStoreinsamza-kv-inmemory.Tests:
InMemoryKeyValueStoreand verified that they passed.InMemoryKeyValueStore../gradlew build(some of the tests insamza-testuseInMemoryKeyValueStore).API changes: I don't think the
InMemoryKeyValueStoreis part of the Samza API, sinceInMemoryKeyValueStorageEngineFactoryis supposed to be used, but theInMemoryKeyValueStoreconstructor did change from having oneKeyValueStoreMetricsargument with a default value ofnew KeyValueStoreMetricsto having a requiredKeyValueStoreMetricsargument. I believe this only applies to Scala usage ofInMemoryKeyValueStore, since Java usage requires all arguments (even ones with default values) to be passed anyways.Upgrade/usage instructions: If using the
InMemoryKeyValueStoreconstructor in another Scala class, then add theKeyValueStoreMetricsargument. It's unlikely that anyone is depending on this constructor explicitly.Notes:
While writing the unit tests, I found a couple of bugs: https://issues.apache.org/jira/browse/SAMZA-2563 (InMemoryKeyValueStore double counts deletes in metrics) and https://issues.apache.org/jira/browse/SAMZA-2564 (InMemoryKeyValueStore.snapshot does not satisfy immutability API). I did not include fixes in this PR, since I want to keep the Scala refactoring separate from any functional changes.
This PR is not intended to have any functional changes.