[Mondrian] MONDRIAN-689: Session cancelling in XML/A server
ken.ganong at truvenhealth.com
Wed Jan 21 14:09:10 EST 2015
I'm planning to submit a patch to add session cancelling to the olap4j-xmlaserver project. Here is how I am planning to implement this feature:
* Have the XML/A server recognize Microsoft's extension for query cancelling, but only the version giving a session id.
* Expand SessionInfo from DefaultXmlaServlet and move it into its own java file.
* When executing a query (including drill through queries), add an OlapStatement to the session. Remove this OlapStatement from the session when done executing the query (in the finally block).
* Sessions will have a configurable timeout and a thread will run to periodically cull timed out sessions.
* When a session is cancelled, the OlapStatement.cancel method will be called on every OlapStatement associated with that session.
* BeginSession will do what it does now (just return session ID).
* Sessions will be created whenever an execute command is used for it or when the Session command sets credentials for the session.
* EndSession will forget the session, but not cancel the OlapStatements in the session.
* Implement the DISCOVER_SESSIONS and DISCOVER_COMMANDS rowsets, populating them with a partial set of the columns defined in the Microsoft specification.
o For example, no reads, writes, read_kb, write_kb, cpu_time, or used_memory columns will be populated.
This implementation will depend on the OlapStatement.cancel method for cancelling queries. This bridges the gap between the XML/A cancel command and the OlapStatement cancel, but depends on the implementation of OlapStatement to communicate that cancel further down.
The sessions should not be memory-intensive, since OlapStatements are removed once they have finished executing, they should be able to be garbage collected at the same time-frame as before. Since sessions now have a timeout and are periodically culled, the slow memory creep of attaching a username and password to every session would no longer be possible (as it currently is with the sessionInfos object in the olap4j-xmlaserver code line).
I welcome any feedback about my implementation approach for Session cancelling.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mondrian