Skip to content

Commit 9acf1e9

Browse files
authored
Fix conflict config plan type (#17260)
* fix_conflict_plan_type * remove unused enum * remove unused enum
1 parent 9424778 commit 9acf1e9

4 files changed

Lines changed: 45 additions & 4 deletions

File tree

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/consensus/request/ConfigPhysicalPlanType.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ public enum ConfigPhysicalPlanType {
135135
CreateUserWithRawPassword((short) 638),
136136
UpdateUserMaxSession((short) 639),
137137
UpdateUserMinSession((short) 640),
138-
AccountUnlock((short) 641),
139138

140139
/** Table Author */
141140
RCreateUser((short) 641),

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/auth/AuthorPlanExecutor.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ public TSStatus executeAuthorNonQuery(AuthorTreePlan authorPlan) {
147147
case DropRole:
148148
authorizer.deleteRole(roleName);
149149
break;
150-
case AccountUnlock:
151-
break;
152150
case GrantRole:
153151
for (int permission : permissions) {
154152
PrivilegeType priv = PrivilegeType.values()[permission];

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/executor/ConfigPlanExecutor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,6 @@ public TSStatus executeNonQueryPlan(ConfigPhysicalPlan physicalPlan)
459459
case DropUser:
460460
case DropUserV2:
461461
case DropRole:
462-
case AccountUnlock:
463462
case GrantRole:
464463
case GrantUser:
465464
case GrantRoleToUser:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.iotdb.confignode.consensus.request;
21+
22+
import org.junit.Test;
23+
24+
import java.util.HashMap;
25+
import java.util.Map;
26+
27+
import static org.junit.Assert.fail;
28+
29+
public class ConfigPhysicalPlanTypeTest {
30+
31+
@Test
32+
public void checkUniqueness() {
33+
Map<Short, ConfigPhysicalPlanType> map = new HashMap<>();
34+
for (ConfigPhysicalPlanType value : ConfigPhysicalPlanType.values()) {
35+
if (map.containsKey(value.getPlanType())) {
36+
fail(
37+
String.format(
38+
"%s and %s have the same type number %s",
39+
map.get(value.getPlanType()), value, value.getPlanType()));
40+
} else {
41+
map.put(value.getPlanType(), value);
42+
}
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)