accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [accumulo] branch master updated: Fixes #1618 concurrent merge check in bulk import (#1637)
Date Thu, 09 Jul 2020 15:39:51 GMT
This is an automated email from the ASF dual-hosted git repository.

kturner 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 25a55df  Fixes #1618 concurrent merge check in bulk import (#1637)
25a55df is described below

commit 25a55df2309fc1891ef208e35f2268b254ffb4e8
Author: Craig Scheiderer <cdschei2@gmail.com>
AuthorDate: Thu Jul 9 11:32:51 2020 -0400

    Fixes #1618 concurrent merge check in bulk import (#1637)
---
 .../apache/accumulo/core/clientImpl/bulk/BulkImport.java   | 14 ++++++--------
 .../java/org/apache/accumulo/core/dataImpl/KeyExtent.java  |  8 ++++++++
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java
index 5120333..002f192 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/BulkImport.java
@@ -608,15 +608,13 @@ public class BulkImport implements ImportDestinationArguments, ImportMappingOpti
           continue;
         }
 
-        boolean containsPrevRow = ke.getPrevEndRow() == null || (oke.getPrevEndRow() != null
-            && ke.getPrevEndRow().compareTo(oke.getPrevEndRow()) <= 0);
-        boolean containsEndRow = ke.getEndRow() == null
-            || (oke.getEndRow() != null && ke.getEndRow().compareTo(oke.getEndRow())
>= 0);
-
-        if (containsPrevRow && containsEndRow) {
+        if (ke.contains(oke)) {
           mappings.get(ke).merge(mappings.remove(oke));
-        } else {
-          throw new RuntimeException("TODO handle merges");
+        } else if (!oke.contains(ke)) {
+          throw new RuntimeException("Error during bulk import: Unable to merge overlapping
"
+              + "tablets where neither tablet contains the other. This may be caused by "
+              + "a concurrent merge. Key extents " + oke + " and " + ke + " overlap, but
"
+              + "neither contains the other.");
         }
       }
     }
diff --git a/core/src/main/java/org/apache/accumulo/core/dataImpl/KeyExtent.java b/core/src/main/java/org/apache/accumulo/core/dataImpl/KeyExtent.java
index 5bded9b..c51bcf5 100644
--- a/core/src/main/java/org/apache/accumulo/core/dataImpl/KeyExtent.java
+++ b/core/src/main/java/org/apache/accumulo/core/dataImpl/KeyExtent.java
@@ -457,6 +457,14 @@ public class KeyExtent implements WritableComparable<KeyExtent>
{
     return ke.getTableId();
   }
 
+  public boolean contains(KeyExtent oke) {
+    boolean containsPrevRow = getPrevEndRow() == null
+        || (oke.getPrevEndRow() != null && getPrevEndRow().compareTo(oke.getPrevEndRow())
<= 0);
+    boolean containsEndRow = getEndRow() == null
+        || (oke.getEndRow() != null && getEndRow().compareTo(oke.getEndRow()) >=
0);
+    return containsPrevRow && containsEndRow;
+  }
+
   public boolean contains(final ByteSequence bsrow) {
     if (bsrow == null) {
       throw new IllegalArgumentException(


Mime
View raw message