Class DirectoryWatcherManager

java.lang.Object
com.nt.udc.util.DirectoryWatcherManager

public class DirectoryWatcherManager extends Object
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 Details

  • Method Details

    • initExecutorService

      public void initExecutorService(String testId, int numThreads)
      This function initialises executor service for a test.
      Parameters:
      testId - Identifier of a test
      numThreads - 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 directory
      nodeId - Identifier of the node
      completedFileSubstrsList - substrings of the output file once it's entirely written out
      completedFileSubstrsType - substrings type of the output file once it's entirely written out
      testId - Identifier of a test
      Throws:
      IOException
    • shutdownDirectoryWatcherServices

      public void shutdownDirectoryWatcherServices(String testId)
      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.