Interface ArtifactWalk.KeyVisitor

Enclosing interface:
ArtifactWalk
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ArtifactWalk.KeyVisitor
One enumerated key. A visitor failure stops the current worker's segment but leaves its claim to expire and resume from the last committed cursor, so a crash never loses the pass.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Called immediately before the walk durably commits cursor as processed - every checkpoint stride and at segment completion (cursor is null for a segment that held no keys) - the visitor's moment to flush its own buffered derived writes.
    void
    Called once per key, in ascending lexicographic order within the current segment's range.
  • Method Details

    • visit

      void visit(String key) throws IOException
      Called once per key, in ascending lexicographic order within the current segment's range.
      Throws:
      IOException
    • beforeCheckpoint

      default void beforeCheckpoint(String cursor) throws IOException
      Called immediately before the walk durably commits cursor as processed - every checkpoint stride and at segment completion (cursor is null for a segment that held no keys) - the visitor's moment to flush its own buffered derived writes. The cursor lands only after this returns, so a consumer that flushes here is never resumed past an item whose derived write died in a buffer: a flush failure leaves the previous cursor standing, and the re-visit replays exactly what was lost. A visitor that writes through per item needs nothing; the default does nothing.
      Throws:
      IOException