use of org.apache.ignite.internal.processors.odbc.SqlListenerProtocolVersion in project ignite by apache.
the class JdbcThinTcpIo method handshake.
/**
* @throws IOException On error.
* @throws IgniteCheckedException On error.
*/
public void handshake() throws IOException, IgniteCheckedException {
BinaryWriterExImpl writer = new BinaryWriterExImpl(null, new BinaryHeapOutputStream(HANDSHAKE_MSG_SIZE), null, null);
writer.writeByte((byte) SqlListenerRequest.HANDSHAKE);
writer.writeShort(CURRENT_VER.major());
writer.writeShort(CURRENT_VER.minor());
writer.writeShort(CURRENT_VER.maintenance());
writer.writeByte(SqlListenerNioListener.JDBC_CLIENT);
writer.writeBoolean(distributedJoins);
writer.writeBoolean(enforceJoinOrder);
send(writer.array());
BinaryReaderExImpl reader = new BinaryReaderExImpl(null, new BinaryHeapInputStream(read()), null, null, false);
boolean accepted = reader.readBoolean();
if (accepted)
return;
short maj = reader.readShort();
short min = reader.readShort();
short maintenance = reader.readShort();
String err = reader.readString();
SqlListenerProtocolVersion ver = SqlListenerProtocolVersion.create(maj, min, maintenance);
throw new IgniteCheckedException("Handshake failed [driverProtocolVer=" + CURRENT_VER + ", remoteNodeProtocolVer=" + ver + ", err=" + err + ']');
}
Aggregations