ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prachi Garg <pg...@gridgain.com>
Subject Thin Client documentation: OP_QUERY_SQL_CURSOR_GET_PAGE
Date Thu, 28 Dec 2017 00:06:30 GMT
Pavel,

I have 2 records in my cache, and when I run an example for
OP_QUERY_SQL=2002 with cursor page size 1, I get the following result
(expected)

len: 83
resReqId: 1
status code: 0
cursorId: 1
rowCount: 1
moreResults: true

Then, I run the OP_QUERY_SQL_CURSOR_GET_PAGE = 2003, using the following
code:

DataOutputStream out = new DataOutputStream(socket.getOutputStream());

// Message length
writeIntLittleEndian(18, out);

// Op code = QUERY_SQL_CURSOR_GET_PAGE
writeShortLittleEndian(2003, out);

// Request id (can be anything)
long reqId = 1;
writeLongLittleEndian(reqId, out);

// Cursor Id
writeLongLittleEndian(1, out);

// Send request
out.flush();

// Read result
DataInputStream in = new DataInputStream(socket.getInputStream());

// Response length
final int len = readIntLittleEndian(in);
System.out.println("len: " + len);

// Request id
long resReqId = readLongLittleEndian(in);
System.out.println("resReqId: " + resReqId);

// Success
int statusCode = readIntLittleEndian(in);
System.out.println("status code: " + statusCode);

int rowCount = readIntLittleEndian(in);
System.out.println("rowCount: " + rowCount);

// Read entries (as user objects)
for (int i = 0; i < rowCount; i++){
    // ...
}

boolean moreResults = readBooleanLittleEndian(in);
System.out.println("moreResults: " + moreResults);

but the result is not what is expected:

len: 1
resReqId: 44096429228032
status code: 721512192
rowCount: 1672392448
moreResults: true

Also, there is no error on server side.

Anything wrong in the OP_QUERY_SQL_CURSOR_GET_PAGE request that I am
sending?

-Prachi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message