Class ChangeRequestHistory<T>

    • Constructor Detail

      • ChangeRequestHistory

        public ChangeRequestHistory()
      • ChangeRequestHistory

        public ChangeRequestHistory​(int maxSize)
    • Method Detail

      • stop

        public void stop()
      • addChangeRequests

        public void addChangeRequests​(List<T> requests)
        Add batch of segment changes update.
      • addChangeRequest

        public void addChangeRequest​(T request)
        Add single segment change update.
      • getRequestsSince

        public com.google.common.util.concurrent.ListenableFuture<ChangeRequestsSnapshot<T>> getRequestsSince​(ChangeRequestHistory.Counter counter)
        Returns a Future that, on completion, returns list of segment updates and associated counter. If there are no update since given counter then Future completion waits till an updates is provided. If counter is older than max number of changes maintained then ChangeRequestsSnapshot is returned with ChangeRequestsSnapshot.resetCounter set to True. If there were no updates to provide immediately then a future is created and returned to caller. This future is added to the "waitingFutures" list and all the futures in the list get resolved as soon as a segment update is provided.