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 TypeMethodDescriptionvoidadd(ImportedObjectV2 object) Different threads can add objects to the stash in parallel.getName()longlongbooleanreadObjects(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:
addin interfaceImportedObjectsStash- Throws:
BackupRestoreException
-
readObjects
Description copied from interface:ImportedObjectsStashRead a collection of objects from the stash. If the stash has fewer objects than numberOfObjects, all objects will be returned.- Specified by:
readObjectsin interfaceImportedObjectsStash- Parameters:
numberOfObjects- number of objects.- Returns:
- collection of objects
- Throws:
BackupRestoreException
-
getName
- Specified by:
getNamein interfaceImportedObjectsStash- Returns:
- stash name
-
getIterationNumber
- Specified by:
getIterationNumberin interfaceImportedObjectsStash- Returns:
- iteration number
-
getNumberOfWrittenObjects
public long getNumberOfWrittenObjects()- Specified by:
getNumberOfWrittenObjectsin interfaceImportedObjectsStash- Returns:
- number of objects written to the stash.
-
getNumberOfRetrievedObjects
public long getNumberOfRetrievedObjects()- Specified by:
getNumberOfRetrievedObjectsin interfaceImportedObjectsStash- Returns:
- number of objects read from the stash by this moment.
-
hasMoreRecords
public boolean hasMoreRecords()- Specified by:
hasMoreRecordsin interfaceImportedObjectsStash- Returns:
- true if the stash has records to read.
-