Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dataroaring committed Sep 14, 2024
1 parent 9e53e68 commit 1bbff3c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ShowCloudWarmUpStmt extends ShowStmt implements NotFallbackInParser
private boolean showAllJobs = false;
private long jobId = -1;

private static final ImmutableList<String> COMPUTE_GROUP_TITLE_NAMES = new ImmutableList.Builder<String>()
private static final ImmutableList<String> WARM_UP_JOB_TITLE_NAMES = new ImmutableList.Builder<String>()
.add("JobId")
.add("ComputeGroup")
.add("Status")
Expand Down Expand Up @@ -116,7 +116,7 @@ public String toString() {
@Override
public ShowResultSetMetaData getMetaData() {
ShowResultSetMetaData.Builder builder = ShowResultSetMetaData.builder();
for (String title : ShowCloudWarmUpStmt.COMPUTE_GROUP_TITLE_NAMES) {
for (String title : ShowCloudWarmUpStmt.WARM_UP_JOB_TITLE_NAMES) {
builder.addColumn(new Column(title, ScalarType.createVarchar(30)));
}
return builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ public String getCloudInstanceId() {
@Override
public void initialize(String[] args) throws Exception {
if (Strings.isNullOrEmpty(Config.cloud_unique_id) && Config.cluster_id == -1) {
throw new UserException("cluser_id must be specified in fe.conf if deployed "
+ "in dissaggregated, because fe should known to which it belongs");
throw new UserException("cluster_id must be specified in fe.conf if deployed "
+ "in cloud mode, because FE should known to which it belongs");
}

if (Strings.isNullOrEmpty(Config.cloud_unique_id)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ public void dropFrontend(FrontendNodeType role, String host, int editLogPort) th

private String tryCreateComputeGroup(String clusterName, String clusterId) throws UserException {
if (Strings.isNullOrEmpty(((CloudEnv) Env.getCurrentEnv()).getCloudInstanceId())) {
throw new DdlException("unable to create cluster due to empty cloud_instance_id");
throw new DdlException("unable to create compute group due to empty cluster_id");
}

Cloud.ClusterPB clusterPB = Cloud.ClusterPB.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ suite("test_grant_revoke_cluster_to_user", "cloud_auth") {
sql """create user ${user3} identified by 'Cloud12345'"""
sql """GRANT SELECT_PRIV ON *.*.* TO '${user3}'@'%'"""
result = connect(user = "${user3}", password = 'Cloud12345', url = context.config.jdbcUrl) {
sql """SHOW COMPUTE GROUPS"""
sql """SHOW CLUSTERS"""
}
// not grant any cluster to user3
assertTrue(result.isEmpty())
Expand All @@ -119,7 +119,7 @@ suite("test_grant_revoke_cluster_to_user", "cloud_auth") {

// admin role user can grant cluster to use
result = connect(user = "${user1}", password = 'Cloud12345', url = context.config.jdbcUrl) {
sql """GRANT USAGE_PRIV ON COMPUTE GROUP '${cluster1}' TO '${user1}'"""
sql """GRANT USAGE_PRIV ON CLUSTER '${cluster1}' TO '${user1}'"""
}

// case run user(default root), and show grant again, should be same result
Expand Down Expand Up @@ -177,7 +177,7 @@ suite("test_grant_revoke_cluster_to_user", "cloud_auth") {
}

sql """SET PROPERTY FOR '${user2}' 'default_cloud_cluster' = '${validCluster}'"""
result = sql """REVOKE USAGE_PRIV ON COMPUTE GROUP '${validCluster}' FROM '${user2}'"""
result = sql """REVOKE USAGE_PRIV ON CLUSTER '${validCluster}' FROM '${user2}'"""
assertEquals(result[0][0], 0)
connect(user = "${user2}", password = 'Cloud12345', url = context.config.jdbcUrl) {
test {
Expand Down

0 comments on commit 1bbff3c

Please sign in to comment.