Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
6e9c691
added working stepper
JHoelli Sep 24, 2025
8cb101a
getting data from popup
JHoelli Sep 24, 2025
10ab85c
page
JHoelli Sep 24, 2025
823ddfb
get working
JHoelli Sep 24, 2025
d570e02
select ID workd
JHoelli Sep 24, 2025
6dba050
added boxes
JHoelli Sep 24, 2025
7bcc921
links are in view
JHoelli Sep 24, 2025
3ff06ec
better, still UI Fixes needed
JHoelli Sep 24, 2025
9fb3cc1
added Link Type
JHoelli Sep 24, 2025
6a60170
working on first level
JHoelli Sep 25, 2025
8e235c0
first level working
JHoelli Sep 25, 2025
9e0ff7e
second level api works
JHoelli Sep 25, 2025
f779956
refactored Logic
JHoelli Sep 25, 2025
5ecd45d
eliminated log in asset service
JHoelli Sep 25, 2025
041f7fa
added Button Functionality
JHoelli Sep 25, 2025
4061e24
small fix in addToAsset
JHoelli Sep 25, 2025
3ec5132
everything seems to be working
JHoelli Sep 26, 2025
e9cb6a2
basic ui
JHoelli Sep 26, 2025
1c575e8
eliminated from Start Page
JHoelli Sep 26, 2025
6331023
tree draft
JHoelli Sep 29, 2025
a82692f
draft
JHoelli Sep 29, 2025
8c4565f
select works
JHoelli Sep 29, 2025
248009f
returned button
JHoelli Sep 29, 2025
8eacf83
Emit works
JHoelli Sep 29, 2025
943cedd
first working fraft
JHoelli Sep 29, 2025
71a9325
first draft running
JHoelli Sep 29, 2025
77c4026
save
JHoelli Sep 29, 2025
2bae75c
Message
JHoelli Sep 29, 2025
40caec7
DataLake Endpoint
JHoelli Sep 29, 2025
06eaee3
first part of DL works
JHoelli Sep 29, 2025
e9bf628
dataLake is running
JHoelli Sep 29, 2025
0425d39
some cleanup
JHoelli Sep 29, 2025
3153cfb
refactored some methods for easier readability
JHoelli Sep 29, 2025
37b44d7
cleaned up some more
JHoelli Sep 29, 2025
c9b296e
finished first cleanup
JHoelli Sep 29, 2025
e22d4c5
fixed css
JHoelli Sep 30, 2025
430e3b6
deleted comments
JHoelli Sep 30, 2025
1bc8d8a
fixed checkbox
JHoelli Sep 30, 2025
582741c
Final
JHoelli Sep 30, 2025
e6bda8b
rewrote first path to path
JHoelli Sep 30, 2025
35b0b34
inbetween saver
JHoelli Sep 30, 2025
8dc026f
rewrote to path
JHoelli Sep 30, 2025
b7e67bc
deleted comments
JHoelli Sep 30, 2025
9f1c04e
moved Asset
JHoelli Sep 30, 2025
940a333
resolved mapping issue
JHoelli Sep 30, 2025
b471c2d
elimnated console logs
JHoelli Sep 30, 2025
1f480ee
save inbetween
JHoelli Oct 1, 2025
efafc00
working
JHoelli Oct 1, 2025
1e657be
now working
JHoelli Oct 1, 2025
a7a352e
cleanup now working
JHoelli Oct 1, 2025
311440f
renamed asset model
JHoelli Oct 1, 2025
3f62ab2
deleted unneccessary loop
JHoelli Oct 1, 2025
c89e18d
easy case works
JHoelli Oct 1, 2025
c2353fe
fixed the overwriting issue
JHoelli Oct 1, 2025
2f6894c
everything working
JHoelli Oct 1, 2025
3ec5bb0
eliminated logs
JHoelli Oct 1, 2025
629a90b
imported model
JHoelli Oct 1, 2025
093ac46
Merge branch 'apache:dev' into AddAssetsToAdapter
JHoelli Oct 1, 2025
909ad51
layout has gotten better
JHoelli Oct 1, 2025
5625593
layout
JHoelli Oct 1, 2025
06b1561
Merge branch 'dev' into AddAssetsToAdapter
tenthe Oct 2, 2025
ae5a0d2
removed_polling
JHoelli Oct 6, 2025
e902922
pollign in model
JHoelli Oct 6, 2025
d9ca8f9
removed from Promise
JHoelli Oct 6, 2025
b90a7e9
translation
JHoelli Oct 6, 2025
4f2871d
prep translation of config
JHoelli Oct 6, 2025
c1d1e33
css
JHoelli Oct 6, 2025
b012c00
more translation
JHoelli Oct 6, 2025
ac56c3a
i18n translation files
JHoelli Oct 6, 2025
c6a9961
fixed linter
JHoelli Oct 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@
import org.apache.streampipes.model.datalake.DataLakeMeasure;

import java.util.List;
import java.util.Optional;

public interface IDataExplorerSchemaManagement {

List<DataLakeMeasure> getAllMeasurements();

DataLakeMeasure getById(String elementId);

Optional<DataLakeMeasure> getExistingMeasureByName(String measureName);

DataLakeMeasure createOrUpdateMeasurement(DataLakeMeasure measure);

void deleteMeasurement(String elementId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public DataLakeMeasure getById(String elementId) {
}

/**
* For new measurements an entry is generated in the database. For existing measurements the schema is updated
* For new measurements an entry is generated in the database. For existing
* measurements the schema is updated
* according to the update strategy defined by the measurement.
*/
@Override
Expand All @@ -75,28 +76,28 @@ public DataLakeMeasure createOrUpdateMeasurement(DataLakeMeasure measure) {
*/
private void handleExistingMeasurement(
DataLakeMeasure measure,
DataLakeMeasure existingMeasure
) {
DataLakeMeasure existingMeasure) {
measure.setElementId(existingMeasure.getElementId());
if (DataLakeMeasureSchemaUpdateStrategy.UPDATE_SCHEMA.equals(measure.getSchemaUpdateStrategy())) {
// For the update schema strategy the old schema is overwritten with the new one
updateMeasurement(measure);
} else {
// For the extent existing schema strategy the old schema is merged with the new one
// For the extent existing schema strategy the old schema is merged with the new
// one
unifyEventSchemaAndUpdateMeasure(measure, existingMeasure);
}
}


/**
* Returns the existing measure that has the provided measure name
*/
private Optional<DataLakeMeasure> getExistingMeasureByName(String measureName) {
@Override
public Optional<DataLakeMeasure> getExistingMeasureByName(String measureName) {
return dataLakeStorage.findAll()
.stream()
.filter(m -> m.getMeasureName()
.equals(measureName))
.findFirst();
.stream()
.filter(m -> m.getMeasureName()
.equals(measureName))
.findFirst();
}

private static void setDefaultUpdateStrategyIfNoneProvided(DataLakeMeasure measure) {
Expand All @@ -117,16 +118,15 @@ public void deleteMeasurement(String elementId) {
@Override
public boolean deleteMeasurementByName(String measureName) {
var measureToDeleteOpt = dataLakeStorage.findAll()
.stream()
.filter(measurement -> measurement.getMeasureName()
.equals(measureName))
.findFirst();
.stream()
.filter(measurement -> measurement.getMeasureName()
.equals(measureName))
.findFirst();

return measureToDeleteOpt.map(measure -> {
dataLakeStorage.deleteElementById(measure.getElementId());
return true;
}
).orElse(false);
}).orElse(false);
}

@Override
Expand All @@ -146,16 +146,15 @@ private void setSchemaVersionAndStoreMeasurement(DataLakeMeasure measure) {
}

/**
* First the event schemas of the measurements are merged and then the measure is updated in the database
* First the event schemas of the measurements are merged and then the measure
* is updated in the database
*/
private void unifyEventSchemaAndUpdateMeasure(
DataLakeMeasure measure,
DataLakeMeasure existingMeasure
) {
DataLakeMeasure existingMeasure) {
var properties = getUnifiedEventProperties(
existingMeasure,
measure
);
measure);

measure
.getEventSchema()
Expand All @@ -170,26 +169,23 @@ private void unifyEventSchemaAndUpdateMeasure(
*/
private List<EventProperty> getUnifiedEventProperties(
DataLakeMeasure measure1,
DataLakeMeasure measure2
) {
// Combine the event properties from both measures into a single Stream
DataLakeMeasure measure2) {
// Combine the event properties from both measures into a single Stream
var allMeasurementProperties = Stream.concat(
measure1.getEventSchema()
.getEventProperties()
.stream(),
.getEventProperties()
.stream(),
measure2.getEventSchema()
.getEventProperties()
.stream()
);
.getEventProperties()
.stream());

// Filter event properties by removing duplicate runtime names
// If there are duplicate keys, choose the first occurrence
var unifiedEventProperties = allMeasurementProperties
.collect(Collectors.toMap(
EventProperty::getRuntimeName,
Function.identity(),
(eventProperty, eventProperty2) -> eventProperty
))
(eventProperty, eventProperty2) -> eventProperty))
.values();
return new ArrayList<>(unifiedEventProperties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,42 +49,33 @@ public class DataLakeMeasureResource extends AbstractAuthGuardedRestResource {

public DataLakeMeasureResource() {
this.dataLakeMeasureManagement = new DataExplorerDispatcher().getDataExplorerManager()
.getSchemaManagement();
.getSchemaManagement();
}

@PostMapping(
produces = MediaType.APPLICATION_JSON_VALUE,
consumes = MediaType.APPLICATION_JSON_VALUE
)
@PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<DataLakeMeasure> addDataLake(@RequestBody DataLakeMeasure dataLakeMeasure) {
DataLakeMeasure result = this.dataLakeMeasureManagement.createOrUpdateMeasurement(dataLakeMeasure);
return ok(result);
}

/**
* Handles HTTP GET requests to retrieve the entry counts of specified measurements.
* Handles HTTP GET requests to retrieve the entry counts of specified
* measurements.
*
* @param measurementNames A list of measurement names to return the count.
* @return A ResponseEntity containing a map of measurement names and their corresponding entry counts.
* @return A ResponseEntity containing a map of measurement names and their
* corresponding entry counts.
*/
@Operation(
summary = "Retrieve measurement counts",
description = "Retrieves the entry counts for the specified measurements from the data lake.")
@GetMapping(
path = "/count",
produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Retrieve measurement counts", description = "Retrieves the entry counts for the specified measurements from the data lake.")
@GetMapping(path = "/count", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Map<String, Integer>> getEntryCountsOfMeasurments(
@Parameter(description = "A list of measurement names to return the count.")
@RequestParam(value = "measurementNames")
List<String> measurementNames
) {
@Parameter(description = "A list of measurement names to return the count.") @RequestParam(value = "measurementNames") List<String> measurementNames) {
var allMeasurements = this.dataLakeMeasureManagement.getAllMeasurements();
var result = new DataExplorerDispatcher()
.getDataExplorerManager()
.getMeasurementCounter(
allMeasurements,
measurementNames
)
measurementNames)
.countMeasurementSizes();
return ok(result);
}
Expand All @@ -99,11 +90,20 @@ public ResponseEntity<?> getDataLakeMeasure(@PathVariable("id") String elementId
}
}

@GetMapping(path = "byName/{measureName}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getDataLakeMeasureName(@PathVariable("measureName") String measureName) {
var measure = this.dataLakeMeasureManagement.getExistingMeasureByName(measureName);
if (Objects.nonNull(measure)) {
return ok(measure);
} else {
return notFound();
}
}

@PutMapping(path = "{id}", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> updateDataLakeMeasure(
@PathVariable("id") String elementId,
@RequestBody DataLakeMeasure measure
) {
@RequestBody DataLakeMeasure measure) {
if (elementId.equals(measure.getElementId())) {
try {
this.dataLakeMeasureManagement.updateMeasurement(measure);
Expand All @@ -115,7 +115,6 @@ public ResponseEntity<?> updateDataLakeMeasure(
return badRequest();
}


@DeleteMapping(path = "{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> deleteDataLakeMeasure(@PathVariable("id") String elementId) {
try {
Expand Down
7 changes: 6 additions & 1 deletion ui/deployment/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -414,5 +414,10 @@
"Error Details": null,
"Resources": null,
"All {{allResourcesAlias}}": "All {{allResourcesAlias}}",
"{{ widgetTitle }} Clone": "{{ widgetTitle }} Clone"
"{{ widgetTitle }} Clone": "{{ widgetTitle }} Clone",
"Your {{assetTypes}} were successfully added to {{assetIds}}.": "Your {{assetTypes}} were successfully added to {{assetIds}}.",
"Your {{assetTypes}} were successfully deleted from {{assetIds}}.": "Your {{assetTypes}} were successfully deleted from {{assetIds}}.",
"Starting adapter {{adapterName}}": "Starting adapter {{adapterName}}",
"Creating adapter {{adapterName}}": "Creating adapter {{adapterName}}",
"Updating adapter {{adapterName}}": "Updating adapter {{adapterName}}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ export class DatalakeRestService {
.pipe(map(res => res as DataLakeMeasure));
}

getMeasurementByName(name: String): Observable<DataLakeMeasure> {
return this.http
.get(`${this.dataLakeMeasureUrl}/byName/${name}`)
.pipe(map(res => res as DataLakeMeasure));
}

performMultiQuery(
queryParams: DatalakeQueryParameters[],
): Observable<SpQueryResult[]> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ export interface AssetLink {
navigationActive: boolean;
}

export interface LinkageData {
//Data Model to extract AssetLinks from the UI
name: string;
id: string;
type: string;
selected?: boolean | null;
}

export interface Isa95TypeDesc {
label: string;
type: Isa95Type;
Expand Down Expand Up @@ -94,6 +102,14 @@ export interface SpAssetModel extends SpAsset {
removable: boolean;
}

export interface SpAssetTreeNode {
assetId: string;
assetName: string;
assets?: SpAssetTreeNode[];
spAssetModelId: string;
flattenPath: any[];
}

export type Isa95Type =
| 'PROCESS_CELL'
| 'PRODUCTION_UNIT'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!--
~ 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.
~
-->
<div *ngIf="assetsData?.length">
<mat-tree
[dataSource]="dataSource"
[treeControl]="treeControl"
class="asset-tree"
>
<!-- Parent Node Definition -->
<mat-nested-tree-node *matTreeNodeDef="let node; when: hasChild">
<div
class="mat-tree-node"
(click)="onAssetSelect(node)"
[class.selected-node]="isSelected(node)"
>
<button
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'Toggle ' + node.assetName"
>
<mat-icon>{{
treeControl.isExpanded(node)
? 'expand_more'
: 'chevron_right'
}}</mat-icon>
</button>
<span>{{ node.assetName }}</span>
</div>
<div *ngIf="treeControl.isExpanded(node)" role="group">
<ng-container matTreeNodeOutlet></ng-container>
</div>
</mat-nested-tree-node>

<!-- Leaf Node Definition (no children) -->
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle>
<div
class="mat-tree-node"
(click)="onAssetSelect(node)"
[class.selected-node]="isSelected(node)"
>
<button
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'Toggle ' + node.assetName"
>
<mat-icon></mat-icon>
</button>
<span>{{ node.assetName }}</span>
</div>
</mat-tree-node>
</mat-tree>
</div>

<!-- If no assets available -->
<div *ngIf="!assetsData?.length">
<p>No assets available</p>
</div>
Loading
Loading