use of org.apache.hadoop.ozone.om.response.CleanupTableInfo in project ozone by apache.
the class OzoneManagerDoubleBuffer method addCleanupEntry.
private void addCleanupEntry(DoubleBufferEntry entry, Map<String, List<Long>> cleanupEpochs) {
Class<? extends OMClientResponse> responseClass = entry.getResponse().getClass();
CleanupTableInfo cleanupTableInfo = responseClass.getAnnotation(CleanupTableInfo.class);
if (cleanupTableInfo != null) {
String[] cleanupTables;
if (cleanupTableInfo.cleanupAll()) {
cleanupTables = Arrays.stream(new OMDBDefinition().getColumnFamilies()).map(DBColumnFamilyDefinition::getTableName).toArray(String[]::new);
} else {
cleanupTables = cleanupTableInfo.cleanupTables();
}
for (String table : cleanupTables) {
cleanupEpochs.computeIfAbsent(table, list -> new ArrayList<>()).add(entry.getTrxLogIndex());
}
} else {
// add CleanupTableInfo annotation.
throw new RuntimeException("CleanupTableInfo Annotation is missing " + "for" + responseClass);
}
}
Aggregations