You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by aljoscha <gi...@git.apache.org> on 2016/11/23 11:17:13 UTC
[GitHub] flink pull request #2855: Add Tests in StateBackendTestBase that verify Defa...
GitHub user aljoscha opened a pull request:
https://github.com/apache/flink/pull/2855
Add Tests in StateBackendTestBase that verify Default-Value Behaviour
The tests were not checking whether all backends exhibit the same behaviour when it comes to default values. This changes none of the actual code, just protects the current behaviour with tests.
R: @StephanEwen for review please since you had some thoughts about that in the past
CC: @shixiaogang #2768 should be updated to pass these
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aljoscha/flink extend-state-backend-test
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/2855.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 #2855
----
commit ab061a26bcd26cc88adbc4a50ecbec457aee2ddb
Author: Aljoscha Krettek <al...@gmail.com>
Date: 2016-11-23T11:13:05Z
Add Tests in StateBackendTestBase that verify Default-Value Behaviour
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #2855: Add Tests in StateBackendTestBase that verify Defa...
Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/2855#discussion_r89792484
--- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java ---
@@ -659,6 +655,116 @@ public void testFoldingState() {
}
/**
+ * Verify that an empty {@code ValueState} will yield the default value.
+ */
+ @Test
+ public void testValueStateDefaultValue() throws Exception {
+ AbstractKeyedStateBackend<Integer> backend = createKeyedBackend(IntSerializer.INSTANCE);
+
+ ValueStateDescriptor<String> kvId = new ValueStateDescriptor<>("id", String.class, "Hello");
--- End diff --
Adding that as an additional test.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink issue #2855: Add Tests in StateBackendTestBase that verify Default-Val...
Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha commented on the issue:
https://github.com/apache/flink/pull/2855
Thanks for reviewing, @StefanRRichter!
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #2855: Add Tests in StateBackendTestBase that verify Defa...
Posted by StefanRRichter <gi...@git.apache.org>.
Github user StefanRRichter commented on a diff in the pull request:
https://github.com/apache/flink/pull/2855#discussion_r89782543
--- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/state/StateBackendTestBase.java ---
@@ -659,6 +655,116 @@ public void testFoldingState() {
}
/**
+ * Verify that an empty {@code ValueState} will yield the default value.
+ */
+ @Test
+ public void testValueStateDefaultValue() throws Exception {
+ AbstractKeyedStateBackend<Integer> backend = createKeyedBackend(IntSerializer.INSTANCE);
+
+ ValueStateDescriptor<String> kvId = new ValueStateDescriptor<>("id", String.class, "Hello");
--- End diff --
We could also check that ``null`` is accepted as a valid initial value.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] flink pull request #2855: Add Tests in StateBackendTestBase that verify Defa...
Posted by aljoscha <gi...@git.apache.org>.
Github user aljoscha closed the pull request at:
https://github.com/apache/flink/pull/2855
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---