File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
src/main/java/com/alipay/oceanbase/rpc Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -4247,12 +4247,19 @@ public ObServerRoute getRoute(boolean readonly) {
42474247 }
42484248
42494249 public ObTableServerCapacity getServerCapacity () {
4250- if (tableRoster .isEmpty ()) {
4251- throw new IllegalStateException ("client is not initialized and obTable is empty" );
4250+ if (isOdpMode ()) {
4251+ if (odpTable == null ) {
4252+ throw new IllegalStateException ("client is not initialized and obTable is empty" );
4253+ }
4254+ return odpTable .getServerCapacity ();
4255+ } else {
4256+ if (tableRoster == null || tableRoster .isEmpty ()) {
4257+ throw new IllegalStateException ("client is not initialized and obTable is empty" );
4258+ }
4259+ Iterator <ObTable > iterator = tableRoster .values ().iterator ();
4260+ ObTable firstObTable = iterator .next ();
4261+ return firstObTable .getServerCapacity ();
42524262 }
4253- Iterator <ObTable > iterator = tableRoster .values ().iterator ();
4254- ObTable firstObTable = iterator .next ();
4255- return firstObTable .getServerCapacity ();
42564263 }
42574264
42584265 public void setOdpAddr (String odpAddr ) {
You can’t perform that action at this time.
0 commit comments