Search in sources :

Example 1 with ServiceJobProcesses

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();
        });
    });
}
Also used : ServiceJobProcesses(com.netflix.titus.api.jobmanager.model.job.ServiceJobProcesses)

Example 2 with ServiceJobProcesses

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());
}
Also used : ServiceJobProcesses(com.netflix.titus.api.jobmanager.model.job.ServiceJobProcesses) Capacity(com.netflix.titus.api.jobmanager.model.job.Capacity)

Aggregations

ServiceJobProcesses (com.netflix.titus.api.jobmanager.model.job.ServiceJobProcesses)2 Capacity (com.netflix.titus.api.jobmanager.model.job.Capacity)1