forked from vesoft-inc/nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdateVertexExecutor.h
65 lines (47 loc) · 1.72 KB
/
UpdateVertexExecutor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* Copyright (c) 2019 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#ifndef GRAPH_UPDATEVERTEXEXECUTOR_H_
#define GRAPH_UPDATEVERTEXEXECUTOR_H_
#include "base/Base.h"
#include "graph/Executor.h"
#include "meta/SchemaManager.h"
#include "storage/client/StorageClient.h"
namespace nebula {
namespace storage {
namespace cpp2 {
class UpdateResponse;
} // namespace cpp2
} // namespace storage
namespace graph {
class UpdateVertexExecutor final : public Executor {
public:
UpdateVertexExecutor(Sentence *sentence, ExecutionContext *ectx);
const char* name() const override {
return "UpdateVertexExecutor";
}
Status MUST_USE_RESULT prepare() override;
void execute() override;
void setupResponse(cpp2::ExecutionResponse &resp) override;
private:
// To do some preparing works on the clauses
Status prepareSet();
Status prepareWhen();
Status prepareYield();
std::vector<std::string> getReturnColumns();
// All required data have arrived, finish the execution.
void finishExecution(storage::cpp2::UpdateResponse &&rpcResp);
private:
UpdateVertexSentence *sentence_{nullptr};
std::unique_ptr<cpp2::ExecutionResponse> resp_;
bool insertable_{false};
VertexID vertex_;
std::vector<storage::cpp2::UpdateItem> updateItems_;
Expression *filter_{nullptr};
std::vector<YieldColumn*> yields_;
};
} // namespace graph
} // namespace nebula
#endif // GRAPH_UPDATEVERTEXEXECUTOR_H_