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/07/13 02:37:06 UTC
incubator-iota git commit: Improved the stream performer
Repository: incubator-iota
Updated Branches:
refs/heads/master 7bdae0b7c -> c079ff9fa
Improved the stream 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/c079ff9f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-iota/tree/c079ff9f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-iota/diff/c079ff9f
Branch: refs/heads/master
Commit: c079ff9fa29d4420ce5eb7d4c22f78aed84522fe
Parents: 7bdae0b
Author: tonyfaustini <to...@yahoo.com>
Authored: Tue Jul 12 19:37:01 2016 -0700
Committer: tonyfaustini <to...@yahoo.com>
Committed: Tue Jul 12 19:37:01 2016 -0700
----------------------------------------------------------------------
fey-examples/active-jar-repo/fey-stream.jar | Bin 13503 -> 30284 bytes
fey-examples/active-json-repo/timestamp.json | 2 +-
.../iota/fey/performer/RandomDouble.scala | 56 +++++++++++++++++++
.../apache/iota/fey/performer/RandomFloat.scala | 56 -------------------
.../iota/fey/performer/RandomInteger.scala | 6 +-
.../apache/iota/fey/performer/RandomUUID.scala | 6 +-
.../apache/iota/fey/performer/Timestamp.scala | 6 +-
7 files changed, 66 insertions(+), 66 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/c079ff9f/fey-examples/active-jar-repo/fey-stream.jar
----------------------------------------------------------------------
diff --git a/fey-examples/active-jar-repo/fey-stream.jar b/fey-examples/active-jar-repo/fey-stream.jar
index ff8996d..1d57ec8 100644
Binary files a/fey-examples/active-jar-repo/fey-stream.jar and b/fey-examples/active-jar-repo/fey-stream.jar differ
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/c079ff9f/fey-examples/active-json-repo/timestamp.json
----------------------------------------------------------------------
diff --git a/fey-examples/active-json-repo/timestamp.json b/fey-examples/active-json-repo/timestamp.json
index 36a82a8..a62f8b6 100644
--- a/fey-examples/active-json-repo/timestamp.json
+++ b/fey-examples/active-json-repo/timestamp.json
@@ -14,7 +14,7 @@
"backoff": 0,
"source": {
"name": "fey-stream.jar",
- "classPath": "org.apache.iota.fey.performer.Timestamp",
+ "classPath": "org.apache.iota.fey.performer.RandomUUID",
"parameters": {
}
}
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/c079ff9f/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
new file mode 100644
index 0000000..d0efb5e
--- /dev/null
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomDouble.scala
@@ -0,0 +1,56 @@
+/*
+ * 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.iota.fey.FeyGenericActor
+
+import scala.collection.immutable.Map
+import scala.concurrent.duration._
+
+class RandomDouble(override val params: Map[String, String] = Map.empty,
+ override val backoff: FiniteDuration = 1.minutes,
+ override val connectTo: Map[String, ActorRef] = Map.empty,
+ override val schedulerTimeInterval: FiniteDuration = 30.seconds,
+ override val orchestrationName: String = "",
+ override val orchestrationID: String = "",
+ override val autoScale: Boolean = false) extends FeyGenericActor {
+
+ override def onStart : Unit = {
+ }
+
+ override def onStop : Unit = {
+ }
+
+ override def onRestart(reason: Throwable) : Unit = {
+ // Called after actor is up and running - after self restart
+ }
+
+ override def customReceive: Receive = {
+ case x => log.debug(s"Untreated $x")
+ }
+
+ override def processMessage[T](message: T, sender: ActorRef): Unit = {
+ }
+
+ override def execute() : Unit = {
+ val rd = scala.util.Random.nextGaussian().toString
+ log.debug(rd)
+ propagateMessage(rd)
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/c079ff9f/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomFloat.scala
----------------------------------------------------------------------
diff --git a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomFloat.scala b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomFloat.scala
deleted file mode 100644
index ad175c3..0000000
--- a/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomFloat.scala
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.iota.fey.FeyGenericActor
-
-import scala.collection.immutable.Map
-import scala.concurrent.duration._
-
-class RandomFloat(override val params: Map[String, String] = Map.empty,
- override val backoff: FiniteDuration = 1.minutes,
- override val connectTo: Map[String, ActorRef] = Map.empty,
- override val schedulerTimeInterval: FiniteDuration = 30.seconds,
- override val orchestrationName: String = "",
- override val orchestrationID: String = "",
- override val autoScale: Boolean = false) extends FeyGenericActor {
-
- override def onStart : Unit = {
- }
-
- override def onStop : Unit = {
- }
-
- override def onRestart(reason: Throwable) : Unit = {
- // Called after actor is up and running - after self restart
- }
-
- override def customReceive: Receive = {
- case x => log.debug(s"Untreated $x")
- }
-
- override def processMessage[T](message: T, sender: ActorRef): Unit = {
- }
-
- override def execute() : Unit = {
- val rf = RandomFloat.this
- log.debug(rf.toString)
- propagateMessage(rf.toString)
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/c079ff9f/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 2fc61e9..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
@@ -49,9 +49,9 @@ class RandomInteger(override val params: Map[String, String] = Map.empty,
}
override def execute() : Unit = {
- val ri = RandomInteger.this
- log.debug(ri.toString)
- propagateMessage(ri.toString)
+ val ri = scala.util.Random.nextInt().toString
+ log.debug(ri)
+ propagateMessage(ri)
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/c079ff9f/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 f9c10ab..be3f3cf 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
@@ -48,9 +48,9 @@ class RandomUUID(override val params: Map[String, String] = Map.empty,
}
override def execute() : Unit = {
- val uuid = RandomUUID.this
- log.debug(uuid.toString)
- propagateMessage(uuid.toString)
+ val uuid = java.util.UUID.randomUUID.toString
+ log.debug(uuid)
+ propagateMessage(uuid)
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/c079ff9f/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 5b90881..c138118 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
@@ -48,9 +48,9 @@ class Timestamp(override val params: Map[String, String] = Map.empty,
}
override def execute() : Unit = {
- val ts = java.lang.System.currentTimeMillis()
- log.debug(ts.toString)
- propagateMessage(ts.toString)
+ val ts = java.lang.System.currentTimeMillis().toString
+ log.debug(ts)
+ propagateMessage(ts)
}
}
\ No newline at end of file