You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by wi...@apache.org on 2020/05/25 17:42:34 UTC

[incubator-streampipes] branch dev updated (28daf81 -> 68b1d7b)

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

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


    from 28daf81  Update timing of saving labels in database (timeseries labeling tool)
     new 218ab75  Update timing of label saving to database (timeseries labeling tool)
     new 1545c25  [STREAMPIPES-142] Handle non-primitive and primitive event data returned from Siddhi
     new 68b1d7b  Merge branch 'dev' of https://github.com/apache/incubator-streampipes into dev

The 3 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:
 .../wrapper/siddhi/engine/SiddhiEventEngine.java         | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)


[incubator-streampipes] 02/03: [STREAMPIPES-142] Handle non-primitive and primitive event data returned from Siddhi

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

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

commit 1545c25f471a1e0328ae3fb2806e97d3781a994b
Author: Patrick Wiener <wi...@fzi.de>
AuthorDate: Mon May 25 19:42:05 2020 +0200

    [STREAMPIPES-142] Handle non-primitive and primitive event data returned from Siddhi
---
 .../wrapper/siddhi/engine/SiddhiEventEngine.java         | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/engine/SiddhiEventEngine.java b/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/engine/SiddhiEventEngine.java
index 4c35128..08671a5 100644
--- a/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/engine/SiddhiEventEngine.java
+++ b/streampipes-wrapper-siddhi/src/main/java/org/apache/streampipes/wrapper/siddhi/engine/SiddhiEventEngine.java
@@ -34,12 +34,7 @@ import io.siddhi.core.event.Event;
 import io.siddhi.core.stream.input.InputHandler;
 import io.siddhi.core.stream.output.StreamCallback;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringJoiner;
+import java.util.*;
 
 public abstract class SiddhiEventEngine<B extends EventProcessorBindingParams> implements
         EventProcessor<B> {
@@ -138,8 +133,15 @@ public abstract class SiddhiEventEngine<B extends EventProcessorBindingParams> i
           schemaInfo, SourceInfo sourceInfo) {
     Map<String, Object> outMap = new HashMap<>();
     for (int i = 0; i < sortedEventKeys.size(); i++) {
+
+      if (event.getData(i) instanceof LinkedList) {
         List<Object> tmp = (List<Object>) event.getData(i);
-      outMap.put(sortedEventKeys.get(i), tmp.get(0));
+        outMap.put(sortedEventKeys.get(i), tmp.get(0));
+      }
+      else {
+        outMap.put(sortedEventKeys.get(i), event.getData(i));
+      }
+
     }
     return EventFactory.fromMap(outMap, sourceInfo, schemaInfo);
   }


[incubator-streampipes] 01/03: Update timing of label saving to database (timeseries labeling tool)

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

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

commit 218ab7526ee2b09de0783007c51bde8f365e0e53
Author: Daniel Ebi <eb...@fzi.de>
AuthorDate: Mon May 25 11:30:18 2020 +0200

    Update timing of label saving to database (timeseries labeling tool)
---
 .../line-chart/line-chart-widget.component.ts      | 55 ++++------------------
 1 file changed, 10 insertions(+), 45 deletions(-)

diff --git a/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.ts b/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.ts
index ed6faf3..e433508 100644
--- a/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.ts
+++ b/ui/src/app/data-explorer-v2/components/widgets/line-chart/line-chart-widget.component.ts
@@ -51,10 +51,7 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget implements
 
   // indicator variable if labeling mode is activated
   private labelingModeOn = false;
-
-  // indicator variable if labels has been changed
-  private changedLabels = false;
-
+  
   private dialogReference = undefined;
 
   updatemenus = [
@@ -323,7 +320,8 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget implements
               }
             }
             this.data['labels'] = this.data[0]['customdata'];
-            this.setChangedLabels(true);
+            // saving labels persistently
+            this.saveLabelsInDatabase(result, this.selectedStartX, this.selectedEndX);
 
             // adding coloured shape (based on selected label) to graph (equals selected time interval)
             this.addShapeToGraph(this.selectedStartX, this.selectedEndX, this.colorService.getColor(result));
@@ -416,42 +414,17 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget implements
 
     // changing dragmode to 'zoom'
     this.graph.layout.dragmode = 'zoom';
-
-    // saving labels persistently
-    if (this.getChangedLabels()) {
-      this.saveLabelsInDatabase();
-    }
+    
   }
 
-  private saveLabelsInDatabase() {
-    let currentLabel = undefined;
-    let indices = [];
-    for (const label in this.data['labels']) {
-      if (currentLabel !== this.data['labels'][label] && indices.length > 0) {
-        const startdate = new Date(this.data[0]['x'][indices[0]]).getTime() - 1;
-        const enddate = new Date(this.data[0]['x'][indices[indices.length - 1]]).getTime() + 1;
-        this.dataLakeRestService.saveLabelsInDatabase(this.data['measureName'], startdate, enddate, currentLabel).subscribe(
+  private saveLabelsInDatabase(label, start_X, end_X) {
+    const startdate = new Date(start_X).getTime() - 1;
+    const enddate = new Date(end_X).getTime() + 1;
+    this.dataLakeRestService.saveLabelsInDatabase(this.data['measureName'], startdate, enddate, label).subscribe(
             res => {
               // console.log('Successfully wrote label ' + currentLabel + ' into database.');
             }
-        );
-        currentLabel = undefined;
-        indices = [];
-        indices.push(label);
-      } else {
-        indices.push(label);
-      }
-
-      currentLabel = this.data['labels'][label];
-    }
-    const last_startdate = new Date(this.data[0]['x'][indices[0]]).getTime() - 1;
-    const last_enddate = new Date(this.data[0]['x'][indices[indices.length - 1]]).getTime() + 1;
-    this.dataLakeRestService.saveLabelsInDatabase(this.data['measureName'], last_startdate, last_enddate, currentLabel).subscribe(
-        res => {
-          // console.log('Successfully wrote label ' + currentLabel + ' in last iteration into database.');
-        });
-    this.setChangedLabels(false);
-
+            );
   }
 
   private addInitialColouredShapesToGraph() {
@@ -510,15 +483,7 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget implements
     };
     this.graph.layout.shapes.push(shape);
   }
-
-  public setChangedLabels(state: boolean) {
-    this.changedLabels = state;
-  }
-
-  public getChangedLabels() {
-    return this.changedLabels;
-  }
-
+  
   setStartX(startX: string) {
     this.selectedStartX = startX;
   }


[incubator-streampipes] 03/03: Merge branch 'dev' of https://github.com/apache/incubator-streampipes into dev

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

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

commit 68b1d7b9918a83f6eaeea8efaaa6291ac90bd7ba
Merge: 1545c25 28daf81
Author: Patrick Wiener <wi...@fzi.de>
AuthorDate: Mon May 25 19:42:12 2020 +0200

    Merge branch 'dev' of https://github.com/apache/incubator-streampipes into dev