Github user mxm commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1453#discussion_r47895579
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateForTask.java
 ---
    @@ -48,18 +48,38 @@
        /** The state of the parallel operator */
        private final SerializedValue<StateHandle<?>> state;
     
    +   /**
    +    * The state size. This is also part of the deserialized state handle.
    +    * We store it here in order to not deserialize the state handle when
    +    * gathering stats.
    +    */
    +   private final long stateSize;
    +
        /** The vertex id of the parallel operator */
        private final JobVertexID operatorId;
        
        /** The index of the parallel subtask */
        private final int subtask;
    +
    +   /** The duration of the acknowledged (ack timestamp - trigger 
timestamp). */
    +   private final long duration;
        
    -   public StateForTask(SerializedValue<StateHandle<?>> state, JobVertexID 
operatorId, int subtask) {
    +   public StateForTask(
    +                   SerializedValue<StateHandle<?>> state,
    +                   long stateSize,
    +                   JobVertexID operatorId,
    +                   int subtask,
    +                   long duration) {
    +
                this.state = checkNotNull(state, "State");
    +           // Sanity check and don't fail checkpoint because of this.
    +           this.stateSize = stateSize >= 0 ? stateSize : 0;
    --- End diff --
    
    Not sure about this. Could `stateSize` also be an Option and be None if it 
can't be determined?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to