<commit_before>package de.htwg.zeta.common.cluster

import akka.actor.ActorPath
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.AddressFromURIString
import akka.actor.RootActorPath
import akka.cluster.client.ClusterClient
import akka.cluster.client.ClusterClientSettings
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory

/**
 */
object ClusterManager {
  val clusterPathPrefix = "akka.tcp://ClusterSystem@"

  def getJournalPath(port: Int, seeds: List[String]): ActorPath = {
    if (seeds.isEmpty) {
      ActorPath.fromString(s"$clusterPathPrefix${HostIP.load()}:${port}/user/store")
    } else {
      ActorPath.fromString(s"$clusterPathPrefix${HostIP.lookupNodeAddress(seeds.head)}/user/store")
    }
  }
<commit_msg>rework ClusterManager#getJournalPath<commit_after>package de.htwg.zeta.common.cluster

import akka.actor.ActorPath
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory

/**
 */
object ClusterManager {
  val clusterPathPrefix = "akka.tcp://ClusterSystem@"

  def getJournalPath(port: Int, seeds: List[String]): ActorPath = {
    seeds.headOption match {
      case None =>
        ActorPath.fromString(s"$clusterPathPrefix${HostIP.load()}:${port}/user/store")

      case Some(seed) =>
        ActorPath.fromString(s"$clusterPathPrefix${HostIP.lookupNodeAddress(seed)}/user/store")
    }
  }

{'fraction_non_alphanumeric': 0.12689257390050468, 'fraction_numerical': 0.0, 'mean_word_length': 4.906382978723404, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3142540', 'n_tokens_mistral': 453, 'n_tokens_neox': 431, 'n_words': 64}