Class YarnRegistryViewForProviders
java.lang.Object
org.apache.hadoop.yarn.service.registry.YarnRegistryViewForProviders
Registry view for providers. This tracks where the service
is registered, offers access to the record and other things.
-
Constructor Summary
ConstructorsConstructorDescriptionYarnRegistryViewForProviders(org.apache.hadoop.registry.client.api.RegistryOperations registryOperations, String user, String serviceClass, String instanceName, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteChildren(String path, boolean recursive) Delete the children of a path -but not the path itself.voiddeleteComponent(ComponentInstanceId instanceId, String containerId) Delete a component.Get the absolute path to where the service has registered itself.org.apache.hadoop.registry.client.types.ServiceRecordgetComponent(String componentName) Get a component.Get the path to where the service has registered itself.getUser()List components.voidputComponent(String serviceClass, String serviceName, String componentName, org.apache.hadoop.registry.client.types.ServiceRecord record) Add a component.voidputComponent(String componentName, org.apache.hadoop.registry.client.types.ServiceRecord record) Add a component under the slider name/entry.putService(String username, String serviceClass, String serviceName, org.apache.hadoop.registry.client.types.ServiceRecord record, boolean deleteTreeFirst) Add a service under a path, optionally purging any history.registerSelf(org.apache.hadoop.registry.client.types.ServiceRecord record, boolean deleteTreeFirst) Add a service under a path for the current user.
-
Constructor Details
-
YarnRegistryViewForProviders
-
-
Method Details
-
getUser
-
getSelfRegistrationPath
Get the path to where the service has registered itself. Null until the service is registered- Returns:
- the service registration path.
-
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 namerecord- 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 ~usercomponentName- component namerecord- 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
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- userserviceClass- service class to use under ~userserviceName- name of the servicerecord- service recorddeleteTreeFirst- 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 recorddeleteTreeFirst- perform recursive delete of the path first- Returns:
- the path the service was created at
- Throws:
IOException
-
deleteComponent
Delete a component.- Parameters:
containerId- component name- Throws:
IOException
-
deleteChildren
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 deleterecursive- flag to request recursive deletes- Throws:
IOException- IO problems
-