Class OrderedListUserState<T>


  • public class OrderedListUserState<T>
    extends java.lang.Object
    An implementation of an ordered list user state that utilizes the Beam Fn State API to fetch, clear and persist values.

    Calling asyncClose() schedules any required persistence changes. This object should no longer be used after it is closed.

    TODO: Move to an async persist model where persistence is signalled based upon cache memory pressure and its need to flush.

    • Constructor Summary

      Constructors 
      Constructor Description
      OrderedListUserState​(Cache<?,​?> cache, BeamFnStateClient beamFnStateClient, java.lang.String instructionId, org.apache.beam.model.fnexecution.v1.BeamFnApi.StateKey stateKey, org.apache.beam.sdk.coders.Coder<T> valueCoder)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(org.apache.beam.sdk.values.TimestampedValue<T> value)  
      void asyncClose()  
      void clear()  
      void clearRange​(org.joda.time.Instant minTimestamp, org.joda.time.Instant limitTimestamp)  
      java.lang.Iterable<org.apache.beam.sdk.values.TimestampedValue<T>> read()  
      java.lang.Iterable<org.apache.beam.sdk.values.TimestampedValue<T>> readRange​(org.joda.time.Instant minTimestamp, org.joda.time.Instant limitTimestamp)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OrderedListUserState

        public OrderedListUserState​(Cache<?,​?> cache,
                                    BeamFnStateClient beamFnStateClient,
                                    java.lang.String instructionId,
                                    org.apache.beam.model.fnexecution.v1.BeamFnApi.StateKey stateKey,
                                    org.apache.beam.sdk.coders.Coder<T> valueCoder)
    • Method Detail

      • add

        public void add​(org.apache.beam.sdk.values.TimestampedValue<T> value)
      • readRange

        public java.lang.Iterable<org.apache.beam.sdk.values.TimestampedValue<T>> readRange​(org.joda.time.Instant minTimestamp,
                                                                                            org.joda.time.Instant limitTimestamp)
      • read

        public java.lang.Iterable<org.apache.beam.sdk.values.TimestampedValue<T>> read()
      • clearRange

        public void clearRange​(org.joda.time.Instant minTimestamp,
                               org.joda.time.Instant limitTimestamp)
      • clear

        public void clear()
      • asyncClose

        public void asyncClose()
                        throws java.lang.Exception
        Throws:
        java.lang.Exception