iota-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonyfaust...@apache.org
Subject [22/31] incubator-iota git commit: Reverted the Default null case according to the comments
Date Tue, 29 Nov 2016 23:29:21 GMT
Reverted the Default null case according to the comments


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

Branch: refs/heads/master
Commit: d4a151aaaa4e90adcabcf0a5030dd47a745a75e0
Parents: cf83745
Author: Shivansh <shiv4nsh@gmail.com>
Authored: Sat Nov 5 04:01:12 2016 +0530
Committer: Shivansh <shiv4nsh@gmail.com>
Committed: Sat Nov 5 04:01:12 2016 +0530

----------------------------------------------------------------------
 fey-core/src/main/scala/org/apache/iota/fey/Ensemble.scala  | 5 ++---
 .../main/scala/org/apache/iota/fey/FeyGenericActor.scala    | 5 ++---
 fey-core/src/main/scala/org/apache/iota/fey/TrieNode.scala  | 8 +++-----
 .../scala/org/apache/iota/fey/performer/ZMQPublisher.scala  | 6 ++----
 .../scala/org/apache/iota/fey/performer/ZMQSubscriber.scala | 9 ++++-----
 5 files changed, 13 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/d4a151aa/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 2ce13ff..0e075e3 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
@@ -33,7 +33,6 @@ protected class Ensemble(val orchestrationID: String,
   import Ensemble._
 
   val monitoring_actor = FEY_MONITOR.actorRef
-  val DEFAULT_NULL = null
   var performers_metadata: Map[String, Performer] = Map.empty[String, Performer]
   var connectors: Map[String,Array[String]] = Map.empty[String,Array[String]]
   var performer: Map[String,ActorRef] = Map.empty[String,ActorRef]
@@ -164,13 +163,13 @@ protected class Ensemble(val orchestrationID: String,
     */
   private def createFeyActor(performerID: String, connectionIDs: Array[String], tmpActors:HashMap[String,
ActorRef]):(String, ActorRef) = {
     if(!tmpActors.contains(performerID)){
-      val performerInfo = performers_metadata.getOrElse(performerID, DEFAULT_NULL)
+      val performerInfo = performers_metadata.getOrElse(performerID, null)
       if (Option(performerInfo).isDefined) {
         val connections: Map[String, ActorRef] = connectionIDs.map(connID => {
           createFeyActor(connID, connectors.getOrElse(connID,Array.empty),tmpActors)
         }).toMap
 
-        var actor: ActorRef = DEFAULT_NULL
+        var actor: ActorRef = null
         val actorProps = getPerformer(performerInfo, connections)
         if(performerInfo.autoScale) {
 

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/d4a151aa/fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActor.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActor.scala b/fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActor.scala
index dd83ce1..970a99f 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActor.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActor.scala
@@ -44,14 +44,13 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
 
   extends Actor with ActorLogging{
 
-  val DEFAULT_NULL = null
 
   import FeyGenericActor._
 
   /**
     * Keeps reference to the cancellable
     */
-  @volatile private var scheduler: Cancellable = DEFAULT_NULL
+  @volatile private var scheduler: Cancellable = null
   @volatile private var endBackoff: Long = 0
   private[fey] val monitoring_actor = FEY_MONITOR.actorRef
 
@@ -114,7 +113,7 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
   private final def stopScheduler() = {
     if (Option(scheduler).isDefined) {
       scheduler.cancel()
-      scheduler = DEFAULT_NULL
+      scheduler = null
     }
   }
   /**

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/d4a151aa/fey-core/src/main/scala/org/apache/iota/fey/TrieNode.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/TrieNode.scala b/fey-core/src/main/scala/org/apache/iota/fey/TrieNode.scala
index 5afd3ee..902e5f2 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/TrieNode.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/TrieNode.scala
@@ -29,12 +29,10 @@ case class TrieNode(path: String, children: ArrayBuffer[TrieNode], events:ArrayB
 
 protected class Trie(systemName: String){
 
-  val DEFAULT_NULL = null
-
   private val root: TrieNode = TrieNode(systemName, ArrayBuffer.empty, ArrayBuffer.empty)
   var elements: Int = 0
 
-  def append(path: String, event: Monitor.MonitorEvent = DEFAULT_NULL): Unit = {
+  def append(path: String, event: Monitor.MonitorEvent = null): Unit = {
     append(path.replaceFirst("akka://","").split("/"),root,1,event)
   }
 
@@ -101,11 +99,11 @@ protected class Trie(systemName: String){
   }
 
   def print:JsValue = {
-    getObject(root, DEFAULT_NULL)
+    getObject(root, null)
   }
 
   def printWithEvents:JsValue = {
-    getObjectEvent(root, DEFAULT_NULL)
+    getObjectEvent(root, null)
   }
 
   def getRootChildren():ArrayBuffer[TrieNode] = {

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/d4a151aa/performers/zmq/src/main/scala/org/apache/iota/fey/performer/ZMQPublisher.scala
----------------------------------------------------------------------
diff --git a/performers/zmq/src/main/scala/org/apache/iota/fey/performer/ZMQPublisher.scala
b/performers/zmq/src/main/scala/org/apache/iota/fey/performer/ZMQPublisher.scala
index 0f19aa0..856f91c 100644
--- a/performers/zmq/src/main/scala/org/apache/iota/fey/performer/ZMQPublisher.scala
+++ b/performers/zmq/src/main/scala/org/apache/iota/fey/performer/ZMQPublisher.scala
@@ -33,16 +33,14 @@ class ZMQPublisher(override val params: Map[String, String] = Map.empty,
 
   //-------default params----------
   val DEFAULT_PORT = 5559
-  val DEFAULT_NULL = null
-
   var port: Int = DEFAULT_PORT
   var target: String = "localhost"
   val DEFAULT_LINGER = 200
   val DEFAULT_HMW = 10
 
   //-------class vars-------------------
-  var ctx: ZMQ.Context = DEFAULT_NULL
-  var pub: ZMQ.Socket = DEFAULT_NULL
+  var ctx: ZMQ.Context = null
+  var pub: ZMQ.Socket = null
   var count: Int = 0
 
   override def onStart: Unit = {

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/d4a151aa/performers/zmq/src/main/scala/org/apache/iota/fey/performer/ZMQSubscriber.scala
----------------------------------------------------------------------
diff --git a/performers/zmq/src/main/scala/org/apache/iota/fey/performer/ZMQSubscriber.scala
b/performers/zmq/src/main/scala/org/apache/iota/fey/performer/ZMQSubscriber.scala
index 7e51980..299c59e 100644
--- a/performers/zmq/src/main/scala/org/apache/iota/fey/performer/ZMQSubscriber.scala
+++ b/performers/zmq/src/main/scala/org/apache/iota/fey/performer/ZMQSubscriber.scala
@@ -32,14 +32,13 @@ class ZMQSubscriber(override val params: Map[String, String] = Map.empty,
 
   //-------default params----------
   val DEFAULT_PORT = 5563
-  val DEFAULT_NULL = null
   var port: Int = DEFAULT_PORT
   var target: String = "localhost"
   val topic_filter: String = "DATA"
 
   //-------class vars-------------------
-  var ctx: ZMQ.Context = DEFAULT_NULL
-  var pub: ZMQ.Socket = DEFAULT_NULL
+  var ctx: ZMQ.Context = null
+  var pub: ZMQ.Socket = null
   var count: Int = 0
 
   override def onStart: Unit = {
@@ -70,8 +69,8 @@ class ZMQSubscriber(override val params: Map[String, String] = Map.empty,
     pub.disconnect("tcp://" + target + ":" + port)
     pub.close()
     ctx.close()
-    pub = DEFAULT_NULL
-    ctx = DEFAULT_NULL
+    pub = null
+    ctx = null
   }
 
   override def onRestart(reason: Throwable): Unit = {


Mime
View raw message