Skip to content

Commit

Permalink
Unify symbol to exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shylock-Hg committed Jan 3, 2020
1 parent 804b502 commit 8487785
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/graph/DropEdgeExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void DropEdgeExecutor::execute() {
auto *mc = ectx()->getMetaClient();
auto *name = sentence_->name();
auto spaceId = ectx()->rctx()->session()->space();
auto future = mc->dropEdgeSchema(spaceId, *name, sentence_->isIfExist());
auto future = mc->dropEdgeSchema(spaceId, *name, sentence_->isIfExists());

auto *runner = ectx()->rctx()->runner();
auto cb = [this] (auto &&resp) {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/DropSpaceExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Status DropSpaceExecutor::prepare() {


void DropSpaceExecutor::execute() {
auto future = ectx()->getMetaClient()->dropSpace(*spaceName_, sentence_->isIfExist());
auto future = ectx()->getMetaClient()->dropSpace(*spaceName_, sentence_->isIfExists());
auto *runner = ectx()->rctx()->runner();

auto cb = [this] (auto &&resp) {
Expand Down
2 changes: 1 addition & 1 deletion src/graph/DropTagExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void DropTagExecutor::execute() {
auto *mc = ectx()->getMetaClient();
auto *name = sentence_->name();
auto spaceId = ectx()->rctx()->session()->space();
auto future = mc->dropTagSchema(spaceId, *name, sentence_->isIfExist());
auto future = mc->dropTagSchema(spaceId, *name, sentence_->isIfExists());

auto *runner = ectx()->rctx()->runner();
auto cb = [this] (auto &&resp) {
Expand Down
12 changes: 6 additions & 6 deletions src/meta/client/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,10 @@ MetaClient::getSpace(std::string name) {
return future;
}

folly::Future<StatusOr<bool>> MetaClient::dropSpace(std::string name, const bool ifExist) {
folly::Future<StatusOr<bool>> MetaClient::dropSpace(std::string name, const bool ifExists) {
cpp2::DropSpaceReq req;
req.set_space_name(std::move(name));
req.set_if_exists(ifExist);
req.set_if_exists(ifExists);
folly::Promise<StatusOr<bool>> promise;
auto future = promise.getFuture();
getResponse(std::move(req), [] (auto client, auto request) {
Expand Down Expand Up @@ -1002,11 +1002,11 @@ MetaClient::listTagSchemas(GraphSpaceID spaceId) {


folly::Future<StatusOr<bool>>
MetaClient::dropTagSchema(int32_t spaceId, std::string tagName, const bool ifExist) {
MetaClient::dropTagSchema(int32_t spaceId, std::string tagName, const bool ifExists) {
cpp2::DropTagReq req;
req.set_space_id(spaceId);
req.set_tag_name(std::move(tagName));
req.set_if_exists(ifExist);
req.set_if_exists(ifExists);
folly::Promise<StatusOr<bool>> promise;
auto future = promise.getFuture();
getResponse(std::move(req), [] (auto client, auto request) {
Expand Down Expand Up @@ -1109,11 +1109,11 @@ MetaClient::getEdgeSchema(GraphSpaceID spaceId, std::string name, SchemaVer vers


folly::Future<StatusOr<bool>>
MetaClient::dropEdgeSchema(GraphSpaceID spaceId, std::string name, const bool ifExist) {
MetaClient::dropEdgeSchema(GraphSpaceID spaceId, std::string name, const bool ifExists) {
cpp2::DropEdgeReq req;
req.set_space_id(std::move(spaceId));
req.set_edge_name(std::move(name));
req.set_if_exists(ifExist);
req.set_if_exists(ifExists);
folly::Promise<StatusOr<bool>> promise;
auto future = promise.getFuture();
getResponse(std::move(req), [] (auto client, auto request) {
Expand Down
6 changes: 3 additions & 3 deletions src/meta/client/MetaClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class MetaClient {
getSpace(std::string name);

folly::Future<StatusOr<bool>>
dropSpace(std::string name, bool ifExist = false);
dropSpace(std::string name, bool ifExists = false);

folly::Future<StatusOr<std::vector<cpp2::HostItem>>>
listHosts();
Expand All @@ -183,7 +183,7 @@ class MetaClient {
listTagSchemas(GraphSpaceID spaceId);

folly::Future<StatusOr<bool>>
dropTagSchema(int32_t spaceId, std::string name, bool ifExist = false);
dropTagSchema(int32_t spaceId, std::string name, bool ifExists = false);

// Return the latest schema when ver = -1
folly::Future<StatusOr<nebula::cpp2::Schema>>
Expand All @@ -208,7 +208,7 @@ class MetaClient {
getEdgeSchema(GraphSpaceID spaceId, std::string name, SchemaVer version = -1);

folly::Future<StatusOr<bool>>
dropEdgeSchema(GraphSpaceID spaceId, std::string name, bool ifExist = false);
dropEdgeSchema(GraphSpaceID spaceId, std::string name, bool ifExists = false);

// Operations for index
folly::Future<StatusOr<TagIndexID>>
Expand Down
8 changes: 4 additions & 4 deletions src/parser/Sentence.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ class CreateSentence : public Sentence {

class DropSentence : public Sentence {
public:
explicit DropSentence(bool ifExist) : ifExist_{ifExist} {}
explicit DropSentence(bool ifExists) : ifExists_{ifExists} {}
virtual ~DropSentence() = default;

bool isIfExist() {
return ifExist_;
bool isIfExists() {
return ifExists_;
}
private:
bool ifExist_{false};
bool ifExists_{false};
};

inline std::ostream& operator<<(std::ostream &os, Sentence::Kind kind) {
Expand Down

0 comments on commit 8487785

Please sign in to comment.