Class DurableLogDiagnosticHarness

java.lang.Object
org.j7m.middleware.durablelog.internal.DurableLogDiagnosticHarness

public final class DurableLogDiagnosticHarness extends Object
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 Details

    • DurableLogDiagnosticHarness

      public DurableLogDiagnosticHarness()
      Creates a diagnostic harness.
  • Method Details

    • truncateTail

      public void truncateTail(Path directory, int bytes) throws IOException
      Truncates bytes from the active segment tail.
      Parameters:
      directory - log directory
      bytes - number of bytes to remove
      Throws:
      IOException - when segment access fails
    • corruptByte

      public void corruptByte(Path directory, long offset) throws IOException
      Flips one byte in the active segment payload or header area.
      Parameters:
      directory - log directory
      offset - byte offset to modify
      Throws:
      IOException - when segment access fails
    • lastSegment

      public Path lastSegment(Path directory) throws IOException
      Returns latest segment path.
      Parameters:
      directory - log directory
      Returns:
      latest segment path
      Throws:
      IOException - when no segment can be found or listed