Package org.apache.uima.ducc.common

Examples of org.apache.uima.ducc.common.NodeConfiguration$ClassSorter


    void initClasses(String filename)
    {
      String methodName = "initClasses";
        String me = Scheduler.class.getName() + ".Config";
        DuccLogger initLogger = new DuccLogger(me, COMPONENT_NAME);
        NodeConfiguration nc = new NodeConfiguration(filename, initLogger);
    try {
      nc.readConfiguration();
    } catch (Throwable e) {
            logger.error(methodName, null, e);
            logger.error(methodName, null, "Scheduler exits: unable to read configuration.");
            System.exit(1);
    }

        nc.printConfiguration();

        DuccProperties[] nps = nc.getToplevelNodepools();
        Map<String, DuccProperties> cls = nc.getClasses();

        nodepools = new NodePool[nps.length];                   // top-level nodepools
        schedulers = new IScheduler[nps.length];                // a schedler for each top-level nodepool

        // Here build up the ResourceClass definitions
        logger.info(methodName, null, "Classes:");
        logger.info(methodName, null, ResourceClass.getHeader());
        logger.info(methodName, null, ResourceClass.getDashes());
        for ( DuccProperties props : cls.values() ) {
            ResourceClass rc = new ResourceClass(props);
            resourceClasses.put(rc, rc);
            resourceClassesByName.put(rc.getName(), rc);
            logger.info(methodName, null, rc.toString());
        }

        DuccProperties dc = nc.getDefaultFairShareClass();
        if ( dc != null ) {
            defaultFairShareName = dc.getProperty("name");
        }

        dc = nc.getDefaultReserveClass();
        if ( dc != null ) {
            defaultReserveName = dc.getProperty("name");
        }

        // Instatntiate one scheduler per top-level nodepool
View Full Code Here


  public static String classes = "classes";
  public static String name = "name";
 
  private static NodeConfiguration getNodeConfiguration() {
    String location = "getNodeConfiguration";
    NodeConfiguration nc = null;
    String class_definitions = null;
    try {
      class_definitions =  System.getProperty(DUCC_HOME) + "/"+resources+"/"+SystemPropertyResolver.getStringProperty(DuccPropertiesResolver.ducc_rm_class_definitions, scheduler+"."+classes);
      nc = new NodeConfiguration(class_definitions, logger);
      nc.readConfiguration();
    }
    catch(Throwable t) {
      logger.error(location, jobid, t);
      logger.error(location, jobid, class_definitions);
    }
View Full Code Here

 
  private static String getDefaultFairShareClass() {
    String location = "getDefaultFairShareClass";
    String defaultReserveName = null;
    try {
      NodeConfiguration nc = getNodeConfiguration();
      DuccProperties rp = nc.getDefaultFairShareClass();
      defaultReserveName = rp.getProperty(name);
    }
    catch(Throwable t) {
      logger.error(location, jobid, t);
    }
View Full Code Here

 
  private static String getDefaultFixedClass() {
    String location = "getDefaultFixedClass";
    String defaultFixedName = null;
    try {
      NodeConfiguration nc = getNodeConfiguration();
      DuccProperties rp = nc.getDefaultFixedClass();
      defaultFixedName = rp.getProperty(name);
    }
    catch(Throwable t) {
      logger.error(location, jobid, t);
    }
View Full Code Here

        instance = getInstance();

        File file = new File(fileName);
        if ( lastModified != file.lastModified() ) {         // reread if it looks like it changed
            lastModified = file.lastModified();
            nodeConfiguration = new NodeConfiguration(fileName, logger);
            lastModified = file.lastModified();
            nodeConfiguration.readConfiguration();
        }

    return nodeConfiguration;
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.common.NodeConfiguration$ClassSorter

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.