Class ObjectQueueProcessor


  • public class ObjectQueueProcessor
    extends Object
    Objects for persisting would coming one by one and we do not want to persist them one by one. But we also do not know how many objects would come. So the algorithm is: when the object(s) is coming, we add them to the queue. Then, if there are no in-progress tasks persisting data, we get all the tasks from the queue and persist them. Otherwise we do not do anything.
    Since:
    8.0.0
    • Constructor Detail

      • ObjectQueueProcessor

        public ObjectQueueProcessor​(DatabasePersister databasePersister,
                                    Object fakeObjectForIdGeneration)
    • Method Detail

      • persistAllPendingObjectsInTheQueue

        public long persistAllPendingObjectsInTheQueue()
        We call it at the end, when we have to process the whole queue before processing the stash.