@Test public void shouldReBalanceTasksAcrossAllClientsWhenCapacityAndTaskCountTheSame() throws Exception { createClientWithPreviousActiveTasks(p3, 1, task00, task01, task02, task03); createClient(p1, 1); createClient(p2, 1); createClient(p4, 1); final StickyTaskAssignor<Integer> taskAssignor = createTaskAssignor(task00, task02, task01, task03); taskAssignor.assign(0); assertThat(clients.get(p1).assignedTaskCount(), equalTo(1)); assertThat(clients.get(p2).assignedTaskCount(), equalTo(1)); assertThat(clients.get(p3).assignedTaskCount(), equalTo(1)); assertThat(clients.get(p4).assignedTaskCount(), equalTo(1)); }
@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);  }