| Modifier and Type | Class and Description |
|---|---|
static interface |
ArchiveTool.ActionConfirmation<T>
Allows user to confirm or reject an action.
|
static class |
ArchiveTool.VerifyOption
Set of options for
verify(PrintStream, File, Set, String, ActionConfirmation) and
verifyRecording(PrintStream, File, long, Set, String, ActionConfirmation) methods. |
| Constructor and Description |
|---|
ArchiveTool() |
| Modifier and Type | Method and Description |
|---|---|
static long |
capacity(File archiveDir)
Get the capacity in bytes of the
Catalog. |
static long |
capacity(File archiveDir,
long newCapacity)
Set the capacity in bytes of the
Catalog. |
static void |
checksum(PrintStream out,
File archiveDir,
boolean allFiles,
String checksumClassName)
Compute and persist CRC-32(c) checksums for every fragment of a segment file for all recordings in the catalog.
|
static void |
checksumRecording(PrintStream out,
File archiveDir,
long recordingId,
boolean allFiles,
String checksumClassName)
Compute and persist CRC-32(c) checksums for every fragment of a segment file(s) for a given recording.
|
static void |
compact(PrintStream out,
File archiveDir)
Compact Catalog file by removing all recordings in state
RecordingState.INVALID
and delete the corresponding segment files. |
static void |
deleteOrphanedSegments(PrintStream out,
File archiveDir)
Delete orphaned recording segments that have been detached, i.e.
|
static void |
describe(PrintStream out,
File archiveDir)
Describe the metadata for all valid entries in the
Catalog. |
static void |
describeAll(PrintStream out,
File archiveDir)
Describe the metadata for all entries in the
Catalog. |
static void |
describeRecording(PrintStream out,
File archiveDir,
long recordingId)
Describe the metadata for an entry in the
Catalog identified by recording id. |
static void |
dump(PrintStream out,
File archiveDir,
long fragmentCountLimit,
ArchiveTool.ActionConfirmation<Long> confirmActionOnFragmentCountLimit)
Dump the contents of an
Archive so it can be inspected or debugged. |
static int |
entryCount(File archiveDir)
Count of the number of entries in the
Catalog. |
static void |
main(String[] args)
Main method for launching the process.
|
static void |
markRecordingInvalid(PrintStream out,
File archiveDir,
long recordingId)
Mark a recording invalid by marking it as
RecordingState.INVALID in the catalog. |
static void |
markRecordingValid(PrintStream out,
File archiveDir,
long recordingId)
Mark a recording valid by marking it as
RecordingState.VALID in the catalog. |
static int |
maxEntries(File archiveDir)
Deprecated.
Use
capacity(File) instead. |
static int |
maxEntries(File archiveDir,
long newMaxEntries)
Deprecated.
Use
capacity(File, long) instead. |
static void |
migrate(PrintStream out,
File archiveDir)
Migrate previous archive
MarkFile, Catalog, and recordings from previous version
to the latest version. |
static long |
pid(File archiveDir)
Get the pid of the process for the
Archive. |
static void |
printErrors(PrintStream out,
File archiveDir)
Print the errors in the
MarkFile. |
static boolean |
verify(PrintStream out,
File archiveDir,
Set<ArchiveTool.VerifyOption> options,
String checksumClassName,
ArchiveTool.ActionConfirmation<File> truncateOnPageStraddle)
Verify descriptors in the catalog, checking recording files availability and contents.
|
static boolean |
verifyRecording(PrintStream out,
File archiveDir,
long recordingId,
Set<ArchiveTool.VerifyOption> options,
String checksumClassName,
ArchiveTool.ActionConfirmation<File> truncateOnPageStraddle)
Verify descriptor in the catalog according to recordingId, checking recording files availability and contents.
|
public static void main(String[] args)
args - passed to the process.@Deprecated public static int maxEntries(File archiveDir)
capacity(File) instead.Catalog.archiveDir - containing the Catalog.Catalog.capacity(File)@Deprecated public static int maxEntries(File archiveDir, long newMaxEntries)
capacity(File, long) instead.Catalog.archiveDir - containing the Catalog.newMaxEntries - value to set.Catalog after update.capacity(File, long)public static long capacity(File archiveDir)
Catalog.archiveDir - containing the Catalog.Catalog, i.e. size of the Catalog file.public static long capacity(File archiveDir, long newCapacity)
Catalog. If new capacity is smaller than current Catalog
capacity then this method is a no op.archiveDir - containing the Catalog.newCapacity - value to set.Catalog after update.public static void describeAll(PrintStream out, File archiveDir)
Catalog.
This will include entries that have been invalidated.out - to which the entries will be printed.archiveDir - containing the Catalog.public static void describe(PrintStream out, File archiveDir)
Catalog.
This will not include entries that have been invalidated.out - to which the entries will be printed.archiveDir - containing the Catalog.public static void describeRecording(PrintStream out, File archiveDir, long recordingId)
Catalog identified by recording id.out - to which the entry will be printed.archiveDir - containing the Catalog.recordingId - to identify the entry.public static int entryCount(File archiveDir)
Catalog.archiveDir - containing the Catalog.Catalog.public static void printErrors(PrintStream out, File archiveDir)
MarkFile.out - stream to which the errors will be printed.archiveDir - containing the MarkFile.public static void dump(PrintStream out, File archiveDir, long fragmentCountLimit, ArchiveTool.ActionConfirmation<Long> confirmActionOnFragmentCountLimit)
Archive so it can be inspected or debugged. Each recording will have its
contents dumped up to fragmentCountLimit before requesting to continue.out - to which the contents will be printed.archiveDir - containing the Archive.fragmentCountLimit - limit of data fragments to print from each recording before continue.confirmActionOnFragmentCountLimit - confirm continue to dump at limit.public static boolean verify(PrintStream out, File archiveDir, Set<ArchiveTool.VerifyOption> options, String checksumClassName, ArchiveTool.ActionConfirmation<File> truncateOnPageStraddle)
Faulty entries are marked as unusable.
out - stream to print results and errors to.archiveDir - that contains MarkFile, Catalog, and recordings.options - set of options that control verification behavior.truncateOnPageStraddle - action to perform if last fragment in the max segment file straddles the page
boundary, i.e. if true the file will be truncated (last fragment
will be deleted), if false the fragment is considered complete.checksumClassName - (optional) fully qualified class name of the Checksum implementation.true if no errors have been encountered, false otherwise (faulty entries are marked
as unusable if false is returned)public static boolean verifyRecording(PrintStream out, File archiveDir, long recordingId, Set<ArchiveTool.VerifyOption> options, String checksumClassName, ArchiveTool.ActionConfirmation<File> truncateOnPageStraddle)
Faulty entries are marked as unusable.
out - stream to print results and errors to.archiveDir - that contains MarkFile, Catalog, and recordings.recordingId - to verify.options - set of options that control verification behavior.truncateOnPageStraddle - action to perform if last fragment in the max segment file straddles the page
boundary, i.e. if true the file will be truncated (last fragment
will be deleted), if false the fragment if considered complete.checksumClassName - (optional) fully qualified class name of the Checksum implementation.true if no errors have been encountered, false otherwise (the recording is marked
as unusable if false is returned)AeronException - if there is no recording with recordingId in the archivepublic static void checksum(PrintStream out, File archiveDir, boolean allFiles, String checksumClassName)
public static void checksumRecording(PrintStream out, File archiveDir, long recordingId, boolean allFiles, String checksumClassName)
out - stream to print results and errors to.archiveDir - that contains MarkFile, Catalog, and recordings.recordingId - to compute checksums for.allFiles - should compute checksums for all segment file or only for the last one.checksumClassName - fully qualified class name of the Checksum implementation.AeronException - if there is no recording with recordingId in the archivepublic static void markRecordingValid(PrintStream out, File archiveDir, long recordingId)
RecordingState.VALID in the catalog.out - stream to print results and errors to.archiveDir - that contains MarkFile, Catalog, and recordings.recordingId - to reviveAeronException - if there is no recording with recordingId in the archivepublic static void markRecordingInvalid(PrintStream out, File archiveDir, long recordingId)
RecordingState.INVALID in the catalog.out - stream to print results and errors to.archiveDir - that contains MarkFile, Catalog, and recordings.recordingId - to invalidateAeronException - if there is no recording with recordingId in the archivepublic static void migrate(PrintStream out, File archiveDir)
MarkFile, Catalog, and recordings from previous version
to the latest version.out - output stream to print results and errors to.archiveDir - that contains MarkFile, Catalog and recordings.public static void compact(PrintStream out, File archiveDir)
RecordingState.INVALID
and delete the corresponding segment files.out - stream to print results and errors to.archiveDir - that contains MarkFile, Catalog, and recordings.public static void deleteOrphanedSegments(PrintStream out, File archiveDir)
out - stream to print results and errors to.archiveDir - that contains MarkFile, Catalog, and recordings.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.