Page 1 of 1

Remove sinks or sources

Posted: Thu Apr 16, 2015 5:17 pm
by Alizee
I can install sinks or sources like common stream queries using addQuery2(..), but I can only find stream queries using getLogicalQueryIds(..) followed by a removeQuery(..) loop.

So far I've noticed that I could remove sinks using their name, but how do I get those names (considering I wasn't the one who pushed the sink into the server)?

I don't have the slightest clue when it comes to sources cause those actually have no removeSource-like function at all.

Thanks in advance, your support has been outstanding so far!

Alizee

Re: Remove sinks or sources

Posted: Mon Apr 20, 2015 9:41 am
by Marco Grawunder
Hi Alizee,

you can retrieve all sinks (that you are allowed to see) with getSinks() and and all information about sources with getStreamsAndViewsInformation() (I think there could be a better name ;-)).

Sources are created when you use := or ::= in PQL. If you do not need explicit sources/sinks you can just use access/sender operators in queries. In this case the sources and sink are removed automatically if all queries that use these sources/sinks are removed.

Hope that answers your question?

Marco

Re: Remove sinks or sources

Posted: Mon Apr 20, 2015 12:16 pm
by Alizee
I'm using CQL cause I'm not going to be the one who pushes queries in the final application and want it to be as intuitive as possible. Therefore I use "CREATE STREAM" and "STREAM TO" in my source and sink queries. How would I implicitly use them in CQL?

Re: Remove sinks or sources

Posted: Mon Apr 20, 2015 1:23 pm
by Marco Grawunder
Unfortunetly, this is currently only in PQL possible.

Re: Remove sinks or sources

Posted: Mon Apr 20, 2015 2:21 pm
by Alizee
So basically there's no way to remove a source during runtime if I use CQL?

Re: Remove sinks or sources

Posted: Mon Apr 20, 2015 2:56 pm
by Marco Grawunder
Of course you can. You can use a DROP statement to remove sources and sinks if you know the name.

Re: Remove sinks or sources

Posted: Mon Apr 20, 2015 3:18 pm
by Alizee
I meant internally.. But yes, that's exactly what I'm gonna do now. Thank you for the clarification, Marco! :)

Re: Remove sinks or sources

Posted: Mon Apr 20, 2015 4:58 pm
by Alizee
PS: removeSinkByName(name, token) throws an XML-exception for some reason. Any idea why?

Re: Remove sinks or sources

Posted: Tue Apr 21, 2015 11:50 am
by Marco Grawunder
Hmm. Maybe the name of the sink is not correct? Can you post a bug report? Ich will create a Jira account for you.

http://wiki.odysseus.offis.uni-oldenbur ... port+a+bug