From 8bc14ef4146c1367ad60ae709e01ae73502761ec Mon Sep 17 00:00:00 2001 From: Raveen Savinda Rathnayake Date: Thu, 29 Mar 2018 15:26:55 +0530 Subject: [PATCH 1/3] Remove the while loop used to run a siddhi app With this while loop a siddhi app is used to to run continuously. As a result of that #9 occurred. With the previous implementation siddhi app used to run smoothly with an input file because the while loop breaks inside the input file availability checking if condition. Now by removing it siddhi app runs in with or without an input file. Resolves: #9 --- .../siddhi/sdk/launcher/run/SiddhiRun.java | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/modules/siddhi-launcher/src/main/java/org/wso2/siddhi/sdk/launcher/run/SiddhiRun.java b/modules/siddhi-launcher/src/main/java/org/wso2/siddhi/sdk/launcher/run/SiddhiRun.java index 436f920..fd5e559 100644 --- a/modules/siddhi-launcher/src/main/java/org/wso2/siddhi/sdk/launcher/run/SiddhiRun.java +++ b/modules/siddhi-launcher/src/main/java/org/wso2/siddhi/sdk/launcher/run/SiddhiRun.java @@ -37,24 +37,21 @@ public SiddhiRun() { public void runSiddhi(String siddhiApp, String inputFile) throws InterruptedException { - while (true) { - try { - //Generating runtime - SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp); - - //Starting event processing - siddhiAppRuntime.start(); - - if (!(inputFile == null || inputFile.equalsIgnoreCase(""))) { - InputFeeder inputFeeder = new InputFeeder(siddhiAppRuntime, inputFile); - //starting input feeder - inputFeeder.start(); - break; - } - } catch (Exception e) { - log.error("Internal Siddhi Error Occurred: " + e); - break; + try { + //Generating runtime + SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp); + + //Starting event processing + siddhiAppRuntime.start(); + + if (!(inputFile == null || inputFile.equalsIgnoreCase(""))) { + InputFeeder inputFeeder = new InputFeeder(siddhiAppRuntime, inputFile); + //starting input feeder + inputFeeder.start(); } + } catch (Exception e) { + log.error("Internal Siddhi Error Occurred: " + e); } + } } From b54c4aea1fc8c2b07892e3d105ac6f1ecaad434f Mon Sep 17 00:00:00 2001 From: Raveen Savinda Rathnayake Date: Thu, 29 Mar 2018 15:53:52 +0530 Subject: [PATCH 2/3] Bump siddhi and its extension versions and add new extensions Bumped siddhi version to 4.1.12. Bumped siddhi extensions to its latest versions. Added siddhi.execution.env extension. Added siddhi.store.cassandra extension. All the version updates are matched with the product-sp included siddhi and its extension versions. --- pom.xml | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 10c38d8..f1fefab 100644 --- a/pom.xml +++ b/pom.xml @@ -177,6 +177,11 @@ siddhi-execution-tensorflow ${siddhi.execution.tensorflow.version} + + org.wso2.extension.siddhi.execution.env + siddhi-execution-env + ${siddhi.execution.env.version} + org.wso2.extension.siddhi.io.jms @@ -276,6 +281,11 @@ siddhi-store-hbase ${siddhi.store.hbase.version} + + org.wso2.extension.siddhi.store.cassandra + siddhi-store-cassandra + ${siddhi.store.cassandra.version} + org.wso2.extension.siddhi.io.mqtt siddhi-io-mqtt @@ -316,7 +326,7 @@ - 4.1.2 + 4.1.12 1.64 2.7.4 2.4.1 @@ -332,41 +342,43 @@ 4.0.10 4.0.9 4.0.10 - 4.0.21 + 4.0.22 4.0.8 4.0.10 - 4.0.8 + 4.0.9 4.0.10 - 4.0.10 - 4.0.15 + 4.0.11 + 4.0.16 1.0.10 4.0.9 - 1.0.11 + 1.0.13 1.0.7 1.0.1 + 1.0.1 - 1.0.5 - 2.0.13 - 1.0.20 - 1.0.9 - 1.0.13 + 1.0.6 + 2.0.15 + 1.0.21 + 1.0.12 + 1.0.14 1.0.17 - 4.1.3 + 4.1.5 4.0.12 1.0.18 - 4.0.15 + 4.0.18 4.0.10 1.0.10 - 1.0.13 + 1.0.14 4.0.11 1.0.10 1.0.0 1.0.13 - 4.0.15 - 1.0.14 - 4.0.6 + 4.0.17 + 1.0.15 + 4.0.7 + 1.0.3 4.0.8 From bf729870eb624b62270bd61d623310b7d0193c12 Mon Sep 17 00:00:00 2001 From: Raveen Savinda Rathnayake Date: Thu, 29 Mar 2018 17:46:58 +0530 Subject: [PATCH 3/3] Change catch clause to catch throwable siddhi exceptions Since siddhi is throwing runtime exceptions, catch clause should handle throwable exceptions. --- .../main/java/org/wso2/siddhi/sdk/launcher/run/SiddhiRun.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/siddhi-launcher/src/main/java/org/wso2/siddhi/sdk/launcher/run/SiddhiRun.java b/modules/siddhi-launcher/src/main/java/org/wso2/siddhi/sdk/launcher/run/SiddhiRun.java index fd5e559..14e9799 100644 --- a/modules/siddhi-launcher/src/main/java/org/wso2/siddhi/sdk/launcher/run/SiddhiRun.java +++ b/modules/siddhi-launcher/src/main/java/org/wso2/siddhi/sdk/launcher/run/SiddhiRun.java @@ -49,7 +49,7 @@ public void runSiddhi(String siddhiApp, String inputFile) throws InterruptedExce //starting input feeder inputFeeder.start(); } - } catch (Exception e) { + } catch (Throwable e) { log.error("Internal Siddhi Error Occurred: " + e); }