You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by oe...@apache.org on 2026/10/15 08:22:26 UTC
(streampipes) branch dev updated: fix(#5090): Add naming option for persist dataset in adapters (#5091)
This is an automated email from the ASF dual-hosted git repository.
SvenO3 pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 8b0b9d0dba fix(#5090): Add naming option for persist dataset in adapters (#5091)
8b0b9d0dba is described below
commit 8b0b9d0dba5022cdf76b3e01d0641e756a094fff
Author: Sven Oehler <43...@users.noreply.github.com>
AuthorDate: Thu Oct 15 10:22:20 2026 +0200
fix(#5090): Add naming option for persist dataset in adapters (#5091)
---
.../management/compact/PersistPipelineHandler.java | 18 +++++++++++++++---
.../connect/adapter/compact/CreateOptions.java | 7 ++++++-
.../rest/impl/connect/CompactAdapterResource.java | 2 +-
ui/deployment/i18n/de.json | 3 ++-
ui/deployment/i18n/en.json | 3 ++-
ui/deployment/i18n/pl.json | 3 ++-
.../src/lib/model/gen/streampipes-model.ts | 4 +++-
.../start-adapter-configuration.component.html | 22 ++++++++++++++++++++++
.../start-adapter-configuration.component.ts | 2 ++
.../adapter-started-dialog.component.ts | 14 +++++++++++---
10 files changed, 66 insertions(+), 12 deletions(-)
diff --git a/streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/compact/PersistPipelineHandler.java b/streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/compact/PersistPipelineHandler.java
index 6a77cf7e12..822ab84c54 100644
--- a/streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/compact/PersistPipelineHandler.java
+++ b/streampipes-connect-management/src/main/java/org/apache/streampipes/connect/management/compact/PersistPipelineHandler.java
@@ -61,13 +61,20 @@ public class PersistPipelineHandler {
public PipelineOperationStatus createAndStartPersistPipeline(AdapterDescription adapterDescription,
ExtensionServiceRequestManager requestManager) throws Exception {
+ return createAndStartPersistPipeline(adapterDescription, requestManager, null);
+ }
+
+ public PipelineOperationStatus createAndStartPersistPipeline(AdapterDescription adapterDescription,
+ ExtensionServiceRequestManager requestManager,
+ String persistDatasetName) throws Exception {
var template = getTemplate();
if (template != null) {
+ var datasetName = nameOrDefault(persistDatasetName, adapterDescription.getName());
var compactPipeline = new CompactPipeline(
String.format("persist-%s", adapterDescription.getName().replaceAll(" ", "-")),
String.format("Persist %s", adapterDescription.getName()),
null,
- makeTemplateConfig(adapterDescription, template.getPipeline()),
+ makeTemplateConfig(adapterDescription, template.getPipeline(), datasetName),
new CreateOptions(false, true)
);
var pipelineGenerationResult = compactPipelineManagement.makePipeline(compactPipeline);
@@ -85,11 +92,16 @@ public class PersistPipelineHandler {
return this.templateStorage.getElementById(DATASET_TEMPLATE_ID);
}
+ private String nameOrDefault(String name, String defaultName) {
+ return name == null || name.isBlank() ? defaultName : name;
+ }
+
private List<CompactPipelineElement> makeTemplateConfig(AdapterDescription adapterDescription,
- List<CompactPipelineElement> pipelineElements) {
+ List<CompactPipelineElement> pipelineElements,
+ String datasetName) {
pipelineElements.get(0).configuration().addAll(
List.of(
- Map.of(DATASET_MEASUREMENT_FIELD, adapterDescription.getName()),
+ Map.of(DATASET_MEASUREMENT_FIELD, datasetName),
Map.of(DATASET_TIMESTAMP_FIELD, String.format("s0::%s", getTimestampField(adapterDescription))),
Map.of(DATASET_DIMENSIONS_FIELD, getDimensions(adapterDescription))
)
diff --git a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/compact/CreateOptions.java b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/compact/CreateOptions.java
index ee8ea06f61..a30fc23088 100644
--- a/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/compact/CreateOptions.java
+++ b/streampipes-model/src/main/java/org/apache/streampipes/model/connect/adapter/compact/CreateOptions.java
@@ -22,5 +22,10 @@ import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(JsonInclude.Include.NON_NULL)
public record CreateOptions(Boolean persist,
- Boolean start) {
+ Boolean start,
+ String persistDatasetName) {
+
+ public CreateOptions(Boolean persist, Boolean start) {
+ this(persist, start, null);
+ }
}
diff --git a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/CompactAdapterResource.java b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/CompactAdapterResource.java
index 6d1b2bf3b7..9ad177a823 100644
--- a/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/CompactAdapterResource.java
+++ b/streampipes-rest/src/main/java/org/apache/streampipes/rest/impl/connect/CompactAdapterResource.java
@@ -164,7 +164,7 @@ public class CompactAdapterResource extends AbstractAdapterResource<AdapterMaste
),
pipelineManager,
getAuthenticatedUserSid()
- ).createAndStartPersistPipeline(storedAdapter, requestManager);
+ ).createAndStartPersistPipeline(storedAdapter, requestManager, compactAdapter.createOptions().persistDatasetName());
}
if (compactAdapter.createOptions()
.start()) {
diff --git a/ui/deployment/i18n/de.json b/ui/deployment/i18n/de.json
index d6e7371b5a..2969711ada 100644
--- a/ui/deployment/i18n/de.json
+++ b/ui/deployment/i18n/de.json
@@ -651,6 +651,7 @@
"Last updated": "Zuletzt aktualisiert",
"Latitude": "Breitengrad",
"Layer type": "Kartentyp",
+ "Leave blank to use the adapter name.": "Leer lassen, um den Adapternamen zu verwenden.",
"Leave entry empty": "Leer lassen",
"Left": "Links",
"Legacy multi-source chart": "Legacy-Diagramm mit mehreren Quellen",
@@ -1207,8 +1208,8 @@
"The following fields used by this chart no longer exist in the dataset:": "Die folgenden von diesem Diagramm verwendeten Felder existieren nicht mehr im Dataset:",
"The following files already exist. Please rename them.": "Die folgenden Dateien existieren bereits. Bitte umbenennen.",
"The input data stream does not satisfy the requirements specified by the data processor.": "Der Eingabedatenstrom erfüllt nicht die vom Datenprozessor festgelegten Anforderungen.",
- "The original event is used without transformation. Your script is preserved.": "Das Originalereignis wird ohne Transformation verwendet. Ihr Skript bleibt erhalten.",
"The message as shown in the top right corner of every page. Longer messages are cut off after about 60 characters and shown in full on hover": "Die Meldung, wie sie oben rechts auf jeder Seite angezeigt wird. Längere Meldungen werden nach etwa 60 Zeichen abgeschnitten und beim Überfahren mit der Maus vollständig angezeigt",
+ "The original event is used without transformation. Your script is preserved.": "Das Originalereignis wird ohne Transformation verwendet. Ihr Skript bleibt erhalten.",
"The timestamp must be a UNIX timestamp in milliseconds. Edit the timestamp field or add an ingestion timestamp.": "Der Zeitstempel muss einem UNIX-Zeitstempel in Millisekunden entsprechen. Zeitstempelfeld markieren oder einen Zeitstempel im Skripteditor hinzufügen.",
"The value should be a number": "Der Wert sollte eine Zahl sein",
"There was an error while guessing the schema of your configured data stream": "Beim Erkennen des Schemas der Datenquelle ist ein Fehler aufgetreten",
diff --git a/ui/deployment/i18n/en.json b/ui/deployment/i18n/en.json
index 93b8960cfb..a57488def6 100644
--- a/ui/deployment/i18n/en.json
+++ b/ui/deployment/i18n/en.json
@@ -651,6 +651,7 @@
"Last updated": null,
"Latitude": null,
"Layer type": null,
+ "Leave blank to use the adapter name.": null,
"Leave entry empty": null,
"Left": null,
"Legacy multi-source chart": null,
@@ -1207,8 +1208,8 @@
"The following fields used by this chart no longer exist in the dataset:": null,
"The following files already exist. Please rename them.": null,
"The input data stream does not satisfy the requirements specified by the data processor.": null,
- "The original event is used without transformation. Your script is preserved.": null,
"The message as shown in the top right corner of every page. Longer messages are cut off after about 60 characters and shown in full on hover": null,
+ "The original event is used without transformation. Your script is preserved.": null,
"The timestamp must be a UNIX timestamp in milliseconds. Edit the timestamp field or add an ingestion timestamp.": null,
"The value should be a number": null,
"There was an error while guessing the schema of your configured data stream": null,
diff --git a/ui/deployment/i18n/pl.json b/ui/deployment/i18n/pl.json
index 155a9a312a..8f73d2050c 100644
--- a/ui/deployment/i18n/pl.json
+++ b/ui/deployment/i18n/pl.json
@@ -651,6 +651,7 @@
"Last updated": "Ostatnia aktualizacja",
"Latitude": "Szerokość geograficzna",
"Layer type": "Typ warstwy",
+ "Leave blank to use the adapter name.": "Pozostaw puste, aby użyć nazwy adaptera.",
"Leave entry empty": "Pozostaw puste",
"Left": "Lewa",
"Legacy multi-source chart": "Starszy wykres z wieloma źródłami",
@@ -1207,8 +1208,8 @@
"The following fields used by this chart no longer exist in the dataset:": "Następujące pola używane przez ten wykres nie istnieją już w zbiorze danych:",
"The following files already exist. Please rename them.": "Następujące pliki już istnieją. Zmień ich nazwy.",
"The input data stream does not satisfy the requirements specified by the data processor.": "Strumień danych wejściowych nie spełnia wymagań określonych przez procesor danych.",
- "The original event is used without transformation. Your script is preserved.": "Oryginalne zdarzenie jest używane bez przekształcania. Skrypt zostaje zachowany.",
"The message as shown in the top right corner of every page. Longer messages are cut off after about 60 characters and shown in full on hover": "Komunikat wyświetlany w prawym górnym rogu każdej strony. Dłuższe komunikaty są skracane po około 60 znakach i wyświetlane w całości po najechaniu kursorem",
+ "The original event is used without transformation. Your script is preserved.": "Oryginalne zdarzenie jest używane bez przekształcania. Skrypt zostaje zachowany.",
"The timestamp must be a UNIX timestamp in milliseconds. Edit the timestamp field or add an ingestion timestamp.": "Znacznik czasu musi być znacznikiem UNIX w milisekundach. Edytuj pole znacznika czasu lub dodaj znacznik czasu konsumowania zdarzenia.",
"The value should be a number": "Wartość powinna być liczbą",
"There was an error while guessing the schema of your configured data stream": "Wystąpił błąd podczas rozpoznawania schematu skonfigurowanego strumień danych",
diff --git a/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts b/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts
index a49ccc4a22..b4144727fd 100644
--- a/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts
+++ b/ui/projects/streampipes/platform-services/src/lib/model/gen/streampipes-model.ts
@@ -17,7 +17,7 @@
* under the License.
*/
// @ts-nocheck
-// Generated using typescript-generator version 3.2.1263 on 2026-09-18 15:38:44.
+// Generated using typescript-generator version 3.2.1263 on 2026-10-13 16:58:25.
export class NamedStreamPipesEntity implements Storable {
'@class':
@@ -1153,6 +1153,7 @@ export class CorrectionValueTransformationRuleDescription extends ValueTransform
export class CreateOptions {
persist: boolean;
+ persistDatasetName: string;
start: boolean;
static fromData(
@@ -1164,6 +1165,7 @@ export class CreateOptions {
}
const instance = target || new CreateOptions();
instance.persist = data.persist;
+ instance.persistDatasetName = data.persistDatasetName;
instance.start = data.start;
return instance;
}
diff --git a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
index ed81bf2876..bde78e9716 100644
--- a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
@@ -244,6 +244,28 @@
(optionSelectedEmitter)="handlePersistOption($event)"
>
@if (saveInDataLake) {
+ <sp-form-field
+ class="mt-md"
+ [level]="3"
+ [label]="'Dataset name' | translate"
+ [description]="
+ 'Leave blank to use the adapter name.'
+ | translate
+ "
+ >
+ <mat-form-field>
+ <input
+ matInput
+ [(ngModel)]="dataLakeDatasetName"
+ [ngModelOptions]="{ standalone: true }"
+ [placeholder]="adapterDescription.name"
+ [attr.aria-label]="
+ 'Dataset name' | translate
+ "
+ data-cy="sp-store-in-datalake-dataset-name"
+ />
+ </mat-form-field>
+ </sp-form-field>
<sp-form-field
class="mt-md"
[level]="3"
diff --git a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts
index b7bbffb704..e8196e3950 100644
--- a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts
@@ -153,6 +153,7 @@ export class StartAdapterConfigurationComponent implements OnInit {
private cachedEventRateRule: ReduceEventRateRule | null;
saveInDataLake = false;
+ dataLakeDatasetName = '';
dataLakeTimestampField: string;
showCode = false;
@@ -237,6 +238,7 @@ export class StartAdapterConfigurationComponent implements OnInit {
data: {
adapter: this.adapterDescription,
saveInDataLake: this.saveInDataLake,
+ dataLakeDatasetName: this.dataLakeDatasetName,
dataLakeTimestampField: this.dataLakeTimestampField,
editMode: false,
startAdapterNow,
diff --git a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
index 7289c42ce6..ae1f4d4329 100644
--- a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
+++ b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
@@ -111,6 +111,8 @@ export class AdapterStartedDialog implements OnInit {
*/
@Input() saveInDataLake: boolean;
+ @Input() dataLakeDatasetName = '';
+
/**
* Timestamp field of event. Required when storing events in the data lake.
*/
@@ -441,14 +443,15 @@ export class AdapterStartedDialog implements OnInit {
name: pipelineId,
});
+ const datasetName = this.getDatasetName(adapter);
const res = await lastValueFrom(
- this.dataLakeService.getMeasurementByName(adapter.name),
+ this.dataLakeService.getMeasurementByName(datasetName),
);
linkageData.push({
type: 'dataset',
id: res.elementId,
- name: adapter.name,
+ name: datasetName,
});
}
@@ -515,6 +518,7 @@ export class AdapterStartedDialog implements OnInit {
createOptions: {
persist: false,
start: true,
+ persistDatasetName: undefined,
},
};
this.compactPipelineService.create(pipeline).subscribe(
@@ -544,7 +548,7 @@ export class AdapterStartedDialog implements OnInit {
): CompactPipelineElement[] {
template[0].configuration.push(
{
- db_measurement: this.adapter.name,
+ db_measurement: this.getDatasetName(adapter),
},
{
timestamp_mapping: 's0::' + this.dataLakeTimestampField,
@@ -566,6 +570,10 @@ export class AdapterStartedDialog implements OnInit {
return template;
}
+ private getDatasetName(adapter: AdapterDescription): string {
+ return this.dataLakeDatasetName?.trim() || adapter.name;
+ }
+
private createPipelineId(): string {
const base = `persist-${this.adapter.name.replaceAll(' ', '-')}`;
const suffix = Math.random().toString(36).slice(2, 8);