Skip to content

Commit

Permalink
Simplifying the config
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeep6189 committed Oct 16, 2023
1 parent 4a78fc4 commit d87bc6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ final class FilodbSettings(val conf: Config) {

lazy val minNumNodes = config.as[Option[Int]]("min-num-nodes-in-cluster")

lazy val akkaPort = allConfig.as[Option[Int]]("akka.remote.netty.tcp.port")

/**
* Returns IngestionConfig/dataset configuration from parsing dataset-configs file paths.
* If those are empty, then parse the "streams" config key for inline configs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,10 @@ class FiloDbClusterDiscovery(settings: FilodbSettings,

lazy private val hostNames = {
require(settings.minNumNodes.isDefined, "[ClusterV2] Minimum Number of Nodes config not provided")
if (settings.k8sHostFormat.isDefined && settings.akkaPort.isDefined) {
if (settings.k8sHostFormat.isDefined) {
// This is used in kubernetes setup. We read the host format config and resolve the FQDN using env variables
val hosts = (0 until settings.minNumNodes.get)
.map(i => {
val currentHostname = String.format(
settings.k8sHostFormat.get,
i.toString
)
s"${currentHostname}:${settings.akkaPort.get}"
})
.map(i => String.format(settings.k8sHostFormat.get, i.toString))
logger.info(s"[ClusterV2] hosts to communicate: " + hosts)
hosts.sorted
} else if (settings.hostList.isDefined) {
Expand Down

0 comments on commit d87bc6a

Please sign in to comment.