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 2021/07/30 07:11:17 UTC

[incubator-streampipes] 02/08: [STREAMPIPES-402] Store measurement info in widget config

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

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

commit 174bdccec539838222dcf5e28f8d9ef08ed9337e
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Wed Jul 28 22:20:58 2021 +0200

    [STREAMPIPES-402] Store measurement info in widget config
---
 .../impl/datalake/PersistedDataStreamResource.java | 23 +++++++--------
 ui/src/app/core-model/gen/streampipes-model.ts     | 14 +++++----
 ...lorer-widget-appearance-settings.component.html |  9 ++++--
 .../data-explorer-designer-panel.component.html    |  4 ++-
 .../data-explorer-designer-panel.component.ts      | 34 ++--------------------
 ...ta-explorer-widget-data-settings.component.html | 27 ++++++++++++-----
 ...ta-explorer-widget-data-settings.component.scss |  9 ++++++
 ...data-explorer-widget-data-settings.component.ts | 22 ++++++++++----
 .../data-explorer-dashboard-grid.component.html    |  4 +--
 .../grid/data-explorer-dashboard-grid.component.ts | 22 ++++++--------
 .../data-explorer-dashboard-panel.component.html   |  2 +-
 .../data-explorer-dashboard-panel.component.ts     | 26 +++++++----------
 .../data-explorer-dashboard-widget.component.html  |  8 +++--
 .../data-explorer-dashboard-widget.component.ts    | 29 +++++++++---------
 .../widgets/base/base-data-explorer-widget.ts      | 22 +++++++-------
 .../widgets/image/image-widget.component.ts        |  4 +--
 .../line-chart/line-chart-widget.component.ts      | 14 ++++-----
 .../widgets/table/table-widget.component.ts        |  6 ++--
 ...-explorer-add-visualization-dialog.component.ts | 16 +++++-----
 .../services/data-view-data-explorer.service.ts    |  9 +++---
 20 files changed, 156 insertions(+), 148 deletions(-)

diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/PersistedDataStreamResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/PersistedDataStreamResource.java
index 853f09b..8032f13 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/PersistedDataStreamResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/datalake/PersistedDataStreamResource.java
@@ -17,7 +17,7 @@
  */
 package org.apache.streampipes.rest.impl.datalake;
 
-import org.apache.streampipes.model.datalake.PersistedDataStream;
+import org.apache.streampipes.model.datalake.DataLakeMeasure;
 import org.apache.streampipes.model.graph.DataSinkInvocation;
 import org.apache.streampipes.model.pipeline.Pipeline;
 import org.apache.streampipes.rest.impl.dashboard.AbstractPipelineExtractionResource;
@@ -32,7 +32,7 @@ import javax.ws.rs.core.Response;
 import java.util.ArrayList;
 
 @Path("/v3/users/{username}/datalake/pipelines")
-public class PersistedDataStreamResource extends AbstractPipelineExtractionResource<PersistedDataStream> {
+public class PersistedDataStreamResource extends AbstractPipelineExtractionResource<DataLakeMeasure> {
 
   private static final String DataLakeAppId = "org.apache.streampipes.sinks.internal.jvm.datalake";
   private static final String MeasureFieldInternalName = "db_measurement";
@@ -54,19 +54,18 @@ public class PersistedDataStreamResource extends AbstractPipelineExtractionResou
   }
 
   @Override
-  protected PersistedDataStream convert(Pipeline pipeline, DataSinkInvocation sink) {
-    PersistedDataStream ps = new PersistedDataStream();
-    ps.setSchema(sink.getInputStreams().get(0).getEventSchema());
-    ps.setPipelineId(pipeline.getPipelineId());
-    ps.setPipelineName(pipeline.getName());
-    ps.setMeasureName(extractFieldValue(sink, MeasureFieldInternalName));
+  protected DataLakeMeasure convert(Pipeline pipeline, DataSinkInvocation sink) {
+    DataLakeMeasure measure = new DataLakeMeasure();
+    measure.setEventSchema(sink.getInputStreams().get(0).getEventSchema());
+    measure.setPipelineId(pipeline.getPipelineId());
+    measure.setPipelineName(pipeline.getName());
+    measure.setMeasureName(extractFieldValue(sink, MeasureFieldInternalName));
 
-    return ps;
+    return measure;
   }
 
   @Override
-  protected boolean matches(PersistedDataStream persistedDataStream, String pipelineId, String fieldValue) {
-    return persistedDataStream.getPipelineId().equals(pipelineId) &&
-            persistedDataStream.getMeasureName().equals(fieldValue);
+  protected boolean matches(DataLakeMeasure measure, String pipelineId, String fieldValue) {
+    return measure.getMeasureName().equals(fieldValue);
   }
 }
diff --git a/ui/src/app/core-model/gen/streampipes-model.ts b/ui/src/app/core-model/gen/streampipes-model.ts
index 0db11de..ad61b39 100644
--- a/ui/src/app/core-model/gen/streampipes-model.ts
+++ b/ui/src/app/core-model/gen/streampipes-model.ts
@@ -19,7 +19,7 @@
 /* tslint:disable */
 /* eslint-disable */
 // @ts-nocheck
-// Generated using typescript-generator version 2.27.744 on 2021-07-27 22:29:33.
+// Generated using typescript-generator version 2.27.744 on 2021-07-28 15:16:18.
 
 export class AbstractStreamPipesEntity {
     "@class": "org.apache.streampipes.model.base.AbstractStreamPipesEntity" | "org.apache.streampipes.model.base.NamedStreamPipesEntity" | "org.apache.streampipes.model.connect.adapter.AdapterDescription" | "org.apache.streampipes.model.connect.adapter.AdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.GenericAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.SpecificAdapterSetDescription" | "org.apache.streampipes.model.connect.adapter.AdapterStre [...]
@@ -195,9 +195,9 @@ export class AdapterDescription extends NamedStreamPipesEntity {
         instance.selectedEndpointUrl = data.selectedEndpointUrl;
         instance.correspondingServiceGroup = data.correspondingServiceGroup;
         instance.id = data.id;
-        instance.valueRules = __getCopyArrayFn(__identity<any>())(data.valueRules);
         instance.streamRules = __getCopyArrayFn(__identity<any>())(data.streamRules);
         instance.schemaRules = __getCopyArrayFn(__identity<any>())(data.schemaRules);
+        instance.valueRules = __getCopyArrayFn(__identity<any>())(data.valueRules);
         return instance;
     }
 
@@ -957,6 +957,8 @@ export class DataLakeMeasure extends UnnamedStreamPipesEntity {
     "@class": "org.apache.streampipes.model.datalake.DataLakeMeasure";
     eventSchema: EventSchema;
     measureName: string;
+    pipelineId: string;
+    pipelineName: string;
 
     static fromData(data: DataLakeMeasure, target?: DataLakeMeasure): DataLakeMeasure {
         if (!data) {
@@ -966,6 +968,8 @@ export class DataLakeMeasure extends UnnamedStreamPipesEntity {
         super.fromData(data, instance);
         instance.measureName = data.measureName;
         instance.eventSchema = EventSchema.fromData(data.eventSchema);
+        instance.pipelineId = data.pipelineId;
+        instance.pipelineName = data.pipelineName;
         return instance;
     }
 }
@@ -1647,9 +1651,9 @@ export class GenericAdapterSetDescription extends AdapterSetDescription implemen
         }
         const instance = target || new GenericAdapterSetDescription();
         super.fromData(data, instance);
+        instance.eventSchema = EventSchema.fromData(data.eventSchema);
         instance.formatDescription = FormatDescription.fromData(data.formatDescription);
         instance.protocolDescription = ProtocolDescription.fromData(data.protocolDescription);
-        instance.eventSchema = EventSchema.fromData(data.eventSchema);
         return instance;
     }
 }
@@ -1666,9 +1670,9 @@ export class GenericAdapterStreamDescription extends AdapterStreamDescription im
         }
         const instance = target || new GenericAdapterStreamDescription();
         super.fromData(data, instance);
+        instance.eventSchema = EventSchema.fromData(data.eventSchema);
         instance.formatDescription = FormatDescription.fromData(data.formatDescription);
         instance.protocolDescription = ProtocolDescription.fromData(data.protocolDescription);
-        instance.eventSchema = EventSchema.fromData(data.eventSchema);
         return instance;
     }
 }
@@ -2763,8 +2767,8 @@ export class SpDataSet extends SpDataStream {
         instance.datasetInvocationId = data.datasetInvocationId;
         instance.correspondingPipeline = data.correspondingPipeline;
         instance.selectedEndpointUrl = data.selectedEndpointUrl;
-        instance.brokerHostname = data.brokerHostname;
         instance.actualTopicName = data.actualTopicName;
+        instance.brokerHostname = data.brokerHostname;
         return instance;
     }
 }
diff --git a/ui/src/app/data-explorer/components/designer-panel/appearance-settings/data-explorer-widget-appearance-settings.component.html b/ui/src/app/data-explorer/components/designer-panel/appearance-settings/data-explorer-widget-appearance-settings.component.html
index 79c4631..72062f0 100644
--- a/ui/src/app/data-explorer/components/designer-panel/appearance-settings/data-explorer-widget-appearance-settings.component.html
+++ b/ui/src/app/data-explorer/components/designer-panel/appearance-settings/data-explorer-widget-appearance-settings.component.html
@@ -33,7 +33,9 @@
             <input matInput
                    [(colorPicker)]="baseAppearanceConfig.backgroundColor"
                    [cpPosition]="'bottom'"
-                   [style.background]="baseAppearanceConfig.backgroundColor" required [cpPresetColors] = "presetColors"/>
+                   [style.background]="baseAppearanceConfig.backgroundColor" required
+                   [cpPresetColors] = "presetColors"
+                   autocomplete="off"/>
         </mat-form-field>
     </div>
 
@@ -43,7 +45,10 @@
             <input matInput
                    [(colorPicker)]="baseAppearanceConfig.textColor"
                    [cpPosition]="'bottom'"
-                   [style.background]="baseAppearanceConfig.textColor" required [cpPresetColors] = "presetColors"/>
+                   [style.background]="baseAppearanceConfig.textColor"
+                   required
+                   [cpPresetColors] = "presetColors"
+                   autocomplete="off"/>
         </mat-form-field>
     </div>
 </div>
diff --git a/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.html b/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.html
index 8bb6a0a..1ecc3b9 100644
--- a/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.html
+++ b/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.html
@@ -17,6 +17,7 @@
   -->
 
 <div fxFlex="100" fxLayout="column" class="designer-panel-content">
+    <h4 *ngIf="currentlyConfiguredWidget">{{ currentlyConfiguredWidget.baseAppearanceConfig.widgetTitle }}</h4>
     <mat-tab-group [selectedIndex]="selectedIndex" (selectedIndexChange)="selectOptionsPanel($event)" color="accent"
                    class="small">
         <mat-tab label="Data"></mat-tab>
@@ -26,8 +27,9 @@
 
     <div fxFlex="100" fxLayout="column">
         <div class="designer-panel-config" *ngIf="currentlyConfiguredWidget">
+
             <div *ngIf="selectedIndex == 0">
-                <sp-data-explorer-widget-data-settings [persistedDataStream]="persistedDataStream" [currentlyConfiguredWidget]="currentlyConfiguredWidget">
+                <sp-data-explorer-widget-data-settings [dataLakeMeasure]="dataLakeMeasure" [currentlyConfiguredWidget]="currentlyConfiguredWidget">
 
                 </sp-data-explorer-widget-data-settings>
             </div>
diff --git a/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.ts b/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.ts
index 1386db0..f3b2bd4 100644
--- a/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.ts
+++ b/ui/src/app/data-explorer/components/designer-panel/data-explorer-designer-panel.component.ts
@@ -16,36 +16,8 @@
  *
  */
 
-import {
-  Component,
-  EventEmitter,
-  Input,
-  OnChanges,
-  OnInit,
-  Output,
-  QueryList,
-  SimpleChanges,
-  ViewChildren,
-  ViewEncapsulation
-} from '@angular/core';
-import {GridsterItemComponent, GridType} from 'angular-gridster2';
-import {DateRange} from '../../../core-model/datalake/DateRange';
-import {GridsterInfo} from '../../../dashboard/models/gridster-info.model';
-import {
-  IDataViewDashboard,
-  IDataViewDashboardConfig,
-  IDataViewDashboardItem
-} from '../../models/dataview-dashboard.model';
-import {DataViewDataExplorerService} from '../../services/data-view-data-explorer.service';
-import {RefreshDashboardService} from '../../services/refresh-dashboard.service';
-import {ResizeService} from '../../services/resize.service';
-import {
-  DashboardWidgetModel,
-  DataExplorerWidgetModel, PersistedDataStream
-} from "../../../core-model/gen/streampipes-model";
-import {forkJoin} from "rxjs/internal/observable/forkJoin";
-import {Observable} from "rxjs";
-import {DataExplorerDashboardGridComponent} from "../grid/data-explorer-dashboard-grid.component";
+import {Component, Input, OnInit} from '@angular/core';
+import {DataExplorerWidgetModel, DataLakeMeasure} from "../../../core-model/gen/streampipes-model";
 
 @Component({
   selector: 'sp-data-explorer-designer-panel',
@@ -55,7 +27,7 @@ import {DataExplorerDashboardGridComponent} from "../grid/data-explorer-dashboar
 export class DataExplorerDesignerPanelComponent implements OnInit {
 
   @Input() currentlyConfiguredWidget: DataExplorerWidgetModel;
-  @Input() persistedDataStream: PersistedDataStream;
+  @Input() dataLakeMeasure: DataLakeMeasure;
 
   selectedIndex: number = 0;
 
diff --git a/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.html b/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.html
index fed830e..5696663 100644
--- a/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.html
+++ b/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.html
@@ -16,14 +16,27 @@
   ~
   -->
 
-<div fxFlex="100">
-    <h4>Pipeline</h4>
-    <mat-form-field color="accent">
+<div fxFlex="100" fxLayout="column">
+    <h5>Data Source</h5>
+    <mat-radio-group
+            class="selection-radio-group"
+            [(ngModel)]="sourceSelection">
+        <mat-radio-button class="selection-radio-button" [value]="'pipeline'">Pipeline</mat-radio-button>
+        <mat-radio-button class="selection-radio-button" [value]="'measurement'">Measurement</mat-radio-button>
+    </mat-radio-group>
+    <mat-form-field color="accent" fxFlex="100" *ngIf="sourceSelection == 'pipeline'">
         <mat-label>Data Explorer Sinks</mat-label>
-        <mat-select [(value)]="persistedDataStream">
-            <mat-option [value]="pipeline" *ngFor="let pipeline of availablePipelines">
-                <div class="pipeline-name">{{ pipeline.pipelineName }}</div>
-                <div class="measure-name">{{ pipeline.measureName }}</div>
+        <mat-select [(value)]="currentlyConfiguredWidget.measureName">
+            <mat-option [value]="pipeline.measureName" *ngFor="let pipeline of availablePipelines">
+                <span class="pipeline-name">{{ pipeline.pipelineName }}</span>&nbsp;&nbsp;{{ pipeline.measureName }}
+            </mat-option>
+        </mat-select>
+    </mat-form-field>
+    <mat-form-field color="accent" fxFlex="100" *ngIf="sourceSelection == 'measurement'">
+        <mat-label>Data Explorer Sinks</mat-label>
+        <mat-select [(value)]="currentlyConfiguredWidget.measureName">
+            <mat-option [value]="measurement.measureName" *ngFor="let measurement of availableMeasurements">
+                <span class="pipeline-name">{{ measurement.measureName }}</span>
             </mat-option>
         </mat-select>
     </mat-form-field>
diff --git a/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.scss b/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.scss
index 61d4e85..964f34b 100644
--- a/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.scss
+++ b/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.scss
@@ -22,5 +22,14 @@
 
 .measure-name {
   font-weight: normal;
+}
+
+.selection-radio-group {
+    display: flex;
+    flex-direction: column;
+    margin: 15px 0;
+}
 
+.selection-radio-button {
+  margin: 5px;
 }
diff --git a/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.ts b/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.ts
index 33fed90..0951ad0 100644
--- a/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.ts
+++ b/ui/src/app/data-explorer/components/designer-panel/data-settings/data-explorer-widget-data-settings.component.ts
@@ -19,9 +19,10 @@
 import {Component, Input, OnInit} from '@angular/core';
 import {
   DataExplorerWidgetModel,
-  PersistedDataStream
+  DataLakeMeasure
 } from "../../../../core-model/gen/streampipes-model";
 import {DataViewDataExplorerService} from "../../../services/data-view-data-explorer.service";
+import {DatalakeRestService} from "../../../../core-services/datalake/datalake-rest.service";
 
 @Component({
   selector: 'sp-data-explorer-widget-data-settings',
@@ -31,17 +32,21 @@ import {DataViewDataExplorerService} from "../../../services/data-view-data-expl
 export class DataExplorerWidgetDataSettingsComponent implements OnInit {
 
   @Input() currentlyConfiguredWidget: DataExplorerWidgetModel;
-  @Input() persistedDataStream: PersistedDataStream;
+  @Input() dataLakeMeasure: DataLakeMeasure;
 
-  availablePipelines: Array<PersistedDataStream>;
+  availablePipelines: Array<DataLakeMeasure>;
+  availableMeasurements: Array<DataLakeMeasure>;
 
-  constructor(private dataExplorerService: DataViewDataExplorerService) {
+  sourceSelection: "pipeline" | "measurement" = "pipeline";
+
+  constructor(private dataExplorerService: DataViewDataExplorerService,
+              private datalakeRestService: DatalakeRestService) {
 
   }
 
   ngOnInit(): void {
-    console.log(this.persistedDataStream);
     this.loadAvailablePipelines();
+    this.loadAvailableMeasurements();
   }
 
   loadAvailablePipelines() {
@@ -50,5 +55,12 @@ export class DataExplorerWidgetDataSettingsComponent implements OnInit {
     })
   }
 
+  loadAvailableMeasurements() {
+    this.datalakeRestService.getAllInfos().subscribe(response => {
+      console.log(response);
+      this.availableMeasurements = response;
+    })
+  }
+
 
 }
diff --git a/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.html b/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.html
index b73e9d6..6d1fe7b 100644
--- a/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.html
+++ b/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.html
@@ -31,10 +31,10 @@
                     [item]="item"
                     [widget]="item"
                     [configuredWidget]="configuredWidgets.get(item.id)"
-                    [persistedDataStream]="persistedDataStreams.get(item.id)"
+                    [dataLakeMeasure]="dataLakeMeasures.get(item.id)"
                     [editMode]="editMode"
                     [gridsterItemComponent]="gridsterItemComponent"
-                    *ngIf="configuredWidgets.has(item.id) && persistedDataStreams.has(item.id)"></sp-data-explorer-dashboard-widget>
+                    *ngIf="configuredWidgets.has(item.id) && dataLakeMeasures.has(item.id)"></sp-data-explorer-dashboard-widget>
         </gridster-item>
     </ng-container>
 </gridster>
diff --git a/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.ts b/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.ts
index affcb5f..6cbdc75 100644
--- a/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.ts
+++ b/ui/src/app/data-explorer/components/grid/data-explorer-dashboard-grid.component.ts
@@ -25,8 +25,7 @@ import {
   Output,
   QueryList,
   SimpleChanges,
-  ViewChildren,
-  ViewEncapsulation
+  ViewChildren
 } from '@angular/core';
 import {GridsterItemComponent, GridType} from 'angular-gridster2';
 import {DateRange} from '../../../core-model/datalake/DateRange';
@@ -39,13 +38,9 @@ import {
 import {DataViewDataExplorerService} from '../../services/data-view-data-explorer.service';
 import {RefreshDashboardService} from '../../services/refresh-dashboard.service';
 import {ResizeService} from '../../services/resize.service';
-import {
-  DashboardWidgetModel,
-  DataExplorerWidgetModel, PersistedDataStream
-} from "../../../core-model/gen/streampipes-model";
-import {forkJoin} from "rxjs/internal/observable/forkJoin";
-import {Observable} from "rxjs";
+import {DataExplorerWidgetModel, DataLakeMeasure} from "../../../core-model/gen/streampipes-model";
 import {Tuple2} from "../../../core-model/base/Tuple2";
+import {DatalakeRestService} from "../../../core-services/datalake/datalake-rest.service";
 
 @Component({
   selector: 'sp-data-explorer-dashboard-grid',
@@ -61,7 +56,7 @@ export class DataExplorerDashboardGridComponent implements OnInit, OnChanges {
   dashboard: IDataViewDashboard;
 
   configuredWidgets: Map<String, DataExplorerWidgetModel> = new Map<String, DataExplorerWidgetModel>();
-  persistedDataStreams: Map<String, PersistedDataStream> = new Map<String, PersistedDataStream>();
+  dataLakeMeasures: Map<String, DataLakeMeasure> = new Map<String, DataLakeMeasure>();
 
   /**
    * This is the date range (start, end) to view the data and is set in data-explorer.ts
@@ -71,7 +66,7 @@ export class DataExplorerDashboardGridComponent implements OnInit, OnChanges {
 
   @Output() deleteCallback: EventEmitter<IDataViewDashboardItem> = new EventEmitter<IDataViewDashboardItem>();
   @Output() updateCallback: EventEmitter<DataExplorerWidgetModel> = new EventEmitter<DataExplorerWidgetModel>();
-  @Output() configureWidgetCallback: EventEmitter<Tuple2<DataExplorerWidgetModel, PersistedDataStream>> = new EventEmitter<Tuple2<DataExplorerWidgetModel, PersistedDataStream>>();
+  @Output() configureWidgetCallback: EventEmitter<Tuple2<DataExplorerWidgetModel, DataLakeMeasure>> = new EventEmitter<Tuple2<DataExplorerWidgetModel, DataLakeMeasure>>();
 
   options: IDataViewDashboardConfig;
   loaded = false;
@@ -80,7 +75,8 @@ export class DataExplorerDashboardGridComponent implements OnInit, OnChanges {
 
   constructor(private resizeService: ResizeService,
               private dataViewDataExplorerService: DataViewDataExplorerService,
-              private refreshDashboardService: RefreshDashboardService) {
+              private refreshDashboardService: RefreshDashboardService,
+              private datalakeRestService: DatalakeRestService) {
 
   }
 
@@ -120,7 +116,7 @@ export class DataExplorerDashboardGridComponent implements OnInit, OnChanges {
     this.dataViewDataExplorerService.getWidget(widgetId).subscribe(response => {
       this.configuredWidgets.set(widgetId, response);
       this.dataViewDataExplorerService.getPersistedDataStream(response.pipelineId, response.measureName).subscribe(ps => {
-        this.persistedDataStreams.set(widgetId, ps);
+        this.dataLakeMeasures.set(widgetId, ps);
       })
     });
   }
@@ -142,7 +138,7 @@ export class DataExplorerDashboardGridComponent implements OnInit, OnChanges {
     this.updateCallback.emit(dashboardWidget);
   }
 
-  propagateWidgetSelection(configuredWidget: Tuple2<DataExplorerWidgetModel, PersistedDataStream>) {
+  propagateWidgetSelection(configuredWidget: Tuple2<DataExplorerWidgetModel, DataLakeMeasure>) {
     this.configureWidgetCallback.emit(configuredWidget);
     this.options.api.optionsChanged();
   }
diff --git a/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.html b/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.html
index e497c05..97e3173 100644
--- a/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.html
+++ b/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.html
@@ -30,7 +30,7 @@
                 </div>
                 <sp-data-explorer-designer-panel
                         [currentlyConfiguredWidget]="currentlyConfiguredWidget"
-                        [persistedDataStream]="persistedDataStream"
+                        [dataLakeMeasure]="dataLakeMeasure"
                         fxFlex="100">
 
                 </sp-data-explorer-designer-panel>
diff --git a/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts b/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
index b7785f0..8a950e0 100644
--- a/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
+++ b/ui/src/app/data-explorer/components/panel/data-explorer-dashboard-panel.component.ts
@@ -17,18 +17,14 @@
  */
 
 import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core';
-import { MatDialog } from '@angular/material/dialog';
-import { Observable, Subscription } from 'rxjs';
-import { forkJoin } from 'rxjs/internal/observable/forkJoin';
-import { DateRange } from '../../../core-model/datalake/DateRange';
-import { DataExplorerAddVisualizationDialogComponent } from '../../dialogs/add-widget/data-explorer-add-visualization-dialog.component';
-import { IDataViewDashboard, IDataViewDashboardItem } from '../../models/dataview-dashboard.model';
-import { DataViewDataExplorerService } from '../../services/data-view-data-explorer.service';
-import { RefreshDashboardService } from '../../services/refresh-dashboard.service';
-import {
-  DashboardWidgetModel,
-  DataExplorerWidgetModel, PersistedDataStream
-} from "../../../core-model/gen/streampipes-model";
+import {MatDialog} from '@angular/material/dialog';
+import {Observable, Subscription} from 'rxjs';
+import {DateRange} from '../../../core-model/datalake/DateRange';
+import {DataExplorerAddVisualizationDialogComponent} from '../../dialogs/add-widget/data-explorer-add-visualization-dialog.component';
+import {IDataViewDashboard, IDataViewDashboardItem} from '../../models/dataview-dashboard.model';
+import {DataViewDataExplorerService} from '../../services/data-view-data-explorer.service';
+import {RefreshDashboardService} from '../../services/refresh-dashboard.service';
+import {DataExplorerWidgetModel, DataLakeMeasure} from "../../../core-model/gen/streampipes-model";
 import {DataExplorerDashboardGridComponent} from "../grid/data-explorer-dashboard-grid.component";
 import {MatDrawer} from "@angular/material/sidenav";
 import {Tuple2} from "../../../core-model/base/Tuple2";
@@ -66,7 +62,7 @@ export class DataExplorerDashboardPanelComponent implements OnInit {
   widgetsToUpdate: Map<string, DataExplorerWidgetModel> = new Map<string, DataExplorerWidgetModel>();
 
   currentlyConfiguredWidget: DataExplorerWidgetModel;
-  persistedDataStream: PersistedDataStream;
+  dataLakeMeasure: DataLakeMeasure;
 
   constructor(private dataViewDataExplorerService: DataViewDataExplorerService,
               public dialog: MatDialog,
@@ -164,10 +160,10 @@ export class DataExplorerDashboardPanelComponent implements OnInit {
     this.dashboardGrid.options.api.optionsChanged();
   }
 
-  updateCurrentlyConfiguredWidget(currentWidget: Tuple2<DataExplorerWidgetModel, PersistedDataStream>) {
+  updateCurrentlyConfiguredWidget(currentWidget: Tuple2<DataExplorerWidgetModel, DataLakeMeasure>) {
     this.widgetsToUpdate.set(currentWidget.a._id, currentWidget.a);
     this.currentlyConfiguredWidget = currentWidget.a;
-    this.persistedDataStream = currentWidget.b;
+    this.dataLakeMeasure = currentWidget.b;
     this.designerDrawer.open();
   }
 }
diff --git a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html
index 4145a83..1389bae 100644
--- a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html
+++ b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.html
@@ -54,7 +54,7 @@
                             [editMode]="editMode"
                             [dataViewDashboardItem]="widget"
                             [dataExplorerWidget]="configuredWidget"
-                            [persistedDataStream]="persistedDataStream"
+                            [dataLakeMeasure]="dataLakeMeasure"
                             class="h-100">
                     </sp-data-explorer-table-widget>
                 </div>
@@ -67,7 +67,7 @@
                             [editMode]="editMode"
                             [dataViewDashboardItem]="widget"
                             [dataExplorerWidget]="configuredWidget"
-                            [persistedDataStream]="persistedDataStream"
+                            [dataLakeMeasure]="dataLakeMeasure"
                             class="h-100">
                     </sp-data-explorer-line-chart-widget>
                 </div>
@@ -79,7 +79,9 @@
                             [gridsterItemComponent]="gridsterItemComponent"
                             [editMode]="editMode"
                             [dataViewDashboardItem]="widget"
-                            [dataExplorerWidget]="configuredWidget" class="h-100"></sp-data-explorer-image-widget>
+                            [dataExplorerWidget]="configuredWidget"
+                            [dataLakeMeasure]="dataLakeMeasure"
+                            class="h-100"></sp-data-explorer-image-widget>
                 </div>
             </div>
         </div>
diff --git a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts
index 5ce1854..cbe0bca 100644
--- a/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widget/data-explorer-dashboard-widget.component.ts
@@ -16,17 +16,14 @@
  *
  */
 
-import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
-import { MatDialog } from '@angular/material/dialog';
-import { GridsterItem, GridsterItemComponent } from 'angular-gridster2';
-import { DateRange } from '../../../core-model/datalake/DateRange';
-import { DataExplorerAddVisualizationDialogComponent } from '../../dialogs/add-widget/data-explorer-add-visualization-dialog.component';
-import { IDataViewDashboardItem } from '../../models/dataview-dashboard.model';
-import { DataViewDataExplorerService } from '../../services/data-view-data-explorer.service';
-import {
-  DataExplorerWidgetModel,
-  PersistedDataStream
-} from "../../../core-model/gen/streampipes-model";
+import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
+import {MatDialog} from '@angular/material/dialog';
+import {GridsterItem, GridsterItemComponent} from 'angular-gridster2';
+import {DateRange} from '../../../core-model/datalake/DateRange';
+import {DataExplorerAddVisualizationDialogComponent} from '../../dialogs/add-widget/data-explorer-add-visualization-dialog.component';
+import {IDataViewDashboardItem} from '../../models/dataview-dashboard.model';
+import {DataViewDataExplorerService} from '../../services/data-view-data-explorer.service';
+import {DataExplorerWidgetModel, DataLakeMeasure} from "../../../core-model/gen/streampipes-model";
 import {DataDownloadDialog} from "../datadownloadDialog/dataDownload.dialog";
 import {Tuple2} from "../../../core-model/base/Tuple2";
 
@@ -44,7 +41,7 @@ export class DataExplorerDashboardWidgetComponent implements OnInit {
   configuredWidget: DataExplorerWidgetModel;
 
   @Input()
-  persistedDataStream: PersistedDataStream;
+  dataLakeMeasure: DataLakeMeasure;
 
   @Input()
   editMode: boolean;
@@ -63,7 +60,7 @@ export class DataExplorerDashboardWidgetComponent implements OnInit {
 
   @Output() deleteCallback: EventEmitter<IDataViewDashboardItem> = new EventEmitter<IDataViewDashboardItem>();
   @Output() updateCallback: EventEmitter<DataExplorerWidgetModel> = new EventEmitter<DataExplorerWidgetModel>();
-  @Output() configureWidgetCallback: EventEmitter<Tuple2<DataExplorerWidgetModel, PersistedDataStream>> = new EventEmitter<Tuple2<DataExplorerWidgetModel, PersistedDataStream>>();
+  @Output() configureWidgetCallback: EventEmitter<Tuple2<DataExplorerWidgetModel, DataLakeMeasure>> = new EventEmitter<Tuple2<DataExplorerWidgetModel, DataLakeMeasure>>();
 
 
   title = '';
@@ -76,7 +73,7 @@ export class DataExplorerDashboardWidgetComponent implements OnInit {
   ngOnInit(): void {
     console.log(this.configuredWidget);
     this.widgetLoaded = true;
-    this.title = this.persistedDataStream.measureName;
+    this.title = this.dataLakeMeasure.measureName;
   }
 
   removeWidget() {
@@ -104,12 +101,12 @@ export class DataExplorerDashboardWidgetComponent implements OnInit {
   downloadDataAsFile() {
     const dialogRef = this.dialog.open(DataDownloadDialog, {
       width: '600px',
-      data: { index: this.persistedDataStream.measureName, date: this.viewDateRange },
+      data: { index: this.dataLakeMeasure.measureName, date: this.viewDateRange },
       panelClass: 'custom-dialog-container'
     });
   }
 
   triggerWidgetEditMode() {
-    this.configureWidgetCallback.emit({a: this.configuredWidget, b: this.persistedDataStream});
+    this.configureWidgetCallback.emit({a: this.configuredWidget, b: this.dataLakeMeasure});
   }
 }
diff --git a/ui/src/app/data-explorer/components/widgets/base/base-data-explorer-widget.ts b/ui/src/app/data-explorer/components/widgets/base/base-data-explorer-widget.ts
index 1197728..11c393e 100644
--- a/ui/src/app/data-explorer/components/widgets/base/base-data-explorer-widget.ts
+++ b/ui/src/app/data-explorer/components/widgets/base/base-data-explorer-widget.ts
@@ -16,17 +16,19 @@
  *
  */
 
-import { EventEmitter, Input, OnChanges, Output, SimpleChanges, Directive } from '@angular/core';
-import { MatDialog } from '@angular/material/dialog';
-import { GridsterItem, GridsterItemComponent } from 'angular-gridster2';
-import { DateRange } from '../../../../core-model/datalake/DateRange';
-import { DatalakeRestService } from '../../../../core-services/datalake/datalake-rest.service';
-import { IDataViewDashboardItem } from '../../../models/dataview-dashboard.model';
-import { DataDownloadDialog } from '../../datadownloadDialog/dataDownload.dialog';
+import {Directive, EventEmitter, Input, OnChanges, Output, SimpleChanges} from '@angular/core';
+import {MatDialog} from '@angular/material/dialog';
+import {GridsterItem, GridsterItemComponent} from 'angular-gridster2';
+import {DateRange} from '../../../../core-model/datalake/DateRange';
+import {DatalakeRestService} from '../../../../core-services/datalake/datalake-rest.service';
+import {IDataViewDashboardItem} from '../../../models/dataview-dashboard.model';
 import {
   DataExplorerWidgetModel,
-  EventProperty, EventPropertyPrimitive, EventPropertyUnion,
-  EventSchema, PersistedDataStream
+  DataLakeMeasure,
+  EventProperty,
+  EventPropertyPrimitive,
+  EventPropertyUnion,
+  EventSchema
 } from "../../../../core-model/gen/streampipes-model";
 
 @Directive()
@@ -48,7 +50,7 @@ export abstract class BaseDataExplorerWidget implements OnChanges {
 
   @Input() dataViewDashboardItem: IDataViewDashboardItem;
   @Input() dataExplorerWidget: DataExplorerWidgetModel;
-  @Input() persistedDataStream: PersistedDataStream;
+  @Input() dataLakeMeasure: DataLakeMeasure;
 
   public selectedProperties: string[];
 
diff --git a/ui/src/app/data-explorer/components/widgets/image/image-widget.component.ts b/ui/src/app/data-explorer/components/widgets/image/image-widget.component.ts
index ccf2423..2748d74 100644
--- a/ui/src/app/data-explorer/components/widgets/image/image-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/image/image-widget.component.ts
@@ -53,7 +53,7 @@ export class ImageWidgetComponent extends BaseDataExplorerWidget implements OnIn
     this.canvasWidth = this.gridsterItemComponent.width - 20;
     this.imagePreviewHeight = this.gridsterItemComponent.width / 14;
 
-    this.availableColumns = this.getImageProperties(this.dataExplorerWidget.dataLakeMeasure.eventSchema);
+    this.availableColumns = this.getImageProperties(this.dataLakeMeasure.eventSchema);
     this.selectedColumn = this.availableColumns[0];
     this.updateData();
   }
@@ -66,7 +66,7 @@ export class ImageWidgetComponent extends BaseDataExplorerWidget implements OnIn
     this.setShownComponents(false, false, true);
 
     this.dataLakeRestService.getDataAutoAggregation(
-        this.dataExplorerWidget.dataLakeMeasure.measureName, this.viewDateRange.startDate.getTime(), this.viewDateRange.endDate.getTime())
+        this.dataLakeMeasure.measureName, this.viewDateRange.startDate.getTime(), this.viewDateRange.endDate.getTime())
         .subscribe(
             (res: DataResult) => {
              // this.availableImageData = res;
diff --git a/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.ts b/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.ts
index f5532ab..3965b19 100644
--- a/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/line-chart/line-chart-widget.component.ts
@@ -141,13 +141,13 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget implements
 
 
   ngOnInit(): void {
-    this.availableProperties = this.getNumericProperty(this.persistedDataStream.schema);
-    this.dimensionProperties = this.getDimensionProperties(this.persistedDataStream.schema);
-    this.availableNoneNumericColumns = this.getNoneNumericProperties(this.persistedDataStream.schema);
+    this.availableProperties = this.getNumericProperty(this.dataLakeMeasure.eventSchema);
+    this.dimensionProperties = this.getDimensionProperties(this.dataLakeMeasure.eventSchema);
+    this.availableNoneNumericColumns = this.getNoneNumericProperties(this.dataLakeMeasure.eventSchema);
 
     // Reduce selected columns when more then 6
     this.selectedLineChartProperties = this.availableProperties.length > 6 ? this.availableProperties.slice(0, 5) : this.availableProperties;
-    this.xKey = this.getTimestampProperty(this.persistedDataStream.schema).runtimeName;
+    this.xKey = this.getTimestampProperty(this.dataLakeMeasure.eventSchema).runtimeName;
     this.yKeys = this.getRuntimeNames(this.selectedLineChartProperties);
     this.updateData();
     this.resizeService.resizeSubject.subscribe(info => {
@@ -166,7 +166,7 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget implements
     if (!this.advancedSettingsActive) {
       this.setShownComponents(false, false, true);
       this.dataLakeRestService.getDataAutoAggregation(
-        this.persistedDataStream.measureName, this.viewDateRange.startDate.getTime(), this.viewDateRange.endDate.getTime())
+        this.dataLakeMeasure.measureName, this.viewDateRange.startDate.getTime(), this.viewDateRange.endDate.getTime())
         .subscribe((res: DataResult) => {
           this.processNoneGroupedData(res);
         });
@@ -174,7 +174,7 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget implements
       if (this.groupValue === 'None') {
         this.setShownComponents(false, false, true);
         this.dataLakeRestService.getData(
-          this.persistedDataStream.measureName, this.viewDateRange.startDate.getTime(), this.viewDateRange.endDate.getTime()
+          this.dataLakeMeasure.measureName, this.viewDateRange.startDate.getTime(), this.viewDateRange.endDate.getTime()
           , this.aggregationTimeUnit, this.aggregationValue)
           .subscribe((res: DataResult) => {
             this.processNoneGroupedData(res);
@@ -194,7 +194,7 @@ export class LineChartWidgetComponent extends BaseDataExplorerWidget implements
     if (res.total === 0) {
       this.setShownComponents(true, false, false);
     } else {
-      res.measureName = this.persistedDataStream.measureName;
+      res.measureName = this.dataLakeMeasure.measureName;
       const tmp = this.transformData(res, this.xKey);
       this.data = this.displayData(tmp, this.yKeys);
 
diff --git a/ui/src/app/data-explorer/components/widgets/table/table-widget.component.ts b/ui/src/app/data-explorer/components/widgets/table/table-widget.component.ts
index 913a2f1..9b8d4ea 100644
--- a/ui/src/app/data-explorer/components/widgets/table/table-widget.component.ts
+++ b/ui/src/app/data-explorer/components/widgets/table/table-widget.component.ts
@@ -47,8 +47,8 @@ export class TableWidgetComponent extends BaseDataExplorerWidget implements OnIn
 
   ngOnInit(): void {
     this.dataSource.sort = this.sort;
-    this.availableColumns = [this.getTimestampProperty(this.persistedDataStream.schema)];
-    this.availableColumns = this.availableColumns.concat(this.getValuePropertyKeys(this.persistedDataStream.schema));
+    this.availableColumns = [this.getTimestampProperty(this.dataLakeMeasure.eventSchema)];
+    this.availableColumns = this.availableColumns.concat(this.getValuePropertyKeys(this.dataLakeMeasure.eventSchema));
 
     // Reduce selected columns when more then 6
     this.selectedColumns = this.availableColumns.length > 6 ? this.availableColumns.slice(0, 5) : this.availableColumns;
@@ -62,7 +62,7 @@ export class TableWidgetComponent extends BaseDataExplorerWidget implements OnIn
     this.setShownComponents(false, false, true);
 
     this.dataLakeRestService.getDataAutoAggregation(
-      this.persistedDataStream.measureName, this.viewDateRange.startDate.getTime(), this.viewDateRange.endDate.getTime())
+      this.dataLakeMeasure.measureName, this.viewDateRange.startDate.getTime(), this.viewDateRange.endDate.getTime())
       .subscribe(
       (res: DataResult) => {
         this.dataSource.data = this.transformData(res);
diff --git a/ui/src/app/data-explorer/dialogs/add-widget/data-explorer-add-visualization-dialog.component.ts b/ui/src/app/data-explorer/dialogs/add-widget/data-explorer-add-visualization-dialog.component.ts
index 24e66ef..7a4b7d1 100644
--- a/ui/src/app/data-explorer/dialogs/add-widget/data-explorer-add-visualization-dialog.component.ts
+++ b/ui/src/app/data-explorer/dialogs/add-widget/data-explorer-add-visualization-dialog.component.ts
@@ -16,16 +16,16 @@
  *
  */
 
-import { Component, Inject, OnInit } from '@angular/core';
-import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
-import { ElementIconText } from '../../../services/get-element-icon-text.service';
+import {Component, Inject, OnInit} from '@angular/core';
+import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
+import {ElementIconText} from '../../../services/get-element-icon-text.service';
 import {IDataViewDashboard, IWidget} from '../../models/dataview-dashboard.model';
-import { DataExplorerWidgetRegistry } from '../../registry/data-explorer-widget-registry';
-import { DataViewDataExplorerService } from '../../services/data-view-data-explorer.service';
+import {DataExplorerWidgetRegistry} from '../../registry/data-explorer-widget-registry';
+import {DataViewDataExplorerService} from '../../services/data-view-data-explorer.service';
 import {
   DataExplorerWidgetModel,
   DataLakeMeasure,
-  EventSchema, PersistedDataStream
+  EventSchema
 } from "../../../core-model/gen/streampipes-model";
 
 @Component({
@@ -53,10 +53,10 @@ export class DataExplorerAddVisualizationDialogComponent implements OnInit {
     description: 'Select widget'
   }];
 
-  visualizableData: PersistedDataStream[] = [];
+  visualizableData: DataLakeMeasure[] = [];
   availableWidgets: IWidget[];
 
-  selectedDataSet: PersistedDataStream;
+  selectedDataSet: DataLakeMeasure;
   selectedWidget: string;
 
   dashboard: IDataViewDashboard;
diff --git a/ui/src/app/data-explorer/services/data-view-data-explorer.service.ts b/ui/src/app/data-explorer/services/data-view-data-explorer.service.ts
index 56cfe6e..4c0a07b 100644
--- a/ui/src/app/data-explorer/services/data-view-data-explorer.service.ts
+++ b/ui/src/app/data-explorer/services/data-view-data-explorer.service.ts
@@ -27,7 +27,6 @@ import {IDataViewDashboard} from '../models/dataview-dashboard.model';
 import {
   DataExplorerWidgetModel,
   DataLakeMeasure,
-  PersistedDataStream
 } from "../../core-model/gen/streampipes-model";
 
 
@@ -101,15 +100,15 @@ export class DataViewDataExplorerService {
     return this.http.put(this.dashboardWidgetUrl + '/' + widget._id, widget);
   }
 
-  getPersistedDataStream(pipelineId: string, measureName: string): Observable<PersistedDataStream> {
+  getPersistedDataStream(pipelineId: string, measureName: string): Observable<DataLakeMeasure> {
     return this.http.get(`${this.persistedDataStreamsUrl}/${pipelineId}/${measureName}`)
-        .pipe(map(response => PersistedDataStream.fromData(response as any)));
+        .pipe(map(response => DataLakeMeasure.fromData(response as any)));
   }
 
-  getAllPersistedDataStreams(): Observable<PersistedDataStream[]> {
+  getAllPersistedDataStreams(): Observable<DataLakeMeasure[]> {
     return this.http.get(this.persistedDataStreamsUrl)
         .pipe(map(response => {
-          return (response as any[]).map(p => PersistedDataStream.fromData(p));
+          return (response as any[]).map(p => DataLakeMeasure.fromData(p));
         }));
   }
 }