public class JobServiceProtoConverter
extends java.lang.Object
JobServiceGrpc.JobServiceImplBase
service to
and from V4 DTO POJO's.com.netflix.genie.common.internal.dto.v4
,
com.netflix.genie.proto
Constructor and Description |
---|
JobServiceProtoConverter() |
Modifier and Type | Method and Description |
---|---|
AgentClientMetadata |
toAgentClientMetadataDto(com.netflix.genie.proto.AgentMetadata agentMetadata)
Convert a proto
AgentMetadata to an AgentClientMetadata . |
com.netflix.genie.proto.ChangeJobStatusRequest |
toChangeJobStatusRequestProto(@NotBlank java.lang.String jobId,
JobStatus currentJobStatus,
JobStatus newJobStatus,
java.lang.String message)
Convert parameters into ChangeJobStatusRequest for the server.
|
com.netflix.genie.proto.ClaimJobRequest |
toClaimJobRequestProto(java.lang.String jobId,
AgentClientMetadata agentClientMetadata)
Convert agent metadata and job id into a ClaimJobRequest for the server.
|
com.netflix.genie.proto.DryRunJobSpecificationRequest |
toDryRunJobSpecificationRequestProto(AgentJobRequest jobRequest)
Convert a V4 Job Request DTO into a gRPC dry run resolve job specification request to be sent to the server.
|
com.netflix.genie.proto.HandshakeRequest |
toHandshakeRequestProto(AgentClientMetadata agentClientMetadata)
Convert parameters into HandshakeRequest for the server.
|
JobRequest |
toJobRequestDto(com.netflix.genie.proto.DryRunJobSpecificationRequest request)
Convert a gRPC request to dry run a job specification resolution into a
JobRequest for use within
Genie server codebase. |
JobRequest |
toJobRequestDto(com.netflix.genie.proto.ReserveJobIdRequest request)
Convert a gRPC reserve job id request into a V4 Job Request DTO for use within Genie codebase.
|
JobSpecification |
toJobSpecificationDto(com.netflix.genie.proto.JobSpecification protoSpec)
Convert a response from server into a Job Specification DTO which can be used in the codebase free of gRPC.
|
com.netflix.genie.proto.JobSpecification |
toJobSpecificationProto(JobSpecification jobSpecification)
Convert a Job Specification DTO to a protobuf message representation.
|
com.netflix.genie.proto.JobSpecificationRequest |
toJobSpecificationRequestProto(java.lang.String id)
Generate a
JobSpecificationRequest from the given job id. |
com.netflix.genie.proto.JobSpecificationResponse |
toJobSpecificationResponseProto(JobSpecification jobSpecification)
Build a
JobSpecificationResponse out of the given JobSpecification . |
com.netflix.genie.proto.ReserveJobIdRequest |
toReserveJobIdRequestProto(AgentJobRequest jobRequest,
AgentClientMetadata agentClientMetadata)
Convert a V4 Job Request DTO into a gRPC reserve job id request to be sent to the server.
|
public com.netflix.genie.proto.ReserveJobIdRequest toReserveJobIdRequestProto(AgentJobRequest jobRequest, AgentClientMetadata agentClientMetadata) throws GenieConversionException
jobRequest
- The job request to convertagentClientMetadata
- The metadata about the agentGenieConversionException
- if conversion failspublic com.netflix.genie.proto.JobSpecificationRequest toJobSpecificationRequestProto(java.lang.String id)
JobSpecificationRequest
from the given job id.id
- The job id to generate the request forpublic JobRequest toJobRequestDto(com.netflix.genie.proto.ReserveJobIdRequest request) throws GenieConversionException
request
- The request to convertGenieConversionException
- if conversion failspublic com.netflix.genie.proto.DryRunJobSpecificationRequest toDryRunJobSpecificationRequestProto(AgentJobRequest jobRequest) throws GenieConversionException
jobRequest
- The job request to convertGenieConversionException
- if conversion failspublic JobRequest toJobRequestDto(com.netflix.genie.proto.DryRunJobSpecificationRequest request) throws GenieConversionException
JobRequest
for use within
Genie server codebase.request
- The request to convertGenieConversionException
- if conversion failspublic AgentClientMetadata toAgentClientMetadataDto(com.netflix.genie.proto.AgentMetadata agentMetadata)
AgentMetadata
to an AgentClientMetadata
.agentMetadata
- The metadata to convertpublic com.netflix.genie.proto.JobSpecificationResponse toJobSpecificationResponseProto(JobSpecification jobSpecification)
JobSpecificationResponse
out of the given JobSpecification
.jobSpecification
- The job specification to serializepublic JobSpecification toJobSpecificationDto(com.netflix.genie.proto.JobSpecification protoSpec)
protoSpec
- The protobuf specification messagepublic com.netflix.genie.proto.JobSpecification toJobSpecificationProto(JobSpecification jobSpecification)
jobSpecification
- The JobSpecification
to convertJobSpecification
instancepublic com.netflix.genie.proto.ClaimJobRequest toClaimJobRequestProto(java.lang.String jobId, AgentClientMetadata agentClientMetadata)
jobId
- job idagentClientMetadata
- agent metadatapublic com.netflix.genie.proto.ChangeJobStatusRequest toChangeJobStatusRequestProto(@NotBlank @NotBlank java.lang.String jobId, JobStatus currentJobStatus, JobStatus newJobStatus, @Nullable java.lang.String message)
jobId
- job idcurrentJobStatus
- the expected current status on the servernewJobStatus
- the new current status for this jobmessage
- an optional message to record with the state changepublic com.netflix.genie.proto.HandshakeRequest toHandshakeRequestProto(AgentClientMetadata agentClientMetadata) throws GenieConversionException
agentClientMetadata
- agent client metadataHandshakeRequest
GenieConversionException
- if the inputs are invalid