iota-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tonyfaust...@apache.org
Subject incubator-iota git commit: added Random {Integer, FLoat and UUID} to stream
Date Wed, 13 Jul 2016 01:00:27 GMT
Repository: incubator-iota
Updated Branches:
  refs/heads/master e944961f1 -> f2096dbee


added Random {Integer, FLoat and UUID} to stream


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

Branch: refs/heads/master
Commit: f2096dbeee62d2d6fc936fb4a4cd4b4737bda69c
Parents: e944961
Author: tonyfaustini <tonyfaustini@yahoo.com>
Authored: Tue Jul 12 18:00:22 2016 -0700
Committer: tonyfaustini <tonyfaustini@yahoo.com>
Committed: Tue Jul 12 18:00:22 2016 -0700

----------------------------------------------------------------------
 .../apache/iota/fey/performer/RandomFloat.scala | 56 +++++++++++++++++++
 .../iota/fey/performer/RandomInteger.scala      | 57 ++++++++++++++++++++
 .../apache/iota/fey/performer/RandomUUID.scala  | 56 +++++++++++++++++++
 .../apache/iota/fey/performer/Timestamp.scala   | 40 +++++++-------
 4 files changed, 189 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/f2096dbe/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
new file mode 100644
index 0000000..ad175c3
--- /dev/null
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomFloat.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 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/f2096dbe/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
new file mode 100644
index 0000000..2fc61e9
--- /dev/null
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomInteger.scala
@@ -0,0 +1,57 @@
+/*
+ * 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 RandomInteger(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 ri = RandomInteger.this
+    log.debug(ri.toString)
+    propagateMessage(ri.toString)
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/f2096dbe/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
new file mode 100644
index 0000000..f9c10ab
--- /dev/null
+++ b/performers/stream/src/main/scala/org/apache/iota/fey/performer/RandomUUID.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.
+// ee 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 RandomUUID(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 uuid = RandomUUID.this
+    log.debug(uuid.toString)
+    propagateMessage(uuid.toString)
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-iota/blob/f2096dbe/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 3901e98..5b90881 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,19 +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.
- * See 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.
+// ee the License for the specific language governing permissions and
+// limitations under the License.
+
 package org.apache.iota.fey.performer
 
 import akka.actor.ActorRef
@@ -30,13 +30,13 @@ class Timestamp(override val params: Map[String, String] = Map.empty,
                 override val orchestrationID: String = "",
                 override val autoScale: Boolean = false) extends FeyGenericActor {
 
-  override def onStart = {
+  override def onStart : Unit = {
   }
 
-  override def onStop = {
+  override def onStop : Unit = {
   }
 
-  override def onRestart(reason: Throwable) = {
+  override def onRestart(reason: Throwable) : Unit = {
     // Called after actor is up and running - after self restart
   }
 
@@ -47,7 +47,7 @@ class Timestamp(override val params: Map[String, String] = Map.empty,
   override def processMessage[T](message: T, sender: ActorRef): Unit = {
   }
 
-  override def execute() = {
+  override def execute() : Unit = {
     val ts = java.lang.System.currentTimeMillis()
     log.debug(ts.toString)
     propagateMessage(ts.toString)


Mime
View raw message