Interface JobService


public interface JobService
An interface that provides all methods needed for the Genie job client implementation.
Since:
3.0.0
  • Field Details

  • Method Details

    • submitJob

      @POST("/api/v3/jobs") retrofit2.Call<Void> submitJob(@Body JobRequest request)
      Method to submit a job to Genie.
      Parameters:
      request - The request object containing all the
      Returns:
      A callable object.
    • submitJob

      @POST("/api/v3/jobs") retrofit2.Call<Void> submitJob(@HeaderMap Map<String,String> customHeaders, @Body JobRequest request)
      Method to submit a job to Genie with user defined custom headers.
      Parameters:
      customHeaders - client defined custom headers.
      request - The request object containing all the
      Returns:
      A callable object.
    • submitJobWithAttachments

      @Multipart @POST("/api/v3/jobs") retrofit2.Call<Void> submitJobWithAttachments(@Part("request") JobRequest request, @Part List<okhttp3.MultipartBody.Part> attachments)
      Submit a job with attachments.
      Parameters:
      request - A JobRequest object containing all the details needed to run the job.
      attachments - A list of all the attachment files to be sent to the server.
      Returns:
      A callable object.
    • submitJobWithAttachments

      @Multipart @POST("/api/v3/jobs") retrofit2.Call<Void> submitJobWithAttachments(@HeaderMap Map<String,String> customHeaders, @Part("request") JobRequest request, @Part List<okhttp3.MultipartBody.Part> attachments)
      Submit a job with attachments and custom headers.
      Parameters:
      customHeaders - client defined custom headers.
      request - A JobRequest object containing all the details needed to run the job.
      attachments - A list of all the attachment files to be sent to the server.
      Returns:
      A callable object.
    • getJobs

      @GET("/api/v3/jobs") retrofit2.Call<com.fasterxml.jackson.databind.JsonNode> getJobs(@Query("id") String id, @Query("name") String name, @Query("user") String user, @Query("status") Set<String> statuses, @Query("tag") Set<String> tags, @Query("clusterName") String clusterName, @Query("clusterId") String clusterId, @Query("commandName") String commandName, @Query("commandId") String commandId, @Query("minStarted") Long minStarted, @Query("maxStarted") Long maxStarted, @Query("minFinished") Long minFinished, @Query("maxFinished") Long maxFinished, @Query("grouping") String grouping, @Query("groupingInstance") String groupingInstance, @Query("size") Integer size, @Query("sort") String sort, @Query("page") Integer page)
      Method to get all jobs from Genie.
      Parameters:
      id - id for job
      name - name of job (can be a SQL-style pattern such as HIVE%)
      user - user who submitted job
      statuses - statuses of jobs to find
      tags - tags for the job
      clusterName - the name of the cluster
      clusterId - the id of the cluster
      commandName - the name of the command run by the job
      commandId - the id of the command run by the job
      minStarted - 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 grouping the job should be a member of
      groupingInstance - The grouping instance the job should be a member of
      size - The maximum number of results in the page
      sort - The sort order
      page - The page index
      Returns:
      A callable object.
    • getJob

      @GET("/api/v3/jobs/{id}") retrofit2.Call<Job> getJob(@Path("id") String jobId)
      Method to fetch a single job from Genie.
      Parameters:
      jobId - The id of the job to get.
      Returns:
      A callable object.
    • getJobOutputFile

      @Streaming @GET("/api/v3/jobs/{id}/output/{path}") retrofit2.Call<okhttp3.ResponseBody> getJobOutputFile(@Path("id") String jobId, @Path(value="path",encoded=true) String outputFilePath)
      Method to fetch an output file for a job from Genie.

      NOTE: If the specified outputFilePath is a directory, then the directory manifest is returned.

      Parameters:
      jobId - The id of the job whose output file is desired.
      outputFilePath - The path to the file within output directory.
      Returns:
      A callable object.
    • getJobOutputFile

      @Streaming @GET("/api/v3/jobs/{id}/output/{path}") retrofit2.Call<okhttp3.ResponseBody> getJobOutputFile(@Path("id") String jobId, @Path(value="path",encoded=true) String outputFilePath, @Header("Range") String range)
      Method to fetch partial output file for a job from Genie.

      NOTE: If the specified outputFilePath is a directory, then the directory manifest is returned.

      Parameters:
      jobId - The id of the job whose output file is desired.
      outputFilePath - The path to the file within output directory.
      range - The range header value
      Returns:
      A callable object.
    • getJobStatus

      @GET("/api/v3/jobs/{id}/status") retrofit2.Call<com.fasterxml.jackson.databind.JsonNode> getJobStatus(@Path("id") String jobId)
      Method to get Job status.
      Parameters:
      jobId - The id of the job whose status is desired.
      Returns:
      A callable object.
    • getJobCluster

      @GET("/api/v3/jobs/{id}/cluster") retrofit2.Call<Cluster> getJobCluster(@Path("id") String jobId)
      Method to get the cluster information on which a job is run.
      Parameters:
      jobId - The id of the job.
      Returns:
      A callable object.
    • getJobCommand

      @GET("/api/v3/jobs/{id}/command") retrofit2.Call<Command> getJobCommand(@Path("id") String jobId)
      Method to get the command information on which a job is run.
      Parameters:
      jobId - The id of the job.
      Returns:
      A callable object.
    • getJobRequest

      @GET("/api/v3/jobs/{id}/request") retrofit2.Call<JobRequest> getJobRequest(@Path("id") String jobId)
      Method to get the JobRequest for a job.
      Parameters:
      jobId - The id of the job.
      Returns:
      A callable object.
    • getJobExecution

      @GET("/api/v3/jobs/{id}/execution") retrofit2.Call<JobExecution> getJobExecution(@Path("id") String jobId)
      Method to get the execution information for a job.
      Parameters:
      jobId - The id of the job.
      Returns:
      A callable object.
    • getJobMetadata

      @GET("/api/v3/jobs/{id}/metadata") retrofit2.Call<JobMetadata> getJobMetadata(@Path("id") String jobId)
      Method to get the metadata information for a job.
      Parameters:
      jobId - The id of the job.
      Returns:
      A callable object.
    • getJobApplications

      @GET("/api/v3/jobs/{id}/applications") retrofit2.Call<List<Application>> getJobApplications(@Path("id") String jobId)
      Method to get the Applications for a job.
      Parameters:
      jobId - The id of the job.
      Returns:
      A callable object.
    • killJob

      @DELETE("/api/v3/jobs/{id}") retrofit2.Call<Void> killJob(@Path("id") String jobId)
      Method to send a job kill request to Genie.
      Parameters:
      jobId - The id of the job.
      Returns:
      A callable object.