Skip to content

Commit

Permalink
Fix the latency type in the executionResponse (vesoft-inc#355)
Browse files Browse the repository at this point in the history
* Fix the latency type in the executionResponse

* Fix compilation

* Fix comment

Co-authored-by: Yichen Wang <[email protected]>
  • Loading branch information
nebula-bots and Aiee authored Dec 9, 2021
1 parent 495c78b commit 79e059a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/common/graph/ExecutionResponseOps-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct TccStructTraits<::nebula::ExecutionResponse> {
_ftype = apache::thrift::protocol::T_I32;
} else if (_fname == "latency_in_us") {
fid = 2;
_ftype = apache::thrift::protocol::T_I32;
_ftype = apache::thrift::protocol::T_I64;
} else if (_fname == "data") {
fid = 3;
_ftype = apache::thrift::protocol::T_STRUCT;
Expand Down Expand Up @@ -75,9 +75,9 @@ uint32_t Cpp2Ops<::nebula::ExecutionResponse>::write(Protocol* proto,
::nebula::ErrorCode>::write(*proto,
obj->errorCode);
xfer += proto->writeFieldEnd();
xfer += proto->writeFieldBegin("latency_in_us", apache::thrift::protocol::T_I32, 2);
xfer += proto->writeFieldBegin("latency_in_us", apache::thrift::protocol::T_I64, 2);
xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral,
int32_t>::write(*proto, obj->latencyInUs);
int64_t>::write(*proto, obj->latencyInUs);
xfer += proto->writeFieldEnd();
if (obj->data != nullptr) {
xfer += proto->writeFieldBegin("data", apache::thrift::protocol::T_STRUCT, 3);
Expand Down Expand Up @@ -134,7 +134,7 @@ _readField_error_code : {
}
_readField_latency_in_us : {
::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::integral,
int32_t>::read(*proto, obj->latencyInUs);
int64_t>::read(*proto, obj->latencyInUs);
isset_latency_in_us = true;
}

Expand Down Expand Up @@ -216,7 +216,7 @@ _readField_comment : {
}
}
case 2: {
if (LIKELY(_readState.fieldType == apache::thrift::protocol::T_I32)) {
if (LIKELY(_readState.fieldType == apache::thrift::protocol::T_I64)) {
goto _readField_latency_in_us;
} else {
goto _skip;
Expand Down Expand Up @@ -276,9 +276,9 @@ uint32_t Cpp2Ops<::nebula::ExecutionResponse>::serializedSize(
xfer += ::apache::thrift::detail::pm::protocol_methods<
::apache::thrift::type_class::enumeration,
::nebula::ErrorCode>::serializedSize<false>(*proto, obj->errorCode);
xfer += proto->serializedFieldSize("latency_in_us", apache::thrift::protocol::T_I32, 2);
xfer += proto->serializedFieldSize("latency_in_us", apache::thrift::protocol::T_I64, 2);
xfer += ::apache::thrift::detail::pm::
protocol_methods<::apache::thrift::type_class::integral, int32_t>::serializedSize<false>(
protocol_methods<::apache::thrift::type_class::integral, int64_t>::serializedSize<false>(
*proto, obj->latencyInUs);
if (obj->data != nullptr) {
xfer += proto->serializedFieldSize("data", apache::thrift::protocol::T_STRUCT, 3);
Expand Down Expand Up @@ -314,9 +314,9 @@ uint32_t Cpp2Ops<::nebula::ExecutionResponse>::serializedSizeZC(
xfer += ::apache::thrift::detail::pm::protocol_methods<
::apache::thrift::type_class::enumeration,
::nebula::ErrorCode>::serializedSize<false>(*proto, obj->errorCode);
xfer += proto->serializedFieldSize("latency_in_us", apache::thrift::protocol::T_I32, 2);
xfer += proto->serializedFieldSize("latency_in_us", apache::thrift::protocol::T_I64, 2);
xfer += ::apache::thrift::detail::pm::
protocol_methods<::apache::thrift::type_class::integral, int32_t>::serializedSize<false>(
protocol_methods<::apache::thrift::type_class::integral, int64_t>::serializedSize<false>(
*proto, obj->latencyInUs);
if (obj->data != nullptr) {
xfer += proto->serializedFieldSize("data", apache::thrift::protocol::T_STRUCT, 3);
Expand Down
2 changes: 1 addition & 1 deletion src/common/graph/Response.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ struct ExecutionResponse {
}

ErrorCode errorCode{ErrorCode::SUCCEEDED};
int32_t latencyInUs{0};
int64_t latencyInUs{0};
std::unique_ptr<nebula::DataSet> data{nullptr};
std::unique_ptr<std::string> spaceName{nullptr};
std::unique_ptr<std::string> errorMsg{nullptr};
Expand Down
2 changes: 1 addition & 1 deletion src/interface/storage.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct ResponseCommon {
// Only contains the partition that returns error
1: required list<PartitionResult> failed_parts,
// Query latency from storage service
2: required i32 latency_in_us,
2: required i64 latency_in_us,
3: optional map<string,i32> latency_detail_us,
}

Expand Down

0 comments on commit 79e059a

Please sign in to comment.