Class ServiceApiUtil

java.lang.Object
org.apache.hadoop.yarn.service.utils.ServiceApiUtil

public class ServiceApiUtil extends Object
  • Field Details

  • Constructor Details

    • ServiceApiUtil

      public ServiceApiUtil()
  • Method Details

    • setJsonSerDeser

      @VisibleForTesting public static void setJsonSerDeser(JsonSerDeser jsd)
    • validateAndResolveService

      @VisibleForTesting public static void validateAndResolveService(Service service, SliderFileSystem fs, org.apache.hadoop.conf.Configuration conf) throws IOException
      Throws:
      IOException
    • validateJvmOpts

      public static void validateJvmOpts(String jvmOpts) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • validateKerberosPrincipal

      public static void validateKerberosPrincipal(KerberosPrincipal kerberosPrincipal) throws IOException
      Throws:
      IOException
    • validateNameFormat

      public static void validateNameFormat(String name, org.apache.hadoop.conf.Configuration conf)
    • getComponents

      @VisibleForTesting public static List<Component> getComponents(SliderFileSystem fs, String serviceName) throws IOException
      Throws:
      IOException
    • loadService

      public static Service loadService(SliderFileSystem fs, String serviceName) throws IOException
      Throws:
      IOException
    • loadServiceUpgrade

      public static Service loadServiceUpgrade(SliderFileSystem fs, String serviceName, String version) throws IOException
      Throws:
      IOException
    • loadServiceFrom

      public static Service loadServiceFrom(SliderFileSystem fs, org.apache.hadoop.fs.Path appDefPath) throws IOException
      Throws:
      IOException
    • getServiceJsonPath

      public static org.apache.hadoop.fs.Path getServiceJsonPath(SliderFileSystem fs, String serviceName)
    • validateCompResourceSize

      public static void validateCompResourceSize(org.apache.hadoop.yarn.api.records.Resource maxResource, Service service) throws org.apache.hadoop.yarn.exceptions.YarnException
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
    • sortByDependencies

      public static Collection<Component> sortByDependencies(List<Component> components)
    • createDirAndPersistApp

      public static void createDirAndPersistApp(SliderFileSystem fs, org.apache.hadoop.fs.Path appDir, Service service) throws IOException, SliderException
      Throws:
      IOException
      SliderException
    • writeAppDefinition

      public static org.apache.hadoop.fs.Path writeAppDefinition(SliderFileSystem fs, org.apache.hadoop.fs.Path appDir, Service service) throws IOException
      Throws:
      IOException
    • writeAppDefinition

      public static org.apache.hadoop.fs.Path writeAppDefinition(SliderFileSystem fs, Service service) throws IOException
      Throws:
      IOException
    • getLiveContainers

      public static List<Container> getLiveContainers(Service service, List<String> componentInstances) throws org.apache.hadoop.yarn.exceptions.YarnException
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
    • validateInstancesUpgrade

      public static void validateInstancesUpgrade(List<Container> liveContainers) throws org.apache.hadoop.yarn.exceptions.YarnException
      Validates that the component instances that are requested to upgrade require an upgrade.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
    • isUpgradable

      public static boolean isUpgradable(Container container)
      Returns whether the container can be upgraded in the current state.
    • validateAndResolveCompsUpgrade

      public static List<Container> validateAndResolveCompsUpgrade(Service liveService, Collection<String> compNames) throws org.apache.hadoop.yarn.exceptions.YarnException
      Validates the components that are requested to upgrade require an upgrade. It returns the instances of the components which need upgrade.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
    • validateAndResolveCompsStable

      public static List<Container> validateAndResolveCompsStable(Service liveService, Collection<String> compNames) throws org.apache.hadoop.yarn.exceptions.YarnException
      Validates the components that are requested are stable for upgrade. It returns the instances of the components which are in ready state.
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
    • getHostnameSuffix

      public static String getHostnameSuffix(String serviceName, org.apache.hadoop.conf.Configuration conf)
    • parseAndValidateComponentInstanceName

      public static String parseAndValidateComponentInstanceName(String instanceOrHostname, String serviceName, org.apache.hadoop.conf.Configuration conf) throws IllegalArgumentException
      Throws:
      IllegalArgumentException
    • parseComponentName

      public static String parseComponentName(String componentInstanceName) throws org.apache.hadoop.yarn.exceptions.YarnException
      Throws:
      org.apache.hadoop.yarn.exceptions.YarnException
    • $

      public static String $(String s)
    • resolveCompsDependency

      public static List<String> resolveCompsDependency(Service service)
    • checkServiceDependencySatisified

      public static void checkServiceDependencySatisified(Service service)