public ClusterControllerService(final CCConfig config, final ICCApplication application) throws Exception {
this.ccConfig = config;
this.configManager = ccConfig.getConfigManager();
if (application == null) {
throw new IllegalArgumentException("ICCApplication cannot be null");
}
this.application = application;
File jobLogFolder = new File(ccConfig.getRootDir(), "logs/jobs");
jobLog = new LogFile(jobLogFolder);
final INetworkSecurityConfig securityConfig = getNetworkSecurityConfig();
networkSecurityManager = new NetworkSecurityManager(securityConfig);
workQueue = new WorkQueue("ClusterController", Thread.MAX_PRIORITY);
this.timer = new Timer(true);
final ClusterTopology topology = computeClusterTopology(ccConfig);
ccContext = new ClusterControllerContext(topology);
sweeper = new DeadNodeSweeper();
resultDirectoryService =
new ResultDirectoryService(ccConfig.getResultTTL(), ccConfig.getResultSweepThreshold());
deploymentRunMap = new HashMap<>();
stateDumpRunMap = new HashMap<>();
threadDumpRunMap = Collections.synchronizedMap(new HashMap<>());
nodeManager = new NodeManager(this, ccConfig, resourceManager, application.getGatekeeper());
ccId = ccConfig.getCcId();
jobIdFactory = new JobIdFactory(ccId);
deployedJobSpecIdFactory = new DeployedJobSpecIdFactory();
}