Search in sources :

Example 31 with CallMetadata

use of com.netflix.titus.api.model.callmetadata.CallMetadata in project titus-control-plane by Netflix.

the class SpringCallMetadataInterceptorTest method testOriginalCallerId.

@Test
public void testOriginalCallerId() throws Exception {
    when(request.getHeader(CallMetadataHeaders.CALLER_ID_HEADER)).thenReturn(MY_ORIGINAL_CALLER);
    interceptor.preHandle(request, response, new Object());
    CallMetadata callMetadata = expectCallMetadataAuthentication();
    assertThat(callMetadata.getCallers()).hasSize(2);
    assertThat(callMetadata.getCallers().get(0).getId()).isEqualTo(MY_ORIGINAL_CALLER);
    assertThat(callMetadata.getCallers().get(1).getId()).isEqualTo(MY_DIRECT_CALLER);
    assertThat(callMetadata.getCallers().get(1).getCallerType()).isEqualTo(CallerType.Application);
}
Also used : CallMetadata(com.netflix.titus.api.model.callmetadata.CallMetadata) Test(org.junit.Test)

Example 32 with CallMetadata

use of com.netflix.titus.api.model.callmetadata.CallMetadata in project titus-control-plane by Netflix.

the class SpringCallMetadataInterceptorTest method testDirectCaller.

@Test
public void testDirectCaller() throws Exception {
    interceptor.preHandle(request, response, new Object());
    CallMetadata callMetadata = expectCallMetadataAuthentication();
    assertThat(callMetadata.getCallers()).hasSize(1);
    assertThat(callMetadata.getCallers().get(0).getId()).isEqualTo(MY_DIRECT_CALLER);
    assertThat(callMetadata.getCallers().get(0).getCallerType()).isEqualTo(CallerType.Unknown);
}
Also used : CallMetadata(com.netflix.titus.api.model.callmetadata.CallMetadata) Test(org.junit.Test)

Example 33 with CallMetadata

use of com.netflix.titus.api.model.callmetadata.CallMetadata in project titus-control-plane by Netflix.

the class DefaultLoadBalancerServiceTest method multipleLoadBalancersPerJob.

@Test
public void multipleLoadBalancersPerJob() {
    PublishSubject<JobManagerEvent<?>> taskEvents = PublishSubject.create();
    String jobId = UUID.randomUUID().toString();
    String firstLoadBalancerId = "lb-" + UUID.randomUUID().toString();
    String secondLoadBalancerId = "lb-" + UUID.randomUUID().toString();
    int numberOfStartedTasks = 5;
    when(client.registerAll(any(), any())).thenReturn(Completable.complete());
    when(client.deregisterAll(any(), any())).thenReturn(Completable.complete());
    when(v3JobOperations.observeJobs()).thenReturn(taskEvents);
    LoadBalancerTests.applyValidGetJobMock(v3JobOperations, jobId);
    List<Task> tasks = LoadBalancerTests.buildTasksStarted(numberOfStartedTasks, jobId);
    Collection<LoadBalancerTargetState> firstExpectedTargets = tasks.stream().map(task -> new LoadBalancerTargetState(new LoadBalancerTarget(firstLoadBalancerId, task.getId(), task.getTaskContext().get(TaskAttributes.TASK_ATTRIBUTES_CONTAINER_IP)), REGISTERED)).collect(Collectors.toList());
    Collection<LoadBalancerTargetState> secondExpectedTargets = tasks.stream().map(task -> new LoadBalancerTargetState(new LoadBalancerTarget(secondLoadBalancerId, task.getId(), task.getTaskContext().get(TaskAttributes.TASK_ATTRIBUTES_CONTAINER_IP)), REGISTERED)).collect(Collectors.toList());
    when(v3JobOperations.getTasks(jobId)).thenReturn(CollectionsExt.merge(tasks, LoadBalancerTests.buildTasks(2, jobId, TaskState.StartInitiated), LoadBalancerTests.buildTasks(2, jobId, TaskState.KillInitiated), LoadBalancerTests.buildTasks(3, jobId, TaskState.Finished), LoadBalancerTests.buildTasks(1, jobId, TaskState.Disconnected)));
    LoadBalancerConfiguration configuration = LoadBalancerTests.mockConfiguration(MIN_TIME_IN_QUEUE_MS);
    DefaultLoadBalancerService service = new DefaultLoadBalancerService(runtime, configuration, client, loadBalancerStore, loadBalancerJobOperations, reconciler, validator, testScheduler);
    AssertableSubscriber<Batch<TargetStateBatchable, String>> testSubscriber = service.events().test();
    // associate two load balancers to the same job
    assertTrue(service.addLoadBalancer(jobId, firstLoadBalancerId).await(100, TimeUnit.MILLISECONDS));
    assertTrue(service.addLoadBalancer(jobId, secondLoadBalancerId).await(100, TimeUnit.MILLISECONDS));
    assertThat(service.getJobLoadBalancers(jobId).toList().toBlocking().single()).containsOnly(firstLoadBalancerId, secondLoadBalancerId);
    verify(v3JobOperations, times(2)).getTasks(jobId);
    testScheduler.advanceTimeBy(FLUSH_WAIT_TIME_MS, TimeUnit.MILLISECONDS);
    // 1 batch per loadbalancer
    testSubscriber.assertNoErrors().assertValueCount(2);
    assertThat(loadBalancerStore.getLoadBalancerTargets(firstLoadBalancerId).collectList().block()).containsExactlyInAnyOrderElementsOf(firstExpectedTargets);
    assertThat(loadBalancerStore.getLoadBalancerTargets(secondLoadBalancerId).collectList().block()).containsExactlyInAnyOrderElementsOf(secondExpectedTargets);
    verify(client).registerAll(eq(firstLoadBalancerId), argThat(targets -> targets != null && targets.size() == numberOfStartedTasks));
    verify(client).registerAll(eq(secondLoadBalancerId), argThat(targets -> targets != null && targets.size() == numberOfStartedTasks));
    verify(client, never()).deregisterAll(eq(firstLoadBalancerId), any());
    verify(client, never()).deregisterAll(eq(secondLoadBalancerId), any());
    verifyReconcilerIgnore(firstLoadBalancerId, LoadBalancerTests.ipAddresses(tasks));
    verifyReconcilerIgnore(secondLoadBalancerId, LoadBalancerTests.ipAddresses(tasks));
    // now some more tasks are added to the job, check if both load balancers get updated
    List<Task> newTasks = new ArrayList<>();
    for (int i = 1; i <= numberOfStartedTasks; i++) {
        String taskId = UUID.randomUUID().toString();
        Task startingWithIp = ServiceJobTask.newBuilder().withJobId(jobId).withId(taskId).withStatus(TaskStatus.newBuilder().withState(TaskState.StartInitiated).build()).withTaskContext(CollectionsExt.asMap(TaskAttributes.TASK_ATTRIBUTES_CONTAINER_IP, String.format("%1$d.%1$d.%1$d.%1$d", i + numberOfStartedTasks))).build();
        Task started = startingWithIp.toBuilder().withStatus(TaskStatus.newBuilder().withState(TaskState.Started).build()).build();
        newTasks.add(started);
        taskEvents.onNext(TaskUpdateEvent.taskChange(null, started, startingWithIp, callMetadata));
    }
    testScheduler.advanceTimeBy(FLUSH_WAIT_TIME_MS, TimeUnit.MILLISECONDS);
    // 2 more batches (one per load balancer)
    testSubscriber.assertNoErrors().assertValueCount(4);
    verify(client, times(2)).registerAll(eq(firstLoadBalancerId), argThat(targets -> targets != null && targets.size() == numberOfStartedTasks));
    verify(client, times(2)).registerAll(eq(secondLoadBalancerId), argThat(targets -> targets != null && targets.size() == numberOfStartedTasks));
    verify(client, never()).deregisterAll(eq(firstLoadBalancerId), any());
    verify(client, never()).deregisterAll(eq(secondLoadBalancerId), any());
    verifyReconcilerIgnore(firstLoadBalancerId, LoadBalancerTests.ipAddresses(newTasks));
    verifyReconcilerIgnore(secondLoadBalancerId, LoadBalancerTests.ipAddresses(newTasks));
    assertThat(loadBalancerStore.getLoadBalancerTargets(firstLoadBalancerId).collectList().block()).hasSize(firstExpectedTargets.size() + numberOfStartedTasks);
    assertThat(loadBalancerStore.getLoadBalancerTargets(secondLoadBalancerId).collectList().block()).hasSize(secondExpectedTargets.size() + numberOfStartedTasks);
}
Also used : LoadBalancerConnector(com.netflix.titus.api.connector.cloud.LoadBalancerConnector) JobLoadBalancerState(com.netflix.titus.api.loadbalancer.model.JobLoadBalancerState) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Task(com.netflix.titus.api.jobmanager.model.job.Task) CollectionsExt(com.netflix.titus.common.util.CollectionsExt) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Single(rx.Single) TitusRuntimes(com.netflix.titus.common.runtime.TitusRuntimes) DefaultLoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.DefaultLoadBalancerJobValidator) Schedulers(rx.schedulers.Schedulers) CallMetadata(com.netflix.titus.api.model.callmetadata.CallMetadata) LoadBalancerTarget(com.netflix.titus.api.loadbalancer.model.LoadBalancerTarget) LoadBalancerStore(com.netflix.titus.api.loadbalancer.store.LoadBalancerStore) JobLoadBalancer(com.netflix.titus.api.loadbalancer.model.JobLoadBalancer) LoadBalancerValidationConfiguration(com.netflix.titus.api.loadbalancer.model.sanitizer.LoadBalancerValidationConfiguration) Collection(java.util.Collection) DEREGISTERED(com.netflix.titus.api.loadbalancer.model.LoadBalancerTarget.State.DEREGISTERED) TaskStatus(com.netflix.titus.api.jobmanager.model.job.TaskStatus) Set(java.util.Set) UUID(java.util.UUID) JobManagerEvent(com.netflix.titus.api.jobmanager.model.job.event.JobManagerEvent) Collectors(java.util.stream.Collectors) TaskState(com.netflix.titus.api.jobmanager.model.job.TaskState) List(java.util.List) TaskUpdateEvent(com.netflix.titus.api.jobmanager.model.job.event.TaskUpdateEvent) Assert.assertFalse(org.junit.Assert.assertFalse) PublishSubject(rx.subjects.PublishSubject) Mockito.mock(org.mockito.Mockito.mock) Completable(rx.Completable) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) LoadBalancerTargetState(com.netflix.titus.api.loadbalancer.model.LoadBalancerTargetState) LoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.LoadBalancerJobValidator) TestScheduler(rx.schedulers.TestScheduler) ArrayList(java.util.ArrayList) AssertableSubscriber(rx.observers.AssertableSubscriber) ServiceJobTask(com.netflix.titus.api.jobmanager.model.job.ServiceJobTask) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) JobManagerException(com.netflix.titus.api.jobmanager.service.JobManagerException) Before(org.junit.Before) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) LoadBalancer(com.netflix.titus.api.connector.cloud.LoadBalancer) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) V3JobOperations(com.netflix.titus.api.jobmanager.service.V3JobOperations) Batch(com.netflix.titus.common.util.rx.batch.Batch) Mockito.never(org.mockito.Mockito.never) TaskAttributes(com.netflix.titus.api.jobmanager.TaskAttributes) InMemoryLoadBalancerStore(com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore) REGISTERED(com.netflix.titus.api.loadbalancer.model.LoadBalancerTarget.State.REGISTERED) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) Task(com.netflix.titus.api.jobmanager.model.job.Task) ServiceJobTask(com.netflix.titus.api.jobmanager.model.job.ServiceJobTask) JobManagerEvent(com.netflix.titus.api.jobmanager.model.job.event.JobManagerEvent) ArrayList(java.util.ArrayList) LoadBalancerTarget(com.netflix.titus.api.loadbalancer.model.LoadBalancerTarget) Batch(com.netflix.titus.common.util.rx.batch.Batch) LoadBalancerTargetState(com.netflix.titus.api.loadbalancer.model.LoadBalancerTargetState) Test(org.junit.Test)

Example 34 with CallMetadata

use of com.netflix.titus.api.model.callmetadata.CallMetadata in project titus-control-plane by Netflix.

the class DefaultLoadBalancerServiceTest method movedTaskOnlyTargetAssociatedWithLoadBalancer.

@Test
public void movedTaskOnlyTargetAssociatedWithLoadBalancer() {
    String taskId = UUID.randomUUID().toString();
    String sourceJobId = UUID.randomUUID().toString();
    String targetJobId = UUID.randomUUID().toString();
    String targetLoadBalancerId = "lb-" + UUID.randomUUID().toString();
    PublishSubject<JobManagerEvent<?>> taskEvents = PublishSubject.create();
    when(client.registerAll(any(), any())).thenReturn(Completable.complete());
    when(client.deregisterAll(any(), any())).thenReturn(Completable.complete());
    when(v3JobOperations.observeJobs()).thenReturn(taskEvents);
    LoadBalancerTests.applyValidGetJobMock(v3JobOperations, sourceJobId);
    LoadBalancerTests.applyValidGetJobMock(v3JobOperations, targetJobId);
    LoadBalancerConfiguration configuration = LoadBalancerTests.mockConfiguration(MIN_TIME_IN_QUEUE_MS);
    DefaultLoadBalancerService service = new DefaultLoadBalancerService(runtime, configuration, client, loadBalancerStore, loadBalancerJobOperations, reconciler, validator, testScheduler);
    AssertableSubscriber<Batch<TargetStateBatchable, String>> testSubscriber = service.events().test();
    assertThat(service.getJobLoadBalancers(sourceJobId).toBlocking().toIterable()).isEmpty();
    assertTrue(service.addLoadBalancer(targetJobId, targetLoadBalancerId).await(100, TimeUnit.MILLISECONDS));
    assertThat(service.getJobLoadBalancers(targetJobId).toBlocking().toIterable()).containsExactlyInAnyOrder(targetLoadBalancerId);
    testScheduler.advanceTimeBy(FLUSH_WAIT_TIME_MS, TimeUnit.MILLISECONDS);
    testSubscriber.assertNoErrors().assertValueCount(0);
    verify(client, never()).registerAll(any(), any());
    verify(client, never()).deregisterAll(any(), any());
    verifyNoReconcilerIgnore();
    Task moved = ServiceJobTask.newBuilder().withJobId(targetJobId).withId(taskId).withStatus(TaskStatus.newBuilder().withState(TaskState.Started).build()).withTaskContext(CollectionsExt.asMap(TaskAttributes.TASK_ATTRIBUTES_CONTAINER_IP, "1.2.3.4", TaskAttributes.TASK_ATTRIBUTES_MOVED_FROM_JOB, sourceJobId)).build();
    // detect the task is moved and gets registered on the target
    taskEvents.onNext(TaskUpdateEvent.newTaskFromAnotherJob(null, moved, callMetadata));
    testScheduler.advanceTimeBy(FLUSH_WAIT_TIME_MS, TimeUnit.MILLISECONDS);
    testSubscriber.assertNoErrors().assertValueCount(1);
    verify(client).registerAll(eq(targetLoadBalancerId), argThat(set -> set.contains("1.2.3.4")));
    verify(client, never()).deregisterAll(any(), any());
    verifyReconcilerIgnore(targetLoadBalancerId, "1.2.3.4");
}
Also used : LoadBalancerConnector(com.netflix.titus.api.connector.cloud.LoadBalancerConnector) JobLoadBalancerState(com.netflix.titus.api.loadbalancer.model.JobLoadBalancerState) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Task(com.netflix.titus.api.jobmanager.model.job.Task) CollectionsExt(com.netflix.titus.common.util.CollectionsExt) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Single(rx.Single) TitusRuntimes(com.netflix.titus.common.runtime.TitusRuntimes) DefaultLoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.DefaultLoadBalancerJobValidator) Schedulers(rx.schedulers.Schedulers) CallMetadata(com.netflix.titus.api.model.callmetadata.CallMetadata) LoadBalancerTarget(com.netflix.titus.api.loadbalancer.model.LoadBalancerTarget) LoadBalancerStore(com.netflix.titus.api.loadbalancer.store.LoadBalancerStore) JobLoadBalancer(com.netflix.titus.api.loadbalancer.model.JobLoadBalancer) LoadBalancerValidationConfiguration(com.netflix.titus.api.loadbalancer.model.sanitizer.LoadBalancerValidationConfiguration) Collection(java.util.Collection) DEREGISTERED(com.netflix.titus.api.loadbalancer.model.LoadBalancerTarget.State.DEREGISTERED) TaskStatus(com.netflix.titus.api.jobmanager.model.job.TaskStatus) Set(java.util.Set) UUID(java.util.UUID) JobManagerEvent(com.netflix.titus.api.jobmanager.model.job.event.JobManagerEvent) Collectors(java.util.stream.Collectors) TaskState(com.netflix.titus.api.jobmanager.model.job.TaskState) List(java.util.List) TaskUpdateEvent(com.netflix.titus.api.jobmanager.model.job.event.TaskUpdateEvent) Assert.assertFalse(org.junit.Assert.assertFalse) PublishSubject(rx.subjects.PublishSubject) Mockito.mock(org.mockito.Mockito.mock) Completable(rx.Completable) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) LoadBalancerTargetState(com.netflix.titus.api.loadbalancer.model.LoadBalancerTargetState) LoadBalancerJobValidator(com.netflix.titus.api.loadbalancer.model.sanitizer.LoadBalancerJobValidator) TestScheduler(rx.schedulers.TestScheduler) ArrayList(java.util.ArrayList) AssertableSubscriber(rx.observers.AssertableSubscriber) ServiceJobTask(com.netflix.titus.api.jobmanager.model.job.ServiceJobTask) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) JobManagerException(com.netflix.titus.api.jobmanager.service.JobManagerException) Before(org.junit.Before) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) Mockito.when(org.mockito.Mockito.when) LoadBalancer(com.netflix.titus.api.connector.cloud.LoadBalancer) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) V3JobOperations(com.netflix.titus.api.jobmanager.service.V3JobOperations) Batch(com.netflix.titus.common.util.rx.batch.Batch) Mockito.never(org.mockito.Mockito.never) TaskAttributes(com.netflix.titus.api.jobmanager.TaskAttributes) InMemoryLoadBalancerStore(com.netflix.titus.runtime.store.v3.memory.InMemoryLoadBalancerStore) REGISTERED(com.netflix.titus.api.loadbalancer.model.LoadBalancerTarget.State.REGISTERED) TitusRuntime(com.netflix.titus.common.runtime.TitusRuntime) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) Task(com.netflix.titus.api.jobmanager.model.job.Task) ServiceJobTask(com.netflix.titus.api.jobmanager.model.job.ServiceJobTask) Batch(com.netflix.titus.common.util.rx.batch.Batch) JobManagerEvent(com.netflix.titus.api.jobmanager.model.job.event.JobManagerEvent) Test(org.junit.Test)

Example 35 with CallMetadata

use of com.netflix.titus.api.model.callmetadata.CallMetadata 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

CallMetadata (com.netflix.titus.api.model.callmetadata.CallMetadata)35 List (java.util.List)16 ArrayList (java.util.ArrayList)14 Task (com.netflix.titus.api.jobmanager.model.job.Task)13 TitusRuntime (com.netflix.titus.common.runtime.TitusRuntime)12 Completable (rx.Completable)12 TaskState (com.netflix.titus.api.jobmanager.model.job.TaskState)11 Collections (java.util.Collections)11 Collectors (java.util.stream.Collectors)11 JobManagerException (com.netflix.titus.api.jobmanager.service.JobManagerException)10 Test (org.junit.Test)10 TaskStatus (com.netflix.titus.api.jobmanager.model.job.TaskStatus)9 V3JobOperations (com.netflix.titus.api.jobmanager.service.V3JobOperations)9 CollectionsExt (com.netflix.titus.common.util.CollectionsExt)9 Pair (com.netflix.titus.common.util.tuple.Pair)9 Set (java.util.Set)9 TimeUnit (java.util.concurrent.TimeUnit)9 TaskAttributes (com.netflix.titus.api.jobmanager.TaskAttributes)7 ServiceJobTask (com.netflix.titus.api.jobmanager.model.job.ServiceJobTask)7 JobManagerEvent (com.netflix.titus.api.jobmanager.model.job.event.JobManagerEvent)7