Class ParallelFileHashHandler

java.lang.Object
lib.pwss.hash.file_hash_handler.parallel.ParallelFileHashHandler
All Implemented Interfaces:
ParallelFileHash

public final class ParallelFileHashHandler extends Object implements ParallelFileHash
This class handles parallel calculation of hash values for files using multiple hashing algorithms.
  • Constructor Details

    • ParallelFileHashHandler

      public ParallelFileHashHandler(BigFileHashHandler hashInstance)
      Constructs a new ParallelFileHashHandler with the given instance of BigFileHashHandler.
      Parameters:
      hashInstance - The instance of BigFileHashHandler to use for calculating hashes.
  • Method Details

    • GetAllHashesInParallel

      public HashForFilesOutput GetAllHashesInParallel(File file)
      Description copied from interface: ParallelFileHash
      Calculates the hashes for a given file in parallel using SHA256, SHA3, and Blake2B algorithms.
      Specified by:
      GetAllHashesInParallel in interface ParallelFileHash
      Parameters:
      file - The file to be hashed.
      Returns:
      An instance of HashForFilesOutput containing the calculated hashes.
    • calculateSha256HashFuture

      public Future<String> calculateSha256HashFuture(File file)
      Description copied from interface: ParallelFileHash
      Calculates the SHA256 hash for a given file and returns a Future representing the pending result.
      Specified by:
      calculateSha256HashFuture in interface ParallelFileHash
      Parameters:
      file - The file to be hashed.
      Returns:
      A Future containing the computed SHA256 hash.
    • calculateSha3HashFuture

      public Future<String> calculateSha3HashFuture(File file)
      Description copied from interface: ParallelFileHash
      Calculates the SHA3 hash for a given file and returns a Future representing the pending result.
      Specified by:
      calculateSha3HashFuture in interface ParallelFileHash
      Parameters:
      file - The file to be hashed.
      Returns:
      A Future containing the computed SHA3 hash.
    • calculateBlake2bHashFuture

      public Future<String> calculateBlake2bHashFuture(File file)
      Description copied from interface: ParallelFileHash
      Calculates the Blake2B hash for a given file and returns a Future representing the pending result.
      Specified by:
      calculateBlake2bHashFuture in interface ParallelFileHash
      Parameters:
      file - The file to be hashed.
      Returns:
      A Future containing the computed Blake2B hash.
    • shutdownThreadPool

      public final void shutdownThreadPool()
      Description copied from interface: ParallelFileHash
      Shuts down the thread pool and ensures all tasks are completed.
      Specified by:
      shutdownThreadPool in interface ParallelFileHash