public class CachingArchiveManager extends java.lang.Object implements SegmentArchiveManager
Constructor and Description |
---|
CachingArchiveManager(PersistentCache persistentCache,
SegmentArchiveManager delegate) |
Modifier and Type | Method and Description |
---|---|
void |
backup(@NotNull java.lang.String archiveName,
@NotNull java.lang.String backupArchiveName,
@NotNull java.util.Set<java.util.UUID> recoveredEntries)
Method that is doing a backup of the archive given with
archiveName into backupArchiveName . |
void |
copyFile(@NotNull java.lang.String from,
@NotNull java.lang.String to)
Copies the archive with all the segments.
|
@NotNull SegmentArchiveWriter |
create(@NotNull java.lang.String archiveName)
Creates a new archive.
|
boolean |
delete(@NotNull java.lang.String archiveName)
Deletes the archive if exists.
|
boolean |
exists(@NotNull java.lang.String archiveName)
Check if archive exists.
|
@Nullable SegmentArchiveReader |
forceOpen(java.lang.String archiveName)
Opens an archive that wasn't closed correctly.
|
@NotNull java.util.List<java.lang.String> |
listArchives()
List names of the available .tar archives.
|
@Nullable SegmentArchiveReader |
open(@NotNull java.lang.String archiveName)
Opens a given archive for reading.
|
void |
recoverEntries(@NotNull java.lang.String archiveName,
@NotNull java.util.LinkedHashMap<java.util.UUID,byte[]> entries)
Finds all the segments included in the archive.
|
boolean |
renameTo(@NotNull java.lang.String from,
@NotNull java.lang.String to)
Renames the archive.
|
public CachingArchiveManager(PersistentCache persistentCache, SegmentArchiveManager delegate)
@NotNull public @NotNull java.util.List<java.lang.String> listArchives() throws java.io.IOException
SegmentArchiveManager
listArchives
in interface SegmentArchiveManager
java.io.IOException
@Nullable public @Nullable SegmentArchiveReader open(@NotNull @NotNull java.lang.String archiveName) throws java.io.IOException
SegmentArchiveManager
open
in interface SegmentArchiveManager
java.io.IOException
@Nullable public @Nullable SegmentArchiveReader forceOpen(java.lang.String archiveName) throws java.io.IOException
SegmentArchiveManager
forceOpen
in interface SegmentArchiveManager
java.io.IOException
@NotNull public @NotNull SegmentArchiveWriter create(@NotNull @NotNull java.lang.String archiveName) throws java.io.IOException
SegmentArchiveManager
create
in interface SegmentArchiveManager
java.io.IOException
public boolean delete(@NotNull @NotNull java.lang.String archiveName)
SegmentArchiveManager
delete
in interface SegmentArchiveManager
public boolean renameTo(@NotNull @NotNull java.lang.String from, @NotNull @NotNull java.lang.String to)
SegmentArchiveManager
renameTo
in interface SegmentArchiveManager
from
- the existing archiveto
- new namepublic void copyFile(@NotNull @NotNull java.lang.String from, @NotNull @NotNull java.lang.String to) throws java.io.IOException
SegmentArchiveManager
copyFile
in interface SegmentArchiveManager
from
- the existing archiveto
- new namejava.io.IOException
public boolean exists(@NotNull @NotNull java.lang.String archiveName)
SegmentArchiveManager
exists
in interface SegmentArchiveManager
archiveName
- archive to checkpublic void recoverEntries(@NotNull @NotNull java.lang.String archiveName, @NotNull @NotNull java.util.LinkedHashMap<java.util.UUID,byte[]> entries) throws java.io.IOException
SegmentArchiveManager
recoverEntries
in interface SegmentArchiveManager
archiveName
- archive to recoverentries
- results will be put there, in the order of presence in the
archivejava.io.IOException
public void backup(@NotNull @NotNull java.lang.String archiveName, @NotNull @NotNull java.lang.String backupArchiveName, @NotNull @NotNull java.util.Set<java.util.UUID> recoveredEntries) throws java.io.IOException
SegmentArchiveManager
archiveName
into backupArchiveName
.
In addition, set of UUIDs of recovered segments is provided which can be inspected during backup.
Method is invoked during archive recovery procedure and concrete implementation can decide whether original archive
should be deleted or modified.backup
in interface SegmentArchiveManager
java.io.IOException
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.