Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
ba65ecf
added a vire creation
JHoelli Sep 12, 2025
245e107
Paginator created by in backend working with curl
JHoelli Sep 12, 2025
3e6d95e
curl after date working
JHoelli Sep 12, 2025
714db3e
fix for findAll not working after introducing design view
JHoelli Sep 12, 2025
3c48b92
eliminated prints
JHoelli Sep 12, 2025
7edded7
first step to working paginator API in Adapter
JHoelli Sep 12, 2025
9886a86
startkey working
JHoelli Sep 15, 2025
2553386
small fix in migration v093 to make it runnable with design docs
JHoelli Sep 15, 2025
b6e7b79
additional views and adapter migration
JHoelli Sep 15, 2025
35d08f8
drafted UI Component
JHoelli Sep 15, 2025
7d77ef6
first draft paginator service
JHoelli Sep 15, 2025
3254408
Merge branch 'dev' into paging
JHoelli Sep 15, 2025
c26d1f1
deleted some stuff
JHoelli Sep 15, 2025
bb93ab3
first page table ui
JHoelli Sep 15, 2025
585d7a8
first draft working
JHoelli Sep 15, 2025
bfdf00a
Before Flex
JHoelli Sep 15, 2025
466bac5
flexibilised everything a bit
JHoelli Sep 15, 2025
0ff2a49
overwrite paginator
JHoelli Sep 15, 2025
8c81b5c
First draft for flexible view in pagination
JHoelli Sep 15, 2025
f5113e8
added lisence
JHoelli Sep 15, 2025
7c6e070
first draft for multiple sort options
JHoelli Sep 16, 2025
c937843
seems to be working
JHoelli Sep 16, 2025
d2727bf
fixed the numbering
JHoelli Sep 16, 2025
6a18d44
running
JHoelli Sep 16, 2025
4973153
fix for property
JHoelli Sep 16, 2025
611140e
small fix in backend
JHoelli Sep 16, 2025
d1c2e50
error
JHoelli Sep 16, 2025
7129022
first part in backendquery fixed
JHoelli Sep 16, 2025
d975683
reverted signals
JHoelli Sep 16, 2025
6a87136
First working draft
JHoelli Sep 16, 2025
82c3094
deleted Logs in sp-table-pagination
JHoelli Sep 16, 2025
cf65525
deleted more logs
JHoelli Sep 16, 2025
aae8542
last fix
JHoelli Sep 16, 2025
a8198c9
minor
JHoelli Sep 17, 2025
5a15a6f
save reload
JHoelli Sep 17, 2025
ea3156a
some cleanup
JHoelli Sep 17, 2025
6c9af36
error fixed
JHoelli Sep 17, 2025
1aa3956
added some comments
JHoelli Sep 17, 2025
41f38ae
added some comments
JHoelli Sep 17, 2025
c769309
started writing migration
JHoelli Sep 17, 2025
646b687
migration working
JHoelli Sep 17, 2025
291803f
migration order fix
JHoelli Sep 17, 2025
f48abb5
removed logger in AdapterStorageImpl
JHoelli Sep 17, 2025
811bdf5
removed logger in AdapterStorageImpl
JHoelli Sep 17, 2025
e9b0190
AdapterMasterManagement
JHoelli Sep 17, 2025
6bf1ba9
Formated Adapter Resources
JHoelli Sep 17, 2025
9742ac0
minor key renaming
JHoelli Sep 17, 2025
38483df
refactored getAdapterPagination
JHoelli Sep 17, 2025
da0d1b5
added EndItem to paginated API
JHoelli Sep 17, 2025
bf6517f
added Endkey to frontend
JHoelli Sep 17, 2025
61820b6
endkey working
JHoelli Sep 17, 2025
559c7da
filtering works
JHoelli Sep 17, 2025
0757f00
filtering works
JHoelli Sep 17, 2025
4b36e01
added view for category base
JHoelli Sep 17, 2025
e0fd74f
filtering working again
JHoelli Sep 17, 2025
8289d28
save before cleanup
JHoelli Sep 18, 2025
e454473
first working draft
JHoelli Sep 18, 2025
7ac3140
First draft of working backend
JHoelli Sep 18, 2025
b58d16b
Paging works
JHoelli Sep 18, 2025
5a92934
UI for category
JHoelli Sep 18, 2025
67e2bac
category filter seems to work
JHoelli Sep 18, 2025
014afe1
small fix in backend for running
JHoelli Sep 18, 2025
0354010
paging in category works
JHoelli Sep 18, 2025
08e0059
DB Credentials from Env
JHoelli Sep 18, 2025
fc3901c
search working
JHoelli Sep 19, 2025
3489cab
searchbar working
JHoelli Sep 19, 2025
1f2db04
reset working
JHoelli Sep 19, 2025
3e746e3
changes in filter toolbar (only one applicable)
JHoelli Sep 19, 2025
a44b980
everything working?
JHoelli Sep 19, 2025
7620c4c
refactored fetchAdapters
JHoelli Sep 19, 2025
980d91c
first part of refactoring pagination ui
JHoelli Sep 19, 2025
5ce8c16
refactoring finished
JHoelli Sep 19, 2025
9aa9a3b
refactored ng
JHoelli Sep 19, 2025
084f991
small fix in refactoring
JHoelli Sep 19, 2025
caec7f2
finished refactoring
JHoelli Sep 19, 2025
e9d3ed7
start and stop button
JHoelli Sep 19, 2025
1fbac4c
removed error
JHoelli Sep 19, 2025
fcfbab9
deleted logger
JHoelli Sep 19, 2025
0b3b2c5
eliminated Logs in Backend
JHoelli Sep 19, 2025
daac59d
save before backend refactoring
JHoelli Sep 19, 2025
1c36928
refactoring in backend seems to be working
JHoelli Sep 19, 2025
2ea8fee
eliminated last print
JHoelli Sep 19, 2025
5d55a8c
minor
JHoelli Sep 19, 2025
bf27250
mvn succesful
JHoelli Sep 19, 2025
71d9e41
fix going beack to all
JHoelli Sep 19, 2025
a58ed05
fixed category issue
JHoelli Sep 19, 2025
ed89132
fixed search field to ascending
JHoelli Sep 19, 2025
2b34cb2
added a comment
JHoelli Sep 19, 2025
751eb82
added wait to goToConnect
JHoelli Sep 22, 2025
1892cb3
small change in simulator endpoint
JHoelli Sep 22, 2025
bcde2ed
first pagination test runs
JHoelli Sep 22, 2025
fe93495
inbetween save
JHoelli Sep 22, 2025
c118b0b
draft first test
JHoelli Sep 22, 2025
a0a5e21
eliminated some logs
JHoelli Sep 22, 2025
0914a74
filter is running
JHoelli Sep 22, 2025
d4003a8
clean up
JHoelli Sep 22, 2025
abde465
eliminated a load
JHoelli Sep 22, 2025
77660d8
small fix in paging component (added defautls)
JHoelli Sep 22, 2025
d754af2
test running except running
JHoelli Sep 22, 2025
efd51c6
everything running
JHoelli Sep 22, 2025
8ebb24d
all tests are running
JHoelli Sep 22, 2025
67bdfde
small refactoring still running
JHoelli Sep 22, 2025
8487379
deleted logs
JHoelli Sep 22, 2025
3c220d4
fixed adapter tests
JHoelli Sep 23, 2025
bd58ba3
changes to view
JHoelli Sep 23, 2025
c381d09
elimnated logger
JHoelli Sep 23, 2025
efd8c9c
eliminated logger
JHoelli Sep 23, 2025
c0715ce
tests work
JHoelli Sep 23, 2025
fecffbd
Update ui/projects/streampipes/shared-ui/src/lib/components/sp-table-…
JHoelli Sep 23, 2025
b170a54
Merge branch 'apache:dev' into paging
JHoelli Sep 23, 2025
961bb58
changed naming convention to startId and endId
JHoelli Sep 23, 2025
f58b383
merged cypress
JHoelli Sep 23, 2025
34c84a4
added gradle-tech to package.json
JHoelli Sep 23, 2025
2196879
tests running again
JHoelli Sep 23, 2025
9b19cc1
some small refactoring
JHoelli Sep 23, 2025
e3823fb
finished refactoring
JHoelli Sep 23, 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 @@ -41,7 +41,8 @@
import java.util.NoSuchElementException;

/**
* This class is responsible for managing all the adapter instances which are executed on worker nodes
* This class is responsible for managing all the adapter instances which are
* executed on worker nodes
*/
public class AdapterMasterManagement {

Expand All @@ -57,8 +58,7 @@ public AdapterMasterManagement(
IAdapterStorage adapterInstanceStorage,
AdapterResourceManager adapterResourceManager,
DataStreamResourceManager dataStreamResourceManager,
AdapterMetrics adapterMetrics
) {
AdapterMetrics adapterMetrics) {
this.adapterInstanceStorage = adapterInstanceStorage;
this.adapterMetrics = adapterMetrics;
this.adapterResourceManager = adapterResourceManager;
Expand All @@ -68,8 +68,7 @@ public AdapterMasterManagement(
public void addAdapter(
AdapterDescription adapterDescription,
String adapterId,
String principalSid
)
String principalSid)
throws AdapterException {

// Create elementId for datastream
Expand All @@ -92,8 +91,7 @@ private void createDataStreamForAdapter(
AdapterDescription adapterDescription,
String adapterId,
String streamId,
String principalSid
) throws AdapterException {
String principalSid) throws AdapterException {
var storedDescription = new SourcesManagement()
.createAdapterDataStream(adapterDescription, streamId);
storedDescription.setCorrespondingAdapterId(adapterId);
Expand All @@ -116,7 +114,8 @@ public AdapterDescription getAdapter(String elementId) throws AdapterException {
}

/**
* First the adapter is stopped removed, then the corresponding data source is deleted
* First the adapter is stopped removed, then the corresponding data source is
* deleted
*
* @param elementId The elementId of the adapter instance
* @throws AdapterException when adapter can not be stopped
Expand Down Expand Up @@ -145,8 +144,20 @@ public List<AdapterDescription> getAllAdapterInstances() {
return adapterInstanceStorage.findAll();
}

public List<AdapterDescription> getPaginatedAdapterInstances(String startKey, String endKey, int limit, String view,
boolean descending) {
return adapterInstanceStorage.getAdapterPaginator(startKey,endKey, limit, view, descending);
}


public List<AdapterDescription> getItemsByCategoryPaginated(String category, String startKey, int limit,
boolean descending) {
return adapterInstanceStorage.getItemsByCategoryPaginated(category,startKey, limit, descending);
}


public void stopStreamAdapter(String elementId,
boolean forceStop) throws AdapterException {
boolean forceStop) throws AdapterException {
AdapterDescription ad = adapterInstanceStorage.getElementById(elementId);

try {
Expand Down Expand Up @@ -181,8 +192,7 @@ public void startStreamAdapter(String elementId) throws AdapterException {
ad.getAppId(),
SpServiceUrlProvider.ADAPTER,
ad.getDeploymentConfiguration()
.getDesiredServiceTags()
);
.getDesiredServiceTags());

// Update selected endpoint URL of adapter
ad.setSelectedEndpointUrl(baseUrl);
Expand All @@ -191,7 +201,8 @@ public void startStreamAdapter(String elementId) throws AdapterException {
// Invoke adapter instance
WorkerRestClient.invokeStreamAdapter(baseUrl, elementId);

// register the adapter at the metrics manager so that the AdapterHealthCheck can send metrics
// register the adapter at the metrics manager so that the AdapterHealthCheck
// can send metrics
adapterMetrics.register(ad.getElementId(), ad.getName());

LOG.info("Started adapter " + elementId + " on: " + baseUrl);
Expand All @@ -202,8 +213,7 @@ public void startStreamAdapter(String elementId) throws AdapterException {

private void installDataSource(
SpDataStream stream,
String principalSid
) throws AdapterException {
String principalSid) throws AdapterException {
try {
new DataStreamVerifier(stream).verifyAndAdd(principalSid, false);
} catch (SepaParseException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ public void install() {
new CreateAssetLinkTypeTask().execute();
new CreateDefaultAssetTask().execute();
new AddDefaultPipelineTemplatesTask(
StorageDispatcher.INSTANCE.getNoSqlStore().getPipelineTemplateStorage()
).execute();
StorageDispatcher.INSTANCE.getNoSqlStore().getPipelineTemplateStorage()).execute();
}

@Override
Expand All @@ -79,6 +78,7 @@ private void createViews() {
addNotificationView();
addPipelineView();
addDataLakeMeasureView();
addPaginatorView();
}

private void addNotificationView() {
Expand Down Expand Up @@ -113,8 +113,7 @@ private void addNotificationView() {
+ "}");
notificationCountTypeViews.put("unread", countFunction);
notificationCountDocument.setViews(notificationCountTypeViews);
Response countResp =
Utils.getCouchDbNotificationClient().design().synchronizeWithDb(notificationCountDocument);
Response countResp = Utils.getCouchDbNotificationClient().design().synchronizeWithDb(notificationCountDocument);

if (resp.getError() != null && countResp != null) {
logFailure(PREPARING_NOTIFICATIONS_TEXT);
Expand All @@ -126,6 +125,70 @@ private void addNotificationView() {
}
}

private void addPaginatorView() {
DesignDocument paginatorDocument = prepareDocument("_design/paginator");

Map<String, MapReduce> paginatorViews = new HashMap<>();

// View to paginate documents by creation time
MapReduce paginationFunctionByCreate = new MapReduce();
paginationFunctionByCreate.setMap(
"function (doc) {\n"
+ " if (doc.properties && doc.properties.createdAt) {\n"
+ " emit(doc.properties.createdAt, doc);\n"
+ " }\n"
+ "}");

// View to paginate documents by name
MapReduce paginationFunctionByName = new MapReduce();
paginationFunctionByName.setMap(
"function (doc) {\n"
+ " if (doc.properties && doc.properties.name && typeof doc.properties.name === 'string') {\n"
+ " emit(doc.properties.name, doc);\n"
+ " }\n"
+ "}");

// View to paginate documents by running
MapReduce paginationFunctionByRunning = new MapReduce();
paginationFunctionByRunning.setMap(
"function (doc) {\n"
+ " emit([doc.properties.running, doc._id], doc);\n"
+ "}");

MapReduce paginationFunctionByCategory = new MapReduce();
paginationFunctionByCategory.setMap(
"function (doc) {\n"
+ " if (doc.properties && Array.isArray(doc.properties.category)) {\n"
+ " doc.properties.category.forEach(function (cat) {\n"
+ " emit([cat, doc._id], doc);\n"
+ " });\n"
+ " }\n"
+ "}");

// View to list all non-design documents
MapReduce nonDesignDocsView = new MapReduce();
nonDesignDocsView.setMap(
"function (doc) {\n"
+ " if (!doc._id.startsWith(\"_design/\")) {\n"
+ " emit(doc._id, doc);\n"
+ " }\n"
+ "}");

// Add views to the document
paginatorViews.put("by_createdAt", paginationFunctionByCreate);
paginatorViews.put("by_name", paginationFunctionByName);
paginatorViews.put("by_running", paginationFunctionByRunning);
paginatorViews.put("by_category", paginationFunctionByCategory);
paginatorViews.put("non_design_docs", nonDesignDocsView);

paginatorDocument.setViews(paginatorViews);

// Push the design document to CouchDB
Utils.getCouchDbAdapterInstanceClient()
.design()
.synchronizeWithDb(paginatorDocument);
}

private void addPipelineView() {
DesignDocument pipelineDocument = prepareDocument("_design/adapters");
DesignDocument allPipelinesDocument = prepareDocument("_design/pipelines");
Expand All @@ -146,7 +209,6 @@ private void addPipelineView() {
pipelineDocument.setViews(adapterViews);
Utils.getCouchDbPipelineClient().design().synchronizeWithDb(pipelineDocument);


MapReduce allPipelinesFunction = new MapReduce();
allPipelinesFunction.setMap("function (doc) {\n"
+ " emit(doc._id, doc);\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
import java.util.Map;

public class ResetManagement {
// This class should be moved into another package. I moved it here because I got a cyclic maven
// This class should be moved into another package. I moved it here because I
// got a cyclic maven
// dependency between this package and streampipes-pipeline-management
// See in issue [STREAMPIPES-405]

Expand Down Expand Up @@ -104,11 +105,10 @@ private static void stopAndDeleteAllPipelines() {
private static void stopAndDeleteAllAdapters() {
AdapterMasterManagement adapterMasterManagement = new AdapterMasterManagement(
StorageDispatcher.INSTANCE.getNoSqlStore()
.getAdapterInstanceStorage(),
.getAdapterInstanceStorage(),
new SpResourceManager().manageAdapters(),
new SpResourceManager().manageDataStreams(),
AdapterMetricsManager.INSTANCE.getAdapterMetrics()
);
AdapterMetricsManager.INSTANCE.getAdapterMetrics());

List<AdapterDescription> allAdapters = adapterMasterManagement.getAllAdapterInstances();
allAdapters.forEach(adapterDescription -> {
Expand Down Expand Up @@ -144,24 +144,22 @@ private static void removeAllDataInDataLake() {
}

private static void removeAllDataViewWidgets() {
var widgetStorage =
StorageDispatcher.INSTANCE.getNoSqlStore()
.getDataExplorerWidgetStorage();
var widgetStorage = StorageDispatcher.INSTANCE.getNoSqlStore()
.getDataExplorerWidgetStorage();
widgetStorage.findAll()
.forEach(widget -> widgetStorage.deleteElementById(widget.getElementId()));
.forEach(widget -> widgetStorage.deleteElementById(widget.getElementId()));
}

private static void removeAllDataViews() {
var dataLakeDashboardStorage =
StorageDispatcher.INSTANCE.getNoSqlStore()
.getDataExplorerDashboardStorage();
var dataLakeDashboardStorage = StorageDispatcher.INSTANCE.getNoSqlStore()
.getDataExplorerDashboardStorage();
dataLakeDashboardStorage.findAll()
.forEach(dashboard -> dataLakeDashboardStorage.deleteElementById(dashboard.getElementId()));
.forEach(dashboard -> dataLakeDashboardStorage.deleteElementById(dashboard.getElementId()));
}

private static void removeAllAssets(String username) {
IGenericStorage genericStorage = StorageDispatcher.INSTANCE.getNoSqlStore()
.getGenericStorage();
.getGenericStorage();
try {
for (Map<String, Object> asset : genericStorage.findAll("asset-management")) {
genericStorage.delete((String) asset.get("_id"), (String) asset.get("_rev"));
Expand All @@ -172,8 +170,7 @@ private static void removeAllAssets(String username) {
}

private static void removeAllPipelineTemplates() {
var pipelineElementTemplateStorage = StorageDispatcher
.INSTANCE
var pipelineElementTemplateStorage = StorageDispatcher.INSTANCE
.getNoSqlStore()
.getPipelineElementTemplateStorage();

Expand All @@ -186,21 +183,19 @@ private static void removeAllPipelineTemplates() {
private static void clearGenericStorage() {
var appDocTypesToDelete = List.of(
"asset-management",
"asset-sites"
);
"asset-sites");
var genericStorage = StorageDispatcher.INSTANCE.getNoSqlStore()
.getGenericStorage();
.getGenericStorage();

appDocTypesToDelete.forEach(docType -> {
try {
var allDocs = genericStorage.findAll(docType);
for (var doc : allDocs) {
genericStorage.delete(
doc.get("_id")
.toString(),
.toString(),
doc.get("_rev")
.toString()
);
.toString());
}
} catch (IOException e) {
throw new RuntimeException(e);
Expand Down
Loading