dlmarion commented on code in PR #2665:
URL: https://github.com/apache/accumulo/pull/2665#discussion_r939063078
##########
core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java:
##########
@@ -153,6 +162,56 @@ private static <T> Supplier<T>
memoizeWithExpiration(Supplier<T> s) {
return () -> Suppliers.memoizeWithExpiration(s::get, 100,
MILLISECONDS).get();
}
+ private ScanServerSelector createScanServerSelector() {
+ String clazz =
ClientProperty.SCAN_SERVER_SELECTOR.getValue(info.getProperties());
+ try {
+ Class<? extends ScanServerSelector> impl =
+ Class.forName(clazz).asSubclass(ScanServerSelector.class);
+ ScanServerSelector scanServerSelector =
impl.getDeclaredConstructor().newInstance();
+
+ Map<String,String> sserverProps = new HashMap<>();
+ ClientProperty
+ .getPrefix(info.getProperties(),
ClientProperty.SCAN_SERVER_SELECTOR_OPTS_PREFIX.getKey())
+ .forEach((k, v) -> {
+ sserverProps.put(
+ k.toString()
+
.substring(ClientProperty.SCAN_SERVER_SELECTOR_OPTS_PREFIX.getKey().length()),
+ v.toString());
+ });
Review Comment:
This returns Map<Object,Object>, not Map<String,String>, so it doesn't work.
Do you have an alternative implementation?
```
Map<String,String> sserverProps = ClientProperty
.getPrefix(info.getProperties(),
ClientProperty.SCAN_SERVER_SELECTOR_OPTS_PREFIX.getKey())
.entrySet()
.stream()
.collect(Collectors.toMap(e -> String.valueOf(e.getKey()), e ->
String.valueOf(e.getvalue()),
(prev, next) -> next, HashMap::new));
```
--
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]