Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update. #74

Merged
merged 1 commit into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gen-interface.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ done

if [ $SYNC_REMOTE_INTERFACE -eq 1 ]; then
for mod in common meta storage graph; do
wget -P $NEBULA_INTERFACE_HOME https://raw.githubusercontent.com/vesoft-inc/nebula/master/src/interface/$mod.thrift
wget -O $NEBULA_INTERFACE_HOME/$mod.thrift https://raw.githubusercontent.com/vesoft-inc/nebula/master/src/interface/$mod.thrift
done
fi

Expand Down
12 changes: 6 additions & 6 deletions include/common/graph/ExecutionResponseOps-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct TccStructTraits<::nebula::ExecutionResponse> {
if (false) {
} else if (_fname == "error_code") {
fid = 1;
_ftype = apache::thrift::protocol::T_I32;
_ftype = apache::thrift::protocol::T_I64;
} else if (_fname == "latency_in_us") {
fid = 2;
_ftype = apache::thrift::protocol::T_I32;
Expand Down Expand Up @@ -74,7 +74,7 @@ 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);
xfer += proto->writeFieldEnd();
Expand Down Expand Up @@ -133,7 +133,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 @@ -215,7 +215,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 @@ -275,7 +275,7 @@ 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>(
*proto, obj->latencyInUs);
Expand Down Expand Up @@ -313,7 +313,7 @@ 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>(
*proto, obj->latencyInUs);
Expand Down
2 changes: 1 addition & 1 deletion include/common/graph/Response.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,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
4 changes: 2 additions & 2 deletions include/nebula/sclient/StorageClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace cpp2 {
class GraphStorageServiceAsyncClient;
class ScanCursor;
class ScanEdgeRequest;
class ScanEdgeResponse;
class ScanResponse;

} // namespace cpp2
} // namespace storage
Expand Down Expand Up @@ -82,7 +82,7 @@ class StorageClient {
MetaClient* getMetaClient() { return mClient_.get(); }

private:
std::pair<bool, storage::cpp2::ScanEdgeResponse> doScanEdge(
std::pair<bool, storage::cpp2::ScanResponse> doScanEdge(
const storage::cpp2::ScanEdgeRequest& req);

template <typename Request, typename RemoteFunc, typename Response>
Expand Down
2 changes: 1 addition & 1 deletion src/client/tests/SessionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ TEST_F(SessionTest, Data) {
"USE data_test;"
"CREATE TAG IF NOT EXISTS geo(any_shape Geography, only_point Geography(point), "
"only_lineString Geography(linestring), only_polygon Geography(polygon));");
ASSERT_EQ(resp.errorCode, nebula::ErrorCode::SUCCEEDED);
ASSERT_EQ(resp.errorCode, nebula::ErrorCode::SUCCEEDED) << *resp.errorMsg;

::sleep(30);

Expand Down
10 changes: 8 additions & 2 deletions src/interface/common.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ cpp_include "common/datatypes/GeographyOps-inl.h"

const binary (cpp.type = "char const *") version = "2.6.0"

typedef i64 (cpp.type = "nebula::ClusterID") ClusterID
typedef i32 (cpp.type = "nebula::GraphSpaceID") GraphSpaceID
typedef i32 (cpp.type = "nebula::PartitionID") PartitionID
typedef i32 (cpp.type = "nebula::TagID") TagID
Expand Down Expand Up @@ -251,6 +252,11 @@ struct CheckpointInfo {
2: binary path,
}

// used for raft and drainer
struct LogEntry {
1: ClusterID cluster;
2: binary log_str;
}

// These are all data types supported in the graph properties
enum PropertyType {
Expand All @@ -263,7 +269,7 @@ enum PropertyType {
FLOAT = 4,
DOUBLE = 5,
STRING = 6,
// String with fixed length. If the string content is shorteri
// String with fixed length. If the string content is shorter
// than the given length, '\0' will be padded to the end
FIXED_STRING = 7, // New in v2
INT8 = 8, // New in v2
Expand Down Expand Up @@ -355,7 +361,7 @@ enum ErrorCode {
E_BALANCED = -2024,
E_NO_RUNNING_BALANCE_PLAN = -2025,
E_NO_VALID_HOST = -2026,
E_CORRUPTTED_BALANCE_PLAN = -2027,
E_CORRUPTED_BALANCE_PLAN = -2027,
E_NO_INVALID_BALANCE_PLAN = -2028,


Expand Down
99 changes: 87 additions & 12 deletions src/interface/gen-cpp2/GraphStorageService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,43 +204,43 @@ void GraphStorageServiceSvIf::async_tm_updateEdge(std::unique_ptr<apache::thrift
});
}

void GraphStorageServiceSvIf::scanVertex( ::nebula::storage::cpp2::ScanVertexResponse& /*_return*/, const ::nebula::storage::cpp2::ScanVertexRequest& /*req*/) {
void GraphStorageServiceSvIf::scanVertex( ::nebula::storage::cpp2::ScanResponse& /*_return*/, const ::nebula::storage::cpp2::ScanVertexRequest& /*req*/) {
apache::thrift::detail::si::throw_app_exn_unimplemented("scanVertex");
}

folly::SemiFuture< ::nebula::storage::cpp2::ScanVertexResponse> GraphStorageServiceSvIf::semifuture_scanVertex(const ::nebula::storage::cpp2::ScanVertexRequest& p_req) {
return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::storage::cpp2::ScanVertexResponse& _return) { scanVertex(_return, p_req); });
folly::SemiFuture< ::nebula::storage::cpp2::ScanResponse> GraphStorageServiceSvIf::semifuture_scanVertex(const ::nebula::storage::cpp2::ScanVertexRequest& p_req) {
return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::storage::cpp2::ScanResponse& _return) { scanVertex(_return, p_req); });
}

folly::Future< ::nebula::storage::cpp2::ScanVertexResponse> GraphStorageServiceSvIf::future_scanVertex(const ::nebula::storage::cpp2::ScanVertexRequest& p_req) {
folly::Future< ::nebula::storage::cpp2::ScanResponse> GraphStorageServiceSvIf::future_scanVertex(const ::nebula::storage::cpp2::ScanVertexRequest& p_req) {
using Source = apache::thrift::concurrency::ThreadManager::Source;
auto scope = getRequestContext()->getRequestExecutionScope();
auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL);
return apache::thrift::detail::si::future(semifuture_scanVertex(p_req), std::move(ka));
}

void GraphStorageServiceSvIf::async_tm_scanVertex(std::unique_ptr<apache::thrift::HandlerCallback< ::nebula::storage::cpp2::ScanVertexResponse>> callback, const ::nebula::storage::cpp2::ScanVertexRequest& p_req) {
void GraphStorageServiceSvIf::async_tm_scanVertex(std::unique_ptr<apache::thrift::HandlerCallback< ::nebula::storage::cpp2::ScanResponse>> callback, const ::nebula::storage::cpp2::ScanVertexRequest& p_req) {
apache::thrift::detail::si::async_tm(this, std::move(callback), [&] {
return future_scanVertex(p_req);
});
}

void GraphStorageServiceSvIf::scanEdge( ::nebula::storage::cpp2::ScanEdgeResponse& /*_return*/, const ::nebula::storage::cpp2::ScanEdgeRequest& /*req*/) {
void GraphStorageServiceSvIf::scanEdge( ::nebula::storage::cpp2::ScanResponse& /*_return*/, const ::nebula::storage::cpp2::ScanEdgeRequest& /*req*/) {
apache::thrift::detail::si::throw_app_exn_unimplemented("scanEdge");
}

folly::SemiFuture< ::nebula::storage::cpp2::ScanEdgeResponse> GraphStorageServiceSvIf::semifuture_scanEdge(const ::nebula::storage::cpp2::ScanEdgeRequest& p_req) {
return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::storage::cpp2::ScanEdgeResponse& _return) { scanEdge(_return, p_req); });
folly::SemiFuture< ::nebula::storage::cpp2::ScanResponse> GraphStorageServiceSvIf::semifuture_scanEdge(const ::nebula::storage::cpp2::ScanEdgeRequest& p_req) {
return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::storage::cpp2::ScanResponse& _return) { scanEdge(_return, p_req); });
}

folly::Future< ::nebula::storage::cpp2::ScanEdgeResponse> GraphStorageServiceSvIf::future_scanEdge(const ::nebula::storage::cpp2::ScanEdgeRequest& p_req) {
folly::Future< ::nebula::storage::cpp2::ScanResponse> GraphStorageServiceSvIf::future_scanEdge(const ::nebula::storage::cpp2::ScanEdgeRequest& p_req) {
using Source = apache::thrift::concurrency::ThreadManager::Source;
auto scope = getRequestContext()->getRequestExecutionScope();
auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL);
return apache::thrift::detail::si::future(semifuture_scanEdge(p_req), std::move(ka));
}

void GraphStorageServiceSvIf::async_tm_scanEdge(std::unique_ptr<apache::thrift::HandlerCallback< ::nebula::storage::cpp2::ScanEdgeResponse>> callback, const ::nebula::storage::cpp2::ScanEdgeRequest& p_req) {
void GraphStorageServiceSvIf::async_tm_scanEdge(std::unique_ptr<apache::thrift::HandlerCallback< ::nebula::storage::cpp2::ScanResponse>> callback, const ::nebula::storage::cpp2::ScanEdgeRequest& p_req) {
apache::thrift::detail::si::async_tm(this, std::move(callback), [&] {
return future_scanEdge(p_req);
});
Expand Down Expand Up @@ -351,6 +351,69 @@ void GraphStorageServiceSvIf::async_tm_chainAddEdges(std::unique_ptr<apache::thr
});
}

void GraphStorageServiceSvIf::get( ::nebula::storage::cpp2::KVGetResponse& /*_return*/, const ::nebula::storage::cpp2::KVGetRequest& /*req*/) {
apache::thrift::detail::si::throw_app_exn_unimplemented("get");
}

folly::SemiFuture< ::nebula::storage::cpp2::KVGetResponse> GraphStorageServiceSvIf::semifuture_get(const ::nebula::storage::cpp2::KVGetRequest& p_req) {
return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::storage::cpp2::KVGetResponse& _return) { get(_return, p_req); });
}

folly::Future< ::nebula::storage::cpp2::KVGetResponse> GraphStorageServiceSvIf::future_get(const ::nebula::storage::cpp2::KVGetRequest& p_req) {
using Source = apache::thrift::concurrency::ThreadManager::Source;
auto scope = getRequestContext()->getRequestExecutionScope();
auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL);
return apache::thrift::detail::si::future(semifuture_get(p_req), std::move(ka));
}

void GraphStorageServiceSvIf::async_tm_get(std::unique_ptr<apache::thrift::HandlerCallback< ::nebula::storage::cpp2::KVGetResponse>> callback, const ::nebula::storage::cpp2::KVGetRequest& p_req) {
apache::thrift::detail::si::async_tm(this, std::move(callback), [&] {
return future_get(p_req);
});
}

void GraphStorageServiceSvIf::put( ::nebula::storage::cpp2::ExecResponse& /*_return*/, const ::nebula::storage::cpp2::KVPutRequest& /*req*/) {
apache::thrift::detail::si::throw_app_exn_unimplemented("put");
}

folly::SemiFuture< ::nebula::storage::cpp2::ExecResponse> GraphStorageServiceSvIf::semifuture_put(const ::nebula::storage::cpp2::KVPutRequest& p_req) {
return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::storage::cpp2::ExecResponse& _return) { put(_return, p_req); });
}

folly::Future< ::nebula::storage::cpp2::ExecResponse> GraphStorageServiceSvIf::future_put(const ::nebula::storage::cpp2::KVPutRequest& p_req) {
using Source = apache::thrift::concurrency::ThreadManager::Source;
auto scope = getRequestContext()->getRequestExecutionScope();
auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL);
return apache::thrift::detail::si::future(semifuture_put(p_req), std::move(ka));
}

void GraphStorageServiceSvIf::async_tm_put(std::unique_ptr<apache::thrift::HandlerCallback< ::nebula::storage::cpp2::ExecResponse>> callback, const ::nebula::storage::cpp2::KVPutRequest& p_req) {
apache::thrift::detail::si::async_tm(this, std::move(callback), [&] {
return future_put(p_req);
});
}

void GraphStorageServiceSvIf::remove( ::nebula::storage::cpp2::ExecResponse& /*_return*/, const ::nebula::storage::cpp2::KVRemoveRequest& /*req*/) {
apache::thrift::detail::si::throw_app_exn_unimplemented("remove");
}

folly::SemiFuture< ::nebula::storage::cpp2::ExecResponse> GraphStorageServiceSvIf::semifuture_remove(const ::nebula::storage::cpp2::KVRemoveRequest& p_req) {
return apache::thrift::detail::si::semifuture_returning([&]( ::nebula::storage::cpp2::ExecResponse& _return) { remove(_return, p_req); });
}

folly::Future< ::nebula::storage::cpp2::ExecResponse> GraphStorageServiceSvIf::future_remove(const ::nebula::storage::cpp2::KVRemoveRequest& p_req) {
using Source = apache::thrift::concurrency::ThreadManager::Source;
auto scope = getRequestContext()->getRequestExecutionScope();
auto ka = getThreadManager()->getKeepAlive(std::move(scope), Source::INTERNAL);
return apache::thrift::detail::si::future(semifuture_remove(p_req), std::move(ka));
}

void GraphStorageServiceSvIf::async_tm_remove(std::unique_ptr<apache::thrift::HandlerCallback< ::nebula::storage::cpp2::ExecResponse>> callback, const ::nebula::storage::cpp2::KVRemoveRequest& p_req) {
apache::thrift::detail::si::async_tm(this, std::move(callback), [&] {
return future_remove(p_req);
});
}

void GraphStorageServiceSvNull::getNeighbors( ::nebula::storage::cpp2::GetNeighborsResponse& /*_return*/, const ::nebula::storage::cpp2::GetNeighborsRequest& /*req*/) {}

void GraphStorageServiceSvNull::getProps( ::nebula::storage::cpp2::GetPropResponse& /*_return*/, const ::nebula::storage::cpp2::GetPropRequest& /*req*/) {}
Expand All @@ -369,9 +432,9 @@ void GraphStorageServiceSvNull::updateVertex( ::nebula::storage::cpp2::UpdateRes

void GraphStorageServiceSvNull::updateEdge( ::nebula::storage::cpp2::UpdateResponse& /*_return*/, const ::nebula::storage::cpp2::UpdateEdgeRequest& /*req*/) {}

void GraphStorageServiceSvNull::scanVertex( ::nebula::storage::cpp2::ScanVertexResponse& /*_return*/, const ::nebula::storage::cpp2::ScanVertexRequest& /*req*/) {}
void GraphStorageServiceSvNull::scanVertex( ::nebula::storage::cpp2::ScanResponse& /*_return*/, const ::nebula::storage::cpp2::ScanVertexRequest& /*req*/) {}

void GraphStorageServiceSvNull::scanEdge( ::nebula::storage::cpp2::ScanEdgeResponse& /*_return*/, const ::nebula::storage::cpp2::ScanEdgeRequest& /*req*/) {}
void GraphStorageServiceSvNull::scanEdge( ::nebula::storage::cpp2::ScanResponse& /*_return*/, const ::nebula::storage::cpp2::ScanEdgeRequest& /*req*/) {}

void GraphStorageServiceSvNull::getUUID( ::nebula::storage::cpp2::GetUUIDResp& /*_return*/, const ::nebula::storage::cpp2::GetUUIDReq& /*req*/) {}

Expand All @@ -383,6 +446,12 @@ void GraphStorageServiceSvNull::chainUpdateEdge( ::nebula::storage::cpp2::Update

void GraphStorageServiceSvNull::chainAddEdges( ::nebula::storage::cpp2::ExecResponse& /*_return*/, const ::nebula::storage::cpp2::AddEdgesRequest& /*req*/) {}

void GraphStorageServiceSvNull::get( ::nebula::storage::cpp2::KVGetResponse& /*_return*/, const ::nebula::storage::cpp2::KVGetRequest& /*req*/) {}

void GraphStorageServiceSvNull::put( ::nebula::storage::cpp2::ExecResponse& /*_return*/, const ::nebula::storage::cpp2::KVPutRequest& /*req*/) {}

void GraphStorageServiceSvNull::remove( ::nebula::storage::cpp2::ExecResponse& /*_return*/, const ::nebula::storage::cpp2::KVRemoveRequest& /*req*/) {}



const char* GraphStorageServiceAsyncProcessor::getServiceName() {
Expand Down Expand Up @@ -422,6 +491,9 @@ const GraphStorageServiceAsyncProcessor::ProcessMap GraphStorageServiceAsyncProc
{"lookupAndTraverse", &GraphStorageServiceAsyncProcessor::setUpAndProcess_lookupAndTraverse<apache::thrift::BinaryProtocolReader, apache::thrift::BinaryProtocolWriter>},
{"chainUpdateEdge", &GraphStorageServiceAsyncProcessor::setUpAndProcess_chainUpdateEdge<apache::thrift::BinaryProtocolReader, apache::thrift::BinaryProtocolWriter>},
{"chainAddEdges", &GraphStorageServiceAsyncProcessor::setUpAndProcess_chainAddEdges<apache::thrift::BinaryProtocolReader, apache::thrift::BinaryProtocolWriter>},
{"get", &GraphStorageServiceAsyncProcessor::setUpAndProcess_get<apache::thrift::BinaryProtocolReader, apache::thrift::BinaryProtocolWriter>},
{"put", &GraphStorageServiceAsyncProcessor::setUpAndProcess_put<apache::thrift::BinaryProtocolReader, apache::thrift::BinaryProtocolWriter>},
{"remove", &GraphStorageServiceAsyncProcessor::setUpAndProcess_remove<apache::thrift::BinaryProtocolReader, apache::thrift::BinaryProtocolWriter>},
};

const GraphStorageServiceAsyncProcessor::ProcessMap& GraphStorageServiceAsyncProcessor::getCompactProtocolProcessMap() {
Expand All @@ -445,6 +517,9 @@ const GraphStorageServiceAsyncProcessor::ProcessMap GraphStorageServiceAsyncProc
{"lookupAndTraverse", &GraphStorageServiceAsyncProcessor::setUpAndProcess_lookupAndTraverse<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter>},
{"chainUpdateEdge", &GraphStorageServiceAsyncProcessor::setUpAndProcess_chainUpdateEdge<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter>},
{"chainAddEdges", &GraphStorageServiceAsyncProcessor::setUpAndProcess_chainAddEdges<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter>},
{"get", &GraphStorageServiceAsyncProcessor::setUpAndProcess_get<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter>},
{"put", &GraphStorageServiceAsyncProcessor::setUpAndProcess_put<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter>},
{"remove", &GraphStorageServiceAsyncProcessor::setUpAndProcess_remove<apache::thrift::CompactProtocolReader, apache::thrift::CompactProtocolWriter>},
};

}}} // nebula::storage::cpp2
Loading