You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iota.apache.org by to...@apache.org on 2016/11/29 23:29:00 UTC
[01/31] incubator-iota git commit: Corrected the Scalastyle file for
the header
Repository: incubator-iota
Updated Branches:
refs/heads/master a027f11ec -> 2895047d1
Corrected the Scalastyle file for the header
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/24a57f12
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/24a57f12
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/24a57f12
Branch: refs/heads/master
Commit: 24a57f12200fcac258fe7794b6afc34327510a59
Parents: e08e775
Author: Shivansh <sh...@gmail.com>
Authored: Thu Nov 3 23:30:22 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Thu Nov 3 23:30:22 2016 +0530
----------------------------------------------------------------------
scalastyle-config.xml | 249 ++++++++++++++++++++++++---------------------
1 file changed, 134 insertions(+), 115 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/24a57f12/scalastyle-config.xml
----------------------------------------------------------------------
diff --git a/scalastyle-config.xml b/scalastyle-config.xml
index 7e3596f..545e432 100644
--- a/scalastyle-config.xml
+++ b/scalastyle-config.xml
@@ -1,117 +1,136 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
<scalastyle>
- <name>Scalastyle standard configuration</name>
- <check level="warning" class="org.scalastyle.file.FileTabChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.file.FileLengthChecker" enabled="true">
- <parameters>
- <parameter name="maxFileLength"><![CDATA[800]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true">
- <parameters>
- <parameter name="header"><![CDATA[// Copyright (C) 2011-2012 the original author or authors.
-// See the LICENCE.txt file distributed with this work for additional
-// information regarding copyright ownership.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.SpacesAfterPlusChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.file.WhitespaceEndOfLineChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.SpacesBeforePlusChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.file.FileLineLengthChecker" enabled="true">
- <parameters>
- <parameter name="maxLineLength"><![CDATA[160]]></parameter>
- <parameter name="tabSize"><![CDATA[4]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.ClassNamesChecker" enabled="true">
- <parameters>
- <parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true">
- <parameters>
- <parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.PackageObjectNamesChecker" enabled="true">
- <parameters>
- <parameter name="regex"><![CDATA[^[a-z][A-Za-z]*$]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.EqualsHashCodeChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.IllegalImportsChecker" enabled="true">
- <parameters>
- <parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.ParameterNumberChecker" enabled="true">
- <parameters>
- <parameter name="maxParameters"><![CDATA[8]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.MagicNumberChecker" enabled="true">
- <parameters>
- <parameter name="ignore"><![CDATA[-1,0,1,2,3]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.ReturnChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.NullChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.NoCloneChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.NoFinalizeChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.CovariantEqualsChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.StructuralTypeChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.file.RegexChecker" enabled="true">
- <parameters>
- <parameter name="regex"><![CDATA[println]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.NumberOfTypesChecker" enabled="true">
- <parameters>
- <parameter name="maxTypes"><![CDATA[30]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.CyclomaticComplexityChecker" enabled="true">
- <parameters>
- <parameter name="maximum"><![CDATA[10]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.UppercaseLChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.scalariform.IfBraceChecker" enabled="true">
- <parameters>
- <parameter name="singleLineAllowed"><![CDATA[true]]></parameter>
- <parameter name="doubleLineAllowed"><![CDATA[false]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.MethodLengthChecker" enabled="true">
- <parameters>
- <parameter name="maxLength"><![CDATA[50]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="true">
- <parameters>
- <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*$]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" enabled="true">
- <parameters>
- <parameter name="maxMethods"><![CDATA[30]]></parameter>
- </parameters>
- </check>
- <check level="warning" class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.file.NewLineAtEofChecker" enabled="true"></check>
- <check level="warning" class="org.scalastyle.file.NoNewLineAtEofChecker" enabled="false"></check>
+ <name>Scalastyle standard configuration</name>
+ <check level="warning" class="org.scalastyle.file.FileTabChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.FileLengthChecker" enabled="true">
+ <parameters>
+ <parameter name="maxFileLength"><![CDATA[800]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true">
+ <parameters>
+ <parameter name="header"><![CDATA[/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.SpacesAfterPlusChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.WhitespaceEndOfLineChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.SpacesBeforePlusChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.FileLineLengthChecker" enabled="true">
+ <parameters>
+ <parameter name="maxLineLength"><![CDATA[160]]></parameter>
+ <parameter name="tabSize"><![CDATA[4]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.ClassNamesChecker" enabled="true">
+ <parameters>
+ <parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true">
+ <parameters>
+ <parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.PackageObjectNamesChecker" enabled="true">
+ <parameters>
+ <parameter name="regex"><![CDATA[^[a-z][A-Za-z]*$]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.EqualsHashCodeChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.IllegalImportsChecker" enabled="true">
+ <parameters>
+ <parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.ParameterNumberChecker" enabled="true">
+ <parameters>
+ <parameter name="maxParameters"><![CDATA[8]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.MagicNumberChecker" enabled="true">
+ <parameters>
+ <parameter name="ignore"><![CDATA[-1,0,1,2,3]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker"
+ enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker"
+ enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.ReturnChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.NullChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.NoCloneChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.NoFinalizeChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.CovariantEqualsChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.StructuralTypeChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.RegexChecker" enabled="true">
+ <parameters>
+ <parameter name="regex"><![CDATA[println]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.NumberOfTypesChecker" enabled="true">
+ <parameters>
+ <parameter name="maxTypes"><![CDATA[30]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.CyclomaticComplexityChecker" enabled="true">
+ <parameters>
+ <parameter name="maximum"><![CDATA[10]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.UppercaseLChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.scalariform.IfBraceChecker" enabled="true">
+ <parameters>
+ <parameter name="singleLineAllowed"><![CDATA[true]]></parameter>
+ <parameter name="doubleLineAllowed"><![CDATA[false]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.MethodLengthChecker" enabled="true">
+ <parameters>
+ <parameter name="maxLength"><![CDATA[50]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="true">
+ <parameters>
+ <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*$]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" enabled="true">
+ <parameters>
+ <parameter name="maxMethods"><![CDATA[30]]></parameter>
+ </parameters>
+ </check>
+ <check level="warning" class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.NewLineAtEofChecker" enabled="true"></check>
+ <check level="warning" class="org.scalastyle.file.NoNewLineAtEofChecker" enabled="false"></check>
</scalastyle>
\ No newline at end of file
[19/31] incubator-iota git commit: Removed scalastyle in feycore
Posted by to...@apache.org.
Removed scalastyle in feycore
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/57916d76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/57916d76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/57916d76
Branch: refs/heads/master
Commit: 57916d76be9382f7c63f969edd2906c1c0af3cb3
Parents: bf4a280
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:43:25 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:43:25 2016 +0530
----------------------------------------------------------------------
fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala | 3 +--
fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala | 8 ++++----
2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/57916d76/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala b/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
index 3018d03..5e5522b 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -371,4 +370,4 @@ private object FEY_CACHE{
}
sealed case class OrchestrationInformation(ensembleSpecJson: List[JsObject], orchestrationID: String,
- orchestrationName: String, orchestrationTimestamp: String)
\ No newline at end of file
+ orchestrationName: String, orchestrationTimestamp: String)
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/57916d76/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala b/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
index 2100cbd..4e0c3a4 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
@@ -87,8 +87,8 @@ protected class Monitor(eventsStore: Trie) extends Actor with ActorLogging {
case _ =>
}
- def logInfo(path:String, event:String, timestamp: Long, info:String, reason:Throwable = null) = {
- if(reason != null){
+ def logInfo(path:String, event:String, timestamp: Long, info:String, reason:Throwable = null): Unit = {
+ if(Option(reason).isDefined){
log.error(reason, s"$event | $timestamp | $path | $info")
}else{
log.info(s"$event | $timestamp | $path | $info")
@@ -123,13 +123,13 @@ protected object Monitor{
}
def mapEventsToRows(actors: ArrayBuffer[TrieNode], prefix:String): ArrayBuffer[String] = {
- actors.map(actor => {
+ actors.flatMap(actor => {
val currentPath = if (prefix == "/user/FEY-CORE") actor.path else s"$prefix/${actor.path}"
val events = actor.events.map(event => {
getTableLine(currentPath, event.timestamp, event.event, event.info)
})
mapEventsToRows(actor.children, currentPath) ++ events
- }).flatten
+ })
}
def getSimpleHTMLEvents: String = {
[08/31] incubator-iota git commit: Removed scalastyle in randomdouble
Posted by to...@apache.org.
Removed scalastyle in randomdouble
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/a1e74557
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/a1e74557
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/a1e74557
Branch: refs/heads/master
Commit: a1e745578c2fa0b2651bc2b7734d35865e321e37
Parents: 0d9e6b1
Author: Shivansh <sh...@gmail.com>
Authored: Thu Nov 3 23:54:15 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Thu Nov 3 23:54:15 2016 +0530
----------------------------------------------------------------------
.../iota/fey/performer/RandomDouble.scala | 33 ++++++++++----------
1 file changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/a1e74557/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomDouble.scala
----------------------------------------------------------------------
diff --git a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomDouble.scala b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomDouble.scala
index 5f04791..e73c80c 100644
--- a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomDouble.scala
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomDouble.scala
@@ -1,18 +1,19 @@
-
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// ee the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.iota.fey.performer
@@ -53,4 +54,4 @@ class RandomDouble(override val params: Map[String, String] = Map.empty,
propagateMessage(rd)
}
-}
\ No newline at end of file
+}
[18/31] incubator-iota git commit: Removed scalastyle in utils and
jsonRecieverActor
Posted by to...@apache.org.
Removed scalastyle in utils and jsonRecieverActor
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/bf4a2806
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/bf4a2806
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/bf4a2806
Branch: refs/heads/master
Commit: bf4a2806310a9dacea806dabacd7aa7243741948
Parents: 290d67b
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:41:22 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:41:22 2016 +0530
----------------------------------------------------------------------
.../main/scala/org/apache/iota/fey/JsonReceiverActor.scala | 1 -
fey-core/src/main/scala/org/apache/iota/fey/Utils.scala | 9 ++++++---
2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/bf4a2806/fey-core/src/main/scala/org/apache/iota/fey/JsonReceiverActor.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/JsonReceiverActor.scala b/fey-core/src/main/scala/org/apache/iota/fey/JsonReceiverActor.scala
index 3fb5330..875009b 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/JsonReceiverActor.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/JsonReceiverActor.scala
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/bf4a2806/fey-core/src/main/scala/org/apache/iota/fey/Utils.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/Utils.scala b/fey-core/src/main/scala/org/apache/iota/fey/Utils.scala
index ff4e574..fda1a30 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/Utils.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/Utils.scala
@@ -211,6 +211,9 @@ object CONFIG{
val CONSOLE_APPENDER = "FEY-CONSOLE"
val CONTROL_AWARE_MAILBOX = "akka.fey-dispatchers.control-aware-dispatcher"
+ val DEFAULT_MESSAGE = 500
+ val DEFAULT_PORT = 8080
+
var CHECKPOINT_DIR = ""
var JSON_REPOSITORY = ""
var JSON_EXTENSION = ""
@@ -218,13 +221,13 @@ object CONFIG{
var CHEKPOINT_ENABLED = true
var LOG_LEVEL = ""
var LOG_APPENDER = ""
- var MESSAGES_PER_RESIZE:Int = 500
+ var MESSAGES_PER_RESIZE: Int = DEFAULT_MESSAGE
var DYNAMIC_JAR_REPO = ""
var DYNAMIC_JAR_FORCE_PULL = false
var CUSTOM_DISPATCHERS: ConfigValue = null
var MONITORING_ENABLED: Boolean = true
var MONITORING_TYPE: String = "COMPLETE"
- var PORT = 8080
+ var PORT = DEFAULT_PORT
var URL_PATH = "localhost"
def loadUserConfiguration(path: String) : Unit = {
@@ -325,4 +328,4 @@ case class NetworkAlreadyDefined(message:String) extends Exception(message)
case class IllegalPerformerCreation(message:String) extends Exception(message)
case class NetworkNotDefined(message:String) extends Exception(message)
case class CommandNotRecognized(message:String) extends Exception(message)
-case class RestartEnsemble(message:String) extends Exception(message)
\ No newline at end of file
+case class RestartEnsemble(message:String) extends Exception(message)
[25/31] incubator-iota git commit: Corrected Monitor.scala according
to the comments
Posted by to...@apache.org.
Corrected Monitor.scala 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/5b2c3760
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/5b2c3760
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/5b2c3760
Branch: refs/heads/master
Commit: 5b2c37608a96efcef4d25914958c3eab6fd4dc3e
Parents: 9142e65
Author: Shivansh <sh...@gmail.com>
Authored: Tue Nov 15 06:35:42 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Tue Nov 15 06:35:42 2016 +0530
----------------------------------------------------------------------
fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/5b2c3760/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala b/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
index 4e0c3a4..98fa3e8 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
@@ -57,7 +57,7 @@ protected class Monitor(eventsStore: Trie) extends Actor with ActorLogging {
eventsStore.append(sender().path.toString,MonitorEvent(EVENTS.STOP, timestamp, info))
case RESTART(reason, timestamp) =>
- logInfo(sender().path.toString, EVENTS.RESTART, timestamp, "", reason)
+ logInfo(sender().path.toString, EVENTS.RESTART, timestamp, "", Option(reason))
eventsStore.append(sender().path.toString,MonitorEvent(EVENTS.RESTART, timestamp, reason.getMessage))
case TERMINATE(actorPath, timestamp, info) =>
@@ -75,7 +75,7 @@ protected class Monitor(eventsStore: Trie) extends Actor with ActorLogging {
Monitor.simpleEvents.put(sender().path.toString, ('O',timestamp))
case RESTART(reason, timestamp) =>
- logInfo(sender().path.toString, EVENTS.RESTART, timestamp, "", reason)
+ logInfo(sender().path.toString, EVENTS.RESTART, timestamp, "", Option(reason))
Monitor.simpleEvents.put(sender().path.toString, ('R',timestamp))
case TERMINATE(actorPath, timestamp, info) =>
@@ -87,9 +87,9 @@ protected class Monitor(eventsStore: Trie) extends Actor with ActorLogging {
case _ =>
}
- def logInfo(path:String, event:String, timestamp: Long, info:String, reason:Throwable = null): Unit = {
- if(Option(reason).isDefined){
- log.error(reason, s"$event | $timestamp | $path | $info")
+ def logInfo(path: String, event: String, timestamp: Long, info: String, reason: Option[Throwable] = null): Unit = {
+ if (reason.isDefined) {
+ log.error(reason.get, s"$event | $timestamp | $path | $info")
}else{
log.info(s"$event | $timestamp | $path | $info")
}
[02/31] incubator-iota git commit: Removed the scalastyle warnings of
null and header in Sensor
Posted by to...@apache.org.
Removed the scalastyle warnings of null and header in Sensor
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/41433b8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/41433b8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/41433b8a
Branch: refs/heads/master
Commit: 41433b8a99231def3b4e4f8d3aac233d33773460
Parents: 24a57f1
Author: Shivansh <sh...@gmail.com>
Authored: Thu Nov 3 23:43:59 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Thu Nov 3 23:43:59 2016 +0530
----------------------------------------------------------------------
fey-core/src/main/resources/application.conf | 1 -
.../scala/org/apache/iota/fey/Application.scala | 1 -
.../iota/fey/performer/RandomInteger.scala | 31 +++++------
.../org/apache/iota/fey/performer/Sensor.scala | 54 ++++++++++----------
4 files changed, 44 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/41433b8a/fey-core/src/main/resources/application.conf
----------------------------------------------------------------------
diff --git a/fey-core/src/main/resources/application.conf b/fey-core/src/main/resources/application.conf
index e732880..964a5ef 100644
--- a/fey-core/src/main/resources/application.conf
+++ b/fey-core/src/main/resources/application.conf
@@ -13,7 +13,6 @@
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
-//
// Defines the default configuration for Fey
// User can override this configuration by creating a configuration file
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/41433b8a/fey-core/src/main/scala/org/apache/iota/fey/Application.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/Application.scala b/fey-core/src/main/scala/org/apache/iota/fey/Application.scala
index 34bbc29..4298a7e 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/Application.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/Application.scala
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.iota.fey
import akka.actor.{ActorSystem, Props}
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/41433b8a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala
----------------------------------------------------------------------
diff --git a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala
index a694111..72de479 100644
--- a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala
@@ -1,18 +1,19 @@
-
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// ee the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.iota.fey.performer
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/41433b8a/performers/virtual_sensor/src/main/scala/org/apache/iota/fey/performer/Sensor.scala
----------------------------------------------------------------------
diff --git a/performers/virtual_sensor/src/main/scala/org/apache/iota/fey/performer/Sensor.scala b/performers/virtual_sensor/src/main/scala/org/apache/iota/fey/performer/Sensor.scala
index c80669c..e87cb2f 100644
--- a/performers/virtual_sensor/src/main/scala/org/apache/iota/fey/performer/Sensor.scala
+++ b/performers/virtual_sensor/src/main/scala/org/apache/iota/fey/performer/Sensor.scala
@@ -1,29 +1,31 @@
-
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// ee the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.iota.fey.performer
import akka.actor.ActorRef
+import org.apache.commons.math3.distribution.NormalDistribution
import org.apache.iota.fey.FeyGenericActor
+import org.joda.time.DateTime
+import play.api.libs.json.{JsObject, JsValue, Json}
import scala.collection.immutable.Map
import scala.concurrent.duration._
-import org.apache.commons.math3.distribution.NormalDistribution
-import org.joda.time.DateTime
-import play.api.libs.json.{JsObject, JsValue, Json}
+import scala.util.Try
class Sensor(override val params: Map[String, String] = Map.empty,
@@ -38,8 +40,8 @@ class Sensor(override val params: Map[String, String] = Map.empty,
var name = "sensor"
var expected_value: Double = 70.0
var sigma: Double = 1.0
- var exceptions: JsValue = null
- var output: NormalDistribution = null
+ var exceptions: Option[JsValue] = None
+ var output: Option[NormalDistribution] = None
var sensor_type = "environmental"
// wav vibration
var vib = ""
@@ -87,13 +89,13 @@ class Sensor(override val params: Map[String, String] = Map.empty,
val ts = java.lang.System.currentTimeMillis().toString
var out = ""
if (!isException) {
- output = new NormalDistribution(expected_value, sigma)
+ output = Try(new NormalDistribution(expected_value, sigma)).toOption
sound = normal_sound
vib = normal_vib
}
sensor_type match {
- case "environmental" => out = s"""$lrn|$ts|{"x":${output.sample()}}"""
+ case "environmental" => out = s"""$lrn|$ts|{"x":${output.fold(0.0D)(x => x.sample())}}"""
case "vibration" => out = s"""$lrn|$ts|{"blob":$vib}"""
case "wav" => out = s"""$lrn|$ts|{"wav":$sound}"""
}
@@ -105,7 +107,7 @@ class Sensor(override val params: Map[String, String] = Map.empty,
var efile = ""
var ev = 0.0
val date = DateTime.now
- val all_exceptions = exceptions.as[List[JsObject]]
+ val all_exceptions = exceptions.fold(List[JsObject]())(value => value.as[List[JsObject]])
all_exceptions.foreach(x => {
try {
val st = (x \ "start_time").as[Array[Int]]
@@ -120,7 +122,7 @@ class Sensor(override val params: Map[String, String] = Map.empty,
sound = exception_sound
} else {
ev = (x \ "expected_value").as[Double]
- output = new NormalDistribution(ev, sigma)
+ output = Option(new NormalDistribution(ev, sigma))
}
true
}
@@ -152,7 +154,7 @@ class Sensor(override val params: Map[String, String] = Map.empty,
if (params.contains("exceptions")) {
val p = params("exceptions")
try {
- exceptions = Json.parse(p)
+ exceptions = Option(Json.parse(p))
} catch {
case e: Exception => log.error(s"Invalid JSON defining exception $p")
}
@@ -167,4 +169,4 @@ class Sensor(override val params: Map[String, String] = Map.empty,
}
}
-}
\ No newline at end of file
+}
[27/31] incubator-iota git commit: Removed the compilation error
Posted by to...@apache.org.
Removed the compilation error
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/e96b066d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/e96b066d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/e96b066d
Branch: refs/heads/master
Commit: e96b066dc87da887ee168e83359a675d087828b2
Parents: 238cf47
Author: Shivansh <sh...@gmail.com>
Authored: Tue Nov 15 06:50:54 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Tue Nov 15 06:50:54 2016 +0530
----------------------------------------------------------------------
fey-core/src/main/scala/org/apache/iota/fey/TrieNode.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/e96b066d/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 2abbb86..bbcb50d 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,7 +29,7 @@ case class TrieNode(path: String, children: ArrayBuffer[TrieNode], events:ArrayB
protected class Trie(systemName: String){
- private val DEFAULT_TRIE_NODE = TrieNode(systemName, ArrayBuffer.empty, ArrayBuffer.empty
+ private val DEFAULT_TRIE_NODE = TrieNode(systemName, ArrayBuffer.empty, ArrayBuffer.empty)
private val root: Option[TrieNode] = Option(DEFAULT_TRIE_NODE)
var elements: Int = 0
[09/31] incubator-iota git commit: Removed scalastyle in randomuuid
Posted by to...@apache.org.
Removed scalastyle in randomuuid
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/1f0895c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/1f0895c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/1f0895c5
Branch: refs/heads/master
Commit: 1f0895c56420f444b5f833a1d8374e67b3b3b7ef
Parents: a1e7455
Author: Shivansh <sh...@gmail.com>
Authored: Thu Nov 3 23:55:04 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Thu Nov 3 23:55:04 2016 +0530
----------------------------------------------------------------------
.../apache/iota/fey/performer/RandomUUID.scala | 33 ++++++++++----------
1 file changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/1f0895c5/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomUUID.scala
----------------------------------------------------------------------
diff --git a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomUUID.scala b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomUUID.scala
index be3f3cf..c0e3493 100644
--- a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomUUID.scala
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomUUID.scala
@@ -1,18 +1,19 @@
-
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// ee the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.iota.fey.performer
@@ -53,4 +54,4 @@ class RandomUUID(override val params: Map[String, String] = Map.empty,
propagateMessage(uuid)
}
-}
\ No newline at end of file
+}
[16/31] incubator-iota git commit: Removed scalastyle in
CheckpointProcessor , Orchestration and WatchServiceReciever
Posted by to...@apache.org.
Removed scalastyle in CheckpointProcessor , Orchestration and WatchServiceReciever
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/820f2b10
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/820f2b10
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/820f2b10
Branch: refs/heads/master
Commit: 820f2b10d92d67a46efc0a19e619de5d16705cd2
Parents: 15ab0a8
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:33:24 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:33:24 2016 +0530
----------------------------------------------------------------------
.../src/main/scala/org/apache/iota/fey/CheckpointProcessor.scala | 1 -
fey-core/src/main/scala/org/apache/iota/fey/Orchestration.scala | 4 ++--
.../main/scala/org/apache/iota/fey/WatchServiceReceiver.scala | 1 -
3 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/820f2b10/fey-core/src/main/scala/org/apache/iota/fey/CheckpointProcessor.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/CheckpointProcessor.scala b/fey-core/src/main/scala/org/apache/iota/fey/CheckpointProcessor.scala
index c66be1c..663ffdf 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/CheckpointProcessor.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/CheckpointProcessor.scala
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/820f2b10/fey-core/src/main/scala/org/apache/iota/fey/Orchestration.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/Orchestration.scala b/fey-core/src/main/scala/org/apache/iota/fey/Orchestration.scala
index d247279..1e47a80 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/Orchestration.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/Orchestration.scala
@@ -75,7 +75,7 @@ protected class Orchestration(val name: String,
}
}
- override def postStop() = {
+ override def postStop(): Unit = {
monitoring_actor ! Monitor.STOP(Utils.getTimestamp)
log.info(s"STOPPED ${self.path.name}")
}
@@ -250,4 +250,4 @@ protected object ORCHESTRATION_CACHE{
*/
val orchestration_metadata: HashMap[String, Map[String,JsObject]] = HashMap.empty[String, Map[String,JsObject]]
val orchestration_name: HashMap[String, String] = HashMap.empty
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/820f2b10/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala b/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
index a07a8d2..df78c51 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/WatchServiceReceiver.scala
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
[31/31] incubator-iota git commit: Merge branch 'IOTA-29' of
https://github.com/shiv4nsh/incubator-iota
Posted by to...@apache.org.
Merge branch 'IOTA-29' of https://github.com/shiv4nsh/incubator-iota
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/2895047d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/2895047d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/2895047d
Branch: refs/heads/master
Commit: 2895047d1d341ad5ba299f0c228ce56825781f34
Parents: a027f11 800ceea
Author: tonyfaustini <to...@yahoo.com>
Authored: Tue Nov 29 15:28:40 2016 -0800
Committer: tonyfaustini <to...@yahoo.com>
Committed: Tue Nov 29 15:28:40 2016 -0800
----------------------------------------------------------------------
fey-core/src/main/resources/application.conf | 1 -
.../scala/org/apache/iota/fey/Application.scala | 1 -
.../apache/iota/fey/CheckpointProcessor.scala | 1 -
.../scala/org/apache/iota/fey/Ensemble.scala | 39 +--
.../scala/org/apache/iota/fey/FeyCore.scala | 17 +-
.../org/apache/iota/fey/FeyGenericActor.scala | 24 +-
.../iota/fey/FeyGenericActorReceiver.scala | 3 +-
.../org/apache/iota/fey/FeyUIService.scala | 3 +-
.../org/apache/iota/fey/JsonReceiver.scala | 3 +-
.../org/apache/iota/fey/JsonReceiverActor.scala | 1 -
.../scala/org/apache/iota/fey/Monitor.scala | 14 +-
.../org/apache/iota/fey/Orchestration.scala | 4 +-
.../scala/org/apache/iota/fey/TrieNode.scala | 68 ++---
.../main/scala/org/apache/iota/fey/Utils.scala | 9 +-
.../apache/iota/fey/WatchServiceReceiver.scala | 1 -
.../scala/org/apache/iota/fey/MonitorSpec.scala | 2 +-
.../apache/iota/fey/performer/Application.scala | 22 +-
.../apache/iota/fey/performer/Heartbeat.scala | 33 +--
.../iota/fey/performer/RandomDouble.scala | 33 +--
.../iota/fey/performer/RandomInteger.scala | 33 +--
.../apache/iota/fey/performer/RandomUUID.scala | 33 +--
.../apache/iota/fey/performer/Timestamp.scala | 33 +--
.../org/apache/iota/fey/performer/Sensor.scala | 54 ++--
.../apache/iota/fey/performer/Application.scala | 2 +-
.../iota/fey/performer/ZMQPublisher.scala | 40 +--
.../iota/fey/performer/ZMQSubscriber.scala | 29 +--
scalastyle-config.xml | 249 ++++++++++---------
27 files changed, 394 insertions(+), 358 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/2895047d/fey-core/src/main/resources/application.conf
----------------------------------------------------------------------
[23/31] incubator-iota git commit: Corrected Ensemble.scala according
to the comments
Posted by to...@apache.org.
Corrected Ensemble.scala 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/a91998f4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/a91998f4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/a91998f4
Branch: refs/heads/master
Commit: a91998f4ef27de320dd1844aa85cb555678cd76b
Parents: d4a151a
Author: Shivansh <sh...@gmail.com>
Authored: Tue Nov 15 06:27:55 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Tue Nov 15 06:27:55 2016 +0530
----------------------------------------------------------------------
.../src/main/scala/org/apache/iota/fey/Ensemble.scala | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/a91998f4/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 0e075e3..4db5f98 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
@@ -163,21 +163,21 @@ 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, null)
- if (Option(performerInfo).isDefined) {
+ val performerInfo = performers_metadata.get(performerID)
+ if (performerInfo.isDefined) {
val connections: Map[String, ActorRef] = connectionIDs.map(connID => {
createFeyActor(connID, connectors.getOrElse(connID,Array.empty),tmpActors)
}).toMap
var actor: ActorRef = null
- val actorProps = getPerformer(performerInfo, connections)
- if(performerInfo.autoScale) {
+ val actorProps = getPerformer(performerInfo.get, connections)
+ if(performerInfo.get.autoScale) {
- val resizer = DefaultResizer(lowerBound = performerInfo.lowerBound, upperBound = performerInfo.upperBound,
- messagesPerResize = CONFIG.MESSAGES_PER_RESIZE, backoffThreshold = performerInfo.backoffThreshold, backoffRate = 0.1)
+ val resizer = DefaultResizer(lowerBound = performerInfo.get.lowerBound, upperBound = performerInfo.get.upperBound,
+ messagesPerResize = CONFIG.MESSAGES_PER_RESIZE, backoffThreshold = performerInfo.get.backoffThreshold, backoffRate = 0.1)
val strategy =
- if(performerInfo.isRoundRobin) {
+ if(performerInfo.get.isRoundRobin) {
log.info(s"Using Round Robin for performer ${performerID}")
RoundRobinPool(1, Some(resizer))
} else {
[05/31] incubator-iota git commit: Removed scalastyle in random
integer
Posted by to...@apache.org.
Removed scalastyle in random integer
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/dffae64d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/dffae64d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/dffae64d
Branch: refs/heads/master
Commit: dffae64dda7631f16fb0cb95d3b0ae8a12d3dd94
Parents: e9a9d2b
Author: Shivansh <sh...@gmail.com>
Authored: Thu Nov 3 23:50:39 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Thu Nov 3 23:50:39 2016 +0530
----------------------------------------------------------------------
.../main/scala/org/apache/iota/fey/performer/RandomInteger.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/dffae64d/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala
----------------------------------------------------------------------
diff --git a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala
index 72de479..c104f87 100644
--- a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala
@@ -54,4 +54,4 @@ class RandomInteger(override val params: Map[String, String] = Map.empty,
propagateMessage(ri)
}
-}
\ No newline at end of file
+}
[17/31] incubator-iota git commit: Removed scalastyle in Ensemble
Posted by to...@apache.org.
Removed scalastyle in Ensemble
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/290d67b7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/290d67b7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/290d67b7
Branch: refs/heads/master
Commit: 290d67b71856b9f4a3f9c6901d2d6bf364094242
Parents: 820f2b1
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:38:12 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:38:12 2016 +0530
----------------------------------------------------------------------
.../scala/org/apache/iota/fey/Ensemble.scala | 30 +++++++++++++-------
1 file changed, 19 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/290d67b7/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 a606217..2ce13ff 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,6 +33,7 @@ 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]
@@ -163,13 +164,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, null)
- if(performerInfo != null){
+ val performerInfo = performers_metadata.getOrElse(performerID, DEFAULT_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 = null
+ var actor: ActorRef = DEFAULT_NULL
val actorProps = getPerformer(performerInfo, connections)
if(performerInfo.autoScale) {
@@ -204,6 +205,7 @@ protected class Ensemble(val orchestrationID: String,
/**
* Creates actor props based on JSON configuration
+ *
* @param performerInfo Performer object
* @param connections connections
* @return Props of actor based on JSON config
@@ -271,11 +273,11 @@ object Ensemble {
* @return map of connectors
*/
def extractConnections(connectors: List[JsObject]): Map[String,Array[String]] = {
- connectors.map(connector => {
+ connectors.flatMap(connector => {
connector.keys.map(key => {
(key, (connector \ key).as[List[String]].toArray)
}).toMap
- }).flatten.toMap
+ }).toMap
}
/**
@@ -296,12 +298,18 @@ object Ensemble {
if(lowerBound > upperBound){
throw new IllegalArgumentException(" Could not define performer. Autoscale param: Lower bound greater than upper bound")
}
- val threshold: Double = if (autoScale && (performer \ PERFORMER_AUTO_SCALE).as[JsObject].keys.contains(PERFORMER_BACKOFF_THRESHOLD))
- (performer \ PERFORMER_AUTO_SCALE \ PERFORMER_BACKOFF_THRESHOLD).as[Double] else 0.3
- val roundRobin: Boolean = if (autoScale && (performer \ PERFORMER_AUTO_SCALE).as[JsObject].keys.contains(PERFORMER_ROUND_ROBIN))
- (performer \ PERFORMER_AUTO_SCALE \ PERFORMER_ROUND_ROBIN).as[Boolean] else false
-
-
+ val threshold: Double = if (autoScale && (performer \ PERFORMER_AUTO_SCALE).as[JsObject].keys.contains(PERFORMER_BACKOFF_THRESHOLD)) {
+ (performer \ PERFORMER_AUTO_SCALE \ PERFORMER_BACKOFF_THRESHOLD).as[Double]
+ }
+ else {
+ 0.3
+ }
+ val roundRobin: Boolean = if (autoScale && (performer \ PERFORMER_AUTO_SCALE).as[JsObject].keys.contains(PERFORMER_ROUND_ROBIN)) {
+ (performer \ PERFORMER_AUTO_SCALE \ PERFORMER_ROUND_ROBIN).as[Boolean]
+ }
+ else {
+ false
+ }
val jarName: String = (performer \ SOURCE \ SOURCE_NAME).as[String]
val classPath: String = (performer \ SOURCE \ SOURCE_CLASSPATH).as[String]
val params:Map[String,String] = getMapOfParams((performer \ SOURCE \ SOURCE_PARAMS).as[JsObject])
[26/31] incubator-iota git commit: Corrected TrieNode.scala according
to the comments
Posted by to...@apache.org.
Corrected TrieNode.scala 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/238cf47e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/238cf47e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/238cf47e
Branch: refs/heads/master
Commit: 238cf47e2e67b784aaf44ffb95a6857afe466899
Parents: 5b2c376
Author: Shivansh <sh...@gmail.com>
Authored: Tue Nov 15 06:46:23 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Tue Nov 15 06:46:23 2016 +0530
----------------------------------------------------------------------
.../scala/org/apache/iota/fey/TrieNode.scala | 60 ++++++++++----------
1 file changed, 31 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/238cf47e/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 902e5f2..2abbb86 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,25 +29,27 @@ case class TrieNode(path: String, children: ArrayBuffer[TrieNode], events:ArrayB
protected class Trie(systemName: String){
- private val root: TrieNode = TrieNode(systemName, ArrayBuffer.empty, ArrayBuffer.empty)
+ private val DEFAULT_TRIE_NODE = TrieNode(systemName, ArrayBuffer.empty, ArrayBuffer.empty
+
+ private val root: Option[TrieNode] = Option(DEFAULT_TRIE_NODE)
var elements: Int = 0
def append(path: String, event: Monitor.MonitorEvent = null): Unit = {
- append(path.replaceFirst("akka://","").split("/"),root,1,event)
+ append(path.replaceFirst("akka://", "").split("/"), root, 1, event)
}
- @tailrec private def append(path: Array[String], root: TrieNode, index: Int, event: Monitor.MonitorEvent): Unit = {
- if (Option(root).isDefined && index < path.length) {
- var nextRoot = root.children.filter(child => child.path == path(index))
+ @tailrec private def append(path: Array[String], root: Option[TrieNode], index: Int, event: Monitor.MonitorEvent): Unit = {
+ if (root.isDefined && index < path.length) {
+ var nextRoot = root.fold(DEFAULT_TRIE_NODE)(identity).children.filter(child => child.path == path(index))
if(nextRoot.isEmpty){
nextRoot = ArrayBuffer(TrieNode(path(index), ArrayBuffer.empty, ArrayBuffer.empty))
- root.children += nextRoot(0)
+ root.fold(DEFAULT_TRIE_NODE)(identity).children += nextRoot(0)
elements += 1
}
if (Option(event).isDefined && index == path.length - 1) {
nextRoot(0).events += event
}
- append(path, nextRoot(0), index + 1, event)
+ append(path, nextRoot.headOption, index + 1, event)
}
}
@@ -55,13 +57,13 @@ protected class Trie(systemName: String){
recHasPath(root, path.replaceFirst("akka://","").split("/"),1)
}
- @tailrec private def recHasPath(root: TrieNode, path: Array[String], index: Int): Boolean = {
- if (Option(root).isDefined && index < path.length) {
- var nextRoot = root.children.filter(child => child.path == path(index))
+ @tailrec private def recHasPath(root: Option[TrieNode], path: Array[String], index: Int): Boolean = {
+ if (root.isDefined && index < path.length) {
+ var nextRoot = root.fold(DEFAULT_TRIE_NODE)(identity).children.filter(child => child.path == path(index))
if(nextRoot.isEmpty){
false
}else{
- recHasPath(nextRoot(0), path, index + 1)
+ recHasPath(nextRoot.headOption, path, index + 1)
}
}else{
true
@@ -72,16 +74,16 @@ protected class Trie(systemName: String){
recGetNode(root, path.replaceFirst("akka://","").split("/"),1)
}
- @tailrec private def recGetNode(root: TrieNode, path: Array[String], index: Int): Option[TrieNode]= {
- if (Option(root).isDefined && index < path.length) {
- var nextRoot = root.children.filter(child => child.path == path(index))
+ @tailrec private def recGetNode(root: Option[TrieNode], path: Array[String], index: Int): Option[TrieNode] = {
+ if (root.isDefined && index < path.length) {
+ var nextRoot = root.fold(DEFAULT_TRIE_NODE)(identity).children.filter(child => child.path == path(index))
if(nextRoot.isEmpty){
None
}else{
if(path.length - 1 == index){
Some(nextRoot(0))
}else {
- recGetNode(nextRoot(0), path, index + 1)
+ recGetNode(nextRoot.headOption, path, index + 1)
}
}
}else{
@@ -91,8 +93,8 @@ protected class Trie(systemName: String){
def removeAllNodes(): Unit = {
var index = 0
- while(index < root.children.length){
- root.children.remove(index)
+ while (index < root.fold(DEFAULT_TRIE_NODE)(identity).children.length) {
+ root.fold(DEFAULT_TRIE_NODE)(identity).children.remove(index)
index += 1
}
elements = 0
@@ -107,31 +109,31 @@ protected class Trie(systemName: String){
}
def getRootChildren():ArrayBuffer[TrieNode] = {
- root.children
+ root.fold(DEFAULT_TRIE_NODE)(identity).children
}
- private def getObject(root: TrieNode, parent: TrieNode):JsObject = {
- if (Option(root).isDefined) {
- Json.obj("name" -> root.path,
- "parent" -> (if (Option(parent).isDefined) parent.path else "null"),
- "children" -> root.children.map(getObject(_, root))
+ private def getObject(root: Option[TrieNode], parent: Option[TrieNode]): JsObject = {
+ if (root.isDefined) {
+ Json.obj("name" -> root.fold(DEFAULT_TRIE_NODE)(identity).path,
+ "parent" -> (if (parent.isDefined) parent.fold(DEFAULT_TRIE_NODE)(identity).path else "null"),
+ "children" -> root.fold(DEFAULT_TRIE_NODE)(identity).children.map(a => getObject(Option(a), root))
)
}else{
Json.obj()
}
}
- private def getObjectEvent(root: TrieNode, parent: TrieNode):JsObject = {
- if (Option(root).isDefined) {
- Json.obj("name" -> root.path,
- "parent" -> (if (Option(parent).isDefined) parent.path else "null"),
- "events" -> root.events.map(event => {
+ private def getObjectEvent(root: Option[TrieNode], parent: Option[TrieNode]):JsObject = {
+ if (root.isDefined) {
+ Json.obj("name" -> root.fold(DEFAULT_TRIE_NODE)(identity).path,
+ "parent" -> (if (parent.isDefined) parent.fold(DEFAULT_TRIE_NODE)(identity).path else "null"),
+ "events" -> root.fold(DEFAULT_TRIE_NODE)(identity).events.map(event => {
Json.obj("type" -> event.event,
"timestamp" -> event.timestamp,
"info" -> event.info
)
}),
- "children" -> root.children.map(getObjectEvent(_, root))
+ "children" -> root.fold(DEFAULT_TRIE_NODE)(identity).children.map(a=>getObjectEvent(Option(a), root))
)
}else{
Json.obj()
[21/31] incubator-iota git commit: Optimized the imports
Posted by to...@apache.org.
Optimized the imports
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/cf837455
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/cf837455
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/cf837455
Branch: refs/heads/master
Commit: cf837455385e78c671eb6df4965ed50b9c3defd4
Parents: 2be0905
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:55:45 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:55:45 2016 +0530
----------------------------------------------------------------------
.../src/main/scala/org/apache/iota/fey/FeyCore.scala | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/cf837455/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala b/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
index 5e5522b..9c2b61d 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/FeyCore.scala
@@ -17,25 +17,23 @@
package org.apache.iota.fey
-import java.nio.file.Paths
import java.io.File
-import scala.concurrent.duration._
-import akka.actor.{Actor, ActorLogging, ActorRef, OneForOneStrategy, PoisonPill, Props, Terminated}
-import Utils._
import akka.actor.SupervisorStrategy._
-import play.api.libs.json._
-import JSON_PATH._
+import akka.actor.{Actor, ActorLogging, ActorRef, OneForOneStrategy, PoisonPill, Props, Terminated}
import akka.routing.GetRoutees
-import org.apache.iota.fey.Orchestration.{CREATE_ENSEMBLES, DELETE_ENSEMBLES, UPDATE_ENSEMBLES}
import com.eclipsesource.schema._
+import org.apache.iota.fey.JSON_PATH._
+import org.apache.iota.fey.Orchestration.{CREATE_ENSEMBLES, DELETE_ENSEMBLES, UPDATE_ENSEMBLES}
+import org.apache.iota.fey.Utils._
+import play.api.libs.json._
import scala.collection.mutable.HashMap
+import scala.concurrent.duration._
protected class FeyCore extends Actor with ActorLogging{
import FeyCore._
- import CONFIG._
val monitoring_actor = FEY_MONITOR.actorRef
[29/31] incubator-iota git commit: Resolved the error for MonitorSpec
Posted by to...@apache.org.
Resolved the error for MonitorSpec
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/436c504f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/436c504f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/436c504f
Branch: refs/heads/master
Commit: 436c504f32435f4ebccfc99515460d7c617d6105
Parents: 7911821
Author: Shivansh <sh...@gmail.com>
Authored: Tue Nov 22 15:26:31 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Tue Nov 22 15:26:31 2016 +0530
----------------------------------------------------------------------
fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/436c504f/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala b/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
index 98fa3e8..340958f 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/Monitor.scala
@@ -87,7 +87,7 @@ protected class Monitor(eventsStore: Trie) extends Actor with ActorLogging {
case _ =>
}
- def logInfo(path: String, event: String, timestamp: Long, info: String, reason: Option[Throwable] = null): Unit = {
+ def logInfo(path: String, event: String, timestamp: Long, info: String, reason: Option[Throwable] = None): Unit = {
if (reason.isDefined) {
log.error(reason.get, s"$event | $timestamp | $path | $info")
}else{
[28/31] incubator-iota git commit: Resolved error for FeyGenericActor
Posted by to...@apache.org.
Resolved error for FeyGenericActor
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/79118216
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/79118216
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/79118216
Branch: refs/heads/master
Commit: 79118216c3f282a3019d3db3dda813cd58563215
Parents: e96b066
Author: Shivansh <sh...@gmail.com>
Authored: Tue Nov 22 15:24:21 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Tue Nov 22 15:24:21 2016 +0530
----------------------------------------------------------------------
fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActor.scala | 2 +-
fey-core/src/test/scala/org/apache/iota/fey/MonitorSpec.scala | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/79118216/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 d5be525..5114c95 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
@@ -113,7 +113,7 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
private final def stopScheduler() = {
if (scheduler.isDefined) {
scheduler.get.cancel()
- scheduler = null
+ scheduler = None
}
}
/**
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/79118216/fey-core/src/test/scala/org/apache/iota/fey/MonitorSpec.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/test/scala/org/apache/iota/fey/MonitorSpec.scala b/fey-core/src/test/scala/org/apache/iota/fey/MonitorSpec.scala
index 3008518..43499ef 100644
--- a/fey-core/src/test/scala/org/apache/iota/fey/MonitorSpec.scala
+++ b/fey-core/src/test/scala/org/apache/iota/fey/MonitorSpec.scala
@@ -122,7 +122,7 @@ class MonitorSpec extends BaseAkkaSpec{
}
"result in logging error when throwable is specified" in {
EventFilter[IllegalArgumentException](occurrences = 1) intercept {
- monitorRef.underlyingActor.logInfo("path", "STOP", 1, "info", new IllegalArgumentException("Test"))
+ monitorRef.underlyingActor.logInfo("path", "STOP", 1, "info", Option(new IllegalArgumentException("Test")))
}
}
}
[22/31] incubator-iota git commit: Reverted the Default null case
according to the comments
Posted by to...@apache.org.
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 <sh...@gmail.com>
Authored: Sat Nov 5 04:01:12 2016 +0530
Committer: Shivansh <sh...@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 = {
[15/31] incubator-iota git commit: Removed scalastyle in TrieNode
Posted by to...@apache.org.
Removed scalastyle in TrieNode
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/15ab0a81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/15ab0a81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/15ab0a81
Branch: refs/heads/master
Commit: 15ab0a8126e010ef6af20eec4016aaf159154d70
Parents: 6f4e0be
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:30:40 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:30:40 2016 +0530
----------------------------------------------------------------------
.../scala/org/apache/iota/fey/TrieNode.scala | 28 +++++++++++---------
1 file changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/15ab0a81/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 4de3da7..5afd3ee 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
@@ -17,7 +17,7 @@
package org.apache.iota.fey
-import play.api.libs.json.{JsArray, JsObject, JsValue, Json}
+import play.api.libs.json.{JsObject, JsValue, Json}
import scala.annotation.tailrec
import scala.collection.mutable.ArrayBuffer
@@ -29,25 +29,27 @@ 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 = null): Unit = {
+ def append(path: String, event: Monitor.MonitorEvent = DEFAULT_NULL): Unit = {
append(path.replaceFirst("akka://","").split("/"),root,1,event)
}
@tailrec private def append(path: Array[String], root: TrieNode, index: Int, event: Monitor.MonitorEvent): Unit = {
- if(root != null && index < path.length){
+ if (Option(root).isDefined && index < path.length) {
var nextRoot = root.children.filter(child => child.path == path(index))
if(nextRoot.isEmpty){
nextRoot = ArrayBuffer(TrieNode(path(index), ArrayBuffer.empty, ArrayBuffer.empty))
root.children += nextRoot(0)
elements += 1
}
- if(event != null && index == path.length - 1){
+ if (Option(event).isDefined && index == path.length - 1) {
nextRoot(0).events += event
}
- append(path, nextRoot(0),index+1, event)
+ append(path, nextRoot(0), index + 1, event)
}
}
@@ -56,7 +58,7 @@ protected class Trie(systemName: String){
}
@tailrec private def recHasPath(root: TrieNode, path: Array[String], index: Int): Boolean = {
- if(root != null && index < path.length) {
+ if (Option(root).isDefined && index < path.length) {
var nextRoot = root.children.filter(child => child.path == path(index))
if(nextRoot.isEmpty){
false
@@ -73,7 +75,7 @@ protected class Trie(systemName: String){
}
@tailrec private def recGetNode(root: TrieNode, path: Array[String], index: Int): Option[TrieNode]= {
- if(root != null && index < path.length) {
+ if (Option(root).isDefined && index < path.length) {
var nextRoot = root.children.filter(child => child.path == path(index))
if(nextRoot.isEmpty){
None
@@ -99,11 +101,11 @@ protected class Trie(systemName: String){
}
def print:JsValue = {
- getObject(root, null)
+ getObject(root, DEFAULT_NULL)
}
def printWithEvents:JsValue = {
- getObjectEvent(root, null)
+ getObjectEvent(root, DEFAULT_NULL)
}
def getRootChildren():ArrayBuffer[TrieNode] = {
@@ -111,9 +113,9 @@ protected class Trie(systemName: String){
}
private def getObject(root: TrieNode, parent: TrieNode):JsObject = {
- if(root != null) {
+ if (Option(root).isDefined) {
Json.obj("name" -> root.path,
- "parent" -> (if(parent != null) parent.path else "null"),
+ "parent" -> (if (Option(parent).isDefined) parent.path else "null"),
"children" -> root.children.map(getObject(_, root))
)
}else{
@@ -122,9 +124,9 @@ protected class Trie(systemName: String){
}
private def getObjectEvent(root: TrieNode, parent: TrieNode):JsObject = {
- if(root != null) {
+ if (Option(root).isDefined) {
Json.obj("name" -> root.path,
- "parent" -> (if(parent != null) parent.path else "null"),
+ "parent" -> (if (Option(parent).isDefined) parent.path else "null"),
"events" -> root.events.map(event => {
Json.obj("type" -> event.event,
"timestamp" -> event.timestamp,
[20/31] incubator-iota git commit: Removed scalastyle in
feyGenericActorReciever
Posted by to...@apache.org.
Removed scalastyle in feyGenericActorReciever
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/2be09059
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/2be09059
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/2be09059
Branch: refs/heads/master
Commit: 2be0905961ce6382206201f16c4171ebeba736c6
Parents: 57916d7
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:44:48 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:44:48 2016 +0530
----------------------------------------------------------------------
.../main/scala/org/apache/iota/fey/FeyGenericActorReceiver.scala | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/2be09059/fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActorReceiver.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActorReceiver.scala b/fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActorReceiver.scala
index 7361d01..e3b8001 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActorReceiver.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/FeyGenericActorReceiver.scala
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -173,7 +172,7 @@ abstract class FeyGenericActorReceiver(override val params: Map[String,String] =
}catch{
case e: Exception =>
- if(outputStream != null) {
+ if(Option(outputStream).isDefined) {
outputStream.close()
(new File(s"${CONFIG.DYNAMIC_JAR_REPO}/$jarName")).delete()
}
[07/31] incubator-iota git commit: Removed scalastyle in
heartbeat.scala
Posted by to...@apache.org.
Removed scalastyle in heartbeat.scala
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/0d9e6b1a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/0d9e6b1a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/0d9e6b1a
Branch: refs/heads/master
Commit: 0d9e6b1adaf59d02113f83052fd546275e16a46c
Parents: dace138
Author: Shivansh <sh...@gmail.com>
Authored: Thu Nov 3 23:53:07 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Thu Nov 3 23:53:07 2016 +0530
----------------------------------------------------------------------
.../apache/iota/fey/performer/Heartbeat.scala | 33 ++++++++++----------
1 file changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/0d9e6b1a/performers/stream/src/main/scala/org/apache/iota/fey/performer/Heartbeat.scala
----------------------------------------------------------------------
diff --git a/performers/stream/src/main/scala/org/apache/iota/fey/performer/Heartbeat.scala b/performers/stream/src/main/scala/org/apache/iota/fey/performer/Heartbeat.scala
index cf2e87d..9409c63 100644
--- a/performers/stream/src/main/scala/org/apache/iota/fey/performer/Heartbeat.scala
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/Heartbeat.scala
@@ -1,18 +1,19 @@
-
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// ee the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.iota.fey.performer
@@ -52,4 +53,4 @@ class Heartbeat(override val params: Map[String, String] = Map.empty,
propagateMessage("alive")
}
-}
\ No newline at end of file
+}
[03/31] incubator-iota git commit: Removed scalastyle of application
for println
Posted by to...@apache.org.
Removed scalastyle of application for println
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/3c71962d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/3c71962d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/3c71962d
Branch: refs/heads/master
Commit: 3c71962dfb8f1d5df414a5b6dfb273e4e2e2a8f6
Parents: 41433b8
Author: Shivansh <sh...@gmail.com>
Authored: Thu Nov 3 23:46:53 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Thu Nov 3 23:46:53 2016 +0530
----------------------------------------------------------------------
.../src/main/scala/org/apache/iota/fey/performer/Application.scala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/3c71962d/performers/zmq/src/main/scala/org/apache/iota/fey/performer/Application.scala
----------------------------------------------------------------------
diff --git a/performers/zmq/src/main/scala/org/apache/iota/fey/performer/Application.scala b/performers/zmq/src/main/scala/org/apache/iota/fey/performer/Application.scala
index d99a826..c745bbb 100644
--- a/performers/zmq/src/main/scala/org/apache/iota/fey/performer/Application.scala
+++ b/performers/zmq/src/main/scala/org/apache/iota/fey/performer/Application.scala
@@ -22,7 +22,7 @@ import scala.concurrent.duration._
object Application extends App {
- //println("Starting")
+ //print("Starting")
//implicit val system = ActorSystem("ZMQ-RUN")
[12/31] incubator-iota git commit: Removed scalastyle in ZMQPublisher
and FeyUIServicer
Posted by to...@apache.org.
Removed scalastyle in ZMQPublisher and FeyUIServicer
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/e5560ee4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/e5560ee4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/e5560ee4
Branch: refs/heads/master
Commit: e5560ee48987c8f0c428742aaf33e9c814b6f717
Parents: 2b585a1
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:19:08 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:19:08 2016 +0530
----------------------------------------------------------------------
fey-core/src/main/scala/org/apache/iota/fey/FeyUIService.scala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/e5560ee4/fey-core/src/main/scala/org/apache/iota/fey/FeyUIService.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/FeyUIService.scala b/fey-core/src/main/scala/org/apache/iota/fey/FeyUIService.scala
index cb48192..46dd832 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/FeyUIService.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/FeyUIService.scala
@@ -38,10 +38,11 @@ object FeyUIService {
class FeyUIService(urlPath: String, port: Int) extends NettyServerComponents with BuiltInComponents {
+ val THREAD_SLEEP_TIME = 2000
lazy val router = Router.from {
case GET(p"/fey/activeactors") => Action {
FEY_CORE_ACTOR.actorRef ! JSON_TREE
- Thread.sleep(2000)
+ Thread.sleep(THREAD_SLEEP_TIME)
val json = IdentifyFeyActors.generateTreeJson()
val jsonTree: String = IdentifyFeyActors.getHTMLTree(json)
Results.Ok(jsonTree).as("text/html")
[30/31] incubator-iota git commit: Removed the null error
Posted by to...@apache.org.
Removed the null error
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/800ceead
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/800ceead
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/800ceead
Branch: refs/heads/master
Commit: 800ceeadc1af59acf25b987ca7f75f164d8f5133
Parents: 436c504
Author: Shivansh <sh...@gmail.com>
Authored: Tue Nov 22 15:44:32 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Tue Nov 22 15:44:32 2016 +0530
----------------------------------------------------------------------
fey-core/src/main/scala/org/apache/iota/fey/TrieNode.scala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/800ceead/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 bbcb50d..0e2a087 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
@@ -101,11 +101,11 @@ protected class Trie(systemName: String){
}
def print:JsValue = {
- getObject(root, null)
+ getObject(root, None)
}
def printWithEvents:JsValue = {
- getObjectEvent(root, null)
+ getObjectEvent(root, None)
}
def getRootChildren():ArrayBuffer[TrieNode] = {
[06/31] incubator-iota git commit: Removed scalastyle in
Timestamp.scalar
Posted by to...@apache.org.
Removed scalastyle in Timestamp.scalar
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/dace1384
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/dace1384
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/dace1384
Branch: refs/heads/master
Commit: dace13842f75f1765d32b43de1d4c716ba480e91
Parents: dffae64
Author: Shivansh <sh...@gmail.com>
Authored: Thu Nov 3 23:51:53 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Thu Nov 3 23:51:53 2016 +0530
----------------------------------------------------------------------
.../apache/iota/fey/performer/Timestamp.scala | 33 ++++++++++----------
1 file changed, 17 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/dace1384/performers/stream/src/main/scala/org/apache/iota/fey/performer/Timestamp.scala
----------------------------------------------------------------------
diff --git a/performers/stream/src/main/scala/org/apache/iota/fey/performer/Timestamp.scala b/performers/stream/src/main/scala/org/apache/iota/fey/performer/Timestamp.scala
index c138118..b0dfcb9 100644
--- a/performers/stream/src/main/scala/org/apache/iota/fey/performer/Timestamp.scala
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/Timestamp.scala
@@ -1,18 +1,19 @@
-
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// ee the License for the specific language governing permissions and
-// limitations under the License.
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.apache.iota.fey.performer
@@ -53,4 +54,4 @@ class Timestamp(override val params: Map[String, String] = Map.empty,
propagateMessage(ts)
}
-}
\ No newline at end of file
+}
[24/31] incubator-iota git commit: Corrected FeyGenericActor.scala
according to the comments
Posted by to...@apache.org.
Corrected FeyGenericActor.scala 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/9142e653
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/9142e653
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/9142e653
Branch: refs/heads/master
Commit: 9142e65391b054561e0cfd12cb032f40dcdb49ce
Parents: a91998f
Author: Shivansh <sh...@gmail.com>
Authored: Tue Nov 15 06:31:39 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Tue Nov 15 06:31:39 2016 +0530
----------------------------------------------------------------------
.../scala/org/apache/iota/fey/FeyGenericActor.scala | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/9142e653/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 970a99f..d5be525 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
@@ -50,7 +50,7 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
/**
* Keeps reference to the cancellable
*/
- @volatile private var scheduler: Cancellable = null
+ @volatile private var scheduler: Option[Cancellable] = None
@volatile private var endBackoff: Long = 0
private[fey] val monitoring_actor = FEY_MONITOR.actorRef
@@ -111,8 +111,8 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
* Stops the scheduler
*/
private final def stopScheduler() = {
- if (Option(scheduler).isDefined) {
- scheduler.cancel()
+ if (scheduler.isDefined) {
+ scheduler.get.cancel()
scheduler = null
}
}
@@ -129,14 +129,14 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
* The time interval to be used is the one passed to the constructor
*/
private final def startScheduler() = {
- if(Option(scheduler).isEmpty && schedulerTimeInterval.toNanos != 0){
- scheduler = context.system.scheduler.schedule(1.seconds, schedulerTimeInterval){
+ if (scheduler.isEmpty && schedulerTimeInterval.toNanos != 0) {
+ scheduler = Option(context.system.scheduler.schedule(1.seconds, schedulerTimeInterval) {
try{
execute()
}catch{
case e: Exception => self ! EXCEPTION(e)
}
- }
+ })
}
}
@@ -146,7 +146,7 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
* @return true if scheduller is running
*/
final def isShedulerRunning():Boolean = {
- if(Option(scheduler).isDefined && !scheduler.isCancelled){
+ if(scheduler.isDefined && !scheduler.get.isCancelled){
true
}else{
false
[14/31] incubator-iota git commit: Removed scalastyle in
FeyGenericActor
Posted by to...@apache.org.
Removed scalastyle in FeyGenericActor
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/6f4e0bee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/6f4e0bee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/6f4e0bee
Branch: refs/heads/master
Commit: 6f4e0beeaed4d41993a8f1a8a97ee72547621b94
Parents: a0bca13
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:24:19 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:24:19 2016 +0530
----------------------------------------------------------------------
.../org/apache/iota/fey/FeyGenericActor.scala | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/6f4e0bee/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 36f39fa..dd83ce1 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
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -45,12 +44,14 @@ 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 = null
+ @volatile private var scheduler: Cancellable = DEFAULT_NULL
@volatile private var endBackoff: Long = 0
private[fey] val monitoring_actor = FEY_MONITOR.actorRef
@@ -111,9 +112,9 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
* Stops the scheduler
*/
private final def stopScheduler() = {
- if (scheduler != null) {
+ if (Option(scheduler).isDefined) {
scheduler.cancel()
- scheduler = null
+ scheduler = DEFAULT_NULL
}
}
/**
@@ -129,7 +130,7 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
* The time interval to be used is the one passed to the constructor
*/
private final def startScheduler() = {
- if(scheduler == null && schedulerTimeInterval.toNanos != 0){
+ if(Option(scheduler).isEmpty && schedulerTimeInterval.toNanos != 0){
scheduler = context.system.scheduler.schedule(1.seconds, schedulerTimeInterval){
try{
execute()
@@ -142,10 +143,11 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
/**
* Check state of scheduler
+ *
* @return true if scheduller is running
*/
final def isShedulerRunning():Boolean = {
- if(scheduler != null && !scheduler.isCancelled){
+ if(Option(scheduler).isDefined && !scheduler.isCancelled){
true
}else{
false
@@ -154,6 +156,7 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
/**
* get endBackoff
+ *
* @return
*/
final def getEndBackoff(): Long = {
@@ -170,6 +173,7 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
* Called every time actors receives the PROCESS message.
* The default implementation propagates the message to the connected actors
* and fires up the backoff
+ *
* @param message message to be processed
* @tparam T Any
*/
@@ -220,12 +224,14 @@ abstract class FeyGenericActor(val params: Map[String,String] = Map.empty,
/**
* Used to set a info message when sending Stop monitor events
+ *
* @return String info
*/
def stopMonitorInfo:String = "Stopped"
/**
* Used to set a info message when sending Start monitor events
+ *
* @return String info
*/
def startMonitorInfo:String = "Started"
@@ -263,3 +269,4 @@ object FeyGenericActor {
+
[13/31] incubator-iota git commit: Removed scalastyle in JsonReciever
Posted by to...@apache.org.
Removed scalastyle in JsonReciever
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/a0bca13c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/a0bca13c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/a0bca13c
Branch: refs/heads/master
Commit: a0bca13c57f82c9ad519962abea898b9baebf685
Parents: e5560ee
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:20:59 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:20:59 2016 +0530
----------------------------------------------------------------------
fey-core/src/main/scala/org/apache/iota/fey/JsonReceiver.scala | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/a0bca13c/fey-core/src/main/scala/org/apache/iota/fey/JsonReceiver.scala
----------------------------------------------------------------------
diff --git a/fey-core/src/main/scala/org/apache/iota/fey/JsonReceiver.scala b/fey-core/src/main/scala/org/apache/iota/fey/JsonReceiver.scala
index 6781f01..c9e1925 100644
--- a/fey-core/src/main/scala/org/apache/iota/fey/JsonReceiver.scala
+++ b/fey-core/src/main/scala/org/apache/iota/fey/JsonReceiver.scala
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -146,7 +145,7 @@ trait JsonReceiver extends Runnable{
}catch{
case e: Exception =>
- if(outputStream != null) {
+ if (Option(outputStream).isDefined) {
outputStream.close()
(new File(s"${CONFIG.DYNAMIC_JAR_REPO}/$jarName")).delete()
}
[04/31] incubator-iota git commit: Removed scalastyle of application
for println in performer
Posted by to...@apache.org.
Removed scalastyle of application for println in performer
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/e9a9d2b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/e9a9d2b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/e9a9d2b3
Branch: refs/heads/master
Commit: e9a9d2b3357040accce1e3c6a881964574104146
Parents: 3c71962
Author: Shivansh <sh...@gmail.com>
Authored: Thu Nov 3 23:49:12 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Thu Nov 3 23:49:12 2016 +0530
----------------------------------------------------------------------
.../apache/iota/fey/performer/Application.scala | 22 ++++++++++----------
1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/e9a9d2b3/performers/stream/src/main/scala/org/apache/iota/fey/performer/Application.scala
----------------------------------------------------------------------
diff --git a/performers/stream/src/main/scala/org/apache/iota/fey/performer/Application.scala b/performers/stream/src/main/scala/org/apache/iota/fey/performer/Application.scala
index ce5164d..3ba4f1a 100644
--- a/performers/stream/src/main/scala/org/apache/iota/fey/performer/Application.scala
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/Application.scala
@@ -24,16 +24,16 @@ import scala.concurrent.duration._
object Application extends App {
-// println("Starting")
-//
-// implicit val system = ActorSystem("STREAM-RUN")
-//
-// val timestamp = system.actorOf(Props(classOf[Timestamp], Map.empty, 1.minutes, Map.empty, 1.seconds, "", "", false), name = "TIMESTAMP")
-//
-// timestamp ! PROCESS("Stream it")
-//
-// val heartbeat = system.actorOf(Props(classOf[Heartbeat], Map.empty, 1.minutes, Map.empty, 1.seconds, "", "", false), name = "HEARTBEAT")
-//
-// heartbeat ! PROCESS("Stream it")
+ /* print("Starting")
+ implicit val system = ActorSystem("STREAM-RUN")
+
+ val timestamp = system.actorOf(Props(classOf[Timestamp], Map.empty, 1.minutes, Map.empty, 1.seconds, "", "", false), name = "TIMESTAMP")
+
+ timestamp ! PROCESS("Stream it")
+
+ val heartbeat = system.actorOf(Props(classOf[Heartbeat], Map.empty, 1.minutes, Map.empty, 1.seconds, "", "", false), name = "HEARTBEAT")
+
+ heartbeat ! PROCESS("Stream it")
+*/
}
[10/31] incubator-iota git commit: Removed scalastyle in ZMQPublisher
Posted by to...@apache.org.
Removed scalastyle in ZMQPublisher
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/7cc1745a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/7cc1745a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/7cc1745a
Branch: refs/heads/master
Commit: 7cc1745a5dcb8c200fd8d6087d9614807a881574
Parents: 1f0895c
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:06:40 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:06:40 2016 +0530
----------------------------------------------------------------------
.../iota/fey/performer/ZMQPublisher.scala | 40 +++++++++++---------
1 file changed, 22 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/7cc1745a/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 d7dbf90..252a8bc 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
@@ -32,24 +32,27 @@ class ZMQPublisher(override val params: Map[String, String] = Map.empty,
override val autoScale: Boolean = false) extends FeyGenericActor {
//-------default params----------
- var port: Int = 5559
+ val DEFAULT_PORT = 5559
+ var port: Int = DEFAULT_PORT
var target: String = "localhost"
+ val DEFAULT_LINGER = 200
+ val DEFAULT_HMW = 10
//-------class vars-------------------
var ctx: ZMQ.Context = null
var pub: ZMQ.Socket = null
var count: Int = 0
- override def onStart = {
+ override def onStart: Unit = {
log.info("Starting ZMQ Publisher")
try {
- _params_check()
+ checkParams()
ctx = ZMQ.context(1)
pub = ctx.socket(ZMQ.PUB)
- pub.setLinger(200)
- pub.setHWM(10)
+ pub.setLinger(DEFAULT_LINGER)
+ pub.setHWM(DEFAULT_HMW)
pub.connect("tcp://" + target + ":" + port)
}
catch {
@@ -57,23 +60,23 @@ class ZMQPublisher(override val params: Map[String, String] = Map.empty,
}
}
- override def onStop = {
+ override def onStop: Unit = {
pub.disconnect("tcp://" + target + ":" + port)
}
- override def onRestart(reason: Throwable) = {
+ override def onRestart(reason: Throwable): Unit = {
// Called after actor is up and running - after self restart
try {
- if (pub != null) {
+ if (Option(pub).isDefined) {
pub.close()
}
- if (ctx != null) {
+ if (Option(ctx).isDefined) {
ctx.close()
}
ctx = ZMQ.context(1)
pub = ctx.socket(ZMQ.PUB)
- pub.setLinger(200)
- pub.setHWM(10)
+ pub.setLinger(DEFAULT_LINGER)
+ pub.setHWM(DEFAULT_HMW)
pub.connect("tcp://" + target + ":" + port)
}
catch {
@@ -87,7 +90,7 @@ class ZMQPublisher(override val params: Map[String, String] = Map.empty,
case x => log.debug(s"Untreated $x")
}
- override def execute() = {
+ override def execute(): Unit = {
log.debug(s"Msg count: $count")
}
@@ -96,7 +99,7 @@ class ZMQPublisher(override val params: Map[String, String] = Map.empty,
message match {
case message: String =>
// Assuming each String message has only point data
- _zmq_send(s"$message")
+ sendZMQ(s"$message")
// case message: Map[String, (String,String,String,String)] =>
// val formatted_msgs: Array[String] = message.map(point => _format_messages(point._2)).toArray
@@ -106,20 +109,20 @@ class ZMQPublisher(override val params: Map[String, String] = Map.empty,
}
}
- def _format_messages(fields: (String, String, String, String)): String = {
+ def formatMessages(fields: (String, String, String, String)): String = {
// The tuple has the following elements: lrn, timestamp, value, type
// And we have to create a message with the format:
// DATA|cloud|lrn|timestamp|{"<type>" : <value>}
- "DATA|cloud|" + fields._1 + "|" + fields._2 + "|" + s"""{"${fields._3}":"${fields._4}"}"""
+ s"""DATA|cloud| ${fields._1}|${fields._2}|{"${fields._3}":"${fields._4}"}"""
}
- def _zmq_send(Message: String) = {
- log.debug(s"messsage =$Message")
+ def sendZMQ(Message: String): Unit = {
+ log.debug(s"message =$Message")
pub.send(Message)
count += 1
}
- def _params_check() = {
+ def checkParams(): Unit = {
if (params.contains("zmq_port")) {
port = params("zmq_port").toInt
}
@@ -132,3 +135,4 @@ class ZMQPublisher(override val params: Map[String, String] = Map.empty,
+
[11/31] incubator-iota git commit: Removed scalastyle in ZMQPublisher
and ZMQSubscriber
Posted by to...@apache.org.
Removed scalastyle in ZMQPublisher and ZMQSubscriber
Project: http://git-wip-us.apache.org/repos/asf/incubator-iota/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-iota/commit/2b585a1f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/2b585a1f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/2b585a1f
Branch: refs/heads/master
Commit: 2b585a1f018ea77daed68ba4856e8ac202352fa2
Parents: 7cc1745
Author: Shivansh <sh...@gmail.com>
Authored: Fri Nov 4 00:17:00 2016 +0530
Committer: Shivansh <sh...@gmail.com>
Committed: Fri Nov 4 00:17:00 2016 +0530
----------------------------------------------------------------------
.../iota/fey/performer/ZMQPublisher.scala | 8 +++--
.../iota/fey/performer/ZMQSubscriber.scala | 38 ++++++++++----------
2 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/2b585a1f/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 252a8bc..0f19aa0 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,14 +33,16 @@ 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 = null
- var pub: ZMQ.Socket = null
+ var ctx: ZMQ.Context = DEFAULT_NULL
+ var pub: ZMQ.Socket = DEFAULT_NULL
var count: Int = 0
override def onStart: Unit = {
@@ -113,7 +115,7 @@ class ZMQPublisher(override val params: Map[String, String] = Map.empty,
// The tuple has the following elements: lrn, timestamp, value, type
// And we have to create a message with the format:
// DATA|cloud|lrn|timestamp|{"<type>" : <value>}
- s"""DATA|cloud| ${fields._1}|${fields._2}|{"${fields._3}":"${fields._4}"}"""
+ s"""DATA|cloud| ${fields._1}|${fields._2}|{${fields._3}:${fields._4}}"""
}
def sendZMQ(Message: String): Unit = {
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/2b585a1f/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 c7d0381..7e51980 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
@@ -31,25 +31,25 @@ class ZMQSubscriber(override val params: Map[String, String] = Map.empty,
override val autoScale: Boolean = false) extends FeyGenericActor {
//-------default params----------
- var port: Int = 5563
+ 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 = null
- var pub: ZMQ.Socket = null
+ var ctx: ZMQ.Context = DEFAULT_NULL
+ var pub: ZMQ.Socket = DEFAULT_NULL
var count: Int = 0
- override def onStart = {
+ override def onStart: Unit = {
log.info("Starting ZMQ Subscriber")
try {
-
- _params_check()
+ checkParams()
// Prepare our context and subscriber
ctx = ZMQ.context(1)
val subscriber = ctx.socket(ZMQ.SUB)
-
subscriber.bind(s"tcp://$target:$port")
subscriber.subscribe(topic_filter.getBytes())
while (true) {
@@ -66,21 +66,21 @@ class ZMQSubscriber(override val params: Map[String, String] = Map.empty,
}
}
- override def onStop = {
+ override def onStop: Unit = {
pub.disconnect("tcp://" + target + ":" + port)
pub.close()
ctx.close()
- pub = null
- ctx = null
+ pub = DEFAULT_NULL
+ ctx = DEFAULT_NULL
}
- override def onRestart(reason: Throwable) = {
+ override def onRestart(reason: Throwable): Unit = {
// Called after actor is up and running - after self restart
try {
- if (pub != null) {
+ if (Option(pub).isDefined) {
pub.close()
}
- if (ctx != null) {
+ if (Option(ctx).isDefined) {
ctx.close()
}
}
@@ -95,9 +95,7 @@ class ZMQSubscriber(override val params: Map[String, String] = Map.empty,
case x => log.debug(s"Untreated $x")
}
- override def execute() = {
- log.debug(s"Msg count: $count")
- }
+ override def execute(): Unit = log.debug(s"Msg count: $count")
override def processMessage[T](message: T, sender: ActorRef): Unit = {
message match {
@@ -105,14 +103,14 @@ class ZMQSubscriber(override val params: Map[String, String] = Map.empty,
}
}
- def _format_messages(fields: (String, String, String, String)): String = {
+ def formatMessages(fields: (String, String, String, String)): String = {
// The tuple has the following elements: lrn, timestamp, value, type
// And we have to create a message with the format:
// DATA|cloud|lrn|timestamp|{"<type>" : <value>}
- "DATA|cloud|" + fields._1 + "|" + fields._2 + "|" + s"""{"${fields._3}":"${fields._4}"}"""
+ s"""DATA|cloud|${fields._1}|${fields._2}|{${fields._3}:${fields._4}}"""
}
- def _params_check() = {
+ def checkParams(): Unit = {
if (params.contains("zmq_port")) {
port = params("zmq_port").toInt
}
@@ -121,4 +119,4 @@ class ZMQSubscriber(override val params: Map[String, String] = Map.empty,
}
}
-}
\ No newline at end of file
+}