iota-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonyfaust...@apache.org
Subject [1/8] incubator-iota git commit: Refactoring printing Routees
Date Mon, 11 Jul 2016 18:50:31 GMT
Repository: incubator-iota
Updated Branches:
  refs/heads/master 36d489b95 -> c017bcbbb


Refactoring printing Routees

Instead of using the toString method, we should use the Routee as an instance of ActorRefRoutee


Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/16a45790
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/16a45790
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/16a45790

Branch: refs/heads/master
Commit: 16a45790ce89ee2ac6a146ce7ddb4d801f8bc53f
Parents: c381fc4
Author: Barbara Gomes <barbaramaltagomes@gmail.com>
Authored: Fri Jul 8 10:52:54 2016 -0700
Committer: Barbara Gomes <barbaramaltagomes@gmail.com>
Committed: Fri Jul 8 10:52:54 2016 -0700

----------------------------------------------------------------------
 .../src/main/scala/org/apache/iota/fey/Ensemble.scala |  2 +-
 .../scala/org/apache/iota/fey/IdentifyFeyActors.scala | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/16a45790/fey-core/src/main/scala/org/apache/iota/fey/Ensemble.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/Ensemble.scala b/fey-core/src/main/scala/org/apache/iota/fey/Ensemble.scala
index 1a18bb9..ce87699 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/Ensemble.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/Ensemble.scala
@@ -160,10 +160,10 @@ protected class Ensemble(val orchestrationID: String,
           createFeyActor(connID, connectors.getOrElse(connID,Array.empty),tmpActors)
         }).toMap
 
-
         var actor:ActorRef = null
         val actorProps = getPerformer(performerInfo, connections)
         if(performerInfo.autoScale > 0) {
+
           val resizer = DefaultResizer(lowerBound = 1, upperBound = performerInfo.autoScale,
             messagesPerResize = CONFIG.MESSAGES_PER_RESIZE, backoffThreshold = 0.4)
           val smallestMailBox = SmallestMailboxPool(1, Some(resizer))

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/16a45790/fey-core/src/main/scala/org/apache/iota/fey/IdentifyFeyActors.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/IdentifyFeyActors.scala b/fey-core/src/main/scala/org/apache/iota/fey/IdentifyFeyActors.scala
index 80387db..9670b5d 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/IdentifyFeyActors.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/IdentifyFeyActors.scala
@@ -18,7 +18,7 @@
 package org.apache.iota.fey
 
 import akka.actor.{Actor, ActorIdentity, ActorLogging, ActorPath, Identify}
-import akka.routing.{GetRoutees, Routees}
+import akka.routing.{ActorRefRoutee, GetRoutees, Routees}
 import play.api.libs.json._
 
 import scala.collection.mutable.HashSet
@@ -27,8 +27,6 @@ protected class IdentifyFeyActors extends Actor with ActorLogging {
 
   import IdentifyFeyActors._
 
-  val toStringRouteePrefix = "ActorRefRoutee(Actor["
-
   def receive = {
     case IDENTIFY_TREE(startPath) =>
       log.info("Current Actors in system:")
@@ -47,10 +45,12 @@ protected class IdentifyFeyActors extends Actor with ActorLogging {
       self ! ref.path
 
     case routees:Routees =>
-      routees.routees.foreach(routee => {
-        val pathTmp = routee.toString.replace(toStringRouteePrefix,"")
-        actorsPath.add(pathTmp.substring(0, pathTmp.indexOf("#")))
-      })
+      routees.routees
+        .map(_.asInstanceOf[ActorRefRoutee])
+        .foreach(routee => {
+          log.info(routee.ref.path.toString)
+          actorsPath.add(routee.ref.path.toString)
+        })
 
     case _ =>
   }


Mime
View raw message