FraunhoferIOSB / FROST-Server

A Complete Server implementation of the OGC SensorThings API
https://fraunhoferiosb.github.io/FROST-Server/
GNU Lesser General Public License v3.0
192 stars 67 forks source link

Experimentally implement DELETE on Sets, with $filter support. #70

Open hylkevds opened 5 years ago

hylkevds commented 5 years ago

See https://github.com/opengeospatial/sensorthings/issues/44

hylkevds commented 5 years ago

@chhonker: the development version of FROST-Server now supports filtered deletes.

FROST-Client also does, in version 0.19-SNAPSHOT: service.observations().query().filter("phenomenonTime lt 2018-01-01T12:00:00Z").delete();

Could you try it out and see if it works as you expect?

hylkevds commented 2 years ago

ToDo: Add documentation and link to that on the landing page

ssoper-usgs commented 1 year ago

Is deletion on sets with $filter support implemented now? I see this issue is still open.

jkreft-usgs commented 1 year ago

It appears to still be in the code:

one relevant link

hylkevds commented 1 year ago

Ah, good point. Yes this is implemented and can be enabled using the option extension.filterDelete.enable.

I should type up the documentation page, and add a conformance class to the landing page linking to that documentation.

ssoper-usgs commented 1 year ago

Thanks Hylke! I can see where the filterDeleteEnabled flag is set in the code: https://github.com/FraunhoferIOSB/FROST-Server/blob/v2.x/FROST-Server.Core/src/main/java/de/fraunhofer/iosb/ilt/frostserver/settings/CoreSettings.java#L277 - but do you have notes on how to toggle this setting? By default it is set to false, how would I set it to true? A note that we are deploying this as a docker container.

EDIT: I think I found it, I think I can set an environment variable with the name extension.filterDelete.enable to true in our environment configuration to override the default false setting. Looking at this line in particular: https://github.com/FraunhoferIOSB/FROST-Server/blob/v2.x/FROST-Server.Core/src/main/java/de/fraunhofer/iosb/ilt/frostserver/settings/CoreSettings.java#L134

hylkevds commented 1 year ago

Yes, the link I posted above points to the settings documentation that lists that option (https://fraunhoferiosb.github.io/FROST-Server/settings/settings.html#extension-settings)

ssoper-usgs commented 1 year ago

Ok, I think I have the extension.filterDelete.enable set to true on my frost http server.

The deletes are working now, it is a bit slow at the moment (sometimes times out after 60 seconds processing 10 such queries at a time) but I imagine I'll need to add some indexes to the frost db to speed it up. Any suggestions on speeding up such queries would be appreciated - thank you as always.

hylkevds commented 1 year ago

There's a setting to log slow queries: persistence.slowQueryThreshold. More info on that is on our DB Performance page.