cshannon commented on code in PR #4323:
URL: https://github.com/apache/accumulo/pull/4323#discussion_r1509286816
##########
server/manager/src/test/java/org/apache/accumulo/manager/tableOps/split/UpdateTabletsTest.java:
##########
@@ -47,6 +75,33 @@ FileUtil.FileInfo newFileInfo(String start, String end) {
return new FileUtil.FileInfo(new Text(start), new Text(end));
}
+ /**
+ * This is a set of tablet metadata columns that the split code is known to
handle. The purpose of
+ * the set is to detect when a new tablet metadata column was added without
considering the
+ * implications for splitting tablets. For a column to be in this set it
means an Accumulo
+ * developer has determined that split code can handle that column OR has
opened an issue about
+ * handling it.
+ */
+ private static final Set<ColumnType> COLUMNS_HANDLED_BY_SPLIT =
+ EnumSet.of(ColumnType.TIME, ColumnType.LOGS, ColumnType.FILES,
ColumnType.PREV_ROW,
+ ColumnType.OPID, ColumnType.LOCATION, ColumnType.ECOMP,
ColumnType.SELECTED,
+ ColumnType.LOADED, ColumnType.USER_COMPACTION_REQUESTED,
ColumnType.MERGED,
+ ColumnType.LAST, ColumnType.SCANS, ColumnType.DIR,
ColumnType.CLONED, ColumnType.FLUSH_ID,
+ ColumnType.FLUSH_NONCE, ColumnType.SUSPEND, ColumnType.AVAILABILITY,
+ ColumnType.HOSTING_REQUESTED, ColumnType.COMPACTED);
+
+ /**
+ * The purpose of this test is to catch new tablet metadata columns that
were added w/o
+ * considering splitting tablets.
+ */
+ @Test
+ public void checkColumns() {
+ for (ColumnType columnType : ColumnType.values()) {
+ assertTrue(COLUMNS_HANDLED_BY_SPLIT.contains(columnType),
Review Comment:
I don't know if this is easily possible with EasyMock but I was wondering if
the mock API supports a way to check that all methods have been mocked with
expectations? I suppose we could just use reflection to iterate over the
methods and check each one, but I'm curious if there's just a simpler way to
check the mocked object has methods that haven't been mocked so we could throw
an error if new methods showed up but were not mocked with a return value,
which would of course imply it was not considered.
--
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]