You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by mm...@apache.org on 2020/01/16 16:38:11 UTC

[accumulo] branch master updated: Fix predicate for TabletFile in Gatherer

This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new 012d291  Fix predicate for TabletFile in Gatherer
012d291 is described below

commit 012d2912c2aea44b60d5d66b926e14a1d10b56f7
Author: Mike Miller <mm...@apache.org>
AuthorDate: Thu Jan 16 11:37:24 2020 -0500

    Fix predicate for TabletFile in Gatherer
---
 .../main/java/org/apache/accumulo/core/summary/Gatherer.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java b/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
index c7ec879..adaa45d 100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/Gatherer.java
@@ -169,7 +169,7 @@ public class Gatherer {
    *         associated with a file represent the tablets that use the file.
    */
   private Map<String,Map<TabletFile,List<TRowRange>>>
-      getFilesGroupedByLocation(Predicate<String> fileSelector) {
+      getFilesGroupedByLocation(Predicate<TabletFile> fileSelector) {
 
     Iterable<TabletMetadata> tmi = TabletsMetadata.builder().forTable(tableId)
         .overlapping(startRow, endRow).fetch(FILES, LOCATION, LAST, PREV_ROW).build(ctx);
@@ -179,7 +179,7 @@ public class Gatherer {
 
     for (TabletMetadata tm : tmi) {
       for (TabletFile file : tm.getFiles()) {
-        if (fileSelector.test(file.getMetadataEntry())) {
+        if (fileSelector.test(file)) {
           // TODO push this filtering to server side and possibly use batch scanner
           files.computeIfAbsent(file, s -> new ArrayList<>()).add(tm);
         }
@@ -368,9 +368,9 @@ public class Gatherer {
 
     private synchronized void initiateProcessing(ProcessedFiles previousWork) {
       try {
-        Predicate<String> fileSelector =
-            file -> Math.abs(Hashing.murmur3_32().hashString(file, UTF_8).asInt()) % modulus
-                == remainder;
+        Predicate<TabletFile> fileSelector = file -> Math
+            .abs(Hashing.murmur3_32().hashString(file.getNormalizedPath(), UTF_8).asInt()) % modulus
+            == remainder;
         if (previousWork != null) {
           fileSelector = fileSelector.and(previousWork.failedFiles::contains);
         }