Class GRpcJobServiceImpl

java.lang.Object
com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
com.netflix.genie.web.agent.apis.rpc.v4.endpoints.GRpcJobServiceImpl
All Implemented Interfaces:
io.grpc.BindableService

public class GRpcJobServiceImpl extends com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
Extension of JobServiceGrpc.JobServiceImplBase to provide functionality for resolving and fetching specifications for jobs to be run by the Genie Agent.
Since:
4.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    GRpcJobServiceImpl(AgentJobService agentJobService, JobServiceProtoConverter jobServiceProtoConverter, JobServiceProtoErrorComposer protoErrorComposer, io.micrometer.core.instrument.MeterRegistry meterRegistry)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    changeJobArchiveStatus(com.netflix.genie.proto.ChangeJobArchiveStatusRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.ChangeJobArchiveStatusResponse> responseObserver)
    When the agent wants to set the archival status of a job post-execution (i.e.
    void
    changeJobStatus(com.netflix.genie.proto.ChangeJobStatusRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.ChangeJobStatusResponse> responseObserver)
    When the agent wants to tell the system that the status of a job is changed this API is called.
    void
    claimJob(com.netflix.genie.proto.ClaimJobRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.ClaimJobResponse> responseObserver)
    When an agent is claiming responsibility and ownership for a job this API is called.
    void
    configure(com.netflix.genie.proto.ConfigureRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.ConfigureResponse> responseObserver)
    This API provides runtime configuration to the agent (example: timeouts, parallelism, etc.).
    void
    getJobSpecification(com.netflix.genie.proto.JobSpecificationRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.JobSpecificationResponse> responseObserver)
    Assuming a specification has already been resolved the agent will call this API with a job id to fetch the specification.
    void
    getJobStatus(com.netflix.genie.proto.GetJobStatusRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.GetJobStatusResponse> responseObserver)
    When the agent wants to confirm it's status is still the expected one (i.e.
    void
    handshake(com.netflix.genie.proto.HandshakeRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.HandshakeResponse> responseObserver)
    This API gives the server a chance to reject a client/agent based on its metadata (version, location, ...).
    void
    reserveJobId(com.netflix.genie.proto.ReserveJobIdRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.ReserveJobIdResponse> responseObserver)
    This API will reserve a job id using the supplied metadata in the request and return the reserved job id.
    void
    resolveJobSpecification(com.netflix.genie.proto.JobSpecificationRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.JobSpecificationResponse> responseObserver)
    This API will take a request to resolve a Job Specification and given the inputs figure out all the details needed to flesh out a job specification for the Agent to run.
    void
    resolveJobSpecificationDryRun(com.netflix.genie.proto.DryRunJobSpecificationRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.JobSpecificationResponse> responseObserver)
    The agent requests that a job specification be resolved without impacting any state in the database.

    Methods inherited from class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase

    bindService

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GRpcJobServiceImpl

      public GRpcJobServiceImpl(AgentJobService agentJobService, JobServiceProtoConverter jobServiceProtoConverter, JobServiceProtoErrorComposer protoErrorComposer, io.micrometer.core.instrument.MeterRegistry meterRegistry)
      Constructor.
      Parameters:
      agentJobService - The implementation of the AgentJobService to use
      jobServiceProtoConverter - DTO/Proto converter
      protoErrorComposer - proto error message composer
      meterRegistry - meter registry
  • Method Details

    • handshake

      public void handshake(com.netflix.genie.proto.HandshakeRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.HandshakeResponse> responseObserver)
      This API gives the server a chance to reject a client/agent based on its metadata (version, location, ...).
      Overrides:
      handshake in class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
      Parameters:
      request - The request containing client metadata
      responseObserver - To send the response
    • configure

      public void configure(com.netflix.genie.proto.ConfigureRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.ConfigureResponse> responseObserver)
      This API provides runtime configuration to the agent (example: timeouts, parallelism, etc.).
      Overrides:
      configure in class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
      Parameters:
      request - The agent request
      responseObserver - To send the response
    • reserveJobId

      public void reserveJobId(com.netflix.genie.proto.ReserveJobIdRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.ReserveJobIdResponse> responseObserver)
      This API will reserve a job id using the supplied metadata in the request and return the reserved job id.
      Overrides:
      reserveJobId in class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
      Parameters:
      request - The request containing all the metadata necessary to reserve a job id in the system
      responseObserver - To send the response
    • resolveJobSpecification

      public void resolveJobSpecification(com.netflix.genie.proto.JobSpecificationRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.JobSpecificationResponse> responseObserver)
      This API will take a request to resolve a Job Specification and given the inputs figure out all the details needed to flesh out a job specification for the Agent to run. The request parameters will be stored in the database.
      Overrides:
      resolveJobSpecification in class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
      Parameters:
      request - The request information
      responseObserver - How to send a response
    • getJobSpecification

      public void getJobSpecification(com.netflix.genie.proto.JobSpecificationRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.JobSpecificationResponse> responseObserver)
      Assuming a specification has already been resolved the agent will call this API with a job id to fetch the specification.
      Overrides:
      getJobSpecification in class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
      Parameters:
      request - The request containing the job id to return the specification for
      responseObserver - How to send a response
    • resolveJobSpecificationDryRun

      public void resolveJobSpecificationDryRun(com.netflix.genie.proto.DryRunJobSpecificationRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.JobSpecificationResponse> responseObserver)
      The agent requests that a job specification be resolved without impacting any state in the database. This operation is completely transient and just reflects what the job specification would look like given the current state of the system and the input parameters.
      Overrides:
      resolveJobSpecificationDryRun in class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
      Parameters:
      request - The request containing all the metadata required to resolve a job specification
      responseObserver - The observer to send a response with
    • claimJob

      public void claimJob(com.netflix.genie.proto.ClaimJobRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.ClaimJobResponse> responseObserver)
      When an agent is claiming responsibility and ownership for a job this API is called.
      Overrides:
      claimJob in class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
      Parameters:
      request - The request containing the job id being claimed and other pertinent metadata
      responseObserver - The observer to send a response with
    • changeJobStatus

      public void changeJobStatus(com.netflix.genie.proto.ChangeJobStatusRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.ChangeJobStatusResponse> responseObserver)
      When the agent wants to tell the system that the status of a job is changed this API is called.
      Overrides:
      changeJobStatus in class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
      Parameters:
      request - The request containing the necessary metadata to change job status for a given job
      responseObserver - The observer to send a response with
    • getJobStatus

      public void getJobStatus(com.netflix.genie.proto.GetJobStatusRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.GetJobStatusResponse> responseObserver)
      When the agent wants to confirm it's status is still the expected one (i.e. that the leader didn't mark the job failed).
      Overrides:
      getJobStatus in class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
      Parameters:
      request - The request containing the job id to look up
      responseObserver - The observer to send a response with
    • changeJobArchiveStatus

      public void changeJobArchiveStatus(com.netflix.genie.proto.ChangeJobArchiveStatusRequest request, io.grpc.stub.StreamObserver<com.netflix.genie.proto.ChangeJobArchiveStatusResponse> responseObserver)
      When the agent wants to set the archival status of a job post-execution (i.e. archived successfully, or failed to archive).
      Overrides:
      changeJobArchiveStatus in class com.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
      Parameters:
      request - The request containing the job id to look up
      responseObserver - The observer to send a response with