@Test public void shouldAssignMultipleReplicasOfStandbyTask() throws Exception { createClientWithPreviousActiveTasks(p1, 1, task00); createClientWithPreviousActiveTasks(p2, 1, task01); createClientWithPreviousActiveTasks(p3, 1, task02); final StickyTaskAssignor taskAssignor = createTaskAssignor(task00, task01, task02); taskAssignor.assign(2); assertThat(clients.get(p1).standbyTasks(), equalTo(Utils.mkSet(task01, task02))); assertThat(clients.get(p2).standbyTasks(), equalTo(Utils.mkSet(task02, task00))); assertThat(clients.get(p3).standbyTasks(), equalTo(Utils.mkSet(task00, task01))); }
@Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); }
StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } }
StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); }
StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); }
StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas);  }