Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Region & Remove Region & Reconstruct Region #14634

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.apache.iotdb.it.env;

import org.apache.iotdb.it.env.cluster.env.AIEnv;
import org.apache.iotdb.it.env.cluster.env.AbstractEnv;
import org.apache.iotdb.it.env.cluster.env.Cluster1Env;
import org.apache.iotdb.it.env.cluster.env.SimpleEnv;
import org.apache.iotdb.it.env.remote.env.RemoteServerEnv;
Expand Down Expand Up @@ -75,4 +76,8 @@ public static BaseEnv getEnv() {
}
return env;
}

public static AbstractEnv getAbstractEnv() {
return (AbstractEnv) getEnv();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ private Map<String, Integer> countNodeStatus(final Map<Integer, String> nodeStat
return result;
}

public void checkNodeInStatus(int nodeId, NodeStatus expectation) {
checkClusterStatus(nodeStatusMap -> expectation.getStatus().equals(nodeStatusMap.get(nodeId)));
}

public void checkClusterStatusWithoutUnknown() {
checkClusterStatus(
nodeStatusMap -> nodeStatusMap.values().stream().noneMatch("Unknown"::equals));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public String getLogDirPath() {
+ getTimeForLogDirectory(startTime);
}

@Override
String getNodeType() {
return "ainode";
}

@Override
public void start() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,18 @@ public String getNodePath() {
return System.getProperty(USER_DIR) + File.separator + TARGET + File.separator + getId();
}

public String getDataPath() {
return getNodePath()
+ File.separator
+ IoTDBConstant.DATA_FOLDER_NAME
+ File.separator
+ getNodeType()
+ File.separator
+ IoTDBConstant.DATA_FOLDER_NAME;
}

abstract String getNodeType();

public void dumpJVMSnapshot(String testCaseName) {
JMXServiceURL url;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ protected void addStartCmdParams(final List<String> params) {
"-s"));
}

@Override
String getNodeType() {
return "confignode";
}

@Override
protected void reloadMutableFields() {
mutableCommonProperties.setProperty(CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS, SIMPLE_CONSENSUS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ protected void addStartCmdParams(final List<String> params) {
"-s"));
}

@Override
String getNodeType() {
return "datanode";
}

@Override
protected void reloadMutableFields() {
mutableCommonProperties.setProperty(CONFIG_NODE_CONSENSUS_PROTOCOL_CLASS, SIMPLE_CONSENSUS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.junit.Before;

public class IoTDBRegionMigrateDataNodeCrashITFrameworkForIoTV1
extends IoTDBRegionMigrateReliabilityITFramework {
extends IoTDBRegionOperationReliabilityITFramework {

@Override
@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.iotdb.commons.utils.KillPoint.KillNode;

public class IoTDBRegionMigrateDataNodeCrashITFrameworkForIoTV2
extends IoTDBRegionMigrateReliabilityITFramework {
extends IoTDBRegionOperationReliabilityITFramework {

@SafeVarargs
public final <T extends Enum<T>> void success(T... dataNodeKillPoints) throws Exception {
Expand Down
Loading
Loading