11 #include <unordered_map>
14 #include "ScanEdgeIter.h"
15 #include "common/datatypes/HostAddr.h"
16 #include "common/thrift/ThriftTypes.h"
17 #include "nebula/mclient/MetaClient.h"
18 #include "nebula/sclient/SConfig.h"
19 #include "nebula/sclient/ScanEdgeIter.h"
22 class IOThreadPoolExecutor;
31 template <
class ClientType>
32 class ThriftClientManager;
39 class MetaServiceAsyncClient;
47 class GraphStorageServiceAsyncClient;
49 class ScanEdgeRequest;
55 #define DEFAULT_LIMIT std::numeric_limits<int64_t>::max()
56 #define DEFAULT_START_TIME 0
57 #define DEFAULT_END_TIME std::numeric_limits<int64_t>::max()
63 explicit StorageClient(
const std::vector<std::string>& metaAddrs,
69 std::vector<PartitionID> getParts(
const std::string& spaceName);
74 std::vector<std::string> propNames,
75 int64_t limit = DEFAULT_LIMIT,
76 int64_t startTime = DEFAULT_START_TIME,
77 int64_t endTime = DEFAULT_END_TIME,
78 std::string filter =
"",
79 bool onlyLatestVersion =
false,
80 bool enableReadFromFollower =
true);
83 return mClient_.get();
87 std::pair<bool, storage::cpp2::ScanResponse> doScanEdge(
88 const storage::cpp2::ScanEdgeRequest& req);
90 template <
typename Request,
typename RemoteFunc,
typename Response>
91 void getResponse(std::pair<HostAddr, Request>&& request,
92 RemoteFunc&& remoteFunc,
95 std::unique_ptr<MetaClient> mClient_;
97 std::shared_ptr<folly::IOThreadPoolExecutor> ioExecutor_;
98 std::shared_ptr<thrift::ThriftClientManager<storage::cpp2::GraphStorageServiceAsyncClient>>