dlmarion commented on code in PR #4693:
URL: https://github.com/apache/accumulo/pull/4693#discussion_r1650988577
##########
test/src/main/java/org/apache/accumulo/test/functional/BulkNewIT.java:
##########
@@ -755,6 +759,68 @@ public void testExceptionInMetadataUpdate() throws
Exception {
}
}
+ /*
+ * Test bulk importing to tablets with different availability settings. For
hosted tablets bulk
+ * import should refresh them.
+ */
+ @Test
+ public void testAvailability() throws Exception {
+ try (AccumuloClient c =
Accumulo.newClient().from(getClientProps()).build()) {
+ String dir = getDir("/testBulkFile-");
+ FileSystem fs = getCluster().getFileSystem();
+ fs.mkdirs(new Path(dir));
+
+ addSplits(c, tableName, "0100 0200 0300 0400 0500");
+
+ c.tableOperations().setTabletAvailability(tableName, new Range("0100",
false, "0200", true),
+ TabletAvailability.HOSTED);
+ c.tableOperations().setTabletAvailability(tableName, new Range("0300",
false, "0400", true),
+ TabletAvailability.HOSTED);
+ c.tableOperations().setTabletAvailability(tableName, new Range("0400",
false, null, true),
+ TabletAvailability.UNHOSTED);
+
+ // verify tablet availabilities are as expected
+ var seenAvailabilites =
c.tableOperations().getTabletInformation(tableName, new Range())
+ .collect(Collectors.toMap(ti -> {
+ var er = ti.getTabletId().getEndRow();
+ return er == null ? "NULL" : er.toString();
+ }, TabletInformation::getTabletAvailability));
+ assertEquals(Map.of("0100", TabletAvailability.ONDEMAND, "0200",
TabletAvailability.HOSTED,
+ "0300", TabletAvailability.ONDEMAND, "0400",
TabletAvailability.HOSTED, "0500",
+ TabletAvailability.UNHOSTED, "NULL", TabletAvailability.UNHOSTED),
seenAvailabilites);
+
+ // create files that straddle tables w/ different Availability settings
+ writeData(dir + "/f1.", aconf, 0, 150);
+ writeData(dir + "/f2.", aconf, 151, 250);
+ writeData(dir + "/f3.", aconf, 251, 350);
+ writeData(dir + "/f4.", aconf, 351, 450);
+ writeData(dir + "/f5.", aconf, 451, 550);
+
+ c.tableOperations().importDirectory(dir).to(tableName).load();
Review Comment:
Should we re-verify that tablet availability after import? Or does bulk
import host all of the tablets?
--
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]