Hi Prachi,

I've fixed cache creation method for you, see attachment. I did not fix
anything else.
Sorry, but this kind of code with hardcoded message lengths, operation
codes, etc is very hard to work with.
Hardcoded values may be useful for trivial operations so that users get an
idea of the protocol.
But for complex stuff like SQL this gets out of hand quickly.

My recommendations:
- Create a common SendRequest method which will deal with message lengths,
op codes and request ids automatically
- Create writeString method to deal with UTF stuff in one place
- When something does not work, use debugger on the server side
(see ClientMessageParser class), it is easy to step through and see which
value went wrong

Thanks,
Pavel

On Wed, Jan 10, 2018 at 11:58 PM, Denis Magda <dma...@apache.org> wrote:

> Pavel, as a side note,
>
> The methods/operations Prachi is struggling with look pretty standard to
> me.
>
> Do you have tests for them in the code base? I mean *not* the tests you
> shared before where we use existing internal binary marshaller APIs but
> where we code every operation from scratch (what Prachi is doing for
> documentation code snippets).
>
> Such tests would help to complete the doc quicker and would ensure that
> the protocol works as expected on the user side where people are not going
> to sit on the internal binary marshaller apis.
>
> —
> Denis
>
> > On Jan 10, 2018, at 12:29 PM, Prachi Garg <pg...@gridgain.com> wrote:
> >
> > Pavel,
> >
> > I am having trouble creating examples for some of the thin protocol
> > operations. I have uploaded my project on github -
> >
> > https://github.com/pgarg/ignite-examples/blob/master/
> src/main/java/ignite/myexamples/thinclient/ThinClientExample2.java
> >
> > Please look into the following methods and provide a fix for them:
> >
> >   - doSQLQuery()
> >   - getQueryCursorPage()
> >   - putBinaryType()
> >   - doQueryScan()
> >   - createCacheWithConfiguration()
> >
> > Thanks,
> > -Prachi
>
>

Reply via email to