use of com.netflix.titus.api.jobmanager.model.job.ServiceJobProcesses in project titus-control-plane by Netflix.
the class DefaultJobManagementServiceGrpc method updateJobProcesses.
@Override
public void updateJobProcesses(JobProcessesUpdate request, StreamObserver<Empty> responseObserver) {
execute(callMetadataResolver, responseObserver, callMetadata -> {
ServiceJobProcesses serviceJobProcesses = GrpcJobManagementModelConverters.toCoreServiceJobProcesses(request.getServiceJobProcesses());
authorizeJobUpdate(callMetadata, request.getJobId()).concatWith(jobOperations.updateServiceJobProcessesReactor(request.getJobId(), serviceJobProcesses, callMetadata)).subscribe(nothing -> {
}, e -> safeOnError(logger, e, responseObserver), () -> {
responseObserver.onNext(Empty.getDefaultInstance());
responseObserver.onCompleted();
});
});
}
use of com.netflix.titus.api.jobmanager.model.job.ServiceJobProcesses in project titus-control-plane by Netflix.
the class BasicServiceJobActions method isDesiredCapacityInvalid.
private static boolean isDesiredCapacityInvalid(Capacity targetCapacity, Job<ServiceJobExt> serviceJob) {
ServiceJobProcesses serviceJobProcesses = serviceJob.getJobDescriptor().getExtensions().getServiceJobProcesses();
Capacity currentCapacity = serviceJob.getJobDescriptor().getExtensions().getCapacity();
return (serviceJobProcesses.isDisableIncreaseDesired() && targetCapacity.getDesired() > currentCapacity.getDesired()) || (serviceJobProcesses.isDisableDecreaseDesired() && targetCapacity.getDesired() < currentCapacity.getDesired());
}
Aggregations