@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.calcite.avatica.proto.Requests.PrepareRequest)) { return super.equals(obj); } org.apache.calcite.avatica.proto.Requests.PrepareRequest other = (org.apache.calcite.avatica.proto.Requests.PrepareRequest) obj; boolean result = true; result = result && getConnectionId() .equals(other.getConnectionId()); result = result && getSql() .equals(other.getSql()); result = result && (getMaxRowCount() == other.getMaxRowCount()); result = result && (getMaxRowsTotal() == other.getMaxRowsTotal()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getConnectionIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, connectionId_); } if (!getSqlBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sql_); } if (maxRowCount_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeUInt64Size(3, maxRowCount_); } if (maxRowsTotal_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(4, maxRowsTotal_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public Builder mergeFrom(org.apache.calcite.avatica.proto.Requests.PrepareRequest other) { if (other == org.apache.calcite.avatica.proto.Requests.PrepareRequest.getDefaultInstance()) return this; if (!other.getConnectionId().isEmpty()) { connectionId_ = other.connectionId_; onChanged(); } if (!other.getSql().isEmpty()) { sql_ = other.sql_; onChanged(); } if (other.getMaxRowCount() != 0L) { setMaxRowCount(other.getMaxRowCount()); } if (other.getMaxRowsTotal() != 0L) { setMaxRowsTotal(other.getMaxRowsTotal()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test public void testPrepareDeserialization() throws Exception { final String sql = "SELECT * FROM FOO"; final String connectionId = UUID.randomUUID().toString(); final long maxRowCount = 200L; // The "current" serialization strategy. Requests.PrepareRequest protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowsTotal(maxRowCount).build(); Service.PrepareRequest prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); // The "old" serialization strategy. protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowCount(maxRowCount).build(); prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); // Both the new and old provided should default to the new protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowCount(500L) .setMaxRowsTotal(maxRowCount).build(); prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); }
@Test public void testPrepareDeserialization() throws Exception { final String sql = "SELECT * FROM FOO"; final String connectionId = UUID.randomUUID().toString(); final long maxRowCount = 200L; // The "current" serialization strategy. Requests.PrepareRequest protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowsTotal(maxRowCount).build(); Service.PrepareRequest prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); // The "old" serialization strategy. protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowCount(maxRowCount).build(); prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); // Both the new and old provided should default to the new protoPrepare = Requests.PrepareRequest.newBuilder(). setConnectionId(connectionId).setSql(sql).setMaxRowCount(500L) .setMaxRowsTotal(maxRowCount).build(); prepareReq = new Service.PrepareRequest().deserialize(protoPrepare); assertEquals(maxRowCount, prepareReq.maxRowCount); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getConnectionIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, connectionId_); } if (!getSqlBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, sql_); } if (maxRowCount_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeUInt64Size(3, maxRowCount_); } if (maxRowsTotal_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeInt64Size(4, maxRowsTotal_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; hash = (53 * hash) + getConnectionId().hashCode(); hash = (37 * hash) + SQL_FIELD_NUMBER; hash = (53 * hash) + getSql().hashCode(); hash = (37 * hash) + MAX_ROW_COUNT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getMaxRowCount()); hash = (37 * hash) + MAX_ROWS_TOTAL_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getMaxRowsTotal()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + CONNECTION_ID_FIELD_NUMBER; hash = (53 * hash) + getConnectionId().hashCode(); hash = (37 * hash) + SQL_FIELD_NUMBER; hash = (53 * hash) + getSql().hashCode(); hash = (37 * hash) + MAX_ROW_COUNT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getMaxRowCount()); hash = (37 * hash) + MAX_ROWS_TOTAL_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getMaxRowsTotal()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.calcite.avatica.proto.Requests.PrepareRequest)) { return super.equals(obj); } org.apache.calcite.avatica.proto.Requests.PrepareRequest other = (org.apache.calcite.avatica.proto.Requests.PrepareRequest) obj; boolean result = true; result = result && getConnectionId() .equals(other.getConnectionId()); result = result && getSql() .equals(other.getSql()); result = result && (getMaxRowCount() == other.getMaxRowCount()); result = result && (getMaxRowsTotal() == other.getMaxRowsTotal()); result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(org.apache.calcite.avatica.proto.Requests.PrepareRequest other) { if (other == org.apache.calcite.avatica.proto.Requests.PrepareRequest.getDefaultInstance()) return this; if (!other.getConnectionId().isEmpty()) { connectionId_ = other.connectionId_; onChanged(); } if (!other.getSql().isEmpty()) { sql_ = other.sql_; onChanged(); } if (other.getMaxRowCount() != 0L) { setMaxRowCount(other.getMaxRowCount()); } if (other.getMaxRowsTotal() != 0L) { setMaxRowsTotal(other.getMaxRowsTotal()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Override PrepareRequest deserialize(Message genericMsg) { final Requests.PrepareRequest msg = ProtobufService.castProtobufMessage(genericMsg, Requests.PrepareRequest.class); String connectionId = null; if (msg.hasField(CONNECTION_ID_DESCRIPTOR)) { connectionId = msg.getConnectionId(); } String sql = null; if (msg.hasField(SQL_DESCRIPTOR)) { sql = msg.getSql(); } // Use the old field unless the new field is provided long totalRowsForStatement = msg.getMaxRowCount(); if (msg.hasField(MAX_ROWS_TOTAL_DESCRIPTOR)) { totalRowsForStatement = msg.getMaxRowsTotal(); } return new PrepareRequest(connectionId, sql, totalRowsForStatement); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getConnectionIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, connectionId_); } if (!getSqlBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sql_); } if (maxRowCount_ != 0L) { output.writeUInt64(3, maxRowCount_); } if (maxRowsTotal_ != 0L) { output.writeInt64(4, maxRowsTotal_); } unknownFields.writeTo(output); }
@Override PrepareRequest deserialize(Message genericMsg) { final Requests.PrepareRequest msg = ProtobufService.castProtobufMessage(genericMsg, Requests.PrepareRequest.class); String connectionId = null; if (msg.hasField(CONNECTION_ID_DESCRIPTOR)) { connectionId = msg.getConnectionId(); } String sql = null; if (msg.hasField(SQL_DESCRIPTOR)) { sql = msg.getSql(); } // Use the old field unless the new field is provided long totalRowsForStatement = msg.getMaxRowCount(); if (msg.hasField(MAX_ROWS_TOTAL_DESCRIPTOR)) { totalRowsForStatement = msg.getMaxRowsTotal(); } return new PrepareRequest(connectionId, sql, totalRowsForStatement); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getConnectionIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, connectionId_); } if (!getSqlBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, sql_); } if (maxRowCount_ != 0L) { output.writeUInt64(3, maxRowCount_); } if (maxRowsTotal_ != 0L) { output.writeInt64(4, maxRowsTotal_); } unknownFields.writeTo(output); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public Builder mergeFrom(org.apache.calcite.avatica.proto.Requests.PrepareRequest other) { if (other == org.apache.calcite.avatica.proto.Requests.PrepareRequest.getDefaultInstance()) return this; if (!other.getConnectionId().isEmpty()) { connectionId_ = other.connectionId_; onChanged(); } if (!other.getSql().isEmpty()) { sql_ = other.sql_; onChanged(); } if (other.getMaxRowCount() != 0L) { setMaxRowCount(other.getMaxRowCount()); } onChanged(); return this; }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getConnectionIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessage.computeStringSize(1, connectionId_); } if (!getSqlBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessage.computeStringSize(2, sql_); } if (maxRowCount_ != 0L) { size += com.google.protobuf.CodedOutputStream .computeUInt64Size(3, maxRowCount_); } memoizedSize = size; return size; }
@java.lang.Override public org.apache.calcite.avatica.proto.Requests.PrepareRequest getDefaultInstanceForType() { return org.apache.calcite.avatica.proto.Requests.PrepareRequest.getDefaultInstance(); }
public org.apache.calcite.avatica.proto.Requests.PrepareRequest getDefaultInstanceForType() { return org.apache.calcite.avatica.proto.Requests.PrepareRequest.getDefaultInstance(); }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {