public static void checkNonNull(String value, String field, String type) throws SliderException { if (SliderUtils.isUnset(value)) { throw new SliderException(type + "." + field + " cannot be null"); } }
public int getMaxInstanceCountInt() throws BadConfigException { if (SliderUtils.isUnset(maxInstanceCount)) { return Integer.MAX_VALUE; } try { return Integer.parseInt(maxInstanceCount); } catch (NumberFormatException nfe) { throw new BadConfigException(nfe, "Invalid value for maxInstanceCount for %s", name); } }
public int getMinInstanceCountInt() throws BadConfigException { if (SliderUtils.isUnset(minInstanceCount)) { return 0; } try { return Integer.parseInt(minInstanceCount); } catch (NumberFormatException nfe) { throw new BadConfigException(nfe, "Invalid value for minInstanceCount for %s", name); } }
public static void checkNonNull(String value, String field, String type) throws SliderException { if (SliderUtils.isUnset(value)) { throw new SliderException(type + "." + field + " cannot be null"); } }
public int getMinInstanceCountInt() throws BadConfigException { if (SliderUtils.isUnset(minInstanceCount)) { return 0; } try { return Integer.parseInt(minInstanceCount); } catch (NumberFormatException nfe) { throw new BadConfigException(nfe, "Invalid value for minInstanceCount for %s", name); } }
public int getMaxInstanceCountInt() throws BadConfigException { if (SliderUtils.isUnset(maxInstanceCount)) { return Integer.MAX_VALUE; } try { return Integer.parseInt(maxInstanceCount); } catch (NumberFormatException nfe) { throw new BadConfigException(nfe, "Invalid value for maxInstanceCount for %s", name); } }
public Boolean getAutoStartOnFailureBoolean() { if (SliderUtils.isUnset(getAutoStartOnFailure())) { return Boolean.FALSE; } return Boolean.parseBoolean(getAutoStartOnFailure()); }
public Boolean getAutoStartOnFailureBoolean() { if (SliderUtils.isUnset(getAutoStartOnFailure())) { return Boolean.FALSE; } return Boolean.parseBoolean(getAutoStartOnFailure()); }
/** * Verify that an option is set: that is defined AND non-empty * @param key key to verify * @throws BadConfigException */ public void verifyOptionSet(String key) throws BadConfigException { if (SliderUtils.isUnset(getOption(key, null))) { throw new BadConfigException("Unset cluster option %s", key); } }
/** * Verify that an option is set: that is defined AND non-empty * @param key key to verify * @throws BadConfigException */ public void verifyOptionSet(String key) throws BadConfigException { if (SliderUtils.isUnset(getOption(key, null))) { throw new BadConfigException("Unset cluster option %s", key); } }
/** * Verify that an option is set: that is defined AND non-empty * @param key * @throws BadConfigException */ public void verifyOptionSet(String key) throws BadConfigException { if (SliderUtils.isUnset(getOption(key, null))) { throw new BadConfigException("Unset option %s", key); } }
/** * Verify that an option is set: that is defined AND non-empty * @param key * @throws BadConfigException */ public void verifyOptionSet(String key) throws BadConfigException { if (SliderUtils.isUnset(getOption(key, null))) { throw new BadConfigException("Unset option %s", key); } }
/** * Is this node instance a suitable candidate for the specific role? * @param role role ID * @param label label which must match, or "" for no label checks * @return true if the node has space for this role, is running and the labels * match. */ public boolean canHost(int role, String label) { return isOnline() && (SliderUtils.isUnset(label) || label.equals(nodeLabels)) // label match && getOrCreate(role).isAvailable(); // no live role }
/** * Is this node instance a suitable candidate for the specific role? * @param role role ID * @param label label which must match, or "" for no label checks * @return true if the node has space for this role, is running and the labels * match. */ public boolean canHost(int role, String label) { return isOnline() && (SliderUtils.isUnset(label) || label.equals(nodeLabels)) // label match && getOrCreate(role).isAvailable(); // no live role }
public String getPrincipal () throws IOException { String principal = instanceDefinition.getAppConfOperations() .getComponent(SliderKeys.COMPONENT_AM).get(SliderXmlConfKeys.KEY_KEYTAB_PRINCIPAL); if (SliderUtils.isUnset(principal)) { principal = UserGroupInformation.getLoginUser().getShortUserName(); log.info("No principal set in the slider configuration. Will use AM login" + " identity {} to attempt keytab-based login", principal); } return principal; }
public String getPrincipal () throws IOException { String principal = instanceDefinition.getAppConfOperations() .getComponent(SliderKeys.COMPONENT_AM).get(SliderXmlConfKeys.KEY_KEYTAB_PRINCIPAL); if (SliderUtils.isUnset(principal)) { principal = UserGroupInformation.getLoginUser().getShortUserName(); log.info("No principal set in the slider configuration. Will use AM login" + " identity {} to attempt keytab-based login", principal); } return principal; }
private String getClusterName() { if (SliderUtils.isUnset(clusterName)) { clusterName = getAmState().getInternalsSnapshot().get(OptionKeys.APPLICATION_NAME); } return clusterName; }
private String getClusterName() { if (SliderUtils.isUnset(clusterName)) { clusterName = getAmState().getInternalsSnapshot().get(OptionKeys.APPLICATION_NAME); } return clusterName; }
@Override public void validate() throws BadCommandArgumentsException, UsageException { super.validate(); if (keytab != null && SliderUtils.isUnset(principal)) { throw new UsageException("Missing argument " + ARG_PRINCIPAL); } if (keytab == null && SliderUtils.isSet(principal)) { throw new UsageException("Missing argument " + ARG_KEYTAB); } } }
@Override public void validate() throws BadCommandArgumentsException, UsageException { super.validate(); if (keytab != null && SliderUtils.isUnset(principal)) { throw new UsageException("Missing argument " + ARG_PRINCIPAL); } if (keytab == null && SliderUtils.isSet(principal)) { throw new UsageException("Missing argument " + ARG_KEYTAB); } } }