Class BitmappedObjectReachabilityChecker

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ObjectWalk walk  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<RevObject> areAllReachable​(java.util.Collection<RevObject> targets, java.util.stream.Stream<RevObject> starters)
      Checks that all targets are reachable from the starters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BitmappedObjectReachabilityChecker

        public BitmappedObjectReachabilityChecker​(ObjectWalk walk)
        New instance of the reachability checker using a existing walk.
        Parameters:
        walk - ObjectWalk instance to reuse. Caller retains ownership.
    • Method Detail

      • areAllReachable

        public java.util.Optional<RevObject> areAllReachable​(java.util.Collection<RevObject> targets,
                                                             java.util.stream.Stream<RevObject> starters)
                                                      throws java.io.IOException
        Checks that all targets are reachable from the starters. This implementation tries to shortcut the check adding starters incrementally. Ordering the starters by relevance can improve performance in the average case.
        Specified by:
        areAllReachable in interface ObjectReachabilityChecker
        Parameters:
        targets - objects to check for reachability from the starters
        starters - objects known to be reachable to the caller
        Returns:
        Optional a single unreachable target if there are any (there could be more). Empty optional means all targets are reachable.
        Throws:
        java.io.IOException - Cannot access underlying storage