Sfoglia il codice sorgente

Merge pull request #9489 from hexagontk/main

[Kotlin / Hexagon]: Update Hexagon version and dependencies
Mike Smith 7 mesi fa
parent
commit
ddd09520c1

+ 8 - 8
frameworks/Kotlin/hexagon/build.gradle

@@ -1,7 +1,7 @@
 
 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"
@@ -9,13 +9,13 @@ 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"
@@ -30,5 +30,5 @@ subprojects {
 }
 
 tasks.wrapper {
-    gradleVersion = "8.10"
+    gradleVersion = "8.10.2"
 }

BIN
frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.jar


+ 1 - 1
frameworks/Kotlin/hexagon/gradle/wrapper/gradle-wrapper.properties

@@ -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

+ 2 - 2
frameworks/Kotlin/hexagon/hexagon-helidon-pgclient.dockerfile

@@ -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
 
@@ -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

+ 2 - 2
frameworks/Kotlin/hexagon/hexagon-helidon.dockerfile

@@ -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
 
@@ -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

+ 1 - 1
frameworks/Kotlin/hexagon/hexagon-tomcat.dockerfile

@@ -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

+ 4 - 4
frameworks/Kotlin/hexagon/store_pgclient/src/main/kotlin/BenchmarkPgClientStore.kt

@@ -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 {
@@ -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 ->

+ 10 - 11
frameworks/Kotlin/hexagon/store_sql/src/main/kotlin/BenchmarkSqlStore.kt

@@ -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 {
@@ -63,19 +64,17 @@ 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()
             }
         }
@@ -83,7 +82,7 @@ class BenchmarkSqlStore(
 
     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()) {