You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2022/01/18 22:24:50 UTC

[incubator-streampipes] branch dev updated (091c19f -> ff57daa)

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a change to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git.


    from 091c19f  [hotfix] Fix dependency conflict
     new e755dba  [hotfix] Add auth header to pipeline element detach requests
     new 352c560  [hotfix] Add reload button to adapter overview
     new 94d6516  [test] Add e2e tests for trend detection
     new ff57daa  [hotfix] Add event index support to Siddhi query builder

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../constants/GlobalStreamPipesConstants.java      |  2 +-
 .../streampipes/processors/siddhi/trend/Trend.java |  2 +-
 .../processors/siddhi/trend/TrendController.java   |  2 +-
 .../manager/execution/http/HttpRequestBuilder.java |  4 ++-
 .../wrapper/siddhi/engine/SiddhiEngine.java        | 13 +-------
 .../siddhi/query/expression/Expressions.java       |  4 +++
 .../query/expression/PropertyExpression.java       |  6 +++-
 .../wrapper/siddhi/utils/SiddhiUtils.java          |  3 +-
 .../filters-siddhi/increase1/description.json      | 35 ++++++++++++++++++++++
 .../filters-siddhi/increase1/expected.csv          |  2 ++
 .../filters-siddhi/increase1/input.csv             |  3 ++
 .../filters-siddhi/increase2/description.json      | 35 ++++++++++++++++++++++
 .../filters-siddhi/increase2/expected.csv          |  0
 .../filters-siddhi/increase2/input.csv             |  3 ++
 .../filters-siddhi/increase3/description.json      | 35 ++++++++++++++++++++++
 .../filters-siddhi/increase3/expected.csv          |  2 ++
 .../filters-siddhi/increase3/input.csv             |  4 +++
 .../tests/pipelineElement/SinglePipelineElement.ts |  2 +-
 .../existing-adapters.component.html               |  7 +++++
 19 files changed, 145 insertions(+), 19 deletions(-)
 create mode 100644 ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/description.json
 create mode 100644 ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/expected.csv
 create mode 100644 ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/input.csv
 create mode 100644 ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/description.json
 create mode 100644 ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/expected.csv
 create mode 100644 ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/input.csv
 create mode 100644 ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/description.json
 create mode 100644 ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/expected.csv
 create mode 100644 ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/input.csv

[incubator-streampipes] 01/04: [hotfix] Add auth header to pipeline element detach requests

Posted by ri...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit e755dba4a97fbc4841e90effc0059c32924f3f6e
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Tue Jan 18 21:51:17 2022 +0100

    [hotfix] Add auth header to pipeline element detach requests
---
 .../streampipes/commons/constants/GlobalStreamPipesConstants.java     | 2 +-
 .../apache/streampipes/manager/execution/http/HttpRequestBuilder.java | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/streampipes-commons/src/main/java/org/apache/streampipes/commons/constants/GlobalStreamPipesConstants.java b/streampipes-commons/src/main/java/org/apache/streampipes/commons/constants/GlobalStreamPipesConstants.java
index 70bca02..c52eb67 100644
--- a/streampipes-commons/src/main/java/org/apache/streampipes/commons/constants/GlobalStreamPipesConstants.java
+++ b/streampipes-commons/src/main/java/org/apache/streampipes/commons/constants/GlobalStreamPipesConstants.java
@@ -22,7 +22,7 @@ public class GlobalStreamPipesConstants {
   public static final String STD_ICON_NAME = "icon.png";
   public static final String STD_DOCUMENTATION_NAME = "documentation.md";
 
-  public static final String CONNECT_MASTER_SOURCES_ENDPOINT = "/streampipes-backend/api/v2/connect/master/sources/";
+  public static final String CONNECT_MASTER_SOURCES_ENDPOINT = "/streampipes-backend/api/v2/connect/master/sources";
 
   public static final String INTERNAL_TOPIC_PREFIX = "org-apache-streampipes-internal-";
 
diff --git a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/http/HttpRequestBuilder.java b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/http/HttpRequestBuilder.java
index ddd771f..1dae7b5 100644
--- a/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/http/HttpRequestBuilder.java
+++ b/streampipes-pipeline-management/src/main/java/org/apache/streampipes/manager/execution/http/HttpRequestBuilder.java
@@ -71,7 +71,9 @@ public class HttpRequestBuilder {
 
   public PipelineElementStatus detach() {
     try {
-      Response httpResp = Request.Delete(endpointUrl).connectTimeout(10000).execute();
+      Response httpResp = Request.Delete(endpointUrl)
+              .addHeader("Authorization", getAuthToken())
+              .connectTimeout(10000).execute();
       return handleResponse(httpResp);
     } catch (Exception e) {
       LOG.error("Could not stop pipeline {}", endpointUrl, e);

[incubator-streampipes] 04/04: [hotfix] Add event index support to Siddhi query builder

Posted by ri...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit ff57daac3ce264acf371ad98b7b962669cd39840
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Tue Jan 18 23:23:15 2022 +0100

    [hotfix] Add event index support to Siddhi query builder
---
 .../apache/streampipes/processors/siddhi/trend/Trend.java   |  2 +-
 .../processors/siddhi/trend/TrendController.java            |  2 +-
 .../streampipes/wrapper/siddhi/engine/SiddhiEngine.java     | 13 +------------
 .../wrapper/siddhi/query/expression/Expressions.java        |  4 ++++
 .../wrapper/siddhi/query/expression/PropertyExpression.java |  6 +++++-
 .../streampipes/wrapper/siddhi/utils/SiddhiUtils.java       |  3 ++-
 6 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/streampipes-extensions/streampipes-processors-filters-siddhi/src/main/java/org/apache/streampipes/processors/siddhi/trend/Trend.java b/streampipes-extensions/streampipes-processors-filters-siddhi/src/main/java/org/apache/streampipes/processors/siddhi/trend/Trend.java
index b72f6da..5404e0d 100644
--- a/streampipes-extensions/streampipes-processors-filters-siddhi/src/main/java/org/apache/streampipes/processors/siddhi/trend/Trend.java
+++ b/streampipes-extensions/streampipes-processors-filters-siddhi/src/main/java/org/apache/streampipes/processors/siddhi/trend/Trend.java
@@ -79,7 +79,7 @@ public class Trend extends SiddhiEventEngine<TrendParameters> {
     List<String> outputFieldSelectors = siddhiParams.getParams().getOutputFieldSelectors();
     outputFieldSelectors
             .forEach(outputFieldSelector -> selectClause
-                    .addProperty(Expressions.property("e2", outputFieldSelector)));
+                    .addProperty(Expressions.property("e2", outputFieldSelector, "last")));
 
     return selectClause;
   }
diff --git a/streampipes-extensions/streampipes-processors-filters-siddhi/src/main/java/org/apache/streampipes/processors/siddhi/trend/TrendController.java b/streampipes-extensions/streampipes-processors-filters-siddhi/src/main/java/org/apache/streampipes/processors/siddhi/trend/TrendController.java
index 510410c..dfda35e 100644
--- a/streampipes-extensions/streampipes-processors-filters-siddhi/src/main/java/org/apache/streampipes/processors/siddhi/trend/TrendController.java
+++ b/streampipes-extensions/streampipes-processors-filters-siddhi/src/main/java/org/apache/streampipes/processors/siddhi/trend/TrendController.java
@@ -59,7 +59,7 @@ public class TrendController extends StandaloneEventProcessingDeclarer<TrendPara
     @Override
     public ConfiguredEventProcessor<TrendParameters> onInvocation(DataProcessorInvocation
                                                                              invocationGraph, ProcessingElementParameterExtractor extractor) {
-        String operation = extractor.selectedSingleValue( Operation, String.class);
+        String operation = extractor.selectedSingleValue(Operation, String.class);
         int increase = extractor.singleValueParameter(Increase, Integer.class);
         int duration = extractor.singleValueParameter(Duration, Integer.class);
         String mapping = extractor.mappingPropertyValue(Mapping);
diff --git a/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/engine/SiddhiEngine.java b/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/engine/SiddhiEngine.java
index e63a19b..4c18d4c 100644
--- a/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/engine/SiddhiEngine.java
+++ b/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/engine/SiddhiEngine.java
@@ -71,8 +71,6 @@ public class SiddhiEngine {
     this.typeInfo = settings.getSiddhiProcessorParams().getEventTypeInfo();
     SiddhiManager siddhiManager = SpSiddhiManager.INSTANCE.getSiddhiManager();
 
-    //this.timestampField = removeStreamIdFromTimestamp(setTimestamp(parameters));
-
     siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(settings.getSiddhiAppString());
     settings.getSiddhiProcessorParams().getParams()
             .getInEventTypes()
@@ -93,7 +91,7 @@ public class SiddhiEngine {
     } else {
       callback = new SiddhiOutputStreamDebugCallback(debugCallback, settings.getSiddhiAppConfig().getOutputConfig());
     }
-    System.out.println(SiddhiUtils.getPreparedOutputTopicName(params));
+    LOG.info(SiddhiUtils.getPreparedOutputTopicName(params));
     siddhiAppRuntime.addCallback(SiddhiUtils.getPreparedOutputTopicName(params), callback);
     siddhiAppRuntime.start();
   }
@@ -118,13 +116,4 @@ public class SiddhiEngine {
     this.siddhiAppRuntime.shutdown();
   }
 
-//  public void setSortedEventKeys(List<String> sortedEventKeys) {
-//    String streamId = (String) this.listOfEventKeys.keySet().toArray()[0];    // only reliable if there is only one stream, else use changeEventKeys() to respective streamId
-//    changeEventKeys(streamId, sortedEventKeys);
-//  }
-//
-//  public void changeEventKeys(String streamId, List<String> newEventKeys) {
-//    this.listOfEventKeys.put(streamId, newEventKeys);
-//  }
-
 }
diff --git a/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/query/expression/Expressions.java b/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/query/expression/Expressions.java
index ae2f976..40dfbda 100644
--- a/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/query/expression/Expressions.java
+++ b/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/query/expression/Expressions.java
@@ -169,6 +169,10 @@ public class Expressions {
     return new PropertyExpression(streamName, propertyName);
   }
 
+  public static PropertyExpression property(String streamName, String propertyName, String eventIndex) {
+    return new PropertyExpression(streamName, propertyName, eventIndex);
+  }
+
   public static PropertyExpression property(String propertyName) {
     return new PropertyExpression(propertyName);
   }
diff --git a/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/query/expression/PropertyExpression.java b/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/query/expression/PropertyExpression.java
index 81f0ee9..9619865 100644
--- a/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/query/expression/PropertyExpression.java
+++ b/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/query/expression/PropertyExpression.java
@@ -23,12 +23,16 @@ import org.apache.streampipes.wrapper.siddhi.utils.SiddhiUtils;
 
 public class PropertyExpression extends PropertyExpressionBase {
 
-  private String siddhiPropertyName;
+  private final String siddhiPropertyName;
 
   public PropertyExpression(String streamName, String property) {
     this.siddhiPropertyName = join(".", streamName, property);
   }
 
+  public PropertyExpression(String streamName, String property, String eventIndex) {
+    this.siddhiPropertyName = join(".", streamName + "[" + eventIndex + "]", property);
+  }
+
   public PropertyExpression(String property) {
     this.siddhiPropertyName = property;
   }
diff --git a/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/utils/SiddhiUtils.java b/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/utils/SiddhiUtils.java
index 5174bd1..0a72e15 100644
--- a/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/utils/SiddhiUtils.java
+++ b/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/utils/SiddhiUtils.java
@@ -65,7 +65,8 @@ public class SiddhiUtils {
               outputKey.startsWith(SiddhiConstants.SECOND_STREAM_PREFIX)) {
         outputKey = outputKey.substring(2);
       }
-      outMap.put(outputKey, event.getData(i));
+      Object data = event.getData(i);
+      outMap.put(outputKey, data);
     }
 
     return outMap;

[incubator-streampipes] 02/04: [hotfix] Add reload button to adapter overview

Posted by ri...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 352c560e8ec6bbc1f916fe2b3d8acd2dcf8208b6
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Tue Jan 18 21:58:15 2022 +0100

    [hotfix] Add reload button to adapter overview
---
 .../existing-adapters/existing-adapters.component.html             | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ui/src/app/connect/components/data-marketplace/existing-adapters/existing-adapters.component.html b/ui/src/app/connect/components/data-marketplace/existing-adapters/existing-adapters.component.html
index 3626195..d1ee145 100644
--- a/ui/src/app/connect/components/data-marketplace/existing-adapters/existing-adapters.component.html
+++ b/ui/src/app/connect/components/data-marketplace/existing-adapters/existing-adapters.component.html
@@ -20,6 +20,13 @@
     <div class="assemblyOptions sp-blue-bg mt-20" style="padding:5px;">
         <div fxLayout="row" fxLayoutAlign="start center">
             <h4>My adapters</h4>
+            <span fxFlex></span>
+            <button mat-button mat-icon-button matTooltip="Refresh adapters" matTooltipPosition="above"
+                    (click)="updateAdapterEmitter.emit()">
+                <i class="material-icons">
+                    refresh
+                </i>
+            </button>
         </div>
     </div>
     <div class="sp-blue-border">

[incubator-streampipes] 03/04: [test] Add e2e tests for trend detection

Posted by ri...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 94d65162b6365e712b5b856c0b4fa012563c16e2
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Tue Jan 18 23:22:12 2022 +0100

    [test] Add e2e tests for trend detection
---
 .../filters-siddhi/increase1/description.json      | 35 ++++++++++++++++++++++
 .../filters-siddhi/increase1/expected.csv          |  2 ++
 .../filters-siddhi/increase1/input.csv             |  3 ++
 .../filters-siddhi/increase2/description.json      | 35 ++++++++++++++++++++++
 .../filters-siddhi/increase2/expected.csv          |  0
 .../filters-siddhi/increase2/input.csv             |  3 ++
 .../filters-siddhi/increase3/description.json      | 35 ++++++++++++++++++++++
 .../filters-siddhi/increase3/expected.csv          |  2 ++
 .../filters-siddhi/increase3/input.csv             |  4 +++
 .../tests/pipelineElement/SinglePipelineElement.ts |  2 +-
 10 files changed, 120 insertions(+), 1 deletion(-)

diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/description.json b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/description.json
new file mode 100644
index 0000000..6635a5f
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/description.json
@@ -0,0 +1,35 @@
+{
+  "name": "trend",
+  "config": [
+    {
+      "type": "drop-down",
+      "selector": "mapping",
+      "value": "sensorValue"
+    },
+    {
+      "type": "radio",
+      "selector": "operation",
+      "value": "Increase"
+    },
+    {
+      "type": "input",
+      "selector": "increase",
+      "value": "100"
+    },
+    {
+      "type": "input",
+      "selector": "duration",
+      "value": "10"
+    },
+    {
+      "type": "checkbox",
+      "selector": "timestamp",
+      "value": "check"
+    },
+    {
+      "type": "checkbox",
+      "selector": "sensorValue",
+      "value": "check"
+    }
+  ]
+}
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/expected.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/expected.csv
new file mode 100644
index 0000000..b35c308
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/expected.csv
@@ -0,0 +1,2 @@
+time;sensorvalue
+1623871503078;10.0
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/input.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/input.csv
new file mode 100644
index 0000000..9b29df0
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase1/input.csv
@@ -0,0 +1,3 @@
+timestamp;sensorValue
+1623871499055;1.0
+1623871503078;10
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/description.json b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/description.json
new file mode 100644
index 0000000..6635a5f
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/description.json
@@ -0,0 +1,35 @@
+{
+  "name": "trend",
+  "config": [
+    {
+      "type": "drop-down",
+      "selector": "mapping",
+      "value": "sensorValue"
+    },
+    {
+      "type": "radio",
+      "selector": "operation",
+      "value": "Increase"
+    },
+    {
+      "type": "input",
+      "selector": "increase",
+      "value": "100"
+    },
+    {
+      "type": "input",
+      "selector": "duration",
+      "value": "10"
+    },
+    {
+      "type": "checkbox",
+      "selector": "timestamp",
+      "value": "check"
+    },
+    {
+      "type": "checkbox",
+      "selector": "sensorValue",
+      "value": "check"
+    }
+  ]
+}
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/expected.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/expected.csv
new file mode 100644
index 0000000..e69de29
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/input.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/input.csv
new file mode 100644
index 0000000..7ffe39e
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase2/input.csv
@@ -0,0 +1,3 @@
+timestamp;sensorValue
+1623871499055;1.0
+1623871503078;1.5
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/description.json b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/description.json
new file mode 100644
index 0000000..6635a5f
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/description.json
@@ -0,0 +1,35 @@
+{
+  "name": "trend",
+  "config": [
+    {
+      "type": "drop-down",
+      "selector": "mapping",
+      "value": "sensorValue"
+    },
+    {
+      "type": "radio",
+      "selector": "operation",
+      "value": "Increase"
+    },
+    {
+      "type": "input",
+      "selector": "increase",
+      "value": "100"
+    },
+    {
+      "type": "input",
+      "selector": "duration",
+      "value": "10"
+    },
+    {
+      "type": "checkbox",
+      "selector": "timestamp",
+      "value": "check"
+    },
+    {
+      "type": "checkbox",
+      "selector": "sensorValue",
+      "value": "check"
+    }
+  ]
+}
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/expected.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/expected.csv
new file mode 100644
index 0000000..b35c308
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/expected.csv
@@ -0,0 +1,2 @@
+time;sensorvalue
+1623871503078;10.0
diff --git a/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/input.csv b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/input.csv
new file mode 100644
index 0000000..73ccb34
--- /dev/null
+++ b/ui/cypress/fixtures/pipelineElement/filters-siddhi/increase3/input.csv
@@ -0,0 +1,4 @@
+timestamp;sensorValue
+1623871499055;1.0
+1623871503078;10
+1623871503085;11
diff --git a/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts b/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts
index 31463d8..b04f234 100644
--- a/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts
+++ b/ui/cypress/tests/pipelineElement/SinglePipelineElement.ts
@@ -22,7 +22,7 @@ import { ProcessorTest } from '../../support/model/ProcessorTest';
 const allTests = Cypress.env('processingElements');
 
 allTests.forEach(test => {
-  const testNames = ['jsEvaluator1'];
+  const testNames = ['increase3'];
 
   const processorTest = test as ProcessorTest;