Class AbstractNodeWrapper
java.lang.Object
org.apache.iotdb.it.env.cluster.node.AbstractNodeWrapper
- All Implemented Interfaces:
BaseNodeWrapper
- Direct Known Subclasses:
AINodeWrapper,ConfigNodeWrapper,DataNodeWrapper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PropertiesSpecified by -DClusterConfigurations in commandLine.protected final intprotected final Propertiesprotected final PropertiesImmutable values are connection configurations, such as ip, ports which are generated randomly during cluster initialization.protected Processprotected final booleanprotected final intprotected final MppJVMConfigprotected final Propertiesprotected final PropertiesMutable properties are always hardcoded default values to make the cluster be set up successfully.protected final MppCommonConfigprotected final int[]protected final Stringprotected final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractNodeWrapper(String testClassName, String testMethodName, int[] portList, int clusterIndex, boolean isMultiCluster, long startTime) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddStartCmdParams(List<String> params) final voidchangeConfig(MppBaseConfig nodeConfig, MppCommonConfig commonConfig, MppJVMConfig jvmConfig) Change the config of this node.voidCreateLogDir must be called after changeConfig for correct log directory.voidCreateNodeDir must be called before changeConfig for persistent.voidvoiddumpJVMSnapshot(String testCaseName) voidPerform jstack on the process corresponding to the wrapper, and use logger to output the results.voidexecuteJstack(String testCaseName) Perform jstack on the process corresponding to the wrapper, and output the results to a file in the log directory.protected abstract StringReturn the common config file path specified through system variableprotected abstract StringReturn the node config file path specified through system variablefinal StringgetIp()final Stringprotected StringintlonggetPid()final intgetPort()protected abstract Stringabstract Stringprotected Stringprotected abstract MppJVMConfigbooleanisAlive()protected abstract voidprotected abstract voidvoidsetKillPoints(List<String> killPoints) voidsetPort(int port) voidstart()voidstop()voidprotected StringworkDirFilePath(String dirName, String fileName) 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.BaseNodeWrapper
getId
-
Field Details
-
testClassName
-
testMethodName
-
portList
protected final int[] portList -
jmxPort
protected final int jmxPort -
jvmConfig
-
clusterIndex
protected final int clusterIndex -
isMultiCluster
protected final boolean isMultiCluster -
instance
-
mutableNodeProperties
Mutable properties are always hardcoded default values to make the cluster be set up successfully. Their lifecycles are the same with the whole test runner. -
mutableCommonProperties
-
clusterConfigProperties
Specified by -DClusterConfigurations in commandLine. A name of ClusterConfigurations can be interpreted to a set of configurations below. -
immutableNodeProperties
Immutable values are connection configurations, such as ip, ports which are generated randomly during cluster initialization. Their lifecycles are the same with this node wrapper instance. -
immutableCommonProperties
-
outputCommonConfig
-
-
Constructor Details
-
AbstractNodeWrapper
-
-
Method Details
-
createNodeDir
public void createNodeDir()CreateNodeDir must be called before changeConfig for persistent.- Specified by:
createNodeDirin interfaceBaseNodeWrapper
-
createLogDir
public void createLogDir()CreateLogDir must be called after changeConfig for correct log directory.- Specified by:
createLogDirin interfaceBaseNodeWrapper
-
destroyDir
public void destroyDir()- Specified by:
destroyDirin interfaceBaseNodeWrapper
-
changeConfig
public final void changeConfig(MppBaseConfig nodeConfig, MppCommonConfig commonConfig, @Nullable MppJVMConfig jvmConfig) Change the config of this node. Here's the order of applied config source. The latter one will override the former one if a key is duplicated.- 1. Reading directly from assembled property files of other modules.
- 2. Default values which are hardcoded in mutable properties fields.
- 3. Values read from the path specified by system variables.
- 4. Values mutated by developers through
EnvFactory. - 5. Make sure immutable properties are not changed.
- Parameters:
nodeConfig- the values mutated throughEnvFactorycommonConfig- the values mutated throughEnvFactory.jvmConfig- the JVM configurations need to be changed. If it's null, then nothing will be happened.
-
start
public void start()- Specified by:
startin interfaceBaseNodeWrapper
-
stop
public void stop()- Specified by:
stopin interfaceBaseNodeWrapper
-
stopForcibly
public void stopForcibly()- Specified by:
stopForciblyin interfaceBaseNodeWrapper
-
isAlive
public boolean isAlive()- Specified by:
isAlivein interfaceBaseNodeWrapper
-
getIp
- Specified by:
getIpin interfaceBaseNodeWrapper
-
getPort
public final int getPort()- Specified by:
getPortin interfaceBaseNodeWrapper
-
getMetricPort
public int getMetricPort()- Specified by:
getMetricPortin interfaceBaseNodeWrapper
-
setPort
public void setPort(int port) -
getIpAndPortString
- Specified by:
getIpAndPortStringin interfaceBaseNodeWrapper
-
workDirFilePath
-
getLogPath
-
getLogDirPath
-
getNodePath
-
getDataPath
-
dumpJVMSnapshot
-
getTestLogDirName
-
setKillPoints
-
reloadMutableFields
protected abstract void reloadMutableFields() -
renameFile
protected abstract void renameFile() -
getSystemConfigPath
-
getDefaultNodeConfigPath
Return the node config file path specified through system variable -
getDefaultCommonConfigPath
Return the common config file path specified through system variable -
addStartCmdParams
-
getSystemPropertiesPath
-
initVMConfig
-
executeJstack
public void executeJstack()Description copied from interface:BaseNodeWrapperPerform jstack on the process corresponding to the wrapper, and use logger to output the results.- Specified by:
executeJstackin interfaceBaseNodeWrapper
-
executeJstack
Description copied from interface:BaseNodeWrapperPerform jstack on the process corresponding to the wrapper, and output the results to a file in the log directory.- Specified by:
executeJstackin interfaceBaseNodeWrapper- Parameters:
testCaseName- the name of test case
-
getPid
public long getPid()- Specified by:
getPidin interfaceBaseNodeWrapper- Returns:
- The native process ID of the process, -1 if failure.
-