Class ParallelFileHashHandler
java.lang.Object
lib.pwss.hash.file_hash_handler.parallel.ParallelFileHashHandler
- All Implemented Interfaces:
ParallelFileHash
This class handles parallel calculation of hash values for files using
multiple hashing algorithms.
-
Constructor Summary
ConstructorsConstructorDescriptionParallelFileHashHandler(BigFileHashHandler hashInstance) Constructs a new ParallelFileHashHandler with the given instance of BigFileHashHandler. -
Method Summary
Modifier and TypeMethodDescriptionCalculates the Blake2B hash for a given file and returns a Future representing the pending result.Calculates the SHA256 hash for a given file and returns a Future representing the pending result.calculateSha3HashFuture(File file) Calculates the SHA3 hash for a given file and returns a Future representing the pending result.GetAllHashesInParallel(File file) Calculates the hashes for a given file in parallel using SHA256, SHA3, and Blake2B algorithms.final voidShuts down the thread pool and ensures all tasks are completed.
-
Constructor Details
-
ParallelFileHashHandler
Constructs a new ParallelFileHashHandler with the given instance of BigFileHashHandler.- Parameters:
hashInstance- The instance of BigFileHashHandler to use for calculating hashes.
-
-
Method Details
-
GetAllHashesInParallel
Description copied from interface:ParallelFileHashCalculates the hashes for a given file in parallel using SHA256, SHA3, and Blake2B algorithms.- Specified by:
GetAllHashesInParallelin interfaceParallelFileHash- Parameters:
file- The file to be hashed.- Returns:
- An instance of HashForFilesOutput containing the calculated hashes.
-
calculateSha256HashFuture
Description copied from interface:ParallelFileHashCalculates the SHA256 hash for a given file and returns a Future representing the pending result.- Specified by:
calculateSha256HashFuturein interfaceParallelFileHash- Parameters:
file- The file to be hashed.- Returns:
- A Future containing the computed SHA256 hash.
-
calculateSha3HashFuture
Description copied from interface:ParallelFileHashCalculates the SHA3 hash for a given file and returns a Future representing the pending result.- Specified by:
calculateSha3HashFuturein interfaceParallelFileHash- Parameters:
file- The file to be hashed.- Returns:
- A Future containing the computed SHA3 hash.
-
calculateBlake2bHashFuture
Description copied from interface:ParallelFileHashCalculates the Blake2B hash for a given file and returns a Future representing the pending result.- Specified by:
calculateBlake2bHashFuturein interfaceParallelFileHash- Parameters:
file- The file to be hashed.- Returns:
- A Future containing the computed Blake2B hash.
-
shutdownThreadPool
public final void shutdownThreadPool()Description copied from interface:ParallelFileHashShuts down the thread pool and ensures all tasks are completed.- Specified by:
shutdownThreadPoolin interfaceParallelFileHash
-