tysonnorris commented on a change in pull request #2584: SPI for Loadbalancer

 File path: 
 @@ -77,16 +82,32 @@ trait LoadBalancer {
     def publish(action: ExecutableWhiskAction, msg: 
ActivationMessage)(implicit transid: TransactionId): 
Future[Future[Either[ActivationId, WhiskActivation]]]
+    /**
+     * Return a message indicating the health of the containers and/or 
container pool in general
+     * @return a Future[String] representing the heal response that will be 
sent to the client
+     */
+    def getHealthResponse: Future[JsObject]
+class LoadBalancerServiceProvider extends LoadBalancerProvider {
+    override def getLoadBalancer(config: WhiskConfig, instance: InstanceId)
+            (implicit logging: Logging, actorSystem: ActorSystem): 
LoadBalancer = new LoadBalancerService(config, instance)
+object LoadBalancerServiceProvider extends SpiFactory[LoadBalancerProvider]{
+    override def apply(dependencies: Dependencies): LoadBalancerProvider = new 
 class LoadBalancerService(
     config: WhiskConfig,
-    instance: InstanceId,
-    entityStore: EntityStore)(
+    instance: InstanceId)(
         implicit val actorSystem: ActorSystem,
         logging: Logging)
     extends LoadBalancer {
+    /** Used to manage an action for testing invoker health */
+    val entityStore =  WhiskEntityStore.datastore(config)
 Review comment:
   It is not generating a new one, but acquiring a reference to the singleton 
EntityStore. The reference from LoadBalancerServer -> EntityStore is an impl 
detail (used to create the health action) that doesn't have anything to do with 
the LoadBalancer interface. To pass as Dependencies, the `SpiLoader.get` call 
in Controller would need to "know" this impl detail. 
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:

With regards,
Apache Git Services

Reply via email to