Skip to content

Commit

Permalink
HBASE-29097 Add error logging when put creation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mnpoonia committed Jan 28, 2025
1 parent 2daf846 commit 0cc31dd
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
LOG.error(
"Got exception while creating put for regioninfo {}." + "meta key for regioninfo is {}",
regionInfo.getRegionNameAsString(), metaKeyForRegion);
throw ex;
}
}

/**
Expand Down

0 comments on commit 0cc31dd

Please sign in to comment.