|
62 | 62 | import static com.alipay.oceanbase.rpc.location.model.TableEntry.HBASE_ROW_KEY_ELEMENT; |
63 | 63 | import static com.alipay.oceanbase.rpc.location.model.partition.ObPartIdCalculator.*; |
64 | 64 | import static com.alipay.oceanbase.rpc.property.Property.*; |
| 65 | +import static com.alipay.oceanbase.rpc.protocol.payload.Constants.INVALID_TABLET_ID; |
65 | 66 | import static com.alipay.oceanbase.rpc.protocol.payload.impl.execute.ObTableOperationType.*; |
66 | 67 | import static com.alipay.oceanbase.rpc.util.TableClientLoggerFactory.*; |
67 | 68 | import static java.lang.String.format; |
@@ -3763,15 +3764,17 @@ public ObPayload execute(final ObTableAbstractOperationRequest request) throws E |
3763 | 3764 | } |
3764 | 3765 |
|
3765 | 3766 | // Check if partIdMapObTable size is greater than 1 |
3766 | | - if (partIdMapObTable.size() > 1 && !getServerCapacity().isSupportDistributedExecute()) { |
| 3767 | + boolean isDistributedExecuteSupported = getServerCapacity().isSupportDistributedExecute(); |
| 3768 | + if (partIdMapObTable.size() > 1 && !isDistributedExecuteSupported) { |
3767 | 3769 | throw new ObTablePartitionConsistentException( |
3768 | 3770 | "query and mutate must be a atomic operation"); |
3769 | 3771 | } |
3770 | 3772 | // Proceed with the operation |
3771 | 3773 | Map.Entry<Long, ObTableParam> entry = partIdMapObTable.entrySet().iterator().next(); |
3772 | 3774 | ObTableParam tableParam = entry.getValue(); |
3773 | 3775 | request.setTableId(tableParam.getTableId()); |
3774 | | - request.setPartitionId(tableParam.getPartitionId()); |
| 3776 | + long partitionId = isDistributedExecuteSupported ? INVALID_TABLET_ID : tableParam.getPartitionId(); |
| 3777 | + request.setPartitionId(partitionId); |
3775 | 3778 | request.setTimeout(tableParam.getObTable().getObTableOperationTimeout()); |
3776 | 3779 | ObTable obTable = tableParam.getObTable(); |
3777 | 3780 |
|
|
0 commit comments