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

SvenO3 pushed a commit to branch 
4567-prevent-excessive-dataset-count-queries-when-using-large-page-sizes
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to 
refs/heads/4567-prevent-excessive-dataset-count-queries-when-using-large-page-sizes
 by this push:
     new 62499f0291 Limit maximum automatic count load
62499f0291 is described below

commit 62499f02919bc77c90ae0c1b339f9cd4477d3361
Author: Sven Oehler <[email protected]>
AuthorDate: Wed Jun 24 11:36:03 2026 +0200

    Limit maximum automatic count load
---
 .../datalake-configuration.component.html          | 44 +++++++++++++++++-----
 .../datalake-configuration.component.ts            | 11 +++++-
 2 files changed, 45 insertions(+), 10 deletions(-)

diff --git 
a/ui/src/app/dataset/components/datalake-configuration/datalake-configuration.component.html
 
b/ui/src/app/dataset/components/datalake-configuration/datalake-configuration.component.html
index 3b3e882896..27aa725209 100644
--- 
a/ui/src/app/dataset/components/datalake-configuration/datalake-configuration.component.html
+++ 
b/ui/src/app/dataset/components/datalake-configuration/datalake-configuration.component.html
@@ -107,15 +107,41 @@
                                 >{{ 'Loading' | translate }}
                             </mat-spinner>
                         } @else {
-                            <sp-label
-                                tone="neutral"
-                                minWidth="100px"
-                                [labelText]="
-                                    configurationEntry.eventsLatest | number
-                                "
-                                size="small"
-                            >
-                            </sp-label>
+                            @if (configurationEntry.eventsLatest > -1) {
+                                <sp-label
+                                    tone="neutral"
+                                    class="cursor-pointer"
+                                    data-cy="datalake-latest-count-value"
+                                    minWidth="100px"
+                                    [labelText]="
+                                        configurationEntry.eventsLatest | 
number
+                                    "
+                                    size="small"
+                                    (click)="
+                                        receiveLatestMeasurementSize(
+                                            configurationEntry
+                                        );
+                                        $event.stopPropagation()
+                                    "
+                                >
+                                </sp-label>
+                            } @else {
+                                <sp-label
+                                    tone="neutral"
+                                    class="cursor-pointer"
+                                    data-cy="datalake-latest-count-button"
+                                    minWidth="100px"
+                                    [labelText]="'Click to load' | translate"
+                                    size="small"
+                                    (click)="
+                                        receiveLatestMeasurementSize(
+                                            configurationEntry
+                                        );
+                                        $event.stopPropagation()
+                                    "
+                                >
+                                </sp-label>
+                            }
                         }
                     </td>
                 </ng-container>
diff --git 
a/ui/src/app/dataset/components/datalake-configuration/datalake-configuration.component.ts
 
b/ui/src/app/dataset/components/datalake-configuration/datalake-configuration.component.ts
index cf53cd6441..3ef6c539f2 100644
--- 
a/ui/src/app/dataset/components/datalake-configuration/datalake-configuration.component.ts
+++ 
b/ui/src/app/dataset/components/datalake-configuration/datalake-configuration.component.ts
@@ -137,6 +137,8 @@ import { Subscription } from 'rxjs';
 export class DatalakeConfigurationComponent
     implements OnInit, AfterViewInit, OnDestroy
 {
+    private readonly maxAutomaticCountLoad = 50;
+
     paginator: MatPaginator;
     @ViewChild(MatSort) sort: MatSort;
     @ViewChild(SpTableComponent)
@@ -439,6 +441,10 @@ export class DatalakeConfigurationComponent
         this.queryEntryCounts([entry.name], 'eventsTotal');
     }
 
+    receiveLatestMeasurementSize(entry: DataLakeConfigurationEntry): void {
+        this.queryEntryCounts([entry.name], 'eventsLatest', 7);
+    }
+
     receiveMeasurementSizes(pageIndex: number): void {
         const start = pageIndex * this.pageSize;
         const end = start + this.pageSize;
@@ -446,7 +452,10 @@ export class DatalakeConfigurationComponent
             .slice(start, end)
             .filter(m => m.eventsLatest === -1)
             .map(m => m.name);
-        if (measurements.length > 0) {
+        if (
+            measurements.length > 0 &&
+            measurements.length <= this.maxAutomaticCountLoad
+        ) {
             this.queryEntryCounts(measurements, 'eventsLatest', 7);
         }
     }

Reply via email to