You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/08/13 02:13:56 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #1676: WIP - convert translators to lambdas

ctubbsii commented on a change in pull request #1676:
URL: https://github.com/apache/accumulo/pull/1676#discussion_r469656145



##########
File path: core/src/main/java/org/apache/accumulo/core/clientImpl/TabletServerBatchReaderIterator.java
##########
@@ -533,15 +535,19 @@ static void trackScanning(Map<KeyExtent,List<Range>> failures,
       Map<KeyExtent,List<Range>> unscanned, MultiScanResult scanResult) {
 
     // translate returned failures, remove them from unscanned, and add them to failures
-    Map<KeyExtent,List<Range>> retFailures = Translator.translate(scanResult.failures,
-        Translators.TKET, new Translator.ListTranslator<>(Translators.TRT));
+         Map<KeyExtent, List<Range>> retFailures = scanResult.failures.entrySet().stream()
+            .collect(Collectors.toMap(
+                    entry -> new KeyExtent(entry.getKey()),
+                    entry -> entry.getValue().stream().map(Range::new).collect(Collectors.toList())
+          ));
+
     unscanned.keySet().removeAll(retFailures.keySet());
     failures.putAll(retFailures);
 
-    // translate full scans and remove them from unscanned
-    HashSet<KeyExtent> fullScans =
-        new HashSet<>(Translator.translate(scanResult.fullScans, Translators.TKET));
-    unscanned.keySet().removeAll(fullScans);
+        // translate full scans and remove them from unscanned
+
+    Set<KeyExtent> fullScans = scanResult.fullScans.stream().map(KeyExtent::new).collect(Collectors.toSet());
+        unscanned.keySet().removeAll(fullScans);

Review comment:
       `mvn compile` may have issues with dependency resolution on the non-java modules (such as the native map module, which doesn't produce a java jar, but rather a tar.gz artifact). A better command, that won't have these issues in dependency resolution between sibling modules is `mvn package -DskipTests`. It does basically the same thing, but ensures that all artifacts are built in sibling modules, so there's no issues resolving non-java dependencies from sibling modules in the multi-module reactor build.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org