Skip to content

Commit

Permalink
[Enhancement] Allow CN to run script (StarRocks#44982)
Browse files Browse the repository at this point in the history
Signed-off-by: Binglin Chang <[email protected]>
  • Loading branch information
decster authored and node committed May 9, 2024
1 parent ed92273 commit 3b2003e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.starrocks.rpc.BackendServiceClient;
import com.starrocks.server.GlobalStateMgr;
import com.starrocks.sql.ast.ExecuteScriptStmt;
import com.starrocks.system.Backend;
import com.starrocks.system.ComputeNode;
import com.starrocks.thrift.TNetworkAddress;
import groovy.lang.Binding;
import groovy.lang.GroovyShell;
Expand Down Expand Up @@ -79,7 +79,7 @@ private static ShowResultSet executeFrontendScript(ExecuteScriptStmt stmt, Conne
}

private static ShowResultSet executeBackendScript(ExecuteScriptStmt stmt, ConnectContext ctx) throws UserException {
Backend be = GlobalStateMgr.getCurrentState().getNodeMgr().getClusterInfo().getBackend(stmt.getBeId());
ComputeNode be = GlobalStateMgr.getCurrentState().getNodeMgr().getClusterInfo().getBackendOrComputeNode(stmt.getBeId());
if (be == null) {
throw new UserException("node not found: " + stmt.getBeId());
}
Expand Down

0 comments on commit 3b2003e

Please sign in to comment.