Agile BoardRank to TopRank to BottomAttach filesAttach ScreenshotVotersStop watchingWatchersConvert to IssueLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      The main idea is to wrap user state value with a class holding the value and the expiration timestamp (maybe meta data in future) and use the new object as a value in the existing implementations:

      class TtlValue<V> {
        V value;
        long expirationTimestamp;
      }
      

      The original state binder factory is wrapped with TtlStateBinder if TTL is enabled:

      state = ttlConfig.updateType == DISABLED ?
       bind(binder) : bind(new TtlStateBinder(binder, timerService));
      

      TtlStateBinder decorates the states produced by the original binder with TTL logic wrappers and adds TtlValue serialisation logic:

      TtlStateBinder {
          StateBinder binder;
          ProcessingTimeProvier timeProvider; // System.currentTimeMillis()
          <V> TtlValueState<V> createValueState(valueDesc) {
               serializer = new TtlValueSerializer(valueDesc.getSerializer);
               ttlValueDesc = new ValueDesc(serializer, ...);
               // or implement custom TypeInfo
               originalStateWithTtl = binder.createValueState(valueDesc);
               return new TtlValueState(originalStateWithTtl, timeProvider);
          }
      
            // List, Map, ...
      }
      

      TTL serializer should add expiration timestamp

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            azagrebin Andrey Zagrebin
            azagrebin Andrey Zagrebin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment