@InterfaceAudience.Private
  public static LockRequest buildLockRequest(final LockType type, final String namespace,
    final TableName tableName, final List<RegionInfo> regionInfos, final String description,
    final long nonceGroup, final long nonce) {
    final LockRequest.Builder builder =
      LockRequest.newBuilder().setLockType(type).setNonceGroup(nonceGroup).setNonce(nonce);
    if (regionInfos != null) {
      for (RegionInfo hri : regionInfos) {
        builder.addRegionInfo(ProtobufUtil.toRegionInfo(hri));
      }
    } else if (namespace != null) {
      builder.setNamespace(namespace);
    } else if (tableName != null) {
      builder.setTableName(ProtobufUtil.toProtoTableName(tableName));
    }
    return builder.setDescription(description).build();
  }
Create a new EntityLock object to acquire exclusive lock on multiple regions of same tables.
Internally, the table and its namespace will also be locked in shared mode.
hbase-server/src/main/java/org/apache/hadoop/hbase/client/locking/LockServiceClient.java