Class ObjectQueueProcessor
java.lang.Object
com.atlassian.confluence.impl.backuprestore.restore.persisters.ObjectQueueProcessor
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 Summary
ConstructorsConstructorDescriptionObjectQueueProcessor
(ObjectPersister objectPersister, PersisterHelper persisterHelper) ObjectQueueProcessor
(ObjectPersister objectPersister, PersisterHelper persisterHelper, BlockingQueue<ImportedObjectV2> objectsQueue) -
Method Summary
Modifier and TypeMethodDescriptionlong
We call it at the end, when we have to process the whole queue before processing the stash.int
processChunkOfStash
(ImportedObjectsStash stash, IdMapper idMapper) Processes a small piece of data from the stash async.
-
Constructor Details
-
ObjectQueueProcessor
-
ObjectQueueProcessor
public ObjectQueueProcessor(ObjectPersister objectPersister, PersisterHelper persisterHelper, BlockingQueue<ImportedObjectV2> objectsQueue)
-
-
Method Details
-
persistAllPendingObjectsInTheQueue
public long persistAllPendingObjectsInTheQueue()We call it at the end, when we have to process the whole queue before processing the stash. -
processChunkOfStash
public int processChunkOfStash(ImportedObjectsStash stash, IdMapper idMapper) throws BackupRestoreException Processes a small piece of data from the stash async. Returns number of processed elements.- Throws:
BackupRestoreException
-