Skip to content

Commit

Permalink
Addressed gpang's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yupeng9 committed Aug 26, 2015
1 parent 376bf31 commit e3a4177
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Expand Up @@ -57,8 +57,8 @@ public synchronized void addWorker(long workerId, int tierAlias) {
mWorkerIdToAlias.put(workerId, tierAlias);
}

public int removeWorker(long workerId) {
return mWorkerIdToAlias.remove(workerId);
public void removeWorker(long workerId) {
mWorkerIdToAlias.remove(workerId);
}

public Set<Long> getWorkers() {
Expand Down
Expand Up @@ -40,6 +40,8 @@ public void addWorkerTest() {
Assert.assertEquals(0, mInfo.getWorkers().size());
mInfo.addWorker(1, StorageLevelAlias.MEM.getValue());
Assert.assertTrue(mInfo.getWorkers().contains(1L));
mInfo.addWorker(1, StorageLevelAlias.MEM.getValue());
Assert.assertEquals(1, mInfo.getWorkers().size());
}

@Test
Expand All @@ -48,6 +50,10 @@ public void removeWorkerTest() {
Assert.assertTrue(mInfo.getWorkers().contains(1L));
mInfo.removeWorker(1);
Assert.assertEquals(0, mInfo.getWorkers().size());

// remove nonexiting worker.
mInfo.removeWorker(1);
Assert.assertEquals(0, mInfo.getWorkers().size());
}

@Test
Expand Down

0 comments on commit e3a4177

Please sign in to comment.