Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for delete all? #35

Open
thomasms opened this issue Apr 30, 2021 · 2 comments
Open

Support for delete all? #35

thomasms opened this issue Apr 30, 2021 · 2 comments

Comments

@thomasms
Copy link

Hi,

Thanks for the recent updates to the documentation, this is a useful utility!

I cannot find anything regarding a deleteAll API in the documentation and looking in the code it seems it is not supported:

    @Override
    public void deleteAll(Iterable<? extends XmlChannel> entities) {
        throw new UnsupportedOperationException("Delete All is not supported.");
    }

    @Override
    public void deleteAll() {
        throw new UnsupportedOperationException("Delete All is not supported.");
    }

Is there any reason why this is not supported? Are there plans to implement this in the future?

The reason I ask is that I would find it useful in a few use cases. Iterating over all channel names to delete each one individually is going to be painful for 1000+ PVs.

@shroffk
Copy link
Collaborator

shroffk commented Apr 30, 2021

Hello, there is a general desire to make delete data a task one which requires care and consideration.

Instead of exposing a delete all functionality to eveyone... if the situation arises that all channels need to be deleted then someone can delete the elastic index and recreate it (using the elastic rest api)

@iTerminate
Copy link

@shroffk I would also find it useful to have an API that lets me provide a list of Channels for deletion. This would not be functionality that lets your clear all the channels but ones that have been specified within the API call. Since the functionality is scriptable, it doesn't matter if the functionality is exposed or not. It just takes a bit longer to clear all the channels from the database with current functionality.

My use case is such that I have a script that updates pv records for various IOCs, I remove all Channels that belong to specific IOC before I add the new ones into ChannelFinder, this removes the possibility of keeping Channels that no longer exist for the specific IOC. After doing some performance testing with the latest version I noticed that the create function with a list of channels is very fast but my clearing of channels is still slow since I have to do it one by one. If you think its best not to expose this functionality, I can alternatively fetch a list of pvs for the specific IOC and compare in my script to see if any need to be removed, maybe it is a better approach? I see that the create function also deletes all existing channels before adding new ones so I don't have to worry about some stagnant properties/tags?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants