ctubbsii commented on code in PR #5485:
URL: https://github.com/apache/accumulo/pull/5485#discussion_r2048104173
##########
server/base/src/main/java/org/apache/accumulo/server/compaction/FileCompactor.java:
##########
@@ -346,10 +346,21 @@ public CompactionStats call()
// have compacted, or in the case of cloned tables where one
// of the tables has compacted the input file but the other
// has not.
- String dropCachePrefixProperty =
+ final String dropCachePrefixProperty =
acuTableConf.get(Property.TABLE_COMPACTION_INPUT_DROP_CACHE_BEHIND);
- final EnumSet<FileTypePrefix> dropCacheFilePrefixes =
- FileTypePrefix.typesFromList(dropCachePrefixProperty);
+ final EnumSet<FileTypePrefix> dropCacheFileTypes;
+ if (dropCachePrefixProperty.equalsIgnoreCase("ALL")) {
+ dropCacheFileTypes = EnumSet.allOf(FileTypePrefix.class);
+ } else if (dropCachePrefixProperty.equalsIgnoreCase("NON-IMPORT")) {
+ dropCacheFileTypes = EnumSet.of(FileTypePrefix.FLUSH,
FileTypePrefix.FULL_COMPACTION,
+ FileTypePrefix.COMPACTION,
FileTypePrefix.MERGING_MINOR_COMPACTION);
+ } else if (dropCachePrefixProperty.equalsIgnoreCase("NONE")) {
+ dropCacheFileTypes = EnumSet.noneOf(FileTypePrefix.class);
+ } else {
+ throw new IllegalArgumentException("Invalid value for property "
+ + Property.TABLE_COMPACTION_INPUT_DROP_CACHE_BEHIND.getKey()
+ + " expected one of ALL, NONE, or NON-IMPORT");
+ }
Review Comment:
I was going to put this in ConfigurationTypeHelper in my code review
suggestions commit, but couldn't because the FileTypePrefix is not in the core
module. Here is fine, but if this code ends up getting used in more places,
it'd be nice to put the conversion in a central place. ConfigurationTypeHelper
is generally the place we put conversions from the String properties to the
concrete objects the strings represent (like instantiating a class from the
property value containing a class name)
--
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]