Class OcpMongoReplicaSet
java.lang.Object
io.debezium.testing.system.tools.databases.mongodb.sharded.OcpMongoReplicaSet
- All Implemented Interfaces:
AutoCloseable,org.testcontainers.lifecycle.Startable
Mongo replica set. When started, member number 0 is set as primary, root user is created and optionally internal member auth is enabled
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final booleanprivate static final org.slf4j.Loggerprivate final intprivate final List<OcpMongoReplicaSetMember>private final Stringprivate final io.fabric8.openshift.client.OpenShiftClientprivate final OpenShiftUtilsprivate final Stringprivate final Stringprivate final Stringprivate final intprivate booleanprivate final boolean -
Constructor Summary
ConstructorsConstructorDescriptionOcpMongoReplicaSet(String name, boolean configServer, int memberCount, String rootUserName, String rootPassword, io.fabric8.openshift.client.OpenShiftClient ocp, String project, boolean useInternalAuth, int shardNum) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()executeMongosh(String command, boolean debugLogs) execute mongosh command/script on node number 0 (member 0 should always be primary)private StringgetConfigServerServiceName(int replicaNum) private Stringprivate StringgetName()private intgetPort()intprivate StringgetShardReplicaServiceName(int replicaNum) voidstart()voidstop()voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.testcontainers.lifecycle.Startable
close, getDependencies
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
name
-
configServer
private final boolean configServer -
memberCount
private final int memberCount -
authRequired
private boolean authRequired -
rootUserName
-
rootPassword
-
started
private boolean started -
ocp
private final io.fabric8.openshift.client.OpenShiftClient ocp -
ocpUtil
-
project
-
useInternalAuth
private final boolean useInternalAuth -
shardNum
private final int shardNum -
members
-
-
Constructor Details
-
OcpMongoReplicaSet
-
-
Method Details
-
getReplicaSetFullName
-
start
public void start()- Specified by:
startin interfaceorg.testcontainers.lifecycle.Startable
-
stop
public void stop()- Specified by:
stopin interfaceorg.testcontainers.lifecycle.Startable
-
getName
-
getShardNum
public int getShardNum() -
waitForStopped
public void waitForStopped() -
executeMongosh
execute mongosh command/script on node number 0 (member 0 should always be primary)- Parameters:
command-debugLogs- print command and outputs to log- Returns:
- captured outputs from command execution
-
getLocalhostConnectionString
-
getPort
private int getPort() -
getInitRsCommand
- Throws:
IOExceptionfreemarker.template.TemplateException
-
getShardReplicaServiceName
-
getConfigServerServiceName
-
builder
-