Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-13880

The behavior of JobExecutionResult.getAccumulatorResult does not match its java doc

    XMLWordPrintableJSON

Details

    Description

      The java doc of `JobExecutionResult.getAccumulatorResult` states that "Returns {@code null}, if no accumulator with that name was produced", but actually an NPE will be triggered if no accumulator with that name is produced.

      I'm going to rewrite the `getAccumulatorResult` method to the following:

      public <T> T getAccumulatorResult(String accumulatorName) {
         OptionalFailure<Object> result = this.accumulatorResults.get(accumulatorName);
         if (result != null) {
            return (T) result.getUnchecked();
         } else {
            return null;
         }
      }
      

      Please assign this issue to me if this solution is acceptable.

       

      Attachments

        Issue Links

          Activity

            People

              TsReaper Caizhi Weng
              TsReaper Caizhi Weng
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m