You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by eb...@apache.org on 2021/08/04 13:06:00 UTC

[incubator-streampipes] branch STREAMPIPES-319 updated (2c4a16f -> e5ba500)

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

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


    from 2c4a16f  [STREAMPIPES-402] Move line chart config to widget panel
     new e007ee5  [STREAMPIPES-319] Add skeleton of DatalakeRestService class
     new 531ab7f  [STREAMPIPES-319] Add base url and datalake url definitions to DatalakeRestService class
     new 8c39daa  [STREAMPIPES-319] Fix type declaration
     new 635d12e  [STREAMPIPES-319] Add basic functionalities to Datalake REST Service
     new e5ba500  Merge branch 'STREAMPIPES-319' of github.com:apache/incubator-streampipes into STREAMPIPES-319

The 5 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:
 .../datalake/DatalakeQueryParameters.ts            |   4 +-
 .../apis/datalake-rest.service.ts                  | 193 +++++++++++++++++++++
 2 files changed, 195 insertions(+), 2 deletions(-)
 create mode 100644 ui/src/app/platform-services/apis/datalake-rest.service.ts

[incubator-streampipes] 02/05: [STREAMPIPES-319] Add base url and datalake url definitions to DatalakeRestService class

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

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

commit 531ab7f13728b3102be5fef4c6c8edd226b0fbd4
Author: Daniel Ebi <eb...@fzi.de>
AuthorDate: Thu Jul 29 11:28:08 2021 +0200

    [STREAMPIPES-319] Add base url and datalake url definitions to DatalakeRestService class
---
 ui/src/app/platform-services/apis/datalake-rest.service.ts | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/ui/src/app/platform-services/apis/datalake-rest.service.ts b/ui/src/app/platform-services/apis/datalake-rest.service.ts
index dca2c40..a90fdf4 100644
--- a/ui/src/app/platform-services/apis/datalake-rest.service.ts
+++ b/ui/src/app/platform-services/apis/datalake-rest.service.ts
@@ -17,8 +17,20 @@
  */
 
 import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { AuthStatusService } from '../../services/auth-status.service';
 
 @Injectable()
 export class DatalakeRestService {
+    constructor(private http: HttpClient,
+                private authStatusService: AuthStatusService) {
+    }
 
+    private get baseUrl() {
+        return '/streampipes-backend';
+    }
+
+    private get dataLakeUrl() {
+        return this.baseUrl + '/api/v4/users/' + this.authStatusService.email + '/datalake';
+    }
 }

[incubator-streampipes] 03/05: [STREAMPIPES-319] Fix type declaration

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

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

commit 8c39daa8c8317cf5e4675fbf9a5cac30107d2bf5
Author: Daniel Ebi <eb...@fzi.de>
AuthorDate: Wed Aug 4 15:03:44 2021 +0200

    [STREAMPIPES-319] Fix type declaration
---
 ui/src/app/core-services/datalake/DatalakeQueryParameters.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ui/src/app/core-services/datalake/DatalakeQueryParameters.ts b/ui/src/app/core-services/datalake/DatalakeQueryParameters.ts
index a71616f..6859b0c 100644
--- a/ui/src/app/core-services/datalake/DatalakeQueryParameters.ts
+++ b/ui/src/app/core-services/datalake/DatalakeQueryParameters.ts
@@ -23,8 +23,8 @@ export class DatalakeQueryParameters {
   public page: number;
   public limit: number;
   public offset: number;
-  public groupBy: number;
-  public order: number;
+  public groupBy: string;
+  public order: string;
   public aggregationFunction: string;
   public timeInterval: string;
 }

[incubator-streampipes] 04/05: [STREAMPIPES-319] Add basic functionalities to Datalake REST Service

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

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

commit 635d12ec919ea8cb82dd50939b9a83f4b00b7634
Author: Daniel Ebi <eb...@fzi.de>
AuthorDate: Wed Aug 4 15:04:46 2021 +0200

    [STREAMPIPES-319] Add basic functionalities to Datalake REST Service
---
 .../apis/datalake-rest.service.ts                  | 159 ++++++++++++++++++++-
 1 file changed, 158 insertions(+), 1 deletion(-)

diff --git a/ui/src/app/platform-services/apis/datalake-rest.service.ts b/ui/src/app/platform-services/apis/datalake-rest.service.ts
index a90fdf4..d8cfd0d 100644
--- a/ui/src/app/platform-services/apis/datalake-rest.service.ts
+++ b/ui/src/app/platform-services/apis/datalake-rest.service.ts
@@ -17,8 +17,15 @@
  */
 
 import { Injectable } from '@angular/core';
-import { HttpClient } from '@angular/common/http';
+import { HttpClient, HttpRequest } from '@angular/common/http';
 import { AuthStatusService } from '../../services/auth-status.service';
+import { Observable } from 'rxjs';
+import { DataLakeMeasure } from '../../core-model/gen/streampipes-model';
+import { map } from 'rxjs/operators';
+import { DataResult } from '../../core-model/datalake/DataResult';
+import { DatalakeQueryParameters } from '../../core-services/datalake/DatalakeQueryParameters';
+import { PageResult } from '../../core-model/datalake/PageResult';
+import { GroupedDataResult } from '../../core-model/datalake/GroupedDataResult';
 
 @Injectable()
 export class DatalakeRestService {
@@ -33,4 +40,154 @@ export class DatalakeRestService {
     private get dataLakeUrl() {
         return this.baseUrl + '/api/v4/users/' + this.authStatusService.email + '/datalake';
     }
+
+    getAllMeasurementSeries(): Observable<DataLakeMeasure[]> {
+        const url = this.dataLakeUrl + '/measurements/';
+        return this.http.get(url).pipe(map(response => {
+            return (response as any[]).map(p => DataLakeMeasure.fromData(p));
+        }));
+    }
+
+    getData(index, startDate, endDate, columns, aggregationFunction, aggregationTimeUnit, aggregationTimeValue): Observable<DataResult> {
+        const url = this.dataLakeUrl + '/measurements/' + index;
+        const timeInterval = aggregationTimeValue + aggregationTimeUnit;
+
+        const queryParams: DatalakeQueryParameters = this.getQueryParameters(columns, startDate, endDate, undefined, undefined,
+            undefined, undefined, undefined, aggregationFunction, timeInterval);
+
+        // @ts-ignore
+        return this.http.get<DataResult>(url, {params: queryParams});
+    }
+
+    getPagedData(index: string, itemsPerPage: number, page: number, columns?: string, order?: string): Observable<PageResult> {
+        const url = this.dataLakeUrl + '/measurements/' + index;
+
+        const queryParams: DatalakeQueryParameters = this.getQueryParameters(columns, undefined, undefined, page,
+            itemsPerPage, undefined, undefined, order, undefined, undefined);
+
+        // @ts-ignore
+        return this.http.get<PageResult>(url, {params: queryParams});
+    }
+
+    getGroupedData(index: string, groupingTags: string, aggregationFunction?: string, columns?: string, startDate?: number, endDate?:
+        number, aggregationTimeUnit?: string, aggregationTimeValue?: number, order?: string, limit?: number):
+        Observable<GroupedDataResult> {
+
+        const url = this.dataLakeUrl + '/measurements/' + index;
+        let _aggregationFunction = 'mean';
+        let timeInterval = '2000ms';
+
+        if (aggregationFunction) {
+            _aggregationFunction = aggregationFunction;
+        }
+
+        if (aggregationTimeUnit && aggregationTimeValue) {
+            timeInterval = aggregationTimeValue + aggregationTimeUnit;
+        }
+
+        const queryParams: DatalakeQueryParameters = this.getQueryParameters(columns, startDate, endDate, undefined, limit,
+            undefined, groupingTags, order, _aggregationFunction, timeInterval);
+
+        // @ts-ignore
+        return this.http.get<GroupedDataResult>(url, {params: queryParams});
+    }
+
+    downloadRawData(index, format) {
+        const url = this.dataLakeUrl + '/measurements/' + index + '/download?format=' + format;
+
+        const request = new HttpRequest('GET', url, {
+            reportProgress: true,
+            responseType: 'text'
+        });
+
+        return this.http.request(request);
+    }
+
+    downloadQueriedData(index, format, startDate?, endDate?, columns?, aggregationFunction?, aggregationTimeUnit?, aggregationTimeValue?, groupingsTags?, order?, limit?, offset?) {
+        const url = this.dataLakeUrl + '/measurements/' + index + '/download?format=' + format;
+        const timeInterval = aggregationTimeValue + aggregationTimeUnit;
+
+        const queryParams: DatalakeQueryParameters = this.getQueryParameters(columns, startDate, endDate, undefined,
+            limit, offset, groupingsTags, order, aggregationFunction, timeInterval);
+
+        const request = new HttpRequest('GET', url, {
+            reportProgress: true,
+            responseType: 'text',
+            params: queryParams
+        },);
+
+        return this.http.request(request);
+    }
+
+    removeData(index: string, startDate?: number, endDate?: number) {
+        const url = this.dataLakeUrl + '/measurements/' + index;
+
+        const queryParams: DatalakeQueryParameters = this.getQueryParameters(undefined, startDate, endDate, undefined,
+            undefined, undefined, undefined, undefined, undefined, undefined);
+
+        const request = new HttpRequest('DELETE', url, {
+            reportProgress: true,
+            responseType: 'text',
+            params: queryParams
+        });
+
+        return this.http.request(request);
+    }
+
+    dropSingleMeasurementSeries(index: string) {
+        const url = this.dataLakeUrl + '/measurements/' + index + '/drop';
+        return this.http.delete(url);
+    }
+
+    dropAllMeasurementSeries() {
+        const url = this.dataLakeUrl + '/measurements/';
+        return this.http.delete(url);
+    }
+
+    private getQueryParameters(columns?: string, startDate?: number, endDate?: number, page?: number, limit?: number,
+                               offset?: number, groupBy?: string, order?: string, aggregationFunction?: string, timeInterval?: string):
+        DatalakeQueryParameters {
+        const queryParams: DatalakeQueryParameters = new DatalakeQueryParameters();
+
+        if (columns) {
+            queryParams.columns = columns;
+        }
+
+        if (startDate) {
+            queryParams.startDate = startDate;
+        }
+
+        if (endDate) {
+            queryParams.endDate = endDate;
+        }
+        if (page) {
+            queryParams.page = page;
+        }
+
+        if (limit) {
+            queryParams.limit = limit;
+        }
+
+        if (offset) {
+            queryParams.offset = offset;
+        }
+
+        if (groupBy) {
+            queryParams.groupBy = groupBy;
+        }
+
+        if (order) {
+            queryParams.order = order;
+        }
+
+        if (aggregationFunction) {
+            queryParams.aggregationFunction = aggregationFunction;
+        }
+
+        if (timeInterval) {
+            queryParams.timeInterval = timeInterval;
+        }
+
+        return queryParams;
+    }
 }

[incubator-streampipes] 05/05: Merge branch 'STREAMPIPES-319' of github.com:apache/incubator-streampipes into STREAMPIPES-319

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

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

commit e5ba5009f3d903dcadbb20a9539f935a982cf790
Merge: 635d12e 2c4a16f
Author: Daniel Ebi <eb...@fzi.de>
AuthorDate: Wed Aug 4 15:05:43 2021 +0200

    Merge branch 'STREAMPIPES-319' of github.com:apache/incubator-streampipes into STREAMPIPES-319

 pom.xml                                            |   2 +-
 .../backend/StreamPipesResourceConfig.java         |   6 +-
 .../model/datalake/CustomMapSerializer.java        |  27 ++--
 .../model/datalake/DataExplorerWidgetModel.java    |  70 ++++++--
 .../model/datalake/DataLakeMeasure.java            |  21 ++-
 .../model/datalake/PersistedDataStream.java        |  71 ++++++++
 .../AbstractPipelineExtractionResource.java        |  88 ++++++++++
 .../rest/impl/dashboard/VisualizablePipeline.java  | 124 --------------
 .../dashboard/VisualizablePipelineResource.java    |  82 ++++++++++
 .../impl/datalake/PersistedDataStreamResource.java |  71 ++++++++
 ui/src/app/core-model/gen/streampipes-model.ts     |  73 +++++----
 ...lorer-widget-appearance-settings.component.html |  54 +++++++
 ...lorer-widget-appearance-settings.component.scss |  17 ++
 ...xplorer-widget-appearance-settings.component.ts |  14 +-
 .../data-explorer-designer-panel.component.html    |  19 ++-
 .../data-explorer-designer-panel.component.scss    |   4 +
 .../data-explorer-designer-panel.component.ts      |  33 +---
 ...ta-explorer-widget-data-settings.component.html |  43 +++++
 ...a-explorer-widget-data-settings.component.scss} |  17 +-
 ...data-explorer-widget-data-settings.component.ts |  65 ++++++++
 .../data-explorer-dashboard-grid.component.html    |   4 +-
 .../grid/data-explorer-dashboard-grid.component.ts |  30 ++--
 .../data-explorer-dashboard-panel.component.html   |   7 +-
 .../data-explorer-dashboard-panel.component.ts     |  47 +++---
 .../data-explorer-dashboard-widget.component.html  |  18 ++-
 .../data-explorer-dashboard-widget.component.scss  |   2 +-
 .../data-explorer-dashboard-widget.component.ts    |  29 ++--
 .../widgets/base/base-data-explorer-widget.ts      | 160 +++++++-----------
 ...ta-explorer-widget.ts => base-widget-config.ts} | 107 +++++--------
 .../config/image-widget-config.component.html}     |   9 --
 .../config/image-widget-config.component.scss}     |   9 --
 .../image/config/image-widget-config.component.ts} |  11 +-
 .../components/widgets/image/image-config.ts       |  41 -----
 .../widgets/image/image-widget.component.ts        |  42 ++---
 .../widgets/image/model/image-widget.model.ts}     |  32 ++--
 .../config/line-chart-widget-config.component.html |  63 ++++++++
 .../line-chart-widget-config.component.scss}       |   4 -
 .../config/line-chart-widget-config.component.ts   |  76 +++++++++
 .../widgets/line-chart/line-chart-config.ts        |  41 -----
 .../line-chart/line-chart-widget.component.html    |  52 +-----
 .../line-chart/line-chart-widget.component.ts      | 178 +++++++++------------
 .../line-chart/model/line-chart-widget.model.ts    |  44 +++++
 .../config/table-widget-config.component.html      |  35 ++++
 .../table/config/table-widget-config.component.ts  |  37 ++++-
 .../table-widget.model.ts}                         |  26 ++-
 .../components/widgets/table/table-config.ts       |  41 -----
 .../widgets/table/table-widget.component.html      |  45 +++---
 .../widgets/table/table-widget.component.scss      |  14 +-
 .../widgets/table/table-widget.component.ts        |  79 +++++----
 .../no-data/no-data-in-date-range.component.css    |   1 -
 .../select-properties.component.html               |   4 +-
 .../select-properties.component.ts                 |   5 +
 ui/src/app/data-explorer/data-explorer.module.ts   |  10 ++
 ...xplorer-add-visualization-dialog.component.html |   3 +-
 ...-explorer-add-visualization-dialog.component.ts |  21 ++-
 .../models/dataview-dashboard.model.ts             |  17 +-
 .../registry/widget-config-builder.ts              | 124 --------------
 .../services/data-view-data-explorer.service.ts    |  47 ++++--
 .../widget-configuration.service.ts}               |  20 +--
 59 files changed, 1397 insertions(+), 1039 deletions(-)

[incubator-streampipes] 01/05: [STREAMPIPES-319] Add skeleton of DatalakeRestService class

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

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

commit e007ee52610b49912aa12d3541356457f5698137
Author: Daniel Ebi <eb...@fzi.de>
AuthorDate: Thu Jul 29 09:53:06 2021 +0200

    [STREAMPIPES-319] Add skeleton of DatalakeRestService class
---
 .../apis/datalake-rest.service.ts                  | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/ui/src/app/platform-services/apis/datalake-rest.service.ts b/ui/src/app/platform-services/apis/datalake-rest.service.ts
new file mode 100644
index 0000000..dca2c40
--- /dev/null
+++ b/ui/src/app/platform-services/apis/datalake-rest.service.ts
@@ -0,0 +1,24 @@
+/*
+ * 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
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ *
+ */
+
+import { Injectable } from '@angular/core';
+
+@Injectable()
+export class DatalakeRestService {
+
+}