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.JobServiceImplBaseExtension ofJobServiceGrpc.JobServiceImplBaseto 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 voidchangeJobArchiveStatus(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.voidchangeJobStatus(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.voidclaimJob(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.voidconfigure(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.).voidgetJobSpecification(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.voidgetJobStatus(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.voidhandshake(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, ...).voidreserveJobId(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.voidresolveJobSpecification(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.voidresolveJobSpecificationDryRun(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 theAgentJobServiceto 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:
handshakein 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:
configurein 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:
reserveJobIdin 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:
resolveJobSpecificationin 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:
getJobSpecificationin 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:
resolveJobSpecificationDryRunin 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:
claimJobin 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:
changeJobStatusin 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:
getJobStatusin 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:
changeJobArchiveStatusin classcom.netflix.genie.proto.JobServiceGrpc.JobServiceImplBase- Parameters:
request- The request containing the job id to look upresponseObserver- The observer to send a response with
-
-