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

PersistedAppendingBuffer state primitive has incorrect contracts for view() method

    XMLWordPrintableJSON

Details

    Description

      The PersistedAppendingBuffer state primitive in Stateful Functions, states that view() returns null if the buffer wasn't accessed before, or after a clear().

      This actually is not possible. The PersistedAppendingBuffer primitive is based on Flink's ListState state handle, which always returns an empty list if the elements of the list is empty, and never a null.

      This means that the PersistedAppendingBuffer won't be able to differentiate the cases (e.g. if the state wasn't accessed or cleared v.s. an empty buffer).
      We suggest to just change the contract so that PersistedAppendingBuffer#view() follows the behavior of Flink's ListState to never return null.

      Attachments

        Issue Links

          Activity

            People

              tzulitai Tzu-Li (Gordon) Tai
              tzulitai Tzu-Li (Gordon) Tai
              Votes:
              0 Vote for this issue
              Watchers:
              1 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