Example #1
1
 private static String getAbsoluteExecutablePath(final Config config) {
   if (Strings.isNullOrEmpty(config.getWrapperScript())) {
     return "";
   }
   return FileUtilities.getAbsoluteFileForExecutables(new File(config.getWrapperScript()))
       .getPath();
 }
Example #2
0
    @Override
    public GridRunner create(final Config config, final DependencyResolver dependencies) {
      final GridRunner runner = new GridRunner();

      runner.setServiceFactory(getServiceFactory());
      runner.setEnabled(true);

      runner.setQueueName(config.getQueueName());

      if (config.getMemoryRequirement() != null) {
        runner.setMemoryRequirement(config.getMemoryRequirement());
      }

      if (config.getNativeSpecification() != null) {
        runner.setNativeSpecification(config.getNativeSpecification());
      }

      runner.setGridScriptFactory(gridScriptFactory);
      runner.setManager(gridEngineManager);
      runner.setWrapperScript(getAbsoluteExecutablePath(config));
      runner.setWorkerFactoryConfig(config.getWorkerConfiguration());
      runner.setFileTokenFactory(fileTokenFactory);
      runner.setDaemonLoggerFactory(new DaemonLoggerFactory(new File(config.getLogOutputFolder())));
      final DaemonConfig daemonConfig = config.getParentConfig().getParentConfig();
      if (daemonConfig.isDumpErrors() && !Strings.isNullOrEmpty(daemonConfig.getDumpFolderPath())) {
        runner.setFailedJobManager(
            new FailedJobManager(new File(daemonConfig.getDumpFolderPath())));
      } else {
        runner.setFailedJobManager(new FailedJobManager());
      }

      return runner;
    }