Class AzureArchiveManagerV8
java.lang.Object
org.apache.jackrabbit.oak.segment.azure.v8.AzureArchiveManagerV8
- All Implemented Interfaces:
SegmentArchiveManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.microsoft.azure.storage.blob.CloudBlobDirectory
protected final IOMonitor
protected final FileStoreMonitor
-
Constructor Summary
ConstructorsConstructorDescriptionAzureArchiveManagerV8
(com.microsoft.azure.storage.blob.CloudBlobDirectory segmentstoreDirectory, IOMonitor ioMonitor, FileStoreMonitor fileStoreMonitor, WriteAccessController writeAccessController) -
Method Summary
Modifier and TypeMethodDescriptionvoid
backup
(@NotNull String archiveName, @NotNull String backupArchiveName, @NotNull Set<UUID> recoveredEntries) Method is not deleting segments from the directory given witharchiveName
, if they are in the set of recovered segments.void
Copies the archive with all the segments.Creates a new archive.boolean
Deletes the archive if exists.boolean
Check if archive exists.Opens an archive that wasn't closed correctly.protected com.microsoft.azure.storage.blob.CloudBlobDirectory
getDirectory
(String archiveName) List names of the available .tar archives.Opens a given archive for reading.void
recoverEntries
(String archiveName, LinkedHashMap<UUID, byte[]> entries) Finds all the segments included in the archive.boolean
Renames the archive.
-
Field Details
-
cloudBlobDirectory
protected final com.microsoft.azure.storage.blob.CloudBlobDirectory cloudBlobDirectory -
ioMonitor
-
monitor
-
-
Constructor Details
-
AzureArchiveManagerV8
public AzureArchiveManagerV8(com.microsoft.azure.storage.blob.CloudBlobDirectory segmentstoreDirectory, IOMonitor ioMonitor, FileStoreMonitor fileStoreMonitor, WriteAccessController writeAccessController)
-
-
Method Details
-
listArchives
Description copied from interface:SegmentArchiveManager
List names of the available .tar archives.- Specified by:
listArchives
in interfaceSegmentArchiveManager
- Returns:
- archive list
- Throws:
IOException
-
open
Description copied from interface:SegmentArchiveManager
Opens a given archive for reading.- Specified by:
open
in interfaceSegmentArchiveManager
- Returns:
- the archive reader or null if the archive doesn't exist or doesn't have a valid index
- Throws:
IOException
-
forceOpen
Description copied from interface:SegmentArchiveManager
Opens an archive that wasn't closed correctly.- Specified by:
forceOpen
in interfaceSegmentArchiveManager
- Returns:
- the archive reader or null if the implementation doesn't support opening an unclosed archive
- Throws:
IOException
-
create
Description copied from interface:SegmentArchiveManager
Creates a new archive.- Specified by:
create
in interfaceSegmentArchiveManager
- Returns:
- the archive writer
- Throws:
IOException
-
delete
Description copied from interface:SegmentArchiveManager
Deletes the archive if exists.- Specified by:
delete
in interfaceSegmentArchiveManager
- Returns:
- true if the archive was removed, false otherwise
-
renameTo
Description copied from interface:SegmentArchiveManager
Renames the archive.- Specified by:
renameTo
in interfaceSegmentArchiveManager
- Parameters:
from
- the existing archiveto
- new name- Returns:
- true if the archive was renamed, false otherwise
-
copyFile
Description copied from interface:SegmentArchiveManager
Copies the archive with all the segments.- Specified by:
copyFile
in interfaceSegmentArchiveManager
- Parameters:
from
- the existing archiveto
- new name- Throws:
IOException
-
exists
Description copied from interface:SegmentArchiveManager
Check if archive exists.- Specified by:
exists
in interfaceSegmentArchiveManager
- Parameters:
archiveName
- archive to check- Returns:
- true if archive exists, false otherwise
-
recoverEntries
public void recoverEntries(String archiveName, LinkedHashMap<UUID, byte[]> entries) throws IOExceptionDescription copied from interface:SegmentArchiveManager
Finds all the segments included in the archive.- Specified by:
recoverEntries
in interfaceSegmentArchiveManager
- Parameters:
archiveName
- archive to recoverentries
- results will be put there, in the order of presence in the archive- Throws:
IOException
-
backup
public void backup(@NotNull @NotNull String archiveName, @NotNull @NotNull String backupArchiveName, @NotNull @NotNull Set<UUID> recoveredEntries) throws IOException Method is not deleting segments from the directory given witharchiveName
, if they are in the set of recovered segments. Reason for that is because during execution of this method, remote repository can be accessed by another application, and deleting a valid segment can cause consistency issues there.- Specified by:
backup
in interfaceSegmentArchiveManager
- Throws:
IOException
-
getDirectory
protected com.microsoft.azure.storage.blob.CloudBlobDirectory getDirectory(String archiveName) throws IOException - Throws:
IOException
-