keith-turner commented on code in PR #4327:
URL: https://github.com/apache/accumulo/pull/4327#discussion_r1509144267
##########
test/src/main/java/org/apache/accumulo/test/fate/accumulo/AccumuloStoreIT.java:
##########
@@ -202,4 +203,21 @@ private void injectStatus(ClientContext client, String
table, FateId fateId, TSt
}
}
+ protected static void createFateTable(ClientContext client, String table)
throws Exception {
+ final var fateTableProps =
+
client.tableOperations().getTableProperties(AccumuloTable.FATE.tableName());
+ client.tableOperations().create(table);
+
+ // Use modifyProperties() instead of trying to set the properties as part
of
+ // initial table create and using NewTableConfiguration(). The reason is
that
+ // the create operation sets extra properties as well, and by using
modifyProperties()
+ // we can clear all existing properties first, so we end up with an
identical config
+ // to the real FATE user instance table.
+ var testFateTableProps = client.tableOperations().modifyProperties(table,
existing -> {
+ existing.clear();
+ existing.putAll(fateTableProps);
+ });
+
Review Comment:
Its nice to set the props at table creation time so there is no need to
worry about eventual consistency isssues of when the tserver actually notices
the change. Could do something like the following. We could also duplicate the
tablet availability settings.
```suggestion
TabletAvailability availability;
try(var tabletStream =
client.tableOperations().getTabletInformation(AccumuloTable.FATE.tableName(),
new Range())){
availability =
tabletStream.map(TabletInformation::getTabletAvailability).distinct().collect(MoreCollectors.onlyElement());
}
var newTableConf = new
NewTableConfiguration().withInitialTabletAvailability(availability).withoutDefaultIterators().setProperties(fateTableProps);
client.tableOperations().create(table, newTableConf);
final var testFateTableProps =
client.tableOperations().getTableProperties(table);
// ensure that create table did not set any other props
```
--
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]