Repository: hbase
Updated Branches:
  refs/heads/HBASE-14070.HLC 7a42c38ef -> 45bb4f0a5


HBASE-18385 Enable HLC on meta, default for all other tables (Sai Teja Ranuva)

Change-Id: Ieab08197af49a0ccfb2357c4bf982a14f704e2d2


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

Branch: refs/heads/HBASE-14070.HLC
Commit: 45bb4f0a56178b9c073ba268e3a6636aa7f5ae71
Parents: 7a42c38
Author: Amit Patel <iamnota...@gmail.com>
Authored: Mon Jul 17 12:01:55 2017 -0700
Committer: Apekshit Sharma <a...@apache.org>
Committed: Mon Jul 17 12:09:13 2017 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/hbase/HTableDescriptor.java  | 2 ++
 .../apache/hadoop/hbase/client/TableDescriptorBuilder.java   | 7 ++++++-
 .../org/apache/hadoop/hbase/util/FSTableDescriptors.java     | 1 +
 .../java/org/apache/hadoop/hbase/TestClockWithCluster.java   | 8 ++++----
 4 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/45bb4f0a/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
index c865255..c272b1d 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java
@@ -71,6 +71,8 @@ public class HTableDescriptor implements TableDescriptor, 
Comparable<HTableDescr
   public static final int DEFAULT_REGION_REPLICATION = 
TableDescriptorBuilder.DEFAULT_REGION_REPLICATION;
   public static final boolean DEFAULT_REGION_MEMSTORE_REPLICATION = 
TableDescriptorBuilder.DEFAULT_REGION_MEMSTORE_REPLICATION;
   public static final ClockType DEFAULT_CLOCK_TYPE = 
TableDescriptorBuilder.DEFAULT_CLOCK_TYPE;
+  public static final ClockType DEFAULT_META_CLOCK_TYPE =
+      TableDescriptorBuilder.DEFAULT_META_CLOCK_TYPE;
   protected final ModifyableTableDescriptor delegatee;
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/45bb4f0a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
----------------------------------------------------------------------
diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
index 2e8d3e9..d40ce2b 100644
--- 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
+++ 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
@@ -159,11 +159,16 @@ public class TableDescriptorBuilder {
   private static final Durability DEFAULT_DURABLITY = Durability.USE_DEFAULT;
 
   /**
-   * Default clock type for HTD is SYSTEM
+   * Default clock type for HTableDescriptor is SYSTEM
    */
   @InterfaceAudience.Private
   public static final ClockType DEFAULT_CLOCK_TYPE = ClockType.SYSTEM;
 
+  /**
+   * Default clock type for HTD is HLC
+   */
+  public static final ClockType DEFAULT_META_CLOCK_TYPE = ClockType.HLC;
+
   @InterfaceAudience.Private
   public static final String PRIORITY = "PRIORITY";
   private static final Bytes PRIORITY_KEY

http://git-wip-us.apache.org/repos/asf/hbase/blob/45bb4f0a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
index dcd3144..78ebda5 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
@@ -191,6 +191,7 @@ public class FSTableDescriptors implements TableDescriptors 
{
             .setCacheDataInL1(true))
           
.addCoprocessor("org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint",
             null, Coprocessor.PRIORITY_SYSTEM, null)
+          .setClockType(HTableDescriptor.DEFAULT_META_CLOCK_TYPE)
           .build());
   }
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/45bb4f0a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClockWithCluster.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClockWithCluster.java 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClockWithCluster.java
index 228c5df..572a128 100644
--- 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClockWithCluster.java
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestClockWithCluster.java
@@ -94,22 +94,22 @@ public class TestClockWithCluster {
   }
 
   @Test
-  public void testMetaTableClockTypeIsSystem() throws IOException {
+  public void testMetaTableClockTypeIsHLC() throws IOException {
     Admin admin = connection.getAdmin();
     Table table = connection.getTable(TableName.META_TABLE_NAME);
     ClockType clockType = 
admin.getTableDescriptor(TableName.META_TABLE_NAME).getClockType();
-    assertEquals(ClockType.SYSTEM, clockType);
+    assertEquals(ClockType.HLC, clockType);
   }
 
   @Test
-  public void testMetaTableTimestampsAreSystem() throws IOException {
+  public void testMetaTableTimestampsAreHLC() throws IOException {
     // Checks timestamps of whatever is present in meta table currently.
     // ToDo: Include complete meta table sample with all column families to 
check all paths of
     // meta table modification.
     Table table = connection.getTable(TableName.META_TABLE_NAME);
     Result result = table.getScanner(new Scan()).next();
     for (Cell cell : result.rawCells()) {
-      assertTrue(TimestampType.PHYSICAL.isLikelyOfType(cell.getTimestamp()));
+      assertTrue(TimestampType.HYBRID.isLikelyOfType(cell.getTimestamp()));
     }
   }
 }
\ No newline at end of file

Reply via email to