Search in sources :

Example 1 with TitusRuntime

use of com.netflix.titus.common.runtime.TitusRuntime in project titus-control-plane by Netflix.

the class GrpcJobReplicatorEventStream method newConnection.

@Override
protected Flux<ReplicatorEvent<JobSnapshot, JobManagerEvent<?>>> newConnection() {
    return Flux.<ReplicatorEvent<JobSnapshot, JobManagerEvent<?>>>create(sink -> {
        CacheUpdater cacheUpdater = new CacheUpdater(jobSnapshotFactory, keepAliveEnabled, titusRuntime);
        logger.info("Connecting to the job event stream (filteringCriteria={})...", filteringCriteria);
        ConnectableFlux<JobManagerEvent<?>> connectableStream = client.observeJobs(filteringCriteria).publish();
        Flux<JobManagerEvent<?>> augmentedStream;
        if (configuration.isConnectionTimeoutEnabled()) {
            augmentedStream = Flux.merge(connectableStream.take(1).timeout(Duration.ofMillis(configuration.getConnectionTimeoutMs())).ignoreElements().onErrorMap(TimeoutException.class, error -> new TimeoutException(String.format("No event received from stream in %sms", configuration.getConnectionTimeoutMs()))), connectableStream);
        } else {
            augmentedStream = connectableStream;
        }
        Disposable disposable = augmentedStream.subscribe(jobEvent -> {
            long started = titusRuntime.getClock().wallTime();
            try {
                cacheUpdater.onEvent(jobEvent).ifPresent(sink::next);
                eventProcessingLatencies.recordLevel(titusRuntime.getClock().wallTime() - started);
            } catch (Exception e) {
                // Throw error to force the cache reconnect.
                logger.warn("Unexpected error when handling the job change notification: {}", jobEvent, e);
                ExceptionExt.silent(() -> sink.error(e));
            }
        }, e -> ExceptionExt.silent(() -> sink.error(e)), () -> ExceptionExt.silent(sink::complete));
        sink.onDispose(disposable);
        connectableStream.connect();
    }).doOnSubscribe(subscription -> subscriptionCounter.incrementAndGet()).doFinally(signal -> subscriptionCounter.decrementAndGet());
}
Also used : Disposable(reactor.core.Disposable) JobManagerConstants(com.netflix.titus.api.jobmanager.service.JobManagerConstants) Disposable(reactor.core.Disposable) Task(com.netflix.titus.api.jobmanager.model.job.Task) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) HashMap(java.util.HashMap) AbstractReplicatorEventStream(com.netflix.titus.runtime.connector.common.replicator.AbstractReplicatorEventStream) Scheduler(reactor.core.scheduler.Scheduler) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) ReplicatorEvent(com.netflix.titus.runtime.connector.common.replicator.ReplicatorEvent) SpectatorExt(com.netflix.titus.common.util.spectator.SpectatorExt) JobSnapshot(com.netflix.titus.runtime.connector.jobmanager.snapshot.JobSnapshot) ConnectableFlux(reactor.core.publisher.ConnectableFlux) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Duration(java.time.Duration) Map(java.util.Map) JobState(com.netflix.titus.api.jobmanager.model.job.JobState) ExceptionExt(com.netflix.titus.common.util.ExceptionExt) RemoteJobManagementClientWithKeepAlive(com.netflix.titus.runtime.connector.jobmanager.RemoteJobManagementClientWithKeepAlive) Job(com.netflix.titus.api.jobmanager.model.job.Job) Logger(org.slf4j.Logger) JobUpdateEvent(com.netflix.titus.api.jobmanager.model.job.event.JobUpdateEvent) JobSnapshotFactory(com.netflix.titus.runtime.connector.jobmanager.snapshot.JobSnapshotFactory) Set(java.util.Set) JobManagerEvent(com.netflix.titus.api.jobmanager.model.job.event.JobManagerEvent) TaskState(com.netflix.titus.api.jobmanager.model.job.TaskState) JobKeepAliveEvent(com.netflix.titus.api.jobmanager.model.job.event.JobKeepAliveEvent) AtomicLong(java.util.concurrent.atomic.AtomicLong) Flux(reactor.core.publisher.Flux) List(java.util.List) ValueRangeCounter(com.netflix.titus.common.util.spectator.ValueRangeCounter) TaskUpdateEvent(com.netflix.titus.api.jobmanager.model.job.event.TaskUpdateEvent) JobConnectorConfiguration(com.netflix.titus.runtime.connector.jobmanager.JobConnectorConfiguration) DataReplicatorMetrics(com.netflix.titus.runtime.connector.common.replicator.DataReplicatorMetrics) Optional(java.util.Optional) JobManagementClient(com.netflix.titus.runtime.connector.jobmanager.JobManagementClient) VisibleForTesting(com.google.common.annotations.VisibleForTesting) PolledMeter(com.netflix.spectator.api.patterns.PolledMeter) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) Collections(java.util.Collections) JobManagerEvent(com.netflix.titus.api.jobmanager.model.job.event.JobManagerEvent) ReplicatorEvent(com.netflix.titus.runtime.connector.common.replicator.ReplicatorEvent) TimeoutException(java.util.concurrent.TimeoutException) TimeoutException(java.util.concurrent.TimeoutException)

Example 2 with TitusRuntime

use of com.netflix.titus.common.runtime.TitusRuntime in project titus-control-plane by Netflix.

the class TaskEventsGeneratorTest method checkPublisherState.

@Test
public void checkPublisherState() {
    int numTasks = 5;
    final TaskEventsGenerator taskEventsGenerator = new TaskEventsGenerator(mockTitusClient(numTasks), Collections.emptyMap(), titusRuntime);
    try {
        EsPublisher esPublisher = new EsPublisher(taskEventsGenerator, mockElasticSearchClient(), mockEsPublisherConfiguration(), new DefaultRegistry());
        esPublisher.activate();
        final CountDownLatch latch = new CountDownLatch(1);
        Flux.interval(Duration.ofSeconds(1), Schedulers.elastic()).take(1).doOnNext(i -> {
            final int numTasksUpdated = esPublisher.getNumTasksPublished();
            final int numErrors = esPublisher.getNumErrorsInPublishing();
            assertThat(numErrors).isEqualTo(0);
            assertThat(numTasksUpdated).isGreaterThanOrEqualTo(numTasks);
            latch.countDown();
        }).subscribe();
        try {
            latch.await(2, TimeUnit.MINUTES);
        } catch (InterruptedException e) {
            fail("Timeout in checkPublisherState ", e);
        }
    } finally {
        taskEventsGenerator.shutdown();
    }
}
Also used : EsPublisher(com.netflix.titus.supplementary.taskspublisher.es.EsPublisher) BulkEsIndexResp(com.netflix.titus.ext.elasticsearch.model.BulkEsIndexResp) Java6Assertions.assertThat(org.assertj.core.api.Java6Assertions.assertThat) Fail.fail(org.assertj.core.api.Fail.fail) Answer(org.mockito.stubbing.Answer) EmptyLogStorageInfo(com.netflix.titus.runtime.endpoint.common.EmptyLogStorageInfo) EsPublisherConfiguration(com.netflix.titus.supplementary.taskspublisher.config.EsPublisherConfiguration) TitusRuntimes(com.netflix.titus.common.runtime.TitusRuntimes) JobOrTaskUpdate(com.netflix.titus.supplementary.taskspublisher.TitusClient.JobOrTaskUpdate) Duration(java.time.Duration) BulkEsIndexRespItem(com.netflix.titus.ext.elasticsearch.model.BulkEsIndexRespItem) EsIndexResp(com.netflix.titus.ext.elasticsearch.model.EsIndexResp) Schedulers(reactor.core.scheduler.Schedulers) EsClient(com.netflix.titus.ext.elasticsearch.EsClient) JobGenerator(com.netflix.titus.testkit.model.job.JobGenerator) Test(org.junit.Test) Mono(reactor.core.publisher.Mono) GrpcJobManagementModelConverters(com.netflix.titus.runtime.endpoint.v3.grpc.GrpcJobManagementModelConverters) Mockito.when(org.mockito.Mockito.when) ArgumentMatchers.anyList(org.mockito.ArgumentMatchers.anyList) Collectors(java.util.stream.Collectors) TimeUnit(java.util.concurrent.TimeUnit) CountDownLatch(java.util.concurrent.CountDownLatch) Flux(reactor.core.publisher.Flux) List(java.util.List) DefaultRegistry(com.netflix.spectator.api.DefaultRegistry) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) Collections(java.util.Collections) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Mockito.mock(org.mockito.Mockito.mock) EsPublisher(com.netflix.titus.supplementary.taskspublisher.es.EsPublisher) DefaultRegistry(com.netflix.spectator.api.DefaultRegistry) CountDownLatch(java.util.concurrent.CountDownLatch) Test(org.junit.Test)

Example 3 with TitusRuntime

use of com.netflix.titus.common.runtime.TitusRuntime in project titus-control-plane by Netflix.

the class KubeNotificationProcessor method handlePodUpdatedEvent.

private Mono<Void> handlePodUpdatedEvent(PodEvent event, Job job, Task task) {
    // This is basic sanity check. If it fails, we have a major problem with pod state.
    if (event.getPod() == null || event.getPod().getStatus() == null || event.getPod().getStatus().getPhase() == null) {
        logger.warn("Pod notification with pod without status or phase set: taskId={}, pod={}", task.getId(), event.getPod());
        metricsNoChangesApplied.increment();
        return Mono.empty();
    }
    PodWrapper podWrapper = new PodWrapper(event.getPod());
    Optional<V1Node> node;
    if (event instanceof PodUpdatedEvent) {
        node = ((PodUpdatedEvent) event).getNode();
    } else if (event instanceof PodDeletedEvent) {
        node = ((PodDeletedEvent) event).getNode();
    } else {
        node = Optional.empty();
    }
    Either<TaskStatus, String> newTaskStatusOrError = new PodToTaskMapper(podWrapper, node, task, event instanceof PodDeletedEvent, containerResultCodeResolver, titusRuntime).getNewTaskStatus();
    if (newTaskStatusOrError.hasError()) {
        logger.info(newTaskStatusOrError.getError());
        metricsNoChangesApplied.increment();
        return Mono.empty();
    }
    TaskStatus newTaskStatus = newTaskStatusOrError.getValue();
    if (TaskStatus.areEquivalent(task.getStatus(), newTaskStatus)) {
        logger.info("Pod change notification does not change task status: taskId={}, status={}, eventSequenceNumber={}", task.getId(), newTaskStatus, event.getSequenceNumber());
    } else {
        logger.info("Pod notification changes task status: taskId={}, fromStatus={}, toStatus={}, eventSequenceNumber={}", task.getId(), task.getStatus(), newTaskStatus, event.getSequenceNumber());
    }
    // against most up to date task version.
    if (!updateTaskStatus(podWrapper, newTaskStatus, node, task, true).isPresent()) {
        return Mono.empty();
    }
    return ReactorExt.toMono(v3JobOperations.updateTask(task.getId(), current -> updateTaskStatus(podWrapper, newTaskStatus, node, current, false), V3JobOperations.Trigger.Kube, "Pod status updated from kubernetes node (k8phase='" + event.getPod().getStatus().getPhase() + "', taskState=" + task.getStatus().getState() + ")", KUBE_CALL_METADATA));
}
Also used : Retry(reactor.util.retry.Retry) Task(com.netflix.titus.api.jobmanager.model.job.Task) CollectionsExt(com.netflix.titus.common.util.CollectionsExt) LoggerFactory(org.slf4j.LoggerFactory) V1PodStatus(io.kubernetes.client.openapi.models.V1PodStatus) ReactorExt(com.netflix.titus.common.util.rx.ReactorExt) KubeUtil(com.netflix.titus.master.kubernetes.KubeUtil) TITUS_NODE_DOMAIN(com.netflix.titus.runtime.kubernetes.KubeConstants.TITUS_NODE_DOMAIN) Duration(java.time.Duration) Map(java.util.Map) DirectKubeApiServerIntegrator(com.netflix.titus.master.kubernetes.client.DirectKubeApiServerIntegrator) Either(com.netflix.titus.common.util.tuple.Either) CallMetadata(com.netflix.titus.api.model.callmetadata.CallMetadata) PodEvent(com.netflix.titus.master.kubernetes.client.model.PodEvent) Job(com.netflix.titus.api.jobmanager.model.job.Job) TaskStatus(com.netflix.titus.api.jobmanager.model.job.TaskStatus) JobFunctions(com.netflix.titus.api.jobmanager.model.job.JobFunctions) TaskState(com.netflix.titus.api.jobmanager.model.job.TaskState) PodNotFoundEvent(com.netflix.titus.master.kubernetes.client.model.PodNotFoundEvent) Timer(com.netflix.spectator.api.Timer) List(java.util.List) Optional(java.util.Optional) PodWrapper(com.netflix.titus.master.kubernetes.client.model.PodWrapper) Gauge(com.netflix.spectator.api.Gauge) Disposable(reactor.core.Disposable) Stopwatch(com.google.common.base.Stopwatch) PodDeletedEvent(com.netflix.titus.master.kubernetes.client.model.PodDeletedEvent) Counter(com.netflix.spectator.api.Counter) HashMap(java.util.HashMap) MetricConstants(com.netflix.titus.master.MetricConstants) V1Node(io.kubernetes.client.openapi.models.V1Node) Singleton(javax.inject.Singleton) Scheduler(reactor.core.scheduler.Scheduler) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) Pair(com.netflix.titus.common.util.tuple.Pair) ContainerResultCodeResolver(com.netflix.titus.master.kubernetes.ContainerResultCodeResolver) Schedulers(reactor.core.scheduler.Schedulers) Evaluators.acceptNotNull(com.netflix.titus.common.util.Evaluators.acceptNotNull) KubeJobManagementReconciler(com.netflix.titus.master.kubernetes.controller.KubeJobManagementReconciler) ExecutorService(java.util.concurrent.ExecutorService) ExecutorsExt(com.netflix.titus.common.util.ExecutorsExt) Logger(org.slf4j.Logger) PodUpdatedEvent(com.netflix.titus.master.kubernetes.client.model.PodUpdatedEvent) Mono(reactor.core.publisher.Mono) Activator(com.netflix.titus.common.util.guice.annotation.Activator) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) ExecutableStatus(com.netflix.titus.api.jobmanager.model.job.ExecutableStatus) V3JobOperations(com.netflix.titus.api.jobmanager.service.V3JobOperations) TaskAttributes(com.netflix.titus.api.jobmanager.TaskAttributes) PodToTaskMapper(com.netflix.titus.master.kubernetes.PodToTaskMapper) V1ContainerState(io.kubernetes.client.openapi.models.V1ContainerState) VisibleForTesting(com.google.common.annotations.VisibleForTesting) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) Comparator(java.util.Comparator) Evaluators(com.netflix.titus.common.util.Evaluators) PodToTaskMapper(com.netflix.titus.master.kubernetes.PodToTaskMapper) PodDeletedEvent(com.netflix.titus.master.kubernetes.client.model.PodDeletedEvent) V1Node(io.kubernetes.client.openapi.models.V1Node) PodWrapper(com.netflix.titus.master.kubernetes.client.model.PodWrapper) PodUpdatedEvent(com.netflix.titus.master.kubernetes.client.model.PodUpdatedEvent) TaskStatus(com.netflix.titus.api.jobmanager.model.job.TaskStatus)

Example 4 with TitusRuntime

use of com.netflix.titus.common.runtime.TitusRuntime in project titus-control-plane by Netflix.

the class ObserveJobsSubscription method tryInitialize.

private boolean tryInitialize() {
    ObserveJobsQuery query = getLastObserveJobsQueryEvent();
    if (query == null) {
        return false;
    }
    Stopwatch start = Stopwatch.createStarted();
    String trxId = UUID.randomUUID().toString();
    CallMetadata callMetadata = context.getCallMetadataResolver().resolve().orElse(CallMetadataConstants.UNDEFINED_CALL_METADATA);
    metrics.observeJobsStarted(trxId, callMetadata);
    JobQueryCriteria<TaskStatus.TaskState, JobDescriptor.JobSpecCase> criteria = toJobQueryCriteria(query);
    V3JobQueryCriteriaEvaluator jobsPredicate = new V3JobQueryCriteriaEvaluator(criteria, titusRuntime);
    V3TaskQueryCriteriaEvaluator tasksPredicate = new V3TaskQueryCriteriaEvaluator(criteria, titusRuntime);
    Observable<JobChangeNotification> eventStream = context.getJobOperations().observeJobs(jobsPredicate, tasksPredicate, true).filter(event -> withArchived || !event.isArchived()).observeOn(context.getObserveJobsScheduler()).subscribeOn(context.getObserveJobsScheduler(), false).map(event -> GrpcJobManagementModelConverters.toGrpcJobChangeNotification(event, context.getGrpcObjectsCache(), titusRuntime.getClock().wallTime())).compose(ObservableExt.head(() -> {
        List<JobChangeNotification> snapshot = createJobsSnapshot(jobsPredicate, tasksPredicate);
        snapshot.add(SNAPSHOT_END_MARKER);
        return snapshot;
    })).doOnError(e -> logger.error("Unexpected error in jobs event stream", e));
    AtomicBoolean closingProcessed = new AtomicBoolean();
    this.jobServiceSubscription = eventStream.doOnUnsubscribe(() -> {
        if (!closingProcessed.getAndSet(true)) {
            metrics.observeJobsUnsubscribed(trxId, start.elapsed(TimeUnit.MILLISECONDS));
        }
    }).subscribe(event -> {
        metrics.observeJobsEventEmitted(trxId);
        jobServiceEvents.add(event);
        drain();
    }, e -> {
        if (!closingProcessed.getAndSet(true)) {
            metrics.observeJobsError(trxId, start.elapsed(TimeUnit.MILLISECONDS), e);
        }
        jobServiceCompleted = true;
        jobServiceError = new StatusRuntimeException(Status.INTERNAL.withDescription("All jobs monitoring stream terminated with an error").withCause(e));
        drain();
    }, () -> {
        if (!closingProcessed.getAndSet(true)) {
            metrics.observeJobsCompleted(trxId, start.elapsed(TimeUnit.MILLISECONDS));
        }
        jobServiceCompleted = true;
        drain();
    });
    this.grpcStreamInitiated = true;
    return true;
}
Also used : KeepAliveResponse(com.netflix.titus.grpc.protogen.KeepAliveResponse) Stopwatch(com.google.common.base.Stopwatch) ObserveJobsQuery(com.netflix.titus.grpc.protogen.ObserveJobsQuery) Task(com.netflix.titus.api.jobmanager.model.job.Task) CallMetadataConstants(com.netflix.titus.api.model.callmetadata.CallMetadataConstants) LoggerFactory(org.slf4j.LoggerFactory) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) ArrayList(java.util.ArrayList) Observable(rx.Observable) StreamObserver(io.grpc.stub.StreamObserver) Pair(com.netflix.titus.common.util.tuple.Pair) TaskStatus(com.netflix.titus.grpc.protogen.TaskStatus) ExceptionExt(com.netflix.titus.common.util.ExceptionExt) Status(io.grpc.Status) CallMetadata(com.netflix.titus.api.model.callmetadata.CallMetadata) ServerCallStreamObserver(io.grpc.stub.ServerCallStreamObserver) JobDescriptor(com.netflix.titus.grpc.protogen.JobDescriptor) V3TaskQueryCriteriaEvaluator(com.netflix.titus.runtime.endpoint.v3.grpc.query.V3TaskQueryCriteriaEvaluator) Job(com.netflix.titus.api.jobmanager.model.job.Job) KeepAliveRequest(com.netflix.titus.grpc.protogen.KeepAliveRequest) Logger(org.slf4j.Logger) Predicate(java.util.function.Predicate) SNAPSHOT_END_MARKER(com.netflix.titus.master.jobmanager.endpoint.v3.grpc.ObserveJobsContext.SNAPSHOT_END_MARKER) BlockingQueue(java.util.concurrent.BlockingQueue) UUID(java.util.UUID) GrpcJobManagementModelConverters(com.netflix.titus.runtime.endpoint.v3.grpc.GrpcJobManagementModelConverters) TimeUnit(java.util.concurrent.TimeUnit) StatusRuntimeException(io.grpc.StatusRuntimeException) AtomicLong(java.util.concurrent.atomic.AtomicLong) List(java.util.List) JobQueryCriteria(com.netflix.titus.runtime.endpoint.JobQueryCriteria) LinkedBlockingDeque(java.util.concurrent.LinkedBlockingDeque) V3JobQueryCriteriaEvaluator(com.netflix.titus.runtime.endpoint.v3.grpc.query.V3JobQueryCriteriaEvaluator) GrpcJobQueryModelConverters.toJobQueryCriteria(com.netflix.titus.runtime.endpoint.v3.grpc.GrpcJobQueryModelConverters.toJobQueryCriteria) ObserveJobsWithKeepAliveRequest(com.netflix.titus.grpc.protogen.ObserveJobsWithKeepAliveRequest) VisibleForTesting(com.google.common.annotations.VisibleForTesting) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) ObservableExt(com.netflix.titus.common.util.rx.ObservableExt) Subscription(rx.Subscription) JobChangeNotification(com.netflix.titus.grpc.protogen.JobChangeNotification) V3TaskQueryCriteriaEvaluator(com.netflix.titus.runtime.endpoint.v3.grpc.query.V3TaskQueryCriteriaEvaluator) CallMetadata(com.netflix.titus.api.model.callmetadata.CallMetadata) Stopwatch(com.google.common.base.Stopwatch) V3JobQueryCriteriaEvaluator(com.netflix.titus.runtime.endpoint.v3.grpc.query.V3JobQueryCriteriaEvaluator) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) JobChangeNotification(com.netflix.titus.grpc.protogen.JobChangeNotification) StatusRuntimeException(io.grpc.StatusRuntimeException) ObserveJobsQuery(com.netflix.titus.grpc.protogen.ObserveJobsQuery)

Example 5 with TitusRuntime

use of com.netflix.titus.common.runtime.TitusRuntime in project titus-control-plane by Netflix.

the class SupervisorServiceModule method getLocalMasterInstanceResolver.

/**
 * As MasterInstance data contain a lot of details that are deployment specific, this binding is provided here
 * for completeness/as an example only. It should be overridden by deployment specific configuration.
 */
@Provides
@Singleton
public LocalMasterInstanceResolver getLocalMasterInstanceResolver(SupervisorConfiguration configuration, GrpcMasterEndpointConfiguration grpcServerConfiguration, LocalMasterReadinessResolver localMasterReadinessResolver, TitusRuntime titusRuntime) {
    String ipAddress = NetworkExt.getLocalIPs().flatMap(ips -> ips.stream().filter(NetworkExt::isIpV4).findFirst()).orElse("127.0.0.1");
    ServerPort grpcPort = ServerPort.newBuilder().withPortNumber(grpcServerConfiguration.getPort()).withSecure(false).withProtocol("grpc").withDescription("TitusMaster GRPC endpoint").build();
    MasterInstance initial = MasterInstance.newBuilder().withInstanceId(configuration.getTitusMasterInstanceId()).withInstanceGroupId(configuration.getTitusMasterInstanceId() + "Group").withIpAddress(ipAddress).withStatusHistory(Collections.emptyList()).withStatus(MasterStatus.newBuilder().withState(MasterState.Starting).withMessage("Bootstrapping").withTimestamp(titusRuntime.getClock().wallTime()).build()).withServerPorts(Collections.singletonList(grpcPort)).build();
    return new DefaultLocalMasterInstanceResolver(localMasterReadinessResolver, initial);
}
Also used : SupervisorConfiguration(com.netflix.titus.master.supervisor.SupervisorConfiguration) LeaderActivator(com.netflix.titus.api.supervisor.service.LeaderActivator) AlwaysEnabledLocalMasterReadinessResolver(com.netflix.titus.api.supervisor.service.resolver.AlwaysEnabledLocalMasterReadinessResolver) LocalMasterMonitor(com.netflix.titus.master.supervisor.service.leader.LocalMasterMonitor) LocalMasterReadinessResolver(com.netflix.titus.api.supervisor.service.LocalMasterReadinessResolver) Singleton(javax.inject.Singleton) LocalMasterInstanceResolver(com.netflix.titus.api.supervisor.service.LocalMasterInstanceResolver) ConfigProxyFactory(com.netflix.archaius.ConfigProxyFactory) MasterState(com.netflix.titus.api.supervisor.model.MasterState) MasterStatus(com.netflix.titus.api.supervisor.model.MasterStatus) GuiceLeaderActivator(com.netflix.titus.master.supervisor.service.leader.GuiceLeaderActivator) ServerPort(com.netflix.titus.api.supervisor.model.ServerPort) SupervisorOperations(com.netflix.titus.api.supervisor.service.SupervisorOperations) DefaultLocalMasterInstanceResolver(com.netflix.titus.master.supervisor.service.resolver.DefaultLocalMasterInstanceResolver) MasterMonitor(com.netflix.titus.api.supervisor.service.MasterMonitor) ImmediateLeaderElector(com.netflix.titus.master.supervisor.service.leader.ImmediateLeaderElector) Provides(com.google.inject.Provides) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) NetworkExt(com.netflix.titus.common.util.NetworkExt) LeaderElectionOrchestrator(com.netflix.titus.master.supervisor.service.leader.LeaderElectionOrchestrator) Collections(java.util.Collections) GrpcMasterEndpointConfiguration(com.netflix.titus.master.endpoint.grpc.GrpcMasterEndpointConfiguration) LeaderElector(com.netflix.titus.api.supervisor.service.LeaderElector) AbstractModule(com.google.inject.AbstractModule) MasterInstance(com.netflix.titus.api.supervisor.model.MasterInstance) DefaultLocalMasterInstanceResolver(com.netflix.titus.master.supervisor.service.resolver.DefaultLocalMasterInstanceResolver) MasterInstance(com.netflix.titus.api.supervisor.model.MasterInstance) ServerPort(com.netflix.titus.api.supervisor.model.ServerPort) Singleton(javax.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

TitusRuntime (com.netflix.titus.common.runtime.TitusRuntime)20 List (java.util.List)16 Job (com.netflix.titus.api.jobmanager.model.job.Job)14 Task (com.netflix.titus.api.jobmanager.model.job.Task)12 ArrayList (java.util.ArrayList)11 Collections (java.util.Collections)10 Optional (java.util.Optional)9 TaskState (com.netflix.titus.api.jobmanager.model.job.TaskState)8 V3JobOperations (com.netflix.titus.api.jobmanager.service.V3JobOperations)8 JobFunctions (com.netflix.titus.api.jobmanager.model.job.JobFunctions)7 HashSet (java.util.HashSet)7 CallMetadata (com.netflix.titus.api.model.callmetadata.CallMetadata)6 DefaultRegistry (com.netflix.spectator.api.DefaultRegistry)5 TaskStatus (com.netflix.titus.api.jobmanager.model.job.TaskStatus)5 JobStore (com.netflix.titus.api.jobmanager.store.JobStore)5 VersionSupplier (com.netflix.titus.master.jobmanager.service.VersionSupplier)5 Test (org.junit.Test)5 VisibleForTesting (com.google.common.annotations.VisibleForTesting)4 ServiceJobExt (com.netflix.titus.api.jobmanager.model.job.ext.ServiceJobExt)4 JobManagerConstants (com.netflix.titus.api.jobmanager.service.JobManagerConstants)4