Search in sources :

Example 16 with TitusRuntime

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

the class EmbeddedTitusMaster method boot.

public EmbeddedTitusMaster boot() {
    Stopwatch timer = Stopwatch.createStarted();
    logger.info("Starting Titus Master");
    Module embeddedKubeModule;
    if (embeddedKubeCluster == null) {
        embeddedKubeModule = new AbstractModule() {

            @Override
            protected void configure() {
            }
        };
    } else {
        embeddedKubeModule = new EmbeddedKubeModule(embeddedKubeCluster);
    }
    injector = InjectorBuilder.fromModules(Modules.override(new TitusRuntimeModule(false)).with(new AbstractModule() {

        @Override
        protected void configure() {
            bind(Archaius2ConfigurationLogger.class).asEagerSingleton();
            bind(Registry.class).toInstance(new DefaultRegistry());
        }
    }), embeddedKubeModule, Modules.override(new TitusMasterModule(enableREST, TitusMasterModule.Mode.EMBEDDED_KUBE)).with(new AbstractModule() {

        @Override
        protected void configure() {
            bind(InstanceCloudConnector.class).toInstance(new NoOpInstanceCloudConnector());
            bind(MasterDescription.class).toInstance(masterDescription);
            bind(MasterMonitor.class).to(LocalMasterMonitor.class);
            bind(AppScalePolicyStore.class).to(InMemoryPolicyStore.class);
            bind(LoadBalancerStore.class).to(InMemoryLoadBalancerStore.class);
            bind(LoadBalancerConnector.class).to(NoOpLoadBalancerConnector.class);
            bind(LoadBalancerJobValidator.class).to(NoOpLoadBalancerJobValidator.class);
        }

        @Provides
        @Singleton
        public JobStore getJobStore(TitusRuntime titusRuntime) {
            if (!cassandraJobStore) {
                return jobStore;
            }
            try {
                JobStore jobStore = EmbeddedCassandraStoreFactory.newBuilder().withTitusRuntime(titusRuntime).build().getJobStore();
                return jobStore;
            } catch (Throwable e) {
                e.printStackTrace();
                return null;
            }
        }
    }), newJettyModule(), new ArchaiusModule() {

        @Override
        protected void configureArchaius() {
            bindApplicationConfigurationOverride().toInstance(config);
        }
    }).createInjector();
    if (grpcPort <= 0) {
        grpcPort = getGrpcPort();
        config.setProperty("titus.master.grpcServer.port", "" + grpcPort);
    }
    injector.getInstance(ContainerEventBus.class).submitInOrder(new ContainerEventBus.ContainerStartedEvent());
    injector.getInstance(LeaderActivator.class).becomeLeader();
    injector.getInstance(AuditLogService.class).auditLogEvents().subscribe(auditLogs::add);
    if (enableREST) {
        // Since jetty API server is run on a separate thread, it may not be ready yet
        // We do not have better way, but call it until it replies.
        getClient().findAllApplicationSLA().retryWhen(attempts -> {
            return attempts.zipWith(Observable.range(1, 5), (n, i) -> i).flatMap(i -> {
                return Observable.timer(i, TimeUnit.SECONDS);
            });
        }).timeout(30, TimeUnit.SECONDS).toBlocking().firstOrDefault(null);
    }
    logger.info("Embedded TitusMaster started in {}ms", timer.elapsed(TimeUnit.MILLISECONDS));
    return this;
}
Also used : Module(com.google.inject.Module) AuditLogEvent(com.netflix.titus.api.audit.model.AuditLogEvent) LoadBalancerConnector(com.netflix.titus.api.connector.cloud.LoadBalancerConnector) LocalMasterMonitor(com.netflix.titus.master.supervisor.service.leader.LocalMasterMonitor) InjectorBuilder(com.netflix.governator.InjectorBuilder) ManagedChannel(io.grpc.ManagedChannel) EmbeddedKubeCluster(com.netflix.titus.testkit.embedded.kube.EmbeddedKubeCluster) Key(com.google.inject.Key) LoggerFactory(org.slf4j.LoggerFactory) NoOpLoadBalancerConnector(com.netflix.titus.api.connector.cloud.noop.NoOpLoadBalancerConnector) MasterDescription(com.netflix.titus.api.supervisor.service.MasterDescription) NoOpLoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.NoOpLoadBalancerJobValidator) TitusMaster(com.netflix.titus.master.TitusMaster) TitusRuntimeModule(com.netflix.titus.master.TitusRuntimeModule) JobStore(com.netflix.titus.api.jobmanager.store.JobStore) LoadBalancerStore(com.netflix.titus.api.loadbalancer.store.LoadBalancerStore) AppScalePolicyStore(com.netflix.titus.api.appscale.store.AppScalePolicyStore) InMemoryJobStore(com.netflix.titus.runtime.store.v3.memory.InMemoryJobStore) MasterMonitor(com.netflix.titus.api.supervisor.service.MasterMonitor) ContainerEventBus(com.netflix.titus.common.util.guice.ContainerEventBus) ReactorTitusMasterClient(com.netflix.titus.testkit.client.ReactorTitusMasterClient) SupervisorServiceGrpc(com.netflix.titus.grpc.protogen.SupervisorServiceGrpc) ArchaiusSystemDisruptionBudgetResolver(com.netflix.titus.master.eviction.service.quota.system.ArchaiusSystemDisruptionBudgetResolver) InMemoryPolicyStore(com.netflix.titus.runtime.store.v3.memory.InMemoryPolicyStore) List(java.util.List) MachineServiceGrpc(com.netflix.titus.grpc.protogen.v4.MachineServiceGrpc) LifecycleInjector(com.netflix.governator.LifecycleInjector) SchedulerServiceGrpc(com.netflix.titus.grpc.protogen.SchedulerServiceGrpc) EmbeddedJettyModule(com.netflix.titus.runtime.endpoint.common.rest.EmbeddedJettyModule) EmbeddedCassandraStoreFactory(com.netflix.titus.ext.cassandra.testkit.store.EmbeddedCassandraStoreFactory) SupervisorServiceBlockingStub(com.netflix.titus.grpc.protogen.SupervisorServiceGrpc.SupervisorServiceBlockingStub) JobManagementServiceStub(com.netflix.titus.grpc.protogen.JobManagementServiceGrpc.JobManagementServiceStub) JettyModule(com.netflix.governator.guice.jetty.JettyModule) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) LeaderActivator(com.netflix.titus.api.supervisor.service.LeaderActivator) Stopwatch(com.google.common.base.Stopwatch) Modules(com.google.inject.util.Modules) LoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.LoadBalancerJobValidator) HealthStub(com.netflix.titus.grpc.protogen.HealthGrpc.HealthStub) NoOpInstanceCloudConnector(com.netflix.titus.api.connector.cloud.noop.NoOpInstanceCloudConnector) Singleton(javax.inject.Singleton) TitusMasterGrpcServer(com.netflix.titus.master.endpoint.grpc.TitusMasterGrpcServer) Observable(rx.Observable) JobActivityHistoryServiceGrpc(com.netflix.titus.grpc.protogen.JobActivityHistoryServiceGrpc) EvictionServiceGrpc(com.netflix.titus.grpc.protogen.EvictionServiceGrpc) HealthGrpc(com.netflix.titus.grpc.protogen.HealthGrpc) InstanceCloudConnector(com.netflix.titus.api.connector.cloud.InstanceCloudConnector) AutoScalingServiceGrpc(com.netflix.titus.grpc.protogen.AutoScalingServiceGrpc) TitusMasterModule(com.netflix.titus.master.TitusMasterModule) ArchaiusModule(com.netflix.archaius.guice.ArchaiusModule) EmbeddedKubeModule(com.netflix.titus.testkit.embedded.kube.EmbeddedKubeModule) Properties(java.util.Properties) Logger(org.slf4j.Logger) TestKitGrpcClientErrorUtils(com.netflix.titus.testkit.grpc.TestKitGrpcClientErrorUtils) DefaultSettableConfig(com.netflix.archaius.config.DefaultSettableConfig) JobManagementServiceGrpc(com.netflix.titus.grpc.protogen.JobManagementServiceGrpc) TitusMasterClient(com.netflix.titus.testkit.client.TitusMasterClient) Archaius2ConfigurationLogger(com.netflix.titus.common.util.archaius2.Archaius2ConfigurationLogger) TimeUnit(java.util.concurrent.TimeUnit) ManagedChannelBuilder(io.grpc.ManagedChannelBuilder) ObjectMappers(com.netflix.titus.api.json.ObjectMappers) Provides(com.google.inject.Provides) LoadBalancerServiceGrpc(com.netflix.titus.grpc.protogen.LoadBalancerServiceGrpc) DefaultRegistry(com.netflix.spectator.api.DefaultRegistry) JobManagementServiceBlockingStub(com.netflix.titus.grpc.protogen.JobManagementServiceGrpc.JobManagementServiceBlockingStub) InMemoryLoadBalancerStore(com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore) Registry(com.netflix.spectator.api.Registry) Preconditions(com.google.common.base.Preconditions) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) SystemDisruptionBudgetDescriptor(com.netflix.titus.master.eviction.service.quota.system.SystemDisruptionBudgetDescriptor) AbstractModule(com.google.inject.AbstractModule) AuditLogService(com.netflix.titus.api.audit.service.AuditLogService) AppScalePolicyStore(com.netflix.titus.api.appscale.store.AppScalePolicyStore) MasterDescription(com.netflix.titus.api.supervisor.service.MasterDescription) Stopwatch(com.google.common.base.Stopwatch) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) EmbeddedKubeModule(com.netflix.titus.testkit.embedded.kube.EmbeddedKubeModule) NoOpLoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.NoOpLoadBalancerJobValidator) LoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.LoadBalancerJobValidator) NoOpInstanceCloudConnector(com.netflix.titus.api.connector.cloud.noop.NoOpInstanceCloudConnector) InstanceCloudConnector(com.netflix.titus.api.connector.cloud.InstanceCloudConnector) LeaderActivator(com.netflix.titus.api.supervisor.service.LeaderActivator) LocalMasterMonitor(com.netflix.titus.master.supervisor.service.leader.LocalMasterMonitor) MasterMonitor(com.netflix.titus.api.supervisor.service.MasterMonitor) LoadBalancerConnector(com.netflix.titus.api.connector.cloud.LoadBalancerConnector) NoOpLoadBalancerConnector(com.netflix.titus.api.connector.cloud.noop.NoOpLoadBalancerConnector) NoOpInstanceCloudConnector(com.netflix.titus.api.connector.cloud.noop.NoOpInstanceCloudConnector) Archaius2ConfigurationLogger(com.netflix.titus.common.util.archaius2.Archaius2ConfigurationLogger) ContainerEventBus(com.netflix.titus.common.util.guice.ContainerEventBus) JobStore(com.netflix.titus.api.jobmanager.store.JobStore) InMemoryJobStore(com.netflix.titus.runtime.store.v3.memory.InMemoryJobStore) DefaultRegistry(com.netflix.spectator.api.DefaultRegistry) Registry(com.netflix.spectator.api.Registry) AbstractModule(com.google.inject.AbstractModule) TitusMasterModule(com.netflix.titus.master.TitusMasterModule) ArchaiusModule(com.netflix.archaius.guice.ArchaiusModule) DefaultRegistry(com.netflix.spectator.api.DefaultRegistry) Module(com.google.inject.Module) TitusRuntimeModule(com.netflix.titus.master.TitusRuntimeModule) EmbeddedJettyModule(com.netflix.titus.runtime.endpoint.common.rest.EmbeddedJettyModule) JettyModule(com.netflix.governator.guice.jetty.JettyModule) TitusMasterModule(com.netflix.titus.master.TitusMasterModule) ArchaiusModule(com.netflix.archaius.guice.ArchaiusModule) EmbeddedKubeModule(com.netflix.titus.testkit.embedded.kube.EmbeddedKubeModule) AbstractModule(com.google.inject.AbstractModule) LoadBalancerStore(com.netflix.titus.api.loadbalancer.store.LoadBalancerStore) InMemoryLoadBalancerStore(com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore) TitusRuntimeModule(com.netflix.titus.master.TitusRuntimeModule)

Example 17 with TitusRuntime

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

the class DefaultNodeConditionControllerTest method badNodeConditionsIgnoredForJobsNotOptingIn.

@Test
public void badNodeConditionsIgnoredForJobsNotOptingIn() {
    Map<String, TitusNode> nodeMap = buildNodes();
    List<Job<BatchJobExt>> jobs = getJobs(false);
    Map<String, List<Task>> stringListMap = buildTasksForJobAndNodeAssignment(new ArrayList<>(nodeMap.values()), jobs);
    TitusRuntime titusRuntime = mock(TitusRuntime.class);
    when(titusRuntime.getRegistry()).thenReturn(new DefaultRegistry());
    RelocationConfiguration configuration = mock(RelocationConfiguration.class);
    when(configuration.getBadNodeConditionPattern()).thenReturn(".*Failure");
    when(configuration.isTaskTerminationOnBadNodeConditionEnabled()).thenReturn(true);
    NodeDataResolver nodeDataResolver = mock(NodeDataResolver.class);
    when(nodeDataResolver.resolve()).thenReturn(nodeMap);
    JobDataReplicator jobDataReplicator = mock(JobDataReplicator.class);
    when(jobDataReplicator.getStalenessMs()).thenReturn(0L);
    // Job attribute "terminateContainerOnBadAgent" = False
    ReadOnlyJobOperations readOnlyJobOperations = mock(ReadOnlyJobOperations.class);
    when(readOnlyJobOperations.getJobs()).thenReturn(new ArrayList<>(jobs));
    stringListMap.forEach((key, value) -> when(readOnlyJobOperations.getTasks(key)).thenReturn(value));
    JobManagementClient jobManagementClient = mock(JobManagementClient.class);
    Set<String> terminatedTaskIds = new HashSet<>();
    when(jobManagementClient.killTask(anyString(), anyBoolean(), any())).thenAnswer(invocation -> {
        String taskIdToBeTerminated = invocation.getArgument(0);
        terminatedTaskIds.add(taskIdToBeTerminated);
        return Mono.empty();
    });
    DefaultNodeConditionController nodeConditionController = new DefaultNodeConditionController(configuration, nodeDataResolver, jobDataReplicator, readOnlyJobOperations, jobManagementClient, titusRuntime);
    ExecutionContext executionContext = ExecutionContext.newBuilder().withIteration(ExecutionId.initial()).build();
    StepVerifier.create(nodeConditionController.handleNodesWithBadCondition(executionContext)).verifyComplete();
    // no tasks should be terminated for jobs
    assertThat(terminatedTaskIds).isEmpty();
}
Also used : JobDataReplicator(com.netflix.titus.runtime.connector.jobmanager.JobDataReplicator) ReadOnlyJobOperations(com.netflix.titus.api.jobmanager.service.ReadOnlyJobOperations) JobManagementClient(com.netflix.titus.runtime.connector.jobmanager.JobManagementClient) NodeDataResolver(com.netflix.titus.supplementary.relocation.connector.NodeDataResolver) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) ExecutionContext(com.netflix.titus.common.framework.scheduler.ExecutionContext) DefaultRegistry(com.netflix.spectator.api.DefaultRegistry) ArrayList(java.util.ArrayList) List(java.util.List) TitusNode(com.netflix.titus.supplementary.relocation.connector.TitusNode) Job(com.netflix.titus.api.jobmanager.model.job.Job) RelocationConfiguration(com.netflix.titus.supplementary.relocation.RelocationConfiguration) HashSet(java.util.HashSet) Test(org.junit.Test)

Example 18 with TitusRuntime

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

the class BaseGcController method enterActiveMode.

@Activator
public void enterActiveMode() {
    ScheduleDescriptor gcScheduleDescriptor = ScheduleDescriptor.newBuilder().withName(name).withDescription(description).withInitialDelay(Duration.ofMillis(controllerConfiguration.getControllerInitialDelayMs())).withInterval(Duration.ofMillis(controllerConfiguration.getControllerIntervalMs())).withTimeout(Duration.ofMillis(controllerConfiguration.getControllerTimeoutMs())).build();
    executorService = ExecutorsExt.namedSingleThreadExecutor(name);
    schedulerRef = scheduler.schedule(gcScheduleDescriptor, e -> doGc(), executorService);
    tokenBucket = Limiters.createInstrumentedFixedIntervalTokenBucket(name + "TokenBucket", tokenBucketConfiguration, currentTokenBucket -> logger.info("Token bucket: {} configuration updated with: {}", name, currentTokenBucket), titusRuntime);
}
Also used : ExecutorsExt(com.netflix.titus.common.util.ExecutorsExt) Gauge(com.netflix.spectator.api.Gauge) Logger(org.slf4j.Logger) LoggerFactory(org.slf4j.LoggerFactory) MetricConstants(com.netflix.titus.master.MetricConstants) ScheduleReference(com.netflix.titus.common.framework.scheduler.ScheduleReference) Activator(com.netflix.titus.common.util.guice.annotation.Activator) FixedIntervalTokenBucketConfiguration(com.netflix.titus.common.util.limiter.tokenbucket.FixedIntervalTokenBucketConfiguration) PreDestroy(javax.annotation.PreDestroy) List(java.util.List) ScheduleDescriptor(com.netflix.titus.common.framework.scheduler.model.ScheduleDescriptor) Duration(java.time.Duration) Limiters(com.netflix.titus.common.util.limiter.Limiters) Named(javax.inject.Named) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) TokenBucket(com.netflix.titus.common.util.limiter.tokenbucket.TokenBucket) Evaluators(com.netflix.titus.common.util.Evaluators) Collections(java.util.Collections) Deactivator(com.netflix.titus.common.util.guice.annotation.Deactivator) ExecutorService(java.util.concurrent.ExecutorService) LocalScheduler(com.netflix.titus.common.framework.scheduler.LocalScheduler) ScheduleDescriptor(com.netflix.titus.common.framework.scheduler.model.ScheduleDescriptor) Activator(com.netflix.titus.common.util.guice.annotation.Activator)

Example 19 with TitusRuntime

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

the class LoadBalancerTests method getMockLoadBalancerService.

public static LoadBalancerService getMockLoadBalancerService() {
    final TitusRuntime runtime = TitusRuntimes.internal();
    final LoadBalancerConfiguration loadBalancerConfig = mockConfiguration(5_000);
    final LoadBalancerConnector connector = mock(LoadBalancerConnector.class);
    final V3JobOperations v3JobOperations = mock(V3JobOperations.class);
    when(v3JobOperations.observeJobs()).thenReturn(PublishSubject.create());
    final LoadBalancerJobOperations loadBalancerJobOperations = new LoadBalancerJobOperations(v3JobOperations);
    final LoadBalancerReconciler reconciler = mock(LoadBalancerReconciler.class);
    when(reconciler.events()).thenReturn(PublishSubject.create());
    final LoadBalancerStore loadBalancerStore = new InMemoryLoadBalancerStore();
    final LoadBalancerJobValidator validator = new NoOpLoadBalancerJobValidator();
    final TestScheduler testScheduler = Schedulers.test();
    return new DefaultLoadBalancerService(runtime, loadBalancerConfig, connector, loadBalancerStore, loadBalancerJobOperations, reconciler, validator, testScheduler);
}
Also used : NoOpLoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.NoOpLoadBalancerJobValidator) LoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.LoadBalancerJobValidator) LoadBalancerConnector(com.netflix.titus.api.connector.cloud.LoadBalancerConnector) V3JobOperations(com.netflix.titus.api.jobmanager.service.V3JobOperations) InMemoryLoadBalancerStore(com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore) NoOpLoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.NoOpLoadBalancerJobValidator) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) TestScheduler(rx.schedulers.TestScheduler) LoadBalancerStore(com.netflix.titus.api.loadbalancer.store.LoadBalancerStore) InMemoryLoadBalancerStore(com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore)

Example 20 with TitusRuntime

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

the class JobScenarioBuilder method triggerComputePlatformEvent.

private JobScenarioBuilder triggerComputePlatformEvent(Task task, TaskState taskState, String reason, int errorCode) {
    String reasonMessage;
    if (taskState == TaskState.Finished) {
        reasonMessage = errorCode == 0 ? "Completed successfully" : "Container terminated with an error " + errorCode;
    } else {
        reasonMessage = "Task changed state to " + taskState;
    }
    AtomicBoolean done = new AtomicBoolean();
    final Map<String, String> newTaskContext = new HashMap<>();
    if (taskState == TaskState.Launched) {
        newTaskContext.putAll(computeProvider.getScheduledTaskContext(task.getId()));
    }
    TaskStatus taskStatus = JobModel.newTaskStatus().withState(taskState).withReasonCode(reason).withReasonMessage(reasonMessage).withTimestamp(testScheduler.now()).build();
    Function<Task, Optional<Task>> changeFunction = currentTask -> JobManagerUtil.newMesosTaskStateUpdater(taskStatus, titusRuntime).apply(currentTask).map(updated -> updated.toBuilder().withTaskContext(CollectionsExt.merge(updated.getTaskContext(), newTaskContext)).build());
    jobOperations.updateTask(task.getId(), changeFunction, Trigger.ComputeProvider, String.format("ComputeProvider callback taskStatus=%s, reason=%s (%s)", taskState, reason, reasonMessage), callMetadata).subscribe(() -> done.set(true));
    autoAdvanceUntil(done::get);
    assertThat(done.get()).isTrue();
    return this;
}
Also used : JobModel(com.netflix.titus.api.jobmanager.model.job.JobModel) BiFunction(java.util.function.BiFunction) Task(com.netflix.titus.api.jobmanager.model.job.Task) CollectionsExt(com.netflix.titus.common.util.CollectionsExt) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) RECONCILER_ACTIVE_TIMEOUT_MS(com.netflix.titus.master.jobmanager.service.integration.scenario.JobsScenarioBuilder.RECONCILER_ACTIVE_TIMEOUT_MS) Map(java.util.Map) CallMetadata(com.netflix.titus.api.model.callmetadata.CallMetadata) StoreEvent(com.netflix.titus.master.jobmanager.service.integration.scenario.StubbedJobStore.StoreEvent) JobManagerUtil(com.netflix.titus.master.jobmanager.service.JobManagerUtil) Caller(com.netflix.titus.api.model.callmetadata.Caller) Job(com.netflix.titus.api.jobmanager.model.job.Job) Predicate(java.util.function.Predicate) Collection(java.util.Collection) TaskStatus(com.netflix.titus.api.jobmanager.model.job.TaskStatus) JobFunctions(com.netflix.titus.api.jobmanager.model.job.JobFunctions) TitusRxSubscriber(com.netflix.titus.testkit.rx.TitusRxSubscriber) JobManagerEvent(com.netflix.titus.api.jobmanager.model.job.event.JobManagerEvent) Collectors(java.util.stream.Collectors) TaskState(com.netflix.titus.api.jobmanager.model.job.TaskState) Capacity(com.netflix.titus.api.jobmanager.model.job.Capacity) List(java.util.List) VersionSupplier(com.netflix.titus.master.jobmanager.service.VersionSupplier) TaskUpdateEvent(com.netflix.titus.api.jobmanager.model.job.event.TaskUpdateEvent) VersionSuppliers(com.netflix.titus.master.jobmanager.service.VersionSuppliers) DisruptionBudget(com.netflix.titus.api.jobmanager.model.job.disruptionbudget.DisruptionBudget) Optional(java.util.Optional) Trigger(com.netflix.titus.api.jobmanager.service.V3JobOperations.Trigger) BatchJobTask(com.netflix.titus.api.jobmanager.model.job.BatchJobTask) ServiceJobProcesses(com.netflix.titus.api.jobmanager.model.job.ServiceJobProcesses) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) Callable(java.util.concurrent.Callable) TestScheduler(rx.schedulers.TestScheduler) Function(java.util.function.Function) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) Pair(com.netflix.titus.common.util.tuple.Pair) ExceptionExt(com.netflix.titus.common.util.ExceptionExt) ExtTestSubscriber(com.netflix.titus.testkit.rx.ExtTestSubscriber) Iterator(java.util.Iterator) JobUpdateEvent(com.netflix.titus.api.jobmanager.model.job.event.JobUpdateEvent) Subscriber(rx.Subscriber) ServiceJobExt(com.netflix.titus.api.jobmanager.model.job.ext.ServiceJobExt) CallerType(com.netflix.titus.api.model.callmetadata.CallerType) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) V3JobOperations(com.netflix.titus.api.jobmanager.service.V3JobOperations) CapacityAttributes(com.netflix.titus.api.jobmanager.model.job.CapacityAttributes) Preconditions(com.google.common.base.Preconditions) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) Collections(java.util.Collections) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Task(com.netflix.titus.api.jobmanager.model.job.Task) BatchJobTask(com.netflix.titus.api.jobmanager.model.job.BatchJobTask) Optional(java.util.Optional) HashMap(java.util.HashMap) TaskStatus(com.netflix.titus.api.jobmanager.model.job.TaskStatus)

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