use of com.hazelcast.sql.impl.SqlServiceImpl in project hazelcast by hazelcast.
the class SqlExecuteMessageTask method encodeResponse.
@Override
protected ClientMessage encodeResponse(Object response) {
AbstractSqlResult result = (AbstractSqlResult) response;
if (result.updateCount() >= 0) {
return SqlExecuteCodec.encodeResponse(null, null, result.updateCount(), null);
} else {
SqlServiceImpl sqlService = nodeEngine.getSqlService();
SqlPage page = sqlService.getInternalService().getClientStateRegistry().registerAndFetch(endpoint.getUuid(), result, parameters.cursorBufferSize, serializationService);
return SqlExecuteCodec.encodeResponse(result.getRowMetadata().getColumns(), page, -1, null);
}
}
use of com.hazelcast.sql.impl.SqlServiceImpl in project hazelcast by hazelcast.
the class PhoneHomeTest method testSqlQueriesSubmitted.
@Test
public void testSqlQueriesSubmitted() {
Map<String, String> parameters = phoneHome.phoneHome(true);
assertEquals(parameters.get(PhoneHomeMetrics.SQL_QUERIES_SUBMITTED.getRequestParameterName()), "0");
SqlServiceImpl sqlService = node.getNodeEngine().getSqlService();
try {
sqlService.execute("SELECT * FROM map");
} catch (Exception e) {
ignore(e);
}
parameters = phoneHome.phoneHome(true);
assertEquals(parameters.get(PhoneHomeMetrics.SQL_QUERIES_SUBMITTED.getRequestParameterName()), "1");
}
Aggregations