Class DurableLogDiagnosticHarness
java.lang.Object
org.j7m.middleware.durablelog.internal.DurableLogDiagnosticHarness
Internal deterministic crash and corruption diagnostic harness.
This type is intentionally placed in a non-exported package. It supports Phase 6.2 tests and the local crash-recovery demo, but it is not part of the durable-log public API.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcorruptByte(Path directory, long offset) Flips one byte in the active segment payload or header area.lastSegment(Path directory) Returns latest segment path.voidtruncateTail(Path directory, int bytes) Truncates bytes from the active segment tail.
-
Constructor Details
-
DurableLogDiagnosticHarness
public DurableLogDiagnosticHarness()Creates a diagnostic harness.
-
-
Method Details
-
truncateTail
Truncates bytes from the active segment tail.- Parameters:
directory- log directorybytes- number of bytes to remove- Throws:
IOException- when segment access fails
-
corruptByte
Flips one byte in the active segment payload or header area.- Parameters:
directory- log directoryoffset- byte offset to modify- Throws:
IOException- when segment access fails
-
lastSegment
Returns latest segment path.- Parameters:
directory- log directory- Returns:
- latest segment path
- Throws:
IOException- when no segment can be found or listed
-