Hi Till, Preston,

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 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?)

. [image: Inline image 1]

> 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.

>-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?


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.
As I mentioned before in my comments in 'VXQUERY-182' [3] up to now I went
through the 'VXQuery CLI' module and I believe now I have a good idea
about implementation of
that module.

[1] - https://issues.apache.org/jira/browse/VXQUERY-180
[2] - https://cwiki.apache.org/confluence/display/VXQUERY/Server+API
[3] - https://issues.apache.org/jira/browse/VXQUERY-182

Thank you,

*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>    *

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