Class YarnRegistryViewForProviders

java.lang.Object
org.apache.hadoop.yarn.service.registry.YarnRegistryViewForProviders

public class YarnRegistryViewForProviders extends Object
Registry view for providers. This tracks where the service is registered, offers access to the record and other things.
  • Constructor Details

    • YarnRegistryViewForProviders

      public YarnRegistryViewForProviders(org.apache.hadoop.registry.client.api.RegistryOperations registryOperations, String user, String serviceClass, String instanceName, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId)
  • Method Details

    • getUser

      public String getUser()
    • getSelfRegistrationPath

      public String getSelfRegistrationPath()
      Get the path to where the service has registered itself. Null until the service is registered
      Returns:
      the service registration path.
    • getAbsoluteSelfRegistrationPath

      public String getAbsoluteSelfRegistrationPath()
      Get the absolute path to where the service has registered itself. This includes the base registry path Null until the service is registered
      Returns:
      the service registration path.
    • putComponent

      public void putComponent(String componentName, org.apache.hadoop.registry.client.types.ServiceRecord record) throws IOException
      Add a component under the slider name/entry.
      Parameters:
      componentName - component name
      record - record to put
      Throws:
      IOException
    • putComponent

      public void putComponent(String serviceClass, String serviceName, String componentName, org.apache.hadoop.registry.client.types.ServiceRecord record) throws IOException
      Add a component.
      Parameters:
      serviceClass - service class to use under ~user
      componentName - component name
      record - record to put
      Throws:
      IOException
    • getComponent

      public org.apache.hadoop.registry.client.types.ServiceRecord getComponent(String componentName) throws IOException
      Get a component.
      Parameters:
      componentName - component name
      Returns:
      the service record
      Throws:
      IOException
    • listComponents

      public List<String> listComponents() throws IOException
      List components.
      Returns:
      a list of components
      Throws:
      IOException
    • putService

      public String putService(String username, String serviceClass, String serviceName, org.apache.hadoop.registry.client.types.ServiceRecord record, boolean deleteTreeFirst) throws IOException
      Add a service under a path, optionally purging any history.
      Parameters:
      username - user
      serviceClass - service class to use under ~user
      serviceName - name of the service
      record - service record
      deleteTreeFirst - perform recursive delete of the path first.
      Returns:
      the path the service was created at
      Throws:
      IOException
    • registerSelf

      public String registerSelf(org.apache.hadoop.registry.client.types.ServiceRecord record, boolean deleteTreeFirst) throws IOException
      Add a service under a path for the current user.
      Parameters:
      record - service record
      deleteTreeFirst - perform recursive delete of the path first
      Returns:
      the path the service was created at
      Throws:
      IOException
    • deleteComponent

      public void deleteComponent(ComponentInstanceId instanceId, String containerId) throws IOException
      Delete a component.
      Parameters:
      containerId - component name
      Throws:
      IOException
    • deleteChildren

      public void deleteChildren(String path, boolean recursive) throws IOException
      Delete the children of a path -but not the path itself. It is not an error if the path does not exist
      Parameters:
      path - path to delete
      recursive - flag to request recursive deletes
      Throws:
      IOException - IO problems