/** * get a global option * @param key key * @return value or null * */ public String get(String key) { return globalOptions.get(key); } /**
/** * get a global option * @param key key * @return value or null * */ public String get(String key) { return globalOptions.get(key); } /**
/** * Set a property if it is not already set * @param key key * @param value value */ public void putIfUnset(String key, String value) { if (get(key) == null) { put(key, value); } }
/** * Get the path to the DFS configuration that is defined in the cluster specification * @return the generated configuration dir */ public String getGeneratedConfDir() { return getGlobalInternalOptions().get( InternalKeys.INTERNAL_GENERATED_CONF_PATH); }
/** * Get the path to the DFS configuration that is defined in the cluster specification * @return the generated configuration dir */ public String getGeneratedConfDir() { return getGlobalInternalOptions().get( InternalKeys.INTERNAL_GENERATED_CONF_PATH); }
/** * Set a property if it is not already set * @param key key * @param value value */ public void putIfUnset(String key, String value) { if (get(key) == null) { put(key, value); } }
public boolean isSet(String key) { return SliderUtils.isSet(get(key)); }
public boolean isSet(String key) { return SliderUtils.isSet(get(key)); }
/** * Is this app package versioned? * * @return true if {@link SliderKeys#APP_VERSION} was set in the app config * provided during creation of this app * @since 0.80.0-incubating */ public boolean isVersioned() { return StringUtils.isNotEmpty(getAppConfOperations().getGlobalOptions() .get(SliderKeys.APP_VERSION)); }
public boolean isKeytabProvided() { String keytabLocalPath = instanceDefinition.getAppConfOperations() .getComponent(SliderKeys.COMPONENT_AM) .get(SliderXmlConfKeys.KEY_AM_KEYTAB_LOCAL_PATH); String keytabName = instanceDefinition.getAppConfOperations() .getComponent(SliderKeys.COMPONENT_AM) .get(SliderXmlConfKeys.KEY_AM_LOGIN_KEYTAB_NAME); return StringUtils.isNotBlank(keytabLocalPath) || StringUtils.isNotBlank(keytabName); }
/** * Is this app package versioned? * * @return true if {@link SliderKeys#APP_VERSION} was set in the app config * provided during creation of this app * @since 0.80.0-incubating */ public boolean isVersioned() { return StringUtils.isNotEmpty(getAppConfOperations().getGlobalOptions() .get(SliderKeys.APP_VERSION)); }
public boolean isKeytabProvided() { String keytabLocalPath = instanceDefinition.getAppConfOperations() .getComponent(SliderKeys.COMPONENT_AM) .get(SliderXmlConfKeys.KEY_AM_KEYTAB_LOCAL_PATH); String keytabName = instanceDefinition.getAppConfOperations() .getComponent(SliderKeys.COMPONENT_AM) .get(SliderXmlConfKeys.KEY_AM_LOGIN_KEYTAB_NAME); return StringUtils.isNotBlank(keytabLocalPath) || StringUtils.isNotBlank(keytabName); }
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; }
/** * append to a global option * @param key key * @return value * */ public String append(String key, String value) { if (SliderUtils.isUnset(value)) { return null; } if (globalOptions.containsKey(key)) { globalOptions.put(key, globalOptions.get(key) + "," + value); } else { globalOptions.put(key, value); } return globalOptions.get(key); }
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; }
/** * append to a global option * @param key key * @return value * */ public String append(String key, String value) { if (SliderUtils.isUnset(value)) { return null; } if (globalOptions.containsKey(key)) { globalOptions.put(key, globalOptions.get(key) + "," + value); } else { globalOptions.put(key, value); } return globalOptions.get(key); }