Skip to content

Commit

Permalink
Merge pull request #9489 from hexagontk/main
Browse files Browse the repository at this point in the history
[Kotlin / Hexagon]: Update Hexagon version and dependencies
  • Loading branch information
msmith-techempower authored Jan 7, 2025
2 parents 91c59dc + 11621a4 commit ddd0952
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 29 deletions.
16 changes: 8 additions & 8 deletions frameworks/Kotlin/hexagon/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@

plugins {
id "org.jetbrains.kotlin.jvm" version "2.0.20" apply false
id "org.graalvm.buildtools.native" version "0.10.3" apply false
id "org.jetbrains.kotlin.jvm" version "2.0.21" apply false
id "org.graalvm.buildtools.native" version "0.10.4" apply false
}

version = "1.0.0"
description = "TFB benchmark"
group = "com.hexagonkt"

ext {
hexagonVersion = "3.7.0"
jettyVersion = "12.0.13"
nettyVersion = "4.1.113.Final"
hexagonVersion = "3.7.3"
jettyVersion = "12.0.16"
nettyVersion = "4.1.116.Final"

hikariVersion = "5.1.0"
hikariVersion = "6.2.1"
postgresqlVersion = "42.7.4"
vertxVersion = "4.5.10"
vertxVersion = "4.5.11"
cache2kVersion = "2.6.1.Final"

applicationClass = "com.hexagonkt.BenchmarkKt"
Expand All @@ -30,5 +30,5 @@ subprojects {
}

tasks.wrapper {
gradleVersion = "8.10"
gradleVersion = "8.10.2"
}
Binary file modified frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions frameworks/Kotlin/hexagon/hexagon-helidon-pgclient.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# BUILD
#
FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-22-cds-musl AS build
FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-23-cds-musl AS build
USER root
WORKDIR /hexagon

Expand All @@ -12,7 +12,7 @@ RUN ./gradlew --quiet -x test installDist
#
# RUNTIME
#
FROM docker.io/bellsoft/liberica-runtime-container:jre-22-musl
FROM docker.io/bellsoft/liberica-runtime-container:jre-23-musl
ARG PROJECT=hexagon_helidon_pgclient

ENV POSTGRESQL_DB_HOST tfb-database
Expand Down
4 changes: 2 additions & 2 deletions frameworks/Kotlin/hexagon/hexagon-helidon.dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# BUILD
#
FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-22-cds-musl AS build
FROM docker.io/bellsoft/liberica-runtime-container:jdk-all-23-cds-musl AS build
USER root
WORKDIR /hexagon

Expand All @@ -12,7 +12,7 @@ RUN ./gradlew --quiet -x test installDist
#
# RUNTIME
#
FROM docker.io/bellsoft/liberica-runtime-container:jre-22-musl
FROM docker.io/bellsoft/liberica-runtime-container:jre-23-musl
ARG PROJECT=hexagon_helidon_postgresql

ENV POSTGRESQL_DB_HOST tfb-database
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Kotlin/hexagon/hexagon-tomcat.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN ./gradlew --quiet -x test war
#
# RUNTIME
#
FROM docker.io/tomcat:11.0.0-jre21-temurin-noble
FROM docker.io/tomcat:11-jre21-temurin-noble
ARG MODULE=/hexagon/hexagon_tomcat_postgresql

ENV POSTGRESQL_DB_HOST tfb-database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ class BenchmarkPgClientStore(
) : BenchmarkStore(settings) {

companion object {
private const val SELECT_WORLD: String = "select * from world where id = $1"
private const val LOAD_WORLDS: String = "select id, randomNumber from world"
private const val SELECT_WORLD: String = "select id, randomNumber from world where id = $1"
private const val UPDATE_WORLD: String = "update world set randomNumber = $1 where id = $2"
private const val SELECT_ALL_FORTUNES: String = "select * from fortune"
private const val SELECT_ALL_FORTUNES: String = "select id, message from fortune"
}

private val connectOptions: PgConnectOptions by lazy {
Expand Down Expand Up @@ -81,13 +82,12 @@ class BenchmarkPgClientStore(
.toCompletionStage()
.toCompletableFuture()
.get()

}
}

override fun initWorldsCache(cache: Cache<Int, CachedWorld>) {
dataSource
.preparedQuery("select * from world")
.preparedQuery(LOAD_WORLDS)
.execute()
.map { rowSet ->
rowSet.map { row ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ class BenchmarkSqlStore(
) : BenchmarkStore(settings) {

companion object {
private const val SELECT_WORLD: String = "select * from world where id = ?"
private const val LOAD_WORLDS: String = "select id, randomNumber from world"
private const val SELECT_WORLD: String = "select id, randomNumber from world where id = ?"
private const val UPDATE_WORLD: String = "update world set randomNumber = ? where id = ?"
private const val SELECT_ALL_FORTUNES: String = "select * from fortune"
private const val SELECT_ALL_FORTUNES: String = "select id, message from fortune"
}

private val dataSource: HikariDataSource by lazy {
Expand Down Expand Up @@ -63,27 +64,25 @@ class BenchmarkSqlStore(
override fun replaceWorlds(worlds: List<World>) {
dataSource.connection.use { con: Connection ->
val stmtSelect = con.prepareStatement(SELECT_WORLD)
val stmtUpdate = con.prepareStatement(UPDATE_WORLD)

worlds.forEach {
val worldId = it.id
val newRandomNumber = it.randomNumber

stmtSelect.setInt(1, worldId)
stmtSelect.setInt(1, it.id)
val rs = stmtSelect.executeQuery()
rs.next()
rs.getInt(2) // Read 'randomNumber' to comply with Test type 5, point 6
}

stmtUpdate.setInt(1, newRandomNumber)
stmtUpdate.setInt(2, worldId)
val stmtUpdate = con.prepareStatement(UPDATE_WORLD)
worlds.forEach {
stmtUpdate.setInt(1, it.randomNumber)
stmtUpdate.setInt(2, it.id)
stmtUpdate.executeUpdate()
}
}
}

override fun initWorldsCache(cache: Cache<Int, CachedWorld>) {
dataSource.connection.use { con: Connection ->
val stmtSelect = con.prepareStatement("select * from world")
val stmtSelect = con.prepareStatement(LOAD_WORLDS)
val rs = stmtSelect.executeQuery()

while (rs.next()) {
Expand Down

0 comments on commit ddd0952

Please sign in to comment.