dlmarion commented on code in PR #3294:
URL: https://github.com/apache/accumulo/pull/3294#discussion_r1168700724
##########
test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java:
##########
@@ -102,86 +123,140 @@ public void test() throws Exception {
c.tableOperations().flush(tableName, null, null, true);
TabletLocationState flushed = getTabletLocationState(c, tableId);
- assertEquals(newTablet.current, flushed.current);
+ assertNotNull(flushed.current);
assertEquals(flushed.getCurrentServer(), flushed.getLastServer());
assertNull(newTablet.future);
+ assertEquals(TabletHostingGoal.ONDEMAND, flushed.goal);
// take the tablet offline
c.tableOperations().offline(tableName, true);
TabletLocationState offline = getTabletLocationState(c, tableId);
assertNull(offline.future);
assertNull(offline.current);
assertEquals(flushed.getCurrentServer(), offline.getLastServer());
+ assertEquals(TabletHostingGoal.ONDEMAND, offline.goal);
// put it back online
c.tableOperations().online(tableName, true);
TabletLocationState online = getTabletLocationState(c, tableId);
assertNull(online.future);
assertNotNull(online.current);
assertEquals(online.getCurrentServer(), online.getLastServer());
+ assertEquals(TabletHostingGoal.ONDEMAND, online.goal);
- // take the tablet offline
- c.tableOperations().offline(tableName, true);
- offline = getTabletLocationState(c, tableId);
- assertNull(offline.future);
- assertNull(offline.current);
- assertEquals(flushed.getCurrentServer(), offline.getLastServer());
+ // set the hosting goal to always
+ c.tableOperations().setTabletHostingGoal(tableName, new Range(),
TabletHostingGoal.ALWAYS);
+ TabletLocationState always;
+ do {
+ UtilWaitThread.sleep(250);
+ always = getTabletLocationState(c, tableId);
+ } while (always.goal == TabletHostingGoal.ONDEMAND);
+
+ assertNull(always.future);
+ assertNotNull(always.current);
+ assertEquals(flushed.getCurrentServer(), always.getLastServer());
+ assertEquals(TabletHostingGoal.ALWAYS, always.goal);
+
+ // set the hosting goal to never
+ c.tableOperations().setTabletHostingGoal(tableName, new Range(),
TabletHostingGoal.NEVER);
+ TabletLocationState never;
+ do {
+ UtilWaitThread.sleep(250);
+ never = getTabletLocationState(c, tableId);
+ } while (never.goal == TabletHostingGoal.ALWAYS);
Review Comment:
Suggestion applied in cd223b6
##########
test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java:
##########
@@ -102,86 +123,140 @@ public void test() throws Exception {
c.tableOperations().flush(tableName, null, null, true);
TabletLocationState flushed = getTabletLocationState(c, tableId);
- assertEquals(newTablet.current, flushed.current);
+ assertNotNull(flushed.current);
assertEquals(flushed.getCurrentServer(), flushed.getLastServer());
assertNull(newTablet.future);
+ assertEquals(TabletHostingGoal.ONDEMAND, flushed.goal);
// take the tablet offline
c.tableOperations().offline(tableName, true);
TabletLocationState offline = getTabletLocationState(c, tableId);
assertNull(offline.future);
assertNull(offline.current);
assertEquals(flushed.getCurrentServer(), offline.getLastServer());
+ assertEquals(TabletHostingGoal.ONDEMAND, offline.goal);
// put it back online
c.tableOperations().online(tableName, true);
TabletLocationState online = getTabletLocationState(c, tableId);
assertNull(online.future);
assertNotNull(online.current);
assertEquals(online.getCurrentServer(), online.getLastServer());
+ assertEquals(TabletHostingGoal.ONDEMAND, online.goal);
- // take the tablet offline
- c.tableOperations().offline(tableName, true);
- offline = getTabletLocationState(c, tableId);
- assertNull(offline.future);
- assertNull(offline.current);
- assertEquals(flushed.getCurrentServer(), offline.getLastServer());
+ // set the hosting goal to always
+ c.tableOperations().setTabletHostingGoal(tableName, new Range(),
TabletHostingGoal.ALWAYS);
+ TabletLocationState always;
+ do {
+ UtilWaitThread.sleep(250);
+ always = getTabletLocationState(c, tableId);
+ } while (always.goal == TabletHostingGoal.ONDEMAND);
Review Comment:
Suggestion applied in cd223b6
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]