@Override public void setConf(Configuration newConf) { this.conf = (CoronaConf) newConf; nodeExpiryInterval = conf.getNodeExpiryInterval(); if (this.expireNodesThread != null) { this.expireNodesThread.interrupt(); } loadManager = new LoadManager(this); topologyCache = new TopologyCache(conf); cpuToResourcePartitioning = conf.getCpuToResourcePartitioning(); for (Map.Entry<Integer, Map<ResourceType, Integer>> entry : cpuToResourcePartitioning.entrySet()) { for (ResourceType type : entry.getValue().keySet()) { if (!typeToIndices.containsKey(type)) { typeToIndices.put(type, new RunnableIndices(type)); } } } resourceLimit.setConf(conf); faultManager.setConf(conf); }
/** * Check if a node has enough resources. * * @param node The node * @return A boolean indicating if it has enough resources. */ public boolean hasEnoughResource(ClusterNode node) { return resourceLimit.hasEnoughResource(node); }