use of com.netflix.titus.runtime.connector.jobmanager.JobConnectorConfiguration in project titus-control-plane by Netflix.
the class CommandContext method getJobManagementClientWithKeepAlive.
public RemoteJobManagementClient getJobManagementClientWithKeepAlive(long keepAliveInternalMs) {
JobManagementServiceGrpc.JobManagementServiceStub stub = getJobManagementGrpcStub();
ReactorJobManagementServiceStub reactorStub = getGrpcToReactorClientFactory().apply(stub, ReactorJobManagementServiceStub.class, JobManagementServiceGrpc.getServiceDescriptor());
JobConnectorConfiguration configuration = Archaius2Ext.newConfiguration(JobConnectorConfiguration.class, "titus.connector.jobService.keepAliveIntervalMs", "" + keepAliveInternalMs);
return new RemoteJobManagementClientWithKeepAlive("cli", configuration, stub, reactorStub, titusRuntime);
}
use of com.netflix.titus.runtime.connector.jobmanager.JobConnectorConfiguration in project titus-control-plane by Netflix.
the class StreamDataReplicatorPerf method main.
public static void main(String[] args) throws InterruptedException {
TitusRuntime titusRuntime = TitusRuntimes.internal();
JobManagementClient client = Mockito.mock(JobManagementClient.class);
JobConnectorConfiguration configuration = Mockito.mock(JobConnectorConfiguration.class);
Mockito.when(client.observeJobs(ArgumentMatchers.any())).thenAnswer(invocation -> Flux.defer(() -> {
JobManagerEvent jobUpdateEvent = JobUpdateEvent.newJob(JOB, JobManagerConstants.GRPC_REPLICATOR_CALL_METADATA);
JobManagerEvent taskUpdateEvent = TaskUpdateEvent.newTask(JOB, TASK, JobManagerConstants.GRPC_REPLICATOR_CALL_METADATA);
return Flux.just(jobUpdateEvent, JobManagerEvent.snapshotMarker()).concatWith(Flux.interval(Duration.ofSeconds(1)).take(1).map(tick -> taskUpdateEvent)).concatWith(Flux.interval(Duration.ofSeconds(1)).take(1).flatMap(tick -> Flux.error(new RuntimeException("Simulated error"))));
}));
JobDataReplicator replicator = new JobDataReplicatorProvider(configuration, client, JobSnapshotFactories.newDefault(titusRuntime), titusRuntime).get();
replicator.events().subscribe(System.out::println);
Thread.sleep(3600_000);
}
Aggregations