Class ObjectQueueProcessor
- java.lang.Object
-
- com.atlassian.confluence.impl.backuprestore.restore.persisters.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 Summary
Constructors Constructor Description ObjectQueueProcessor(ObjectPersister objectPersister, PersisterHelper persisterHelper)
ObjectQueueProcessor(ObjectPersister objectPersister, PersisterHelper persisterHelper, BlockingQueue<ImportedObjectV2> objectsQueue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
persistAllPendingObjectsInTheQueue()
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 Detail
-
ObjectQueueProcessor
public ObjectQueueProcessor(ObjectPersister objectPersister, PersisterHelper persisterHelper)
-
ObjectQueueProcessor
public ObjectQueueProcessor(ObjectPersister objectPersister, PersisterHelper persisterHelper, BlockingQueue<ImportedObjectV2> objectsQueue)
-
-
Method Detail
-
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
-
-