Flex  0.17.9
schema.h
Go to the documentation of this file.
1 
16 #ifndef GRAPHSCOPE_FRAGMENT_SCHEMA_H_
17 #define GRAPHSCOPE_FRAGMENT_SCHEMA_H_
18 
19 #include "flex/engines/hqps_db/core/utils/hqps_utils.h"
21 #include "flex/utils/id_indexer.h"
24 #include "flex/utils/result.h"
25 #include "flex/utils/yaml_utils.h"
26 
27 namespace gs {
28 
29 class Schema {
30  public:
31  // How many built-in plugins are there.
32  // Currently only one builtin plugin, SERVER_APP is supported.
33  static constexpr uint8_t RESERVED_PLUGIN_NUM = 1;
34  static constexpr uint8_t MAX_PLUGIN_ID = 245;
35  static constexpr uint8_t ADHOC_READ_PLUGIN_ID = 253;
36  static constexpr uint8_t HQPS_ADHOC_READ_PLUGIN_ID = 254;
37  static constexpr uint8_t HQPS_ADHOC_WRITE_PLUGIN_ID = 255;
38 
39  static constexpr uint8_t CYPHER_READ_PLUGIN_ID = 248;
40  static constexpr uint8_t CYPHER_WRITE_PLUGIN_ID = 247;
41  static constexpr uint8_t CYPHER_READ_DEBUG_PLUGIN_ID = 246;
42  static constexpr const char* HQPS_ADHOC_READ_PLUGIN_ID_STR = "\xFE";
43  static constexpr const char* HQPS_ADHOC_WRITE_PLUGIN_ID_STR = "\xFF";
44  static constexpr const char* ADHOC_READ_PLUGIN_ID_STR = "\xFD";
45  static constexpr const char* CYPHER_READ_DEBUG_PLUGIN_ID_STR = "\xF6";
46  static constexpr const char* PRIMITIVE_TYPE_KEY = "primitive_type";
47  static constexpr const char* VARCHAR_KEY = "varchar";
48  static constexpr const char* MAX_LENGTH_KEY = "max_length";
49 
50  // The builtin plugins are reserved for the system.
51  static constexpr uint8_t BUILTIN_PLUGIN_NUM = 4;
52 
53  static constexpr uint8_t BUILTIN_COUNT_VERTICES_PLUGIN_ID = 252;
54  static constexpr const char* BUILTIN_COUNT_VERTICES_PLUGIN_NAME =
55  "count_vertices";
56  static constexpr uint8_t BUILTIN_PAGERANK_PLUGIN_ID = 251;
57  static constexpr const char* BUILTIN_PAGERANK_PLUGIN_NAME = "pagerank";
58  static constexpr uint8_t BUILTIN_K_DEGREE_NEIGHBORS_PLUGIN_ID = 250;
59  static constexpr const char* BUILTIN_K_DEGREE_NEIGHBORS_PLUGIN_NAME =
60  "k_neighbors";
61  static constexpr uint8_t BUILTIN_TVSP_PLUGIN_ID = 249;
62  static constexpr const char* BUILTIN_TVSP_PLUGIN_NAME =
63  "shortest_path_among_three";
64  static constexpr const char* BUILTIN_PLUGIN_NAMES[BUILTIN_PLUGIN_NUM] = {
67  static constexpr uint8_t BUILTIN_PLUGIN_IDS[BUILTIN_PLUGIN_NUM] = {
70 
71  // An array containing all compatible versions of schema.
72  static const std::vector<std::string> COMPATIBLE_VERSIONS;
73  static constexpr const char* DEFAULT_SCHEMA_VERSION = "v0.0";
74 
75  static bool IsBuiltinPlugin(const std::string& plugin_name);
76 
78  Schema();
79  ~Schema();
80 
81  static const std::vector<std::string>& GetCompatibleVersions();
82 
83  void Clear();
84 
85  void add_vertex_label(
86  const std::string& label, const std::vector<PropertyType>& property_types,
87  const std::vector<std::string>& property_names,
88  const std::vector<std::tuple<PropertyType, std::string, size_t>>&
89  primary_key,
90  const std::vector<StorageStrategy>& strategies = {},
91  size_t max_vnum = static_cast<size_t>(1) << 32,
92  const std::string& description = "");
93 
94  void add_edge_label(const std::string& src_label,
95  const std::string& dst_label,
96  const std::string& edge_label,
97  const std::vector<PropertyType>& properties,
98  const std::vector<std::string>& prop_names,
101  bool oe_mutable = true, bool ie_mutable = true,
102  bool sort_on_compaction = false,
103  const std::string& description = "");
104 
105  label_t vertex_label_num() const;
106 
107  label_t edge_label_num() const;
108 
109  bool contains_vertex_label(const std::string& label) const;
110 
111  label_t get_vertex_label_id(const std::string& label) const;
112 
114  label_t label_id, const std::vector<PropertyType>& types,
115  const std::vector<StorageStrategy>& strategies = {});
116 
117  const std::vector<PropertyType>& get_vertex_properties(
118  const std::string& label) const;
119 
120  const std::vector<std::string>& get_vertex_property_names(
121  const std::string& label) const;
122 
123  const std::string& get_vertex_description(const std::string& label) const;
124 
125  const std::vector<PropertyType>& get_vertex_properties(label_t label) const;
126 
127  const std::vector<std::string>& get_vertex_property_names(
128  label_t label) const;
129 
130  const std::string& get_vertex_description(label_t label) const;
131 
132  const std::vector<StorageStrategy>& get_vertex_storage_strategies(
133  const std::string& label) const;
134 
135  size_t get_max_vnum(const std::string& label) const;
136 
137  bool exist(const std::string& src_label, const std::string& dst_label,
138  const std::string& edge_label) const;
139 
140  bool exist(label_type src_label, label_type dst_label,
141  label_type edge_label) const;
142 
143  const std::vector<PropertyType>& get_edge_properties(
144  const std::string& src_label, const std::string& dst_label,
145  const std::string& label) const;
146 
147  const std::vector<PropertyType>& get_edge_properties(label_t src_label,
148  label_t dst_label,
149  label_t label) const;
150 
151  const std::string& get_compiler_path() const;
152 
153  void set_compiler_path(const std::string& compiler_path);
154 
155  std::string get_edge_description(const std::string& src_label,
156  const std::string& dst_label,
157  const std::string& label) const;
158 
159  std::string get_edge_description(label_t src_label, label_t dst_label,
160  label_t label) const;
161 
162  PropertyType get_edge_property(label_t src, label_t dst, label_t edge) const;
163 
164  const std::vector<std::string>& get_edge_property_names(
165  const std::string& src_label, const std::string& dst_label,
166  const std::string& label) const;
167 
168  const std::vector<std::string>& get_edge_property_names(
169  const label_t& src_label, const label_t& dst_label,
170  const label_t& label) const;
171 
172  bool vertex_has_property(const std::string& label,
173  const std::string& prop) const;
174 
175  bool vertex_has_primary_key(const std::string& label,
176  const std::string& prop) const;
177 
178  bool edge_has_property(const std::string& src_label,
179  const std::string& dst_label,
180  const std::string& edge_label,
181  const std::string& prop) const;
182 
183  bool has_vertex_label(const std::string& label) const;
184 
185  bool has_edge_label(const std::string& src_label,
186  const std::string& dst_label,
187  const std::string& edge_label) const;
188 
189  bool has_edge_label(label_t src_label, label_t dst_label,
190  label_t edge_label) const;
191 
192  bool valid_edge_property(const std::string& src_label,
193  const std::string& dst_label,
194  const std::string& label) const;
195 
196  EdgeStrategy get_outgoing_edge_strategy(const std::string& src_label,
197  const std::string& dst_label,
198  const std::string& label) const;
199 
200  EdgeStrategy get_incoming_edge_strategy(const std::string& src_label,
201  const std::string& dst_label,
202  const std::string& label) const;
203 
205  label_t dst_label,
206  label_t label) const {
207  uint32_t index = generate_edge_label(src_label, dst_label, label);
208  return oe_strategy_.at(index);
209  }
210 
212  label_t dst_label,
213  label_t label) const {
214  uint32_t index = generate_edge_label(src_label, dst_label, label);
215  return ie_strategy_.at(index);
216  }
217 
218  bool outgoing_edge_mutable(const std::string& src_label,
219  const std::string& dst_label,
220  const std::string& label) const;
221 
222  bool incoming_edge_mutable(const std::string& src_label,
223  const std::string& dst_label,
224  const std::string& label) const;
225 
226  bool get_sort_on_compaction(const std::string& src_label,
227  const std::string& dst_label,
228  const std::string& label) const;
229 
230  bool contains_edge_label(const std::string& label) const;
231 
232  label_t get_edge_label_id(const std::string& label) const;
233 
234  std::string get_vertex_label_name(label_t index) const;
235 
236  std::string get_edge_label_name(label_t index) const;
237 
238  const std::vector<std::tuple<PropertyType, std::string, size_t>>&
239  get_vertex_primary_key(label_t index) const;
240 
241  const std::string& get_vertex_primary_key_name(label_t index) const;
242 
243  void Serialize(std::unique_ptr<grape::LocalIOAdaptor>& writer) const;
244 
245  void Deserialize(std::unique_ptr<grape::LocalIOAdaptor>& reader);
246 
247  static Result<Schema> LoadFromYaml(const std::string& schema_config);
248 
249  static Result<Schema> LoadFromYamlNode(const YAML::Node& schema_node);
250 
251  bool Equals(const Schema& other) const;
252 
253  // Return the map from plugin name to plugin id
254  const std::unordered_map<std::string, std::pair<std::string, uint8_t>>&
255  GetPlugins() const;
256 
257  bool EmplacePlugins(
258  const std::vector<std::pair<std::string, std::string>>& plugins);
259 
260  void SetPluginDir(const std::string& plugin_dir);
261 
262  void RemovePlugin(const std::string& plugin_name);
263 
264  std::string GetPluginDir() const;
265 
266  std::string GetDescription() const;
267 
268  void SetDescription(const std::string& description);
269 
270  void SetVersion(const std::string& version);
271 
272  std::string GetVersion() const;
273 
274  bool has_multi_props_edge() const;
275 
276  const std::unordered_map<std::string, std::pair<PropertyType, uint8_t>>&
278 
279  private:
280  label_t vertex_label_to_index(const std::string& label);
281 
282  label_t edge_label_to_index(const std::string& label);
283 
284  uint32_t generate_edge_label(label_t src, label_t dst, label_t edge) const;
285 
288  std::vector<std::vector<PropertyType>> vproperties_;
289  std::vector<std::vector<std::string>> vprop_names_;
290  std::vector<std::string> v_descriptions_;
291  std::vector<std::vector<std::tuple<PropertyType, std::string, size_t>>>
292  v_primary_keys_; // the third element is the index of the property in the
293  // vertex property list
294  std::vector<std::vector<StorageStrategy>> vprop_storage_;
295  std::map<uint32_t, std::vector<PropertyType>> eproperties_;
296  std::map<uint32_t, std::vector<std::string>> eprop_names_;
297  std::map<uint32_t, std::string> e_descriptions_;
298  std::map<uint32_t, EdgeStrategy> oe_strategy_;
299  std::map<uint32_t, EdgeStrategy> ie_strategy_;
300  std::map<uint32_t, bool> oe_mutability_;
301  std::map<uint32_t, bool> ie_mutability_;
302  std::map<uint32_t, bool> sort_on_compactions_;
303  std::vector<std::unordered_map<std::string, std::pair<PropertyType, uint8_t>>>
305  std::vector<size_t> max_vnum_;
306  std::unordered_map<std::string, std::pair<std::string, uint8_t>>
307  plugin_name_to_path_and_id_; // key is plugin_name, value is plugin_path
308  // and plugin_id
309  std::string plugin_dir_;
310  std::string description_;
311  std::string version_;
312  std::string compiler_path_;
314 };
315 
316 } // namespace gs
317 
318 #endif // GRAPHSCOPE_FRAGMENT_SCHEMA_H_
gs::Schema::oe_mutability_
std::map< uint32_t, bool > oe_mutability_
Definition: schema.h:300
gs::Schema::add_vertex_label
void add_vertex_label(const std::string &label, const std::vector< PropertyType > &property_types, const std::vector< std::string > &property_names, const std::vector< std::tuple< PropertyType, std::string, size_t >> &primary_key, const std::vector< StorageStrategy > &strategies={}, size_t max_vnum=static_cast< size_t >(1)<< 32, const std::string &description="")
Definition: schema.cc:61
gs::Result
Definition: result.h:62
gs::Schema::BUILTIN_PLUGIN_NUM
static constexpr uint8_t BUILTIN_PLUGIN_NUM
Definition: schema.h:51
gs::Schema::get_sort_on_compaction
bool get_sort_on_compaction(const std::string &src_label, const std::string &dst_label, const std::string &label) const
Definition: schema.cc:347
gs::Schema::version_
std::string version_
Definition: schema.h:311
gs::Schema::has_edge_label
bool has_edge_label(const std::string &src_label, const std::string &dst_label, const std::string &edge_label) const
Definition: schema.cc:1445
gs::Schema::MAX_LENGTH_KEY
static constexpr const char * MAX_LENGTH_KEY
Definition: schema.h:48
gs::Schema::get_edge_label_id
label_t get_edge_label_id(const std::string &label) const
Definition: schema.cc:362
gs::Schema::ie_mutability_
std::map< uint32_t, bool > ie_mutability_
Definition: schema.h:301
gs::Schema::outgoing_edge_mutable
bool outgoing_edge_mutable(const std::string &src_label, const std::string &dst_label, const std::string &label) const
Definition: schema.cc:327
gs::Schema::e_descriptions_
std::map< uint32_t, std::string > e_descriptions_
Definition: schema.h:297
gs::Schema::HQPS_ADHOC_READ_PLUGIN_ID_STR
static constexpr const char * HQPS_ADHOC_READ_PLUGIN_ID_STR
Definition: schema.h:42
gs::EdgeStrategy::kMultiple
@ kMultiple
types.h
gs::Schema::LoadFromYaml
static Result< Schema > LoadFromYaml(const std::string &schema_config)
Definition: schema.cc:1468
gs::Schema::ADHOC_READ_PLUGIN_ID
static constexpr uint8_t ADHOC_READ_PLUGIN_ID
Definition: schema.h:35
gs::Schema::get_outgoing_edge_strategy
EdgeStrategy get_outgoing_edge_strategy(const std::string &src_label, const std::string &dst_label, const std::string &label) const
Definition: schema.cc:307
gs::Schema::vertex_label_to_index
label_t vertex_label_to_index(const std::string &label)
Definition: schema.cc:447
gs::Schema::VARCHAR_KEY
static constexpr const char * VARCHAR_KEY
Definition: schema.h:47
gs::Schema::BUILTIN_COUNT_VERTICES_PLUGIN_ID
static constexpr uint8_t BUILTIN_COUNT_VERTICES_PLUGIN_ID
Definition: schema.h:53
gs::Schema::BUILTIN_TVSP_PLUGIN_ID
static constexpr uint8_t BUILTIN_TVSP_PLUGIN_ID
Definition: schema.h:61
gs::Schema::get_edge_property
PropertyType get_edge_property(label_t src, label_t dst, label_t edge) const
Definition: schema.cc:267
gs::Schema::get_incoming_edge_strategy
EdgeStrategy get_incoming_edge_strategy(const std::string &src_label, const std::string &dst_label, const std::string &label) const
Definition: schema.cc:317
gs::Schema::Deserialize
void Deserialize(std::unique_ptr< grape::LocalIOAdaptor > &reader)
Definition: schema.cc:421
gs::Schema::PRIMITIVE_TYPE_KEY
static constexpr const char * PRIMITIVE_TYPE_KEY
Definition: schema.h:46
gs::Schema::description_
std::string description_
Definition: schema.h:310
gs::Schema::vlabel_indexer_
IdIndexer< std::string, label_t > vlabel_indexer_
Definition: schema.h:286
gs
Definition: adj_list.h:23
gs::Schema::EmplacePlugins
bool EmplacePlugins(const std::vector< std::pair< std::string, std::string >> &plugins)
Definition: schema.cc:1264
gs::Schema::get_edge_description
std::string get_edge_description(const std::string &src_label, const std::string &dst_label, const std::string &label) const
Definition: schema.cc:240
gs::Schema::LoadFromYamlNode
static Result< Schema > LoadFromYamlNode(const YAML::Node &schema_node)
Definition: schema.cc:1483
gs::Schema::get_outgoing_edge_strategy
EdgeStrategy get_outgoing_edge_strategy(label_t src_label, label_t dst_label, label_t label) const
Definition: schema.h:204
gs::Schema::COMPATIBLE_VERSIONS
static const std::vector< std::string > COMPATIBLE_VERSIONS
Definition: schema.h:72
gs::Schema::Serialize
void Serialize(std::unique_ptr< grape::LocalIOAdaptor > &writer) const
Definition: schema.cc:409
gs::Schema::get_vertex_storage_strategies
const std::vector< StorageStrategy > & get_vertex_storage_strategies(const std::string &label) const
Definition: schema.cc:180
gs::Schema::compiler_path_
std::string compiler_path_
Definition: schema.h:312
gs::Schema::set_compiler_path
void set_compiler_path(const std::string &compiler_path)
Definition: schema.cc:35
gs::Schema::oe_strategy_
std::map< uint32_t, EdgeStrategy > oe_strategy_
Definition: schema.h:298
gs::Schema::get_compiler_path
const std::string & get_compiler_path() const
Definition: schema.cc:39
gs::Schema::vertex_has_primary_key
bool vertex_has_primary_key(const std::string &label, const std::string &prop) const
Definition: schema.cc:1407
gs::Schema::RESERVED_PLUGIN_NUM
static constexpr uint8_t RESERVED_PLUGIN_NUM
Definition: schema.h:33
gs::Schema::get_vertex_primary_key_name
const std::string & get_vertex_primary_key_name(label_t index) const
Definition: schema.cc:398
gs::Schema::get_edge_property_names
const std::vector< std::string > & get_edge_property_names(const std::string &src_label, const std::string &dst_label, const std::string &label) const
Definition: schema.cc:273
gs::Schema::get_edge_properties
const std::vector< PropertyType > & get_edge_properties(const std::string &src_label, const std::string &dst_label, const std::string &label) const
Definition: schema.cc:216
gs::Schema::Schema
Schema()
Definition: schema.cc:32
gs::Schema::GetDescription
std::string GetDescription() const
Definition: schema.cc:1384
gs::Schema::max_vnum_
std::vector< size_t > max_vnum_
Definition: schema.h:305
gs::Schema::RemovePlugin
void RemovePlugin(const std::string &plugin_name)
Definition: schema.cc:1378
gs::Schema::BUILTIN_TVSP_PLUGIN_NAME
static constexpr const char * BUILTIN_TVSP_PLUGIN_NAME
Definition: schema.h:62
gs::Schema::BUILTIN_COUNT_VERTICES_PLUGIN_NAME
static constexpr const char * BUILTIN_COUNT_VERTICES_PLUGIN_NAME
Definition: schema.h:54
gs::Schema
Definition: schema.h:29
gs::Schema::valid_edge_property
bool valid_edge_property(const std::string &src_label, const std::string &dst_label, const std::string &label) const
Definition: schema.cc:297
gs::Schema::SetPluginDir
void SetPluginDir(const std::string &plugin_dir)
Definition: schema.cc:1376
gs::Schema::plugin_name_to_path_and_id_
std::unordered_map< std::string, std::pair< std::string, uint8_t > > plugin_name_to_path_and_id_
Definition: schema.h:307
yaml_utils.h
gs::Schema::vertex_label_num
label_t vertex_label_num() const
Definition: schema.cc:110
gs::Schema::BUILTIN_PLUGIN_IDS
static constexpr uint8_t BUILTIN_PLUGIN_IDS[BUILTIN_PLUGIN_NUM]
Definition: schema.h:67
gs::Schema::GetPluginDir
std::string GetPluginDir() const
Definition: schema.cc:1382
gs::Schema::CYPHER_READ_PLUGIN_ID
static constexpr uint8_t CYPHER_READ_PLUGIN_ID
Definition: schema.h:39
gs::Schema::edge_label_num
label_t edge_label_num() const
Definition: schema.cc:114
gs::Schema::BUILTIN_PAGERANK_PLUGIN_ID
static constexpr uint8_t BUILTIN_PAGERANK_PLUGIN_ID
Definition: schema.h:56
gs::IdIndexer< std::string, label_t >
gs::Schema::SetVersion
void SetVersion(const std::string &version)
Definition: schema.cc:1390
result.h
gs::Schema::eprop_names_
std::map< uint32_t, std::vector< std::string > > eprop_names_
Definition: schema.h:296
gs::Schema::set_vertex_properties
void set_vertex_properties(label_t label_id, const std::vector< PropertyType > &types, const std::vector< StorageStrategy > &strategies={})
Definition: schema.cc:130
gs::Schema::get_vertex_label_name
std::string get_vertex_label_name(label_t index) const
Definition: schema.cc:374
gs::Schema::SetDescription
void SetDescription(const std::string &description)
Definition: schema.cc:1386
gs::Schema::GetVersion
std::string GetVersion() const
Definition: schema.cc:1391
gs::Schema::ie_strategy_
std::map< uint32_t, EdgeStrategy > ie_strategy_
Definition: schema.h:299
gs::Schema::has_vertex_label
bool has_vertex_label(const std::string &label) const
Definition: schema.cc:1440
gs::Schema::has_multi_props_edge_
bool has_multi_props_edge_
Definition: schema.h:313
gs::Schema::BUILTIN_K_DEGREE_NEIGHBORS_PLUGIN_ID
static constexpr uint8_t BUILTIN_K_DEGREE_NEIGHBORS_PLUGIN_ID
Definition: schema.h:58
gs::Schema::eproperties_
std::map< uint32_t, std::vector< PropertyType > > eproperties_
Definition: schema.h:295
gs::Schema::BUILTIN_PAGERANK_PLUGIN_NAME
static constexpr const char * BUILTIN_PAGERANK_PLUGIN_NAME
Definition: schema.h:57
gs::Schema::Clear
void Clear()
Definition: schema.cc:41
gs::Schema::get_vertex_description
const std::string & get_vertex_description(const std::string &label) const
Definition: schema.cc:165
gs::Schema::MAX_PLUGIN_ID
static constexpr uint8_t MAX_PLUGIN_ID
Definition: schema.h:34
gs::Schema::label_type
label_t label_type
Definition: schema.h:77
gs::Schema::Equals
bool Equals(const Schema &other) const
Definition: schema.cc:479
id_indexer.h
gs::Schema::HQPS_ADHOC_WRITE_PLUGIN_ID
static constexpr uint8_t HQPS_ADHOC_WRITE_PLUGIN_ID
Definition: schema.h:37
types.h
gs::Schema::plugin_dir_
std::string plugin_dir_
Definition: schema.h:309
gs::Schema::CYPHER_READ_DEBUG_PLUGIN_ID_STR
static constexpr const char * CYPHER_READ_DEBUG_PLUGIN_ID_STR
Definition: schema.h:45
gs::Schema::CYPHER_WRITE_PLUGIN_ID
static constexpr uint8_t CYPHER_WRITE_PLUGIN_ID
Definition: schema.h:40
gs::Schema::get_vertex_property_names
const std::vector< std::string > & get_vertex_property_names(const std::string &label) const
Definition: schema.cc:149
gs::Schema::sort_on_compactions_
std::map< uint32_t, bool > sort_on_compactions_
Definition: schema.h:302
gs::Schema::GetPlugins
const std::unordered_map< std::string, std::pair< std::string, uint8_t > > & GetPlugins() const
Definition: schema.cc:1258
gs::EdgeStrategy
EdgeStrategy
Definition: types.h:24
gs::Schema::get_vertex_properties
const std::vector< PropertyType > & get_vertex_properties(const std::string &label) const
Definition: schema.cc:138
gs::Schema::BUILTIN_PLUGIN_NAMES
static constexpr const char * BUILTIN_PLUGIN_NAMES[BUILTIN_PLUGIN_NUM]
Definition: schema.h:64
gs::Schema::vprop_name_to_type_and_index_
std::vector< std::unordered_map< std::string, std::pair< PropertyType, uint8_t > > > vprop_name_to_type_and_index_
Definition: schema.h:304
gs::Schema::BUILTIN_K_DEGREE_NEIGHBORS_PLUGIN_NAME
static constexpr const char * BUILTIN_K_DEGREE_NEIGHBORS_PLUGIN_NAME
Definition: schema.h:59
gs::Schema::CYPHER_READ_DEBUG_PLUGIN_ID
static constexpr uint8_t CYPHER_READ_DEBUG_PLUGIN_ID
Definition: schema.h:41
gs::Schema::ADHOC_READ_PLUGIN_ID_STR
static constexpr const char * ADHOC_READ_PLUGIN_ID_STR
Definition: schema.h:44
gs::Schema::vertex_has_property
bool vertex_has_property(const std::string &label, const std::string &prop) const
Definition: schema.cc:1396
gs::Schema::get_edge_label_name
std::string get_edge_label_name(label_t index) const
Definition: schema.cc:382
gs::Schema::contains_vertex_label
bool contains_vertex_label(const std::string &label) const
Definition: schema.cc:118
gs::Schema::add_edge_label
void add_edge_label(const std::string &src_label, const std::string &dst_label, const std::string &edge_label, const std::vector< PropertyType > &properties, const std::vector< std::string > &prop_names, EdgeStrategy oe=EdgeStrategy::kMultiple, EdgeStrategy ie=EdgeStrategy::kMultiple, bool oe_mutable=true, bool ie_mutable=true, bool sort_on_compaction=false, const std::string &description="")
Definition: schema.cc:83
gs::Schema::generate_edge_label
uint32_t generate_edge_label(label_t src, label_t dst, label_t edge) const
Definition: schema.cc:468
gs::Schema::get_max_vnum
size_t get_max_vnum(const std::string &label) const
Definition: schema.cc:191
gs::Schema::vproperties_
std::vector< std::vector< PropertyType > > vproperties_
Definition: schema.h:288
gs::Schema::exist
bool exist(const std::string &src_label, const std::string &dst_label, const std::string &edge_label) const
Definition: schema.cc:201
gs::Schema::contains_edge_label
bool contains_edge_label(const std::string &label) const
Definition: schema.cc:369
gs::Schema::DEFAULT_SCHEMA_VERSION
static constexpr const char * DEFAULT_SCHEMA_VERSION
Definition: schema.h:73
gs::Schema::GetCompatibleVersions
static const std::vector< std::string > & GetCompatibleVersions()
Definition: schema.cc:1494
gs::label_t
uint8_t label_t
Definition: types.h:32
gs::Schema::IsBuiltinPlugin
static bool IsBuiltinPlugin(const std::string &plugin_name)
Definition: schema.cc:23
gs::Schema::incoming_edge_mutable
bool incoming_edge_mutable(const std::string &src_label, const std::string &dst_label, const std::string &label) const
Definition: schema.cc:337
gs::Schema::vprop_names_
std::vector< std::vector< std::string > > vprop_names_
Definition: schema.h:289
gs::Schema::get_incoming_edge_strategy
EdgeStrategy get_incoming_edge_strategy(label_t src_label, label_t dst_label, label_t label) const
Definition: schema.h:211
gs::Schema::HQPS_ADHOC_WRITE_PLUGIN_ID_STR
static constexpr const char * HQPS_ADHOC_WRITE_PLUGIN_ID_STR
Definition: schema.h:43
gs::Schema::elabel_indexer_
IdIndexer< std::string, label_t > elabel_indexer_
Definition: schema.h:287
table.h
gs::Schema::~Schema
~Schema()
gs::Schema::edge_label_to_index
label_t edge_label_to_index(const std::string &label)
Definition: schema.cc:462
gs::Schema::vprop_storage_
std::vector< std::vector< StorageStrategy > > vprop_storage_
Definition: schema.h:294
gs::Schema::get_vertex_label_id
label_t get_vertex_label_id(const std::string &label) const
Definition: schema.cc:123
gs::Schema::has_multi_props_edge
bool has_multi_props_edge() const
Definition: schema.cc:1393
gs::Schema::v_descriptions_
std::vector< std::string > v_descriptions_
Definition: schema.h:290
gs::Schema::get_vertex_primary_key
const std::vector< std::tuple< PropertyType, std::string, size_t > > & get_vertex_primary_key(label_t index) const
Definition: schema.cc:391
gs::Schema::get_vprop_name_to_type_and_index
const std::unordered_map< std::string, std::pair< PropertyType, uint8_t > > & get_vprop_name_to_type_and_index(label_t label) const
Definition: schema.cc:197
gs::Schema::v_primary_keys_
std::vector< std::vector< std::tuple< PropertyType, std::string, size_t > > > v_primary_keys_
Definition: schema.h:292
gs::Schema::HQPS_ADHOC_READ_PLUGIN_ID
static constexpr uint8_t HQPS_ADHOC_READ_PLUGIN_ID
Definition: schema.h:36
gs::Schema::edge_has_property
bool edge_has_property(const std::string &src_label, const std::string &dst_label, const std::string &edge_label, const std::string &prop) const
Definition: schema.cc:1421