You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2016/02/18 18:09:38 UTC

[2/9] storm git commit: [STORM-1253] - port backtype.storm.timer to java

[STORM-1253] - port backtype.storm.timer to java


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/0a5813ab
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/0a5813ab
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/0a5813ab

Branch: refs/heads/master
Commit: 0a5813abb643ff8c9398f2aa94ac40d01a6379d6
Parents: d187a20
Author: Boyang Jerry Peng <je...@yahoo-inc.com>
Authored: Fri Feb 5 14:22:08 2016 -0600
Committer: Boyang Jerry Peng <je...@yahoo-inc.com>
Committed: Thu Feb 18 10:32:05 2016 -0600

----------------------------------------------------------------------
 storm-core/src/jvm/org/apache/storm/Timer.java | 50 +++++++++++++++++++++
 1 file changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/0a5813ab/storm-core/src/jvm/org/apache/storm/Timer.java
----------------------------------------------------------------------
diff --git a/storm-core/src/jvm/org/apache/storm/Timer.java b/storm-core/src/jvm/org/apache/storm/Timer.java
new file mode 100644
index 0000000..c9a8868
--- /dev/null
+++ b/storm-core/src/jvm/org/apache/storm/Timer.java
@@ -0,0 +1,50 @@
+/**
+ * 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.storm;
+
+import java.util.Comparator;
+import java.util.PriorityQueue;
+import java.util.TimerTask;
+
+public class Timer {
+
+    public interface KillFunc {
+        public void onKill(Throwable throwable);
+    }
+
+    public static class StormTimerTask extends TimerTask {
+
+        PriorityQueue queue = new PriorityQueue(10, new Comparator() {
+            @Override
+            public int compare(Object o1, Object o2) {
+                return 0;
+            }
+        });
+
+        @Override
+        public void run() {
+
+        }
+    }
+
+    public TimerTask mkTimer(String name) {
+
+    }
+
+}