File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
src/main/java/com/alipay/oceanbase/rpc Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -2299,6 +2299,16 @@ public ObPayload execute(final ObTableAbstractOperationRequest request) throws E
22992299 if (partIdMapObTable .size () > 1 && !isDistributedExecuteSupported ) {
23002300 throw new ObTablePartitionConsistentException (
23012301 "query and mutate must be a atomic operation" );
2302+ } else if (partIdMapObTable .isEmpty ()) {
2303+ StringBuilder rangeInfo = new StringBuilder ();
2304+ rangeInfo .append ("could not find part id of ranges: [" );
2305+ for (int i = 0 ; i < tableQuery .getKeyRanges ().size (); i ++) {
2306+ if (i > 0 ) rangeInfo .append (", " );
2307+ ObNewRange range = tableQuery .getKeyRanges ().get (i );
2308+ rangeInfo .append (range .getStartKey ().toString ()).append (" - " ).append (range .getEndKey ().toString ());
2309+ }
2310+ rangeInfo .append ("]" );
2311+ throw new ObTableException (rangeInfo .toString ());
23022312 }
23032313 // Proceed with the operation
23042314 Map .Entry <Long , ObTableParam > entry = partIdMapObTable .entrySet ().iterator ().next ();
Original file line number Diff line number Diff line change @@ -135,4 +135,18 @@ public int hashCode() {
135135 return Objects .hashCode (objs );
136136 }
137137
138+ @ Override
139+ public String toString () {
140+ StringBuilder sb = new StringBuilder ();
141+ sb .append ("[" );
142+ for (int i = 0 ; i < objs .size (); i ++) {
143+ if (i > 0 ) {
144+ sb .append (", " );
145+ }
146+ ObObj obj = objs .get (i );
147+ sb .append (obj != null ? obj .toString () : "null" );
148+ }
149+ sb .append ("]" );
150+ return sb .toString ();
151+ }
138152}
You can’t perform that action at this time.
0 commit comments