Package com.nt.udc.util
Class DirectoryWatcherManager
java.lang.Object
com.nt.udc.util.DirectoryWatcherManager
This class manages directory watcher services for a node.
Each node chain test will have one executor service, which would
in turn run multiple directory watcher services asynchronously.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
initExecutorService
(String testId, int numThreads) This function initialises executor service for a test.void
This function stops all directory watcher services for a NM.void
This function stops directory watcher services for a test.void
watchDirectory
(String dir, String nodeId, List<String> completedFileSubstrsList, DirectoryKeyPropertiesParser.SubstringType completedFileSubstrsType, String testId) This function adds a new directory watcher service for a test's end node.
-
Constructor Details
-
DirectoryWatcherManager
-
-
Method Details
-
initExecutorService
This function initialises executor service for a test.- Parameters:
testId
- Identifier of a testnumThreads
- Number of threads to run directory watcher services on
-
watchDirectory
public void watchDirectory(String dir, String nodeId, List<String> completedFileSubstrsList, DirectoryKeyPropertiesParser.SubstringType completedFileSubstrsType, String testId) throws IOException This function adds a new directory watcher service for a test's end node.- Parameters:
dir
- Output directorynodeId
- Identifier of the nodecompletedFileSubstrsList
- substrings of the output file once it's entirely written outcompletedFileSubstrsType
- substrings type of the output file once it's entirely written outtestId
- Identifier of a test- Throws:
IOException
-
shutdownDirectoryWatcherServices
This function stops directory watcher services for a test.- Parameters:
testId
- Identifier of a test
-
shutdownAllDirectoryWatcherServices
public void shutdownAllDirectoryWatcherServices()This function stops all directory watcher services for a NM.
-