@Transactional(readOnly=true) @Validated public class JpaJobSearchServiceImpl extends java.lang.Object implements JobSearchService
| Constructor and Description |
|---|
JpaJobSearchServiceImpl(JpaJobRepository jobRepository,
JpaClusterRepository clusterRepository,
JpaCommandRepository commandRepository)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.data.domain.Page<JobSearchResult> |
findJobs(java.lang.String id,
java.lang.String jobName,
java.lang.String user,
java.util.Set<JobStatus> statuses,
java.util.Set<java.lang.String> tags,
java.lang.String clusterName,
java.lang.String clusterId,
java.lang.String commandName,
java.lang.String commandId,
java.util.Date minStarted,
java.util.Date maxStarted,
java.util.Date minFinished,
java.util.Date maxFinished,
java.lang.String grouping,
java.lang.String groupingInstance,
org.springframework.data.domain.Pageable page)
Search for jobs which match the given filter criteria.
|
long |
getActiveJobCountForUser(java.lang.String user)
Get the count of 'active' jobs for a given user across all instances.
|
java.util.Set<Job> |
getAllActiveJobsOnHost(java.lang.String hostName)
Given a hostname return a set of all the jobs currently active on that host.
|
java.util.List<java.lang.String> |
getAllHostsWithActiveJobs()
Get a set of host names which are currently have active jobs in the Genie cluster.
|
Job |
getJob(java.lang.String id)
Get job information for given job id.
|
java.util.List<Application> |
getJobApplications(java.lang.String id)
Get the applications the job was run with or exception if not found.
|
Cluster |
getJobCluster(java.lang.String id)
Get the cluster the job was run on or exception if not found.
|
Command |
getJobCommand(java.lang.String id)
Get the command the job was run with or exception if not found.
|
JobExecution |
getJobExecution(java.lang.String id)
Get job execution for given job id.
|
java.lang.String |
getJobHost(java.lang.String jobId)
Get the hostname a job is running on.
|
JobRequest |
getJobRequest(java.lang.String id)
Get job request for given job id.
|
JobStatus |
getJobStatus(java.lang.String id)
Get the status of the job with the given id.
|
public JpaJobSearchServiceImpl(JpaJobRepository jobRepository, JpaClusterRepository clusterRepository, JpaCommandRepository commandRepository)
jobRepository - The repository to use for job entitiesclusterRepository - The repository to use for cluster entitiescommandRepository - The repository to use for command entitiespublic org.springframework.data.domain.Page<JobSearchResult> findJobs(@Nullable java.lang.String id, @Nullable java.lang.String jobName, @Nullable java.lang.String user, @Nullable java.util.Set<JobStatus> statuses, @Nullable java.util.Set<java.lang.String> tags, @Nullable java.lang.String clusterName, @Nullable java.lang.String clusterId, @Nullable java.lang.String commandName, @Nullable java.lang.String commandId, @Nullable java.util.Date minStarted, @Nullable java.util.Date maxStarted, @Nullable java.util.Date minFinished, @Nullable java.util.Date maxFinished, @Nullable java.lang.String grouping, @Nullable java.lang.String groupingInstance, @NotNull org.springframework.data.domain.Pageable page)
findJobs in interface JobSearchServiceid - id for jobjobName - name of job (can be a SQL-style pattern such as HIVE%)user - user who submitted jobstatuses - statuses of jobtags - tags for the jobclusterName - name of cluster for jobclusterId - id of cluster for jobcommandName - name of the command run in the jobcommandId - id of the command run in the jobminStarted - The time which the job had to start after in order to be return (inclusive)maxStarted - The time which the job had to start before in order to be returned (exclusive)minFinished - The time which the job had to finish after in order to be return (inclusive)maxFinished - The time which the job had to finish before in order to be returned (exclusive)grouping - The job grouping to search forgroupingInstance - The job grouping instance to search forpage - Page information of job to getpublic java.util.Set<Job> getAllActiveJobsOnHost(@NotBlank java.lang.String hostName)
getAllActiveJobsOnHost in interface JobSearchServicehostName - The host name to search for. Not null or empty.public java.util.List<java.lang.String> getAllHostsWithActiveJobs()
getAllHostsWithActiveJobs in interface JobSearchServicepublic Job getJob(@NotBlank(message="No id entered. Unable to get job.") java.lang.String id) throws GenieNotFoundException
getJob in interface JobSearchServiceid - id of job to look upGenieNotFoundExceptionpublic JobStatus getJobStatus(@NotBlank java.lang.String id) throws GenieException
getJobStatus in interface JobSearchServiceid - The id of the job to get status forGenieException - When any error, including not found, is encounteredpublic JobRequest getJobRequest(@NotBlank java.lang.String id) throws GenieException
getJobRequest in interface JobSearchServiceid - id of job request to look upGenieException - if there is an errorpublic JobExecution getJobExecution(@NotBlank java.lang.String id) throws GenieException
getJobExecution in interface JobSearchServiceid - id of job execution to look upGenieException - if there is an errorpublic Cluster getJobCluster(@NotBlank java.lang.String id) throws GenieException
getJobCluster in interface JobSearchServiceid - The id of the job to get the cluster forGenieException - If either the job or the cluster is not foundpublic Command getJobCommand(@NotBlank java.lang.String id) throws GenieException
getJobCommand in interface JobSearchServiceid - The id of the job to get the command forGenieException - If either the job or the command is not foundpublic java.util.List<Application> getJobApplications(@NotBlank java.lang.String id) throws GenieException
getJobApplications in interface JobSearchServiceid - The id of the job to get the applications forGenieException - If either the job or the applications were not foundpublic java.lang.String getJobHost(@NotBlank
java.lang.String jobId)
throws GenieException
getJobHost in interface JobSearchServicejobId - The id of the job to get the hostname forGenieException - If the job isn't found or any other errorpublic long getActiveJobCountForUser(@NotBlank
java.lang.String user)
throws GenieException
getActiveJobCountForUser in interface JobSearchServiceuser - The user nameGenieException - If any error occurs