0

Building zk front end to handle multiple simultaneous long running data queries?

asked 2011-10-31 18:42:05 +0800

davout gravatar image davout
1435 3 18

I have design problem that I'm looking to solve with ZK.

There is a requirement to build a web app to support a portal style multi window display where each window is displays two panes: a query statement in the top pane, and the query results in a grid in the second pane. The queries are being sent to an underlying custom analytics engine. Each query window need to be modeless - think MDI. The data queries to the underlying custom analytics engine can be very long running - 2 minutes plus sometimes to return results.

To address this I want to provide the user with a MDI style interface where they can:
* Open a new query window
* Type in the query string and select 'go'. Under the hood the code will fire off the query to the remote custom analytics engine
* Open a second query window
* In the second query window type in a new query and select 'go'
* Repeat this for a third window and so on.
* Once a query window has received its results, the user is free to change the query statement and fire off a second different query.

Behind the scenes something has to receive a notification that a query has completed and that the related window grid needs to be updated with the results. There is no indication of when a query will be completed by the underlying custome analytics engine. If my app fires off queries from windows A, B C and D; the results could return in any order.

Any suggestions for how to deliver this in ZK?

delete flag offensive retag edit

28 Replies

Sort by ยป oldest newest

answered 2011-11-10 09:21:25 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Gekkio,
i'm not at the codes before weekend. So i have a question for the AtmosphereServerPush. Is the zkmax package needed for the AtmosphereServerPush?

thanks
Stephan

link publish delete flag offensive edit

answered 2011-11-10 12:39:16 +0800

gekkio gravatar image gekkio flag of Finland
899 1
http://gekkio.fi/blog

AtmosphereServerPush works with all ZK editions, so it does not need any extras (zkex.jar, zkmax.jar).

I've removed the zkmax dependency from the sample project to clarify this.

link publish delete flag offensive edit

answered 2011-11-11 02:45:51 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

Hi Joonas,

Thanks for the suggestions. We will add the "non-blocking server push" feature in ZK6.

Looking forward to your blog.

link publish delete flag offensive edit

answered 2011-11-11 04:56:52 +0800

dennis gravatar image dennis
3679 1 6
http://www.javaworld.com....

Nice discussion, I would like to know the CometAtmosphereHander too.

link publish delete flag offensive edit

answered 2012-01-27 15:41:42 +0800

davout gravatar image davout
1435 3 18

I noticed that your AtmosphereServerPush implementation is in Scala. Would it be possible to package this up so that Java coders can easily deploy it?

link publish delete flag offensive edit

answered 2012-01-28 17:25:47 +0800

gekkio gravatar image gekkio flag of Finland
899 1
http://gekkio.fi/blog

Thanks for the interest!
Converting some of my Scala stuff to Java has been on my todo list for a while, so I finally did it.
You can find the rewritten async module + other goodies here:

https://github.com/Gekkio/jawwa

The first version (0.1.0) is available in a Maven repository if you want to try it. Please note that everything in that project is still experimental, so remember to do careful testing if you intend to use it.

link publish delete flag offensive edit

answered 2012-01-28 17:36:23 +0800

gekkio gravatar image gekkio flag of Finland
899 1
http://gekkio.fi/blog

I'd also like to point out that ZK 6 will include an asynchronous server push implementation in the ZK EE package. Once ZK 6 is released, you could consider using it instead since it might be more stable than my experimental stuff.

link publish delete flag offensive edit

answered 2012-01-28 22:22:49 +0800

rdgrimes gravatar image rdgrimes
735 7

updated 2012-01-28 22:25:01 +0800

I have a couple comments on this that I hope are relevant.

First, I would never tie a 2 minute process to an interactive process. This is more like a batch process whose results should be accessible from the app, whether that is immediate or later. This gives you the flexibility of either consuming the results during the current session or coming back later and continuing on. As such, here is what I would do.

1) Separate the analytics engine process as a service using the @OneWay Annotation.

2) When the requested process is done in #1, store each result set to a temporary results file, with a unique Id, to the server.

3) Create an associative entry in a UserResults table, containing the user Id and results file unique Id.

4) You can then either:
a) long poll for changes to the UserResults table, if the user is waiting in the current session for the results.
b) server push changes that have occurred within UserResults table, if again the user is waiting for the results in the current session
c) Look for these changes to the UserResults table upon a new login

5) I would have a panel in the web app that lists recently submitted queries, with a status next to each (processing, completed, viewed, etc.)

6) The user could then click on "completed" queries in the mentioned panel to request the results be brought down, from the results file saved on the server, into another larger panel.

This allows the user have greater flexibility, and the ability to view historical queries, rather than regenerating them and consuming resources.

Hopefully I'm not off-base on what you're looking to accomplish.

Ron

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-10-31 18:42:05 +0800

Seen: 1,261 times

Last updated: Jan 28 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More