Flex
0.17.9
|
#include <schema.h>
Public Types | |
using | label_type = label_t |
Public Member Functions | |
Schema () | |
~Schema () | |
void | Clear () |
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="") |
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="") |
label_t | vertex_label_num () const |
label_t | edge_label_num () const |
bool | contains_vertex_label (const std::string &label) const |
label_t | get_vertex_label_id (const std::string &label) const |
void | set_vertex_properties (label_t label_id, const std::vector< PropertyType > &types, const std::vector< StorageStrategy > &strategies={}) |
const std::vector< PropertyType > & | get_vertex_properties (const std::string &label) const |
const std::vector< std::string > & | get_vertex_property_names (const std::string &label) const |
const std::string & | get_vertex_description (const std::string &label) const |
const std::vector< PropertyType > & | get_vertex_properties (label_t label) const |
const std::vector< std::string > & | get_vertex_property_names (label_t label) const |
const std::string & | get_vertex_description (label_t label) const |
const std::vector< StorageStrategy > & | get_vertex_storage_strategies (const std::string &label) const |
size_t | get_max_vnum (const std::string &label) const |
bool | exist (const std::string &src_label, const std::string &dst_label, const std::string &edge_label) const |
bool | exist (label_type src_label, label_type dst_label, label_type edge_label) const |
const std::vector< PropertyType > & | get_edge_properties (const std::string &src_label, const std::string &dst_label, const std::string &label) const |
const std::vector< PropertyType > & | get_edge_properties (label_t src_label, label_t dst_label, label_t label) const |
std::string | get_edge_description (const std::string &src_label, const std::string &dst_label, const std::string &label) const |
std::string | get_edge_description (label_t src_label, label_t dst_label, label_t label) const |
PropertyType | get_edge_property (label_t src, label_t dst, label_t edge) const |
const std::vector< std::string > & | get_edge_property_names (const std::string &src_label, const std::string &dst_label, const std::string &label) const |
const std::vector< std::string > & | get_edge_property_names (const label_t &src_label, const label_t &dst_label, const label_t &label) const |
bool | vertex_has_property (const std::string &label, const std::string &prop) const |
bool | vertex_has_primary_key (const std::string &label, const std::string &prop) const |
bool | edge_has_property (const std::string &src_label, const std::string &dst_label, const std::string &edge_label, const std::string &prop) const |
bool | has_vertex_label (const std::string &label) const |
bool | has_edge_label (const std::string &src_label, const std::string &dst_label, const std::string &edge_label) const |
bool | has_edge_label (label_t src_label, label_t dst_label, label_t edge_label) const |
bool | valid_edge_property (const std::string &src_label, const std::string &dst_label, const std::string &label) const |
EdgeStrategy | get_outgoing_edge_strategy (const std::string &src_label, const std::string &dst_label, const std::string &label) const |
EdgeStrategy | get_incoming_edge_strategy (const std::string &src_label, const std::string &dst_label, const std::string &label) const |
bool | outgoing_edge_mutable (const std::string &src_label, const std::string &dst_label, const std::string &label) const |
bool | incoming_edge_mutable (const std::string &src_label, const std::string &dst_label, const std::string &label) const |
bool | get_sort_on_compaction (const std::string &src_label, const std::string &dst_label, const std::string &label) const |
bool | contains_edge_label (const std::string &label) const |
label_t | get_edge_label_id (const std::string &label) const |
std::string | get_vertex_label_name (label_t index) const |
std::string | get_edge_label_name (label_t index) const |
const std::vector< std::tuple< PropertyType, std::string, size_t > > & | get_vertex_primary_key (label_t index) const |
const std::string & | get_vertex_primary_key_name (label_t index) const |
void | Serialize (std::unique_ptr< grape::LocalIOAdaptor > &writer) const |
void | Deserialize (std::unique_ptr< grape::LocalIOAdaptor > &reader) |
bool | Equals (const Schema &other) const |
const std::unordered_map< std::string, std::pair< std::string, uint8_t > > & | GetPlugins () const |
bool | EmplacePlugins (const std::vector< std::pair< std::string, std::string >> &plugins) |
void | SetPluginDir (const std::string &plugin_dir) |
void | RemovePlugin (const std::string &plugin_name) |
std::string | GetPluginDir () const |
std::string | GetDescription () const |
void | SetDescription (const std::string &description) |
void | SetVersion (const std::string &version) |
std::string | GetVersion () const |
bool | has_multi_props_edge () const |
Static Public Member Functions | |
static bool | IsBuiltinPlugin (const std::string &plugin_name) |
static const std::vector< std::string > & | GetCompatibleVersions () |
static Result< Schema > | LoadFromYaml (const std::string &schema_config) |
static Result< Schema > | LoadFromYamlNode (const YAML::Node &schema_node) |
Static Public Attributes | |
static constexpr uint8_t | RESERVED_PLUGIN_NUM = 1 |
static constexpr uint8_t | MAX_PLUGIN_ID = 251 |
static constexpr uint8_t | ADHOC_READ_PLUGIN_ID = 253 |
static constexpr uint8_t | HQPS_ADHOC_READ_PLUGIN_ID = 254 |
static constexpr uint8_t | HQPS_ADHOC_WRITE_PLUGIN_ID = 255 |
static constexpr const char * | HQPS_ADHOC_READ_PLUGIN_ID_STR = "\xFE" |
static constexpr const char * | HQPS_ADHOC_WRITE_PLUGIN_ID_STR = "\xFF" |
static constexpr const char * | ADHOC_READ_PLUGIN_ID_STR = "\xFD" |
static constexpr const char * | PRIMITIVE_TYPE_KEY = "primitive_type" |
static constexpr const char * | VARCHAR_KEY = "varchar" |
static constexpr const char * | MAX_LENGTH_KEY = "max_length" |
static constexpr const uint16_t | STRING_DEFAULT_MAX_LENGTH = 256 |
static constexpr uint8_t | BUILTIN_PLUGIN_NUM = 1 |
static constexpr uint8_t | BUILTIN_COUNT_VERTICES_PLUGIN_ID = 252 |
static constexpr const char * | BUILTIN_COUNT_VERTICES_PLUGIN_NAME |
static constexpr const char * | BUILTIN_PLUGIN_NAMES [BUILTIN_PLUGIN_NUM] |
static constexpr uint8_t | BUILTIN_PLUGIN_IDS [BUILTIN_PLUGIN_NUM] |
static const std::vector< std::string > | COMPATIBLE_VERSIONS |
static constexpr const char * | DEFAULT_SCHEMA_VERSION = "v0.0" |
Private Member Functions | |
label_t | vertex_label_to_index (const std::string &label) |
label_t | edge_label_to_index (const std::string &label) |
uint32_t | generate_edge_label (label_t src, label_t dst, label_t edge) const |
Private Attributes | |
IdIndexer< std::string, label_t > | vlabel_indexer_ |
IdIndexer< std::string, label_t > | elabel_indexer_ |
std::vector< std::vector< PropertyType > > | vproperties_ |
std::vector< std::vector< std::string > > | vprop_names_ |
std::vector< std::string > | v_descriptions_ |
std::vector< std::vector< std::tuple< PropertyType, std::string, size_t > > > | v_primary_keys_ |
std::vector< std::vector< StorageStrategy > > | vprop_storage_ |
std::map< uint32_t, std::vector< PropertyType > > | eproperties_ |
std::map< uint32_t, std::vector< std::string > > | eprop_names_ |
std::map< uint32_t, std::string > | e_descriptions_ |
std::map< uint32_t, EdgeStrategy > | oe_strategy_ |
std::map< uint32_t, EdgeStrategy > | ie_strategy_ |
std::map< uint32_t, bool > | oe_mutability_ |
std::map< uint32_t, bool > | ie_mutability_ |
std::map< uint32_t, bool > | sort_on_compactions_ |
std::vector< size_t > | max_vnum_ |
std::unordered_map< std::string, std::pair< std::string, uint8_t > > | plugin_name_to_path_and_id_ |
std::string | plugin_dir_ |
std::string | description_ |
std::string | version_ |
bool | has_multi_props_edge_ |
using gs::Schema::label_type = label_t |
gs::Schema::Schema | ( | ) |
|
default |
void gs::Schema::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 = "" |
||
) |
void gs::Schema::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 = "" |
||
) |
void gs::Schema::Clear | ( | ) |
bool gs::Schema::contains_edge_label | ( | const std::string & | label | ) | const |
bool gs::Schema::contains_vertex_label | ( | const std::string & | label | ) | const |
void gs::Schema::Deserialize | ( | std::unique_ptr< grape::LocalIOAdaptor > & | reader | ) |
bool gs::Schema::edge_has_property | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | edge_label, | ||
const std::string & | prop | ||
) | const |
label_t gs::Schema::edge_label_num | ( | ) | const |
|
private |
bool gs::Schema::EmplacePlugins | ( | const std::vector< std::pair< std::string, std::string >> & | plugins | ) |
bool gs::Schema::Equals | ( | const Schema & | other | ) | const |
bool gs::Schema::exist | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | edge_label | ||
) | const |
bool gs::Schema::exist | ( | label_type | src_label, |
label_type | dst_label, | ||
label_type | edge_label | ||
) | const |
std::string gs::Schema::get_edge_description | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | label | ||
) | const |
std::string gs::Schema::get_edge_description | ( | label_t | src_label, |
label_t | dst_label, | ||
label_t | label | ||
) | const |
label_t gs::Schema::get_edge_label_id | ( | const std::string & | label | ) | const |
std::string gs::Schema::get_edge_label_name | ( | label_t | index | ) | const |
const std::vector< PropertyType > & gs::Schema::get_edge_properties | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | label | ||
) | const |
const std::vector< PropertyType > & gs::Schema::get_edge_properties | ( | label_t | src_label, |
label_t | dst_label, | ||
label_t | label | ||
) | const |
PropertyType gs::Schema::get_edge_property | ( | label_t | src, |
label_t | dst, | ||
label_t | edge | ||
) | const |
const std::vector< std::string > & gs::Schema::get_edge_property_names | ( | const label_t & | src_label, |
const label_t & | dst_label, | ||
const label_t & | label | ||
) | const |
const std::vector< std::string > & gs::Schema::get_edge_property_names | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | label | ||
) | const |
EdgeStrategy gs::Schema::get_incoming_edge_strategy | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | label | ||
) | const |
size_t gs::Schema::get_max_vnum | ( | const std::string & | label | ) | const |
EdgeStrategy gs::Schema::get_outgoing_edge_strategy | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | label | ||
) | const |
bool gs::Schema::get_sort_on_compaction | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | label | ||
) | const |
const std::string & gs::Schema::get_vertex_description | ( | const std::string & | label | ) | const |
const std::string & gs::Schema::get_vertex_description | ( | label_t | label | ) | const |
label_t gs::Schema::get_vertex_label_id | ( | const std::string & | label | ) | const |
std::string gs::Schema::get_vertex_label_name | ( | label_t | index | ) | const |
const std::vector< std::tuple< PropertyType, std::string, size_t > > & gs::Schema::get_vertex_primary_key | ( | label_t | index | ) | const |
const std::string& gs::Schema::get_vertex_primary_key_name | ( | label_t | index | ) | const |
const std::vector< PropertyType > & gs::Schema::get_vertex_properties | ( | const std::string & | label | ) | const |
const std::vector< PropertyType > & gs::Schema::get_vertex_properties | ( | label_t | label | ) | const |
const std::vector< std::string > & gs::Schema::get_vertex_property_names | ( | const std::string & | label | ) | const |
const std::vector< std::string > & gs::Schema::get_vertex_property_names | ( | label_t | label | ) | const |
const std::vector< StorageStrategy > & gs::Schema::get_vertex_storage_strategies | ( | const std::string & | label | ) | const |
|
static |
std::string gs::Schema::GetDescription | ( | ) | const |
std::string gs::Schema::GetPluginDir | ( | ) | const |
const std::unordered_map< std::string, std::pair< std::string, uint8_t > > & gs::Schema::GetPlugins | ( | ) | const |
std::string gs::Schema::GetVersion | ( | ) | const |
bool gs::Schema::has_edge_label | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | edge_label | ||
) | const |
bool gs::Schema::has_multi_props_edge | ( | ) | const |
bool gs::Schema::has_vertex_label | ( | const std::string & | label | ) | const |
bool gs::Schema::incoming_edge_mutable | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | label | ||
) | const |
|
static |
bool gs::Schema::outgoing_edge_mutable | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | label | ||
) | const |
void gs::Schema::RemovePlugin | ( | const std::string & | plugin_name | ) |
void gs::Schema::Serialize | ( | std::unique_ptr< grape::LocalIOAdaptor > & | writer | ) | const |
void gs::Schema::set_vertex_properties | ( | label_t | label_id, |
const std::vector< PropertyType > & | types, | ||
const std::vector< StorageStrategy > & | strategies = {} |
||
) |
void gs::Schema::SetDescription | ( | const std::string & | description | ) |
void gs::Schema::SetPluginDir | ( | const std::string & | plugin_dir | ) |
void gs::Schema::SetVersion | ( | const std::string & | version | ) |
bool gs::Schema::valid_edge_property | ( | const std::string & | src_label, |
const std::string & | dst_label, | ||
const std::string & | label | ||
) | const |
bool gs::Schema::vertex_has_primary_key | ( | const std::string & | label, |
const std::string & | prop | ||
) | const |
bool gs::Schema::vertex_has_property | ( | const std::string & | label, |
const std::string & | prop | ||
) | const |
label_t gs::Schema::vertex_label_num | ( | ) | const |
|
private |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
static |
|
staticconstexpr |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
private |
|
private |
|
staticconstexpr |
|
staticconstexpr |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexpr |
|
staticconstexpr |
|
private |
|
staticconstexpr |
|
private |
|
private |
|
staticconstexpr |
|
private |
|
private |
|
private |
|
private |