assertNull(location.future);
assertEquals(location.current, server);
count++;
}
assertEquals(count, 1);
TabletLocationState assigned = null;
try {
assigned = new TabletLocationState(root, server, null, null, null, false);
} catch (BadLocationStateException e) {
fail("Unexpected error " + e);
}
tstore.unassign(Collections.singletonList(assigned));
count = 0;
for (TabletLocationState location : tstore) {
assertEquals(location.extent, root);
assertNull(location.future);
assertNull(location.current);
count++;
}
assertEquals(count, 1);
KeyExtent notRoot = new KeyExtent(new Text("0"), null, null);
try {
tstore.setLocations(Collections.singletonList(new Assignment(notRoot, server)));
Assert.fail("should not get here");
} catch (IllegalArgumentException ex) {}
try {
tstore.setFutureLocations(Collections.singletonList(new Assignment(notRoot, server)));
Assert.fail("should not get here");
} catch (IllegalArgumentException ex) {}
TabletLocationState broken = null;
try {
broken = new TabletLocationState(notRoot, server, null, null, null, false);
} catch (BadLocationStateException e) {
fail("Unexpected error " + e);
}
try {
tstore.unassign(Collections.singletonList(broken));