Hi Dilanka,

answers inline:

On 7 Mar 2016, at 8:20, Dilanka Rathnayake wrote:

Thank you for your reply. As you told I created a HTTP interface using
tomcat and it starts cluster controller while executing the query.
then as you told it is the point that I went wrong.

So then, If we should not to start the cluster by HTTP interface then we have to use the cluster to start the HTTP interface. So do you mean we have to make a simple HTTP server to start it by cluster controller or start a
server like Jetty from cluster controller?

I think that we can start a server using an implementation of an
ICCApplicationEntryPoint. That is started by the ClusterController.
To get some inspiration you could look at the way this is done in
AsterixDB (incubating) [1]. However, I would seriously encourage you to
also look at netty [2].

[1] https://github.com/apache/incubator-asterixdb/blob/master/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplicationEntryPoint.java
[2] http://netty.io/

I attached a diagram of architecture I guessed. So please look at
this diagram.

In present 'Vxquery CLI' the cluster controller starts by startLocalHyracks()
method and it starts during query execution (please correct me if I am wrong). But the problem is we have to use a HTTP interface to send HTTP
requests from the web interface to back end. So then we have to
start cluster before sending HTTP requests to back end or we have to keep running the cluster controller while running the web app. Is it correct? If
it is correct how we can do it. (any suggestions?)

Starting a mini-cluster inside of the CLI is just a shortcut for testing. The intended deployment is a separate cluster of one CC (cluster controller)
and a few NCs (node controllers) that the CLI will talk to.
So the HTTP server should be started inside of the CC that itself can be
started with the shell scripts in vxquery-server.
Please see if the information on in vxquery-server and on the website makes
sense to you and tell us what is missing.

. [image: Inline image 1]


Unfortunately, I can’t see this image. It might have been stripped out by the
mailing list. Could you send a link?

Also I went trough 'VXQUERY-180' [1] issue and its wiki page[2] . You are
discussing about a 'RESTful API' for 'CLI' there.That API
is implementing using ' SwaggerIO' and is it makes HTTP interface in
cluster controller as you told? I tried to run that and I got following
Response for all examples.

I think what we have so far is just a specification for the API and we’ve used Swagger’s tooling to describe the API, nothing is expected to work ..

There are also a few hand-written examples on the wiki page that show requests
(using curl’s syntax) and the expected results from the HTTP API.

-d "statement=for $x in doc('books.xml')/bookstore/book/title return $x"
* Rebuilt URL to: http://localhost:/????/query
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
POST /????/query HTTP/1.1
Host: localhost
User-Agent: curl/7.43.0
Accept: */*
Content-Length: 63
Content-Type: application/x-www-form-urlencoded

* upload completely sent off: 63 out of 63 bytes
< HTTP/1.1 200 OK
< Date: Mon, 07 Mar 2016 16:06:28 GMT
< Server: Apache/2.4.12 (Ubuntu)
< Last-Modified: Fri, 05 Feb 2016 05:47:57 GMT
< ETag: "208-52aff64a4d142"
< Accept-Ranges: bytes
< Content-Length: 520
< Vary: Accept-Encoding
< Content-Type: text/html
<
<html>

<head>
    <script type="text/javascript" src="
https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.js";></script>
    <script type="text/javascript" src="script.js"></script>
</head>


    <body>
        <form method="post" action="save.php">
            Name:
            <input id="name" name="name" type="text" />
            <br> Password:
            <input id="Pass" name="pass" type="password" />
            <br>
            <input type="submit" value="Done" />
        </form>
    </body>

* Connection #0 to host localhost left intact
</html>

what is that error going on?

I’m surprised that you got a response at all. It seems that some HTTP
server is running on you machine.

Also please be kind enough to suggest some works/jobs that I can do for get more familiar to this cluster controllers and HTTP interface that should
implement.

I think that it would be helpful if you would
a) try to start a mini VXQuery cluster outside of the CLI executable and
   run a query against that (just to see if it works) and
b) create a very simple implementation of an ICCApplicationEntryPoint
(e.g. one that prints something to stderr) and deploy that so that it
   will run while starting the cluster controller.

Does this make sense?
If you try this, please tell us either how you did it or what information is missing to enable you to do it (so that we could add it to the website).

Does this help?

Cheers,
Till

On Mon, Mar 7, 2016 at 2:45 AM, Till Westmann <[email protected]> wrote:

Hi Dilanka,

I took a brief look (sorry if I missed something) at the change and I do have a question on the intended deployment model. It seems to me, that you’ve created an HTTP interface that requires an additional servlet
container (Tomcat) that the HTTP interface is deployed into.

Is that correct?

If so, I think that this is not the deployment model that we envisioned
(and I hope that someone will correct me if that’s just me and not
everybody who though about this before).

As VXQuery anyway runs at least one process/JVM (the cluster controller of the underlying Hyracks platform), the idea was to have this process also serve HTTP requests. And the CLI and the WebUI would then talk to this HTTP
API. That way we would ensure that
a) the HTTP API exposes all functionality of a VXQuery cluster and
b) we don’t require too may process to start VXQuery.

So, specifically to the issue that you are seeing: the cluster should
start the HTTP interface and the container hosting the HTTP interface
should not start a cluster at all.

To run an HTTP service inside of the Hyracks cluster controller another project that’s based on Hyracks - Apache AsterixDB (incubating) [1] - uses Jetty [2]. However, another interesting option to do this that should be
considered is Netty [3].

To get some more information about the cluster architecture of VXQuery you
could also take a look at 2 technical reports on VXQuery [4] and the
underlying Hyracks platform [5].

Does this help?
Till

[1] http://asterixdb.incubator.apache.org/
[2] https://eclipse.org/jetty/
[3] http://netty.io/
[4] http://arxiv.org/abs/1504.00331
[5] https://asterix.ics.uci.edu/pub/Hyracks.pdf


On 2 Mar 2016, at 7:51, Dilanka Rathnayake wrote:

I created a Restful API to get query result using vxquery CLI.

I implemented a new java class called vxquery.java and the controller of Rest service call the 'run()' method in vxquery.java. But, as soon as the
'run()' has been called an exception is thrown as follows.
'org.apache.hyracks.api.exceptions.HyracksDataException:
org.apache.hyracks.api.exceptions.HyracksDataException:
org.apache.hyracks.api.exceptions.HyracksDataException:
org.apache.hyracks.algebricks.common.exceptions.AlgebricksException:
org.apache.vxquery.exceptions.SystemException: SYSE0001:'

If I run same method in same way through the main method in vxquery.java,
then it runs normally and gives the expected result.
When I was debugging, I have found out that the exception is throwing
because of "request error" when calling the method
'deliverIncomingMessage()' in RPCInterface.class.

I think the above mentioned error is occurred because the CLI is starting
a
cluster and run the query even if a cluster has not been defined. At that
time we cant send requests to localhost by tomcat.
Is this correct? Does anyone has an idea to solve this. Appreciate any
help
regarding this. I am trying to find a solution almost 2 days. Still no
success.

You can check my code here..
https://github.com/dilankamr/vxquery
Please check "readme" for more info.

*Best Regards.*

*Dilanka Rathnayake,*
*Department of Computer Engineering,*

*Faculty of Engineering,**University of Peradeniya,*
*Sri Lanka.*


* <https://lk.linkedin.com/in/dilankamr>
<https://www.facebook.com/Dilankamr>    *


Reply via email to