You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@eagle.apache.org by wujinhu <gi...@git.apache.org> on 2017/02/23 05:42:17 UTC
[GitHub] eagle pull request #839: [EAGLE-927] support for hadoop jmx resource info
GitHub user wujinhu opened a pull request:
https://github.com/apache/eagle/pull/839
[EAGLE-927] support for hadoop jmx resource info
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/wujinhu/eagle EAGLE-927
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/eagle/pull/839.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #839
----
commit ddcd59616109caa7833af2d3e442cb9ad778ca28
Author: wujinhu <wu...@126.com>
Date: 2017-02-23T05:40:44Z
support for hadoop jmx resource info
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] eagle pull request #839: [EAGLE-927] support for hadoop jmx resource info
Posted by haoch <gi...@git.apache.org>.
Github user haoch commented on a diff in the pull request:
https://github.com/apache/eagle/pull/839#discussion_r102645230
--- Diff: eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/siddhiext/StringSubtractFunctionExtensionTest.java ---
@@ -0,0 +1,62 @@
+/*
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.eagle.siddhiext;
+
+import org.junit.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.wso2.siddhi.core.ExecutionPlanRuntime;
+import org.wso2.siddhi.core.SiddhiManager;
+import org.wso2.siddhi.core.event.Event;
+import org.wso2.siddhi.core.stream.input.InputHandler;
+import org.wso2.siddhi.core.stream.output.StreamCallback;
+import org.wso2.siddhi.core.util.EventPrinter;
+
+public class StringSubtractFunctionExtensionTest {
+ private static final Logger LOG = LoggerFactory.getLogger(StringSubtractFunctionExtensionTest.class);
+
+ @Test
+ public void testStringSubtract() throws Exception {
+ String ql = " define stream log(timestamp long, switchLabel string, port string, message string); " +
+ " from log select string:subtract(\"a:b:c:d:e:f:g\", \"g:a:e:d:z:r:s:c\") as alertKey insert into output; ";
+ SiddhiManager manager = new SiddhiManager();
+ ExecutionPlanRuntime runtime = manager.createExecutionPlanRuntime(ql);
+ runtime.addCallback("output", new StreamCallback() {
+ @Override
+ public void receive(Event[] events) {
+ EventPrinter.print(events);
+ Assert.assertTrue(events.length == 1);
+ Assert.assertTrue(events[0].getData(0).toString().equals("z\nr\ns"));
+ }
+ });
+
+ runtime.start();
+
+ InputHandler logInput = runtime.getInputHandler("log");
+
+ Event e = new Event();
+ e.setTimestamp(System.currentTimeMillis());
+ e.setData(new Object[] {System.currentTimeMillis(), "switch-ra-slc-01", "port01", "log-message...."});
+ logInput.send(e);
+
+ Thread.sleep(1000);
--- End diff --
Avoid sleep in CEP ut
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] eagle pull request #839: [EAGLE-927] support for hadoop jmx resource info
Posted by haoch <gi...@git.apache.org>.
Github user haoch commented on a diff in the pull request:
https://github.com/apache/eagle/pull/839#discussion_r102645205
--- Diff: eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/test/java/org/apache/eagle/siddhiext/StringSubtractFunctionExtensionTest.java ---
@@ -0,0 +1,62 @@
+/*
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.eagle.siddhiext;
+
+import org.junit.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.wso2.siddhi.core.ExecutionPlanRuntime;
+import org.wso2.siddhi.core.SiddhiManager;
+import org.wso2.siddhi.core.event.Event;
+import org.wso2.siddhi.core.stream.input.InputHandler;
+import org.wso2.siddhi.core.stream.output.StreamCallback;
+import org.wso2.siddhi.core.util.EventPrinter;
+
+public class StringSubtractFunctionExtensionTest {
+ private static final Logger LOG = LoggerFactory.getLogger(StringSubtractFunctionExtensionTest.class);
+
+ @Test
+ public void testStringSubtract() throws Exception {
+ String ql = " define stream log(timestamp long, switchLabel string, port string, message string); " +
+ " from log select string:subtract(\"a:b:c:d:e:f:g\", \"g:a:e:d:z:r:s:c\") as alertKey insert into output; ";
+ SiddhiManager manager = new SiddhiManager();
+ ExecutionPlanRuntime runtime = manager.createExecutionPlanRuntime(ql);
+ runtime.addCallback("output", new StreamCallback() {
+ @Override
+ public void receive(Event[] events) {
+ EventPrinter.print(events);
+ Assert.assertTrue(events.length == 1);
+ Assert.assertTrue(events[0].getData(0).toString().equals("z\nr\ns"));
+ }
+ });
+
+ runtime.start();
+
+ InputHandler logInput = runtime.getInputHandler("log");
+
+ Event e = new Event();
+ e.setTimestamp(System.currentTimeMillis());
+ e.setData(new Object[] {System.currentTimeMillis(), "switch-ra-slc-01", "port01", "log-message...."});
--- End diff --
Remove sensitive info
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] eagle pull request #839: [EAGLE-927] support for hadoop jmx resource info
Posted by wujinhu <gi...@git.apache.org>.
GitHub user wujinhu reopened a pull request:
https://github.com/apache/eagle/pull/839
[EAGLE-927] support for hadoop jmx resource info
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/wujinhu/eagle EAGLE-927
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/eagle/pull/839.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #839
----
commit ddcd59616109caa7833af2d3e442cb9ad778ca28
Author: wujinhu <wu...@126.com>
Date: 2017-02-23T05:40:44Z
support for hadoop jmx resource info
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] eagle pull request #839: [EAGLE-927] support for hadoop jmx resource info
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/eagle/pull/839
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
[GitHub] eagle pull request #839: [EAGLE-927] support for hadoop jmx resource info
Posted by wujinhu <gi...@git.apache.org>.
Github user wujinhu closed the pull request at:
https://github.com/apache/eagle/pull/839
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---