public class JobResourceProvider extends AbstractJDBCResourceProvider<org.apache.ambari.server.controller.internal.JobResourceProvider.JobFields>
Modifier and Type | Class and Description |
---|---|
static interface |
JobResourceProvider.JobFetcher
Simple interface for fetching jobs from db.
|
protected class |
JobResourceProvider.PostgresJobFetcher
A job fetcher that queries a postgres job table.
|
AbstractResourceProvider.Command<T>
Modifier and Type | Field and Description |
---|---|
protected static String |
JOB_CLUSTER_NAME_PROPERTY_ID |
protected static String |
JOB_CONF_PATH_PROPERTY_ID |
protected static String |
JOB_ELAPSED_TIME_PROPERTY_ID |
protected static String |
JOB_ID_PROPERTY_ID |
protected static String |
JOB_INPUT_BYTES_PROPERTY_ID |
protected static String |
JOB_MAPS_PROPERTY_ID |
protected static String |
JOB_NAME_PROPERTY_ID |
protected static String |
JOB_OUTPUT_BYTES_PROPERTY_ID |
protected static String |
JOB_REDUCES_PROPERTY_ID |
protected static String |
JOB_STATUS_PROPERTY_ID |
protected static String |
JOB_SUBMIT_TIME_PROPERTY_ID |
protected static String |
JOB_USER_NAME_PROPERTY_ID |
protected static String |
JOB_WORKFLOW_ENTITY_NAME_PROPERTY_ID |
protected static String |
JOB_WORKFLOW_ID_PROPERTY_ID |
protected JobResourceProvider.JobFetcher |
jobFetcher |
protected static Map<Resource.Type,String> |
keyPropertyIds
The key property ids for a Job resource.
|
protected static Set<String> |
propertyIds
The property ids for a Job resource.
|
PROPERTIES_ATTRIBUTES_REGEX
Modifier | Constructor and Description |
---|---|
protected |
JobResourceProvider()
Create a new job resource provider.
|
protected |
JobResourceProvider(JobResourceProvider.JobFetcher jobFetcher)
Create a new job resource provider.
|
Modifier and Type | Method and Description |
---|---|
RequestStatus |
createResources(Request request)
Create the resources defined by the properties in the given request object.
|
RequestStatus |
deleteResources(Request request,
Predicate predicate)
Delete the resources selected by the given predicate.
|
protected Map<String,org.apache.ambari.server.controller.internal.JobResourceProvider.JobFields> |
getDBFieldMap()
Gets a map from property ids to db fields.
|
Map<Resource.Type,String> |
getKeyPropertyIds()
Get the key property ids for the resource type associated with this resource
provider.
|
protected Set<String> |
getPKPropertyIds()
Get the set of property ids that uniquely identify the resources
of this provider.
|
Set<Resource> |
getResources(Request request,
Predicate predicate)
Get a set of
resources based on the given request and predicate
information. |
RequestStatus |
updateResources(Request request,
Predicate predicate)
Update the resources selected by the given predicate with the properties
from the given request object.
|
getDBField, getDBFieldString, setInt, setLong, setString
addObserver, createResources, getConfigurationRequests, getPropertyMaps, getPropertyMaps, getQueryParameterValue, getRequestStatus, getRequestStatus, getRequestStatus, getResources, modifyResources, notifyCreate, notifyDelete, notifyUpdate, parseProperties, updateObservers
checkCategory, checkConfigPropertyIds, checkPropertyIds, containsArguments, getCategoryIds, getPropertyIds, getRegexEntry, getRegexGroups, getRequestPropertyIds, isPatternKey, isPropertyCategoryRequested, isPropertyEntryRequested, isPropertyRequested, setResourceProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkPropertyIds
protected static final String JOB_CLUSTER_NAME_PROPERTY_ID
protected static final String JOB_WORKFLOW_ID_PROPERTY_ID
protected static final String JOB_ID_PROPERTY_ID
protected static final String JOB_NAME_PROPERTY_ID
protected static final String JOB_STATUS_PROPERTY_ID
protected static final String JOB_USER_NAME_PROPERTY_ID
protected static final String JOB_SUBMIT_TIME_PROPERTY_ID
protected static final String JOB_ELAPSED_TIME_PROPERTY_ID
protected static final String JOB_MAPS_PROPERTY_ID
protected static final String JOB_REDUCES_PROPERTY_ID
protected static final String JOB_INPUT_BYTES_PROPERTY_ID
protected static final String JOB_OUTPUT_BYTES_PROPERTY_ID
protected static final String JOB_CONF_PATH_PROPERTY_ID
protected static final String JOB_WORKFLOW_ENTITY_NAME_PROPERTY_ID
protected JobResourceProvider.JobFetcher jobFetcher
protected static final Map<Resource.Type,String> keyPropertyIds
protected JobResourceProvider()
protected JobResourceProvider(JobResourceProvider.JobFetcher jobFetcher)
jobFetcher
- job fetcherpublic RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException
ResourceProvider
request
- the request object which defines the set of properties
for the resources to be createdSystemException
- an internal system exception occurredUnsupportedPropertyException
- the request contains unsupported property idsResourceAlreadyExistsException
- attempted to create a resource which already existsNoSuchParentResourceException
- a parent resource of the resource to create doesn't existpublic Set<Resource> getResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException
ResourceProvider
resources
based on the given request and predicate
information.
Note that it is not required for this resource provider to completely filter
the set of resources based on the given predicate. It may not be possible
since some of the properties involved may be provided by another
provider
. This partial filtering is allowed because
the predicate will always be applied by the calling cluster controller. The
predicate is made available at this level so that some pre-filtering can be done
as an optimization.
A simple implementation of a resource provider may choose to just return all of
the resources of a given type and allow the calling cluster controller to filter
based on the predicate.request
- the request object which defines the desired set of propertiespredicate
- the predicate object which can be used to filter which
resources are returnedSystemException
- an internal system exception occurredUnsupportedPropertyException
- the request contains unsupported property idsNoSuchResourceException
- the requested resource instance doesn't existNoSuchParentResourceException
- a parent resource of the requested resource doesn't existpublic RequestStatus updateResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException
ResourceProvider
request
- the request object which defines the set of properties
for the resources to be updatedpredicate
- the predicate object which can be used to filter which
resources are updatedSystemException
- an internal system exception occurredUnsupportedPropertyException
- the request contains unsupported property idsNoSuchResourceException
- the resource instance to be updated doesn't existNoSuchParentResourceException
- a parent resource of the resource doesn't existpublic RequestStatus deleteResources(Request request, Predicate predicate) throws SystemException, UnsupportedPropertyException, NoSuchResourceException, NoSuchParentResourceException
ResourceProvider
request
- the request object which defines the set of properties
for the resources to be updatedpredicate
- the predicate object which can be used to filter which
resources are deletedSystemException
- an internal system exception occurredUnsupportedPropertyException
- the request contains unsupported property idsNoSuchResourceException
- the resource instance to be deleted doesn't existNoSuchParentResourceException
- a parent resource of the resource doesn't existprotected Set<String> getPKPropertyIds()
AbstractResourceProvider
getPKPropertyIds
in class AbstractResourceProvider
public Map<Resource.Type,String> getKeyPropertyIds()
ResourceProvider
getKeyPropertyIds
in interface ResourceProvider
getKeyPropertyIds
in class AbstractResourceProvider
protected Map<String,org.apache.ambari.server.controller.internal.JobResourceProvider.JobFields> getDBFieldMap()
AbstractJDBCResourceProvider
getDBFieldMap
in class AbstractJDBCResourceProvider<org.apache.ambari.server.controller.internal.JobResourceProvider.JobFields>
Copyright © 2022 Apache Software Foundation. All rights reserved.