dlmarion commented on a change in pull request #2186:
URL: https://github.com/apache/accumulo/pull/2186#discussion_r662211853
##########
File path: core/src/main/java/org/apache/accumulo/core/conf/Property.java
##########
@@ -1171,120 +1201,70 @@
"This property is deprecated since 2.0.0, use
tserver.scan.executors.meta.threads instead. "
+ "The maximum number of concurrent metadata read ahead that will
execute.");
- private String key;
- private String defaultValue;
- private String description;
+ private static final EnumSet<Property> fixedProperties = EnumSet.of(
+ // port options
+ GC_PORT, MANAGER_CLIENTPORT, TSERV_CLIENTPORT,
+
+ // tserver cache options
+ TSERV_CACHE_MANAGER_IMPL, TSERV_DATACACHE_SIZE, TSERV_INDEXCACHE_SIZE,
+ TSERV_SUMMARYCACHE_SIZE,
+
+ // others
+ TSERV_NATIVEMAP_ENABLED, TSERV_SCAN_MAX_OPENFILES);
+ private static final HashSet<String> validTableProperties;
+ private static final HashSet<String> validProperties;
+ private static final HashSet<String> validPrefixes;
+ private static final HashMap<String,Property> propertiesByKey;
+
+ static {
+ // Precomputing information here avoids :
+ // * Computing it each time a method is called
+ // * Using synch to compute the first time a method is called
+ propertiesByKey = new HashMap<>();
+ validPrefixes = new HashSet<>();
+ validProperties = new HashSet<>();
+
+ for (Property p : Property.values()) {
+ if (p.getType().equals(PropertyType.PREFIX)) {
+ validPrefixes.add(p.getKey());
+ } else {
+ validProperties.add(p.getKey());
Review comment:
I think you can add the following here and remove the loop at line 1237:
```
if (p.getKey().startsWith(Property.TABLE_PREFIX.getKey())) {
validTableProperties.add(p.getKey());
}
```
--
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]