mnpoonia commented on code in PR #6638:
URL: https://github.com/apache/hbase/pull/6638#discussion_r1932464869


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java:
##########
@@ -636,8 +636,16 @@ public static Put makePutFromRegionInfo(RegionInfo 
regionInfo) throws IOExceptio
    * @throws IllegalArgumentException when the provided RegionInfo is not the 
default replica.
    */
   public static Put makePutFromRegionInfo(RegionInfo regionInfo, long ts) 
throws IOException {
-    return addRegionInfo(new 
Put(CatalogFamilyFormat.getMetaKeyForRegion(regionInfo), ts),
-      regionInfo);
+    byte[] metaKeyForRegion = 
CatalogFamilyFormat.getMetaKeyForRegion(regionInfo);
+    try {
+      Put put = new Put(metaKeyForRegion, ts);
+      return addRegionInfo(put, regionInfo);
+    } catch (IllegalArgumentException ex) {

Review Comment:
   We want to catch IllegalArgumentException because that is what our code 
throws
   ```
   public Put(byte[] rowArray, int rowOffset, int rowLength, long ts) {
       checkRow(rowArray, rowOffset, rowLength);
       this.row = Bytes.copy(rowArray, rowOffset, rowLength);
       this.ts = ts;
       if (ts < 0) {
         throw new IllegalArgumentException("Timestamp cannot be negative. ts=" 
+ ts);
       }
     }
   ```
   
   And it is a RunTime exception not compile time like IOException. 



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to