Class VerificationObserver

java.lang.Object
org.cojen.tupl.diag.VerificationObserver
Direct Known Subclasses:
Verify

public class VerificationObserver extends Object
Index verification observer. Implementation does not need to be thread-safe, but instances should not be shared by concurrent verifications.
See Also:
  • Field Details

    • index

      protected Index index
      Index currently being verified.
    • height

      protected int height
      Index height; is zero for empty indexes.
  • Constructor Details

    • VerificationObserver

      public VerificationObserver()
  • Method Details

    • indexBegin

      public boolean indexBegin(Index index, int height)
      Called before full index verification begins. Default implementation records the index and height, and then returns true.
      Parameters:
      index - index being verified
      height - index height; is zero for empty indexes
      Returns:
      false if verification should stop
    • indexComplete

      public boolean indexComplete(Index index, boolean passed, String message)
      Called after index verification has finished. Default implementation clears the index and height fields, and then returns true.
      Parameters:
      index - index which finished verification
      passed - true if index passed all verification
      message - optional message
      Returns:
      false if verification should stop
    • indexNodePassed

      public boolean indexNodePassed(long id, int level, int entryCount, int freeBytes, int largeValueCount)
      Called after an index node passes verification. Implementation is free to report incremental progress or throttle verification. Default implementation does nothing but return true.
      Parameters:
      id - ephemeral node identifier
      level - index node level; root node is level one
      entryCount - total number of entries in the node
      freeBytes - amount of unused bytes in the node
      largeValueCount - number of values which don't fit entirely in the node
      Returns:
      false if verification should stop
    • indexNodeFailed

      public boolean indexNodeFailed(long id, int level, String message)
      Called after an index node fails verification. Implementation is free to report incremental progress or throttle verification. Default implementation prints a message to standard out and returns true.
      Parameters:
      id - ephemeral node identifier
      level - index node level; root node is level one
      message - failure message
      Returns:
      false if verification should stop
    • appendFailedMessage

      protected void appendFailedMessage(StringBuilder b, long id, int level, String message)
      Invoked by default implementation of indexNodeFailed.
    • reportFailure

      protected void reportFailure(String message)
      Invoked by default implementation of indexNodeFailed.