accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mjw...@apache.org
Subject accumulo git commit: ACCUMULO-4657 - backport to 1.7
Date Tue, 20 Jun 2017 20:42:55 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.7 ede9daee0 -> bc557247a


ACCUMULO-4657 - backport to 1.7


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/bc557247
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/bc557247
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/bc557247

Branch: refs/heads/1.7
Commit: bc557247a65cc6dbdcb49e97ed6594d54da547f9
Parents: ede9dae
Author: Michael Wall <mjwall@apache.org>
Authored: Tue Jun 20 16:15:21 2017 -0400
Committer: Michael Wall <mjwall@apache.org>
Committed: Tue Jun 20 16:15:21 2017 -0400

----------------------------------------------------------------------
 .../apache/accumulo/server/util/MetadataTableUtil.java | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/bc557247/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
index 0832769..f7fd31f 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
@@ -23,6 +23,7 @@ import static org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSec
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
@@ -908,12 +909,14 @@ public class MetadataTableUtil {
     mscanner.setRange(new KeyExtent(new Text(tableId), null, null).toMetadataRange());
     mscanner.fetchColumnFamily(TabletsSection.BulkFileColumnFamily.NAME);
     BatchWriter bw = conn.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig());
+    byte[] tidAsBytes = Long.toString(tid).getBytes(UTF_8);
     for (Entry<Key,Value> entry : mscanner) {
-      log.debug("Looking at entry " + entry + " with tid " + tid);
-      if (Long.parseLong(entry.getValue().toString()) == tid) {
-        log.debug("deleting entry " + entry);
-        Mutation m = new Mutation(entry.getKey().getRow());
-        m.putDelete(entry.getKey().getColumnFamily(), entry.getKey().getColumnQualifier());
+      log.trace("Looking at entry {} with tid {}", entry, tid);
+      if (Arrays.equals(entry.getValue().get(), tidAsBytes)) {
+        log.trace("deleting entry {}", entry);
+        Key key = entry.getKey();
+        Mutation m = new Mutation(key.getRow());
+        m.putDelete(key.getColumnFamily(), key.getColumnQualifier());
         bw.addMutation(m);
       }
     }


Mime
View raw message