Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2299,6 +2299,16 @@ public ObPayload execute(final ObTableAbstractOperationRequest request) throws E
if (partIdMapObTable.size() > 1 && !isDistributedExecuteSupported) {
throw new ObTablePartitionConsistentException(
"query and mutate must be a atomic operation");
} else if (partIdMapObTable.isEmpty()) {
StringBuilder rangeInfo = new StringBuilder();
rangeInfo.append("could not find part id of ranges: [");
for (int i = 0; i < tableQuery.getKeyRanges().size(); i++) {
if (i > 0) rangeInfo.append(", ");
ObNewRange range = tableQuery.getKeyRanges().get(i);
rangeInfo.append(range.getStartKey().toString()).append(" - ").append(range.getEndKey().toString());
}
rangeInfo.append("]");
throw new ObTableException(rangeInfo.toString());
}
// Proceed with the operation
Map.Entry<Long, ObTableParam> entry = partIdMapObTable.entrySet().iterator().next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,18 @@ public int hashCode() {
return Objects.hashCode(objs);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[");
for (int i = 0; i < objs.size(); i++) {
if (i > 0) {
sb.append(", ");
}
ObObj obj = objs.get(i);
sb.append(obj != null ? obj.toString() : "null");
}
sb.append("]");
return sb.toString();
}
}