Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Dec 21, 2023
1 parent 5b1bbf7 commit 54927d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,30 @@ trait WithStarRocksContainer extends WithJdbcServerContainer {

private val starrocksDockerImage = "starrocks/allin1-ubuntu:3.1.6"

private val STARROCKS_FE_PORT = 9030
private val STARROCKS_FE_MYSQL_PORT = 9030
private val STARROCKS_FE_HTTP_PORT = 8030
private val STARROCKS_BE_THRIFT_PORT = 9060
private val STARROCKS_BE_HTTP_PORT = 8040
private val STARROCKS_BE_HEARTBEAT_PORT = 9050
private val ports = Seq(
STARROCKS_FE_MYSQL_PORT,
STARROCKS_FE_HTTP_PORT,
STARROCKS_BE_THRIFT_PORT,
STARROCKS_BE_HTTP_PORT,
STARROCKS_BE_HEARTBEAT_PORT)

override val containerDef: GenericContainer.Def[GenericContainer] = GenericContainer.Def(
dockerImage = starrocksDockerImage,
exposedPorts = Seq(STARROCKS_FE_PORT),
exposedPorts = ports,
waitStrategy = new WaitAllStrategy().withStartupTimeout(Duration.ofMinutes(10))
.withStrategy(Wait.forListeningPorts(STARROCKS_FE_PORT))
.withStrategy(Wait.forListeningPorts(ports: _*))
.withStrategy(forLogMessage(".*broker service already added into FE service.*", 1))
.withStrategy(
forLogMessage(".*Enjoy the journal to StarRocks blazing-fast lake-house engine.*", 1)))

protected def feUrl: String = withContainers { container =>
protected def feJdbcUrl: String = withContainers { container =>
val queryServerHost: String = container.host
val queryServerPort: Int = container.mappedPort(STARROCKS_FE_PORT)
val url = s"$queryServerHost:$queryServerPort"
url
val queryServerPort: Int = container.mappedPort(STARROCKS_FE_MYSQL_PORT)
s"jdbc:mysql://$queryServerHost:$queryServerPort"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ trait WithStarRocksEngine extends WithJdbcEngine with WithStarRocksContainer {

override def withKyuubiConf: Map[String, String] = Map(
ENGINE_SHARE_LEVEL.key -> "SERVER",
ENGINE_JDBC_CONNECTION_URL.key -> s"jdbc:mysql://$feUrl",
ENGINE_JDBC_CONNECTION_URL.key -> feJdbcUrl,
ENGINE_JDBC_CONNECTION_USER.key -> user,
ENGINE_JDBC_CONNECTION_PASSWORD.key -> password,
ENGINE_TYPE.key -> "jdbc",
Expand Down

0 comments on commit 54927d3

Please sign in to comment.