hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject hbase git commit: HBASE-13502 - Deprecate/remove getRowComparator() in TableName (Ram)
Date Wed, 22 Apr 2015 04:06:43 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.1 9c62dadf9 -> 96553e19d


HBASE-13502 - Deprecate/remove getRowComparator() in TableName (Ram)


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

Branch: refs/heads/branch-1.1
Commit: 96553e19d2ed1281296bb61bcb5db8200b436f21
Parents: 9c62dad
Author: ramkrishna <ramkrishna.s.vasudevan@gmail.com>
Authored: Wed Apr 22 09:36:12 2015 +0530
Committer: ramkrishna <ramkrishna.s.vasudevan@gmail.com>
Committed: Wed Apr 22 09:36:12 2015 +0530

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/client/MetaCache.java  | 8 +++++++-
 .../src/main/java/org/apache/hadoop/hbase/TableName.java     | 4 ++++
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/96553e19/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaCache.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaCache.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaCache.java
index 0f59b8a..8daaac9 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaCache.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/MetaCache.java
@@ -31,6 +31,8 @@ import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HRegionLocation;
+import org.apache.hadoop.hbase.KeyValue;
+import org.apache.hadoop.hbase.KeyValue.KVComparator;
 import org.apache.hadoop.hbase.RegionLocations;
 import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.TableName;
@@ -84,7 +86,7 @@ public class MetaCache {
     // checking is actually the last region in the table.
     byte[] endKey = possibleRegion.getRegionLocation().getRegionInfo().getEndKey();
     if (Bytes.equals(endKey, HConstants.EMPTY_END_ROW) ||
-        tableName.getRowComparator().compareRows(
+        getRowComparator(tableName).compareRows(
             endKey, 0, endKey.length, row, 0, row.length) > 0) {
       return possibleRegion;
     }
@@ -93,6 +95,10 @@ public class MetaCache {
     return null;
   }
 
+  private KVComparator getRowComparator(TableName tableName) {
+    return TableName.META_TABLE_NAME.equals(tableName) ? KeyValue.META_COMPARATOR
+        : KeyValue.COMPARATOR;
+  }
   /**
    * Put a newly discovered HRegionLocation into the cache.
    * @param tableName The table name.

http://git-wip-us.apache.org/repos/asf/hbase/blob/96553e19/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
index 34c8155..55254a9 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/TableName.java
@@ -513,7 +513,11 @@ public final class TableName implements Comparable<TableName> {
    * Get the appropriate row comparator for this table.
    *
    * @return The comparator.
+   * @deprecated The comparator is an internal property of the table. Should
+   * not have been exposed here
    */
+  @InterfaceAudience.Private
+  @Deprecated
   public KVComparator getRowComparator() {
      if(TableName.META_TABLE_NAME.equals(this)) {
       return KeyValue.META_COMPARATOR;


Mime
View raw message