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 #807 Refactor KeyExtent.toMetadataRange to use TabletSection (#818)
Date Fri, 04 Jan 2019 14:21:04 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 42c5029  fixes #807 Refactor KeyExtent.toMetadataRange to use TabletSection (#818)
42c5029 is described below

commit 42c50298383512a7794e85613d7e0b50cfbdfa8b
Author: Jeffrey L. Zeiberg <Jeffrey.Zeiberg@asrcfederal.com>
AuthorDate: Fri Jan 4 09:00:27 2019 -0500

    fixes #807 Refactor KeyExtent.toMetadataRange to use TabletSection (#818)
---
 .../main/java/org/apache/accumulo/core/dataImpl/KeyExtent.java   | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

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 2d88103..bc94b06 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
@@ -60,6 +60,7 @@ public class KeyExtent implements WritableComparable<KeyExtent> {
   private Text textPrevEndRow;
 
   private static final Table.ID EMPTY_ID = Table.ID.of("");
+  private static final Text EMPTY_TEXT = new Text("");
 
   private void check() {
 
@@ -495,11 +496,9 @@ public class KeyExtent implements WritableComparable<KeyExtent>
{
   }
 
   public Range toMetadataRange() {
-    Text metadataPrevRow = new Text(getTableId().getUtf8());
-    metadataPrevRow.append(new byte[] {';'}, 0, 1);
-    if (getPrevEndRow() != null) {
-      metadataPrevRow.append(getPrevEndRow().getBytes(), 0, getPrevEndRow().getLength());
-    }
+
+    Text metadataPrevRow = TabletsSection.getRow(getTableId(),
+        getPrevEndRow() == null ? EMPTY_TEXT : getPrevEndRow());
 
     return new Range(metadataPrevRow, getPrevEndRow() == null, getMetadataEntry(), true);
   }


Mime
View raw message