Package org.apache.uima.ducc.transport.event.common

Examples of org.apache.uima.ducc.transport.event.common.DuccWorkPopDriver


  private boolean isCancelJobDriverProcessFailed(IDuccWorkJob job) {
    String methodName = "isCancelJobDriverProcessFailed";
    logger.trace(methodName, null, messages.fetch("enter"));
    boolean ckpt = false;
    if(!job.isFinished()) {
      DuccWorkPopDriver driver = job.getDriver();
      IDuccProcessMap processMap = driver.getProcessMap();
      if(processMap != null) {
        Collection<IDuccProcess> processCollection = processMap.values();
        Iterator<IDuccProcess> iterator = processCollection.iterator();
        while(iterator.hasNext()) {
          IDuccProcess process = iterator.next();
View Full Code Here


  private boolean isDriverCompleted(IDuccWorkJob job) {
    String methodName = "isDriverCompleted";
    logger.trace(methodName, null, messages.fetch("enter"));
    boolean ckpt = false;
    if(job.isFinished()) {
      DuccWorkPopDriver driver = job.getDriver();
      IDuccProcessMap processMap = driver.getProcessMap();
      if(processMap != null) {
        Collection<IDuccProcess> processCollection = processMap.values();
        Iterator<IDuccProcess> iterator = processCollection.iterator();
        while(iterator.hasNext()) {
          IDuccProcess process = iterator.next();
View Full Code Here

 
  private void uimaAsClientInitialize() throws JobDriverTerminateException {
    String location = "uimaAsClientInitialize";
    duccOut.info(location, jobid, "jd.step:"+location);
    try {
      DuccWorkPopDriver popDriver = getJob().getDriver();
      serverUri = popDriver.getServerUri();
      duccOut.info(location, jobid, "broker"+":"+serverUri);
      endPoint = popDriver.getEndPoint();
      duccOut.info(location, jobid, "endpoint"+":"+endPoint);
      Map<String,Object> appCtx = new HashMap<String,Object>();
      try {
        metaTimeout = Integer.parseInt(getJob().getDriver().getMetaTimeout());
        duccOut.info(location, jobid, DuccPropertiesResolver.default_process_get_meta_time_max+":"+metaTimeout);
View Full Code Here

      wi_time = DuccPropertiesResolver.getInstance().getFileProperty(DuccPropertiesResolver.default_process_per_item_time_max);
    }
    // Exception handler
    String processExceptionHandler = jobRequestProperties.getProperty(JobRequestProperties.key_driver_exception_handler);
    // Command line
    DuccWorkPopDriver driver = new DuccWorkPopDriver(job.getjobBroker(), job.getjobQueue(), crxml, crcfg, meta_time, lost_time, wi_time, processExceptionHandler);
    JavaCommandLine driverCommandLine = new JavaCommandLine(javaCmd);
    driverCommandLine.setClassName(IDuccCommand.main);
    driverCommandLine.addOption(IDuccCommand.arg_ducc_deploy_configruation);
    driverCommandLine.addOption(IDuccCommand.arg_ducc_deploy_components);
    driverCommandLine.addOption(IDuccCommand.arg_ducc_job_id+job.getDuccId().toString());
    // classpath
    String java_classpath = getDuccClasspath(0)// for driver 
    String driverClasspath = jobRequestProperties.getProperty(JobSpecificationProperties.key_classpath);
    logger.debug(methodName, job.getDuccId(), "driver CP (spec):"+driverClasspath);
    logger.debug(methodName, job.getDuccId(), "java CP:"+java_classpath);
    if(driverClasspath != null) {
      if(isClasspathOrderUserBeforeDucc(jobRequestProperties.getProperty(JobSpecificationProperties.key_classpath_order),job.getDuccId())) {
        logger.info(methodName, job.getDuccId(), "driver:OrderUserBeforeDucc");
        driverClasspath=driverClasspath+File.pathSeparator+java_classpath;
      }
      else {
        logger.info(methodName, job.getDuccId(), "driver:OrderDuccBeforeUser");
        driverClasspath=java_classpath+File.pathSeparator+driverClasspath;
      }
    }
    else {
      logger.info(methodName, job.getDuccId(), "driver:OrderDefault");
      driverClasspath=java_classpath;
    }
    logger.debug(methodName, job.getDuccId(), "driver CP (combined):"+driverClasspath);
    driverCommandLine.setClasspath(driverClasspath);
    // Add the user-provided JVM args
    boolean haveXmx = false;
    String driver_jvm_args = jobRequestProperties.getProperty(JobSpecificationProperties.key_driver_jvm_args);
    ArrayList<String> dTokens = QuotedOptions.tokenizeList(driver_jvm_args, true);
    for(String token : dTokens) {
      driverCommandLine.addOption(token);
      if (!haveXmx) {
          haveXmx = token.startsWith("-Xmx");
      }
    }
    // Add any site-provided JVM args, but not -Xmx if the user has provided one
    String siteJvmArgs = DuccPropertiesResolver.get(DuccPropertiesResolver.ducc_driver_jvm_args);
    dTokens = QuotedOptions.tokenizeList(siteJvmArgs, true);    // a null arg is acceptable
    for (String token : dTokens) {
        if (!haveXmx || !token.startsWith("-Xmx")) {
            driverCommandLine.addOption(token);
        }
    }
   
    // Name the log config file explicitly - the default of searching the user-provided classpath is dangerous
    driverCommandLine.addOption("-Dlog4j.configuration=file://" + Utils.findDuccHome() + "/resources/log4j.xml");
    // Environment
    String driverEnvironmentVariables = jobRequestProperties.getProperty(JobSpecificationProperties.key_environment);
    int envCountDriver = addEnvironment(job, "driver", driverCommandLine, driverEnvironmentVariables);
    logger.info(methodName, job.getDuccId(), "driver env vars: "+envCountDriver);
    logger.debug(methodName, job.getDuccId(), "driver: "+driverCommandLine.getCommand());
    // Log directory
    driverCommandLine.setLogDirectory(jobRequestProperties.getProperty(JobSpecificationProperties.key_log_directory));
    driver.setCommandLine(driverCommandLine);
    //
    NodeIdentity nodeIdentity = hostManager.getNode();
    DuccId duccId = jdIdFactory.next();
    duccId.setFriendly(0);
    DuccProcess driverProcess = new DuccProcess(duccId,nodeIdentity,ProcessType.Pop);
    CGroupManager.assign(job.getDuccId(), driverProcess, driver_max_size_in_bytes);
    driverProcess.setResourceState(ResourceState.Allocated);
    driverProcess.setNodeIdentity(nodeIdentity);
    driver.getProcessMap().put(driverProcess.getDuccId(), driverProcess);
    //
    orchestratorCommonArea.getProcessAccounting().addProcess(duccId, job.getDuccId());
    //
    job.setDriver(driver);
  }
View Full Code Here

    return 1;
  }
 
  private void setJdJmxUrl(DuccWorkJob job, String jdJmxUrl) {
    if(jdJmxUrl != null) {
      DuccWorkPopDriver driver = job.getDriver();
      IDuccProcessMap processMap = driver.getProcessMap();
      if(processMap != null) {
        Collection<IDuccProcess> processCollection = processMap.values();
        Iterator<IDuccProcess> iterator = processCollection.iterator();
        while(iterator.hasNext()) {
          IDuccProcess process = iterator.next();
View Full Code Here

    String methodName = "copyDriverWorkItemsReport";
    try {
      DuccProcessWorkItemsMap pwiMap = jdStatusReport.getDuccProcessWorkItemsMap();
      IDuccProcessWorkItems pwi = pwiMap.getTotals();
      pwi.setCountUnassigned(jdStatusReport.getWorkItemPendingProcessAssignmentCount());
      DuccWorkPopDriver driver = job.getDriver();
      IDuccProcessMap processMap = driver.getProcessMap();
      if(processMap != null) {
        Iterator<DuccId> iterator = processMap.keySet().iterator();
        while(iterator.hasNext()) {
          DuccId processId = iterator.next();
          IDuccProcess process = processMap.get(processId);
View Full Code Here

  }
 
  PagingInfo(IDuccWorkJob job) {
    if(job != null) {
      count(this, job.getProcessMap());
      DuccWorkPopDriver driver = job.getDriver();
      if(driver != null) {
        count(this, driver.getProcessMap());
      }
    }
  }
View Full Code Here

  public ConcurrentSkipListMap<Long, JobProcessData> transform(IDuccWorkJob job) {
    ConcurrentSkipListMap<Long, JobProcessData> map = new ConcurrentSkipListMap<Long, JobProcessData>();
    if(job != null) {
      IDuccProcessMap jpMap = job.getProcessMap();
      transform(map, job, jpMap);
      DuccWorkPopDriver driver = job.getDriver();
      if(driver != null) {
        IDuccProcessMap jdMap = driver.getProcessMap();
        transform(map, job, jdMap);
      }
    }
    return map;
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.transport.event.common.DuccWorkPopDriver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.