/** * Get the node failure threshold for a specific role, falling back to * the global one if not * @param roleGroup role group * @return the threshold for failures */ private int getNodeFailureThresholdForRole(String roleGroup) { ConfTreeOperations resources = instanceDefinition.getResourceOperations(); return resources.getComponentOptInt(roleGroup, NODE_FAILURE_THRESHOLD, nodeFailureThreshold); }
/** * Get the health threshold percent for a specific role, falling back to * the global one if not. * @param roleGroup role group * @return the threshold percent for health */ public int getHealthThresholdPercentForRole(String roleGroup) { ConfTreeOperations resources = instanceDefinition.getResourceOperations(); return resources.getComponentOptInt(roleGroup, CONTAINER_HEALTH_THRESHOLD_PERCENT, healthThresholdPercent); }
/** * Get the node failure threshold for a specific role, falling back to * the global one if not * @param roleGroup role group * @return the threshold for failures */ private int getNodeFailureThresholdForRole(String roleGroup) { ConfTreeOperations resources = instanceDefinition.getResourceOperations(); return resources.getComponentOptInt(roleGroup, NODE_FAILURE_THRESHOLD, nodeFailureThreshold); }
/** * Get the desired instance count of a role, rejecting negative values * @param resources resource map * @param roleGroup role group * @return the instance count * @throws BadConfigException if the count is negative */ private int getDesiredInstanceCount(ConfTreeOperations resources, String roleGroup) throws BadConfigException { int desiredInstanceCount = resources.getComponentOptInt(roleGroup, COMPONENT_INSTANCES, 0); if (desiredInstanceCount < 0) { log.error("Role {} has negative desired instances : {}", roleGroup, desiredInstanceCount); throw new BadConfigException( "Negative instance count (%) requested for component %s", desiredInstanceCount, roleGroup); } return desiredInstanceCount; }
/** * Get the desired instance count of a role, rejecting negative values * @param resources resource map * @param roleGroup role group * @return the instance count * @throws BadConfigException if the count is negative */ private int getDesiredInstanceCount(ConfTreeOperations resources, String roleGroup) throws BadConfigException { int desiredInstanceCount = resources.getComponentOptInt(roleGroup, COMPONENT_INSTANCES, 0); if (desiredInstanceCount < 0) { log.error("Role {} has negative desired instances : {}", roleGroup, desiredInstanceCount); throw new BadConfigException( "Negative instance count (%) requested for component %s", desiredInstanceCount, roleGroup); } return desiredInstanceCount; }
/** * Get the failure threshold for a specific role, falling back to * the global one if not * @param roleStatus role * @return the threshold for failures */ private int getFailureThresholdForRole(RoleStatus roleStatus) { ConfTreeOperations resources = instanceDefinition.getResourceOperations(); return resources.getComponentOptInt(roleStatus.getGroup(), CONTAINER_FAILURE_THRESHOLD, failureThreshold); }
/** * Get the failure threshold for a specific role, falling back to * the global one if not * @param roleStatus role * @return the threshold for failures */ private int getFailureThresholdForRole(RoleStatus roleStatus) { ConfTreeOperations resources = instanceDefinition.getResourceOperations(); return resources.getComponentOptInt(roleStatus.getGroup(), CONTAINER_FAILURE_THRESHOLD, failureThreshold); }
if (!SliderKeys.COMPONENT_AM.equals(componentName)) { clientComponentInstances.put(componentName, clientResources .getComponentOptInt(componentName, COMPONENT_INSTANCES, -1));
if (!SliderKeys.COMPONENT_AM.equals(componentName)) { clientComponentInstances.put(componentName, clientResources .getComponentOptInt(componentName, COMPONENT_INSTANCES, -1));
int priority = resources.getComponentOptInt(name, COMPONENT_PRIORITY, i);
int priority = resources.getComponentOptInt(name, COMPONENT_PRIORITY, i);
getAppConfOperations().getComponentOptInt(roleGroup, AgentKeys.WAIT_HEARTBEAT, 0);
getAppConfOperations().getComponentOptInt(roleGroup, AgentKeys.WAIT_HEARTBEAT, 0);