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:
[email protected]
With regards,
Apache Git Services