All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.teambytes.inflatable.raft.config.RaftConfig.scala Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package com.teambytes.inflatable.raft.config

import com.typesafe.config.Config
import java.util.concurrent.TimeUnit
import concurrent.duration._
import akka.actor.Extension

private[inflatable] class RaftConfig (config: Config) extends Extension {

  val raftConfig = config.getConfig("akka.raft")

  val defaultAppendEntriesBatchSize = raftConfig.getInt("default-append-entries-batch-size")

  val publishTestingEvents = raftConfig.getBoolean("publish-testing-events")

  val electionTimeoutMin = raftConfig.getDuration("election-timeout.min", TimeUnit.MILLISECONDS).millis
  val electionTimeoutMax = raftConfig.getDuration("election-timeout.max", TimeUnit.MILLISECONDS).millis

  val heartbeatInterval = raftConfig.getDuration("heartbeat-interval", TimeUnit.MILLISECONDS).millis

  val clusterAutoDiscoveryIdentifyTimeout = raftConfig.getDuration("cluster.auto-discovery.identify-timeout", TimeUnit.MILLISECONDS).millis
  val clusterAutoDiscoveryRetryCount = raftConfig.getInt("cluster.auto-discovery.retry-count")
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy