From 31d3464779bd4937512f0aa0d791873012fe0df3 Mon Sep 17 00:00:00 2001 From: Radovan Zvoncek Date: Mon, 28 Oct 2024 16:36:22 +0200 Subject: [PATCH] Strip away any units, not just MiB --- .../com/datastax/montecristo/model/application/CassandraYaml.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/montecristo/src/main/kotlin/com/datastax/montecristo/model/application/CassandraYaml.kt b/montecristo/src/main/kotlin/com/datastax/montecristo/model/application/CassandraYaml.kt index fda806a..07ba580 100644 --- a/montecristo/src/main/kotlin/com/datastax/montecristo/model/application/CassandraYaml.kt +++ b/montecristo/src/main/kotlin/com/datastax/montecristo/model/application/CassandraYaml.kt @@ -32,7 +32,7 @@ data class CassandraYaml(val data : JsonNode) : YamlConfig(data) { val memtableAllocationType get() = get("memtable_allocation_type") val authorizer get() = get("authorizer") val rowCacheSizeInMB get() = ( - get("row_cache_size", "0").replace("MiB", "") + get("row_cache_size", "0").replace("\\D+".toRegex(), "") ).toInt() fun isRowCacheEnabled(): Boolean { return (rowCacheSizeInMB.toString().toInt() > 0)