Interface BinaryGarbageCollector

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String getId()
      Gets a unique identifier for this garbage collector.
      BinaryManagerStatus getStatus()
      Gets the status of the binaries to GC and of those that won't be.
      boolean isInProgress()
      Checks if a GC is in progress.
      void mark​(String digest)
      Marks a binary as being in use.
      void start()
      Starts the garbage collection process.
      void stop​(boolean delete)
      Stops the garbage collection process and deletes all binaries that have not been marked (sweep).
    • Method Detail

      • getId

        String getId()
        Gets a unique identifier for this garbage collector. Two garbage collectors that would impact the same files must have the same identifier.
        Returns:
        a unique identifier
      • start

        void start()
        Starts the garbage collection process.

        After this, all active binaries must be fed to the mark(java.lang.String) method.

      • mark

        void mark​(String digest)
        Marks a binary as being in use.
        Parameters:
        digest - the binary's digest
      • stop

        void stop​(boolean delete)
        Stops the garbage collection process and deletes all binaries that have not been marked (sweep).
        Parameters:
        delete - true if actual deletion must be performed, false if the binaries to delete should simply be counted in the status
      • getStatus

        BinaryManagerStatus getStatus()
        Gets the status of the binaries to GC and of those that won't be.

        Available after stop(boolean).

        Returns:
        the status
      • isInProgress

        boolean isInProgress()
        Checks if a GC is in progress.

        A GC is in progress is #start has been called but not #stop.

        It's only useful to call this from a separate thread from the one that calls mark(java.lang.String).

        Returns:
        true if a GC is in progress