Class ImportedObjectsStashImpl
java.lang.Object
com.atlassian.confluence.impl.backuprestore.restore.stash.ImportedObjectsStashImpl
- All Implemented Interfaces:
ImportedObjectsStash
Allows to temporarily "stash" imported objects and then read them.
For performance reasons, current implementation allows to write records first and read them only when all records are written.
When the reading started, no more writing is allowed.
- Since:
- 7.20.0
-
Constructor Summary
ConstructorsConstructorDescriptionImportedObjectsStashImpl
(String name, int iteration, StashObjectsWriter stashObjectsWriter, StashObjectsReader stashObjectsReader) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ImportedObjectV2 object) Different threads can add objects to the stash in parallel.getName()
long
long
boolean
readObjects
(int numberOfObjects) Read a collection of objects from the stash.
-
Constructor Details
-
ImportedObjectsStashImpl
public ImportedObjectsStashImpl(String name, int iteration, StashObjectsWriter stashObjectsWriter, StashObjectsReader stashObjectsReader)
-
-
Method Details
-
add
Different threads can add objects to the stash in parallel.- Specified by:
add
in interfaceImportedObjectsStash
- Throws:
BackupRestoreException
-
readObjects
Description copied from interface:ImportedObjectsStash
Read a collection of objects from the stash. If the stash has fewer objects than numberOfObjects, all objects will be returned.- Specified by:
readObjects
in interfaceImportedObjectsStash
- Parameters:
numberOfObjects
- number of objects.- Returns:
- collection of objects
- Throws:
BackupRestoreException
-
getName
- Specified by:
getName
in interfaceImportedObjectsStash
- Returns:
- stash name
-
getIterationNumber
- Specified by:
getIterationNumber
in interfaceImportedObjectsStash
- Returns:
- iteration number
-
getNumberOfWrittenObjects
public long getNumberOfWrittenObjects()- Specified by:
getNumberOfWrittenObjects
in interfaceImportedObjectsStash
- Returns:
- number of objects written to the stash.
-
getNumberOfRetrievedObjects
public long getNumberOfRetrievedObjects()- Specified by:
getNumberOfRetrievedObjects
in interfaceImportedObjectsStash
- Returns:
- number of objects read from the stash by this moment.
-
hasMoreRecords
public boolean hasMoreRecords()- Specified by:
hasMoreRecords
in interfaceImportedObjectsStash
- Returns:
- true if the stash has records to read.
-