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 ofJobServiceGrpc.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
All Methods Instance Methods Concrete Methods 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.
-
-
-
Constructor Detail
-
GRpcJobServiceImpl
public GRpcJobServiceImpl(AgentJobService agentJobService, JobServiceProtoConverter jobServiceProtoConverter, JobServiceProtoErrorComposer protoErrorComposer, io.micrometer.core.instrument.MeterRegistry meterRegistry)
Constructor.- Parameters:
agentJobService
- The implementation of theAgentJobService
to usejobServiceProtoConverter
- DTO/Proto converterprotoErrorComposer
- proto error message composermeterRegistry
- meter registry
-
-
Method Detail
-
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 classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
- Parameters:
request
- The request containing client metadataresponseObserver
- 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 classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
- Parameters:
request
- The agent requestresponseObserver
- 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 classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
- Parameters:
request
- The request containing all the metadata necessary to reserve a job id in the systemresponseObserver
- 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 classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
- Parameters:
request
- The request informationresponseObserver
- 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 classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
- Parameters:
request
- The request containing the job id to return the specification forresponseObserver
- 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 classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
- Parameters:
request
- The request containing all the metadata required to resolve a job specificationresponseObserver
- 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 classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
- Parameters:
request
- The request containing the job id being claimed and other pertinent metadataresponseObserver
- 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 classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
- Parameters:
request
- The request containing the necessary metadata to change job status for a given jobresponseObserver
- 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 classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
- Parameters:
request
- The request containing the job id to look upresponseObserver
- 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 classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase
- Parameters:
request
- The request containing the job id to look upresponseObserver
- The observer to send a response with
-
-