You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/12/21 22:21:28 UTC

[GitHub] tysonnorris commented on a change in pull request #2943: revert LoadBalancerData to be synchronous

tysonnorris commented on a change in pull request #2943: revert LoadBalancerData to be synchronous
URL: https://github.com/apache/incubator-openwhisk/pull/2943#discussion_r158391774
 
 

 ##########
 File path: core/controller/src/main/scala/whisk/core/loadBalancer/DistributedLoadBalancerData.scala
 ##########
 @@ -17,69 +17,102 @@
 
 package whisk.core.loadBalancer
 
+import akka.actor.Actor
+import akka.actor.ActorRef
 import akka.actor.ActorSystem
+import akka.actor.Props
 import akka.util.Timeout
-import akka.pattern.ask
-import whisk.common.Logging
-import whisk.core.entity.{ActivationId, UUID}
-
-import scala.collection.concurrent.TrieMap
-import scala.concurrent.Future
+import scala.collection.mutable
 import scala.concurrent.duration._
+import whisk.common.Logging
+import whisk.core.entity.ActivationId
+import whisk.core.entity.InstanceId
+import whisk.core.entity.UUID
 
 /**
  * Encapsulates data used for loadbalancer and active-ack bookkeeping.
  *
  * Note: The state keeping is backed by distributed akka actors. All CRUDs operations are done on local values, thus
  * a stale value might be read.
  */
-class DistributedLoadBalancerData(implicit actorSystem: ActorSystem, logging: Logging) extends LoadBalancerData {
+class DistributedLoadBalancerData(instance: InstanceId, monitor: Option[ActorRef] = None)(
 
 Review comment:
   monitor is used for testing, to test replication Changed events from SharedDataService:
   ```    case c @ Changed(e) =>
         logging.debug(this, "Current elements: " + c.get(storage))
         val res = c.get(storage).entries.mapValues(_.entries.mapValues(_.toInt))
         if (res.nonEmpty) {
           res.values.foreach(_.values.foreach(i => {
             require(i >= 0, s"values cannot be less than 0 ${res}")
           }))
           monitor ! Updated(storageName, res)
         }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services