You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/01/08 07:43:46 UTC

[GitHub] [flink] klion26 opened a new pull request #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element

klion26 opened a new pull request #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element
URL: https://github.com/apache/flink/pull/10796
 
 
   ## What is the purpose of the change
   
   Make `AppendingState#add` refuse to add null elment, and update the java doc
   
   ## Brief change log
   
   1. Update the java doc of AppendingState#add about refusing to add null element
   2. Make all implementations of AppendingState#add respect the java doc
   3. Add ut tests cover this scenario
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - StateBackendTestBase#{`testListStateAddNull`, `testReducingStateAddNull`, `testFoldingStateAddNull`, `testAggregatingStateAddNull`}
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] klion26 commented on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element

Posted by GitBox <gi...@apache.org>.
klion26 commented on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element
URL: https://github.com/apache/flink/pull/10796#issuecomment-571929461
 
 
   cc @aljoscha 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element
URL: https://github.com/apache/flink/pull/10796#issuecomment-571939777
 
 
   <!--
   Meta data
   Hash:3c4dece4d584ae396c69247e3bcf978807b9f232 Status:FAILURE URL:https://travis-ci.com/flink-ci/flink/builds/143523185 TriggerType:PUSH TriggerID:3c4dece4d584ae396c69247e3bcf978807b9f232
   Hash:3c4dece4d584ae396c69247e3bcf978807b9f232 Status:FAILURE URL:https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4185 TriggerType:PUSH TriggerID:3c4dece4d584ae396c69247e3bcf978807b9f232
   -->
   ## CI report:
   
   * 3c4dece4d584ae396c69247e3bcf978807b9f232 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/143523185) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4185) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] aljoscha commented on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element

Posted by GitBox <gi...@apache.org>.
aljoscha commented on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element
URL: https://github.com/apache/flink/pull/10796#issuecomment-571988186
 
 
   There's a CI failure.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] ehabqadah commented on a change in pull request #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element

Posted by GitBox <gi...@apache.org>.
ehabqadah commented on a change in pull request #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element
URL: https://github.com/apache/flink/pull/10796#discussion_r364469317
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/api/common/state/AppendingState.java
 ##########
 @@ -60,10 +60,11 @@
 	 * to the list of values. The next time {@link #get()} is called (for the same state
 	 * partition) the returned state will represent the updated list.
 	 *
-	 * <p>If null is passed in, the state value will remain unchanged.
+	 * <p>AppendingState refuses to add null element.
 	 *
 	 * @param value The new value for the state.
 	 *
+	 * @throws NullPointerException Thrown if the passed in parameter is null.
 	 * @throws Exception Thrown if the system cannot access the state.
 	 */
 	void add(IN value) throws Exception;
 
 Review comment:
   you could also add a default implementation to execute `Preconditions.checkNotNull` here, and make all sub-classes to call it `AppendingState.super.add(val);`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] ehabqadah commented on a change in pull request #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element

Posted by GitBox <gi...@apache.org>.
ehabqadah commented on a change in pull request #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element
URL: https://github.com/apache/flink/pull/10796#discussion_r365590633
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/api/common/state/AppendingState.java
 ##########
 @@ -60,10 +60,11 @@
 	 * to the list of values. The next time {@link #get()} is called (for the same state
 	 * partition) the returned state will represent the updated list.
 	 *
-	 * <p>If null is passed in, the state value will remain unchanged.
+	 * <p>AppendingState refuses to add null element.
 	 *
 	 * @param value The new value for the state.
 	 *
+	 * @throws NullPointerException Thrown if the passed in parameter is null.
 	 * @throws Exception Thrown if the system cannot access the state.
 	 */
 	void add(IN value) throws Exception;
 
 Review comment:
   you could also add a default implementation to execute Preconditions.checkNotNull here, and make all sub-classes to call it AppendingState.super.add(val);

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] ehabqadah commented on a change in pull request #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element

Posted by GitBox <gi...@apache.org>.
ehabqadah commented on a change in pull request #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element
URL: https://github.com/apache/flink/pull/10796#discussion_r364469317
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/api/common/state/AppendingState.java
 ##########
 @@ -60,10 +60,11 @@
 	 * to the list of values. The next time {@link #get()} is called (for the same state
 	 * partition) the returned state will represent the updated list.
 	 *
-	 * <p>If null is passed in, the state value will remain unchanged.
+	 * <p>AppendingState refuses to add null element.
 	 *
 	 * @param value The new value for the state.
 	 *
+	 * @throws NullPointerException Thrown if the passed in parameter is null.
 	 * @throws Exception Thrown if the system cannot access the state.
 	 */
 	void add(IN value) throws Exception;
 
 Review comment:
   you could also add a default implementation to execute `Preconditions.checkNotNull` here, and make all sub-classes to call it `AppendingState.super.add(val);`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element
URL: https://github.com/apache/flink/pull/10796#issuecomment-571939777
 
 
   <!--
   Meta data
   Hash:3c4dece4d584ae396c69247e3bcf978807b9f232 Status:UNKNOWN URL:TBD TriggerType:PUSH TriggerID:3c4dece4d584ae396c69247e3bcf978807b9f232
   -->
   ## CI report:
   
   * 3c4dece4d584ae396c69247e3bcf978807b9f232 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element
URL: https://github.com/apache/flink/pull/10796#issuecomment-571939777
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3c4dece4d584ae396c69247e3bcf978807b9f232",
       "status" : "FAILURE",
       "url" : "https://travis-ci.com/flink-ci/flink/builds/143523185",
       "triggerID" : "3c4dece4d584ae396c69247e3bcf978807b9f232",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3c4dece4d584ae396c69247e3bcf978807b9f232",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4185",
       "triggerID" : "3c4dece4d584ae396c69247e3bcf978807b9f232",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3c4dece4d584ae396c69247e3bcf978807b9f232 Travis: [FAILURE](https://travis-ci.com/flink-ci/flink/builds/143523185) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=4185) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #10796: [FLINK-15424][StateBackend] Make AppendintState#add refuse to add null element
URL: https://github.com/apache/flink/pull/10796#issuecomment-571929974
 
 
   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 3c4dece4d584ae396c69247e3bcf978807b9f232 (Wed Jan 08 07:45:45 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services