Original commit: elastic/x-pack-elasticsearch@ae64b6355e
This commit is contained in:
Nik Everett 2017-06-23 16:19:31 -04:00
parent f9451a90a9
commit bf84de2fc4
2 changed files with 4 additions and 2 deletions

View File

@ -114,7 +114,7 @@ public abstract class ProtoUtils {
public static <T> T readValue(DataInput in, int type) throws IOException {
Object result;
byte hasNext = in.readByte();
if (hasNext == 0) {
if (hasNext == 0) { // NOCOMMIT feels like a bitmask at the start of the row would be better.
return null;
}
switch (type) {

View File

@ -120,7 +120,7 @@ public class HttpJdbcClient implements Closeable {
// read the data
// allocate columns
int rows = in.readInt();
page.resize(rows);
page.resize(rows); // NOCOMMIT I believe this is duplicated with readData
readData(in, page, rows);
return response.requestId;
@ -192,6 +192,7 @@ public class HttpJdbcClient implements Closeable {
Response response = ProtoUtils.readResponse(in, header);
// NOCOMMIT why not move the throw login into readResponse?
if (response instanceof ExceptionResponse) {
ExceptionResponse ex = (ExceptionResponse) response;
throw SqlExceptionType.asException(ex.asSql, ex.message);
@ -201,6 +202,7 @@ public class HttpJdbcClient implements Closeable {
throw new JdbcException("%s", error.stack);
}
if (response instanceof Response) {
// NOCOMMIT I'd feel more comfortable either returning Response and passing the class in and calling responseClass.cast(response)
return (R) response;
}