@Test public void shouldAssignEachActiveTaskToOneClientWhenMoreClientsThanTasks() throws Exception { createClient(p1, 1); createClient(p2, 1); createClient(p3, 1); createClient(p4, 1); createClient(5, 1); createClient(6, 1); final StickyTaskAssignor<Integer> taskAssignor = createTaskAssignor(task00, task01, task02); taskAssignor.assign(0); assertThat(allActiveTasks(), equalTo(Arrays.asList(task00, task01, task02))); }
@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);  }