FRosner / spawncamping-dds

Data-Driven Spark allows quick data exploration based on Apache Spark.
Other
28 stars 15 forks source link

Start and stop from SprayServer should show nice error message #285

Open FRosner opened 8 years ago

FRosner commented 8 years ago

Problem

When executing SprayServer.start() while there is already a server running or SprayServer.stop() when there is no server running, the program will tell you to register / unregister a server using DDS.setServer(server: Server) and DDS.unsetServer(), respectively.

It would be much nicer, if SprayServer checked whether there is already a server set and shows a respective hint for its methods instead of the generic setter and unsetter from DDS.

Solution

Check whether a server is set in DDS before SprayServer is trying to start or stop one, and avoid calling the DDS.setServer(server: Server) and DDS.unsetServer() methods if not necessary.

We might need to add a way to check whether a server is set to DDS.