keith-turner commented on code in PR #6040:
URL: https://github.com/apache/accumulo/pull/6040#discussion_r2688589906
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java:
##########
@@ -243,6 +245,26 @@ private SortedKeyValueIterator<Key,Value> createIterator()
} else {
// Scan time iterator options were set, so need to merge those with
pre-parsed table
// iterator options.
+
+ // First ensure the set iterators do not conflict with the existing
table iterators.
+ for (var scanParamIterInfo : scanParams.getSsiList()) {
Review Comment:
Maybe a refactoring like the following could help speed up the scan code.
Maybe `Map<String, IteratorSetting> parsed` will help avoid redundant parsing
work as each scan iterator is checked.
```java
public static void checkIteratorConflicts(Map<String, IteratorSetting>
parsed, IteratorSetting settings) throws AccumuloException {
// parsed is keyed on IteratorSetting.name
var existing = parsed.get(settings.getName());
if(existing != null) {
// TODO check for conflicts like the current code does on unparsed
config
}
}
public static void checkIteratorConflicts2(Map<String,String> props,
IteratorSetting setting,
EnumSet<IteratorScope> scopes)
throws AccumuloException{
for (IteratorScope scope : scopes) {
Map<String, IteratorSetting> parsed = parseIteratorConfig(props,
scope);
checkIteratorConflicts(parsed, setting);
}
}
```
For performance, probably only the scan code really matters when refactoring
this code. Do not really care about the performance of this code for setting
iterators on a table or something like that. Nothing else will be executed as
frequently.
--
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]