[ https://issues.apache.org/jira/browse/HBASE-17980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16163562#comment-16163562 ]
stack commented on HBASE-17980: ------------------------------- [~brandboat] Ok if i move these static methods from RegionInfoBuilder to the RegionInfo Interface? 335 /** 336 * Gets the table name from the specified region name. 337 * @param regionName to extract the table name from 338 * @return Table name 339 */ 340 public static TableName getTable(final byte [] regionName) { 341 int offset = -1; 342 for (int i = 0; i < regionName.length; i++) { 343 if (regionName[i] == HConstants.DELIMITER) { 344 offset = i; 345 break; 346 } 347 } 348 byte[] buff = new byte[offset]; 349 System.arraycopy(regionName, 0, buff, 0, offset); 350 return TableName.valueOf(buff); 351 } 352 353 /** 354 * Gets the start key from the specified region name. 355 * @param regionName 356 * @return Start key. 357 * @throws java.io.IOException 358 */ 359 public static byte[] getStartKey(final byte[] regionName) throws IOException { 360 return parseRegionName(regionName)[1]; 361 } etc... Otherwise the patch is great. > Any HRegionInfo we give out should be immutable > ----------------------------------------------- > > Key: HBASE-17980 > URL: https://issues.apache.org/jira/browse/HBASE-17980 > Project: HBase > Issue Type: Sub-task > Affects Versions: 2.0.0 > Reporter: Chia-Ping Tsai > Assignee: Kuan-Po Tseng > Labels: beginner > Fix For: 2.0.0 > > Attachments: HBASE-17980.master.v0.patch, > HBASE-17980.master.v1.patch, HBASE-17980-master.v2.patch, > HBASE-17980-master.v2.patch > > > This is similar to HBASE-15583. > # Introduce RegionInfo class. HRegionInfo will extend RegionInfo. > # Deprecate HRegionInfo to be removed in 3.0 > # RegionInfo contain all of the read-only methods of HRegionInfo > # Add "RegionInfo Builder" -- This message was sent by Atlassian JIRA (v6.4.14#64029)