Tabnine Logo
SliderUtils.isSet
Code IndexAdd Tabnine to your IDE (free)

How to use
isSet
method
in
org.apache.slider.common.tools.SliderUtils

Best Java code snippets using org.apache.slider.common.tools.SliderUtils.isSet (Showing top 20 results out of 315)

origin: apache/incubator-slider

public YarnRegistryViewForProviders(RegistryOperations registryOperations,
  String user,
  String sliderServiceClass,
  String instanceName,
  ApplicationAttemptId applicationAttemptId) {
 Preconditions.checkArgument(registryOperations != null,
   "null registry operations");
 Preconditions.checkArgument(user != null, "null user");
 Preconditions.checkArgument(SliderUtils.isSet(sliderServiceClass),
   "unset service class");
 Preconditions.checkArgument(SliderUtils.isSet(instanceName),
   "instanceName");
 Preconditions.checkArgument(applicationAttemptId != null,
   "null applicationAttemptId");
 this.registryOperations = registryOperations;
 this.user = user;
 this.sliderServiceClass = sliderServiceClass;
 this.instanceName = instanceName;
 this.applicationAttemptId = applicationAttemptId;
}
origin: apache/incubator-slider

/**
 * Release a tag associated with a container
 *
 * @param component
 * @param containerId
 */
public void releaseTag(String component, String containerId) {
 if (SliderUtils.isSet(component) && SliderUtils.isSet(containerId)) {
  ConcurrentHashMap<String, String> compTags = allTags.get(component);
  if (compTags != null) {
   synchronized (compTags) {
    for (String key : compTags.keySet()) {
     if (compTags.get(key).equals(containerId)) {
      compTags.put(key, FREE);
     }
    }
   }
  }
 }
}
origin: org.apache.slider/slider-core

/**
 * Release a tag associated with a container
 *
 * @param component
 * @param containerId
 */
public void releaseTag(String component, String containerId) {
 if (SliderUtils.isSet(component) && SliderUtils.isSet(containerId)) {
  ConcurrentHashMap<String, String> compTags = allTags.get(component);
  if (compTags != null) {
   synchronized (compTags) {
    for (String key : compTags.keySet()) {
     if (compTags.get(key).equals(containerId)) {
      compTags.put(key, FREE);
     }
    }
   }
  }
 }
}
origin: apache/incubator-slider

/**
 * Set the size of the heap if a non-empty heap is passed in. 
 * @param heap empty string or something like "128M" ,"1G" etc. The value is
 * trimmed.
 */
public void setJVMHeap(String heap) {
 if (SliderUtils.isSet(heap)) {
  add("-Xmx" + heap.trim());
 }
}
origin: org.apache.slider/slider-core

/**
 * Set the size of the heap if a non-empty heap is passed in. 
 * @param heap empty string or something like "128M" ,"1G" etc. The value is
 * trimmed.
 */
public void setJVMHeap(String heap) {
 if (SliderUtils.isSet(heap)) {
  add("-Xmx" + heap.trim());
 }
}
origin: org.apache.slider/slider-core

public boolean isSet(String key) {
 return SliderUtils.isSet(get(key));
}
origin: apache/incubator-slider

public boolean isSet(String key) {
 return SliderUtils.isSet(get(key));
}
origin: org.apache.slider/slider-core

/**
 * Build up the path string for package install location -no attempt to
 * create the directory is made
 *
 * @return the path for persistent app package
 */
public Path buildPackageDirPath(String packageName, String packageVersion) {
 Preconditions.checkNotNull(packageName);
 Path path = getBaseApplicationPath();
 path = new Path(path, SliderKeys.PACKAGE_DIRECTORY + "/" + packageName);
 if (SliderUtils.isSet(packageVersion)) {
  path = new Path(path, packageVersion);
 }
 return path;
}
origin: apache/incubator-slider

/**
 * Build up the path string for package install location -no attempt to
 * create the directory is made
 *
 * @return the path for persistent app package
 */
public Path buildPackageDirPath(String packageName, String packageVersion) {
 Preconditions.checkNotNull(packageName);
 Path path = getBaseApplicationPath();
 path = new Path(path, SliderKeys.PACKAGE_DIRECTORY + "/" + packageName);
 if (SliderUtils.isSet(packageVersion)) {
  path = new Path(path, packageVersion);
 }
 return path;
}
origin: org.apache.slider/slider-core

private boolean isDockerContainer(String roleGroup) {
 String type = getApplicationComponent(roleGroup).getType();
 if (SliderUtils.isSet(type)) {
  return type.toLowerCase().equals(SliderUtils.DOCKER) || type.toLowerCase().equals(SliderUtils.DOCKER_YARN);
 }
 return false;
}
origin: apache/incubator-slider

private boolean isDockerContainer(String roleGroup) {
 String type = getApplicationComponent(roleGroup).getType();
 if (SliderUtils.isSet(type)) {
  return type.toLowerCase().equals(SliderUtils.DOCKER) || type.toLowerCase().equals(SliderUtils.DOCKER_YARN);
 }
 return false;
}
origin: org.apache.slider/slider-core

private boolean isYarnDockerContainer(String roleGroup) {
 String type = getApplicationComponent(roleGroup).getType();
 if (SliderUtils.isSet(type)) {
  return type.toLowerCase().equals(SliderUtils.DOCKER_YARN);
 }
 return false;
}
origin: apache/incubator-slider

private boolean isYarnDockerContainer(String roleGroup) {
 String type = getApplicationComponent(roleGroup).getType();
 if (SliderUtils.isSet(type)) {
  return type.toLowerCase().equals(SliderUtils.DOCKER_YARN);
 }
 return false;
}
origin: org.apache.slider/slider-core

 /**
  * Query for the image path being set (non null/non empty)
  * @return true if there is a path in the image path option
  */
 @JsonIgnore
 public boolean isImagePathSet() {
  return SliderUtils.isSet(getImagePath());
 }
}
origin: apache/incubator-slider

 /**
  * Query for the image path being set (non null/non empty)
  * @return true if there is a path in the image path option
  */
 @JsonIgnore
 public boolean isImagePathSet() {
  return SliderUtils.isSet(getImagePath());
 }
}
origin: apache/incubator-slider

/**
 * Inner Validation logic for container request
 * @param containerRequest request
 * @param priority raw priority of role
 * @param requestDetails details for error messages
 */
@VisibleForTesting
public static void validateContainerRequest(AMRMClient.ContainerRequest containerRequest,
 int priority, String requestDetails) {
 String exp = containerRequest.getNodeLabelExpression();
 boolean hasRacks = containerRequest.getRacks() != null &&
  (!containerRequest.getRacks().isEmpty());
 boolean hasNodes = containerRequest.getNodes() != null &&
  (!containerRequest.getNodes().isEmpty());
 boolean hasLabel = SliderUtils.isSet(exp);
 // Don't support specifying >= 2 node labels in a node label expression now
 if (hasLabel && (exp.contains("&&") || exp.contains("||"))) {
  throw new InvalidContainerRequestException(
    "Cannot specify more than two node labels"
      + " in a single node label expression: " + requestDetails);
 }
 // Don't allow specify node label against ANY request listing hosts or racks
 if (hasLabel && ( hasRacks || hasNodes)) {
  throw new InvalidContainerRequestException(
    "Cannot specify node label with rack or node: " + requestDetails);
 }
}
origin: org.apache.slider/slider-core

 @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);
  }
 }
}
origin: apache/incubator-slider

 @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);
  }
 }
}
origin: org.apache.slider/slider-core

/**
 * Add the ZK paths to the application options. 
 * 
 * @param zkBinding ZK binding
 */
public void addZKBinding(ZKPathBuilder zkBinding) throws BadConfigException {
 String quorum = zkBinding.getAppQuorum();
 if (SliderUtils.isSet(quorum)) {
  MapOperations globalAppOptions =
    instanceDescription.getAppConfOperations().getGlobalOptions();
  globalAppOptions.put(ZOOKEEPER_PATH, zkBinding.getAppPath());
  globalAppOptions.put(ZOOKEEPER_QUORUM, quorum);
  globalAppOptions.put(ZOOKEEPER_HOSTS,
    ZookeeperUtils.convertToHostsOnlyList(quorum));
 }
}
origin: apache/incubator-slider

/**
 * Add the ZK paths to the application options. 
 * 
 * @param zkBinding ZK binding
 */
public void addZKBinding(ZKPathBuilder zkBinding) throws BadConfigException {
 String quorum = zkBinding.getAppQuorum();
 if (SliderUtils.isSet(quorum)) {
  MapOperations globalAppOptions =
    instanceDescription.getAppConfOperations().getGlobalOptions();
  globalAppOptions.put(ZOOKEEPER_PATH, zkBinding.getAppPath());
  globalAppOptions.put(ZOOKEEPER_QUORUM, quorum);
  globalAppOptions.put(ZOOKEEPER_HOSTS,
    ZookeeperUtils.convertToHostsOnlyList(quorum));
 }
}
org.apache.slider.common.toolsSliderUtilsisSet

Popular methods of SliderUtils

  • buildEnvMap
  • extractDomainNameFromFQDN
  • extractFirstLine
    Extract the first line of a multi-line string. This is typically used to prune the stack trace appen
  • getApplicationResourceInputStream
  • getHdpVersion
    Retrieve the HDP version if it is an HDP cluster, or null otherwise. It first checks if system prope
  • isHdp
    Query to find if it is an HDP cluster
  • listDir
    List a directory in the local filesystem
  • sortApplicationsByMostRecent
    Sorts the given list of application reports, most recently started or finished instance first.
  • truncate
    Truncate the given string to a maximum length provided with a pad (...) added to the end if expected
  • write
    Write bytes to a file
  • addBuildInfo
    Add the cluster build information; this will include Hadoop details too
  • appReportToString
  • addBuildInfo,
  • appReportToString,
  • appendToURL,
  • buildApplicationReportMap,
  • buildClasspath,
  • checkCredentialCacheFile,
  • checkForRequiredNativeLibraries,
  • checkPort,
  • collectionToStringList

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now