Class RemoteServerEnv
java.lang.Object
org.apache.iotdb.it.env.remote.env.RemoteServerEnv
- All Implemented Interfaces:
BaseEnv
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDestroy the cluster and all the configurations.dataNodeIdToWrapper(int nodeId) voidvoidensureNodeStatus(List<BaseNodeWrapper> nodes, List<NodeStatus> targetStatus) Ensure all the nodes being in the corresponding status.Get aConfigNodeWrapperrandomly.Get aDataNodeWrapperrandomly.Return theClusterConfigfor developers to set values before test.getConfigNodeWrapper(int index) Get theConfigNodeWrapperof the specified index.getConnection(String username, String password) getConnection(DataNodeWrapper dataNodeWrapper, String username, String password) getConnection(Constant.Version version, String username, String password) getConnectionWithSpecifiedDataNode(DataNodeWrapper dataNode, String username, String password) getDataNodeWrapper(int index) Get theDataNodeWrapperof the specified index.intGet the index of the first dataNode with a SchemaRegion leader.getIP()intGet the index of the ConfigNode leader.getMetricPrometheusReporterContents(String authHeader) Return the content of prometheusintgetPort()getSessionConnection(String userName, String password) getSessionConnection(ZoneId zoneId) getSessionConnection(List<String> nodeUrls) getSessionPool(int maxSize) getWriteOnlyConnectionWithSpecifiedDataNode(DataNodeWrapper dataNode, String username, String password) voidInit a cluster with default number of ConfigNodes and DataNodes.voidinitClusterEnvironment(int configNodesNum, int dataNodesNum) Init a cluster with the specified number of ConfigNodes and DataNodes.voidinitClusterEnvironment(int configNodesNum, int dataNodesNum, int testWorkingRetryCount) Init a cluster with the specified number of ConfigNodes and DataNodes.voidregisterConfigNodeKillPoints(List<String> killPoints) voidregisterDataNodeKillPoints(List<String> killPoints) voidregisterNewConfigNode(boolean isNeedVerify) Register a new ConfigNode with random ports.voidregisterNewConfigNode(ConfigNodeWrapper newConfigNodeWrapper, boolean isNeedVerify) Register a new DataNode with specified ConfigNodeWrapper.voidregisterNewDataNode(boolean isNeedVerify) Register a new DataNode with random ports.voidregisterNewDataNode(DataNodeWrapper newDataNodeWrapper, boolean isNeedVerify) Register a new DataNode with specified DataNodeWrapper.voidsetTestMethodName(String testCaseName) voidShutdown all existed ConfigNodes.voidShutdown all existed DataNodes.voidshutdownConfigNode(int index) Shutdown an existed ConfigNode.voidshutdownDataNode(int index) Shutdown an existed DataNode.voidvoidShutdown forcibly all existed DataNodes.voidStart all existed ConfigNodes.voidStart all existed DataNodes.voidstartConfigNode(int index) Start an existed ConfigNode.voidstartDataNode(int index) Start an existed DataNode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.iotdb.itbase.env.BaseEnv
getConfigNodeConnection, getConnection, getConnection, getConnectionWithSpecifiedDataNode, getUrlContent, getWriteOnlyConnectionWithSpecifiedDataNode
-
Constructor Details
-
RemoteServerEnv
public RemoteServerEnv()
-
-
Method Details
-
initClusterEnvironment
public void initClusterEnvironment()Description copied from interface:BaseEnvInit a cluster with default number of ConfigNodes and DataNodes.- Specified by:
initClusterEnvironmentin interfaceBaseEnv
-
initClusterEnvironment
public void initClusterEnvironment(int configNodesNum, int dataNodesNum) Description copied from interface:BaseEnvInit a cluster with the specified number of ConfigNodes and DataNodes.- Specified by:
initClusterEnvironmentin interfaceBaseEnv- Parameters:
configNodesNum- the number of ConfigNodes.dataNodesNum- the number of DataNodes.
-
initClusterEnvironment
public void initClusterEnvironment(int configNodesNum, int dataNodesNum, int testWorkingRetryCount) Description copied from interface:BaseEnvInit a cluster with the specified number of ConfigNodes and DataNodes.- Specified by:
initClusterEnvironmentin interfaceBaseEnv- Parameters:
configNodesNum- the number of ConfigNodes.dataNodesNum- the number of DataNodes.testWorkingRetryCount- the retry count when testing the availability of cluster
-
cleanClusterEnvironment
public void cleanClusterEnvironment()Description copied from interface:BaseEnvDestroy the cluster and all the configurations.- Specified by:
cleanClusterEnvironmentin interfaceBaseEnv
-
getConfig
Description copied from interface:BaseEnvReturn theClusterConfigfor developers to set values before test. -
getMetricPrometheusReporterContents
Description copied from interface:BaseEnvReturn the content of prometheus- Specified by:
getMetricPrometheusReporterContentsin interfaceBaseEnv
-
getConnection
- Specified by:
getConnectionin interfaceBaseEnv- Throws:
SQLException
-
getWriteOnlyConnectionWithSpecifiedDataNode
public Connection getWriteOnlyConnectionWithSpecifiedDataNode(DataNodeWrapper dataNode, String username, String password) - Specified by:
getWriteOnlyConnectionWithSpecifiedDataNodein interfaceBaseEnv
-
getConnectionWithSpecifiedDataNode
public Connection getConnectionWithSpecifiedDataNode(DataNodeWrapper dataNode, String username, String password) throws SQLException - Specified by:
getConnectionWithSpecifiedDataNodein interfaceBaseEnv- Throws:
SQLException
-
getConnection
public Connection getConnection(Constant.Version version, String username, String password) throws SQLException - Specified by:
getConnectionin interfaceBaseEnv- Throws:
SQLException
-
getConnection
public Connection getConnection(DataNodeWrapper dataNodeWrapper, String username, String password) throws SQLException - Specified by:
getConnectionin interfaceBaseEnv- Throws:
SQLException
-
setTestMethodName
- Specified by:
setTestMethodNamein interfaceBaseEnv
-
dumpTestJVMSnapshot
public void dumpTestJVMSnapshot()- Specified by:
dumpTestJVMSnapshotin interfaceBaseEnv
-
getNodeWrapperList
- Specified by:
getNodeWrapperListin interfaceBaseEnv
-
getConfigNodeWrapperList
- Specified by:
getConfigNodeWrapperListin interfaceBaseEnv
-
getDataNodeWrapperList
- Specified by:
getDataNodeWrapperListin interfaceBaseEnv
-
getLeaderConfigNodeConnection
- Specified by:
getLeaderConfigNodeConnectionin interfaceBaseEnv- Throws:
ClientManagerException
-
getSessionPool
- Specified by:
getSessionPoolin interfaceBaseEnv
-
getSessionConnection
- Specified by:
getSessionConnectionin interfaceBaseEnv- Throws:
IoTDBConnectionException
-
getSessionConnection
- Specified by:
getSessionConnectionin interfaceBaseEnv- Throws:
IoTDBConnectionException
-
getSessionConnection
public ISession getSessionConnection(String userName, String password) throws IoTDBConnectionException - Specified by:
getSessionConnectionin interfaceBaseEnv- Throws:
IoTDBConnectionException
-
getSessionConnection
- Specified by:
getSessionConnectionin interfaceBaseEnv- Throws:
IoTDBConnectionException
-
getFirstLeaderSchemaRegionDataNodeIndex
public int getFirstLeaderSchemaRegionDataNodeIndex()Description copied from interface:BaseEnvGet the index of the first dataNode with a SchemaRegion leader.- Specified by:
getFirstLeaderSchemaRegionDataNodeIndexin interfaceBaseEnv- Returns:
- The index of DataNode with SchemaRegion-leader in dataNodeWrapperList
-
getLeaderConfigNodeIndex
public int getLeaderConfigNodeIndex()Description copied from interface:BaseEnvGet the index of the ConfigNode leader.- Specified by:
getLeaderConfigNodeIndexin interfaceBaseEnv- Returns:
- The index of ConfigNode-Leader in configNodeWrapperList
-
startConfigNode
public void startConfigNode(int index) Description copied from interface:BaseEnvStart an existed ConfigNode.- Specified by:
startConfigNodein interfaceBaseEnv
-
startAllConfigNodes
public void startAllConfigNodes()Description copied from interface:BaseEnvStart all existed ConfigNodes.- Specified by:
startAllConfigNodesin interfaceBaseEnv
-
shutdownConfigNode
public void shutdownConfigNode(int index) Description copied from interface:BaseEnvShutdown an existed ConfigNode.- Specified by:
shutdownConfigNodein interfaceBaseEnv
-
shutdownAllConfigNodes
public void shutdownAllConfigNodes()Description copied from interface:BaseEnvShutdown all existed ConfigNodes.- Specified by:
shutdownAllConfigNodesin interfaceBaseEnv
-
shutdownForciblyAllConfigNodes
public void shutdownForciblyAllConfigNodes()- Specified by:
shutdownForciblyAllConfigNodesin interfaceBaseEnv
-
ensureNodeStatus
Description copied from interface:BaseEnvEnsure all the nodes being in the corresponding status.- Specified by:
ensureNodeStatusin interfaceBaseEnv- Parameters:
nodes- the nodes list to query.targetStatus- the targetNodeStatusof each node. It should have the same length with nodes.
-
generateRandomConfigNodeWrapper
Description copied from interface:BaseEnvGet aConfigNodeWrapperrandomly.- Specified by:
generateRandomConfigNodeWrapperin interfaceBaseEnv- Returns:
- A random available ConfigNodeWrapper
-
generateRandomDataNodeWrapper
Description copied from interface:BaseEnvGet aDataNodeWrapperrandomly.- Specified by:
generateRandomDataNodeWrapperin interfaceBaseEnv- Returns:
- A random available ConfigNodeWrapper
-
getConfigNodeWrapper
Description copied from interface:BaseEnvGet theConfigNodeWrapperof the specified index.- Specified by:
getConfigNodeWrapperin interfaceBaseEnv- Returns:
- The ConfigNodeWrapper of the specified index
-
getDataNodeWrapper
Description copied from interface:BaseEnvGet theDataNodeWrapperof the specified index.- Specified by:
getDataNodeWrapperin interfaceBaseEnv- Returns:
- The DataNodeWrapper of the specified index
-
registerNewDataNode
public void registerNewDataNode(boolean isNeedVerify) Description copied from interface:BaseEnvRegister a new DataNode with random ports.- Specified by:
registerNewDataNodein interfaceBaseEnv
-
registerNewConfigNode
public void registerNewConfigNode(boolean isNeedVerify) Description copied from interface:BaseEnvRegister a new ConfigNode with random ports.- Specified by:
registerNewConfigNodein interfaceBaseEnv
-
registerNewDataNode
Description copied from interface:BaseEnvRegister a new DataNode with specified DataNodeWrapper.- Specified by:
registerNewDataNodein interfaceBaseEnv
-
registerNewConfigNode
Description copied from interface:BaseEnvRegister a new DataNode with specified ConfigNodeWrapper.- Specified by:
registerNewConfigNodein interfaceBaseEnv
-
startDataNode
public void startDataNode(int index) Description copied from interface:BaseEnvStart an existed DataNode.- Specified by:
startDataNodein interfaceBaseEnv
-
startAllDataNodes
public void startAllDataNodes()Description copied from interface:BaseEnvStart all existed DataNodes.- Specified by:
startAllDataNodesin interfaceBaseEnv
-
shutdownDataNode
public void shutdownDataNode(int index) Description copied from interface:BaseEnvShutdown an existed DataNode.- Specified by:
shutdownDataNodein interfaceBaseEnv
-
shutdownAllDataNodes
public void shutdownAllDataNodes()Description copied from interface:BaseEnvShutdown all existed DataNodes.- Specified by:
shutdownAllDataNodesin interfaceBaseEnv
-
shutdownForciblyAllDataNodes
public void shutdownForciblyAllDataNodes()Description copied from interface:BaseEnvShutdown forcibly all existed DataNodes.- Specified by:
shutdownForciblyAllDataNodesin interfaceBaseEnv
-
getMqttPort
public int getMqttPort()- Specified by:
getMqttPortin interfaceBaseEnv
-
getIP
-
getPort
-
getSbinPath
- Specified by:
getSbinPathin interfaceBaseEnv
-
getToolsPath
- Specified by:
getToolsPathin interfaceBaseEnv
-
getLibPath
- Specified by:
getLibPathin interfaceBaseEnv
-
dataNodeIdToWrapper
- Specified by:
dataNodeIdToWrapperin interfaceBaseEnv
-
registerConfigNodeKillPoints
- Specified by:
registerConfigNodeKillPointsin interfaceBaseEnv
-
registerDataNodeKillPoints
- Specified by:
registerDataNodeKillPointsin interfaceBaseEnv
-