z3n3r commented on a change in pull request #2445:
URL: https://github.com/apache/hbase/pull/2445#discussion_r506774952



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionInfoBuilder.java
##########
@@ -33,6 +33,25 @@
   public static final RegionInfo UNDEFINED =
     RegionInfoBuilder.newBuilder(TableName.valueOf("__UNDEFINED__")).build();
 
+  /**
+   * RegionInfo for first root region
+   * You cannot use this builder to make an instance of the {@link 
#ROOT_REGIONINFO}.
+   * Just refer to this instance. Also, while the instance is actually a 
MutableRI, its type is
+   * just RI so the mutable methods are not available (unless you go casting); 
it appears
+   * as immutable (I tried adding Immutable type but it just makes a mess).
+   *
+   * We are using the non-legacy encoding format to reduce the boilerplace code
+   */
+  public static final RegionInfo ROOT_REGIONINFO =
+    new MutableRegionInfo(TableName.ROOT_TABLE_NAME,
+      HConstants.EMPTY_START_ROW,
+      HConstants.EMPTY_END_ROW,
+      false,
+      0,
+      RegionInfo.DEFAULT_REPLICA_ID,
+      false);

Review comment:
       That would be in the table schema. Should still be changeable. I didn't 
not remove support.

##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionInfoBuilder.java
##########
@@ -33,6 +33,25 @@
   public static final RegionInfo UNDEFINED =
     RegionInfoBuilder.newBuilder(TableName.valueOf("__UNDEFINED__")).build();
 
+  /**
+   * RegionInfo for first root region
+   * You cannot use this builder to make an instance of the {@link 
#ROOT_REGIONINFO}.
+   * Just refer to this instance. Also, while the instance is actually a 
MutableRI, its type is
+   * just RI so the mutable methods are not available (unless you go casting); 
it appears
+   * as immutable (I tried adding Immutable type but it just makes a mess).
+   *
+   * We are using the non-legacy encoding format to reduce the boilerplace code
+   */
+  public static final RegionInfo ROOT_REGIONINFO =
+    new MutableRegionInfo(TableName.ROOT_TABLE_NAME,
+      HConstants.EMPTY_START_ROW,
+      HConstants.EMPTY_END_ROW,
+      false,
+      0,
+      RegionInfo.DEFAULT_REPLICA_ID,
+      false);

Review comment:
       That would be in the table schema?  Should still be changeable. I didn't 
remove support.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to