tysonnorris commented on a change in pull request #2531: Share bookkeeping data 
across controllers
URL: 
https://github.com/apache/incubator-openwhisk/pull/2531#discussion_r139290192
 
 

 ##########
 File path: 
core/controller/src/main/scala/whisk/core/loadBalancer/SharedDataService.scala
 ##########
 @@ -33,35 +32,14 @@ case class RemoveCounter(key: String)
 case object GetMap
 
 /**
- * Companion object to specify actor properties from the outside, e.g. name of 
the shared map
+ * Companion object to specify actor properties from the outside, e.g. name of 
the shared map and cluster seed nodes
  */
 object SharedDataService {
-  val requiredProperties = Map(WhiskConfig.controllerSeedNodes -> null)
-
-  def props(storageName: String): Props = Props(new 
SharedDataService(storageName))
-
-  /**
-   * Add seed nodes if cluster provider is specified, otherwhise return the 
existing config.
-   * Parse akka seed nodes this way until either of these 2 issues is resolved:
-   * https://github.com/akka/akka/issues/23600
-   * https://github.com/typesafehub/config/issues/69
-   * @return Updated Config
-   */
-  def addAkkaSeedNodesToConf(whiskConf: WhiskConfig): Config = {
-    val conf = ConfigFactory.load()
-
-    val cluster = conf.getString("akka.actor.provider")
-
-    if (cluster == "cluster") {
-      val seedNodes = whiskConf.controllerSeedNodes
-      val nodes = seedNodes.split(' ').map(x => 
s""""akka.tcp://controller-actor-system@$x"""")
-      val configWithSeedNodes = 
ConfigFactory.parseString(s"akka.cluster.seed-nodes=[${nodes.mkString(",")}]")
-      configWithSeedNodes.withFallback(conf)
-    } else conf
-  }
+  def props(storageName: String, seedNodes: Seq[Address]): Props =
+    Props(new SharedDataService(storageName, seedNodes))
 }
 
-class SharedDataService(storageName: String) extends Actor with ActorLogging {
+class SharedDataService(storageName: String, seedNodes: Seq[Address]) extends 
Actor with ActorLogging {
 
 Review comment:
   `SharedDataService` appears to be core to enabling clustering, so I'm 
wondering if it should be less specific to data storage, and rather expose 
`DataService` as a feature; i.e. `SharedDataService` -> `WhiskCluster` and add 
`WhiskCluster.dataService`. I don't think enabling clustering should be taken 
lightly, so this would make it more obvious that it would be the one (and only) 
entry point to initiating cluster support within either controller or invoker; 
and if there are cases where invoker clustering should be enabled, move this 
into `/common/scala` instead of controller. WDYT?
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to