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