public class SegmentTarManager extends Object implements SegmentArchiveManager
Constructor and Description |
---|
SegmentTarManager(File segmentstoreDir,
FileStoreMonitor fileStoreMonitor,
IOMonitor ioMonitor,
boolean memoryMapping,
boolean offHeapAccess) |
Modifier and Type | Method and Description |
---|---|
void |
copyFile(String from,
String to)
Copies the archive with all the segments.
|
SegmentArchiveWriter |
create(String archiveName)
Creates a new archive.
|
boolean |
delete(String archiveName)
Deletes the archive if exists.
|
boolean |
exists(String archiveName)
Check if archive exists.
|
SegmentArchiveReader |
forceOpen(String archiveName)
Opens an archive that wasn't closed correctly.
|
List<String> |
listArchives()
List names of the available .tar archives.
|
SegmentArchiveReader |
open(String name)
Opens a given archive for reading.
|
void |
recoverEntries(String archiveName,
LinkedHashMap<UUID,byte[]> entries)
Finds all the segments included in the archive.
|
boolean |
renameTo(String from,
String to)
Renames the archive.
|
public SegmentTarManager(File segmentstoreDir, FileStoreMonitor fileStoreMonitor, IOMonitor ioMonitor, boolean memoryMapping, boolean offHeapAccess)
public List<String> listArchives()
SegmentArchiveManager
listArchives
in interface SegmentArchiveManager
public SegmentArchiveReader open(String name) throws IOException
SegmentArchiveManager
open
in interface SegmentArchiveManager
IOException
public SegmentArchiveReader forceOpen(String archiveName) throws IOException
SegmentArchiveManager
forceOpen
in interface SegmentArchiveManager
IOException
public SegmentArchiveWriter create(String archiveName)
SegmentArchiveManager
create
in interface SegmentArchiveManager
public boolean delete(String archiveName)
SegmentArchiveManager
delete
in interface SegmentArchiveManager
public boolean renameTo(String from, String to)
SegmentArchiveManager
renameTo
in interface SegmentArchiveManager
from
- the existing archiveto
- new namepublic void copyFile(String from, String to) throws IOException
SegmentArchiveManager
copyFile
in interface SegmentArchiveManager
from
- the existing archiveto
- new nameIOException
public boolean exists(String archiveName)
SegmentArchiveManager
exists
in interface SegmentArchiveManager
archiveName
- archive to checkpublic void recoverEntries(String archiveName, LinkedHashMap<UUID,byte[]> entries) throws IOException
SegmentArchiveManager
recoverEntries
in interface SegmentArchiveManager
archiveName
- archive to recoverentries
- results will be put there, in the order of presence in the
archiveIOException
Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.