From baa166f56ccc44693dec60d938a2e09a545b7782 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 10 Feb 2023 08:48:04 +0800 Subject: [PATCH 01/85] draft commit of grin apis --- grin/include/partition/partition.h | 148 ++ grin/include/predefine.h | 136 ++ grin/include/propertygraph/label.h | 62 + grin/include/propertygraph/primarykey.h | 28 + grin/include/propertygraph/property.h | 83 + grin/include/propertygraph/propertygraph.h | 66 + grin/include/topology/adjacentlist.h | 47 + grin/include/topology/edgelist.h | 41 + grin/include/topology/structure.h | 63 + grin/include/topology/vertexlist.h | 49 + modules/graph/fragment/arrow_fragment.grin.h | 1495 ++++++++++++++++++ modules/graph/fragment/graph_schema.grin.h | 251 +++ 12 files changed, 2469 insertions(+) create mode 100644 grin/include/partition/partition.h create mode 100644 grin/include/predefine.h create mode 100644 grin/include/propertygraph/label.h create mode 100644 grin/include/propertygraph/primarykey.h create mode 100644 grin/include/propertygraph/property.h create mode 100644 grin/include/propertygraph/propertygraph.h create mode 100644 grin/include/topology/adjacentlist.h create mode 100644 grin/include/topology/edgelist.h create mode 100644 grin/include/topology/structure.h create mode 100644 grin/include/topology/vertexlist.h create mode 100644 modules/graph/fragment/arrow_fragment.grin.h create mode 100644 modules/graph/fragment/graph_schema.grin.h diff --git a/grin/include/partition/partition.h b/grin/include/partition/partition.h new file mode 100644 index 000000000..2e98aef80 --- /dev/null +++ b/grin/include/partition/partition.h @@ -0,0 +1,148 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#ifndef GRIN_INCLUDE_PARTITION_PARTITION_H_ +#define GRIN_INCLUDE_PARTITION_PARTITION_H_ + +#include "../predefine.h" + +#ifdef PARTITION_STRATEGY + +// basic partition informations +size_t get_total_partitions_number(const PartitionedGraph); + +size_t get_total_vertices_number(const PartitionedGraph); + +PartitionList get_local_partitions(const PartitionedGraph); + +void destroy_partition_list(PartitionList); + +size_t get_partition_list_size(const PartitionList); + +Partition get_partition_from_list(const PartitionList, const size_t); + +#ifdef MUTABLE_GRAPH +PartitionList create_partition_list(); +bool insert_partition_to_list(PartitionList, const Partition); +#endif + +void* get_partition_info(const Partition); + +Graph get_local_graph_from_partition(const PartitionedGraph, const Partition); + +// serialization & deserialization +char* serialize_remote_partition(const PartitionedGraph, const RemotePartition); + +char* serialize_remote_vertex(const PartitionedGraph, const RemoteVertex); + +char* serialize_remote_vertex_with_data(const PartitionedGraph, + const RemoteVertex, const VertexData); + +char* serialize_remote_edge(const PartitionedGraph, const RemoteEdge); + +Partition get_partition_from_deserialization(const PartitionedGraph, + const char*); + +Vertex get_vertex_from_deserialization(const PartitionedGraph, const Partition, + const char*); + +Vertex get_vertex_from_deserialization_with_data(const PartitionedGraph, + const Partition, const char*, + VertexData); + +Edge get_edge_from_deserialization(const PartitionedGraph, const Partition, + const char*); + +// For local vertex: could get its properties locally, but not sure to have all +// its edges locally, which depends on the partition strategy; every vertex +// could be local in 1~n partitions. +bool is_local_vertex(const PartitionedGraph, const Partition, Vertex); + +// For local edge: could get its properties locally; +// every edge could be local in 1/2/n partitions +bool is_local_edge(const PartitionedGraph, const Partition, const Edge); + +// For a non-local vertex/edge, get its master partition (a remote partition); +// also, we can get its master vertex/edge (a remote vertex/edge); +// for a local vertex/edge, an invalid value would be returned +RemotePartition get_master_partition_for_vertex(const PartitionedGraph, + const Partition, Vertex); + +RemotePartition get_master_partition_for_edge(const PartitionedGraph, + const Partition, const Edge); + +RemoteVertex get_master_vertex_for_vertex(const PartitionedGraph, + const Partition, Vertex); + +RemoteEdge get_master_edge_for_edge(const PartitionedGraph, const Partition, + const Edge); + +// get the partitions in which a vertex exists +RemotePartitionList get_remote_partition_list_for_vertex(const PartitionedGraph, + const Partition, + Vertex); + +void destroy_remote_partition_list(RemotePartitionList); + +size_t get_remote_partition_list_size(const RemotePartitionList); + +RemotePartition get_remote_partition_from_list(const RemotePartitionList, + const size_t); + +#ifdef MUTABLE_GRAPH +RemotePartitionList create_remote_partition_list(); +bool insert_remote_partition_to_list(RemotePartitionList, + const RemotePartition); +#endif + +// get the replicas of a vertex +RemoteVertexList get_all_replicas_for_vertex(const PartitionedGraph, + const Partition, Vertex); + +void destroy_remote_vertex_list(RemoteVertexList); + +size_t get_remote_vertex_list_size(const RemoteVertexList); + +RemoteVertex get_remote_vertex_from_list(const RemoteVertexList, const size_t); + +#ifdef MUTABLE_GRAPH +RemoteVertexList create_remote_vertex_list(); +bool insert_remote_vertex_to_list(RemoteVertexList, const RemoteVertex); +#endif +#endif + +#if defined(PARTITION_STRATEGY) && defined(ENABLE_VERTEX_LIST) +VertexList get_local_vertices(const PartitionedGraph, const Partition); + +VertexList get_remote_vertices(const PartitionedGraph, const Partition); + +VertexList get_remote_vertices_by_partition(const PartitionedGraph, + const RemotePartition); +#endif + +#if defined(PARTITION_STRATEGY) && defined(ENABLE_ADJACENT_LIST) +AdjacentList get_local_adjacent_list(const PartitionedGraph, const Direction, + const Partition, Vertex); + +AdjacentList get_remote_adjacent_list(const PartitionedGraph, const Direction, + const Partition, Vertex); + +AdjacentList get_remote_adjacent_list_by_partition(const PartitionedGraph, + const Direction, + const Partition, + Vertex); +#endif + +#endif // GRIN_INCLUDE_PARTITION_PARTITION_H_ diff --git a/grin/include/predefine.h b/grin/include/predefine.h new file mode 100644 index 000000000..865d620f4 --- /dev/null +++ b/grin/include/predefine.h @@ -0,0 +1,136 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +#ifndef GRIN_INCLUDE_PREDEFINE_H_ +#define GRIN_INCLUDE_PREDEFINE_H_ + +#include +#include +#include + +// The enum type for edge directions. +typedef enum { + IN = 0, + OUT = 1, + BOTH = 2, +} Direction; + +// The enum type for partition strategies. +typedef enum { + VERTEX_CUT = 0, + EDGE_CUT = 1, + HYBRID = 2, +} PartitionStrategy; + +// The enum type for replicate-edge strategies. +typedef enum { + ALL = 0, + PART = 1, + NONE = 2, +} ReplicateEdgeStrategy; + +// The enum type for vertex/edge data type. +typedef enum { + INT = 0, + LONG = 1, + UNSIGNED = 2, + UNSIGNED_LONG = 3, + FLOAT = 4, + DOUBLE = 5, + OTHER = 6, +} DataType; + +/* The following macros are defined as the features of the storage. */ +// Note: mutable graph is currently NOT supported in grin-libgrape-lite +// #define MUTABLE_GRAPH // Graph is mutable +#define WITH_VERTEX_DATA // There is data on vertex. +#define WITH_EDGE_DATA // There is data on edge, e.g. weight. +#define ENABLE_VERTEX_LIST // Enable the vertex list structure. +#define CONTINUOUS_VID_TRAIT // Enable continous index on vertext list. +#define ENABLE_ADJACENT_LIST // Enable the adjacent list structure. +// Note: edge_list is only used in vertex_cut fragment +// #define ENABLE_EDGE_LIST // Enable the edge list structure. + +// The partition strategy. +#define PARTITION_STRATEGY EDGE_CUT +// There are all/part edges on local vertices. +#define EDGES_ON_LOCAL_VERTEX ALL +// There are all/part/none edges on non-local vertices. +#define EDGES_ON_NON_LOCAL_VERTEX NONE +// The direction of edges on local vertices. +#define EDGES_ON_LOCAL_VERTEX_DIRECTION BOTH + +/* The followings macros are defined as invalid value. */ +#define NULL_TYPE NULL // Null type (null data type) +#define NULL_GRAPH NULL // Null graph handle (invalid return value). +#define NULL_VERTEX NULL // Null vertex handle (invalid return value). +#define NULL_EDGE NULL // Null edge handle (invalid return value). +#define NULL_PARTITION UINT_MAX // Null partition handle (invalid return value). +#define NULL_LIST NULL // Null list of any kind. +#define NULL_REMOTE_PARTITION UINT_MAX // same as partition. +#define NULL_REMOTE_VERTEX NULL // same as vertex. +#define NULL_REMOTE_EDGE NULL // same as edge. + +/* The following data types shall be defined through typedef. */ +// local graph +typedef void* Graph; + +// vertex +typedef void* Vertex; +typedef void* VertexID; + +// vertex data +#ifdef WITH_VERTEX_DATA +typedef void* VertexData; +#endif + +// vertex list +#ifdef ENABLE_VERTEX_LIST +typedef void* VertexList; +typedef void* VertexListIterator; +#endif + +// adjacent list +#ifdef ENABLE_ADJACENT_LIST +typedef void* AdjacentList; +typedef void* AdjacentListIterator; +#endif + +// edge +typedef void* Edge; + +// edge data +#ifdef WITH_EDGE_DATA +typedef void* EdgeData; +#endif + +// partitioned graph +typedef void* PartitionedGraph; + +// partition and partition list +typedef unsigned Partition; +typedef Partition* PartitionList; + +// remote partition and remote partition list +typedef Partition RemotePartition; +typedef PartitionList RemotePartitionList; + +// remote vertex and remote vertex list +typedef Vertex RemoteVertex; +typedef RemoteVertex* RemoteVertexList; + +// remote edge +typedef Edge RemoteEdge; + +#endif // GRIN_INCLUDE_PREDEFINE_H_ diff --git a/grin/include/propertygraph/label.h b/grin/include/propertygraph/label.h new file mode 100644 index 000000000..830d6ee63 --- /dev/null +++ b/grin/include/propertygraph/label.h @@ -0,0 +1,62 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This header file is not available for libgrape-lite. + +#ifndef GRIN_PROPERTY_GRAPH_LABEL_H_ +#define GRIN_PROPERTY_GRAPH_LABEL_H_ + +#include "grin/predefine.h" + +#ifdef WITH_VERTEX_LABEL +VertexLabelList get_vertex_labels(const Graph); + +size_t get_vertex_label_list_size(const VertexLabelList); + +VertexLabel get_vertex_label_from_list(const VertexLabelList, const size_t); + +VertexLabelList create_vertex_label_list(); + +void destroy_vertex_label_list(VertexLabelList); + +bool insert_vertex_label_to_list(VertexLabelList, const VertexLabel); + +VertexLabel get_vertex_label(const Graph, const Vertex); + +char* get_vertex_label_name(const Graph, const VertexLabel); +#endif + +#ifdef WITH_EDGE_LABEL +EdgeLabelList get_edge_labels(const Graph); + +size_t get_edge_label_list_size(const EdgeLabelList); + +EdgeLabel get_edge_label_from_list(const EdgeLabelList, const size_t); + +EdgeLabelList create_edge_label_list(); + +void destroy_edge_label_list(EdgeLabelList); + +bool insert_edge_label_to_list(EdgeLabelList, const EdgeLabel); + +EdgeLabel get_edge_label(const Graph, const Edge); + +char* get_edge_label_name(const Graph, const EdgeLabel); +#endif + +#if defined(WITH_VERTEX_LABEL) && defined(WITH_EDGE_LABEL) +VertexLabel get_src_label_from_edge_label(const Graph, const EdgeLabel); + +VertexLabel get_dst_label_from_edge_label(const Graph, const EdgeLabel); +#endif + +#endif // GRIN_PROPERTY_GRAPH_LABEL_H_ \ No newline at end of file diff --git a/grin/include/propertygraph/primarykey.h b/grin/include/propertygraph/primarykey.h new file mode 100644 index 000000000..5e3607c1a --- /dev/null +++ b/grin/include/propertygraph/primarykey.h @@ -0,0 +1,28 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This header file is not available for libgrape-lite. + +#ifndef GRIN_PROPERTY_GRAPH_PRIMARY_KEY_H_ +#define GRIN_PROPERTY_GRAPH_PRIMARY_KEY_H_ + +#include "grin/predefine.h" + +#ifdef WITH_VERTEX_PRIMARTY_KEYS + +PropertyList get_primary_keys(const Graph); + +Vertex get_vertex_from_primay_keys(const Graph, const Row); + +#endif + +#endif // GRIN_PROPERTY_GRAPH_PRIMARY_KEY_H_ \ No newline at end of file diff --git a/grin/include/propertygraph/property.h b/grin/include/propertygraph/property.h new file mode 100644 index 000000000..4d27b4810 --- /dev/null +++ b/grin/include/propertygraph/property.h @@ -0,0 +1,83 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This header file is not available for libgrape-lite. + +#ifndef GRIN_PROPERTY_GRAPH_PROPERTY_H_ +#define GRIN_PROPERTY_GRAPH_PROPERTY_H_ + +#include "grin/predefine.h" + +#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) +char* get_property_name(const Graph, const Property); + +DataType get_property_type(const Graph, const Property); + +size_t get_property_list_size(const PropertyList); + +Property get_property_from_list(const PropertyList, const size_t); + +PropertyList create_property_list(); + +void destroy_property_list(PropertyList); + +bool insert_property_to_list(PropertyList, const Property); + +void* get_property_value_from_row(const Row, const Property); + +size_t get_row_list_size(const RowList); + +RowListIterator get_row_list_begin(RowList); + +RowListIterator get_next_row_iter(RowList, const RowListIterator); + +bool has_next_row_iter(RowList, const RowListIterator); + +Row get_row_from_iter(RowList, const RowListIterator); + +RowList create_row_list(); + +void destroy_row_list(RowList); + +bool insert_row_to_list(RowList, const Row); +#endif + +#ifdef WITH_VERTEX_PROPERTY +void* get_vertex_property_value(const Graph, const Vertex, const Property); + +PropertyList get_all_vertex_properties(const Graph); + +Row get_vertex_row(const Graph, const Vertex, const PropertyList); + +RowList get_vertex_row_in_batch(const Graph, const VertexList, + const PropertyList); +#endif + +#ifdef WITH_EDGE_PROPERTY +void* get_edge_property_value(const Graph, const Edge, const Property); + +PropertyList get_all_edge_properties(const Graph); + +Row get_edge_row(const Graph, const Edge, const PropertyList); + +RowList get_edge_row_in_batch(const Graph, const EdgeList, const PropertyList); +#endif + +#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE) +Graph select_vertex_properties(const Graph, const PropertyList); +#endif + +#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE) +Graph select_edge_properteis(const Graph, const PropertyList); +#endif + +#endif // GRIN_PROPERTY_GRAPH_PROPERTY_H_ \ No newline at end of file diff --git a/grin/include/propertygraph/propertygraph.h b/grin/include/propertygraph/propertygraph.h new file mode 100644 index 000000000..2337f08dd --- /dev/null +++ b/grin/include/propertygraph/propertygraph.h @@ -0,0 +1,66 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This header file is not available for libgrape-lite. + +#ifndef GRIN_PROPERTY_GRAPH_PROPERTY_GRAPH_H_ +#define GRIN_PROPERTY_GRAPH_PROPERTY_GRAPH_H_ + +#include "../predefine.h" + +#if defined(WITH_VERTEX_LABEL) && defined(ENABLE_VERTEX_LIST) +VertexList get_vertex_list_from_label(const Graph, const VertexLabel); +#endif + +#if defined(WITH_EDGE_LABEL) && defined(ENABLE_EDGE_LIST) +EdgeList get_edge_list_from_label(const Graph, const EdgeLabel); +#endif + +#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) +PropertyList get_all_vertex_properties_from_label(const Graph, + const VertexLabel); +#endif + +#if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) +PropertyList get_all_edge_properties_from_label(const Graph, const EdgeLabel); +#endif + +#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) && \ + defined(COLUMN_STORE) +Graph select_vertex_properties_for_label(const Graph, const PropertyList, + const VertexLabel); +#endif + +#if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) && \ + defined(COLUMN_STORE) +Graph select_edge_properteis_for_label(const Graph, const PropertyList, + const EdgeLabel); +#endif + +#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PRIMARTY_KEYS) +PropertyList get_primary_keys_from_label(const Graph, const VertexLabel); + +Vertex get_vertex_from_primary_keys_and_label(const Graph, const Row, + const VertexLabel); +#endif + +#if defined(WITH_VERTEX_LABEL) && defined(ENABLE_VERTEX_LIST) && \ + defined(PARTITION_STRATEGY) +VertexList get_local_vertices_from_label(const PartitionedGraph, + const Partition, const VertexLabel); + +VertexList get_non_local_vertices_from_label(const PartitionedGraph, + const Partition, + const VertexLabel); +#endif + +#endif // GRIN_PROPERTY_GRAPH_PROPERTY_GRAPH_H_ \ No newline at end of file diff --git a/grin/include/topology/adjacentlist.h b/grin/include/topology/adjacentlist.h new file mode 100644 index 000000000..965df6db0 --- /dev/null +++ b/grin/include/topology/adjacentlist.h @@ -0,0 +1,47 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#ifndef GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ +#define GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ + +#include "../predefine.h" + +#ifdef ENABLE_ADJACENT_LIST + +AdjacentList get_adjacent_list(const Graph, const Direction, Vertex); + +void destroy_adjacent_list(AdjacentList); + +AdjacentListIterator get_adjacent_list_begin(const AdjacentList); + +AdjacentListIterator get_next_adjacent_iter(const AdjacentList, + AdjacentListIterator); + +size_t get_adjacent_list_size(const AdjacentList); + +bool has_next_adjacent_iter(const AdjacentList, const AdjacentListIterator); + +Vertex get_neighbor_from_iter(const AdjacentList, const AdjacentListIterator); + +#ifdef WITH_EDGE_DATA +DataType get_adjacent_edge_data_type(const Graph); + +EdgeData get_adjacent_edge_data_value(const AdjacentList, + const AdjacentListIterator); +#endif + +#endif + +#endif // GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ diff --git a/grin/include/topology/edgelist.h b/grin/include/topology/edgelist.h new file mode 100644 index 000000000..a691bba17 --- /dev/null +++ b/grin/include/topology/edgelist.h @@ -0,0 +1,41 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#ifndef GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ +#define GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ + +#ifdef ENABLE_EDGE_LIST + +EdgeList get_edge_list(const Graph, const Direction); + +void destroy_edge_list(EdgeList); + +size_t get_edge_list_size(const EdgeList); + +EdgeListIterator get_edge_list_begin(const EdgeList); + +EdgeListIterator get_next_edge_iter(const EdgeList, EdgeListIterator); + +bool has_next_edge_iter(const EdgeList, const EdgeListIterator); + +Edge get_edge_from_iter(const EdgeList, const EdgeListIterator); + +#ifdef MUTABLE_GRAPH +EdgeList create_edge_list(); +bool insert_edge_to_list(EdgeList, const Edge); +#endif +#endif + +#endif // GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ diff --git a/grin/include/topology/structure.h b/grin/include/topology/structure.h new file mode 100644 index 000000000..49ac8844d --- /dev/null +++ b/grin/include/topology/structure.h @@ -0,0 +1,63 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#ifndef GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ +#define GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ + +#include "../predefine.h" + +bool is_directed(const Graph); + +size_t get_vertex_num(const Graph); + +size_t get_edge_num(const Graph); + +void destroy_vertex(Vertex); + +DataType get_vertex_id_data_type(const Graph); + +VertexID get_vertex_id(const Vertex); + +#ifdef WITH_VERTEX_DATA +DataType get_vertex_data_type(const Graph, const Vertex); + +VertexData get_vertex_data_value(const Graph, const Vertex); + +void destroy_vertex_data(VertexData); + +#ifdef MUTABLE_GRAPH +void set_vertex_data_value(Graph, Vertex, const VertexData); +#endif +#endif + +void destroy_edge(Edge); + +Vertex get_edge_src(const Graph, const Edge); + +Vertex get_edge_dst(const Graph, const Edge); + +#ifdef WITH_EDGE_DATA +DataType get_edge_data_type(const Graph, const Edge); + +EdgeData get_edge_data_value(const Graph, const Edge); + +void destroy_edge_data(EdgeData); + +#ifdef MUTABLE_GRAPH +void set_edge_data_value(Graph, Edge, const EdgeData); +#endif +#endif + +#endif // GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ diff --git a/grin/include/topology/vertexlist.h b/grin/include/topology/vertexlist.h new file mode 100644 index 000000000..bd4940919 --- /dev/null +++ b/grin/include/topology/vertexlist.h @@ -0,0 +1,49 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#ifndef GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ +#define GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ + +#include "../predefine.h" + +#ifdef ENABLE_VERTEX_LIST + +VertexList get_vertex_list(const Graph); + +void destroy_vertex_list(Graph); + +size_t get_vertex_list_size(const VertexList); + +VertexListIterator get_vertex_list_begin(const VertexList); + +VertexListIterator get_next_vertex_iter(const VertexList, VertexListIterator); + +bool has_next_vertex_iter(const VertexList, const VertexListIterator); + +Vertex get_vertex_from_iter(const VertexList, const VertexListIterator); + +#ifdef CONTINUOUS_VID_TRAIT +VertexID get_begin_vertex_id_from_list(const VertexList); + +VertexID get_end_vertex_id_from_list(const VertexList); +#endif + +#ifdef MUTABLE_GRAPH +VertexList create_vertex_list(); +bool insert_vertex_to_list(VertexList, const Vertex); +#endif +#endif + +#endif // GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h new file mode 100644 index 000000000..55435ddd3 --- /dev/null +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -0,0 +1,1495 @@ +#ifndef MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H +#define MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H + +/** Copyright 2020-2023 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#ifndef MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_MOD_H_ +#define MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_MOD_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "arrow/api.h" +#include "arrow/io/api.h" + +#include "grape/fragment/fragment_base.h" +#include "grape/graph/adj_list.h" +#include "grape/utils/vertex_array.h" + +#include "client/ds/core_types.h" +#include "client/ds/object_meta.h" + +#include "basic/ds/arrow.h" +#include "basic/ds/arrow_utils.h" +#include "common/util/typename.h" + +#include "graph/fragment/arrow_fragment_base.h" +#include "graph/fragment/fragment_traits.h" +#include "graph/fragment/graph_schema.h" +#include "graph/fragment/property_graph_types.h" +#include "graph/utils/error.h" +#include "graph/vertex_map/arrow_local_vertex_map.h" +#include "graph/vertex_map/arrow_vertex_map.h" + +namespace gs { + +template +class ArrowProjectedFragment; + +} // namespace gs + +namespace vineyard { + +inline std::string generate_name_with_suffix( + const std::string& prefix, property_graph_types::LABEL_ID_TYPE label) { + return prefix + "_" + std::to_string(label); +} + +inline std::string generate_name_with_suffix( + const std::string& prefix, property_graph_types::LABEL_ID_TYPE v_label, + property_graph_types::LABEL_ID_TYPE e_label) { + return prefix + "_" + std::to_string(v_label) + "_" + std::to_string(e_label); +} + +template +class ArrowFragmentBaseBuilder; + +template ::type, VID_T>> +class __attribute__((annotate("vineyard"))) ArrowFragment + : public ArrowFragmentBase, + public vineyard::BareRegistered< + ArrowFragment> { + + public: + static std::unique_ptr Create() __attribute__((used)) { + return std::static_pointer_cast( + std::unique_ptr>{ + new ArrowFragment()}); + } + + + public: + void Construct(const ObjectMeta& meta) override { + std::string __type_name = type_name>(); + VINEYARD_ASSERT( + meta.GetTypeName() == __type_name, + "Expect typename '" + __type_name + "', but got '" + meta.GetTypeName() + "'"); + this->meta_ = meta; + this->id_ = meta.GetId(); + + meta.GetKeyValue("fid_", this->fid_); + meta.GetKeyValue("fnum_", this->fnum_); + meta.GetKeyValue("directed_", this->directed_); + meta.GetKeyValue("is_multigraph_", this->is_multigraph_); + meta.GetKeyValue("vertex_label_num_", this->vertex_label_num_); + meta.GetKeyValue("edge_label_num_", this->edge_label_num_); + meta.GetKeyValue("oid_type", this->oid_type); + meta.GetKeyValue("vid_type", this->vid_type); + this->ivnums_.Construct(meta.GetMemberMeta("ivnums_")); + this->ovnums_.Construct(meta.GetMemberMeta("ovnums_")); + this->tvnums_.Construct(meta.GetMemberMeta("tvnums_")); + for (size_t __idx = 0; __idx < meta.GetKeyValue("__vertex_tables_-size"); ++__idx) { + this->vertex_tables_.emplace_back(std::dynamic_pointer_cast( + meta.GetMember("__vertex_tables_-" + std::to_string(__idx)))); + } + for (size_t __idx = 0; __idx < meta.GetKeyValue("__ovgid_lists_-size"); ++__idx) { + this->ovgid_lists_.emplace_back(std::dynamic_pointer_cast( + meta.GetMember("__ovgid_lists_-" + std::to_string(__idx)))); + } + for (size_t __idx = 0; __idx < meta.GetKeyValue("__ovg2l_maps_-size"); ++__idx) { + this->ovg2l_maps_.emplace_back(std::dynamic_pointer_cast>( + meta.GetMember("__ovg2l_maps_-" + std::to_string(__idx)))); + } + for (size_t __idx = 0; __idx < meta.GetKeyValue("__edge_tables_-size"); ++__idx) { + this->edge_tables_.emplace_back(std::dynamic_pointer_cast
( + meta.GetMember("__edge_tables_-" + std::to_string(__idx)))); + } + this->ie_lists_.resize(meta.GetKeyValue("__ie_lists_-size")); + for (size_t __idx = 0; __idx < this->ie_lists_.size(); ++__idx) { + for (size_t __idy = 0; __idy < meta.GetKeyValue( + "__ie_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { + this->ie_lists_[__idx].emplace_back(std::dynamic_pointer_cast( + meta.GetMember("__ie_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); + } + } + this->oe_lists_.resize(meta.GetKeyValue("__oe_lists_-size")); + for (size_t __idx = 0; __idx < this->oe_lists_.size(); ++__idx) { + for (size_t __idy = 0; __idy < meta.GetKeyValue( + "__oe_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { + this->oe_lists_[__idx].emplace_back(std::dynamic_pointer_cast( + meta.GetMember("__oe_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); + } + } + this->ie_offsets_lists_.resize(meta.GetKeyValue("__ie_offsets_lists_-size")); + for (size_t __idx = 0; __idx < this->ie_offsets_lists_.size(); ++__idx) { + for (size_t __idy = 0; __idy < meta.GetKeyValue( + "__ie_offsets_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { + this->ie_offsets_lists_[__idx].emplace_back(std::dynamic_pointer_cast( + meta.GetMember("__ie_offsets_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); + } + } + this->oe_offsets_lists_.resize(meta.GetKeyValue("__oe_offsets_lists_-size")); + for (size_t __idx = 0; __idx < this->oe_offsets_lists_.size(); ++__idx) { + for (size_t __idy = 0; __idy < meta.GetKeyValue( + "__oe_offsets_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { + this->oe_offsets_lists_[__idx].emplace_back(std::dynamic_pointer_cast( + meta.GetMember("__oe_offsets_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); + } + } + this->vm_ptr_ = std::dynamic_pointer_cast(meta.GetMember("vm_ptr_")); + meta.GetKeyValue("schema_json_", this->schema_json_); + + + if (meta.IsLocal()) { + this->PostConstruct(meta); + } + } + + private: +public: + using oid_t = OID_T; + using vid_t = VID_T; + using internal_oid_t = typename InternalType::type; + using eid_t = property_graph_types::EID_TYPE; + using prop_id_t = property_graph_types::PROP_ID_TYPE; + using label_id_t = property_graph_types::LABEL_ID_TYPE; + using vertex_range_t = grape::VertexRange; + using inner_vertices_t = vertex_range_t; + using outer_vertices_t = vertex_range_t; + using vertices_t = vertex_range_t; + using nbr_t = property_graph_utils::Nbr; + using nbr_unit_t = property_graph_utils::NbrUnit; + using adj_list_t = property_graph_utils::AdjList; + using raw_adj_list_t = property_graph_utils::RawAdjList; + using vertex_map_t = VERTEX_MAP_T; + using vertex_t = grape::Vertex; + + using ovg2l_map_t = + ska::flat_hash_map::KeyHash>; + + using vid_array_t = ArrowArrayType; + using vid_vineyard_array_t = ArrowVineyardArrayType; + using vid_vineyard_builder_t = ArrowVineyardBuilderType; + using eid_array_t = ArrowArrayType; + using eid_vineyard_array_t = ArrowVineyardArrayType; + using eid_vineyard_builder_t = ArrowVineyardBuilderType; + + using vid_builder_t = ArrowBuilderType; + + template + using vertex_array_t = grape::VertexArray; + + template + using inner_vertex_array_t = grape::VertexArray; + + template + using outer_vertex_array_t = grape::VertexArray; + + static constexpr grape::LoadStrategy load_strategy = + grape::LoadStrategy::kBothOutIn; + + public: + ~ArrowFragment() = default; + + vineyard::ObjectID vertex_map_id() const override { return vm_ptr_->id(); } + + bool directed() const override { + // grin structure directed + return directed_; + } + + bool is_multigraph() const override { + // grin structure multigraph ++++ + return is_multigraph_; + } + + const std::string vid_typename() const override { + // grin structure vid type + return vid_type; + } + + const std::string oid_typename() const override { return oid_type; } + + + fid_t fid() const { + // grin partition get_partition + return fid_; + } + + fid_t fnum() const { + // grin partition get_partition_number + return fnum_; + } + + label_id_t vertex_label(const vertex_t& v) const { + // grin label get vertex_label by vertex + return vid_parser_.GetLabelId(v.GetValue()); + } + + int64_t vertex_offset(const vertex_t& v) const { + // to remove ---- + return vid_parser_.GetOffset(v.GetValue()); + } + + label_id_t vertex_label_num() const { + // grin label get vertex label list size + return schema_.vertex_label_num(); + } + + label_id_t edge_label_num() const { + // grin label get edge label list size + return schema_.edge_label_num(); + } + + prop_id_t vertex_property_num(label_id_t label) const { + // grin pg get_all_vertex_properties_from_label + std::string type = "VERTEX"; + return static_cast(schema_.GetEntry(label, type).property_num()); + } + + std::shared_ptr vertex_property_type(label_id_t label, + prop_id_t prop) const { + // grin property get_property_type + return vertex_tables_[label]->schema()->field(prop)->type(); + } + + prop_id_t edge_property_num(label_id_t label) const { + // grin pg get_all_edge_properties_from_label + std::string type = "EDGE"; + return static_cast(schema_.GetEntry(label, type).property_num()); + } + + std::shared_ptr edge_property_type(label_id_t label, + prop_id_t prop) const { + // grin property get_property_type + return edge_tables_[label]->schema()->field(prop)->type(); + } + + std::shared_ptr vertex_data_table(label_id_t i) const { + // grin pg get_all_rows ++++??? + return vertex_tables_[i]->GetTable(); + } + + std::shared_ptr edge_data_table(label_id_t i) const { + // grin pg get_all_rows ++++??? + return edge_tables_[i]->GetTable(); + } + + template + property_graph_utils::EdgeDataColumn edge_data_column( + label_id_t label, prop_id_t prop) const { + // get rid of this method and EdgeDataColumn structure + // this structure actually serves to get a specific property of an edge + // and it can be replaced by grin property get_edge_row + if (edge_tables_[label]->num_rows() == 0) { + return property_graph_utils::EdgeDataColumn(); + } else { + // the finalized etables are guaranteed to have been concatenated + return property_graph_utils::EdgeDataColumn( + edge_tables_[label]->column(prop)->chunk(0)); + } + } + + template + property_graph_utils::VertexDataColumn vertex_data_column( + label_id_t label, prop_id_t prop) const { + // Ditto. it can be replaced by grin property get_vertex_row && get_property_value_from_row + if (vertex_tables_[label]->num_rows() == 0) { + return property_graph_utils::VertexDataColumn( + InnerVertices(label)); + } else { + // the finalized vtables are guaranteed to have been concatenated + return property_graph_utils::VertexDataColumn( + InnerVertices(label), vertex_tables_[label]->column(prop)->chunk(0)); + } + } + + vertex_range_t Vertices(label_id_t label_id) const { + // continuous_vid_traits + return vertex_range_t( + vid_parser_.GenerateId(0, label_id, 0), + vid_parser_.GenerateId(0, label_id, tvnums_[label_id])); + } + + vertex_range_t InnerVertices(label_id_t label_id) const { + // continuous_vid_traits + return vertex_range_t( + vid_parser_.GenerateId(0, label_id, 0), + vid_parser_.GenerateId(0, label_id, ivnums_[label_id])); + } + + vertex_range_t OuterVertices(label_id_t label_id) const { + // continuous_vid_traits + return vertex_range_t( + vid_parser_.GenerateId(0, label_id, ivnums_[label_id]), + vid_parser_.GenerateId(0, label_id, tvnums_[label_id])); + } + + vertex_range_t InnerVerticesSlice(label_id_t label_id, vid_t start, vid_t end) + const { + // continuous_vid_traits + CHECK(start <= end && start <= ivnums_[label_id]); + if (end <= ivnums_[label_id]) { + return vertex_range_t(vid_parser_.GenerateId(0, label_id, start), + vid_parser_.GenerateId(0, label_id, end)); + } else { + return vertex_range_t( + vid_parser_.GenerateId(0, label_id, start), + vid_parser_.GenerateId(0, label_id, ivnums_[label_id])); + } + } + + inline vid_t GetVerticesNum(label_id_t label_id) const { + // grin label get_vertex_num_by_label + return tvnums_[label_id]; + } + + bool GetVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { + vid_t gid; + if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { + return (vid_parser_.GetFid(gid) == fid_) ? InnerVertexGid2Vertex(gid, v) + : OuterVertexGid2Vertex(gid, v); + } else { + return false; + } + } + + oid_t GetId(const vertex_t& v) const { + return IsInnerVertex(v) ? GetInnerVertexId(v) : GetOuterVertexId(v); + } + + internal_oid_t GetInternalId(const vertex_t& v) const { + return IsInnerVertex(v) ? GetInnerVertexInternalId(v) + : GetOuterVertexInternalId(v); + } + + fid_t GetFragId(const vertex_t& u) const { + return IsInnerVertex(u) ? fid_ : vid_parser_.GetFid(GetOuterVertexGid(u)); + } + + size_t GetTotalNodesNum() const { return vm_ptr_->GetTotalNodesNum(); } + size_t GetTotalVerticesNum() const { return vm_ptr_->GetTotalNodesNum(); } + size_t GetTotalVerticesNum(label_id_t label) const { + return vm_ptr_->GetTotalNodesNum(label); + } + + size_t GetEdgeNum() const { return directed_ ? oenum_ + ienum_ : oenum_; } + + size_t GetInEdgeNum() const { return ienum_; } + + size_t GetOutEdgeNum() const { return oenum_; } + + template + T GetData(const vertex_t& v, prop_id_t prop_id) const { + // grin get vertex row && get_property_value_from_row + return property_graph_utils::ValueGetter::Value( + vertex_tables_columns_[vid_parser_.GetLabelId(v.GetValue())][prop_id], + vid_parser_.GetOffset(v.GetValue())); + } + + bool HasChild(const vertex_t& v, label_id_t e_label) const { + return GetLocalOutDegree(v, e_label) != 0; + } + + bool HasParent(const vertex_t& v, label_id_t e_label) const { + return GetLocalInDegree(v, e_label) != 0; + } + + int GetLocalOutDegree(const vertex_t& v, label_id_t e_label) const { + return GetOutgoingAdjList(v, e_label).Size(); + } + + int GetLocalInDegree(const vertex_t& v, label_id_t e_label) const { + return GetIncomingAdjList(v, e_label).Size(); + } + + // FIXME: grape message buffer compatibility + bool Gid2Vertex(const vid_t& gid, vertex_t& v) const { + return (vid_parser_.GetFid(gid) == fid_) ? InnerVertexGid2Vertex(gid, v) + : OuterVertexGid2Vertex(gid, v); + } + + vid_t Vertex2Gid(const vertex_t& v) const { + return IsInnerVertex(v) ? GetInnerVertexGid(v) : GetOuterVertexGid(v); + } + + inline vid_t GetInnerVerticesNum(label_id_t label_id) const { + return ivnums_[label_id]; + } + + inline vid_t GetOuterVerticesNum(label_id_t label_id) const { + return ovnums_[label_id]; + } + + inline bool IsInnerVertex(const vertex_t& v) const { + return vid_parser_.GetOffset(v.GetValue()) < + static_cast(ivnums_[vid_parser_.GetLabelId(v.GetValue())]); + } + + inline bool IsOuterVertex(const vertex_t& v) const { + vid_t offset = vid_parser_.GetOffset(v.GetValue()); + label_id_t label = vid_parser_.GetLabelId(v.GetValue()); + return offset < tvnums_[label] && offset >= ivnums_[label]; + } + + bool GetInnerVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { + vid_t gid; + if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { + if (vid_parser_.GetFid(gid) == fid_) { + v.SetValue(vid_parser_.GetLid(gid)); + return true; + } + } + return false; + } + + bool GetOuterVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { + vid_t gid; + if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { + return OuterVertexGid2Vertex(gid, v); + } + return false; + } + + inline oid_t GetInnerVertexId(const vertex_t& v) const { + return oid_t(GetInnerVertexInternalId(v)); + } + + inline internal_oid_t GetInnerVertexInternalId(const vertex_t& v) const { + internal_oid_t internal_oid; + vid_t gid = + vid_parser_.GenerateId(fid_, vid_parser_.GetLabelId(v.GetValue()), + vid_parser_.GetOffset(v.GetValue())); + CHECK(vm_ptr_->GetOid(gid, internal_oid)); + return internal_oid; + } + + inline oid_t GetOuterVertexId(const vertex_t& v) const { + return oid_t(GetOuterVertexInternalId(v)); + } + + inline internal_oid_t GetOuterVertexInternalId(const vertex_t& v) const { + vid_t gid = GetOuterVertexGid(v); + internal_oid_t internal_oid; + CHECK(vm_ptr_->GetOid(gid, internal_oid)); + return internal_oid; + } + + inline oid_t Gid2Oid(const vid_t& gid) const { + internal_oid_t internal_oid; + CHECK(vm_ptr_->GetOid(gid, internal_oid)); + return oid_t(internal_oid); + } + + inline bool Oid2Gid(label_id_t label, const oid_t& oid, vid_t& gid) const { + return vm_ptr_->GetGid(label, internal_oid_t(oid), gid); + } + + inline bool Oid2Gid(label_id_t label, const oid_t& oid, vertex_t& v) const { + vid_t gid; + if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { + v.SetValue(gid); + return true; + } + return false; + } + + inline bool InnerVertexGid2Vertex(const vid_t& gid, vertex_t& v) const { + v.SetValue(vid_parser_.GetLid(gid)); + return true; + } + + inline bool OuterVertexGid2Vertex(const vid_t& gid, vertex_t& v) const { + auto map = ovg2l_maps_ptr_[vid_parser_.GetLabelId(gid)]; + auto iter = map->find(gid); + if (iter != map->end()) { + v.SetValue(iter->second); + return true; + } else { + return false; + } + } + + inline vid_t GetOuterVertexGid(const vertex_t& v) const { + label_id_t v_label = vid_parser_.GetLabelId(v.GetValue()); + return ovgid_lists_ptr_[v_label][vid_parser_.GetOffset(v.GetValue()) - + static_cast(ivnums_[v_label])]; + } + inline vid_t GetInnerVertexGid(const vertex_t& v) const { + return vid_parser_.GenerateId(fid_, vid_parser_.GetLabelId(v.GetValue()), + vid_parser_.GetOffset(v.GetValue())); + } + + inline adj_list_t GetIncomingAdjList(const vertex_t& v, label_id_t e_label) + const { + // grin vertexlist continous_vid_trait get_vertex_from_vid ++++ + vid_t vid = v.GetValue(); + label_id_t v_label = vid_parser_.GetLabelId(vid); + int64_t v_offset = vid_parser_.GetOffset(vid); + const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; + const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; + return adj_list_t(&ie[offset_array[v_offset]], + &ie[offset_array[v_offset + 1]], + flatten_edge_tables_columns_[e_label]); + } + + inline raw_adj_list_t GetIncomingRawAdjList(const vertex_t& v, + label_id_t e_label) const { + vid_t vid = v.GetValue(); + label_id_t v_label = vid_parser_.GetLabelId(vid); + int64_t v_offset = vid_parser_.GetOffset(vid); + const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; + const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; + return raw_adj_list_t(&ie[offset_array[v_offset]], + &ie[offset_array[v_offset + 1]]); + } + + inline adj_list_t GetOutgoingAdjList(const vertex_t& v, label_id_t e_label) + const { + vid_t vid = v.GetValue(); + label_id_t v_label = vid_parser_.GetLabelId(vid); + int64_t v_offset = vid_parser_.GetOffset(vid); + const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; + const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; + return adj_list_t(&oe[offset_array[v_offset]], + &oe[offset_array[v_offset + 1]], + flatten_edge_tables_columns_[e_label]); + } + + inline raw_adj_list_t GetOutgoingRawAdjList(const vertex_t& v, + label_id_t e_label) const { + vid_t vid = v.GetValue(); + label_id_t v_label = vid_parser_.GetLabelId(vid); + int64_t v_offset = vid_parser_.GetOffset(vid); + const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; + const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; + return raw_adj_list_t(&oe[offset_array[v_offset]], + &oe[offset_array[v_offset + 1]]); + } + + /** + * N.B.: as an temporary solution, for POC of graph-learn, will be removed + * later. + */ + + inline const int64_t* GetIncomingOffsetArray(label_id_t v_label, + label_id_t e_label) const { + return ie_offsets_ptr_lists_[v_label][e_label]; + } + + inline const int64_t* GetOutgoingOffsetArray(label_id_t v_label, + label_id_t e_label) const { + return oe_offsets_ptr_lists_[v_label][e_label]; + } + + inline int64_t GetIncomingOffsetLength(label_id_t v_label, label_id_t e_label) + const { + return ie_offsets_lists_[v_label][e_label]->length(); + } + + inline int64_t GetOutgoingOffsetLength(label_id_t v_label, label_id_t e_label) + const { + return oe_offsets_lists_[v_label][e_label]->length(); + } + + inline std::pair GetOutgoingAdjOffsets( + const vertex_t& v, label_id_t e_label) const { + vid_t vid = v.GetValue(); + label_id_t v_label = vid_parser_.GetLabelId(vid); + int64_t v_offset = vid_parser_.GetOffset(vid); + const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; + return std::make_pair(offset_array[v_offset], offset_array[v_offset + 1]); + } + + inline grape::DestList IEDests(const vertex_t& v, label_id_t e_label) const { + int64_t offset = vid_parser_.GetOffset(v.GetValue()); + auto v_label = vertex_label(v); + + return grape::DestList(idoffset_[v_label][e_label][offset], + idoffset_[v_label][e_label][offset + 1]); + } + + inline grape::DestList OEDests(const vertex_t& v, label_id_t e_label) const { + int64_t offset = vid_parser_.GetOffset(v.GetValue()); + auto v_label = vertex_label(v); + + return grape::DestList(odoffset_[v_label][e_label][offset], + odoffset_[v_label][e_label][offset + 1]); + } + + inline grape::DestList IOEDests(const vertex_t& v, label_id_t e_label) const { + int64_t offset = vid_parser_.GetOffset(v.GetValue()); + auto v_label = vertex_label(v); + + return grape::DestList(iodoffset_[v_label][e_label][offset], + iodoffset_[v_label][e_label][offset + 1]); + } + + std::shared_ptr GetVertexMap() { return vm_ptr_; } + + const PropertyGraphSchema& schema() const override { return schema_; } + + void PrepareToRunApp(const grape::CommSpec& comm_spec, + grape::PrepareConf conf); +/* mutable functions are not supported in grin 0.1 + boost::leaf::result AddVerticesAndEdges( + Client & client, + std::map> && vertex_tables_map, + std::map> && edge_tables_map, + ObjectID vm_id, + const std::vector>>& + edge_relations, + int concurrency); + + boost::leaf::result AddVertices( + Client & client, + std::map> && vertex_tables_map, + ObjectID vm_id); + + boost::leaf::result AddEdges( + Client & client, + std::map> && edge_tables_map, + const std::vector>>& + edge_relations, + int concurrency); + + /// Add a set of new vertex labels and a set of new edge labels to graph. + /// Vertex label id started from vertex_label_num_, and edge label id + /// started from edge_label_num_. + boost::leaf::result AddNewVertexEdgeLabels( + Client & client, + std::vector> && vertex_tables, + std::vector> && edge_tables, ObjectID vm_id, + const std::vector>>& + edge_relations, + int concurrency); + + /// Add a set of new vertex labels to graph. Vertex label id started from + /// vertex_label_num_. + boost::leaf::result AddNewVertexLabels( + Client & client, + std::vector> && vertex_tables, + ObjectID vm_id); + + /// Add a set of new edge labels to graph. Edge label id started from + /// edge_label_num_. + boost::leaf::result AddNewEdgeLabels( + Client & client, + std::vector> && edge_tables, + const std::vector>>& + edge_relations, + int concurrency); + + boost::leaf::result AddVertexColumns( + vineyard::Client & client, + const std::map< + label_id_t, + std::vector>>> + columns, + bool replace = false) override; + + boost::leaf::result AddVertexColumns( + vineyard::Client & client, + const std::map>>> + columns, + bool replace = false) override; + + template + boost::leaf::result AddVertexColumnsImpl( + vineyard::Client & client, + const std::map< + label_id_t, + std::vector>>> + columns, + bool replace = false); + + boost::leaf::result AddEdgeColumns( + vineyard::Client & client, + const std::map< + label_id_t, + std::vector>>> + columns, + bool replace = false) override; + + boost::leaf::result AddEdgeColumns( + vineyard::Client & client, + const std::map>>> + columns, + bool replace = false) override; + + template + boost::leaf::result AddEdgeColumnsImpl( + vineyard::Client & client, + const std::map< + label_id_t, + std::vector>>> + columns, + bool replace = false); + + boost::leaf::result Project( + vineyard::Client & client, + std::map> vertices, + std::map> edges); + + boost::leaf::result TransformDirection( + vineyard::Client & client, int concurrency); + + boost::leaf::result ConsolidateVertexColumns( + vineyard::Client & client, const label_id_t vlabel, + std::vector const& prop_names, + std::string const& consolidate_name); + + boost::leaf::result ConsolidateVertexColumns( + vineyard::Client & client, const label_id_t vlabel, + std::vector const& props, std::string const& consolidate_name); + + boost::leaf::result ConsolidateEdgeColumns( + vineyard::Client & client, const label_id_t elabel, + std::vector const& prop_names, + std::string const& consolidate_name); + + boost::leaf::result ConsolidateEdgeColumns( + vineyard::Client & client, const label_id_t elabel, + std::vector const& props, std::string const& consolidate_name); +*/ + // we support projection by providing a "view" graph + void* Project( + vineyard::Client & client, + std::map> vertices, + std::map> edges); + // use grin property "select" + private: + void initPointers(); + + void initDestFidList( + bool in_edge, bool out_edge, + std::vector>>& fid_lists, + std::vector>>& fid_lists_offset); + + void directedCSR2Undirected( + vineyard::Client & client, + std::vector>>> & + oe_lists, + std::vector>> & + oe_offsets_lists, + int concurrency, bool& is_multigraph); + + __attribute__((annotate("shared"))) fid_t fid_, fnum_; + __attribute__((annotate("shared"))) bool directed_; + __attribute__((annotate("shared"))) bool is_multigraph_; + __attribute__((annotate("shared"))) property_graph_types::LABEL_ID_TYPE vertex_label_num_; + __attribute__((annotate("shared"))) property_graph_types::LABEL_ID_TYPE edge_label_num_; + size_t oenum_, ienum_; // FIXME: should be pre-computable + + __attribute__((annotate("shared"))) String oid_type, vid_type; + + __attribute__((annotate("shared"))) vineyard::Array ivnums_, ovnums_, tvnums_; + + __attribute__((annotate("shared"))) List> vertex_tables_; + std::vector> vertex_tables_columns_; + + __attribute__((annotate("shared"))) List> ovgid_lists_; + std::vector ovgid_lists_ptr_; + + __attribute__((annotate("shared"))) List>> ovg2l_maps_; + std::vector*> ovg2l_maps_ptr_; + + __attribute__((annotate("shared"))) List> edge_tables_; + std::vector> edge_tables_columns_; + std::vector flatten_edge_tables_columns_; + + __attribute__((annotate("shared"))) List>> ie_lists_, + oe_lists_; + std::vector> ie_ptr_lists_, oe_ptr_lists_; + __attribute__((annotate("shared"))) List>> ie_offsets_lists_, + oe_offsets_lists_; + std::vector> ie_offsets_ptr_lists_, + oe_offsets_ptr_lists_; + + std::vector>> idst_, odst_, iodst_; + std::vector>> idoffset_, odoffset_, + iodoffset_; + + __attribute__((annotate("shared"))) std::shared_ptr vm_ptr_; + + vineyard::IdParser vid_parser_; + + __attribute__((annotate("shared"))) json schema_json_; + PropertyGraphSchema schema_; + + friend class ArrowFragmentBaseBuilder; + + template + friend class gs::ArrowProjectedFragment; +}; + +} // namespace vineyard + +#endif // MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_MOD_H_ + +// vim: syntax=cpp + +namespace vineyard { + +template::type, VID_T>> +class ArrowFragmentBaseBuilder: public ObjectBuilder { + public: + // using oid_t + using oid_t = OID_T; + // using vid_t + using vid_t = VID_T; + // using internal_oid_t + using internal_oid_t = typename InternalType::type; + // using eid_t + using eid_t = property_graph_types::EID_TYPE; + // using prop_id_t + using prop_id_t = property_graph_types::PROP_ID_TYPE; + // using label_id_t + using label_id_t = property_graph_types::LABEL_ID_TYPE; + // using vertex_range_t + using vertex_range_t = grape::VertexRange; + // using inner_vertices_t + using inner_vertices_t = vertex_range_t; + // using outer_vertices_t + using outer_vertices_t = vertex_range_t; + // using vertices_t + using vertices_t = vertex_range_t; + // using nbr_t + using nbr_t = property_graph_utils::Nbr; + // using nbr_unit_t + using nbr_unit_t = property_graph_utils::NbrUnit; + // using adj_list_t + using adj_list_t = property_graph_utils::AdjList; + // using raw_adj_list_t + using raw_adj_list_t = property_graph_utils::RawAdjList; + // using vertex_map_t + using vertex_map_t = VERTEX_MAP_T; + // using vertex_t + using vertex_t = grape::Vertex; + // using ovg2l_map_t + using ovg2l_map_t = + ska::flat_hash_map::KeyHash>; + // using vid_array_t + using vid_array_t = ArrowArrayType; + // using vid_vineyard_array_t + using vid_vineyard_array_t = ArrowVineyardArrayType; + // using vid_vineyard_builder_t + using vid_vineyard_builder_t = ArrowVineyardBuilderType; + // using eid_array_t + using eid_array_t = ArrowArrayType; + // using eid_vineyard_array_t + using eid_vineyard_array_t = ArrowVineyardArrayType; + // using eid_vineyard_builder_t + using eid_vineyard_builder_t = ArrowVineyardBuilderType; + // using vid_builder_t + using vid_builder_t = ArrowBuilderType; + + explicit ArrowFragmentBaseBuilder(Client &client) {} + + explicit ArrowFragmentBaseBuilder( + ArrowFragment const &__value) { + this->set_fid_(__value.fid_); + this->set_fnum_(__value.fnum_); + this->set_directed_(__value.directed_); + this->set_is_multigraph_(__value.is_multigraph_); + this->set_vertex_label_num_(__value.vertex_label_num_); + this->set_edge_label_num_(__value.edge_label_num_); + this->set_oid_type(__value.oid_type); + this->set_vid_type(__value.vid_type); + this->set_ivnums_( + std::make_shared::type>( + __value.ivnums_)); + this->set_ovnums_( + std::make_shared::type>( + __value.ovnums_)); + this->set_tvnums_( + std::make_shared::type>( + __value.tvnums_)); + for (auto const &__vertex_tables__item: __value.vertex_tables_) { + this->add_vertex_tables_(__vertex_tables__item); + } + for (auto const &__ovgid_lists__item: __value.ovgid_lists_) { + this->add_ovgid_lists_(__ovgid_lists__item); + } + for (auto const &__ovg2l_maps__item: __value.ovg2l_maps_) { + this->add_ovg2l_maps_(__ovg2l_maps__item); + } + for (auto const &__edge_tables__item: __value.edge_tables_) { + this->add_edge_tables_(__edge_tables__item); + } + this->ie_lists_.resize(__value.ie_lists_.size()); + for (size_t __idx = 0; __idx < __value.ie_lists_.size(); ++__idx) { + this->ie_lists_[__idx].resize(__value.ie_lists_[__idx].size()); + for (size_t __idy = 0; __idy < __value.ie_lists_[__idx].size(); ++__idy) { + this->ie_lists_[__idx][__idy] = __value.ie_lists_[__idx][__idy]; + } + } + this->oe_lists_.resize(__value.oe_lists_.size()); + for (size_t __idx = 0; __idx < __value.oe_lists_.size(); ++__idx) { + this->oe_lists_[__idx].resize(__value.oe_lists_[__idx].size()); + for (size_t __idy = 0; __idy < __value.oe_lists_[__idx].size(); ++__idy) { + this->oe_lists_[__idx][__idy] = __value.oe_lists_[__idx][__idy]; + } + } + this->ie_offsets_lists_.resize(__value.ie_offsets_lists_.size()); + for (size_t __idx = 0; __idx < __value.ie_offsets_lists_.size(); ++__idx) { + this->ie_offsets_lists_[__idx].resize(__value.ie_offsets_lists_[__idx].size()); + for (size_t __idy = 0; __idy < __value.ie_offsets_lists_[__idx].size(); ++__idy) { + this->ie_offsets_lists_[__idx][__idy] = __value.ie_offsets_lists_[__idx][__idy]; + } + } + this->oe_offsets_lists_.resize(__value.oe_offsets_lists_.size()); + for (size_t __idx = 0; __idx < __value.oe_offsets_lists_.size(); ++__idx) { + this->oe_offsets_lists_[__idx].resize(__value.oe_offsets_lists_[__idx].size()); + for (size_t __idy = 0; __idy < __value.oe_offsets_lists_[__idx].size(); ++__idy) { + this->oe_offsets_lists_[__idx][__idy] = __value.oe_offsets_lists_[__idx][__idy]; + } + } + this->set_vm_ptr_(__value.vm_ptr_); + this->set_schema_json_(__value.schema_json_); + } + + explicit ArrowFragmentBaseBuilder( + std::shared_ptr> const & __value): + ArrowFragmentBaseBuilder(*__value) { + } + + ObjectMeta &ValueMetaRef(std::shared_ptr> &__value) { + return __value->meta_; + } + + std::shared_ptr _Seal(Client &client) override { + // ensure the builder hasn't been sealed yet. + ENSURE_NOT_SEALED(this); + + VINEYARD_CHECK_OK(this->Build(client)); + auto __value = std::make_shared>(); + + return this->_Seal(client, __value); + } + + std::shared_ptr _Seal(Client &client, std::shared_ptr> &__value) { + size_t __value_nbytes = 0; + + __value->meta_.SetTypeName(type_name>()); + if (std::is_base_of>::value) { + __value->meta_.SetGlobal(true); + } + + __value->fid_ = fid_; + __value->meta_.AddKeyValue("fid_", __value->fid_); + + __value->fnum_ = fnum_; + __value->meta_.AddKeyValue("fnum_", __value->fnum_); + + __value->directed_ = directed_; + __value->meta_.AddKeyValue("directed_", __value->directed_); + + __value->is_multigraph_ = is_multigraph_; + __value->meta_.AddKeyValue("is_multigraph_", __value->is_multigraph_); + + __value->vertex_label_num_ = vertex_label_num_; + __value->meta_.AddKeyValue("vertex_label_num_", __value->vertex_label_num_); + + __value->edge_label_num_ = edge_label_num_; + __value->meta_.AddKeyValue("edge_label_num_", __value->edge_label_num_); + + __value->oid_type = oid_type; + __value->meta_.AddKeyValue("oid_type", __value->oid_type); + + __value->vid_type = vid_type; + __value->meta_.AddKeyValue("vid_type", __value->vid_type); + + // using __ivnums__value_type = typename vineyard::Array; + using __ivnums__value_type = decltype(__value->ivnums_); + auto __value_ivnums_ = std::dynamic_pointer_cast<__ivnums__value_type>( + ivnums_->_Seal(client)); + __value->ivnums_ = *__value_ivnums_; + __value->meta_.AddMember("ivnums_", __value->ivnums_); + __value_nbytes += __value_ivnums_->nbytes(); + + // using __ovnums__value_type = typename vineyard::Array; + using __ovnums__value_type = decltype(__value->ovnums_); + auto __value_ovnums_ = std::dynamic_pointer_cast<__ovnums__value_type>( + ovnums_->_Seal(client)); + __value->ovnums_ = *__value_ovnums_; + __value->meta_.AddMember("ovnums_", __value->ovnums_); + __value_nbytes += __value_ovnums_->nbytes(); + + // using __tvnums__value_type = typename vineyard::Array; + using __tvnums__value_type = decltype(__value->tvnums_); + auto __value_tvnums_ = std::dynamic_pointer_cast<__tvnums__value_type>( + tvnums_->_Seal(client)); + __value->tvnums_ = *__value_tvnums_; + __value->meta_.AddMember("tvnums_", __value->tvnums_); + __value_nbytes += __value_tvnums_->nbytes(); + + // using __vertex_tables__value_type = typename List>::value_type::element_type; + using __vertex_tables__value_type = typename decltype(__value->vertex_tables_)::value_type::element_type; + + size_t __vertex_tables__idx = 0; + for (auto &__vertex_tables__value: vertex_tables_) { + auto __value_vertex_tables_ = std::dynamic_pointer_cast<__vertex_tables__value_type>( + __vertex_tables__value->_Seal(client)); + __value->vertex_tables_.emplace_back(__value_vertex_tables_); + __value->meta_.AddMember("__vertex_tables_-" + std::to_string(__vertex_tables__idx), + __value_vertex_tables_); + __value_nbytes += __value_vertex_tables_->nbytes(); + __vertex_tables__idx += 1; + } + __value->meta_.AddKeyValue("__vertex_tables_-size", __value->vertex_tables_.size()); + + // using __ovgid_lists__value_type = typename List>::value_type::element_type; + using __ovgid_lists__value_type = typename decltype(__value->ovgid_lists_)::value_type::element_type; + + size_t __ovgid_lists__idx = 0; + for (auto &__ovgid_lists__value: ovgid_lists_) { + auto __value_ovgid_lists_ = std::dynamic_pointer_cast<__ovgid_lists__value_type>( + __ovgid_lists__value->_Seal(client)); + __value->ovgid_lists_.emplace_back(__value_ovgid_lists_); + __value->meta_.AddMember("__ovgid_lists_-" + std::to_string(__ovgid_lists__idx), + __value_ovgid_lists_); + __value_nbytes += __value_ovgid_lists_->nbytes(); + __ovgid_lists__idx += 1; + } + __value->meta_.AddKeyValue("__ovgid_lists_-size", __value->ovgid_lists_.size()); + + // using __ovg2l_maps__value_type = typename List>>::value_type::element_type; + using __ovg2l_maps__value_type = typename decltype(__value->ovg2l_maps_)::value_type::element_type; + + size_t __ovg2l_maps__idx = 0; + for (auto &__ovg2l_maps__value: ovg2l_maps_) { + auto __value_ovg2l_maps_ = std::dynamic_pointer_cast<__ovg2l_maps__value_type>( + __ovg2l_maps__value->_Seal(client)); + __value->ovg2l_maps_.emplace_back(__value_ovg2l_maps_); + __value->meta_.AddMember("__ovg2l_maps_-" + std::to_string(__ovg2l_maps__idx), + __value_ovg2l_maps_); + __value_nbytes += __value_ovg2l_maps_->nbytes(); + __ovg2l_maps__idx += 1; + } + __value->meta_.AddKeyValue("__ovg2l_maps_-size", __value->ovg2l_maps_.size()); + + // using __edge_tables__value_type = typename List>::value_type::element_type; + using __edge_tables__value_type = typename decltype(__value->edge_tables_)::value_type::element_type; + + size_t __edge_tables__idx = 0; + for (auto &__edge_tables__value: edge_tables_) { + auto __value_edge_tables_ = std::dynamic_pointer_cast<__edge_tables__value_type>( + __edge_tables__value->_Seal(client)); + __value->edge_tables_.emplace_back(__value_edge_tables_); + __value->meta_.AddMember("__edge_tables_-" + std::to_string(__edge_tables__idx), + __value_edge_tables_); + __value_nbytes += __value_edge_tables_->nbytes(); + __edge_tables__idx += 1; + } + __value->meta_.AddKeyValue("__edge_tables_-size", __value->edge_tables_.size()); + + // using __ie_lists__value_type = typename List>>::value_type::value_type::element_type; + using __ie_lists__value_type = typename decltype(__value->ie_lists_)::value_type::value_type::element_type; + + size_t __ie_lists__idx = 0; + __value->ie_lists_.resize(ie_lists_.size()); + for (auto &__ie_lists__value_vec: ie_lists_) { + size_t __ie_lists__idy = 0; + __value->meta_.AddKeyValue("__ie_lists_-" + std::to_string(__ie_lists__idx) + "-size", __ie_lists__value_vec.size()); + for (auto &__ie_lists__value: __ie_lists__value_vec) { + auto __value_ie_lists_ = std::dynamic_pointer_cast<__ie_lists__value_type>( + __ie_lists__value->_Seal(client)); + __value->ie_lists_[__ie_lists__idx].emplace_back(__value_ie_lists_); + __value->meta_.AddMember("__ie_lists_-" + std::to_string(__ie_lists__idx) + "-" + std::to_string(__ie_lists__idy), + __value_ie_lists_); + __value_nbytes += __value_ie_lists_->nbytes(); + __ie_lists__idy += 1; + } + __ie_lists__idx += 1; + } + __value->meta_.AddKeyValue("__ie_lists_-size", __value->ie_lists_.size()); + + // using __oe_lists__value_type = typename List>>::value_type::value_type::element_type; + using __oe_lists__value_type = typename decltype(__value->oe_lists_)::value_type::value_type::element_type; + + size_t __oe_lists__idx = 0; + __value->oe_lists_.resize(oe_lists_.size()); + for (auto &__oe_lists__value_vec: oe_lists_) { + size_t __oe_lists__idy = 0; + __value->meta_.AddKeyValue("__oe_lists_-" + std::to_string(__oe_lists__idx) + "-size", __oe_lists__value_vec.size()); + for (auto &__oe_lists__value: __oe_lists__value_vec) { + auto __value_oe_lists_ = std::dynamic_pointer_cast<__oe_lists__value_type>( + __oe_lists__value->_Seal(client)); + __value->oe_lists_[__oe_lists__idx].emplace_back(__value_oe_lists_); + __value->meta_.AddMember("__oe_lists_-" + std::to_string(__oe_lists__idx) + "-" + std::to_string(__oe_lists__idy), + __value_oe_lists_); + __value_nbytes += __value_oe_lists_->nbytes(); + __oe_lists__idy += 1; + } + __oe_lists__idx += 1; + } + __value->meta_.AddKeyValue("__oe_lists_-size", __value->oe_lists_.size()); + + // using __ie_offsets_lists__value_type = typename List>>::value_type::value_type::element_type; + using __ie_offsets_lists__value_type = typename decltype(__value->ie_offsets_lists_)::value_type::value_type::element_type; + + size_t __ie_offsets_lists__idx = 0; + __value->ie_offsets_lists_.resize(ie_offsets_lists_.size()); + for (auto &__ie_offsets_lists__value_vec: ie_offsets_lists_) { + size_t __ie_offsets_lists__idy = 0; + __value->meta_.AddKeyValue("__ie_offsets_lists_-" + std::to_string(__ie_offsets_lists__idx) + "-size", __ie_offsets_lists__value_vec.size()); + for (auto &__ie_offsets_lists__value: __ie_offsets_lists__value_vec) { + auto __value_ie_offsets_lists_ = std::dynamic_pointer_cast<__ie_offsets_lists__value_type>( + __ie_offsets_lists__value->_Seal(client)); + __value->ie_offsets_lists_[__ie_offsets_lists__idx].emplace_back(__value_ie_offsets_lists_); + __value->meta_.AddMember("__ie_offsets_lists_-" + std::to_string(__ie_offsets_lists__idx) + "-" + std::to_string(__ie_offsets_lists__idy), + __value_ie_offsets_lists_); + __value_nbytes += __value_ie_offsets_lists_->nbytes(); + __ie_offsets_lists__idy += 1; + } + __ie_offsets_lists__idx += 1; + } + __value->meta_.AddKeyValue("__ie_offsets_lists_-size", __value->ie_offsets_lists_.size()); + + // using __oe_offsets_lists__value_type = typename List>>::value_type::value_type::element_type; + using __oe_offsets_lists__value_type = typename decltype(__value->oe_offsets_lists_)::value_type::value_type::element_type; + + size_t __oe_offsets_lists__idx = 0; + __value->oe_offsets_lists_.resize(oe_offsets_lists_.size()); + for (auto &__oe_offsets_lists__value_vec: oe_offsets_lists_) { + size_t __oe_offsets_lists__idy = 0; + __value->meta_.AddKeyValue("__oe_offsets_lists_-" + std::to_string(__oe_offsets_lists__idx) + "-size", __oe_offsets_lists__value_vec.size()); + for (auto &__oe_offsets_lists__value: __oe_offsets_lists__value_vec) { + auto __value_oe_offsets_lists_ = std::dynamic_pointer_cast<__oe_offsets_lists__value_type>( + __oe_offsets_lists__value->_Seal(client)); + __value->oe_offsets_lists_[__oe_offsets_lists__idx].emplace_back(__value_oe_offsets_lists_); + __value->meta_.AddMember("__oe_offsets_lists_-" + std::to_string(__oe_offsets_lists__idx) + "-" + std::to_string(__oe_offsets_lists__idy), + __value_oe_offsets_lists_); + __value_nbytes += __value_oe_offsets_lists_->nbytes(); + __oe_offsets_lists__idy += 1; + } + __oe_offsets_lists__idx += 1; + } + __value->meta_.AddKeyValue("__oe_offsets_lists_-size", __value->oe_offsets_lists_.size()); + + // using __vm_ptr__value_type = typename std::shared_ptr::element_type; + using __vm_ptr__value_type = typename decltype(__value->vm_ptr_)::element_type; + auto __value_vm_ptr_ = std::dynamic_pointer_cast<__vm_ptr__value_type>( + vm_ptr_->_Seal(client)); + __value->vm_ptr_ = __value_vm_ptr_; + __value->meta_.AddMember("vm_ptr_", __value->vm_ptr_); + __value_nbytes += __value_vm_ptr_->nbytes(); + + __value->schema_json_ = schema_json_; + __value->meta_.AddKeyValue("schema_json_", __value->schema_json_); + + __value->meta_.SetNBytes(__value_nbytes); + + VINEYARD_CHECK_OK(client.CreateMetaData(__value->meta_, __value->id_)); + + // mark the builder as sealed + this->set_sealed(true); + + + // run `PostConstruct` to return a valid object + __value->PostConstruct(__value->meta_); + + return std::static_pointer_cast(__value); + } + + Status Build(Client &client) override { + return Status::OK(); + } + + protected: + vineyard::fid_t fid_; + vineyard::fid_t fnum_; + bool directed_; + bool is_multigraph_; + property_graph_types::LABEL_ID_TYPE vertex_label_num_; + property_graph_types::LABEL_ID_TYPE edge_label_num_; + vineyard::String oid_type; + vineyard::String vid_type; + std::shared_ptr ivnums_; + std::shared_ptr ovnums_; + std::shared_ptr tvnums_; + std::vector> vertex_tables_; + std::vector> ovgid_lists_; + std::vector> ovg2l_maps_; + std::vector> edge_tables_; + std::vector>> ie_lists_; + std::vector>> oe_lists_; + std::vector>> ie_offsets_lists_; + std::vector>> oe_offsets_lists_; + std::shared_ptr vm_ptr_; + vineyard::json schema_json_; + + void set_fid_(vineyard::fid_t const &fid__) { + this->fid_ = fid__; + } + + void set_fnum_(vineyard::fid_t const &fnum__) { + this->fnum_ = fnum__; + } + + void set_directed_(bool const &directed__) { + this->directed_ = directed__; + } + + void set_is_multigraph_(bool const &is_multigraph__) { + this->is_multigraph_ = is_multigraph__; + } + + void set_vertex_label_num_(property_graph_types::LABEL_ID_TYPE const &vertex_label_num__) { + this->vertex_label_num_ = vertex_label_num__; + } + + void set_edge_label_num_(property_graph_types::LABEL_ID_TYPE const &edge_label_num__) { + this->edge_label_num_ = edge_label_num__; + } + + void set_oid_type(vineyard::String const &oid_type_) { + this->oid_type = oid_type_; + } + + void set_vid_type(vineyard::String const &vid_type_) { + this->vid_type = vid_type_; + } + + void set_ivnums_(std::shared_ptr const & ivnums__) { + this->ivnums_ = ivnums__; + } + + void set_ovnums_(std::shared_ptr const & ovnums__) { + this->ovnums_ = ovnums__; + } + + void set_tvnums_(std::shared_ptr const & tvnums__) { + this->tvnums_ = tvnums__; + } + + void set_vertex_tables_(std::vector> const &vertex_tables__) { + this->vertex_tables_ = vertex_tables__; + } + void set_vertex_tables_(size_t const idx, std::shared_ptr const &vertex_tables__) { + if (idx >= this->vertex_tables_.size()) { + this->vertex_tables_.resize(idx + 1); + } + this->vertex_tables_[idx] = vertex_tables__; + } + void add_vertex_tables_(std::shared_ptr const &vertex_tables__) { + this->vertex_tables_.emplace_back(vertex_tables__); + } + void remove_vertex_tables_(const size_t vertex_tables__index_) { + this->vertex_tables_.erase(this->vertex_tables_.begin() + vertex_tables__index_); + } + + void set_ovgid_lists_(std::vector> const &ovgid_lists__) { + this->ovgid_lists_ = ovgid_lists__; + } + void set_ovgid_lists_(size_t const idx, std::shared_ptr const &ovgid_lists__) { + if (idx >= this->ovgid_lists_.size()) { + this->ovgid_lists_.resize(idx + 1); + } + this->ovgid_lists_[idx] = ovgid_lists__; + } + void add_ovgid_lists_(std::shared_ptr const &ovgid_lists__) { + this->ovgid_lists_.emplace_back(ovgid_lists__); + } + void remove_ovgid_lists_(const size_t ovgid_lists__index_) { + this->ovgid_lists_.erase(this->ovgid_lists_.begin() + ovgid_lists__index_); + } + + void set_ovg2l_maps_(std::vector> const &ovg2l_maps__) { + this->ovg2l_maps_ = ovg2l_maps__; + } + void set_ovg2l_maps_(size_t const idx, std::shared_ptr const &ovg2l_maps__) { + if (idx >= this->ovg2l_maps_.size()) { + this->ovg2l_maps_.resize(idx + 1); + } + this->ovg2l_maps_[idx] = ovg2l_maps__; + } + void add_ovg2l_maps_(std::shared_ptr const &ovg2l_maps__) { + this->ovg2l_maps_.emplace_back(ovg2l_maps__); + } + void remove_ovg2l_maps_(const size_t ovg2l_maps__index_) { + this->ovg2l_maps_.erase(this->ovg2l_maps_.begin() + ovg2l_maps__index_); + } + + void set_edge_tables_(std::vector> const &edge_tables__) { + this->edge_tables_ = edge_tables__; + } + void set_edge_tables_(size_t const idx, std::shared_ptr const &edge_tables__) { + if (idx >= this->edge_tables_.size()) { + this->edge_tables_.resize(idx + 1); + } + this->edge_tables_[idx] = edge_tables__; + } + void add_edge_tables_(std::shared_ptr const &edge_tables__) { + this->edge_tables_.emplace_back(edge_tables__); + } + void remove_edge_tables_(const size_t edge_tables__index_) { + this->edge_tables_.erase(this->edge_tables_.begin() + edge_tables__index_); + } + + void set_ie_lists_(std::vector>> const &ie_lists__) { + this->ie_lists_ = ie_lists__; + } + void set_ie_lists_(size_t const idx, std::vector> const &ie_lists__) { + if (idx >= this->ie_lists_.size()) { + this->ie_lists_.resize(idx + 1); + } + this->ie_lists_[idx] = ie_lists__; + } + void set_ie_lists_(size_t const idx, size_t const idy, + std::shared_ptr const &ie_lists__) { + if (idx >= this->ie_lists_.size()) { + this->ie_lists_.resize(idx + 1); + } + if (idy >= this->ie_lists_[idx].size()) { + this->ie_lists_[idx].resize(idy + 1); + } + this->ie_lists_[idx][idy] = ie_lists__; + } + void add_ie_lists_(std::vector> const &ie_lists__) { + this->ie_lists_.emplace_back(ie_lists__); + } + void remove_ie_lists_(const size_t ie_lists__index_) { + this->ie_lists_.erase(this->ie_lists_.begin() + ie_lists__index_); + } + void remove_ie_lists_(const size_t ie_lists__index_, const size_t ie_lists__inner_index_) { + auto &ie_lists__inner_ = this->ie_lists_[ie_lists__index_]; + ie_lists__inner_.erase(ie_lists__inner_.begin() + ie_lists__inner_index_); + } + + void set_oe_lists_(std::vector>> const &oe_lists__) { + this->oe_lists_ = oe_lists__; + } + void set_oe_lists_(size_t const idx, std::vector> const &oe_lists__) { + if (idx >= this->oe_lists_.size()) { + this->oe_lists_.resize(idx + 1); + } + this->oe_lists_[idx] = oe_lists__; + } + void set_oe_lists_(size_t const idx, size_t const idy, + std::shared_ptr const &oe_lists__) { + if (idx >= this->oe_lists_.size()) { + this->oe_lists_.resize(idx + 1); + } + if (idy >= this->oe_lists_[idx].size()) { + this->oe_lists_[idx].resize(idy + 1); + } + this->oe_lists_[idx][idy] = oe_lists__; + } + void add_oe_lists_(std::vector> const &oe_lists__) { + this->oe_lists_.emplace_back(oe_lists__); + } + void remove_oe_lists_(const size_t oe_lists__index_) { + this->oe_lists_.erase(this->oe_lists_.begin() + oe_lists__index_); + } + void remove_oe_lists_(const size_t oe_lists__index_, const size_t oe_lists__inner_index_) { + auto &oe_lists__inner_ = this->oe_lists_[oe_lists__index_]; + oe_lists__inner_.erase(oe_lists__inner_.begin() + oe_lists__inner_index_); + } + + void set_ie_offsets_lists_(std::vector>> const &ie_offsets_lists__) { + this->ie_offsets_lists_ = ie_offsets_lists__; + } + void set_ie_offsets_lists_(size_t const idx, std::vector> const &ie_offsets_lists__) { + if (idx >= this->ie_offsets_lists_.size()) { + this->ie_offsets_lists_.resize(idx + 1); + } + this->ie_offsets_lists_[idx] = ie_offsets_lists__; + } + void set_ie_offsets_lists_(size_t const idx, size_t const idy, + std::shared_ptr const &ie_offsets_lists__) { + if (idx >= this->ie_offsets_lists_.size()) { + this->ie_offsets_lists_.resize(idx + 1); + } + if (idy >= this->ie_offsets_lists_[idx].size()) { + this->ie_offsets_lists_[idx].resize(idy + 1); + } + this->ie_offsets_lists_[idx][idy] = ie_offsets_lists__; + } + void add_ie_offsets_lists_(std::vector> const &ie_offsets_lists__) { + this->ie_offsets_lists_.emplace_back(ie_offsets_lists__); + } + void remove_ie_offsets_lists_(const size_t ie_offsets_lists__index_) { + this->ie_offsets_lists_.erase(this->ie_offsets_lists_.begin() + ie_offsets_lists__index_); + } + void remove_ie_offsets_lists_(const size_t ie_offsets_lists__index_, const size_t ie_offsets_lists__inner_index_) { + auto &ie_offsets_lists__inner_ = this->ie_offsets_lists_[ie_offsets_lists__index_]; + ie_offsets_lists__inner_.erase(ie_offsets_lists__inner_.begin() + ie_offsets_lists__inner_index_); + } + + void set_oe_offsets_lists_(std::vector>> const &oe_offsets_lists__) { + this->oe_offsets_lists_ = oe_offsets_lists__; + } + void set_oe_offsets_lists_(size_t const idx, std::vector> const &oe_offsets_lists__) { + if (idx >= this->oe_offsets_lists_.size()) { + this->oe_offsets_lists_.resize(idx + 1); + } + this->oe_offsets_lists_[idx] = oe_offsets_lists__; + } + void set_oe_offsets_lists_(size_t const idx, size_t const idy, + std::shared_ptr const &oe_offsets_lists__) { + if (idx >= this->oe_offsets_lists_.size()) { + this->oe_offsets_lists_.resize(idx + 1); + } + if (idy >= this->oe_offsets_lists_[idx].size()) { + this->oe_offsets_lists_[idx].resize(idy + 1); + } + this->oe_offsets_lists_[idx][idy] = oe_offsets_lists__; + } + void add_oe_offsets_lists_(std::vector> const &oe_offsets_lists__) { + this->oe_offsets_lists_.emplace_back(oe_offsets_lists__); + } + void remove_oe_offsets_lists_(const size_t oe_offsets_lists__index_) { + this->oe_offsets_lists_.erase(this->oe_offsets_lists_.begin() + oe_offsets_lists__index_); + } + void remove_oe_offsets_lists_(const size_t oe_offsets_lists__index_, const size_t oe_offsets_lists__inner_index_) { + auto &oe_offsets_lists__inner_ = this->oe_offsets_lists_[oe_offsets_lists__index_]; + oe_offsets_lists__inner_.erase(oe_offsets_lists__inner_.begin() + oe_offsets_lists__inner_index_); + } + + void set_vm_ptr_(std::shared_ptr const & vm_ptr__) { + this->vm_ptr_ = vm_ptr__; + } + + void set_schema_json_(vineyard::json const &schema_json__) { + this->schema_json_ = schema_json__; + } + + private: + friend class ArrowFragment; +}; + + +} // namespace vineyard + + + +#endif // MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H diff --git a/modules/graph/fragment/graph_schema.grin.h b/modules/graph/fragment/graph_schema.grin.h new file mode 100644 index 000000000..d581f88f9 --- /dev/null +++ b/modules/graph/fragment/graph_schema.grin.h @@ -0,0 +1,251 @@ +/** Copyright 2020-2023 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#ifndef MODULES_GRAPH_FRAGMENT_GRAPH_SCHEMA_GRIN_H_ +#define MODULES_GRAPH_FRAGMENT_GRAPH_SCHEMA_GRIN_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "arrow/api.h" +#include "arrow/io/api.h" + +#include "common/util/json.h" +#include "graph/fragment/property_graph_types.h" +#include "graph/utils/error.h" + +namespace vineyard { + +class MaxGraphSchema; + +using PropertyType = std::shared_ptr; +class Entry { + // it seems entry is mostly for schema edition + // we will get rid of it + public: + using LabelId = int; + using PropertyId = int; + struct PropertyDef { + PropertyId id; + std::string name; + PropertyType type; + + json ToJSON() const; + void FromJSON(const json& root); + }; + LabelId id; + std::string label; + std::string type; + std::vector props_; + std::vector primary_keys; + std::vector> relations; + std::vector valid_properties; + + std::vector mapping; // old prop id -> new prop id + std::vector reverse_mapping; // new prop id -> old prop id + + void AddProperty(const std::string& name, PropertyType type); + void RemoveProperty(const std::string& name); + void RemoveProperty(const size_t index); + + void AddPrimaryKey(const std::string& key_name); + void AddPrimaryKeys(const std::vector& key_name_list); + void AddPrimaryKeys(size_t key_count, + const std::vector& key_name_list); + void AddRelation(const std::string& src, const std::string& dst); + + size_t property_num() const; + + std::vector properties() const; + + PropertyId GetPropertyId(const std::string& name) const; + PropertyType GetPropertyType(PropertyId prop_id) const; + std::string GetPropertyName(PropertyId prop_id) const; + + json ToJSON() const; + void FromJSON(const json& root); + + void InvalidateProperty(PropertyId id) { valid_properties[id] = 0; } +}; + +class PropertyGraphSchema { + public: + // try to get rid of labelId and propertyId + // also put get_vertex_id & get_vertex_by_id methods in continous_vid_trait + // same can be done for labelId and propertyId + using LabelId = int; + using PropertyId = int; + + PropertyGraphSchema() = default; + + explicit PropertyGraphSchema(json const& json) { FromJSON(json); } + + PropertyId GetVertexPropertyId(LabelId label_id, + const std::string& name) const; + // grin get property by name ++++ + PropertyType GetVertexPropertyType(LabelId label_id, + PropertyId prop_id) const; + // grin get property type + std::string GetVertexPropertyName(LabelId label_id, PropertyId prop_id) const; + // grin get property name + + PropertyId GetEdgePropertyId(LabelId label_id, const std::string& name) const; + PropertyType GetEdgePropertyType(LabelId label_id, PropertyId prop_id) const; + std::string GetEdgePropertyName(LabelId label_id, PropertyId prop_id) const; + // Ditto. + + LabelId GetVertexLabelId(const std::string& name) const; + // grin get vertex label by name + std::string GetVertexLabelName(LabelId label_id) const; + // grin get vertex label name + + LabelId GetEdgeLabelId(const std::string& name) const; + std::string GetEdgeLabelName(LabelId label_id) const; + // Ditto. + + /* try to get rid of entry + Entry* CreateEntry(const std::string& name, const std::string& type); + + void AddEntry(const Entry& entry); + + const Entry& GetEntry(LabelId label_id, const std::string& type) const; + + Entry& GetMutableEntry(const std::string& label, const std::string& type); + + Entry& GetMutableEntry(const LabelId label_id, const std::string& type); + */ + + json ToJSON() const; + void ToJSON(json& root) const; + //mutable void FromJSON(json const& root); + + std::string ToJSONString() const; + //mutable void FromJSONString(std::string const& schema); + + //mutable void set_fnum(size_t fnum) { fnum_ = fnum; } + size_t fnum() const { return fnum_; } + + //std::vector vertex_entries() const; + + //std::vector edge_entries() const; + + std::vector GetVertexLabels() const; + // grin vertex label list + // grin get vertex name + + std::vector GetEdgeLabels() const; + // Ditto. + + std::vector> GetVertexPropertyListByLabel( + const std::string& label) const; + // grin vertex property list + std::vector> GetVertexPropertyListByLabel( + LabelId label_id) const; + // grin vertex property list + + std::vector> GetEdgePropertyListByLabel( + const std::string& label) const; + std::vector> GetEdgePropertyListByLabel( + LabelId label_id) const; + //Ditto. + + //mutable bool Validate(std::string& message); + + const std::map& GetPropertyNameToIDMapping() const; + // get from grin and build + void DumpToFile(std::string const& path); + // similar + // mutable void InvalidateVertex(LabelId label_id) { valid_vertices_[label_id] = 0; } + + // mutable void InvalidateEdge(LabelId label_id) { valid_edges_[label_id] = 0; } + + size_t vertex_label_num() const { + // grin get_vertex_label_list_size + return std::accumulate(valid_vertices_.begin(), valid_vertices_.end(), 0); + } + + size_t edge_label_num() const { + // grin get_edge_label_list_size + return std::accumulate(valid_edges_.begin(), valid_edges_.end(), 0); + } + + // For internal use, get all vertex label number include invalid ones. + size_t all_vertex_label_num() const { return vertex_entries_.size(); } + // no diff since immutable + + // For internal use, get all edge label number include invalid ones. + size_t all_edge_label_num() const { return edge_entries_.size(); } + + friend MaxGraphSchema; + + private: + size_t fnum_; + std::vector vertex_entries_; + std::vector edge_entries_; + std::vector valid_vertices_; + std::vector valid_edges_; + std::map name_to_idx_; +}; + +/* transformation is currently out of the scope of grin +// In Analytical engine, assume label ids of vertex entries are continuous +// from zero, and property ids of each label is also continuous from zero. +// When transform schema to Maxgraph style, we gather all property names and +// unique them, assign each name a id (index of the vector), then preserve a +// vector for each label, stores mappings from original id to transformed +// id. +class MaxGraphSchema { + public: + using LabelId = int; + using PropertyId = int; + explicit MaxGraphSchema(const PropertyGraphSchema& schema); + PropertyId GetPropertyId(const std::string& name); + PropertyType GetPropertyType(LabelId label_id, PropertyId prop_id); + std::string GetPropertyName(PropertyId prop_id); + + LabelId GetLabelId(const std::string& name); + std::string GetLabelName(LabelId label_id); + + void set_fnum(size_t fnum) { fnum_ = fnum; } + + void AddEntry(const Entry& entry) { entries_.push_back(entry); } + + void ToJSON(json& root) const; + void FromJSON(json const& root); + + std::string ToJSONString() const; + void FromJSONString(std::string const& schema); + + size_t fnum() const { return fnum_; } + + void DumpToFile(std::string const& path); + + private: + size_t fnum_; + std::vector entries_; +}; +*/ + +} // namespace vineyard + +#endif // MODULES_GRAPH_FRAGMENT_GRAPH_SCHEMA_GRIN_H_ From 926b66215ed8bcbfe95b63306e2a26d6ed9004b9 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Mon, 13 Feb 2023 10:27:01 +0800 Subject: [PATCH 02/85] pre implement arrow fragment by grin apis --- grin/include/partition/partition.h | 7 + grin/include/predefine.h | 55 +- grin/include/propertygraph/label.h | 14 +- grin/include/propertygraph/property.h | 4 + grin/include/propertygraph/propertygraph.h | 6 + grin/include/topology/adjacentlist.h | 4 + grin/include/topology/structure.h | 15 +- grin/include/topology/vertexlist.h | 10 + grin/src/predefine.h | 139 ++ modules/graph/fragment/arrow_fragment.grin.h | 1430 ++++++------------ modules/graph/fragment/graph_schema.grin.h | 2 +- 11 files changed, 691 insertions(+), 995 deletions(-) create mode 100644 grin/src/predefine.h diff --git a/grin/include/partition/partition.h b/grin/include/partition/partition.h index 2e98aef80..a7f232872 100644 --- a/grin/include/partition/partition.h +++ b/grin/include/partition/partition.h @@ -70,6 +70,8 @@ Edge get_edge_from_deserialization(const PartitionedGraph, const Partition, // could be local in 1~n partitions. bool is_local_vertex(const PartitionedGraph, const Partition, Vertex); +bool is_remote_vertex(const PartitionedGraph, const Partition, Vertex); + // For local edge: could get its properties locally; // every edge could be local in 1/2/n partitions bool is_local_edge(const PartitionedGraph, const Partition, const Edge); @@ -128,6 +130,11 @@ VertexList get_local_vertices(const PartitionedGraph, const Partition); VertexList get_remote_vertices(const PartitionedGraph, const Partition); +#ifdef WITH_VERTEX_LABEL +VertexList get_local_vertices_by_label(const PartitionedGraph, const Partition, const VertexLabel); +VertexList get_remote_vertices_by_label(const PartitionedGraph, const Partition, const VertexLabel); +#endif + VertexList get_remote_vertices_by_partition(const PartitionedGraph, const RemotePartition); #endif diff --git a/grin/include/predefine.h b/grin/include/predefine.h index 865d620f4..46a1a9741 100644 --- a/grin/include/predefine.h +++ b/grin/include/predefine.h @@ -42,25 +42,29 @@ typedef enum { // The enum type for vertex/edge data type. typedef enum { - INT = 0, - LONG = 1, - UNSIGNED = 2, - UNSIGNED_LONG = 3, - FLOAT = 4, - DOUBLE = 5, - OTHER = 6, + Undefined = 0, + Int32 = 1, + UInt32 = 2, + Int64 = 3, + UInt64 = 4, + Float = 5, + Double = 6, + String = 7, + Date32 = 8, + Date64 = 9, } DataType; /* The following macros are defined as the features of the storage. */ // Note: mutable graph is currently NOT supported in grin-libgrape-lite // #define MUTABLE_GRAPH // Graph is mutable +#define WITH_VERTEX_ORIGIN_ID // There is origin id for vertex semantic #define WITH_VERTEX_DATA // There is data on vertex. #define WITH_EDGE_DATA // There is data on edge, e.g. weight. #define ENABLE_VERTEX_LIST // Enable the vertex list structure. #define CONTINUOUS_VID_TRAIT // Enable continous index on vertext list. #define ENABLE_ADJACENT_LIST // Enable the adjacent list structure. // Note: edge_list is only used in vertex_cut fragment -// #define ENABLE_EDGE_LIST // Enable the edge list structure. +#define ENABLE_EDGE_LIST // Enable the edge list structure. // The partition strategy. #define PARTITION_STRATEGY EDGE_CUT @@ -71,6 +75,16 @@ typedef enum { // The direction of edges on local vertices. #define EDGES_ON_LOCAL_VERTEX_DIRECTION BOTH +// propertygraph +#define WITH_VERTEX_LABEL +#define WITH_EDGE_LABEL +#define WITH_VERTEX_PROPERTY +#define WITH_EDGE_PROPERTY +#define COLUMN_STORE +#define CONTINIOUS_VERTEX_LABEL_ID_TRAIT +#define CONTINIOUS_EDGE_LABEL_ID_TRAIT + + /* The followings macros are defined as invalid value. */ #define NULL_TYPE NULL // Null type (null data type) #define NULL_GRAPH NULL // Null graph handle (invalid return value). @@ -90,6 +104,11 @@ typedef void* Graph; typedef void* Vertex; typedef void* VertexID; +// vertex origin id +#ifdef WITH_VERTEX_ORIGIN_ID +typedef void* OriginID; +#endif + // vertex data #ifdef WITH_VERTEX_DATA typedef void* VertexData; @@ -133,4 +152,24 @@ typedef RemoteVertex* RemoteVertexList; // remote edge typedef Edge RemoteEdge; +#ifdef WITH_VERTEX_LABEL +typedef void* VertexLabelID; +typedef void* VertexLabel; +typedef void* VertexLabelList; +#endif + +#ifdef WITH_EDGE_LABEL +typedef void* EdgeLabelID; +typedef void* EdgeLabel; +typedef void* EdgeLabelList; +#endif + +#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) +typedef void* PropertyID; +typedef void* Property; +typedef void* PropertyList; +typedef void* Row; +typedef void* RowList; +#endif + #endif // GRIN_INCLUDE_PREDEFINE_H_ diff --git a/grin/include/propertygraph/label.h b/grin/include/propertygraph/label.h index 830d6ee63..2fb56702a 100644 --- a/grin/include/propertygraph/label.h +++ b/grin/include/propertygraph/label.h @@ -15,7 +15,7 @@ limitations under the License. #ifndef GRIN_PROPERTY_GRAPH_LABEL_H_ #define GRIN_PROPERTY_GRAPH_LABEL_H_ -#include "grin/predefine.h" +#include "../predefine.h" #ifdef WITH_VERTEX_LABEL VertexLabelList get_vertex_labels(const Graph); @@ -33,6 +33,12 @@ bool insert_vertex_label_to_list(VertexLabelList, const VertexLabel); VertexLabel get_vertex_label(const Graph, const Vertex); char* get_vertex_label_name(const Graph, const VertexLabel); +#ifdef CONTINIOUS_VERTEX_LABEL_ID_TRAIT +VertexLabelID get_vertex_label_list_begin(const VertexLabelList); +VertexLabelID get_vertex_label_list_end(const VertexLabelList); +VertexLabelID get_vertex_label_id(const VertexLabel); +VertexLabel get_vertex_label_from_id(const VertexLabelID); +#endif #endif #ifdef WITH_EDGE_LABEL @@ -51,6 +57,12 @@ bool insert_edge_label_to_list(EdgeLabelList, const EdgeLabel); EdgeLabel get_edge_label(const Graph, const Edge); char* get_edge_label_name(const Graph, const EdgeLabel); +#ifdef CONTINIOUS_EDGE_LABEL_ID_TRAIT +EdgeLabelID get_edge_label_list_begin(const EdgeLabelList); +EdgeLabelID get_edge_label_list_end(const EdgeLabelList); +EdgeLabelID get_edge_label_id(const EdgeLabel); +EdgeLabel get_edge_label_from_id(const EdgeLabelID); +#endif #endif #if defined(WITH_VERTEX_LABEL) && defined(WITH_EDGE_LABEL) diff --git a/grin/include/propertygraph/property.h b/grin/include/propertygraph/property.h index 4d27b4810..c0008d5c4 100644 --- a/grin/include/propertygraph/property.h +++ b/grin/include/propertygraph/property.h @@ -20,6 +20,10 @@ limitations under the License. #if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) char* get_property_name(const Graph, const Property); +#ifdef WITH_PROPERTY_NAME +Property get_property_by_name(const Graph, char* name); +#endif + DataType get_property_type(const Graph, const Property); size_t get_property_list_size(const PropertyList); diff --git a/grin/include/propertygraph/propertygraph.h b/grin/include/propertygraph/propertygraph.h index 2337f08dd..5275e59b9 100644 --- a/grin/include/propertygraph/propertygraph.h +++ b/grin/include/propertygraph/propertygraph.h @@ -28,10 +28,16 @@ EdgeList get_edge_list_from_label(const Graph, const EdgeLabel); #if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) PropertyList get_all_vertex_properties_from_label(const Graph, const VertexLabel); +#ifdef CONTINIOUS_VERTEX_LABEL_ID_TRAIT +Property get_vertex_property_from_id(const VertexLabel, const PropertyID); +#endif #endif #if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) PropertyList get_all_edge_properties_from_label(const Graph, const EdgeLabel); +#ifdef CONTINIOUS_EDGE_LABEL_ID_TRAIT +Property get_edge_property_from_id(const VertexLabel, const PropertyID); +#endif #endif #if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) && \ diff --git a/grin/include/topology/adjacentlist.h b/grin/include/topology/adjacentlist.h index 965df6db0..36c29245b 100644 --- a/grin/include/topology/adjacentlist.h +++ b/grin/include/topology/adjacentlist.h @@ -22,6 +22,10 @@ limitations under the License. AdjacentList get_adjacent_list(const Graph, const Direction, Vertex); +#ifdef WITH_EDGE_LABEL +AdjacentList get_adjacent_list_by_edge_label(const Graph, const Direction, Vertex, EdgeLabel); +#endif + void destroy_adjacent_list(AdjacentList); AdjacentListIterator get_adjacent_list_begin(const AdjacentList); diff --git a/grin/include/topology/structure.h b/grin/include/topology/structure.h index 49ac8844d..0be7c9586 100644 --- a/grin/include/topology/structure.h +++ b/grin/include/topology/structure.h @@ -20,16 +20,14 @@ limitations under the License. bool is_directed(const Graph); +bool is_multigraph(const Graph); + size_t get_vertex_num(const Graph); size_t get_edge_num(const Graph); void destroy_vertex(Vertex); -DataType get_vertex_id_data_type(const Graph); - -VertexID get_vertex_id(const Vertex); - #ifdef WITH_VERTEX_DATA DataType get_vertex_data_type(const Graph, const Vertex); @@ -42,6 +40,15 @@ void set_vertex_data_value(Graph, Vertex, const VertexData); #endif #endif +#ifdef WITH_VERTEX_ORIGIN_ID +Vertex get_vertex_from_origin_id(const Graph, const OriginID); +OriginID get_vertex_origin_id(const Graph, const Vertex); + +#ifdef WITH_VERTEX_LABEL +Vertex get_vertex_from_label_origin_id(const Graph, const VertexLabel, const OriginID); +#endif +#endif + void destroy_edge(Edge); Vertex get_edge_src(const Graph, const Edge); diff --git a/grin/include/topology/vertexlist.h b/grin/include/topology/vertexlist.h index bd4940919..d5d7f2d94 100644 --- a/grin/include/topology/vertexlist.h +++ b/grin/include/topology/vertexlist.h @@ -22,6 +22,10 @@ limitations under the License. VertexList get_vertex_list(const Graph); +#ifdef WITH_VERTEX_LABEL +VertexList get_vertex_list_by_label(const Graph, const VertexLabel); +#endif + void destroy_vertex_list(Graph); size_t get_vertex_list_size(const VertexList); @@ -38,6 +42,12 @@ Vertex get_vertex_from_iter(const VertexList, const VertexListIterator); VertexID get_begin_vertex_id_from_list(const VertexList); VertexID get_end_vertex_id_from_list(const VertexList); + +DataType get_vertex_id_data_type(const Graph); + +VertexID get_vertex_id(const Vertex); + +Vertex get_vertex_from_id(const VertexID); #endif #ifdef MUTABLE_GRAPH diff --git a/grin/src/predefine.h b/grin/src/predefine.h new file mode 100644 index 000000000..8ac490e06 --- /dev/null +++ b/grin/src/predefine.h @@ -0,0 +1,139 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +#include "grin/include/predefine.h" +#include "grape/fragment/immutable_edgecut_fragment.h" + +#include "arrow/api.h" + + +#ifndef GRIN_SRC_PREDEFINE_H_ +#define GRIN_SRC_PREDEFINE_H_ + +template +struct DataTypeEnum { + static constexpr DataType value = DataType::Undefined; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Int32; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::UInt32; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Int64; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::UInt64; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Float; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Double; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::String; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Date32; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Date64; +}; + +std::string GetDataTypeName(DataType type) { + switch (type) { + case DataType::Int32: + return "int32"; + case DataType::UInt32: + return "uint32"; + case DataType::Int64: + return "int64"; + case DataType::UInt64: + return "uint64"; + case DataType::Float: + return "float"; + case DataType::Double: + return "double"; + case DataType::String: + return "string"; + case DataType::Date32: + return "date32"; + case DataType::Date64: + return "date64"; + default: + return "undefined"; + } +} + +/* The following data types shall be defined through typedef. */ +// local graph +typedef grape::ImmutableEdgecutFragment + Graph_T; + +// vertex +typedef Graph_T::vertex_t Vertex_T; +typedef Graph_T::vid_t VertexID_T; +typedef Graph_T::vdata_t VertexData_T; + +// vertex list +#ifdef ENABLE_VERTEX_LIST +typedef Graph_T::vertex_range_t VertexList_T; +typedef Graph_T::vid_t VertexListIterator_T; +#endif + +// indexed vertex list +#ifdef ENABLE_INDEXED_VERTEX_LIST +typedef Graph_T::vid_t VertexIndex_T; +#endif + +// adjacent list +#ifdef ENABLE_ADJACENT_LIST +typedef Graph_T::adj_list_t AdjacentList_T; +typedef Graph_T::nbr_t AdjacentListIterator_T; +#endif + +// edge +typedef Graph_T::edge_t Edge_T; +typedef Graph_T::edata_t EdgeData_T; + +// partitioned graph +typedef Graph_T PartitionedGraph_T; + +// remote vertex +typedef Vertex_T RemoteVertex_T; + +// remote edge +typedef Edge_T RemoteEdge_T; + +#endif // GRIN_SRC_PREDEFINE_H_ diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index 55435ddd3..a05a663ad 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -49,6 +49,17 @@ limitations under the License. #include "graph/vertex_map/arrow_local_vertex_map.h" #include "graph/vertex_map/arrow_vertex_map.h" +extern "C" { +#include "grin/include/topology/structure.h" +#include "grin/include/topology/vertexlist.h" +#include "grin/include/topology/edgelist.h" +#include "grin/include/topology/adjacentlist.h" +#include "grin/include/partition/partition.h" +#include "grin/include/propertygraph/label.h" +#include "grin/include/propertygraph/property.h" +#include "grin/include/propertygraph/propertygraph.h" +} + namespace gs { template > { - public: - static std::unique_ptr Create() __attribute__((used)) { - return std::static_pointer_cast( - std::unique_ptr>{ - new ArrowFragment()}); - } - - - public: - void Construct(const ObjectMeta& meta) override { - std::string __type_name = type_name>(); - VINEYARD_ASSERT( - meta.GetTypeName() == __type_name, - "Expect typename '" + __type_name + "', but got '" + meta.GetTypeName() + "'"); - this->meta_ = meta; - this->id_ = meta.GetId(); - - meta.GetKeyValue("fid_", this->fid_); - meta.GetKeyValue("fnum_", this->fnum_); - meta.GetKeyValue("directed_", this->directed_); - meta.GetKeyValue("is_multigraph_", this->is_multigraph_); - meta.GetKeyValue("vertex_label_num_", this->vertex_label_num_); - meta.GetKeyValue("edge_label_num_", this->edge_label_num_); - meta.GetKeyValue("oid_type", this->oid_type); - meta.GetKeyValue("vid_type", this->vid_type); - this->ivnums_.Construct(meta.GetMemberMeta("ivnums_")); - this->ovnums_.Construct(meta.GetMemberMeta("ovnums_")); - this->tvnums_.Construct(meta.GetMemberMeta("tvnums_")); - for (size_t __idx = 0; __idx < meta.GetKeyValue("__vertex_tables_-size"); ++__idx) { - this->vertex_tables_.emplace_back(std::dynamic_pointer_cast
( - meta.GetMember("__vertex_tables_-" + std::to_string(__idx)))); - } - for (size_t __idx = 0; __idx < meta.GetKeyValue("__ovgid_lists_-size"); ++__idx) { - this->ovgid_lists_.emplace_back(std::dynamic_pointer_cast( - meta.GetMember("__ovgid_lists_-" + std::to_string(__idx)))); - } - for (size_t __idx = 0; __idx < meta.GetKeyValue("__ovg2l_maps_-size"); ++__idx) { - this->ovg2l_maps_.emplace_back(std::dynamic_pointer_cast>( - meta.GetMember("__ovg2l_maps_-" + std::to_string(__idx)))); - } - for (size_t __idx = 0; __idx < meta.GetKeyValue("__edge_tables_-size"); ++__idx) { - this->edge_tables_.emplace_back(std::dynamic_pointer_cast
( - meta.GetMember("__edge_tables_-" + std::to_string(__idx)))); - } - this->ie_lists_.resize(meta.GetKeyValue("__ie_lists_-size")); - for (size_t __idx = 0; __idx < this->ie_lists_.size(); ++__idx) { - for (size_t __idy = 0; __idy < meta.GetKeyValue( - "__ie_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { - this->ie_lists_[__idx].emplace_back(std::dynamic_pointer_cast( - meta.GetMember("__ie_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); - } - } - this->oe_lists_.resize(meta.GetKeyValue("__oe_lists_-size")); - for (size_t __idx = 0; __idx < this->oe_lists_.size(); ++__idx) { - for (size_t __idy = 0; __idy < meta.GetKeyValue( - "__oe_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { - this->oe_lists_[__idx].emplace_back(std::dynamic_pointer_cast( - meta.GetMember("__oe_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); - } - } - this->ie_offsets_lists_.resize(meta.GetKeyValue("__ie_offsets_lists_-size")); - for (size_t __idx = 0; __idx < this->ie_offsets_lists_.size(); ++__idx) { - for (size_t __idy = 0; __idy < meta.GetKeyValue( - "__ie_offsets_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { - this->ie_offsets_lists_[__idx].emplace_back(std::dynamic_pointer_cast( - meta.GetMember("__ie_offsets_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); - } - } - this->oe_offsets_lists_.resize(meta.GetKeyValue("__oe_offsets_lists_-size")); - for (size_t __idx = 0; __idx < this->oe_offsets_lists_.size(); ++__idx) { - for (size_t __idy = 0; __idy < meta.GetKeyValue( - "__oe_offsets_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { - this->oe_offsets_lists_[__idx].emplace_back(std::dynamic_pointer_cast( - meta.GetMember("__oe_offsets_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); - } - } - this->vm_ptr_ = std::dynamic_pointer_cast(meta.GetMember("vm_ptr_")); - meta.GetKeyValue("schema_json_", this->schema_json_); +// public: +// static std::unique_ptr Create() __attribute__((used)) { +// return std::static_pointer_cast( +// std::unique_ptr>{ +// new ArrowFragment()}); +// } + + +// public: +// void Construct(const ObjectMeta& meta) override { +// std::string __type_name = type_name>(); +// VINEYARD_ASSERT( +// meta.GetTypeName() == __type_name, +// "Expect typename '" + __type_name + "', but got '" + meta.GetTypeName() + "'"); +// this->meta_ = meta; +// this->id_ = meta.GetId(); + +// meta.GetKeyValue("fid_", this->fid_); +// meta.GetKeyValue("fnum_", this->fnum_); +// meta.GetKeyValue("directed_", this->directed_); +// meta.GetKeyValue("is_multigraph_", this->is_multigraph_); +// meta.GetKeyValue("vertex_label_num_", this->vertex_label_num_); +// meta.GetKeyValue("edge_label_num_", this->edge_label_num_); +// meta.GetKeyValue("oid_type", this->oid_type); +// meta.GetKeyValue("vid_type", this->vid_type); +// this->ivnums_.Construct(meta.GetMemberMeta("ivnums_")); +// this->ovnums_.Construct(meta.GetMemberMeta("ovnums_")); +// this->tvnums_.Construct(meta.GetMemberMeta("tvnums_")); +// for (size_t __idx = 0; __idx < meta.GetKeyValue("__vertex_tables_-size"); ++__idx) { +// this->vertex_tables_.emplace_back(std::dynamic_pointer_cast
( +// meta.GetMember("__vertex_tables_-" + std::to_string(__idx)))); +// } +// for (size_t __idx = 0; __idx < meta.GetKeyValue("__ovgid_lists_-size"); ++__idx) { +// this->ovgid_lists_.emplace_back(std::dynamic_pointer_cast( +// meta.GetMember("__ovgid_lists_-" + std::to_string(__idx)))); +// } +// for (size_t __idx = 0; __idx < meta.GetKeyValue("__ovg2l_maps_-size"); ++__idx) { +// this->ovg2l_maps_.emplace_back(std::dynamic_pointer_cast>( +// meta.GetMember("__ovg2l_maps_-" + std::to_string(__idx)))); +// } +// for (size_t __idx = 0; __idx < meta.GetKeyValue("__edge_tables_-size"); ++__idx) { +// this->edge_tables_.emplace_back(std::dynamic_pointer_cast
( +// meta.GetMember("__edge_tables_-" + std::to_string(__idx)))); +// } +// this->ie_lists_.resize(meta.GetKeyValue("__ie_lists_-size")); +// for (size_t __idx = 0; __idx < this->ie_lists_.size(); ++__idx) { +// for (size_t __idy = 0; __idy < meta.GetKeyValue( +// "__ie_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { +// this->ie_lists_[__idx].emplace_back(std::dynamic_pointer_cast( +// meta.GetMember("__ie_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); +// } +// } +// this->oe_lists_.resize(meta.GetKeyValue("__oe_lists_-size")); +// for (size_t __idx = 0; __idx < this->oe_lists_.size(); ++__idx) { +// for (size_t __idy = 0; __idy < meta.GetKeyValue( +// "__oe_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { +// this->oe_lists_[__idx].emplace_back(std::dynamic_pointer_cast( +// meta.GetMember("__oe_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); +// } +// } +// this->ie_offsets_lists_.resize(meta.GetKeyValue("__ie_offsets_lists_-size")); +// for (size_t __idx = 0; __idx < this->ie_offsets_lists_.size(); ++__idx) { +// for (size_t __idy = 0; __idy < meta.GetKeyValue( +// "__ie_offsets_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { +// this->ie_offsets_lists_[__idx].emplace_back(std::dynamic_pointer_cast( +// meta.GetMember("__ie_offsets_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); +// } +// } +// this->oe_offsets_lists_.resize(meta.GetKeyValue("__oe_offsets_lists_-size")); +// for (size_t __idx = 0; __idx < this->oe_offsets_lists_.size(); ++__idx) { +// for (size_t __idy = 0; __idy < meta.GetKeyValue( +// "__oe_offsets_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { +// this->oe_offsets_lists_[__idx].emplace_back(std::dynamic_pointer_cast( +// meta.GetMember("__oe_offsets_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); +// } +// } +// this->vm_ptr_ = std::dynamic_pointer_cast(meta.GetMember("vm_ptr_")); +// meta.GetKeyValue("schema_json_", this->schema_json_); - if (meta.IsLocal()) { - this->PostConstruct(meta); - } - } +// if (meta.IsLocal()) { +// this->PostConstruct(meta); +// } +// } - private: +// private: public: using oid_t = OID_T; using vid_t = VID_T; @@ -211,304 +222,388 @@ class __attribute__((annotate("vineyard"))) ArrowFragment public: ~ArrowFragment() = default; + // hide vertex_map + // vineyard::ObjectID vertex_map_id() const override { return vm_ptr_->id(); } + + void init(void* partitioned_graph) { + pg_ = partitioned_graph; + assert(get_partition_list_size(pg_) == 1); + auto pl = get_local_partitions(pg_); + auto p = get_partition_from_list(pl, 0); + g_ = get_local_graph_from_partition(pg_, p); - vineyard::ObjectID vertex_map_id() const override { return vm_ptr_->id(); } + directed_ = is_directed(g_); + is_multigraph_ = is_multigraph(g_); + fid_ = p; + fnum_ = get_total_partitions_number(pg_); + } - bool directed() const override { - // grin structure directed - return directed_; + bool directed() const override { + return directed_; } bool is_multigraph() const override { - // grin structure multigraph ++++ return is_multigraph_; } const std::string vid_typename() const override { - // grin structure vid type - return vid_type; + auto dt = get_vertex_id_data_type(g_); + return GetDataTypeName(dt); } - const std::string oid_typename() const override { return oid_type; } + const std::string oid_typename() const override { + auto dt = DataTypeEnum::value(); + return GetDataTypeName(dt); + } + fid_t fid() const { return fid_; } - fid_t fid() const { - // grin partition get_partition - return fid_; - } + fid_t fnum() const { return fnum_; } - fid_t fnum() const { - // grin partition get_partition_number - return fnum_; + void* vertex_label(const void* v) { + return get_vertex_label(g_, v); } label_id_t vertex_label(const vertex_t& v) const { - // grin label get vertex_label by vertex - return vid_parser_.GetLabelId(v.GetValue()); + void* _v = get_vertex_from_id(v.GetValue()); + void* _label = vertex_label(_v); + void* _label_id = get_label_id(g_, _label); + return *(static_cast(_label_id)) } - int64_t vertex_offset(const vertex_t& v) const { - // to remove ---- - return vid_parser_.GetOffset(v.GetValue()); - } +// int64_t vertex_offset(const vertex_t& v) const { +// // to remove ---- +// return vid_parser_.GetOffset(v.GetValue()); +// } label_id_t vertex_label_num() const { - // grin label get vertex label list size - return schema_.vertex_label_num(); + void* vll = get_vertex_labels(g_); + return get_vertex_label_list_size(vll); } label_id_t edge_label_num() const { - // grin label get edge label list size - return schema_.edge_label_num(); + void* ell = get_edge_labels(g_); + return get_edge_label_list_size(ell); } prop_id_t vertex_property_num(label_id_t label) const { - // grin pg get_all_vertex_properties_from_label - std::string type = "VERTEX"; - return static_cast(schema_.GetEntry(label, type).property_num()); + void* _label = get_vertex_label_from_id((void*)(&label)); + void* vpl = get_all_vertex_properties_from_label(g_, _label); + return get_property_list_size(vpl); } std::shared_ptr vertex_property_type(label_id_t label, prop_id_t prop) const { - // grin property get_property_type - return vertex_tables_[label]->schema()->field(prop)->type(); + void* _label = get_vertex_label_from_id(label) + void* _property = get_vertex_property_from_id(_label, prop); + auto dt = get_property_type(_g, _property); + return GetArrowDataType(dt); } prop_id_t edge_property_num(label_id_t label) const { - // grin pg get_all_edge_properties_from_label - std::string type = "EDGE"; - return static_cast(schema_.GetEntry(label, type).property_num()); + void* _label = get_edge_label_from_id((void*)(&label)); + void* epl = get_all_edge_properties_from_label(g_, _label); + return get_property_list_size(epl); } std::shared_ptr edge_property_type(label_id_t label, prop_id_t prop) const { - // grin property get_property_type - return edge_tables_[label]->schema()->field(prop)->type(); - } - - std::shared_ptr vertex_data_table(label_id_t i) const { - // grin pg get_all_rows ++++??? - return vertex_tables_[i]->GetTable(); - } - - std::shared_ptr edge_data_table(label_id_t i) const { - // grin pg get_all_rows ++++??? - return edge_tables_[i]->GetTable(); - } - - template - property_graph_utils::EdgeDataColumn edge_data_column( - label_id_t label, prop_id_t prop) const { - // get rid of this method and EdgeDataColumn structure - // this structure actually serves to get a specific property of an edge - // and it can be replaced by grin property get_edge_row - if (edge_tables_[label]->num_rows() == 0) { - return property_graph_utils::EdgeDataColumn(); - } else { - // the finalized etables are guaranteed to have been concatenated - return property_graph_utils::EdgeDataColumn( - edge_tables_[label]->column(prop)->chunk(0)); - } - } - - template - property_graph_utils::VertexDataColumn vertex_data_column( - label_id_t label, prop_id_t prop) const { - // Ditto. it can be replaced by grin property get_vertex_row && get_property_value_from_row - if (vertex_tables_[label]->num_rows() == 0) { - return property_graph_utils::VertexDataColumn( - InnerVertices(label)); - } else { - // the finalized vtables are guaranteed to have been concatenated - return property_graph_utils::VertexDataColumn( - InnerVertices(label), vertex_tables_[label]->column(prop)->chunk(0)); - } - } + void* _label = get_edge_label_from_id(label) + void* _property = get_edge_property_from_id(_label, prop); + auto dt = get_property_type(_g, _property); + return GetArrowDataType(dt); + } + +// std::shared_ptr vertex_data_table(label_id_t i) const { +// // maybe we should get rid of the method +// // there is no way we can provide the whole data with a C-style api +// return vertex_tables_[i]->GetTable(); +// } + +// std::shared_ptr edge_data_table(label_id_t i) const { +// // Ditto. +// return edge_tables_[i]->GetTable(); +// } + +// template +// property_graph_utils::EdgeDataColumn edge_data_column( +// label_id_t label, prop_id_t prop) const { +// // get rid of this method and EdgeDataColumn structure +// // this structure actually serves to get a specific property of an edge +// // and it can be replaced by grin property get_edge_row +// if (edge_tables_[label]->num_rows() == 0) { +// return property_graph_utils::EdgeDataColumn(); +// } else { +// // the finalized etables are guaranteed to have been concatenated +// return property_graph_utils::EdgeDataColumn( +// edge_tables_[label]->column(prop)->chunk(0)); +// } +// } + +// template +// property_graph_utils::VertexDataColumn vertex_data_column( +// label_id_t label, prop_id_t prop) const { +// // Ditto. it can be replaced by grin property get_vertex_row && get_property_value_from_row +// if (vertex_tables_[label]->num_rows() == 0) { +// return property_graph_utils::VertexDataColumn( +// InnerVertices(label)); +// } else { +// // the finalized vtables are guaranteed to have been concatenated +// return property_graph_utils::VertexDataColumn( +// InnerVertices(label), vertex_tables_[label]->column(prop)->chunk(0)); +// } +// } vertex_range_t Vertices(label_id_t label_id) const { - // continuous_vid_traits - return vertex_range_t( - vid_parser_.GenerateId(0, label_id, 0), - vid_parser_.GenerateId(0, label_id, tvnums_[label_id])); + //continious vid trait + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_vertex_list_by_label(pg_, fid_, _label); + void* beginh = get_begin_vertex_id_from_list(vlh); + VID_T* begin = static_cast(beginh); + void* endh = get_end_vertex_id_from_list(vlh); + VID_T* end = static_cast(endh); + return vertex_range_t(*begin, *end); } vertex_range_t InnerVertices(label_id_t label_id) const { - // continuous_vid_traits - return vertex_range_t( - vid_parser_.GenerateId(0, label_id, 0), - vid_parser_.GenerateId(0, label_id, ivnums_[label_id])); + //continious vid trait + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_local_vertices_by_label(pg_, fid_, _label); + void* beginh = get_begin_vertex_id_from_list(vlh); + VID_T* begin = static_cast(beginh); + void* endh = get_end_vertex_id_from_list(vlh); + VID_T* end = static_cast(endh); + return vertex_range_t(*begin, *end); } vertex_range_t OuterVertices(label_id_t label_id) const { - // continuous_vid_traits - return vertex_range_t( - vid_parser_.GenerateId(0, label_id, ivnums_[label_id]), - vid_parser_.GenerateId(0, label_id, tvnums_[label_id])); + //continious vid trait + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_remote_vertices_by_label(pg_, fid_, _label); + void* beginh = get_begin_vertex_id_from_list(vlh); + VID_T* begin = static_cast(beginh); + void* endh = get_end_vertex_id_from_list(vlh); + VID_T* end = static_cast(endh); + return vertex_range_t(*begin, *end); } vertex_range_t InnerVerticesSlice(label_id_t label_id, vid_t start, vid_t end) const { // continuous_vid_traits - CHECK(start <= end && start <= ivnums_[label_id]); - if (end <= ivnums_[label_id]) { - return vertex_range_t(vid_parser_.GenerateId(0, label_id, start), - vid_parser_.GenerateId(0, label_id, end)); + vertex_range_t vr = InnerVertices(label_id); + size_t _end = vr.size(); + CHECK(start <= end && start <= _end); + if (end <= _end) { + return vr.SetRange(start, end); } else { - return vertex_range_t( - vid_parser_.GenerateId(0, label_id, start), - vid_parser_.GenerateId(0, label_id, ivnums_[label_id])); + return vr.SetRange(start, _end); } } inline vid_t GetVerticesNum(label_id_t label_id) const { - // grin label get_vertex_num_by_label - return tvnums_[label_id]; + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_vertex_list_by_label(pg_, fid_, _label); + return get_vertex_list_size(vlh); } bool GetVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { - vid_t gid; - if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { - return (vid_parser_.GetFid(gid) == fid_) ? InnerVertexGid2Vertex(gid, v) - : OuterVertexGid2Vertex(gid, v); - } else { - return false; + void* _label = get_vertex_label_from_id((void*)(&label)); + void* _v = get_vertex_from_label_origin_id(_label, (void*)(&oid)); + if (_v == NULL_VERTEX) { + return false; } + void* _id = get_vertex_id(_v); + v.SetValue(*(static_cast(_id))); + return true; } oid_t GetId(const vertex_t& v) const { - return IsInnerVertex(v) ? GetInnerVertexId(v) : GetOuterVertexId(v); + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _id = get_vertex_origin_id(_v); + return *(static_cast(_id)); } - internal_oid_t GetInternalId(const vertex_t& v) const { - return IsInnerVertex(v) ? GetInnerVertexInternalId(v) - : GetOuterVertexInternalId(v); - } +// internal_oid_t GetInternalId(const vertex_t& v) const { +// return IsInnerVertex(v) ? GetInnerVertexInternalId(v) +// : GetOuterVertexInternalId(v); +// } fid_t GetFragId(const vertex_t& u) const { - return IsInnerVertex(u) ? fid_ : vid_parser_.GetFid(GetOuterVertexGid(u)); + auto rp = get_master_partition_for_vertex(pg_, fid_, (void*)(&u)); + if (rp == NULL_REMOTE_PARTITION) { + return fid_; + } + return rp; } - size_t GetTotalNodesNum() const { return vm_ptr_->GetTotalNodesNum(); } - size_t GetTotalVerticesNum() const { return vm_ptr_->GetTotalNodesNum(); } + size_t GetTotalNodesNum() const { + // secondary + return GetTotalVerticesNum() + } + size_t GetTotalVerticesNum() const { + void* vl = get_vertex_list(g_); + return get_vertex_list_size(vl); + } size_t GetTotalVerticesNum(label_id_t label) const { - return vm_ptr_->GetTotalNodesNum(label); + void* _label = get_vertex_label_from_id((void*)(&label)); + void* vl = get_vertex_list_by_label(_label); + return get_vertex_list_size(vl); } + // secondary size_t GetEdgeNum() const { return directed_ ? oenum_ + ienum_ : oenum_; } - + // secondary size_t GetInEdgeNum() const { return ienum_; } - + // secondary size_t GetOutEdgeNum() const { return oenum_; } template T GetData(const vertex_t& v, prop_id_t prop_id) const { - // grin get vertex row && get_property_value_from_row - return property_graph_utils::ValueGetter::Value( - vertex_tables_columns_[vid_parser_.GetLabelId(v.GetValue())][prop_id], - vid_parser_.GetOffset(v.GetValue())); + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _label = get_vertex_label(g_, _v); + void* _property = get_vertex_property_from_id(_lable, (void*)(&prop_id)); + void* _pl = get_all_vertex_properties_from_label(g_, _label); + void* _row = get_vertex_row(g_, _v, _pl); + void* _value = get_property_value_from_row(_row, _property); + return *(static_cast(_value)); } bool HasChild(const vertex_t& v, label_id_t e_label) const { + // secondary return GetLocalOutDegree(v, e_label) != 0; } bool HasParent(const vertex_t& v, label_id_t e_label) const { + // secondary return GetLocalInDegree(v, e_label) != 0; } int GetLocalOutDegree(const vertex_t& v, label_id_t e_label) const { + // secondary return GetOutgoingAdjList(v, e_label).Size(); } int GetLocalInDegree(const vertex_t& v, label_id_t e_label) const { + // secondary return GetIncomingAdjList(v, e_label).Size(); } // FIXME: grape message buffer compatibility bool Gid2Vertex(const vid_t& gid, vertex_t& v) const { - return (vid_parser_.GetFid(gid) == fid_) ? InnerVertexGid2Vertex(gid, v) - : OuterVertexGid2Vertex(gid, v); + std::stringstream ss; + ss << gid; + void* vh = get_vertex_from_deserialization(pg_, fid_, ss.str().c_str()); + if (vh == NULL_VERTEX) { + return false; + } + vertex_t* _v = static_cast(vh); + v.SetValue(_v->GetValue()); + return true; } vid_t Vertex2Gid(const vertex_t& v) const { + // secondary return IsInnerVertex(v) ? GetInnerVertexGid(v) : GetOuterVertexGid(v); } inline vid_t GetInnerVerticesNum(label_id_t label_id) const { - return ivnums_[label_id]; + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_local_vertices_by_label(pg_, fid_, _label); + return get_vertex_list_size(vlh); } inline vid_t GetOuterVerticesNum(label_id_t label_id) const { - return ovnums_[label_id]; + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_remote_vertices_by_label(pg_, fid_, _label); + return get_vertex_list_size(vlh); } inline bool IsInnerVertex(const vertex_t& v) const { - return vid_parser_.GetOffset(v.GetValue()) < - static_cast(ivnums_[vid_parser_.GetLabelId(v.GetValue())]); + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + return is_local_vertex(pg_, fid_, _v); } inline bool IsOuterVertex(const vertex_t& v) const { - vid_t offset = vid_parser_.GetOffset(v.GetValue()); - label_id_t label = vid_parser_.GetLabelId(v.GetValue()); - return offset < tvnums_[label] && offset >= ivnums_[label]; + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + return is_remote_vertex(pg_, fid_, _v); } bool GetInnerVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { - vid_t gid; - if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { - if (vid_parser_.GetFid(gid) == fid_) { - v.SetValue(vid_parser_.GetLid(gid)); - return true; - } - } - return false; + return GetVertex(label, oid, v); + // vid_t gid; + // if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { + // if (vid_parser_.GetFid(gid) == fid_) { + // v.SetValue(vid_parser_.GetLid(gid)); + // return true; + // } + // } + // return false; } bool GetOuterVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { - vid_t gid; - if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { - return OuterVertexGid2Vertex(gid, v); - } - return false; + return GetVertex(label, oid, v); + // vid_t gid; + // if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { + // return OuterVertexGid2Vertex(gid, v); + // } + // return false; } - inline oid_t GetInnerVertexId(const vertex_t& v) const { - return oid_t(GetInnerVertexInternalId(v)); + inline oid_t GetVertexOriginId(const vertex_t& v) const { + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _id = get_vertex_origin_id(g_, _v); + return *(static_cast(_id)); } - inline internal_oid_t GetInnerVertexInternalId(const vertex_t& v) const { - internal_oid_t internal_oid; - vid_t gid = - vid_parser_.GenerateId(fid_, vid_parser_.GetLabelId(v.GetValue()), - vid_parser_.GetOffset(v.GetValue())); - CHECK(vm_ptr_->GetOid(gid, internal_oid)); - return internal_oid; + inline oid_t GetInnerVertexId(const vertex_t& v) const { + return GetVertexOriginId(v); + // return oid_t(GetInnerVertexInternalId(v)); } +// inline internal_oid_t GetInnerVertexInternalId(const vertex_t& v) const { +// internal_oid_t internal_oid; +// vid_t gid = +// vid_parser_.GenerateId(fid_, vid_parser_.GetLabelId(v.GetValue()), +// vid_parser_.GetOffset(v.GetValue())); +// CHECK(vm_ptr_->GetOid(gid, internal_oid)); +// return internal_oid; +// } + inline oid_t GetOuterVertexId(const vertex_t& v) const { - return oid_t(GetOuterVertexInternalId(v)); + return GetVertexOriginId(v); + // return oid_t(GetOuterVertexInternalId(v)); } - inline internal_oid_t GetOuterVertexInternalId(const vertex_t& v) const { - vid_t gid = GetOuterVertexGid(v); - internal_oid_t internal_oid; - CHECK(vm_ptr_->GetOid(gid, internal_oid)); - return internal_oid; - } +// inline internal_oid_t GetOuterVertexInternalId(const vertex_t& v) const { +// vid_t gid = GetOuterVertexGid(v); +// internal_oid_t internal_oid; +// CHECK(vm_ptr_->GetOid(gid, internal_oid)); +// return internal_oid; +// } inline oid_t Gid2Oid(const vid_t& gid) const { - internal_oid_t internal_oid; - CHECK(vm_ptr_->GetOid(gid, internal_oid)); - return oid_t(internal_oid); + vertex_t v; + Gid2Vertex(gid, v); + return GetVertexOriginId(v); + // internal_oid_t internal_oid; + // CHECK(vm_ptr_->GetOid(gid, internal_oid)); + // return oid_t(internal_oid); } inline bool Oid2Gid(label_id_t label, const oid_t& oid, vid_t& gid) const { - return vm_ptr_->GetGid(label, internal_oid_t(oid), gid); + vertex_t v; + if (!GetVertex(label, oid, v)) { + return false; + } + gid = Vertex2Gid(v); + return true; + // return vm_ptr_->GetGid(label, internal_oid_t(oid), gid); } inline bool Oid2Gid(label_id_t label, const oid_t& oid, vertex_t& v) const { vid_t gid; - if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { +// if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { + if (Oid2Gid(label, oid, gid)) { v.SetValue(gid); return true; } @@ -516,111 +611,129 @@ class __attribute__((annotate("vineyard"))) ArrowFragment } inline bool InnerVertexGid2Vertex(const vid_t& gid, vertex_t& v) const { - v.SetValue(vid_parser_.GetLid(gid)); - return true; + return Gid2Vertex(gid, v); + // v.SetValue(vid_parser_.GetLid(gid)); + // return true; } inline bool OuterVertexGid2Vertex(const vid_t& gid, vertex_t& v) const { - auto map = ovg2l_maps_ptr_[vid_parser_.GetLabelId(gid)]; - auto iter = map->find(gid); - if (iter != map->end()) { - v.SetValue(iter->second); - return true; - } else { - return false; - } + return Gid2Vertex(gid, v); + // auto map = ovg2l_maps_ptr_[vid_parser_.GetLabelId(gid)]; + // auto iter = map->find(gid); + // if (iter != map->end()) { + // v.SetValue(iter->second); + // return true; + // } else { + // return false; + // } } inline vid_t GetOuterVertexGid(const vertex_t& v) const { - label_id_t v_label = vid_parser_.GetLabelId(v.GetValue()); - return ovgid_lists_ptr_[v_label][vid_parser_.GetOffset(v.GetValue()) - - static_cast(ivnums_[v_label])]; + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _mv = get_master_vertex_for_vertex(pg_, fid_, _v); + void* _id = get_vertex_id(_mv); + return *(static_cast(_id)); + // label_id_t v_label = vid_parser_.GetLabelId(v.GetValue()); + // return ovgid_lists_ptr_[v_label][vid_parser_.GetOffset(v.GetValue()) - + // static_cast(ivnums_[v_label])]; } inline vid_t GetInnerVertexGid(const vertex_t& v) const { - return vid_parser_.GenerateId(fid_, vid_parser_.GetLabelId(v.GetValue()), - vid_parser_.GetOffset(v.GetValue())); - } - - inline adj_list_t GetIncomingAdjList(const vertex_t& v, label_id_t e_label) - const { - // grin vertexlist continous_vid_trait get_vertex_from_vid ++++ - vid_t vid = v.GetValue(); - label_id_t v_label = vid_parser_.GetLabelId(vid); - int64_t v_offset = vid_parser_.GetOffset(vid); - const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; - const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; - return adj_list_t(&ie[offset_array[v_offset]], - &ie[offset_array[v_offset + 1]], - flatten_edge_tables_columns_[e_label]); - } + std::stringstream ss(serialize_remote_vertex(pg_, (void*)(&v))); + VID_T gid; + ss >> gid; + return gid; + // return vid_parser_.GenerateId(fid_, vid_parser_.GetLabelId(v.GetValue()), + // vid_parser_.GetOffset(v.GetValue())); + } + +// inline adj_list_t GetIncomingAdjList(const vertex_t& v, label_id_t e_label) +// const { +// // // grin vertexlist continous_vid_trait get_vertex_from_vid ++++ +// // vid_t vid = v.GetValue(); +// // label_id_t v_label = vid_parser_.GetLabelId(vid); +// // int64_t v_offset = vid_parser_.GetOffset(vid); +// // const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; +// // const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; +// // return adj_list_t(&ie[offset_array[v_offset]], +// // &ie[offset_array[v_offset + 1]], +// // flatten_edge_tables_columns_[e_label]); +// } inline raw_adj_list_t GetIncomingRawAdjList(const vertex_t& v, label_id_t e_label) const { - vid_t vid = v.GetValue(); - label_id_t v_label = vid_parser_.GetLabelId(vid); - int64_t v_offset = vid_parser_.GetOffset(vid); - const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; - const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; - return raw_adj_list_t(&ie[offset_array[v_offset]], - &ie[offset_array[v_offset + 1]]); - } - - inline adj_list_t GetOutgoingAdjList(const vertex_t& v, label_id_t e_label) - const { - vid_t vid = v.GetValue(); - label_id_t v_label = vid_parser_.GetLabelId(vid); - int64_t v_offset = vid_parser_.GetOffset(vid); - const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; - const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; - return adj_list_t(&oe[offset_array[v_offset]], - &oe[offset_array[v_offset + 1]], - flatten_edge_tables_columns_[e_label]); - } + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _label = get_edge_label_from_id((void*)(&e_label)); + void* al = get_adjacent_list_by_edge_label(g_, Direction::IN, (void*)(&v), _label); + return adj_list_t(al, get_adjacent_list_size(al)); + // vid_t vid = v.GetValue(); + // label_id_t v_label = vid_parser_.GetLabelId(vid); + // int64_t v_offset = vid_parser_.GetOffset(vid); + // const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; + // const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; + // return raw_adj_list_t(&ie[offset_array[v_offset]], + // &ie[offset_array[v_offset + 1]]); + } + +// inline adj_list_t GetOutgoingAdjList(const vertex_t& v, label_id_t e_label) +// const { +// vid_t vid = v.GetValue(); +// label_id_t v_label = vid_parser_.GetLabelId(vid); +// int64_t v_offset = vid_parser_.GetOffset(vid); +// const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; +// const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; +// return adj_list_t(&oe[offset_array[v_offset]], +// &oe[offset_array[v_offset + 1]], +// flatten_edge_tables_columns_[e_label]); +// } inline raw_adj_list_t GetOutgoingRawAdjList(const vertex_t& v, label_id_t e_label) const { - vid_t vid = v.GetValue(); - label_id_t v_label = vid_parser_.GetLabelId(vid); - int64_t v_offset = vid_parser_.GetOffset(vid); - const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; - const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; - return raw_adj_list_t(&oe[offset_array[v_offset]], - &oe[offset_array[v_offset + 1]]); - } - - /** - * N.B.: as an temporary solution, for POC of graph-learn, will be removed - * later. - */ - - inline const int64_t* GetIncomingOffsetArray(label_id_t v_label, - label_id_t e_label) const { - return ie_offsets_ptr_lists_[v_label][e_label]; - } - - inline const int64_t* GetOutgoingOffsetArray(label_id_t v_label, - label_id_t e_label) const { - return oe_offsets_ptr_lists_[v_label][e_label]; - } - - inline int64_t GetIncomingOffsetLength(label_id_t v_label, label_id_t e_label) - const { - return ie_offsets_lists_[v_label][e_label]->length(); - } - - inline int64_t GetOutgoingOffsetLength(label_id_t v_label, label_id_t e_label) - const { - return oe_offsets_lists_[v_label][e_label]->length(); - } - - inline std::pair GetOutgoingAdjOffsets( - const vertex_t& v, label_id_t e_label) const { - vid_t vid = v.GetValue(); - label_id_t v_label = vid_parser_.GetLabelId(vid); - int64_t v_offset = vid_parser_.GetOffset(vid); - const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; - return std::make_pair(offset_array[v_offset], offset_array[v_offset + 1]); - } + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _label = get_edge_label_from_id((void*)(&e_label)); + void* al = get_adjacent_list_by_edge_label(g_, Direction::OUT, (void*)(&v), _label); + return adj_list_t(al, get_adjacent_list_size(al)); + // vid_t vid = v.GetValue(); + // label_id_t v_label = vid_parser_.GetLabelId(vid); + // int64_t v_offset = vid_parser_.GetOffset(vid); + // const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; + // const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; + // return raw_adj_list_t(&oe[offset_array[v_offset]], + // &oe[offset_array[v_offset + 1]]); + } + +// /** +// * N.B.: as an temporary solution, for POC of graph-learn, will be removed +// * later. +// */ + +// inline const int64_t* GetIncomingOffsetArray(label_id_t v_label, +// label_id_t e_label) const { +// return ie_offsets_ptr_lists_[v_label][e_label]; +// } + +// inline const int64_t* GetOutgoingOffsetArray(label_id_t v_label, +// label_id_t e_label) const { +// return oe_offsets_ptr_lists_[v_label][e_label]; +// } + +// inline int64_t GetIncomingOffsetLength(label_id_t v_label, label_id_t e_label) +// const { +// return ie_offsets_lists_[v_label][e_label]->length(); +// } + +// inline int64_t GetOutgoingOffsetLength(label_id_t v_label, label_id_t e_label) +// const { +// return oe_offsets_lists_[v_label][e_label]->length(); +// } + +// inline std::pair GetOutgoingAdjOffsets( +// const vertex_t& v, label_id_t e_label) const { +// vid_t vid = v.GetValue(); +// label_id_t v_label = vid_parser_.GetLabelId(vid); +// int64_t v_offset = vid_parser_.GetOffset(vid); +// const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; +// return std::make_pair(offset_array[v_offset], offset_array[v_offset + 1]); +// } inline grape::DestList IEDests(const vertex_t& v, label_id_t e_label) const { int64_t offset = vid_parser_.GetOffset(v.GetValue()); @@ -646,9 +759,9 @@ class __attribute__((annotate("vineyard"))) ArrowFragment iodoffset_[v_label][e_label][offset + 1]); } - std::shared_ptr GetVertexMap() { return vm_ptr_; } +// std::shared_ptr GetVertexMap() { return vm_ptr_; } - const PropertyGraphSchema& schema() const override { return schema_; } +// const PropertyGraphSchema& schema() const override { return schema_; } void PrepareToRunApp(const grape::CommSpec& comm_spec, grape::PrepareConf conf); @@ -791,14 +904,6 @@ class __attribute__((annotate("vineyard"))) ArrowFragment std::vector>>& fid_lists, std::vector>>& fid_lists_offset); - void directedCSR2Undirected( - vineyard::Client & client, - std::vector>>> & - oe_lists, - std::vector>> & - oe_offsets_lists, - int concurrency, bool& is_multigraph); - __attribute__((annotate("shared"))) fid_t fid_, fnum_; __attribute__((annotate("shared"))) bool directed_; __attribute__((annotate("shared"))) bool is_multigraph_; @@ -855,641 +960,4 @@ class __attribute__((annotate("vineyard"))) ArrowFragment // vim: syntax=cpp -namespace vineyard { - -template::type, VID_T>> -class ArrowFragmentBaseBuilder: public ObjectBuilder { - public: - // using oid_t - using oid_t = OID_T; - // using vid_t - using vid_t = VID_T; - // using internal_oid_t - using internal_oid_t = typename InternalType::type; - // using eid_t - using eid_t = property_graph_types::EID_TYPE; - // using prop_id_t - using prop_id_t = property_graph_types::PROP_ID_TYPE; - // using label_id_t - using label_id_t = property_graph_types::LABEL_ID_TYPE; - // using vertex_range_t - using vertex_range_t = grape::VertexRange; - // using inner_vertices_t - using inner_vertices_t = vertex_range_t; - // using outer_vertices_t - using outer_vertices_t = vertex_range_t; - // using vertices_t - using vertices_t = vertex_range_t; - // using nbr_t - using nbr_t = property_graph_utils::Nbr; - // using nbr_unit_t - using nbr_unit_t = property_graph_utils::NbrUnit; - // using adj_list_t - using adj_list_t = property_graph_utils::AdjList; - // using raw_adj_list_t - using raw_adj_list_t = property_graph_utils::RawAdjList; - // using vertex_map_t - using vertex_map_t = VERTEX_MAP_T; - // using vertex_t - using vertex_t = grape::Vertex; - // using ovg2l_map_t - using ovg2l_map_t = - ska::flat_hash_map::KeyHash>; - // using vid_array_t - using vid_array_t = ArrowArrayType; - // using vid_vineyard_array_t - using vid_vineyard_array_t = ArrowVineyardArrayType; - // using vid_vineyard_builder_t - using vid_vineyard_builder_t = ArrowVineyardBuilderType; - // using eid_array_t - using eid_array_t = ArrowArrayType; - // using eid_vineyard_array_t - using eid_vineyard_array_t = ArrowVineyardArrayType; - // using eid_vineyard_builder_t - using eid_vineyard_builder_t = ArrowVineyardBuilderType; - // using vid_builder_t - using vid_builder_t = ArrowBuilderType; - - explicit ArrowFragmentBaseBuilder(Client &client) {} - - explicit ArrowFragmentBaseBuilder( - ArrowFragment const &__value) { - this->set_fid_(__value.fid_); - this->set_fnum_(__value.fnum_); - this->set_directed_(__value.directed_); - this->set_is_multigraph_(__value.is_multigraph_); - this->set_vertex_label_num_(__value.vertex_label_num_); - this->set_edge_label_num_(__value.edge_label_num_); - this->set_oid_type(__value.oid_type); - this->set_vid_type(__value.vid_type); - this->set_ivnums_( - std::make_shared::type>( - __value.ivnums_)); - this->set_ovnums_( - std::make_shared::type>( - __value.ovnums_)); - this->set_tvnums_( - std::make_shared::type>( - __value.tvnums_)); - for (auto const &__vertex_tables__item: __value.vertex_tables_) { - this->add_vertex_tables_(__vertex_tables__item); - } - for (auto const &__ovgid_lists__item: __value.ovgid_lists_) { - this->add_ovgid_lists_(__ovgid_lists__item); - } - for (auto const &__ovg2l_maps__item: __value.ovg2l_maps_) { - this->add_ovg2l_maps_(__ovg2l_maps__item); - } - for (auto const &__edge_tables__item: __value.edge_tables_) { - this->add_edge_tables_(__edge_tables__item); - } - this->ie_lists_.resize(__value.ie_lists_.size()); - for (size_t __idx = 0; __idx < __value.ie_lists_.size(); ++__idx) { - this->ie_lists_[__idx].resize(__value.ie_lists_[__idx].size()); - for (size_t __idy = 0; __idy < __value.ie_lists_[__idx].size(); ++__idy) { - this->ie_lists_[__idx][__idy] = __value.ie_lists_[__idx][__idy]; - } - } - this->oe_lists_.resize(__value.oe_lists_.size()); - for (size_t __idx = 0; __idx < __value.oe_lists_.size(); ++__idx) { - this->oe_lists_[__idx].resize(__value.oe_lists_[__idx].size()); - for (size_t __idy = 0; __idy < __value.oe_lists_[__idx].size(); ++__idy) { - this->oe_lists_[__idx][__idy] = __value.oe_lists_[__idx][__idy]; - } - } - this->ie_offsets_lists_.resize(__value.ie_offsets_lists_.size()); - for (size_t __idx = 0; __idx < __value.ie_offsets_lists_.size(); ++__idx) { - this->ie_offsets_lists_[__idx].resize(__value.ie_offsets_lists_[__idx].size()); - for (size_t __idy = 0; __idy < __value.ie_offsets_lists_[__idx].size(); ++__idy) { - this->ie_offsets_lists_[__idx][__idy] = __value.ie_offsets_lists_[__idx][__idy]; - } - } - this->oe_offsets_lists_.resize(__value.oe_offsets_lists_.size()); - for (size_t __idx = 0; __idx < __value.oe_offsets_lists_.size(); ++__idx) { - this->oe_offsets_lists_[__idx].resize(__value.oe_offsets_lists_[__idx].size()); - for (size_t __idy = 0; __idy < __value.oe_offsets_lists_[__idx].size(); ++__idy) { - this->oe_offsets_lists_[__idx][__idy] = __value.oe_offsets_lists_[__idx][__idy]; - } - } - this->set_vm_ptr_(__value.vm_ptr_); - this->set_schema_json_(__value.schema_json_); - } - - explicit ArrowFragmentBaseBuilder( - std::shared_ptr> const & __value): - ArrowFragmentBaseBuilder(*__value) { - } - - ObjectMeta &ValueMetaRef(std::shared_ptr> &__value) { - return __value->meta_; - } - - std::shared_ptr _Seal(Client &client) override { - // ensure the builder hasn't been sealed yet. - ENSURE_NOT_SEALED(this); - - VINEYARD_CHECK_OK(this->Build(client)); - auto __value = std::make_shared>(); - - return this->_Seal(client, __value); - } - - std::shared_ptr _Seal(Client &client, std::shared_ptr> &__value) { - size_t __value_nbytes = 0; - - __value->meta_.SetTypeName(type_name>()); - if (std::is_base_of>::value) { - __value->meta_.SetGlobal(true); - } - - __value->fid_ = fid_; - __value->meta_.AddKeyValue("fid_", __value->fid_); - - __value->fnum_ = fnum_; - __value->meta_.AddKeyValue("fnum_", __value->fnum_); - - __value->directed_ = directed_; - __value->meta_.AddKeyValue("directed_", __value->directed_); - - __value->is_multigraph_ = is_multigraph_; - __value->meta_.AddKeyValue("is_multigraph_", __value->is_multigraph_); - - __value->vertex_label_num_ = vertex_label_num_; - __value->meta_.AddKeyValue("vertex_label_num_", __value->vertex_label_num_); - - __value->edge_label_num_ = edge_label_num_; - __value->meta_.AddKeyValue("edge_label_num_", __value->edge_label_num_); - - __value->oid_type = oid_type; - __value->meta_.AddKeyValue("oid_type", __value->oid_type); - - __value->vid_type = vid_type; - __value->meta_.AddKeyValue("vid_type", __value->vid_type); - - // using __ivnums__value_type = typename vineyard::Array; - using __ivnums__value_type = decltype(__value->ivnums_); - auto __value_ivnums_ = std::dynamic_pointer_cast<__ivnums__value_type>( - ivnums_->_Seal(client)); - __value->ivnums_ = *__value_ivnums_; - __value->meta_.AddMember("ivnums_", __value->ivnums_); - __value_nbytes += __value_ivnums_->nbytes(); - - // using __ovnums__value_type = typename vineyard::Array; - using __ovnums__value_type = decltype(__value->ovnums_); - auto __value_ovnums_ = std::dynamic_pointer_cast<__ovnums__value_type>( - ovnums_->_Seal(client)); - __value->ovnums_ = *__value_ovnums_; - __value->meta_.AddMember("ovnums_", __value->ovnums_); - __value_nbytes += __value_ovnums_->nbytes(); - - // using __tvnums__value_type = typename vineyard::Array; - using __tvnums__value_type = decltype(__value->tvnums_); - auto __value_tvnums_ = std::dynamic_pointer_cast<__tvnums__value_type>( - tvnums_->_Seal(client)); - __value->tvnums_ = *__value_tvnums_; - __value->meta_.AddMember("tvnums_", __value->tvnums_); - __value_nbytes += __value_tvnums_->nbytes(); - - // using __vertex_tables__value_type = typename List>::value_type::element_type; - using __vertex_tables__value_type = typename decltype(__value->vertex_tables_)::value_type::element_type; - - size_t __vertex_tables__idx = 0; - for (auto &__vertex_tables__value: vertex_tables_) { - auto __value_vertex_tables_ = std::dynamic_pointer_cast<__vertex_tables__value_type>( - __vertex_tables__value->_Seal(client)); - __value->vertex_tables_.emplace_back(__value_vertex_tables_); - __value->meta_.AddMember("__vertex_tables_-" + std::to_string(__vertex_tables__idx), - __value_vertex_tables_); - __value_nbytes += __value_vertex_tables_->nbytes(); - __vertex_tables__idx += 1; - } - __value->meta_.AddKeyValue("__vertex_tables_-size", __value->vertex_tables_.size()); - - // using __ovgid_lists__value_type = typename List>::value_type::element_type; - using __ovgid_lists__value_type = typename decltype(__value->ovgid_lists_)::value_type::element_type; - - size_t __ovgid_lists__idx = 0; - for (auto &__ovgid_lists__value: ovgid_lists_) { - auto __value_ovgid_lists_ = std::dynamic_pointer_cast<__ovgid_lists__value_type>( - __ovgid_lists__value->_Seal(client)); - __value->ovgid_lists_.emplace_back(__value_ovgid_lists_); - __value->meta_.AddMember("__ovgid_lists_-" + std::to_string(__ovgid_lists__idx), - __value_ovgid_lists_); - __value_nbytes += __value_ovgid_lists_->nbytes(); - __ovgid_lists__idx += 1; - } - __value->meta_.AddKeyValue("__ovgid_lists_-size", __value->ovgid_lists_.size()); - - // using __ovg2l_maps__value_type = typename List>>::value_type::element_type; - using __ovg2l_maps__value_type = typename decltype(__value->ovg2l_maps_)::value_type::element_type; - - size_t __ovg2l_maps__idx = 0; - for (auto &__ovg2l_maps__value: ovg2l_maps_) { - auto __value_ovg2l_maps_ = std::dynamic_pointer_cast<__ovg2l_maps__value_type>( - __ovg2l_maps__value->_Seal(client)); - __value->ovg2l_maps_.emplace_back(__value_ovg2l_maps_); - __value->meta_.AddMember("__ovg2l_maps_-" + std::to_string(__ovg2l_maps__idx), - __value_ovg2l_maps_); - __value_nbytes += __value_ovg2l_maps_->nbytes(); - __ovg2l_maps__idx += 1; - } - __value->meta_.AddKeyValue("__ovg2l_maps_-size", __value->ovg2l_maps_.size()); - - // using __edge_tables__value_type = typename List>::value_type::element_type; - using __edge_tables__value_type = typename decltype(__value->edge_tables_)::value_type::element_type; - - size_t __edge_tables__idx = 0; - for (auto &__edge_tables__value: edge_tables_) { - auto __value_edge_tables_ = std::dynamic_pointer_cast<__edge_tables__value_type>( - __edge_tables__value->_Seal(client)); - __value->edge_tables_.emplace_back(__value_edge_tables_); - __value->meta_.AddMember("__edge_tables_-" + std::to_string(__edge_tables__idx), - __value_edge_tables_); - __value_nbytes += __value_edge_tables_->nbytes(); - __edge_tables__idx += 1; - } - __value->meta_.AddKeyValue("__edge_tables_-size", __value->edge_tables_.size()); - - // using __ie_lists__value_type = typename List>>::value_type::value_type::element_type; - using __ie_lists__value_type = typename decltype(__value->ie_lists_)::value_type::value_type::element_type; - - size_t __ie_lists__idx = 0; - __value->ie_lists_.resize(ie_lists_.size()); - for (auto &__ie_lists__value_vec: ie_lists_) { - size_t __ie_lists__idy = 0; - __value->meta_.AddKeyValue("__ie_lists_-" + std::to_string(__ie_lists__idx) + "-size", __ie_lists__value_vec.size()); - for (auto &__ie_lists__value: __ie_lists__value_vec) { - auto __value_ie_lists_ = std::dynamic_pointer_cast<__ie_lists__value_type>( - __ie_lists__value->_Seal(client)); - __value->ie_lists_[__ie_lists__idx].emplace_back(__value_ie_lists_); - __value->meta_.AddMember("__ie_lists_-" + std::to_string(__ie_lists__idx) + "-" + std::to_string(__ie_lists__idy), - __value_ie_lists_); - __value_nbytes += __value_ie_lists_->nbytes(); - __ie_lists__idy += 1; - } - __ie_lists__idx += 1; - } - __value->meta_.AddKeyValue("__ie_lists_-size", __value->ie_lists_.size()); - - // using __oe_lists__value_type = typename List>>::value_type::value_type::element_type; - using __oe_lists__value_type = typename decltype(__value->oe_lists_)::value_type::value_type::element_type; - - size_t __oe_lists__idx = 0; - __value->oe_lists_.resize(oe_lists_.size()); - for (auto &__oe_lists__value_vec: oe_lists_) { - size_t __oe_lists__idy = 0; - __value->meta_.AddKeyValue("__oe_lists_-" + std::to_string(__oe_lists__idx) + "-size", __oe_lists__value_vec.size()); - for (auto &__oe_lists__value: __oe_lists__value_vec) { - auto __value_oe_lists_ = std::dynamic_pointer_cast<__oe_lists__value_type>( - __oe_lists__value->_Seal(client)); - __value->oe_lists_[__oe_lists__idx].emplace_back(__value_oe_lists_); - __value->meta_.AddMember("__oe_lists_-" + std::to_string(__oe_lists__idx) + "-" + std::to_string(__oe_lists__idy), - __value_oe_lists_); - __value_nbytes += __value_oe_lists_->nbytes(); - __oe_lists__idy += 1; - } - __oe_lists__idx += 1; - } - __value->meta_.AddKeyValue("__oe_lists_-size", __value->oe_lists_.size()); - - // using __ie_offsets_lists__value_type = typename List>>::value_type::value_type::element_type; - using __ie_offsets_lists__value_type = typename decltype(__value->ie_offsets_lists_)::value_type::value_type::element_type; - - size_t __ie_offsets_lists__idx = 0; - __value->ie_offsets_lists_.resize(ie_offsets_lists_.size()); - for (auto &__ie_offsets_lists__value_vec: ie_offsets_lists_) { - size_t __ie_offsets_lists__idy = 0; - __value->meta_.AddKeyValue("__ie_offsets_lists_-" + std::to_string(__ie_offsets_lists__idx) + "-size", __ie_offsets_lists__value_vec.size()); - for (auto &__ie_offsets_lists__value: __ie_offsets_lists__value_vec) { - auto __value_ie_offsets_lists_ = std::dynamic_pointer_cast<__ie_offsets_lists__value_type>( - __ie_offsets_lists__value->_Seal(client)); - __value->ie_offsets_lists_[__ie_offsets_lists__idx].emplace_back(__value_ie_offsets_lists_); - __value->meta_.AddMember("__ie_offsets_lists_-" + std::to_string(__ie_offsets_lists__idx) + "-" + std::to_string(__ie_offsets_lists__idy), - __value_ie_offsets_lists_); - __value_nbytes += __value_ie_offsets_lists_->nbytes(); - __ie_offsets_lists__idy += 1; - } - __ie_offsets_lists__idx += 1; - } - __value->meta_.AddKeyValue("__ie_offsets_lists_-size", __value->ie_offsets_lists_.size()); - - // using __oe_offsets_lists__value_type = typename List>>::value_type::value_type::element_type; - using __oe_offsets_lists__value_type = typename decltype(__value->oe_offsets_lists_)::value_type::value_type::element_type; - - size_t __oe_offsets_lists__idx = 0; - __value->oe_offsets_lists_.resize(oe_offsets_lists_.size()); - for (auto &__oe_offsets_lists__value_vec: oe_offsets_lists_) { - size_t __oe_offsets_lists__idy = 0; - __value->meta_.AddKeyValue("__oe_offsets_lists_-" + std::to_string(__oe_offsets_lists__idx) + "-size", __oe_offsets_lists__value_vec.size()); - for (auto &__oe_offsets_lists__value: __oe_offsets_lists__value_vec) { - auto __value_oe_offsets_lists_ = std::dynamic_pointer_cast<__oe_offsets_lists__value_type>( - __oe_offsets_lists__value->_Seal(client)); - __value->oe_offsets_lists_[__oe_offsets_lists__idx].emplace_back(__value_oe_offsets_lists_); - __value->meta_.AddMember("__oe_offsets_lists_-" + std::to_string(__oe_offsets_lists__idx) + "-" + std::to_string(__oe_offsets_lists__idy), - __value_oe_offsets_lists_); - __value_nbytes += __value_oe_offsets_lists_->nbytes(); - __oe_offsets_lists__idy += 1; - } - __oe_offsets_lists__idx += 1; - } - __value->meta_.AddKeyValue("__oe_offsets_lists_-size", __value->oe_offsets_lists_.size()); - - // using __vm_ptr__value_type = typename std::shared_ptr::element_type; - using __vm_ptr__value_type = typename decltype(__value->vm_ptr_)::element_type; - auto __value_vm_ptr_ = std::dynamic_pointer_cast<__vm_ptr__value_type>( - vm_ptr_->_Seal(client)); - __value->vm_ptr_ = __value_vm_ptr_; - __value->meta_.AddMember("vm_ptr_", __value->vm_ptr_); - __value_nbytes += __value_vm_ptr_->nbytes(); - - __value->schema_json_ = schema_json_; - __value->meta_.AddKeyValue("schema_json_", __value->schema_json_); - - __value->meta_.SetNBytes(__value_nbytes); - - VINEYARD_CHECK_OK(client.CreateMetaData(__value->meta_, __value->id_)); - - // mark the builder as sealed - this->set_sealed(true); - - - // run `PostConstruct` to return a valid object - __value->PostConstruct(__value->meta_); - - return std::static_pointer_cast(__value); - } - - Status Build(Client &client) override { - return Status::OK(); - } - - protected: - vineyard::fid_t fid_; - vineyard::fid_t fnum_; - bool directed_; - bool is_multigraph_; - property_graph_types::LABEL_ID_TYPE vertex_label_num_; - property_graph_types::LABEL_ID_TYPE edge_label_num_; - vineyard::String oid_type; - vineyard::String vid_type; - std::shared_ptr ivnums_; - std::shared_ptr ovnums_; - std::shared_ptr tvnums_; - std::vector> vertex_tables_; - std::vector> ovgid_lists_; - std::vector> ovg2l_maps_; - std::vector> edge_tables_; - std::vector>> ie_lists_; - std::vector>> oe_lists_; - std::vector>> ie_offsets_lists_; - std::vector>> oe_offsets_lists_; - std::shared_ptr vm_ptr_; - vineyard::json schema_json_; - - void set_fid_(vineyard::fid_t const &fid__) { - this->fid_ = fid__; - } - - void set_fnum_(vineyard::fid_t const &fnum__) { - this->fnum_ = fnum__; - } - - void set_directed_(bool const &directed__) { - this->directed_ = directed__; - } - - void set_is_multigraph_(bool const &is_multigraph__) { - this->is_multigraph_ = is_multigraph__; - } - - void set_vertex_label_num_(property_graph_types::LABEL_ID_TYPE const &vertex_label_num__) { - this->vertex_label_num_ = vertex_label_num__; - } - - void set_edge_label_num_(property_graph_types::LABEL_ID_TYPE const &edge_label_num__) { - this->edge_label_num_ = edge_label_num__; - } - - void set_oid_type(vineyard::String const &oid_type_) { - this->oid_type = oid_type_; - } - - void set_vid_type(vineyard::String const &vid_type_) { - this->vid_type = vid_type_; - } - - void set_ivnums_(std::shared_ptr const & ivnums__) { - this->ivnums_ = ivnums__; - } - - void set_ovnums_(std::shared_ptr const & ovnums__) { - this->ovnums_ = ovnums__; - } - - void set_tvnums_(std::shared_ptr const & tvnums__) { - this->tvnums_ = tvnums__; - } - - void set_vertex_tables_(std::vector> const &vertex_tables__) { - this->vertex_tables_ = vertex_tables__; - } - void set_vertex_tables_(size_t const idx, std::shared_ptr const &vertex_tables__) { - if (idx >= this->vertex_tables_.size()) { - this->vertex_tables_.resize(idx + 1); - } - this->vertex_tables_[idx] = vertex_tables__; - } - void add_vertex_tables_(std::shared_ptr const &vertex_tables__) { - this->vertex_tables_.emplace_back(vertex_tables__); - } - void remove_vertex_tables_(const size_t vertex_tables__index_) { - this->vertex_tables_.erase(this->vertex_tables_.begin() + vertex_tables__index_); - } - - void set_ovgid_lists_(std::vector> const &ovgid_lists__) { - this->ovgid_lists_ = ovgid_lists__; - } - void set_ovgid_lists_(size_t const idx, std::shared_ptr const &ovgid_lists__) { - if (idx >= this->ovgid_lists_.size()) { - this->ovgid_lists_.resize(idx + 1); - } - this->ovgid_lists_[idx] = ovgid_lists__; - } - void add_ovgid_lists_(std::shared_ptr const &ovgid_lists__) { - this->ovgid_lists_.emplace_back(ovgid_lists__); - } - void remove_ovgid_lists_(const size_t ovgid_lists__index_) { - this->ovgid_lists_.erase(this->ovgid_lists_.begin() + ovgid_lists__index_); - } - - void set_ovg2l_maps_(std::vector> const &ovg2l_maps__) { - this->ovg2l_maps_ = ovg2l_maps__; - } - void set_ovg2l_maps_(size_t const idx, std::shared_ptr const &ovg2l_maps__) { - if (idx >= this->ovg2l_maps_.size()) { - this->ovg2l_maps_.resize(idx + 1); - } - this->ovg2l_maps_[idx] = ovg2l_maps__; - } - void add_ovg2l_maps_(std::shared_ptr const &ovg2l_maps__) { - this->ovg2l_maps_.emplace_back(ovg2l_maps__); - } - void remove_ovg2l_maps_(const size_t ovg2l_maps__index_) { - this->ovg2l_maps_.erase(this->ovg2l_maps_.begin() + ovg2l_maps__index_); - } - - void set_edge_tables_(std::vector> const &edge_tables__) { - this->edge_tables_ = edge_tables__; - } - void set_edge_tables_(size_t const idx, std::shared_ptr const &edge_tables__) { - if (idx >= this->edge_tables_.size()) { - this->edge_tables_.resize(idx + 1); - } - this->edge_tables_[idx] = edge_tables__; - } - void add_edge_tables_(std::shared_ptr const &edge_tables__) { - this->edge_tables_.emplace_back(edge_tables__); - } - void remove_edge_tables_(const size_t edge_tables__index_) { - this->edge_tables_.erase(this->edge_tables_.begin() + edge_tables__index_); - } - - void set_ie_lists_(std::vector>> const &ie_lists__) { - this->ie_lists_ = ie_lists__; - } - void set_ie_lists_(size_t const idx, std::vector> const &ie_lists__) { - if (idx >= this->ie_lists_.size()) { - this->ie_lists_.resize(idx + 1); - } - this->ie_lists_[idx] = ie_lists__; - } - void set_ie_lists_(size_t const idx, size_t const idy, - std::shared_ptr const &ie_lists__) { - if (idx >= this->ie_lists_.size()) { - this->ie_lists_.resize(idx + 1); - } - if (idy >= this->ie_lists_[idx].size()) { - this->ie_lists_[idx].resize(idy + 1); - } - this->ie_lists_[idx][idy] = ie_lists__; - } - void add_ie_lists_(std::vector> const &ie_lists__) { - this->ie_lists_.emplace_back(ie_lists__); - } - void remove_ie_lists_(const size_t ie_lists__index_) { - this->ie_lists_.erase(this->ie_lists_.begin() + ie_lists__index_); - } - void remove_ie_lists_(const size_t ie_lists__index_, const size_t ie_lists__inner_index_) { - auto &ie_lists__inner_ = this->ie_lists_[ie_lists__index_]; - ie_lists__inner_.erase(ie_lists__inner_.begin() + ie_lists__inner_index_); - } - - void set_oe_lists_(std::vector>> const &oe_lists__) { - this->oe_lists_ = oe_lists__; - } - void set_oe_lists_(size_t const idx, std::vector> const &oe_lists__) { - if (idx >= this->oe_lists_.size()) { - this->oe_lists_.resize(idx + 1); - } - this->oe_lists_[idx] = oe_lists__; - } - void set_oe_lists_(size_t const idx, size_t const idy, - std::shared_ptr const &oe_lists__) { - if (idx >= this->oe_lists_.size()) { - this->oe_lists_.resize(idx + 1); - } - if (idy >= this->oe_lists_[idx].size()) { - this->oe_lists_[idx].resize(idy + 1); - } - this->oe_lists_[idx][idy] = oe_lists__; - } - void add_oe_lists_(std::vector> const &oe_lists__) { - this->oe_lists_.emplace_back(oe_lists__); - } - void remove_oe_lists_(const size_t oe_lists__index_) { - this->oe_lists_.erase(this->oe_lists_.begin() + oe_lists__index_); - } - void remove_oe_lists_(const size_t oe_lists__index_, const size_t oe_lists__inner_index_) { - auto &oe_lists__inner_ = this->oe_lists_[oe_lists__index_]; - oe_lists__inner_.erase(oe_lists__inner_.begin() + oe_lists__inner_index_); - } - - void set_ie_offsets_lists_(std::vector>> const &ie_offsets_lists__) { - this->ie_offsets_lists_ = ie_offsets_lists__; - } - void set_ie_offsets_lists_(size_t const idx, std::vector> const &ie_offsets_lists__) { - if (idx >= this->ie_offsets_lists_.size()) { - this->ie_offsets_lists_.resize(idx + 1); - } - this->ie_offsets_lists_[idx] = ie_offsets_lists__; - } - void set_ie_offsets_lists_(size_t const idx, size_t const idy, - std::shared_ptr const &ie_offsets_lists__) { - if (idx >= this->ie_offsets_lists_.size()) { - this->ie_offsets_lists_.resize(idx + 1); - } - if (idy >= this->ie_offsets_lists_[idx].size()) { - this->ie_offsets_lists_[idx].resize(idy + 1); - } - this->ie_offsets_lists_[idx][idy] = ie_offsets_lists__; - } - void add_ie_offsets_lists_(std::vector> const &ie_offsets_lists__) { - this->ie_offsets_lists_.emplace_back(ie_offsets_lists__); - } - void remove_ie_offsets_lists_(const size_t ie_offsets_lists__index_) { - this->ie_offsets_lists_.erase(this->ie_offsets_lists_.begin() + ie_offsets_lists__index_); - } - void remove_ie_offsets_lists_(const size_t ie_offsets_lists__index_, const size_t ie_offsets_lists__inner_index_) { - auto &ie_offsets_lists__inner_ = this->ie_offsets_lists_[ie_offsets_lists__index_]; - ie_offsets_lists__inner_.erase(ie_offsets_lists__inner_.begin() + ie_offsets_lists__inner_index_); - } - - void set_oe_offsets_lists_(std::vector>> const &oe_offsets_lists__) { - this->oe_offsets_lists_ = oe_offsets_lists__; - } - void set_oe_offsets_lists_(size_t const idx, std::vector> const &oe_offsets_lists__) { - if (idx >= this->oe_offsets_lists_.size()) { - this->oe_offsets_lists_.resize(idx + 1); - } - this->oe_offsets_lists_[idx] = oe_offsets_lists__; - } - void set_oe_offsets_lists_(size_t const idx, size_t const idy, - std::shared_ptr const &oe_offsets_lists__) { - if (idx >= this->oe_offsets_lists_.size()) { - this->oe_offsets_lists_.resize(idx + 1); - } - if (idy >= this->oe_offsets_lists_[idx].size()) { - this->oe_offsets_lists_[idx].resize(idy + 1); - } - this->oe_offsets_lists_[idx][idy] = oe_offsets_lists__; - } - void add_oe_offsets_lists_(std::vector> const &oe_offsets_lists__) { - this->oe_offsets_lists_.emplace_back(oe_offsets_lists__); - } - void remove_oe_offsets_lists_(const size_t oe_offsets_lists__index_) { - this->oe_offsets_lists_.erase(this->oe_offsets_lists_.begin() + oe_offsets_lists__index_); - } - void remove_oe_offsets_lists_(const size_t oe_offsets_lists__index_, const size_t oe_offsets_lists__inner_index_) { - auto &oe_offsets_lists__inner_ = this->oe_offsets_lists_[oe_offsets_lists__index_]; - oe_offsets_lists__inner_.erase(oe_offsets_lists__inner_.begin() + oe_offsets_lists__inner_index_); - } - - void set_vm_ptr_(std::shared_ptr const & vm_ptr__) { - this->vm_ptr_ = vm_ptr__; - } - - void set_schema_json_(vineyard::json const &schema_json__) { - this->schema_json_ = schema_json__; - } - - private: - friend class ArrowFragment; -}; - - -} // namespace vineyard - - - #endif // MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H diff --git a/modules/graph/fragment/graph_schema.grin.h b/modules/graph/fragment/graph_schema.grin.h index d581f88f9..c7cfc9cc2 100644 --- a/modules/graph/fragment/graph_schema.grin.h +++ b/modules/graph/fragment/graph_schema.grin.h @@ -98,7 +98,7 @@ class PropertyGraphSchema { PropertyGraphSchema() = default; - explicit PropertyGraphSchema(json const& json) { FromJSON(json); } + //explicit PropertyGraphSchema(json const& json) { FromJSON(json); } PropertyId GetVertexPropertyId(LabelId label_id, const std::string& name) const; From d789df98d950004a179275aa7ca606536e4e8ab1 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Mon, 13 Feb 2023 19:05:22 +0800 Subject: [PATCH 03/85] fix nbr, adjlist, project & dests --- grin/include/propertygraph/property.h | 2 +- grin/include/propertygraph/propertygraph.h | 2 +- modules/graph/fragment/arrow_fragment.grin.h | 89 ++++++----- modules/graph/fragment/property_graph_types.h | 142 ++++++++++++++++++ 4 files changed, 196 insertions(+), 39 deletions(-) diff --git a/grin/include/propertygraph/property.h b/grin/include/propertygraph/property.h index c0008d5c4..31173127b 100644 --- a/grin/include/propertygraph/property.h +++ b/grin/include/propertygraph/property.h @@ -15,7 +15,7 @@ limitations under the License. #ifndef GRIN_PROPERTY_GRAPH_PROPERTY_H_ #define GRIN_PROPERTY_GRAPH_PROPERTY_H_ -#include "grin/predefine.h" +#include "../predefine.h" #if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) char* get_property_name(const Graph, const Property); diff --git a/grin/include/propertygraph/propertygraph.h b/grin/include/propertygraph/propertygraph.h index 5275e59b9..38a507e33 100644 --- a/grin/include/propertygraph/propertygraph.h +++ b/grin/include/propertygraph/propertygraph.h @@ -36,7 +36,7 @@ Property get_vertex_property_from_id(const VertexLabel, const PropertyID); #if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) PropertyList get_all_edge_properties_from_label(const Graph, const EdgeLabel); #ifdef CONTINIOUS_EDGE_LABEL_ID_TRAIT -Property get_edge_property_from_id(const VertexLabel, const PropertyID); +Property get_edge_property_from_id(const EdgeLabel, const PropertyID); #endif #endif diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index a05a663ad..592f20964 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -646,61 +646,61 @@ class __attribute__((annotate("vineyard"))) ArrowFragment // vid_parser_.GetOffset(v.GetValue())); } -// inline adj_list_t GetIncomingAdjList(const vertex_t& v, label_id_t e_label) -// const { -// // // grin vertexlist continous_vid_trait get_vertex_from_vid ++++ -// // vid_t vid = v.GetValue(); -// // label_id_t v_label = vid_parser_.GetLabelId(vid); -// // int64_t v_offset = vid_parser_.GetOffset(vid); -// // const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; -// // const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; -// // return adj_list_t(&ie[offset_array[v_offset]], -// // &ie[offset_array[v_offset + 1]], -// // flatten_edge_tables_columns_[e_label]); -// } - - inline raw_adj_list_t GetIncomingRawAdjList(const vertex_t& v, - label_id_t e_label) const { + inline adj_list_t GetIncomingAdjList(const vertex_t& v, label_id_t e_label) + const { void* _v = get_vertex_from_id((void*)(&v.GetValue())); void* _label = get_edge_label_from_id((void*)(&e_label)); void* al = get_adjacent_list_by_edge_label(g_, Direction::IN, (void*)(&v), _label); - return adj_list_t(al, get_adjacent_list_size(al)); + return adj_list_t(g_, _label, al, get_adjacent_list_size(al)); + // // grin vertexlist continous_vid_trait get_vertex_from_vid ++++ // vid_t vid = v.GetValue(); // label_id_t v_label = vid_parser_.GetLabelId(vid); // int64_t v_offset = vid_parser_.GetOffset(vid); // const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; // const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; - // return raw_adj_list_t(&ie[offset_array[v_offset]], - // &ie[offset_array[v_offset + 1]]); + // return adj_list_t(&ie[offset_array[v_offset]], + // &ie[offset_array[v_offset + 1]], + // flatten_edge_tables_columns_[e_label]); } -// inline adj_list_t GetOutgoingAdjList(const vertex_t& v, label_id_t e_label) -// const { +// inline raw_adj_list_t GetIncomingRawAdjList(const vertex_t& v, +// label_id_t e_label) const { // vid_t vid = v.GetValue(); // label_id_t v_label = vid_parser_.GetLabelId(vid); // int64_t v_offset = vid_parser_.GetOffset(vid); -// const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; -// const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; -// return adj_list_t(&oe[offset_array[v_offset]], -// &oe[offset_array[v_offset + 1]], -// flatten_edge_tables_columns_[e_label]); +// const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; +// const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; +// return raw_adj_list_t(&ie[offset_array[v_offset]], +// &ie[offset_array[v_offset + 1]]); // } - inline raw_adj_list_t GetOutgoingRawAdjList(const vertex_t& v, - label_id_t e_label) const { + inline adj_list_t GetOutgoingAdjList(const vertex_t& v, label_id_t e_label) + const { void* _v = get_vertex_from_id((void*)(&v.GetValue())); void* _label = get_edge_label_from_id((void*)(&e_label)); void* al = get_adjacent_list_by_edge_label(g_, Direction::OUT, (void*)(&v), _label); - return adj_list_t(al, get_adjacent_list_size(al)); + return adj_list_t(g_, _label, al, get_adjacent_list_size(al)); // vid_t vid = v.GetValue(); // label_id_t v_label = vid_parser_.GetLabelId(vid); // int64_t v_offset = vid_parser_.GetOffset(vid); // const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; // const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; - // return raw_adj_list_t(&oe[offset_array[v_offset]], - // &oe[offset_array[v_offset + 1]]); + // return adj_list_t(&oe[offset_array[v_offset]], + // &oe[offset_array[v_offset + 1]], + // flatten_edge_tables_columns_[e_label]); } +// inline raw_adj_list_t GetOutgoingRawAdjList(const vertex_t& v, +// label_id_t e_label) const { +// vid_t vid = v.GetValue(); +// label_id_t v_label = vid_parser_.GetLabelId(vid); +// int64_t v_offset = vid_parser_.GetOffset(vid); +// const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; +// const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; +// return raw_adj_list_t(&oe[offset_array[v_offset]], +// &oe[offset_array[v_offset + 1]]); +// } + // /** // * N.B.: as an temporary solution, for POC of graph-learn, will be removed // * later. @@ -736,24 +736,27 @@ class __attribute__((annotate("vineyard"))) ArrowFragment // } inline grape::DestList IEDests(const vertex_t& v, label_id_t e_label) const { - int64_t offset = vid_parser_.GetOffset(v.GetValue()); - auto v_label = vertex_label(v); + void* _v = get_vertex_from_id((void*)(v.GetValue())); + void* _vertex_label = get_vertex_label(_v); + int64_t offset = v.GetValue() - InnerVertices(_vertex_label).begin_value(); return grape::DestList(idoffset_[v_label][e_label][offset], idoffset_[v_label][e_label][offset + 1]); } inline grape::DestList OEDests(const vertex_t& v, label_id_t e_label) const { - int64_t offset = vid_parser_.GetOffset(v.GetValue()); - auto v_label = vertex_label(v); + void* _v = get_vertex_from_id((void*)(v.GetValue())); + void* _vertex_label = get_vertex_label(_v); + int64_t offset = v.GetValue() - InnerVertices(_vertex_label).begin_value(); return grape::DestList(odoffset_[v_label][e_label][offset], odoffset_[v_label][e_label][offset + 1]); } inline grape::DestList IOEDests(const vertex_t& v, label_id_t e_label) const { - int64_t offset = vid_parser_.GetOffset(v.GetValue()); - auto v_label = vertex_label(v); + void* _v = get_vertex_from_id((void*)(v.GetValue())); + void* _vertex_label = get_vertex_label(_v); + int64_t offset = v.GetValue() - InnerVertices(_vertex_label).begin_value(); return grape::DestList(iodoffset_[v_label][e_label][offset], iodoffset_[v_label][e_label][offset + 1]); @@ -894,7 +897,19 @@ class __attribute__((annotate("vineyard"))) ArrowFragment void* Project( vineyard::Client & client, std::map> vertices, - std::map> edges); + std::map> edges) { + void* new_g; + for (auto& pair : vertices) { + void* vertex_label = get_vetex_label_from_id((void*)(&pair.first)); + void* property_list = create_property_list(); + for (auto& prop_id: pair.second) { + void* property = get_property_by_id(vertex_label, proper_id); + insert_property_to_list(property_list, property); + } + new_g = select_vertex_properties_for_label(g_, propertylist, vertex_label); + } + // same for edge + } // use grin property "select" private: void initPointers(); diff --git a/modules/graph/fragment/property_graph_types.h b/modules/graph/fragment/property_graph_types.h index 6c19890a2..e39d5637f 100644 --- a/modules/graph/fragment/property_graph_types.h +++ b/modules/graph/fragment/property_graph_types.h @@ -27,6 +27,10 @@ limitations under the License. #include "basic/ds/arrow.h" #include "common/util/arrow.h" +extern "C" { +#include "grin/topology/adjacentlist.h" +} + namespace vineyard { using fid_t = grape::fid_t; @@ -552,6 +556,144 @@ class AdjList { template using AdjListDefault = AdjList; +template +struct GRIN_Nbr { + private: + using vid_t = VID_T; + using eid_t = EID_T; + using prop_id_t = property_graph_types::PROP_ID_TYPE; + + public: + GRIN_Nbr(void* g, void* edge_label, void* adj_list, size_t current) { + g_ = g; + edge_label_ = edge_label; + adj_list_ = adj_list; + current_ = current; + if (current_ == 0) { + adj_list_iter_ = get_adjacent_list_begin(adj_list_); + property_list_ = get_all_edge_properties_from_label(edge_label_); + } else { + adj_list_iter_ = nullptr; + } + } + + grape::Vertex neighbor() const { + return grape::Vertex(neighbor_); + } + + grape::Vertex get_neighbor() const { + return grape::Vertex(neighbor_); + } + + EID_T edge_id() const { return eid_; } + + void* get_data(prop_id_t prop_id) const { + void* _edge = get_edge_from_label_id(edge_label_, eid_); + void* _row = get_edge_row(g_, _edge, property_list_); + void* _property = get_edge_property_from_id(edge_label_, prop_id); + return get_property_value_from_row(_row, _property); + } + + template + T get_data(prop_id_t prop_id) const { + return ValueGetter::Value(edata_arrays_[prop_id], nbr_->eid); + } + + std::string get_str(prop_id_t prop_id) const { + return ValueGetter::Value(edata_arrays_[prop_id], nbr_->eid); + } + + double get_double(prop_id_t prop_id) const { + return ValueGetter::Value(edata_arrays_[prop_id], nbr_->eid); + } + + int64_t get_int(prop_id_t prop_id) const { + return ValueGetter::Value(edata_arrays_[prop_id], nbr_->eid); + } + + inline const GRIN_Nbr& operator++() const { + ++current_; + add_current_value(); + return *this; + } + + inline bool operator==(const GRIN_Nbr& rhs) const { + return (current_ == rhs.current_) && (adj_list_ == rhs.adj_list_); + } + + inline bool operator!=(const GRIN_Nbr& rhs) const { + return (current_ != rhs.current_) || (adj_list_ != rhs.adj_list_); + } + + inline bool operator<(const GRIN_Nbr& rhs) const { + return (current_ < rhs.current_) && (adj_list_ == rhs.adj_list_);; + } + + inline const GRIN_Nbr& operator*() const { return *this; } + + private: + void add_current_value() { + adj_list_iter_ = get_next_adjacent_iter(adj_list_, adj_list_iter_); + void* v_ = get_neighbor_from_iter(adj_list_, adj_list_iter_); + VID_T* vptr = static_cast(get_vertex_id(v_)); + current_value_.neighbor = (*vptr); + EDATA_T* eptr = static_cast(get_adjacent_edge_data_value(adj_list_, adj_list_iter_)); + current_value_.data = (*eptr); + } + + void* g_; + void* edge_label_; + void* property_list_; + void* adj_list_; + void* adj_list_iter_; + size_t current_; + VID_T neighbor_; + EID_T eid_; +}; + +template +using GRIN_NbrDefault = GRIN_Nbr; + +template +class GRIN_AdjList { + public: + GRIN_AdjList() : g_(NULL), edge_label_(NULL), adj_list_(NULL), sz_(0), begin_(0), end_(0) {} + GRIN_AdjList(void* g, void* edge_label, void* adj_list, size_t sz) + : g_(g), edge_label_(edge_label), adj_list_(adj_list), sz_(sz), begin_(0), end_(sz) {} + + inline GRIN_Nbr begin() const { + return GRIN_Nbr(g_, edge_label_, adj_list_, begin_); + } + + inline GRIN_Nbr end() const { + return GRIN_Nbr(g_, edge_label_, adj_list_, end_); + } + + inline size_t Size() const { return sz_; } + + inline bool Empty() const { return sz_ == 0; } + + inline bool NotEmpty() const { return sz_ > 0; } + + size_t size() const { return sz_; } + + //inline const NbrUnit* begin_unit() const { return begin_; } + + //inline const NbrUnit* end_unit() const { return end_; } + + private: + const void* g_; + const void* edge_label_; + const void* adj_list_; + const size_t sz_; + const size_t begin_; + const size_t end_; +}; + +template +using GRIN_AdjListDefault = AdjList; + + /** * OffsetAdjList will offset the outer vertices' lid, makes it between "ivnum" * and "tvnum" instead of "ivnum ~ tvnum - outer vertex index" From 22b938ebbbc63e9529b7c28db0f33b830c3d5aad Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 14 Feb 2023 14:03:40 +0800 Subject: [PATCH 04/85] macro format --- grin/include/predefine.h | 98 ++++++++++++------- grin/include/propertygraph/label.h | 10 +- grin/include/propertygraph/propertygraph.h | 4 +- grin/include/topology/vertexlist.h | 2 +- modules/graph/fragment/arrow_fragment.grin.h | 6 +- modules/graph/fragment/property_graph_types.h | 26 ++--- 6 files changed, 84 insertions(+), 62 deletions(-) diff --git a/grin/include/predefine.h b/grin/include/predefine.h index 46a1a9741..8fe28ebf3 100644 --- a/grin/include/predefine.h +++ b/grin/include/predefine.h @@ -55,46 +55,50 @@ typedef enum { } DataType; /* The following macros are defined as the features of the storage. */ -// Note: mutable graph is currently NOT supported in grin-libgrape-lite -// #define MUTABLE_GRAPH // Graph is mutable -#define WITH_VERTEX_ORIGIN_ID // There is origin id for vertex semantic -#define WITH_VERTEX_DATA // There is data on vertex. -#define WITH_EDGE_DATA // There is data on edge, e.g. weight. -#define ENABLE_VERTEX_LIST // Enable the vertex list structure. -#define CONTINUOUS_VID_TRAIT // Enable continous index on vertext list. -#define ENABLE_ADJACENT_LIST // Enable the adjacent list structure. -// Note: edge_list is only used in vertex_cut fragment -#define ENABLE_EDGE_LIST // Enable the edge list structure. - -// The partition strategy. -#define PARTITION_STRATEGY EDGE_CUT -// There are all/part edges on local vertices. -#define EDGES_ON_LOCAL_VERTEX ALL -// There are all/part/none edges on non-local vertices. -#define EDGES_ON_NON_LOCAL_VERTEX NONE -// The direction of edges on local vertices. -#define EDGES_ON_LOCAL_VERTEX_DIRECTION BOTH +// #define MUTABLE_GRAPH // Graph is mutable, NOT supported in v6d +#define WITH_VERTEX_ORIGIN_ID // There is origin id for vertex semantic +// #define WITH_VERTEX_DATA // There is data on vertex. +// #define WITH_EDGE_DATA // There is data on edge, e.g. weight. +#define ENABLE_VERTEX_LIST // Enable the vertex list structure. +#define CONTINUOUS_VERTEX_ID_TRAIT // Enable continous vertex id for vertex list. +#define ENABLE_ADJACENT_LIST // Enable the adjacent list structure. +#define ENABLE_EDGE_LIST // Enable the edge list structure. + +#define PARTITION_STRATEGY EDGE_CUT // The partition strategy. +#define EDGES_ON_LOCAL_VERTEX ALL // There are all/part edges on local vertices. +#define EDGES_ON_NON_LOCAL_VERTEX NONE // There are all/part/none edges on non-local vertices. +#define EDGES_ON_LOCAL_VERTEX_DIRECTION BOTH // The direction of edges on local vertices. // propertygraph -#define WITH_VERTEX_LABEL -#define WITH_EDGE_LABEL -#define WITH_VERTEX_PROPERTY -#define WITH_EDGE_PROPERTY -#define COLUMN_STORE -#define CONTINIOUS_VERTEX_LABEL_ID_TRAIT -#define CONTINIOUS_EDGE_LABEL_ID_TRAIT +#define WITH_VERTEX_LABEL // There are labels on vertices. +#define WITH_VERTEX_PROPERTY // There is any property on vertices. +// #define WITH_VERTEX_PRIMARTY_KEYS // There are primary keys for vertex. +#define NATURAL_VERTEX_LABEL_ID_TRAIT // Vertex label has natural continuous id from 0. +#define WITH_EDGE_LABEL // There are labels for edges. +#define WITH_EDGE_PROPERTY // There is any property for edges. +#define NATURAL_EDGE_LABEL_ID_TRAIT // Edge label has natural continuous id from 0. +#define COLUMN_STORE // Column-oriented storage for properties. +#define NATURAL_PROPERTY_ID_TRAIT // Property has natural continuous id from 0. + +#define PROPERTY_ON_NON_LOCAL_VERTEX NONE // There are properties on non-local vertices. +#define PROPERTY_ON_NON_LOCAL_EDGE NONE // There are properties on non-local edges. +// #define ENABLE_PREDICATE // Enable predicates for vertices and edges. /* The followings macros are defined as invalid value. */ -#define NULL_TYPE NULL // Null type (null data type) -#define NULL_GRAPH NULL // Null graph handle (invalid return value). -#define NULL_VERTEX NULL // Null vertex handle (invalid return value). -#define NULL_EDGE NULL // Null edge handle (invalid return value). -#define NULL_PARTITION UINT_MAX // Null partition handle (invalid return value). -#define NULL_LIST NULL // Null list of any kind. +#define NULL_TYPE NULL // Null type (null data type) +#define NULL_GRAPH NULL // Null graph handle (invalid return value). +#define NULL_VERTEX NULL // Null vertex handle (invalid return value). +#define NULL_EDGE NULL // Null edge handle (invalid return value). +#define NULL_PARTITION UINT_MAX // Null partition handle (invalid return value). +#define NULL_LIST NULL // Null list of any kind. #define NULL_REMOTE_PARTITION UINT_MAX // same as partition. -#define NULL_REMOTE_VERTEX NULL // same as vertex. -#define NULL_REMOTE_EDGE NULL // same as edge. +#define NULL_REMOTE_VERTEX NULL // same as vertex. +#define NULL_REMOTE_EDGE NULL // same as edge. +#define NULL_VERTEX_LABEL // Null vertex label handle (invalid return value). +#define NULL_EDGE_LABEL // Null vertex label handle (invalid return value). +#define NULL_PROPERTY // Null property handle (invalid return value). +#define NULL_ROW // Null row handle (invalid return value). /* The following data types shall be defined through typedef. */ // local graph @@ -102,7 +106,6 @@ typedef void* Graph; // vertex typedef void* Vertex; -typedef void* VertexID; // vertex origin id #ifdef WITH_VERTEX_ORIGIN_ID @@ -120,6 +123,11 @@ typedef void* VertexList; typedef void* VertexListIterator; #endif +// vertex id +#ifdef CONTINUOUS_VERTEX_ID_TRAIT +typedef void* VertexID; +#endif + // adjacent list #ifdef ENABLE_ADJACENT_LIST typedef void* AdjacentList; @@ -134,6 +142,12 @@ typedef void* Edge; typedef void* EdgeData; #endif +// edge list +#ifdef ENABLE_EDGE_LIST +typedef void* EdgeList; +typedef void* EdgeListIterator; +#endif + // partitioned graph typedef void* PartitionedGraph; @@ -153,23 +167,31 @@ typedef RemoteVertex* RemoteVertexList; typedef Edge RemoteEdge; #ifdef WITH_VERTEX_LABEL -typedef void* VertexLabelID; typedef void* VertexLabel; typedef void* VertexLabelList; +#ifdef NATURAL_VERTEX_LABEL_ID_TRAIT +typedef void* VertexLabelID; +#endif #endif #ifdef WITH_EDGE_LABEL -typedef void* EdgeLabelID; typedef void* EdgeLabel; typedef void* EdgeLabelList; +#ifdef NATURAL_EDGE_LABEL_ID_TRAIT +typedef void* EdgeLabelID; +#endif #endif #if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) -typedef void* PropertyID; typedef void* Property; typedef void* PropertyList; +typedef void* PropertyListIterator; +#ifdef NATURAL_PROPERTY_ID_TRAIT +typedef void* PropertyID; +#endif typedef void* Row; typedef void* RowList; +typedef void* RowListIterator; #endif #endif // GRIN_INCLUDE_PREDEFINE_H_ diff --git a/grin/include/propertygraph/label.h b/grin/include/propertygraph/label.h index 2fb56702a..90167292a 100644 --- a/grin/include/propertygraph/label.h +++ b/grin/include/propertygraph/label.h @@ -33,9 +33,8 @@ bool insert_vertex_label_to_list(VertexLabelList, const VertexLabel); VertexLabel get_vertex_label(const Graph, const Vertex); char* get_vertex_label_name(const Graph, const VertexLabel); -#ifdef CONTINIOUS_VERTEX_LABEL_ID_TRAIT -VertexLabelID get_vertex_label_list_begin(const VertexLabelList); -VertexLabelID get_vertex_label_list_end(const VertexLabelList); + +#ifdef NATURAL_VERTEX_LABEL_ID_TRAIT VertexLabelID get_vertex_label_id(const VertexLabel); VertexLabel get_vertex_label_from_id(const VertexLabelID); #endif @@ -57,9 +56,8 @@ bool insert_edge_label_to_list(EdgeLabelList, const EdgeLabel); EdgeLabel get_edge_label(const Graph, const Edge); char* get_edge_label_name(const Graph, const EdgeLabel); -#ifdef CONTINIOUS_EDGE_LABEL_ID_TRAIT -EdgeLabelID get_edge_label_list_begin(const EdgeLabelList); -EdgeLabelID get_edge_label_list_end(const EdgeLabelList); + +#ifdef NATURAL_EDGE_LABEL_ID_TRAIT EdgeLabelID get_edge_label_id(const EdgeLabel); EdgeLabel get_edge_label_from_id(const EdgeLabelID); #endif diff --git a/grin/include/propertygraph/propertygraph.h b/grin/include/propertygraph/propertygraph.h index 38a507e33..d4a46890a 100644 --- a/grin/include/propertygraph/propertygraph.h +++ b/grin/include/propertygraph/propertygraph.h @@ -28,14 +28,14 @@ EdgeList get_edge_list_from_label(const Graph, const EdgeLabel); #if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) PropertyList get_all_vertex_properties_from_label(const Graph, const VertexLabel); -#ifdef CONTINIOUS_VERTEX_LABEL_ID_TRAIT +#ifdef NATURAL_PROPERTY_ID_TRAIT Property get_vertex_property_from_id(const VertexLabel, const PropertyID); #endif #endif #if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) PropertyList get_all_edge_properties_from_label(const Graph, const EdgeLabel); -#ifdef CONTINIOUS_EDGE_LABEL_ID_TRAIT +#ifdef NATURAL_PROPERTY_ID_TRAIT Property get_edge_property_from_id(const EdgeLabel, const PropertyID); #endif #endif diff --git a/grin/include/topology/vertexlist.h b/grin/include/topology/vertexlist.h index d5d7f2d94..f25890352 100644 --- a/grin/include/topology/vertexlist.h +++ b/grin/include/topology/vertexlist.h @@ -38,7 +38,7 @@ bool has_next_vertex_iter(const VertexList, const VertexListIterator); Vertex get_vertex_from_iter(const VertexList, const VertexListIterator); -#ifdef CONTINUOUS_VID_TRAIT +#ifdef CONTINUOUS_VERTEX_ID_TRAIT VertexID get_begin_vertex_id_from_list(const VertexList); VertexID get_end_vertex_id_from_list(const VertexList); diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index 592f20964..b324e8dda 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -355,7 +355,7 @@ class __attribute__((annotate("vineyard"))) ArrowFragment // } vertex_range_t Vertices(label_id_t label_id) const { - //continious vid trait + //continuous vid trait void* _label = get_vertex_label_from_id((void*)(&label_id)); void* vlh = get_vertex_list_by_label(pg_, fid_, _label); void* beginh = get_begin_vertex_id_from_list(vlh); @@ -366,7 +366,7 @@ class __attribute__((annotate("vineyard"))) ArrowFragment } vertex_range_t InnerVertices(label_id_t label_id) const { - //continious vid trait + //continuous vid trait void* _label = get_vertex_label_from_id((void*)(&label_id)); void* vlh = get_local_vertices_by_label(pg_, fid_, _label); void* beginh = get_begin_vertex_id_from_list(vlh); @@ -377,7 +377,7 @@ class __attribute__((annotate("vineyard"))) ArrowFragment } vertex_range_t OuterVertices(label_id_t label_id) const { - //continious vid trait + //continuous vid trait void* _label = get_vertex_label_from_id((void*)(&label_id)); void* vlh = get_remote_vertices_by_label(pg_, fid_, _label); void* beginh = get_begin_vertex_id_from_list(vlh); diff --git a/modules/graph/fragment/property_graph_types.h b/modules/graph/fragment/property_graph_types.h index e39d5637f..2ee492d65 100644 --- a/modules/graph/fragment/property_graph_types.h +++ b/modules/graph/fragment/property_graph_types.h @@ -588,27 +588,30 @@ struct GRIN_Nbr { EID_T edge_id() const { return eid_; } void* get_data(prop_id_t prop_id) const { - void* _edge = get_edge_from_label_id(edge_label_, eid_); - void* _row = get_edge_row(g_, _edge, property_list_); + void* _row = get_edge_row(g_, edge_, property_list_); void* _property = get_edge_property_from_id(edge_label_, prop_id); return get_property_value_from_row(_row, _property); } template T get_data(prop_id_t prop_id) const { - return ValueGetter::Value(edata_arrays_[prop_id], nbr_->eid); + void* _data = get_data(prop_id); + return *(static_cast(_data)); } std::string get_str(prop_id_t prop_id) const { - return ValueGetter::Value(edata_arrays_[prop_id], nbr_->eid); + void* _data = get_data(prop_id); + return *(static_cast(_data)); } double get_double(prop_id_t prop_id) const { - return ValueGetter::Value(edata_arrays_[prop_id], nbr_->eid); + void* _data = get_data(prop_id); + return *(static_cast(_data)); } int64_t get_int(prop_id_t prop_id) const { - return ValueGetter::Value(edata_arrays_[prop_id], nbr_->eid); + void* _data = get_data(prop_id); + return *(static_cast(_data)); } inline const GRIN_Nbr& operator++() const { @@ -634,11 +637,10 @@ struct GRIN_Nbr { private: void add_current_value() { adj_list_iter_ = get_next_adjacent_iter(adj_list_, adj_list_iter_); - void* v_ = get_neighbor_from_iter(adj_list_, adj_list_iter_); - VID_T* vptr = static_cast(get_vertex_id(v_)); - current_value_.neighbor = (*vptr); - EDATA_T* eptr = static_cast(get_adjacent_edge_data_value(adj_list_, adj_list_iter_)); - current_value_.data = (*eptr); + void* _v = get_neighbor_from_iter(adj_list_, adj_list_iter_); + void* _vid = get_vertex_id(_v); + neighbor_ = *(static_cast(_vid)); + edge_ = get_edge_from_iter(adj_list_, adj_list_iter); } void* g_; @@ -648,7 +650,7 @@ struct GRIN_Nbr { void* adj_list_iter_; size_t current_; VID_T neighbor_; - EID_T eid_; + void* edge_; }; template From a526c0d68e1a4726a119f8cc5fbfdaf4f55af862 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 15 Feb 2023 18:03:17 +0800 Subject: [PATCH 05/85] reorg iterator logic & partition logic & property row logic --- grin/include/partition/partition.h | 161 +++++++++--------- grin/include/predefine.h | 160 +++++++---------- .../{propertygraph => property}/label.h | 61 ++++--- .../{propertygraph => property}/primarykey.h | 8 +- grin/include/property/property.h | 51 ++++++ grin/include/property/propertylist.h | 88 ++++++++++ grin/include/propertygraph/property.h | 87 ---------- grin/include/propertygraph/propertygraph.h | 72 -------- grin/include/topology/adjacentlist.h | 19 +-- grin/include/topology/edgelist.h | 26 ++- grin/include/topology/structure.h | 26 ++- grin/include/topology/vertexlist.h | 26 ++- 12 files changed, 387 insertions(+), 398 deletions(-) rename grin/include/{propertygraph => property}/label.h (78%) rename grin/include/{propertygraph => property}/primarykey.h (82%) create mode 100644 grin/include/property/property.h create mode 100644 grin/include/property/propertylist.h delete mode 100644 grin/include/propertygraph/property.h delete mode 100644 grin/include/propertygraph/propertygraph.h diff --git a/grin/include/partition/partition.h b/grin/include/partition/partition.h index a7f232872..8beda5c31 100644 --- a/grin/include/partition/partition.h +++ b/grin/include/partition/partition.h @@ -18,138 +18,137 @@ limitations under the License. #include "../predefine.h" -#ifdef PARTITION_STRATEGY - +#ifdef ENABLE_GRAPH_PARTITION // basic partition informations size_t get_total_partitions_number(const PartitionedGraph); size_t get_total_vertices_number(const PartitionedGraph); -PartitionList get_local_partitions(const PartitionedGraph); +size_t get_total_edges_number(const PartitionedGraph); + + +// partition list +PartitionList get_local_partition_list(const PartitionedGraph); void destroy_partition_list(PartitionList); +PartitionList create_partition_list(); + +bool insert_partition_to_list(PartitionList, const Partition); + size_t get_partition_list_size(const PartitionList); Partition get_partition_from_list(const PartitionList, const size_t); -#ifdef MUTABLE_GRAPH -PartitionList create_partition_list(); -bool insert_partition_to_list(PartitionList, const Partition); +#ifdef NATURAL_PARTITION_ID_TRAIT +Partition get_partition_from_id(const PartitionID); + +PartitionID get_partition_id(const Partition); #endif -void* get_partition_info(const Partition); +void* get_partition_info(const PartitionedGraph, const Partition); Graph get_local_graph_from_partition(const PartitionedGraph, const Partition); -// serialization & deserialization -char* serialize_remote_partition(const PartitionedGraph, const RemotePartition); -char* serialize_remote_vertex(const PartitionedGraph, const RemoteVertex); +// master & mirror vertices for vertexcut partition +// while they refer to inner & outer vertices in edgecut partition +#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST) +VertexList get_master_vertices(const Graph); -char* serialize_remote_vertex_with_data(const PartitionedGraph, - const RemoteVertex, const VertexData); +VertexList get_mirror_vertices(const Graph); -char* serialize_remote_edge(const PartitionedGraph, const RemoteEdge); +VertexList get_mirror_vertices_by_partition(const Graph, const Partition); -Partition get_partition_from_deserialization(const PartitionedGraph, - const char*); +#ifdef WITH_VERTEX_LABEL +VertexList get_master_vertices_by_label(const Graph, const VertexLabel); -Vertex get_vertex_from_deserialization(const PartitionedGraph, const Partition, - const char*); +VertexList get_mirror_vertices_by_label(const Graph, const VertexLabel); -Vertex get_vertex_from_deserialization_with_data(const PartitionedGraph, - const Partition, const char*, - VertexData); +VertexList get_mirror_vertices_by_label_partition(const Graph, const VertexLabel, const Partition); +#endif +#endif -Edge get_edge_from_deserialization(const PartitionedGraph, const Partition, - const char*); +#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_ADJACENT_LIST) +AdjacentList get_adjacent_master_list(const Graph, const Direction, const Vertex); -// For local vertex: could get its properties locally, but not sure to have all -// its edges locally, which depends on the partition strategy; every vertex -// could be local in 1~n partitions. -bool is_local_vertex(const PartitionedGraph, const Partition, Vertex); +AdjacentList get_adjacent_mirror_list(const Graph, const Direction, const Vertex); -bool is_remote_vertex(const PartitionedGraph, const Partition, Vertex); +AdjacentList get_adjacent_mirror_list_by_partition(const Graph, const Direction, + const Partition, const Vertex); +#endif -// For local edge: could get its properties locally; -// every edge could be local in 1/2/n partitions -bool is_local_edge(const PartitionedGraph, const Partition, const Edge); -// For a non-local vertex/edge, get its master partition (a remote partition); -// also, we can get its master vertex/edge (a remote vertex/edge); -// for a local vertex/edge, an invalid value would be returned -RemotePartition get_master_partition_for_vertex(const PartitionedGraph, - const Partition, Vertex); +// Vertex ref refers to the same vertex referred in other partitions, +// while edge ref is likewise. And both can be serialized to char* for +// message transporting nd deserialized on the other end. +VertexRef get_vertex_ref_for_vertex(const Graph, const Partition, const Vertex); -RemotePartition get_master_partition_for_edge(const PartitionedGraph, - const Partition, const Edge); +VertexRef get_master_vertex_ref_for_vertex(const Graph, const Vertex); -RemoteVertex get_master_vertex_for_vertex(const PartitionedGraph, - const Partition, Vertex); +char* serialize_vertex_ref(const Graph, const VertexRef); -RemoteEdge get_master_edge_for_edge(const PartitionedGraph, const Partition, - const Edge); +Vertex get_vertex_from_deserialization(const Graph, const Partition, const char*); -// get the partitions in which a vertex exists -RemotePartitionList get_remote_partition_list_for_vertex(const PartitionedGraph, - const Partition, - Vertex); +EdgeRef get_edge_ref_for_edge(const Graph, const Partition, const Edge); -void destroy_remote_partition_list(RemotePartitionList); +EdgeRef get_master_edge_ref_for_edge(const Graph, const Edge); -size_t get_remote_partition_list_size(const RemotePartitionList); +char* serialize_edge_ref(const Graph, const EdgeRef); -RemotePartition get_remote_partition_from_list(const RemotePartitionList, - const size_t); +Edge get_edge_from_deserialization(const Graph, const Partition, const char*); -#ifdef MUTABLE_GRAPH -RemotePartitionList create_remote_partition_list(); -bool insert_remote_partition_to_list(RemotePartitionList, - const RemotePartition); -#endif -// get the replicas of a vertex -RemoteVertexList get_all_replicas_for_vertex(const PartitionedGraph, - const Partition, Vertex); +// The concept of local_complete refers to whether we can get complete data or properties +// locally in the partition. It is orthogonal to the concept of master/mirror which +// is mainly designed for data aggregation. In some extremely cases, master vertices +// may NOT contain all the data or properties locally. +bool is_vertex_data_local_complete(const Graph, const Vertex); -void destroy_remote_vertex_list(RemoteVertexList); +bool is_vertex_property_local_complete(const Graph, const Vertex); -size_t get_remote_vertex_list_size(const RemoteVertexList); +bool is_edge_data_local_complete(const Graph, const Edge); -RemoteVertex get_remote_vertex_from_list(const RemoteVertexList, const size_t); +bool is_edge_property_local_complete(const Graph, const Edge); -#ifdef MUTABLE_GRAPH -RemoteVertexList create_remote_vertex_list(); -bool insert_remote_vertex_to_list(RemoteVertexList, const RemoteVertex); -#endif +// use valid vertex refs of vertex v (i.e., vertex v refered in other partitions) +// to help aggregate data/property when v is NOT local_complete +#ifdef ENABLE_VALID_VERTEX_REF_LIST +VertexRefList get_all_valid_vertex_ref_list_for_vertex(const Graph, const Vertex); + +void destroy_vertex_ref_list(VertexRefList); + +size_t get_vertex_ref_list_size(const VertexRefList); + +VertexRef get_vertex_ref_from_list(const VertexRefList, size_t); #endif -#if defined(PARTITION_STRATEGY) && defined(ENABLE_VERTEX_LIST) -VertexList get_local_vertices(const PartitionedGraph, const Partition); +#ifdef ENABLE_VALID_VERTEX_REF_LIST_ITERATOR +VertexRefListIterator get_all_valid_vertex_ref_list_begin_for_vertex(const Graph, const Vertex); -VertexList get_remote_vertices(const PartitionedGraph, const Partition); +bool get_next_vertex_ref_list_iter(VertexRefListIterator); -#ifdef WITH_VERTEX_LABEL -VertexList get_local_vertices_by_label(const PartitionedGraph, const Partition, const VertexLabel); -VertexList get_remote_vertices_by_label(const PartitionedGraph, const Partition, const VertexLabel); +VertexRef get_vertex_ref_from_iter(VertexRefListIterator); #endif -VertexList get_remote_vertices_by_partition(const PartitionedGraph, - const RemotePartition); +#ifdef ENABLE_VALID_EDGE_REF_LIST +EdgeRefList get_all_valid_edge_ref_list_for_edge(const Graph, const Edge); + +void destroy_edge_ref_list(EdgeRefList); + +size_t get_edge_ref_list_size(const EdgeRefList); + +EdgeRef get_edge_ref_from_list(const EdgeRefList, size_t); #endif -#if defined(PARTITION_STRATEGY) && defined(ENABLE_ADJACENT_LIST) -AdjacentList get_local_adjacent_list(const PartitionedGraph, const Direction, - const Partition, Vertex); +#ifdef ENABLE_VALID_EDGE_REF_LIST_ITERATOR +EdgeRefListIterator get_all_valid_edge_ref_list_begin_for_edge(const Graph, const Edge); + +bool get_next_edge_ref_list_iter(EdgeRefListIterator); -AdjacentList get_remote_adjacent_list(const PartitionedGraph, const Direction, - const Partition, Vertex); +EdgeRef get_edge_ref_from_iter(EdgeRefListIterator); +#endif -AdjacentList get_remote_adjacent_list_by_partition(const PartitionedGraph, - const Direction, - const Partition, - Vertex); #endif #endif // GRIN_INCLUDE_PARTITION_PARTITION_H_ diff --git a/grin/include/predefine.h b/grin/include/predefine.h index 8fe28ebf3..a6f77096b 100644 --- a/grin/include/predefine.h +++ b/grin/include/predefine.h @@ -15,7 +15,6 @@ limitations under the License. #ifndef GRIN_INCLUDE_PREDEFINE_H_ #define GRIN_INCLUDE_PREDEFINE_H_ -#include #include #include @@ -26,20 +25,6 @@ typedef enum { BOTH = 2, } Direction; -// The enum type for partition strategies. -typedef enum { - VERTEX_CUT = 0, - EDGE_CUT = 1, - HYBRID = 2, -} PartitionStrategy; - -// The enum type for replicate-edge strategies. -typedef enum { - ALL = 0, - PART = 1, - NONE = 2, -} ReplicateEdgeStrategy; - // The enum type for vertex/edge data type. typedef enum { Undefined = 0, @@ -55,19 +40,25 @@ typedef enum { } DataType; /* The following macros are defined as the features of the storage. */ -// #define MUTABLE_GRAPH // Graph is mutable, NOT supported in v6d -#define WITH_VERTEX_ORIGIN_ID // There is origin id for vertex semantic -// #define WITH_VERTEX_DATA // There is data on vertex. -// #define WITH_EDGE_DATA // There is data on edge, e.g. weight. -#define ENABLE_VERTEX_LIST // Enable the vertex list structure. -#define CONTINUOUS_VERTEX_ID_TRAIT // Enable continous vertex id for vertex list. -#define ENABLE_ADJACENT_LIST // Enable the adjacent list structure. -#define ENABLE_EDGE_LIST // Enable the edge list structure. - -#define PARTITION_STRATEGY EDGE_CUT // The partition strategy. -#define EDGES_ON_LOCAL_VERTEX ALL // There are all/part edges on local vertices. -#define EDGES_ON_NON_LOCAL_VERTEX NONE // There are all/part/none edges on non-local vertices. -#define EDGES_ON_LOCAL_VERTEX_DIRECTION BOTH // The direction of edges on local vertices. +#define WITH_VERTEX_ORIGIN_ID // There is origin id for vertex semantic +// #define WITH_VERTEX_DATA // There is data on vertex. +// #define WITH_EDGE_DATA // There is data on edge, e.g. weight. +#define ENABLE_VERTEX_LIST // Enable the vertex list structure. +// #define ENABLE_VERTEX_LIST_ITERATOR // There is vertex list iterator for unknown size list. +#define CONTINUOUS_VERTEX_ID_TRAIT // Enable continous vertex id for vertex list. +#define ENABLE_EDGE_LIST // Enable the edge list structure. +// #define ENABLE_EDGE_LIST_ITERATOR // There is edge list iterator for unknown size list. +#define ENABLE_ADJACENT_LIST // Enable the adjacent list structure. +// #define ENABLE_ADJACENT_LIST_ITERATOR // There is adjacent list iterator for unknown size list. + +// partitioned graph +#define ENABLE_GRAPH_PARTITION // Enable partitioned graph. +#define NATURAL_PARTITION_ID_TRAIT // Partition has natural continuous id from 0. +// #define ENABLE_VALID_VERTEX_REF_LIST // There is valid vertex ref list for vertex +// #define ENABLE_VALID_VERTEX_REF_LIST_ITERATOR // There is valid vertex ref list iterator for vertex +// #define ENABLE_VALID_EDGE_REF_LIST // There is valid edge ref list for edge +// #define ENABLE_VALID_EDGE_REF_LIST_ITERATOR // There is valid edge ref list iterator for vertex + // propertygraph #define WITH_VERTEX_LABEL // There are labels on vertices. @@ -79,98 +70,79 @@ typedef enum { #define NATURAL_EDGE_LABEL_ID_TRAIT // Edge label has natural continuous id from 0. #define COLUMN_STORE // Column-oriented storage for properties. #define NATURAL_PROPERTY_ID_TRAIT // Property has natural continuous id from 0. +#define ENABLE_ROW_LIST // Enable row list to access property value -#define PROPERTY_ON_NON_LOCAL_VERTEX NONE // There are properties on non-local vertices. -#define PROPERTY_ON_NON_LOCAL_EDGE NONE // There are properties on non-local edges. + +// predicate // #define ENABLE_PREDICATE // Enable predicates for vertices and edges. /* The followings macros are defined as invalid value. */ -#define NULL_TYPE NULL // Null type (null data type) -#define NULL_GRAPH NULL // Null graph handle (invalid return value). -#define NULL_VERTEX NULL // Null vertex handle (invalid return value). -#define NULL_EDGE NULL // Null edge handle (invalid return value). -#define NULL_PARTITION UINT_MAX // Null partition handle (invalid return value). -#define NULL_LIST NULL // Null list of any kind. -#define NULL_REMOTE_PARTITION UINT_MAX // same as partition. -#define NULL_REMOTE_VERTEX NULL // same as vertex. -#define NULL_REMOTE_EDGE NULL // same as edge. -#define NULL_VERTEX_LABEL // Null vertex label handle (invalid return value). -#define NULL_EDGE_LABEL // Null vertex label handle (invalid return value). -#define NULL_PROPERTY // Null property handle (invalid return value). -#define NULL_ROW // Null row handle (invalid return value). +#define NULL_TYPE NULL // Null type (null data type) +#define NULL_GRAPH NULL // Null graph handle (invalid return value). +#define NULL_VERTEX NULL // Null vertex handle (invalid return value). +#define NULL_EDGE NULL // Null edge handle (invalid return value). +#define NULL_LIST NULL // Null list of any kind (invalid return value). +#define NULL_PARTITION NULL // Null partition handle (invalid return value). +#define NULL_VERTEX_REF NULL // Null vertex ref (invalid return value). +#define NULL_EDGE_REF NULL // Null edge ref (invalid return value). +#define NULL_VERTEX_LABEL NULL // Null vertex label handle (invalid return value). +#define NULL_EDGE_LABEL NULL // Null edge label handle (invalid return value). +#define NULL_PROPERTY NULL // Null property handle (invalid return value). +#define NULL_ROW NULL // Null row handle (invalid return value). /* The following data types shall be defined through typedef. */ -// local graph -typedef void* Graph; - -// vertex -typedef void* Vertex; +typedef void* Graph; +typedef void* Vertex; +typedef void* Edge; -// vertex origin id #ifdef WITH_VERTEX_ORIGIN_ID -typedef void* OriginID; +typedef void* OriginID; #endif - -// vertex data #ifdef WITH_VERTEX_DATA -typedef void* VertexData; +typedef void* VertexData; #endif - -// vertex list #ifdef ENABLE_VERTEX_LIST -typedef void* VertexList; -typedef void* VertexListIterator; +typedef void* VertexList; +#endif +#ifdef ENABLE_VERTEX_LIST_ITERATOR +typedef void* VertexListIterator; #endif - -// vertex id #ifdef CONTINUOUS_VERTEX_ID_TRAIT -typedef void* VertexID; +typedef void* VertexID; #endif - -// adjacent list #ifdef ENABLE_ADJACENT_LIST -typedef void* AdjacentList; -typedef void* AdjacentListIterator; +typedef void* AdjacentList; +#endif +#ifdef ENABLE_ADJACENT_LIST_ITERATOR +typedef void* AdjacentListIterator; #endif - -// edge -typedef void* Edge; - -// edge data #ifdef WITH_EDGE_DATA -typedef void* EdgeData; +typedef void* EdgeData; #endif - -// edge list #ifdef ENABLE_EDGE_LIST -typedef void* EdgeList; -typedef void* EdgeListIterator; +typedef void* EdgeList; +#endif +#ifdef ENABLE_EDGE_LIST_ITERATOR +typedef void* EdgeListIterator; #endif -// partitioned graph +#ifdef ENABLE_GRAPH_PARTITION typedef void* PartitionedGraph; - -// partition and partition list -typedef unsigned Partition; -typedef Partition* PartitionList; - -// remote partition and remote partition list -typedef Partition RemotePartition; -typedef PartitionList RemotePartitionList; - -// remote vertex and remote vertex list -typedef Vertex RemoteVertex; -typedef RemoteVertex* RemoteVertexList; - -// remote edge -typedef Edge RemoteEdge; +typedef void* Partition; +typedef void* PartitionList; +#ifdef NATURAL_PARTITION_ID_TRAIT +typedef unsigned PartitionID; +#endif +typedef void* VertexRef; +typedef void* EdgeRef; +#endif #ifdef WITH_VERTEX_LABEL typedef void* VertexLabel; typedef void* VertexLabelList; #ifdef NATURAL_VERTEX_LABEL_ID_TRAIT -typedef void* VertexLabelID; +typedef unsigned VertexLabelID; #endif #endif @@ -178,20 +150,18 @@ typedef void* VertexLabelID; typedef void* EdgeLabel; typedef void* EdgeLabelList; #ifdef NATURAL_EDGE_LABEL_ID_TRAIT -typedef void* EdgeLabelID; +typedef unsigned EdgeLabelID; #endif #endif #if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) typedef void* Property; typedef void* PropertyList; -typedef void* PropertyListIterator; #ifdef NATURAL_PROPERTY_ID_TRAIT -typedef void* PropertyID; +typedef unsigned PropertyID; #endif typedef void* Row; typedef void* RowList; -typedef void* RowListIterator; #endif #endif // GRIN_INCLUDE_PREDEFINE_H_ diff --git a/grin/include/propertygraph/label.h b/grin/include/property/label.h similarity index 78% rename from grin/include/propertygraph/label.h rename to grin/include/property/label.h index 90167292a..b65e130f7 100644 --- a/grin/include/propertygraph/label.h +++ b/grin/include/property/label.h @@ -12,61 +12,76 @@ limitations under the License. // This header file is not available for libgrape-lite. -#ifndef GRIN_PROPERTY_GRAPH_LABEL_H_ -#define GRIN_PROPERTY_GRAPH_LABEL_H_ +#ifndef GRIN_INCLUDE_PROPERTY_LABEL_H_ +#define GRIN_INCLUDE_PROPERTY_LABEL_H_ #include "../predefine.h" #ifdef WITH_VERTEX_LABEL -VertexLabelList get_vertex_labels(const Graph); - -size_t get_vertex_label_list_size(const VertexLabelList); - -VertexLabel get_vertex_label_from_list(const VertexLabelList, const size_t); - -VertexLabelList create_vertex_label_list(); - -void destroy_vertex_label_list(VertexLabelList); - -bool insert_vertex_label_to_list(VertexLabelList, const VertexLabel); - +// Vertex label VertexLabel get_vertex_label(const Graph, const Vertex); char* get_vertex_label_name(const Graph, const VertexLabel); #ifdef NATURAL_VERTEX_LABEL_ID_TRAIT VertexLabelID get_vertex_label_id(const VertexLabel); + VertexLabel get_vertex_label_from_id(const VertexLabelID); #endif -#endif -#ifdef WITH_EDGE_LABEL -EdgeLabelList get_edge_labels(const Graph); +// Vertex label list +VertexLabelList get_vertex_label_list(const Graph); -size_t get_edge_label_list_size(const EdgeLabelList); +void destroy_vertex_label_list(VertexLabelList); -EdgeLabel get_edge_label_from_list(const EdgeLabelList, const size_t); +VertexLabelList create_vertex_label_list(); -EdgeLabelList create_edge_label_list(); +bool insert_vertex_label_to_list(VertexLabelList, const VertexLabel); -void destroy_edge_label_list(EdgeLabelList); +size_t get_vertex_label_list_size(const VertexLabelList); -bool insert_edge_label_to_list(EdgeLabelList, const EdgeLabel); +VertexLabel get_vertex_label_from_list(const VertexLabelList, const size_t); +#endif +#ifdef WITH_EDGE_LABEL +// Edge label EdgeLabel get_edge_label(const Graph, const Edge); char* get_edge_label_name(const Graph, const EdgeLabel); #ifdef NATURAL_EDGE_LABEL_ID_TRAIT EdgeLabelID get_edge_label_id(const EdgeLabel); + EdgeLabel get_edge_label_from_id(const EdgeLabelID); #endif + +// Edge label list +EdgeLabelList get_edge_label_list(const Graph); + +void destroy_edge_label_list(EdgeLabelList); + +EdgeLabelList create_edge_label_list(); + +bool insert_edge_label_to_list(EdgeLabelList, const EdgeLabel); + +size_t get_edge_label_list_size(const EdgeLabelList); + +EdgeLabel get_edge_label_from_list(const EdgeLabelList, const size_t); #endif + #if defined(WITH_VERTEX_LABEL) && defined(WITH_EDGE_LABEL) VertexLabel get_src_label_from_edge_label(const Graph, const EdgeLabel); VertexLabel get_dst_label_from_edge_label(const Graph, const EdgeLabel); #endif -#endif // GRIN_PROPERTY_GRAPH_LABEL_H_ \ No newline at end of file +#if defined(WITH_VERTEX_LABEL) && defined(ENABLE_VERTEX_LIST) +VertexList get_vertex_list_by_label(const Graph, const VertexLabel); +#endif + +#if defined(WITH_EDGE_LABEL) && defined(ENABLE_EDGE_LIST) +EdgeList get_edge_list_by_label(const Graph, const EdgeLabel); +#endif + +#endif // GRIN_INCLUDE_PROPERTY_LABEL_H_ \ No newline at end of file diff --git a/grin/include/propertygraph/primarykey.h b/grin/include/property/primarykey.h similarity index 82% rename from grin/include/propertygraph/primarykey.h rename to grin/include/property/primarykey.h index 5e3607c1a..491af4a09 100644 --- a/grin/include/propertygraph/primarykey.h +++ b/grin/include/property/primarykey.h @@ -12,10 +12,10 @@ limitations under the License. // This header file is not available for libgrape-lite. -#ifndef GRIN_PROPERTY_GRAPH_PRIMARY_KEY_H_ -#define GRIN_PROPERTY_GRAPH_PRIMARY_KEY_H_ +#ifndef GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ +#define GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ -#include "grin/predefine.h" +#include "../predefine.h" #ifdef WITH_VERTEX_PRIMARTY_KEYS @@ -25,4 +25,4 @@ Vertex get_vertex_from_primay_keys(const Graph, const Row); #endif -#endif // GRIN_PROPERTY_GRAPH_PRIMARY_KEY_H_ \ No newline at end of file +#endif // GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ \ No newline at end of file diff --git a/grin/include/property/property.h b/grin/include/property/property.h new file mode 100644 index 000000000..32f34e42f --- /dev/null +++ b/grin/include/property/property.h @@ -0,0 +1,51 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This header file is not available for libgrape-lite. + +#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_H_ +#define GRIN_INCLUDE_PROPERTY_PROPERTY_H_ + +#include "../predefine.h" + +#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) +#ifdef WITH_PROPERTY_NAME +char* get_property_name(const Graph, const Property); + +Property get_property_by_name(const Graph, char* name); +#endif + +DataType get_property_type(const Graph, const Property); + +void* get_property_value_from_row(const Row, const Property); + +size_t get_row_list_size(const RowList); + +Row get_row_from_list(const RowList, size_t); + +void* get_property_value_from_row(const Row, const Property); + +#ifdef WITH_VERTEX_PROPERTY +RowList get_vertex_row_list(const Graph, const VertexList, const PropertyList); + +Row get_vertex_row_from_list(const RowList, const Vertex); +#endif + +#ifdef WITH_EDGE_PROPERTY +RowList get_edge_row_list(const Graph, const EdgeList, const PropertyList); + +Row get_edge_row_from_list(const RowList, const Edge); +#endif + +#endif + +#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_H_ \ No newline at end of file diff --git a/grin/include/property/propertylist.h b/grin/include/property/propertylist.h new file mode 100644 index 000000000..763d50bd7 --- /dev/null +++ b/grin/include/property/propertylist.h @@ -0,0 +1,88 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This header file is not available for libgrape-lite. + +#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ +#define GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ + +#include "../predefine.h" + +// Property list +#ifdef WITH_VERTEX_PROPERTY +PropertyList get_all_vertex_properties(const Graph); +#endif + +#ifdef WITH_EDGE_PROPERTY +PropertyList get_all_edge_properties(const Graph); +#endif + +size_t get_property_list_size(const PropertyList); + +Property get_property_from_list(const PropertyList, const size_t); + +PropertyList create_property_list(); + +void destroy_property_list(PropertyList); + +bool insert_property_to_list(PropertyList, const Property); + + +#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) +PropertyList get_all_vertex_properties_by_label(const Graph, const VertexLabel); + +#ifdef NATURAL_PROPERTY_ID_TRAIT +Property get_vertex_property_from_id(const VertexLabel, const PropertyID); + +PropertyID get_vertex_property_id(const VertexLabel, const Property); +#endif +#endif + +#if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) +PropertyList get_all_edge_properties_by_label(const Graph, const EdgeLabel); + +#ifdef NATURAL_PROPERTY_ID_TRAIT +Property get_edge_property_from_id(const EdgeLabel, const PropertyID); + +PropertyID get_edge_property_id(const EdgeLabel, const Property); +#endif +#endif + +#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PRIMARTY_KEYS) +PropertyList get_primary_keys_by_label(const Graph, const VertexLabel); + +Vertex get_vertex_by_primary_keys_and_label(const Graph, const Row, + const VertexLabel); +#endif + +// graph projection +#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE) +Graph select_vertex_properties(const Graph, const PropertyList); +#endif + +#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE) +Graph select_edge_properteis(const Graph, const PropertyList); +#endif + +#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) && \ + defined(COLUMN_STORE) +Graph select_vertex_properties_for_label(const Graph, const VertexLabel, + const PropertyList); +#endif + +#if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) && \ + defined(COLUMN_STORE) +Graph select_edge_properties_for_label(const Graph, const EdgeLabel, + const PropertyList); +#endif + +#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ \ No newline at end of file diff --git a/grin/include/propertygraph/property.h b/grin/include/propertygraph/property.h deleted file mode 100644 index 31173127b..000000000 --- a/grin/include/propertygraph/property.h +++ /dev/null @@ -1,87 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This header file is not available for libgrape-lite. - -#ifndef GRIN_PROPERTY_GRAPH_PROPERTY_H_ -#define GRIN_PROPERTY_GRAPH_PROPERTY_H_ - -#include "../predefine.h" - -#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) -char* get_property_name(const Graph, const Property); - -#ifdef WITH_PROPERTY_NAME -Property get_property_by_name(const Graph, char* name); -#endif - -DataType get_property_type(const Graph, const Property); - -size_t get_property_list_size(const PropertyList); - -Property get_property_from_list(const PropertyList, const size_t); - -PropertyList create_property_list(); - -void destroy_property_list(PropertyList); - -bool insert_property_to_list(PropertyList, const Property); - -void* get_property_value_from_row(const Row, const Property); - -size_t get_row_list_size(const RowList); - -RowListIterator get_row_list_begin(RowList); - -RowListIterator get_next_row_iter(RowList, const RowListIterator); - -bool has_next_row_iter(RowList, const RowListIterator); - -Row get_row_from_iter(RowList, const RowListIterator); - -RowList create_row_list(); - -void destroy_row_list(RowList); - -bool insert_row_to_list(RowList, const Row); -#endif - -#ifdef WITH_VERTEX_PROPERTY -void* get_vertex_property_value(const Graph, const Vertex, const Property); - -PropertyList get_all_vertex_properties(const Graph); - -Row get_vertex_row(const Graph, const Vertex, const PropertyList); - -RowList get_vertex_row_in_batch(const Graph, const VertexList, - const PropertyList); -#endif - -#ifdef WITH_EDGE_PROPERTY -void* get_edge_property_value(const Graph, const Edge, const Property); - -PropertyList get_all_edge_properties(const Graph); - -Row get_edge_row(const Graph, const Edge, const PropertyList); - -RowList get_edge_row_in_batch(const Graph, const EdgeList, const PropertyList); -#endif - -#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE) -Graph select_vertex_properties(const Graph, const PropertyList); -#endif - -#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE) -Graph select_edge_properteis(const Graph, const PropertyList); -#endif - -#endif // GRIN_PROPERTY_GRAPH_PROPERTY_H_ \ No newline at end of file diff --git a/grin/include/propertygraph/propertygraph.h b/grin/include/propertygraph/propertygraph.h deleted file mode 100644 index d4a46890a..000000000 --- a/grin/include/propertygraph/propertygraph.h +++ /dev/null @@ -1,72 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This header file is not available for libgrape-lite. - -#ifndef GRIN_PROPERTY_GRAPH_PROPERTY_GRAPH_H_ -#define GRIN_PROPERTY_GRAPH_PROPERTY_GRAPH_H_ - -#include "../predefine.h" - -#if defined(WITH_VERTEX_LABEL) && defined(ENABLE_VERTEX_LIST) -VertexList get_vertex_list_from_label(const Graph, const VertexLabel); -#endif - -#if defined(WITH_EDGE_LABEL) && defined(ENABLE_EDGE_LIST) -EdgeList get_edge_list_from_label(const Graph, const EdgeLabel); -#endif - -#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) -PropertyList get_all_vertex_properties_from_label(const Graph, - const VertexLabel); -#ifdef NATURAL_PROPERTY_ID_TRAIT -Property get_vertex_property_from_id(const VertexLabel, const PropertyID); -#endif -#endif - -#if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) -PropertyList get_all_edge_properties_from_label(const Graph, const EdgeLabel); -#ifdef NATURAL_PROPERTY_ID_TRAIT -Property get_edge_property_from_id(const EdgeLabel, const PropertyID); -#endif -#endif - -#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) && \ - defined(COLUMN_STORE) -Graph select_vertex_properties_for_label(const Graph, const PropertyList, - const VertexLabel); -#endif - -#if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) && \ - defined(COLUMN_STORE) -Graph select_edge_properteis_for_label(const Graph, const PropertyList, - const EdgeLabel); -#endif - -#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PRIMARTY_KEYS) -PropertyList get_primary_keys_from_label(const Graph, const VertexLabel); - -Vertex get_vertex_from_primary_keys_and_label(const Graph, const Row, - const VertexLabel); -#endif - -#if defined(WITH_VERTEX_LABEL) && defined(ENABLE_VERTEX_LIST) && \ - defined(PARTITION_STRATEGY) -VertexList get_local_vertices_from_label(const PartitionedGraph, - const Partition, const VertexLabel); - -VertexList get_non_local_vertices_from_label(const PartitionedGraph, - const Partition, - const VertexLabel); -#endif - -#endif // GRIN_PROPERTY_GRAPH_PROPERTY_GRAPH_H_ \ No newline at end of file diff --git a/grin/include/topology/adjacentlist.h b/grin/include/topology/adjacentlist.h index 36c29245b..d7c1906ac 100644 --- a/grin/include/topology/adjacentlist.h +++ b/grin/include/topology/adjacentlist.h @@ -19,7 +19,6 @@ limitations under the License. #include "../predefine.h" #ifdef ENABLE_ADJACENT_LIST - AdjacentList get_adjacent_list(const Graph, const Direction, Vertex); #ifdef WITH_EDGE_LABEL @@ -28,22 +27,20 @@ AdjacentList get_adjacent_list_by_edge_label(const Graph, const Direction, Verte void destroy_adjacent_list(AdjacentList); -AdjacentListIterator get_adjacent_list_begin(const AdjacentList); +size_t get_adjacent_list_size(const AdjacentList); -AdjacentListIterator get_next_adjacent_iter(const AdjacentList, - AdjacentListIterator); +Vertex get_neighbor_from_adjacent_list(const AdjacentList, size_t); -size_t get_adjacent_list_size(const AdjacentList); +Edge get_edge_from_adjacent_list(const AdjacentList, size_t); -bool has_next_adjacent_iter(const AdjacentList, const AdjacentListIterator); +#ifdef ENABLE_ADJACENT_LIST_ITERATOR +AdjacentListIterator get_adjacent_list_begin(const Graph); -Vertex get_neighbor_from_iter(const AdjacentList, const AdjacentListIterator); +bool get_next_adjacent_list_iter(AdjacentListIterator); -#ifdef WITH_EDGE_DATA -DataType get_adjacent_edge_data_type(const Graph); +Vertex get_neighbor_from_iter(AdjacentListIterator); -EdgeData get_adjacent_edge_data_value(const AdjacentList, - const AdjacentListIterator); +Edge get_edge_from_iter(AdjacentListIterator); #endif #endif diff --git a/grin/include/topology/edgelist.h b/grin/include/topology/edgelist.h index a691bba17..5b66d82aa 100644 --- a/grin/include/topology/edgelist.h +++ b/grin/include/topology/edgelist.h @@ -16,26 +16,38 @@ limitations under the License. #ifndef GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ #define GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ +#include "../predefine.h" + #ifdef ENABLE_EDGE_LIST EdgeList get_edge_list(const Graph, const Direction); +#ifdef WITH_EDGE_LABEL +EdgeList get_edge_list_by_label(const Graph, const EdgeLabel); +#endif + void destroy_edge_list(EdgeList); +EdgeList create_edge_list(); + +bool insert_edge_to_list(EdgeList, const Edge); + size_t get_edge_list_size(const EdgeList); -EdgeListIterator get_edge_list_begin(const EdgeList); +Edge get_edge_from_list(const EdgeList, size_t); -EdgeListIterator get_next_edge_iter(const EdgeList, EdgeListIterator); +#ifdef ENABLE_EDGE_LIST_ITERATOR +EdgeListIterator get_edge_list_begin(const Graph); -bool has_next_edge_iter(const EdgeList, const EdgeListIterator); +#ifdef WITH_EDGE_LABEL +EdgeListIterator get_edge_list_begin_by_label(const Graph, const EdgeLabel); +#endif -Edge get_edge_from_iter(const EdgeList, const EdgeListIterator); +bool get_next_edge_list_iter(EdgeListIterator); -#ifdef MUTABLE_GRAPH -EdgeList create_edge_list(); -bool insert_edge_to_list(EdgeList, const Edge); +Edge get_edge_from_iter(EdgeListIterator); #endif + #endif #endif // GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ diff --git a/grin/include/topology/structure.h b/grin/include/topology/structure.h index 0be7c9586..3b6b785a8 100644 --- a/grin/include/topology/structure.h +++ b/grin/include/topology/structure.h @@ -18,14 +18,25 @@ limitations under the License. #include "../predefine.h" +// Graph bool is_directed(const Graph); bool is_multigraph(const Graph); size_t get_vertex_num(const Graph); +#ifdef WITH_VERTEX_LABEL +size_t get_vertex_num_by_label(const Graph, const VertexLabel); +#endif + size_t get_edge_num(const Graph); +#ifdef WITH_EDGE_LABEL +size_t get_edge_num_by_label(const Graph, const EdgeLabel); +#endif + + +// Vertex void destroy_vertex(Vertex); #ifdef WITH_VERTEX_DATA @@ -34,21 +45,22 @@ DataType get_vertex_data_type(const Graph, const Vertex); VertexData get_vertex_data_value(const Graph, const Vertex); void destroy_vertex_data(VertexData); - -#ifdef MUTABLE_GRAPH -void set_vertex_data_value(Graph, Vertex, const VertexData); -#endif #endif #ifdef WITH_VERTEX_ORIGIN_ID Vertex get_vertex_from_origin_id(const Graph, const OriginID); -OriginID get_vertex_origin_id(const Graph, const Vertex); #ifdef WITH_VERTEX_LABEL Vertex get_vertex_from_label_origin_id(const Graph, const VertexLabel, const OriginID); #endif + +OriginID get_vertex_origin_id(const Graph, const Vertex); + +void destroy_vertex_origin_id(OriginID); #endif + +// Edge void destroy_edge(Edge); Vertex get_edge_src(const Graph, const Edge); @@ -61,10 +73,6 @@ DataType get_edge_data_type(const Graph, const Edge); EdgeData get_edge_data_value(const Graph, const Edge); void destroy_edge_data(EdgeData); - -#ifdef MUTABLE_GRAPH -void set_edge_data_value(Graph, Edge, const EdgeData); -#endif #endif #endif // GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ diff --git a/grin/include/topology/vertexlist.h b/grin/include/topology/vertexlist.h index f25890352..6e6302db8 100644 --- a/grin/include/topology/vertexlist.h +++ b/grin/include/topology/vertexlist.h @@ -26,17 +26,27 @@ VertexList get_vertex_list(const Graph); VertexList get_vertex_list_by_label(const Graph, const VertexLabel); #endif -void destroy_vertex_list(Graph); +void destroy_vertex_list(VertexList); + +VertexList create_vertex_list(); + +bool insert_vertex_to_list(VertexList, const Vertex); size_t get_vertex_list_size(const VertexList); -VertexListIterator get_vertex_list_begin(const VertexList); +Vertex get_vertex_from_list(const VertexList, const size_t); + +#ifdef ENABLE_VERTEX_LIST_ITERATOR +VertexListIterator get_vertex_list_begin(const Graph); -VertexListIterator get_next_vertex_iter(const VertexList, VertexListIterator); +#ifdef WITH_VERTEX_LABEL +VertexListIterator get_vertex_list_begin_by_label(const Graph, const VertexLabel); +#endif -bool has_next_vertex_iter(const VertexList, const VertexListIterator); +bool get_next_vertex_list_iter(VertexListIterator); -Vertex get_vertex_from_iter(const VertexList, const VertexListIterator); +Vertex get_vertex_from_iter(VertexListIterator); +#endif #ifdef CONTINUOUS_VERTEX_ID_TRAIT VertexID get_begin_vertex_id_from_list(const VertexList); @@ -48,12 +58,10 @@ DataType get_vertex_id_data_type(const Graph); VertexID get_vertex_id(const Vertex); Vertex get_vertex_from_id(const VertexID); -#endif -#ifdef MUTABLE_GRAPH -VertexList create_vertex_list(); -bool insert_vertex_to_list(VertexList, const Vertex); +void destroy_vertex_id(VertexID); #endif + #endif #endif // GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ From 88cc56a84461cada29d6d7b048e95dec63a112ae Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Mon, 20 Feb 2023 10:26:24 +0800 Subject: [PATCH 06/85] grin api implementations --- grin/include/partition/partition.h | 65 ++--- grin/include/predefine.h | 41 ++- grin/include/property/label.h | 12 +- grin/include/property/property.h | 45 ++-- grin/include/property/propertylist.h | 70 +++--- grin/include/topology/vertexlist.h | 2 + grin/src/partition/partition.cc | 233 ++++++++++++++++++ grin/src/predefine.h | 86 ++++--- grin/src/property/label.cc | 176 +++++++++++++ grin/src/property/primarykey.h | 28 +++ grin/src/property/property.cc | 137 ++++++++++ grin/src/property/propertylist.cc | 132 ++++++++++ grin/src/topology/adjacentlist.cc | 106 ++++++++ grin/src/topology/edgelist.cc | 48 ++++ grin/src/topology/structure.cc | 125 ++++++++++ grin/src/topology/vertexlist.cc | 122 +++++++++ grin/src/utils.h | 26 ++ modules/graph/fragment/arrow_fragment.grin.h | 144 ++++++++++- modules/graph/fragment/property_graph_types.h | 144 ----------- 19 files changed, 1451 insertions(+), 291 deletions(-) create mode 100644 grin/src/partition/partition.cc create mode 100644 grin/src/property/label.cc create mode 100644 grin/src/property/primarykey.h create mode 100644 grin/src/property/property.cc create mode 100644 grin/src/property/propertylist.cc create mode 100644 grin/src/topology/adjacentlist.cc create mode 100644 grin/src/topology/edgelist.cc create mode 100644 grin/src/topology/structure.cc create mode 100644 grin/src/topology/vertexlist.cc create mode 100644 grin/src/utils.h diff --git a/grin/include/partition/partition.h b/grin/include/partition/partition.h index 8beda5c31..410945203 100644 --- a/grin/include/partition/partition.h +++ b/grin/include/partition/partition.h @@ -80,73 +80,62 @@ AdjacentList get_adjacent_mirror_list_by_partition(const Graph, const Direction, // Vertex ref refers to the same vertex referred in other partitions, -// while edge ref is likewise. And both can be serialized to char* for -// message transporting nd deserialized on the other end. +// while edge ref is likewise. Both can be serialized to char* for +// message transporting and deserialized on the other end. VertexRef get_vertex_ref_for_vertex(const Graph, const Partition, const Vertex); -VertexRef get_master_vertex_ref_for_vertex(const Graph, const Vertex); +Vertex get_vertex_from_vertex_ref(const Graph, const VertexRef); + +Partition get_master_partition_from_vertex_ref(const Graph, const VertexRef); char* serialize_vertex_ref(const Graph, const VertexRef); -Vertex get_vertex_from_deserialization(const Graph, const Partition, const char*); +VertexRef deserialize_to_vertex_ref(const Graph, const char*); EdgeRef get_edge_ref_for_edge(const Graph, const Partition, const Edge); -EdgeRef get_master_edge_ref_for_edge(const Graph, const Edge); +Edge get_edge_from_edge_ref(const Graph, const EdgeRef); -char* serialize_edge_ref(const Graph, const EdgeRef); +Partition get_master_partition_from_edge_ref(const Graph, const EdgeRef); -Edge get_edge_from_deserialization(const Graph, const Partition, const char*); +char* serialize_edge_ref(const Graph, const EdgeRef); +EdgeRef deserialize_to_edge_ref(const Graph, const char*); // The concept of local_complete refers to whether we can get complete data or properties // locally in the partition. It is orthogonal to the concept of master/mirror which // is mainly designed for data aggregation. In some extremely cases, master vertices // may NOT contain all the data or properties locally. -bool is_vertex_data_local_complete(const Graph, const Vertex); - -bool is_vertex_property_local_complete(const Graph, const Vertex); - -bool is_edge_data_local_complete(const Graph, const Edge); - -bool is_edge_property_local_complete(const Graph, const Edge); +bool is_vertex_neighbor_local_complete(const Graph, const Vertex); -// use valid vertex refs of vertex v (i.e., vertex v refered in other partitions) -// to help aggregate data/property when v is NOT local_complete -#ifdef ENABLE_VALID_VERTEX_REF_LIST -VertexRefList get_all_valid_vertex_ref_list_for_vertex(const Graph, const Vertex); +PartitionList vertex_neighbor_complete_partitions(const Graph, const Vertex); -void destroy_vertex_ref_list(VertexRefList); - -size_t get_vertex_ref_list_size(const VertexRefList); +#ifdef WITH_VERTEX_DATA +bool is_vertex_data_local_complete(const Graph, const Vertex); -VertexRef get_vertex_ref_from_list(const VertexRefList, size_t); +PartitionList vertex_data_complete_partitions(const Graph, const Vertex); #endif -#ifdef ENABLE_VALID_VERTEX_REF_LIST_ITERATOR -VertexRefListIterator get_all_valid_vertex_ref_list_begin_for_vertex(const Graph, const Vertex); - -bool get_next_vertex_ref_list_iter(VertexRefListIterator); +#ifdef WITH_VERTEX_PROPERTY +bool is_vertex_property_local_complete(const Graph, const Vertex); -VertexRef get_vertex_ref_from_iter(VertexRefListIterator); +PartitionList vertex_property_complete_partitions(const Graph, const Vertex); #endif -#ifdef ENABLE_VALID_EDGE_REF_LIST -EdgeRefList get_all_valid_edge_ref_list_for_edge(const Graph, const Edge); - -void destroy_edge_ref_list(EdgeRefList); - -size_t get_edge_ref_list_size(const EdgeRefList); +#ifdef WITH_EDGE_DATA +bool is_edge_data_local_complete(const Graph, const Edge); -EdgeRef get_edge_ref_from_list(const EdgeRefList, size_t); +PartitionList edge_data_complete_partitions(const Graph, const Edge); #endif -#ifdef ENABLE_VALID_EDGE_REF_LIST_ITERATOR -EdgeRefListIterator get_all_valid_edge_ref_list_begin_for_edge(const Graph, const Edge); +#ifdef WITH_EDGE_PROPERTY +bool is_edge_property_local_complete(const Graph, const Edge); -bool get_next_edge_ref_list_iter(EdgeRefListIterator); +PartitionList edge_data_complete_partitions(const Graph, const Edge); +#endif -EdgeRef get_edge_ref_from_iter(EdgeRefListIterator); +#ifndef EDGECUT_PARTITION_TRAIT +PartitionList vertex_complete_partitions(const Graph, const Vertex); #endif #endif diff --git a/grin/include/predefine.h b/grin/include/predefine.h index a6f77096b..7d16aac5f 100644 --- a/grin/include/predefine.h +++ b/grin/include/predefine.h @@ -15,6 +15,7 @@ limitations under the License. #ifndef GRIN_INCLUDE_PREDEFINE_H_ #define GRIN_INCLUDE_PREDEFINE_H_ +#include #include #include @@ -53,24 +54,27 @@ typedef enum { // partitioned graph #define ENABLE_GRAPH_PARTITION // Enable partitioned graph. +#define EDGECUT_PARTITION_TRAIT // Use edgecut partition strategy. #define NATURAL_PARTITION_ID_TRAIT // Partition has natural continuous id from 0. // #define ENABLE_VALID_VERTEX_REF_LIST // There is valid vertex ref list for vertex // #define ENABLE_VALID_VERTEX_REF_LIST_ITERATOR // There is valid vertex ref list iterator for vertex // #define ENABLE_VALID_EDGE_REF_LIST // There is valid edge ref list for edge // #define ENABLE_VALID_EDGE_REF_LIST_ITERATOR // There is valid edge ref list iterator for vertex - +#ifdef EDGECUT_PARTITION_TRAIT +#undef ENABLE_EDGE_LIST +#endif // propertygraph #define WITH_VERTEX_LABEL // There are labels on vertices. #define WITH_VERTEX_PROPERTY // There is any property on vertices. // #define WITH_VERTEX_PRIMARTY_KEYS // There are primary keys for vertex. #define NATURAL_VERTEX_LABEL_ID_TRAIT // Vertex label has natural continuous id from 0. +#define NATURAL_VERTEX_PROPERTY_ID_TRAIT // Vertex property has natural continuous id from 0. #define WITH_EDGE_LABEL // There are labels for edges. #define WITH_EDGE_PROPERTY // There is any property for edges. #define NATURAL_EDGE_LABEL_ID_TRAIT // Edge label has natural continuous id from 0. +#define NATURAL_EDGE_PROPERTY_ID_TRAIT // Edge property has natural continuous id from 0. #define COLUMN_STORE // Column-oriented storage for properties. -#define NATURAL_PROPERTY_ID_TRAIT // Property has natural continuous id from 0. -#define ENABLE_ROW_LIST // Enable row list to access property value // predicate @@ -90,6 +94,7 @@ typedef enum { #define NULL_EDGE_LABEL NULL // Null edge label handle (invalid return value). #define NULL_PROPERTY NULL // Null property handle (invalid return value). #define NULL_ROW NULL // Null row handle (invalid return value). +#define NULL_NATURAL_ID UINT_MAX // Null natural id (invalid return value). /* The following data types shall be defined through typedef. */ typedef void* Graph; @@ -154,14 +159,30 @@ typedef unsigned EdgeLabelID; #endif #endif -#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) -typedef void* Property; -typedef void* PropertyList; -#ifdef NATURAL_PROPERTY_ID_TRAIT -typedef unsigned PropertyID; +#ifdef WITH_VERTEX_PROPERTY +typedef void* VertexProperty; +typedef void* VertexPropertyList; +#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT +typedef unsigned VertexPropertyID; +#endif +#ifdef COLUMN_STORE +typedef void* VertexColumn; +#else +typedef void* VertexRow; +#endif +#endif + +#ifdef WITH_EDGE_PROPERTY +typedef void* EdgeProperty; +typedef void* EdgePropertyList; +#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT +typedef unsigned EdgePropertyID; +#endif +#ifdef COLUMN_STORE +typedef void* EdgeColumn; +#else +typedef void* EdgeRow; #endif -typedef void* Row; -typedef void* RowList; #endif #endif // GRIN_INCLUDE_PREDEFINE_H_ diff --git a/grin/include/property/label.h b/grin/include/property/label.h index b65e130f7..36039deeb 100644 --- a/grin/include/property/label.h +++ b/grin/include/property/label.h @@ -23,6 +23,8 @@ VertexLabel get_vertex_label(const Graph, const Vertex); char* get_vertex_label_name(const Graph, const VertexLabel); +VertexLabel get_vertex_label_by_name(const Graph, char*); + #ifdef NATURAL_VERTEX_LABEL_ID_TRAIT VertexLabelID get_vertex_label_id(const VertexLabel); @@ -49,6 +51,8 @@ EdgeLabel get_edge_label(const Graph, const Edge); char* get_edge_label_name(const Graph, const EdgeLabel); +EdgeLabel get_edge_label_by_name(const Graph, char*); + #ifdef NATURAL_EDGE_LABEL_ID_TRAIT EdgeLabelID get_edge_label_id(const EdgeLabel); @@ -76,12 +80,4 @@ VertexLabel get_src_label_from_edge_label(const Graph, const EdgeLabel); VertexLabel get_dst_label_from_edge_label(const Graph, const EdgeLabel); #endif -#if defined(WITH_VERTEX_LABEL) && defined(ENABLE_VERTEX_LIST) -VertexList get_vertex_list_by_label(const Graph, const VertexLabel); -#endif - -#if defined(WITH_EDGE_LABEL) && defined(ENABLE_EDGE_LIST) -EdgeList get_edge_list_by_label(const Graph, const EdgeLabel); -#endif - #endif // GRIN_INCLUDE_PROPERTY_LABEL_H_ \ No newline at end of file diff --git a/grin/include/property/property.h b/grin/include/property/property.h index 32f34e42f..e11fdfdec 100644 --- a/grin/include/property/property.h +++ b/grin/include/property/property.h @@ -17,33 +17,34 @@ limitations under the License. #include "../predefine.h" -#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) -#ifdef WITH_PROPERTY_NAME -char* get_property_name(const Graph, const Property); - -Property get_property_by_name(const Graph, char* name); -#endif - -DataType get_property_type(const Graph, const Property); - -void* get_property_value_from_row(const Row, const Property); - -size_t get_row_list_size(const RowList); - -Row get_row_from_list(const RowList, size_t); - -void* get_property_value_from_row(const Row, const Property); - #ifdef WITH_VERTEX_PROPERTY -RowList get_vertex_row_list(const Graph, const VertexList, const PropertyList); +void destroy_vertex_property(VertexProperty); + +#ifdef WITH_VERTEX_PROPERTY_NAME +char* get_vertex_property_name(const Graph, const VertexProperty); -Row get_vertex_row_from_list(const RowList, const Vertex); +#ifdef COLUMN_STORE +VertexColumn get_vertex_column_by_name(const Graph, char* name); +#endif #endif -#ifdef WITH_EDGE_PROPERTY -RowList get_edge_row_list(const Graph, const EdgeList, const PropertyList); +DataType get_vertex_property_type(const Graph, const VertexProperty); -Row get_edge_row_from_list(const RowList, const Edge); +#ifdef COLUMN_STORE +void destroy_vertex_column(VertexColumn); +#ifdef ENABLE_VERTEX_LIST +VertexColumn get_vertex_column_by_list(const Graph, const VertexList, const VertexProperty); +#endif +#ifdef WITH_VERTEX_LABEL +VertexColumn get_vertex_column_by_label(const Graph, const VertexLabel, const VertexProperty); +#endif +void* get_value_from_vertex_column(const VertexColumn, const Vertex); +#else +void destroy_vertex_row(VertexRow); +VertexRow get_vertex_row_by_list(const Graph, const Vertex, const VertexPropertyList); +#ifdef WITH_VERTEX_LABEL +VertexRow get_vertex_row_by_label(const Graph, const Vertex, const VertexLabel); +#endif #endif #endif diff --git a/grin/include/property/propertylist.h b/grin/include/property/propertylist.h index 763d50bd7..9fce4e827 100644 --- a/grin/include/property/propertylist.h +++ b/grin/include/property/propertylist.h @@ -19,41 +19,50 @@ limitations under the License. // Property list #ifdef WITH_VERTEX_PROPERTY -PropertyList get_all_vertex_properties(const Graph); -#endif - -#ifdef WITH_EDGE_PROPERTY -PropertyList get_all_edge_properties(const Graph); -#endif - -size_t get_property_list_size(const PropertyList); +VertexPropertyList get_all_vertex_properties(const Graph); -Property get_property_from_list(const PropertyList, const size_t); +size_t get_vertex_property_list_size(const VertexPropertyList); -PropertyList create_property_list(); +VertexProperty get_vertex_property_from_list(const VertexPropertyList, const size_t); -void destroy_property_list(PropertyList); +VertexPropertyList create_vertex_property_list(); -bool insert_property_to_list(PropertyList, const Property); +void destroy_vertex_property_list(VertexPropertyList); +bool insert_vertex_property_to_list(VertexPropertyList, const VertexProperty); -#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) -PropertyList get_all_vertex_properties_by_label(const Graph, const VertexLabel); +#ifdef WITH_VERTEX_LABEL +VertexPropertyList get_all_vertex_properties_by_label(const Graph, const VertexLabel); -#ifdef NATURAL_PROPERTY_ID_TRAIT -Property get_vertex_property_from_id(const VertexLabel, const PropertyID); +#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT +VertexProperty get_vertex_property_from_id(const VertexLabel, const VertexPropertyID); -PropertyID get_vertex_property_id(const VertexLabel, const Property); +VertexPropertyID get_vertex_property_id(const VertexLabel, const VertexProperty); #endif #endif +#endif + +#ifdef WITH_EDGE_PROPERTY +EdgePropertyList get_all_edge_properties(const Graph); + +size_t get_edge_property_list_size(const EdgePropertyList); + +EdgeProperty get_edge_property_from_list(const EdgePropertyList, const size_t); -#if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) -PropertyList get_all_edge_properties_by_label(const Graph, const EdgeLabel); +EdgePropertyList create_edge_property_list(); -#ifdef NATURAL_PROPERTY_ID_TRAIT -Property get_edge_property_from_id(const EdgeLabel, const PropertyID); +void destroy_edge_property_list(EdgePropertyList); -PropertyID get_edge_property_id(const EdgeLabel, const Property); +bool insert_edge_property_to_list(EdgePropertyList, const EdgeProperty); + +#ifdef WITH_EDGE_LABEL +EdgePropertyList get_all_edge_properties_by_label(const Graph, const EdgeLabel); + +#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT +EdgeProperty get_edge_property_from_id(const EdgeLabel, const EdgePropertyID); + +EdgePropertyID get_edge_property_id(const EdgeLabel, const EdgeProperty); +#endif #endif #endif @@ -66,23 +75,10 @@ Vertex get_vertex_by_primary_keys_and_label(const Graph, const Row, // graph projection #if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE) -Graph select_vertex_properties(const Graph, const PropertyList); +Graph select_vertex_properties(const Graph, const VertexPropertyList); #endif - #if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE) -Graph select_edge_properteis(const Graph, const PropertyList); -#endif - -#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PROPERTY) && \ - defined(COLUMN_STORE) -Graph select_vertex_properties_for_label(const Graph, const VertexLabel, - const PropertyList); -#endif - -#if defined(WITH_EDGE_LABEL) && defined(WITH_EDGE_PROPERTY) && \ - defined(COLUMN_STORE) -Graph select_edge_properties_for_label(const Graph, const EdgeLabel, - const PropertyList); +Graph select_edge_properteis(const Graph, const EdgePropertyList); #endif #endif // GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ \ No newline at end of file diff --git a/grin/include/topology/vertexlist.h b/grin/include/topology/vertexlist.h index 6e6302db8..cb097956b 100644 --- a/grin/include/topology/vertexlist.h +++ b/grin/include/topology/vertexlist.h @@ -49,6 +49,8 @@ Vertex get_vertex_from_iter(VertexListIterator); #endif #ifdef CONTINUOUS_VERTEX_ID_TRAIT +bool is_vertex_list_continuous(const VertexList); + VertexID get_begin_vertex_id_from_list(const VertexList); VertexID get_end_vertex_id_from_list(const VertexList); diff --git a/grin/src/partition/partition.cc b/grin/src/partition/partition.cc new file mode 100644 index 000000000..1746e06f8 --- /dev/null +++ b/grin/src/partition/partition.cc @@ -0,0 +1,233 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "grin/src/predefine.h" +#include "grin/include/partition/partition.h" +#include "modules/graph/fragment/property_graph_types.h" + +#ifdef ENABLE_GRAPH_PARTITION +// basic partition informations +size_t get_total_partitions_number(const PartitionedGraph pg) { + // auto _pg = static_cast(pg); + // return _pg->fnum(); +} + +size_t get_total_vertices_number(const PartitionedGraph pg) { + // auto _pg = static_cast(pg); + // return _pg->GetTotalVerticesNum(); +} + +// partition list +PartitionList get_local_partition_list(const PartitionedGraph pg) { + // auto _pg = static_cast(pg); + // auto pl = new PartitionList_T(); + // pl->push_back(_pg->fid()); + // return pl; +} + +void destroy_partition_list(PartitionList); + +PartitionList create_partition_list(); + +bool insert_partition_to_list(PartitionList, const Partition); + +size_t get_partition_list_size(const PartitionList); + +Partition get_partition_from_list(const PartitionList, const size_t); + +void destroy_partition(Partition); + +void* get_partition_info(const PartitionedGraph, const Partition); + +Graph get_local_graph_from_partition(const PartitionedGraph, const Partition); + +#ifdef NATURAL_PARTITION_ID_TRAIT +Partition get_partition_from_id(const PartitionID pid) { + auto p = new Partition_T(pid); + return p; +} + +PartitionID get_partition_id(const Partition p) { + auto _p = static_cast(p); + return *_p; +} +#endif + +// master & mirror vertices for vertexcut partition +// while they refer to inner & outer vertices in edgecut partition +#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST) +VertexList get_master_vertices(const Graph g) { + auto _g = static_cast(g); + auto _vl = new VertexList_T(); + for (VertexLabel_T vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { + _vl->push_back(_g->InnerVertices(vlabel)); + } + return _vl; +} + +VertexList get_mirror_vertices(const Graph g) { + auto _g = static_cast(g); + auto _vl = new VertexList_T(); + for (VertexLabel_T vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { + _vl->push_back(_g->OuterVertices(vlabel)); + } + return _vl; +} + +VertexList get_mirror_vertices_by_partition(const Graph g, const Partition p) { + return NULL_LIST; +} + +#ifdef WITH_VERTEX_LABEL +VertexList get_master_vertices_by_label(const Graph g, const VertexLabel vlabel) { + auto _g = static_cast(g); + auto _vlabel = static_cast(vlabel); + auto _vl = new VertexList_T(); + _vl->push_back(_g->InnerVertices(*_vlabel)); + return _vl; +} + +VertexList get_mirror_vertices_by_label(const Graph g, const VertexLabel vlabel) { + auto _g = static_cast(g); + auto _vlabel = static_cast(vlabel); + auto _vl = new VertexList_T(); + _vl->push_back(_g->OuterVertices(*_vlabel)); + return _vl; +} + +VertexList get_mirror_vertices_by_label_partition(const Graph g, const VertexLabel vlabel, + const Partition p) { + return NULL_LIST; +} +#endif +#endif + +#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_ADJACENT_LIST) +AdjacentList get_adjacent_master_list(const Graph g, const Direction d, const Vertex v) { + return NULL_LIST; +} + +AdjacentList get_adjacent_mirror_list(const Graph g, const Direction d, const Vertex v) { + return NULL_LIST; +} + +AdjacentList get_adjacent_mirror_list_by_partition(const Graph g, const Direction d, + const Partition p, const Vertex v) { + return NULL_LIST; +} +#endif + + +// Vertex ref refers to the same vertex referred in other partitions, +// while edge ref is likewise. Both can be serialized to char* for +// message transporting and deserialized on the other end. +VertexRef get_vertex_ref_for_vertex(const Graph g, const Partition p, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto gid = _g->Vertex2Gid(*_v); + auto vr = new VertexRef(gid); + return vr; +} + +Vertex get_vertex_from_vertex_ref(const Graph g, const VertexRef vr) { + auto _g = static_cast(g); + auto _vr = static_cast(vr); + auto v = new Vertex_T(); + if (_g->Gid2Vertex(*_vr, *v)) { + return v; + } + return NULL_VERTEX; +} + +Partition get_master_partition_from_vertex_ref(const Graph g, const VertexRef vr) { + auto _g = static_cast(g); + auto _vr = static_cast(vr); + auto id_parser = vineyard::IdParser(); + id_parser.Init(_g->fnum(), _g->vertex_label_num()); + return id_parser.GetFid(*_vr); +} + +char* serialize_vertex_ref(const Graph g, const VertexRef vr) { + auto _vr = static_cast(vr); + std::stringstream ss; + ss << *_vr; + int len = ss.str().length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", ss.str().c_str()); + return out; +} + +VertexRef deserialize_to_vertex_ref(const Graph g, const char* msg) { + std::stringstream ss(msg); + VertexRef_T gid; + ss >> gid; + auto vr = new VertexRef_T(gid); + return vr; +} + +EdgeRef get_edge_ref_for_edge(const Graph g, const Partition p, const Edge e) { + return NULL_EDGE_REF; +} + +Edge get_edge_from_edge_ref(const Graph g, const EdgeRef e) { + return NULL_EDGE; +} + +Partition get_master_partition_from_edge_ref(const Graph g, const EdgeRef er) { + return NULL_PARTITION; +} + +char* serialize_edge_ref(const Graph g, const EdgeRef er) { + return NULL; +} + +EdgeRef deserialize_to_edge_ref(const Graph g, const char* msg) { + return NULL_EDGE_REF; +} + +// The concept of local_complete refers to whether we can get complete data or properties +// locally in the partition. It is orthogonal to the concept of master/mirror which +// is mainly designed for data aggregation. In some extremely cases, master vertices +// may NOT contain all the data or properties locally. +bool is_vertex_neighbor_local_complete(const Graph g, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + return _g->IsInnerVertex(*_v); +} + +PartitionList vertex_neighbor_complete_partitions(const Graph g, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto pl = new PartitionList_T(); + pl->push_back(_g->GetFragId(*_v)); + return pl; +} + +bool is_vertex_property_local_complete(const Graph g, const Vertex v) { + return is_vertex_neighbor_local_complete(g, v); +} + +PartitionList vertex_property_complete_partitions(const Graph g, const Vertex v) { + return vertex_neighbor_complete_partitions(g, v); +} + +bool is_edge_property_local_complete(const Graph g, const Edge e) { + return true; +} + +PartitionList edge_property_complete_partitions(const Graph g, const Edge e) { + return NULL_LIST; +} +#endif diff --git a/grin/src/predefine.h b/grin/src/predefine.h index 8ac490e06..6adffeaee 100644 --- a/grin/src/predefine.h +++ b/grin/src/predefine.h @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "grin/include/predefine.h" -#include "grape/fragment/immutable_edgecut_fragment.h" +#include "modules/graph/fragment/arrow_fragment.h" #include "arrow/api.h" @@ -96,44 +96,70 @@ std::string GetDataTypeName(DataType type) { } } -/* The following data types shall be defined through typedef. */ -// local graph -typedef grape::ImmutableEdgecutFragment - Graph_T; - -// vertex -typedef Graph_T::vertex_t Vertex_T; -typedef Graph_T::vid_t VertexID_T; -typedef Graph_T::vdata_t VertexData_T; +#define G_OID_T int +#define G_VID_T unsigned -// vertex list +/* The following data types shall be defined through typedef. */ +typedef vineyard::ArrowFragment Graph_T; +typedef Graph_T::vertex_t Vertex_T; +struct Edge_T { + Vertex src; + Vertex dst; + Direction dir; + unsigned elabel; + Graph_T::eid_t eid; +}; + +#ifdef WITH_VERTEX_ORIGIN_ID +typedef Graph_T::oid_t OriginID_T; +#endif #ifdef ENABLE_VERTEX_LIST -typedef Graph_T::vertex_range_t VertexList_T; -typedef Graph_T::vid_t VertexListIterator_T; +typedef std::vector VertexList_T; #endif - -// indexed vertex list -#ifdef ENABLE_INDEXED_VERTEX_LIST -typedef Graph_T::vid_t VertexIndex_T; +#ifdef CONTINUOUS_VERTEX_ID_TRAIT +typedef Graph_T::vid_t VertexID_T; #endif - -// adjacent list #ifdef ENABLE_ADJACENT_LIST -typedef Graph_T::adj_list_t AdjacentList_T; -typedef Graph_T::nbr_t AdjacentListIterator_T; +struct AdjacentList_T { + Vertex v; + Direction dir; + unsigned elabel; + std::vector data; +}; #endif -// edge -typedef Graph_T::edge_t Edge_T; -typedef Graph_T::edata_t EdgeData_T; - -// partitioned graph +#ifdef ENABLE_GRAPH_PARTITION typedef Graph_T PartitionedGraph_T; +typedef unsigned Partition_T; +typedef std::vector PartitionList_T; +typedef Graph_T::vid_t VertexRef_T; +typedef Edge_T EdgeRef_T; +#endif -// remote vertex -typedef Vertex_T RemoteVertex_T; +#ifdef WITH_VERTEX_LABEL +typedef unsigned VertexLabel_T; +typedef std::vector VertexLabelList_T; +#endif + +#ifdef WITH_EDGE_LABEL +typedef unsigned EdgeLabel_T; +typedef std::vector EdgeLabelList_T; +#endif + +#ifdef WITH_VERTEX_PROPERTY +typedef std::pair VertexProperty_T; +typedef std::vector VertexPropertyList_T; +#ifdef COLUMN_STORE +typedef std::vector VertexColumn_T; +#endif +#endif -// remote edge -typedef Edge_T RemoteEdge_T; +#ifdef WITH_EDGE_PROPERTY +typedef std::pair EdgeProperty_T; +typedef std::vector EdgePropertyList_T; +#ifdef COLUMN_STORE +typedef std::vector EdgeColumn_T; +#endif +#endif #endif // GRIN_SRC_PREDEFINE_H_ diff --git a/grin/src/property/label.cc b/grin/src/property/label.cc new file mode 100644 index 000000000..6f8d057e9 --- /dev/null +++ b/grin/src/property/label.cc @@ -0,0 +1,176 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This header file is not available for libgrape-lite. + +#include "grin/src/predefine.h" +#include "grin/include/property/label.h" + +#ifdef WITH_VERTEX_LABEL +// Vertex label +VertexLabel get_vertex_label(const Graph g, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto vl = new VertexLabel_T(_g->vertex_label(*_v)); + return vl; +} + +char* get_vertex_label_name(const Graph g, const VertexLabel vl) { + auto _g = static_cast(g); + auto _vl = static_cast(vl); + auto s = std::move(_g->schema().GetVertexLabelName(*_vl)); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} + +VertexLabel get_vertex_label_by_name(const Graph g, char* name) { + auto _g = static_cast(g); + auto s = std::string(name); + auto vl = new VertexLabel_T(_g->schema().GetVertexLabelId(s)); + return vl; +} + +#ifdef NATURAL_VERTEX_LABEL_ID_TRAIT +VertexLabelID get_vertex_label_id(const VertexLabel vl) { + auto _vl = static_cast(vl); + return *_vl; +} + +VertexLabel get_vertex_label_from_id(const VertexLabelID vli) { + auto vl = new VertexLabel_T(vli); + return vl; +} +#endif + +// Vertex label list +VertexLabelList get_vertex_label_list(const Graph g) { + auto _g = static_cast(g); + auto vll = new VertexLabelList_T(); + for (auto i = 0; i < _g->vertex_label_num(); ++i) { + vll->push_back(i); + } + return vll; +} + +void destroy_vertex_label_list(VertexLabelList vll) { + auto _vll = static_cast(vll); + delete _vll; +} + +VertexLabelList create_vertex_label_list() { + auto vll = new VertexLabelList_T(); + return vll; +} + +bool insert_vertex_label_to_list(VertexLabelList vll, const VertexLabel vl) { + auto _vll = static_cast(vll); + auto _vl = static_cast(vl); + _vll->push_back(*_vl); + return true; +} + +size_t get_vertex_label_list_size(const VertexLabelList vll) { + auto _vll = static_cast(vll); + return _vll->size(); +} + +VertexLabel get_vertex_label_from_list(const VertexLabelList vll, const size_t idx) { + auto _vll = static_cast(vll); + auto vl = new VertexLabel_T((*_vll)[idx]); + return vl; +} +#endif + +#ifdef WITH_EDGE_LABEL +// Edge label +EdgeLabel get_edge_label(const Graph g, const Edge e) { + auto _e = static_cast(e); + auto el = new EdgeLabel_T(_e->elabel); + return el; +} + +char* get_edge_label_name(const Graph g, const EdgeLabel el) { + auto _g = static_cast(g); + auto _el = static_cast(el); + auto s = std::move(_g->schema().GetEdgeLabelName(*_el)); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} + +EdgeLabel get_edge_label_by_name(const Graph g, char* name) { + auto _g = static_cast(g); + auto s = std::string(name); + auto el = new EdgeLabel_T(_g->schema().GetEdgeLabelId(s)); + return el; +} + +#ifdef NATURAL_EDGE_LABEL_ID_TRAIT +EdgeLabelID get_edge_label_id(const EdgeLabel el) { + auto _el = static_cast(el); + return *_el; +} + +EdgeLabel get_edge_label_from_id(const EdgeLabelID eli) { + auto el = new EdgeLabel_T(eli); + return el; +} +#endif + +// Edge label list +EdgeLabelList get_edge_label_list(const Graph g) { + auto _g = static_cast(g); + auto ell = new EdgeLabelList_T(); + for (auto i = 0; i < _g->vertex_label_num(); ++i) { + ell->push_back(i); + } + return ell; +} + +void destroy_edge_label_list(EdgeLabelList ell) { + auto _ell = static_cast(ell); + delete _ell; +} + +EdgeLabelList create_edge_label_list() { + auto ell = new EdgeLabelList_T(); + return ell; +} + +bool insert_edge_label_to_list(EdgeLabelList ell, const EdgeLabel el) { + auto _ell = static_cast(ell); + auto _el = static_cast(el); + _ell->push_back(*_el); + return true; +} + +size_t get_edge_label_list_size(const EdgeLabelList ell) { + auto _ell = static_cast(ell); + return _ell->size(); +} + +EdgeLabel get_edge_label_from_list(const EdgeLabelList ell, const size_t idx) { + auto _ell = static_cast(ell); + auto el = new VertexLabel_T((*_ell)[idx]); + return el; +} +#endif + + +#if defined(WITH_VERTEX_LABEL) && defined(WITH_EDGE_LABEL) +VertexLabel get_src_label_from_edge_label(const Graph, const EdgeLabel); + +VertexLabel get_dst_label_from_edge_label(const Graph, const EdgeLabel); +#endif diff --git a/grin/src/property/primarykey.h b/grin/src/property/primarykey.h new file mode 100644 index 000000000..491af4a09 --- /dev/null +++ b/grin/src/property/primarykey.h @@ -0,0 +1,28 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This header file is not available for libgrape-lite. + +#ifndef GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ +#define GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ + +#include "../predefine.h" + +#ifdef WITH_VERTEX_PRIMARTY_KEYS + +PropertyList get_primary_keys(const Graph); + +Vertex get_vertex_from_primay_keys(const Graph, const Row); + +#endif + +#endif // GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ \ No newline at end of file diff --git a/grin/src/property/property.cc b/grin/src/property/property.cc new file mode 100644 index 000000000..143936b1b --- /dev/null +++ b/grin/src/property/property.cc @@ -0,0 +1,137 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This header file is not available for libgrape-lite. + +#include "grin/src/predefine.h" + +#ifdef WITH_VERTEX_PROPERTY +void destroy_vertex_property(VertexProperty) { + +} +#ifdef WITH_VERTEX_PROPERTY_NAME +char* get_vertex_property_name(const Graph, const VertexProperty); + +#ifdef COLUMN_STORE +VertexColumn get_vertex_column_by_name(const Graph, char* name); +#endif +#endif + +DataType get_vertex_property_type(const Graph g, const VertexProperty vp) { + auto _g = static_cast(g); + auto _vp = static_cast(vp); + auto dt = _g->schema().GetVertexPropertyType(_vp->first, _vp->second); + return dt.get(); +} + +#ifdef COLUMN_STORE +void destroy_vertex_column(VertexColumn vc) { + auto _vc = static_cast(vc); + delete _vc; +} +#ifdef ENABLE_VERTEX_LIST +VertexColumn get_vertex_column_by_list(const Graph g, const VertexList vl, + const VertexProperty vp) { + auto _g = static_cast(g); + auto _vl = static_cast(vl); + auto _vp = static_cast(vp); + + if (_vl->size() > 1) return NULL_LIST; + auto v = (*_vl)[0].begin(); + auto vlabel = _g->vertex_label(*v); + + if (_vp->first != vlabel) return NULL_LIST; + auto vc = new VertexColumn_T(); + vc->push_back(*_vp); + return vc; +} +#endif +#ifdef WITH_VERTEX_LABEL +VertexColumn get_vertex_column_by_label(const Graph g, const VertexLabel vl, + const VertexProperty vp) { + auto _g = static_cast(g); + auto _vl = static_cast(vl); + auto _vp = static_cast(vp); + + if (*_vl != _vp->first) return NULL_LIST; + auto vc = new VertexColumn_T(); + vc->push_back(*_vp); + return vc; +} +#endif +void* get_value_from_vertex_column(const Graph g, const VertexColumn vc, const Vertex v) { + auto _g = static_cast(g); + auto _vc = static_cast(vc); + auto _v = static_cast(v); + auto vp = (*_vc)[0]; + auto dt = _g->schema().GetVertexPropertyType(vp.first, vp.second); + auto c = _g->vertex_data_column(vp.first, vp.second); + return &c[_v]; +} +#else +void destroy_vertex_row(VertexRow); +VertexRow get_vertex_row_by_list(const Graph, const Vertex, const VertexPropertyList); +#ifdef WITH_VERTEX_LABEL +VertexRow get_vertex_row_by_label(const Graph, const Vertex, const VertexLabel); +#endif +#endif + +#endif + +#ifdef WITH_EDGE_PROPERTY +#ifdef WITH_EDGE_PROPERTY_NAME +char* get_edge_property_name(const Graph, const EdgeProperty); + +#ifdef COLUMN_STORE +EdgeColumn get_edge_column_by_name(const Graph, char* name); +#endif +#endif + +DataType get_edge_property_type(const Graph g, const EdgeProperty ep) { + auto _g = static_cast(g); + auto _ep = static_cast(ep); + auto dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); + return dt.get(); +} + +#ifdef COLUMN_STORE +#ifdef WITH_EDGE_LABEL +EdgeColumn get_edge_column_by_label(const Graph g, const EdgeLabel el, + const EdgeProperty ep) { + auto _g = static_cast(g); + auto _el = static_cast(el); + auto _ep = static_cast(ep); + + if (*_el != _ep->first) return NULL_LIST; + auto ec = new EdgeColumn_T(); + ec->push_back(*_ep); + return ec; +} +#endif +void* get_value_from_edge_column(const Graph g, const EdgeColumn ec, const Edge e) { + auto _g = static_cast(g); + auto _ec = static_cast(ec); + auto _e = static_cast(e); + auto ep = (*_ec)[0]; + auto dt = _g->schema().GetEdgePropertyType(ep.first, ep.second); + auto c = _g->edge_data_column(ep.first, ep.second); + return &c[_e->eid]; +} +#else +EdgeRow get_edge_row_by_list(const Graph, const Edge, const EdgePropertyList); +#ifdef WITH_EDGE_LABEL +EdgeRow get_edge_row_by_label(const Graph, const Edge, const EdgeLabel); +#endif +#endif + +#endif + diff --git a/grin/src/property/propertylist.cc b/grin/src/property/propertylist.cc new file mode 100644 index 000000000..a874d14dd --- /dev/null +++ b/grin/src/property/propertylist.cc @@ -0,0 +1,132 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This header file is not available for libgrape-lite. + +#include "grin/src/predefine.h" +#include "grin/src/utils.h" +#include "grin/include/property/propertylist.h" + +// Property list +#ifdef WITH_VERTEX_PROPERTY +VertexPropertyList get_all_vertex_properties(const Graph g) { + auto _g = static_cast(g); + auto vpl = new VertexPropertyList_T(); + for (auto vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { + for (auto p = 0; p < _g->vertex_property_num(vlabel); ++p) { + vpl->push_back(VertexProperty_T(vlabel, p)); + } + } + return vpl; +} + +size_t get_vertex_property_list_size(const VertexPropertyList vpl) { + auto _vpl = static_cast(vpl); + return _vpl->size(); +} + +VertexProperty get_vertex_property_from_list(const VertexPropertyList vpl, const size_t idx) { + auto _vpl = static_cast(vpl); + auto vp = new VertexProperty_T((*_vpl)[idx]); + return vp; +} + +VertexPropertyList create_vertex_property_list() { + auto vpl = new VertexPropertyList_T(); + return vpl; +} + +void destroy_vertex_property_list(VertexPropertyList vpl) { + auto _vpl = static_cast(vpl); + delete _vpl; +} + +bool insert_vertex_property_to_list(VertexPropertyList vpl, const VertexProperty vp) { + auto _vpl = static_cast(vpl); + auto _vp = static_cast(vp); + _vpl->push_back(*_vp); + return true; +} + +#ifdef WITH_VERTEX_LABEL +VertexPropertyList get_all_vertex_properties_by_label(const Graph g, const VertexLabel vlabel) { + auto _g = static_cast(g); + auto _vlabel = static_cast(vlabel); + auto vpl = new VertexPropertyList_T(); + for (auto p = 0; p < _g->vertex_property_num(*_vlabel); ++p) { + vpl->push_back(VertexProperty_T(*_vlabel, p)); + } + return vpl; +} + +#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT +VertexProperty get_vertex_property_from_id(const VertexLabel vlabel, const VertexPropertyID vpi) { + auto _vlabel = static_cast(vlabel); + auto vp = new VertexProperty_T(*_vlabel, vpi); + return vp; +} + +VertexPropertyID get_vertex_property_id(const VertexLabel vlabel, const VertexProperty vp) { + auto _vlabel = static_cast(vlabel); + auto _vp = static_cast(vp); + if (*_vlabel != _vp->first) return NULL_NATURAL_ID; + return _vp->second; +} +#endif +#endif +#endif + +#ifdef WITH_EDGE_PROPERTY +EdgePropertyList get_all_edge_properties(const Graph); + +size_t get_edge_property_list_size(const EdgePropertyList); + +EdgeProperty get_edge_property_from_list(const EdgePropertyList, const size_t); + +EdgePropertyList create_edge_property_list(); + +void destroy_edge_property_list(EdgePropertyList); + +bool insert_edge_property_to_list(EdgePropertyList, const EdgeProperty); + +#ifdef WITH_EDGE_LABEL +EdgePropertyList get_all_edge_properties_by_label(const Graph, const EdgeLabel); + +#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT +EdgeProperty get_edge_property_from_id(const EdgeLabel, const EdgePropertyID); + +EdgePropertyID get_edge_property_id(const EdgeLabel, const EdgeProperty); +#endif +#endif +#endif + +// graph projection +#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE) +Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { + auto _g = static_cast(g); + auto _vpl = static_cast(vpl); + std::map> vertices, edges; + for (auto& p: *_vpl) { + if (vertices.find(p.first) == vertices.end()) { + vertices.insert(p.first, {p.second}); + } else { + vertices[p.first].push_back(p.second); + } + } + auto client = get_client(); + auto object_id = _g->Project(client, vertices, edges); + return get_graph_by_object_id(object_id); +} +#endif +#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE) +Graph select_edge_properteis(const Graph, const EdgePropertyList); +#endif \ No newline at end of file diff --git a/grin/src/topology/adjacentlist.cc b/grin/src/topology/adjacentlist.cc new file mode 100644 index 000000000..487cb66e8 --- /dev/null +++ b/grin/src/topology/adjacentlist.cc @@ -0,0 +1,106 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "grin/src/predefine.h" +#include "grin/include/topology/adjacentlist.h" + +#ifdef ENABLE_ADJACENT_LIST +AdjacentList get_adjacent_list(const Graph g, const Direction d, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto al = new AdjacentList_T(); + al->v = v; + al->dir = d; + al->elabel = _g->edge_label_num(); + for (EdgeLabel_T elabel = 0; elabel < al->elabel; ++elabel) { + if (d == Direction::IN) { + al->data.push_back(_g->GetIncomingRawAdjList(*_v, elabel)); + } else { + al->data.push_back(_g->GetOutgoingRawAdjList(*_v, elabel)); + } + } + return al; +} + +#ifdef WITH_EDGE_LABEL +AdjacentList get_adjacent_list_by_edge_label(const Graph g, const Direction d, + const Vertex v, const EdgeLabel elabel) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto _elabel = static_cast(elabel); + auto al = new AdjacentList_T(); + al->v = v; + al->dir = d; + al->elabel = *_elabel; + if (d == Direction::IN) { + al->data.push_back(_g->GetIncomingRawAdjList(*_v, *_elabel)); + } else { + al->data.push_back(_g->GetOutgoingRawAdjList(*_v, *_elabel)); + } + return al; +} +#endif + +void destroy_adjacent_list(AdjacentList al) { + auto _al = static_cast(al); + delete _al; +} + +size_t get_adjacent_list_size(const AdjacentList al) { + auto _al = static_cast(al); + size_t result = 0; + for (auto &ral : _al->data) { + result += ral.Size(); + } + return result; +} + +Vertex get_neighbor_from_adjacent_list(const AdjacentList al, size_t idx) { + auto _al = static_cast(al); + size_t result = 0; + for (auto &ral : _al->data) { + result += ral.Size(); + if (idx < result) { + auto _idx = idx - (result - ral.size()); + auto _nbr = ral.begin() + _idx; + auto v = new Vertex_T(_nbr->vid); + return v; + } + } + return NULL_VERTEX; +} + +Edge get_edge_from_adjacent_list(const AdjacentList al, size_t idx) { + auto _al = static_cast(al); + size_t result = 0; + for (unsigned i = 0; i < _al->data.size(); ++i) { + result += _al->data[i].Size(); + if (idx < result) { + auto _idx = idx - (result - _al->data[i].Size()); + auto _nbr = _al->data[i].begin() + _idx; + auto v = new Vertex_T(_nbr->vid); + auto e = new Edge_T(); + e->src = _al->v; + e->dst = v; + e->dir = _al->dir; + e->elabel = _al->data.size() > 1 ? i : _al->elabel; + e->eid = _nbr->eid; + return e; + } + } + return NULL_EDGE; +} + +#endif \ No newline at end of file diff --git a/grin/src/topology/edgelist.cc b/grin/src/topology/edgelist.cc new file mode 100644 index 000000000..50cef92d3 --- /dev/null +++ b/grin/src/topology/edgelist.cc @@ -0,0 +1,48 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "../predefine.h" + +#ifdef ENABLE_EDGE_LIST + +EdgeList get_edge_list(const Graph, const Direction); + +#ifdef WITH_EDGE_LABEL +EdgeList get_edge_list_by_label(const Graph, const EdgeLabel); +#endif + +void destroy_edge_list(EdgeList); + +EdgeList create_edge_list(); + +bool insert_edge_to_list(EdgeList, const Edge); + +size_t get_edge_list_size(const EdgeList); + +Edge get_edge_from_list(const EdgeList, size_t); + +#ifdef ENABLE_EDGE_LIST_ITERATOR +EdgeListIterator get_edge_list_begin(const Graph); + +#ifdef WITH_EDGE_LABEL +EdgeListIterator get_edge_list_begin_by_label(const Graph, const EdgeLabel); +#endif + +bool get_next_edge_list_iter(EdgeListIterator); + +Edge get_edge_from_iter(EdgeListIterator); +#endif + +#endif diff --git a/grin/src/topology/structure.cc b/grin/src/topology/structure.cc new file mode 100644 index 000000000..27a9778b1 --- /dev/null +++ b/grin/src/topology/structure.cc @@ -0,0 +1,125 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "grin/src/predefine.h" +#include "grin/include/topology/structure.h" + + +// Graph +bool is_directed(const Graph g) { + auto _g = static_cast(g); + return _g->directed(); +} + +bool is_multigraph(const Graph g) { + auto _g = static_cast(g); + return _g->is_multigraph(); +} + +size_t get_vertex_num(const Graph g) { + auto _g = static_cast(g); + size_t result = 0; + for (VertexLabel_T vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { + result += _g->GetVerticesNum(vlabel); + } + return result; +} + +#ifdef WITH_VERTEX_LABEL +size_t get_vertex_num_by_label(const Graph g, const VertexLabel vlabel) { + auto _g = static_cast(g); + auto _vlabel = static_cast(vlabel); + return _g->GetVerticesNum(*_vlabel); +} +#endif + +size_t get_edge_num(const Graph g) { + auto _g = static_cast(g); + return _g->GetEdgeNum(); +} + +#ifdef WITH_EDGE_LABEL +size_t get_edge_num_by_label(const Graph g, const EdgeLabel elabel) { + auto _g = static_cast(g); + auto _elabel = static_cast(elabel); + return _g->edge_data_table(*_elabel)->num_rows(); +} +#endif + +// Vertex +void destroy_vertex(Vertex v) { + auto _v = static_cast(v); + delete _v; +} + +#ifdef WITH_VERTEX_ORIGIN_ID +Vertex get_vertex_from_origin_id(const Graph g, const OriginID oid) { + auto _g = static_cast(g); + Vertex result; + for (VertexLabel_T vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { + result = get_vertex_from_label_origin_id(g, &vlabel, oid); + if (result != NULL_VERTEX) { + return result; + } + } + return NULL_VERTEX; +} + +#ifdef WITH_VERTEX_LABEL +Vertex get_vertex_from_label_origin_id(const Graph g, const VertexLabel vlabel, const OriginID oid) { + auto _g = static_cast(g); + auto _vlabel = static_cast(vlabel); + auto _oid = static_cast(oid); + Graph_T::vid_t gid; + auto v = new Vertex_T(); + if (_g->Oid2Gid(*_vlabel, *_oid, gid)) { + if (_g->Gid2Vertex(gid, *v)) { + return v; + } + } + return NULL_VERTEX; +} +#endif + +OriginID get_vertex_origin_id(const Graph g, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto gid = _g->Vertex2Gid(*_v); + auto oid = new OriginID_T(_g->Gid2Oid(gid)); + return oid; +} + +void destroy_vertex_origin_id(OriginID oid) { + auto _oid = static_cast(oid); + delete _oid; +} +#endif + + +// Edge +void destroy_edge(Edge e) { + auto _e = static_cast(e); + delete _e; +} + +Vertex get_edge_src(const Graph g, const Edge e) { + auto _e = static_cast(e); + return _e->src; +} + +Vertex get_edge_dst(const Graph g, const Edge e) { + auto _e = static_cast(e); + return _e->dst; +} diff --git a/grin/src/topology/vertexlist.cc b/grin/src/topology/vertexlist.cc new file mode 100644 index 000000000..7e39e73b4 --- /dev/null +++ b/grin/src/topology/vertexlist.cc @@ -0,0 +1,122 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "grin/src/predefine.h" +#include "grin/include/topology/vertexlist.h" + +#ifdef ENABLE_VERTEX_LIST + +VertexList get_vertex_list(const Graph g) { + auto _g = static_cast(g); + auto vl = new VertexList_T(); + for (VertexLabel_T vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { + vl->push_back(_g->Vertices(vlabel)); + } + return vl; +} + +#ifdef WITH_VERTEX_LABEL +VertexList get_vertex_list_by_label(const Graph g, const VertexLabel vlabel) { + auto _g = static_cast(g); + auto vl = new VertexList_T(); + auto _vlabel = static_cast(vlabel); + vl->push_back(_g->Vertices(*_vlabel)); + return vl; +} +#endif + +void destroy_vertex_list(VertexList vl) { + auto _vl = static_cast(vl); + delete _vl; +} + +VertexList create_vertex_list() { + auto vl = new VertexList_T(); + return vl; +} + +bool insert_vertex_to_list(VertexList vl, const Vertex v) { + auto _vl = static_cast(vl); + auto _v = static_cast(v); + _vl->push_back(Graph_T::vertex_range_t(_v->GetValue(), _v->GetValue())); + return true; +} + +size_t get_vertex_list_size(const VertexList vl) { + auto _vl = static_cast(vl); + size_t result = 0; + for (auto &vr : *_vl) { + result += vr.size(); + } + return result; +} + +Vertex get_vertex_from_list(const VertexList vl, const size_t idx) { + auto _vl = static_cast(vl); + size_t result = 0; + for (auto &vr : *_vl) { + result += vr.size(); + if (idx < result) { + auto _idx = idx - (result - vr.size()); + auto v = new Vertex_T(vr.begin_value() + _idx); + return v; + } + } + return NULL_VERTEX; +} + +#ifdef CONTINUOUS_VERTEX_ID_TRAIT +bool is_vertex_list_continuous(const VertexList vl) { + auto _vl = static_cast(vl); + return _vl->size() == 1; +} + +VertexID get_begin_vertex_id_from_list(const VertexList vl) { + auto _vl = static_cast(vl); + auto _vid = (*_vl)[0].begin_value(); + auto vid = new VertexID_T(_vid); + return vid; +} + +VertexID get_end_vertex_id_from_list(const VertexList vl) { + auto _vl = static_cast(vl); + auto _vid = (*_vl)[0].end_value(); + auto vid = new VertexID_T(_vid); + return vid; +} + +DataType get_vertex_id_data_type(const Graph g) { + return DataTypeEnum::value; +} + +VertexID get_vertex_id(const Vertex v) { + auto _v = static_cast(v); + auto vid = new VertexID_T(_v->GetValue()); + return vid; +} + +Vertex get_vertex_from_id(const VertexID vid) { + auto _vid = static_cast(vid); + auto v = new Vertex_T(*_vid); + return v; +} + +void destroy_vertex_id(VertexID vid) { + auto _vid = static_cast(vid); + delete _vid; +} +#endif + +#endif diff --git a/grin/src/utils.h b/grin/src/utils.h new file mode 100644 index 000000000..6e727e53e --- /dev/null +++ b/grin/src/utils.h @@ -0,0 +1,26 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +#include "grin/include/predefine.h" + + + +#ifndef GRIN_SRC_UTILS_H_ +#define GRIN_SRC_UTILS_H_ + +vineyard::Client get_client(); + +Graph get_graph_by_object_id(vineyard::Client&, vineyard::ObjectID); + +#endif // GRIN_SRC_UTILS_H_ \ No newline at end of file diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index b324e8dda..cca0a6e19 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -70,6 +70,146 @@ class ArrowProjectedFragment; namespace vineyard { +template +struct GRIN_Nbr { + private: + using vid_t = VID_T; + using eid_t = EID_T; + using prop_id_t = property_graph_types::PROP_ID_TYPE; + + public: + GRIN_Nbr(void* g, void* edge_label, void* adj_list, size_t current) { + g_ = g; + edge_label_ = edge_label; + adj_list_ = adj_list; + current_ = current; + if (current_ == 0) { + adj_list_iter_ = get_adjacent_list_begin(adj_list_); + property_list_ = get_all_edge_properties_from_label(edge_label_); + } else { + adj_list_iter_ = nullptr; + } + } + + grape::Vertex neighbor() const { + return grape::Vertex(neighbor_); + } + + grape::Vertex get_neighbor() const { + return grape::Vertex(neighbor_); + } + + EID_T edge_id() const { return eid_; } + + void* get_data(prop_id_t prop_id) const { + void* _row = get_edge_row(g_, edge_, property_list_); + void* _property = get_edge_property_from_id(edge_label_, prop_id); + return get_property_value_from_row(_row, _property); + } + + template + T get_data(prop_id_t prop_id) const { + void* _data = get_data(prop_id); + return *(static_cast(_data)); + } + + std::string get_str(prop_id_t prop_id) const { + void* _data = get_data(prop_id); + return *(static_cast(_data)); + } + + double get_double(prop_id_t prop_id) const { + void* _data = get_data(prop_id); + return *(static_cast(_data)); + } + + int64_t get_int(prop_id_t prop_id) const { + void* _data = get_data(prop_id); + return *(static_cast(_data)); + } + + inline const GRIN_Nbr& operator++() const { + ++current_; + add_current_value(); + return *this; + } + + inline bool operator==(const GRIN_Nbr& rhs) const { + return (current_ == rhs.current_) && (adj_list_ == rhs.adj_list_); + } + + inline bool operator!=(const GRIN_Nbr& rhs) const { + return (current_ != rhs.current_) || (adj_list_ != rhs.adj_list_); + } + + inline bool operator<(const GRIN_Nbr& rhs) const { + return (current_ < rhs.current_) && (adj_list_ == rhs.adj_list_);; + } + + inline const GRIN_Nbr& operator*() const { return *this; } + + private: + void add_current_value() { + adj_list_iter_ = get_next_adjacent_iter(adj_list_, adj_list_iter_); + void* _v = get_neighbor_from_iter(adj_list_, adj_list_iter_); + void* _vid = get_vertex_id(_v); + neighbor_ = *(static_cast(_vid)); + edge_ = get_edge_from_iter(adj_list_, adj_list_iter); + } + + void* g_; + void* edge_label_; + void* property_list_; + void* adj_list_; + void* adj_list_iter_; + size_t current_; + VID_T neighbor_; + void* edge_; +}; + +template +using GRIN_NbrDefault = GRIN_Nbr; + +template +class GRIN_AdjList { + public: + GRIN_AdjList() : g_(NULL), edge_label_(NULL), adj_list_(NULL), sz_(0), begin_(0), end_(0) {} + GRIN_AdjList(void* g, void* edge_label, void* adj_list, size_t sz) + : g_(g), edge_label_(edge_label), adj_list_(adj_list), sz_(sz), begin_(0), end_(sz) {} + + inline GRIN_Nbr begin() const { + return GRIN_Nbr(g_, edge_label_, adj_list_, begin_); + } + + inline GRIN_Nbr end() const { + return GRIN_Nbr(g_, edge_label_, adj_list_, end_); + } + + inline size_t Size() const { return sz_; } + + inline bool Empty() const { return sz_ == 0; } + + inline bool NotEmpty() const { return sz_ > 0; } + + size_t size() const { return sz_; } + + //inline const NbrUnit* begin_unit() const { return begin_; } + + //inline const NbrUnit* end_unit() const { return end_; } + + private: + const void* g_; + const void* edge_label_; + const void* adj_list_; + const size_t sz_; + const size_t begin_; + const size_t end_; +}; + +template +using GRIN_AdjListDefault = AdjList; + + inline std::string generate_name_with_suffix( const std::string& prefix, property_graph_types::LABEL_ID_TYPE label) { return prefix + "_" + std::to_string(label); @@ -87,7 +227,7 @@ class ArrowFragmentBaseBuilder; template ::type, VID_T>> -class __attribute__((annotate("vineyard"))) ArrowFragment +class __attribute__((annotate("vineyard"))) GRIN_ArrowFragment : public ArrowFragmentBase, public vineyard::BareRegistered< ArrowFragment> { @@ -221,7 +361,7 @@ class __attribute__((annotate("vineyard"))) ArrowFragment grape::LoadStrategy::kBothOutIn; public: - ~ArrowFragment() = default; + ~GRIN_ArrowFragment() = default; // hide vertex_map // vineyard::ObjectID vertex_map_id() const override { return vm_ptr_->id(); } diff --git a/modules/graph/fragment/property_graph_types.h b/modules/graph/fragment/property_graph_types.h index 2ee492d65..6c19890a2 100644 --- a/modules/graph/fragment/property_graph_types.h +++ b/modules/graph/fragment/property_graph_types.h @@ -27,10 +27,6 @@ limitations under the License. #include "basic/ds/arrow.h" #include "common/util/arrow.h" -extern "C" { -#include "grin/topology/adjacentlist.h" -} - namespace vineyard { using fid_t = grape::fid_t; @@ -556,146 +552,6 @@ class AdjList { template using AdjListDefault = AdjList; -template -struct GRIN_Nbr { - private: - using vid_t = VID_T; - using eid_t = EID_T; - using prop_id_t = property_graph_types::PROP_ID_TYPE; - - public: - GRIN_Nbr(void* g, void* edge_label, void* adj_list, size_t current) { - g_ = g; - edge_label_ = edge_label; - adj_list_ = adj_list; - current_ = current; - if (current_ == 0) { - adj_list_iter_ = get_adjacent_list_begin(adj_list_); - property_list_ = get_all_edge_properties_from_label(edge_label_); - } else { - adj_list_iter_ = nullptr; - } - } - - grape::Vertex neighbor() const { - return grape::Vertex(neighbor_); - } - - grape::Vertex get_neighbor() const { - return grape::Vertex(neighbor_); - } - - EID_T edge_id() const { return eid_; } - - void* get_data(prop_id_t prop_id) const { - void* _row = get_edge_row(g_, edge_, property_list_); - void* _property = get_edge_property_from_id(edge_label_, prop_id); - return get_property_value_from_row(_row, _property); - } - - template - T get_data(prop_id_t prop_id) const { - void* _data = get_data(prop_id); - return *(static_cast(_data)); - } - - std::string get_str(prop_id_t prop_id) const { - void* _data = get_data(prop_id); - return *(static_cast(_data)); - } - - double get_double(prop_id_t prop_id) const { - void* _data = get_data(prop_id); - return *(static_cast(_data)); - } - - int64_t get_int(prop_id_t prop_id) const { - void* _data = get_data(prop_id); - return *(static_cast(_data)); - } - - inline const GRIN_Nbr& operator++() const { - ++current_; - add_current_value(); - return *this; - } - - inline bool operator==(const GRIN_Nbr& rhs) const { - return (current_ == rhs.current_) && (adj_list_ == rhs.adj_list_); - } - - inline bool operator!=(const GRIN_Nbr& rhs) const { - return (current_ != rhs.current_) || (adj_list_ != rhs.adj_list_); - } - - inline bool operator<(const GRIN_Nbr& rhs) const { - return (current_ < rhs.current_) && (adj_list_ == rhs.adj_list_);; - } - - inline const GRIN_Nbr& operator*() const { return *this; } - - private: - void add_current_value() { - adj_list_iter_ = get_next_adjacent_iter(adj_list_, adj_list_iter_); - void* _v = get_neighbor_from_iter(adj_list_, adj_list_iter_); - void* _vid = get_vertex_id(_v); - neighbor_ = *(static_cast(_vid)); - edge_ = get_edge_from_iter(adj_list_, adj_list_iter); - } - - void* g_; - void* edge_label_; - void* property_list_; - void* adj_list_; - void* adj_list_iter_; - size_t current_; - VID_T neighbor_; - void* edge_; -}; - -template -using GRIN_NbrDefault = GRIN_Nbr; - -template -class GRIN_AdjList { - public: - GRIN_AdjList() : g_(NULL), edge_label_(NULL), adj_list_(NULL), sz_(0), begin_(0), end_(0) {} - GRIN_AdjList(void* g, void* edge_label, void* adj_list, size_t sz) - : g_(g), edge_label_(edge_label), adj_list_(adj_list), sz_(sz), begin_(0), end_(sz) {} - - inline GRIN_Nbr begin() const { - return GRIN_Nbr(g_, edge_label_, adj_list_, begin_); - } - - inline GRIN_Nbr end() const { - return GRIN_Nbr(g_, edge_label_, adj_list_, end_); - } - - inline size_t Size() const { return sz_; } - - inline bool Empty() const { return sz_ == 0; } - - inline bool NotEmpty() const { return sz_ > 0; } - - size_t size() const { return sz_; } - - //inline const NbrUnit* begin_unit() const { return begin_; } - - //inline const NbrUnit* end_unit() const { return end_; } - - private: - const void* g_; - const void* edge_label_; - const void* adj_list_; - const size_t sz_; - const size_t begin_; - const size_t end_; -}; - -template -using GRIN_AdjListDefault = AdjList; - - /** * OffsetAdjList will offset the outer vertices' lid, makes it between "ivnum" * and "tvnum" instead of "ivnum ~ tvnum - outer vertex index" From e90d1d80ffe41ea067b51e2dee869fbb4b69ea00 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 21 Feb 2023 10:23:47 +0800 Subject: [PATCH 07/85] some fixes --- grin/include/partition/partition.h | 7 - grin/include/predefine.h | 20 +- grin/include/property/primarykey.h | 2 +- grin/include/property/property.h | 55 ++++-- grin/src/partition/partition.cc | 78 +++++--- grin/src/predefine.h | 34 +++- grin/src/property/label.cc | 18 +- .../property/{primarykey.h => primarykey.cc} | 7 +- grin/src/property/property.cc | 185 ++++++++++-------- grin/src/property/propertylist.cc | 89 +++++++-- grin/src/utils.h | 10 +- modules/basic/ds/arrow_utils.cc | 56 ++++++ modules/basic/ds/arrow_utils.h | 2 + 13 files changed, 393 insertions(+), 170 deletions(-) rename grin/src/property/{primarykey.h => primarykey.cc} (82%) diff --git a/grin/include/partition/partition.h b/grin/include/partition/partition.h index 410945203..cf9ca7d81 100644 --- a/grin/include/partition/partition.h +++ b/grin/include/partition/partition.h @@ -19,15 +19,8 @@ limitations under the License. #include "../predefine.h" #ifdef ENABLE_GRAPH_PARTITION -// basic partition informations size_t get_total_partitions_number(const PartitionedGraph); -size_t get_total_vertices_number(const PartitionedGraph); - -size_t get_total_edges_number(const PartitionedGraph); - - -// partition list PartitionList get_local_partition_list(const PartitionedGraph); void destroy_partition_list(PartitionList); diff --git a/grin/include/predefine.h b/grin/include/predefine.h index 7d16aac5f..a697a8c6b 100644 --- a/grin/include/predefine.h +++ b/grin/include/predefine.h @@ -67,15 +67,17 @@ typedef enum { // propertygraph #define WITH_VERTEX_LABEL // There are labels on vertices. #define WITH_VERTEX_PROPERTY // There is any property on vertices. +#define WITH_VERTEX_PROPERTY_NAME // There is cross-label property name. // #define WITH_VERTEX_PRIMARTY_KEYS // There are primary keys for vertex. #define NATURAL_VERTEX_LABEL_ID_TRAIT // Vertex label has natural continuous id from 0. #define NATURAL_VERTEX_PROPERTY_ID_TRAIT // Vertex property has natural continuous id from 0. #define WITH_EDGE_LABEL // There are labels for edges. #define WITH_EDGE_PROPERTY // There is any property for edges. +#define WITH_EDGE_PROPERTY_NAME // There is cross-label property name. #define NATURAL_EDGE_LABEL_ID_TRAIT // Edge label has natural continuous id from 0. #define NATURAL_EDGE_PROPERTY_ID_TRAIT // Edge property has natural continuous id from 0. #define COLUMN_STORE // Column-oriented storage for properties. - +#define ENABLE_VERTEX_ROW_LIST_ITERATOR // Enable vertex row list iterator. // predicate // #define ENABLE_PREDICATE // Enable predicates for vertices and edges. @@ -161,28 +163,20 @@ typedef unsigned EdgeLabelID; #ifdef WITH_VERTEX_PROPERTY typedef void* VertexProperty; -typedef void* VertexPropertyList; #ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT typedef unsigned VertexPropertyID; #endif -#ifdef COLUMN_STORE -typedef void* VertexColumn; -#else -typedef void* VertexRow; -#endif +typedef void* VertexPropertyList; +typedef void* VertexPropertyTable; #endif #ifdef WITH_EDGE_PROPERTY typedef void* EdgeProperty; -typedef void* EdgePropertyList; #ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT typedef unsigned EdgePropertyID; #endif -#ifdef COLUMN_STORE -typedef void* EdgeColumn; -#else -typedef void* EdgeRow; -#endif +typedef void* EdgePropertyList; +typedef void* EdgePropertyTable; #endif #endif // GRIN_INCLUDE_PREDEFINE_H_ diff --git a/grin/include/property/primarykey.h b/grin/include/property/primarykey.h index 491af4a09..55912ccb6 100644 --- a/grin/include/property/primarykey.h +++ b/grin/include/property/primarykey.h @@ -19,7 +19,7 @@ limitations under the License. #ifdef WITH_VERTEX_PRIMARTY_KEYS -PropertyList get_primary_keys(const Graph); +VertexPropertyList get_primary_keys(const Graph); Vertex get_vertex_from_primay_keys(const Graph, const Row); diff --git a/grin/include/property/property.h b/grin/include/property/property.h index e11fdfdec..d072c59da 100644 --- a/grin/include/property/property.h +++ b/grin/include/property/property.h @@ -17,34 +17,59 @@ limitations under the License. #include "../predefine.h" +// Vertex Property #ifdef WITH_VERTEX_PROPERTY void destroy_vertex_property(VertexProperty); +DataType get_vertex_property_type(VertexProperty); + +// Vertex Property Name #ifdef WITH_VERTEX_PROPERTY_NAME char* get_vertex_property_name(const Graph, const VertexProperty); -#ifdef COLUMN_STORE -VertexColumn get_vertex_column_by_name(const Graph, char* name); -#endif +VertexProperty get_vertex_property_by_name(const Graph, const VertexLabel, const char*); #endif -DataType get_vertex_property_type(const Graph, const VertexProperty); +// Vertex Property Table +void destroy_vertex_property_table(VertexPropertyTable); + +void* get_value_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexProperty); + +VertexPropertyTable get_vertex_property_table_by_label(const Graph, const VertexLabel); #ifdef COLUMN_STORE -void destroy_vertex_column(VertexColumn); -#ifdef ENABLE_VERTEX_LIST -VertexColumn get_vertex_column_by_list(const Graph, const VertexList, const VertexProperty); +VertexPropertyTable get_vertex_property_table_for_property(const Graph, const VertexProperty); +#else +VertexPropertyTable get_vertex_property_table_for_vertex(const Graph, const Vertex); #endif -#ifdef WITH_VERTEX_LABEL -VertexColumn get_vertex_column_by_label(const Graph, const VertexLabel, const VertexProperty); + #endif -void* get_value_from_vertex_column(const VertexColumn, const Vertex); -#else -void destroy_vertex_row(VertexRow); -VertexRow get_vertex_row_by_list(const Graph, const Vertex, const VertexPropertyList); -#ifdef WITH_VERTEX_LABEL -VertexRow get_vertex_row_by_label(const Graph, const Vertex, const VertexLabel); + + +// Edge Property +#ifdef WITH_EDGE_PROPERTY +void destroy_edge_property(EdgeProperty); + +DataType get_edge_property_type(EdgeProperty); + +// Edge Property Name +#ifdef WITH_EDGE_PROPERTY_NAME +char* get_edge_property_name(const Graph, const EdgeProperty); + +EdgeProperty get_edge_property_by_name(const Graph, const EdgeLabel, const char*); #endif + +// Edge Property Table +void destroy_edge_property_table(EdgePropertyTable); + +void* get_value_from_edge_property_table(const EdgePropertyTable, const Edge, const EdgeProperty); + +EdgePropertyTable get_edge_property_table_by_label(const Graph, const EdgeLabel); + +#ifdef COLUMN_STORE +EdgePropertyTable get_edge_property_table_for_property(const Graph, const EdgeProperty); +#else +EdgePropertyTable get_edge_property_table_for_edge(const Graph, const Edge); #endif #endif diff --git a/grin/src/partition/partition.cc b/grin/src/partition/partition.cc index 1746e06f8..c1203591f 100644 --- a/grin/src/partition/partition.cc +++ b/grin/src/partition/partition.cc @@ -14,44 +14,75 @@ limitations under the License. */ #include "grin/src/predefine.h" +#include "grin/src/utils.h" #include "grin/include/partition/partition.h" #include "modules/graph/fragment/property_graph_types.h" +#include "src/client/client.h" + #ifdef ENABLE_GRAPH_PARTITION -// basic partition informations size_t get_total_partitions_number(const PartitionedGraph pg) { - // auto _pg = static_cast(pg); - // return _pg->fnum(); -} - -size_t get_total_vertices_number(const PartitionedGraph pg) { - // auto _pg = static_cast(pg); - // return _pg->GetTotalVerticesNum(); + auto _pg = static_cast(pg); + return _pg->total_frag_num(); } -// partition list PartitionList get_local_partition_list(const PartitionedGraph pg) { - // auto _pg = static_cast(pg); - // auto pl = new PartitionList_T(); - // pl->push_back(_pg->fid()); - // return pl; + auto _pg = static_cast(pg); + auto pl = new PartitionList_T(); + vineyard::Client client; + client.Connect(); + for (const auto & [fid, location] : _pg->FragmentLocations()) { + if (location == client.instance_id()) { + pl->push_back(fid); + } + } + return pl; } -void destroy_partition_list(PartitionList); +void destroy_partition_list(PartitionList pl) { + auto _pl = static_cast(pl); + delete _pl; +} -PartitionList create_partition_list(); +PartitionList create_partition_list() { + auto pl = new PartitionList_T(); + return pl; +} -bool insert_partition_to_list(PartitionList, const Partition); +bool insert_partition_to_list(PartitionList pl, const Partition p) { + auto _pl = static_cast(pl); + auto _p = static_cast(p); + _pl->push_back(*_p); + return true; +} -size_t get_partition_list_size(const PartitionList); +size_t get_partition_list_size(const PartitionList pl) { + auto _pl = static_cast(pl); + return _pl->size(); +} -Partition get_partition_from_list(const PartitionList, const size_t); +Partition get_partition_from_list(const PartitionList pl, const size_t idx) { + auto _pl = static_cast(pl); + auto p = new Partition_T((*_pl)[idx]); + return p; +} -void destroy_partition(Partition); +void destroy_partition(Partition p) { + auto _p = static_cast(p); + delete _p; +} -void* get_partition_info(const PartitionedGraph, const Partition); +void* get_partition_info(const PartitionedGraph pg, const Partition p) { + return NULL; +} -Graph get_local_graph_from_partition(const PartitionedGraph, const Partition); +Graph get_local_graph_from_partition(const PartitionedGraph pg, const Partition p) { + auto _pg = static_cast(pg); + auto _p = static_cast(p); + vineyard::Client client; + client.Connect(); + return get_graph_by_object_id(client, _pg->Fragments().at(*_p)); +} #ifdef NATURAL_PARTITION_ID_TRAIT Partition get_partition_from_id(const PartitionID pid) { @@ -137,7 +168,7 @@ VertexRef get_vertex_ref_for_vertex(const Graph g, const Partition p, const Vert auto _g = static_cast(g); auto _v = static_cast(v); auto gid = _g->Vertex2Gid(*_v); - auto vr = new VertexRef(gid); + auto vr = new VertexRef_T(gid); return vr; } @@ -156,7 +187,8 @@ Partition get_master_partition_from_vertex_ref(const Graph g, const VertexRef vr auto _vr = static_cast(vr); auto id_parser = vineyard::IdParser(); id_parser.Init(_g->fnum(), _g->vertex_label_num()); - return id_parser.GetFid(*_vr); + auto p = new Partition_T(id_parser.GetFid(*_vr)); + return p; } char* serialize_vertex_ref(const Graph g, const VertexRef vr) { diff --git a/grin/src/predefine.h b/grin/src/predefine.h index 6adffeaee..9d11838c1 100644 --- a/grin/src/predefine.h +++ b/grin/src/predefine.h @@ -14,6 +14,7 @@ limitations under the License. */ #include "grin/include/predefine.h" #include "modules/graph/fragment/arrow_fragment.h" +#include "modules/graph/fragment/arrow_fragment_group.h" #include "arrow/api.h" @@ -96,6 +97,29 @@ std::string GetDataTypeName(DataType type) { } } +DataType ArrowToDataType(std::shared_ptr type) { + if (type == nullptr) { + return DataType::Undefined; + } else if (arrow::int32()->Equals(type)) { + return DataType::Int32; + } else if (arrow::int64()->Equals(type)) { + return DataType::Int64; + } else if (arrow::float32()->Equals(type)) { + return DataType::Float; + } else if (arrow::uint32()->Equals(type)) { + return DataType::UInt32; + } else if (arrow::uint64()->Equals(type)) { + return DataType::UInt64; + } else if (arrow::float64()->Equals(type)) { + return DataType::Double; + } else if (arrow::utf8()->Equals(type)) { + return DataType::String; + } else if (arrow::large_utf8()->Equals(type)) { + return DataType::String; + } + return DataType::Undefined; +} + #define G_OID_T int #define G_VID_T unsigned @@ -129,7 +153,7 @@ struct AdjacentList_T { #endif #ifdef ENABLE_GRAPH_PARTITION -typedef Graph_T PartitionedGraph_T; +typedef vineyard::ArrowFragmentGroup PartitionedGraph_T; typedef unsigned Partition_T; typedef std::vector PartitionList_T; typedef Graph_T::vid_t VertexRef_T; @@ -149,17 +173,13 @@ typedef std::vector EdgeLabelList_T; #ifdef WITH_VERTEX_PROPERTY typedef std::pair VertexProperty_T; typedef std::vector VertexPropertyList_T; -#ifdef COLUMN_STORE -typedef std::vector VertexColumn_T; -#endif +typedef std::pair VertexPropertyTable_T; #endif #ifdef WITH_EDGE_PROPERTY typedef std::pair EdgeProperty_T; typedef std::vector EdgePropertyList_T; -#ifdef COLUMN_STORE -typedef std::vector EdgeColumn_T; -#endif +typedef std::pair EdgePropertyTable_T; #endif #endif // GRIN_SRC_PREDEFINE_H_ diff --git a/grin/src/property/label.cc b/grin/src/property/label.cc index 6f8d057e9..ec957f7e4 100644 --- a/grin/src/property/label.cc +++ b/grin/src/property/label.cc @@ -170,7 +170,21 @@ EdgeLabel get_edge_label_from_list(const EdgeLabelList ell, const size_t idx) { #if defined(WITH_VERTEX_LABEL) && defined(WITH_EDGE_LABEL) -VertexLabel get_src_label_from_edge_label(const Graph, const EdgeLabel); +VertexLabel get_src_label_from_edge_label(const Graph g, const EdgeLabel elabel) { + auto _g = static_cast(g); + auto _elabel = static_cast(elabel); + auto entry = _g->schema().GetEntry(*_elabel, "EDGE"); + auto pair = entry.relations[0]; + auto vlabel = new VertexLabel_T(_g->schema().GetVertexLabelId(pair.first)); + return vlabel; +} -VertexLabel get_dst_label_from_edge_label(const Graph, const EdgeLabel); +VertexLabel get_dst_label_from_edge_label(const Graph g, const EdgeLabel elabel) { + auto _g = static_cast(g); + auto _elabel = static_cast(elabel); + auto entry = _g->schema().GetEntry(*_elabel, "EDGE"); + auto pair = entry.relations[0]; + auto vlabel = new VertexLabel_T(_g->schema().GetVertexLabelId(pair.second)); + return vlabel; +} #endif diff --git a/grin/src/property/primarykey.h b/grin/src/property/primarykey.cc similarity index 82% rename from grin/src/property/primarykey.h rename to grin/src/property/primarykey.cc index 491af4a09..7ad07f251 100644 --- a/grin/src/property/primarykey.h +++ b/grin/src/property/primarykey.cc @@ -12,10 +12,7 @@ limitations under the License. // This header file is not available for libgrape-lite. -#ifndef GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ -#define GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ - -#include "../predefine.h" +#include "grin/src/predefine.h" #ifdef WITH_VERTEX_PRIMARTY_KEYS @@ -24,5 +21,3 @@ PropertyList get_primary_keys(const Graph); Vertex get_vertex_from_primay_keys(const Graph, const Row); #endif - -#endif // GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ \ No newline at end of file diff --git a/grin/src/property/property.cc b/grin/src/property/property.cc index 143936b1b..cb7edc988 100644 --- a/grin/src/property/property.cc +++ b/grin/src/property/property.cc @@ -10,128 +10,155 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This header file is not available for libgrape-lite. - #include "grin/src/predefine.h" #ifdef WITH_VERTEX_PROPERTY -void destroy_vertex_property(VertexProperty) { - +void destroy_vertex_property(VertexProperty vp) { + auto _vp = static_cast(vp); + delete _vp; } -#ifdef WITH_VERTEX_PROPERTY_NAME -char* get_vertex_property_name(const Graph, const VertexProperty); - -#ifdef COLUMN_STORE -VertexColumn get_vertex_column_by_name(const Graph, char* name); -#endif -#endif DataType get_vertex_property_type(const Graph g, const VertexProperty vp) { auto _g = static_cast(g); auto _vp = static_cast(vp); auto dt = _g->schema().GetVertexPropertyType(_vp->first, _vp->second); - return dt.get(); + return ArrowToDataType(dt); } -#ifdef COLUMN_STORE -void destroy_vertex_column(VertexColumn vc) { - auto _vc = static_cast(vc); - delete _vc; -} -#ifdef ENABLE_VERTEX_LIST -VertexColumn get_vertex_column_by_list(const Graph g, const VertexList vl, - const VertexProperty vp) { +#ifdef WITH_VERTEX_PROPERTY_NAME +char* get_vertex_property_name(const Graph g, const VertexProperty vp) { auto _g = static_cast(g); - auto _vl = static_cast(vl); auto _vp = static_cast(vp); + auto s = _g->schema().GetVertexPropertyName(_vp->first, _vp->second); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} - if (_vl->size() > 1) return NULL_LIST; - auto v = (*_vl)[0].begin(); - auto vlabel = _g->vertex_label(*v); - - if (_vp->first != vlabel) return NULL_LIST; - auto vc = new VertexColumn_T(); - vc->push_back(*_vp); - return vc; +VertexProperty get_vertex_property_by_name(const Graph g, const VertexLabel vlabel, + const char* name) { + auto _g = static_cast(g); + auto _vlabel = static_cast(vlabel); + auto s = std::string(name); + auto vp = new VertexProperty_T(*_vlabel, _g->schema().GetVertexPropertyId(*_vlabel, s)); + return vp; } + #endif -#ifdef WITH_VERTEX_LABEL -VertexColumn get_vertex_column_by_label(const Graph g, const VertexLabel vl, - const VertexProperty vp) { + +// Vertex Property Table +void destroy_vertex_property_table(VertexPropertyTable vpt) { + auto _vpt = static_cast(vpt); + delete _vpt; +} + +const void* get_value_from_vertex_property_table(const Graph g, const VertexPropertyTable vpt, + const Vertex v, const VertexProperty vp) { auto _g = static_cast(g); - auto _vl = static_cast(vl); + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); auto _vp = static_cast(vp); + if (_vp->first != _vpt->first || !_vpt->second.Contain(*_v)) return NULL; + auto offset = _v->GetValue() - _vpt->second.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return result; +} - if (*_vl != _vp->first) return NULL_LIST; - auto vc = new VertexColumn_T(); - vc->push_back(*_vp); - return vc; +VertexPropertyTable get_vertex_property_table_by_label(const Graph g, const VertexLabel vlabel) { + auto _g = static_cast(g); + auto _vlabel = static_cast(vlabel); + auto vpt = new VertexPropertyTable_T(*_vlabel, _g->InnerVertices(*_vlabel)); + return vpt; } -#endif -void* get_value_from_vertex_column(const Graph g, const VertexColumn vc, const Vertex v) { + +#ifdef COLUMN_STORE +VertexPropertyTable get_vertex_property_table_for_property(const Graph g, const VertexProperty vp) { auto _g = static_cast(g); - auto _vc = static_cast(vc); - auto _v = static_cast(v); - auto vp = (*_vc)[0]; - auto dt = _g->schema().GetVertexPropertyType(vp.first, vp.second); - auto c = _g->vertex_data_column(vp.first, vp.second); - return &c[_v]; + auto _vp = static_cast(vp); + auto vlabel = _vp->first; + auto vpt = new VertexPropertyTable_T(vlabel, _g->InnerVertices(vlabel)); + return vpt; } #else -void destroy_vertex_row(VertexRow); -VertexRow get_vertex_row_by_list(const Graph, const Vertex, const VertexPropertyList); -#ifdef WITH_VERTEX_LABEL -VertexRow get_vertex_row_by_label(const Graph, const Vertex, const VertexLabel); -#endif +VertexPropertyTable get_vertex_property_table_for_vertex(const Graph, const Vertex); #endif #endif -#ifdef WITH_EDGE_PROPERTY -#ifdef WITH_EDGE_PROPERTY_NAME -char* get_edge_property_name(const Graph, const EdgeProperty); -#ifdef COLUMN_STORE -EdgeColumn get_edge_column_by_name(const Graph, char* name); -#endif -#endif +#ifdef WITH_EDGE_PROPERTY +void destroy_edge_property(EdgeProperty ep) { + auto _ep = static_cast(ep); + delete _ep; +} DataType get_edge_property_type(const Graph g, const EdgeProperty ep) { auto _g = static_cast(g); auto _ep = static_cast(ep); auto dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); - return dt.get(); + return ArrowToDataType(dt); } -#ifdef COLUMN_STORE -#ifdef WITH_EDGE_LABEL -EdgeColumn get_edge_column_by_label(const Graph g, const EdgeLabel el, - const EdgeProperty ep) { +#ifdef WITH_EDGE_PROPERTY_NAME +char* get_edge_property_name(const Graph g, const EdgeProperty ep) { auto _g = static_cast(g); - auto _el = static_cast(el); auto _ep = static_cast(ep); + auto s = _g->schema().GetEdgePropertyName(_ep->first, _ep->second); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} - if (*_el != _ep->first) return NULL_LIST; - auto ec = new EdgeColumn_T(); - ec->push_back(*_ep); - return ec; +EdgeProperty get_edge_property_by_name(const Graph g, const EdgeLabel elabel, + const char* name) { + auto _g = static_cast(g); + auto _elabel = static_cast(elabel); + auto s = std::string(name); + auto ep = new EdgeProperty_T(*_elabel, _g->schema().GetEdgePropertyId(*_elabel, s)); + return ep; } + #endif -void* get_value_from_edge_column(const Graph g, const EdgeColumn ec, const Edge e) { + +// Edge Property Table +void destroy_edge_property_table(EdgePropertyTable ept) { + auto _ept = static_cast(ept); + delete _ept; +} + +const void* get_value_from_edge_property_table(const Graph g, const EdgePropertyTable ept, + const Edge e, const EdgeProperty ep) { auto _g = static_cast(g); - auto _ec = static_cast(ec); + auto _ept = static_cast(ept); auto _e = static_cast(e); - auto ep = (*_ec)[0]; - auto dt = _g->schema().GetEdgePropertyType(ep.first, ep.second); - auto c = _g->edge_data_column(ep.first, ep.second); - return &c[_e->eid]; + auto _ep = static_cast(ep); + if (_ep->first != _ept->first || _e->eid >= _ept->second) return NULL; + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return result; } -#else -EdgeRow get_edge_row_by_list(const Graph, const Edge, const EdgePropertyList); -#ifdef WITH_EDGE_LABEL -EdgeRow get_edge_row_by_label(const Graph, const Edge, const EdgeLabel); -#endif -#endif +EdgePropertyTable get_edge_property_table_by_label(const Graph g, const EdgeLabel elabel) { + auto _g = static_cast(g); + auto _elabel = static_cast(elabel); + auto ept = new EdgePropertyTable_T(*_elabel, _g->edge_data_table(*_elabel)->num_rows()); + return ept; +} + +#ifdef COLUMN_STORE +EdgePropertyTable get_edge_property_table_for_property(const Graph g, const EdgeProperty ep) { + auto _g = static_cast(g); + auto _ep = static_cast(ep); + auto elabel = _ep->first; + auto ept = new EdgePropertyTable_T(elabel, _g->edge_data_table(elabel)->num_rows()); + return ept; +} +#else +EdgePropertyTable get_edge_property_table_for_edge(const Graph, const Edge); #endif +#endif \ No newline at end of file diff --git a/grin/src/property/propertylist.cc b/grin/src/property/propertylist.cc index a874d14dd..d06b34729 100644 --- a/grin/src/property/propertylist.cc +++ b/grin/src/property/propertylist.cc @@ -16,7 +16,7 @@ limitations under the License. #include "grin/src/utils.h" #include "grin/include/property/propertylist.h" -// Property list +// Vertex property list #ifdef WITH_VERTEX_PROPERTY VertexPropertyList get_all_vertex_properties(const Graph g) { auto _g = static_cast(g); @@ -85,30 +85,76 @@ VertexPropertyID get_vertex_property_id(const VertexLabel vlabel, const VertexPr #endif #endif +// Edge property list #ifdef WITH_EDGE_PROPERTY -EdgePropertyList get_all_edge_properties(const Graph); +EdgePropertyList get_all_edge_properties(const Graph g) { + auto _g = static_cast(g); + auto epl = new EdgePropertyList_T(); + for (auto elabel = 0; elabel < _g->edge_label_num(); ++elabel) { + for (auto p = 0; p < _g->edge_property_num(elabel); ++p) { + epl->push_back(EdgeProperty_T(elabel, p)); + } + } + return epl; +} -size_t get_edge_property_list_size(const EdgePropertyList); +size_t get_edge_property_list_size(const EdgePropertyList epl) { + auto _epl = static_cast(epl); + return _epl->size(); +} -EdgeProperty get_edge_property_from_list(const EdgePropertyList, const size_t); +EdgeProperty get_edge_property_from_list(const EdgePropertyList epl, const size_t idx) { + auto _epl = static_cast(epl); + auto ep = new EdgeProperty_T((*_epl)[idx]); + return ep; +} -EdgePropertyList create_edge_property_list(); +EdgePropertyList create_edge_property_list() { + auto epl = new EdgePropertyList_T(); + return epl; +} -void destroy_edge_property_list(EdgePropertyList); +void destroy_edge_property_list(EdgePropertyList epl) { + auto _epl = static_cast(epl); + delete _epl; +} -bool insert_edge_property_to_list(EdgePropertyList, const EdgeProperty); +bool insert_edge_property_to_list(EdgePropertyList epl, const EdgeProperty ep) { + auto _epl = static_cast(epl); + auto _ep = static_cast(ep); + _epl->push_back(*_ep); + return true; +} #ifdef WITH_EDGE_LABEL -EdgePropertyList get_all_edge_properties_by_label(const Graph, const EdgeLabel); +EdgePropertyList get_all_edge_properties_by_label(const Graph g, const EdgeLabel elabel) { + auto _g = static_cast(g); + auto _elabel = static_cast(elabel); + auto epl = new EdgePropertyList_T(); + for (auto p = 0; p < _g->edge_property_num(*_elabel); ++p) { + epl->push_back(EdgeProperty_T(*_elabel, p)); + } + return epl; +} #ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT -EdgeProperty get_edge_property_from_id(const EdgeLabel, const EdgePropertyID); +EdgeProperty get_edge_property_from_id(const EdgeLabel elabel, const EdgePropertyID epi) { + auto _elabel = static_cast(elabel); + auto ep = new EdgeProperty_T(*_elabel, epi); + return ep; +} -EdgePropertyID get_edge_property_id(const EdgeLabel, const EdgeProperty); +EdgePropertyID get_edge_property_id(const EdgeLabel elabel, const EdgeProperty ep) { + auto _elabel = static_cast(elabel); + auto _ep = static_cast(ep); + if (*_elabel != _ep->first) return NULL_NATURAL_ID; + return _ep->second; +} #endif #endif #endif + // graph projection #if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE) Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { @@ -122,11 +168,28 @@ Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { vertices[p.first].push_back(p.second); } } - auto client = get_client(); + vineyard::Client client; + client.Connect(); auto object_id = _g->Project(client, vertices, edges); - return get_graph_by_object_id(object_id); + return get_graph_by_object_id(client, object_id.value()); } #endif + #if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE) -Graph select_edge_properteis(const Graph, const EdgePropertyList); +Graph select_edge_properteis(const Graph g, const EdgePropertyList epl) { + auto _g = static_cast(g); + auto _epl = static_cast(epl); + std::map> vertices, edges; + for (auto& p: *_epl) { + if (edges.find(p.first) == edges.end()) { + edges.insert(p.first, {p.second}); + } else { + edges[p.first].push_back(p.second); + } + } + vineyard::Client client; + client.Connect(); + auto object_id = _g->Project(client, vertices, edges); + return get_graph_by_object_id(client, object_id.value()); +} #endif \ No newline at end of file diff --git a/grin/src/utils.h b/grin/src/utils.h index 6e727e53e..65e07cac4 100644 --- a/grin/src/utils.h +++ b/grin/src/utils.h @@ -13,14 +13,16 @@ See the License for the specific language governing permissions and limitations under the License. */ #include "grin/include/predefine.h" - +#include "src/client/client.h" +#include "modules/graph/fragment/arrow_fragment.h" #ifndef GRIN_SRC_UTILS_H_ #define GRIN_SRC_UTILS_H_ -vineyard::Client get_client(); - -Graph get_graph_by_object_id(vineyard::Client&, vineyard::ObjectID); +Graph get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { + auto frag = std::dynamic_pointer_cast>(client.GetObject(object_id)); + return frag.get(); +} #endif // GRIN_SRC_UTILS_H_ \ No newline at end of file diff --git a/modules/basic/ds/arrow_utils.cc b/modules/basic/ds/arrow_utils.cc index 962885fcb..2a0dc865f 100644 --- a/modules/basic/ds/arrow_utils.cc +++ b/modules/basic/ds/arrow_utils.cc @@ -743,6 +743,62 @@ const void* get_arrow_array_data(std::shared_ptr const& array) { } } +const void* get_arrow_array_data_element(std::shared_ptr const& array, unsigned offset) { + if (array->type()->Equals(arrow::int8())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array)->raw_values() + offset); + } else if (array->type()->Equals(arrow::uint8())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array)->raw_values() + offset); + } else if (array->type()->Equals(arrow::int16())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array)->raw_values() + offset); + } else if (array->type()->Equals(arrow::uint16())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array)->raw_values() + offset); + } else if (array->type()->Equals(arrow::int32())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array)->raw_values() + offset); + } else if (array->type()->Equals(arrow::uint32())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array)->raw_values() + offset); + } else if (array->type()->Equals(arrow::int64())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array)->raw_values() + offset); + } else if (array->type()->Equals(arrow::uint64())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array)->raw_values() + offset); + } else if (array->type()->Equals(arrow::float32())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array)->raw_values() + offset); + } else if (array->type()->Equals(arrow::float64())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array)->raw_values() + offset); + } else if (array->type()->Equals(arrow::utf8())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array).get() + offset); + } else if (array->type()->Equals(arrow::large_utf8())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array).get() + offset); + } else if (array->type()->id() == arrow::Type::LIST) { + return reinterpret_cast( + std::dynamic_pointer_cast(array).get() + offset); + } else if (array->type()->id() == arrow::Type::LARGE_LIST) { + return reinterpret_cast( + std::dynamic_pointer_cast(array).get() + offset); + } else if (array->type()->id() == arrow::Type::FIXED_SIZE_LIST) { + return reinterpret_cast( + std::dynamic_pointer_cast(array).get() + offset); + } else if (array->type()->Equals(arrow::null())) { + return reinterpret_cast( + std::dynamic_pointer_cast(array).get() + offset); + } else { + LOG(ERROR) << "Unsupported arrow array type '" << array->type()->ToString() + << "', type id: " << array->type()->id(); + return NULL; + } +} + Status TypeLoosen(const std::vector>& schemas, std::shared_ptr& schema) { int field_num = -1; diff --git a/modules/basic/ds/arrow_utils.h b/modules/basic/ds/arrow_utils.h index 98ddec8ca..c30dc2aea 100644 --- a/modules/basic/ds/arrow_utils.h +++ b/modules/basic/ds/arrow_utils.h @@ -285,6 +285,8 @@ std::string type_name_from_arrow_type( const void* get_arrow_array_data(std::shared_ptr const& array); +const void* get_arrow_array_data_element(std::shared_ptr const& array, unsigned offset); + Status TypeLoosen(const std::vector>& schemas, std::shared_ptr& schema); From 812bafadadcd1de666ebf4ca80a9787910c4b049 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 24 Feb 2023 08:45:03 +0800 Subject: [PATCH 08/85] add doxygen comments --- grin/docs/Doxyfile | 2694 +++++++++++++++++ grin/docs/Doxyfile.bak | 2553 ++++++++++++++++ grin/docs/README.md | 36 + .../doxygen/html/adjacentlist_8h_source.html | 121 + grin/docs/_build/doxygen/html/bc_s.png | Bin 0 -> 676 bytes grin/docs/_build/doxygen/html/bc_sd.png | Bin 0 -> 635 bytes grin/docs/_build/doxygen/html/bdwn.png | Bin 0 -> 147 bytes grin/docs/_build/doxygen/html/closed.png | Bin 0 -> 132 bytes .../dir_49e56c817e5e54854c35e136979f97ca.html | 86 + .../dir_85395b416142281e9b8cbaa2a4bb7bc5.html | 92 + .../dir_d44c64559bbebec7f509842c48db8b23.html | 102 + .../dir_f450b25d4e0d87eea6a09d028ca7ee7d.html | 98 + .../dir_ffb75fe14fe29e45cb01a712fdfb6c45.html | 108 + grin/docs/_build/doxygen/html/doc.png | Bin 0 -> 746 bytes grin/docs/_build/doxygen/html/docd.png | Bin 0 -> 756 bytes grin/docs/_build/doxygen/html/doxygen.css | 2007 ++++++++++++ grin/docs/_build/doxygen/html/doxygen.svg | 26 + grin/docs/_build/doxygen/html/dynsections.js | 130 + .../doxygen/html/edgelist_8h_source.html | 126 + grin/docs/_build/doxygen/html/files.html | 102 + .../docs/_build/doxygen/html/folderclosed.png | Bin 0 -> 616 bytes grin/docs/_build/doxygen/html/folderopen.png | Bin 0 -> 597 bytes grin/docs/_build/doxygen/html/globals.html | 206 ++ .../_build/doxygen/html/globals_defs.html | 129 + .../_build/doxygen/html/globals_enum.html | 83 + .../_build/doxygen/html/globals_eval.html | 94 + .../_build/doxygen/html/globals_func.html | 107 + .../_build/doxygen/html/globals_type.html | 82 + grin/docs/_build/doxygen/html/group__nv.html | 364 +++ grin/docs/_build/doxygen/html/index.html | 134 + grin/docs/_build/doxygen/html/jquery.js | 34 + grin/docs/_build/doxygen/html/label_8h.html | 290 ++ .../_build/doxygen/html/label_8h_source.html | 119 + grin/docs/_build/doxygen/html/menu.js | 136 + grin/docs/_build/doxygen/html/menudata.js | 51 + grin/docs/_build/doxygen/html/modules.html | 87 + grin/docs/_build/doxygen/html/nav_f.png | Bin 0 -> 153 bytes grin/docs/_build/doxygen/html/nav_fd.png | Bin 0 -> 169 bytes grin/docs/_build/doxygen/html/nav_g.png | Bin 0 -> 95 bytes grin/docs/_build/doxygen/html/nav_h.png | Bin 0 -> 98 bytes grin/docs/_build/doxygen/html/nav_hd.png | Bin 0 -> 114 bytes grin/docs/_build/doxygen/html/open.png | Bin 0 -> 123 bytes .../doxygen/html/partition_8h_source.html | 207 ++ .../_build/doxygen/html/predefine_8h.html | 1476 +++++++++ .../doxygen/html/predefine_8h_source.html | 335 ++ .../_build/doxygen/html/primarykey_8h.html | 220 ++ .../doxygen/html/primarykey_8h_source.html | 104 + .../docs/_build/doxygen/html/property_8h.html | 371 +++ .../doxygen/html/property_8h_source.html | 126 + .../_build/doxygen/html/propertylist_8h.html | 163 + .../doxygen/html/propertylist_8h_source.html | 146 + .../_build/doxygen/html/propertytable_8h.html | 286 ++ .../doxygen/html/propertytable_8h_source.html | 125 + grin/docs/_build/doxygen/html/search/all_0.js | 4 + grin/docs/_build/doxygen/html/search/all_1.js | 4 + grin/docs/_build/doxygen/html/search/all_2.js | 5 + grin/docs/_build/doxygen/html/search/all_3.js | 10 + grin/docs/_build/doxygen/html/search/all_4.js | 13 + grin/docs/_build/doxygen/html/search/all_5.js | 5 + grin/docs/_build/doxygen/html/search/all_6.js | 22 + grin/docs/_build/doxygen/html/search/all_7.js | 7 + grin/docs/_build/doxygen/html/search/all_8.js | 4 + grin/docs/_build/doxygen/html/search/all_9.js | 19 + grin/docs/_build/doxygen/html/search/all_a.js | 4 + grin/docs/_build/doxygen/html/search/all_b.js | 8 + grin/docs/_build/doxygen/html/search/all_c.js | 6 + grin/docs/_build/doxygen/html/search/all_d.js | 4 + grin/docs/_build/doxygen/html/search/all_e.js | 6 + grin/docs/_build/doxygen/html/search/all_f.js | 10 + .../docs/_build/doxygen/html/search/close.svg | 31 + .../_build/doxygen/html/search/defines_0.js | 4 + .../_build/doxygen/html/search/defines_1.js | 13 + .../_build/doxygen/html/search/defines_2.js | 19 + .../_build/doxygen/html/search/defines_3.js | 10 + .../_build/doxygen/html/search/enums_0.js | 5 + .../doxygen/html/search/enumvalues_0.js | 4 + .../doxygen/html/search/enumvalues_1.js | 6 + .../doxygen/html/search/enumvalues_2.js | 4 + .../doxygen/html/search/enumvalues_3.js | 6 + .../doxygen/html/search/enumvalues_4.js | 4 + .../doxygen/html/search/enumvalues_5.js | 4 + .../doxygen/html/search/enumvalues_6.js | 6 + .../_build/doxygen/html/search/files_0.js | 4 + .../_build/doxygen/html/search/files_1.js | 8 + .../_build/doxygen/html/search/files_2.js | 4 + .../_build/doxygen/html/search/functions_0.js | 4 + .../_build/doxygen/html/search/functions_1.js | 4 + .../_build/doxygen/html/search/functions_2.js | 5 + .../_build/doxygen/html/search/functions_3.js | 4 + .../_build/doxygen/html/search/functions_4.js | 21 + .../_build/doxygen/html/search/functions_5.js | 4 + .../_build/doxygen/html/search/functions_6.js | 5 + .../_build/doxygen/html/search/groups_0.js | 4 + grin/docs/_build/doxygen/html/search/mag.svg | 37 + .../docs/_build/doxygen/html/search/mag_d.svg | 37 + .../_build/doxygen/html/search/mag_sel.svg | 74 + .../_build/doxygen/html/search/mag_seld.svg | 74 + .../_build/doxygen/html/search/pages_0.js | 4 + .../_build/doxygen/html/search/search.css | 291 ++ .../docs/_build/doxygen/html/search/search.js | 816 +++++ .../_build/doxygen/html/search/searchdata.js | 33 + .../_build/doxygen/html/search/typedefs_0.js | 4 + grin/docs/_build/doxygen/html/splitbar.png | Bin 0 -> 314 bytes grin/docs/_build/doxygen/html/splitbard.png | Bin 0 -> 282 bytes .../doxygen/html/structure_8h_source.html | 151 + grin/docs/_build/doxygen/html/svgpan.js | 323 ++ grin/docs/_build/doxygen/html/sync_off.png | Bin 0 -> 853 bytes grin/docs/_build/doxygen/html/sync_on.png | Bin 0 -> 845 bytes grin/docs/_build/doxygen/html/tab_a.png | Bin 0 -> 142 bytes grin/docs/_build/doxygen/html/tab_ad.png | Bin 0 -> 135 bytes grin/docs/_build/doxygen/html/tab_b.png | Bin 0 -> 169 bytes grin/docs/_build/doxygen/html/tab_bd.png | Bin 0 -> 173 bytes grin/docs/_build/doxygen/html/tab_h.png | Bin 0 -> 177 bytes grin/docs/_build/doxygen/html/tab_hd.png | Bin 0 -> 180 bytes grin/docs/_build/doxygen/html/tab_s.png | Bin 0 -> 184 bytes grin/docs/_build/doxygen/html/tab_sd.png | Bin 0 -> 188 bytes grin/docs/_build/doxygen/html/tabs.css | 1 + grin/docs/_build/doxygen/html/type_8h.html | 184 ++ .../_build/doxygen/html/type_8h_source.html | 162 + .../doxygen/html/vertexlist_8h_source.html | 126 + grin/docs/_build/doxygen/xml/Doxyfile.xml | 342 +++ .../_build/doxygen/xml/_r_e_a_d_m_e_8md.xml | 49 + .../_build/doxygen/xml/adjacentlist_8h.xml | 204 ++ grin/docs/_build/doxygen/xml/combine.xslt | 15 + grin/docs/_build/doxygen/xml/compound.xsd | 1305 ++++++++ .../dir_49e56c817e5e54854c35e136979f97ca.xml | 11 + .../dir_85395b416142281e9b8cbaa2a4bb7bc5.xml | 12 + .../dir_d44c64559bbebec7f509842c48db8b23.xml | 15 + .../dir_f450b25d4e0d87eea6a09d028ca7ee7d.xml | 15 + .../dir_ffb75fe14fe29e45cb01a712fdfb6c45.xml | 17 + grin/docs/_build/doxygen/xml/doxyfile.xsd | 45 + grin/docs/_build/doxygen/xml/edgelist_8h.xml | 80 + grin/docs/_build/doxygen/xml/group__nv.xml | 170 ++ grin/docs/_build/doxygen/xml/index.xml | 263 ++ grin/docs/_build/doxygen/xml/index.xsd | 71 + grin/docs/_build/doxygen/xml/indexpage.xml | 80 + grin/docs/_build/doxygen/xml/label_8h.xml | 358 +++ grin/docs/_build/doxygen/xml/partition_8h.xml | 906 ++++++ grin/docs/_build/doxygen/xml/predefine_8h.xml | 1294 ++++++++ .../docs/_build/doxygen/xml/primarykey_8h.xml | 180 ++ grin/docs/_build/doxygen/xml/property_8h.xml | 382 +++ .../_build/doxygen/xml/propertylist_8h.xml | 453 +++ .../_build/doxygen/xml/propertytable_8h.xml | 326 ++ grin/docs/_build/doxygen/xml/structure_8h.xml | 435 +++ grin/docs/_build/doxygen/xml/type_8h.xml | 593 ++++ .../docs/_build/doxygen/xml/vertexlist_8h.xml | 281 ++ grin/docs/_build/doxygen/xml/xml.xsd | 23 + grin/include/index/label.h | 101 + grin/include/partition/partition.h | 14 +- grin/include/predefine.h | 402 ++- grin/include/property/label.h | 83 - grin/include/property/primarykey.h | 49 +- grin/include/property/property.h | 111 +- grin/include/property/propertylist.h | 53 +- grin/include/property/propertytable.h | 139 + grin/include/property/type.h | 99 + grin/include/topology/adjacentlist.h | 4 +- grin/include/topology/edgelist.h | 8 +- grin/include/topology/structure.h | 20 +- grin/include/topology/vertexlist.h | 23 +- 160 files changed, 25125 insertions(+), 293 deletions(-) create mode 100644 grin/docs/Doxyfile create mode 100644 grin/docs/Doxyfile.bak create mode 100644 grin/docs/README.md create mode 100644 grin/docs/_build/doxygen/html/adjacentlist_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/bc_s.png create mode 100644 grin/docs/_build/doxygen/html/bc_sd.png create mode 100644 grin/docs/_build/doxygen/html/bdwn.png create mode 100644 grin/docs/_build/doxygen/html/closed.png create mode 100644 grin/docs/_build/doxygen/html/dir_49e56c817e5e54854c35e136979f97ca.html create mode 100644 grin/docs/_build/doxygen/html/dir_85395b416142281e9b8cbaa2a4bb7bc5.html create mode 100644 grin/docs/_build/doxygen/html/dir_d44c64559bbebec7f509842c48db8b23.html create mode 100644 grin/docs/_build/doxygen/html/dir_f450b25d4e0d87eea6a09d028ca7ee7d.html create mode 100644 grin/docs/_build/doxygen/html/dir_ffb75fe14fe29e45cb01a712fdfb6c45.html create mode 100644 grin/docs/_build/doxygen/html/doc.png create mode 100644 grin/docs/_build/doxygen/html/docd.png create mode 100644 grin/docs/_build/doxygen/html/doxygen.css create mode 100644 grin/docs/_build/doxygen/html/doxygen.svg create mode 100644 grin/docs/_build/doxygen/html/dynsections.js create mode 100644 grin/docs/_build/doxygen/html/edgelist_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/files.html create mode 100644 grin/docs/_build/doxygen/html/folderclosed.png create mode 100644 grin/docs/_build/doxygen/html/folderopen.png create mode 100644 grin/docs/_build/doxygen/html/globals.html create mode 100644 grin/docs/_build/doxygen/html/globals_defs.html create mode 100644 grin/docs/_build/doxygen/html/globals_enum.html create mode 100644 grin/docs/_build/doxygen/html/globals_eval.html create mode 100644 grin/docs/_build/doxygen/html/globals_func.html create mode 100644 grin/docs/_build/doxygen/html/globals_type.html create mode 100644 grin/docs/_build/doxygen/html/group__nv.html create mode 100644 grin/docs/_build/doxygen/html/index.html create mode 100644 grin/docs/_build/doxygen/html/jquery.js create mode 100644 grin/docs/_build/doxygen/html/label_8h.html create mode 100644 grin/docs/_build/doxygen/html/label_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/menu.js create mode 100644 grin/docs/_build/doxygen/html/menudata.js create mode 100644 grin/docs/_build/doxygen/html/modules.html create mode 100644 grin/docs/_build/doxygen/html/nav_f.png create mode 100644 grin/docs/_build/doxygen/html/nav_fd.png create mode 100644 grin/docs/_build/doxygen/html/nav_g.png create mode 100644 grin/docs/_build/doxygen/html/nav_h.png create mode 100644 grin/docs/_build/doxygen/html/nav_hd.png create mode 100644 grin/docs/_build/doxygen/html/open.png create mode 100644 grin/docs/_build/doxygen/html/partition_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/predefine_8h.html create mode 100644 grin/docs/_build/doxygen/html/predefine_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/primarykey_8h.html create mode 100644 grin/docs/_build/doxygen/html/primarykey_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/property_8h.html create mode 100644 grin/docs/_build/doxygen/html/property_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/propertylist_8h.html create mode 100644 grin/docs/_build/doxygen/html/propertylist_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/propertytable_8h.html create mode 100644 grin/docs/_build/doxygen/html/propertytable_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/search/all_0.js create mode 100644 grin/docs/_build/doxygen/html/search/all_1.js create mode 100644 grin/docs/_build/doxygen/html/search/all_2.js create mode 100644 grin/docs/_build/doxygen/html/search/all_3.js create mode 100644 grin/docs/_build/doxygen/html/search/all_4.js create mode 100644 grin/docs/_build/doxygen/html/search/all_5.js create mode 100644 grin/docs/_build/doxygen/html/search/all_6.js create mode 100644 grin/docs/_build/doxygen/html/search/all_7.js create mode 100644 grin/docs/_build/doxygen/html/search/all_8.js create mode 100644 grin/docs/_build/doxygen/html/search/all_9.js create mode 100644 grin/docs/_build/doxygen/html/search/all_a.js create mode 100644 grin/docs/_build/doxygen/html/search/all_b.js create mode 100644 grin/docs/_build/doxygen/html/search/all_c.js create mode 100644 grin/docs/_build/doxygen/html/search/all_d.js create mode 100644 grin/docs/_build/doxygen/html/search/all_e.js create mode 100644 grin/docs/_build/doxygen/html/search/all_f.js create mode 100644 grin/docs/_build/doxygen/html/search/close.svg create mode 100644 grin/docs/_build/doxygen/html/search/defines_0.js create mode 100644 grin/docs/_build/doxygen/html/search/defines_1.js create mode 100644 grin/docs/_build/doxygen/html/search/defines_2.js create mode 100644 grin/docs/_build/doxygen/html/search/defines_3.js create mode 100644 grin/docs/_build/doxygen/html/search/enums_0.js create mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_0.js create mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_1.js create mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_2.js create mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_3.js create mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_4.js create mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_5.js create mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_6.js create mode 100644 grin/docs/_build/doxygen/html/search/files_0.js create mode 100644 grin/docs/_build/doxygen/html/search/files_1.js create mode 100644 grin/docs/_build/doxygen/html/search/files_2.js create mode 100644 grin/docs/_build/doxygen/html/search/functions_0.js create mode 100644 grin/docs/_build/doxygen/html/search/functions_1.js create mode 100644 grin/docs/_build/doxygen/html/search/functions_2.js create mode 100644 grin/docs/_build/doxygen/html/search/functions_3.js create mode 100644 grin/docs/_build/doxygen/html/search/functions_4.js create mode 100644 grin/docs/_build/doxygen/html/search/functions_5.js create mode 100644 grin/docs/_build/doxygen/html/search/functions_6.js create mode 100644 grin/docs/_build/doxygen/html/search/groups_0.js create mode 100644 grin/docs/_build/doxygen/html/search/mag.svg create mode 100644 grin/docs/_build/doxygen/html/search/mag_d.svg create mode 100644 grin/docs/_build/doxygen/html/search/mag_sel.svg create mode 100644 grin/docs/_build/doxygen/html/search/mag_seld.svg create mode 100644 grin/docs/_build/doxygen/html/search/pages_0.js create mode 100644 grin/docs/_build/doxygen/html/search/search.css create mode 100644 grin/docs/_build/doxygen/html/search/search.js create mode 100644 grin/docs/_build/doxygen/html/search/searchdata.js create mode 100644 grin/docs/_build/doxygen/html/search/typedefs_0.js create mode 100644 grin/docs/_build/doxygen/html/splitbar.png create mode 100644 grin/docs/_build/doxygen/html/splitbard.png create mode 100644 grin/docs/_build/doxygen/html/structure_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/svgpan.js create mode 100644 grin/docs/_build/doxygen/html/sync_off.png create mode 100644 grin/docs/_build/doxygen/html/sync_on.png create mode 100644 grin/docs/_build/doxygen/html/tab_a.png create mode 100644 grin/docs/_build/doxygen/html/tab_ad.png create mode 100644 grin/docs/_build/doxygen/html/tab_b.png create mode 100644 grin/docs/_build/doxygen/html/tab_bd.png create mode 100644 grin/docs/_build/doxygen/html/tab_h.png create mode 100644 grin/docs/_build/doxygen/html/tab_hd.png create mode 100644 grin/docs/_build/doxygen/html/tab_s.png create mode 100644 grin/docs/_build/doxygen/html/tab_sd.png create mode 100644 grin/docs/_build/doxygen/html/tabs.css create mode 100644 grin/docs/_build/doxygen/html/type_8h.html create mode 100644 grin/docs/_build/doxygen/html/type_8h_source.html create mode 100644 grin/docs/_build/doxygen/html/vertexlist_8h_source.html create mode 100644 grin/docs/_build/doxygen/xml/Doxyfile.xml create mode 100644 grin/docs/_build/doxygen/xml/_r_e_a_d_m_e_8md.xml create mode 100644 grin/docs/_build/doxygen/xml/adjacentlist_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/combine.xslt create mode 100644 grin/docs/_build/doxygen/xml/compound.xsd create mode 100644 grin/docs/_build/doxygen/xml/dir_49e56c817e5e54854c35e136979f97ca.xml create mode 100644 grin/docs/_build/doxygen/xml/dir_85395b416142281e9b8cbaa2a4bb7bc5.xml create mode 100644 grin/docs/_build/doxygen/xml/dir_d44c64559bbebec7f509842c48db8b23.xml create mode 100644 grin/docs/_build/doxygen/xml/dir_f450b25d4e0d87eea6a09d028ca7ee7d.xml create mode 100644 grin/docs/_build/doxygen/xml/dir_ffb75fe14fe29e45cb01a712fdfb6c45.xml create mode 100644 grin/docs/_build/doxygen/xml/doxyfile.xsd create mode 100644 grin/docs/_build/doxygen/xml/edgelist_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/group__nv.xml create mode 100644 grin/docs/_build/doxygen/xml/index.xml create mode 100644 grin/docs/_build/doxygen/xml/index.xsd create mode 100644 grin/docs/_build/doxygen/xml/indexpage.xml create mode 100644 grin/docs/_build/doxygen/xml/label_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/partition_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/predefine_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/primarykey_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/property_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/propertylist_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/propertytable_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/structure_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/type_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/vertexlist_8h.xml create mode 100644 grin/docs/_build/doxygen/xml/xml.xsd create mode 100644 grin/include/index/label.h delete mode 100644 grin/include/property/label.h create mode 100644 grin/include/property/propertytable.h create mode 100644 grin/include/property/type.h diff --git a/grin/docs/Doxyfile b/grin/docs/Doxyfile new file mode 100644 index 000000000..ae4615685 --- /dev/null +++ b/grin/docs/Doxyfile @@ -0,0 +1,2694 @@ +# Doxyfile 1.9.6 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = GRIN + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Graph Retrieval Interface" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = _build/doxygen + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = ../ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:^^" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# Possible values are: NO, YES and FAIL_ON_WARNINGS. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = README.md ../include + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, +# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C +# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.h + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# ANamespace::AClass, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = README.md + +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use gray-scales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2 + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /
+ + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+ + + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + + +
+
adjacentlist.h
+
+
+
1
+
16#ifndef GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_
+
17#define GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_
+
18
+
19#include "../predefine.h"
+
20
+
21#ifdef ENABLE_ADJACENT_LIST
+
22AdjacentList get_adjacent_list(const Graph, const Direction, Vertex);
+
23
+
24#ifdef WITH_EDGE_PROPERTY
+
25AdjacentList get_adjacent_list_by_edge_type(const Graph, const Direction, Vertex, EdgeType);
+
26#endif
+
27
+
28void destroy_adjacent_list(AdjacentList);
+
29
+
30size_t get_adjacent_list_size(const AdjacentList);
+
31
+
32Vertex get_neighbor_from_adjacent_list(const AdjacentList, size_t);
+
33
+
34Edge get_edge_from_adjacent_list(const AdjacentList, size_t);
+
35
+
36#ifdef ENABLE_ADJACENT_LIST_ITERATOR
+
37AdjacentListIterator get_adjacent_list_begin(const Graph);
+
38
+
39bool get_next_adjacent_list_iter(AdjacentListIterator);
+
40
+
41Vertex get_neighbor_from_iter(AdjacentListIterator);
+
42
+
43Edge get_edge_from_iter(AdjacentListIterator);
+
44#endif
+
45
+
46#endif
+
47
+
48#endif // GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_
+
Direction
Enumerates the directions of edges with respect to a certain vertex.
Definition: predefine.h:33
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/bc_s.png b/grin/docs/_build/doxygen/html/bc_s.png new file mode 100644 index 0000000000000000000000000000000000000000..224b29aa9847d5a4b3902efd602b7ddf7d33e6c2 GIT binary patch literal 676 zcmV;V0$crwP)y__>=_9%My z{n931IS})GlGUF8K#6VIbs%684A^L3@%PlP2>_sk`UWPq@f;rU*V%rPy_ekbhXT&s z(GN{DxFv}*vZp`F>S!r||M`I*nOwwKX+BC~3P5N3-)Y{65c;ywYiAh-1*hZcToLHK ztpl1xomJ+Yb}K(cfbJr2=GNOnT!UFA7Vy~fBz8?J>XHsbZoDad^8PxfSa0GDgENZS zuLCEqzb*xWX2CG*b&5IiO#NzrW*;`VC9455M`o1NBh+(k8~`XCEEoC1Ybwf;vr4K3 zg|EB<07?SOqHp9DhLpS&bzgo70I+ghB_#)K7H%AMU3v}xuyQq9&Bm~++VYhF09a+U zl7>n7Jjm$K#b*FONz~fj;I->Bf;ule1prFN9FovcDGBkpg>)O*-}eLnC{6oZHZ$o% zXKW$;0_{8hxHQ>l;_*HATI(`7t#^{$(zLe}h*mqwOc*nRY9=?Sx4OOeVIfI|0V(V2 zBrW#G7Ss9wvzr@>H*`r>zE z+e8bOBgqIgldUJlG(YUDviMB`9+DH8n-s9SXRLyJHO1!=wY^79WYZMTa(wiZ!zP66 zA~!21vmF3H2{ngD;+`6j#~6j;$*f*G_2ZD1E;9(yaw7d-QnSCpK(cR1zU3qU0000< KMNUMnLSTYoA~SLT literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/bc_sd.png b/grin/docs/_build/doxygen/html/bc_sd.png new file mode 100644 index 0000000000000000000000000000000000000000..31ca888dc71049713b35c351933a8d0f36180bf1 GIT binary patch literal 635 zcmV->0)+jEP)Jwi0r1~gdSq#w{Bu1q z`craw(p2!hu$4C_$Oc3X(sI6e=9QSTwPt{G) z=htT&^~&c~L2~e{r5_5SYe7#Is-$ln>~Kd%$F#tC65?{LvQ}8O`A~RBB0N~`2M+waajO;5>3B&-viHGJeEK2TQOiPRa zfDKyqwMc4wfaEh4jt>H`nW_Zidwk@Bowp`}(VUaj-pSI(-1L>FJVsX}Yl9~JsqgsZ zUD9(rMwf23Gez6KPa|wwInZodP-2}9@fK0Ga_9{8SOjU&4l`pH4@qlQp83>>HT$xW zER^U>)MyV%t(Lu=`d=Y?{k1@}&r7ZGkFQ%z%N+sE9BtYjovzxyxCPxN6&@wLK{soQ zSmkj$aLI}miuE^p@~4}mg9OjDfGEkgY4~^XzLRUBB*O{+&vq<3v(E%+k_i%=`~j%{ Vj14gnt9}3g002ovPDHLkV1n!oC4m3{ literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/bdwn.png b/grin/docs/_build/doxygen/html/bdwn.png new file mode 100644 index 0000000000000000000000000000000000000000..940a0b950443a0bb1b216ac03c45b8a16c955452 GIT binary patch literal 147 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)H!3HEvS)PKZC{Gv1kP61Pb5HX&C2wk~_T1|%O$WD@{V-kvUwAr*{o@8{^CZMh(5KoB^r_<4^zF@3)Cp&&t3hdujKf f*?bjBoY!V+E))@{xMcbjXe@)LtDnm{r-UW|*e5JT literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/dir_49e56c817e5e54854c35e136979f97ca.html b/grin/docs/_build/doxygen/html/dir_49e56c817e5e54854c35e136979f97ca.html new file mode 100644 index 000000000..5a3fcab31 --- /dev/null +++ b/grin/docs/_build/doxygen/html/dir_49e56c817e5e54854c35e136979f97ca.html @@ -0,0 +1,86 @@ + + + + + + + +GRIN: docs Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
docs Directory Reference
+
+
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/dir_85395b416142281e9b8cbaa2a4bb7bc5.html b/grin/docs/_build/doxygen/html/dir_85395b416142281e9b8cbaa2a4bb7bc5.html new file mode 100644 index 000000000..8316ff6aa --- /dev/null +++ b/grin/docs/_build/doxygen/html/dir_85395b416142281e9b8cbaa2a4bb7bc5.html @@ -0,0 +1,92 @@ + + + + + + + +GRIN: include/partition Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
partition Directory Reference
+
+
+ + + + +

+Files

file  partition.h [code]
 
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/dir_d44c64559bbebec7f509842c48db8b23.html b/grin/docs/_build/doxygen/html/dir_d44c64559bbebec7f509842c48db8b23.html new file mode 100644 index 000000000..afa7e9b80 --- /dev/null +++ b/grin/docs/_build/doxygen/html/dir_d44c64559bbebec7f509842c48db8b23.html @@ -0,0 +1,102 @@ + + + + + + + +GRIN: include Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
include Directory Reference
+
+
+ + + + + + + + +

+Directories

directory  partition
 
directory  property
 
directory  topology
 
+ + + + +

+Files

file  predefine.h [code]
 Pre-defined macros for storage features. Undefine the macros of features that the storage does NOT support, so that APIs under unsupported features will NOT be available to the callers to avoid ambiguity.
 
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/dir_f450b25d4e0d87eea6a09d028ca7ee7d.html b/grin/docs/_build/doxygen/html/dir_f450b25d4e0d87eea6a09d028ca7ee7d.html new file mode 100644 index 000000000..51449b856 --- /dev/null +++ b/grin/docs/_build/doxygen/html/dir_f450b25d4e0d87eea6a09d028ca7ee7d.html @@ -0,0 +1,98 @@ + + + + + + + +GRIN: include/topology Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
topology Directory Reference
+
+
+ + + + + + + + + + +

+Files

file  adjacentlist.h [code]
 
file  edgelist.h [code]
 
file  structure.h [code]
 
file  vertexlist.h [code]
 
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/dir_ffb75fe14fe29e45cb01a712fdfb6c45.html b/grin/docs/_build/doxygen/html/dir_ffb75fe14fe29e45cb01a712fdfb6c45.html new file mode 100644 index 000000000..99ce3960c --- /dev/null +++ b/grin/docs/_build/doxygen/html/dir_ffb75fe14fe29e45cb01a712fdfb6c45.html @@ -0,0 +1,108 @@ + + + + + + + +GRIN: include/property Directory Reference + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
property Directory Reference
+
+
+ + + + + + + + + + + + + + + + + + + + +

+Files

file  label.h [code]
 Define the label related APIs.
 
file  primarykey.h [code]
 Define the primary key related APIs.
 
file  property.h [code]
 Define the property related APIs.
 
file  propertylist.h [code]
 Define the property list related and graph projection APIs.
 
file  propertytable.h [code]
 Define the property table related APIs.
 
file  type.h [code]
 Define the vertex/edge type related APIs.
 
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/doc.png b/grin/docs/_build/doxygen/html/doc.png new file mode 100644 index 0000000000000000000000000000000000000000..17edabff95f7b8da13c9516a04efe05493c29501 GIT binary patch literal 746 zcmV7=@pnbNXRFEm&G8P!&WHG=d)>K?YZ1bzou)2{$)) zumDct!>4SyxL;zgaG>wy`^Hv*+}0kUfCrz~BCOViSb$_*&;{TGGn2^x9K*!Sf0=lV zpP=7O;GA0*Jm*tTYj$IoXvimpnV4S1Z5f$p*f$Db2iq2zrVGQUz~yq`ahn7ck(|CE z7Gz;%OP~J6)tEZWDzjhL9h2hdfoU2)Nd%T<5Kt;Y0XLt&<@6pQx!nw*5`@bq#?l*?3z{Hlzoc=Pr>oB5(9i6~_&-}A(4{Q$>c>%rV&E|a(r&;?i5cQB=} zYSDU5nXG)NS4HEs0it2AHe2>shCyr7`6@4*6{r@8fXRbTA?=IFVWAQJL&H5H{)DpM#{W(GL+Idzf^)uRV@oB8u$ z8v{MfJbTiiRg4bza<41NAzrl{=3fl_D+$t+^!xlQ8S}{UtY`e z;;&9UhyZqQRN%2pot{*Ei0*4~hSF_3AH2@fKU!$NSflS>{@tZpDT4`M2WRTTVH+D? z)GFlEGGHe?koB}i|1w45!BF}N_q&^HJ&-tyR{(afC6H7|aml|tBBbv}55C5DNP8p3 z)~jLEO4Z&2hZmP^i-e%(@d!(E|KRafiU8Q5u(wU((j8un3OR*Hvj+t literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/docd.png b/grin/docs/_build/doxygen/html/docd.png new file mode 100644 index 0000000000000000000000000000000000000000..d7c94fda9bf08ecc02c7190d968452b7a2dbf04b GIT binary patch literal 756 zcmV1wr-rhpn+wxm%q2)IkAYsr{iGq<}_z5JCD4J;FN?6Qh;@TCubdp(_XdD-^ zG_#)IP7_z6hKNdx5^+FGArwLWTWCG!j+oKji?U!hxA#d-ljgkN`+e^@-P+RWG{Bx= z2iQyYTtEf*o~ySWrIVW}HWHi0_hd4~$E6Jx1U`>Owo}EYJ1O>iZvS?!z8}B}QwLMA zC3Keqf1c}K@?C`X>68b(EUzYUYAS&OH^VPteZLPr{S&|nQvp@6W4GH-1U8!u&7l~A zx~RUSNH+>7@q38W6!BzirtjLFCzc|XGx)EF#G%^pWION*k@?vP<2O>|XkCD3ujl%1 z{55JSVkw{~HbX>iEZ2%yJ2eHj5Yh8OTpzs0A2;tZ^x!#5D+y-es{k1&0|Ns9-|+Xt ziGiTsZ8(^nUo#wdTpIDkb-Zp(3|A*FzW}GZ5SQD-r^R`&X@`26E3W|GyrwDIZjtQ& z$g5f8Sv=VgVtDien@J(!^BK+#l;s-LgP--p7C;7;E!ysXcXK6?+9D>_-B(?Wm(U zQbNm-5TyYxIU=rs0+)!ixqzhuxw(AqKc3?KKX32{D~Qibp*r0x&Wux5-9WCMMRi3U zTd6dOCQlj>a;gr;gLwRKulT&(m@^L{&HkSC(qH05HSSf$YEhynGvH zWNez``Z8FJXE+BSg=%ak{OR z+Nylcb{?evLYLuE1_HngYw0g%LC#=$a@?4~Tx>F9295Q>9UJ|_6v-KMw;!YZSgGj@ zR8fRov=hJ#QvsO@xw*{0%zH@OKVEUrsummary { + list-style-type: none; +} + +details > summary::-webkit-details-marker { + display: none; +} + +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; +} + +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; +} + +body { + scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-background-color); +} + +::-webkit-scrollbar { + background-color: var(--scrollbar-background-color); + height: 12px; + width: 12px; +} +::-webkit-scrollbar-thumb { + border-radius: 6px; + box-shadow: inset 0 0 12px 12px var(--scrollbar-thumb-color); + border: solid 2px transparent; +} +::-webkit-scrollbar-corner { + background-color: var(--scrollbar-background-color); +} + diff --git a/grin/docs/_build/doxygen/html/doxygen.svg b/grin/docs/_build/doxygen/html/doxygen.svg new file mode 100644 index 000000000..d42dad52d --- /dev/null +++ b/grin/docs/_build/doxygen/html/doxygen.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grin/docs/_build/doxygen/html/dynsections.js b/grin/docs/_build/doxygen/html/dynsections.js new file mode 100644 index 000000000..1f4cd14a6 --- /dev/null +++ b/grin/docs/_build/doxygen/html/dynsections.js @@ -0,0 +1,130 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); + $('table.directory tr'). + removeClass('odd').filter(':visible:odd').addClass('odd'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + + + + + + +GRIN: include/topology/edgelist.h Source File + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
edgelist.h
+
+
+
1
+
16#ifndef GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_
+
17#define GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_
+
18
+
19#include "../predefine.h"
+
20
+
21#ifdef ENABLE_EDGE_LIST
+
22
+
23EdgeList get_edge_list(const Graph, const Direction);
+
24
+
25#ifdef WITH_EDGE_PROPERTY
+
26EdgeList get_edge_list_by_type(const Graph, const EdgeType);
+
27#endif
+
28
+
29void destroy_edge_list(EdgeList);
+
30
+
31EdgeList create_edge_list();
+
32
+
33bool insert_edge_to_list(EdgeList, const Edge);
+
34
+
35size_t get_edge_list_size(const EdgeList);
+
36
+
37Edge get_edge_from_list(const EdgeList, size_t);
+
38
+
39#ifdef ENABLE_EDGE_LIST_ITERATOR
+
40EdgeListIterator get_edge_list_begin(const Graph);
+
41
+
42#ifdef WITH_EDGE_PROPERTY
+
43EdgeListIterator get_edge_list_begin_by_type(const Graph, const EdgeType);
+
44#endif
+
45
+
46bool get_next_edge_list_iter(EdgeListIterator);
+
47
+
48Edge get_edge_from_iter(EdgeListIterator);
+
49#endif
+
50
+
51#endif
+
52
+
53#endif // GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_
+
Direction
Enumerates the directions of edges with respect to a certain vertex.
Definition: predefine.h:33
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/files.html b/grin/docs/_build/doxygen/html/files.html new file mode 100644 index 000000000..c17a4a7ad --- /dev/null +++ b/grin/docs/_build/doxygen/html/files.html @@ -0,0 +1,102 @@ + + + + + + + +GRIN: File List + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
File List
+
+
+
Here is a list of all documented files with brief descriptions:
+
[detail level 123]
+ + + + + + + + + + + + + + + + +
  include
  partition
 partition.h
  property
 label.hDefine the label related APIs
 primarykey.hDefine the primary key related APIs
 property.hDefine the property related APIs
 propertylist.hDefine the property list related and graph projection APIs
 propertytable.hDefine the property table related APIs
 type.hDefine the vertex/edge type related APIs
  topology
 adjacentlist.h
 edgelist.h
 structure.h
 vertexlist.h
 predefine.hPre-defined macros for storage features. Undefine the macros of features that the storage does NOT support, so that APIs under unsupported features will NOT be available to the callers to avoid ambiguity
+
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/folderclosed.png b/grin/docs/_build/doxygen/html/folderclosed.png new file mode 100644 index 0000000000000000000000000000000000000000..bb8ab35edce8e97554e360005ee9fc5bffb36e66 GIT binary patch literal 616 zcmV-u0+;=XP)a9#ETzayK)T~Jw&MMH>OIr#&;dC}is*2Mqdf&akCc=O@`qC+4i z5Iu3w#1M@KqXCz8TIZd1wli&kkl2HVcAiZ8PUn5z_kG@-y;?yK06=cA0U%H0PH+kU zl6dp}OR(|r8-RG+YLu`zbI}5TlOU6ToR41{9=uz^?dGTNL;wIMf|V3`d1Wj3y!#6` zBLZ?xpKR~^2x}?~zA(_NUu3IaDB$tKma*XUdOZN~c=dLt_h_k!dbxm_*ibDM zlFX`g{k$X}yIe%$N)cn1LNu=q9_CS)*>A zsX_mM4L@`(cSNQKMFc$RtYbx{79#j-J7hk*>*+ZZhM4Hw?I?rsXCi#mRWJ=-0LGV5a-WR0Qgt<|Nqf)C-@80`5gIz45^_20000IqP)X=#(TiCT&PiIIVc55T}TU}EUh*{q$|`3@{d>{Tc9Bo>e= zfmF3!f>fbI9#GoEHh0f`i5)wkLpva0ztf%HpZneK?w-7AK@b4Itw{y|Zd3k!fH?q2 zlhckHd_V2M_X7+)U&_Xcfvtw60l;--DgZmLSw-Y?S>)zIqMyJ1#FwLU*%bl38ok+! zh78H87n`ZTS;uhzAR$M`zZ`bVhq=+%u9^$5jDplgxd44}9;IRqUH1YHH|@6oFe%z( zo4)_>E$F&^P-f(#)>(TrnbE>Pefs9~@iN=|)Rz|V`sGfHNrJ)0gJb8xx+SBmRf@1l zvuzt=vGfI)<-F9!o&3l?>9~0QbUDT(wFdnQPv%xdD)m*g%!20>Bc9iYmGAp<9YAa( z0QgYgTWqf1qN++Gqp z8@AYPTB3E|6s=WLG?xw0tm|U!o=&zd+H0oRYE;Dbx+Na9s^STqX|Gnq%H8s(nGDGJ j8vwW|`Ts`)fSK|Kx=IK@RG@g200000NkvXXu0mjfauFEA literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/globals.html b/grin/docs/_build/doxygen/html/globals.html new file mode 100644 index 000000000..6b4661eaa --- /dev/null +++ b/grin/docs/_build/doxygen/html/globals.html @@ -0,0 +1,206 @@ + + + + + + + +GRIN: File Members + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all documented file members with links to the documentation:
+ +

- a -

    +
  • assign_label_to_vertex() : label.h
  • +
+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- i -

+ + +

- n -

+ + +

- o -

+ + +

- s -

+ + +

- u -

+ + +

- w -

+
+ + + + diff --git a/grin/docs/_build/doxygen/html/globals_defs.html b/grin/docs/_build/doxygen/html/globals_defs.html new file mode 100644 index 000000000..bf849a083 --- /dev/null +++ b/grin/docs/_build/doxygen/html/globals_defs.html @@ -0,0 +1,129 @@ + + + + + + + +GRIN: File Members + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+  + +

- c -

+ + +

- e -

+ + +

- n -

+ + +

- w -

+
+ + + + diff --git a/grin/docs/_build/doxygen/html/globals_enum.html b/grin/docs/_build/doxygen/html/globals_enum.html new file mode 100644 index 000000000..47d12f124 --- /dev/null +++ b/grin/docs/_build/doxygen/html/globals_enum.html @@ -0,0 +1,83 @@ + + + + + + + +GRIN: File Members + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/globals_eval.html b/grin/docs/_build/doxygen/html/globals_eval.html new file mode 100644 index 000000000..ae47e000b --- /dev/null +++ b/grin/docs/_build/doxygen/html/globals_eval.html @@ -0,0 +1,94 @@ + + + + + + + +GRIN: File Members + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/globals_func.html b/grin/docs/_build/doxygen/html/globals_func.html new file mode 100644 index 000000000..058855f3a --- /dev/null +++ b/grin/docs/_build/doxygen/html/globals_func.html @@ -0,0 +1,107 @@ + + + + + + + +GRIN: File Members + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/globals_type.html b/grin/docs/_build/doxygen/html/globals_type.html new file mode 100644 index 000000000..b69e04cc0 --- /dev/null +++ b/grin/docs/_build/doxygen/html/globals_type.html @@ -0,0 +1,82 @@ + + + + + + + +GRIN: File Members + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/group__nv.html b/grin/docs/_build/doxygen/html/group__nv.html new file mode 100644 index 000000000..fb26860c9 --- /dev/null +++ b/grin/docs/_build/doxygen/html/group__nv.html @@ -0,0 +1,364 @@ + + + + + + + +GRIN: Null Values + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Null Values
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Macros

#define NULL_TYPE   Undefined
 Null type (undefined data type)
 
#define NULL_GRAPH   NULL
 Null graph (invalid return value)
 
#define NULL_VERTEX   NULL
 Non-existing vertex (invalid return value)
 
#define NULL_EDGE   NULL
 Non-existing edge (invalid return value)
 
#define NULL_LIST   NULL
 Null list of any kind (invalid return value)
 
#define NULL_PARTITION   NULL
 Non-existing partition (invalid return value)
 
#define NULL_VERTEX_REF   NULL
 Null vertex reference (invalid return value)
 
#define NULL_EDGE_REF   NULL
 Null edge reference (invalid return value)
 
#define NULL_VERTEX_TYPE   NULL
 Non-existing vertex type (invalid return value)
 
#define NULL_EDGE_TYPE   NULL
 Non-existing edge type (invalid return value)
 
#define NULL_PROPERTY   NULL
 Non-existing property (invalid return value)
 
#define NULL_ROW   NULL
 Null row (invalid return value)
 
#define NULL_NATURAL_ID   UINT_MAX
 Null natural id of any kind (invalid return value)
 
+

Detailed Description

+

Macros for Null(invalid) values

+

Macro Definition Documentation

+ +

◆ NULL_EDGE

+ +
+
+ + + + +
#define NULL_EDGE   NULL
+
+ +

Non-existing edge (invalid return value)

+ +

Definition at line 262 of file predefine.h.

+ +
+
+ +

◆ NULL_EDGE_REF

+ +
+
+ + + + +
#define NULL_EDGE_REF   NULL
+
+ +

Null edge reference (invalid return value)

+ +

Definition at line 270 of file predefine.h.

+ +
+
+ +

◆ NULL_EDGE_TYPE

+ +
+
+ + + + +
#define NULL_EDGE_TYPE   NULL
+
+ +

Non-existing edge type (invalid return value)

+ +

Definition at line 274 of file predefine.h.

+ +
+
+ +

◆ NULL_GRAPH

+ +
+
+ + + + +
#define NULL_GRAPH   NULL
+
+ +

Null graph (invalid return value)

+ +

Definition at line 258 of file predefine.h.

+ +
+
+ +

◆ NULL_LIST

+ +
+
+ + + + +
#define NULL_LIST   NULL
+
+ +

Null list of any kind (invalid return value)

+ +

Definition at line 264 of file predefine.h.

+ +
+
+ +

◆ NULL_NATURAL_ID

+ +
+
+ + + + +
#define NULL_NATURAL_ID   UINT_MAX
+
+ +

Null natural id of any kind (invalid return value)

+ +

Definition at line 280 of file predefine.h.

+ +
+
+ +

◆ NULL_PARTITION

+ +
+
+ + + + +
#define NULL_PARTITION   NULL
+
+ +

Non-existing partition (invalid return value)

+ +

Definition at line 266 of file predefine.h.

+ +
+
+ +

◆ NULL_PROPERTY

+ +
+
+ + + + +
#define NULL_PROPERTY   NULL
+
+ +

Non-existing property (invalid return value)

+ +

Definition at line 276 of file predefine.h.

+ +
+
+ +

◆ NULL_ROW

+ +
+
+ + + + +
#define NULL_ROW   NULL
+
+ +

Null row (invalid return value)

+ +

Definition at line 278 of file predefine.h.

+ +
+
+ +

◆ NULL_TYPE

+ +
+
+ + + + +
#define NULL_TYPE   Undefined
+
+ +

Null type (undefined data type)

+ +

Definition at line 256 of file predefine.h.

+ +
+
+ +

◆ NULL_VERTEX

+ +
+
+ + + + +
#define NULL_VERTEX   NULL
+
+ +

Non-existing vertex (invalid return value)

+ +

Definition at line 260 of file predefine.h.

+ +
+
+ +

◆ NULL_VERTEX_REF

+ +
+
+ + + + +
#define NULL_VERTEX_REF   NULL
+
+ +

Null vertex reference (invalid return value)

+ +

Definition at line 268 of file predefine.h.

+ +
+
+ +

◆ NULL_VERTEX_TYPE

+ +
+
+ + + + +
#define NULL_VERTEX_TYPE   NULL
+
+ +

Non-existing vertex type (invalid return value)

+ +

Definition at line 272 of file predefine.h.

+ +
+
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/index.html b/grin/docs/_build/doxygen/html/index.html new file mode 100644 index 000000000..37da82485 --- /dev/null +++ b/grin/docs/_build/doxygen/html/index.html @@ -0,0 +1,134 @@ + + + + + + + +GRIN: GRIN + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
GRIN
+
+
+

+

+Assumptions

+

+Property Graph

+
    +
  • Vertices have types, so as Edges.
  • +
  • The relationship between edge type and pairs of vertex types is many-to-many.
  • +
  • Properties are bound to vertex and edge types, but some may have the same name.
  • +
  • Labels can be assigned to vertices and edges (NOT their types) primarily for query filtering, and labels have no properties.
  • +
+

+Design Principles

+

+Handler

+
    +
  • GRIN provides a series of handlers for graph concepts, such as vertex, edge and graph itself.
  • +
  • Since almost everything in GRIN are handlers except of only a few string names, the type for a graph concept and its handler is always mixed-used in GRIN.
  • +
  • For example, we use the type Vertex to represent the type of a vertex handler, instead of using VertexHandler for clean code.
  • +
+

+List

+
    +
  • A list handler, no matter what kind of list it represents, is available to the user only if the storage can provide the size of the list, and an element retrieval API by position (i.e., index of array).
  • +
  • For the instance of Vertex, when some GRIN API returns a VertexList(handler), the user can get the size of the VertexList by calling get_vertex_list_size to get the size, and get_vertex_from_list to get a vertex by providing an index value ranges from 0 to size-1.
  • +
+

+List Iterator

+
    +
  • A list iterator handler, no matter what kind of list it represents, is available to the user if the list size is unknown or for sequential scan efficiency.
  • +
  • Take Vertex as example again, users can get the iterator at the beginning using APIs like get_vertex_list_begin, and keeps on using get_next_vertex_list_iter to update the iterator till the end of the list when a false is returned. APIs like get_vertex_from_iter will return the Vertex from the vertex iterator.
  • +
+

+Property

+
    +
  • Properties are bound to vertex and edge types. It means even some properties may have the same name, as long as they are bound to different vertex or edge types, GRIN will provide distinct handlers for these properties. This is because, although properties with the same name usually provide the same semantic in the graph, they may have different data types in the underlying storage for efficiency concerns (e.g., short date and long date).
  • +
  • To avoid the incompatibility with storage engines, we made the design choice to bind properties under vertex and edge types. Meanwhile, GRIN provides an API to get all the property handlers with the (same) given property name.
  • +
+

+Reference

+
    +
  • GRIN introduces the reference concept in partitioned graph. It stands for the reference of an instance that can be recognized in partitions other than the current partition where the instance is accessed.
  • +
  • For example, a VertexRef is a reference of a Vertex that can be recognized in other partitions.
  • +
+

+Traits

+

+Natural ID Trait

+
    +
  • Concepts represent the schema of the graph, such as vertex type and properties bound to a certain edge type, are usually numbered naturally from 0 to its num - 1 in many storage engines. To facilitate further optimizations in the upper computing engines, GRIN provides the natural number ID trait. A storage can provide such a trait if it also uses the natural numbering for graph schema concepts.
  • +
+
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/jquery.js b/grin/docs/_build/doxygen/html/jquery.js new file mode 100644 index 000000000..1dffb65b5 --- /dev/null +++ b/grin/docs/_build/doxygen/html/jquery.js @@ -0,0 +1,34 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=y(e||this.defaultElement||this)[0],this.element=y(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=y(),this.hoverable=y(),this.focusable=y(),this.classesElementLookup={},e!==this&&(y.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=y(e.style?e.ownerDocument:e.document||e),this.window=y(this.document[0].defaultView||this.document[0].parentWindow)),this.options=y.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:y.noop,_create:y.noop,_init:y.noop,destroy:function(){var i=this;this._destroy(),y.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:y.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return y.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=y.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e,function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=f[g]?0:Math.min(f[g],n));!a&&1-1){targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if(session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)}closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if(session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE,function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList,finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight()));return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")}function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(),elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight,viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file diff --git a/grin/docs/_build/doxygen/html/label_8h.html b/grin/docs/_build/doxygen/html/label_8h.html new file mode 100644 index 000000000..45d377c69 --- /dev/null +++ b/grin/docs/_build/doxygen/html/label_8h.html @@ -0,0 +1,290 @@ + + + + + + + +GRIN: include/property/label.h File Reference + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+ +
label.h File Reference
+
+
+ +

Define the label related APIs. +More...

+
#include "../predefine.h"
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

+Label get_label_by_name (const Graph, const char *)
 
+char * get_label_name (const Graph, const Label)
 
+void destroy_label (Label)
 
+void destroy_label_list (LabelList)
 
+size_t get_label_list_size (const LabelList)
 
+Label get_label_from_list (const LabelList, const size_t)
 
bool assign_label_to_vertex (const Graph, const Label, Vertex)
 assign a label to a vertex
 
LabelList get_vertex_label_list (const Graph, const Vertex)
 get the label list of a vertex
 
VertexList get_vertex_list_by_label (const Graph, const Label)
 get the vertex list by label
 
VertexList filter_vertex_list_by_label (const VertexList, const Label)
 filtering an existing vertex list by label
 
+

Detailed Description

+

Define the label related APIs.

+

Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

+ +

Definition in file label.h.

+

Function Documentation

+ +

◆ assign_label_to_vertex()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
bool assign_label_to_vertex (const Graph,
const Label,
Vertex  
)
+
+ +

assign a label to a vertex

+
Parameters
+ + + + +
Graphthe graph
Labelthe label
Vertexthe vertex
+
+
+
Returns
whether succeed
+ +
+
+ +

◆ filter_vertex_list_by_label()

+ +
+
+ + + + + + + + + + + + + + + + + + +
VertexList filter_vertex_list_by_label (const VertexList,
const Label 
)
+
+ +

filtering an existing vertex list by label

+
Parameters
+ + + +
VertexListthe existing vertex list
Labelthe label
+
+
+ +
+
+ +

◆ get_vertex_label_list()

+ +
+
+ + + + + + + + + + + + + + + + + + +
LabelList get_vertex_label_list (const Graph,
const Vertex 
)
+
+ +

get the label list of a vertex

+
Parameters
+ + + +
Graphthe graph
Vertexthe vertex
+
+
+ +
+
+ +

◆ get_vertex_list_by_label()

+ +
+
+ + + + + + + + + + + + + + + + + + +
VertexList get_vertex_list_by_label (const Graph,
const Label 
)
+
+ +

get the vertex list by label

+
Parameters
+ + + +
Graphthe graph
Labelthe label
+
+
+ +
+
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/label_8h_source.html b/grin/docs/_build/doxygen/html/label_8h_source.html new file mode 100644 index 000000000..893fed726 --- /dev/null +++ b/grin/docs/_build/doxygen/html/label_8h_source.html @@ -0,0 +1,119 @@ + + + + + + + +GRIN: include/property/label.h Source File + + + + + + + + + +
+
+ + + + + + +
+
GRIN +
+
Graph Retrieval Interface
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+
+
label.h
+
+
+Go to the documentation of this file.
1
+
18#ifndef GRIN_INCLUDE_PROPERTY_LABEL_H_
+
19#define GRIN_INCLUDE_PROPERTY_LABEL_H_
+
20
+
21#include "../predefine.h"
+
22
+
23#ifdef WITH_LABEL
+
24Label get_label_by_name(const Graph, const char*);
+
25
+
26char* get_label_name(const Graph, const Label);
+
27
+
28void destroy_label(Label);
+
29
+
30void destroy_label_list(LabelList);
+
31
+
32size_t get_label_list_size(const LabelList);
+
33
+
34Label get_label_from_list(const LabelList, const size_t);
+
35
+
43bool assign_label_to_vertex(const Graph, const Label, Vertex);
+
44
+
50LabelList get_vertex_label_list(const Graph, const Vertex);
+
51
+
57VertexList get_vertex_list_by_label(const Graph, const Label);
+
58
+
64VertexList filter_vertex_list_by_label(const VertexList, const Label);
+
65#endif
+
66
+
67#endif // GRIN_INCLUDE_PROPERTY_LABEL_H_
+
LabelList get_vertex_label_list(const Graph, const Vertex)
get the label list of a vertex
+
VertexList get_vertex_list_by_label(const Graph, const Label)
get the vertex list by label
+
VertexList filter_vertex_list_by_label(const VertexList, const Label)
filtering an existing vertex list by label
+
bool assign_label_to_vertex(const Graph, const Label, Vertex)
assign a label to a vertex
+
+ + + + diff --git a/grin/docs/_build/doxygen/html/menu.js b/grin/docs/_build/doxygen/html/menu.js new file mode 100644 index 000000000..b0b26936a --- /dev/null +++ b/grin/docs/_build/doxygen/html/menu.js @@ -0,0 +1,136 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { + function makeTree(data,relPath) { + var result=''; + if ('children' in data) { + result+='
    '; + for (var i in data.children) { + var url; + var link; + link = data.children[i].url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + } else { + url = relPath+link; + } + result+='
  • '+ + data.children[i].text+''+ + makeTree(data.children[i],relPath)+'
  • '; + } + result+='
'; + } + return result; + } + var searchBoxHtml; + if (searchEnabled) { + if (serverSide) { + searchBoxHtml='
'+ + '
'+ + '
 '+ + ''+ + '
'+ + '
'+ + '
'+ + '
'; + } else { + searchBoxHtml='
'+ + ''+ + ' '+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'; + } + } + + $('#main-nav').before('
'+ + ''+ + ''+ + '
'); + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchBoxHtml) { + $('#main-menu').append('
  • '); + } + var $mainMenuState = $('#main-menu-state'); + var prevWidth = 0; + if ($mainMenuState.length) { + function initResizableIfExists() { + if (typeof initResizable==='function') initResizable(); + } + // animate mobile menu + $mainMenuState.change(function(e) { + var $menu = $('#main-menu'); + var options = { duration: 250, step: initResizableIfExists }; + if (this.checked) { + options['complete'] = function() { $menu.css('display', 'block') }; + $menu.hide().slideDown(options); + } else { + options['complete'] = function() { $menu.css('display', 'none') }; + $menu.show().slideUp(options); + } + }); + // set default menu visibility + function resetState() { + var $menu = $('#main-menu'); + var $mainMenuState = $('#main-menu-state'); + var newWidth = $(window).outerWidth(); + if (newWidth!=prevWidth) { + if ($(window).outerWidth()<768) { + $mainMenuState.prop('checked',false); $menu.hide(); + $('#searchBoxPos1').html(searchBoxHtml); + $('#searchBoxPos2').hide(); + } else { + $menu.show(); + $('#searchBoxPos1').empty(); + $('#searchBoxPos2').html(searchBoxHtml); + $('#searchBoxPos2').show(); + } + if (typeof searchBox!=='undefined') { + searchBox.CloseResultsWindow(); + } + prevWidth = newWidth; + } + } + $(window).ready(function() { resetState(); initResizableIfExists(); }); + $(window).resize(resetState); + } + $('#main-menu').smartmenus(); +} +/* @license-end */ diff --git a/grin/docs/_build/doxygen/html/menudata.js b/grin/docs/_build/doxygen/html/menudata.js new file mode 100644 index 000000000..e9f59219a --- /dev/null +++ b/grin/docs/_build/doxygen/html/menudata.js @@ -0,0 +1,51 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file +*/ +var menudata={children:[ +{text:"Main Page",url:"index.html"}, +{text:"Files",url:"files.html",children:[ +{text:"File List",url:"files.html"}, +{text:"File Members",url:"globals.html",children:[ +{text:"All",url:"globals.html",children:[ +{text:"a",url:"globals.html#index_a"}, +{text:"b",url:"globals.html#index_b"}, +{text:"c",url:"globals.html#index_c"}, +{text:"d",url:"globals.html#index_d"}, +{text:"e",url:"globals.html#index_e"}, +{text:"f",url:"globals.html#index_f"}, +{text:"g",url:"globals.html#index_g"}, +{text:"i",url:"globals.html#index_i"}, +{text:"n",url:"globals.html#index_n"}, +{text:"o",url:"globals.html#index_o"}, +{text:"s",url:"globals.html#index_s"}, +{text:"u",url:"globals.html#index_u"}, +{text:"w",url:"globals.html#index_w"}]}, +{text:"Functions",url:"globals_func.html"}, +{text:"Enumerations",url:"globals_enum.html"}, +{text:"Enumerator",url:"globals_eval.html"}, +{text:"Macros",url:"globals_defs.html",children:[ +{text:"c",url:"globals_defs.html#index_c"}, +{text:"e",url:"globals_defs.html#index_e"}, +{text:"n",url:"globals_defs.html#index_n"}, +{text:"w",url:"globals_defs.html#index_w"}]}]}]}]} diff --git a/grin/docs/_build/doxygen/html/modules.html b/grin/docs/_build/doxygen/html/modules.html new file mode 100644 index 000000000..93942649e --- /dev/null +++ b/grin/docs/_build/doxygen/html/modules.html @@ -0,0 +1,87 @@ + + + + + + + +GRIN: Modules + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Modules
    +
    +
    +
    Here is a list of all modules:
    + + +
     Null Values
    +
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/nav_f.png b/grin/docs/_build/doxygen/html/nav_f.png new file mode 100644 index 0000000000000000000000000000000000000000..72a58a529ed3a9ed6aa0c51a79cf207e026deee2 GIT binary patch literal 153 zcmeAS@N?(olHy`uVBq!ia0vp^j6iI`!2~2XGqLUlQVE_ejv*C{Z|{2ZH7M}7UYxc) zn!W8uqtnIQ>_z8U literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/nav_fd.png b/grin/docs/_build/doxygen/html/nav_fd.png new file mode 100644 index 0000000000000000000000000000000000000000..032fbdd4c54f54fa9a2e6423b94ef4b2ebdfaceb GIT binary patch literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^j6iI`!2~2XGqLUlQU#tajv*C{Z|C~*H7f|XvG1G8 zt7aS*L7xwMeS}!z6R#{C5tIw-s~AJ==F^i}x3XyJseHR@yF& zerFf(Zf;Dd{+(0lDIROL@Sj-Ju2JQ8&-n%4%q?>|^bShc&lR?}7HeMo@BDl5N(aHY Uj$gdr1MOz;boFyt=akR{0D!zeaR2}S literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/nav_g.png b/grin/docs/_build/doxygen/html/nav_g.png new file mode 100644 index 0000000000000000000000000000000000000000..2093a237a94f6c83e19ec6e5fd42f7ddabdafa81 GIT binary patch literal 95 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrB!3HFm1ilyoDK$?Q$B+ufw|5PB85lU25BhtE tr?otc=hd~V+ws&_A@j8Fiv!KF$B+ufw|5=67#uj90@pIL wZ=Q8~_Ju`#59=RjDrmm`tMD@M=!-l18IR?&vFVdQ&MBb@0HFXL6W-eg#Jd_@e6*DPn)w;=|1H}Zvm9l6xXXB%>yL=NQU;mg M>FVdQ&MBb@0Bdt1Qvd(} literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/open.png b/grin/docs/_build/doxygen/html/open.png new file mode 100644 index 0000000000000000000000000000000000000000..30f75c7efe2dd0c9e956e35b69777a02751f048b GIT binary patch literal 123 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VPM$7~Ar*{o?;hlAFyLXmaDC0y znK1_#cQqJWPES%4Uujug^TE?jMft$}Eq^WaR~)%f)vSNs&gek&x%A9X9sM + + + + + + +GRIN: include/partition/partition.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    partition.h
    +
    +
    +
    1
    +
    16#ifndef GRIN_INCLUDE_PARTITION_PARTITION_H_
    +
    17#define GRIN_INCLUDE_PARTITION_PARTITION_H_
    +
    18
    +
    19#include "../predefine.h"
    +
    20
    +
    21**** add enable_vertex/edge_ref macros ****
    +
    22
    +
    23#ifdef ENABLE_GRAPH_PARTITION
    +
    24size_t get_total_partitions_number(const PartitionedGraph);
    +
    25
    +
    26PartitionList get_local_partition_list(const PartitionedGraph);
    +
    27
    +
    28void destroy_partition_list(PartitionList);
    +
    29
    +
    30PartitionList create_partition_list();
    +
    31
    +
    32bool insert_partition_to_list(PartitionList, const Partition);
    +
    33
    +
    34size_t get_partition_list_size(const PartitionList);
    +
    35
    +
    36Partition get_partition_from_list(const PartitionList, const size_t);
    +
    37
    +
    38#ifdef NATURAL_PARTITION_ID_TRAIT
    +
    39Partition get_partition_from_id(const PartitionID);
    +
    40
    +
    41PartitionID get_partition_id(const Partition);
    +
    42#endif
    +
    43
    +
    44void* get_partition_info(const PartitionedGraph, const Partition);
    +
    45
    +
    46Graph get_local_graph_from_partition(const PartitionedGraph, const Partition);
    +
    47
    +
    48
    +
    49// master & mirror vertices for vertexcut partition
    +
    50// while they refer to inner & outer vertices in edgecut partition
    +
    51#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST)
    +
    52VertexList get_master_vertices(const Graph);
    +
    53
    +
    54VertexList get_mirror_vertices(const Graph);
    +
    55
    +
    56VertexList get_mirror_vertices_by_partition(const Graph, const Partition);
    +
    57
    +
    58#ifdef WITH_VERTEX_PROPERTY
    +
    59VertexList get_master_vertices_by_type(const Graph, const VertexType);
    +
    60
    +
    61VertexList get_mirror_vertices_by_type(const Graph, const VertexType);
    +
    62
    +
    63VertexList get_mirror_vertices_by_type_partition(const Graph, const VertexType, const Partition);
    +
    64#endif
    +
    65#endif
    +
    66
    +
    67#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_ADJACENT_LIST)
    +
    68AdjacentList get_adjacent_master_list(const Graph, const Direction, const Vertex);
    +
    69
    +
    70AdjacentList get_adjacent_mirror_list(const Graph, const Direction, const Vertex);
    +
    71
    +
    72AdjacentList get_adjacent_mirror_list_by_partition(const Graph, const Direction,
    +
    73 const Partition, const Vertex);
    +
    74#endif
    +
    75
    +
    76
    +
    77// Vertex ref refers to the same vertex referred in other partitions,
    +
    78// while edge ref is likewise. Both can be serialized to char* for
    +
    79// message transporting and deserialized on the other end.
    +
    80VertexRef get_vertex_ref_for_vertex(const Graph, const Partition, const Vertex);
    +
    81
    +
    82Vertex get_vertex_from_vertex_ref(const Graph, const VertexRef);
    +
    83
    +
    84Partition get_master_partition_from_vertex_ref(const Graph, const VertexRef);
    +
    85
    +
    86char* serialize_vertex_ref(const Graph, const VertexRef);
    +
    87
    +
    88VertexRef deserialize_to_vertex_ref(const Graph, const char*);
    +
    89
    +
    90EdgeRef get_edge_ref_for_edge(const Graph, const Partition, const Edge);
    +
    91
    +
    92Edge get_edge_from_edge_ref(const Graph, const EdgeRef);
    +
    93
    +
    94Partition get_master_partition_from_edge_ref(const Graph, const EdgeRef);
    +
    95
    +
    96char* serialize_edge_ref(const Graph, const EdgeRef);
    +
    97
    +
    98EdgeRef deserialize_to_edge_ref(const Graph, const char*);
    +
    99
    +
    100// The concept of local_complete refers to whether we can get complete data or properties
    +
    101// locally in the partition. It is orthogonal to the concept of master/mirror which
    +
    102// is mainly designed for data aggregation. In some extremely cases, master vertices
    +
    103// may NOT contain all the data or properties locally.
    +
    104bool is_vertex_neighbor_local_complete(const Graph, const Vertex);
    +
    105
    +
    106PartitionList vertex_neighbor_complete_partitions(const Graph, const Vertex);
    +
    107
    +
    108#ifdef WITH_VERTEX_DATA
    +
    109bool is_vertex_data_local_complete(const Graph, const Vertex);
    +
    110
    +
    111PartitionList vertex_data_complete_partitions(const Graph, const Vertex);
    +
    112#endif
    +
    113
    +
    114#ifdef WITH_VERTEX_PROPERTY
    +
    115bool is_vertex_property_local_complete(const Graph, const Vertex);
    +
    116
    +
    117PartitionList vertex_property_complete_partitions(const Graph, const Vertex);
    +
    118#endif
    +
    119
    +
    120#ifdef WITH_EDGE_DATA
    +
    121bool is_edge_data_local_complete(const Graph, const Edge);
    +
    122
    +
    123PartitionList edge_data_complete_partitions(const Graph, const Edge);
    +
    124#endif
    +
    125
    +
    126#ifdef WITH_EDGE_PROPERTY
    +
    127bool is_edge_property_local_complete(const Graph, const Edge);
    +
    128
    +
    129PartitionList edge_data_complete_partitions(const Graph, const Edge);
    +
    130#endif
    +
    131
    +
    132#endif
    +
    133
    +
    134#endif // GRIN_INCLUDE_PARTITION_PARTITION_H_
    +
    Direction
    Enumerates the directions of edges with respect to a certain vertex.
    Definition: predefine.h:33
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/predefine_8h.html b/grin/docs/_build/doxygen/html/predefine_8h.html new file mode 100644 index 000000000..fef96f7c2 --- /dev/null +++ b/grin/docs/_build/doxygen/html/predefine_8h.html @@ -0,0 +1,1476 @@ + + + + + + + +GRIN: include/predefine.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    + +
    predefine.h File Reference
    +
    +
    + +

    Pre-defined macros for storage features. Undefine the macros of features that the storage does NOT support, so that APIs under unsupported features will NOT be available to the callers to avoid ambiguity. +More...

    +
    #include <limits.h>
    +#include <stdbool.h>
    +#include <stddef.h>
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Macros

    TopologyMacros

    Macros for basic graph topology features

    +
    #define WITH_VERTEX_ORIGINAL_ID
     There is original ID for a vertex. This facilitates queries starting from a specific vertex, since one can get the vertex handler directly using its original ID.
     
    #define WITH_VERTEX_DATA
     There is data on vertex. E.g., the PageRank value of a vertex.
     
    #define WITH_EDGE_DATA
     There is data on edge. E.g., the weight of an edge.
     
    #define ENABLE_VERTEX_LIST
     Enable the vertex list structure. The vertex list related APIs follow the design principle of GRIN List.
     
    #define ENABLE_VERTEX_LIST_ITERATOR
     Enable the vertex list iterator. The vertex list iterator related APIs follow the design principle of GRIN Iterator.
     
    #define ENABLE_EDGE_LIST
     Enable the edge list structure. The edge list related APIs follow the design principle of GRIN List.
     
    #define ENABLE_EDGE_LIST_ITERATOR
     Enable the edge list iterator. The edge list iterator related APIs follow the design principle of GRIN Iterator.
     
    #define ENABLE_ADJACENT_LIST
     Enable the adjacent list structure. The adjacent list related APIs follow the design principle of GRIN List.
     
    #define ENABLE_ADJACENT_LIST_ITERATOR
     Enable the adjacent list iterator. The adjacent list iterator related APIs follow the design principle of GRIN Iterator.
     
    PartitionMacros

    Macros for partitioned graph features

    +
    #define ENABLE_GRAPH_PARTITION
     Enable partitioned graph. A partitioned graph usually contains several fragments (i.e., local graphs) that are distributedly stored in a cluster. In GRIN, Graph represents to a single fragment that can be locally accessed.
     
    #define NATURAL_PARTITION_ID_TRAIT
     The storage provides natural number IDs for partitions. It follows the design principle of natural number ID trait in GRIN.
     
    #define ENABLE_VERTEX_REF
     The storage provides reference of vertex that can be recognized in other partitions where the vertex also appears.
     
    #define ENABLE_EDGE_REF
     The storage provides reference of edge that can be recognized in other partitions where the edge also appears.
     
    PropertyMacros

    Macros for property graph features

    +
    #define WITH_PROPERTY_NAME
     There are property names for properties. The relationship between property name and properties is one-to-many, because properties bound to different vertex/edge types are distinguished even they may share the same property name. Please refer to the design principle of Property for details.
     
    #define WITH_VERTEX_PROPERTY
     There are properties bound to vertices. When vertices are typed, vertex properties are bound to vertex types, according to the definition of vertex type.
     
    #define WITH_VERTEX_PRIMARTY_KEYS
     There are primary keys for vertices. Vertex primary keys is a set of vertex properties whose values can distinguish vertices. When vertices are typed, each vertex type has its own primary keys which distinguishes the vertices of that type.
     
    #define NATURAL_VERTEX_TYPE_ID_TRAIT
     The storage provides natural number IDs for vertex types. It follows the design principle of natural ID trait in GRIN.
     
    #define NATURAL_VERTEX_PROPERTY_ID_TRAIT
     The storage provides natural number IDs for properties bound to a certain vertex type. It follows the design principle of natural ID trait in GRIN.
     
    #define WITH_EDGE_PROPERTY
     
    #define WITH_EDGE_PRIMARTY_KEYS
     
    #define NATURAL_EDGE_TYPE_ID_TRAIT
     
    #define NATURAL_EDGE_PROPERTY_ID_TRAIT
     
    #define WITH_LABEL
     There are labels assigned to vertices or edges. Labels are mainly used in filtering vertcies or edges.
     
    #define COLUMN_STORE_TRAIT
     The storage uses column store for properties. This enables efficient property selections for vertices and edges.
     
    PredicateMacros

    Macros for predicate features

    +
    #define ENABLE_PREDICATE
     Enable predicates on graph.
     
    NullValues

    Macros for Null(invalid) values

    +
    #define NULL_TYPE   Undefined
     Null type (undefined data type)
     
    #define NULL_GRAPH   NULL
     Null graph (invalid return value)
     
    #define NULL_VERTEX   NULL
     Non-existing vertex (invalid return value)
     
    #define NULL_EDGE   NULL
     Non-existing edge (invalid return value)
     
    #define NULL_LIST   NULL
     Null list of any kind (invalid return value)
     
    #define NULL_PARTITION   NULL
     Non-existing partition (invalid return value)
     
    #define NULL_VERTEX_REF   NULL
     Null vertex reference (invalid return value)
     
    #define NULL_EDGE_REF   NULL
     Null edge reference (invalid return value)
     
    #define NULL_VERTEX_TYPE   NULL
     Non-existing vertex type (invalid return value)
     
    #define NULL_EDGE_TYPE   NULL
     Non-existing edge type (invalid return value)
     
    #define NULL_PROPERTY   NULL
     Non-existing property (invalid return value)
     
    #define NULL_ROW   NULL
     Null row (invalid return value)
     
    #define NULL_NATURAL_ID   UINT_MAX
     Null natural id of any kind (invalid return value)
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Typedefs

    typedef void * Graph
     
    typedef void * Vertex
     
    typedef void * Edge
     
    typedef void * OriginalID
     
    typedef void * VertexList
     
    typedef void * AdjacentList
     
    typedef void * PartitionedGraph
     
    typedef void * Partition
     
    typedef void * PartitionList
     
    typedef unsigned PartitionID
     
    typedef void * VertexRef
     
    typedef void * VertexType
     
    typedef void * VertexTypeList
     
    typedef void * VertexProperty
     
    typedef void * VertexPropertyList
     
    typedef void * VertexPropertyTable
     
    typedef unsigned VertexTypeID
     
    typedef unsigned VertexPropertyID
     
    typedef void * EdgeType
     
    typedef void * EdgeTypeList
     
    typedef void * EdgeProperty
     
    typedef void * EdgePropertyList
     
    typedef void * EdgePropertyTable
     
    typedef unsigned EdgeTypeID
     
    typedef unsigned EdgePropertyID
     
    typedef void * Row
     
    + + + + + + + +

    +Enumerations

    enum  Direction { IN = 0 +, OUT = 1 +, BOTH = 2 + }
     Enumerates the directions of edges with respect to a certain vertex. More...
     
    enum  DataType {
    +  Undefined = 0 +, Int32 = 1 +, UInt32 = 2 +, Int64 = 3 +,
    +  UInt64 = 4 +, Float = 5 +, Double = 6 +, String = 7 +,
    +  Date32 = 8 +, Date64 = 9 +
    + }
     Enumerates the datatype supported in the storage. More...
     
    +

    Detailed Description

    +

    Pre-defined macros for storage features. Undefine the macros of features that the storage does NOT support, so that APIs under unsupported features will NOT be available to the callers to avoid ambiguity.

    +

    Copyright 2020 Alibaba Group Holding Limited.

    +

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0
    +

    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    + +

    Definition in file predefine.h.

    +

    Macro Definition Documentation

    + +

    ◆ COLUMN_STORE_TRAIT

    + +
    +
    + + + + +
    #define COLUMN_STORE_TRAIT
    +
    + +

    The storage uses column store for properties. This enables efficient property selections for vertices and edges.

    + +

    Definition at line 217 of file predefine.h.

    + +
    +
    + +

    ◆ ENABLE_ADJACENT_LIST

    + +
    +
    + + + + +
    #define ENABLE_ADJACENT_LIST
    +
    + +

    Enable the adjacent list structure. The adjacent list related APIs follow the design principle of GRIN List.

    + +

    Definition at line 102 of file predefine.h.

    + +
    +
    + +

    ◆ ENABLE_ADJACENT_LIST_ITERATOR

    + +
    +
    + + + + +
    #define ENABLE_ADJACENT_LIST_ITERATOR
    +
    + +

    Enable the adjacent list iterator. The adjacent list iterator related APIs follow the design principle of GRIN Iterator.

    + +

    Definition at line 108 of file predefine.h.

    + +
    +
    + +

    ◆ ENABLE_EDGE_LIST

    + +
    +
    + + + + +
    #define ENABLE_EDGE_LIST
    +
    + +

    Enable the edge list structure. The edge list related APIs follow the design principle of GRIN List.

    + +

    Definition at line 90 of file predefine.h.

    + +
    +
    + +

    ◆ ENABLE_EDGE_LIST_ITERATOR

    + +
    +
    + + + + +
    #define ENABLE_EDGE_LIST_ITERATOR
    +
    + +

    Enable the edge list iterator. The edge list iterator related APIs follow the design principle of GRIN Iterator.

    + +

    Definition at line 96 of file predefine.h.

    + +
    +
    + +

    ◆ ENABLE_EDGE_REF

    + +
    +
    + + + + +
    #define ENABLE_EDGE_REF
    +
    + +

    The storage provides reference of edge that can be recognized in other partitions where the edge also appears.

    + +

    Definition at line 147 of file predefine.h.

    + +
    +
    + +

    ◆ ENABLE_GRAPH_PARTITION

    + +
    +
    + + + + +
    #define ENABLE_GRAPH_PARTITION
    +
    + +

    Enable partitioned graph. A partitioned graph usually contains several fragments (i.e., local graphs) that are distributedly stored in a cluster. In GRIN, Graph represents to a single fragment that can be locally accessed.

    + +

    Definition at line 129 of file predefine.h.

    + +
    +
    + +

    ◆ ENABLE_PREDICATE

    + +
    +
    + + + + +
    #define ENABLE_PREDICATE
    +
    + +

    Enable predicates on graph.

    + +

    Definition at line 247 of file predefine.h.

    + +
    +
    + +

    ◆ ENABLE_VERTEX_LIST

    + +
    +
    + + + + +
    #define ENABLE_VERTEX_LIST
    +
    + +

    Enable the vertex list structure. The vertex list related APIs follow the design principle of GRIN List.

    + +

    Definition at line 78 of file predefine.h.

    + +
    +
    + +

    ◆ ENABLE_VERTEX_LIST_ITERATOR

    + +
    +
    + + + + +
    #define ENABLE_VERTEX_LIST_ITERATOR
    +
    + +

    Enable the vertex list iterator. The vertex list iterator related APIs follow the design principle of GRIN Iterator.

    + +

    Definition at line 84 of file predefine.h.

    + +
    +
    + +

    ◆ ENABLE_VERTEX_REF

    + +
    +
    + + + + +
    #define ENABLE_VERTEX_REF
    +
    + +

    The storage provides reference of vertex that can be recognized in other partitions where the vertex also appears.

    + +

    Definition at line 141 of file predefine.h.

    + +
    +
    + +

    ◆ NATURAL_EDGE_PROPERTY_ID_TRAIT

    + +
    +
    + + + + +
    #define NATURAL_EDGE_PROPERTY_ID_TRAIT
    +
    + +

    Definition at line 205 of file predefine.h.

    + +
    +
    + +

    ◆ NATURAL_EDGE_TYPE_ID_TRAIT

    + +
    +
    + + + + +
    #define NATURAL_EDGE_TYPE_ID_TRAIT
    +
    + +

    Definition at line 204 of file predefine.h.

    + +
    +
    + +

    ◆ NATURAL_PARTITION_ID_TRAIT

    + +
    +
    + + + + +
    #define NATURAL_PARTITION_ID_TRAIT
    +
    + +

    The storage provides natural number IDs for partitions. It follows the design principle of natural number ID trait in GRIN.

    + +

    Definition at line 135 of file predefine.h.

    + +
    +
    + +

    ◆ NATURAL_VERTEX_PROPERTY_ID_TRAIT

    + +
    +
    + + + + +
    #define NATURAL_VERTEX_PROPERTY_ID_TRAIT
    +
    + +

    The storage provides natural number IDs for properties bound to a certain vertex type. It follows the design principle of natural ID trait in GRIN.

    + +

    Definition at line 199 of file predefine.h.

    + +
    +
    + +

    ◆ NATURAL_VERTEX_TYPE_ID_TRAIT

    + +
    +
    + + + + +
    #define NATURAL_VERTEX_TYPE_ID_TRAIT
    +
    + +

    The storage provides natural number IDs for vertex types. It follows the design principle of natural ID trait in GRIN.

    + +

    Definition at line 192 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_EDGE

    + +
    +
    + + + + +
    #define NULL_EDGE   NULL
    +
    + +

    Non-existing edge (invalid return value)

    + +

    Definition at line 262 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_EDGE_REF

    + +
    +
    + + + + +
    #define NULL_EDGE_REF   NULL
    +
    + +

    Null edge reference (invalid return value)

    + +

    Definition at line 270 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_EDGE_TYPE

    + +
    +
    + + + + +
    #define NULL_EDGE_TYPE   NULL
    +
    + +

    Non-existing edge type (invalid return value)

    + +

    Definition at line 274 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_GRAPH

    + +
    +
    + + + + +
    #define NULL_GRAPH   NULL
    +
    + +

    Null graph (invalid return value)

    + +

    Definition at line 258 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_LIST

    + +
    +
    + + + + +
    #define NULL_LIST   NULL
    +
    + +

    Null list of any kind (invalid return value)

    + +

    Definition at line 264 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_NATURAL_ID

    + +
    +
    + + + + +
    #define NULL_NATURAL_ID   UINT_MAX
    +
    + +

    Null natural id of any kind (invalid return value)

    + +

    Definition at line 280 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_PARTITION

    + +
    +
    + + + + +
    #define NULL_PARTITION   NULL
    +
    + +

    Non-existing partition (invalid return value)

    + +

    Definition at line 266 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_PROPERTY

    + +
    +
    + + + + +
    #define NULL_PROPERTY   NULL
    +
    + +

    Non-existing property (invalid return value)

    + +

    Definition at line 276 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_ROW

    + +
    +
    + + + + +
    #define NULL_ROW   NULL
    +
    + +

    Null row (invalid return value)

    + +

    Definition at line 278 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_TYPE

    + +
    +
    + + + + +
    #define NULL_TYPE   Undefined
    +
    + +

    Null type (undefined data type)

    + +

    Definition at line 256 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_VERTEX

    + +
    +
    + + + + +
    #define NULL_VERTEX   NULL
    +
    + +

    Non-existing vertex (invalid return value)

    + +

    Definition at line 260 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_VERTEX_REF

    + +
    +
    + + + + +
    #define NULL_VERTEX_REF   NULL
    +
    + +

    Null vertex reference (invalid return value)

    + +

    Definition at line 268 of file predefine.h.

    + +
    +
    + +

    ◆ NULL_VERTEX_TYPE

    + +
    +
    + + + + +
    #define NULL_VERTEX_TYPE   NULL
    +
    + +

    Non-existing vertex type (invalid return value)

    + +

    Definition at line 272 of file predefine.h.

    + +
    +
    + +

    ◆ WITH_EDGE_DATA

    + +
    +
    + + + + +
    #define WITH_EDGE_DATA
    +
    + +

    There is data on edge. E.g., the weight of an edge.

    + +

    Definition at line 72 of file predefine.h.

    + +
    +
    + +

    ◆ WITH_EDGE_PRIMARTY_KEYS

    + +
    +
    + + + + +
    #define WITH_EDGE_PRIMARTY_KEYS
    +
    + +

    Definition at line 203 of file predefine.h.

    + +
    +
    + +

    ◆ WITH_EDGE_PROPERTY

    + +
    +
    + + + + +
    #define WITH_EDGE_PROPERTY
    +
    + +

    Definition at line 202 of file predefine.h.

    + +
    +
    + +

    ◆ WITH_LABEL

    + +
    +
    + + + + +
    #define WITH_LABEL
    +
    + +

    There are labels assigned to vertices or edges. Labels are mainly used in filtering vertcies or edges.

    + +

    Definition at line 211 of file predefine.h.

    + +
    +
    + +

    ◆ WITH_PROPERTY_NAME

    + +
    +
    + + + + +
    #define WITH_PROPERTY_NAME
    +
    + +

    There are property names for properties. The relationship between property name and properties is one-to-many, because properties bound to different vertex/edge types are distinguished even they may share the same property name. Please refer to the design principle of Property for details.

    + +

    Definition at line 167 of file predefine.h.

    + +
    +
    + +

    ◆ WITH_VERTEX_DATA

    + +
    +
    + + + + +
    #define WITH_VERTEX_DATA
    +
    + +

    There is data on vertex. E.g., the PageRank value of a vertex.

    + +

    Definition at line 67 of file predefine.h.

    + +
    +
    + +

    ◆ WITH_VERTEX_ORIGINAL_ID

    + +
    +
    + + + + +
    #define WITH_VERTEX_ORIGINAL_ID
    +
    + +

    There is original ID for a vertex. This facilitates queries starting from a specific vertex, since one can get the vertex handler directly using its original ID.

    + +

    Definition at line 62 of file predefine.h.

    + +
    +
    + +

    ◆ WITH_VERTEX_PRIMARTY_KEYS

    + +
    +
    + + + + +
    #define WITH_VERTEX_PRIMARTY_KEYS
    +
    + +

    There are primary keys for vertices. Vertex primary keys is a set of vertex properties whose values can distinguish vertices. When vertices are typed, each vertex type has its own primary keys which distinguishes the vertices of that type.

    +

    With primary keys, one can get the vertex from the graph or a certain type by providing the values of the primary keys. The macro is unset if WITH_VERTEX_PROPERTY is NOT defined, in which case, one can use WITH_VERTEX_ORIGINAL_ID when vertices have no properties.

    + +

    Definition at line 186 of file predefine.h.

    + +
    +
    + +

    ◆ WITH_VERTEX_PROPERTY

    + +
    +
    + + + + +
    #define WITH_VERTEX_PROPERTY
    +
    + +

    There are properties bound to vertices. When vertices are typed, vertex properties are bound to vertex types, according to the definition of vertex type.

    + +

    Definition at line 173 of file predefine.h.

    + +
    +
    +

    Typedef Documentation

    + +

    ◆ AdjacentList

    + +
    +
    + + + + +
    typedef void* AdjacentList
    +
    + +

    Definition at line 306 of file predefine.h.

    + +
    +
    + +

    ◆ Edge

    + +
    +
    + + + + +
    typedef void* Edge
    +
    + +

    Definition at line 287 of file predefine.h.

    + +
    +
    + +

    ◆ EdgeProperty

    + +
    +
    + + + + +
    typedef void* EdgeProperty
    +
    + +

    Definition at line 363 of file predefine.h.

    + +
    +
    + +

    ◆ EdgePropertyID

    + +
    +
    + + + + +
    typedef unsigned EdgePropertyID
    +
    + +

    Definition at line 373 of file predefine.h.

    + +
    +
    + +

    ◆ EdgePropertyList

    + +
    +
    + + + + +
    typedef void* EdgePropertyList
    +
    + +

    Definition at line 364 of file predefine.h.

    + +
    +
    + +

    ◆ EdgePropertyTable

    + +
    +
    + + + + +
    typedef void* EdgePropertyTable
    +
    + +

    Definition at line 365 of file predefine.h.

    + +
    +
    + +

    ◆ EdgeType

    + +
    +
    + + + + +
    typedef void* EdgeType
    +
    + +

    Definition at line 361 of file predefine.h.

    + +
    +
    + +

    ◆ EdgeTypeID

    + +
    +
    + + + + +
    typedef unsigned EdgeTypeID
    +
    + +

    Definition at line 369 of file predefine.h.

    + +
    +
    + +

    ◆ EdgeTypeList

    + +
    +
    + + + + +
    typedef void* EdgeTypeList
    +
    + +

    Definition at line 362 of file predefine.h.

    + +
    +
    + +

    ◆ Graph

    + +
    +
    + + + + +
    typedef void* Graph
    +
    + +

    Definition at line 285 of file predefine.h.

    + +
    +
    + +

    ◆ OriginalID

    + +
    +
    + + + + +
    typedef void* OriginalID
    +
    + +

    Definition at line 290 of file predefine.h.

    + +
    +
    + +

    ◆ Partition

    + +
    +
    + + + + +
    typedef void* Partition
    +
    + +

    Definition at line 327 of file predefine.h.

    + +
    +
    + +

    ◆ PartitionedGraph

    + +
    +
    + + + + +
    typedef void* PartitionedGraph
    +
    + +

    Definition at line 326 of file predefine.h.

    + +
    +
    + +

    ◆ PartitionID

    + +
    +
    + + + + +
    typedef unsigned PartitionID
    +
    + +

    Definition at line 332 of file predefine.h.

    + +
    +
    + +

    ◆ PartitionList

    + +
    +
    + + + + +
    typedef void* PartitionList
    +
    + +

    Definition at line 328 of file predefine.h.

    + +
    +
    + +

    ◆ Row

    + +
    +
    + + + + +
    typedef void* Row
    +
    + +

    Definition at line 377 of file predefine.h.

    + +
    +
    + +

    ◆ Vertex

    + +
    +
    + + + + +
    typedef void* Vertex
    +
    + +

    Definition at line 286 of file predefine.h.

    + +
    +
    + +

    ◆ VertexList

    + +
    +
    + + + + +
    typedef void* VertexList
    +
    + +

    Definition at line 298 of file predefine.h.

    + +
    +
    + +

    ◆ VertexProperty

    + +
    +
    + + + + +
    typedef void* VertexProperty
    +
    + +

    Definition at line 347 of file predefine.h.

    + +
    +
    + +

    ◆ VertexPropertyID

    + +
    +
    + + + + +
    typedef unsigned VertexPropertyID
    +
    + +

    Definition at line 357 of file predefine.h.

    + +
    +
    + +

    ◆ VertexPropertyList

    + +
    +
    + + + + +
    typedef void* VertexPropertyList
    +
    + +

    Definition at line 348 of file predefine.h.

    + +
    +
    + +

    ◆ VertexPropertyTable

    + +
    +
    + + + + +
    typedef void* VertexPropertyTable
    +
    + +

    Definition at line 349 of file predefine.h.

    + +
    +
    + +

    ◆ VertexRef

    + +
    +
    + + + + +
    typedef void* VertexRef
    +
    + +

    Definition at line 336 of file predefine.h.

    + +
    +
    + +

    ◆ VertexType

    + +
    +
    + + + + +
    typedef void* VertexType
    +
    + +

    Definition at line 345 of file predefine.h.

    + +
    +
    + +

    ◆ VertexTypeID

    + +
    +
    + + + + +
    typedef unsigned VertexTypeID
    +
    + +

    Definition at line 353 of file predefine.h.

    + +
    +
    + +

    ◆ VertexTypeList

    + +
    +
    + + + + +
    typedef void* VertexTypeList
    +
    + +

    Definition at line 346 of file predefine.h.

    + +
    +
    +

    Enumeration Type Documentation

    + +

    ◆ DataType

    + +
    +
    + + + + +
    enum DataType
    +
    + +

    Enumerates the datatype supported in the storage.

    + + + + + + + + + + + +
    Enumerator
    Undefined 

    other unknown types

    +
    Int32 

    int

    +
    UInt32 

    unsigned int

    +
    Int64 

    long int

    +
    UInt64 

    unsigned long int

    +
    Float 

    float

    +
    Double 

    double

    +
    String 

    string

    +
    Date32 

    short date

    +
    Date64 

    long date

    +
    + +

    Definition at line 40 of file predefine.h.

    + +
    +
    + +

    ◆ Direction

    + +
    +
    + + + + +
    enum Direction
    +
    + +

    Enumerates the directions of edges with respect to a certain vertex.

    + + + + +
    Enumerator
    IN 

    incoming

    +
    OUT 

    outgoing

    +
    BOTH 

    incoming & outgoing

    +
    + +

    Definition at line 33 of file predefine.h.

    + +
    +
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/predefine_8h_source.html b/grin/docs/_build/doxygen/html/predefine_8h_source.html new file mode 100644 index 000000000..ac85add67 --- /dev/null +++ b/grin/docs/_build/doxygen/html/predefine_8h_source.html @@ -0,0 +1,335 @@ + + + + + + + +GRIN: include/predefine.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    predefine.h
    +
    +
    +Go to the documentation of this file.
    1
    +
    24#ifndef GRIN_INCLUDE_PREDEFINE_H_
    +
    25#define GRIN_INCLUDE_PREDEFINE_H_
    +
    26
    +
    27#include <limits.h>
    +
    28#include <stdbool.h>
    +
    29#include <stddef.h>
    +
    30
    +
    31
    +
    33typedef enum {
    +
    34 IN = 0,
    +
    35 OUT = 1,
    +
    36 BOTH = 2,
    +
    37} Direction;
    +
    38
    +
    40typedef enum {
    + +
    42 Int32 = 1,
    +
    43 UInt32 = 2,
    +
    44 Int64 = 3,
    +
    45 UInt64 = 4,
    +
    46 Float = 5,
    +
    47 Double = 6,
    +
    48 String = 7,
    +
    49 Date32 = 8,
    +
    50 Date64 = 9,
    +
    51} DataType;
    +
    52
    +
    57
    +
    62#define WITH_VERTEX_ORIGINAL_ID
    +
    63
    +
    67#define WITH_VERTEX_DATA
    +
    68
    +
    72#define WITH_EDGE_DATA
    +
    73
    +
    78#define ENABLE_VERTEX_LIST
    +
    79
    +
    84#define ENABLE_VERTEX_LIST_ITERATOR
    +
    85
    +
    90#define ENABLE_EDGE_LIST
    +
    91
    +
    96#define ENABLE_EDGE_LIST_ITERATOR
    +
    97
    +
    102#define ENABLE_ADJACENT_LIST
    +
    103
    +
    108#define ENABLE_ADJACENT_LIST_ITERATOR
    +
    109
    +
    110#undef WITH_VERTEX_DATA
    +
    111#undef WITH_EDGE_DATA
    +
    112#undef ENABLE_VERTEX_LIST_ITERATOR
    +
    113#undef ENABLE_EDGE_LIST
    +
    114#undef ENABLE_EDGE_LIST_ITERATOR
    +
    115#undef ENABLE_ADJACENT_LIST_ITERATOR
    +
    117
    +
    118
    +
    123
    +
    129#define ENABLE_GRAPH_PARTITION
    +
    130
    +
    135#define NATURAL_PARTITION_ID_TRAIT
    +
    136
    +
    141#define ENABLE_VERTEX_REF
    +
    142
    +
    147#define ENABLE_EDGE_REF
    +
    148
    +
    149#ifndef ENABLE_GRAPH_PARTITION
    +
    150#undef NATURAL_PARTITION_ID_TRAIT
    +
    151#endif
    +
    152
    +
    153#undef ENABLE_EDGE_REF
    +
    155
    +
    156
    +
    161
    +
    167#define WITH_PROPERTY_NAME
    +
    168
    +
    173#define WITH_VERTEX_PROPERTY
    +
    174
    +
    186#define WITH_VERTEX_PRIMARTY_KEYS
    +
    187
    +
    192#define NATURAL_VERTEX_TYPE_ID_TRAIT
    +
    193
    +
    199#define NATURAL_VERTEX_PROPERTY_ID_TRAIT
    +
    200
    +
    201
    +
    202#define WITH_EDGE_PROPERTY // There is any property for edges.
    +
    203#define WITH_EDGE_PRIMARTY_KEYS // There is cross-type property name.
    +
    204#define NATURAL_EDGE_TYPE_ID_TRAIT // Edge type has natural continuous id from 0.
    +
    205#define NATURAL_EDGE_PROPERTY_ID_TRAIT // Edge property has natural continuous id from 0.
    +
    206
    +
    211#define WITH_LABEL
    +
    212
    +
    217#define COLUMN_STORE_TRAIT
    +
    218
    +
    219#if !defined(WITH_VERTEX_PROPERTY) && !defined(WITH_EDGE_PROPERTY)
    +
    220#undef WITH_PROPERTY_NAME
    +
    221#endif
    +
    222
    +
    223#ifndef WITH_VERTEX_PROPERTY
    +
    224#undef WITH_VERTEX_PRIMARTY_KEYS
    +
    225#undef NATURAL_VERTEX_TYPE_ID_TRAIT
    +
    226#undef NATURAL_VERTEX_PROPERTY_ID_TRAIT
    +
    227#endif
    +
    228
    +
    229#ifndef WITH_EDGE_PROPERTY
    +
    230#undef WITH_EDGE_PRIMARTY_KEYS
    +
    231#undef NATURAL_EDGE_TYPE_ID_TRAIT
    +
    232#undef NATURAL_EDGE_PROPERTY_ID_TRAIT
    +
    233#endif
    +
    234
    +
    235#undef WITH_VERTEX_PRIMARTY_KEYS
    +
    236
    +
    237#undef WITH_LABEL
    +
    239
    +
    244
    +
    247#define ENABLE_PREDICATE
    +
    248#undef ENABLE_PREDICATE
    +
    250
    +
    255
    +
    256#define NULL_TYPE Undefined
    +
    258#define NULL_GRAPH NULL
    +
    260#define NULL_VERTEX NULL
    +
    262#define NULL_EDGE NULL
    +
    264#define NULL_LIST NULL
    +
    266#define NULL_PARTITION NULL
    +
    268#define NULL_VERTEX_REF NULL
    +
    270#define NULL_EDGE_REF NULL
    +
    272#define NULL_VERTEX_TYPE NULL
    +
    274#define NULL_EDGE_TYPE NULL
    +
    276#define NULL_PROPERTY NULL
    +
    278#define NULL_ROW NULL
    +
    280#define NULL_NATURAL_ID UINT_MAX
    +
    282
    +
    283
    +
    284/* Define the handlers using typedef */
    +
    285typedef void* Graph;
    +
    286typedef void* Vertex;
    +
    287typedef void* Edge;
    +
    288
    +
    289#ifdef WITH_VERTEX_ORIGINAL_ID
    +
    290typedef void* OriginalID;
    +
    291#endif
    +
    292
    +
    293#ifdef WITH_VERTEX_DATA
    +
    294typedef void* VertexData;
    +
    295#endif
    +
    296
    +
    297#ifdef ENABLE_VERTEX_LIST
    +
    298typedef void* VertexList;
    +
    299#endif
    +
    300
    +
    301#ifdef ENABLE_VERTEX_LIST_ITERATOR
    +
    302typedef void* VertexListIterator;
    +
    303#endif
    +
    304
    +
    305#ifdef ENABLE_ADJACENT_LIST
    +
    306typedef void* AdjacentList;
    +
    307#endif
    +
    308
    +
    309#ifdef ENABLE_ADJACENT_LIST_ITERATOR
    +
    310typedef void* AdjacentListIterator;
    +
    311#endif
    +
    312
    +
    313#ifdef WITH_EDGE_DATA
    +
    314typedef void* EdgeData;
    +
    315#endif
    +
    316
    +
    317#ifdef ENABLE_EDGE_LIST
    +
    318typedef void* EdgeList;
    +
    319#endif
    +
    320
    +
    321#ifdef ENABLE_EDGE_LIST_ITERATOR
    +
    322typedef void* EdgeListIterator;
    +
    323#endif
    +
    324
    +
    325#ifdef ENABLE_GRAPH_PARTITION
    +
    326typedef void* PartitionedGraph;
    +
    327typedef void* Partition;
    +
    328typedef void* PartitionList;
    +
    329#endif
    +
    330
    +
    331#ifdef NATURAL_PARTITION_ID_TRAIT
    +
    332typedef unsigned PartitionID;
    +
    333#endif
    +
    334
    +
    335#ifdef ENABLE_VERTEX_REF
    +
    336typedef void* VertexRef;
    +
    337#endif
    +
    338
    +
    339#ifdef ENABLE_EDGE_REF
    +
    340typedef void* EdgeRef;
    +
    341#endif
    +
    342
    +
    343
    +
    344#ifdef WITH_VERTEX_PROPERTY
    +
    345typedef void* VertexType;
    +
    346typedef void* VertexTypeList;
    +
    347typedef void* VertexProperty;
    +
    348typedef void* VertexPropertyList;
    +
    349typedef void* VertexPropertyTable;
    +
    350#endif
    +
    351
    +
    352#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT
    +
    353typedef unsigned VertexTypeID;
    +
    354#endif
    +
    355
    +
    356#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT
    +
    357typedef unsigned VertexPropertyID;
    +
    358#endif
    +
    359
    +
    360#ifdef WITH_EDGE_PROPERTY
    +
    361typedef void* EdgeType;
    +
    362typedef void* EdgeTypeList;
    +
    363typedef void* EdgeProperty;
    +
    364typedef void* EdgePropertyList;
    +
    365typedef void* EdgePropertyTable;
    +
    366#endif
    +
    367
    +
    368#ifdef NATURAL_EDGE_TYPE_ID_TRAIT
    +
    369typedef unsigned EdgeTypeID;
    +
    370#endif
    +
    371
    +
    372#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT
    +
    373typedef unsigned EdgePropertyID;
    +
    374#endif
    +
    375
    +
    376#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY)
    +
    377typedef void* Row;
    +
    378#endif
    +
    379
    +
    380#ifdef WITH_LABEL
    +
    381typedef void* Label
    +
    382typedef void* LabelList
    +
    383#endif
    +
    384
    +
    385#endif // GRIN_INCLUDE_PREDEFINE_H_
    +
    Direction
    Enumerates the directions of edges with respect to a certain vertex.
    Definition: predefine.h:33
    +
    @ BOTH
    incoming & outgoing
    Definition: predefine.h:36
    +
    @ OUT
    outgoing
    Definition: predefine.h:35
    +
    @ IN
    incoming
    Definition: predefine.h:34
    +
    DataType
    Enumerates the datatype supported in the storage.
    Definition: predefine.h:40
    +
    @ UInt64
    unsigned long int
    Definition: predefine.h:45
    +
    @ Undefined
    other unknown types
    Definition: predefine.h:41
    +
    @ Date32
    short date
    Definition: predefine.h:49
    +
    @ UInt32
    unsigned int
    Definition: predefine.h:43
    +
    @ Int32
    int
    Definition: predefine.h:42
    +
    @ Date64
    long date
    Definition: predefine.h:50
    +
    @ Float
    float
    Definition: predefine.h:46
    +
    @ Int64
    long int
    Definition: predefine.h:44
    +
    @ String
    string
    Definition: predefine.h:48
    +
    @ Double
    double
    Definition: predefine.h:47
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/primarykey_8h.html b/grin/docs/_build/doxygen/html/primarykey_8h.html new file mode 100644 index 000000000..7ca87cbf8 --- /dev/null +++ b/grin/docs/_build/doxygen/html/primarykey_8h.html @@ -0,0 +1,220 @@ + + + + + + + +GRIN: include/property/primarykey.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    + +
    primarykey.h File Reference
    +
    +
    + +

    Define the primary key related APIs. +More...

    +
    #include "../predefine.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + +

    +Functions

    VertexTypeList get_vertex_types_with_primary_keys (const Graph)
     get the vertex types with primary keys
     
    VertexPropertyList get_primary_keys_by_vertex_type (const Graph, const VertexType)
     get the primary keys (property list) of a specific vertex type
     
    Vertex get_vertex_by_primay_keys (const Graph, const VertexPropertyList, const Row)
     get the vertex with the given primary keys
     
    +

    Detailed Description

    +

    Define the primary key related APIs.

    +

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    + +

    Definition in file primarykey.h.

    +

    Function Documentation

    + +

    ◆ get_primary_keys_by_vertex_type()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    VertexPropertyList get_primary_keys_by_vertex_type (const Graph,
    const VertexType 
    )
    +
    + +

    get the primary keys (property list) of a specific vertex type

    +
    Parameters
    + + + +
    Graphthe graph
    VertexTypethe vertex type
    +
    +
    + +
    +
    + +

    ◆ get_vertex_by_primay_keys()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    Vertex get_vertex_by_primay_keys (const Graph,
    const VertexPropertyList,
    const Row 
    )
    +
    + +

    get the vertex with the given primary keys

    +
    Parameters
    + + + + +
    Graphthe graph
    VertexPropertyListthe primary keys
    Rowthe values of primary keys
    +
    +
    + +
    +
    + +

    ◆ get_vertex_types_with_primary_keys()

    + +
    +
    + + + + + + + + +
    VertexTypeList get_vertex_types_with_primary_keys (const Graph)
    +
    + +

    get the vertex types with primary keys

    +
    Parameters
    + + +
    Graphthe graph
    +
    +
    + +
    +
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/primarykey_8h_source.html b/grin/docs/_build/doxygen/html/primarykey_8h_source.html new file mode 100644 index 000000000..b15ce4873 --- /dev/null +++ b/grin/docs/_build/doxygen/html/primarykey_8h_source.html @@ -0,0 +1,104 @@ + + + + + + + +GRIN: include/property/primarykey.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    primarykey.h
    +
    +
    +Go to the documentation of this file.
    1
    +
    18#ifndef GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_
    +
    19#define GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_
    +
    20
    +
    21#include "../predefine.h"
    +
    22
    +
    23#ifdef WITH_VERTEX_PRIMARY_KEYS
    +
    28VertexTypeList get_vertex_types_with_primary_keys(const Graph);
    +
    29
    +
    35VertexPropertyList get_primary_keys_by_vertex_type(const Graph, const VertexType);
    +
    36
    +
    43Vertex get_vertex_by_primay_keys(const Graph, const VertexPropertyList, const Row);
    +
    44#endif
    +
    45
    +
    46#endif // GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_
    +
    VertexTypeList get_vertex_types_with_primary_keys(const Graph)
    get the vertex types with primary keys
    +
    Vertex get_vertex_by_primay_keys(const Graph, const VertexPropertyList, const Row)
    get the vertex with the given primary keys
    +
    VertexPropertyList get_primary_keys_by_vertex_type(const Graph, const VertexType)
    get the primary keys (property list) of a specific vertex type
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/property_8h.html b/grin/docs/_build/doxygen/html/property_8h.html new file mode 100644 index 000000000..9562f14d4 --- /dev/null +++ b/grin/docs/_build/doxygen/html/property_8h.html @@ -0,0 +1,371 @@ + + + + + + + +GRIN: include/property/property.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    + +
    property.h File Reference
    +
    +
    + +

    Define the property related APIs. +More...

    +
    #include "../predefine.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    +char * get_vertex_property_name (const Graph, const VertexProperty)
     
    VertexProperty get_vertex_property_by_name (const Graph, const VertexType, const char *msg)
     get the vertex property with a given name under a specific vertex type
     
    VertexPropertyList get_vertex_properties_by_name (const Graph, const char *)
     get all the vertex properties with a given name
     
    +char * get_edge_property_name (const Graph, const EdgeProperty)
     
    EdgeProperty get_edge_property_by_name (const Graph, const EdgeType, const char *msg)
     get the edge property with a given name under a specific edge type
     
    EdgePropertyList get_edge_properties_by_name (const Graph, const char *)
     get all the edge properties with a given name
     
    void destroy_vertex_property (VertexProperty)
     destroy vertex property
     
    DataType get_vertex_property_data_type (VertexProperty)
     get property data type
     
    VertexType get_vertex_property_vertex_type (VertexProperty)
     get the vertex type that the property is bound to
     
    +

    Detailed Description

    +

    Define the property related APIs.

    +

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    + +

    Definition in file property.h.

    +

    Function Documentation

    + +

    ◆ destroy_vertex_property()

    + +
    +
    + + + + + + + + +
    void destroy_vertex_property (VertexProperty )
    +
    + +

    destroy vertex property

    +
    Parameters
    + + +
    VertexPropertyvertex property
    +
    +
    + +
    +
    + +

    ◆ get_edge_properties_by_name()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    EdgePropertyList get_edge_properties_by_name (const Graph,
    const char *  
    )
    +
    + +

    get all the edge properties with a given name

    +
    Parameters
    + + + +
    Graphthe graph
    msgthe name
    +
    +
    + +
    +
    + +

    ◆ get_edge_property_by_name()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    EdgeProperty get_edge_property_by_name (const Graph,
    const EdgeType,
    const char * msg 
    )
    +
    + +

    get the edge property with a given name under a specific edge type

    +
    Parameters
    + + + + +
    Graphthe graph
    EdgeTypethe specific edge type
    msgthe name
    +
    +
    + +
    +
    + +

    ◆ get_vertex_properties_by_name()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    VertexPropertyList get_vertex_properties_by_name (const Graph,
    const char *  
    )
    +
    + +

    get all the vertex properties with a given name

    +
    Parameters
    + + + +
    Graphthe graph
    msgthe name
    +
    +
    + +
    +
    + +

    ◆ get_vertex_property_by_name()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    VertexProperty get_vertex_property_by_name (const Graph,
    const VertexType,
    const char * msg 
    )
    +
    + +

    get the vertex property with a given name under a specific vertex type

    +
    Parameters
    + + + + +
    Graphthe graph
    VertexTypethe specific vertex type
    msgthe name
    +
    +
    + +
    +
    + +

    ◆ get_vertex_property_data_type()

    + +
    +
    + + + + + + + + +
    DataType get_vertex_property_data_type (VertexProperty )
    +
    + +

    get property data type

    +
    Parameters
    + + +
    VertexPropertyvertex property
    +
    +
    + +
    +
    + +

    ◆ get_vertex_property_vertex_type()

    + +
    +
    + + + + + + + + +
    VertexType get_vertex_property_vertex_type (VertexProperty )
    +
    + +

    get the vertex type that the property is bound to

    +
    Parameters
    + + +
    VertexPropertyvertex property
    +
    +
    + +
    +
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/property_8h_source.html b/grin/docs/_build/doxygen/html/property_8h_source.html new file mode 100644 index 000000000..e27c544d2 --- /dev/null +++ b/grin/docs/_build/doxygen/html/property_8h_source.html @@ -0,0 +1,126 @@ + + + + + + + +GRIN: include/property/property.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    property.h
    +
    +
    +Go to the documentation of this file.
    1
    +
    18#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_H_
    +
    19#define GRIN_INCLUDE_PROPERTY_PROPERTY_H_
    +
    20
    +
    21#include "../predefine.h"
    +
    22
    +
    23#ifdef WITH_PROPERTY_NAME
    +
    24char* get_vertex_property_name(const Graph, const VertexProperty);
    +
    25
    +
    32VertexProperty get_vertex_property_by_name(const Graph, const VertexType, const char* msg);
    +
    33
    +
    39VertexPropertyList get_vertex_properties_by_name(const Graph, const char*);
    +
    40
    +
    41char* get_edge_property_name(const Graph, const EdgeProperty);
    +
    42
    +
    49EdgeProperty get_edge_property_by_name(const Graph, const EdgeType, const char* msg);
    +
    50
    +
    56EdgePropertyList get_edge_properties_by_name(const Graph, const char*);
    +
    57#endif
    +
    58
    +
    59
    +
    60#ifdef WITH_VERTEX_PROPERTY
    +
    65void destroy_vertex_property(VertexProperty);
    +
    66
    + +
    72
    +
    77VertexType get_vertex_property_vertex_type(VertexProperty);
    +
    78#endif
    +
    79
    +
    80
    +
    81
    +
    82#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_H_
    +
    DataType
    Enumerates the datatype supported in the storage.
    Definition: predefine.h:40
    +
    EdgeProperty get_edge_property_by_name(const Graph, const EdgeType, const char *msg)
    get the edge property with a given name under a specific edge type
    +
    VertexPropertyList get_vertex_properties_by_name(const Graph, const char *)
    get all the vertex properties with a given name
    +
    VertexType get_vertex_property_vertex_type(VertexProperty)
    get the vertex type that the property is bound to
    +
    EdgePropertyList get_edge_properties_by_name(const Graph, const char *)
    get all the edge properties with a given name
    +
    DataType get_vertex_property_data_type(VertexProperty)
    get property data type
    +
    void destroy_vertex_property(VertexProperty)
    destroy vertex property
    +
    VertexProperty get_vertex_property_by_name(const Graph, const VertexType, const char *msg)
    get the vertex property with a given name under a specific vertex type
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/propertylist_8h.html b/grin/docs/_build/doxygen/html/propertylist_8h.html new file mode 100644 index 000000000..602d25ab5 --- /dev/null +++ b/grin/docs/_build/doxygen/html/propertylist_8h.html @@ -0,0 +1,163 @@ + + + + + + + +GRIN: include/property/propertylist.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    + +
    propertylist.h File Reference
    +
    +
    + +

    Define the property list related and graph projection APIs. +More...

    +
    #include "../predefine.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    +VertexPropertyList get_vertex_property_list_by_type (const Graph, const VertexType)
     
    +size_t get_vertex_property_list_size (const VertexPropertyList)
     
    +VertexProperty get_vertex_property_from_list (const VertexPropertyList, const size_t)
     
    +VertexPropertyList create_vertex_property_list ()
     
    +void destroy_vertex_property_list (VertexPropertyList)
     
    +bool insert_vertex_property_to_list (VertexPropertyList, const VertexProperty)
     
    +VertexProperty get_vertex_property_from_id (const VertexType, const VertexPropertyID)
     
    +VertexPropertyID get_vertex_property_id (const VertexType, const VertexProperty)
     
    +EdgePropertyList get_edge_property_list_by_type (const Graph, const EdgeType)
     
    +size_t get_edge_property_list_size (const EdgePropertyList)
     
    +EdgeProperty get_edge_property_from_list (const EdgePropertyList, const size_t)
     
    +EdgePropertyList create_edge_property_list ()
     
    +void destroy_edge_property_list (EdgePropertyList)
     
    +bool insert_edge_property_to_list (EdgePropertyList, const EdgeProperty)
     
    +EdgeProperty get_edge_property_from_id (const EdgeType, const EdgePropertyID)
     
    +EdgePropertyID get_edge_property_id (const EdgeType, const EdgeProperty)
     
    GraphProjection

    Graph projection mainly works to shrink the properties into a subset in need to improve the retrieval efficiency. Note that only the vertex/edge type with at least one property left in the vertex/edge property list will be kept after the projection.

    +

    The projection only works on column store systems.

    +
    +Graph select_vertex_properties (const Graph, const VertexPropertyList)
     project vertex properties
     
    +Graph select_edge_properteis (const Graph, const EdgePropertyList)
     project edge properties
     
    +

    Detailed Description

    +

    Define the property list related and graph projection APIs.

    +

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    + +

    Definition in file propertylist.h.

    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/propertylist_8h_source.html b/grin/docs/_build/doxygen/html/propertylist_8h_source.html new file mode 100644 index 000000000..c99917306 --- /dev/null +++ b/grin/docs/_build/doxygen/html/propertylist_8h_source.html @@ -0,0 +1,146 @@ + + + + + + + +GRIN: include/property/propertylist.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    propertylist.h
    +
    +
    +Go to the documentation of this file.
    1
    +
    18#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_
    +
    19#define GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_
    +
    20
    +
    21#include "../predefine.h"
    +
    22
    +
    23// Property list
    +
    24#ifdef WITH_VERTEX_PROPERTY
    +
    25VertexPropertyList get_vertex_property_list_by_type(const Graph, const VertexType);
    +
    26
    +
    27size_t get_vertex_property_list_size(const VertexPropertyList);
    +
    28
    +
    29VertexProperty get_vertex_property_from_list(const VertexPropertyList, const size_t);
    +
    30
    +
    31VertexPropertyList create_vertex_property_list();
    +
    32
    +
    33void destroy_vertex_property_list(VertexPropertyList);
    +
    34
    +
    35bool insert_vertex_property_to_list(VertexPropertyList, const VertexProperty);
    +
    36#endif
    +
    37
    +
    38#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT
    +
    39VertexProperty get_vertex_property_from_id(const VertexType, const VertexPropertyID);
    +
    40
    +
    41VertexPropertyID get_vertex_property_id(const VertexType, const VertexProperty);
    +
    42#endif
    +
    43
    +
    44
    +
    45#ifdef WITH_EDGE_PROPERTY
    +
    46EdgePropertyList get_edge_property_list_by_type(const Graph, const EdgeType);
    +
    47
    +
    48size_t get_edge_property_list_size(const EdgePropertyList);
    +
    49
    +
    50EdgeProperty get_edge_property_from_list(const EdgePropertyList, const size_t);
    +
    51
    +
    52EdgePropertyList create_edge_property_list();
    +
    53
    +
    54void destroy_edge_property_list(EdgePropertyList);
    +
    55
    +
    56bool insert_edge_property_to_list(EdgePropertyList, const EdgeProperty);
    +
    57#endif
    +
    58
    +
    59#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT
    +
    60EdgeProperty get_edge_property_from_id(const EdgeType, const EdgePropertyID);
    +
    61
    +
    62EdgePropertyID get_edge_property_id(const EdgeType, const EdgeProperty);
    +
    63#endif
    +
    64
    +
    65
    +
    75#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE_TRAIT)
    +
    77Graph select_vertex_properties(const Graph, const VertexPropertyList);
    +
    78#endif
    +
    79
    +
    80#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE_TRAIT)
    +
    82Graph select_edge_properteis(const Graph, const EdgePropertyList);
    +
    83#endif
    +
    84
    +
    85#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_
    +
    Graph select_vertex_properties(const Graph, const VertexPropertyList)
    project vertex properties
    +
    Graph select_edge_properteis(const Graph, const EdgePropertyList)
    project edge properties
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/propertytable_8h.html b/grin/docs/_build/doxygen/html/propertytable_8h.html new file mode 100644 index 000000000..9d18a165e --- /dev/null +++ b/grin/docs/_build/doxygen/html/propertytable_8h.html @@ -0,0 +1,286 @@ + + + + + + + +GRIN: include/property/propertytable.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    + +
    propertytable.h File Reference
    +
    +
    + +

    Define the property table related APIs. +More...

    +
    #include "../predefine.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    void destroy_vertex_property_table (VertexPropertyTable)
     destroy vertex property table
     
    VertexPropertyTable get_vertex_property_table_by_type (const Graph, const VertexType)
     get the vertex property table of a certain vertex type No matter column or row store strategy is used in the storage, GRIN recommends to first get the property table of the vertex type, and then fetch values(rows) by vertex and property(list). However, GRIN does provide direct row fetching API when COLUMN_STORE_TRAIT is NOT set.
     
    void * get_value_from_vertex_property_table (const VertexPropertyTable, const Vertex, const VertexProperty)
     get vertex property value from table
     
    Row get_row_from_vertex_property_table (const VertexPropertyTable, const Vertex, const VertexPropertyList)
     get vertex row from table
     
    Row

    Row works as the pure value array for the properties of a vertex or an edge. In general, you can think of Row as an array of void*, where each void* points to the value of a property. GRIN assumes the user already knows the corresponding property list beforehead, so that she/he knows how to cast the void* into the property's data type.

    +
    +void destroy_row (Row)
     
    +void * get_value_from_row (Row, const size_t)
     the value of a property from row by its position in row
     
    +Row create_row ()
     create a row, usually to get vertex/edge by primary keys
     
    +bool insert_value_to_row (Row, const void *)
     insert a value to the end of the row
     
    +

    Detailed Description

    +

    Define the property table related APIs.

    +

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    + +

    Definition in file propertytable.h.

    +

    Function Documentation

    + +

    ◆ destroy_vertex_property_table()

    + +
    +
    + + + + + + + + +
    void destroy_vertex_property_table (VertexPropertyTable )
    +
    + +

    destroy vertex property table

    +
    Parameters
    + + +
    VertexPropertyTablevertex property table
    +
    +
    + +
    +
    + +

    ◆ get_row_from_vertex_property_table()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    Row get_row_from_vertex_property_table (const VertexPropertyTable,
    const Vertex,
    const VertexPropertyList 
    )
    +
    + +

    get vertex row from table

    +
    Parameters
    + + + + +
    VertexPropertyTablevertex property table
    Vertexthe vertex which is the row index
    VertexPropertyListthe vertex property list as columns
    +
    +
    + +
    +
    + +

    ◆ get_value_from_vertex_property_table()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    void * get_value_from_vertex_property_table (const VertexPropertyTable,
    const Vertex,
    const VertexProperty 
    )
    +
    + +

    get vertex property value from table

    +
    Parameters
    + + + + +
    VertexPropertyTablevertex property table
    Vertexthe vertex which is the row index
    VertexPropertythe vertex property which is the column index
    +
    +
    +
    Returns
    can be casted to the property data type by the caller
    + +
    +
    + +

    ◆ get_vertex_property_table_by_type()

    + +
    +
    + + + + + + + + + + + + + + + + + + +
    VertexPropertyTable get_vertex_property_table_by_type (const Graph,
    const VertexType 
    )
    +
    + +

    get the vertex property table of a certain vertex type No matter column or row store strategy is used in the storage, GRIN recommends to first get the property table of the vertex type, and then fetch values(rows) by vertex and property(list). However, GRIN does provide direct row fetching API when COLUMN_STORE_TRAIT is NOT set.

    +
    Parameters
    + + + +
    Graphthe graph
    VertexTypethe vertex type
    +
    +
    + +
    +
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/propertytable_8h_source.html b/grin/docs/_build/doxygen/html/propertytable_8h_source.html new file mode 100644 index 000000000..4d91074e8 --- /dev/null +++ b/grin/docs/_build/doxygen/html/propertytable_8h_source.html @@ -0,0 +1,125 @@ + + + + + + + +GRIN: include/property/propertytable.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    propertytable.h
    +
    +
    +Go to the documentation of this file.
    1
    +
    18#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_
    +
    19#define GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_
    +
    20
    +
    21#include "../predefine.h"
    +
    22
    +
    31#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY)
    +
    32void destroy_row(Row);
    +
    33
    +
    35void* get_value_from_row(Row, const size_t);
    +
    36
    + +
    39
    +
    41bool insert_value_to_row(Row, const void*);
    +
    42#endif
    +
    44
    +
    45#ifdef WITH_VERTEX_PROPERTY
    +
    50void destroy_vertex_property_table(VertexPropertyTable);
    +
    51
    +
    62VertexPropertyTable get_vertex_property_table_by_type(const Graph, const VertexType);
    +
    63
    +
    71void* get_value_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexProperty);
    +
    72
    +
    79Row get_row_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexPropertyList);
    +
    80
    +
    81#ifndef COLUMN_STORE_TRAIT
    +
    88Row get_vertex_row(const Graph, const Vertex, const VertexPropertyList);
    +
    89#endif
    +
    90#endif
    +
    91
    +
    92
    +
    93#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_
    +
    void destroy_vertex_property_table(VertexPropertyTable)
    destroy vertex property table
    +
    Row get_row_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexPropertyList)
    get vertex row from table
    +
    void * get_value_from_row(Row, const size_t)
    the value of a property from row by its position in row
    +
    bool insert_value_to_row(Row, const void *)
    insert a value to the end of the row
    +
    void * get_value_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexProperty)
    get vertex property value from table
    +
    Row create_row()
    create a row, usually to get vertex/edge by primary keys
    +
    VertexPropertyTable get_vertex_property_table_by_type(const Graph, const VertexType)
    get the vertex property table of a certain vertex type No matter column or row store strategy is used...
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/search/all_0.js b/grin/docs/_build/doxygen/html/search/all_0.js new file mode 100644 index 000000000..5c11d88fc --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['assign_5flabel_5fto_5fvertex_0',['assign_label_to_vertex',['../label_8h.html#a8091acf655961c1b66933945feac27f3',1,'label.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_1.js b/grin/docs/_build/doxygen/html/search/all_1.js new file mode 100644 index 000000000..46cd1debe --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['both_0',['BOTH',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaa627abe5a430420baf29ebe1940a7f2fb',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_2.js b/grin/docs/_build/doxygen/html/search/all_2.js new file mode 100644 index 000000000..fd80d60fd --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['column_5fstore_5ftrait_0',['COLUMN_STORE_TRAIT',['../predefine_8h.html#a408d94da6105b6a6c508726da065e8b7',1,'predefine.h']]], + ['create_5frow_1',['create_row',['../propertytable_8h.html#a86a5c42d5ede169c6374b2434c8c1982',1,'propertytable.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_3.js b/grin/docs/_build/doxygen/html/search/all_3.js new file mode 100644 index 000000000..2981600e3 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_3.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['datatype_0',['DataType',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6',1,'predefine.h']]], + ['date32_1',['Date32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a32e9f594d9d89533ffad18df5536423e',1,'predefine.h']]], + ['date64_2',['Date64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ab51d5181af439511070862d786809269',1,'predefine.h']]], + ['destroy_5fvertex_5fproperty_3',['destroy_vertex_property',['../property_8h.html#a8e1467e6a4a322bb1761a17f779d0dbd',1,'property.h']]], + ['destroy_5fvertex_5fproperty_5ftable_4',['destroy_vertex_property_table',['../propertytable_8h.html#a01c1ba34a369590177ff90521755aac5',1,'propertytable.h']]], + ['direction_5',['Direction',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aa',1,'predefine.h']]], + ['double_6',['Double',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6afb7825ebed9ad96348ee8588d84db633',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_4.js b/grin/docs/_build/doxygen/html/search/all_4.js new file mode 100644 index 000000000..b68fcf548 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_4.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['enable_5fadjacent_5flist_0',['ENABLE_ADJACENT_LIST',['../predefine_8h.html#a470cf7c92d8839bff02a0409d2b7db30',1,'predefine.h']]], + ['enable_5fadjacent_5flist_5fiterator_1',['ENABLE_ADJACENT_LIST_ITERATOR',['../predefine_8h.html#ad4116d8ec1dc2f1cf553348f13b757a0',1,'predefine.h']]], + ['enable_5fedge_5flist_2',['ENABLE_EDGE_LIST',['../predefine_8h.html#ac7521994bc76d45695c1f83ac9ebbe10',1,'predefine.h']]], + ['enable_5fedge_5flist_5fiterator_3',['ENABLE_EDGE_LIST_ITERATOR',['../predefine_8h.html#a193c9b2d09d52d6c9f2a18af75b70074',1,'predefine.h']]], + ['enable_5fedge_5fref_4',['ENABLE_EDGE_REF',['../predefine_8h.html#a947197070bcf936da983899370331286',1,'predefine.h']]], + ['enable_5fgraph_5fpartition_5',['ENABLE_GRAPH_PARTITION',['../predefine_8h.html#a152141205611e26882f23df7a5f69d0a',1,'predefine.h']]], + ['enable_5fpredicate_6',['ENABLE_PREDICATE',['../predefine_8h.html#a0e931dc102cb72f9b6be1d65a5cf87e3',1,'predefine.h']]], + ['enable_5fvertex_5flist_7',['ENABLE_VERTEX_LIST',['../predefine_8h.html#a24ab9b872487b91605b42c2c2d2d33bd',1,'predefine.h']]], + ['enable_5fvertex_5flist_5fiterator_8',['ENABLE_VERTEX_LIST_ITERATOR',['../predefine_8h.html#a3047177510fa354ee7898825387289b7',1,'predefine.h']]], + ['enable_5fvertex_5fref_9',['ENABLE_VERTEX_REF',['../predefine_8h.html#a79e38008004615608e283c5f575df82e',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_5.js b/grin/docs/_build/doxygen/html/search/all_5.js new file mode 100644 index 000000000..4e566c5c7 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['filter_5fvertex_5flist_5fby_5flabel_0',['filter_vertex_list_by_label',['../label_8h.html#a3a6da911bce12049c0d97d99883889b8',1,'label.h']]], + ['float_1',['Float',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ad67b0ee7230dcecb610254e4e5e589cd',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_6.js b/grin/docs/_build/doxygen/html/search/all_6.js new file mode 100644 index 000000000..59b46bbb0 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_6.js @@ -0,0 +1,22 @@ +var searchData= +[ + ['get_5fdst_5ftypes_5ffrom_5fedge_5ftype_0',['get_dst_types_from_edge_type',['../type_8h.html#a00edf242478b7ddf519c24e318e5a61d',1,'type.h']]], + ['get_5fedge_5fproperties_5fby_5fname_1',['get_edge_properties_by_name',['../property_8h.html#a55bf3fc271e09ec398a17364c7826784',1,'property.h']]], + ['get_5fedge_5fproperty_5fby_5fname_2',['get_edge_property_by_name',['../property_8h.html#a002d96d3a1733e075d5a66feb3ad5e02',1,'property.h']]], + ['get_5fedge_5ftypes_5ffrom_5fvertex_5ftype_5fpair_3',['get_edge_types_from_vertex_type_pair',['../type_8h.html#a1705ee27fa9ec2a12d1a4d3700387c8f',1,'type.h']]], + ['get_5fprimary_5fkeys_5fby_5fvertex_5ftype_4',['get_primary_keys_by_vertex_type',['../primarykey_8h.html#ae314c22d353c03bffaf62ea0ba69c491',1,'primarykey.h']]], + ['get_5frow_5ffrom_5fvertex_5fproperty_5ftable_5',['get_row_from_vertex_property_table',['../propertytable_8h.html#a0d727fb5c0a961df0f87c4b128463956',1,'propertytable.h']]], + ['get_5fsrc_5ftypes_5ffrom_5fedge_5ftype_6',['get_src_types_from_edge_type',['../type_8h.html#acedf36dd7ba7c4af1b080de8ffa246d2',1,'type.h']]], + ['get_5fvalue_5ffrom_5frow_7',['get_value_from_row',['../propertytable_8h.html#a23f95e06bdec368337c1ccfbadde97d9',1,'propertytable.h']]], + ['get_5fvalue_5ffrom_5fvertex_5fproperty_5ftable_8',['get_value_from_vertex_property_table',['../propertytable_8h.html#a4116b4fe6d95991db646b0e99d6fbd9f',1,'propertytable.h']]], + ['get_5fvertex_5fby_5fprimay_5fkeys_9',['get_vertex_by_primay_keys',['../primarykey_8h.html#addda3be6a980086d6b25db1a82a89511',1,'primarykey.h']]], + ['get_5fvertex_5flabel_5flist_10',['get_vertex_label_list',['../label_8h.html#a34138b59b44f405f346a48fd4f72ff2c',1,'label.h']]], + ['get_5fvertex_5flist_5fby_5flabel_11',['get_vertex_list_by_label',['../label_8h.html#a3644dc6bfcee62f9183bd89422e6c19e',1,'label.h']]], + ['get_5fvertex_5fproperties_5fby_5fname_12',['get_vertex_properties_by_name',['../property_8h.html#a33bb22d6ad61e86d1963ef9710993537',1,'property.h']]], + ['get_5fvertex_5fproperty_5fby_5fname_13',['get_vertex_property_by_name',['../property_8h.html#afb3122e6b577a4b2117aec43d6499f58',1,'property.h']]], + ['get_5fvertex_5fproperty_5fdata_5ftype_14',['get_vertex_property_data_type',['../property_8h.html#a7d1719a4d15cb72cf235dd6bc5701d25',1,'property.h']]], + ['get_5fvertex_5fproperty_5ftable_5fby_5ftype_15',['get_vertex_property_table_by_type',['../propertytable_8h.html#ac9bc9b9015469cbd548f5d033ef6d5cb',1,'propertytable.h']]], + ['get_5fvertex_5fproperty_5fvertex_5ftype_16',['get_vertex_property_vertex_type',['../property_8h.html#a387695bec35c802bf4a7f6b7362f6e91',1,'property.h']]], + ['get_5fvertex_5ftypes_5fwith_5fprimary_5fkeys_17',['get_vertex_types_with_primary_keys',['../primarykey_8h.html#a6668fc8add629c0aa384b134843d4de8',1,'primarykey.h']]], + ['grin_18',['GRIN',['../index.html',1,'']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_7.js b/grin/docs/_build/doxygen/html/search/all_7.js new file mode 100644 index 000000000..98af1f3ea --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_7.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['in_0',['IN',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaaf3180515f5867a29932df1dc207b31ad',1,'predefine.h']]], + ['insert_5fvalue_5fto_5frow_1',['insert_value_to_row',['../propertytable_8h.html#a36d2dd0c3492ee17c3c7a58d5534cf7e',1,'propertytable.h']]], + ['int32_2',['Int32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a788a72ddbf1bd572b3fcd7a5e7ec8cff',1,'predefine.h']]], + ['int64_3',['Int64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ada475947399b8ab4d13d40fea50f950c',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_8.js b/grin/docs/_build/doxygen/html/search/all_8.js new file mode 100644 index 000000000..47bf2326d --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_8.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['label_2eh_0',['label.h',['../label_8h.html',1,'']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_9.js b/grin/docs/_build/doxygen/html/search/all_9.js new file mode 100644 index 000000000..66cfbd7a4 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_9.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['natural_5fpartition_5fid_5ftrait_0',['NATURAL_PARTITION_ID_TRAIT',['../predefine_8h.html#a0705ed8c61f68b297c2bfee1ef9324f3',1,'predefine.h']]], + ['natural_5fvertex_5fproperty_5fid_5ftrait_1',['NATURAL_VERTEX_PROPERTY_ID_TRAIT',['../predefine_8h.html#a6274cf30a5a13b8a651e038a066d7b4b',1,'predefine.h']]], + ['natural_5fvertex_5ftype_5fid_5ftrait_2',['NATURAL_VERTEX_TYPE_ID_TRAIT',['../predefine_8h.html#a14e2e67fdc843840df342c5cc5d838ba',1,'predefine.h']]], + ['null_5fedge_3',['NULL_EDGE',['../predefine_8h.html#af645ccbab4871128dbaed2a1828cdbef',1,'predefine.h']]], + ['null_5fedge_5fref_4',['NULL_EDGE_REF',['../predefine_8h.html#ac8dec862f065b60acf3e3f15b4fa97d4',1,'predefine.h']]], + ['null_5fedge_5ftype_5',['NULL_EDGE_TYPE',['../predefine_8h.html#acbc160e12d961cf5bae4d0a65574b94c',1,'predefine.h']]], + ['null_5fgraph_6',['NULL_GRAPH',['../predefine_8h.html#acf65bb3a1ad2164ea7eaa8829cb43420',1,'predefine.h']]], + ['null_5flist_7',['NULL_LIST',['../predefine_8h.html#a29aa3c78422ac30f2619b7bd2e1ce3fa',1,'predefine.h']]], + ['null_5fnatural_5fid_8',['NULL_NATURAL_ID',['../predefine_8h.html#af80bb749627dfbcd7c693f7d3d288025',1,'predefine.h']]], + ['null_5fpartition_9',['NULL_PARTITION',['../predefine_8h.html#ae2067f14aabaa8ce09bc058bb9d75683',1,'predefine.h']]], + ['null_5fproperty_10',['NULL_PROPERTY',['../predefine_8h.html#a1a12a4b9cde223311f79ab4d2237a947',1,'predefine.h']]], + ['null_5frow_11',['NULL_ROW',['../predefine_8h.html#a49149212bd213f323ede9d8b2dcb22d0',1,'predefine.h']]], + ['null_5ftype_12',['NULL_TYPE',['../predefine_8h.html#a27a1fcb44e6a426c50b3a854ba584b78',1,'predefine.h']]], + ['null_5fvertex_13',['NULL_VERTEX',['../predefine_8h.html#ac3c33c45c396860b76e8aff4dd2b8158',1,'predefine.h']]], + ['null_5fvertex_5fref_14',['NULL_VERTEX_REF',['../predefine_8h.html#a926c85777b43e74bfbc11181a95ab41b',1,'predefine.h']]], + ['null_5fvertex_5ftype_15',['NULL_VERTEX_TYPE',['../predefine_8h.html#a0a429637d65deffeda136e37b8f39533',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_a.js b/grin/docs/_build/doxygen/html/search/all_a.js new file mode 100644 index 000000000..9a8886eb5 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_a.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['out_0',['OUT',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaac72cb4ba9e379a25e80f157177dbe2b8',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_b.js b/grin/docs/_build/doxygen/html/search/all_b.js new file mode 100644 index 000000000..f55d17bae --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_b.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['predefine_2eh_0',['predefine.h',['../predefine_8h.html',1,'']]], + ['primarykey_2eh_1',['primarykey.h',['../primarykey_8h.html',1,'']]], + ['property_2eh_2',['property.h',['../property_8h.html',1,'']]], + ['propertylist_2eh_3',['propertylist.h',['../propertylist_8h.html',1,'']]], + ['propertytable_2eh_4',['propertytable.h',['../propertytable_8h.html',1,'']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_c.js b/grin/docs/_build/doxygen/html/search/all_c.js new file mode 100644 index 000000000..54268142b --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_c.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['select_5fedge_5fproperteis_0',['select_edge_properteis',['../propertylist_8h.html#aa019e8824f19dbb563b5b1fdb091996e',1,'propertylist.h']]], + ['select_5fvertex_5fproperties_1',['select_vertex_properties',['../propertylist_8h.html#a7d70dbf74489c1a5f0f7f001c9682858',1,'propertylist.h']]], + ['string_2',['String',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ade17ec82ff106e0c2b4417f5ca231eae',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_d.js b/grin/docs/_build/doxygen/html/search/all_d.js new file mode 100644 index 000000000..baae2b481 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_d.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['type_2eh_0',['type.h',['../type_8h.html',1,'']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_e.js b/grin/docs/_build/doxygen/html/search/all_e.js new file mode 100644 index 000000000..ed92d791a --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_e.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['uint32_0',['UInt32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a57352c749ab6266701ed87613213e299',1,'predefine.h']]], + ['uint64_1',['UInt64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a0389a3fa2d3f7cb04de69cca4e9b1d95',1,'predefine.h']]], + ['undefined_2',['Undefined',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a18f893264a00711081b62de694f99db4',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/all_f.js b/grin/docs/_build/doxygen/html/search/all_f.js new file mode 100644 index 000000000..520b83d47 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/all_f.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['with_5fedge_5fdata_0',['WITH_EDGE_DATA',['../predefine_8h.html#aa195a26dc2d6e7b6a2b5692475ac0fd0',1,'predefine.h']]], + ['with_5flabel_1',['WITH_LABEL',['../predefine_8h.html#a3c0bf1209e6c115197d23be31cc371e6',1,'predefine.h']]], + ['with_5fproperty_5fname_2',['WITH_PROPERTY_NAME',['../predefine_8h.html#ac2959315e70197f976d6b92ea2d0a315',1,'predefine.h']]], + ['with_5fvertex_5fdata_3',['WITH_VERTEX_DATA',['../predefine_8h.html#a5511455528a5a200dd03335c2a553364',1,'predefine.h']]], + ['with_5fvertex_5foriginal_5fid_4',['WITH_VERTEX_ORIGINAL_ID',['../predefine_8h.html#adbd707ffa90aa7c694065aaacfdd1226',1,'predefine.h']]], + ['with_5fvertex_5fprimarty_5fkeys_5',['WITH_VERTEX_PRIMARTY_KEYS',['../predefine_8h.html#a8a8fb8ef0bdeabf5e6f0b6b747b70a4f',1,'predefine.h']]], + ['with_5fvertex_5fproperty_6',['WITH_VERTEX_PROPERTY',['../predefine_8h.html#a18e45c40c5c01532d2705e583a898ddb',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/close.svg b/grin/docs/_build/doxygen/html/search/close.svg new file mode 100644 index 000000000..a933eea1a --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/close.svg @@ -0,0 +1,31 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/grin/docs/_build/doxygen/html/search/defines_0.js b/grin/docs/_build/doxygen/html/search/defines_0.js new file mode 100644 index 000000000..2c1686df4 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/defines_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['column_5fstore_5ftrait_0',['COLUMN_STORE_TRAIT',['../predefine_8h.html#a408d94da6105b6a6c508726da065e8b7',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/defines_1.js b/grin/docs/_build/doxygen/html/search/defines_1.js new file mode 100644 index 000000000..b68fcf548 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/defines_1.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['enable_5fadjacent_5flist_0',['ENABLE_ADJACENT_LIST',['../predefine_8h.html#a470cf7c92d8839bff02a0409d2b7db30',1,'predefine.h']]], + ['enable_5fadjacent_5flist_5fiterator_1',['ENABLE_ADJACENT_LIST_ITERATOR',['../predefine_8h.html#ad4116d8ec1dc2f1cf553348f13b757a0',1,'predefine.h']]], + ['enable_5fedge_5flist_2',['ENABLE_EDGE_LIST',['../predefine_8h.html#ac7521994bc76d45695c1f83ac9ebbe10',1,'predefine.h']]], + ['enable_5fedge_5flist_5fiterator_3',['ENABLE_EDGE_LIST_ITERATOR',['../predefine_8h.html#a193c9b2d09d52d6c9f2a18af75b70074',1,'predefine.h']]], + ['enable_5fedge_5fref_4',['ENABLE_EDGE_REF',['../predefine_8h.html#a947197070bcf936da983899370331286',1,'predefine.h']]], + ['enable_5fgraph_5fpartition_5',['ENABLE_GRAPH_PARTITION',['../predefine_8h.html#a152141205611e26882f23df7a5f69d0a',1,'predefine.h']]], + ['enable_5fpredicate_6',['ENABLE_PREDICATE',['../predefine_8h.html#a0e931dc102cb72f9b6be1d65a5cf87e3',1,'predefine.h']]], + ['enable_5fvertex_5flist_7',['ENABLE_VERTEX_LIST',['../predefine_8h.html#a24ab9b872487b91605b42c2c2d2d33bd',1,'predefine.h']]], + ['enable_5fvertex_5flist_5fiterator_8',['ENABLE_VERTEX_LIST_ITERATOR',['../predefine_8h.html#a3047177510fa354ee7898825387289b7',1,'predefine.h']]], + ['enable_5fvertex_5fref_9',['ENABLE_VERTEX_REF',['../predefine_8h.html#a79e38008004615608e283c5f575df82e',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/defines_2.js b/grin/docs/_build/doxygen/html/search/defines_2.js new file mode 100644 index 000000000..66cfbd7a4 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/defines_2.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['natural_5fpartition_5fid_5ftrait_0',['NATURAL_PARTITION_ID_TRAIT',['../predefine_8h.html#a0705ed8c61f68b297c2bfee1ef9324f3',1,'predefine.h']]], + ['natural_5fvertex_5fproperty_5fid_5ftrait_1',['NATURAL_VERTEX_PROPERTY_ID_TRAIT',['../predefine_8h.html#a6274cf30a5a13b8a651e038a066d7b4b',1,'predefine.h']]], + ['natural_5fvertex_5ftype_5fid_5ftrait_2',['NATURAL_VERTEX_TYPE_ID_TRAIT',['../predefine_8h.html#a14e2e67fdc843840df342c5cc5d838ba',1,'predefine.h']]], + ['null_5fedge_3',['NULL_EDGE',['../predefine_8h.html#af645ccbab4871128dbaed2a1828cdbef',1,'predefine.h']]], + ['null_5fedge_5fref_4',['NULL_EDGE_REF',['../predefine_8h.html#ac8dec862f065b60acf3e3f15b4fa97d4',1,'predefine.h']]], + ['null_5fedge_5ftype_5',['NULL_EDGE_TYPE',['../predefine_8h.html#acbc160e12d961cf5bae4d0a65574b94c',1,'predefine.h']]], + ['null_5fgraph_6',['NULL_GRAPH',['../predefine_8h.html#acf65bb3a1ad2164ea7eaa8829cb43420',1,'predefine.h']]], + ['null_5flist_7',['NULL_LIST',['../predefine_8h.html#a29aa3c78422ac30f2619b7bd2e1ce3fa',1,'predefine.h']]], + ['null_5fnatural_5fid_8',['NULL_NATURAL_ID',['../predefine_8h.html#af80bb749627dfbcd7c693f7d3d288025',1,'predefine.h']]], + ['null_5fpartition_9',['NULL_PARTITION',['../predefine_8h.html#ae2067f14aabaa8ce09bc058bb9d75683',1,'predefine.h']]], + ['null_5fproperty_10',['NULL_PROPERTY',['../predefine_8h.html#a1a12a4b9cde223311f79ab4d2237a947',1,'predefine.h']]], + ['null_5frow_11',['NULL_ROW',['../predefine_8h.html#a49149212bd213f323ede9d8b2dcb22d0',1,'predefine.h']]], + ['null_5ftype_12',['NULL_TYPE',['../predefine_8h.html#a27a1fcb44e6a426c50b3a854ba584b78',1,'predefine.h']]], + ['null_5fvertex_13',['NULL_VERTEX',['../predefine_8h.html#ac3c33c45c396860b76e8aff4dd2b8158',1,'predefine.h']]], + ['null_5fvertex_5fref_14',['NULL_VERTEX_REF',['../predefine_8h.html#a926c85777b43e74bfbc11181a95ab41b',1,'predefine.h']]], + ['null_5fvertex_5ftype_15',['NULL_VERTEX_TYPE',['../predefine_8h.html#a0a429637d65deffeda136e37b8f39533',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/defines_3.js b/grin/docs/_build/doxygen/html/search/defines_3.js new file mode 100644 index 000000000..520b83d47 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/defines_3.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['with_5fedge_5fdata_0',['WITH_EDGE_DATA',['../predefine_8h.html#aa195a26dc2d6e7b6a2b5692475ac0fd0',1,'predefine.h']]], + ['with_5flabel_1',['WITH_LABEL',['../predefine_8h.html#a3c0bf1209e6c115197d23be31cc371e6',1,'predefine.h']]], + ['with_5fproperty_5fname_2',['WITH_PROPERTY_NAME',['../predefine_8h.html#ac2959315e70197f976d6b92ea2d0a315',1,'predefine.h']]], + ['with_5fvertex_5fdata_3',['WITH_VERTEX_DATA',['../predefine_8h.html#a5511455528a5a200dd03335c2a553364',1,'predefine.h']]], + ['with_5fvertex_5foriginal_5fid_4',['WITH_VERTEX_ORIGINAL_ID',['../predefine_8h.html#adbd707ffa90aa7c694065aaacfdd1226',1,'predefine.h']]], + ['with_5fvertex_5fprimarty_5fkeys_5',['WITH_VERTEX_PRIMARTY_KEYS',['../predefine_8h.html#a8a8fb8ef0bdeabf5e6f0b6b747b70a4f',1,'predefine.h']]], + ['with_5fvertex_5fproperty_6',['WITH_VERTEX_PROPERTY',['../predefine_8h.html#a18e45c40c5c01532d2705e583a898ddb',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/enums_0.js b/grin/docs/_build/doxygen/html/search/enums_0.js new file mode 100644 index 000000000..601605b3a --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/enums_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['datatype_0',['DataType',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6',1,'predefine.h']]], + ['direction_1',['Direction',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aa',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_0.js b/grin/docs/_build/doxygen/html/search/enumvalues_0.js new file mode 100644 index 000000000..46cd1debe --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/enumvalues_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['both_0',['BOTH',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaa627abe5a430420baf29ebe1940a7f2fb',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_1.js b/grin/docs/_build/doxygen/html/search/enumvalues_1.js new file mode 100644 index 000000000..de292f1fd --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/enumvalues_1.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['date32_0',['Date32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a32e9f594d9d89533ffad18df5536423e',1,'predefine.h']]], + ['date64_1',['Date64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ab51d5181af439511070862d786809269',1,'predefine.h']]], + ['double_2',['Double',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6afb7825ebed9ad96348ee8588d84db633',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_2.js b/grin/docs/_build/doxygen/html/search/enumvalues_2.js new file mode 100644 index 000000000..73c49a177 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/enumvalues_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['float_0',['Float',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ad67b0ee7230dcecb610254e4e5e589cd',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_3.js b/grin/docs/_build/doxygen/html/search/enumvalues_3.js new file mode 100644 index 000000000..00ed7087a --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/enumvalues_3.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['in_0',['IN',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaaf3180515f5867a29932df1dc207b31ad',1,'predefine.h']]], + ['int32_1',['Int32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a788a72ddbf1bd572b3fcd7a5e7ec8cff',1,'predefine.h']]], + ['int64_2',['Int64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ada475947399b8ab4d13d40fea50f950c',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_4.js b/grin/docs/_build/doxygen/html/search/enumvalues_4.js new file mode 100644 index 000000000..9a8886eb5 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/enumvalues_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['out_0',['OUT',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaac72cb4ba9e379a25e80f157177dbe2b8',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_5.js b/grin/docs/_build/doxygen/html/search/enumvalues_5.js new file mode 100644 index 000000000..8b867959b --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/enumvalues_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['string_0',['String',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ade17ec82ff106e0c2b4417f5ca231eae',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_6.js b/grin/docs/_build/doxygen/html/search/enumvalues_6.js new file mode 100644 index 000000000..ed92d791a --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/enumvalues_6.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['uint32_0',['UInt32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a57352c749ab6266701ed87613213e299',1,'predefine.h']]], + ['uint64_1',['UInt64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a0389a3fa2d3f7cb04de69cca4e9b1d95',1,'predefine.h']]], + ['undefined_2',['Undefined',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a18f893264a00711081b62de694f99db4',1,'predefine.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/files_0.js b/grin/docs/_build/doxygen/html/search/files_0.js new file mode 100644 index 000000000..47bf2326d --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/files_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['label_2eh_0',['label.h',['../label_8h.html',1,'']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/files_1.js b/grin/docs/_build/doxygen/html/search/files_1.js new file mode 100644 index 000000000..f55d17bae --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/files_1.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['predefine_2eh_0',['predefine.h',['../predefine_8h.html',1,'']]], + ['primarykey_2eh_1',['primarykey.h',['../primarykey_8h.html',1,'']]], + ['property_2eh_2',['property.h',['../property_8h.html',1,'']]], + ['propertylist_2eh_3',['propertylist.h',['../propertylist_8h.html',1,'']]], + ['propertytable_2eh_4',['propertytable.h',['../propertytable_8h.html',1,'']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/files_2.js b/grin/docs/_build/doxygen/html/search/files_2.js new file mode 100644 index 000000000..baae2b481 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/files_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['type_2eh_0',['type.h',['../type_8h.html',1,'']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/functions_0.js b/grin/docs/_build/doxygen/html/search/functions_0.js new file mode 100644 index 000000000..5c11d88fc --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/functions_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['assign_5flabel_5fto_5fvertex_0',['assign_label_to_vertex',['../label_8h.html#a8091acf655961c1b66933945feac27f3',1,'label.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/functions_1.js b/grin/docs/_build/doxygen/html/search/functions_1.js new file mode 100644 index 000000000..8c9eff410 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/functions_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['create_5frow_0',['create_row',['../propertytable_8h.html#a86a5c42d5ede169c6374b2434c8c1982',1,'propertytable.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/functions_2.js b/grin/docs/_build/doxygen/html/search/functions_2.js new file mode 100644 index 000000000..e9e9c3d69 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/functions_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['destroy_5fvertex_5fproperty_0',['destroy_vertex_property',['../property_8h.html#a8e1467e6a4a322bb1761a17f779d0dbd',1,'property.h']]], + ['destroy_5fvertex_5fproperty_5ftable_1',['destroy_vertex_property_table',['../propertytable_8h.html#a01c1ba34a369590177ff90521755aac5',1,'propertytable.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/functions_3.js b/grin/docs/_build/doxygen/html/search/functions_3.js new file mode 100644 index 000000000..3f526cab3 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/functions_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['filter_5fvertex_5flist_5fby_5flabel_0',['filter_vertex_list_by_label',['../label_8h.html#a3a6da911bce12049c0d97d99883889b8',1,'label.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/functions_4.js b/grin/docs/_build/doxygen/html/search/functions_4.js new file mode 100644 index 000000000..ba7177d6d --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/functions_4.js @@ -0,0 +1,21 @@ +var searchData= +[ + ['get_5fdst_5ftypes_5ffrom_5fedge_5ftype_0',['get_dst_types_from_edge_type',['../type_8h.html#a00edf242478b7ddf519c24e318e5a61d',1,'type.h']]], + ['get_5fedge_5fproperties_5fby_5fname_1',['get_edge_properties_by_name',['../property_8h.html#a55bf3fc271e09ec398a17364c7826784',1,'property.h']]], + ['get_5fedge_5fproperty_5fby_5fname_2',['get_edge_property_by_name',['../property_8h.html#a002d96d3a1733e075d5a66feb3ad5e02',1,'property.h']]], + ['get_5fedge_5ftypes_5ffrom_5fvertex_5ftype_5fpair_3',['get_edge_types_from_vertex_type_pair',['../type_8h.html#a1705ee27fa9ec2a12d1a4d3700387c8f',1,'type.h']]], + ['get_5fprimary_5fkeys_5fby_5fvertex_5ftype_4',['get_primary_keys_by_vertex_type',['../primarykey_8h.html#ae314c22d353c03bffaf62ea0ba69c491',1,'primarykey.h']]], + ['get_5frow_5ffrom_5fvertex_5fproperty_5ftable_5',['get_row_from_vertex_property_table',['../propertytable_8h.html#a0d727fb5c0a961df0f87c4b128463956',1,'propertytable.h']]], + ['get_5fsrc_5ftypes_5ffrom_5fedge_5ftype_6',['get_src_types_from_edge_type',['../type_8h.html#acedf36dd7ba7c4af1b080de8ffa246d2',1,'type.h']]], + ['get_5fvalue_5ffrom_5frow_7',['get_value_from_row',['../propertytable_8h.html#a23f95e06bdec368337c1ccfbadde97d9',1,'propertytable.h']]], + ['get_5fvalue_5ffrom_5fvertex_5fproperty_5ftable_8',['get_value_from_vertex_property_table',['../propertytable_8h.html#a4116b4fe6d95991db646b0e99d6fbd9f',1,'propertytable.h']]], + ['get_5fvertex_5fby_5fprimay_5fkeys_9',['get_vertex_by_primay_keys',['../primarykey_8h.html#addda3be6a980086d6b25db1a82a89511',1,'primarykey.h']]], + ['get_5fvertex_5flabel_5flist_10',['get_vertex_label_list',['../label_8h.html#a34138b59b44f405f346a48fd4f72ff2c',1,'label.h']]], + ['get_5fvertex_5flist_5fby_5flabel_11',['get_vertex_list_by_label',['../label_8h.html#a3644dc6bfcee62f9183bd89422e6c19e',1,'label.h']]], + ['get_5fvertex_5fproperties_5fby_5fname_12',['get_vertex_properties_by_name',['../property_8h.html#a33bb22d6ad61e86d1963ef9710993537',1,'property.h']]], + ['get_5fvertex_5fproperty_5fby_5fname_13',['get_vertex_property_by_name',['../property_8h.html#afb3122e6b577a4b2117aec43d6499f58',1,'property.h']]], + ['get_5fvertex_5fproperty_5fdata_5ftype_14',['get_vertex_property_data_type',['../property_8h.html#a7d1719a4d15cb72cf235dd6bc5701d25',1,'property.h']]], + ['get_5fvertex_5fproperty_5ftable_5fby_5ftype_15',['get_vertex_property_table_by_type',['../propertytable_8h.html#ac9bc9b9015469cbd548f5d033ef6d5cb',1,'propertytable.h']]], + ['get_5fvertex_5fproperty_5fvertex_5ftype_16',['get_vertex_property_vertex_type',['../property_8h.html#a387695bec35c802bf4a7f6b7362f6e91',1,'property.h']]], + ['get_5fvertex_5ftypes_5fwith_5fprimary_5fkeys_17',['get_vertex_types_with_primary_keys',['../primarykey_8h.html#a6668fc8add629c0aa384b134843d4de8',1,'primarykey.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/functions_5.js b/grin/docs/_build/doxygen/html/search/functions_5.js new file mode 100644 index 000000000..768edaa85 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/functions_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['insert_5fvalue_5fto_5frow_0',['insert_value_to_row',['../propertytable_8h.html#a36d2dd0c3492ee17c3c7a58d5534cf7e',1,'propertytable.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/functions_6.js b/grin/docs/_build/doxygen/html/search/functions_6.js new file mode 100644 index 000000000..acfd8b62d --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/functions_6.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['select_5fedge_5fproperteis_0',['select_edge_properteis',['../propertylist_8h.html#aa019e8824f19dbb563b5b1fdb091996e',1,'propertylist.h']]], + ['select_5fvertex_5fproperties_1',['select_vertex_properties',['../propertylist_8h.html#a7d70dbf74489c1a5f0f7f001c9682858',1,'propertylist.h']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/groups_0.js b/grin/docs/_build/doxygen/html/search/groups_0.js new file mode 100644 index 000000000..84e9c6a43 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/groups_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['null_20values_0',['Null Values',['../group__nv.html',1,'']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/mag.svg b/grin/docs/_build/doxygen/html/search/mag.svg new file mode 100644 index 000000000..9f46b301e --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/mag.svg @@ -0,0 +1,37 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/grin/docs/_build/doxygen/html/search/mag_d.svg b/grin/docs/_build/doxygen/html/search/mag_d.svg new file mode 100644 index 000000000..b9a814c78 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/mag_d.svg @@ -0,0 +1,37 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/grin/docs/_build/doxygen/html/search/mag_sel.svg b/grin/docs/_build/doxygen/html/search/mag_sel.svg new file mode 100644 index 000000000..03626f64a --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/mag_sel.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/grin/docs/_build/doxygen/html/search/mag_seld.svg b/grin/docs/_build/doxygen/html/search/mag_seld.svg new file mode 100644 index 000000000..6e720dcc9 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/mag_seld.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/grin/docs/_build/doxygen/html/search/pages_0.js b/grin/docs/_build/doxygen/html/search/pages_0.js new file mode 100644 index 000000000..647473420 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/pages_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['grin_0',['GRIN',['../index.html',1,'']]] +]; diff --git a/grin/docs/_build/doxygen/html/search/search.css b/grin/docs/_build/doxygen/html/search/search.css new file mode 100644 index 000000000..19f76f9d5 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/search.css @@ -0,0 +1,291 @@ +/*---------------- Search Box positioning */ + +#main-menu > li:last-child { + /* This
  • object is the parent of the search bar */ + display: flex; + justify-content: center; + align-items: center; + height: 36px; + margin-right: 1em; +} + +/*---------------- Search box styling */ + +.SRPage * { + font-weight: normal; + line-height: normal; +} + +dark-mode-toggle { + margin-left: 5px; + display: flex; + float: right; +} + +#MSearchBox { + display: inline-block; + white-space : nowrap; + background: var(--search-background-color); + border-radius: 0.65em; + box-shadow: var(--search-box-shadow); + z-index: 102; +} + +#MSearchBox .left { + display: inline-block; + vertical-align: middle; + height: 1.4em; +} + +#MSearchSelect { + display: inline-block; + vertical-align: middle; + width: 20px; + height: 19px; + background-image: var(--search-magnification-select-image); + margin: 0 0 0 0.3em; + padding: 0; +} + +#MSearchSelectExt { + display: inline-block; + vertical-align: middle; + width: 10px; + height: 19px; + background-image: var(--search-magnification-image); + margin: 0 0 0 0.5em; + padding: 0; +} + + +#MSearchField { + display: inline-block; + vertical-align: middle; + width: 7.5em; + height: 19px; + margin: 0 0.15em; + padding: 0; + line-height: 1em; + border:none; + color: var(--search-foreground-color); + outline: none; + font-family: var(--font-family-search); + -webkit-border-radius: 0px; + border-radius: 0px; + background: none; +} + +@media(hover: none) { + /* to avoid zooming on iOS */ + #MSearchField { + font-size: 16px; + } +} + +#MSearchBox .right { + display: inline-block; + vertical-align: middle; + width: 1.4em; + height: 1.4em; +} + +#MSearchClose { + display: none; + font-size: inherit; + background : none; + border: none; + margin: 0; + padding: 0; + outline: none; + +} + +#MSearchCloseImg { + padding: 0.3em; + margin: 0; +} + +.MSearchBoxActive #MSearchField { + color: var(--search-active-color); +} + + + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid var(--search-filter-border-color); + background-color: var(--search-filter-background-color); + z-index: 10001; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt var(--font-family-search); + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: var(--font-family-monospace); + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: var(--search-filter-foreground-color); + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: var(--search-filter-foreground-color); + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: var(--search-filter-highlight-text-color); + background-color: var(--search-filter-highlight-bg-color); + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + /*width: 60ex;*/ + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid var(--search-results-border-color); + background-color: var(--search-results-background-color); + z-index:10000; + width: 300px; + height: 400px; + overflow: auto; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +div.SRPage { + margin: 5px 2px; + background-color: var(--search-results-background-color); +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: var(--search-results-foreground-color); + font-family: var(--font-family-search); + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: var(--search-results-foreground-color); + font-family: var(--font-family-search); + font-size: 8pt; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; + font-family: var(--font-family-search); +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; + font-family: var(--font-family-search); +} + +.SRResult { + display: none; +} + +div.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: var(--nav-gradient-active-image-parent); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/grin/docs/_build/doxygen/html/search/search.js b/grin/docs/_build/doxygen/html/search/search.js new file mode 100644 index 000000000..e103a2621 --- /dev/null +++ b/grin/docs/_build/doxygen/html/search/search.js @@ -0,0 +1,816 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function convertToId(search) +{ + var result = ''; + for (i=0;i do a search + { + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) // Up + { + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } + else if (e.keyCode==13 || e.keyCode==27) + { + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() + { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() + { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() + { + this.keyTimeout = 0; + + // strip leading whitespace + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + var code = searchValue.toLowerCase().charCodeAt(0); + var idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair + { + idxChar = searchValue.substr(0, 2); + } + + var jsFile; + + var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) + { + var hexCode=idx.toString(16); + jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; + } + + var loadJS = function(url, impl, loc){ + var scriptTag = document.createElement('script'); + scriptTag.src = url; + scriptTag.onload = impl; + scriptTag.onreadystatechange = impl; + loc.appendChild(scriptTag); + } + + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + var domSearchBox = this.DOMSearchBox(); + var domPopupSearchResults = this.DOMPopupSearchResults(); + var domSearchClose = this.DOMSearchClose(); + var resultsPath = this.resultsPath; + + var handleResults = function() { + document.getElementById("Loading").style.display="none"; + if (typeof searchData !== 'undefined') { + createResults(resultsPath); + document.getElementById("NoMatches").style.display="none"; + } + + searchResults.Search(searchValue); + + if (domPopupSearchResultsWindow.style.display!='block') + { + domSearchClose.style.display = 'inline-block'; + var left = getXPos(domSearchBox) + 150; + var top = getYPos(domSearchBox) + 20; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + var maxWidth = document.body.clientWidth; + var maxHeight = document.body.clientHeight; + var width = 300; + if (left<10) left=10; + if (width+left+8>maxWidth) width=maxWidth-left-8; + var height = 400; + if (height+top+8>maxHeight) height=maxHeight-top-8; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResultsWindow.style.height = height + 'px'; + } + } + + if (jsFile) { + loadJS(jsFile, handleResults, this.DOMPopupSearchResultsWindow()); + } else { + handleResults(); + } + + this.lastSearchValue = searchValue; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) + { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { + this.DOMSearchBox().className = 'MSearchBoxActive'; + this.searchActive = true; + } + else if (!isActive) // directly remove the panel + { + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + this.DOMSearchField().value = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') + { + return element; + } + + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; + } + else + { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; + } + } + } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; + } +} + +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} + +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} + +function createResults(resultsPath) +{ + var results = document.getElementById("SRResults"); + results.innerHTML = ''; + for (var e=0; e-{AmhX=Jf(#6djGiuzAr*{o?=JLmPLyc> z_*`QK&+BH@jWrYJ7>r6%keRM@)Qyv8R=enp0jiI>aWlGyB58O zFVR20d+y`K7vDw(hJF3;>dD*3-?v=<8M)@x|EEGLnJsniYK!2U1 Y!`|5biEc?d1`HDhPgg&ebxsLQ02F6;9RL6T literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/splitbard.png b/grin/docs/_build/doxygen/html/splitbard.png new file mode 100644 index 0000000000000000000000000000000000000000..8367416d757fd7b6dc4272b6432dc75a75abd068 GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^Yzz!63>-{AmhX=Jf@VhhFKy35^fiT zT~&lUj3=cDh^%3HDY9k5CEku}PHXNoNC(_$U3XPb&Q*ME25pT;2(*BOgAf<+R$lzakPG`kF31()Fx{L5Wrac|GQzjeE= zueY1`Ze{#x<8=S|`~MgGetGce)#vN&|J{Cd^tS%;tBYTo?+^d68<#n_Y_xx`J||4O V@QB{^CqU0Kc)I$ztaD0e0svEzbJzd? literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/structure_8h_source.html b/grin/docs/_build/doxygen/html/structure_8h_source.html new file mode 100644 index 000000000..061f39802 --- /dev/null +++ b/grin/docs/_build/doxygen/html/structure_8h_source.html @@ -0,0 +1,151 @@ + + + + + + + +GRIN: include/topology/structure.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    structure.h
    +
    +
    +
    1
    +
    16#ifndef GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_
    +
    17#define GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_
    +
    18
    +
    19#include "../predefine.h"
    +
    20
    +
    21// Graph
    +
    22bool is_directed(const Graph);
    +
    23
    +
    24bool is_multigraph(const Graph);
    +
    25
    +
    26size_t get_vertex_num(const Graph);
    +
    27
    +
    28#ifdef WITH_VERTEX_PROPERTY
    +
    29size_t get_vertex_num_by_type(const Graph, const VertexType);
    +
    30#endif
    +
    31
    +
    32size_t get_edge_num(const Graph);
    +
    33
    +
    34#ifdef WITH_EDGE_PROPERTY
    +
    35size_t get_edge_num_by_type(const Graph, const EdgeType);
    +
    36#endif
    +
    37
    +
    38
    +
    39// Vertex
    +
    40void destroy_vertex(Vertex);
    +
    41
    +
    42#ifdef WITH_VERTEX_DATA
    +
    43DataType get_vertex_data_type(const Graph, const Vertex);
    +
    44
    +
    45VertexData get_vertex_data_value(const Graph, const Vertex);
    +
    46
    +
    47void destroy_vertex_data(VertexData);
    +
    48#endif
    +
    49
    +
    50#ifdef WITH_VERTEX_ORIGINAL_ID
    +
    51Vertex get_vertex_from_original_id(const Graph, const OriginalID);
    +
    52
    +
    53#ifdef WITH_VERTEX_PROPERTY
    +
    54Vertex get_vertex_from_type_original_id(const Graph, const VertexType, const OriginalID);
    +
    55#endif
    +
    56
    +
    57OriginalID get_vertex_original_id(const Graph, const Vertex);
    +
    58
    +
    59void destroy_vertex_original_id(OriginalID);
    +
    60#endif
    +
    61
    +
    62
    +
    63// Edge
    +
    64void destroy_edge(Edge);
    +
    65
    +
    66Vertex get_edge_src(const Graph, const Edge);
    +
    67
    +
    68Vertex get_edge_dst(const Graph, const Edge);
    +
    69
    +
    70#ifdef WITH_EDGE_DATA
    +
    71DataType get_edge_data_type(const Graph, const Edge);
    +
    72
    +
    73EdgeData get_edge_data_value(const Graph, const Edge);
    +
    74
    +
    75void destroy_edge_data(EdgeData);
    +
    76#endif
    +
    77
    +
    78#endif // GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_
    +
    DataType
    Enumerates the datatype supported in the storage.
    Definition: predefine.h:40
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/svgpan.js b/grin/docs/_build/doxygen/html/svgpan.js new file mode 100644 index 000000000..2678d3846 --- /dev/null +++ b/grin/docs/_build/doxygen/html/svgpan.js @@ -0,0 +1,323 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + The code below is based on SVGPan Library 1.2 and was modified for doxygen + to support both zooming and panning via the mouse and via embedded buttons. + + This code is licensed under the following BSD license: + + Copyright 2009-2010 Andrea Leofreddi . All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are + permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY Andrea Leofreddi ``AS IS'' AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Andrea Leofreddi OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + The views and conclusions contained in the software and documentation are those of the + authors and should not be interpreted as representing official policies, either expressed + or implied, of Andrea Leofreddi. + + @licend The above is the entire license notice for the JavaScript code in this file + */ + +var root = document.documentElement; +var state = 'none'; +var stateOrigin; +var stateTf = root.createSVGMatrix(); +var cursorGrab = ' url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAlQTFRFAAAA////////c3ilYwAAAAN0Uk5T//8A18oNQQAAAD1JREFUeNp0zlEKACAIA9Bt9z90bZBZkQj29qFBEuBOzQHSnWTTyckEfqUuZgFvslH4ch3qLCO/Kr8cAgwATw4Ax6XRCcoAAAAASUVORK5CYII="), move'; +var zoomSteps = 10; +var zoomInFactor; +var zoomOutFactor; +var windowWidth; +var windowHeight; +var svgDoc; +var minZoom; +var maxZoom; +if (!window) window=this; + +/** + * Show the graph in the middle of the view, scaled to fit + */ +function show() +{ + if (window.innerHeight) // Firefox + { + windowWidth = window.innerWidth; + windowHeight = window.innerHeight; + } + else if (document.documentElement.clientWidth) // Chrome/Safari + { + windowWidth = document.documentElement.clientWidth + windowHeight = document.documentElement.clientHeight + } + if (!windowWidth || !windowHeight) // failsafe + { + windowWidth = 800; + windowHeight = 600; + } + minZoom = Math.min(Math.min(viewHeight,windowHeight)/viewHeight,Math.min(viewWidth,windowWidth)/viewWidth); + maxZoom = minZoom+1.5; + zoomInFactor = Math.pow(maxZoom/minZoom,1.0/zoomSteps); + zoomOutFactor = 1.0/zoomInFactor; + + var g = svgDoc.getElementById('viewport'); + try + { + var bb = g.getBBox(); // this can throw an exception if css { display: none } + var tx = (windowWidth-viewWidth*minZoom+8)/(2*minZoom); + var ty = viewHeight+(windowHeight-viewHeight*minZoom)/(2*minZoom); + var a = 'scale('+minZoom+') rotate(0) translate('+tx+' '+ty+')'; + g.setAttribute('transform',a); + } + catch(e) {} +} + +/** + * Register handlers + */ +function init(evt) +{ + svgDoc = evt.target.ownerDocument; + try { + if (top.window && top.window.registerShow) { // register show function in html doc for dynamic sections + top.window.registerShow(sectionId,show); + } + } catch(e) { + // ugh, we are not allowed to talk to the parent; can happen with Chrome when viewing pages + // locally, since they treat every local page as having a different origin + } + show(); + + setAttributes(root, { + "onmousedown" : "handleMouseDown(evt)", + "onmousemove" : "handleMouseMove(evt)", + "onmouseup" : "handleMouseUp(evt)" + }); + + if (window.addEventListener) + { + if (navigator.userAgent.toLowerCase().indexOf('webkit') >= 0 || + navigator.userAgent.toLowerCase().indexOf("opera") >= 0 || + navigator.appVersion.indexOf("MSIE") != -1) + { + window.addEventListener('mousewheel', handleMouseWheel, false); // Chrome/Safari/IE9 + } + else + { + window.addEventListener('DOMMouseScroll', handleMouseWheel, false); // Others + } + } +} + +window.onresize=function() +{ + if (svgDoc) { show(); } +} + +/** + * Instance an SVGPoint object with given event coordinates. + */ +function getEventPoint(evt) +{ + var p = root.createSVGPoint(); + p.x = evt.clientX; + p.y = evt.clientY; + return p; +} + +/** + * Sets the current transform matrix of an element. + */ +function setCTM(element, matrix) +{ + var s = "matrix(" + matrix.a + "," + matrix.b + "," + matrix.c + "," + matrix.d + "," + matrix.e + "," + matrix.f + ")"; + element.setAttribute("transform", s); +} + +/** + * Sets attributes of an element. + */ +function setAttributes(element, attributes) +{ + for (i in attributes) + element.setAttributeNS(null, i, attributes[i]); +} + +function doZoom(g,point,zoomFactor) +{ + var p = point.matrixTransform(g.getCTM().inverse()); + var k = root.createSVGMatrix().translate(p.x, p.y).scale(zoomFactor).translate(-p.x, -p.y); + var n = g.getCTM().multiply(k); + var s = Math.max(n.a,n.d); + if (s>maxZoom) n=n.translate(p.x,p.y).scale(maxZoom/s).translate(-p.x,-p.y); + else if (s'); + d.write('Print SVG'); + d.write(''); + d.write('
    '+xs+'
    '); + d.write(''); + d.write(''); + d.close(); + } catch(e) { + alert('Failed to open popup window needed for printing!\n'+e.message); + } +} +/* @license-end */ diff --git a/grin/docs/_build/doxygen/html/sync_off.png b/grin/docs/_build/doxygen/html/sync_off.png new file mode 100644 index 0000000000000000000000000000000000000000..3b443fc62892114406e3d399421b2a881b897acc GIT binary patch literal 853 zcmV-b1FHOqP)oT|#XixUYy%lpuf3i8{fX!o zUyDD0jOrAiT^tq>fLSOOABs-#u{dV^F$b{L9&!2=9&RmV;;8s^x&UqB$PCj4FdKbh zoB1WTskPUPu05XzFbA}=KZ-GP1fPpAfSs>6AHb12UlR%-i&uOlTpFNS7{jm@mkU1V zh`nrXr~+^lsV-s1dkZOaI|kYyVj3WBpPCY{n~yd%u%e+d=f%`N0FItMPtdgBb@py; zq@v6NVArhyTC7)ULw-Jy8y42S1~4n(3LkrW8mW(F-4oXUP3E`e#g**YyqI7h-J2zK zK{m9##m4ri!7N>CqQqCcnI3hqo1I;Yh&QLNY4T`*ptiQGozK>FF$!$+84Z`xwmeMh zJ0WT+OH$WYFALEaGj2_l+#DC3t7_S`vHpSivNeFbP6+r50cO8iu)`7i%Z4BTPh@_m3Tk!nAm^)5Bqnr%Ov|Baunj#&RPtRuK& z4RGz|D5HNrW83-#ydk}tVKJrNmyYt-sTxLGlJY5nc&Re zU4SgHNPx8~Yxwr$bsju?4q&%T1874xxzq+_%?h8_ofw~(bld=o3iC)LUNR*BY%c0y zWd_jX{Y8`l%z+ol1$@Qa?Cy!(0CVIEeYpKZ`(9{z>3$CIe;pJDQk$m3p}$>xBm4lb zKo{4S)`wdU9Ba9jJbVJ0C=SOefZe%d$8=2r={nu<_^a3~>c#t_U6dye5)JrR(_a^E f@}b6j1K9lwFJq@>o)+Ry00000NkvXXu0mjfWa5j* literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/sync_on.png b/grin/docs/_build/doxygen/html/sync_on.png new file mode 100644 index 0000000000000000000000000000000000000000..e08320fb64e6fa33b573005ed6d8fe294e19db76 GIT binary patch literal 845 zcmV-T1G4;yP)Y;xxyHF2B5Wzm| zOOGupOTn@c(JmBOl)e;XMNnZuiTJP>rM8<|Q`7I_))aP?*T)ow&n59{}X4$3Goat zgjs?*aasfbrokzG5cT4K=uG`E14xZl@z)F={P0Y^?$4t z>v!teRnNZym<6h{7sLyF1V0HsfEl+l6TrZpsfr1}luH~F7L}ktXu|*uVX^RG$L0`K zWs3j|0tIvVe(N%_?2{(iCPFGf#B6Hjy6o&}D$A%W%jfO8_W%ZO#-mh}EM$LMn7joJ z05dHr!5Y92g+31l<%i1(=L1a1pXX+OYnalY>31V4K}BjyRe3)9n#;-cCVRD_IG1fT zOKGeNY8q;TL@K{dj@D^scf&VCs*-Jb>8b>|`b*osv52-!A?BpbYtTQBns5EAU**$m zSnVSm(teh>tQi*S*A>#ySc=n;`BHz`DuG4&g4Kf8lLhca+zvZ7t7RflD6-i-mcK=M z!=^P$*u2)bkY5asG4gsss!Hn%u~>}kIW`vMs%lJLH+u*9<4PaV_c6U`KqWXQH%+Nu zTv41O(^ZVi@qhjQdG!fbZw&y+2o!iYymO^?ud3{P*HdoX83YV*Uu_HB=?U&W9%AU# z80}k1SS-CXTU7dcQlsm<^oYLxVSseqY6NO}dc`Nj?8vrhNuCdm@^{a3AQ_>6myOj+ z`1RsLUXF|dm|3k7s2jD(B{rzE>WI2scH8i1;=O5Cc9xB3^aJk%fQjqsu+kH#0=_5a z0nCE8@dbQa-|YIuUVvG0L_IwHMEhOj$Mj4Uq05 X8=0q~qBNan00000NkvXXu0mjfptF>5 literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/tab_a.png b/grin/docs/_build/doxygen/html/tab_a.png new file mode 100644 index 0000000000000000000000000000000000000000..3b725c41c5a527a3a3e40097077d0e206a681247 GIT binary patch literal 142 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QlXwMjv*C{Z|8b*H5dputLHD# z=<0|*y7z(Vor?d;H&?EG&cXR}?!j-Lm&u1OOI7AIF5&c)RFE;&p0MYK>*Kl@eiymD r@|NpwKX@^z+;{u_Z~trSBfrMKa%3`zocFjEXaR$#tDnm{r-UW|TZ1%4 literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/tab_ad.png b/grin/docs/_build/doxygen/html/tab_ad.png new file mode 100644 index 0000000000000000000000000000000000000000..e34850acfc24be58da6d2fd1ccc6b29cc84fe34d GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QhuH;jv*C{Z|5d*H3V=pKi{In zd2jxLclDRPylmD}^l7{QOtL{vUjO{-WqItb5sQp2h-99b8^^Scr-=2mblCdZuUm?4 jzOJvgvt3{(cjKLW5(A@0qPS@<&}0TrS3j3^P6y&q2{!U5bk+Tso_B!YCpDh>v z{CM*1U8YvQRyBUHt^Ju0W_sq-?;9@_4equ-bavTs=gk796zopr0EBT&m;e9( literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/tab_s.png b/grin/docs/_build/doxygen/html/tab_s.png new file mode 100644 index 0000000000000000000000000000000000000000..ab478c95b67371d700a20869f7de1ddd73522d50 GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QuUrLjv*C{Z|^p8HaRdjTwH7) zC?wLlL}}I{)n%R&r+1}IGmDnq;&J#%V6)9VsYhS`O^BVBQlxOUep0c$RENLq#g8A$ z)z7%K_bI&n@J+X_=x}fJoEKed-$<>=ZI-;YrdjIl`U`uzuDWSP?o#Dmo{%SgM#oan kX~E1%D-|#H#QbHoIja2U-MgvsK&LQxy85}Sb4q9e0Efg%P5=M^ literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/tab_sd.png b/grin/docs/_build/doxygen/html/tab_sd.png new file mode 100644 index 0000000000000000000000000000000000000000..757a565ced4730f85c833fb2547d8e199ae68f19 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!Qq7(&jv*C{Z|_!fH5o7*c=%9% zcILh!EA=pAQKdx-Cdiev=v{eg{8Ht<{e8_NAN~b=)%W>-WDCE0PyDHGemi$BoXwcK z{>e9^za6*c1ilttWw&V+U;WCPlV9{LdC~Ey%_H(qj`xgfES(4Yz5jSTZfCt`4E$0YRsR*S^mTCR^;V&sxC8{l_Cp7w8-YPgg&ebxsLQ00$vXK>z>% literal 0 HcmV?d00001 diff --git a/grin/docs/_build/doxygen/html/tabs.css b/grin/docs/_build/doxygen/html/tabs.css new file mode 100644 index 000000000..71c8a4704 --- /dev/null +++ b/grin/docs/_build/doxygen/html/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important;color:var(--nav-menu-foreground-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} \ No newline at end of file diff --git a/grin/docs/_build/doxygen/html/type_8h.html b/grin/docs/_build/doxygen/html/type_8h.html new file mode 100644 index 000000000..01c502f67 --- /dev/null +++ b/grin/docs/_build/doxygen/html/type_8h.html @@ -0,0 +1,184 @@ + + + + + + + +GRIN: include/property/type.h File Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    + +
    type.h File Reference
    +
    +
    + +

    Define the vertex/edge type related APIs. +More...

    +
    #include "../predefine.h"
    +
    +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    +VertexType get_vertex_type (const Graph, const Vertex)
     
    +char * get_vertex_type_name (const Graph, const VertexType)
     
    +VertexType get_vertex_type_by_name (const Graph, char *)
     
    +VertexTypeList get_vertex_type_list (const Graph)
     
    +void destroy_vertex_type_list (VertexTypeList)
     
    +VertexTypeList create_vertex_type_list ()
     
    +bool insert_vertex_type_to_list (VertexTypeList, const VertexType)
     
    +size_t get_vertex_type_list_size (const VertexTypeList)
     
    +VertexType get_vertex_type_from_list (const VertexTypeList, const size_t)
     
    +VertexTypeID get_vertex_type_id (const VertexType)
     
    +VertexType get_vertex_type_from_id (const VertexTypeID)
     
    +EdgeType get_edge_type (const Graph, const Edge)
     
    +char * get_edge_type_name (const Graph, const EdgeType)
     
    +EdgeType get_edge_type_by_name (const Graph, char *)
     
    +EdgeTypeList get_edge_type_list (const Graph)
     
    +void destroy_edge_type_list (EdgeTypeList)
     
    +EdgeTypeList create_edge_type_list ()
     
    +bool insert_edge_type_to_list (EdgeTypeList, const EdgeType)
     
    +size_t get_edge_type_list_size (const EdgeTypeList)
     
    +EdgeType get_edge_type_from_list (const EdgeTypeList, const size_t)
     
    +EdgeTypeID get_edge_type_id (const EdgeType)
     
    +EdgeType get_edge_type_from_id (const EdgeTypeID)
     
    VertexEdgeTypeRelation

    GRIN assumes the relation between edge type and pairs of vertex types is many-to-many. Thus GRIN returns the pairs of vertex types related to an edge type as a pair of vertex type lists of the same size, and the src/dst vertex types are aligned with their positions in the lists.

    +
    +VertexTypeList get_src_types_from_edge_type (const Graph, const EdgeType)
     the src vertex type list
     
    +VertexTypeList get_dst_types_from_edge_type (const Graph, const EdgeType)
     get the dst vertex type list
     
    +EdgeTypeList get_edge_types_from_vertex_type_pair (const Graph, const VertexType, const VertexType)
     get the edge type list related to a given pair of vertex types
     
    +

    Detailed Description

    +

    Define the vertex/edge type related APIs.

    +

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    + +

    Definition in file type.h.

    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/type_8h_source.html b/grin/docs/_build/doxygen/html/type_8h_source.html new file mode 100644 index 000000000..5baaa9294 --- /dev/null +++ b/grin/docs/_build/doxygen/html/type_8h_source.html @@ -0,0 +1,162 @@ + + + + + + + +GRIN: include/property/type.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    type.h
    +
    +
    +Go to the documentation of this file.
    1
    +
    18#ifndef GRIN_INCLUDE_PROPERTY_TYPE_H_
    +
    19#define GRIN_INCLUDE_PROPERTY_TYPE_H_
    +
    20
    +
    21#include "../predefine.h"
    +
    22
    +
    23#ifdef WITH_VERTEX_PROPERTY
    +
    24// Vertex type
    +
    25VertexType get_vertex_type(const Graph, const Vertex);
    +
    26
    +
    27char* get_vertex_type_name(const Graph, const VertexType);
    +
    28
    +
    29VertexType get_vertex_type_by_name(const Graph, char*);
    +
    30
    +
    31// Vertex type list
    +
    32VertexTypeList get_vertex_type_list(const Graph);
    +
    33
    +
    34void destroy_vertex_type_list(VertexTypeList);
    +
    35
    +
    36VertexTypeList create_vertex_type_list();
    +
    37
    +
    38bool insert_vertex_type_to_list(VertexTypeList, const VertexType);
    +
    39
    +
    40size_t get_vertex_type_list_size(const VertexTypeList);
    +
    41
    +
    42VertexType get_vertex_type_from_list(const VertexTypeList, const size_t);
    +
    43#endif
    +
    44
    +
    45
    +
    46#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT
    +
    47VertexTypeID get_vertex_type_id(const VertexType);
    +
    48
    +
    49VertexType get_vertex_type_from_id(const VertexTypeID);
    +
    50#endif
    +
    51
    +
    52
    +
    53#ifdef WITH_EDGE_PROPERTY
    +
    54// Edge type
    +
    55EdgeType get_edge_type(const Graph, const Edge);
    +
    56
    +
    57char* get_edge_type_name(const Graph, const EdgeType);
    +
    58
    +
    59EdgeType get_edge_type_by_name(const Graph, char*);
    +
    60
    +
    61// Edge type list
    +
    62EdgeTypeList get_edge_type_list(const Graph);
    +
    63
    +
    64void destroy_edge_type_list(EdgeTypeList);
    +
    65
    +
    66EdgeTypeList create_edge_type_list();
    +
    67
    +
    68bool insert_edge_type_to_list(EdgeTypeList, const EdgeType);
    +
    69
    +
    70size_t get_edge_type_list_size(const EdgeTypeList);
    +
    71
    +
    72EdgeType get_edge_type_from_list(const EdgeTypeList, const size_t);
    +
    73#endif
    +
    74
    +
    75#ifdef NATURAL_EDGE_TYPE_ID_TRAIT
    +
    76EdgeTypeID get_edge_type_id(const EdgeType);
    +
    77
    +
    78EdgeType get_edge_type_from_id(const EdgeTypeID);
    +
    79#endif
    +
    80
    +
    87#if defined(WITH_VERTEX_PROPERTY) && defined(WITH_EDGE_PROPERTY)
    +
    89VertexTypeList get_src_types_from_edge_type(const Graph, const EdgeType);
    +
    90
    +
    92VertexTypeList get_dst_types_from_edge_type(const Graph, const EdgeType);
    +
    93
    +
    95EdgeTypeList get_edge_types_from_vertex_type_pair(const Graph, const VertexType, const VertexType);
    +
    96#endif
    +
    98
    +
    99#endif // GRIN_INCLUDE_PROPERTY_TYPE_H_
    +
    VertexTypeList get_dst_types_from_edge_type(const Graph, const EdgeType)
    get the dst vertex type list
    +
    EdgeTypeList get_edge_types_from_vertex_type_pair(const Graph, const VertexType, const VertexType)
    get the edge type list related to a given pair of vertex types
    +
    VertexTypeList get_src_types_from_edge_type(const Graph, const EdgeType)
    the src vertex type list
    +
    + + + + diff --git a/grin/docs/_build/doxygen/html/vertexlist_8h_source.html b/grin/docs/_build/doxygen/html/vertexlist_8h_source.html new file mode 100644 index 000000000..1b820bb9c --- /dev/null +++ b/grin/docs/_build/doxygen/html/vertexlist_8h_source.html @@ -0,0 +1,126 @@ + + + + + + + +GRIN: include/topology/vertexlist.h Source File + + + + + + + + + +
    +
    + + + + + + +
    +
    GRIN +
    +
    Graph Retrieval Interface
    +
    +
    + + + + + + + + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + + +
    +
    +
    vertexlist.h
    +
    +
    +
    1
    +
    16#ifndef GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_
    +
    17#define GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_
    +
    18
    +
    19#include "../predefine.h"
    +
    20
    +
    21#ifdef ENABLE_VERTEX_LIST
    +
    22
    +
    23VertexList get_vertex_list(const Graph);
    +
    24
    +
    25#ifdef WITH_VERTEX_PROPERTY
    +
    26VertexList get_vertex_list_by_type(const Graph, const VertexType);
    +
    27#endif
    +
    28
    +
    29void destroy_vertex_list(VertexList);
    +
    30
    +
    31VertexList create_vertex_list();
    +
    32
    +
    33bool insert_vertex_to_list(VertexList, const Vertex);
    +
    34
    +
    35size_t get_vertex_list_size(const VertexList);
    +
    36
    +
    37Vertex get_vertex_from_list(const VertexList, const size_t);
    +
    38
    +
    39#ifdef ENABLE_VERTEX_LIST_ITERATOR
    +
    40VertexListIterator get_vertex_list_begin(const Graph);
    +
    41
    +
    42#ifdef WITH_VERTEX_PROPERTY
    +
    43VertexListIterator get_vertex_list_begin_by_type(const Graph, const VertexType);
    +
    44#endif
    +
    45
    +
    46bool get_next_vertex_list_iter(VertexListIterator);
    +
    47
    +
    48Vertex get_vertex_from_iter(VertexListIterator);
    +
    49#endif
    +
    50
    +
    51
    +
    52#endif
    +
    53
    +
    54#endif // GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_
    +
    + + + + diff --git a/grin/docs/_build/doxygen/xml/Doxyfile.xml b/grin/docs/_build/doxygen/xml/Doxyfile.xml new file mode 100644 index 000000000..c730ef867 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/Doxyfile.xml @@ -0,0 +1,342 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/_r_e_a_d_m_e_8md.xml b/grin/docs/_build/doxygen/xml/_r_e_a_d_m_e_8md.xml new file mode 100644 index 000000000..125661efe --- /dev/null +++ b/grin/docs/_build/doxygen/xml/_r_e_a_d_m_e_8md.xml @@ -0,0 +1,49 @@ + + + + README.md + + + + + + +#GRIN +##Assumptions +###PropertyGraph +-Verticeshavetypes,soasEdges. +-Therelationshipbetweenedgetypeandpairsofvertextypesismany-to-many. +-Propertiesareboundtovertexandedgetypes,butsomemayhavethesamename. +-Labelscanbeassignedtoverticesandedges(NOTtheirtypes)primarilyforqueryfiltering,andlabelshavenoproperties. +##DesignPrinciples +###Handler +-GRINprovidesaseriesofhandlersforgraphconcepts,suchasvertex,edgeandgraphitself. +-SincealmosteverythinginGRINarehandlersexceptofonlyafewstringnames,thetypeforagraphconceptanditshandlerisalwaysmixed-usedinGRIN. +-Forexample,weusethetypeVertextorepresentthetypeofavertexhandler,insteadofusingVertexHandlerforcleancode. + +###List +-Alisthandler,nomatterwhatkindoflistitrepresents,isavailabletotheuseronlyifthestoragecanprovidethesizeofthelist,andanelementretrievalAPIbyposition(i.e.,indexofarray). +-FortheinstanceofVertex,whensomeGRINAPIreturnsa`VertexList`(handler),theusercangetthesizeofthe`VertexList`bycalling`get_vertex_list_size`togetthe`size`,and`get_vertex_from_list`togeta`vertex`byprovidinganindexvaluerangesfrom`0`to`size-1`. +###ListIterator +-Alistiteratorhandler,nomatterwhatkindoflistitrepresents,isavailabletotheuserifthelistsizeisunknownorforsequentialscanefficiency. +-TakeVertexasexampleagain,userscangettheiteratoratthebeginningusingAPIslike`get_vertex_list_begin`,andkeepsonusing`get_next_vertex_list_iter`toupdatetheiteratortilltheendofthelistwhena`false`isreturned.APIslike`get_vertex_from_iter`willreturnthe`Vertex`fromthevertexiterator. +###Property +-Propertiesareboundtovertexandedgetypes.Itmeansevensomepropertiesmayhavethesamename,aslongastheyareboundtodifferentvertexoredgetypes,GRINwillprovidedistincthandlersfortheseproperties.Thisis +because,althoughpropertieswiththesamenameusuallyprovidethesamesemanticinthegraph,theymayhave +differentdatatypesintheunderlyingstorageforefficiencyconcerns(e.g.,shortdateandlongdate). +-Toavoidtheincompatibilitywithstorageengines,wemadethedesignchoicetobindpropertiesundervertexandedgetypes.Meanwhile,GRINprovidesanAPItogetallthepropertyhandlerswiththe(same)givenpropertyname. +###Reference +-GRINintroducesthereferenceconceptinpartitionedgraph.Itstandsforthereferenceofaninstancethatcan +berecognizedinpartitionsotherthanthecurrentpartitionwheretheinstanceisaccessed. +-Forexample,a`VertexRef`isareferenceofa`Vertex`thatcanberecognizedinotherpartitions. + +##Traits +###NaturalIDTrait +-Conceptsrepresenttheschemaofthegraph,suchasvertextypeandpropertiesboundtoacertainedgetype,areusuallynumberednaturallyfrom`0`toits`num-1`inmanystorageengines.Tofacilitatefurtheroptimizations +intheuppercomputingengines,GRINprovidesthenaturalnumberIDtrait.Astoragecanprovidesuchatraitif +italsousesthenaturalnumberingforgraphschemaconcepts. + + + + + diff --git a/grin/docs/_build/doxygen/xml/adjacentlist_8h.xml b/grin/docs/_build/doxygen/xml/adjacentlist_8h.xml new file mode 100644 index 000000000..7ca45f4f4 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/adjacentlist_8h.xml @@ -0,0 +1,204 @@ + + + + adjacentlist.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AdjacentList + AdjacentList get_adjacent_list + (const Graph, const Direction, Vertex) + get_adjacent_list + + const + Graph + + + const + Direction + + + Vertex + + + + +Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + + + + + AdjacentList + AdjacentList get_adjacent_list_by_edge_type + (const Graph, const Direction, Vertex, EdgeType) + get_adjacent_list_by_edge_type + + const + Graph + + + const + Direction + + + Vertex + + + EdgeType + + + + + + + + + + + void + void destroy_adjacent_list + (AdjacentList) + destroy_adjacent_list + + AdjacentList + + + + + + + + + + + size_t + size_t get_adjacent_list_size + (const AdjacentList) + get_adjacent_list_size + + const + AdjacentList + + + + + + + + + + + Vertex + Vertex get_neighbor_from_adjacent_list + (const AdjacentList, size_t) + get_neighbor_from_adjacent_list + + const + AdjacentList + + + size_t + + + + + + + + + + + Edge + Edge get_edge_from_adjacent_list + (const AdjacentList, size_t) + get_edge_from_adjacent_list + + const + AdjacentList + + + size_t + + + + + + + + + + + + + + + + +#ifndefGRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ +#defineGRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ + +#include"../predefine.h" + +#ifdefENABLE_ADJACENT_LIST +AdjacentListget_adjacent_list(constGraph,constDirection,Vertex); + +#ifdefWITH_EDGE_PROPERTY +AdjacentListget_adjacent_list_by_edge_type(constGraph,constDirection,Vertex,EdgeType); +#endif + +voiddestroy_adjacent_list(AdjacentList); + +size_tget_adjacent_list_size(constAdjacentList); + +Vertexget_neighbor_from_adjacent_list(constAdjacentList,size_t); + +Edgeget_edge_from_adjacent_list(constAdjacentList,size_t); + +#ifdefENABLE_ADJACENT_LIST_ITERATOR +AdjacentListIteratorget_adjacent_list_begin(constGraph); + +boolget_next_adjacent_list_iter(AdjacentListIterator); + +Vertexget_neighbor_from_iter(AdjacentListIterator); + +Edgeget_edge_from_iter(AdjacentListIterator); +#endif + +#endif + +#endif//GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ + + + + diff --git a/grin/docs/_build/doxygen/xml/combine.xslt b/grin/docs/_build/doxygen/xml/combine.xslt new file mode 100644 index 000000000..3bfa82c1e --- /dev/null +++ b/grin/docs/_build/doxygen/xml/combine.xslt @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/compound.xsd b/grin/docs/_build/doxygen/xml/compound.xsd new file mode 100644 index 000000000..a10b58d40 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/compound.xsd @@ -0,0 +1,1305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The mentioned file will be located in the directory as specified by XML_OUTPUT + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/dir_49e56c817e5e54854c35e136979f97ca.xml b/grin/docs/_build/doxygen/xml/dir_49e56c817e5e54854c35e136979f97ca.xml new file mode 100644 index 000000000..84e97a7bd --- /dev/null +++ b/grin/docs/_build/doxygen/xml/dir_49e56c817e5e54854c35e136979f97ca.xml @@ -0,0 +1,11 @@ + + + + docs + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/dir_85395b416142281e9b8cbaa2a4bb7bc5.xml b/grin/docs/_build/doxygen/xml/dir_85395b416142281e9b8cbaa2a4bb7bc5.xml new file mode 100644 index 000000000..5094e1b84 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/dir_85395b416142281e9b8cbaa2a4bb7bc5.xml @@ -0,0 +1,12 @@ + + + + include/partition + partition.h + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/dir_d44c64559bbebec7f509842c48db8b23.xml b/grin/docs/_build/doxygen/xml/dir_d44c64559bbebec7f509842c48db8b23.xml new file mode 100644 index 000000000..5e271af0b --- /dev/null +++ b/grin/docs/_build/doxygen/xml/dir_d44c64559bbebec7f509842c48db8b23.xml @@ -0,0 +1,15 @@ + + + + include + include/partition + include/property + include/topology + predefine.h + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/dir_f450b25d4e0d87eea6a09d028ca7ee7d.xml b/grin/docs/_build/doxygen/xml/dir_f450b25d4e0d87eea6a09d028ca7ee7d.xml new file mode 100644 index 000000000..d4a8d0d48 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/dir_f450b25d4e0d87eea6a09d028ca7ee7d.xml @@ -0,0 +1,15 @@ + + + + include/topology + adjacentlist.h + edgelist.h + structure.h + vertexlist.h + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/dir_ffb75fe14fe29e45cb01a712fdfb6c45.xml b/grin/docs/_build/doxygen/xml/dir_ffb75fe14fe29e45cb01a712fdfb6c45.xml new file mode 100644 index 000000000..d0227ecbb --- /dev/null +++ b/grin/docs/_build/doxygen/xml/dir_ffb75fe14fe29e45cb01a712fdfb6c45.xml @@ -0,0 +1,17 @@ + + + + include/property + label.h + primarykey.h + property.h + propertylist.h + propertytable.h + type.h + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/doxyfile.xsd b/grin/docs/_build/doxygen/xml/doxyfile.xsd new file mode 100644 index 000000000..fbfc2c13d --- /dev/null +++ b/grin/docs/_build/doxygen/xml/doxyfile.xsd @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/edgelist_8h.xml b/grin/docs/_build/doxygen/xml/edgelist_8h.xml new file mode 100644 index 000000000..14b813e6c --- /dev/null +++ b/grin/docs/_build/doxygen/xml/edgelist_8h.xml @@ -0,0 +1,80 @@ + + + + edgelist.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#ifndefGRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ +#defineGRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ + +#include"../predefine.h" + +#ifdefENABLE_EDGE_LIST + +EdgeListget_edge_list(constGraph,constDirection); + +#ifdefWITH_EDGE_PROPERTY +EdgeListget_edge_list_by_type(constGraph,constEdgeType); +#endif + +voiddestroy_edge_list(EdgeList); + +EdgeListcreate_edge_list(); + +boolinsert_edge_to_list(EdgeList,constEdge); + +size_tget_edge_list_size(constEdgeList); + +Edgeget_edge_from_list(constEdgeList,size_t); + +#ifdefENABLE_EDGE_LIST_ITERATOR +EdgeListIteratorget_edge_list_begin(constGraph); + +#ifdefWITH_EDGE_PROPERTY +EdgeListIteratorget_edge_list_begin_by_type(constGraph,constEdgeType); +#endif + +boolget_next_edge_list_iter(EdgeListIterator); + +Edgeget_edge_from_iter(EdgeListIterator); +#endif + +#endif + +#endif//GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ + + + + diff --git a/grin/docs/_build/doxygen/xml/group__nv.xml b/grin/docs/_build/doxygen/xml/group__nv.xml new file mode 100644 index 000000000..d3ad189ff --- /dev/null +++ b/grin/docs/_build/doxygen/xml/group__nv.xml @@ -0,0 +1,170 @@ + + + + nv + Null Values + + + NULL_TYPE + Undefined + +Null type (undefined data type) + + + + + + + + + NULL_GRAPH + NULL + +Null graph (invalid return value) + + + + + + + + + NULL_VERTEX + NULL + +Non-existing vertex (invalid return value) + + + + + + + + + NULL_EDGE + NULL + +Non-existing edge (invalid return value) + + + + + + + + + NULL_LIST + NULL + +Null list of any kind (invalid return value) + + + + + + + + + NULL_PARTITION + NULL + +Non-existing partition (invalid return value) + + + + + + + + + NULL_VERTEX_REF + NULL + +Null vertex reference (invalid return value) + + + + + + + + + NULL_EDGE_REF + NULL + +Null edge reference (invalid return value) + + + + + + + + + NULL_VERTEX_TYPE + NULL + +Non-existing vertex type (invalid return value) + + + + + + + + + NULL_EDGE_TYPE + NULL + +Non-existing edge type (invalid return value) + + + + + + + + + NULL_PROPERTY + NULL + +Non-existing property (invalid return value) + + + + + + + + + NULL_ROW + NULL + +Null row (invalid return value) + + + + + + + + + NULL_NATURAL_ID + UINT_MAX + +Null natural id of any kind (invalid return value) + + + + + + + + + + + +Macros for Null(invalid) values + + + diff --git a/grin/docs/_build/doxygen/xml/index.xml b/grin/docs/_build/doxygen/xml/index.xml new file mode 100644 index 000000000..7f91ad958 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/index.xml @@ -0,0 +1,263 @@ + + + README.md + + partition.h + get_total_partitions_number + get_local_partition_list + destroy_partition_list + create_partition_list + insert_partition_to_list + get_partition_list_size + get_partition_from_list + get_partition_from_id + get_partition_id + get_partition_info + get_local_graph_from_partition + get_master_vertices + get_mirror_vertices + get_mirror_vertices_by_partition + get_master_vertices_by_type + get_mirror_vertices_by_type + get_mirror_vertices_by_type_partition + get_adjacent_master_list + get_adjacent_mirror_list + get_adjacent_mirror_list_by_partition + get_vertex_ref_for_vertex + get_vertex_from_vertex_ref + get_master_partition_from_vertex_ref + serialize_vertex_ref + deserialize_to_vertex_ref + get_edge_ref_for_edge + get_edge_from_edge_ref + get_master_partition_from_edge_ref + serialize_edge_ref + deserialize_to_edge_ref + is_vertex_neighbor_local_complete + vertex_neighbor_complete_partitions + is_vertex_property_local_complete + vertex_property_complete_partitions + is_edge_property_local_complete + edge_data_complete_partitions + + predefine.h + WITH_VERTEX_ORIGINAL_ID + WITH_VERTEX_DATA + WITH_EDGE_DATA + ENABLE_VERTEX_LIST + ENABLE_VERTEX_LIST_ITERATOR + ENABLE_EDGE_LIST + ENABLE_EDGE_LIST_ITERATOR + ENABLE_ADJACENT_LIST + ENABLE_ADJACENT_LIST_ITERATOR + ENABLE_GRAPH_PARTITION + NATURAL_PARTITION_ID_TRAIT + ENABLE_VERTEX_REF + ENABLE_EDGE_REF + WITH_PROPERTY_NAME + WITH_VERTEX_PROPERTY + WITH_VERTEX_PRIMARTY_KEYS + NATURAL_VERTEX_TYPE_ID_TRAIT + NATURAL_VERTEX_PROPERTY_ID_TRAIT + WITH_EDGE_PROPERTY + WITH_EDGE_PRIMARTY_KEYS + NATURAL_EDGE_TYPE_ID_TRAIT + NATURAL_EDGE_PROPERTY_ID_TRAIT + WITH_LABEL + COLUMN_STORE_TRAIT + ENABLE_PREDICATE + NULL_TYPE + NULL_GRAPH + NULL_VERTEX + NULL_EDGE + NULL_LIST + NULL_PARTITION + NULL_VERTEX_REF + NULL_EDGE_REF + NULL_VERTEX_TYPE + NULL_EDGE_TYPE + NULL_PROPERTY + NULL_ROW + NULL_NATURAL_ID + Direction + IN + OUT + BOTH + DataType + Undefined + Int32 + UInt32 + Int64 + UInt64 + Float + Double + String + Date32 + Date64 + Graph + Vertex + Edge + OriginalID + VertexList + AdjacentList + PartitionedGraph + Partition + PartitionList + PartitionID + VertexRef + VertexType + VertexTypeList + VertexProperty + VertexPropertyList + VertexPropertyTable + VertexTypeID + VertexPropertyID + EdgeType + EdgeTypeList + EdgeProperty + EdgePropertyList + EdgePropertyTable + EdgeTypeID + EdgePropertyID + Row + + label.h + get_label_by_name + get_label_name + destroy_label + destroy_label_list + get_label_list_size + get_label_from_list + assign_label_to_vertex + get_vertex_label_list + get_vertex_list_by_label + filter_vertex_list_by_label + + primarykey.h + get_vertex_types_with_primary_keys + get_primary_keys_by_vertex_type + get_vertex_by_primay_keys + + property.h + get_vertex_property_name + get_vertex_property_by_name + get_vertex_properties_by_name + get_edge_property_name + get_edge_property_by_name + get_edge_properties_by_name + destroy_vertex_property + get_vertex_property_data_type + get_vertex_property_vertex_type + + propertylist.h + select_vertex_properties + select_edge_properteis + get_vertex_property_list_by_type + get_vertex_property_list_size + get_vertex_property_from_list + create_vertex_property_list + destroy_vertex_property_list + insert_vertex_property_to_list + get_vertex_property_from_id + get_vertex_property_id + get_edge_property_list_by_type + get_edge_property_list_size + get_edge_property_from_list + create_edge_property_list + destroy_edge_property_list + insert_edge_property_to_list + get_edge_property_from_id + get_edge_property_id + + propertytable.h + destroy_row + get_value_from_row + create_row + insert_value_to_row + destroy_vertex_property_table + get_vertex_property_table_by_type + get_value_from_vertex_property_table + get_row_from_vertex_property_table + + type.h + get_src_types_from_edge_type + get_dst_types_from_edge_type + get_edge_types_from_vertex_type_pair + get_vertex_type + get_vertex_type_name + get_vertex_type_by_name + get_vertex_type_list + destroy_vertex_type_list + create_vertex_type_list + insert_vertex_type_to_list + get_vertex_type_list_size + get_vertex_type_from_list + get_vertex_type_id + get_vertex_type_from_id + get_edge_type + get_edge_type_name + get_edge_type_by_name + get_edge_type_list + destroy_edge_type_list + create_edge_type_list + insert_edge_type_to_list + get_edge_type_list_size + get_edge_type_from_list + get_edge_type_id + get_edge_type_from_id + + adjacentlist.h + get_adjacent_list + get_adjacent_list_by_edge_type + destroy_adjacent_list + get_adjacent_list_size + get_neighbor_from_adjacent_list + get_edge_from_adjacent_list + + edgelist.h + + structure.h + is_directed + is_multigraph + get_vertex_num + get_vertex_num_by_type + get_edge_num + get_edge_num_by_type + destroy_vertex + get_vertex_data_type + get_vertex_data_value + destroy_vertex_data + get_vertex_from_original_id + get_vertex_from_type_original_id + get_vertex_original_id + destroy_vertex_original_id + destroy_edge + get_edge_src + get_edge_dst + + vertexlist.h + get_vertex_list + get_vertex_list_by_type + destroy_vertex_list + create_vertex_list + insert_vertex_to_list + get_vertex_list_size + get_vertex_from_list + get_vertex_list_begin + get_vertex_list_begin_by_type + get_next_vertex_list_iter + get_vertex_from_iter + + docs + + include + + include/partition + + include/property + + include/topology + + index + + diff --git a/grin/docs/_build/doxygen/xml/index.xsd b/grin/docs/_build/doxygen/xml/index.xsd new file mode 100644 index 000000000..cfb7041b5 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/index.xsd @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/indexpage.xml b/grin/docs/_build/doxygen/xml/indexpage.xml new file mode 100644 index 000000000..c32cd7d35 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/indexpage.xml @@ -0,0 +1,80 @@ + + + + index + GRIN + + + + + +Assumptions + +Property Graph + +Vertices have types, so as Edges. +The relationship between edge type and pairs of vertex types is many-to-many. +Properties are bound to vertex and edge types, but some may have the same name. +Labels can be assigned to vertices and edges (NOT their types) primarily for query filtering, and labels have no properties. + + + + + +Design Principles + +Handler + +GRIN provides a series of handlers for graph concepts, such as vertex, edge and graph itself. +Since almost everything in GRIN are handlers except of only a few string names, the type for a graph concept and its handler is always mixed-used in GRIN. +For example, we use the type Vertex to represent the type of a vertex handler, instead of using VertexHandler for clean code. + + + + +List + +A list handler, no matter what kind of list it represents, is available to the user only if the storage can provide the size of the list, and an element retrieval API by position (i.e., index of array). +For the instance of Vertex, when some GRIN API returns a VertexList(handler), the user can get the size of the VertexList by calling get_vertex_list_size to get the size, and get_vertex_from_list to get a vertex by providing an index value ranges from 0 to size-1. + + + + +List Iterator + +A list iterator handler, no matter what kind of list it represents, is available to the user if the list size is unknown or for sequential scan efficiency. +Take Vertex as example again, users can get the iterator at the beginning using APIs like get_vertex_list_begin, and keeps on using get_next_vertex_list_iter to update the iterator till the end of the list when a false is returned. APIs like get_vertex_from_iter will return the Vertex from the vertex iterator. + + + + +Property + +Properties are bound to vertex and edge types. It means even some properties may have the same name, as long as they are bound to different vertex or edge types, GRIN will provide distinct handlers for these properties. This is because, although properties with the same name usually provide the same semantic in the graph, they may have different data types in the underlying storage for efficiency concerns (e.g., short date and long date). +To avoid the incompatibility with storage engines, we made the design choice to bind properties under vertex and edge types. Meanwhile, GRIN provides an API to get all the property handlers with the (same) given property name. + + + + +Reference + +GRIN introduces the reference concept in partitioned graph. It stands for the reference of an instance that can be recognized in partitions other than the current partition where the instance is accessed. +For example, a VertexRef is a reference of a Vertex that can be recognized in other partitions. + + + + + +Traits + +Natural ID Trait + +Concepts represent the schema of the graph, such as vertex type and properties bound to a certain edge type, are usually numbered naturally from 0 to its num - 1 in many storage engines. To facilitate further optimizations in the upper computing engines, GRIN provides the natural number ID trait. A storage can provide such a trait if it also uses the natural numbering for graph schema concepts. + + + + + + + + diff --git a/grin/docs/_build/doxygen/xml/label_8h.xml b/grin/docs/_build/doxygen/xml/label_8h.xml new file mode 100644 index 000000000..8b632137e --- /dev/null +++ b/grin/docs/_build/doxygen/xml/label_8h.xml @@ -0,0 +1,358 @@ + + + + label.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Label + Label get_label_by_name + (const Graph, const char *) + get_label_by_name + + const + Graph + + + const char * + + + + + + + + + + + char * + char * get_label_name + (const Graph, const Label) + get_label_name + + const + Graph + + + const + Label + + + + + + + + + + + void + void destroy_label + (Label) + destroy_label + + Label + + + + + + + + + + + void + void destroy_label_list + (LabelList) + destroy_label_list + + LabelList + + + + + + + + + + + size_t + size_t get_label_list_size + (const LabelList) + get_label_list_size + + const + LabelList + + + + + + + + + + + Label + Label get_label_from_list + (const LabelList, const size_t) + get_label_from_list + + const + LabelList + + + const + size_t + + + + + + + + + + + bool + bool assign_label_to_vertex + (const Graph, const Label, Vertex) + assign_label_to_vertex + + const + Graph + + + const + Label + + + Vertex + + +assign a label to a vertex + + + + +Graph + + +the graph + + + + +Label + + +the label + + + + +Vertex + + +the vertex + + + +whether succeed + + + + + + + + + LabelList + LabelList get_vertex_label_list + (const Graph, const Vertex) + get_vertex_label_list + + const + Graph + + + const + Vertex + + +get the label list of a vertex + + + + +Graph + + +the graph + + + + +Vertex + + +the vertex + + + + + + + + + + + VertexList + VertexList get_vertex_list_by_label + (const Graph, const Label) + get_vertex_list_by_label + + const + Graph + + + const + Label + + +get the vertex list by label + + + + +Graph + + +the graph + + + + +Label + + +the label + + + + + + + + + + + VertexList + VertexList filter_vertex_list_by_label + (const VertexList, const Label) + filter_vertex_list_by_label + + const + VertexList + + + const + Label + + +filtering an existing vertex list by label + + + + +VertexList + + +the existing vertex list + + + + +Label + + +the label + + + + + + + + + + + +Define the label related APIs. + + +Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + +#ifndefGRIN_INCLUDE_PROPERTY_LABEL_H_ +#defineGRIN_INCLUDE_PROPERTY_LABEL_H_ + +#include"../predefine.h" + +#ifdefWITH_LABEL +Labelget_label_by_name(constGraph,constchar*); + +char*get_label_name(constGraph,constLabel); + +voiddestroy_label(Label); + +voiddestroy_label_list(LabelList); + +size_tget_label_list_size(constLabelList); + +Labelget_label_from_list(constLabelList,constsize_t); + +boolassign_label_to_vertex(constGraph,constLabel,Vertex); + +LabelListget_vertex_label_list(constGraph,constVertex); + +VertexListget_vertex_list_by_label(constGraph,constLabel); + +VertexListfilter_vertex_list_by_label(constVertexList,constLabel); +#endif + +#endif//GRIN_INCLUDE_PROPERTY_LABEL_H_ + + + + diff --git a/grin/docs/_build/doxygen/xml/partition_8h.xml b/grin/docs/_build/doxygen/xml/partition_8h.xml new file mode 100644 index 000000000..1554bd00d --- /dev/null +++ b/grin/docs/_build/doxygen/xml/partition_8h.xml @@ -0,0 +1,906 @@ + + + + partition.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ****add enable_vertex edge_ref macros ****size_t + ****add enable_vertex edge_ref macros ****size_t get_total_partitions_number + (const PartitionedGraph) + get_total_partitions_number + + const + PartitionedGraph + + + + +Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + + + + + PartitionList + PartitionList get_local_partition_list + (const PartitionedGraph) + get_local_partition_list + + const + PartitionedGraph + + + + + + + + + + + void + void destroy_partition_list + (PartitionList) + destroy_partition_list + + PartitionList + + + + + + + + + + + PartitionList + PartitionList create_partition_list + () + create_partition_list + + + + + + + + + + bool + bool insert_partition_to_list + (PartitionList, const Partition) + insert_partition_to_list + + PartitionList + + + const + Partition + + + + + + + + + + + size_t + size_t get_partition_list_size + (const PartitionList) + get_partition_list_size + + const + PartitionList + + + + + + + + + + + Partition + Partition get_partition_from_list + (const PartitionList, const size_t) + get_partition_from_list + + const + PartitionList + + + const + size_t + + + + + + + + + + + Partition + Partition get_partition_from_id + (const PartitionID) + get_partition_from_id + + const + PartitionID + + + + + + + + + + + PartitionID + PartitionID get_partition_id + (const Partition) + get_partition_id + + const + Partition + + + + + + + + + + + void * + void * get_partition_info + (const PartitionedGraph, const Partition) + get_partition_info + + const + PartitionedGraph + + + const + Partition + + + + + + + + + + + Graph + Graph get_local_graph_from_partition + (const PartitionedGraph, const Partition) + get_local_graph_from_partition + + const + PartitionedGraph + + + const + Partition + + + + + + + + + + + VertexList + VertexList get_master_vertices + (const Graph) + get_master_vertices + + const + Graph + + + + + + + + + + + VertexList + VertexList get_mirror_vertices + (const Graph) + get_mirror_vertices + + const + Graph + + + + + + + + + + + VertexList + VertexList get_mirror_vertices_by_partition + (const Graph, const Partition) + get_mirror_vertices_by_partition + + const + Graph + + + const + Partition + + + + + + + + + + + VertexList + VertexList get_master_vertices_by_type + (const Graph, const VertexType) + get_master_vertices_by_type + + const + Graph + + + const + VertexType + + + + + + + + + + + VertexList + VertexList get_mirror_vertices_by_type + (const Graph, const VertexType) + get_mirror_vertices_by_type + + const + Graph + + + const + VertexType + + + + + + + + + + + VertexList + VertexList get_mirror_vertices_by_type_partition + (const Graph, const VertexType, const Partition) + get_mirror_vertices_by_type_partition + + const + Graph + + + const + VertexType + + + const + Partition + + + + + + + + + + + AdjacentList + AdjacentList get_adjacent_master_list + (const Graph, const Direction, const Vertex) + get_adjacent_master_list + + const + Graph + + + const + Direction + + + const + Vertex + + + + + + + + + + + AdjacentList + AdjacentList get_adjacent_mirror_list + (const Graph, const Direction, const Vertex) + get_adjacent_mirror_list + + const + Graph + + + const + Direction + + + const + Vertex + + + + + + + + + + + AdjacentList + AdjacentList get_adjacent_mirror_list_by_partition + (const Graph, const Direction, const Partition, const Vertex) + get_adjacent_mirror_list_by_partition + + const + Graph + + + const + Direction + + + const + Partition + + + const + Vertex + + + + + + + + + + + VertexRef + VertexRef get_vertex_ref_for_vertex + (const Graph, const Partition, const Vertex) + get_vertex_ref_for_vertex + + const + Graph + + + const + Partition + + + const + Vertex + + + + + + + + + + + Vertex + Vertex get_vertex_from_vertex_ref + (const Graph, const VertexRef) + get_vertex_from_vertex_ref + + const + Graph + + + const + VertexRef + + + + + + + + + + + Partition + Partition get_master_partition_from_vertex_ref + (const Graph, const VertexRef) + get_master_partition_from_vertex_ref + + const + Graph + + + const + VertexRef + + + + + + + + + + + char * + char * serialize_vertex_ref + (const Graph, const VertexRef) + serialize_vertex_ref + + const + Graph + + + const + VertexRef + + + + + + + + + + + VertexRef + VertexRef deserialize_to_vertex_ref + (const Graph, const char *) + deserialize_to_vertex_ref + + const + Graph + + + const char * + + + + + + + + + + + EdgeRef + EdgeRef get_edge_ref_for_edge + (const Graph, const Partition, const Edge) + get_edge_ref_for_edge + + const + Graph + + + const + Partition + + + const + Edge + + + + + + + + + + + Edge + Edge get_edge_from_edge_ref + (const Graph, const EdgeRef) + get_edge_from_edge_ref + + const + Graph + + + const + EdgeRef + + + + + + + + + + + Partition + Partition get_master_partition_from_edge_ref + (const Graph, const EdgeRef) + get_master_partition_from_edge_ref + + const + Graph + + + const + EdgeRef + + + + + + + + + + + char * + char * serialize_edge_ref + (const Graph, const EdgeRef) + serialize_edge_ref + + const + Graph + + + const + EdgeRef + + + + + + + + + + + EdgeRef + EdgeRef deserialize_to_edge_ref + (const Graph, const char *) + deserialize_to_edge_ref + + const + Graph + + + const char * + + + + + + + + + + + bool + bool is_vertex_neighbor_local_complete + (const Graph, const Vertex) + is_vertex_neighbor_local_complete + + const + Graph + + + const + Vertex + + + + + + + + + + + PartitionList + PartitionList vertex_neighbor_complete_partitions + (const Graph, const Vertex) + vertex_neighbor_complete_partitions + + const + Graph + + + const + Vertex + + + + + + + + + + + bool + bool is_vertex_property_local_complete + (const Graph, const Vertex) + is_vertex_property_local_complete + + const + Graph + + + const + Vertex + + + + + + + + + + + PartitionList + PartitionList vertex_property_complete_partitions + (const Graph, const Vertex) + vertex_property_complete_partitions + + const + Graph + + + const + Vertex + + + + + + + + + + + bool + bool is_edge_property_local_complete + (const Graph, const Edge) + is_edge_property_local_complete + + const + Graph + + + const + Edge + + + + + + + + + + + PartitionList + PartitionList edge_data_complete_partitions + (const Graph, const Edge) + edge_data_complete_partitions + + const + Graph + + + const + Edge + + + + + + + + + + + + + + + + +#ifndefGRIN_INCLUDE_PARTITION_PARTITION_H_ +#defineGRIN_INCLUDE_PARTITION_PARTITION_H_ + +#include"../predefine.h" + +****addenable_vertex/edge_refmacros**** + +#ifdefENABLE_GRAPH_PARTITION +size_tget_total_partitions_number(constPartitionedGraph); + +PartitionListget_local_partition_list(constPartitionedGraph); + +voiddestroy_partition_list(PartitionList); + +PartitionListcreate_partition_list(); + +boolinsert_partition_to_list(PartitionList,constPartition); + +size_tget_partition_list_size(constPartitionList); + +Partitionget_partition_from_list(constPartitionList,constsize_t); + +#ifdefNATURAL_PARTITION_ID_TRAIT +Partitionget_partition_from_id(constPartitionID); + +PartitionIDget_partition_id(constPartition); +#endif + +void*get_partition_info(constPartitionedGraph,constPartition); + +Graphget_local_graph_from_partition(constPartitionedGraph,constPartition); + + +//master&mirrorverticesforvertexcutpartition +//whiletheyrefertoinner&outerverticesinedgecutpartition +#ifdefined(ENABLE_GRAPH_PARTITION)&&defined(ENABLE_VERTEX_LIST) +VertexListget_master_vertices(constGraph); + +VertexListget_mirror_vertices(constGraph); + +VertexListget_mirror_vertices_by_partition(constGraph,constPartition); + +#ifdefWITH_VERTEX_PROPERTY +VertexListget_master_vertices_by_type(constGraph,constVertexType); + +VertexListget_mirror_vertices_by_type(constGraph,constVertexType); + +VertexListget_mirror_vertices_by_type_partition(constGraph,constVertexType,constPartition); +#endif +#endif + +#ifdefined(ENABLE_GRAPH_PARTITION)&&defined(ENABLE_ADJACENT_LIST) +AdjacentListget_adjacent_master_list(constGraph,constDirection,constVertex); + +AdjacentListget_adjacent_mirror_list(constGraph,constDirection,constVertex); + +AdjacentListget_adjacent_mirror_list_by_partition(constGraph,constDirection, +constPartition,constVertex); +#endif + + +//Vertexrefreferstothesamevertexreferredinotherpartitions, +//whileedgerefislikewise.Bothcanbeserializedtochar*for +//messagetransportinganddeserializedontheotherend. +VertexRefget_vertex_ref_for_vertex(constGraph,constPartition,constVertex); + +Vertexget_vertex_from_vertex_ref(constGraph,constVertexRef); + +Partitionget_master_partition_from_vertex_ref(constGraph,constVertexRef); + +char*serialize_vertex_ref(constGraph,constVertexRef); + +VertexRefdeserialize_to_vertex_ref(constGraph,constchar*); + +EdgeRefget_edge_ref_for_edge(constGraph,constPartition,constEdge); + +Edgeget_edge_from_edge_ref(constGraph,constEdgeRef); + +Partitionget_master_partition_from_edge_ref(constGraph,constEdgeRef); + +char*serialize_edge_ref(constGraph,constEdgeRef); + +EdgeRefdeserialize_to_edge_ref(constGraph,constchar*); + +//Theconceptoflocal_completereferstowhetherwecangetcompletedataorproperties +//locallyinthepartition.Itisorthogonaltotheconceptofmaster/mirrorwhich +//ismainlydesignedfordataaggregation.Insomeextremelycases,mastervertices +//mayNOTcontainallthedataorpropertieslocally. +boolis_vertex_neighbor_local_complete(constGraph,constVertex); + +PartitionListvertex_neighbor_complete_partitions(constGraph,constVertex); + +#ifdefWITH_VERTEX_DATA +boolis_vertex_data_local_complete(constGraph,constVertex); + +PartitionListvertex_data_complete_partitions(constGraph,constVertex); +#endif + +#ifdefWITH_VERTEX_PROPERTY +boolis_vertex_property_local_complete(constGraph,constVertex); + +PartitionListvertex_property_complete_partitions(constGraph,constVertex); +#endif + +#ifdefWITH_EDGE_DATA +boolis_edge_data_local_complete(constGraph,constEdge); + +PartitionListedge_data_complete_partitions(constGraph,constEdge); +#endif + +#ifdefWITH_EDGE_PROPERTY +boolis_edge_property_local_complete(constGraph,constEdge); + +PartitionListedge_data_complete_partitions(constGraph,constEdge); +#endif + +#endif + +#endif//GRIN_INCLUDE_PARTITION_PARTITION_H_ + + + + diff --git a/grin/docs/_build/doxygen/xml/predefine_8h.xml b/grin/docs/_build/doxygen/xml/predefine_8h.xml new file mode 100644 index 000000000..ec44bee8b --- /dev/null +++ b/grin/docs/_build/doxygen/xml/predefine_8h.xml @@ -0,0 +1,1294 @@ + + + + predefine.h + limits.h + stdbool.h + stddef.h + include/partition/partition.h + include/property/label.h + include/property/primarykey.h + include/property/property.h + include/property/propertylist.h + include/property/propertytable.h + include/property/type.h + include/topology/adjacentlist.h + include/topology/edgelist.h + include/topology/structure.h + include/topology/vertexlist.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TopologyMacros
    + Macros for basic graph topology features + + + WITH_VERTEX_ORIGINAL_ID + +There is original ID for a vertex. This facilitates queries starting from a specific vertex, since one can get the vertex handler directly using its original ID. + + + + + + + + + WITH_VERTEX_DATA + +There is data on vertex. E.g., the PageRank value of a vertex. + + + + + + + + + WITH_EDGE_DATA + +There is data on edge. E.g., the weight of an edge. + + + + + + + + + ENABLE_VERTEX_LIST + +Enable the vertex list structure. The vertex list related APIs follow the design principle of GRIN List. + + + + + + + + + ENABLE_VERTEX_LIST_ITERATOR + +Enable the vertex list iterator. The vertex list iterator related APIs follow the design principle of GRIN Iterator. + + + + + + + + + ENABLE_EDGE_LIST + +Enable the edge list structure. The edge list related APIs follow the design principle of GRIN List. + + + + + + + + + ENABLE_EDGE_LIST_ITERATOR + +Enable the edge list iterator. The edge list iterator related APIs follow the design principle of GRIN Iterator. + + + + + + + + + ENABLE_ADJACENT_LIST + +Enable the adjacent list structure. The adjacent list related APIs follow the design principle of GRIN List. + + + + + + + + + ENABLE_ADJACENT_LIST_ITERATOR + +Enable the adjacent list iterator. The adjacent list iterator related APIs follow the design principle of GRIN Iterator. + + + + + + + +
    + +
    PartitionMacros
    + Macros for partitioned graph features + + + ENABLE_GRAPH_PARTITION + +Enable partitioned graph. A partitioned graph usually contains several fragments (i.e., local graphs) that are distributedly stored in a cluster. In GRIN, Graph represents to a single fragment that can be locally accessed. + + + + + + + + + NATURAL_PARTITION_ID_TRAIT + +The storage provides natural number IDs for partitions. It follows the design principle of natural number ID trait in GRIN. + + + + + + + + + ENABLE_VERTEX_REF + +The storage provides reference of vertex that can be recognized in other partitions where the vertex also appears. + + + + + + + + + ENABLE_EDGE_REF + +The storage provides reference of edge that can be recognized in other partitions where the edge also appears. + + + + + + + +
    + +
    PropertyMacros
    + Macros for property graph features + + + WITH_PROPERTY_NAME + +There are property names for properties. The relationship between property name and properties is one-to-many, because properties bound to different vertex/edge types are distinguished even they may share the same property name. Please refer to the design principle of Property for details. + + + + + + + + + WITH_VERTEX_PROPERTY + +There are properties bound to vertices. When vertices are typed, vertex properties are bound to vertex types, according to the definition of vertex type. + + + + + + + + + WITH_VERTEX_PRIMARTY_KEYS + +There are primary keys for vertices. Vertex primary keys is a set of vertex properties whose values can distinguish vertices. When vertices are typed, each vertex type has its own primary keys which distinguishes the vertices of that type. + + +With primary keys, one can get the vertex from the graph or a certain type by providing the values of the primary keys. The macro is unset if WITH_VERTEX_PROPERTY is NOT defined, in which case, one can use WITH_VERTEX_ORIGINAL_ID when vertices have no properties. + + + + + + + NATURAL_VERTEX_TYPE_ID_TRAIT + +The storage provides natural number IDs for vertex types. It follows the design principle of natural ID trait in GRIN. + + + + + + + + + NATURAL_VERTEX_PROPERTY_ID_TRAIT + +The storage provides natural number IDs for properties bound to a certain vertex type. It follows the design principle of natural ID trait in GRIN. + + + + + + + + + WITH_EDGE_PROPERTY + + + + + + + + + + WITH_EDGE_PRIMARTY_KEYS + + + + + + + + + + NATURAL_EDGE_TYPE_ID_TRAIT + + + + + + + + + + NATURAL_EDGE_PROPERTY_ID_TRAIT + + + + + + + + + + WITH_LABEL + +There are labels assigned to vertices or edges. Labels are mainly used in filtering vertcies or edges. + + + + + + + + + COLUMN_STORE_TRAIT + +The storage uses column store for properties. This enables efficient property selections for vertices and edges. + + + + + + + +
    + +
    PredicateMacros
    + Macros for predicate features + + + ENABLE_PREDICATE + +Enable predicates on graph. + + + + + + + +
    + +
    NullValues
    + Macros for Null(invalid) values + + + NULL_TYPE + Undefined + +Null type (undefined data type) + + + + + + + + + NULL_GRAPH + NULL + +Null graph (invalid return value) + + + + + + + + + NULL_VERTEX + NULL + +Non-existing vertex (invalid return value) + + + + + + + + + NULL_EDGE + NULL + +Non-existing edge (invalid return value) + + + + + + + + + NULL_LIST + NULL + +Null list of any kind (invalid return value) + + + + + + + + + NULL_PARTITION + NULL + +Non-existing partition (invalid return value) + + + + + + + + + NULL_VERTEX_REF + NULL + +Null vertex reference (invalid return value) + + + + + + + + + NULL_EDGE_REF + NULL + +Null edge reference (invalid return value) + + + + + + + + + NULL_VERTEX_TYPE + NULL + +Non-existing vertex type (invalid return value) + + + + + + + + + NULL_EDGE_TYPE + NULL + +Non-existing edge type (invalid return value) + + + + + + + + + NULL_PROPERTY + NULL + +Non-existing property (invalid return value) + + + + + + + + + NULL_ROW + NULL + +Null row (invalid return value) + + + + + + + + + NULL_NATURAL_ID + UINT_MAX + +Null natural id of any kind (invalid return value) + + + + + + + +
    + + + + Direction + + IN + = 0 + +incoming + + + + + + OUT + = 1 + +outgoing + + + + + + BOTH + = 2 + +incoming & outgoing + + + + + +Enumerates the directions of edges with respect to a certain vertex. + + + + + + + + + + DataType + + Undefined + = 0 + +other unknown types + + + + + + Int32 + = 1 + +int + + + + + + UInt32 + = 2 + +unsigned int + + + + + + Int64 + = 3 + +long int + + + + + + UInt64 + = 4 + +unsigned long int + + + + + + Float + = 5 + +float + + + + + + Double + = 6 + +double + + + + + + String + = 7 + +string + + + + + + Date32 + = 8 + +short date + + + + + + Date64 + = 9 + +long date + + + + + +Enumerates the datatype supported in the storage. + + + + + + + + + + + void * + typedef void* Graph + + Graph + + + + + + + + + + void * + typedef void* Vertex + + Vertex + + + + + + + + + + void * + typedef void* Edge + + Edge + + + + + + + + + + void * + typedef void* OriginalID + + OriginalID + + + + + + + + + + void * + typedef void* VertexList + + VertexList + + + + + + + + + + void * + typedef void* AdjacentList + + AdjacentList + + + + + + + + + + void * + typedef void* PartitionedGraph + + PartitionedGraph + + + + + + + + + + void * + typedef void* Partition + + Partition + + + + + + + + + + void * + typedef void* PartitionList + + PartitionList + + + + + + + + + + unsigned + typedef unsigned PartitionID + + PartitionID + + + + + + + + + + void * + typedef void* VertexRef + + VertexRef + + + + + + + + + + void * + typedef void* VertexType + + VertexType + + + + + + + + + + void * + typedef void* VertexTypeList + + VertexTypeList + + + + + + + + + + void * + typedef void* VertexProperty + + VertexProperty + + + + + + + + + + void * + typedef void* VertexPropertyList + + VertexPropertyList + + + + + + + + + + void * + typedef void* VertexPropertyTable + + VertexPropertyTable + + + + + + + + + + unsigned + typedef unsigned VertexTypeID + + VertexTypeID + + + + + + + + + + unsigned + typedef unsigned VertexPropertyID + + VertexPropertyID + + + + + + + + + + void * + typedef void* EdgeType + + EdgeType + + + + + + + + + + void * + typedef void* EdgeTypeList + + EdgeTypeList + + + + + + + + + + void * + typedef void* EdgeProperty + + EdgeProperty + + + + + + + + + + void * + typedef void* EdgePropertyList + + EdgePropertyList + + + + + + + + + + void * + typedef void* EdgePropertyTable + + EdgePropertyTable + + + + + + + + + + unsigned + typedef unsigned EdgeTypeID + + EdgeTypeID + + + + + + + + + + unsigned + typedef unsigned EdgePropertyID + + EdgePropertyID + + + + + + + + + + void * + typedef void* Row + + Row + + + + + + + + + + +Pre-defined macros for storage features. Undefine the macros of features that the storage does NOT support, so that APIs under unsupported features will NOT be available to the callers to avoid ambiguity. + + +Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + +#ifndefGRIN_INCLUDE_PREDEFINE_H_ +#defineGRIN_INCLUDE_PREDEFINE_H_ + +#include<limits.h> +#include<stdbool.h> +#include<stddef.h> + + +typedefenum{ +IN=0, +OUT=1, +BOTH=2, +}Direction; + +typedefenum{ +Undefined=0, +Int32=1, +UInt32=2, +Int64=3, +UInt64=4, +Float=5, +Double=6, +String=7, +Date32=8, +Date64=9, +}DataType; + + +#defineWITH_VERTEX_ORIGINAL_ID + +#defineWITH_VERTEX_DATA + +#defineWITH_EDGE_DATA + +#defineENABLE_VERTEX_LIST + +#defineENABLE_VERTEX_LIST_ITERATOR + +#defineENABLE_EDGE_LIST + +#defineENABLE_EDGE_LIST_ITERATOR + +#defineENABLE_ADJACENT_LIST + +#defineENABLE_ADJACENT_LIST_ITERATOR + +#undefWITH_VERTEX_DATA +#undefWITH_EDGE_DATA +#undefENABLE_VERTEX_LIST_ITERATOR +#undefENABLE_EDGE_LIST +#undefENABLE_EDGE_LIST_ITERATOR +#undefENABLE_ADJACENT_LIST_ITERATOR + + + +#defineENABLE_GRAPH_PARTITION + +#defineNATURAL_PARTITION_ID_TRAIT + +#defineENABLE_VERTEX_REF + +#defineENABLE_EDGE_REF + +#ifndefENABLE_GRAPH_PARTITION +#undefNATURAL_PARTITION_ID_TRAIT +#endif + +#undefENABLE_EDGE_REF + + + +#defineWITH_PROPERTY_NAME + +#defineWITH_VERTEX_PROPERTY + +#defineWITH_VERTEX_PRIMARTY_KEYS + +#defineNATURAL_VERTEX_TYPE_ID_TRAIT + +#defineNATURAL_VERTEX_PROPERTY_ID_TRAIT + + +#defineWITH_EDGE_PROPERTY//Thereisanypropertyforedges. +#defineWITH_EDGE_PRIMARTY_KEYS//Thereiscross-typepropertyname. +#defineNATURAL_EDGE_TYPE_ID_TRAIT//Edgetypehasnaturalcontinuousidfrom0. +#defineNATURAL_EDGE_PROPERTY_ID_TRAIT//Edgepropertyhasnaturalcontinuousidfrom0. + +#defineWITH_LABEL + +#defineCOLUMN_STORE_TRAIT + +#if!defined(WITH_VERTEX_PROPERTY)&&!defined(WITH_EDGE_PROPERTY) +#undefWITH_PROPERTY_NAME +#endif + +#ifndefWITH_VERTEX_PROPERTY +#undefWITH_VERTEX_PRIMARTY_KEYS +#undefNATURAL_VERTEX_TYPE_ID_TRAIT +#undefNATURAL_VERTEX_PROPERTY_ID_TRAIT +#endif + +#ifndefWITH_EDGE_PROPERTY +#undefWITH_EDGE_PRIMARTY_KEYS +#undefNATURAL_EDGE_TYPE_ID_TRAIT +#undefNATURAL_EDGE_PROPERTY_ID_TRAIT +#endif + +#undefWITH_VERTEX_PRIMARTY_KEYS + +#undefWITH_LABEL + + +#defineENABLE_PREDICATE +#undefENABLE_PREDICATE + + +#defineNULL_TYPEUndefined +#defineNULL_GRAPHNULL +#defineNULL_VERTEXNULL +#defineNULL_EDGENULL +#defineNULL_LISTNULL +#defineNULL_PARTITIONNULL +#defineNULL_VERTEX_REFNULL +#defineNULL_EDGE_REFNULL +#defineNULL_VERTEX_TYPENULL +#defineNULL_EDGE_TYPENULL +#defineNULL_PROPERTYNULL +#defineNULL_ROWNULL +#defineNULL_NATURAL_IDUINT_MAX + + +/*Definethehandlersusingtypedef*/ +typedefvoid*Graph; +typedefvoid*Vertex; +typedefvoid*Edge; + +#ifdefWITH_VERTEX_ORIGINAL_ID +typedefvoid*OriginalID; +#endif + +#ifdefWITH_VERTEX_DATA +typedefvoid*VertexData; +#endif + +#ifdefENABLE_VERTEX_LIST +typedefvoid*VertexList; +#endif + +#ifdefENABLE_VERTEX_LIST_ITERATOR +typedefvoid*VertexListIterator; +#endif + +#ifdefENABLE_ADJACENT_LIST +typedefvoid*AdjacentList; +#endif + +#ifdefENABLE_ADJACENT_LIST_ITERATOR +typedefvoid*AdjacentListIterator; +#endif + +#ifdefWITH_EDGE_DATA +typedefvoid*EdgeData; +#endif + +#ifdefENABLE_EDGE_LIST +typedefvoid*EdgeList; +#endif + +#ifdefENABLE_EDGE_LIST_ITERATOR +typedefvoid*EdgeListIterator; +#endif + +#ifdefENABLE_GRAPH_PARTITION +typedefvoid*PartitionedGraph; +typedefvoid*Partition; +typedefvoid*PartitionList; +#endif + +#ifdefNATURAL_PARTITION_ID_TRAIT +typedefunsignedPartitionID; +#endif + +#ifdefENABLE_VERTEX_REF +typedefvoid*VertexRef; +#endif + +#ifdefENABLE_EDGE_REF +typedefvoid*EdgeRef; +#endif + + +#ifdefWITH_VERTEX_PROPERTY +typedefvoid*VertexType; +typedefvoid*VertexTypeList; +typedefvoid*VertexProperty; +typedefvoid*VertexPropertyList; +typedefvoid*VertexPropertyTable; +#endif + +#ifdefNATURAL_VERTEX_TYPE_ID_TRAIT +typedefunsignedVertexTypeID; +#endif + +#ifdefNATURAL_VERTEX_PROPERTY_ID_TRAIT +typedefunsignedVertexPropertyID; +#endif + +#ifdefWITH_EDGE_PROPERTY +typedefvoid*EdgeType; +typedefvoid*EdgeTypeList; +typedefvoid*EdgeProperty; +typedefvoid*EdgePropertyList; +typedefvoid*EdgePropertyTable; +#endif + +#ifdefNATURAL_EDGE_TYPE_ID_TRAIT +typedefunsignedEdgeTypeID; +#endif + +#ifdefNATURAL_EDGE_PROPERTY_ID_TRAIT +typedefunsignedEdgePropertyID; +#endif + +#ifdefined(WITH_VERTEX_PROPERTY)||defined(WITH_EDGE_PROPERTY) +typedefvoid*Row; +#endif + +#ifdefWITH_LABEL +typedefvoid*Label +typedefvoid*LabelList +#endif + +#endif//GRIN_INCLUDE_PREDEFINE_H_ + + +
    +
    diff --git a/grin/docs/_build/doxygen/xml/primarykey_8h.xml b/grin/docs/_build/doxygen/xml/primarykey_8h.xml new file mode 100644 index 000000000..e2258ad7e --- /dev/null +++ b/grin/docs/_build/doxygen/xml/primarykey_8h.xml @@ -0,0 +1,180 @@ + + + + primarykey.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VertexTypeList + VertexTypeList get_vertex_types_with_primary_keys + (const Graph) + get_vertex_types_with_primary_keys + + const + Graph + + +get the vertex types with primary keys + + + + +Graph + + +the graph + + + + + + + + + + + VertexPropertyList + VertexPropertyList get_primary_keys_by_vertex_type + (const Graph, const VertexType) + get_primary_keys_by_vertex_type + + const + Graph + + + const + VertexType + + +get the primary keys (property list) of a specific vertex type + + + + +Graph + + +the graph + + + + +VertexType + + +the vertex type + + + + + + + + + + + Vertex + Vertex get_vertex_by_primay_keys + (const Graph, const VertexPropertyList, const Row) + get_vertex_by_primay_keys + + const + Graph + + + const + VertexPropertyList + + + const + Row + + +get the vertex with the given primary keys + + + + +Graph + + +the graph + + + + +VertexPropertyList + + +the primary keys + + + + +Row + + +the values of primary keys + + + + + + + + + + + +Define the primary key related APIs. + + +Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + +#ifndefGRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ +#defineGRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ + +#include"../predefine.h" + +#ifdefWITH_VERTEX_PRIMARY_KEYS +VertexTypeListget_vertex_types_with_primary_keys(constGraph); + +VertexPropertyListget_primary_keys_by_vertex_type(constGraph,constVertexType); + +Vertexget_vertex_by_primay_keys(constGraph,constVertexPropertyList,constRow); +#endif + +#endif//GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ + + + + diff --git a/grin/docs/_build/doxygen/xml/property_8h.xml b/grin/docs/_build/doxygen/xml/property_8h.xml new file mode 100644 index 000000000..8fa3cab97 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/property_8h.xml @@ -0,0 +1,382 @@ + + + + property.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + char * + char * get_vertex_property_name + (const Graph, const VertexProperty) + get_vertex_property_name + + const + Graph + + + const + VertexProperty + + + + + + + + + + + VertexProperty + VertexProperty get_vertex_property_by_name + (const Graph, const VertexType, const char *msg) + get_vertex_property_by_name + + const + Graph + + + const + VertexType + + + const char * + msg + + +get the vertex property with a given name under a specific vertex type + + + + +Graph + + +the graph + + + + +VertexType + + +the specific vertex type + + + + +msg + + +the name + + + + + + + + + + + VertexPropertyList + VertexPropertyList get_vertex_properties_by_name + (const Graph, const char *) + get_vertex_properties_by_name + + const + Graph + + + const char * + + +get all the vertex properties with a given name + + + + +Graph + + +the graph + + + + +msg + + +the name + + + + + + + + + + + char * + char * get_edge_property_name + (const Graph, const EdgeProperty) + get_edge_property_name + + const + Graph + + + const + EdgeProperty + + + + + + + + + + + EdgeProperty + EdgeProperty get_edge_property_by_name + (const Graph, const EdgeType, const char *msg) + get_edge_property_by_name + + const + Graph + + + const + EdgeType + + + const char * + msg + + +get the edge property with a given name under a specific edge type + + + + +Graph + + +the graph + + + + +EdgeType + + +the specific edge type + + + + +msg + + +the name + + + + + + + + + + + EdgePropertyList + EdgePropertyList get_edge_properties_by_name + (const Graph, const char *) + get_edge_properties_by_name + + const + Graph + + + const char * + + +get all the edge properties with a given name + + + + +Graph + + +the graph + + + + +msg + + +the name + + + + + + + + + + + void + void destroy_vertex_property + (VertexProperty) + destroy_vertex_property + + VertexProperty + + +destroy vertex property + + + + +VertexProperty + + +vertex property + + + + + + + + + + + DataType + DataType get_vertex_property_data_type + (VertexProperty) + get_vertex_property_data_type + + VertexProperty + + +get property data type + + + + +VertexProperty + + +vertex property + + + + + + + + + + + VertexType + VertexType get_vertex_property_vertex_type + (VertexProperty) + get_vertex_property_vertex_type + + VertexProperty + + +get the vertex type that the property is bound to + + + + +VertexProperty + + +vertex property + + + + + + + + + + + +Define the property related APIs. + + +Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + +#ifndefGRIN_INCLUDE_PROPERTY_PROPERTY_H_ +#defineGRIN_INCLUDE_PROPERTY_PROPERTY_H_ + +#include"../predefine.h" + +#ifdefWITH_PROPERTY_NAME +char*get_vertex_property_name(constGraph,constVertexProperty); + +VertexPropertyget_vertex_property_by_name(constGraph,constVertexType,constchar*msg); + +VertexPropertyListget_vertex_properties_by_name(constGraph,constchar*); + +char*get_edge_property_name(constGraph,constEdgeProperty); + +EdgePropertyget_edge_property_by_name(constGraph,constEdgeType,constchar*msg); + +EdgePropertyListget_edge_properties_by_name(constGraph,constchar*); +#endif + + +#ifdefWITH_VERTEX_PROPERTY +voiddestroy_vertex_property(VertexProperty); + +DataTypeget_vertex_property_data_type(VertexProperty); + +VertexTypeget_vertex_property_vertex_type(VertexProperty); +#endif + + + +#endif//GRIN_INCLUDE_PROPERTY_PROPERTY_H_ + + + + diff --git a/grin/docs/_build/doxygen/xml/propertylist_8h.xml b/grin/docs/_build/doxygen/xml/propertylist_8h.xml new file mode 100644 index 000000000..2ebbe626a --- /dev/null +++ b/grin/docs/_build/doxygen/xml/propertylist_8h.xml @@ -0,0 +1,453 @@ + + + + propertylist.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    GraphProjection
    + Graph projection mainly works to shrink the properties into a subset in need to improve the retrieval efficiency. Note that only the vertex/edge type with at least one property left in the vertex/edge property list will be kept after the projection. +The projection only works on column store systems. + + + Graph + Graph select_vertex_properties + (const Graph, const VertexPropertyList) + select_vertex_properties + + const + Graph + + + const + VertexPropertyList + + +project vertex properties + + + + + + + + + Graph + Graph select_edge_properteis + (const Graph, const EdgePropertyList) + select_edge_properteis + + const + Graph + + + const + EdgePropertyList + + +project edge properties + + + + + + + +
    + + + VertexPropertyList + VertexPropertyList get_vertex_property_list_by_type + (const Graph, const VertexType) + get_vertex_property_list_by_type + + const + Graph + + + const + VertexType + + + + + + + + + + + size_t + size_t get_vertex_property_list_size + (const VertexPropertyList) + get_vertex_property_list_size + + const + VertexPropertyList + + + + + + + + + + + VertexProperty + VertexProperty get_vertex_property_from_list + (const VertexPropertyList, const size_t) + get_vertex_property_from_list + + const + VertexPropertyList + + + const + size_t + + + + + + + + + + + VertexPropertyList + VertexPropertyList create_vertex_property_list + () + create_vertex_property_list + + + + + + + + + + void + void destroy_vertex_property_list + (VertexPropertyList) + destroy_vertex_property_list + + VertexPropertyList + + + + + + + + + + + bool + bool insert_vertex_property_to_list + (VertexPropertyList, const VertexProperty) + insert_vertex_property_to_list + + VertexPropertyList + + + const + VertexProperty + + + + + + + + + + + VertexProperty + VertexProperty get_vertex_property_from_id + (const VertexType, const VertexPropertyID) + get_vertex_property_from_id + + const + VertexType + + + const + VertexPropertyID + + + + + + + + + + + VertexPropertyID + VertexPropertyID get_vertex_property_id + (const VertexType, const VertexProperty) + get_vertex_property_id + + const + VertexType + + + const + VertexProperty + + + + + + + + + + + EdgePropertyList + EdgePropertyList get_edge_property_list_by_type + (const Graph, const EdgeType) + get_edge_property_list_by_type + + const + Graph + + + const + EdgeType + + + + + + + + + + + size_t + size_t get_edge_property_list_size + (const EdgePropertyList) + get_edge_property_list_size + + const + EdgePropertyList + + + + + + + + + + + EdgeProperty + EdgeProperty get_edge_property_from_list + (const EdgePropertyList, const size_t) + get_edge_property_from_list + + const + EdgePropertyList + + + const + size_t + + + + + + + + + + + EdgePropertyList + EdgePropertyList create_edge_property_list + () + create_edge_property_list + + + + + + + + + + void + void destroy_edge_property_list + (EdgePropertyList) + destroy_edge_property_list + + EdgePropertyList + + + + + + + + + + + bool + bool insert_edge_property_to_list + (EdgePropertyList, const EdgeProperty) + insert_edge_property_to_list + + EdgePropertyList + + + const + EdgeProperty + + + + + + + + + + + EdgeProperty + EdgeProperty get_edge_property_from_id + (const EdgeType, const EdgePropertyID) + get_edge_property_from_id + + const + EdgeType + + + const + EdgePropertyID + + + + + + + + + + + EdgePropertyID + EdgePropertyID get_edge_property_id + (const EdgeType, const EdgeProperty) + get_edge_property_id + + const + EdgeType + + + const + EdgeProperty + + + + + + + + + + + +Define the property list related and graph projection APIs. + + +Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + +#ifndefGRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ +#defineGRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ + +#include"../predefine.h" + +//Propertylist +#ifdefWITH_VERTEX_PROPERTY +VertexPropertyListget_vertex_property_list_by_type(constGraph,constVertexType); + +size_tget_vertex_property_list_size(constVertexPropertyList); + +VertexPropertyget_vertex_property_from_list(constVertexPropertyList,constsize_t); + +VertexPropertyListcreate_vertex_property_list(); + +voiddestroy_vertex_property_list(VertexPropertyList); + +boolinsert_vertex_property_to_list(VertexPropertyList,constVertexProperty); +#endif + +#ifdefNATURAL_VERTEX_PROPERTY_ID_TRAIT +VertexPropertyget_vertex_property_from_id(constVertexType,constVertexPropertyID); + +VertexPropertyIDget_vertex_property_id(constVertexType,constVertexProperty); +#endif + + +#ifdefWITH_EDGE_PROPERTY +EdgePropertyListget_edge_property_list_by_type(constGraph,constEdgeType); + +size_tget_edge_property_list_size(constEdgePropertyList); + +EdgePropertyget_edge_property_from_list(constEdgePropertyList,constsize_t); + +EdgePropertyListcreate_edge_property_list(); + +voiddestroy_edge_property_list(EdgePropertyList); + +boolinsert_edge_property_to_list(EdgePropertyList,constEdgeProperty); +#endif + +#ifdefNATURAL_EDGE_PROPERTY_ID_TRAIT +EdgePropertyget_edge_property_from_id(constEdgeType,constEdgePropertyID); + +EdgePropertyIDget_edge_property_id(constEdgeType,constEdgeProperty); +#endif + + +#ifdefined(WITH_VERTEX_PROPERTY)&&defined(COLUMN_STORE_TRAIT) +Graphselect_vertex_properties(constGraph,constVertexPropertyList); +#endif + +#ifdefined(WITH_EDGE_PROPERTY)&&defined(COLUMN_STORE_TRAIT) +Graphselect_edge_properteis(constGraph,constEdgePropertyList); +#endif + +#endif//GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ + + +
    +
    diff --git a/grin/docs/_build/doxygen/xml/propertytable_8h.xml b/grin/docs/_build/doxygen/xml/propertytable_8h.xml new file mode 100644 index 000000000..2cc4ad73c --- /dev/null +++ b/grin/docs/_build/doxygen/xml/propertytable_8h.xml @@ -0,0 +1,326 @@ + + + + propertytable.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Row
    + Row works as the pure value array for the properties of a vertex or an edge. In general, you can think of Row as an array of void*, where each void* points to the value of a property. GRIN assumes the user already knows the corresponding property list beforehead, so that she/he knows how to cast the void* into the property's data type. + + + void + void destroy_row + (Row) + destroy_row + + Row + + + + + + + + + + + void * + void * get_value_from_row + (Row, const size_t) + get_value_from_row + + Row + + + const + size_t + + +the value of a property from row by its position in row + + + + + + + + + Row + Row create_row + () + create_row + +create a row, usually to get vertex/edge by primary keys + + + + + + + + + bool + bool insert_value_to_row + (Row, const void *) + insert_value_to_row + + Row + + + const void * + + +insert a value to the end of the row + + + + + + + +
    + + + void + void destroy_vertex_property_table + (VertexPropertyTable) + destroy_vertex_property_table + + VertexPropertyTable + + +destroy vertex property table + + + + +VertexPropertyTable + + +vertex property table + + + + + + + + + + + VertexPropertyTable + VertexPropertyTable get_vertex_property_table_by_type + (const Graph, const VertexType) + get_vertex_property_table_by_type + + const + Graph + + + const + VertexType + + +get the vertex property table of a certain vertex type No matter column or row store strategy is used in the storage, GRIN recommends to first get the property table of the vertex type, and then fetch values(rows) by vertex and property(list). However, GRIN does provide direct row fetching API when COLUMN_STORE_TRAIT is NOT set. + + + + +Graph + + +the graph + + + + +VertexType + + +the vertex type + + + + + + + + + + + void * + void * get_value_from_vertex_property_table + (const VertexPropertyTable, const Vertex, const VertexProperty) + get_value_from_vertex_property_table + + const + VertexPropertyTable + + + const + Vertex + + + const + VertexProperty + + +get vertex property value from table + + + + +VertexPropertyTable + + +vertex property table + + + + +Vertex + + +the vertex which is the row index + + + + +VertexProperty + + +the vertex property which is the column index + + + +can be casted to the property data type by the caller + + + + + + + + + Row + Row get_row_from_vertex_property_table + (const VertexPropertyTable, const Vertex, const VertexPropertyList) + get_row_from_vertex_property_table + + const + VertexPropertyTable + + + const + Vertex + + + const + VertexPropertyList + + +get vertex row from table + + + + +VertexPropertyTable + + +vertex property table + + + + +Vertex + + +the vertex which is the row index + + + + +VertexPropertyList + + +the vertex property list as columns + + + + + + + + + + + +Define the property table related APIs. + + +Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + +#ifndefGRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ +#defineGRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ + +#include"../predefine.h" + +#ifdefined(WITH_VERTEX_PROPERTY)||defined(WITH_EDGE_PROPERTY) +voiddestroy_row(Row); + +void*get_value_from_row(Row,constsize_t); + +Rowcreate_row(); + +boolinsert_value_to_row(Row,constvoid*); +#endif + +#ifdefWITH_VERTEX_PROPERTY +voiddestroy_vertex_property_table(VertexPropertyTable); + +VertexPropertyTableget_vertex_property_table_by_type(constGraph,constVertexType); + +void*get_value_from_vertex_property_table(constVertexPropertyTable,constVertex,constVertexProperty); + +Rowget_row_from_vertex_property_table(constVertexPropertyTable,constVertex,constVertexPropertyList); + +#ifndefCOLUMN_STORE_TRAIT +Rowget_vertex_row(constGraph,constVertex,constVertexPropertyList); +#endif +#endif + + +#endif//GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ + + +
    +
    diff --git a/grin/docs/_build/doxygen/xml/structure_8h.xml b/grin/docs/_build/doxygen/xml/structure_8h.xml new file mode 100644 index 000000000..72f8fac85 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/structure_8h.xml @@ -0,0 +1,435 @@ + + + + structure.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bool + bool is_directed + (const Graph) + is_directed + + const + Graph + + + + +Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + + + + + bool + bool is_multigraph + (const Graph) + is_multigraph + + const + Graph + + + + + + + + + + + size_t + size_t get_vertex_num + (const Graph) + get_vertex_num + + const + Graph + + + + + + + + + + + size_t + size_t get_vertex_num_by_type + (const Graph, const VertexType) + get_vertex_num_by_type + + const + Graph + + + const + VertexType + + + + + + + + + + + size_t + size_t get_edge_num + (const Graph) + get_edge_num + + const + Graph + + + + + + + + + + + size_t + size_t get_edge_num_by_type + (const Graph, const EdgeType) + get_edge_num_by_type + + const + Graph + + + const + EdgeType + + + + + + + + + + + void + void destroy_vertex + (Vertex) + destroy_vertex + + Vertex + + + + + + + + + + + DataType + DataType get_vertex_data_type + (const Graph, const Vertex) + get_vertex_data_type + + const + Graph + + + const + Vertex + + + + + + + + + + + VertexData + VertexData get_vertex_data_value + (const Graph, const Vertex) + get_vertex_data_value + + const + Graph + + + const + Vertex + + + + + + + + + + + void + void destroy_vertex_data + (VertexData) + destroy_vertex_data + + VertexData + + + + + + + + + + + Vertex + Vertex get_vertex_from_original_id + (const Graph, const OriginalID) + get_vertex_from_original_id + + const + Graph + + + const + OriginalID + + + + + + + + + + + Vertex + Vertex get_vertex_from_type_original_id + (const Graph, const VertexType, const OriginalID) + get_vertex_from_type_original_id + + const + Graph + + + const + VertexType + + + const + OriginalID + + + + + + + + + + + OriginalID + OriginalID get_vertex_original_id + (const Graph, const Vertex) + get_vertex_original_id + + const + Graph + + + const + Vertex + + + + + + + + + + + void + void destroy_vertex_original_id + (OriginalID) + destroy_vertex_original_id + + OriginalID + + + + + + + + + + + void + void destroy_edge + (Edge) + destroy_edge + + Edge + + + + + + + + + + + Vertex + Vertex get_edge_src + (const Graph, const Edge) + get_edge_src + + const + Graph + + + const + Edge + + + + + + + + + + + Vertex + Vertex get_edge_dst + (const Graph, const Edge) + get_edge_dst + + const + Graph + + + const + Edge + + + + + + + + + + + + + + + + +#ifndefGRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ +#defineGRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ + +#include"../predefine.h" + +//Graph +boolis_directed(constGraph); + +boolis_multigraph(constGraph); + +size_tget_vertex_num(constGraph); + +#ifdefWITH_VERTEX_PROPERTY +size_tget_vertex_num_by_type(constGraph,constVertexType); +#endif + +size_tget_edge_num(constGraph); + +#ifdefWITH_EDGE_PROPERTY +size_tget_edge_num_by_type(constGraph,constEdgeType); +#endif + + +//Vertex +voiddestroy_vertex(Vertex); + +#ifdefWITH_VERTEX_DATA +DataTypeget_vertex_data_type(constGraph,constVertex); + +VertexDataget_vertex_data_value(constGraph,constVertex); + +voiddestroy_vertex_data(VertexData); +#endif + +#ifdefWITH_VERTEX_ORIGINAL_ID +Vertexget_vertex_from_original_id(constGraph,constOriginalID); + +#ifdefWITH_VERTEX_PROPERTY +Vertexget_vertex_from_type_original_id(constGraph,constVertexType,constOriginalID); +#endif + +OriginalIDget_vertex_original_id(constGraph,constVertex); + +voiddestroy_vertex_original_id(OriginalID); +#endif + + +//Edge +voiddestroy_edge(Edge); + +Vertexget_edge_src(constGraph,constEdge); + +Vertexget_edge_dst(constGraph,constEdge); + +#ifdefWITH_EDGE_DATA +DataTypeget_edge_data_type(constGraph,constEdge); + +EdgeDataget_edge_data_value(constGraph,constEdge); + +voiddestroy_edge_data(EdgeData); +#endif + +#endif//GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ + + + + diff --git a/grin/docs/_build/doxygen/xml/type_8h.xml b/grin/docs/_build/doxygen/xml/type_8h.xml new file mode 100644 index 000000000..311abddce --- /dev/null +++ b/grin/docs/_build/doxygen/xml/type_8h.xml @@ -0,0 +1,593 @@ + + + + type.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    VertexEdgeTypeRelation
    + GRIN assumes the relation between edge type and pairs of vertex types is many-to-many. Thus GRIN returns the pairs of vertex types related to an edge type as a pair of vertex type lists of the same size, and the src/dst vertex types are aligned with their positions in the lists. + + + VertexTypeList + VertexTypeList get_src_types_from_edge_type + (const Graph, const EdgeType) + get_src_types_from_edge_type + + const + Graph + + + const + EdgeType + + +the src vertex type list + + + + + + + + + VertexTypeList + VertexTypeList get_dst_types_from_edge_type + (const Graph, const EdgeType) + get_dst_types_from_edge_type + + const + Graph + + + const + EdgeType + + +get the dst vertex type list + + + + + + + + + EdgeTypeList + EdgeTypeList get_edge_types_from_vertex_type_pair + (const Graph, const VertexType, const VertexType) + get_edge_types_from_vertex_type_pair + + const + Graph + + + const + VertexType + + + const + VertexType + + +get the edge type list related to a given pair of vertex types + + + + + + + +
    + + + VertexType + VertexType get_vertex_type + (const Graph, const Vertex) + get_vertex_type + + const + Graph + + + const + Vertex + + + + + + + + + + + char * + char * get_vertex_type_name + (const Graph, const VertexType) + get_vertex_type_name + + const + Graph + + + const + VertexType + + + + + + + + + + + VertexType + VertexType get_vertex_type_by_name + (const Graph, char *) + get_vertex_type_by_name + + const + Graph + + + char * + + + + + + + + + + + VertexTypeList + VertexTypeList get_vertex_type_list + (const Graph) + get_vertex_type_list + + const + Graph + + + + + + + + + + + void + void destroy_vertex_type_list + (VertexTypeList) + destroy_vertex_type_list + + VertexTypeList + + + + + + + + + + + VertexTypeList + VertexTypeList create_vertex_type_list + () + create_vertex_type_list + + + + + + + + + + bool + bool insert_vertex_type_to_list + (VertexTypeList, const VertexType) + insert_vertex_type_to_list + + VertexTypeList + + + const + VertexType + + + + + + + + + + + size_t + size_t get_vertex_type_list_size + (const VertexTypeList) + get_vertex_type_list_size + + const + VertexTypeList + + + + + + + + + + + VertexType + VertexType get_vertex_type_from_list + (const VertexTypeList, const size_t) + get_vertex_type_from_list + + const + VertexTypeList + + + const + size_t + + + + + + + + + + + VertexTypeID + VertexTypeID get_vertex_type_id + (const VertexType) + get_vertex_type_id + + const + VertexType + + + + + + + + + + + VertexType + VertexType get_vertex_type_from_id + (const VertexTypeID) + get_vertex_type_from_id + + const + VertexTypeID + + + + + + + + + + + EdgeType + EdgeType get_edge_type + (const Graph, const Edge) + get_edge_type + + const + Graph + + + const + Edge + + + + + + + + + + + char * + char * get_edge_type_name + (const Graph, const EdgeType) + get_edge_type_name + + const + Graph + + + const + EdgeType + + + + + + + + + + + EdgeType + EdgeType get_edge_type_by_name + (const Graph, char *) + get_edge_type_by_name + + const + Graph + + + char * + + + + + + + + + + + EdgeTypeList + EdgeTypeList get_edge_type_list + (const Graph) + get_edge_type_list + + const + Graph + + + + + + + + + + + void + void destroy_edge_type_list + (EdgeTypeList) + destroy_edge_type_list + + EdgeTypeList + + + + + + + + + + + EdgeTypeList + EdgeTypeList create_edge_type_list + () + create_edge_type_list + + + + + + + + + + bool + bool insert_edge_type_to_list + (EdgeTypeList, const EdgeType) + insert_edge_type_to_list + + EdgeTypeList + + + const + EdgeType + + + + + + + + + + + size_t + size_t get_edge_type_list_size + (const EdgeTypeList) + get_edge_type_list_size + + const + EdgeTypeList + + + + + + + + + + + EdgeType + EdgeType get_edge_type_from_list + (const EdgeTypeList, const size_t) + get_edge_type_from_list + + const + EdgeTypeList + + + const + size_t + + + + + + + + + + + EdgeTypeID + EdgeTypeID get_edge_type_id + (const EdgeType) + get_edge_type_id + + const + EdgeType + + + + + + + + + + + EdgeType + EdgeType get_edge_type_from_id + (const EdgeTypeID) + get_edge_type_from_id + + const + EdgeTypeID + + + + + + + + + + + +Define the vertex/edge type related APIs. + + +Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + +#ifndefGRIN_INCLUDE_PROPERTY_TYPE_H_ +#defineGRIN_INCLUDE_PROPERTY_TYPE_H_ + +#include"../predefine.h" + +#ifdefWITH_VERTEX_PROPERTY +//Vertextype +VertexTypeget_vertex_type(constGraph,constVertex); + +char*get_vertex_type_name(constGraph,constVertexType); + +VertexTypeget_vertex_type_by_name(constGraph,char*); + +//Vertextypelist +VertexTypeListget_vertex_type_list(constGraph); + +voiddestroy_vertex_type_list(VertexTypeList); + +VertexTypeListcreate_vertex_type_list(); + +boolinsert_vertex_type_to_list(VertexTypeList,constVertexType); + +size_tget_vertex_type_list_size(constVertexTypeList); + +VertexTypeget_vertex_type_from_list(constVertexTypeList,constsize_t); +#endif + + +#ifdefNATURAL_VERTEX_TYPE_ID_TRAIT +VertexTypeIDget_vertex_type_id(constVertexType); + +VertexTypeget_vertex_type_from_id(constVertexTypeID); +#endif + + +#ifdefWITH_EDGE_PROPERTY +//Edgetype +EdgeTypeget_edge_type(constGraph,constEdge); + +char*get_edge_type_name(constGraph,constEdgeType); + +EdgeTypeget_edge_type_by_name(constGraph,char*); + +//Edgetypelist +EdgeTypeListget_edge_type_list(constGraph); + +voiddestroy_edge_type_list(EdgeTypeList); + +EdgeTypeListcreate_edge_type_list(); + +boolinsert_edge_type_to_list(EdgeTypeList,constEdgeType); + +size_tget_edge_type_list_size(constEdgeTypeList); + +EdgeTypeget_edge_type_from_list(constEdgeTypeList,constsize_t); +#endif + +#ifdefNATURAL_EDGE_TYPE_ID_TRAIT +EdgeTypeIDget_edge_type_id(constEdgeType); + +EdgeTypeget_edge_type_from_id(constEdgeTypeID); +#endif + +#ifdefined(WITH_VERTEX_PROPERTY)&&defined(WITH_EDGE_PROPERTY) +VertexTypeListget_src_types_from_edge_type(constGraph,constEdgeType); + +VertexTypeListget_dst_types_from_edge_type(constGraph,constEdgeType); + +EdgeTypeListget_edge_types_from_vertex_type_pair(constGraph,constVertexType,constVertexType); +#endif + +#endif//GRIN_INCLUDE_PROPERTY_TYPE_H_ + + +
    +
    diff --git a/grin/docs/_build/doxygen/xml/vertexlist_8h.xml b/grin/docs/_build/doxygen/xml/vertexlist_8h.xml new file mode 100644 index 000000000..5c6fe0cd5 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/vertexlist_8h.xml @@ -0,0 +1,281 @@ + + + + vertexlist.h + ../predefine.h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + VertexList + VertexList get_vertex_list + (const Graph) + get_vertex_list + + const + Graph + + + + +Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + + + + + + + VertexList + VertexList get_vertex_list_by_type + (const Graph, const VertexType) + get_vertex_list_by_type + + const + Graph + + + const + VertexType + + + + + + + + + + + void + void destroy_vertex_list + (VertexList) + destroy_vertex_list + + VertexList + + + + + + + + + + + VertexList + VertexList create_vertex_list + () + create_vertex_list + + + + + + + + + + bool + bool insert_vertex_to_list + (VertexList, const Vertex) + insert_vertex_to_list + + VertexList + + + const + Vertex + + + + + + + + + + + size_t + size_t get_vertex_list_size + (const VertexList) + get_vertex_list_size + + const + VertexList + + + + + + + + + + + Vertex + Vertex get_vertex_from_list + (const VertexList, const size_t) + get_vertex_from_list + + const + VertexList + + + const + size_t + + + + + + + + + + + VertexListIterator + VertexListIterator get_vertex_list_begin + (const Graph) + get_vertex_list_begin + + const + Graph + + + + + + + + + + + VertexListIterator + VertexListIterator get_vertex_list_begin_by_type + (const Graph, const VertexType) + get_vertex_list_begin_by_type + + const + Graph + + + const + VertexType + + + + + + + + + + + bool + bool get_next_vertex_list_iter + (VertexListIterator) + get_next_vertex_list_iter + + VertexListIterator + + + + + + + + + + + Vertex + Vertex get_vertex_from_iter + (VertexListIterator) + get_vertex_from_iter + + VertexListIterator + + + + + + + + + + + + + + + + +#ifndefGRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ +#defineGRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ + +#include"../predefine.h" + +#ifdefENABLE_VERTEX_LIST + +VertexListget_vertex_list(constGraph); + +#ifdefWITH_VERTEX_PROPERTY +VertexListget_vertex_list_by_type(constGraph,constVertexType); +#endif + +voiddestroy_vertex_list(VertexList); + +VertexListcreate_vertex_list(); + +boolinsert_vertex_to_list(VertexList,constVertex); + +size_tget_vertex_list_size(constVertexList); + +Vertexget_vertex_from_list(constVertexList,constsize_t); + +#ifdefENABLE_VERTEX_LIST_ITERATOR +VertexListIteratorget_vertex_list_begin(constGraph); + +#ifdefWITH_VERTEX_PROPERTY +VertexListIteratorget_vertex_list_begin_by_type(constGraph,constVertexType); +#endif + +boolget_next_vertex_list_iter(VertexListIterator); + +Vertexget_vertex_from_iter(VertexListIterator); +#endif + + +#endif + +#endif//GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ + + + + diff --git a/grin/docs/_build/doxygen/xml/xml.xsd b/grin/docs/_build/doxygen/xml/xml.xsd new file mode 100644 index 000000000..9f80fe158 --- /dev/null +++ b/grin/docs/_build/doxygen/xml/xml.xsd @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/grin/include/index/label.h b/grin/include/index/label.h new file mode 100644 index 000000000..7b3a0fc88 --- /dev/null +++ b/grin/include/index/label.h @@ -0,0 +1,101 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/** + @file label.h + @brief Define the label related APIs +*/ + +#ifndef GRIN_INCLUDE_INDEX_LABEL_H_ +#define GRIN_INCLUDE_INDEX_LABEL_H_ + +#include "../predefine.h" + +#if defined(WITH_VERTEX_LABEL) || defined(WITH_EDGE_LABEL) +Label get_label_by_name(const Graph, const char*); + +char* get_label_name(const Graph, const Label); + +void destroy_label(Label); + +void destroy_label_list(LabelList); + +size_t get_label_list_size(const LabelList); + +Label get_label_from_list(const LabelList, const size_t); +#endif + +#ifdef WITH_VERTEX_LABEL +/** + * @brief assign a label to a vertex + * @param Graph the graph + * @param Label the label + * @param Vertex the vertex + * @return whether succeed +*/ +bool assign_label_to_vertex(const Graph, const Label, Vertex); + +/** + * @brief get the label list of a vertex + * @param Graph the graph + * @param Vertex the vertex +*/ +LabelList get_vertex_label_list(const Graph, const Vertex); + +/** + * @brief get the vertex list by label + * @param Graph the graph + * @param Label the label +*/ +VertexList get_vertex_list_by_label(const Graph, const Label); + +/** + * @brief filtering an existing vertex list by label + * @param VertexList the existing vertex list + * @param Label the label +*/ +VertexList filter_vertex_list_by_label(const VertexList, const Label); +#endif + +#ifdef WITH_EDGE_LABEL +/** + * @brief assign a label to a edge + * @param Graph the graph + * @param Label the label + * @param Edge the edge + * @return whether succeed +*/ +bool assign_label_to_edge(const Graph, const Label, Edge); + +/** + * @brief get the label list of a edge + * @param Graph the graph + * @param Edge the edge +*/ +LabelList get_edge_label_list(const Graph, const Edge); + +/** + * @brief get the edge list by label + * @param Graph the graph + * @param Label the label +*/ +EdgeList get_edge_list_by_label(const Graph, const Label); + +/** + * @brief filtering an existing edge list by label + * @param EdgeList the existing edge list + * @param Label the label +*/ +EdgeList filter_edge_list_by_label(const EdgeList, const Label); +#endif + +#endif // GRIN_INCLUDE_INDEX_LABEL_H_ \ No newline at end of file diff --git a/grin/include/partition/partition.h b/grin/include/partition/partition.h index cf9ca7d81..8ca032cea 100644 --- a/grin/include/partition/partition.h +++ b/grin/include/partition/partition.h @@ -18,6 +18,8 @@ limitations under the License. #include "../predefine.h" +**** add enable_vertex/edge_ref macros **** + #ifdef ENABLE_GRAPH_PARTITION size_t get_total_partitions_number(const PartitionedGraph); @@ -53,12 +55,12 @@ VertexList get_mirror_vertices(const Graph); VertexList get_mirror_vertices_by_partition(const Graph, const Partition); -#ifdef WITH_VERTEX_LABEL -VertexList get_master_vertices_by_label(const Graph, const VertexLabel); +#ifdef WITH_VERTEX_PROPERTY +VertexList get_master_vertices_by_type(const Graph, const VertexType); -VertexList get_mirror_vertices_by_label(const Graph, const VertexLabel); +VertexList get_mirror_vertices_by_type(const Graph, const VertexType); -VertexList get_mirror_vertices_by_label_partition(const Graph, const VertexLabel, const Partition); +VertexList get_mirror_vertices_by_type_partition(const Graph, const VertexType, const Partition); #endif #endif @@ -127,10 +129,6 @@ bool is_edge_property_local_complete(const Graph, const Edge); PartitionList edge_data_complete_partitions(const Graph, const Edge); #endif -#ifndef EDGECUT_PARTITION_TRAIT -PartitionList vertex_complete_partitions(const Graph, const Vertex); -#endif - #endif #endif // GRIN_INCLUDE_PARTITION_PARTITION_H_ diff --git a/grin/include/predefine.h b/grin/include/predefine.h index a697a8c6b..d14a37178 100644 --- a/grin/include/predefine.h +++ b/grin/include/predefine.h @@ -12,6 +12,15 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ + +/** + * @file predefine.h + * @brief Pre-defined macros for storage features. + * Undefine the macros of features that the storage does NOT support, + * so that APIs under unsupported features will NOT be available to + * the callers to avoid ambiguity. +*/ + #ifndef GRIN_INCLUDE_PREDEFINE_H_ #define GRIN_INCLUDE_PREDEFINE_H_ @@ -19,117 +28,309 @@ limitations under the License. #include #include -// The enum type for edge directions. + +/// Enumerates the directions of edges with respect to a certain vertex typedef enum { - IN = 0, - OUT = 1, - BOTH = 2, + IN = 0, ///< incoming + OUT = 1, ///< outgoing + BOTH = 2, ///< incoming & outgoing } Direction; -// The enum type for vertex/edge data type. +/// Enumerates the datatype supported in the storage typedef enum { - Undefined = 0, - Int32 = 1, - UInt32 = 2, - Int64 = 3, - UInt64 = 4, - Float = 5, - Double = 6, - String = 7, - Date32 = 8, - Date64 = 9, + Undefined = 0, ///< other unknown types + Int32 = 1, ///< int + UInt32 = 2, ///< unsigned int + Int64 = 3, ///< long int + UInt64 = 4, ///< unsigned long int + Float = 5, ///< float + Double = 6, ///< double + String = 7, ///< string + Date32 = 8, ///< short date + Date64 = 9, ///< long date } DataType; -/* The following macros are defined as the features of the storage. */ -#define WITH_VERTEX_ORIGIN_ID // There is origin id for vertex semantic -// #define WITH_VERTEX_DATA // There is data on vertex. -// #define WITH_EDGE_DATA // There is data on edge, e.g. weight. -#define ENABLE_VERTEX_LIST // Enable the vertex list structure. -// #define ENABLE_VERTEX_LIST_ITERATOR // There is vertex list iterator for unknown size list. -#define CONTINUOUS_VERTEX_ID_TRAIT // Enable continous vertex id for vertex list. -#define ENABLE_EDGE_LIST // Enable the edge list structure. -// #define ENABLE_EDGE_LIST_ITERATOR // There is edge list iterator for unknown size list. -#define ENABLE_ADJACENT_LIST // Enable the adjacent list structure. -// #define ENABLE_ADJACENT_LIST_ITERATOR // There is adjacent list iterator for unknown size list. - -// partitioned graph -#define ENABLE_GRAPH_PARTITION // Enable partitioned graph. -#define EDGECUT_PARTITION_TRAIT // Use edgecut partition strategy. -#define NATURAL_PARTITION_ID_TRAIT // Partition has natural continuous id from 0. -// #define ENABLE_VALID_VERTEX_REF_LIST // There is valid vertex ref list for vertex -// #define ENABLE_VALID_VERTEX_REF_LIST_ITERATOR // There is valid vertex ref list iterator for vertex -// #define ENABLE_VALID_EDGE_REF_LIST // There is valid edge ref list for edge -// #define ENABLE_VALID_EDGE_REF_LIST_ITERATOR // There is valid edge ref list iterator for vertex -#ifdef EDGECUT_PARTITION_TRAIT +/** @name TopologyMacros + * @brief Macros for basic graph topology features + */ +///@{ +/** @ingroup TopologyMacros + * @brief There is original ID for a vertex. + * This facilitates queries starting from a specific vertex, + * since one can get the vertex handler directly using its original ID. + */ +#define WITH_VERTEX_ORIGINAL_ID + +/** @ingroup TopologyMacros + * @brief There is data on vertex. E.g., the PageRank value of a vertex. + */ +#define WITH_VERTEX_DATA + +/** @ingroup TopologyMacros + * @brief There is data on edge. E.g., the weight of an edge. +*/ +#define WITH_EDGE_DATA + +/** @ingroup TopologyMacros + * @brief Enable the vertex list structure. + * The vertex list related APIs follow the design principle of GRIN List. +*/ +#define ENABLE_VERTEX_LIST + +/** @ingroup TopologyMacros + * @brief Enable the vertex list iterator. + * The vertex list iterator related APIs follow the design principle of GRIN Iterator. +*/ +#define ENABLE_VERTEX_LIST_ITERATOR + +/** @ingroup TopologyMacros + * @brief Enable the edge list structure. + * The edge list related APIs follow the design principle of GRIN List. +*/ +#define ENABLE_EDGE_LIST + +/** @ingroup TopologyMacros + * @brief Enable the edge list iterator. + * The edge list iterator related APIs follow the design principle of GRIN Iterator. +*/ +#define ENABLE_EDGE_LIST_ITERATOR + +/** @ingroup TopologyMacros + * @brief Enable the adjacent list structure. + * The adjacent list related APIs follow the design principle of GRIN List. +*/ +#define ENABLE_ADJACENT_LIST + +/** @ingroup TopologyMacros + * @brief Enable the adjacent list iterator. + * The adjacent list iterator related APIs follow the design principle of GRIN Iterator. +*/ +#define ENABLE_ADJACENT_LIST_ITERATOR + +#undef WITH_VERTEX_DATA +#undef WITH_EDGE_DATA +#undef ENABLE_VERTEX_LIST_ITERATOR #undef ENABLE_EDGE_LIST +#undef ENABLE_EDGE_LIST_ITERATOR +#undef ENABLE_ADJACENT_LIST_ITERATOR +///@} + + +/** @name PartitionMacros + * @brief Macros for partitioned graph features + */ +///@{ +/** @ingroup PartitionMacros + * @brief Enable partitioned graph. A partitioned graph usually contains + * several fragments (i.e., local graphs) that are distributedly stored + * in a cluster. In GRIN, Graph represents to a single fragment that can + * be locally accessed. + */ +#define ENABLE_GRAPH_PARTITION + +/** @ingroup PartitionMacros + * @brief The storage provides natural number IDs for partitions. + * It follows the design principle of natural number ID trait in GRIN. +*/ +#define NATURAL_PARTITION_ID_TRAIT + +/** @ingroup PartitionMacros + * @brief The storage provides reference of vertex that can be + * recognized in other partitions where the vertex also appears. +*/ +#define ENABLE_VERTEX_REF + +/** @ingroup PartitionMacros + * @brief The storage provides reference of edge that can be + * recognized in other partitions where the edge also appears. +*/ +#define ENABLE_EDGE_REF + +#ifndef ENABLE_GRAPH_PARTITION +#undef NATURAL_PARTITION_ID_TRAIT #endif -// propertygraph -#define WITH_VERTEX_LABEL // There are labels on vertices. -#define WITH_VERTEX_PROPERTY // There is any property on vertices. -#define WITH_VERTEX_PROPERTY_NAME // There is cross-label property name. -// #define WITH_VERTEX_PRIMARTY_KEYS // There are primary keys for vertex. -#define NATURAL_VERTEX_LABEL_ID_TRAIT // Vertex label has natural continuous id from 0. -#define NATURAL_VERTEX_PROPERTY_ID_TRAIT // Vertex property has natural continuous id from 0. -#define WITH_EDGE_LABEL // There are labels for edges. +#undef ENABLE_EDGE_REF +///@} + + +/** @name PropertyMacros + * @brief Macros for property graph features + */ +///@{ +/** @ingroup PropertyMacros + * @brief There are property names for properties. The relationship between property + * name and properties is one-to-many, because properties bound to different vertex/edge + * types are distinguished even they may share the same property name. Please refer to + * the design principle of Property for details. +*/ +#define WITH_PROPERTY_NAME + +/** @ingroup PropertyMacros + * @brief There are properties bound to vertices. When vertices are typed, vertex + * properties are bound to vertex types, according to the definition of vertex type. +*/ +#define WITH_VERTEX_PROPERTY + +/** @ingroup PropertyMacros + * @brief There are primary keys for vertices. Vertex primary keys is + * a set of vertex properties whose values can distinguish vertices. When vertices are + * typed, each vertex type has its own primary keys which distinguishes the vertices of + * that type. + * + * With primary keys, one can get the vertex from the graph or a certain type + * by providing the values of the primary keys. The macro is unset if WITH_VERTEX_PROPERTY + * is NOT defined, in which case, one can use WITH_VERTEX_ORIGINAL_ID when vertices have + * no properties. +*/ +#define WITH_VERTEX_PRIMARTY_KEYS + +/** @ingroup PropertyMacros + * @brief The storage provides natural number IDs for vertex types. + * It follows the design principle of natural ID trait in GRIN. +*/ +#define NATURAL_VERTEX_TYPE_ID_TRAIT + +/** @ingroup PropertyMacros + * @brief The storage provides natural number IDs for properties bound to + * a certain vertex type. + * It follows the design principle of natural ID trait in GRIN. +*/ +#define NATURAL_VERTEX_PROPERTY_ID_TRAIT + + #define WITH_EDGE_PROPERTY // There is any property for edges. -#define WITH_EDGE_PROPERTY_NAME // There is cross-label property name. -#define NATURAL_EDGE_LABEL_ID_TRAIT // Edge label has natural continuous id from 0. +#define WITH_EDGE_PRIMARTY_KEYS // There is cross-type property name. +#define NATURAL_EDGE_TYPE_ID_TRAIT // Edge type has natural continuous id from 0. #define NATURAL_EDGE_PROPERTY_ID_TRAIT // Edge property has natural continuous id from 0. -#define COLUMN_STORE // Column-oriented storage for properties. -#define ENABLE_VERTEX_ROW_LIST_ITERATOR // Enable vertex row list iterator. - -// predicate -// #define ENABLE_PREDICATE // Enable predicates for vertices and edges. - - -/* The followings macros are defined as invalid value. */ -#define NULL_TYPE NULL // Null type (null data type) -#define NULL_GRAPH NULL // Null graph handle (invalid return value). -#define NULL_VERTEX NULL // Null vertex handle (invalid return value). -#define NULL_EDGE NULL // Null edge handle (invalid return value). -#define NULL_LIST NULL // Null list of any kind (invalid return value). -#define NULL_PARTITION NULL // Null partition handle (invalid return value). -#define NULL_VERTEX_REF NULL // Null vertex ref (invalid return value). -#define NULL_EDGE_REF NULL // Null edge ref (invalid return value). -#define NULL_VERTEX_LABEL NULL // Null vertex label handle (invalid return value). -#define NULL_EDGE_LABEL NULL // Null edge label handle (invalid return value). -#define NULL_PROPERTY NULL // Null property handle (invalid return value). -#define NULL_ROW NULL // Null row handle (invalid return value). -#define NULL_NATURAL_ID UINT_MAX // Null natural id (invalid return value). - -/* The following data types shall be defined through typedef. */ + + +/** @ingroup PropertyMacros + * @brief The storage uses column store for properties. + * This enables efficient property selections for vertices and edges. +*/ +#define COLUMN_STORE_TRAIT + +#if !defined(WITH_VERTEX_PROPERTY) && !defined(WITH_EDGE_PROPERTY) +#undef WITH_PROPERTY_NAME +#endif + +#ifndef WITH_VERTEX_PROPERTY +#undef WITH_VERTEX_PRIMARTY_KEYS +#undef NATURAL_VERTEX_TYPE_ID_TRAIT +#undef NATURAL_VERTEX_PROPERTY_ID_TRAIT +#endif + +#ifndef WITH_EDGE_PROPERTY +#undef WITH_EDGE_PRIMARTY_KEYS +#undef NATURAL_EDGE_TYPE_ID_TRAIT +#undef NATURAL_EDGE_PROPERTY_ID_TRAIT +#endif + +#undef WITH_VERTEX_PRIMARTY_KEYS + +#undef WITH_LABEL +///@} + +/** @name PredicateMacros + * @brief Macros for predicate features + */ +///@{ +/** @ingroup PredicateMacros + * @brief Enable predicates on graph. +*/ +#define ENABLE_PREDICATE +#undef ENABLE_PREDICATE +///@} + +/** @name IndexMacros + * @brief Macros for index features + */ +///@{ +/** @ingroup IndexMacros + * @brief Enable vertex label on graph. +*/ +#define WITH_VERTEX_LABEL + +/** @ingroup IndexMacros + * @brief Enable edge label on graph. +*/ +#define WITH_EDGE_LABEL + +#undef WITH_VERTEX_LABEL +#undef WITH_EDGE_LABEL +///@} + +/** @name NullValues + * Macros for Null(invalid) values + */ +///@{ +/** @brief Null type (undefined data type) */ +#define NULL_TYPE Undefined +/** @brief Null graph (invalid return value) */ +#define NULL_GRAPH NULL +/** @brief Non-existing vertex (invalid return value) */ +#define NULL_VERTEX NULL +/** @brief Non-existing edge (invalid return value) */ +#define NULL_EDGE NULL +/** @brief Null list of any kind (invalid return value) */ +#define NULL_LIST NULL +/** @brief Non-existing partition (invalid return value) */ +#define NULL_PARTITION NULL +/** @brief Null vertex reference (invalid return value) */ +#define NULL_VERTEX_REF NULL +/** @brief Null edge reference (invalid return value) */ +#define NULL_EDGE_REF NULL +/** @brief Non-existing vertex type (invalid return value) */ +#define NULL_VERTEX_TYPE NULL +/** @brief Non-existing edge type (invalid return value) */ +#define NULL_EDGE_TYPE NULL +/** @brief Non-existing property (invalid return value) */ +#define NULL_PROPERTY NULL +/** @brief Null row (invalid return value) */ +#define NULL_ROW NULL +/** @brief Null natural id of any kind (invalid return value) */ +#define NULL_NATURAL_ID UINT_MAX +///@} + + +/* Define the handlers using typedef */ typedef void* Graph; typedef void* Vertex; typedef void* Edge; -#ifdef WITH_VERTEX_ORIGIN_ID -typedef void* OriginID; +#ifdef WITH_VERTEX_ORIGINAL_ID +typedef void* OriginalID; #endif + #ifdef WITH_VERTEX_DATA typedef void* VertexData; #endif + #ifdef ENABLE_VERTEX_LIST typedef void* VertexList; #endif + #ifdef ENABLE_VERTEX_LIST_ITERATOR typedef void* VertexListIterator; #endif -#ifdef CONTINUOUS_VERTEX_ID_TRAIT -typedef void* VertexID; -#endif + #ifdef ENABLE_ADJACENT_LIST typedef void* AdjacentList; #endif + #ifdef ENABLE_ADJACENT_LIST_ITERATOR typedef void* AdjacentListIterator; #endif + #ifdef WITH_EDGE_DATA typedef void* EdgeData; #endif + #ifdef ENABLE_EDGE_LIST typedef void* EdgeList; #endif + #ifdef ENABLE_EDGE_LIST_ITERATOR typedef void* EdgeListIterator; #endif @@ -138,45 +339,60 @@ typedef void* EdgeListIterator; typedef void* PartitionedGraph; typedef void* Partition; typedef void* PartitionList; +#endif + #ifdef NATURAL_PARTITION_ID_TRAIT typedef unsigned PartitionID; #endif + +#ifdef ENABLE_VERTEX_REF typedef void* VertexRef; -typedef void* EdgeRef; #endif -#ifdef WITH_VERTEX_LABEL -typedef void* VertexLabel; -typedef void* VertexLabelList; -#ifdef NATURAL_VERTEX_LABEL_ID_TRAIT -typedef unsigned VertexLabelID; -#endif +#ifdef ENABLE_EDGE_REF +typedef void* EdgeRef; #endif -#ifdef WITH_EDGE_LABEL -typedef void* EdgeLabel; -typedef void* EdgeLabelList; -#ifdef NATURAL_EDGE_LABEL_ID_TRAIT -typedef unsigned EdgeLabelID; -#endif -#endif #ifdef WITH_VERTEX_PROPERTY +typedef void* VertexType; +typedef void* VertexTypeList; typedef void* VertexProperty; -#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT -typedef unsigned VertexPropertyID; -#endif typedef void* VertexPropertyList; typedef void* VertexPropertyTable; #endif +#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT +typedef unsigned VertexTypeID; +#endif + +#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT +typedef unsigned VertexPropertyID; +#endif + #ifdef WITH_EDGE_PROPERTY +typedef void* EdgeType; +typedef void* EdgeTypeList; typedef void* EdgeProperty; +typedef void* EdgePropertyList; +typedef void* EdgePropertyTable; +#endif + +#ifdef NATURAL_EDGE_TYPE_ID_TRAIT +typedef unsigned EdgeTypeID; +#endif + #ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT typedef unsigned EdgePropertyID; #endif -typedef void* EdgePropertyList; -typedef void* EdgePropertyTable; + +#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) +typedef void* Row; +#endif + +#ifdef WITH_LABEL +typedef void* Label +typedef void* LabelList #endif #endif // GRIN_INCLUDE_PREDEFINE_H_ diff --git a/grin/include/property/label.h b/grin/include/property/label.h deleted file mode 100644 index 36039deeb..000000000 --- a/grin/include/property/label.h +++ /dev/null @@ -1,83 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This header file is not available for libgrape-lite. - -#ifndef GRIN_INCLUDE_PROPERTY_LABEL_H_ -#define GRIN_INCLUDE_PROPERTY_LABEL_H_ - -#include "../predefine.h" - -#ifdef WITH_VERTEX_LABEL -// Vertex label -VertexLabel get_vertex_label(const Graph, const Vertex); - -char* get_vertex_label_name(const Graph, const VertexLabel); - -VertexLabel get_vertex_label_by_name(const Graph, char*); - -#ifdef NATURAL_VERTEX_LABEL_ID_TRAIT -VertexLabelID get_vertex_label_id(const VertexLabel); - -VertexLabel get_vertex_label_from_id(const VertexLabelID); -#endif - -// Vertex label list -VertexLabelList get_vertex_label_list(const Graph); - -void destroy_vertex_label_list(VertexLabelList); - -VertexLabelList create_vertex_label_list(); - -bool insert_vertex_label_to_list(VertexLabelList, const VertexLabel); - -size_t get_vertex_label_list_size(const VertexLabelList); - -VertexLabel get_vertex_label_from_list(const VertexLabelList, const size_t); -#endif - -#ifdef WITH_EDGE_LABEL -// Edge label -EdgeLabel get_edge_label(const Graph, const Edge); - -char* get_edge_label_name(const Graph, const EdgeLabel); - -EdgeLabel get_edge_label_by_name(const Graph, char*); - -#ifdef NATURAL_EDGE_LABEL_ID_TRAIT -EdgeLabelID get_edge_label_id(const EdgeLabel); - -EdgeLabel get_edge_label_from_id(const EdgeLabelID); -#endif - -// Edge label list -EdgeLabelList get_edge_label_list(const Graph); - -void destroy_edge_label_list(EdgeLabelList); - -EdgeLabelList create_edge_label_list(); - -bool insert_edge_label_to_list(EdgeLabelList, const EdgeLabel); - -size_t get_edge_label_list_size(const EdgeLabelList); - -EdgeLabel get_edge_label_from_list(const EdgeLabelList, const size_t); -#endif - - -#if defined(WITH_VERTEX_LABEL) && defined(WITH_EDGE_LABEL) -VertexLabel get_src_label_from_edge_label(const Graph, const EdgeLabel); - -VertexLabel get_dst_label_from_edge_label(const Graph, const EdgeLabel); -#endif - -#endif // GRIN_INCLUDE_PROPERTY_LABEL_H_ \ No newline at end of file diff --git a/grin/include/property/primarykey.h b/grin/include/property/primarykey.h index 55912ccb6..5d26ff903 100644 --- a/grin/include/property/primarykey.h +++ b/grin/include/property/primarykey.h @@ -10,19 +10,60 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This header file is not available for libgrape-lite. +/** + @file primarykey.h + @brief Define the primary key related APIs +*/ #ifndef GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ #define GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ #include "../predefine.h" -#ifdef WITH_VERTEX_PRIMARTY_KEYS +#ifdef WITH_VERTEX_PRIMARY_KEYS +/** + * @brief get the vertex types with primary keys + * @param Graph the graph +*/ +VertexTypeList get_vertex_types_with_primary_keys(const Graph); + +/** + * @brief get the primary keys (property list) of a specific vertex type + * @param Graph the graph + * @param VertexType the vertex type +*/ +VertexPropertyList get_primary_keys_by_vertex_type(const Graph, const VertexType); + +/** + * @brief get the vertex with the given primary keys + * @param Graph the graph + * @param VertexPropertyList the primary keys + * @param Row the values of primary keys +*/ +Vertex get_vertex_by_primay_keys(const Graph, const VertexPropertyList, const Row); +#endif -VertexPropertyList get_primary_keys(const Graph); +#ifdef WITH_EDGE_PRIMARY_KEYS +/** + * @brief get the edge types with primary keys + * @param Graph the graph +*/ +EdgeTypeList get_edge_types_with_primary_keys(const Graph); -Vertex get_vertex_from_primay_keys(const Graph, const Row); +/** + * @brief get the primary keys (property list) of a specific edge type + * @param Graph the graph + * @param EdgeType the edge type +*/ +EdgePropertyList get_primary_keys_by_edge_type(const Graph, const EdgeType); +/** + * @brief get the edge with the given primary keys + * @param Graph the graph + * @param EdgePropertyList the primary keys + * @param Row the values of primary keys +*/ +Edge get_edge_by_primay_keys(const Graph, const EdgePropertyList, const Row); #endif #endif // GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ \ No newline at end of file diff --git a/grin/include/property/property.h b/grin/include/property/property.h index d072c59da..6cf647a82 100644 --- a/grin/include/property/property.h +++ b/grin/include/property/property.h @@ -10,68 +10,91 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This header file is not available for libgrape-lite. +/** + @file property.h + @brief Define the property related APIs +*/ #ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_H_ #define GRIN_INCLUDE_PROPERTY_PROPERTY_H_ #include "../predefine.h" -// Vertex Property -#ifdef WITH_VERTEX_PROPERTY -void destroy_vertex_property(VertexProperty); - -DataType get_vertex_property_type(VertexProperty); - -// Vertex Property Name -#ifdef WITH_VERTEX_PROPERTY_NAME +#ifdef WITH_PROPERTY_NAME char* get_vertex_property_name(const Graph, const VertexProperty); -VertexProperty get_vertex_property_by_name(const Graph, const VertexLabel, const char*); -#endif +/** + * @brief get the vertex property with a given name under a specific vertex type + * @param Graph the graph + * @param VertexType the specific vertex type + * @param msg the name + */ +VertexProperty get_vertex_property_by_name(const Graph, const VertexType, const char* msg); + +/** + * @brief get all the vertex properties with a given name + * @param Graph the graph + * @param msg the name + */ +VertexPropertyList get_vertex_properties_by_name(const Graph, const char*); -// Vertex Property Table -void destroy_vertex_property_table(VertexPropertyTable); +char* get_edge_property_name(const Graph, const EdgeProperty); -void* get_value_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexProperty); +/** + * @brief get the edge property with a given name under a specific edge type + * @param Graph the graph + * @param EdgeType the specific edge type + * @param msg the name + */ +EdgeProperty get_edge_property_by_name(const Graph, const EdgeType, const char* msg); + +/** + * @brief get all the edge properties with a given name + * @param Graph the graph + * @param msg the name + */ +EdgePropertyList get_edge_properties_by_name(const Graph, const char*); +#endif -VertexPropertyTable get_vertex_property_table_by_label(const Graph, const VertexLabel); -#ifdef COLUMN_STORE -VertexPropertyTable get_vertex_property_table_for_property(const Graph, const VertexProperty); -#else -VertexPropertyTable get_vertex_property_table_for_vertex(const Graph, const Vertex); -#endif +#ifdef WITH_VERTEX_PROPERTY +/** + * @brief destroy vertex property + * @param VertexProperty vertex property + */ +void destroy_vertex_property(VertexProperty); +/** + * @brief get property data type + * @param VertexProperty vertex property + */ +DataType get_vertex_property_data_type(VertexProperty); + +/** + * @brief get the vertex type that the property is bound to + * @param VertexProperty vertex property + */ +VertexType get_vertex_property_vertex_type(VertexProperty); #endif - -// Edge Property #ifdef WITH_EDGE_PROPERTY +/** + * @brief destroy edge property + * @param EdgeProperty edge property + */ void destroy_edge_property(EdgeProperty); -DataType get_edge_property_type(EdgeProperty); - -// Edge Property Name -#ifdef WITH_EDGE_PROPERTY_NAME -char* get_edge_property_name(const Graph, const EdgeProperty); - -EdgeProperty get_edge_property_by_name(const Graph, const EdgeLabel, const char*); -#endif - -// Edge Property Table -void destroy_edge_property_table(EdgePropertyTable); - -void* get_value_from_edge_property_table(const EdgePropertyTable, const Edge, const EdgeProperty); - -EdgePropertyTable get_edge_property_table_by_label(const Graph, const EdgeLabel); - -#ifdef COLUMN_STORE -EdgePropertyTable get_edge_property_table_for_property(const Graph, const EdgeProperty); -#else -EdgePropertyTable get_edge_property_table_for_edge(const Graph, const Edge); -#endif - +/** + * @brief get property data type + * @param EdgeProperty edge property + */ +DataType get_edge_property_data_type(EdgeProperty); + +/** + * @brief get the edge type that the property is bound to + * @param EdgeProperty edge property + */ +EdgeType get_edge_property_edge_type(EdgeProperty); #endif #endif // GRIN_INCLUDE_PROPERTY_PROPERTY_H_ \ No newline at end of file diff --git a/grin/include/property/propertylist.h b/grin/include/property/propertylist.h index 9fce4e827..0c7e5508a 100644 --- a/grin/include/property/propertylist.h +++ b/grin/include/property/propertylist.h @@ -10,7 +10,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This header file is not available for libgrape-lite. +/** + @file propertylist.h + @brief Define the property list related and graph projection APIs +*/ #ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ #define GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ @@ -19,7 +22,7 @@ limitations under the License. // Property list #ifdef WITH_VERTEX_PROPERTY -VertexPropertyList get_all_vertex_properties(const Graph); +VertexPropertyList get_vertex_property_list_by_type(const Graph, const VertexType); size_t get_vertex_property_list_size(const VertexPropertyList); @@ -30,20 +33,17 @@ VertexPropertyList create_vertex_property_list(); void destroy_vertex_property_list(VertexPropertyList); bool insert_vertex_property_to_list(VertexPropertyList, const VertexProperty); - -#ifdef WITH_VERTEX_LABEL -VertexPropertyList get_all_vertex_properties_by_label(const Graph, const VertexLabel); +#endif #ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT -VertexProperty get_vertex_property_from_id(const VertexLabel, const VertexPropertyID); +VertexProperty get_vertex_property_from_id(const VertexType, const VertexPropertyID); -VertexPropertyID get_vertex_property_id(const VertexLabel, const VertexProperty); -#endif -#endif +VertexPropertyID get_vertex_property_id(const VertexType, const VertexProperty); #endif + #ifdef WITH_EDGE_PROPERTY -EdgePropertyList get_all_edge_properties(const Graph); +EdgePropertyList get_edge_property_list_by_type(const Graph, const EdgeType); size_t get_edge_property_list_size(const EdgePropertyList); @@ -54,30 +54,31 @@ EdgePropertyList create_edge_property_list(); void destroy_edge_property_list(EdgePropertyList); bool insert_edge_property_to_list(EdgePropertyList, const EdgeProperty); - -#ifdef WITH_EDGE_LABEL -EdgePropertyList get_all_edge_properties_by_label(const Graph, const EdgeLabel); +#endif #ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT -EdgeProperty get_edge_property_from_id(const EdgeLabel, const EdgePropertyID); +EdgeProperty get_edge_property_from_id(const EdgeType, const EdgePropertyID); -EdgePropertyID get_edge_property_id(const EdgeLabel, const EdgeProperty); -#endif -#endif +EdgePropertyID get_edge_property_id(const EdgeType, const EdgeProperty); #endif -#if defined(WITH_VERTEX_LABEL) && defined(WITH_VERTEX_PRIMARTY_KEYS) -PropertyList get_primary_keys_by_label(const Graph, const VertexLabel); -Vertex get_vertex_by_primary_keys_and_label(const Graph, const Row, - const VertexLabel); -#endif - -// graph projection -#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE) +/** @name GraphProjection + * Graph projection mainly works to shrink the properties into a subset + * in need to improve the retrieval efficiency. Note that only the vertex/edge + * type with at least one property left in the vertex/edge property list will + * be kept after the projection. + * + * The projection only works on column store systems. + */ +///@{ +#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE_TRAIT) +/** @brief project vertex properties */ Graph select_vertex_properties(const Graph, const VertexPropertyList); #endif -#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE) + +#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE_TRAIT) +/** @brief project edge properties */ Graph select_edge_properteis(const Graph, const EdgePropertyList); #endif diff --git a/grin/include/property/propertytable.h b/grin/include/property/propertytable.h new file mode 100644 index 000000000..889298ce3 --- /dev/null +++ b/grin/include/property/propertytable.h @@ -0,0 +1,139 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/** + @file propertytable.h + @brief Define the property table related APIs +*/ + +#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ +#define GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ + +#include "../predefine.h" + +/** @name Row + * Row works as the pure value array for the properties of a vertex or an edge. + * In general, you can think of Row as an array of void*, where each void* points to + * the value of a property. GRIN assumes the user already knows the corresponding + * property list beforehead, so that she/he knows how to cast the void* into the + * property's data type. + */ +///@{ +#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) +void destroy_row(Row); + +/** @brief the value of a property from row by its position in row */ +void* get_value_from_row(Row, const size_t); + +/** @brief create a row, usually to get vertex/edge by primary keys */ +Row create_row(); + +/** @brief insert a value to the end of the row */ +bool insert_value_to_row(Row, const void*); +#endif +///@} + +#ifdef WITH_VERTEX_PROPERTY +/** + * @brief destroy vertex property table + * @param VertexPropertyTable vertex property table + */ +void destroy_vertex_property_table(VertexPropertyTable); + +/** + * @brief get the vertex property table of a certain vertex type + * No matter column or row store strategy is used in the storage, + * GRIN recommends to first get the property table of the vertex type, + * and then fetch values(rows) by vertex and property(list). However, + * GRIN does provide direct row fetching API when COLUMN_STORE_TRAIT + * is NOT set. + * @param Graph the graph + * @param VertexType the vertex type + */ +VertexPropertyTable get_vertex_property_table_by_type(const Graph, const VertexType); + +/** + * @brief get vertex property value from table + * @param VertexPropertyTable vertex property table + * @param Vertex the vertex which is the row index + * @param VertexProperty the vertex property which is the column index + * @return can be casted to the property data type by the caller + */ +void* get_value_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexProperty); + +/** + * @brief get vertex row from table + * @param VertexPropertyTable vertex property table + * @param Vertex the vertex which is the row index + * @param VertexPropertyList the vertex property list as columns + */ +Row get_row_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexPropertyList); + +#ifndef COLUMN_STORE_TRAIT +/** + * @brief get vertex row directly from the graph, this API only works for row store system + * @param Graph the graph + * @param Vertex the vertex which is the row index + * @param VertexPropertyList the vertex property list as columns + */ +Row get_vertex_row(const Graph, const Vertex, const VertexPropertyList); +#endif +#endif + +#ifdef WITH_EDGE_PROPERTY +/** + * @brief destroy edge property table + * @param EdgePropertyTable edge property table + */ +void destroy_edge_property_table(EdgePropertyTable); + +/** + * @brief get the edge property table of a certain edge type + * No matter column or row store strategy is used in the storage, + * GRIN recommends to first get the property table of the edge type, + * and then fetch values(rows) by edge and property(list). However, + * GRIN does provide direct row fetching API when COLUMN_STORE_TRAIT + * is NOT set. + * @param Graph the graph + * @param EdgeType the edge type + */ +EdgePropertyTable get_edge_property_table_by_type(const Graph, const EdgeType); + +/** + * @brief get edge property value from table + * @param EdgePropertyTable edge property table + * @param Edge the edge which is the row index + * @param EdgeProperty the edge property which is the column index + * @return can be casted to the property data type by the caller + */ +void* get_value_from_edge_property_table(const EdgePropertyTable, const Edge, const EdgeProperty); + +/** + * @brief get edge row from table + * @param EdgePropertyTable edge property table + * @param Edge the edge which is the row index + * @param EdgePropertyList the edge property list as columns + */ +Row get_row_from_edge_property_table(const EdgePropertyTable, const Edge, const EdgePropertyList); + +#ifndef COLUMN_STORE_TRAIT +/** + * @brief get edge row directly from the graph, this API only works for row store system + * @param Graph the graph + * @param Edge the edge which is the row index + * @param EdgePropertyList the edge property list as columns + */ +Row get_edge_row(const Graph, const Edge, const EdgePropertyList); +#endif +#endif + +#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ \ No newline at end of file diff --git a/grin/include/property/type.h b/grin/include/property/type.h new file mode 100644 index 000000000..7709439b3 --- /dev/null +++ b/grin/include/property/type.h @@ -0,0 +1,99 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/** + @file type.h + @brief Define the vertex/edge type related APIs +*/ + +#ifndef GRIN_INCLUDE_PROPERTY_TYPE_H_ +#define GRIN_INCLUDE_PROPERTY_TYPE_H_ + +#include "../predefine.h" + +#ifdef WITH_VERTEX_PROPERTY +// Vertex type +VertexType get_vertex_type(const Graph, const Vertex); + +char* get_vertex_type_name(const Graph, const VertexType); + +VertexType get_vertex_type_by_name(const Graph, char*); + +// Vertex type list +VertexTypeList get_vertex_type_list(const Graph); + +void destroy_vertex_type_list(VertexTypeList); + +VertexTypeList create_vertex_type_list(); + +bool insert_vertex_type_to_list(VertexTypeList, const VertexType); + +size_t get_vertex_type_list_size(const VertexTypeList); + +VertexType get_vertex_type_from_list(const VertexTypeList, const size_t); +#endif + + +#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT +VertexTypeID get_vertex_type_id(const VertexType); + +VertexType get_vertex_type_from_id(const VertexTypeID); +#endif + + +#ifdef WITH_EDGE_PROPERTY +// Edge type +EdgeType get_edge_type(const Graph, const Edge); + +char* get_edge_type_name(const Graph, const EdgeType); + +EdgeType get_edge_type_by_name(const Graph, char*); + +// Edge type list +EdgeTypeList get_edge_type_list(const Graph); + +void destroy_edge_type_list(EdgeTypeList); + +EdgeTypeList create_edge_type_list(); + +bool insert_edge_type_to_list(EdgeTypeList, const EdgeType); + +size_t get_edge_type_list_size(const EdgeTypeList); + +EdgeType get_edge_type_from_list(const EdgeTypeList, const size_t); +#endif + +#ifdef NATURAL_EDGE_TYPE_ID_TRAIT +EdgeTypeID get_edge_type_id(const EdgeType); + +EdgeType get_edge_type_from_id(const EdgeTypeID); +#endif + +/** @name VertexEdgeTypeRelation + * GRIN assumes the relation between edge type and pairs of vertex types is many-to-many. + * Thus GRIN returns the pairs of vertex types related to an edge type as a pair of vertex type + * lists of the same size, and the src/dst vertex types are aligned with their positions in the lists. + */ +///@{ +#if defined(WITH_VERTEX_PROPERTY) && defined(WITH_EDGE_PROPERTY) +/** @brief the src vertex type list */ +VertexTypeList get_src_types_from_edge_type(const Graph, const EdgeType); + +/** @brief get the dst vertex type list */ +VertexTypeList get_dst_types_from_edge_type(const Graph, const EdgeType); + +/** @brief get the edge type list related to a given pair of vertex types */ +EdgeTypeList get_edge_types_from_vertex_type_pair(const Graph, const VertexType, const VertexType); +#endif +///@} + +#endif // GRIN_INCLUDE_PROPERTY_TYPE_H_ \ No newline at end of file diff --git a/grin/include/topology/adjacentlist.h b/grin/include/topology/adjacentlist.h index d7c1906ac..e0f524d8e 100644 --- a/grin/include/topology/adjacentlist.h +++ b/grin/include/topology/adjacentlist.h @@ -21,8 +21,8 @@ limitations under the License. #ifdef ENABLE_ADJACENT_LIST AdjacentList get_adjacent_list(const Graph, const Direction, Vertex); -#ifdef WITH_EDGE_LABEL -AdjacentList get_adjacent_list_by_edge_label(const Graph, const Direction, Vertex, EdgeLabel); +#ifdef WITH_EDGE_PROPERTY +AdjacentList get_adjacent_list_by_edge_type(const Graph, const Direction, Vertex, EdgeType); #endif void destroy_adjacent_list(AdjacentList); diff --git a/grin/include/topology/edgelist.h b/grin/include/topology/edgelist.h index 5b66d82aa..4393d2394 100644 --- a/grin/include/topology/edgelist.h +++ b/grin/include/topology/edgelist.h @@ -22,8 +22,8 @@ limitations under the License. EdgeList get_edge_list(const Graph, const Direction); -#ifdef WITH_EDGE_LABEL -EdgeList get_edge_list_by_label(const Graph, const EdgeLabel); +#ifdef WITH_EDGE_PROPERTY +EdgeList get_edge_list_by_type(const Graph, const EdgeType); #endif void destroy_edge_list(EdgeList); @@ -39,8 +39,8 @@ Edge get_edge_from_list(const EdgeList, size_t); #ifdef ENABLE_EDGE_LIST_ITERATOR EdgeListIterator get_edge_list_begin(const Graph); -#ifdef WITH_EDGE_LABEL -EdgeListIterator get_edge_list_begin_by_label(const Graph, const EdgeLabel); +#ifdef WITH_EDGE_PROPERTY +EdgeListIterator get_edge_list_begin_by_type(const Graph, const EdgeType); #endif bool get_next_edge_list_iter(EdgeListIterator); diff --git a/grin/include/topology/structure.h b/grin/include/topology/structure.h index 3b6b785a8..1ff0764aa 100644 --- a/grin/include/topology/structure.h +++ b/grin/include/topology/structure.h @@ -25,14 +25,14 @@ bool is_multigraph(const Graph); size_t get_vertex_num(const Graph); -#ifdef WITH_VERTEX_LABEL -size_t get_vertex_num_by_label(const Graph, const VertexLabel); +#ifdef WITH_VERTEX_PROPERTY +size_t get_vertex_num_by_type(const Graph, const VertexType); #endif size_t get_edge_num(const Graph); -#ifdef WITH_EDGE_LABEL -size_t get_edge_num_by_label(const Graph, const EdgeLabel); +#ifdef WITH_EDGE_PROPERTY +size_t get_edge_num_by_type(const Graph, const EdgeType); #endif @@ -47,16 +47,16 @@ VertexData get_vertex_data_value(const Graph, const Vertex); void destroy_vertex_data(VertexData); #endif -#ifdef WITH_VERTEX_ORIGIN_ID -Vertex get_vertex_from_origin_id(const Graph, const OriginID); +#ifdef WITH_VERTEX_ORIGINAL_ID +Vertex get_vertex_from_original_id(const Graph, const OriginalID); -#ifdef WITH_VERTEX_LABEL -Vertex get_vertex_from_label_origin_id(const Graph, const VertexLabel, const OriginID); +#ifdef WITH_VERTEX_PROPERTY +Vertex get_vertex_from_type_original_id(const Graph, const VertexType, const OriginalID); #endif -OriginID get_vertex_origin_id(const Graph, const Vertex); +OriginalID get_vertex_original_id(const Graph, const Vertex); -void destroy_vertex_origin_id(OriginID); +void destroy_vertex_original_id(OriginalID); #endif diff --git a/grin/include/topology/vertexlist.h b/grin/include/topology/vertexlist.h index cb097956b..b88e3c99a 100644 --- a/grin/include/topology/vertexlist.h +++ b/grin/include/topology/vertexlist.h @@ -22,8 +22,8 @@ limitations under the License. VertexList get_vertex_list(const Graph); -#ifdef WITH_VERTEX_LABEL -VertexList get_vertex_list_by_label(const Graph, const VertexLabel); +#ifdef WITH_VERTEX_PROPERTY +VertexList get_vertex_list_by_type(const Graph, const VertexType); #endif void destroy_vertex_list(VertexList); @@ -39,8 +39,8 @@ Vertex get_vertex_from_list(const VertexList, const size_t); #ifdef ENABLE_VERTEX_LIST_ITERATOR VertexListIterator get_vertex_list_begin(const Graph); -#ifdef WITH_VERTEX_LABEL -VertexListIterator get_vertex_list_begin_by_label(const Graph, const VertexLabel); +#ifdef WITH_VERTEX_PROPERTY +VertexListIterator get_vertex_list_begin_by_type(const Graph, const VertexType); #endif bool get_next_vertex_list_iter(VertexListIterator); @@ -48,21 +48,6 @@ bool get_next_vertex_list_iter(VertexListIterator); Vertex get_vertex_from_iter(VertexListIterator); #endif -#ifdef CONTINUOUS_VERTEX_ID_TRAIT -bool is_vertex_list_continuous(const VertexList); - -VertexID get_begin_vertex_id_from_list(const VertexList); - -VertexID get_end_vertex_id_from_list(const VertexList); - -DataType get_vertex_id_data_type(const Graph); - -VertexID get_vertex_id(const Vertex); - -Vertex get_vertex_from_id(const VertexID); - -void destroy_vertex_id(VertexID); -#endif #endif From f2bf33284a0ebce595120f700b67d2b86915564f Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Sun, 26 Feb 2023 19:18:16 +0800 Subject: [PATCH 09/85] refine grin *.cc --- grin/docs/Doxyfile.bak | 2553 ----------------- .../doxygen/html/adjacentlist_8h_source.html | 121 - grin/docs/_build/doxygen/html/bc_s.png | Bin 676 -> 0 bytes grin/docs/_build/doxygen/html/bc_sd.png | Bin 635 -> 0 bytes grin/docs/_build/doxygen/html/bdwn.png | Bin 147 -> 0 bytes grin/docs/_build/doxygen/html/closed.png | Bin 132 -> 0 bytes .../dir_49e56c817e5e54854c35e136979f97ca.html | 86 - .../dir_85395b416142281e9b8cbaa2a4bb7bc5.html | 92 - .../dir_d44c64559bbebec7f509842c48db8b23.html | 102 - .../dir_f450b25d4e0d87eea6a09d028ca7ee7d.html | 98 - .../dir_ffb75fe14fe29e45cb01a712fdfb6c45.html | 108 - grin/docs/_build/doxygen/html/doc.png | Bin 746 -> 0 bytes grin/docs/_build/doxygen/html/docd.png | Bin 756 -> 0 bytes grin/docs/_build/doxygen/html/doxygen.css | 2007 ------------- grin/docs/_build/doxygen/html/doxygen.svg | 26 - grin/docs/_build/doxygen/html/dynsections.js | 130 - .../doxygen/html/edgelist_8h_source.html | 126 - grin/docs/_build/doxygen/html/files.html | 102 - .../docs/_build/doxygen/html/folderclosed.png | Bin 616 -> 0 bytes grin/docs/_build/doxygen/html/folderopen.png | Bin 597 -> 0 bytes grin/docs/_build/doxygen/html/globals.html | 206 -- .../_build/doxygen/html/globals_defs.html | 129 - .../_build/doxygen/html/globals_enum.html | 83 - .../_build/doxygen/html/globals_eval.html | 94 - .../_build/doxygen/html/globals_func.html | 107 - .../_build/doxygen/html/globals_type.html | 82 - grin/docs/_build/doxygen/html/group__nv.html | 364 --- grin/docs/_build/doxygen/html/index.html | 134 - grin/docs/_build/doxygen/html/jquery.js | 34 - grin/docs/_build/doxygen/html/label_8h.html | 290 -- .../_build/doxygen/html/label_8h_source.html | 119 - grin/docs/_build/doxygen/html/menu.js | 136 - grin/docs/_build/doxygen/html/menudata.js | 51 - grin/docs/_build/doxygen/html/modules.html | 87 - grin/docs/_build/doxygen/html/nav_f.png | Bin 153 -> 0 bytes grin/docs/_build/doxygen/html/nav_fd.png | Bin 169 -> 0 bytes grin/docs/_build/doxygen/html/nav_g.png | Bin 95 -> 0 bytes grin/docs/_build/doxygen/html/nav_h.png | Bin 98 -> 0 bytes grin/docs/_build/doxygen/html/nav_hd.png | Bin 114 -> 0 bytes grin/docs/_build/doxygen/html/open.png | Bin 123 -> 0 bytes .../doxygen/html/partition_8h_source.html | 207 -- .../_build/doxygen/html/predefine_8h.html | 1476 ---------- .../doxygen/html/predefine_8h_source.html | 335 --- .../_build/doxygen/html/primarykey_8h.html | 220 -- .../doxygen/html/primarykey_8h_source.html | 104 - .../docs/_build/doxygen/html/property_8h.html | 371 --- .../doxygen/html/property_8h_source.html | 126 - .../_build/doxygen/html/propertylist_8h.html | 163 -- .../doxygen/html/propertylist_8h_source.html | 146 - .../_build/doxygen/html/propertytable_8h.html | 286 -- .../doxygen/html/propertytable_8h_source.html | 125 - grin/docs/_build/doxygen/html/search/all_0.js | 4 - grin/docs/_build/doxygen/html/search/all_1.js | 4 - grin/docs/_build/doxygen/html/search/all_2.js | 5 - grin/docs/_build/doxygen/html/search/all_3.js | 10 - grin/docs/_build/doxygen/html/search/all_4.js | 13 - grin/docs/_build/doxygen/html/search/all_5.js | 5 - grin/docs/_build/doxygen/html/search/all_6.js | 22 - grin/docs/_build/doxygen/html/search/all_7.js | 7 - grin/docs/_build/doxygen/html/search/all_8.js | 4 - grin/docs/_build/doxygen/html/search/all_9.js | 19 - grin/docs/_build/doxygen/html/search/all_a.js | 4 - grin/docs/_build/doxygen/html/search/all_b.js | 8 - grin/docs/_build/doxygen/html/search/all_c.js | 6 - grin/docs/_build/doxygen/html/search/all_d.js | 4 - grin/docs/_build/doxygen/html/search/all_e.js | 6 - grin/docs/_build/doxygen/html/search/all_f.js | 10 - .../docs/_build/doxygen/html/search/close.svg | 31 - .../_build/doxygen/html/search/defines_0.js | 4 - .../_build/doxygen/html/search/defines_1.js | 13 - .../_build/doxygen/html/search/defines_2.js | 19 - .../_build/doxygen/html/search/defines_3.js | 10 - .../_build/doxygen/html/search/enums_0.js | 5 - .../doxygen/html/search/enumvalues_0.js | 4 - .../doxygen/html/search/enumvalues_1.js | 6 - .../doxygen/html/search/enumvalues_2.js | 4 - .../doxygen/html/search/enumvalues_3.js | 6 - .../doxygen/html/search/enumvalues_4.js | 4 - .../doxygen/html/search/enumvalues_5.js | 4 - .../doxygen/html/search/enumvalues_6.js | 6 - .../_build/doxygen/html/search/files_0.js | 4 - .../_build/doxygen/html/search/files_1.js | 8 - .../_build/doxygen/html/search/files_2.js | 4 - .../_build/doxygen/html/search/functions_0.js | 4 - .../_build/doxygen/html/search/functions_1.js | 4 - .../_build/doxygen/html/search/functions_2.js | 5 - .../_build/doxygen/html/search/functions_3.js | 4 - .../_build/doxygen/html/search/functions_4.js | 21 - .../_build/doxygen/html/search/functions_5.js | 4 - .../_build/doxygen/html/search/functions_6.js | 5 - .../_build/doxygen/html/search/groups_0.js | 4 - grin/docs/_build/doxygen/html/search/mag.svg | 37 - .../docs/_build/doxygen/html/search/mag_d.svg | 37 - .../_build/doxygen/html/search/mag_sel.svg | 74 - .../_build/doxygen/html/search/mag_seld.svg | 74 - .../_build/doxygen/html/search/pages_0.js | 4 - .../_build/doxygen/html/search/search.css | 291 -- .../docs/_build/doxygen/html/search/search.js | 816 ------ .../_build/doxygen/html/search/searchdata.js | 33 - .../_build/doxygen/html/search/typedefs_0.js | 4 - grin/docs/_build/doxygen/html/splitbar.png | Bin 314 -> 0 bytes grin/docs/_build/doxygen/html/splitbard.png | Bin 282 -> 0 bytes .../doxygen/html/structure_8h_source.html | 151 - grin/docs/_build/doxygen/html/svgpan.js | 323 --- grin/docs/_build/doxygen/html/sync_off.png | Bin 853 -> 0 bytes grin/docs/_build/doxygen/html/sync_on.png | Bin 845 -> 0 bytes grin/docs/_build/doxygen/html/tab_a.png | Bin 142 -> 0 bytes grin/docs/_build/doxygen/html/tab_ad.png | Bin 135 -> 0 bytes grin/docs/_build/doxygen/html/tab_b.png | Bin 169 -> 0 bytes grin/docs/_build/doxygen/html/tab_bd.png | Bin 173 -> 0 bytes grin/docs/_build/doxygen/html/tab_h.png | Bin 177 -> 0 bytes grin/docs/_build/doxygen/html/tab_hd.png | Bin 180 -> 0 bytes grin/docs/_build/doxygen/html/tab_s.png | Bin 184 -> 0 bytes grin/docs/_build/doxygen/html/tab_sd.png | Bin 188 -> 0 bytes grin/docs/_build/doxygen/html/tabs.css | 1 - grin/docs/_build/doxygen/html/type_8h.html | 184 -- .../_build/doxygen/html/type_8h_source.html | 162 -- .../doxygen/html/vertexlist_8h_source.html | 126 - grin/docs/_build/doxygen/xml/Doxyfile.xml | 342 --- .../_build/doxygen/xml/_r_e_a_d_m_e_8md.xml | 49 - .../_build/doxygen/xml/adjacentlist_8h.xml | 204 -- grin/docs/_build/doxygen/xml/combine.xslt | 15 - grin/docs/_build/doxygen/xml/compound.xsd | 1305 --------- .../dir_49e56c817e5e54854c35e136979f97ca.xml | 11 - .../dir_85395b416142281e9b8cbaa2a4bb7bc5.xml | 12 - .../dir_d44c64559bbebec7f509842c48db8b23.xml | 15 - .../dir_f450b25d4e0d87eea6a09d028ca7ee7d.xml | 15 - .../dir_ffb75fe14fe29e45cb01a712fdfb6c45.xml | 17 - grin/docs/_build/doxygen/xml/doxyfile.xsd | 45 - grin/docs/_build/doxygen/xml/edgelist_8h.xml | 80 - grin/docs/_build/doxygen/xml/group__nv.xml | 170 -- grin/docs/_build/doxygen/xml/index.xml | 263 -- grin/docs/_build/doxygen/xml/index.xsd | 71 - grin/docs/_build/doxygen/xml/indexpage.xml | 80 - grin/docs/_build/doxygen/xml/label_8h.xml | 358 --- grin/docs/_build/doxygen/xml/partition_8h.xml | 906 ------ grin/docs/_build/doxygen/xml/predefine_8h.xml | 1294 --------- .../docs/_build/doxygen/xml/primarykey_8h.xml | 180 -- grin/docs/_build/doxygen/xml/property_8h.xml | 382 --- .../_build/doxygen/xml/propertylist_8h.xml | 453 --- .../_build/doxygen/xml/propertytable_8h.xml | 326 --- grin/docs/_build/doxygen/xml/structure_8h.xml | 435 --- grin/docs/_build/doxygen/xml/type_8h.xml | 593 ---- .../docs/_build/doxygen/xml/vertexlist_8h.xml | 281 -- grin/docs/_build/doxygen/xml/xml.xsd | 23 - grin/src/partition/partition.cc | 69 +- grin/src/predefine.h | 47 +- grin/src/property/label.cc | 190 -- grin/src/property/property.cc | 164 -- grin/src/property/propertylist.cc | 84 +- grin/src/property/propertytable.cc | 132 + grin/src/property/type.cc | 211 ++ grin/src/topology/adjacentlist.cc | 31 +- grin/src/topology/edgelist.cc | 48 - grin/src/topology/structure.cc | 73 +- grin/src/topology/vertexlist.cc | 60 +- modules/graph/CMakeLists.txt | 1 + modules/graph/fragment/arrow_fragment.grin.h | 16 +- modules/graph/grin/.gitignore | 2 + {grin => modules/graph/grin}/docs/Doxyfile | 5 +- {grin => modules/graph/grin}/docs/README.md | 17 + .../graph/grin/example/example.c | 23 +- .../graph/grin}/include/index/label.h | 0 .../graph/grin}/include/partition/partition.h | 64 +- .../graph/grin}/include/predefine.h | 19 +- .../graph/grin}/include/property/primarykey.h | 0 .../graph/grin}/include/property/property.h | 10 + .../grin}/include/property/propertylist.h | 1 - .../grin}/include/property/propertytable.h | 8 +- .../graph/grin}/include/property/type.h | 0 .../grin}/include/topology/adjacentlist.h | 0 .../graph/grin}/include/topology/edgelist.h | 0 .../graph/grin}/include/topology/structure.h | 8 +- .../graph/grin}/include/topology/vertexlist.h | 0 modules/graph/grin/src/partition/partition.cc | 246 ++ modules/graph/grin/src/predefine.h | 192 ++ modules/graph/grin/src/property/property.cc | 115 + .../graph/grin/src/property/propertylist.cc | 167 ++ .../graph/grin/src/property/propertytable.cc | 132 + modules/graph/grin/src/property/type.cc | 211 ++ .../graph/grin/src/topology/adjacentlist.cc | 105 + modules/graph/grin/src/topology/structure.cc | 122 + modules/graph/grin/src/topology/vertexlist.cc | 78 + {grin => modules/graph/grin}/src/utils.h | 2 +- 184 files changed, 1979 insertions(+), 22256 deletions(-) delete mode 100644 grin/docs/Doxyfile.bak delete mode 100644 grin/docs/_build/doxygen/html/adjacentlist_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/bc_s.png delete mode 100644 grin/docs/_build/doxygen/html/bc_sd.png delete mode 100644 grin/docs/_build/doxygen/html/bdwn.png delete mode 100644 grin/docs/_build/doxygen/html/closed.png delete mode 100644 grin/docs/_build/doxygen/html/dir_49e56c817e5e54854c35e136979f97ca.html delete mode 100644 grin/docs/_build/doxygen/html/dir_85395b416142281e9b8cbaa2a4bb7bc5.html delete mode 100644 grin/docs/_build/doxygen/html/dir_d44c64559bbebec7f509842c48db8b23.html delete mode 100644 grin/docs/_build/doxygen/html/dir_f450b25d4e0d87eea6a09d028ca7ee7d.html delete mode 100644 grin/docs/_build/doxygen/html/dir_ffb75fe14fe29e45cb01a712fdfb6c45.html delete mode 100644 grin/docs/_build/doxygen/html/doc.png delete mode 100644 grin/docs/_build/doxygen/html/docd.png delete mode 100644 grin/docs/_build/doxygen/html/doxygen.css delete mode 100644 grin/docs/_build/doxygen/html/doxygen.svg delete mode 100644 grin/docs/_build/doxygen/html/dynsections.js delete mode 100644 grin/docs/_build/doxygen/html/edgelist_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/files.html delete mode 100644 grin/docs/_build/doxygen/html/folderclosed.png delete mode 100644 grin/docs/_build/doxygen/html/folderopen.png delete mode 100644 grin/docs/_build/doxygen/html/globals.html delete mode 100644 grin/docs/_build/doxygen/html/globals_defs.html delete mode 100644 grin/docs/_build/doxygen/html/globals_enum.html delete mode 100644 grin/docs/_build/doxygen/html/globals_eval.html delete mode 100644 grin/docs/_build/doxygen/html/globals_func.html delete mode 100644 grin/docs/_build/doxygen/html/globals_type.html delete mode 100644 grin/docs/_build/doxygen/html/group__nv.html delete mode 100644 grin/docs/_build/doxygen/html/index.html delete mode 100644 grin/docs/_build/doxygen/html/jquery.js delete mode 100644 grin/docs/_build/doxygen/html/label_8h.html delete mode 100644 grin/docs/_build/doxygen/html/label_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/menu.js delete mode 100644 grin/docs/_build/doxygen/html/menudata.js delete mode 100644 grin/docs/_build/doxygen/html/modules.html delete mode 100644 grin/docs/_build/doxygen/html/nav_f.png delete mode 100644 grin/docs/_build/doxygen/html/nav_fd.png delete mode 100644 grin/docs/_build/doxygen/html/nav_g.png delete mode 100644 grin/docs/_build/doxygen/html/nav_h.png delete mode 100644 grin/docs/_build/doxygen/html/nav_hd.png delete mode 100644 grin/docs/_build/doxygen/html/open.png delete mode 100644 grin/docs/_build/doxygen/html/partition_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/predefine_8h.html delete mode 100644 grin/docs/_build/doxygen/html/predefine_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/primarykey_8h.html delete mode 100644 grin/docs/_build/doxygen/html/primarykey_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/property_8h.html delete mode 100644 grin/docs/_build/doxygen/html/property_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/propertylist_8h.html delete mode 100644 grin/docs/_build/doxygen/html/propertylist_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/propertytable_8h.html delete mode 100644 grin/docs/_build/doxygen/html/propertytable_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/search/all_0.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_1.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_2.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_3.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_4.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_5.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_6.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_7.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_8.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_9.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_a.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_b.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_c.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_d.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_e.js delete mode 100644 grin/docs/_build/doxygen/html/search/all_f.js delete mode 100644 grin/docs/_build/doxygen/html/search/close.svg delete mode 100644 grin/docs/_build/doxygen/html/search/defines_0.js delete mode 100644 grin/docs/_build/doxygen/html/search/defines_1.js delete mode 100644 grin/docs/_build/doxygen/html/search/defines_2.js delete mode 100644 grin/docs/_build/doxygen/html/search/defines_3.js delete mode 100644 grin/docs/_build/doxygen/html/search/enums_0.js delete mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_0.js delete mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_1.js delete mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_2.js delete mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_3.js delete mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_4.js delete mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_5.js delete mode 100644 grin/docs/_build/doxygen/html/search/enumvalues_6.js delete mode 100644 grin/docs/_build/doxygen/html/search/files_0.js delete mode 100644 grin/docs/_build/doxygen/html/search/files_1.js delete mode 100644 grin/docs/_build/doxygen/html/search/files_2.js delete mode 100644 grin/docs/_build/doxygen/html/search/functions_0.js delete mode 100644 grin/docs/_build/doxygen/html/search/functions_1.js delete mode 100644 grin/docs/_build/doxygen/html/search/functions_2.js delete mode 100644 grin/docs/_build/doxygen/html/search/functions_3.js delete mode 100644 grin/docs/_build/doxygen/html/search/functions_4.js delete mode 100644 grin/docs/_build/doxygen/html/search/functions_5.js delete mode 100644 grin/docs/_build/doxygen/html/search/functions_6.js delete mode 100644 grin/docs/_build/doxygen/html/search/groups_0.js delete mode 100644 grin/docs/_build/doxygen/html/search/mag.svg delete mode 100644 grin/docs/_build/doxygen/html/search/mag_d.svg delete mode 100644 grin/docs/_build/doxygen/html/search/mag_sel.svg delete mode 100644 grin/docs/_build/doxygen/html/search/mag_seld.svg delete mode 100644 grin/docs/_build/doxygen/html/search/pages_0.js delete mode 100644 grin/docs/_build/doxygen/html/search/search.css delete mode 100644 grin/docs/_build/doxygen/html/search/search.js delete mode 100644 grin/docs/_build/doxygen/html/search/searchdata.js delete mode 100644 grin/docs/_build/doxygen/html/search/typedefs_0.js delete mode 100644 grin/docs/_build/doxygen/html/splitbar.png delete mode 100644 grin/docs/_build/doxygen/html/splitbard.png delete mode 100644 grin/docs/_build/doxygen/html/structure_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/svgpan.js delete mode 100644 grin/docs/_build/doxygen/html/sync_off.png delete mode 100644 grin/docs/_build/doxygen/html/sync_on.png delete mode 100644 grin/docs/_build/doxygen/html/tab_a.png delete mode 100644 grin/docs/_build/doxygen/html/tab_ad.png delete mode 100644 grin/docs/_build/doxygen/html/tab_b.png delete mode 100644 grin/docs/_build/doxygen/html/tab_bd.png delete mode 100644 grin/docs/_build/doxygen/html/tab_h.png delete mode 100644 grin/docs/_build/doxygen/html/tab_hd.png delete mode 100644 grin/docs/_build/doxygen/html/tab_s.png delete mode 100644 grin/docs/_build/doxygen/html/tab_sd.png delete mode 100644 grin/docs/_build/doxygen/html/tabs.css delete mode 100644 grin/docs/_build/doxygen/html/type_8h.html delete mode 100644 grin/docs/_build/doxygen/html/type_8h_source.html delete mode 100644 grin/docs/_build/doxygen/html/vertexlist_8h_source.html delete mode 100644 grin/docs/_build/doxygen/xml/Doxyfile.xml delete mode 100644 grin/docs/_build/doxygen/xml/_r_e_a_d_m_e_8md.xml delete mode 100644 grin/docs/_build/doxygen/xml/adjacentlist_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/combine.xslt delete mode 100644 grin/docs/_build/doxygen/xml/compound.xsd delete mode 100644 grin/docs/_build/doxygen/xml/dir_49e56c817e5e54854c35e136979f97ca.xml delete mode 100644 grin/docs/_build/doxygen/xml/dir_85395b416142281e9b8cbaa2a4bb7bc5.xml delete mode 100644 grin/docs/_build/doxygen/xml/dir_d44c64559bbebec7f509842c48db8b23.xml delete mode 100644 grin/docs/_build/doxygen/xml/dir_f450b25d4e0d87eea6a09d028ca7ee7d.xml delete mode 100644 grin/docs/_build/doxygen/xml/dir_ffb75fe14fe29e45cb01a712fdfb6c45.xml delete mode 100644 grin/docs/_build/doxygen/xml/doxyfile.xsd delete mode 100644 grin/docs/_build/doxygen/xml/edgelist_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/group__nv.xml delete mode 100644 grin/docs/_build/doxygen/xml/index.xml delete mode 100644 grin/docs/_build/doxygen/xml/index.xsd delete mode 100644 grin/docs/_build/doxygen/xml/indexpage.xml delete mode 100644 grin/docs/_build/doxygen/xml/label_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/partition_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/predefine_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/primarykey_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/property_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/propertylist_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/propertytable_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/structure_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/type_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/vertexlist_8h.xml delete mode 100644 grin/docs/_build/doxygen/xml/xml.xsd delete mode 100644 grin/src/property/label.cc delete mode 100644 grin/src/property/property.cc create mode 100644 grin/src/property/propertytable.cc create mode 100644 grin/src/property/type.cc delete mode 100644 grin/src/topology/edgelist.cc create mode 100644 modules/graph/grin/.gitignore rename {grin => modules/graph/grin}/docs/Doxyfile (99%) rename {grin => modules/graph/grin}/docs/README.md (70%) rename grin/src/property/primarykey.cc => modules/graph/grin/example/example.c (55%) rename {grin => modules/graph/grin}/include/index/label.h (100%) rename {grin => modules/graph/grin}/include/partition/partition.h (76%) rename {grin => modules/graph/grin}/include/predefine.h (97%) rename {grin => modules/graph/grin}/include/property/primarykey.h (100%) rename {grin => modules/graph/grin}/include/property/property.h (92%) rename {grin => modules/graph/grin}/include/property/propertylist.h (99%) rename {grin => modules/graph/grin}/include/property/propertytable.h (93%) rename {grin => modules/graph/grin}/include/property/type.h (100%) rename {grin => modules/graph/grin}/include/topology/adjacentlist.h (100%) rename {grin => modules/graph/grin}/include/topology/edgelist.h (100%) rename {grin => modules/graph/grin}/include/topology/structure.h (91%) rename {grin => modules/graph/grin}/include/topology/vertexlist.h (100%) create mode 100644 modules/graph/grin/src/partition/partition.cc create mode 100644 modules/graph/grin/src/predefine.h create mode 100644 modules/graph/grin/src/property/property.cc create mode 100644 modules/graph/grin/src/property/propertylist.cc create mode 100644 modules/graph/grin/src/property/propertytable.cc create mode 100644 modules/graph/grin/src/property/type.cc create mode 100644 modules/graph/grin/src/topology/adjacentlist.cc create mode 100644 modules/graph/grin/src/topology/structure.cc create mode 100644 modules/graph/grin/src/topology/vertexlist.cc rename {grin => modules/graph/grin}/src/utils.h (95%) diff --git a/grin/docs/Doxyfile.bak b/grin/docs/Doxyfile.bak deleted file mode 100644 index 0c034b996..000000000 --- a/grin/docs/Doxyfile.bak +++ /dev/null @@ -1,2553 +0,0 @@ -# Doxyfile 1.8.18 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the configuration -# file that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "grin" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "Graph Retrieval Interface" - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = _build/doxygen - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all generated output in the proper direction. -# Possible values are: None, LTR, RTL and Context. -# The default value is: None. - -OUTPUT_TEXT_DIRECTION = None - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = ../ - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line -# such as -# /*************** -# as being the beginning of a Javadoc-style comment "banner". If set to NO, the -# Javadoc-style will behave just like regular comments and it will not be -# interpreted by doxygen. -# The default value is: NO. - -JAVADOC_BANNER = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines (in the resulting output). You can put ^^ in the value part of an -# alias to insert a newline as if a physical newline was in the original file. -# When you need a literal { or } or , in the value part of an alias you have to -# escape them by means of a backslash (\), this can lead to conflicts with the -# commands \{ and \} for these it is advised to use the version @{ and @} or use -# a double escape (\\{ and \\}) - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice -# sources only. Doxygen will then generate output that is more tailored for that -# language. For instance, namespaces will be presented as modules, types will be -# separated into more groups, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_SLICE = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, -# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, -# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: -# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser -# tries to guess whether the code is fixed or free formatted code, this is the -# default for Fortran type files). For instance to make doxygen treat .inc files -# as Fortran files (default is PHP), and .f files as C (default is Fortran), -# use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See https://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up -# to that level are automatically included in the table of contents, even if -# they do not have an id attribute. -# Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 5. -# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. - -TOC_INCLUDE_HEADINGS = 5 - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# If one adds a struct or class to a group and this option is enabled, then also -# any nested class or struct is added to the same group. By default this option -# is disabled and one has to add nested compounds explicitly via \ingroup. -# The default value is: NO. - -GROUP_NESTED_COMPOUNDS = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual -# methods of a class will be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIV_VIRTUAL = NO - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# declarations. If set to NO, these declarations will be included in the -# documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# (including Cygwin) ands Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -HIDE_COMPOUND_REFERENCE= NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. If -# EXTRACT_ALL is set to YES then this flag will automatically be disabled. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. -# The default value is: NO. - -WARN_AS_ERROR = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING -# Note: If this tag is empty the current directory is searched. - -INPUT = ../include - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: https://www.gnu.org/software/libiconv/) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# read by doxygen. -# -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), -# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen -# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, -# *.vhdl, *.ucf, *.qsf and *.ice. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.doc \ - *.f90 \ - *.f95 \ - *.f03 \ - *.f08 \ - *.f18 \ - *.f \ - *.for \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf \ - *.ice - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# entity all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see https://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# https://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = NO - -# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML -# documentation will contain a main index with vertical navigation menus that -# are dynamically created via JavaScript. If disabled, the navigation index will -# consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have JavaScript, -# like the Qt help browser. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_MENUS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/xcode/), introduced with OSX -# 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy -# genXcode/_index.html for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg -# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see -# https://inkscape.org) to generate formulas as SVG images instead of PNGs for -# the HTML output. These images will generally look nicer at scaled resolutions. -# Possible values are: png The default and svg Looks nicer but requires the -# pdf2svg tool. -# The default value is: png. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FORMULA_FORMAT = png - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands -# to create new LaTeX commands to be used in formulas as building blocks. See -# the section "Including formulas" for details. - -FORMULA_MACROFILE = - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side JavaScript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. -# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2 - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /
  • "),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e,function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=f[g]?0:Math.min(f[g],n));!a&&1-1){targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if(session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)}closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if(session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE,function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList,finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight()));return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")}function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(),elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight,viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 - * http://www.smartmenus.org/ - * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
    ').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file diff --git a/grin/docs/_build/doxygen/html/label_8h.html b/grin/docs/_build/doxygen/html/label_8h.html deleted file mode 100644 index 45d377c69..000000000 --- a/grin/docs/_build/doxygen/html/label_8h.html +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - -GRIN: include/property/label.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    - -
    label.h File Reference
    -
    -
    - -

    Define the label related APIs. -More...

    -
    #include "../predefine.h"
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Functions

    -Label get_label_by_name (const Graph, const char *)
     
    -char * get_label_name (const Graph, const Label)
     
    -void destroy_label (Label)
     
    -void destroy_label_list (LabelList)
     
    -size_t get_label_list_size (const LabelList)
     
    -Label get_label_from_list (const LabelList, const size_t)
     
    bool assign_label_to_vertex (const Graph, const Label, Vertex)
     assign a label to a vertex
     
    LabelList get_vertex_label_list (const Graph, const Vertex)
     get the label list of a vertex
     
    VertexList get_vertex_list_by_label (const Graph, const Label)
     get the vertex list by label
     
    VertexList filter_vertex_list_by_label (const VertexList, const Label)
     filtering an existing vertex list by label
     
    -

    Detailed Description

    -

    Define the label related APIs.

    -

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    - -

    Definition in file label.h.

    -

    Function Documentation

    - -

    ◆ assign_label_to_vertex()

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    bool assign_label_to_vertex (const Graph,
    const Label,
    Vertex  
    )
    -
    - -

    assign a label to a vertex

    -
    Parameters
    - - - - -
    Graphthe graph
    Labelthe label
    Vertexthe vertex
    -
    -
    -
    Returns
    whether succeed
    - -
    -
    - -

    ◆ filter_vertex_list_by_label()

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    VertexList filter_vertex_list_by_label (const VertexList,
    const Label 
    )
    -
    - -

    filtering an existing vertex list by label

    -
    Parameters
    - - - -
    VertexListthe existing vertex list
    Labelthe label
    -
    -
    - -
    -
    - -

    ◆ get_vertex_label_list()

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    LabelList get_vertex_label_list (const Graph,
    const Vertex 
    )
    -
    - -

    get the label list of a vertex

    -
    Parameters
    - - - -
    Graphthe graph
    Vertexthe vertex
    -
    -
    - -
    -
    - -

    ◆ get_vertex_list_by_label()

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    VertexList get_vertex_list_by_label (const Graph,
    const Label 
    )
    -
    - -

    get the vertex list by label

    -
    Parameters
    - - - -
    Graphthe graph
    Labelthe label
    -
    -
    - -
    -
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/label_8h_source.html b/grin/docs/_build/doxygen/html/label_8h_source.html deleted file mode 100644 index 893fed726..000000000 --- a/grin/docs/_build/doxygen/html/label_8h_source.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - -GRIN: include/property/label.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    label.h
    -
    -
    -Go to the documentation of this file.
    1
    -
    18#ifndef GRIN_INCLUDE_PROPERTY_LABEL_H_
    -
    19#define GRIN_INCLUDE_PROPERTY_LABEL_H_
    -
    20
    -
    21#include "../predefine.h"
    -
    22
    -
    23#ifdef WITH_LABEL
    -
    24Label get_label_by_name(const Graph, const char*);
    -
    25
    -
    26char* get_label_name(const Graph, const Label);
    -
    27
    -
    28void destroy_label(Label);
    -
    29
    -
    30void destroy_label_list(LabelList);
    -
    31
    -
    32size_t get_label_list_size(const LabelList);
    -
    33
    -
    34Label get_label_from_list(const LabelList, const size_t);
    -
    35
    -
    43bool assign_label_to_vertex(const Graph, const Label, Vertex);
    -
    44
    -
    50LabelList get_vertex_label_list(const Graph, const Vertex);
    -
    51
    -
    57VertexList get_vertex_list_by_label(const Graph, const Label);
    -
    58
    -
    64VertexList filter_vertex_list_by_label(const VertexList, const Label);
    -
    65#endif
    -
    66
    -
    67#endif // GRIN_INCLUDE_PROPERTY_LABEL_H_
    -
    LabelList get_vertex_label_list(const Graph, const Vertex)
    get the label list of a vertex
    -
    VertexList get_vertex_list_by_label(const Graph, const Label)
    get the vertex list by label
    -
    VertexList filter_vertex_list_by_label(const VertexList, const Label)
    filtering an existing vertex list by label
    -
    bool assign_label_to_vertex(const Graph, const Label, Vertex)
    assign a label to a vertex
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/menu.js b/grin/docs/_build/doxygen/html/menu.js deleted file mode 100644 index b0b26936a..000000000 --- a/grin/docs/_build/doxygen/html/menu.js +++ /dev/null @@ -1,136 +0,0 @@ -/* - @licstart The following is the entire license notice for the JavaScript code in this file. - - The MIT License (MIT) - - Copyright (C) 1997-2020 by Dimitri van Heesch - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software - and associated documentation files (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, - sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - @licend The above is the entire license notice for the JavaScript code in this file - */ -function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { - function makeTree(data,relPath) { - var result=''; - if ('children' in data) { - result+='
      '; - for (var i in data.children) { - var url; - var link; - link = data.children[i].url; - if (link.substring(0,1)=='^') { - url = link.substring(1); - } else { - url = relPath+link; - } - result+='
    • '+ - data.children[i].text+''+ - makeTree(data.children[i],relPath)+'
    • '; - } - result+='
    '; - } - return result; - } - var searchBoxHtml; - if (searchEnabled) { - if (serverSide) { - searchBoxHtml='
    '+ - '
    '+ - '
     '+ - ''+ - '
    '+ - '
    '+ - '
    '+ - '
    '; - } else { - searchBoxHtml='
    '+ - ''+ - ' '+ - ''+ - ''+ - ''+ - ''+ - ''+ - '
    '; - } - } - - $('#main-nav').before('
    '+ - ''+ - ''+ - '
    '); - $('#main-nav').append(makeTree(menudata,relPath)); - $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); - if (searchBoxHtml) { - $('#main-menu').append('
  • '); - } - var $mainMenuState = $('#main-menu-state'); - var prevWidth = 0; - if ($mainMenuState.length) { - function initResizableIfExists() { - if (typeof initResizable==='function') initResizable(); - } - // animate mobile menu - $mainMenuState.change(function(e) { - var $menu = $('#main-menu'); - var options = { duration: 250, step: initResizableIfExists }; - if (this.checked) { - options['complete'] = function() { $menu.css('display', 'block') }; - $menu.hide().slideDown(options); - } else { - options['complete'] = function() { $menu.css('display', 'none') }; - $menu.show().slideUp(options); - } - }); - // set default menu visibility - function resetState() { - var $menu = $('#main-menu'); - var $mainMenuState = $('#main-menu-state'); - var newWidth = $(window).outerWidth(); - if (newWidth!=prevWidth) { - if ($(window).outerWidth()<768) { - $mainMenuState.prop('checked',false); $menu.hide(); - $('#searchBoxPos1').html(searchBoxHtml); - $('#searchBoxPos2').hide(); - } else { - $menu.show(); - $('#searchBoxPos1').empty(); - $('#searchBoxPos2').html(searchBoxHtml); - $('#searchBoxPos2').show(); - } - if (typeof searchBox!=='undefined') { - searchBox.CloseResultsWindow(); - } - prevWidth = newWidth; - } - } - $(window).ready(function() { resetState(); initResizableIfExists(); }); - $(window).resize(resetState); - } - $('#main-menu').smartmenus(); -} -/* @license-end */ diff --git a/grin/docs/_build/doxygen/html/menudata.js b/grin/docs/_build/doxygen/html/menudata.js deleted file mode 100644 index e9f59219a..000000000 --- a/grin/docs/_build/doxygen/html/menudata.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - @licstart The following is the entire license notice for the JavaScript code in this file. - - The MIT License (MIT) - - Copyright (C) 1997-2020 by Dimitri van Heesch - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software - and associated documentation files (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, - sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - @licend The above is the entire license notice for the JavaScript code in this file -*/ -var menudata={children:[ -{text:"Main Page",url:"index.html"}, -{text:"Files",url:"files.html",children:[ -{text:"File List",url:"files.html"}, -{text:"File Members",url:"globals.html",children:[ -{text:"All",url:"globals.html",children:[ -{text:"a",url:"globals.html#index_a"}, -{text:"b",url:"globals.html#index_b"}, -{text:"c",url:"globals.html#index_c"}, -{text:"d",url:"globals.html#index_d"}, -{text:"e",url:"globals.html#index_e"}, -{text:"f",url:"globals.html#index_f"}, -{text:"g",url:"globals.html#index_g"}, -{text:"i",url:"globals.html#index_i"}, -{text:"n",url:"globals.html#index_n"}, -{text:"o",url:"globals.html#index_o"}, -{text:"s",url:"globals.html#index_s"}, -{text:"u",url:"globals.html#index_u"}, -{text:"w",url:"globals.html#index_w"}]}, -{text:"Functions",url:"globals_func.html"}, -{text:"Enumerations",url:"globals_enum.html"}, -{text:"Enumerator",url:"globals_eval.html"}, -{text:"Macros",url:"globals_defs.html",children:[ -{text:"c",url:"globals_defs.html#index_c"}, -{text:"e",url:"globals_defs.html#index_e"}, -{text:"n",url:"globals_defs.html#index_n"}, -{text:"w",url:"globals_defs.html#index_w"}]}]}]}]} diff --git a/grin/docs/_build/doxygen/html/modules.html b/grin/docs/_build/doxygen/html/modules.html deleted file mode 100644 index 93942649e..000000000 --- a/grin/docs/_build/doxygen/html/modules.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - -GRIN: Modules - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - -
    - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - -
    -
    Modules
    -
    -
    -
    Here is a list of all modules:
    - - -
     Null Values
    -
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/nav_f.png b/grin/docs/_build/doxygen/html/nav_f.png deleted file mode 100644 index 72a58a529ed3a9ed6aa0c51a79cf207e026deee2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 153 zcmeAS@N?(olHy`uVBq!ia0vp^j6iI`!2~2XGqLUlQVE_ejv*C{Z|{2ZH7M}7UYxc) zn!W8uqtnIQ>_z8U diff --git a/grin/docs/_build/doxygen/html/nav_fd.png b/grin/docs/_build/doxygen/html/nav_fd.png deleted file mode 100644 index 032fbdd4c54f54fa9a2e6423b94ef4b2ebdfaceb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^j6iI`!2~2XGqLUlQU#tajv*C{Z|C~*H7f|XvG1G8 zt7aS*L7xwMeS}!z6R#{C5tIw-s~AJ==F^i}x3XyJseHR@yF& zerFf(Zf;Dd{+(0lDIROL@Sj-Ju2JQ8&-n%4%q?>|^bShc&lR?}7HeMo@BDl5N(aHY Uj$gdr1MOz;boFyt=akR{0D!zeaR2}S diff --git a/grin/docs/_build/doxygen/html/nav_g.png b/grin/docs/_build/doxygen/html/nav_g.png deleted file mode 100644 index 2093a237a94f6c83e19ec6e5fd42f7ddabdafa81..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 95 zcmeAS@N?(olHy`uVBq!ia0vp^j6lrB!3HFm1ilyoDK$?Q$B+ufw|5PB85lU25BhtE tr?otc=hd~V+ws&_A@j8Fiv!KF$B+ufw|5=67#uj90@pIL wZ=Q8~_Ju`#59=RjDrmm`tMD@M=!-l18IR?&vFVdQ&MBb@0HFXL6W-eg#Jd_@e6*DPn)w;=|1H}Zvm9l6xXXB%>yL=NQU;mg M>FVdQ&MBb@0Bdt1Qvd(} diff --git a/grin/docs/_build/doxygen/html/open.png b/grin/docs/_build/doxygen/html/open.png deleted file mode 100644 index 30f75c7efe2dd0c9e956e35b69777a02751f048b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 123 zcmeAS@N?(olHy`uVBq!ia0vp^oFL4>1|%O$WD@{VPM$7~Ar*{o?;hlAFyLXmaDC0y znK1_#cQqJWPES%4Uujug^TE?jMft$}Eq^WaR~)%f)vSNs&gek&x%A9X9sM - - - - - - -GRIN: include/partition/partition.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    partition.h
    -
    -
    -
    1
    -
    16#ifndef GRIN_INCLUDE_PARTITION_PARTITION_H_
    -
    17#define GRIN_INCLUDE_PARTITION_PARTITION_H_
    -
    18
    -
    19#include "../predefine.h"
    -
    20
    -
    21**** add enable_vertex/edge_ref macros ****
    -
    22
    -
    23#ifdef ENABLE_GRAPH_PARTITION
    -
    24size_t get_total_partitions_number(const PartitionedGraph);
    -
    25
    -
    26PartitionList get_local_partition_list(const PartitionedGraph);
    -
    27
    -
    28void destroy_partition_list(PartitionList);
    -
    29
    -
    30PartitionList create_partition_list();
    -
    31
    -
    32bool insert_partition_to_list(PartitionList, const Partition);
    -
    33
    -
    34size_t get_partition_list_size(const PartitionList);
    -
    35
    -
    36Partition get_partition_from_list(const PartitionList, const size_t);
    -
    37
    -
    38#ifdef NATURAL_PARTITION_ID_TRAIT
    -
    39Partition get_partition_from_id(const PartitionID);
    -
    40
    -
    41PartitionID get_partition_id(const Partition);
    -
    42#endif
    -
    43
    -
    44void* get_partition_info(const PartitionedGraph, const Partition);
    -
    45
    -
    46Graph get_local_graph_from_partition(const PartitionedGraph, const Partition);
    -
    47
    -
    48
    -
    49// master & mirror vertices for vertexcut partition
    -
    50// while they refer to inner & outer vertices in edgecut partition
    -
    51#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST)
    -
    52VertexList get_master_vertices(const Graph);
    -
    53
    -
    54VertexList get_mirror_vertices(const Graph);
    -
    55
    -
    56VertexList get_mirror_vertices_by_partition(const Graph, const Partition);
    -
    57
    -
    58#ifdef WITH_VERTEX_PROPERTY
    -
    59VertexList get_master_vertices_by_type(const Graph, const VertexType);
    -
    60
    -
    61VertexList get_mirror_vertices_by_type(const Graph, const VertexType);
    -
    62
    -
    63VertexList get_mirror_vertices_by_type_partition(const Graph, const VertexType, const Partition);
    -
    64#endif
    -
    65#endif
    -
    66
    -
    67#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_ADJACENT_LIST)
    -
    68AdjacentList get_adjacent_master_list(const Graph, const Direction, const Vertex);
    -
    69
    -
    70AdjacentList get_adjacent_mirror_list(const Graph, const Direction, const Vertex);
    -
    71
    -
    72AdjacentList get_adjacent_mirror_list_by_partition(const Graph, const Direction,
    -
    73 const Partition, const Vertex);
    -
    74#endif
    -
    75
    -
    76
    -
    77// Vertex ref refers to the same vertex referred in other partitions,
    -
    78// while edge ref is likewise. Both can be serialized to char* for
    -
    79// message transporting and deserialized on the other end.
    -
    80VertexRef get_vertex_ref_for_vertex(const Graph, const Partition, const Vertex);
    -
    81
    -
    82Vertex get_vertex_from_vertex_ref(const Graph, const VertexRef);
    -
    83
    -
    84Partition get_master_partition_from_vertex_ref(const Graph, const VertexRef);
    -
    85
    -
    86char* serialize_vertex_ref(const Graph, const VertexRef);
    -
    87
    -
    88VertexRef deserialize_to_vertex_ref(const Graph, const char*);
    -
    89
    -
    90EdgeRef get_edge_ref_for_edge(const Graph, const Partition, const Edge);
    -
    91
    -
    92Edge get_edge_from_edge_ref(const Graph, const EdgeRef);
    -
    93
    -
    94Partition get_master_partition_from_edge_ref(const Graph, const EdgeRef);
    -
    95
    -
    96char* serialize_edge_ref(const Graph, const EdgeRef);
    -
    97
    -
    98EdgeRef deserialize_to_edge_ref(const Graph, const char*);
    -
    99
    -
    100// The concept of local_complete refers to whether we can get complete data or properties
    -
    101// locally in the partition. It is orthogonal to the concept of master/mirror which
    -
    102// is mainly designed for data aggregation. In some extremely cases, master vertices
    -
    103// may NOT contain all the data or properties locally.
    -
    104bool is_vertex_neighbor_local_complete(const Graph, const Vertex);
    -
    105
    -
    106PartitionList vertex_neighbor_complete_partitions(const Graph, const Vertex);
    -
    107
    -
    108#ifdef WITH_VERTEX_DATA
    -
    109bool is_vertex_data_local_complete(const Graph, const Vertex);
    -
    110
    -
    111PartitionList vertex_data_complete_partitions(const Graph, const Vertex);
    -
    112#endif
    -
    113
    -
    114#ifdef WITH_VERTEX_PROPERTY
    -
    115bool is_vertex_property_local_complete(const Graph, const Vertex);
    -
    116
    -
    117PartitionList vertex_property_complete_partitions(const Graph, const Vertex);
    -
    118#endif
    -
    119
    -
    120#ifdef WITH_EDGE_DATA
    -
    121bool is_edge_data_local_complete(const Graph, const Edge);
    -
    122
    -
    123PartitionList edge_data_complete_partitions(const Graph, const Edge);
    -
    124#endif
    -
    125
    -
    126#ifdef WITH_EDGE_PROPERTY
    -
    127bool is_edge_property_local_complete(const Graph, const Edge);
    -
    128
    -
    129PartitionList edge_data_complete_partitions(const Graph, const Edge);
    -
    130#endif
    -
    131
    -
    132#endif
    -
    133
    -
    134#endif // GRIN_INCLUDE_PARTITION_PARTITION_H_
    -
    Direction
    Enumerates the directions of edges with respect to a certain vertex.
    Definition: predefine.h:33
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/predefine_8h.html b/grin/docs/_build/doxygen/html/predefine_8h.html deleted file mode 100644 index fef96f7c2..000000000 --- a/grin/docs/_build/doxygen/html/predefine_8h.html +++ /dev/null @@ -1,1476 +0,0 @@ - - - - - - - -GRIN: include/predefine.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    - -
    predefine.h File Reference
    -
    -
    - -

    Pre-defined macros for storage features. Undefine the macros of features that the storage does NOT support, so that APIs under unsupported features will NOT be available to the callers to avoid ambiguity. -More...

    -
    #include <limits.h>
    -#include <stdbool.h>
    -#include <stddef.h>
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Macros

    TopologyMacros

    Macros for basic graph topology features

    -
    #define WITH_VERTEX_ORIGINAL_ID
     There is original ID for a vertex. This facilitates queries starting from a specific vertex, since one can get the vertex handler directly using its original ID.
     
    #define WITH_VERTEX_DATA
     There is data on vertex. E.g., the PageRank value of a vertex.
     
    #define WITH_EDGE_DATA
     There is data on edge. E.g., the weight of an edge.
     
    #define ENABLE_VERTEX_LIST
     Enable the vertex list structure. The vertex list related APIs follow the design principle of GRIN List.
     
    #define ENABLE_VERTEX_LIST_ITERATOR
     Enable the vertex list iterator. The vertex list iterator related APIs follow the design principle of GRIN Iterator.
     
    #define ENABLE_EDGE_LIST
     Enable the edge list structure. The edge list related APIs follow the design principle of GRIN List.
     
    #define ENABLE_EDGE_LIST_ITERATOR
     Enable the edge list iterator. The edge list iterator related APIs follow the design principle of GRIN Iterator.
     
    #define ENABLE_ADJACENT_LIST
     Enable the adjacent list structure. The adjacent list related APIs follow the design principle of GRIN List.
     
    #define ENABLE_ADJACENT_LIST_ITERATOR
     Enable the adjacent list iterator. The adjacent list iterator related APIs follow the design principle of GRIN Iterator.
     
    PartitionMacros

    Macros for partitioned graph features

    -
    #define ENABLE_GRAPH_PARTITION
     Enable partitioned graph. A partitioned graph usually contains several fragments (i.e., local graphs) that are distributedly stored in a cluster. In GRIN, Graph represents to a single fragment that can be locally accessed.
     
    #define NATURAL_PARTITION_ID_TRAIT
     The storage provides natural number IDs for partitions. It follows the design principle of natural number ID trait in GRIN.
     
    #define ENABLE_VERTEX_REF
     The storage provides reference of vertex that can be recognized in other partitions where the vertex also appears.
     
    #define ENABLE_EDGE_REF
     The storage provides reference of edge that can be recognized in other partitions where the edge also appears.
     
    PropertyMacros

    Macros for property graph features

    -
    #define WITH_PROPERTY_NAME
     There are property names for properties. The relationship between property name and properties is one-to-many, because properties bound to different vertex/edge types are distinguished even they may share the same property name. Please refer to the design principle of Property for details.
     
    #define WITH_VERTEX_PROPERTY
     There are properties bound to vertices. When vertices are typed, vertex properties are bound to vertex types, according to the definition of vertex type.
     
    #define WITH_VERTEX_PRIMARTY_KEYS
     There are primary keys for vertices. Vertex primary keys is a set of vertex properties whose values can distinguish vertices. When vertices are typed, each vertex type has its own primary keys which distinguishes the vertices of that type.
     
    #define NATURAL_VERTEX_TYPE_ID_TRAIT
     The storage provides natural number IDs for vertex types. It follows the design principle of natural ID trait in GRIN.
     
    #define NATURAL_VERTEX_PROPERTY_ID_TRAIT
     The storage provides natural number IDs for properties bound to a certain vertex type. It follows the design principle of natural ID trait in GRIN.
     
    #define WITH_EDGE_PROPERTY
     
    #define WITH_EDGE_PRIMARTY_KEYS
     
    #define NATURAL_EDGE_TYPE_ID_TRAIT
     
    #define NATURAL_EDGE_PROPERTY_ID_TRAIT
     
    #define WITH_LABEL
     There are labels assigned to vertices or edges. Labels are mainly used in filtering vertcies or edges.
     
    #define COLUMN_STORE_TRAIT
     The storage uses column store for properties. This enables efficient property selections for vertices and edges.
     
    PredicateMacros

    Macros for predicate features

    -
    #define ENABLE_PREDICATE
     Enable predicates on graph.
     
    NullValues

    Macros for Null(invalid) values

    -
    #define NULL_TYPE   Undefined
     Null type (undefined data type)
     
    #define NULL_GRAPH   NULL
     Null graph (invalid return value)
     
    #define NULL_VERTEX   NULL
     Non-existing vertex (invalid return value)
     
    #define NULL_EDGE   NULL
     Non-existing edge (invalid return value)
     
    #define NULL_LIST   NULL
     Null list of any kind (invalid return value)
     
    #define NULL_PARTITION   NULL
     Non-existing partition (invalid return value)
     
    #define NULL_VERTEX_REF   NULL
     Null vertex reference (invalid return value)
     
    #define NULL_EDGE_REF   NULL
     Null edge reference (invalid return value)
     
    #define NULL_VERTEX_TYPE   NULL
     Non-existing vertex type (invalid return value)
     
    #define NULL_EDGE_TYPE   NULL
     Non-existing edge type (invalid return value)
     
    #define NULL_PROPERTY   NULL
     Non-existing property (invalid return value)
     
    #define NULL_ROW   NULL
     Null row (invalid return value)
     
    #define NULL_NATURAL_ID   UINT_MAX
     Null natural id of any kind (invalid return value)
     
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Typedefs

    typedef void * Graph
     
    typedef void * Vertex
     
    typedef void * Edge
     
    typedef void * OriginalID
     
    typedef void * VertexList
     
    typedef void * AdjacentList
     
    typedef void * PartitionedGraph
     
    typedef void * Partition
     
    typedef void * PartitionList
     
    typedef unsigned PartitionID
     
    typedef void * VertexRef
     
    typedef void * VertexType
     
    typedef void * VertexTypeList
     
    typedef void * VertexProperty
     
    typedef void * VertexPropertyList
     
    typedef void * VertexPropertyTable
     
    typedef unsigned VertexTypeID
     
    typedef unsigned VertexPropertyID
     
    typedef void * EdgeType
     
    typedef void * EdgeTypeList
     
    typedef void * EdgeProperty
     
    typedef void * EdgePropertyList
     
    typedef void * EdgePropertyTable
     
    typedef unsigned EdgeTypeID
     
    typedef unsigned EdgePropertyID
     
    typedef void * Row
     
    - - - - - - - -

    -Enumerations

    enum  Direction { IN = 0 -, OUT = 1 -, BOTH = 2 - }
     Enumerates the directions of edges with respect to a certain vertex. More...
     
    enum  DataType {
    -  Undefined = 0 -, Int32 = 1 -, UInt32 = 2 -, Int64 = 3 -,
    -  UInt64 = 4 -, Float = 5 -, Double = 6 -, String = 7 -,
    -  Date32 = 8 -, Date64 = 9 -
    - }
     Enumerates the datatype supported in the storage. More...
     
    -

    Detailed Description

    -

    Pre-defined macros for storage features. Undefine the macros of features that the storage does NOT support, so that APIs under unsupported features will NOT be available to the callers to avoid ambiguity.

    -

    Copyright 2020 Alibaba Group Holding Limited.

    -

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0
    -

    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    - -

    Definition in file predefine.h.

    -

    Macro Definition Documentation

    - -

    ◆ COLUMN_STORE_TRAIT

    - -
    -
    - - - - -
    #define COLUMN_STORE_TRAIT
    -
    - -

    The storage uses column store for properties. This enables efficient property selections for vertices and edges.

    - -

    Definition at line 217 of file predefine.h.

    - -
    -
    - -

    ◆ ENABLE_ADJACENT_LIST

    - -
    -
    - - - - -
    #define ENABLE_ADJACENT_LIST
    -
    - -

    Enable the adjacent list structure. The adjacent list related APIs follow the design principle of GRIN List.

    - -

    Definition at line 102 of file predefine.h.

    - -
    -
    - -

    ◆ ENABLE_ADJACENT_LIST_ITERATOR

    - -
    -
    - - - - -
    #define ENABLE_ADJACENT_LIST_ITERATOR
    -
    - -

    Enable the adjacent list iterator. The adjacent list iterator related APIs follow the design principle of GRIN Iterator.

    - -

    Definition at line 108 of file predefine.h.

    - -
    -
    - -

    ◆ ENABLE_EDGE_LIST

    - -
    -
    - - - - -
    #define ENABLE_EDGE_LIST
    -
    - -

    Enable the edge list structure. The edge list related APIs follow the design principle of GRIN List.

    - -

    Definition at line 90 of file predefine.h.

    - -
    -
    - -

    ◆ ENABLE_EDGE_LIST_ITERATOR

    - -
    -
    - - - - -
    #define ENABLE_EDGE_LIST_ITERATOR
    -
    - -

    Enable the edge list iterator. The edge list iterator related APIs follow the design principle of GRIN Iterator.

    - -

    Definition at line 96 of file predefine.h.

    - -
    -
    - -

    ◆ ENABLE_EDGE_REF

    - -
    -
    - - - - -
    #define ENABLE_EDGE_REF
    -
    - -

    The storage provides reference of edge that can be recognized in other partitions where the edge also appears.

    - -

    Definition at line 147 of file predefine.h.

    - -
    -
    - -

    ◆ ENABLE_GRAPH_PARTITION

    - -
    -
    - - - - -
    #define ENABLE_GRAPH_PARTITION
    -
    - -

    Enable partitioned graph. A partitioned graph usually contains several fragments (i.e., local graphs) that are distributedly stored in a cluster. In GRIN, Graph represents to a single fragment that can be locally accessed.

    - -

    Definition at line 129 of file predefine.h.

    - -
    -
    - -

    ◆ ENABLE_PREDICATE

    - -
    -
    - - - - -
    #define ENABLE_PREDICATE
    -
    - -

    Enable predicates on graph.

    - -

    Definition at line 247 of file predefine.h.

    - -
    -
    - -

    ◆ ENABLE_VERTEX_LIST

    - -
    -
    - - - - -
    #define ENABLE_VERTEX_LIST
    -
    - -

    Enable the vertex list structure. The vertex list related APIs follow the design principle of GRIN List.

    - -

    Definition at line 78 of file predefine.h.

    - -
    -
    - -

    ◆ ENABLE_VERTEX_LIST_ITERATOR

    - -
    -
    - - - - -
    #define ENABLE_VERTEX_LIST_ITERATOR
    -
    - -

    Enable the vertex list iterator. The vertex list iterator related APIs follow the design principle of GRIN Iterator.

    - -

    Definition at line 84 of file predefine.h.

    - -
    -
    - -

    ◆ ENABLE_VERTEX_REF

    - -
    -
    - - - - -
    #define ENABLE_VERTEX_REF
    -
    - -

    The storage provides reference of vertex that can be recognized in other partitions where the vertex also appears.

    - -

    Definition at line 141 of file predefine.h.

    - -
    -
    - -

    ◆ NATURAL_EDGE_PROPERTY_ID_TRAIT

    - -
    -
    - - - - -
    #define NATURAL_EDGE_PROPERTY_ID_TRAIT
    -
    - -

    Definition at line 205 of file predefine.h.

    - -
    -
    - -

    ◆ NATURAL_EDGE_TYPE_ID_TRAIT

    - -
    -
    - - - - -
    #define NATURAL_EDGE_TYPE_ID_TRAIT
    -
    - -

    Definition at line 204 of file predefine.h.

    - -
    -
    - -

    ◆ NATURAL_PARTITION_ID_TRAIT

    - -
    -
    - - - - -
    #define NATURAL_PARTITION_ID_TRAIT
    -
    - -

    The storage provides natural number IDs for partitions. It follows the design principle of natural number ID trait in GRIN.

    - -

    Definition at line 135 of file predefine.h.

    - -
    -
    - -

    ◆ NATURAL_VERTEX_PROPERTY_ID_TRAIT

    - -
    -
    - - - - -
    #define NATURAL_VERTEX_PROPERTY_ID_TRAIT
    -
    - -

    The storage provides natural number IDs for properties bound to a certain vertex type. It follows the design principle of natural ID trait in GRIN.

    - -

    Definition at line 199 of file predefine.h.

    - -
    -
    - -

    ◆ NATURAL_VERTEX_TYPE_ID_TRAIT

    - -
    -
    - - - - -
    #define NATURAL_VERTEX_TYPE_ID_TRAIT
    -
    - -

    The storage provides natural number IDs for vertex types. It follows the design principle of natural ID trait in GRIN.

    - -

    Definition at line 192 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_EDGE

    - -
    -
    - - - - -
    #define NULL_EDGE   NULL
    -
    - -

    Non-existing edge (invalid return value)

    - -

    Definition at line 262 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_EDGE_REF

    - -
    -
    - - - - -
    #define NULL_EDGE_REF   NULL
    -
    - -

    Null edge reference (invalid return value)

    - -

    Definition at line 270 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_EDGE_TYPE

    - -
    -
    - - - - -
    #define NULL_EDGE_TYPE   NULL
    -
    - -

    Non-existing edge type (invalid return value)

    - -

    Definition at line 274 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_GRAPH

    - -
    -
    - - - - -
    #define NULL_GRAPH   NULL
    -
    - -

    Null graph (invalid return value)

    - -

    Definition at line 258 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_LIST

    - -
    -
    - - - - -
    #define NULL_LIST   NULL
    -
    - -

    Null list of any kind (invalid return value)

    - -

    Definition at line 264 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_NATURAL_ID

    - -
    -
    - - - - -
    #define NULL_NATURAL_ID   UINT_MAX
    -
    - -

    Null natural id of any kind (invalid return value)

    - -

    Definition at line 280 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_PARTITION

    - -
    -
    - - - - -
    #define NULL_PARTITION   NULL
    -
    - -

    Non-existing partition (invalid return value)

    - -

    Definition at line 266 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_PROPERTY

    - -
    -
    - - - - -
    #define NULL_PROPERTY   NULL
    -
    - -

    Non-existing property (invalid return value)

    - -

    Definition at line 276 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_ROW

    - -
    -
    - - - - -
    #define NULL_ROW   NULL
    -
    - -

    Null row (invalid return value)

    - -

    Definition at line 278 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_TYPE

    - -
    -
    - - - - -
    #define NULL_TYPE   Undefined
    -
    - -

    Null type (undefined data type)

    - -

    Definition at line 256 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_VERTEX

    - -
    -
    - - - - -
    #define NULL_VERTEX   NULL
    -
    - -

    Non-existing vertex (invalid return value)

    - -

    Definition at line 260 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_VERTEX_REF

    - -
    -
    - - - - -
    #define NULL_VERTEX_REF   NULL
    -
    - -

    Null vertex reference (invalid return value)

    - -

    Definition at line 268 of file predefine.h.

    - -
    -
    - -

    ◆ NULL_VERTEX_TYPE

    - -
    -
    - - - - -
    #define NULL_VERTEX_TYPE   NULL
    -
    - -

    Non-existing vertex type (invalid return value)

    - -

    Definition at line 272 of file predefine.h.

    - -
    -
    - -

    ◆ WITH_EDGE_DATA

    - -
    -
    - - - - -
    #define WITH_EDGE_DATA
    -
    - -

    There is data on edge. E.g., the weight of an edge.

    - -

    Definition at line 72 of file predefine.h.

    - -
    -
    - -

    ◆ WITH_EDGE_PRIMARTY_KEYS

    - -
    -
    - - - - -
    #define WITH_EDGE_PRIMARTY_KEYS
    -
    - -

    Definition at line 203 of file predefine.h.

    - -
    -
    - -

    ◆ WITH_EDGE_PROPERTY

    - -
    -
    - - - - -
    #define WITH_EDGE_PROPERTY
    -
    - -

    Definition at line 202 of file predefine.h.

    - -
    -
    - -

    ◆ WITH_LABEL

    - -
    -
    - - - - -
    #define WITH_LABEL
    -
    - -

    There are labels assigned to vertices or edges. Labels are mainly used in filtering vertcies or edges.

    - -

    Definition at line 211 of file predefine.h.

    - -
    -
    - -

    ◆ WITH_PROPERTY_NAME

    - -
    -
    - - - - -
    #define WITH_PROPERTY_NAME
    -
    - -

    There are property names for properties. The relationship between property name and properties is one-to-many, because properties bound to different vertex/edge types are distinguished even they may share the same property name. Please refer to the design principle of Property for details.

    - -

    Definition at line 167 of file predefine.h.

    - -
    -
    - -

    ◆ WITH_VERTEX_DATA

    - -
    -
    - - - - -
    #define WITH_VERTEX_DATA
    -
    - -

    There is data on vertex. E.g., the PageRank value of a vertex.

    - -

    Definition at line 67 of file predefine.h.

    - -
    -
    - -

    ◆ WITH_VERTEX_ORIGINAL_ID

    - -
    -
    - - - - -
    #define WITH_VERTEX_ORIGINAL_ID
    -
    - -

    There is original ID for a vertex. This facilitates queries starting from a specific vertex, since one can get the vertex handler directly using its original ID.

    - -

    Definition at line 62 of file predefine.h.

    - -
    -
    - -

    ◆ WITH_VERTEX_PRIMARTY_KEYS

    - -
    -
    - - - - -
    #define WITH_VERTEX_PRIMARTY_KEYS
    -
    - -

    There are primary keys for vertices. Vertex primary keys is a set of vertex properties whose values can distinguish vertices. When vertices are typed, each vertex type has its own primary keys which distinguishes the vertices of that type.

    -

    With primary keys, one can get the vertex from the graph or a certain type by providing the values of the primary keys. The macro is unset if WITH_VERTEX_PROPERTY is NOT defined, in which case, one can use WITH_VERTEX_ORIGINAL_ID when vertices have no properties.

    - -

    Definition at line 186 of file predefine.h.

    - -
    -
    - -

    ◆ WITH_VERTEX_PROPERTY

    - -
    -
    - - - - -
    #define WITH_VERTEX_PROPERTY
    -
    - -

    There are properties bound to vertices. When vertices are typed, vertex properties are bound to vertex types, according to the definition of vertex type.

    - -

    Definition at line 173 of file predefine.h.

    - -
    -
    -

    Typedef Documentation

    - -

    ◆ AdjacentList

    - -
    -
    - - - - -
    typedef void* AdjacentList
    -
    - -

    Definition at line 306 of file predefine.h.

    - -
    -
    - -

    ◆ Edge

    - -
    -
    - - - - -
    typedef void* Edge
    -
    - -

    Definition at line 287 of file predefine.h.

    - -
    -
    - -

    ◆ EdgeProperty

    - -
    -
    - - - - -
    typedef void* EdgeProperty
    -
    - -

    Definition at line 363 of file predefine.h.

    - -
    -
    - -

    ◆ EdgePropertyID

    - -
    -
    - - - - -
    typedef unsigned EdgePropertyID
    -
    - -

    Definition at line 373 of file predefine.h.

    - -
    -
    - -

    ◆ EdgePropertyList

    - -
    -
    - - - - -
    typedef void* EdgePropertyList
    -
    - -

    Definition at line 364 of file predefine.h.

    - -
    -
    - -

    ◆ EdgePropertyTable

    - -
    -
    - - - - -
    typedef void* EdgePropertyTable
    -
    - -

    Definition at line 365 of file predefine.h.

    - -
    -
    - -

    ◆ EdgeType

    - -
    -
    - - - - -
    typedef void* EdgeType
    -
    - -

    Definition at line 361 of file predefine.h.

    - -
    -
    - -

    ◆ EdgeTypeID

    - -
    -
    - - - - -
    typedef unsigned EdgeTypeID
    -
    - -

    Definition at line 369 of file predefine.h.

    - -
    -
    - -

    ◆ EdgeTypeList

    - -
    -
    - - - - -
    typedef void* EdgeTypeList
    -
    - -

    Definition at line 362 of file predefine.h.

    - -
    -
    - -

    ◆ Graph

    - -
    -
    - - - - -
    typedef void* Graph
    -
    - -

    Definition at line 285 of file predefine.h.

    - -
    -
    - -

    ◆ OriginalID

    - -
    -
    - - - - -
    typedef void* OriginalID
    -
    - -

    Definition at line 290 of file predefine.h.

    - -
    -
    - -

    ◆ Partition

    - -
    -
    - - - - -
    typedef void* Partition
    -
    - -

    Definition at line 327 of file predefine.h.

    - -
    -
    - -

    ◆ PartitionedGraph

    - -
    -
    - - - - -
    typedef void* PartitionedGraph
    -
    - -

    Definition at line 326 of file predefine.h.

    - -
    -
    - -

    ◆ PartitionID

    - -
    -
    - - - - -
    typedef unsigned PartitionID
    -
    - -

    Definition at line 332 of file predefine.h.

    - -
    -
    - -

    ◆ PartitionList

    - -
    -
    - - - - -
    typedef void* PartitionList
    -
    - -

    Definition at line 328 of file predefine.h.

    - -
    -
    - -

    ◆ Row

    - -
    -
    - - - - -
    typedef void* Row
    -
    - -

    Definition at line 377 of file predefine.h.

    - -
    -
    - -

    ◆ Vertex

    - -
    -
    - - - - -
    typedef void* Vertex
    -
    - -

    Definition at line 286 of file predefine.h.

    - -
    -
    - -

    ◆ VertexList

    - -
    -
    - - - - -
    typedef void* VertexList
    -
    - -

    Definition at line 298 of file predefine.h.

    - -
    -
    - -

    ◆ VertexProperty

    - -
    -
    - - - - -
    typedef void* VertexProperty
    -
    - -

    Definition at line 347 of file predefine.h.

    - -
    -
    - -

    ◆ VertexPropertyID

    - -
    -
    - - - - -
    typedef unsigned VertexPropertyID
    -
    - -

    Definition at line 357 of file predefine.h.

    - -
    -
    - -

    ◆ VertexPropertyList

    - -
    -
    - - - - -
    typedef void* VertexPropertyList
    -
    - -

    Definition at line 348 of file predefine.h.

    - -
    -
    - -

    ◆ VertexPropertyTable

    - -
    -
    - - - - -
    typedef void* VertexPropertyTable
    -
    - -

    Definition at line 349 of file predefine.h.

    - -
    -
    - -

    ◆ VertexRef

    - -
    -
    - - - - -
    typedef void* VertexRef
    -
    - -

    Definition at line 336 of file predefine.h.

    - -
    -
    - -

    ◆ VertexType

    - -
    -
    - - - - -
    typedef void* VertexType
    -
    - -

    Definition at line 345 of file predefine.h.

    - -
    -
    - -

    ◆ VertexTypeID

    - -
    -
    - - - - -
    typedef unsigned VertexTypeID
    -
    - -

    Definition at line 353 of file predefine.h.

    - -
    -
    - -

    ◆ VertexTypeList

    - -
    -
    - - - - -
    typedef void* VertexTypeList
    -
    - -

    Definition at line 346 of file predefine.h.

    - -
    -
    -

    Enumeration Type Documentation

    - -

    ◆ DataType

    - -
    -
    - - - - -
    enum DataType
    -
    - -

    Enumerates the datatype supported in the storage.

    - - - - - - - - - - - -
    Enumerator
    Undefined 

    other unknown types

    -
    Int32 

    int

    -
    UInt32 

    unsigned int

    -
    Int64 

    long int

    -
    UInt64 

    unsigned long int

    -
    Float 

    float

    -
    Double 

    double

    -
    String 

    string

    -
    Date32 

    short date

    -
    Date64 

    long date

    -
    - -

    Definition at line 40 of file predefine.h.

    - -
    -
    - -

    ◆ Direction

    - -
    -
    - - - - -
    enum Direction
    -
    - -

    Enumerates the directions of edges with respect to a certain vertex.

    - - - - -
    Enumerator
    IN 

    incoming

    -
    OUT 

    outgoing

    -
    BOTH 

    incoming & outgoing

    -
    - -

    Definition at line 33 of file predefine.h.

    - -
    -
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/predefine_8h_source.html b/grin/docs/_build/doxygen/html/predefine_8h_source.html deleted file mode 100644 index ac85add67..000000000 --- a/grin/docs/_build/doxygen/html/predefine_8h_source.html +++ /dev/null @@ -1,335 +0,0 @@ - - - - - - - -GRIN: include/predefine.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    predefine.h
    -
    -
    -Go to the documentation of this file.
    1
    -
    24#ifndef GRIN_INCLUDE_PREDEFINE_H_
    -
    25#define GRIN_INCLUDE_PREDEFINE_H_
    -
    26
    -
    27#include <limits.h>
    -
    28#include <stdbool.h>
    -
    29#include <stddef.h>
    -
    30
    -
    31
    -
    33typedef enum {
    -
    34 IN = 0,
    -
    35 OUT = 1,
    -
    36 BOTH = 2,
    -
    37} Direction;
    -
    38
    -
    40typedef enum {
    - -
    42 Int32 = 1,
    -
    43 UInt32 = 2,
    -
    44 Int64 = 3,
    -
    45 UInt64 = 4,
    -
    46 Float = 5,
    -
    47 Double = 6,
    -
    48 String = 7,
    -
    49 Date32 = 8,
    -
    50 Date64 = 9,
    -
    51} DataType;
    -
    52
    -
    57
    -
    62#define WITH_VERTEX_ORIGINAL_ID
    -
    63
    -
    67#define WITH_VERTEX_DATA
    -
    68
    -
    72#define WITH_EDGE_DATA
    -
    73
    -
    78#define ENABLE_VERTEX_LIST
    -
    79
    -
    84#define ENABLE_VERTEX_LIST_ITERATOR
    -
    85
    -
    90#define ENABLE_EDGE_LIST
    -
    91
    -
    96#define ENABLE_EDGE_LIST_ITERATOR
    -
    97
    -
    102#define ENABLE_ADJACENT_LIST
    -
    103
    -
    108#define ENABLE_ADJACENT_LIST_ITERATOR
    -
    109
    -
    110#undef WITH_VERTEX_DATA
    -
    111#undef WITH_EDGE_DATA
    -
    112#undef ENABLE_VERTEX_LIST_ITERATOR
    -
    113#undef ENABLE_EDGE_LIST
    -
    114#undef ENABLE_EDGE_LIST_ITERATOR
    -
    115#undef ENABLE_ADJACENT_LIST_ITERATOR
    -
    117
    -
    118
    -
    123
    -
    129#define ENABLE_GRAPH_PARTITION
    -
    130
    -
    135#define NATURAL_PARTITION_ID_TRAIT
    -
    136
    -
    141#define ENABLE_VERTEX_REF
    -
    142
    -
    147#define ENABLE_EDGE_REF
    -
    148
    -
    149#ifndef ENABLE_GRAPH_PARTITION
    -
    150#undef NATURAL_PARTITION_ID_TRAIT
    -
    151#endif
    -
    152
    -
    153#undef ENABLE_EDGE_REF
    -
    155
    -
    156
    -
    161
    -
    167#define WITH_PROPERTY_NAME
    -
    168
    -
    173#define WITH_VERTEX_PROPERTY
    -
    174
    -
    186#define WITH_VERTEX_PRIMARTY_KEYS
    -
    187
    -
    192#define NATURAL_VERTEX_TYPE_ID_TRAIT
    -
    193
    -
    199#define NATURAL_VERTEX_PROPERTY_ID_TRAIT
    -
    200
    -
    201
    -
    202#define WITH_EDGE_PROPERTY // There is any property for edges.
    -
    203#define WITH_EDGE_PRIMARTY_KEYS // There is cross-type property name.
    -
    204#define NATURAL_EDGE_TYPE_ID_TRAIT // Edge type has natural continuous id from 0.
    -
    205#define NATURAL_EDGE_PROPERTY_ID_TRAIT // Edge property has natural continuous id from 0.
    -
    206
    -
    211#define WITH_LABEL
    -
    212
    -
    217#define COLUMN_STORE_TRAIT
    -
    218
    -
    219#if !defined(WITH_VERTEX_PROPERTY) && !defined(WITH_EDGE_PROPERTY)
    -
    220#undef WITH_PROPERTY_NAME
    -
    221#endif
    -
    222
    -
    223#ifndef WITH_VERTEX_PROPERTY
    -
    224#undef WITH_VERTEX_PRIMARTY_KEYS
    -
    225#undef NATURAL_VERTEX_TYPE_ID_TRAIT
    -
    226#undef NATURAL_VERTEX_PROPERTY_ID_TRAIT
    -
    227#endif
    -
    228
    -
    229#ifndef WITH_EDGE_PROPERTY
    -
    230#undef WITH_EDGE_PRIMARTY_KEYS
    -
    231#undef NATURAL_EDGE_TYPE_ID_TRAIT
    -
    232#undef NATURAL_EDGE_PROPERTY_ID_TRAIT
    -
    233#endif
    -
    234
    -
    235#undef WITH_VERTEX_PRIMARTY_KEYS
    -
    236
    -
    237#undef WITH_LABEL
    -
    239
    -
    244
    -
    247#define ENABLE_PREDICATE
    -
    248#undef ENABLE_PREDICATE
    -
    250
    -
    255
    -
    256#define NULL_TYPE Undefined
    -
    258#define NULL_GRAPH NULL
    -
    260#define NULL_VERTEX NULL
    -
    262#define NULL_EDGE NULL
    -
    264#define NULL_LIST NULL
    -
    266#define NULL_PARTITION NULL
    -
    268#define NULL_VERTEX_REF NULL
    -
    270#define NULL_EDGE_REF NULL
    -
    272#define NULL_VERTEX_TYPE NULL
    -
    274#define NULL_EDGE_TYPE NULL
    -
    276#define NULL_PROPERTY NULL
    -
    278#define NULL_ROW NULL
    -
    280#define NULL_NATURAL_ID UINT_MAX
    -
    282
    -
    283
    -
    284/* Define the handlers using typedef */
    -
    285typedef void* Graph;
    -
    286typedef void* Vertex;
    -
    287typedef void* Edge;
    -
    288
    -
    289#ifdef WITH_VERTEX_ORIGINAL_ID
    -
    290typedef void* OriginalID;
    -
    291#endif
    -
    292
    -
    293#ifdef WITH_VERTEX_DATA
    -
    294typedef void* VertexData;
    -
    295#endif
    -
    296
    -
    297#ifdef ENABLE_VERTEX_LIST
    -
    298typedef void* VertexList;
    -
    299#endif
    -
    300
    -
    301#ifdef ENABLE_VERTEX_LIST_ITERATOR
    -
    302typedef void* VertexListIterator;
    -
    303#endif
    -
    304
    -
    305#ifdef ENABLE_ADJACENT_LIST
    -
    306typedef void* AdjacentList;
    -
    307#endif
    -
    308
    -
    309#ifdef ENABLE_ADJACENT_LIST_ITERATOR
    -
    310typedef void* AdjacentListIterator;
    -
    311#endif
    -
    312
    -
    313#ifdef WITH_EDGE_DATA
    -
    314typedef void* EdgeData;
    -
    315#endif
    -
    316
    -
    317#ifdef ENABLE_EDGE_LIST
    -
    318typedef void* EdgeList;
    -
    319#endif
    -
    320
    -
    321#ifdef ENABLE_EDGE_LIST_ITERATOR
    -
    322typedef void* EdgeListIterator;
    -
    323#endif
    -
    324
    -
    325#ifdef ENABLE_GRAPH_PARTITION
    -
    326typedef void* PartitionedGraph;
    -
    327typedef void* Partition;
    -
    328typedef void* PartitionList;
    -
    329#endif
    -
    330
    -
    331#ifdef NATURAL_PARTITION_ID_TRAIT
    -
    332typedef unsigned PartitionID;
    -
    333#endif
    -
    334
    -
    335#ifdef ENABLE_VERTEX_REF
    -
    336typedef void* VertexRef;
    -
    337#endif
    -
    338
    -
    339#ifdef ENABLE_EDGE_REF
    -
    340typedef void* EdgeRef;
    -
    341#endif
    -
    342
    -
    343
    -
    344#ifdef WITH_VERTEX_PROPERTY
    -
    345typedef void* VertexType;
    -
    346typedef void* VertexTypeList;
    -
    347typedef void* VertexProperty;
    -
    348typedef void* VertexPropertyList;
    -
    349typedef void* VertexPropertyTable;
    -
    350#endif
    -
    351
    -
    352#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT
    -
    353typedef unsigned VertexTypeID;
    -
    354#endif
    -
    355
    -
    356#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT
    -
    357typedef unsigned VertexPropertyID;
    -
    358#endif
    -
    359
    -
    360#ifdef WITH_EDGE_PROPERTY
    -
    361typedef void* EdgeType;
    -
    362typedef void* EdgeTypeList;
    -
    363typedef void* EdgeProperty;
    -
    364typedef void* EdgePropertyList;
    -
    365typedef void* EdgePropertyTable;
    -
    366#endif
    -
    367
    -
    368#ifdef NATURAL_EDGE_TYPE_ID_TRAIT
    -
    369typedef unsigned EdgeTypeID;
    -
    370#endif
    -
    371
    -
    372#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT
    -
    373typedef unsigned EdgePropertyID;
    -
    374#endif
    -
    375
    -
    376#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY)
    -
    377typedef void* Row;
    -
    378#endif
    -
    379
    -
    380#ifdef WITH_LABEL
    -
    381typedef void* Label
    -
    382typedef void* LabelList
    -
    383#endif
    -
    384
    -
    385#endif // GRIN_INCLUDE_PREDEFINE_H_
    -
    Direction
    Enumerates the directions of edges with respect to a certain vertex.
    Definition: predefine.h:33
    -
    @ BOTH
    incoming & outgoing
    Definition: predefine.h:36
    -
    @ OUT
    outgoing
    Definition: predefine.h:35
    -
    @ IN
    incoming
    Definition: predefine.h:34
    -
    DataType
    Enumerates the datatype supported in the storage.
    Definition: predefine.h:40
    -
    @ UInt64
    unsigned long int
    Definition: predefine.h:45
    -
    @ Undefined
    other unknown types
    Definition: predefine.h:41
    -
    @ Date32
    short date
    Definition: predefine.h:49
    -
    @ UInt32
    unsigned int
    Definition: predefine.h:43
    -
    @ Int32
    int
    Definition: predefine.h:42
    -
    @ Date64
    long date
    Definition: predefine.h:50
    -
    @ Float
    float
    Definition: predefine.h:46
    -
    @ Int64
    long int
    Definition: predefine.h:44
    -
    @ String
    string
    Definition: predefine.h:48
    -
    @ Double
    double
    Definition: predefine.h:47
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/primarykey_8h.html b/grin/docs/_build/doxygen/html/primarykey_8h.html deleted file mode 100644 index 7ca87cbf8..000000000 --- a/grin/docs/_build/doxygen/html/primarykey_8h.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - -GRIN: include/property/primarykey.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    - -
    primarykey.h File Reference
    -
    -
    - -

    Define the primary key related APIs. -More...

    -
    #include "../predefine.h"
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - -

    -Functions

    VertexTypeList get_vertex_types_with_primary_keys (const Graph)
     get the vertex types with primary keys
     
    VertexPropertyList get_primary_keys_by_vertex_type (const Graph, const VertexType)
     get the primary keys (property list) of a specific vertex type
     
    Vertex get_vertex_by_primay_keys (const Graph, const VertexPropertyList, const Row)
     get the vertex with the given primary keys
     
    -

    Detailed Description

    -

    Define the primary key related APIs.

    -

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    - -

    Definition in file primarykey.h.

    -

    Function Documentation

    - -

    ◆ get_primary_keys_by_vertex_type()

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    VertexPropertyList get_primary_keys_by_vertex_type (const Graph,
    const VertexType 
    )
    -
    - -

    get the primary keys (property list) of a specific vertex type

    -
    Parameters
    - - - -
    Graphthe graph
    VertexTypethe vertex type
    -
    -
    - -
    -
    - -

    ◆ get_vertex_by_primay_keys()

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    Vertex get_vertex_by_primay_keys (const Graph,
    const VertexPropertyList,
    const Row 
    )
    -
    - -

    get the vertex with the given primary keys

    -
    Parameters
    - - - - -
    Graphthe graph
    VertexPropertyListthe primary keys
    Rowthe values of primary keys
    -
    -
    - -
    -
    - -

    ◆ get_vertex_types_with_primary_keys()

    - -
    -
    - - - - - - - - -
    VertexTypeList get_vertex_types_with_primary_keys (const Graph)
    -
    - -

    get the vertex types with primary keys

    -
    Parameters
    - - -
    Graphthe graph
    -
    -
    - -
    -
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/primarykey_8h_source.html b/grin/docs/_build/doxygen/html/primarykey_8h_source.html deleted file mode 100644 index b15ce4873..000000000 --- a/grin/docs/_build/doxygen/html/primarykey_8h_source.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - -GRIN: include/property/primarykey.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    primarykey.h
    -
    -
    -Go to the documentation of this file.
    1
    -
    18#ifndef GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_
    -
    19#define GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_
    -
    20
    -
    21#include "../predefine.h"
    -
    22
    -
    23#ifdef WITH_VERTEX_PRIMARY_KEYS
    -
    28VertexTypeList get_vertex_types_with_primary_keys(const Graph);
    -
    29
    -
    35VertexPropertyList get_primary_keys_by_vertex_type(const Graph, const VertexType);
    -
    36
    -
    43Vertex get_vertex_by_primay_keys(const Graph, const VertexPropertyList, const Row);
    -
    44#endif
    -
    45
    -
    46#endif // GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_
    -
    VertexTypeList get_vertex_types_with_primary_keys(const Graph)
    get the vertex types with primary keys
    -
    Vertex get_vertex_by_primay_keys(const Graph, const VertexPropertyList, const Row)
    get the vertex with the given primary keys
    -
    VertexPropertyList get_primary_keys_by_vertex_type(const Graph, const VertexType)
    get the primary keys (property list) of a specific vertex type
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/property_8h.html b/grin/docs/_build/doxygen/html/property_8h.html deleted file mode 100644 index 9562f14d4..000000000 --- a/grin/docs/_build/doxygen/html/property_8h.html +++ /dev/null @@ -1,371 +0,0 @@ - - - - - - - -GRIN: include/property/property.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    - -
    property.h File Reference
    -
    -
    - -

    Define the property related APIs. -More...

    -
    #include "../predefine.h"
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Functions

    -char * get_vertex_property_name (const Graph, const VertexProperty)
     
    VertexProperty get_vertex_property_by_name (const Graph, const VertexType, const char *msg)
     get the vertex property with a given name under a specific vertex type
     
    VertexPropertyList get_vertex_properties_by_name (const Graph, const char *)
     get all the vertex properties with a given name
     
    -char * get_edge_property_name (const Graph, const EdgeProperty)
     
    EdgeProperty get_edge_property_by_name (const Graph, const EdgeType, const char *msg)
     get the edge property with a given name under a specific edge type
     
    EdgePropertyList get_edge_properties_by_name (const Graph, const char *)
     get all the edge properties with a given name
     
    void destroy_vertex_property (VertexProperty)
     destroy vertex property
     
    DataType get_vertex_property_data_type (VertexProperty)
     get property data type
     
    VertexType get_vertex_property_vertex_type (VertexProperty)
     get the vertex type that the property is bound to
     
    -

    Detailed Description

    -

    Define the property related APIs.

    -

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    - -

    Definition in file property.h.

    -

    Function Documentation

    - -

    ◆ destroy_vertex_property()

    - -
    -
    - - - - - - - - -
    void destroy_vertex_property (VertexProperty )
    -
    - -

    destroy vertex property

    -
    Parameters
    - - -
    VertexPropertyvertex property
    -
    -
    - -
    -
    - -

    ◆ get_edge_properties_by_name()

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    EdgePropertyList get_edge_properties_by_name (const Graph,
    const char *  
    )
    -
    - -

    get all the edge properties with a given name

    -
    Parameters
    - - - -
    Graphthe graph
    msgthe name
    -
    -
    - -
    -
    - -

    ◆ get_edge_property_by_name()

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    EdgeProperty get_edge_property_by_name (const Graph,
    const EdgeType,
    const char * msg 
    )
    -
    - -

    get the edge property with a given name under a specific edge type

    -
    Parameters
    - - - - -
    Graphthe graph
    EdgeTypethe specific edge type
    msgthe name
    -
    -
    - -
    -
    - -

    ◆ get_vertex_properties_by_name()

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    VertexPropertyList get_vertex_properties_by_name (const Graph,
    const char *  
    )
    -
    - -

    get all the vertex properties with a given name

    -
    Parameters
    - - - -
    Graphthe graph
    msgthe name
    -
    -
    - -
    -
    - -

    ◆ get_vertex_property_by_name()

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    VertexProperty get_vertex_property_by_name (const Graph,
    const VertexType,
    const char * msg 
    )
    -
    - -

    get the vertex property with a given name under a specific vertex type

    -
    Parameters
    - - - - -
    Graphthe graph
    VertexTypethe specific vertex type
    msgthe name
    -
    -
    - -
    -
    - -

    ◆ get_vertex_property_data_type()

    - -
    -
    - - - - - - - - -
    DataType get_vertex_property_data_type (VertexProperty )
    -
    - -

    get property data type

    -
    Parameters
    - - -
    VertexPropertyvertex property
    -
    -
    - -
    -
    - -

    ◆ get_vertex_property_vertex_type()

    - -
    -
    - - - - - - - - -
    VertexType get_vertex_property_vertex_type (VertexProperty )
    -
    - -

    get the vertex type that the property is bound to

    -
    Parameters
    - - -
    VertexPropertyvertex property
    -
    -
    - -
    -
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/property_8h_source.html b/grin/docs/_build/doxygen/html/property_8h_source.html deleted file mode 100644 index e27c544d2..000000000 --- a/grin/docs/_build/doxygen/html/property_8h_source.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - -GRIN: include/property/property.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    property.h
    -
    -
    -Go to the documentation of this file.
    1
    -
    18#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_H_
    -
    19#define GRIN_INCLUDE_PROPERTY_PROPERTY_H_
    -
    20
    -
    21#include "../predefine.h"
    -
    22
    -
    23#ifdef WITH_PROPERTY_NAME
    -
    24char* get_vertex_property_name(const Graph, const VertexProperty);
    -
    25
    -
    32VertexProperty get_vertex_property_by_name(const Graph, const VertexType, const char* msg);
    -
    33
    -
    39VertexPropertyList get_vertex_properties_by_name(const Graph, const char*);
    -
    40
    -
    41char* get_edge_property_name(const Graph, const EdgeProperty);
    -
    42
    -
    49EdgeProperty get_edge_property_by_name(const Graph, const EdgeType, const char* msg);
    -
    50
    -
    56EdgePropertyList get_edge_properties_by_name(const Graph, const char*);
    -
    57#endif
    -
    58
    -
    59
    -
    60#ifdef WITH_VERTEX_PROPERTY
    -
    65void destroy_vertex_property(VertexProperty);
    -
    66
    - -
    72
    -
    77VertexType get_vertex_property_vertex_type(VertexProperty);
    -
    78#endif
    -
    79
    -
    80
    -
    81
    -
    82#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_H_
    -
    DataType
    Enumerates the datatype supported in the storage.
    Definition: predefine.h:40
    -
    EdgeProperty get_edge_property_by_name(const Graph, const EdgeType, const char *msg)
    get the edge property with a given name under a specific edge type
    -
    VertexPropertyList get_vertex_properties_by_name(const Graph, const char *)
    get all the vertex properties with a given name
    -
    VertexType get_vertex_property_vertex_type(VertexProperty)
    get the vertex type that the property is bound to
    -
    EdgePropertyList get_edge_properties_by_name(const Graph, const char *)
    get all the edge properties with a given name
    -
    DataType get_vertex_property_data_type(VertexProperty)
    get property data type
    -
    void destroy_vertex_property(VertexProperty)
    destroy vertex property
    -
    VertexProperty get_vertex_property_by_name(const Graph, const VertexType, const char *msg)
    get the vertex property with a given name under a specific vertex type
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/propertylist_8h.html b/grin/docs/_build/doxygen/html/propertylist_8h.html deleted file mode 100644 index 602d25ab5..000000000 --- a/grin/docs/_build/doxygen/html/propertylist_8h.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - -GRIN: include/property/propertylist.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    - -
    propertylist.h File Reference
    -
    -
    - -

    Define the property list related and graph projection APIs. -More...

    -
    #include "../predefine.h"
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Functions

    -VertexPropertyList get_vertex_property_list_by_type (const Graph, const VertexType)
     
    -size_t get_vertex_property_list_size (const VertexPropertyList)
     
    -VertexProperty get_vertex_property_from_list (const VertexPropertyList, const size_t)
     
    -VertexPropertyList create_vertex_property_list ()
     
    -void destroy_vertex_property_list (VertexPropertyList)
     
    -bool insert_vertex_property_to_list (VertexPropertyList, const VertexProperty)
     
    -VertexProperty get_vertex_property_from_id (const VertexType, const VertexPropertyID)
     
    -VertexPropertyID get_vertex_property_id (const VertexType, const VertexProperty)
     
    -EdgePropertyList get_edge_property_list_by_type (const Graph, const EdgeType)
     
    -size_t get_edge_property_list_size (const EdgePropertyList)
     
    -EdgeProperty get_edge_property_from_list (const EdgePropertyList, const size_t)
     
    -EdgePropertyList create_edge_property_list ()
     
    -void destroy_edge_property_list (EdgePropertyList)
     
    -bool insert_edge_property_to_list (EdgePropertyList, const EdgeProperty)
     
    -EdgeProperty get_edge_property_from_id (const EdgeType, const EdgePropertyID)
     
    -EdgePropertyID get_edge_property_id (const EdgeType, const EdgeProperty)
     
    GraphProjection

    Graph projection mainly works to shrink the properties into a subset in need to improve the retrieval efficiency. Note that only the vertex/edge type with at least one property left in the vertex/edge property list will be kept after the projection.

    -

    The projection only works on column store systems.

    -
    -Graph select_vertex_properties (const Graph, const VertexPropertyList)
     project vertex properties
     
    -Graph select_edge_properteis (const Graph, const EdgePropertyList)
     project edge properties
     
    -

    Detailed Description

    -

    Define the property list related and graph projection APIs.

    -

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    - -

    Definition in file propertylist.h.

    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/propertylist_8h_source.html b/grin/docs/_build/doxygen/html/propertylist_8h_source.html deleted file mode 100644 index c99917306..000000000 --- a/grin/docs/_build/doxygen/html/propertylist_8h_source.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - -GRIN: include/property/propertylist.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    propertylist.h
    -
    -
    -Go to the documentation of this file.
    1
    -
    18#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_
    -
    19#define GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_
    -
    20
    -
    21#include "../predefine.h"
    -
    22
    -
    23// Property list
    -
    24#ifdef WITH_VERTEX_PROPERTY
    -
    25VertexPropertyList get_vertex_property_list_by_type(const Graph, const VertexType);
    -
    26
    -
    27size_t get_vertex_property_list_size(const VertexPropertyList);
    -
    28
    -
    29VertexProperty get_vertex_property_from_list(const VertexPropertyList, const size_t);
    -
    30
    -
    31VertexPropertyList create_vertex_property_list();
    -
    32
    -
    33void destroy_vertex_property_list(VertexPropertyList);
    -
    34
    -
    35bool insert_vertex_property_to_list(VertexPropertyList, const VertexProperty);
    -
    36#endif
    -
    37
    -
    38#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT
    -
    39VertexProperty get_vertex_property_from_id(const VertexType, const VertexPropertyID);
    -
    40
    -
    41VertexPropertyID get_vertex_property_id(const VertexType, const VertexProperty);
    -
    42#endif
    -
    43
    -
    44
    -
    45#ifdef WITH_EDGE_PROPERTY
    -
    46EdgePropertyList get_edge_property_list_by_type(const Graph, const EdgeType);
    -
    47
    -
    48size_t get_edge_property_list_size(const EdgePropertyList);
    -
    49
    -
    50EdgeProperty get_edge_property_from_list(const EdgePropertyList, const size_t);
    -
    51
    -
    52EdgePropertyList create_edge_property_list();
    -
    53
    -
    54void destroy_edge_property_list(EdgePropertyList);
    -
    55
    -
    56bool insert_edge_property_to_list(EdgePropertyList, const EdgeProperty);
    -
    57#endif
    -
    58
    -
    59#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT
    -
    60EdgeProperty get_edge_property_from_id(const EdgeType, const EdgePropertyID);
    -
    61
    -
    62EdgePropertyID get_edge_property_id(const EdgeType, const EdgeProperty);
    -
    63#endif
    -
    64
    -
    65
    -
    75#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE_TRAIT)
    -
    77Graph select_vertex_properties(const Graph, const VertexPropertyList);
    -
    78#endif
    -
    79
    -
    80#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE_TRAIT)
    -
    82Graph select_edge_properteis(const Graph, const EdgePropertyList);
    -
    83#endif
    -
    84
    -
    85#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_
    -
    Graph select_vertex_properties(const Graph, const VertexPropertyList)
    project vertex properties
    -
    Graph select_edge_properteis(const Graph, const EdgePropertyList)
    project edge properties
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/propertytable_8h.html b/grin/docs/_build/doxygen/html/propertytable_8h.html deleted file mode 100644 index 9d18a165e..000000000 --- a/grin/docs/_build/doxygen/html/propertytable_8h.html +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - -GRIN: include/property/propertytable.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    - -
    propertytable.h File Reference
    -
    -
    - -

    Define the property table related APIs. -More...

    -
    #include "../predefine.h"
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Functions

    void destroy_vertex_property_table (VertexPropertyTable)
     destroy vertex property table
     
    VertexPropertyTable get_vertex_property_table_by_type (const Graph, const VertexType)
     get the vertex property table of a certain vertex type No matter column or row store strategy is used in the storage, GRIN recommends to first get the property table of the vertex type, and then fetch values(rows) by vertex and property(list). However, GRIN does provide direct row fetching API when COLUMN_STORE_TRAIT is NOT set.
     
    void * get_value_from_vertex_property_table (const VertexPropertyTable, const Vertex, const VertexProperty)
     get vertex property value from table
     
    Row get_row_from_vertex_property_table (const VertexPropertyTable, const Vertex, const VertexPropertyList)
     get vertex row from table
     
    Row

    Row works as the pure value array for the properties of a vertex or an edge. In general, you can think of Row as an array of void*, where each void* points to the value of a property. GRIN assumes the user already knows the corresponding property list beforehead, so that she/he knows how to cast the void* into the property's data type.

    -
    -void destroy_row (Row)
     
    -void * get_value_from_row (Row, const size_t)
     the value of a property from row by its position in row
     
    -Row create_row ()
     create a row, usually to get vertex/edge by primary keys
     
    -bool insert_value_to_row (Row, const void *)
     insert a value to the end of the row
     
    -

    Detailed Description

    -

    Define the property table related APIs.

    -

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    - -

    Definition in file propertytable.h.

    -

    Function Documentation

    - -

    ◆ destroy_vertex_property_table()

    - -
    -
    - - - - - - - - -
    void destroy_vertex_property_table (VertexPropertyTable )
    -
    - -

    destroy vertex property table

    -
    Parameters
    - - -
    VertexPropertyTablevertex property table
    -
    -
    - -
    -
    - -

    ◆ get_row_from_vertex_property_table()

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    Row get_row_from_vertex_property_table (const VertexPropertyTable,
    const Vertex,
    const VertexPropertyList 
    )
    -
    - -

    get vertex row from table

    -
    Parameters
    - - - - -
    VertexPropertyTablevertex property table
    Vertexthe vertex which is the row index
    VertexPropertyListthe vertex property list as columns
    -
    -
    - -
    -
    - -

    ◆ get_value_from_vertex_property_table()

    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    void * get_value_from_vertex_property_table (const VertexPropertyTable,
    const Vertex,
    const VertexProperty 
    )
    -
    - -

    get vertex property value from table

    -
    Parameters
    - - - - -
    VertexPropertyTablevertex property table
    Vertexthe vertex which is the row index
    VertexPropertythe vertex property which is the column index
    -
    -
    -
    Returns
    can be casted to the property data type by the caller
    - -
    -
    - -

    ◆ get_vertex_property_table_by_type()

    - -
    -
    - - - - - - - - - - - - - - - - - - -
    VertexPropertyTable get_vertex_property_table_by_type (const Graph,
    const VertexType 
    )
    -
    - -

    get the vertex property table of a certain vertex type No matter column or row store strategy is used in the storage, GRIN recommends to first get the property table of the vertex type, and then fetch values(rows) by vertex and property(list). However, GRIN does provide direct row fetching API when COLUMN_STORE_TRAIT is NOT set.

    -
    Parameters
    - - - -
    Graphthe graph
    VertexTypethe vertex type
    -
    -
    - -
    -
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/propertytable_8h_source.html b/grin/docs/_build/doxygen/html/propertytable_8h_source.html deleted file mode 100644 index 4d91074e8..000000000 --- a/grin/docs/_build/doxygen/html/propertytable_8h_source.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - -GRIN: include/property/propertytable.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    propertytable.h
    -
    -
    -Go to the documentation of this file.
    1
    -
    18#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_
    -
    19#define GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_
    -
    20
    -
    21#include "../predefine.h"
    -
    22
    -
    31#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY)
    -
    32void destroy_row(Row);
    -
    33
    -
    35void* get_value_from_row(Row, const size_t);
    -
    36
    - -
    39
    -
    41bool insert_value_to_row(Row, const void*);
    -
    42#endif
    -
    44
    -
    45#ifdef WITH_VERTEX_PROPERTY
    -
    50void destroy_vertex_property_table(VertexPropertyTable);
    -
    51
    -
    62VertexPropertyTable get_vertex_property_table_by_type(const Graph, const VertexType);
    -
    63
    -
    71void* get_value_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexProperty);
    -
    72
    -
    79Row get_row_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexPropertyList);
    -
    80
    -
    81#ifndef COLUMN_STORE_TRAIT
    -
    88Row get_vertex_row(const Graph, const Vertex, const VertexPropertyList);
    -
    89#endif
    -
    90#endif
    -
    91
    -
    92
    -
    93#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_
    -
    void destroy_vertex_property_table(VertexPropertyTable)
    destroy vertex property table
    -
    Row get_row_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexPropertyList)
    get vertex row from table
    -
    void * get_value_from_row(Row, const size_t)
    the value of a property from row by its position in row
    -
    bool insert_value_to_row(Row, const void *)
    insert a value to the end of the row
    -
    void * get_value_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexProperty)
    get vertex property value from table
    -
    Row create_row()
    create a row, usually to get vertex/edge by primary keys
    -
    VertexPropertyTable get_vertex_property_table_by_type(const Graph, const VertexType)
    get the vertex property table of a certain vertex type No matter column or row store strategy is used...
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/search/all_0.js b/grin/docs/_build/doxygen/html/search/all_0.js deleted file mode 100644 index 5c11d88fc..000000000 --- a/grin/docs/_build/doxygen/html/search/all_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['assign_5flabel_5fto_5fvertex_0',['assign_label_to_vertex',['../label_8h.html#a8091acf655961c1b66933945feac27f3',1,'label.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_1.js b/grin/docs/_build/doxygen/html/search/all_1.js deleted file mode 100644 index 46cd1debe..000000000 --- a/grin/docs/_build/doxygen/html/search/all_1.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['both_0',['BOTH',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaa627abe5a430420baf29ebe1940a7f2fb',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_2.js b/grin/docs/_build/doxygen/html/search/all_2.js deleted file mode 100644 index fd80d60fd..000000000 --- a/grin/docs/_build/doxygen/html/search/all_2.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['column_5fstore_5ftrait_0',['COLUMN_STORE_TRAIT',['../predefine_8h.html#a408d94da6105b6a6c508726da065e8b7',1,'predefine.h']]], - ['create_5frow_1',['create_row',['../propertytable_8h.html#a86a5c42d5ede169c6374b2434c8c1982',1,'propertytable.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_3.js b/grin/docs/_build/doxygen/html/search/all_3.js deleted file mode 100644 index 2981600e3..000000000 --- a/grin/docs/_build/doxygen/html/search/all_3.js +++ /dev/null @@ -1,10 +0,0 @@ -var searchData= -[ - ['datatype_0',['DataType',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6',1,'predefine.h']]], - ['date32_1',['Date32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a32e9f594d9d89533ffad18df5536423e',1,'predefine.h']]], - ['date64_2',['Date64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ab51d5181af439511070862d786809269',1,'predefine.h']]], - ['destroy_5fvertex_5fproperty_3',['destroy_vertex_property',['../property_8h.html#a8e1467e6a4a322bb1761a17f779d0dbd',1,'property.h']]], - ['destroy_5fvertex_5fproperty_5ftable_4',['destroy_vertex_property_table',['../propertytable_8h.html#a01c1ba34a369590177ff90521755aac5',1,'propertytable.h']]], - ['direction_5',['Direction',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aa',1,'predefine.h']]], - ['double_6',['Double',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6afb7825ebed9ad96348ee8588d84db633',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_4.js b/grin/docs/_build/doxygen/html/search/all_4.js deleted file mode 100644 index b68fcf548..000000000 --- a/grin/docs/_build/doxygen/html/search/all_4.js +++ /dev/null @@ -1,13 +0,0 @@ -var searchData= -[ - ['enable_5fadjacent_5flist_0',['ENABLE_ADJACENT_LIST',['../predefine_8h.html#a470cf7c92d8839bff02a0409d2b7db30',1,'predefine.h']]], - ['enable_5fadjacent_5flist_5fiterator_1',['ENABLE_ADJACENT_LIST_ITERATOR',['../predefine_8h.html#ad4116d8ec1dc2f1cf553348f13b757a0',1,'predefine.h']]], - ['enable_5fedge_5flist_2',['ENABLE_EDGE_LIST',['../predefine_8h.html#ac7521994bc76d45695c1f83ac9ebbe10',1,'predefine.h']]], - ['enable_5fedge_5flist_5fiterator_3',['ENABLE_EDGE_LIST_ITERATOR',['../predefine_8h.html#a193c9b2d09d52d6c9f2a18af75b70074',1,'predefine.h']]], - ['enable_5fedge_5fref_4',['ENABLE_EDGE_REF',['../predefine_8h.html#a947197070bcf936da983899370331286',1,'predefine.h']]], - ['enable_5fgraph_5fpartition_5',['ENABLE_GRAPH_PARTITION',['../predefine_8h.html#a152141205611e26882f23df7a5f69d0a',1,'predefine.h']]], - ['enable_5fpredicate_6',['ENABLE_PREDICATE',['../predefine_8h.html#a0e931dc102cb72f9b6be1d65a5cf87e3',1,'predefine.h']]], - ['enable_5fvertex_5flist_7',['ENABLE_VERTEX_LIST',['../predefine_8h.html#a24ab9b872487b91605b42c2c2d2d33bd',1,'predefine.h']]], - ['enable_5fvertex_5flist_5fiterator_8',['ENABLE_VERTEX_LIST_ITERATOR',['../predefine_8h.html#a3047177510fa354ee7898825387289b7',1,'predefine.h']]], - ['enable_5fvertex_5fref_9',['ENABLE_VERTEX_REF',['../predefine_8h.html#a79e38008004615608e283c5f575df82e',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_5.js b/grin/docs/_build/doxygen/html/search/all_5.js deleted file mode 100644 index 4e566c5c7..000000000 --- a/grin/docs/_build/doxygen/html/search/all_5.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['filter_5fvertex_5flist_5fby_5flabel_0',['filter_vertex_list_by_label',['../label_8h.html#a3a6da911bce12049c0d97d99883889b8',1,'label.h']]], - ['float_1',['Float',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ad67b0ee7230dcecb610254e4e5e589cd',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_6.js b/grin/docs/_build/doxygen/html/search/all_6.js deleted file mode 100644 index 59b46bbb0..000000000 --- a/grin/docs/_build/doxygen/html/search/all_6.js +++ /dev/null @@ -1,22 +0,0 @@ -var searchData= -[ - ['get_5fdst_5ftypes_5ffrom_5fedge_5ftype_0',['get_dst_types_from_edge_type',['../type_8h.html#a00edf242478b7ddf519c24e318e5a61d',1,'type.h']]], - ['get_5fedge_5fproperties_5fby_5fname_1',['get_edge_properties_by_name',['../property_8h.html#a55bf3fc271e09ec398a17364c7826784',1,'property.h']]], - ['get_5fedge_5fproperty_5fby_5fname_2',['get_edge_property_by_name',['../property_8h.html#a002d96d3a1733e075d5a66feb3ad5e02',1,'property.h']]], - ['get_5fedge_5ftypes_5ffrom_5fvertex_5ftype_5fpair_3',['get_edge_types_from_vertex_type_pair',['../type_8h.html#a1705ee27fa9ec2a12d1a4d3700387c8f',1,'type.h']]], - ['get_5fprimary_5fkeys_5fby_5fvertex_5ftype_4',['get_primary_keys_by_vertex_type',['../primarykey_8h.html#ae314c22d353c03bffaf62ea0ba69c491',1,'primarykey.h']]], - ['get_5frow_5ffrom_5fvertex_5fproperty_5ftable_5',['get_row_from_vertex_property_table',['../propertytable_8h.html#a0d727fb5c0a961df0f87c4b128463956',1,'propertytable.h']]], - ['get_5fsrc_5ftypes_5ffrom_5fedge_5ftype_6',['get_src_types_from_edge_type',['../type_8h.html#acedf36dd7ba7c4af1b080de8ffa246d2',1,'type.h']]], - ['get_5fvalue_5ffrom_5frow_7',['get_value_from_row',['../propertytable_8h.html#a23f95e06bdec368337c1ccfbadde97d9',1,'propertytable.h']]], - ['get_5fvalue_5ffrom_5fvertex_5fproperty_5ftable_8',['get_value_from_vertex_property_table',['../propertytable_8h.html#a4116b4fe6d95991db646b0e99d6fbd9f',1,'propertytable.h']]], - ['get_5fvertex_5fby_5fprimay_5fkeys_9',['get_vertex_by_primay_keys',['../primarykey_8h.html#addda3be6a980086d6b25db1a82a89511',1,'primarykey.h']]], - ['get_5fvertex_5flabel_5flist_10',['get_vertex_label_list',['../label_8h.html#a34138b59b44f405f346a48fd4f72ff2c',1,'label.h']]], - ['get_5fvertex_5flist_5fby_5flabel_11',['get_vertex_list_by_label',['../label_8h.html#a3644dc6bfcee62f9183bd89422e6c19e',1,'label.h']]], - ['get_5fvertex_5fproperties_5fby_5fname_12',['get_vertex_properties_by_name',['../property_8h.html#a33bb22d6ad61e86d1963ef9710993537',1,'property.h']]], - ['get_5fvertex_5fproperty_5fby_5fname_13',['get_vertex_property_by_name',['../property_8h.html#afb3122e6b577a4b2117aec43d6499f58',1,'property.h']]], - ['get_5fvertex_5fproperty_5fdata_5ftype_14',['get_vertex_property_data_type',['../property_8h.html#a7d1719a4d15cb72cf235dd6bc5701d25',1,'property.h']]], - ['get_5fvertex_5fproperty_5ftable_5fby_5ftype_15',['get_vertex_property_table_by_type',['../propertytable_8h.html#ac9bc9b9015469cbd548f5d033ef6d5cb',1,'propertytable.h']]], - ['get_5fvertex_5fproperty_5fvertex_5ftype_16',['get_vertex_property_vertex_type',['../property_8h.html#a387695bec35c802bf4a7f6b7362f6e91',1,'property.h']]], - ['get_5fvertex_5ftypes_5fwith_5fprimary_5fkeys_17',['get_vertex_types_with_primary_keys',['../primarykey_8h.html#a6668fc8add629c0aa384b134843d4de8',1,'primarykey.h']]], - ['grin_18',['GRIN',['../index.html',1,'']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_7.js b/grin/docs/_build/doxygen/html/search/all_7.js deleted file mode 100644 index 98af1f3ea..000000000 --- a/grin/docs/_build/doxygen/html/search/all_7.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['in_0',['IN',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaaf3180515f5867a29932df1dc207b31ad',1,'predefine.h']]], - ['insert_5fvalue_5fto_5frow_1',['insert_value_to_row',['../propertytable_8h.html#a36d2dd0c3492ee17c3c7a58d5534cf7e',1,'propertytable.h']]], - ['int32_2',['Int32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a788a72ddbf1bd572b3fcd7a5e7ec8cff',1,'predefine.h']]], - ['int64_3',['Int64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ada475947399b8ab4d13d40fea50f950c',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_8.js b/grin/docs/_build/doxygen/html/search/all_8.js deleted file mode 100644 index 47bf2326d..000000000 --- a/grin/docs/_build/doxygen/html/search/all_8.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['label_2eh_0',['label.h',['../label_8h.html',1,'']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_9.js b/grin/docs/_build/doxygen/html/search/all_9.js deleted file mode 100644 index 66cfbd7a4..000000000 --- a/grin/docs/_build/doxygen/html/search/all_9.js +++ /dev/null @@ -1,19 +0,0 @@ -var searchData= -[ - ['natural_5fpartition_5fid_5ftrait_0',['NATURAL_PARTITION_ID_TRAIT',['../predefine_8h.html#a0705ed8c61f68b297c2bfee1ef9324f3',1,'predefine.h']]], - ['natural_5fvertex_5fproperty_5fid_5ftrait_1',['NATURAL_VERTEX_PROPERTY_ID_TRAIT',['../predefine_8h.html#a6274cf30a5a13b8a651e038a066d7b4b',1,'predefine.h']]], - ['natural_5fvertex_5ftype_5fid_5ftrait_2',['NATURAL_VERTEX_TYPE_ID_TRAIT',['../predefine_8h.html#a14e2e67fdc843840df342c5cc5d838ba',1,'predefine.h']]], - ['null_5fedge_3',['NULL_EDGE',['../predefine_8h.html#af645ccbab4871128dbaed2a1828cdbef',1,'predefine.h']]], - ['null_5fedge_5fref_4',['NULL_EDGE_REF',['../predefine_8h.html#ac8dec862f065b60acf3e3f15b4fa97d4',1,'predefine.h']]], - ['null_5fedge_5ftype_5',['NULL_EDGE_TYPE',['../predefine_8h.html#acbc160e12d961cf5bae4d0a65574b94c',1,'predefine.h']]], - ['null_5fgraph_6',['NULL_GRAPH',['../predefine_8h.html#acf65bb3a1ad2164ea7eaa8829cb43420',1,'predefine.h']]], - ['null_5flist_7',['NULL_LIST',['../predefine_8h.html#a29aa3c78422ac30f2619b7bd2e1ce3fa',1,'predefine.h']]], - ['null_5fnatural_5fid_8',['NULL_NATURAL_ID',['../predefine_8h.html#af80bb749627dfbcd7c693f7d3d288025',1,'predefine.h']]], - ['null_5fpartition_9',['NULL_PARTITION',['../predefine_8h.html#ae2067f14aabaa8ce09bc058bb9d75683',1,'predefine.h']]], - ['null_5fproperty_10',['NULL_PROPERTY',['../predefine_8h.html#a1a12a4b9cde223311f79ab4d2237a947',1,'predefine.h']]], - ['null_5frow_11',['NULL_ROW',['../predefine_8h.html#a49149212bd213f323ede9d8b2dcb22d0',1,'predefine.h']]], - ['null_5ftype_12',['NULL_TYPE',['../predefine_8h.html#a27a1fcb44e6a426c50b3a854ba584b78',1,'predefine.h']]], - ['null_5fvertex_13',['NULL_VERTEX',['../predefine_8h.html#ac3c33c45c396860b76e8aff4dd2b8158',1,'predefine.h']]], - ['null_5fvertex_5fref_14',['NULL_VERTEX_REF',['../predefine_8h.html#a926c85777b43e74bfbc11181a95ab41b',1,'predefine.h']]], - ['null_5fvertex_5ftype_15',['NULL_VERTEX_TYPE',['../predefine_8h.html#a0a429637d65deffeda136e37b8f39533',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_a.js b/grin/docs/_build/doxygen/html/search/all_a.js deleted file mode 100644 index 9a8886eb5..000000000 --- a/grin/docs/_build/doxygen/html/search/all_a.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['out_0',['OUT',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaac72cb4ba9e379a25e80f157177dbe2b8',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_b.js b/grin/docs/_build/doxygen/html/search/all_b.js deleted file mode 100644 index f55d17bae..000000000 --- a/grin/docs/_build/doxygen/html/search/all_b.js +++ /dev/null @@ -1,8 +0,0 @@ -var searchData= -[ - ['predefine_2eh_0',['predefine.h',['../predefine_8h.html',1,'']]], - ['primarykey_2eh_1',['primarykey.h',['../primarykey_8h.html',1,'']]], - ['property_2eh_2',['property.h',['../property_8h.html',1,'']]], - ['propertylist_2eh_3',['propertylist.h',['../propertylist_8h.html',1,'']]], - ['propertytable_2eh_4',['propertytable.h',['../propertytable_8h.html',1,'']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_c.js b/grin/docs/_build/doxygen/html/search/all_c.js deleted file mode 100644 index 54268142b..000000000 --- a/grin/docs/_build/doxygen/html/search/all_c.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['select_5fedge_5fproperteis_0',['select_edge_properteis',['../propertylist_8h.html#aa019e8824f19dbb563b5b1fdb091996e',1,'propertylist.h']]], - ['select_5fvertex_5fproperties_1',['select_vertex_properties',['../propertylist_8h.html#a7d70dbf74489c1a5f0f7f001c9682858',1,'propertylist.h']]], - ['string_2',['String',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ade17ec82ff106e0c2b4417f5ca231eae',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_d.js b/grin/docs/_build/doxygen/html/search/all_d.js deleted file mode 100644 index baae2b481..000000000 --- a/grin/docs/_build/doxygen/html/search/all_d.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['type_2eh_0',['type.h',['../type_8h.html',1,'']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_e.js b/grin/docs/_build/doxygen/html/search/all_e.js deleted file mode 100644 index ed92d791a..000000000 --- a/grin/docs/_build/doxygen/html/search/all_e.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['uint32_0',['UInt32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a57352c749ab6266701ed87613213e299',1,'predefine.h']]], - ['uint64_1',['UInt64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a0389a3fa2d3f7cb04de69cca4e9b1d95',1,'predefine.h']]], - ['undefined_2',['Undefined',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a18f893264a00711081b62de694f99db4',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/all_f.js b/grin/docs/_build/doxygen/html/search/all_f.js deleted file mode 100644 index 520b83d47..000000000 --- a/grin/docs/_build/doxygen/html/search/all_f.js +++ /dev/null @@ -1,10 +0,0 @@ -var searchData= -[ - ['with_5fedge_5fdata_0',['WITH_EDGE_DATA',['../predefine_8h.html#aa195a26dc2d6e7b6a2b5692475ac0fd0',1,'predefine.h']]], - ['with_5flabel_1',['WITH_LABEL',['../predefine_8h.html#a3c0bf1209e6c115197d23be31cc371e6',1,'predefine.h']]], - ['with_5fproperty_5fname_2',['WITH_PROPERTY_NAME',['../predefine_8h.html#ac2959315e70197f976d6b92ea2d0a315',1,'predefine.h']]], - ['with_5fvertex_5fdata_3',['WITH_VERTEX_DATA',['../predefine_8h.html#a5511455528a5a200dd03335c2a553364',1,'predefine.h']]], - ['with_5fvertex_5foriginal_5fid_4',['WITH_VERTEX_ORIGINAL_ID',['../predefine_8h.html#adbd707ffa90aa7c694065aaacfdd1226',1,'predefine.h']]], - ['with_5fvertex_5fprimarty_5fkeys_5',['WITH_VERTEX_PRIMARTY_KEYS',['../predefine_8h.html#a8a8fb8ef0bdeabf5e6f0b6b747b70a4f',1,'predefine.h']]], - ['with_5fvertex_5fproperty_6',['WITH_VERTEX_PROPERTY',['../predefine_8h.html#a18e45c40c5c01532d2705e583a898ddb',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/close.svg b/grin/docs/_build/doxygen/html/search/close.svg deleted file mode 100644 index a933eea1a..000000000 --- a/grin/docs/_build/doxygen/html/search/close.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/grin/docs/_build/doxygen/html/search/defines_0.js b/grin/docs/_build/doxygen/html/search/defines_0.js deleted file mode 100644 index 2c1686df4..000000000 --- a/grin/docs/_build/doxygen/html/search/defines_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['column_5fstore_5ftrait_0',['COLUMN_STORE_TRAIT',['../predefine_8h.html#a408d94da6105b6a6c508726da065e8b7',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/defines_1.js b/grin/docs/_build/doxygen/html/search/defines_1.js deleted file mode 100644 index b68fcf548..000000000 --- a/grin/docs/_build/doxygen/html/search/defines_1.js +++ /dev/null @@ -1,13 +0,0 @@ -var searchData= -[ - ['enable_5fadjacent_5flist_0',['ENABLE_ADJACENT_LIST',['../predefine_8h.html#a470cf7c92d8839bff02a0409d2b7db30',1,'predefine.h']]], - ['enable_5fadjacent_5flist_5fiterator_1',['ENABLE_ADJACENT_LIST_ITERATOR',['../predefine_8h.html#ad4116d8ec1dc2f1cf553348f13b757a0',1,'predefine.h']]], - ['enable_5fedge_5flist_2',['ENABLE_EDGE_LIST',['../predefine_8h.html#ac7521994bc76d45695c1f83ac9ebbe10',1,'predefine.h']]], - ['enable_5fedge_5flist_5fiterator_3',['ENABLE_EDGE_LIST_ITERATOR',['../predefine_8h.html#a193c9b2d09d52d6c9f2a18af75b70074',1,'predefine.h']]], - ['enable_5fedge_5fref_4',['ENABLE_EDGE_REF',['../predefine_8h.html#a947197070bcf936da983899370331286',1,'predefine.h']]], - ['enable_5fgraph_5fpartition_5',['ENABLE_GRAPH_PARTITION',['../predefine_8h.html#a152141205611e26882f23df7a5f69d0a',1,'predefine.h']]], - ['enable_5fpredicate_6',['ENABLE_PREDICATE',['../predefine_8h.html#a0e931dc102cb72f9b6be1d65a5cf87e3',1,'predefine.h']]], - ['enable_5fvertex_5flist_7',['ENABLE_VERTEX_LIST',['../predefine_8h.html#a24ab9b872487b91605b42c2c2d2d33bd',1,'predefine.h']]], - ['enable_5fvertex_5flist_5fiterator_8',['ENABLE_VERTEX_LIST_ITERATOR',['../predefine_8h.html#a3047177510fa354ee7898825387289b7',1,'predefine.h']]], - ['enable_5fvertex_5fref_9',['ENABLE_VERTEX_REF',['../predefine_8h.html#a79e38008004615608e283c5f575df82e',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/defines_2.js b/grin/docs/_build/doxygen/html/search/defines_2.js deleted file mode 100644 index 66cfbd7a4..000000000 --- a/grin/docs/_build/doxygen/html/search/defines_2.js +++ /dev/null @@ -1,19 +0,0 @@ -var searchData= -[ - ['natural_5fpartition_5fid_5ftrait_0',['NATURAL_PARTITION_ID_TRAIT',['../predefine_8h.html#a0705ed8c61f68b297c2bfee1ef9324f3',1,'predefine.h']]], - ['natural_5fvertex_5fproperty_5fid_5ftrait_1',['NATURAL_VERTEX_PROPERTY_ID_TRAIT',['../predefine_8h.html#a6274cf30a5a13b8a651e038a066d7b4b',1,'predefine.h']]], - ['natural_5fvertex_5ftype_5fid_5ftrait_2',['NATURAL_VERTEX_TYPE_ID_TRAIT',['../predefine_8h.html#a14e2e67fdc843840df342c5cc5d838ba',1,'predefine.h']]], - ['null_5fedge_3',['NULL_EDGE',['../predefine_8h.html#af645ccbab4871128dbaed2a1828cdbef',1,'predefine.h']]], - ['null_5fedge_5fref_4',['NULL_EDGE_REF',['../predefine_8h.html#ac8dec862f065b60acf3e3f15b4fa97d4',1,'predefine.h']]], - ['null_5fedge_5ftype_5',['NULL_EDGE_TYPE',['../predefine_8h.html#acbc160e12d961cf5bae4d0a65574b94c',1,'predefine.h']]], - ['null_5fgraph_6',['NULL_GRAPH',['../predefine_8h.html#acf65bb3a1ad2164ea7eaa8829cb43420',1,'predefine.h']]], - ['null_5flist_7',['NULL_LIST',['../predefine_8h.html#a29aa3c78422ac30f2619b7bd2e1ce3fa',1,'predefine.h']]], - ['null_5fnatural_5fid_8',['NULL_NATURAL_ID',['../predefine_8h.html#af80bb749627dfbcd7c693f7d3d288025',1,'predefine.h']]], - ['null_5fpartition_9',['NULL_PARTITION',['../predefine_8h.html#ae2067f14aabaa8ce09bc058bb9d75683',1,'predefine.h']]], - ['null_5fproperty_10',['NULL_PROPERTY',['../predefine_8h.html#a1a12a4b9cde223311f79ab4d2237a947',1,'predefine.h']]], - ['null_5frow_11',['NULL_ROW',['../predefine_8h.html#a49149212bd213f323ede9d8b2dcb22d0',1,'predefine.h']]], - ['null_5ftype_12',['NULL_TYPE',['../predefine_8h.html#a27a1fcb44e6a426c50b3a854ba584b78',1,'predefine.h']]], - ['null_5fvertex_13',['NULL_VERTEX',['../predefine_8h.html#ac3c33c45c396860b76e8aff4dd2b8158',1,'predefine.h']]], - ['null_5fvertex_5fref_14',['NULL_VERTEX_REF',['../predefine_8h.html#a926c85777b43e74bfbc11181a95ab41b',1,'predefine.h']]], - ['null_5fvertex_5ftype_15',['NULL_VERTEX_TYPE',['../predefine_8h.html#a0a429637d65deffeda136e37b8f39533',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/defines_3.js b/grin/docs/_build/doxygen/html/search/defines_3.js deleted file mode 100644 index 520b83d47..000000000 --- a/grin/docs/_build/doxygen/html/search/defines_3.js +++ /dev/null @@ -1,10 +0,0 @@ -var searchData= -[ - ['with_5fedge_5fdata_0',['WITH_EDGE_DATA',['../predefine_8h.html#aa195a26dc2d6e7b6a2b5692475ac0fd0',1,'predefine.h']]], - ['with_5flabel_1',['WITH_LABEL',['../predefine_8h.html#a3c0bf1209e6c115197d23be31cc371e6',1,'predefine.h']]], - ['with_5fproperty_5fname_2',['WITH_PROPERTY_NAME',['../predefine_8h.html#ac2959315e70197f976d6b92ea2d0a315',1,'predefine.h']]], - ['with_5fvertex_5fdata_3',['WITH_VERTEX_DATA',['../predefine_8h.html#a5511455528a5a200dd03335c2a553364',1,'predefine.h']]], - ['with_5fvertex_5foriginal_5fid_4',['WITH_VERTEX_ORIGINAL_ID',['../predefine_8h.html#adbd707ffa90aa7c694065aaacfdd1226',1,'predefine.h']]], - ['with_5fvertex_5fprimarty_5fkeys_5',['WITH_VERTEX_PRIMARTY_KEYS',['../predefine_8h.html#a8a8fb8ef0bdeabf5e6f0b6b747b70a4f',1,'predefine.h']]], - ['with_5fvertex_5fproperty_6',['WITH_VERTEX_PROPERTY',['../predefine_8h.html#a18e45c40c5c01532d2705e583a898ddb',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/enums_0.js b/grin/docs/_build/doxygen/html/search/enums_0.js deleted file mode 100644 index 601605b3a..000000000 --- a/grin/docs/_build/doxygen/html/search/enums_0.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['datatype_0',['DataType',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6',1,'predefine.h']]], - ['direction_1',['Direction',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aa',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_0.js b/grin/docs/_build/doxygen/html/search/enumvalues_0.js deleted file mode 100644 index 46cd1debe..000000000 --- a/grin/docs/_build/doxygen/html/search/enumvalues_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['both_0',['BOTH',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaa627abe5a430420baf29ebe1940a7f2fb',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_1.js b/grin/docs/_build/doxygen/html/search/enumvalues_1.js deleted file mode 100644 index de292f1fd..000000000 --- a/grin/docs/_build/doxygen/html/search/enumvalues_1.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['date32_0',['Date32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a32e9f594d9d89533ffad18df5536423e',1,'predefine.h']]], - ['date64_1',['Date64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ab51d5181af439511070862d786809269',1,'predefine.h']]], - ['double_2',['Double',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6afb7825ebed9ad96348ee8588d84db633',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_2.js b/grin/docs/_build/doxygen/html/search/enumvalues_2.js deleted file mode 100644 index 73c49a177..000000000 --- a/grin/docs/_build/doxygen/html/search/enumvalues_2.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['float_0',['Float',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ad67b0ee7230dcecb610254e4e5e589cd',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_3.js b/grin/docs/_build/doxygen/html/search/enumvalues_3.js deleted file mode 100644 index 00ed7087a..000000000 --- a/grin/docs/_build/doxygen/html/search/enumvalues_3.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['in_0',['IN',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaaf3180515f5867a29932df1dc207b31ad',1,'predefine.h']]], - ['int32_1',['Int32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a788a72ddbf1bd572b3fcd7a5e7ec8cff',1,'predefine.h']]], - ['int64_2',['Int64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ada475947399b8ab4d13d40fea50f950c',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_4.js b/grin/docs/_build/doxygen/html/search/enumvalues_4.js deleted file mode 100644 index 9a8886eb5..000000000 --- a/grin/docs/_build/doxygen/html/search/enumvalues_4.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['out_0',['OUT',['../predefine_8h.html#a224b9163917ac32fc95a60d8c1eec3aaac72cb4ba9e379a25e80f157177dbe2b8',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_5.js b/grin/docs/_build/doxygen/html/search/enumvalues_5.js deleted file mode 100644 index 8b867959b..000000000 --- a/grin/docs/_build/doxygen/html/search/enumvalues_5.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['string_0',['String',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6ade17ec82ff106e0c2b4417f5ca231eae',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/enumvalues_6.js b/grin/docs/_build/doxygen/html/search/enumvalues_6.js deleted file mode 100644 index ed92d791a..000000000 --- a/grin/docs/_build/doxygen/html/search/enumvalues_6.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['uint32_0',['UInt32',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a57352c749ab6266701ed87613213e299',1,'predefine.h']]], - ['uint64_1',['UInt64',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a0389a3fa2d3f7cb04de69cca4e9b1d95',1,'predefine.h']]], - ['undefined_2',['Undefined',['../predefine_8h.html#ad8ed01ff3ff33333d8e19db4d2818bb6a18f893264a00711081b62de694f99db4',1,'predefine.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/files_0.js b/grin/docs/_build/doxygen/html/search/files_0.js deleted file mode 100644 index 47bf2326d..000000000 --- a/grin/docs/_build/doxygen/html/search/files_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['label_2eh_0',['label.h',['../label_8h.html',1,'']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/files_1.js b/grin/docs/_build/doxygen/html/search/files_1.js deleted file mode 100644 index f55d17bae..000000000 --- a/grin/docs/_build/doxygen/html/search/files_1.js +++ /dev/null @@ -1,8 +0,0 @@ -var searchData= -[ - ['predefine_2eh_0',['predefine.h',['../predefine_8h.html',1,'']]], - ['primarykey_2eh_1',['primarykey.h',['../primarykey_8h.html',1,'']]], - ['property_2eh_2',['property.h',['../property_8h.html',1,'']]], - ['propertylist_2eh_3',['propertylist.h',['../propertylist_8h.html',1,'']]], - ['propertytable_2eh_4',['propertytable.h',['../propertytable_8h.html',1,'']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/files_2.js b/grin/docs/_build/doxygen/html/search/files_2.js deleted file mode 100644 index baae2b481..000000000 --- a/grin/docs/_build/doxygen/html/search/files_2.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['type_2eh_0',['type.h',['../type_8h.html',1,'']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/functions_0.js b/grin/docs/_build/doxygen/html/search/functions_0.js deleted file mode 100644 index 5c11d88fc..000000000 --- a/grin/docs/_build/doxygen/html/search/functions_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['assign_5flabel_5fto_5fvertex_0',['assign_label_to_vertex',['../label_8h.html#a8091acf655961c1b66933945feac27f3',1,'label.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/functions_1.js b/grin/docs/_build/doxygen/html/search/functions_1.js deleted file mode 100644 index 8c9eff410..000000000 --- a/grin/docs/_build/doxygen/html/search/functions_1.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['create_5frow_0',['create_row',['../propertytable_8h.html#a86a5c42d5ede169c6374b2434c8c1982',1,'propertytable.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/functions_2.js b/grin/docs/_build/doxygen/html/search/functions_2.js deleted file mode 100644 index e9e9c3d69..000000000 --- a/grin/docs/_build/doxygen/html/search/functions_2.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['destroy_5fvertex_5fproperty_0',['destroy_vertex_property',['../property_8h.html#a8e1467e6a4a322bb1761a17f779d0dbd',1,'property.h']]], - ['destroy_5fvertex_5fproperty_5ftable_1',['destroy_vertex_property_table',['../propertytable_8h.html#a01c1ba34a369590177ff90521755aac5',1,'propertytable.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/functions_3.js b/grin/docs/_build/doxygen/html/search/functions_3.js deleted file mode 100644 index 3f526cab3..000000000 --- a/grin/docs/_build/doxygen/html/search/functions_3.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['filter_5fvertex_5flist_5fby_5flabel_0',['filter_vertex_list_by_label',['../label_8h.html#a3a6da911bce12049c0d97d99883889b8',1,'label.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/functions_4.js b/grin/docs/_build/doxygen/html/search/functions_4.js deleted file mode 100644 index ba7177d6d..000000000 --- a/grin/docs/_build/doxygen/html/search/functions_4.js +++ /dev/null @@ -1,21 +0,0 @@ -var searchData= -[ - ['get_5fdst_5ftypes_5ffrom_5fedge_5ftype_0',['get_dst_types_from_edge_type',['../type_8h.html#a00edf242478b7ddf519c24e318e5a61d',1,'type.h']]], - ['get_5fedge_5fproperties_5fby_5fname_1',['get_edge_properties_by_name',['../property_8h.html#a55bf3fc271e09ec398a17364c7826784',1,'property.h']]], - ['get_5fedge_5fproperty_5fby_5fname_2',['get_edge_property_by_name',['../property_8h.html#a002d96d3a1733e075d5a66feb3ad5e02',1,'property.h']]], - ['get_5fedge_5ftypes_5ffrom_5fvertex_5ftype_5fpair_3',['get_edge_types_from_vertex_type_pair',['../type_8h.html#a1705ee27fa9ec2a12d1a4d3700387c8f',1,'type.h']]], - ['get_5fprimary_5fkeys_5fby_5fvertex_5ftype_4',['get_primary_keys_by_vertex_type',['../primarykey_8h.html#ae314c22d353c03bffaf62ea0ba69c491',1,'primarykey.h']]], - ['get_5frow_5ffrom_5fvertex_5fproperty_5ftable_5',['get_row_from_vertex_property_table',['../propertytable_8h.html#a0d727fb5c0a961df0f87c4b128463956',1,'propertytable.h']]], - ['get_5fsrc_5ftypes_5ffrom_5fedge_5ftype_6',['get_src_types_from_edge_type',['../type_8h.html#acedf36dd7ba7c4af1b080de8ffa246d2',1,'type.h']]], - ['get_5fvalue_5ffrom_5frow_7',['get_value_from_row',['../propertytable_8h.html#a23f95e06bdec368337c1ccfbadde97d9',1,'propertytable.h']]], - ['get_5fvalue_5ffrom_5fvertex_5fproperty_5ftable_8',['get_value_from_vertex_property_table',['../propertytable_8h.html#a4116b4fe6d95991db646b0e99d6fbd9f',1,'propertytable.h']]], - ['get_5fvertex_5fby_5fprimay_5fkeys_9',['get_vertex_by_primay_keys',['../primarykey_8h.html#addda3be6a980086d6b25db1a82a89511',1,'primarykey.h']]], - ['get_5fvertex_5flabel_5flist_10',['get_vertex_label_list',['../label_8h.html#a34138b59b44f405f346a48fd4f72ff2c',1,'label.h']]], - ['get_5fvertex_5flist_5fby_5flabel_11',['get_vertex_list_by_label',['../label_8h.html#a3644dc6bfcee62f9183bd89422e6c19e',1,'label.h']]], - ['get_5fvertex_5fproperties_5fby_5fname_12',['get_vertex_properties_by_name',['../property_8h.html#a33bb22d6ad61e86d1963ef9710993537',1,'property.h']]], - ['get_5fvertex_5fproperty_5fby_5fname_13',['get_vertex_property_by_name',['../property_8h.html#afb3122e6b577a4b2117aec43d6499f58',1,'property.h']]], - ['get_5fvertex_5fproperty_5fdata_5ftype_14',['get_vertex_property_data_type',['../property_8h.html#a7d1719a4d15cb72cf235dd6bc5701d25',1,'property.h']]], - ['get_5fvertex_5fproperty_5ftable_5fby_5ftype_15',['get_vertex_property_table_by_type',['../propertytable_8h.html#ac9bc9b9015469cbd548f5d033ef6d5cb',1,'propertytable.h']]], - ['get_5fvertex_5fproperty_5fvertex_5ftype_16',['get_vertex_property_vertex_type',['../property_8h.html#a387695bec35c802bf4a7f6b7362f6e91',1,'property.h']]], - ['get_5fvertex_5ftypes_5fwith_5fprimary_5fkeys_17',['get_vertex_types_with_primary_keys',['../primarykey_8h.html#a6668fc8add629c0aa384b134843d4de8',1,'primarykey.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/functions_5.js b/grin/docs/_build/doxygen/html/search/functions_5.js deleted file mode 100644 index 768edaa85..000000000 --- a/grin/docs/_build/doxygen/html/search/functions_5.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['insert_5fvalue_5fto_5frow_0',['insert_value_to_row',['../propertytable_8h.html#a36d2dd0c3492ee17c3c7a58d5534cf7e',1,'propertytable.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/functions_6.js b/grin/docs/_build/doxygen/html/search/functions_6.js deleted file mode 100644 index acfd8b62d..000000000 --- a/grin/docs/_build/doxygen/html/search/functions_6.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['select_5fedge_5fproperteis_0',['select_edge_properteis',['../propertylist_8h.html#aa019e8824f19dbb563b5b1fdb091996e',1,'propertylist.h']]], - ['select_5fvertex_5fproperties_1',['select_vertex_properties',['../propertylist_8h.html#a7d70dbf74489c1a5f0f7f001c9682858',1,'propertylist.h']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/groups_0.js b/grin/docs/_build/doxygen/html/search/groups_0.js deleted file mode 100644 index 84e9c6a43..000000000 --- a/grin/docs/_build/doxygen/html/search/groups_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['null_20values_0',['Null Values',['../group__nv.html',1,'']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/mag.svg b/grin/docs/_build/doxygen/html/search/mag.svg deleted file mode 100644 index 9f46b301e..000000000 --- a/grin/docs/_build/doxygen/html/search/mag.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - diff --git a/grin/docs/_build/doxygen/html/search/mag_d.svg b/grin/docs/_build/doxygen/html/search/mag_d.svg deleted file mode 100644 index b9a814c78..000000000 --- a/grin/docs/_build/doxygen/html/search/mag_d.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - diff --git a/grin/docs/_build/doxygen/html/search/mag_sel.svg b/grin/docs/_build/doxygen/html/search/mag_sel.svg deleted file mode 100644 index 03626f64a..000000000 --- a/grin/docs/_build/doxygen/html/search/mag_sel.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/grin/docs/_build/doxygen/html/search/mag_seld.svg b/grin/docs/_build/doxygen/html/search/mag_seld.svg deleted file mode 100644 index 6e720dcc9..000000000 --- a/grin/docs/_build/doxygen/html/search/mag_seld.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/grin/docs/_build/doxygen/html/search/pages_0.js b/grin/docs/_build/doxygen/html/search/pages_0.js deleted file mode 100644 index 647473420..000000000 --- a/grin/docs/_build/doxygen/html/search/pages_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['grin_0',['GRIN',['../index.html',1,'']]] -]; diff --git a/grin/docs/_build/doxygen/html/search/search.css b/grin/docs/_build/doxygen/html/search/search.css deleted file mode 100644 index 19f76f9d5..000000000 --- a/grin/docs/_build/doxygen/html/search/search.css +++ /dev/null @@ -1,291 +0,0 @@ -/*---------------- Search Box positioning */ - -#main-menu > li:last-child { - /* This
  • object is the parent of the search bar */ - display: flex; - justify-content: center; - align-items: center; - height: 36px; - margin-right: 1em; -} - -/*---------------- Search box styling */ - -.SRPage * { - font-weight: normal; - line-height: normal; -} - -dark-mode-toggle { - margin-left: 5px; - display: flex; - float: right; -} - -#MSearchBox { - display: inline-block; - white-space : nowrap; - background: var(--search-background-color); - border-radius: 0.65em; - box-shadow: var(--search-box-shadow); - z-index: 102; -} - -#MSearchBox .left { - display: inline-block; - vertical-align: middle; - height: 1.4em; -} - -#MSearchSelect { - display: inline-block; - vertical-align: middle; - width: 20px; - height: 19px; - background-image: var(--search-magnification-select-image); - margin: 0 0 0 0.3em; - padding: 0; -} - -#MSearchSelectExt { - display: inline-block; - vertical-align: middle; - width: 10px; - height: 19px; - background-image: var(--search-magnification-image); - margin: 0 0 0 0.5em; - padding: 0; -} - - -#MSearchField { - display: inline-block; - vertical-align: middle; - width: 7.5em; - height: 19px; - margin: 0 0.15em; - padding: 0; - line-height: 1em; - border:none; - color: var(--search-foreground-color); - outline: none; - font-family: var(--font-family-search); - -webkit-border-radius: 0px; - border-radius: 0px; - background: none; -} - -@media(hover: none) { - /* to avoid zooming on iOS */ - #MSearchField { - font-size: 16px; - } -} - -#MSearchBox .right { - display: inline-block; - vertical-align: middle; - width: 1.4em; - height: 1.4em; -} - -#MSearchClose { - display: none; - font-size: inherit; - background : none; - border: none; - margin: 0; - padding: 0; - outline: none; - -} - -#MSearchCloseImg { - padding: 0.3em; - margin: 0; -} - -.MSearchBoxActive #MSearchField { - color: var(--search-active-color); -} - - - -/*---------------- Search filter selection */ - -#MSearchSelectWindow { - display: none; - position: absolute; - left: 0; top: 0; - border: 1px solid var(--search-filter-border-color); - background-color: var(--search-filter-background-color); - z-index: 10001; - padding-top: 4px; - padding-bottom: 4px; - -moz-border-radius: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - -webkit-border-bottom-left-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -} - -.SelectItem { - font: 8pt var(--font-family-search); - padding-left: 2px; - padding-right: 12px; - border: 0px; -} - -span.SelectionMark { - margin-right: 4px; - font-family: var(--font-family-monospace); - outline-style: none; - text-decoration: none; -} - -a.SelectItem { - display: block; - outline-style: none; - color: var(--search-filter-foreground-color); - text-decoration: none; - padding-left: 6px; - padding-right: 12px; -} - -a.SelectItem:focus, -a.SelectItem:active { - color: var(--search-filter-foreground-color); - outline-style: none; - text-decoration: none; -} - -a.SelectItem:hover { - color: var(--search-filter-highlight-text-color); - background-color: var(--search-filter-highlight-bg-color); - outline-style: none; - text-decoration: none; - cursor: pointer; - display: block; -} - -/*---------------- Search results window */ - -iframe#MSearchResults { - /*width: 60ex;*/ - height: 15em; -} - -#MSearchResultsWindow { - display: none; - position: absolute; - left: 0; top: 0; - border: 1px solid var(--search-results-border-color); - background-color: var(--search-results-background-color); - z-index:10000; - width: 300px; - height: 400px; - overflow: auto; -} - -/* ----------------------------------- */ - - -#SRIndex { - clear:both; -} - -.SREntry { - font-size: 10pt; - padding-left: 1ex; -} - -.SRPage .SREntry { - font-size: 8pt; - padding: 1px 5px; -} - -div.SRPage { - margin: 5px 2px; - background-color: var(--search-results-background-color); -} - -.SRChildren { - padding-left: 3ex; padding-bottom: .5em -} - -.SRPage .SRChildren { - display: none; -} - -.SRSymbol { - font-weight: bold; - color: var(--search-results-foreground-color); - font-family: var(--font-family-search); - text-decoration: none; - outline: none; -} - -a.SRScope { - display: block; - color: var(--search-results-foreground-color); - font-family: var(--font-family-search); - font-size: 8pt; - text-decoration: none; - outline: none; -} - -a.SRSymbol:focus, a.SRSymbol:active, -a.SRScope:focus, a.SRScope:active { - text-decoration: underline; -} - -span.SRScope { - padding-left: 4px; - font-family: var(--font-family-search); -} - -.SRPage .SRStatus { - padding: 2px 5px; - font-size: 8pt; - font-style: italic; - font-family: var(--font-family-search); -} - -.SRResult { - display: none; -} - -div.searchresults { - margin-left: 10px; - margin-right: 10px; -} - -/*---------------- External search page results */ - -.pages b { - color: white; - padding: 5px 5px 3px 5px; - background-image: var(--nav-gradient-active-image-parent); - background-repeat: repeat-x; - text-shadow: 0 1px 1px #000000; -} - -.pages { - line-height: 17px; - margin-left: 4px; - text-decoration: none; -} - -.hl { - font-weight: bold; -} - -#searchresults { - margin-bottom: 20px; -} - -.searchpages { - margin-top: 10px; -} - diff --git a/grin/docs/_build/doxygen/html/search/search.js b/grin/docs/_build/doxygen/html/search/search.js deleted file mode 100644 index e103a2621..000000000 --- a/grin/docs/_build/doxygen/html/search/search.js +++ /dev/null @@ -1,816 +0,0 @@ -/* - @licstart The following is the entire license notice for the JavaScript code in this file. - - The MIT License (MIT) - - Copyright (C) 1997-2020 by Dimitri van Heesch - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software - and associated documentation files (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, - sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - @licend The above is the entire license notice for the JavaScript code in this file - */ -function convertToId(search) -{ - var result = ''; - for (i=0;i do a search - { - this.Search(); - } - } - - this.OnSearchSelectKey = function(evt) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 && this.searchIndex0) // Up - { - this.searchIndex--; - this.OnSelectItem(this.searchIndex); - } - else if (e.keyCode==13 || e.keyCode==27) - { - this.OnSelectItem(this.searchIndex); - this.CloseSelectionWindow(); - this.DOMSearchField().focus(); - } - return false; - } - - // --------- Actions - - // Closes the results window. - this.CloseResultsWindow = function() - { - this.DOMPopupSearchResultsWindow().style.display = 'none'; - this.DOMSearchClose().style.display = 'none'; - this.Activate(false); - } - - this.CloseSelectionWindow = function() - { - this.DOMSearchSelectWindow().style.display = 'none'; - } - - // Performs a search. - this.Search = function() - { - this.keyTimeout = 0; - - // strip leading whitespace - var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); - - var code = searchValue.toLowerCase().charCodeAt(0); - var idxChar = searchValue.substr(0, 1).toLowerCase(); - if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair - { - idxChar = searchValue.substr(0, 2); - } - - var jsFile; - - var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); - if (idx!=-1) - { - var hexCode=idx.toString(16); - jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; - } - - var loadJS = function(url, impl, loc){ - var scriptTag = document.createElement('script'); - scriptTag.src = url; - scriptTag.onload = impl; - scriptTag.onreadystatechange = impl; - loc.appendChild(scriptTag); - } - - var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); - var domSearchBox = this.DOMSearchBox(); - var domPopupSearchResults = this.DOMPopupSearchResults(); - var domSearchClose = this.DOMSearchClose(); - var resultsPath = this.resultsPath; - - var handleResults = function() { - document.getElementById("Loading").style.display="none"; - if (typeof searchData !== 'undefined') { - createResults(resultsPath); - document.getElementById("NoMatches").style.display="none"; - } - - searchResults.Search(searchValue); - - if (domPopupSearchResultsWindow.style.display!='block') - { - domSearchClose.style.display = 'inline-block'; - var left = getXPos(domSearchBox) + 150; - var top = getYPos(domSearchBox) + 20; - domPopupSearchResultsWindow.style.display = 'block'; - left -= domPopupSearchResults.offsetWidth; - var maxWidth = document.body.clientWidth; - var maxHeight = document.body.clientHeight; - var width = 300; - if (left<10) left=10; - if (width+left+8>maxWidth) width=maxWidth-left-8; - var height = 400; - if (height+top+8>maxHeight) height=maxHeight-top-8; - domPopupSearchResultsWindow.style.top = top + 'px'; - domPopupSearchResultsWindow.style.left = left + 'px'; - domPopupSearchResultsWindow.style.width = width + 'px'; - domPopupSearchResultsWindow.style.height = height + 'px'; - } - } - - if (jsFile) { - loadJS(jsFile, handleResults, this.DOMPopupSearchResultsWindow()); - } else { - handleResults(); - } - - this.lastSearchValue = searchValue; - } - - // -------- Activation Functions - - // Activates or deactivates the search panel, resetting things to - // their default values if necessary. - this.Activate = function(isActive) - { - if (isActive || // open it - this.DOMPopupSearchResultsWindow().style.display == 'block' - ) - { - this.DOMSearchBox().className = 'MSearchBoxActive'; - this.searchActive = true; - } - else if (!isActive) // directly remove the panel - { - this.DOMSearchBox().className = 'MSearchBoxInactive'; - this.searchActive = false; - this.lastSearchValue = '' - this.lastResultsPage = ''; - this.DOMSearchField().value = ''; - } - } -} - -// ----------------------------------------------------------------------- - -// The class that handles everything on the search results page. -function SearchResults(name) -{ - // The number of matches from the last run of . - this.lastMatchCount = 0; - this.lastKey = 0; - this.repeatOn = false; - - // Toggles the visibility of the passed element ID. - this.FindChildElement = function(id) - { - var parentElement = document.getElementById(id); - var element = parentElement.firstChild; - - while (element && element!=parentElement) - { - if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') - { - return element; - } - - if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) - { - element = element.firstChild; - } - else if (element.nextSibling) - { - element = element.nextSibling; - } - else - { - do - { - element = element.parentNode; - } - while (element && element!=parentElement && !element.nextSibling); - - if (element && element!=parentElement) - { - element = element.nextSibling; - } - } - } - } - - this.Toggle = function(id) - { - var element = this.FindChildElement(id); - if (element) - { - if (element.style.display == 'block') - { - element.style.display = 'none'; - } - else - { - element.style.display = 'block'; - } - } - } - - // Searches for the passed string. If there is no parameter, - // it takes it from the URL query. - // - // Always returns true, since other documents may try to call it - // and that may or may not be possible. - this.Search = function(search) - { - if (!search) // get search word from URL - { - search = window.location.search; - search = search.substring(1); // Remove the leading '?' - search = unescape(search); - } - - search = search.replace(/^ +/, ""); // strip leading spaces - search = search.replace(/ +$/, ""); // strip trailing spaces - search = search.toLowerCase(); - search = convertToId(search); - - var resultRows = document.getElementsByTagName("div"); - var matches = 0; - - var i = 0; - while (i < resultRows.length) - { - var row = resultRows.item(i); - if (row.className == "SRResult") - { - var rowMatchName = row.id.toLowerCase(); - rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' - - if (search.length<=rowMatchName.length && - rowMatchName.substr(0, search.length)==search) - { - row.style.display = 'block'; - matches++; - } - else - { - row.style.display = 'none'; - } - } - i++; - } - document.getElementById("Searching").style.display='none'; - if (matches == 0) // no results - { - document.getElementById("NoMatches").style.display='block'; - } - else // at least one result - { - document.getElementById("NoMatches").style.display='none'; - } - this.lastMatchCount = matches; - return true; - } - - // return the first item with index index or higher that is visible - this.NavNext = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index++; - } - return focusItem; - } - - this.NavPrev = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index--; - } - return focusItem; - } - - this.ProcessKeys = function(e) - { - if (e.type == "keydown") - { - this.repeatOn = false; - this.lastKey = e.keyCode; - } - else if (e.type == "keypress") - { - if (!this.repeatOn) - { - if (this.lastKey) this.repeatOn = true; - return false; // ignore first keypress after keydown - } - } - else if (e.type == "keyup") - { - this.lastKey = 0; - this.repeatOn = false; - } - return this.lastKey!=0; - } - - this.Nav = function(evt,itemIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - var newIndex = itemIndex-1; - var focusItem = this.NavPrev(newIndex); - if (focusItem) - { - var child = this.FindChildElement(focusItem.parentNode.parentNode.id); - if (child && child.style.display == 'block') // children visible - { - var n=0; - var tmpElem; - while (1) // search for last child - { - tmpElem = document.getElementById('Item'+newIndex+'_c'+n); - if (tmpElem) - { - focusItem = tmpElem; - } - else // found it! - { - break; - } - n++; - } - } - } - if (focusItem) - { - focusItem.focus(); - } - else // return focus to search field - { - document.getElementById("MSearchField").focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = itemIndex+1; - var focusItem; - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem && elem.style.display == 'block') // children visible - { - focusItem = document.getElementById('Item'+itemIndex+'_c0'); - } - if (!focusItem) focusItem = this.NavNext(newIndex); - if (focusItem) focusItem.focus(); - } - else if (this.lastKey==39) // Right - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'block'; - } - else if (this.lastKey==37) // Left - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'none'; - } - else if (this.lastKey==27) // Escape - { - searchBox.CloseResultsWindow(); - document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; - } - - this.NavChild = function(evt,itemIndex,childIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - if (childIndex>0) - { - var newIndex = childIndex-1; - document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); - } - else // already at first child, jump to parent - { - document.getElementById('Item'+itemIndex).focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = childIndex+1; - var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); - if (!elem) // last child, jump to parent next parent - { - elem = this.NavNext(itemIndex+1); - } - if (elem) - { - elem.focus(); - } - } - else if (this.lastKey==27) // Escape - { - searchBox.CloseResultsWindow(); - document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; - } -} - -function setKeyActions(elem,action) -{ - elem.setAttribute('onkeydown',action); - elem.setAttribute('onkeypress',action); - elem.setAttribute('onkeyup',action); -} - -function setClassAttr(elem,attr) -{ - elem.setAttribute('class',attr); - elem.setAttribute('className',attr); -} - -function createResults(resultsPath) -{ - var results = document.getElementById("SRResults"); - results.innerHTML = ''; - for (var e=0; e-{AmhX=Jf(#6djGiuzAr*{o?=JLmPLyc> z_*`QK&+BH@jWrYJ7>r6%keRM@)Qyv8R=enp0jiI>aWlGyB58O zFVR20d+y`K7vDw(hJF3;>dD*3-?v=<8M)@x|EEGLnJsniYK!2U1 Y!`|5biEc?d1`HDhPgg&ebxsLQ02F6;9RL6T diff --git a/grin/docs/_build/doxygen/html/splitbard.png b/grin/docs/_build/doxygen/html/splitbard.png deleted file mode 100644 index 8367416d757fd7b6dc4272b6432dc75a75abd068..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^Yzz!63>-{AmhX=Jf@VhhFKy35^fiT zT~&lUj3=cDh^%3HDY9k5CEku}PHXNoNC(_$U3XPb&Q*ME25pT;2(*BOgAf<+R$lzakPG`kF31()Fx{L5Wrac|GQzjeE= zueY1`Ze{#x<8=S|`~MgGetGce)#vN&|J{Cd^tS%;tBYTo?+^d68<#n_Y_xx`J||4O V@QB{^CqU0Kc)I$ztaD0e0svEzbJzd? diff --git a/grin/docs/_build/doxygen/html/structure_8h_source.html b/grin/docs/_build/doxygen/html/structure_8h_source.html deleted file mode 100644 index 061f39802..000000000 --- a/grin/docs/_build/doxygen/html/structure_8h_source.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - -GRIN: include/topology/structure.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    structure.h
    -
    -
    -
    1
    -
    16#ifndef GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_
    -
    17#define GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_
    -
    18
    -
    19#include "../predefine.h"
    -
    20
    -
    21// Graph
    -
    22bool is_directed(const Graph);
    -
    23
    -
    24bool is_multigraph(const Graph);
    -
    25
    -
    26size_t get_vertex_num(const Graph);
    -
    27
    -
    28#ifdef WITH_VERTEX_PROPERTY
    -
    29size_t get_vertex_num_by_type(const Graph, const VertexType);
    -
    30#endif
    -
    31
    -
    32size_t get_edge_num(const Graph);
    -
    33
    -
    34#ifdef WITH_EDGE_PROPERTY
    -
    35size_t get_edge_num_by_type(const Graph, const EdgeType);
    -
    36#endif
    -
    37
    -
    38
    -
    39// Vertex
    -
    40void destroy_vertex(Vertex);
    -
    41
    -
    42#ifdef WITH_VERTEX_DATA
    -
    43DataType get_vertex_data_type(const Graph, const Vertex);
    -
    44
    -
    45VertexData get_vertex_data_value(const Graph, const Vertex);
    -
    46
    -
    47void destroy_vertex_data(VertexData);
    -
    48#endif
    -
    49
    -
    50#ifdef WITH_VERTEX_ORIGINAL_ID
    -
    51Vertex get_vertex_from_original_id(const Graph, const OriginalID);
    -
    52
    -
    53#ifdef WITH_VERTEX_PROPERTY
    -
    54Vertex get_vertex_from_type_original_id(const Graph, const VertexType, const OriginalID);
    -
    55#endif
    -
    56
    -
    57OriginalID get_vertex_original_id(const Graph, const Vertex);
    -
    58
    -
    59void destroy_vertex_original_id(OriginalID);
    -
    60#endif
    -
    61
    -
    62
    -
    63// Edge
    -
    64void destroy_edge(Edge);
    -
    65
    -
    66Vertex get_edge_src(const Graph, const Edge);
    -
    67
    -
    68Vertex get_edge_dst(const Graph, const Edge);
    -
    69
    -
    70#ifdef WITH_EDGE_DATA
    -
    71DataType get_edge_data_type(const Graph, const Edge);
    -
    72
    -
    73EdgeData get_edge_data_value(const Graph, const Edge);
    -
    74
    -
    75void destroy_edge_data(EdgeData);
    -
    76#endif
    -
    77
    -
    78#endif // GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_
    -
    DataType
    Enumerates the datatype supported in the storage.
    Definition: predefine.h:40
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/svgpan.js b/grin/docs/_build/doxygen/html/svgpan.js deleted file mode 100644 index 2678d3846..000000000 --- a/grin/docs/_build/doxygen/html/svgpan.js +++ /dev/null @@ -1,323 +0,0 @@ -/* - @licstart The following is the entire license notice for the JavaScript code in this file. - The code below is based on SVGPan Library 1.2 and was modified for doxygen - to support both zooming and panning via the mouse and via embedded buttons. - - This code is licensed under the following BSD license: - - Copyright 2009-2010 Andrea Leofreddi . All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are - permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of - conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list - of conditions and the following disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY Andrea Leofreddi ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Andrea Leofreddi OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - The views and conclusions contained in the software and documentation are those of the - authors and should not be interpreted as representing official policies, either expressed - or implied, of Andrea Leofreddi. - - @licend The above is the entire license notice for the JavaScript code in this file - */ - -var root = document.documentElement; -var state = 'none'; -var stateOrigin; -var stateTf = root.createSVGMatrix(); -var cursorGrab = ' url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAlQTFRFAAAA////////c3ilYwAAAAN0Uk5T//8A18oNQQAAAD1JREFUeNp0zlEKACAIA9Bt9z90bZBZkQj29qFBEuBOzQHSnWTTyckEfqUuZgFvslH4ch3qLCO/Kr8cAgwATw4Ax6XRCcoAAAAASUVORK5CYII="), move'; -var zoomSteps = 10; -var zoomInFactor; -var zoomOutFactor; -var windowWidth; -var windowHeight; -var svgDoc; -var minZoom; -var maxZoom; -if (!window) window=this; - -/** - * Show the graph in the middle of the view, scaled to fit - */ -function show() -{ - if (window.innerHeight) // Firefox - { - windowWidth = window.innerWidth; - windowHeight = window.innerHeight; - } - else if (document.documentElement.clientWidth) // Chrome/Safari - { - windowWidth = document.documentElement.clientWidth - windowHeight = document.documentElement.clientHeight - } - if (!windowWidth || !windowHeight) // failsafe - { - windowWidth = 800; - windowHeight = 600; - } - minZoom = Math.min(Math.min(viewHeight,windowHeight)/viewHeight,Math.min(viewWidth,windowWidth)/viewWidth); - maxZoom = minZoom+1.5; - zoomInFactor = Math.pow(maxZoom/minZoom,1.0/zoomSteps); - zoomOutFactor = 1.0/zoomInFactor; - - var g = svgDoc.getElementById('viewport'); - try - { - var bb = g.getBBox(); // this can throw an exception if css { display: none } - var tx = (windowWidth-viewWidth*minZoom+8)/(2*minZoom); - var ty = viewHeight+(windowHeight-viewHeight*minZoom)/(2*minZoom); - var a = 'scale('+minZoom+') rotate(0) translate('+tx+' '+ty+')'; - g.setAttribute('transform',a); - } - catch(e) {} -} - -/** - * Register handlers - */ -function init(evt) -{ - svgDoc = evt.target.ownerDocument; - try { - if (top.window && top.window.registerShow) { // register show function in html doc for dynamic sections - top.window.registerShow(sectionId,show); - } - } catch(e) { - // ugh, we are not allowed to talk to the parent; can happen with Chrome when viewing pages - // locally, since they treat every local page as having a different origin - } - show(); - - setAttributes(root, { - "onmousedown" : "handleMouseDown(evt)", - "onmousemove" : "handleMouseMove(evt)", - "onmouseup" : "handleMouseUp(evt)" - }); - - if (window.addEventListener) - { - if (navigator.userAgent.toLowerCase().indexOf('webkit') >= 0 || - navigator.userAgent.toLowerCase().indexOf("opera") >= 0 || - navigator.appVersion.indexOf("MSIE") != -1) - { - window.addEventListener('mousewheel', handleMouseWheel, false); // Chrome/Safari/IE9 - } - else - { - window.addEventListener('DOMMouseScroll', handleMouseWheel, false); // Others - } - } -} - -window.onresize=function() -{ - if (svgDoc) { show(); } -} - -/** - * Instance an SVGPoint object with given event coordinates. - */ -function getEventPoint(evt) -{ - var p = root.createSVGPoint(); - p.x = evt.clientX; - p.y = evt.clientY; - return p; -} - -/** - * Sets the current transform matrix of an element. - */ -function setCTM(element, matrix) -{ - var s = "matrix(" + matrix.a + "," + matrix.b + "," + matrix.c + "," + matrix.d + "," + matrix.e + "," + matrix.f + ")"; - element.setAttribute("transform", s); -} - -/** - * Sets attributes of an element. - */ -function setAttributes(element, attributes) -{ - for (i in attributes) - element.setAttributeNS(null, i, attributes[i]); -} - -function doZoom(g,point,zoomFactor) -{ - var p = point.matrixTransform(g.getCTM().inverse()); - var k = root.createSVGMatrix().translate(p.x, p.y).scale(zoomFactor).translate(-p.x, -p.y); - var n = g.getCTM().multiply(k); - var s = Math.max(n.a,n.d); - if (s>maxZoom) n=n.translate(p.x,p.y).scale(maxZoom/s).translate(-p.x,-p.y); - else if (s'); - d.write('Print SVG'); - d.write(''); - d.write('
    '+xs+'
    '); - d.write(''); - d.write(''); - d.close(); - } catch(e) { - alert('Failed to open popup window needed for printing!\n'+e.message); - } -} -/* @license-end */ diff --git a/grin/docs/_build/doxygen/html/sync_off.png b/grin/docs/_build/doxygen/html/sync_off.png deleted file mode 100644 index 3b443fc62892114406e3d399421b2a881b897acc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 853 zcmV-b1FHOqP)oT|#XixUYy%lpuf3i8{fX!o zUyDD0jOrAiT^tq>fLSOOABs-#u{dV^F$b{L9&!2=9&RmV;;8s^x&UqB$PCj4FdKbh zoB1WTskPUPu05XzFbA}=KZ-GP1fPpAfSs>6AHb12UlR%-i&uOlTpFNS7{jm@mkU1V zh`nrXr~+^lsV-s1dkZOaI|kYyVj3WBpPCY{n~yd%u%e+d=f%`N0FItMPtdgBb@py; zq@v6NVArhyTC7)ULw-Jy8y42S1~4n(3LkrW8mW(F-4oXUP3E`e#g**YyqI7h-J2zK zK{m9##m4ri!7N>CqQqCcnI3hqo1I;Yh&QLNY4T`*ptiQGozK>FF$!$+84Z`xwmeMh zJ0WT+OH$WYFALEaGj2_l+#DC3t7_S`vHpSivNeFbP6+r50cO8iu)`7i%Z4BTPh@_m3Tk!nAm^)5Bqnr%Ov|Baunj#&RPtRuK& z4RGz|D5HNrW83-#ydk}tVKJrNmyYt-sTxLGlJY5nc&Re zU4SgHNPx8~Yxwr$bsju?4q&%T1874xxzq+_%?h8_ofw~(bld=o3iC)LUNR*BY%c0y zWd_jX{Y8`l%z+ol1$@Qa?Cy!(0CVIEeYpKZ`(9{z>3$CIe;pJDQk$m3p}$>xBm4lb zKo{4S)`wdU9Ba9jJbVJ0C=SOefZe%d$8=2r={nu<_^a3~>c#t_U6dye5)JrR(_a^E f@}b6j1K9lwFJq@>o)+Ry00000NkvXXu0mjfWa5j* diff --git a/grin/docs/_build/doxygen/html/sync_on.png b/grin/docs/_build/doxygen/html/sync_on.png deleted file mode 100644 index e08320fb64e6fa33b573005ed6d8fe294e19db76..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 845 zcmV-T1G4;yP)Y;xxyHF2B5Wzm| zOOGupOTn@c(JmBOl)e;XMNnZuiTJP>rM8<|Q`7I_))aP?*T)ow&n59{}X4$3Goat zgjs?*aasfbrokzG5cT4K=uG`E14xZl@z)F={P0Y^?$4t z>v!teRnNZym<6h{7sLyF1V0HsfEl+l6TrZpsfr1}luH~F7L}ktXu|*uVX^RG$L0`K zWs3j|0tIvVe(N%_?2{(iCPFGf#B6Hjy6o&}D$A%W%jfO8_W%ZO#-mh}EM$LMn7joJ z05dHr!5Y92g+31l<%i1(=L1a1pXX+OYnalY>31V4K}BjyRe3)9n#;-cCVRD_IG1fT zOKGeNY8q;TL@K{dj@D^scf&VCs*-Jb>8b>|`b*osv52-!A?BpbYtTQBns5EAU**$m zSnVSm(teh>tQi*S*A>#ySc=n;`BHz`DuG4&g4Kf8lLhca+zvZ7t7RflD6-i-mcK=M z!=^P$*u2)bkY5asG4gsss!Hn%u~>}kIW`vMs%lJLH+u*9<4PaV_c6U`KqWXQH%+Nu zTv41O(^ZVi@qhjQdG!fbZw&y+2o!iYymO^?ud3{P*HdoX83YV*Uu_HB=?U&W9%AU# z80}k1SS-CXTU7dcQlsm<^oYLxVSseqY6NO}dc`Nj?8vrhNuCdm@^{a3AQ_>6myOj+ z`1RsLUXF|dm|3k7s2jD(B{rzE>WI2scH8i1;=O5Cc9xB3^aJk%fQjqsu+kH#0=_5a z0nCE8@dbQa-|YIuUVvG0L_IwHMEhOj$Mj4Uq05 X8=0q~qBNan00000NkvXXu0mjfptF>5 diff --git a/grin/docs/_build/doxygen/html/tab_a.png b/grin/docs/_build/doxygen/html/tab_a.png deleted file mode 100644 index 3b725c41c5a527a3a3e40097077d0e206a681247..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 142 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QlXwMjv*C{Z|8b*H5dputLHD# z=<0|*y7z(Vor?d;H&?EG&cXR}?!j-Lm&u1OOI7AIF5&c)RFE;&p0MYK>*Kl@eiymD r@|NpwKX@^z+;{u_Z~trSBfrMKa%3`zocFjEXaR$#tDnm{r-UW|TZ1%4 diff --git a/grin/docs/_build/doxygen/html/tab_ad.png b/grin/docs/_build/doxygen/html/tab_ad.png deleted file mode 100644 index e34850acfc24be58da6d2fd1ccc6b29cc84fe34d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QhuH;jv*C{Z|5d*H3V=pKi{In zd2jxLclDRPylmD}^l7{QOtL{vUjO{-WqItb5sQp2h-99b8^^Scr-=2mblCdZuUm?4 jzOJvgvt3{(cjKLW5(A@0qPS@<&}0TrS3j3^P6y&q2{!U5bk+Tso_B!YCpDh>v z{CM*1U8YvQRyBUHt^Ju0W_sq-?;9@_4equ-bavTs=gk796zopr0EBT&m;e9( diff --git a/grin/docs/_build/doxygen/html/tab_s.png b/grin/docs/_build/doxygen/html/tab_s.png deleted file mode 100644 index ab478c95b67371d700a20869f7de1ddd73522d50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!QuUrLjv*C{Z|^p8HaRdjTwH7) zC?wLlL}}I{)n%R&r+1}IGmDnq;&J#%V6)9VsYhS`O^BVBQlxOUep0c$RENLq#g8A$ z)z7%K_bI&n@J+X_=x}fJoEKed-$<>=ZI-;YrdjIl`U`uzuDWSP?o#Dmo{%SgM#oan kX~E1%D-|#H#QbHoIja2U-MgvsK&LQxy85}Sb4q9e0Efg%P5=M^ diff --git a/grin/docs/_build/doxygen/html/tab_sd.png b/grin/docs/_build/doxygen/html/tab_sd.png deleted file mode 100644 index 757a565ced4730f85c833fb2547d8e199ae68f19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^j6kfy!2~3aiye;!Qq7(&jv*C{Z|_!fH5o7*c=%9% zcILh!EA=pAQKdx-Cdiev=v{eg{8Ht<{e8_NAN~b=)%W>-WDCE0PyDHGemi$BoXwcK z{>e9^za6*c1ilttWw&V+U;WCPlV9{LdC~Ey%_H(qj`xgfES(4Yz5jSTZfCt`4E$0YRsR*S^mTCR^;V&sxC8{l_Cp7w8-YPgg&ebxsLQ00$vXK>z>% diff --git a/grin/docs/_build/doxygen/html/tabs.css b/grin/docs/_build/doxygen/html/tabs.css deleted file mode 100644 index 71c8a4704..000000000 --- a/grin/docs/_build/doxygen/html/tabs.css +++ /dev/null @@ -1 +0,0 @@ -.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important;color:var(--nav-menu-foreground-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} \ No newline at end of file diff --git a/grin/docs/_build/doxygen/html/type_8h.html b/grin/docs/_build/doxygen/html/type_8h.html deleted file mode 100644 index 01c502f67..000000000 --- a/grin/docs/_build/doxygen/html/type_8h.html +++ /dev/null @@ -1,184 +0,0 @@ - - - - - - - -GRIN: include/property/type.h File Reference - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    - -
    type.h File Reference
    -
    -
    - -

    Define the vertex/edge type related APIs. -More...

    -
    #include "../predefine.h"
    -
    -

    Go to the source code of this file.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    -Functions

    -VertexType get_vertex_type (const Graph, const Vertex)
     
    -char * get_vertex_type_name (const Graph, const VertexType)
     
    -VertexType get_vertex_type_by_name (const Graph, char *)
     
    -VertexTypeList get_vertex_type_list (const Graph)
     
    -void destroy_vertex_type_list (VertexTypeList)
     
    -VertexTypeList create_vertex_type_list ()
     
    -bool insert_vertex_type_to_list (VertexTypeList, const VertexType)
     
    -size_t get_vertex_type_list_size (const VertexTypeList)
     
    -VertexType get_vertex_type_from_list (const VertexTypeList, const size_t)
     
    -VertexTypeID get_vertex_type_id (const VertexType)
     
    -VertexType get_vertex_type_from_id (const VertexTypeID)
     
    -EdgeType get_edge_type (const Graph, const Edge)
     
    -char * get_edge_type_name (const Graph, const EdgeType)
     
    -EdgeType get_edge_type_by_name (const Graph, char *)
     
    -EdgeTypeList get_edge_type_list (const Graph)
     
    -void destroy_edge_type_list (EdgeTypeList)
     
    -EdgeTypeList create_edge_type_list ()
     
    -bool insert_edge_type_to_list (EdgeTypeList, const EdgeType)
     
    -size_t get_edge_type_list_size (const EdgeTypeList)
     
    -EdgeType get_edge_type_from_list (const EdgeTypeList, const size_t)
     
    -EdgeTypeID get_edge_type_id (const EdgeType)
     
    -EdgeType get_edge_type_from_id (const EdgeTypeID)
     
    VertexEdgeTypeRelation

    GRIN assumes the relation between edge type and pairs of vertex types is many-to-many. Thus GRIN returns the pairs of vertex types related to an edge type as a pair of vertex type lists of the same size, and the src/dst vertex types are aligned with their positions in the lists.

    -
    -VertexTypeList get_src_types_from_edge_type (const Graph, const EdgeType)
     the src vertex type list
     
    -VertexTypeList get_dst_types_from_edge_type (const Graph, const EdgeType)
     get the dst vertex type list
     
    -EdgeTypeList get_edge_types_from_vertex_type_pair (const Graph, const VertexType, const VertexType)
     get the edge type list related to a given pair of vertex types
     
    -

    Detailed Description

    -

    Define the vertex/edge type related APIs.

    -

    Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    - -

    Definition in file type.h.

    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/type_8h_source.html b/grin/docs/_build/doxygen/html/type_8h_source.html deleted file mode 100644 index 5baaa9294..000000000 --- a/grin/docs/_build/doxygen/html/type_8h_source.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - -GRIN: include/property/type.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    type.h
    -
    -
    -Go to the documentation of this file.
    1
    -
    18#ifndef GRIN_INCLUDE_PROPERTY_TYPE_H_
    -
    19#define GRIN_INCLUDE_PROPERTY_TYPE_H_
    -
    20
    -
    21#include "../predefine.h"
    -
    22
    -
    23#ifdef WITH_VERTEX_PROPERTY
    -
    24// Vertex type
    -
    25VertexType get_vertex_type(const Graph, const Vertex);
    -
    26
    -
    27char* get_vertex_type_name(const Graph, const VertexType);
    -
    28
    -
    29VertexType get_vertex_type_by_name(const Graph, char*);
    -
    30
    -
    31// Vertex type list
    -
    32VertexTypeList get_vertex_type_list(const Graph);
    -
    33
    -
    34void destroy_vertex_type_list(VertexTypeList);
    -
    35
    -
    36VertexTypeList create_vertex_type_list();
    -
    37
    -
    38bool insert_vertex_type_to_list(VertexTypeList, const VertexType);
    -
    39
    -
    40size_t get_vertex_type_list_size(const VertexTypeList);
    -
    41
    -
    42VertexType get_vertex_type_from_list(const VertexTypeList, const size_t);
    -
    43#endif
    -
    44
    -
    45
    -
    46#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT
    -
    47VertexTypeID get_vertex_type_id(const VertexType);
    -
    48
    -
    49VertexType get_vertex_type_from_id(const VertexTypeID);
    -
    50#endif
    -
    51
    -
    52
    -
    53#ifdef WITH_EDGE_PROPERTY
    -
    54// Edge type
    -
    55EdgeType get_edge_type(const Graph, const Edge);
    -
    56
    -
    57char* get_edge_type_name(const Graph, const EdgeType);
    -
    58
    -
    59EdgeType get_edge_type_by_name(const Graph, char*);
    -
    60
    -
    61// Edge type list
    -
    62EdgeTypeList get_edge_type_list(const Graph);
    -
    63
    -
    64void destroy_edge_type_list(EdgeTypeList);
    -
    65
    -
    66EdgeTypeList create_edge_type_list();
    -
    67
    -
    68bool insert_edge_type_to_list(EdgeTypeList, const EdgeType);
    -
    69
    -
    70size_t get_edge_type_list_size(const EdgeTypeList);
    -
    71
    -
    72EdgeType get_edge_type_from_list(const EdgeTypeList, const size_t);
    -
    73#endif
    -
    74
    -
    75#ifdef NATURAL_EDGE_TYPE_ID_TRAIT
    -
    76EdgeTypeID get_edge_type_id(const EdgeType);
    -
    77
    -
    78EdgeType get_edge_type_from_id(const EdgeTypeID);
    -
    79#endif
    -
    80
    -
    87#if defined(WITH_VERTEX_PROPERTY) && defined(WITH_EDGE_PROPERTY)
    -
    89VertexTypeList get_src_types_from_edge_type(const Graph, const EdgeType);
    -
    90
    -
    92VertexTypeList get_dst_types_from_edge_type(const Graph, const EdgeType);
    -
    93
    -
    95EdgeTypeList get_edge_types_from_vertex_type_pair(const Graph, const VertexType, const VertexType);
    -
    96#endif
    -
    98
    -
    99#endif // GRIN_INCLUDE_PROPERTY_TYPE_H_
    -
    VertexTypeList get_dst_types_from_edge_type(const Graph, const EdgeType)
    get the dst vertex type list
    -
    EdgeTypeList get_edge_types_from_vertex_type_pair(const Graph, const VertexType, const VertexType)
    get the edge type list related to a given pair of vertex types
    -
    VertexTypeList get_src_types_from_edge_type(const Graph, const EdgeType)
    the src vertex type list
    -
    - - - - diff --git a/grin/docs/_build/doxygen/html/vertexlist_8h_source.html b/grin/docs/_build/doxygen/html/vertexlist_8h_source.html deleted file mode 100644 index 1b820bb9c..000000000 --- a/grin/docs/_build/doxygen/html/vertexlist_8h_source.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - -GRIN: include/topology/vertexlist.h Source File - - - - - - - - - -
    -
    - - - - - - -
    -
    GRIN -
    -
    Graph Retrieval Interface
    -
    -
    - - - - - - - - -
    -
    - - -
    -
    -
    -
    -
    -
    Loading...
    -
    Searching...
    -
    No Matches
    -
    -
    -
    -
    - - -
    -
    -
    vertexlist.h
    -
    -
    -
    1
    -
    16#ifndef GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_
    -
    17#define GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_
    -
    18
    -
    19#include "../predefine.h"
    -
    20
    -
    21#ifdef ENABLE_VERTEX_LIST
    -
    22
    -
    23VertexList get_vertex_list(const Graph);
    -
    24
    -
    25#ifdef WITH_VERTEX_PROPERTY
    -
    26VertexList get_vertex_list_by_type(const Graph, const VertexType);
    -
    27#endif
    -
    28
    -
    29void destroy_vertex_list(VertexList);
    -
    30
    -
    31VertexList create_vertex_list();
    -
    32
    -
    33bool insert_vertex_to_list(VertexList, const Vertex);
    -
    34
    -
    35size_t get_vertex_list_size(const VertexList);
    -
    36
    -
    37Vertex get_vertex_from_list(const VertexList, const size_t);
    -
    38
    -
    39#ifdef ENABLE_VERTEX_LIST_ITERATOR
    -
    40VertexListIterator get_vertex_list_begin(const Graph);
    -
    41
    -
    42#ifdef WITH_VERTEX_PROPERTY
    -
    43VertexListIterator get_vertex_list_begin_by_type(const Graph, const VertexType);
    -
    44#endif
    -
    45
    -
    46bool get_next_vertex_list_iter(VertexListIterator);
    -
    47
    -
    48Vertex get_vertex_from_iter(VertexListIterator);
    -
    49#endif
    -
    50
    -
    51
    -
    52#endif
    -
    53
    -
    54#endif // GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_
    -
    - - - - diff --git a/grin/docs/_build/doxygen/xml/Doxyfile.xml b/grin/docs/_build/doxygen/xml/Doxyfile.xml deleted file mode 100644 index c730ef867..000000000 --- a/grin/docs/_build/doxygen/xml/Doxyfile.xml +++ /dev/null @@ -1,342 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/_r_e_a_d_m_e_8md.xml b/grin/docs/_build/doxygen/xml/_r_e_a_d_m_e_8md.xml deleted file mode 100644 index 125661efe..000000000 --- a/grin/docs/_build/doxygen/xml/_r_e_a_d_m_e_8md.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - README.md - - - - - - -#GRIN -##Assumptions -###PropertyGraph --Verticeshavetypes,soasEdges. --Therelationshipbetweenedgetypeandpairsofvertextypesismany-to-many. --Propertiesareboundtovertexandedgetypes,butsomemayhavethesamename. --Labelscanbeassignedtoverticesandedges(NOTtheirtypes)primarilyforqueryfiltering,andlabelshavenoproperties. -##DesignPrinciples -###Handler --GRINprovidesaseriesofhandlersforgraphconcepts,suchasvertex,edgeandgraphitself. --SincealmosteverythinginGRINarehandlersexceptofonlyafewstringnames,thetypeforagraphconceptanditshandlerisalwaysmixed-usedinGRIN. --Forexample,weusethetypeVertextorepresentthetypeofavertexhandler,insteadofusingVertexHandlerforcleancode. - -###List --Alisthandler,nomatterwhatkindoflistitrepresents,isavailabletotheuseronlyifthestoragecanprovidethesizeofthelist,andanelementretrievalAPIbyposition(i.e.,indexofarray). --FortheinstanceofVertex,whensomeGRINAPIreturnsa`VertexList`(handler),theusercangetthesizeofthe`VertexList`bycalling`get_vertex_list_size`togetthe`size`,and`get_vertex_from_list`togeta`vertex`byprovidinganindexvaluerangesfrom`0`to`size-1`. -###ListIterator --Alistiteratorhandler,nomatterwhatkindoflistitrepresents,isavailabletotheuserifthelistsizeisunknownorforsequentialscanefficiency. --TakeVertexasexampleagain,userscangettheiteratoratthebeginningusingAPIslike`get_vertex_list_begin`,andkeepsonusing`get_next_vertex_list_iter`toupdatetheiteratortilltheendofthelistwhena`false`isreturned.APIslike`get_vertex_from_iter`willreturnthe`Vertex`fromthevertexiterator. -###Property --Propertiesareboundtovertexandedgetypes.Itmeansevensomepropertiesmayhavethesamename,aslongastheyareboundtodifferentvertexoredgetypes,GRINwillprovidedistincthandlersfortheseproperties.Thisis -because,althoughpropertieswiththesamenameusuallyprovidethesamesemanticinthegraph,theymayhave -differentdatatypesintheunderlyingstorageforefficiencyconcerns(e.g.,shortdateandlongdate). --Toavoidtheincompatibilitywithstorageengines,wemadethedesignchoicetobindpropertiesundervertexandedgetypes.Meanwhile,GRINprovidesanAPItogetallthepropertyhandlerswiththe(same)givenpropertyname. -###Reference --GRINintroducesthereferenceconceptinpartitionedgraph.Itstandsforthereferenceofaninstancethatcan -berecognizedinpartitionsotherthanthecurrentpartitionwheretheinstanceisaccessed. --Forexample,a`VertexRef`isareferenceofa`Vertex`thatcanberecognizedinotherpartitions. - -##Traits -###NaturalIDTrait --Conceptsrepresenttheschemaofthegraph,suchasvertextypeandpropertiesboundtoacertainedgetype,areusuallynumberednaturallyfrom`0`toits`num-1`inmanystorageengines.Tofacilitatefurtheroptimizations -intheuppercomputingengines,GRINprovidesthenaturalnumberIDtrait.Astoragecanprovidesuchatraitif -italsousesthenaturalnumberingforgraphschemaconcepts. - - - - - diff --git a/grin/docs/_build/doxygen/xml/adjacentlist_8h.xml b/grin/docs/_build/doxygen/xml/adjacentlist_8h.xml deleted file mode 100644 index 7ca45f4f4..000000000 --- a/grin/docs/_build/doxygen/xml/adjacentlist_8h.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - - adjacentlist.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AdjacentList - AdjacentList get_adjacent_list - (const Graph, const Direction, Vertex) - get_adjacent_list - - const - Graph - - - const - Direction - - - Vertex - - - - -Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - - - - - AdjacentList - AdjacentList get_adjacent_list_by_edge_type - (const Graph, const Direction, Vertex, EdgeType) - get_adjacent_list_by_edge_type - - const - Graph - - - const - Direction - - - Vertex - - - EdgeType - - - - - - - - - - - void - void destroy_adjacent_list - (AdjacentList) - destroy_adjacent_list - - AdjacentList - - - - - - - - - - - size_t - size_t get_adjacent_list_size - (const AdjacentList) - get_adjacent_list_size - - const - AdjacentList - - - - - - - - - - - Vertex - Vertex get_neighbor_from_adjacent_list - (const AdjacentList, size_t) - get_neighbor_from_adjacent_list - - const - AdjacentList - - - size_t - - - - - - - - - - - Edge - Edge get_edge_from_adjacent_list - (const AdjacentList, size_t) - get_edge_from_adjacent_list - - const - AdjacentList - - - size_t - - - - - - - - - - - - - - - - -#ifndefGRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ -#defineGRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ - -#include"../predefine.h" - -#ifdefENABLE_ADJACENT_LIST -AdjacentListget_adjacent_list(constGraph,constDirection,Vertex); - -#ifdefWITH_EDGE_PROPERTY -AdjacentListget_adjacent_list_by_edge_type(constGraph,constDirection,Vertex,EdgeType); -#endif - -voiddestroy_adjacent_list(AdjacentList); - -size_tget_adjacent_list_size(constAdjacentList); - -Vertexget_neighbor_from_adjacent_list(constAdjacentList,size_t); - -Edgeget_edge_from_adjacent_list(constAdjacentList,size_t); - -#ifdefENABLE_ADJACENT_LIST_ITERATOR -AdjacentListIteratorget_adjacent_list_begin(constGraph); - -boolget_next_adjacent_list_iter(AdjacentListIterator); - -Vertexget_neighbor_from_iter(AdjacentListIterator); - -Edgeget_edge_from_iter(AdjacentListIterator); -#endif - -#endif - -#endif//GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ - - - - diff --git a/grin/docs/_build/doxygen/xml/combine.xslt b/grin/docs/_build/doxygen/xml/combine.xslt deleted file mode 100644 index 3bfa82c1e..000000000 --- a/grin/docs/_build/doxygen/xml/combine.xslt +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/compound.xsd b/grin/docs/_build/doxygen/xml/compound.xsd deleted file mode 100644 index a10b58d40..000000000 --- a/grin/docs/_build/doxygen/xml/compound.xsd +++ /dev/null @@ -1,1305 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The mentioned file will be located in the directory as specified by XML_OUTPUT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/dir_49e56c817e5e54854c35e136979f97ca.xml b/grin/docs/_build/doxygen/xml/dir_49e56c817e5e54854c35e136979f97ca.xml deleted file mode 100644 index 84e97a7bd..000000000 --- a/grin/docs/_build/doxygen/xml/dir_49e56c817e5e54854c35e136979f97ca.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - docs - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/dir_85395b416142281e9b8cbaa2a4bb7bc5.xml b/grin/docs/_build/doxygen/xml/dir_85395b416142281e9b8cbaa2a4bb7bc5.xml deleted file mode 100644 index 5094e1b84..000000000 --- a/grin/docs/_build/doxygen/xml/dir_85395b416142281e9b8cbaa2a4bb7bc5.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - include/partition - partition.h - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/dir_d44c64559bbebec7f509842c48db8b23.xml b/grin/docs/_build/doxygen/xml/dir_d44c64559bbebec7f509842c48db8b23.xml deleted file mode 100644 index 5e271af0b..000000000 --- a/grin/docs/_build/doxygen/xml/dir_d44c64559bbebec7f509842c48db8b23.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - include - include/partition - include/property - include/topology - predefine.h - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/dir_f450b25d4e0d87eea6a09d028ca7ee7d.xml b/grin/docs/_build/doxygen/xml/dir_f450b25d4e0d87eea6a09d028ca7ee7d.xml deleted file mode 100644 index d4a8d0d48..000000000 --- a/grin/docs/_build/doxygen/xml/dir_f450b25d4e0d87eea6a09d028ca7ee7d.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - include/topology - adjacentlist.h - edgelist.h - structure.h - vertexlist.h - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/dir_ffb75fe14fe29e45cb01a712fdfb6c45.xml b/grin/docs/_build/doxygen/xml/dir_ffb75fe14fe29e45cb01a712fdfb6c45.xml deleted file mode 100644 index d0227ecbb..000000000 --- a/grin/docs/_build/doxygen/xml/dir_ffb75fe14fe29e45cb01a712fdfb6c45.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - include/property - label.h - primarykey.h - property.h - propertylist.h - propertytable.h - type.h - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/doxyfile.xsd b/grin/docs/_build/doxygen/xml/doxyfile.xsd deleted file mode 100644 index fbfc2c13d..000000000 --- a/grin/docs/_build/doxygen/xml/doxyfile.xsd +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/edgelist_8h.xml b/grin/docs/_build/doxygen/xml/edgelist_8h.xml deleted file mode 100644 index 14b813e6c..000000000 --- a/grin/docs/_build/doxygen/xml/edgelist_8h.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - edgelist.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#ifndefGRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ -#defineGRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ - -#include"../predefine.h" - -#ifdefENABLE_EDGE_LIST - -EdgeListget_edge_list(constGraph,constDirection); - -#ifdefWITH_EDGE_PROPERTY -EdgeListget_edge_list_by_type(constGraph,constEdgeType); -#endif - -voiddestroy_edge_list(EdgeList); - -EdgeListcreate_edge_list(); - -boolinsert_edge_to_list(EdgeList,constEdge); - -size_tget_edge_list_size(constEdgeList); - -Edgeget_edge_from_list(constEdgeList,size_t); - -#ifdefENABLE_EDGE_LIST_ITERATOR -EdgeListIteratorget_edge_list_begin(constGraph); - -#ifdefWITH_EDGE_PROPERTY -EdgeListIteratorget_edge_list_begin_by_type(constGraph,constEdgeType); -#endif - -boolget_next_edge_list_iter(EdgeListIterator); - -Edgeget_edge_from_iter(EdgeListIterator); -#endif - -#endif - -#endif//GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ - - - - diff --git a/grin/docs/_build/doxygen/xml/group__nv.xml b/grin/docs/_build/doxygen/xml/group__nv.xml deleted file mode 100644 index d3ad189ff..000000000 --- a/grin/docs/_build/doxygen/xml/group__nv.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - nv - Null Values - - - NULL_TYPE - Undefined - -Null type (undefined data type) - - - - - - - - - NULL_GRAPH - NULL - -Null graph (invalid return value) - - - - - - - - - NULL_VERTEX - NULL - -Non-existing vertex (invalid return value) - - - - - - - - - NULL_EDGE - NULL - -Non-existing edge (invalid return value) - - - - - - - - - NULL_LIST - NULL - -Null list of any kind (invalid return value) - - - - - - - - - NULL_PARTITION - NULL - -Non-existing partition (invalid return value) - - - - - - - - - NULL_VERTEX_REF - NULL - -Null vertex reference (invalid return value) - - - - - - - - - NULL_EDGE_REF - NULL - -Null edge reference (invalid return value) - - - - - - - - - NULL_VERTEX_TYPE - NULL - -Non-existing vertex type (invalid return value) - - - - - - - - - NULL_EDGE_TYPE - NULL - -Non-existing edge type (invalid return value) - - - - - - - - - NULL_PROPERTY - NULL - -Non-existing property (invalid return value) - - - - - - - - - NULL_ROW - NULL - -Null row (invalid return value) - - - - - - - - - NULL_NATURAL_ID - UINT_MAX - -Null natural id of any kind (invalid return value) - - - - - - - - - - - -Macros for Null(invalid) values - - - diff --git a/grin/docs/_build/doxygen/xml/index.xml b/grin/docs/_build/doxygen/xml/index.xml deleted file mode 100644 index 7f91ad958..000000000 --- a/grin/docs/_build/doxygen/xml/index.xml +++ /dev/null @@ -1,263 +0,0 @@ - - - README.md - - partition.h - get_total_partitions_number - get_local_partition_list - destroy_partition_list - create_partition_list - insert_partition_to_list - get_partition_list_size - get_partition_from_list - get_partition_from_id - get_partition_id - get_partition_info - get_local_graph_from_partition - get_master_vertices - get_mirror_vertices - get_mirror_vertices_by_partition - get_master_vertices_by_type - get_mirror_vertices_by_type - get_mirror_vertices_by_type_partition - get_adjacent_master_list - get_adjacent_mirror_list - get_adjacent_mirror_list_by_partition - get_vertex_ref_for_vertex - get_vertex_from_vertex_ref - get_master_partition_from_vertex_ref - serialize_vertex_ref - deserialize_to_vertex_ref - get_edge_ref_for_edge - get_edge_from_edge_ref - get_master_partition_from_edge_ref - serialize_edge_ref - deserialize_to_edge_ref - is_vertex_neighbor_local_complete - vertex_neighbor_complete_partitions - is_vertex_property_local_complete - vertex_property_complete_partitions - is_edge_property_local_complete - edge_data_complete_partitions - - predefine.h - WITH_VERTEX_ORIGINAL_ID - WITH_VERTEX_DATA - WITH_EDGE_DATA - ENABLE_VERTEX_LIST - ENABLE_VERTEX_LIST_ITERATOR - ENABLE_EDGE_LIST - ENABLE_EDGE_LIST_ITERATOR - ENABLE_ADJACENT_LIST - ENABLE_ADJACENT_LIST_ITERATOR - ENABLE_GRAPH_PARTITION - NATURAL_PARTITION_ID_TRAIT - ENABLE_VERTEX_REF - ENABLE_EDGE_REF - WITH_PROPERTY_NAME - WITH_VERTEX_PROPERTY - WITH_VERTEX_PRIMARTY_KEYS - NATURAL_VERTEX_TYPE_ID_TRAIT - NATURAL_VERTEX_PROPERTY_ID_TRAIT - WITH_EDGE_PROPERTY - WITH_EDGE_PRIMARTY_KEYS - NATURAL_EDGE_TYPE_ID_TRAIT - NATURAL_EDGE_PROPERTY_ID_TRAIT - WITH_LABEL - COLUMN_STORE_TRAIT - ENABLE_PREDICATE - NULL_TYPE - NULL_GRAPH - NULL_VERTEX - NULL_EDGE - NULL_LIST - NULL_PARTITION - NULL_VERTEX_REF - NULL_EDGE_REF - NULL_VERTEX_TYPE - NULL_EDGE_TYPE - NULL_PROPERTY - NULL_ROW - NULL_NATURAL_ID - Direction - IN - OUT - BOTH - DataType - Undefined - Int32 - UInt32 - Int64 - UInt64 - Float - Double - String - Date32 - Date64 - Graph - Vertex - Edge - OriginalID - VertexList - AdjacentList - PartitionedGraph - Partition - PartitionList - PartitionID - VertexRef - VertexType - VertexTypeList - VertexProperty - VertexPropertyList - VertexPropertyTable - VertexTypeID - VertexPropertyID - EdgeType - EdgeTypeList - EdgeProperty - EdgePropertyList - EdgePropertyTable - EdgeTypeID - EdgePropertyID - Row - - label.h - get_label_by_name - get_label_name - destroy_label - destroy_label_list - get_label_list_size - get_label_from_list - assign_label_to_vertex - get_vertex_label_list - get_vertex_list_by_label - filter_vertex_list_by_label - - primarykey.h - get_vertex_types_with_primary_keys - get_primary_keys_by_vertex_type - get_vertex_by_primay_keys - - property.h - get_vertex_property_name - get_vertex_property_by_name - get_vertex_properties_by_name - get_edge_property_name - get_edge_property_by_name - get_edge_properties_by_name - destroy_vertex_property - get_vertex_property_data_type - get_vertex_property_vertex_type - - propertylist.h - select_vertex_properties - select_edge_properteis - get_vertex_property_list_by_type - get_vertex_property_list_size - get_vertex_property_from_list - create_vertex_property_list - destroy_vertex_property_list - insert_vertex_property_to_list - get_vertex_property_from_id - get_vertex_property_id - get_edge_property_list_by_type - get_edge_property_list_size - get_edge_property_from_list - create_edge_property_list - destroy_edge_property_list - insert_edge_property_to_list - get_edge_property_from_id - get_edge_property_id - - propertytable.h - destroy_row - get_value_from_row - create_row - insert_value_to_row - destroy_vertex_property_table - get_vertex_property_table_by_type - get_value_from_vertex_property_table - get_row_from_vertex_property_table - - type.h - get_src_types_from_edge_type - get_dst_types_from_edge_type - get_edge_types_from_vertex_type_pair - get_vertex_type - get_vertex_type_name - get_vertex_type_by_name - get_vertex_type_list - destroy_vertex_type_list - create_vertex_type_list - insert_vertex_type_to_list - get_vertex_type_list_size - get_vertex_type_from_list - get_vertex_type_id - get_vertex_type_from_id - get_edge_type - get_edge_type_name - get_edge_type_by_name - get_edge_type_list - destroy_edge_type_list - create_edge_type_list - insert_edge_type_to_list - get_edge_type_list_size - get_edge_type_from_list - get_edge_type_id - get_edge_type_from_id - - adjacentlist.h - get_adjacent_list - get_adjacent_list_by_edge_type - destroy_adjacent_list - get_adjacent_list_size - get_neighbor_from_adjacent_list - get_edge_from_adjacent_list - - edgelist.h - - structure.h - is_directed - is_multigraph - get_vertex_num - get_vertex_num_by_type - get_edge_num - get_edge_num_by_type - destroy_vertex - get_vertex_data_type - get_vertex_data_value - destroy_vertex_data - get_vertex_from_original_id - get_vertex_from_type_original_id - get_vertex_original_id - destroy_vertex_original_id - destroy_edge - get_edge_src - get_edge_dst - - vertexlist.h - get_vertex_list - get_vertex_list_by_type - destroy_vertex_list - create_vertex_list - insert_vertex_to_list - get_vertex_list_size - get_vertex_from_list - get_vertex_list_begin - get_vertex_list_begin_by_type - get_next_vertex_list_iter - get_vertex_from_iter - - docs - - include - - include/partition - - include/property - - include/topology - - index - - diff --git a/grin/docs/_build/doxygen/xml/index.xsd b/grin/docs/_build/doxygen/xml/index.xsd deleted file mode 100644 index cfb7041b5..000000000 --- a/grin/docs/_build/doxygen/xml/index.xsd +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/indexpage.xml b/grin/docs/_build/doxygen/xml/indexpage.xml deleted file mode 100644 index c32cd7d35..000000000 --- a/grin/docs/_build/doxygen/xml/indexpage.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - index - GRIN - - - - - -Assumptions - -Property Graph - -Vertices have types, so as Edges. -The relationship between edge type and pairs of vertex types is many-to-many. -Properties are bound to vertex and edge types, but some may have the same name. -Labels can be assigned to vertices and edges (NOT their types) primarily for query filtering, and labels have no properties. - - - - - -Design Principles - -Handler - -GRIN provides a series of handlers for graph concepts, such as vertex, edge and graph itself. -Since almost everything in GRIN are handlers except of only a few string names, the type for a graph concept and its handler is always mixed-used in GRIN. -For example, we use the type Vertex to represent the type of a vertex handler, instead of using VertexHandler for clean code. - - - - -List - -A list handler, no matter what kind of list it represents, is available to the user only if the storage can provide the size of the list, and an element retrieval API by position (i.e., index of array). -For the instance of Vertex, when some GRIN API returns a VertexList(handler), the user can get the size of the VertexList by calling get_vertex_list_size to get the size, and get_vertex_from_list to get a vertex by providing an index value ranges from 0 to size-1. - - - - -List Iterator - -A list iterator handler, no matter what kind of list it represents, is available to the user if the list size is unknown or for sequential scan efficiency. -Take Vertex as example again, users can get the iterator at the beginning using APIs like get_vertex_list_begin, and keeps on using get_next_vertex_list_iter to update the iterator till the end of the list when a false is returned. APIs like get_vertex_from_iter will return the Vertex from the vertex iterator. - - - - -Property - -Properties are bound to vertex and edge types. It means even some properties may have the same name, as long as they are bound to different vertex or edge types, GRIN will provide distinct handlers for these properties. This is because, although properties with the same name usually provide the same semantic in the graph, they may have different data types in the underlying storage for efficiency concerns (e.g., short date and long date). -To avoid the incompatibility with storage engines, we made the design choice to bind properties under vertex and edge types. Meanwhile, GRIN provides an API to get all the property handlers with the (same) given property name. - - - - -Reference - -GRIN introduces the reference concept in partitioned graph. It stands for the reference of an instance that can be recognized in partitions other than the current partition where the instance is accessed. -For example, a VertexRef is a reference of a Vertex that can be recognized in other partitions. - - - - - -Traits - -Natural ID Trait - -Concepts represent the schema of the graph, such as vertex type and properties bound to a certain edge type, are usually numbered naturally from 0 to its num - 1 in many storage engines. To facilitate further optimizations in the upper computing engines, GRIN provides the natural number ID trait. A storage can provide such a trait if it also uses the natural numbering for graph schema concepts. - - - - - - - - diff --git a/grin/docs/_build/doxygen/xml/label_8h.xml b/grin/docs/_build/doxygen/xml/label_8h.xml deleted file mode 100644 index 8b632137e..000000000 --- a/grin/docs/_build/doxygen/xml/label_8h.xml +++ /dev/null @@ -1,358 +0,0 @@ - - - - label.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Label - Label get_label_by_name - (const Graph, const char *) - get_label_by_name - - const - Graph - - - const char * - - - - - - - - - - - char * - char * get_label_name - (const Graph, const Label) - get_label_name - - const - Graph - - - const - Label - - - - - - - - - - - void - void destroy_label - (Label) - destroy_label - - Label - - - - - - - - - - - void - void destroy_label_list - (LabelList) - destroy_label_list - - LabelList - - - - - - - - - - - size_t - size_t get_label_list_size - (const LabelList) - get_label_list_size - - const - LabelList - - - - - - - - - - - Label - Label get_label_from_list - (const LabelList, const size_t) - get_label_from_list - - const - LabelList - - - const - size_t - - - - - - - - - - - bool - bool assign_label_to_vertex - (const Graph, const Label, Vertex) - assign_label_to_vertex - - const - Graph - - - const - Label - - - Vertex - - -assign a label to a vertex - - - - -Graph - - -the graph - - - - -Label - - -the label - - - - -Vertex - - -the vertex - - - -whether succeed - - - - - - - - - LabelList - LabelList get_vertex_label_list - (const Graph, const Vertex) - get_vertex_label_list - - const - Graph - - - const - Vertex - - -get the label list of a vertex - - - - -Graph - - -the graph - - - - -Vertex - - -the vertex - - - - - - - - - - - VertexList - VertexList get_vertex_list_by_label - (const Graph, const Label) - get_vertex_list_by_label - - const - Graph - - - const - Label - - -get the vertex list by label - - - - -Graph - - -the graph - - - - -Label - - -the label - - - - - - - - - - - VertexList - VertexList filter_vertex_list_by_label - (const VertexList, const Label) - filter_vertex_list_by_label - - const - VertexList - - - const - Label - - -filtering an existing vertex list by label - - - - -VertexList - - -the existing vertex list - - - - -Label - - -the label - - - - - - - - - - - -Define the label related APIs. - - -Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - -#ifndefGRIN_INCLUDE_PROPERTY_LABEL_H_ -#defineGRIN_INCLUDE_PROPERTY_LABEL_H_ - -#include"../predefine.h" - -#ifdefWITH_LABEL -Labelget_label_by_name(constGraph,constchar*); - -char*get_label_name(constGraph,constLabel); - -voiddestroy_label(Label); - -voiddestroy_label_list(LabelList); - -size_tget_label_list_size(constLabelList); - -Labelget_label_from_list(constLabelList,constsize_t); - -boolassign_label_to_vertex(constGraph,constLabel,Vertex); - -LabelListget_vertex_label_list(constGraph,constVertex); - -VertexListget_vertex_list_by_label(constGraph,constLabel); - -VertexListfilter_vertex_list_by_label(constVertexList,constLabel); -#endif - -#endif//GRIN_INCLUDE_PROPERTY_LABEL_H_ - - - - diff --git a/grin/docs/_build/doxygen/xml/partition_8h.xml b/grin/docs/_build/doxygen/xml/partition_8h.xml deleted file mode 100644 index 1554bd00d..000000000 --- a/grin/docs/_build/doxygen/xml/partition_8h.xml +++ /dev/null @@ -1,906 +0,0 @@ - - - - partition.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ****add enable_vertex edge_ref macros ****size_t - ****add enable_vertex edge_ref macros ****size_t get_total_partitions_number - (const PartitionedGraph) - get_total_partitions_number - - const - PartitionedGraph - - - - -Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - - - - - PartitionList - PartitionList get_local_partition_list - (const PartitionedGraph) - get_local_partition_list - - const - PartitionedGraph - - - - - - - - - - - void - void destroy_partition_list - (PartitionList) - destroy_partition_list - - PartitionList - - - - - - - - - - - PartitionList - PartitionList create_partition_list - () - create_partition_list - - - - - - - - - - bool - bool insert_partition_to_list - (PartitionList, const Partition) - insert_partition_to_list - - PartitionList - - - const - Partition - - - - - - - - - - - size_t - size_t get_partition_list_size - (const PartitionList) - get_partition_list_size - - const - PartitionList - - - - - - - - - - - Partition - Partition get_partition_from_list - (const PartitionList, const size_t) - get_partition_from_list - - const - PartitionList - - - const - size_t - - - - - - - - - - - Partition - Partition get_partition_from_id - (const PartitionID) - get_partition_from_id - - const - PartitionID - - - - - - - - - - - PartitionID - PartitionID get_partition_id - (const Partition) - get_partition_id - - const - Partition - - - - - - - - - - - void * - void * get_partition_info - (const PartitionedGraph, const Partition) - get_partition_info - - const - PartitionedGraph - - - const - Partition - - - - - - - - - - - Graph - Graph get_local_graph_from_partition - (const PartitionedGraph, const Partition) - get_local_graph_from_partition - - const - PartitionedGraph - - - const - Partition - - - - - - - - - - - VertexList - VertexList get_master_vertices - (const Graph) - get_master_vertices - - const - Graph - - - - - - - - - - - VertexList - VertexList get_mirror_vertices - (const Graph) - get_mirror_vertices - - const - Graph - - - - - - - - - - - VertexList - VertexList get_mirror_vertices_by_partition - (const Graph, const Partition) - get_mirror_vertices_by_partition - - const - Graph - - - const - Partition - - - - - - - - - - - VertexList - VertexList get_master_vertices_by_type - (const Graph, const VertexType) - get_master_vertices_by_type - - const - Graph - - - const - VertexType - - - - - - - - - - - VertexList - VertexList get_mirror_vertices_by_type - (const Graph, const VertexType) - get_mirror_vertices_by_type - - const - Graph - - - const - VertexType - - - - - - - - - - - VertexList - VertexList get_mirror_vertices_by_type_partition - (const Graph, const VertexType, const Partition) - get_mirror_vertices_by_type_partition - - const - Graph - - - const - VertexType - - - const - Partition - - - - - - - - - - - AdjacentList - AdjacentList get_adjacent_master_list - (const Graph, const Direction, const Vertex) - get_adjacent_master_list - - const - Graph - - - const - Direction - - - const - Vertex - - - - - - - - - - - AdjacentList - AdjacentList get_adjacent_mirror_list - (const Graph, const Direction, const Vertex) - get_adjacent_mirror_list - - const - Graph - - - const - Direction - - - const - Vertex - - - - - - - - - - - AdjacentList - AdjacentList get_adjacent_mirror_list_by_partition - (const Graph, const Direction, const Partition, const Vertex) - get_adjacent_mirror_list_by_partition - - const - Graph - - - const - Direction - - - const - Partition - - - const - Vertex - - - - - - - - - - - VertexRef - VertexRef get_vertex_ref_for_vertex - (const Graph, const Partition, const Vertex) - get_vertex_ref_for_vertex - - const - Graph - - - const - Partition - - - const - Vertex - - - - - - - - - - - Vertex - Vertex get_vertex_from_vertex_ref - (const Graph, const VertexRef) - get_vertex_from_vertex_ref - - const - Graph - - - const - VertexRef - - - - - - - - - - - Partition - Partition get_master_partition_from_vertex_ref - (const Graph, const VertexRef) - get_master_partition_from_vertex_ref - - const - Graph - - - const - VertexRef - - - - - - - - - - - char * - char * serialize_vertex_ref - (const Graph, const VertexRef) - serialize_vertex_ref - - const - Graph - - - const - VertexRef - - - - - - - - - - - VertexRef - VertexRef deserialize_to_vertex_ref - (const Graph, const char *) - deserialize_to_vertex_ref - - const - Graph - - - const char * - - - - - - - - - - - EdgeRef - EdgeRef get_edge_ref_for_edge - (const Graph, const Partition, const Edge) - get_edge_ref_for_edge - - const - Graph - - - const - Partition - - - const - Edge - - - - - - - - - - - Edge - Edge get_edge_from_edge_ref - (const Graph, const EdgeRef) - get_edge_from_edge_ref - - const - Graph - - - const - EdgeRef - - - - - - - - - - - Partition - Partition get_master_partition_from_edge_ref - (const Graph, const EdgeRef) - get_master_partition_from_edge_ref - - const - Graph - - - const - EdgeRef - - - - - - - - - - - char * - char * serialize_edge_ref - (const Graph, const EdgeRef) - serialize_edge_ref - - const - Graph - - - const - EdgeRef - - - - - - - - - - - EdgeRef - EdgeRef deserialize_to_edge_ref - (const Graph, const char *) - deserialize_to_edge_ref - - const - Graph - - - const char * - - - - - - - - - - - bool - bool is_vertex_neighbor_local_complete - (const Graph, const Vertex) - is_vertex_neighbor_local_complete - - const - Graph - - - const - Vertex - - - - - - - - - - - PartitionList - PartitionList vertex_neighbor_complete_partitions - (const Graph, const Vertex) - vertex_neighbor_complete_partitions - - const - Graph - - - const - Vertex - - - - - - - - - - - bool - bool is_vertex_property_local_complete - (const Graph, const Vertex) - is_vertex_property_local_complete - - const - Graph - - - const - Vertex - - - - - - - - - - - PartitionList - PartitionList vertex_property_complete_partitions - (const Graph, const Vertex) - vertex_property_complete_partitions - - const - Graph - - - const - Vertex - - - - - - - - - - - bool - bool is_edge_property_local_complete - (const Graph, const Edge) - is_edge_property_local_complete - - const - Graph - - - const - Edge - - - - - - - - - - - PartitionList - PartitionList edge_data_complete_partitions - (const Graph, const Edge) - edge_data_complete_partitions - - const - Graph - - - const - Edge - - - - - - - - - - - - - - - - -#ifndefGRIN_INCLUDE_PARTITION_PARTITION_H_ -#defineGRIN_INCLUDE_PARTITION_PARTITION_H_ - -#include"../predefine.h" - -****addenable_vertex/edge_refmacros**** - -#ifdefENABLE_GRAPH_PARTITION -size_tget_total_partitions_number(constPartitionedGraph); - -PartitionListget_local_partition_list(constPartitionedGraph); - -voiddestroy_partition_list(PartitionList); - -PartitionListcreate_partition_list(); - -boolinsert_partition_to_list(PartitionList,constPartition); - -size_tget_partition_list_size(constPartitionList); - -Partitionget_partition_from_list(constPartitionList,constsize_t); - -#ifdefNATURAL_PARTITION_ID_TRAIT -Partitionget_partition_from_id(constPartitionID); - -PartitionIDget_partition_id(constPartition); -#endif - -void*get_partition_info(constPartitionedGraph,constPartition); - -Graphget_local_graph_from_partition(constPartitionedGraph,constPartition); - - -//master&mirrorverticesforvertexcutpartition -//whiletheyrefertoinner&outerverticesinedgecutpartition -#ifdefined(ENABLE_GRAPH_PARTITION)&&defined(ENABLE_VERTEX_LIST) -VertexListget_master_vertices(constGraph); - -VertexListget_mirror_vertices(constGraph); - -VertexListget_mirror_vertices_by_partition(constGraph,constPartition); - -#ifdefWITH_VERTEX_PROPERTY -VertexListget_master_vertices_by_type(constGraph,constVertexType); - -VertexListget_mirror_vertices_by_type(constGraph,constVertexType); - -VertexListget_mirror_vertices_by_type_partition(constGraph,constVertexType,constPartition); -#endif -#endif - -#ifdefined(ENABLE_GRAPH_PARTITION)&&defined(ENABLE_ADJACENT_LIST) -AdjacentListget_adjacent_master_list(constGraph,constDirection,constVertex); - -AdjacentListget_adjacent_mirror_list(constGraph,constDirection,constVertex); - -AdjacentListget_adjacent_mirror_list_by_partition(constGraph,constDirection, -constPartition,constVertex); -#endif - - -//Vertexrefreferstothesamevertexreferredinotherpartitions, -//whileedgerefislikewise.Bothcanbeserializedtochar*for -//messagetransportinganddeserializedontheotherend. -VertexRefget_vertex_ref_for_vertex(constGraph,constPartition,constVertex); - -Vertexget_vertex_from_vertex_ref(constGraph,constVertexRef); - -Partitionget_master_partition_from_vertex_ref(constGraph,constVertexRef); - -char*serialize_vertex_ref(constGraph,constVertexRef); - -VertexRefdeserialize_to_vertex_ref(constGraph,constchar*); - -EdgeRefget_edge_ref_for_edge(constGraph,constPartition,constEdge); - -Edgeget_edge_from_edge_ref(constGraph,constEdgeRef); - -Partitionget_master_partition_from_edge_ref(constGraph,constEdgeRef); - -char*serialize_edge_ref(constGraph,constEdgeRef); - -EdgeRefdeserialize_to_edge_ref(constGraph,constchar*); - -//Theconceptoflocal_completereferstowhetherwecangetcompletedataorproperties -//locallyinthepartition.Itisorthogonaltotheconceptofmaster/mirrorwhich -//ismainlydesignedfordataaggregation.Insomeextremelycases,mastervertices -//mayNOTcontainallthedataorpropertieslocally. -boolis_vertex_neighbor_local_complete(constGraph,constVertex); - -PartitionListvertex_neighbor_complete_partitions(constGraph,constVertex); - -#ifdefWITH_VERTEX_DATA -boolis_vertex_data_local_complete(constGraph,constVertex); - -PartitionListvertex_data_complete_partitions(constGraph,constVertex); -#endif - -#ifdefWITH_VERTEX_PROPERTY -boolis_vertex_property_local_complete(constGraph,constVertex); - -PartitionListvertex_property_complete_partitions(constGraph,constVertex); -#endif - -#ifdefWITH_EDGE_DATA -boolis_edge_data_local_complete(constGraph,constEdge); - -PartitionListedge_data_complete_partitions(constGraph,constEdge); -#endif - -#ifdefWITH_EDGE_PROPERTY -boolis_edge_property_local_complete(constGraph,constEdge); - -PartitionListedge_data_complete_partitions(constGraph,constEdge); -#endif - -#endif - -#endif//GRIN_INCLUDE_PARTITION_PARTITION_H_ - - - - diff --git a/grin/docs/_build/doxygen/xml/predefine_8h.xml b/grin/docs/_build/doxygen/xml/predefine_8h.xml deleted file mode 100644 index ec44bee8b..000000000 --- a/grin/docs/_build/doxygen/xml/predefine_8h.xml +++ /dev/null @@ -1,1294 +0,0 @@ - - - - predefine.h - limits.h - stdbool.h - stddef.h - include/partition/partition.h - include/property/label.h - include/property/primarykey.h - include/property/property.h - include/property/propertylist.h - include/property/propertytable.h - include/property/type.h - include/topology/adjacentlist.h - include/topology/edgelist.h - include/topology/structure.h - include/topology/vertexlist.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TopologyMacros
    - Macros for basic graph topology features - - - WITH_VERTEX_ORIGINAL_ID - -There is original ID for a vertex. This facilitates queries starting from a specific vertex, since one can get the vertex handler directly using its original ID. - - - - - - - - - WITH_VERTEX_DATA - -There is data on vertex. E.g., the PageRank value of a vertex. - - - - - - - - - WITH_EDGE_DATA - -There is data on edge. E.g., the weight of an edge. - - - - - - - - - ENABLE_VERTEX_LIST - -Enable the vertex list structure. The vertex list related APIs follow the design principle of GRIN List. - - - - - - - - - ENABLE_VERTEX_LIST_ITERATOR - -Enable the vertex list iterator. The vertex list iterator related APIs follow the design principle of GRIN Iterator. - - - - - - - - - ENABLE_EDGE_LIST - -Enable the edge list structure. The edge list related APIs follow the design principle of GRIN List. - - - - - - - - - ENABLE_EDGE_LIST_ITERATOR - -Enable the edge list iterator. The edge list iterator related APIs follow the design principle of GRIN Iterator. - - - - - - - - - ENABLE_ADJACENT_LIST - -Enable the adjacent list structure. The adjacent list related APIs follow the design principle of GRIN List. - - - - - - - - - ENABLE_ADJACENT_LIST_ITERATOR - -Enable the adjacent list iterator. The adjacent list iterator related APIs follow the design principle of GRIN Iterator. - - - - - - - -
    - -
    PartitionMacros
    - Macros for partitioned graph features - - - ENABLE_GRAPH_PARTITION - -Enable partitioned graph. A partitioned graph usually contains several fragments (i.e., local graphs) that are distributedly stored in a cluster. In GRIN, Graph represents to a single fragment that can be locally accessed. - - - - - - - - - NATURAL_PARTITION_ID_TRAIT - -The storage provides natural number IDs for partitions. It follows the design principle of natural number ID trait in GRIN. - - - - - - - - - ENABLE_VERTEX_REF - -The storage provides reference of vertex that can be recognized in other partitions where the vertex also appears. - - - - - - - - - ENABLE_EDGE_REF - -The storage provides reference of edge that can be recognized in other partitions where the edge also appears. - - - - - - - -
    - -
    PropertyMacros
    - Macros for property graph features - - - WITH_PROPERTY_NAME - -There are property names for properties. The relationship between property name and properties is one-to-many, because properties bound to different vertex/edge types are distinguished even they may share the same property name. Please refer to the design principle of Property for details. - - - - - - - - - WITH_VERTEX_PROPERTY - -There are properties bound to vertices. When vertices are typed, vertex properties are bound to vertex types, according to the definition of vertex type. - - - - - - - - - WITH_VERTEX_PRIMARTY_KEYS - -There are primary keys for vertices. Vertex primary keys is a set of vertex properties whose values can distinguish vertices. When vertices are typed, each vertex type has its own primary keys which distinguishes the vertices of that type. - - -With primary keys, one can get the vertex from the graph or a certain type by providing the values of the primary keys. The macro is unset if WITH_VERTEX_PROPERTY is NOT defined, in which case, one can use WITH_VERTEX_ORIGINAL_ID when vertices have no properties. - - - - - - - NATURAL_VERTEX_TYPE_ID_TRAIT - -The storage provides natural number IDs for vertex types. It follows the design principle of natural ID trait in GRIN. - - - - - - - - - NATURAL_VERTEX_PROPERTY_ID_TRAIT - -The storage provides natural number IDs for properties bound to a certain vertex type. It follows the design principle of natural ID trait in GRIN. - - - - - - - - - WITH_EDGE_PROPERTY - - - - - - - - - - WITH_EDGE_PRIMARTY_KEYS - - - - - - - - - - NATURAL_EDGE_TYPE_ID_TRAIT - - - - - - - - - - NATURAL_EDGE_PROPERTY_ID_TRAIT - - - - - - - - - - WITH_LABEL - -There are labels assigned to vertices or edges. Labels are mainly used in filtering vertcies or edges. - - - - - - - - - COLUMN_STORE_TRAIT - -The storage uses column store for properties. This enables efficient property selections for vertices and edges. - - - - - - - -
    - -
    PredicateMacros
    - Macros for predicate features - - - ENABLE_PREDICATE - -Enable predicates on graph. - - - - - - - -
    - -
    NullValues
    - Macros for Null(invalid) values - - - NULL_TYPE - Undefined - -Null type (undefined data type) - - - - - - - - - NULL_GRAPH - NULL - -Null graph (invalid return value) - - - - - - - - - NULL_VERTEX - NULL - -Non-existing vertex (invalid return value) - - - - - - - - - NULL_EDGE - NULL - -Non-existing edge (invalid return value) - - - - - - - - - NULL_LIST - NULL - -Null list of any kind (invalid return value) - - - - - - - - - NULL_PARTITION - NULL - -Non-existing partition (invalid return value) - - - - - - - - - NULL_VERTEX_REF - NULL - -Null vertex reference (invalid return value) - - - - - - - - - NULL_EDGE_REF - NULL - -Null edge reference (invalid return value) - - - - - - - - - NULL_VERTEX_TYPE - NULL - -Non-existing vertex type (invalid return value) - - - - - - - - - NULL_EDGE_TYPE - NULL - -Non-existing edge type (invalid return value) - - - - - - - - - NULL_PROPERTY - NULL - -Non-existing property (invalid return value) - - - - - - - - - NULL_ROW - NULL - -Null row (invalid return value) - - - - - - - - - NULL_NATURAL_ID - UINT_MAX - -Null natural id of any kind (invalid return value) - - - - - - - -
    - - - - Direction - - IN - = 0 - -incoming - - - - - - OUT - = 1 - -outgoing - - - - - - BOTH - = 2 - -incoming & outgoing - - - - - -Enumerates the directions of edges with respect to a certain vertex. - - - - - - - - - - DataType - - Undefined - = 0 - -other unknown types - - - - - - Int32 - = 1 - -int - - - - - - UInt32 - = 2 - -unsigned int - - - - - - Int64 - = 3 - -long int - - - - - - UInt64 - = 4 - -unsigned long int - - - - - - Float - = 5 - -float - - - - - - Double - = 6 - -double - - - - - - String - = 7 - -string - - - - - - Date32 - = 8 - -short date - - - - - - Date64 - = 9 - -long date - - - - - -Enumerates the datatype supported in the storage. - - - - - - - - - - - void * - typedef void* Graph - - Graph - - - - - - - - - - void * - typedef void* Vertex - - Vertex - - - - - - - - - - void * - typedef void* Edge - - Edge - - - - - - - - - - void * - typedef void* OriginalID - - OriginalID - - - - - - - - - - void * - typedef void* VertexList - - VertexList - - - - - - - - - - void * - typedef void* AdjacentList - - AdjacentList - - - - - - - - - - void * - typedef void* PartitionedGraph - - PartitionedGraph - - - - - - - - - - void * - typedef void* Partition - - Partition - - - - - - - - - - void * - typedef void* PartitionList - - PartitionList - - - - - - - - - - unsigned - typedef unsigned PartitionID - - PartitionID - - - - - - - - - - void * - typedef void* VertexRef - - VertexRef - - - - - - - - - - void * - typedef void* VertexType - - VertexType - - - - - - - - - - void * - typedef void* VertexTypeList - - VertexTypeList - - - - - - - - - - void * - typedef void* VertexProperty - - VertexProperty - - - - - - - - - - void * - typedef void* VertexPropertyList - - VertexPropertyList - - - - - - - - - - void * - typedef void* VertexPropertyTable - - VertexPropertyTable - - - - - - - - - - unsigned - typedef unsigned VertexTypeID - - VertexTypeID - - - - - - - - - - unsigned - typedef unsigned VertexPropertyID - - VertexPropertyID - - - - - - - - - - void * - typedef void* EdgeType - - EdgeType - - - - - - - - - - void * - typedef void* EdgeTypeList - - EdgeTypeList - - - - - - - - - - void * - typedef void* EdgeProperty - - EdgeProperty - - - - - - - - - - void * - typedef void* EdgePropertyList - - EdgePropertyList - - - - - - - - - - void * - typedef void* EdgePropertyTable - - EdgePropertyTable - - - - - - - - - - unsigned - typedef unsigned EdgeTypeID - - EdgeTypeID - - - - - - - - - - unsigned - typedef unsigned EdgePropertyID - - EdgePropertyID - - - - - - - - - - void * - typedef void* Row - - Row - - - - - - - - - - -Pre-defined macros for storage features. Undefine the macros of features that the storage does NOT support, so that APIs under unsupported features will NOT be available to the callers to avoid ambiguity. - - -Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - -#ifndefGRIN_INCLUDE_PREDEFINE_H_ -#defineGRIN_INCLUDE_PREDEFINE_H_ - -#include<limits.h> -#include<stdbool.h> -#include<stddef.h> - - -typedefenum{ -IN=0, -OUT=1, -BOTH=2, -}Direction; - -typedefenum{ -Undefined=0, -Int32=1, -UInt32=2, -Int64=3, -UInt64=4, -Float=5, -Double=6, -String=7, -Date32=8, -Date64=9, -}DataType; - - -#defineWITH_VERTEX_ORIGINAL_ID - -#defineWITH_VERTEX_DATA - -#defineWITH_EDGE_DATA - -#defineENABLE_VERTEX_LIST - -#defineENABLE_VERTEX_LIST_ITERATOR - -#defineENABLE_EDGE_LIST - -#defineENABLE_EDGE_LIST_ITERATOR - -#defineENABLE_ADJACENT_LIST - -#defineENABLE_ADJACENT_LIST_ITERATOR - -#undefWITH_VERTEX_DATA -#undefWITH_EDGE_DATA -#undefENABLE_VERTEX_LIST_ITERATOR -#undefENABLE_EDGE_LIST -#undefENABLE_EDGE_LIST_ITERATOR -#undefENABLE_ADJACENT_LIST_ITERATOR - - - -#defineENABLE_GRAPH_PARTITION - -#defineNATURAL_PARTITION_ID_TRAIT - -#defineENABLE_VERTEX_REF - -#defineENABLE_EDGE_REF - -#ifndefENABLE_GRAPH_PARTITION -#undefNATURAL_PARTITION_ID_TRAIT -#endif - -#undefENABLE_EDGE_REF - - - -#defineWITH_PROPERTY_NAME - -#defineWITH_VERTEX_PROPERTY - -#defineWITH_VERTEX_PRIMARTY_KEYS - -#defineNATURAL_VERTEX_TYPE_ID_TRAIT - -#defineNATURAL_VERTEX_PROPERTY_ID_TRAIT - - -#defineWITH_EDGE_PROPERTY//Thereisanypropertyforedges. -#defineWITH_EDGE_PRIMARTY_KEYS//Thereiscross-typepropertyname. -#defineNATURAL_EDGE_TYPE_ID_TRAIT//Edgetypehasnaturalcontinuousidfrom0. -#defineNATURAL_EDGE_PROPERTY_ID_TRAIT//Edgepropertyhasnaturalcontinuousidfrom0. - -#defineWITH_LABEL - -#defineCOLUMN_STORE_TRAIT - -#if!defined(WITH_VERTEX_PROPERTY)&&!defined(WITH_EDGE_PROPERTY) -#undefWITH_PROPERTY_NAME -#endif - -#ifndefWITH_VERTEX_PROPERTY -#undefWITH_VERTEX_PRIMARTY_KEYS -#undefNATURAL_VERTEX_TYPE_ID_TRAIT -#undefNATURAL_VERTEX_PROPERTY_ID_TRAIT -#endif - -#ifndefWITH_EDGE_PROPERTY -#undefWITH_EDGE_PRIMARTY_KEYS -#undefNATURAL_EDGE_TYPE_ID_TRAIT -#undefNATURAL_EDGE_PROPERTY_ID_TRAIT -#endif - -#undefWITH_VERTEX_PRIMARTY_KEYS - -#undefWITH_LABEL - - -#defineENABLE_PREDICATE -#undefENABLE_PREDICATE - - -#defineNULL_TYPEUndefined -#defineNULL_GRAPHNULL -#defineNULL_VERTEXNULL -#defineNULL_EDGENULL -#defineNULL_LISTNULL -#defineNULL_PARTITIONNULL -#defineNULL_VERTEX_REFNULL -#defineNULL_EDGE_REFNULL -#defineNULL_VERTEX_TYPENULL -#defineNULL_EDGE_TYPENULL -#defineNULL_PROPERTYNULL -#defineNULL_ROWNULL -#defineNULL_NATURAL_IDUINT_MAX - - -/*Definethehandlersusingtypedef*/ -typedefvoid*Graph; -typedefvoid*Vertex; -typedefvoid*Edge; - -#ifdefWITH_VERTEX_ORIGINAL_ID -typedefvoid*OriginalID; -#endif - -#ifdefWITH_VERTEX_DATA -typedefvoid*VertexData; -#endif - -#ifdefENABLE_VERTEX_LIST -typedefvoid*VertexList; -#endif - -#ifdefENABLE_VERTEX_LIST_ITERATOR -typedefvoid*VertexListIterator; -#endif - -#ifdefENABLE_ADJACENT_LIST -typedefvoid*AdjacentList; -#endif - -#ifdefENABLE_ADJACENT_LIST_ITERATOR -typedefvoid*AdjacentListIterator; -#endif - -#ifdefWITH_EDGE_DATA -typedefvoid*EdgeData; -#endif - -#ifdefENABLE_EDGE_LIST -typedefvoid*EdgeList; -#endif - -#ifdefENABLE_EDGE_LIST_ITERATOR -typedefvoid*EdgeListIterator; -#endif - -#ifdefENABLE_GRAPH_PARTITION -typedefvoid*PartitionedGraph; -typedefvoid*Partition; -typedefvoid*PartitionList; -#endif - -#ifdefNATURAL_PARTITION_ID_TRAIT -typedefunsignedPartitionID; -#endif - -#ifdefENABLE_VERTEX_REF -typedefvoid*VertexRef; -#endif - -#ifdefENABLE_EDGE_REF -typedefvoid*EdgeRef; -#endif - - -#ifdefWITH_VERTEX_PROPERTY -typedefvoid*VertexType; -typedefvoid*VertexTypeList; -typedefvoid*VertexProperty; -typedefvoid*VertexPropertyList; -typedefvoid*VertexPropertyTable; -#endif - -#ifdefNATURAL_VERTEX_TYPE_ID_TRAIT -typedefunsignedVertexTypeID; -#endif - -#ifdefNATURAL_VERTEX_PROPERTY_ID_TRAIT -typedefunsignedVertexPropertyID; -#endif - -#ifdefWITH_EDGE_PROPERTY -typedefvoid*EdgeType; -typedefvoid*EdgeTypeList; -typedefvoid*EdgeProperty; -typedefvoid*EdgePropertyList; -typedefvoid*EdgePropertyTable; -#endif - -#ifdefNATURAL_EDGE_TYPE_ID_TRAIT -typedefunsignedEdgeTypeID; -#endif - -#ifdefNATURAL_EDGE_PROPERTY_ID_TRAIT -typedefunsignedEdgePropertyID; -#endif - -#ifdefined(WITH_VERTEX_PROPERTY)||defined(WITH_EDGE_PROPERTY) -typedefvoid*Row; -#endif - -#ifdefWITH_LABEL -typedefvoid*Label -typedefvoid*LabelList -#endif - -#endif//GRIN_INCLUDE_PREDEFINE_H_ - - -
    -
    diff --git a/grin/docs/_build/doxygen/xml/primarykey_8h.xml b/grin/docs/_build/doxygen/xml/primarykey_8h.xml deleted file mode 100644 index e2258ad7e..000000000 --- a/grin/docs/_build/doxygen/xml/primarykey_8h.xml +++ /dev/null @@ -1,180 +0,0 @@ - - - - primarykey.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VertexTypeList - VertexTypeList get_vertex_types_with_primary_keys - (const Graph) - get_vertex_types_with_primary_keys - - const - Graph - - -get the vertex types with primary keys - - - - -Graph - - -the graph - - - - - - - - - - - VertexPropertyList - VertexPropertyList get_primary_keys_by_vertex_type - (const Graph, const VertexType) - get_primary_keys_by_vertex_type - - const - Graph - - - const - VertexType - - -get the primary keys (property list) of a specific vertex type - - - - -Graph - - -the graph - - - - -VertexType - - -the vertex type - - - - - - - - - - - Vertex - Vertex get_vertex_by_primay_keys - (const Graph, const VertexPropertyList, const Row) - get_vertex_by_primay_keys - - const - Graph - - - const - VertexPropertyList - - - const - Row - - -get the vertex with the given primary keys - - - - -Graph - - -the graph - - - - -VertexPropertyList - - -the primary keys - - - - -Row - - -the values of primary keys - - - - - - - - - - - -Define the primary key related APIs. - - -Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - -#ifndefGRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ -#defineGRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ - -#include"../predefine.h" - -#ifdefWITH_VERTEX_PRIMARY_KEYS -VertexTypeListget_vertex_types_with_primary_keys(constGraph); - -VertexPropertyListget_primary_keys_by_vertex_type(constGraph,constVertexType); - -Vertexget_vertex_by_primay_keys(constGraph,constVertexPropertyList,constRow); -#endif - -#endif//GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ - - - - diff --git a/grin/docs/_build/doxygen/xml/property_8h.xml b/grin/docs/_build/doxygen/xml/property_8h.xml deleted file mode 100644 index 8fa3cab97..000000000 --- a/grin/docs/_build/doxygen/xml/property_8h.xml +++ /dev/null @@ -1,382 +0,0 @@ - - - - property.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - char * - char * get_vertex_property_name - (const Graph, const VertexProperty) - get_vertex_property_name - - const - Graph - - - const - VertexProperty - - - - - - - - - - - VertexProperty - VertexProperty get_vertex_property_by_name - (const Graph, const VertexType, const char *msg) - get_vertex_property_by_name - - const - Graph - - - const - VertexType - - - const char * - msg - - -get the vertex property with a given name under a specific vertex type - - - - -Graph - - -the graph - - - - -VertexType - - -the specific vertex type - - - - -msg - - -the name - - - - - - - - - - - VertexPropertyList - VertexPropertyList get_vertex_properties_by_name - (const Graph, const char *) - get_vertex_properties_by_name - - const - Graph - - - const char * - - -get all the vertex properties with a given name - - - - -Graph - - -the graph - - - - -msg - - -the name - - - - - - - - - - - char * - char * get_edge_property_name - (const Graph, const EdgeProperty) - get_edge_property_name - - const - Graph - - - const - EdgeProperty - - - - - - - - - - - EdgeProperty - EdgeProperty get_edge_property_by_name - (const Graph, const EdgeType, const char *msg) - get_edge_property_by_name - - const - Graph - - - const - EdgeType - - - const char * - msg - - -get the edge property with a given name under a specific edge type - - - - -Graph - - -the graph - - - - -EdgeType - - -the specific edge type - - - - -msg - - -the name - - - - - - - - - - - EdgePropertyList - EdgePropertyList get_edge_properties_by_name - (const Graph, const char *) - get_edge_properties_by_name - - const - Graph - - - const char * - - -get all the edge properties with a given name - - - - -Graph - - -the graph - - - - -msg - - -the name - - - - - - - - - - - void - void destroy_vertex_property - (VertexProperty) - destroy_vertex_property - - VertexProperty - - -destroy vertex property - - - - -VertexProperty - - -vertex property - - - - - - - - - - - DataType - DataType get_vertex_property_data_type - (VertexProperty) - get_vertex_property_data_type - - VertexProperty - - -get property data type - - - - -VertexProperty - - -vertex property - - - - - - - - - - - VertexType - VertexType get_vertex_property_vertex_type - (VertexProperty) - get_vertex_property_vertex_type - - VertexProperty - - -get the vertex type that the property is bound to - - - - -VertexProperty - - -vertex property - - - - - - - - - - - -Define the property related APIs. - - -Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - -#ifndefGRIN_INCLUDE_PROPERTY_PROPERTY_H_ -#defineGRIN_INCLUDE_PROPERTY_PROPERTY_H_ - -#include"../predefine.h" - -#ifdefWITH_PROPERTY_NAME -char*get_vertex_property_name(constGraph,constVertexProperty); - -VertexPropertyget_vertex_property_by_name(constGraph,constVertexType,constchar*msg); - -VertexPropertyListget_vertex_properties_by_name(constGraph,constchar*); - -char*get_edge_property_name(constGraph,constEdgeProperty); - -EdgePropertyget_edge_property_by_name(constGraph,constEdgeType,constchar*msg); - -EdgePropertyListget_edge_properties_by_name(constGraph,constchar*); -#endif - - -#ifdefWITH_VERTEX_PROPERTY -voiddestroy_vertex_property(VertexProperty); - -DataTypeget_vertex_property_data_type(VertexProperty); - -VertexTypeget_vertex_property_vertex_type(VertexProperty); -#endif - - - -#endif//GRIN_INCLUDE_PROPERTY_PROPERTY_H_ - - - - diff --git a/grin/docs/_build/doxygen/xml/propertylist_8h.xml b/grin/docs/_build/doxygen/xml/propertylist_8h.xml deleted file mode 100644 index 2ebbe626a..000000000 --- a/grin/docs/_build/doxygen/xml/propertylist_8h.xml +++ /dev/null @@ -1,453 +0,0 @@ - - - - propertylist.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    GraphProjection
    - Graph projection mainly works to shrink the properties into a subset in need to improve the retrieval efficiency. Note that only the vertex/edge type with at least one property left in the vertex/edge property list will be kept after the projection. -The projection only works on column store systems. - - - Graph - Graph select_vertex_properties - (const Graph, const VertexPropertyList) - select_vertex_properties - - const - Graph - - - const - VertexPropertyList - - -project vertex properties - - - - - - - - - Graph - Graph select_edge_properteis - (const Graph, const EdgePropertyList) - select_edge_properteis - - const - Graph - - - const - EdgePropertyList - - -project edge properties - - - - - - - -
    - - - VertexPropertyList - VertexPropertyList get_vertex_property_list_by_type - (const Graph, const VertexType) - get_vertex_property_list_by_type - - const - Graph - - - const - VertexType - - - - - - - - - - - size_t - size_t get_vertex_property_list_size - (const VertexPropertyList) - get_vertex_property_list_size - - const - VertexPropertyList - - - - - - - - - - - VertexProperty - VertexProperty get_vertex_property_from_list - (const VertexPropertyList, const size_t) - get_vertex_property_from_list - - const - VertexPropertyList - - - const - size_t - - - - - - - - - - - VertexPropertyList - VertexPropertyList create_vertex_property_list - () - create_vertex_property_list - - - - - - - - - - void - void destroy_vertex_property_list - (VertexPropertyList) - destroy_vertex_property_list - - VertexPropertyList - - - - - - - - - - - bool - bool insert_vertex_property_to_list - (VertexPropertyList, const VertexProperty) - insert_vertex_property_to_list - - VertexPropertyList - - - const - VertexProperty - - - - - - - - - - - VertexProperty - VertexProperty get_vertex_property_from_id - (const VertexType, const VertexPropertyID) - get_vertex_property_from_id - - const - VertexType - - - const - VertexPropertyID - - - - - - - - - - - VertexPropertyID - VertexPropertyID get_vertex_property_id - (const VertexType, const VertexProperty) - get_vertex_property_id - - const - VertexType - - - const - VertexProperty - - - - - - - - - - - EdgePropertyList - EdgePropertyList get_edge_property_list_by_type - (const Graph, const EdgeType) - get_edge_property_list_by_type - - const - Graph - - - const - EdgeType - - - - - - - - - - - size_t - size_t get_edge_property_list_size - (const EdgePropertyList) - get_edge_property_list_size - - const - EdgePropertyList - - - - - - - - - - - EdgeProperty - EdgeProperty get_edge_property_from_list - (const EdgePropertyList, const size_t) - get_edge_property_from_list - - const - EdgePropertyList - - - const - size_t - - - - - - - - - - - EdgePropertyList - EdgePropertyList create_edge_property_list - () - create_edge_property_list - - - - - - - - - - void - void destroy_edge_property_list - (EdgePropertyList) - destroy_edge_property_list - - EdgePropertyList - - - - - - - - - - - bool - bool insert_edge_property_to_list - (EdgePropertyList, const EdgeProperty) - insert_edge_property_to_list - - EdgePropertyList - - - const - EdgeProperty - - - - - - - - - - - EdgeProperty - EdgeProperty get_edge_property_from_id - (const EdgeType, const EdgePropertyID) - get_edge_property_from_id - - const - EdgeType - - - const - EdgePropertyID - - - - - - - - - - - EdgePropertyID - EdgePropertyID get_edge_property_id - (const EdgeType, const EdgeProperty) - get_edge_property_id - - const - EdgeType - - - const - EdgeProperty - - - - - - - - - - - -Define the property list related and graph projection APIs. - - -Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - -#ifndefGRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ -#defineGRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ - -#include"../predefine.h" - -//Propertylist -#ifdefWITH_VERTEX_PROPERTY -VertexPropertyListget_vertex_property_list_by_type(constGraph,constVertexType); - -size_tget_vertex_property_list_size(constVertexPropertyList); - -VertexPropertyget_vertex_property_from_list(constVertexPropertyList,constsize_t); - -VertexPropertyListcreate_vertex_property_list(); - -voiddestroy_vertex_property_list(VertexPropertyList); - -boolinsert_vertex_property_to_list(VertexPropertyList,constVertexProperty); -#endif - -#ifdefNATURAL_VERTEX_PROPERTY_ID_TRAIT -VertexPropertyget_vertex_property_from_id(constVertexType,constVertexPropertyID); - -VertexPropertyIDget_vertex_property_id(constVertexType,constVertexProperty); -#endif - - -#ifdefWITH_EDGE_PROPERTY -EdgePropertyListget_edge_property_list_by_type(constGraph,constEdgeType); - -size_tget_edge_property_list_size(constEdgePropertyList); - -EdgePropertyget_edge_property_from_list(constEdgePropertyList,constsize_t); - -EdgePropertyListcreate_edge_property_list(); - -voiddestroy_edge_property_list(EdgePropertyList); - -boolinsert_edge_property_to_list(EdgePropertyList,constEdgeProperty); -#endif - -#ifdefNATURAL_EDGE_PROPERTY_ID_TRAIT -EdgePropertyget_edge_property_from_id(constEdgeType,constEdgePropertyID); - -EdgePropertyIDget_edge_property_id(constEdgeType,constEdgeProperty); -#endif - - -#ifdefined(WITH_VERTEX_PROPERTY)&&defined(COLUMN_STORE_TRAIT) -Graphselect_vertex_properties(constGraph,constVertexPropertyList); -#endif - -#ifdefined(WITH_EDGE_PROPERTY)&&defined(COLUMN_STORE_TRAIT) -Graphselect_edge_properteis(constGraph,constEdgePropertyList); -#endif - -#endif//GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ - - -
    -
    diff --git a/grin/docs/_build/doxygen/xml/propertytable_8h.xml b/grin/docs/_build/doxygen/xml/propertytable_8h.xml deleted file mode 100644 index 2cc4ad73c..000000000 --- a/grin/docs/_build/doxygen/xml/propertytable_8h.xml +++ /dev/null @@ -1,326 +0,0 @@ - - - - propertytable.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Row
    - Row works as the pure value array for the properties of a vertex or an edge. In general, you can think of Row as an array of void*, where each void* points to the value of a property. GRIN assumes the user already knows the corresponding property list beforehead, so that she/he knows how to cast the void* into the property's data type. - - - void - void destroy_row - (Row) - destroy_row - - Row - - - - - - - - - - - void * - void * get_value_from_row - (Row, const size_t) - get_value_from_row - - Row - - - const - size_t - - -the value of a property from row by its position in row - - - - - - - - - Row - Row create_row - () - create_row - -create a row, usually to get vertex/edge by primary keys - - - - - - - - - bool - bool insert_value_to_row - (Row, const void *) - insert_value_to_row - - Row - - - const void * - - -insert a value to the end of the row - - - - - - - -
    - - - void - void destroy_vertex_property_table - (VertexPropertyTable) - destroy_vertex_property_table - - VertexPropertyTable - - -destroy vertex property table - - - - -VertexPropertyTable - - -vertex property table - - - - - - - - - - - VertexPropertyTable - VertexPropertyTable get_vertex_property_table_by_type - (const Graph, const VertexType) - get_vertex_property_table_by_type - - const - Graph - - - const - VertexType - - -get the vertex property table of a certain vertex type No matter column or row store strategy is used in the storage, GRIN recommends to first get the property table of the vertex type, and then fetch values(rows) by vertex and property(list). However, GRIN does provide direct row fetching API when COLUMN_STORE_TRAIT is NOT set. - - - - -Graph - - -the graph - - - - -VertexType - - -the vertex type - - - - - - - - - - - void * - void * get_value_from_vertex_property_table - (const VertexPropertyTable, const Vertex, const VertexProperty) - get_value_from_vertex_property_table - - const - VertexPropertyTable - - - const - Vertex - - - const - VertexProperty - - -get vertex property value from table - - - - -VertexPropertyTable - - -vertex property table - - - - -Vertex - - -the vertex which is the row index - - - - -VertexProperty - - -the vertex property which is the column index - - - -can be casted to the property data type by the caller - - - - - - - - - Row - Row get_row_from_vertex_property_table - (const VertexPropertyTable, const Vertex, const VertexPropertyList) - get_row_from_vertex_property_table - - const - VertexPropertyTable - - - const - Vertex - - - const - VertexPropertyList - - -get vertex row from table - - - - -VertexPropertyTable - - -vertex property table - - - - -Vertex - - -the vertex which is the row index - - - - -VertexPropertyList - - -the vertex property list as columns - - - - - - - - - - - -Define the property table related APIs. - - -Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - -#ifndefGRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ -#defineGRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ - -#include"../predefine.h" - -#ifdefined(WITH_VERTEX_PROPERTY)||defined(WITH_EDGE_PROPERTY) -voiddestroy_row(Row); - -void*get_value_from_row(Row,constsize_t); - -Rowcreate_row(); - -boolinsert_value_to_row(Row,constvoid*); -#endif - -#ifdefWITH_VERTEX_PROPERTY -voiddestroy_vertex_property_table(VertexPropertyTable); - -VertexPropertyTableget_vertex_property_table_by_type(constGraph,constVertexType); - -void*get_value_from_vertex_property_table(constVertexPropertyTable,constVertex,constVertexProperty); - -Rowget_row_from_vertex_property_table(constVertexPropertyTable,constVertex,constVertexPropertyList); - -#ifndefCOLUMN_STORE_TRAIT -Rowget_vertex_row(constGraph,constVertex,constVertexPropertyList); -#endif -#endif - - -#endif//GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ - - -
    -
    diff --git a/grin/docs/_build/doxygen/xml/structure_8h.xml b/grin/docs/_build/doxygen/xml/structure_8h.xml deleted file mode 100644 index 72f8fac85..000000000 --- a/grin/docs/_build/doxygen/xml/structure_8h.xml +++ /dev/null @@ -1,435 +0,0 @@ - - - - structure.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool - bool is_directed - (const Graph) - is_directed - - const - Graph - - - - -Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - - - - - bool - bool is_multigraph - (const Graph) - is_multigraph - - const - Graph - - - - - - - - - - - size_t - size_t get_vertex_num - (const Graph) - get_vertex_num - - const - Graph - - - - - - - - - - - size_t - size_t get_vertex_num_by_type - (const Graph, const VertexType) - get_vertex_num_by_type - - const - Graph - - - const - VertexType - - - - - - - - - - - size_t - size_t get_edge_num - (const Graph) - get_edge_num - - const - Graph - - - - - - - - - - - size_t - size_t get_edge_num_by_type - (const Graph, const EdgeType) - get_edge_num_by_type - - const - Graph - - - const - EdgeType - - - - - - - - - - - void - void destroy_vertex - (Vertex) - destroy_vertex - - Vertex - - - - - - - - - - - DataType - DataType get_vertex_data_type - (const Graph, const Vertex) - get_vertex_data_type - - const - Graph - - - const - Vertex - - - - - - - - - - - VertexData - VertexData get_vertex_data_value - (const Graph, const Vertex) - get_vertex_data_value - - const - Graph - - - const - Vertex - - - - - - - - - - - void - void destroy_vertex_data - (VertexData) - destroy_vertex_data - - VertexData - - - - - - - - - - - Vertex - Vertex get_vertex_from_original_id - (const Graph, const OriginalID) - get_vertex_from_original_id - - const - Graph - - - const - OriginalID - - - - - - - - - - - Vertex - Vertex get_vertex_from_type_original_id - (const Graph, const VertexType, const OriginalID) - get_vertex_from_type_original_id - - const - Graph - - - const - VertexType - - - const - OriginalID - - - - - - - - - - - OriginalID - OriginalID get_vertex_original_id - (const Graph, const Vertex) - get_vertex_original_id - - const - Graph - - - const - Vertex - - - - - - - - - - - void - void destroy_vertex_original_id - (OriginalID) - destroy_vertex_original_id - - OriginalID - - - - - - - - - - - void - void destroy_edge - (Edge) - destroy_edge - - Edge - - - - - - - - - - - Vertex - Vertex get_edge_src - (const Graph, const Edge) - get_edge_src - - const - Graph - - - const - Edge - - - - - - - - - - - Vertex - Vertex get_edge_dst - (const Graph, const Edge) - get_edge_dst - - const - Graph - - - const - Edge - - - - - - - - - - - - - - - - -#ifndefGRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ -#defineGRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ - -#include"../predefine.h" - -//Graph -boolis_directed(constGraph); - -boolis_multigraph(constGraph); - -size_tget_vertex_num(constGraph); - -#ifdefWITH_VERTEX_PROPERTY -size_tget_vertex_num_by_type(constGraph,constVertexType); -#endif - -size_tget_edge_num(constGraph); - -#ifdefWITH_EDGE_PROPERTY -size_tget_edge_num_by_type(constGraph,constEdgeType); -#endif - - -//Vertex -voiddestroy_vertex(Vertex); - -#ifdefWITH_VERTEX_DATA -DataTypeget_vertex_data_type(constGraph,constVertex); - -VertexDataget_vertex_data_value(constGraph,constVertex); - -voiddestroy_vertex_data(VertexData); -#endif - -#ifdefWITH_VERTEX_ORIGINAL_ID -Vertexget_vertex_from_original_id(constGraph,constOriginalID); - -#ifdefWITH_VERTEX_PROPERTY -Vertexget_vertex_from_type_original_id(constGraph,constVertexType,constOriginalID); -#endif - -OriginalIDget_vertex_original_id(constGraph,constVertex); - -voiddestroy_vertex_original_id(OriginalID); -#endif - - -//Edge -voiddestroy_edge(Edge); - -Vertexget_edge_src(constGraph,constEdge); - -Vertexget_edge_dst(constGraph,constEdge); - -#ifdefWITH_EDGE_DATA -DataTypeget_edge_data_type(constGraph,constEdge); - -EdgeDataget_edge_data_value(constGraph,constEdge); - -voiddestroy_edge_data(EdgeData); -#endif - -#endif//GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ - - - - diff --git a/grin/docs/_build/doxygen/xml/type_8h.xml b/grin/docs/_build/doxygen/xml/type_8h.xml deleted file mode 100644 index 311abddce..000000000 --- a/grin/docs/_build/doxygen/xml/type_8h.xml +++ /dev/null @@ -1,593 +0,0 @@ - - - - type.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    VertexEdgeTypeRelation
    - GRIN assumes the relation between edge type and pairs of vertex types is many-to-many. Thus GRIN returns the pairs of vertex types related to an edge type as a pair of vertex type lists of the same size, and the src/dst vertex types are aligned with their positions in the lists. - - - VertexTypeList - VertexTypeList get_src_types_from_edge_type - (const Graph, const EdgeType) - get_src_types_from_edge_type - - const - Graph - - - const - EdgeType - - -the src vertex type list - - - - - - - - - VertexTypeList - VertexTypeList get_dst_types_from_edge_type - (const Graph, const EdgeType) - get_dst_types_from_edge_type - - const - Graph - - - const - EdgeType - - -get the dst vertex type list - - - - - - - - - EdgeTypeList - EdgeTypeList get_edge_types_from_vertex_type_pair - (const Graph, const VertexType, const VertexType) - get_edge_types_from_vertex_type_pair - - const - Graph - - - const - VertexType - - - const - VertexType - - -get the edge type list related to a given pair of vertex types - - - - - - - -
    - - - VertexType - VertexType get_vertex_type - (const Graph, const Vertex) - get_vertex_type - - const - Graph - - - const - Vertex - - - - - - - - - - - char * - char * get_vertex_type_name - (const Graph, const VertexType) - get_vertex_type_name - - const - Graph - - - const - VertexType - - - - - - - - - - - VertexType - VertexType get_vertex_type_by_name - (const Graph, char *) - get_vertex_type_by_name - - const - Graph - - - char * - - - - - - - - - - - VertexTypeList - VertexTypeList get_vertex_type_list - (const Graph) - get_vertex_type_list - - const - Graph - - - - - - - - - - - void - void destroy_vertex_type_list - (VertexTypeList) - destroy_vertex_type_list - - VertexTypeList - - - - - - - - - - - VertexTypeList - VertexTypeList create_vertex_type_list - () - create_vertex_type_list - - - - - - - - - - bool - bool insert_vertex_type_to_list - (VertexTypeList, const VertexType) - insert_vertex_type_to_list - - VertexTypeList - - - const - VertexType - - - - - - - - - - - size_t - size_t get_vertex_type_list_size - (const VertexTypeList) - get_vertex_type_list_size - - const - VertexTypeList - - - - - - - - - - - VertexType - VertexType get_vertex_type_from_list - (const VertexTypeList, const size_t) - get_vertex_type_from_list - - const - VertexTypeList - - - const - size_t - - - - - - - - - - - VertexTypeID - VertexTypeID get_vertex_type_id - (const VertexType) - get_vertex_type_id - - const - VertexType - - - - - - - - - - - VertexType - VertexType get_vertex_type_from_id - (const VertexTypeID) - get_vertex_type_from_id - - const - VertexTypeID - - - - - - - - - - - EdgeType - EdgeType get_edge_type - (const Graph, const Edge) - get_edge_type - - const - Graph - - - const - Edge - - - - - - - - - - - char * - char * get_edge_type_name - (const Graph, const EdgeType) - get_edge_type_name - - const - Graph - - - const - EdgeType - - - - - - - - - - - EdgeType - EdgeType get_edge_type_by_name - (const Graph, char *) - get_edge_type_by_name - - const - Graph - - - char * - - - - - - - - - - - EdgeTypeList - EdgeTypeList get_edge_type_list - (const Graph) - get_edge_type_list - - const - Graph - - - - - - - - - - - void - void destroy_edge_type_list - (EdgeTypeList) - destroy_edge_type_list - - EdgeTypeList - - - - - - - - - - - EdgeTypeList - EdgeTypeList create_edge_type_list - () - create_edge_type_list - - - - - - - - - - bool - bool insert_edge_type_to_list - (EdgeTypeList, const EdgeType) - insert_edge_type_to_list - - EdgeTypeList - - - const - EdgeType - - - - - - - - - - - size_t - size_t get_edge_type_list_size - (const EdgeTypeList) - get_edge_type_list_size - - const - EdgeTypeList - - - - - - - - - - - EdgeType - EdgeType get_edge_type_from_list - (const EdgeTypeList, const size_t) - get_edge_type_from_list - - const - EdgeTypeList - - - const - size_t - - - - - - - - - - - EdgeTypeID - EdgeTypeID get_edge_type_id - (const EdgeType) - get_edge_type_id - - const - EdgeType - - - - - - - - - - - EdgeType - EdgeType get_edge_type_from_id - (const EdgeTypeID) - get_edge_type_from_id - - const - EdgeTypeID - - - - - - - - - - - -Define the vertex/edge type related APIs. - - -Copyright 2020 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - -#ifndefGRIN_INCLUDE_PROPERTY_TYPE_H_ -#defineGRIN_INCLUDE_PROPERTY_TYPE_H_ - -#include"../predefine.h" - -#ifdefWITH_VERTEX_PROPERTY -//Vertextype -VertexTypeget_vertex_type(constGraph,constVertex); - -char*get_vertex_type_name(constGraph,constVertexType); - -VertexTypeget_vertex_type_by_name(constGraph,char*); - -//Vertextypelist -VertexTypeListget_vertex_type_list(constGraph); - -voiddestroy_vertex_type_list(VertexTypeList); - -VertexTypeListcreate_vertex_type_list(); - -boolinsert_vertex_type_to_list(VertexTypeList,constVertexType); - -size_tget_vertex_type_list_size(constVertexTypeList); - -VertexTypeget_vertex_type_from_list(constVertexTypeList,constsize_t); -#endif - - -#ifdefNATURAL_VERTEX_TYPE_ID_TRAIT -VertexTypeIDget_vertex_type_id(constVertexType); - -VertexTypeget_vertex_type_from_id(constVertexTypeID); -#endif - - -#ifdefWITH_EDGE_PROPERTY -//Edgetype -EdgeTypeget_edge_type(constGraph,constEdge); - -char*get_edge_type_name(constGraph,constEdgeType); - -EdgeTypeget_edge_type_by_name(constGraph,char*); - -//Edgetypelist -EdgeTypeListget_edge_type_list(constGraph); - -voiddestroy_edge_type_list(EdgeTypeList); - -EdgeTypeListcreate_edge_type_list(); - -boolinsert_edge_type_to_list(EdgeTypeList,constEdgeType); - -size_tget_edge_type_list_size(constEdgeTypeList); - -EdgeTypeget_edge_type_from_list(constEdgeTypeList,constsize_t); -#endif - -#ifdefNATURAL_EDGE_TYPE_ID_TRAIT -EdgeTypeIDget_edge_type_id(constEdgeType); - -EdgeTypeget_edge_type_from_id(constEdgeTypeID); -#endif - -#ifdefined(WITH_VERTEX_PROPERTY)&&defined(WITH_EDGE_PROPERTY) -VertexTypeListget_src_types_from_edge_type(constGraph,constEdgeType); - -VertexTypeListget_dst_types_from_edge_type(constGraph,constEdgeType); - -EdgeTypeListget_edge_types_from_vertex_type_pair(constGraph,constVertexType,constVertexType); -#endif - -#endif//GRIN_INCLUDE_PROPERTY_TYPE_H_ - - -
    -
    diff --git a/grin/docs/_build/doxygen/xml/vertexlist_8h.xml b/grin/docs/_build/doxygen/xml/vertexlist_8h.xml deleted file mode 100644 index 5c6fe0cd5..000000000 --- a/grin/docs/_build/doxygen/xml/vertexlist_8h.xml +++ /dev/null @@ -1,281 +0,0 @@ - - - - vertexlist.h - ../predefine.h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VertexList - VertexList get_vertex_list - (const Graph) - get_vertex_list - - const - Graph - - - - -Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - - - - - - - VertexList - VertexList get_vertex_list_by_type - (const Graph, const VertexType) - get_vertex_list_by_type - - const - Graph - - - const - VertexType - - - - - - - - - - - void - void destroy_vertex_list - (VertexList) - destroy_vertex_list - - VertexList - - - - - - - - - - - VertexList - VertexList create_vertex_list - () - create_vertex_list - - - - - - - - - - bool - bool insert_vertex_to_list - (VertexList, const Vertex) - insert_vertex_to_list - - VertexList - - - const - Vertex - - - - - - - - - - - size_t - size_t get_vertex_list_size - (const VertexList) - get_vertex_list_size - - const - VertexList - - - - - - - - - - - Vertex - Vertex get_vertex_from_list - (const VertexList, const size_t) - get_vertex_from_list - - const - VertexList - - - const - size_t - - - - - - - - - - - VertexListIterator - VertexListIterator get_vertex_list_begin - (const Graph) - get_vertex_list_begin - - const - Graph - - - - - - - - - - - VertexListIterator - VertexListIterator get_vertex_list_begin_by_type - (const Graph, const VertexType) - get_vertex_list_begin_by_type - - const - Graph - - - const - VertexType - - - - - - - - - - - bool - bool get_next_vertex_list_iter - (VertexListIterator) - get_next_vertex_list_iter - - VertexListIterator - - - - - - - - - - - Vertex - Vertex get_vertex_from_iter - (VertexListIterator) - get_vertex_from_iter - - VertexListIterator - - - - - - - - - - - - - - - - -#ifndefGRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ -#defineGRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ - -#include"../predefine.h" - -#ifdefENABLE_VERTEX_LIST - -VertexListget_vertex_list(constGraph); - -#ifdefWITH_VERTEX_PROPERTY -VertexListget_vertex_list_by_type(constGraph,constVertexType); -#endif - -voiddestroy_vertex_list(VertexList); - -VertexListcreate_vertex_list(); - -boolinsert_vertex_to_list(VertexList,constVertex); - -size_tget_vertex_list_size(constVertexList); - -Vertexget_vertex_from_list(constVertexList,constsize_t); - -#ifdefENABLE_VERTEX_LIST_ITERATOR -VertexListIteratorget_vertex_list_begin(constGraph); - -#ifdefWITH_VERTEX_PROPERTY -VertexListIteratorget_vertex_list_begin_by_type(constGraph,constVertexType); -#endif - -boolget_next_vertex_list_iter(VertexListIterator); - -Vertexget_vertex_from_iter(VertexListIterator); -#endif - - -#endif - -#endif//GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ - - - - diff --git a/grin/docs/_build/doxygen/xml/xml.xsd b/grin/docs/_build/doxygen/xml/xml.xsd deleted file mode 100644 index 9f80fe158..000000000 --- a/grin/docs/_build/doxygen/xml/xml.xsd +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/grin/src/partition/partition.cc b/grin/src/partition/partition.cc index c1203591f..b6e7674c9 100644 --- a/grin/src/partition/partition.cc +++ b/grin/src/partition/partition.cc @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "grin/src/predefine.h" -#include "grin/src/utils.h" -#include "grin/include/partition/partition.h" +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/src/utils.h" +#include "modules/graph/grin/include/partition/partition.h" #include "modules/graph/fragment/property_graph_types.h" #include "src/client/client.h" @@ -83,6 +83,7 @@ Graph get_local_graph_from_partition(const PartitionedGraph pg, const Partition client.Connect(); return get_graph_by_object_id(client, _pg->Fragments().at(*_p)); } +#endif #ifdef NATURAL_PARTITION_ID_TRAIT Partition get_partition_from_id(const PartitionID pid) { @@ -96,14 +97,13 @@ PartitionID get_partition_id(const Partition p) { } #endif -// master & mirror vertices for vertexcut partition -// while they refer to inner & outer vertices in edgecut partition + #if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST) VertexList get_master_vertices(const Graph g) { auto _g = static_cast(g); auto _vl = new VertexList_T(); - for (VertexLabel_T vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { - _vl->push_back(_g->InnerVertices(vlabel)); + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + _vl->push_back(_g->InnerVertices(vtype)); } return _vl; } @@ -111,8 +111,8 @@ VertexList get_master_vertices(const Graph g) { VertexList get_mirror_vertices(const Graph g) { auto _g = static_cast(g); auto _vl = new VertexList_T(); - for (VertexLabel_T vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { - _vl->push_back(_g->OuterVertices(vlabel)); + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + _vl->push_back(_g->OuterVertices(vtype)); } return _vl; } @@ -121,24 +121,24 @@ VertexList get_mirror_vertices_by_partition(const Graph g, const Partition p) { return NULL_LIST; } -#ifdef WITH_VERTEX_LABEL -VertexList get_master_vertices_by_label(const Graph g, const VertexLabel vlabel) { +#ifdef WITH_VERTEX_PROPERTY +VertexList get_master_vertices_by_type(const Graph g, const VertexType vtype) { auto _g = static_cast(g); - auto _vlabel = static_cast(vlabel); + auto _vtype = static_cast(vtype); auto _vl = new VertexList_T(); - _vl->push_back(_g->InnerVertices(*_vlabel)); + _vl->push_back(_g->InnerVertices(*_vtype)); return _vl; } -VertexList get_mirror_vertices_by_label(const Graph g, const VertexLabel vlabel) { +VertexList get_mirror_vertices_by_type(const Graph g, const VertexType vtype) { auto _g = static_cast(g); - auto _vlabel = static_cast(vlabel); + auto _vtype = static_cast(vtype); auto _vl = new VertexList_T(); - _vl->push_back(_g->OuterVertices(*_vlabel)); + _vl->push_back(_g->OuterVertices(*_vtype)); return _vl; } -VertexList get_mirror_vertices_by_label_partition(const Graph g, const VertexLabel vlabel, +VertexList get_mirror_vertices_by_type_partition(const Graph g, const VertexType vtype, const Partition p) { return NULL_LIST; } @@ -161,9 +161,7 @@ AdjacentList get_adjacent_mirror_list_by_partition(const Graph g, const Directio #endif -// Vertex ref refers to the same vertex referred in other partitions, -// while edge ref is likewise. Both can be serialized to char* for -// message transporting and deserialized on the other end. +#ifdef ENABLE_VERTEX_REF VertexRef get_vertex_ref_for_vertex(const Graph g, const Partition p, const Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); @@ -208,31 +206,9 @@ VertexRef deserialize_to_vertex_ref(const Graph g, const char* msg) { auto vr = new VertexRef_T(gid); return vr; } +#endif -EdgeRef get_edge_ref_for_edge(const Graph g, const Partition p, const Edge e) { - return NULL_EDGE_REF; -} - -Edge get_edge_from_edge_ref(const Graph g, const EdgeRef e) { - return NULL_EDGE; -} - -Partition get_master_partition_from_edge_ref(const Graph g, const EdgeRef er) { - return NULL_PARTITION; -} - -char* serialize_edge_ref(const Graph g, const EdgeRef er) { - return NULL; -} - -EdgeRef deserialize_to_edge_ref(const Graph g, const char* msg) { - return NULL_EDGE_REF; -} - -// The concept of local_complete refers to whether we can get complete data or properties -// locally in the partition. It is orthogonal to the concept of master/mirror which -// is mainly designed for data aggregation. In some extremely cases, master vertices -// may NOT contain all the data or properties locally. +#ifdef ENABLE_GRAPH_PARTITION bool is_vertex_neighbor_local_complete(const Graph g, const Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); @@ -246,7 +222,9 @@ PartitionList vertex_neighbor_complete_partitions(const Graph g, const Vertex v) pl->push_back(_g->GetFragId(*_v)); return pl; } +#endif +#ifdef WITH_VERTEX_PROPERTY bool is_vertex_property_local_complete(const Graph g, const Vertex v) { return is_vertex_neighbor_local_complete(g, v); } @@ -254,7 +232,10 @@ bool is_vertex_property_local_complete(const Graph g, const Vertex v) { PartitionList vertex_property_complete_partitions(const Graph g, const Vertex v) { return vertex_neighbor_complete_partitions(g, v); } +#endif + +#ifdef WITH_EDGE_PROPERTY bool is_edge_property_local_complete(const Graph g, const Edge e) { return true; } diff --git a/grin/src/predefine.h b/grin/src/predefine.h index 9d11838c1..456e570e8 100644 --- a/grin/src/predefine.h +++ b/grin/src/predefine.h @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "grin/include/predefine.h" +#include "modules/graph/grin/include/predefine.h" #include "modules/graph/fragment/arrow_fragment.h" #include "modules/graph/fragment/arrow_fragment_group.h" @@ -130,24 +130,23 @@ struct Edge_T { Vertex src; Vertex dst; Direction dir; - unsigned elabel; + unsigned etype; Graph_T::eid_t eid; }; -#ifdef WITH_VERTEX_ORIGIN_ID -typedef Graph_T::oid_t OriginID_T; +#ifdef WITH_VERTEX_ORIGINAL_ID +typedef Graph_T::oid_t OriginalID_T; #endif + #ifdef ENABLE_VERTEX_LIST typedef std::vector VertexList_T; #endif -#ifdef CONTINUOUS_VERTEX_ID_TRAIT -typedef Graph_T::vid_t VertexID_T; -#endif + #ifdef ENABLE_ADJACENT_LIST struct AdjacentList_T { Vertex v; Direction dir; - unsigned elabel; + unsigned etype; std::vector data; }; #endif @@ -156,30 +155,38 @@ struct AdjacentList_T { typedef vineyard::ArrowFragmentGroup PartitionedGraph_T; typedef unsigned Partition_T; typedef std::vector PartitionList_T; -typedef Graph_T::vid_t VertexRef_T; -typedef Edge_T EdgeRef_T; -#endif - -#ifdef WITH_VERTEX_LABEL -typedef unsigned VertexLabel_T; -typedef std::vector VertexLabelList_T; #endif -#ifdef WITH_EDGE_LABEL -typedef unsigned EdgeLabel_T; -typedef std::vector EdgeLabelList_T; +#ifdef ENABLE_VERTEX_REF +typedef Graph_T::vid_t VertexRef_T; #endif #ifdef WITH_VERTEX_PROPERTY +typedef unsigned VertexType_T; +typedef std::vector VertexTypeList_T; typedef std::pair VertexProperty_T; typedef std::vector VertexPropertyList_T; -typedef std::pair VertexPropertyTable_T; +struct VertexPropertyTable_T { + Graph_T* g, + unsigned vtype, + Graph_T::vertices_t vertices +}; #endif #ifdef WITH_EDGE_PROPERTY +typedef unsigned EdgeType_T; +typedef std::vector EdgeTypeList_T; typedef std::pair EdgeProperty_T; typedef std::vector EdgePropertyList_T; -typedef std::pair EdgePropertyTable_T; +struct EdgePropertyTable_T { + Graph_T* g, + unsigned etype, + unsigned num +}; +#endif + +#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) +typedef std::vector Row_T; #endif #endif // GRIN_SRC_PREDEFINE_H_ diff --git a/grin/src/property/label.cc b/grin/src/property/label.cc deleted file mode 100644 index ec957f7e4..000000000 --- a/grin/src/property/label.cc +++ /dev/null @@ -1,190 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This header file is not available for libgrape-lite. - -#include "grin/src/predefine.h" -#include "grin/include/property/label.h" - -#ifdef WITH_VERTEX_LABEL -// Vertex label -VertexLabel get_vertex_label(const Graph g, const Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto vl = new VertexLabel_T(_g->vertex_label(*_v)); - return vl; -} - -char* get_vertex_label_name(const Graph g, const VertexLabel vl) { - auto _g = static_cast(g); - auto _vl = static_cast(vl); - auto s = std::move(_g->schema().GetVertexLabelName(*_vl)); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; -} - -VertexLabel get_vertex_label_by_name(const Graph g, char* name) { - auto _g = static_cast(g); - auto s = std::string(name); - auto vl = new VertexLabel_T(_g->schema().GetVertexLabelId(s)); - return vl; -} - -#ifdef NATURAL_VERTEX_LABEL_ID_TRAIT -VertexLabelID get_vertex_label_id(const VertexLabel vl) { - auto _vl = static_cast(vl); - return *_vl; -} - -VertexLabel get_vertex_label_from_id(const VertexLabelID vli) { - auto vl = new VertexLabel_T(vli); - return vl; -} -#endif - -// Vertex label list -VertexLabelList get_vertex_label_list(const Graph g) { - auto _g = static_cast(g); - auto vll = new VertexLabelList_T(); - for (auto i = 0; i < _g->vertex_label_num(); ++i) { - vll->push_back(i); - } - return vll; -} - -void destroy_vertex_label_list(VertexLabelList vll) { - auto _vll = static_cast(vll); - delete _vll; -} - -VertexLabelList create_vertex_label_list() { - auto vll = new VertexLabelList_T(); - return vll; -} - -bool insert_vertex_label_to_list(VertexLabelList vll, const VertexLabel vl) { - auto _vll = static_cast(vll); - auto _vl = static_cast(vl); - _vll->push_back(*_vl); - return true; -} - -size_t get_vertex_label_list_size(const VertexLabelList vll) { - auto _vll = static_cast(vll); - return _vll->size(); -} - -VertexLabel get_vertex_label_from_list(const VertexLabelList vll, const size_t idx) { - auto _vll = static_cast(vll); - auto vl = new VertexLabel_T((*_vll)[idx]); - return vl; -} -#endif - -#ifdef WITH_EDGE_LABEL -// Edge label -EdgeLabel get_edge_label(const Graph g, const Edge e) { - auto _e = static_cast(e); - auto el = new EdgeLabel_T(_e->elabel); - return el; -} - -char* get_edge_label_name(const Graph g, const EdgeLabel el) { - auto _g = static_cast(g); - auto _el = static_cast(el); - auto s = std::move(_g->schema().GetEdgeLabelName(*_el)); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; -} - -EdgeLabel get_edge_label_by_name(const Graph g, char* name) { - auto _g = static_cast(g); - auto s = std::string(name); - auto el = new EdgeLabel_T(_g->schema().GetEdgeLabelId(s)); - return el; -} - -#ifdef NATURAL_EDGE_LABEL_ID_TRAIT -EdgeLabelID get_edge_label_id(const EdgeLabel el) { - auto _el = static_cast(el); - return *_el; -} - -EdgeLabel get_edge_label_from_id(const EdgeLabelID eli) { - auto el = new EdgeLabel_T(eli); - return el; -} -#endif - -// Edge label list -EdgeLabelList get_edge_label_list(const Graph g) { - auto _g = static_cast(g); - auto ell = new EdgeLabelList_T(); - for (auto i = 0; i < _g->vertex_label_num(); ++i) { - ell->push_back(i); - } - return ell; -} - -void destroy_edge_label_list(EdgeLabelList ell) { - auto _ell = static_cast(ell); - delete _ell; -} - -EdgeLabelList create_edge_label_list() { - auto ell = new EdgeLabelList_T(); - return ell; -} - -bool insert_edge_label_to_list(EdgeLabelList ell, const EdgeLabel el) { - auto _ell = static_cast(ell); - auto _el = static_cast(el); - _ell->push_back(*_el); - return true; -} - -size_t get_edge_label_list_size(const EdgeLabelList ell) { - auto _ell = static_cast(ell); - return _ell->size(); -} - -EdgeLabel get_edge_label_from_list(const EdgeLabelList ell, const size_t idx) { - auto _ell = static_cast(ell); - auto el = new VertexLabel_T((*_ell)[idx]); - return el; -} -#endif - - -#if defined(WITH_VERTEX_LABEL) && defined(WITH_EDGE_LABEL) -VertexLabel get_src_label_from_edge_label(const Graph g, const EdgeLabel elabel) { - auto _g = static_cast(g); - auto _elabel = static_cast(elabel); - auto entry = _g->schema().GetEntry(*_elabel, "EDGE"); - auto pair = entry.relations[0]; - auto vlabel = new VertexLabel_T(_g->schema().GetVertexLabelId(pair.first)); - return vlabel; -} - -VertexLabel get_dst_label_from_edge_label(const Graph g, const EdgeLabel elabel) { - auto _g = static_cast(g); - auto _elabel = static_cast(elabel); - auto entry = _g->schema().GetEntry(*_elabel, "EDGE"); - auto pair = entry.relations[0]; - auto vlabel = new VertexLabel_T(_g->schema().GetVertexLabelId(pair.second)); - return vlabel; -} -#endif diff --git a/grin/src/property/property.cc b/grin/src/property/property.cc deleted file mode 100644 index cb7edc988..000000000 --- a/grin/src/property/property.cc +++ /dev/null @@ -1,164 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "grin/src/predefine.h" - -#ifdef WITH_VERTEX_PROPERTY -void destroy_vertex_property(VertexProperty vp) { - auto _vp = static_cast(vp); - delete _vp; -} - -DataType get_vertex_property_type(const Graph g, const VertexProperty vp) { - auto _g = static_cast(g); - auto _vp = static_cast(vp); - auto dt = _g->schema().GetVertexPropertyType(_vp->first, _vp->second); - return ArrowToDataType(dt); -} - -#ifdef WITH_VERTEX_PROPERTY_NAME -char* get_vertex_property_name(const Graph g, const VertexProperty vp) { - auto _g = static_cast(g); - auto _vp = static_cast(vp); - auto s = _g->schema().GetVertexPropertyName(_vp->first, _vp->second); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; -} - -VertexProperty get_vertex_property_by_name(const Graph g, const VertexLabel vlabel, - const char* name) { - auto _g = static_cast(g); - auto _vlabel = static_cast(vlabel); - auto s = std::string(name); - auto vp = new VertexProperty_T(*_vlabel, _g->schema().GetVertexPropertyId(*_vlabel, s)); - return vp; -} - -#endif - -// Vertex Property Table -void destroy_vertex_property_table(VertexPropertyTable vpt) { - auto _vpt = static_cast(vpt); - delete _vpt; -} - -const void* get_value_from_vertex_property_table(const Graph g, const VertexPropertyTable vpt, - const Vertex v, const VertexProperty vp) { - auto _g = static_cast(g); - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - auto _vp = static_cast(vp); - if (_vp->first != _vpt->first || !_vpt->second.Contain(*_v)) return NULL; - auto offset = _v->GetValue() - _vpt->second.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - return result; -} - -VertexPropertyTable get_vertex_property_table_by_label(const Graph g, const VertexLabel vlabel) { - auto _g = static_cast(g); - auto _vlabel = static_cast(vlabel); - auto vpt = new VertexPropertyTable_T(*_vlabel, _g->InnerVertices(*_vlabel)); - return vpt; -} - -#ifdef COLUMN_STORE -VertexPropertyTable get_vertex_property_table_for_property(const Graph g, const VertexProperty vp) { - auto _g = static_cast(g); - auto _vp = static_cast(vp); - auto vlabel = _vp->first; - auto vpt = new VertexPropertyTable_T(vlabel, _g->InnerVertices(vlabel)); - return vpt; -} -#else -VertexPropertyTable get_vertex_property_table_for_vertex(const Graph, const Vertex); -#endif - -#endif - - -#ifdef WITH_EDGE_PROPERTY -void destroy_edge_property(EdgeProperty ep) { - auto _ep = static_cast(ep); - delete _ep; -} - -DataType get_edge_property_type(const Graph g, const EdgeProperty ep) { - auto _g = static_cast(g); - auto _ep = static_cast(ep); - auto dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); - return ArrowToDataType(dt); -} - -#ifdef WITH_EDGE_PROPERTY_NAME -char* get_edge_property_name(const Graph g, const EdgeProperty ep) { - auto _g = static_cast(g); - auto _ep = static_cast(ep); - auto s = _g->schema().GetEdgePropertyName(_ep->first, _ep->second); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; -} - -EdgeProperty get_edge_property_by_name(const Graph g, const EdgeLabel elabel, - const char* name) { - auto _g = static_cast(g); - auto _elabel = static_cast(elabel); - auto s = std::string(name); - auto ep = new EdgeProperty_T(*_elabel, _g->schema().GetEdgePropertyId(*_elabel, s)); - return ep; -} - -#endif - -// Edge Property Table -void destroy_edge_property_table(EdgePropertyTable ept) { - auto _ept = static_cast(ept); - delete _ept; -} - -const void* get_value_from_edge_property_table(const Graph g, const EdgePropertyTable ept, - const Edge e, const EdgeProperty ep) { - auto _g = static_cast(g); - auto _ept = static_cast(ept); - auto _e = static_cast(e); - auto _ep = static_cast(ep); - if (_ep->first != _ept->first || _e->eid >= _ept->second) return NULL; - auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - return result; -} - -EdgePropertyTable get_edge_property_table_by_label(const Graph g, const EdgeLabel elabel) { - auto _g = static_cast(g); - auto _elabel = static_cast(elabel); - auto ept = new EdgePropertyTable_T(*_elabel, _g->edge_data_table(*_elabel)->num_rows()); - return ept; -} - -#ifdef COLUMN_STORE -EdgePropertyTable get_edge_property_table_for_property(const Graph g, const EdgeProperty ep) { - auto _g = static_cast(g); - auto _ep = static_cast(ep); - auto elabel = _ep->first; - auto ept = new EdgePropertyTable_T(elabel, _g->edge_data_table(elabel)->num_rows()); - return ept; -} -#else -EdgePropertyTable get_edge_property_table_for_edge(const Graph, const Edge); -#endif - -#endif \ No newline at end of file diff --git a/grin/src/property/propertylist.cc b/grin/src/property/propertylist.cc index d06b34729..37a03ef6e 100644 --- a/grin/src/property/propertylist.cc +++ b/grin/src/property/propertylist.cc @@ -10,21 +10,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This header file is not available for libgrape-lite. +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/src/utils.h" +#include "modules/graph/grin/include/property/propertylist.h" -#include "grin/src/predefine.h" -#include "grin/src/utils.h" -#include "grin/include/property/propertylist.h" - -// Vertex property list #ifdef WITH_VERTEX_PROPERTY -VertexPropertyList get_all_vertex_properties(const Graph g) { +VertexPropertyList get_all_vertex_properties_by_type(const Graph g, const VertexType vtype) { auto _g = static_cast(g); + auto _vtype = static_cast(vtype); auto vpl = new VertexPropertyList_T(); - for (auto vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { - for (auto p = 0; p < _g->vertex_property_num(vlabel); ++p) { - vpl->push_back(VertexProperty_T(vlabel, p)); - } + for (auto p = 0; p < _g->vertex_property_num(*_vtype); ++p) { + vpl->push_back(VertexProperty_T(*_vtype, p)); } return vpl; } @@ -56,44 +52,32 @@ bool insert_vertex_property_to_list(VertexPropertyList vpl, const VertexProperty _vpl->push_back(*_vp); return true; } +#endif -#ifdef WITH_VERTEX_LABEL -VertexPropertyList get_all_vertex_properties_by_label(const Graph g, const VertexLabel vlabel) { - auto _g = static_cast(g); - auto _vlabel = static_cast(vlabel); - auto vpl = new VertexPropertyList_T(); - for (auto p = 0; p < _g->vertex_property_num(*_vlabel); ++p) { - vpl->push_back(VertexProperty_T(*_vlabel, p)); - } - return vpl; -} #ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT -VertexProperty get_vertex_property_from_id(const VertexLabel vlabel, const VertexPropertyID vpi) { - auto _vlabel = static_cast(vlabel); - auto vp = new VertexProperty_T(*_vlabel, vpi); +VertexProperty get_vertex_property_from_id(const VertexType vtype, const VertexPropertyID vpi) { + auto _vtype = static_cast(vtype); + auto vp = new VertexProperty_T(*_vtype, vpi); return vp; } -VertexPropertyID get_vertex_property_id(const VertexLabel vlabel, const VertexProperty vp) { - auto _vlabel = static_cast(vlabel); +VertexPropertyID get_vertex_property_id(const VertexType vtype, const VertexProperty vp) { + auto _vtype = static_cast(vtype); auto _vp = static_cast(vp); - if (*_vlabel != _vp->first) return NULL_NATURAL_ID; + if (*_vtype != _vp->first) return NULL_NATURAL_ID; return _vp->second; } #endif -#endif -#endif -// Edge property list + #ifdef WITH_EDGE_PROPERTY -EdgePropertyList get_all_edge_properties(const Graph g) { +EdgePropertyList get_all_edge_properties_by_type(const Graph g, const EdgeType etype) { auto _g = static_cast(g); + auto _etype = static_cast(etype); auto epl = new EdgePropertyList_T(); - for (auto elabel = 0; elabel < _g->edge_label_num(); ++elabel) { - for (auto p = 0; p < _g->edge_property_num(elabel); ++p) { - epl->push_back(EdgeProperty_T(elabel, p)); - } + for (auto p = 0; p < _g->edge_property_num(*_etype); ++p) { + epl->push_back(EdgeProperty_T(*_etype, p)); } return epl; } @@ -125,38 +109,26 @@ bool insert_edge_property_to_list(EdgePropertyList epl, const EdgeProperty ep) { _epl->push_back(*_ep); return true; } +#endif -#ifdef WITH_EDGE_LABEL -EdgePropertyList get_all_edge_properties_by_label(const Graph g, const EdgeLabel elabel) { - auto _g = static_cast(g); - auto _elabel = static_cast(elabel); - auto epl = new EdgePropertyList_T(); - for (auto p = 0; p < _g->edge_property_num(*_elabel); ++p) { - epl->push_back(EdgeProperty_T(*_elabel, p)); - } - return epl; -} #ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT -EdgeProperty get_edge_property_from_id(const EdgeLabel elabel, const EdgePropertyID epi) { - auto _elabel = static_cast(elabel); - auto ep = new EdgeProperty_T(*_elabel, epi); +EdgeProperty get_edge_property_from_id(const EdgeType etype, const EdgePropertyID epi) { + auto _etype = static_cast(etype); + auto ep = new EdgeProperty_T(*_etype, epi); return ep; } -EdgePropertyID get_edge_property_id(const EdgeLabel elabel, const EdgeProperty ep) { - auto _elabel = static_cast(elabel); +EdgePropertyID get_edge_property_id(const EdgeType etype, const EdgeProperty ep) { + auto _etype = static_cast(etype); auto _ep = static_cast(ep); - if (*_elabel != _ep->first) return NULL_NATURAL_ID; + if (*_etype != _ep->first) return NULL_NATURAL_ID; return _ep->second; } #endif -#endif -#endif -// graph projection -#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE) +#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE_TRAIT) Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { auto _g = static_cast(g); auto _vpl = static_cast(vpl); @@ -175,7 +147,7 @@ Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { } #endif -#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE) +#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE_TRAIT) Graph select_edge_properteis(const Graph g, const EdgePropertyList epl) { auto _g = static_cast(g); auto _epl = static_cast(epl); diff --git a/grin/src/property/propertytable.cc b/grin/src/property/propertytable.cc new file mode 100644 index 000000000..91699dc77 --- /dev/null +++ b/grin/src/property/propertytable.cc @@ -0,0 +1,132 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/include/property/propertytable.h" + +#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) +void destroy_row(Row r) { + auto _r = static_cast(r); + delete _r; +} + +const void* get_value_from_row(Row r, const size_t idx) { + auto _r = static_cast(r); + return (*_r)[idx]; +} + +Row create_row() { + auto r = new Row_T(); + return r; +} + +bool insert_value_to_row(Row r, const void* value) { + auto _r = static_cast(r); + _r->push_back(value); + return true; +} +#endif + + +#ifdef WITH_VERTEX_PROPERTY +void destroy_vertex_property_table(VertexPropertyTable vpt) { + auto _vpt = static_cast(vpt); + delete _vpt; +} + +VertexPropertyTable get_vertex_property_table_by_type(const Graph g, const VertexType vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto vpt = new VertexPropertyTable_T(); + vpt->g = _g; + vpt->vtype = *_vtype; + vpt->vertices = _g->InnerVertices(*_vtype); + return vpt; +} + +const void* get_value_from_vertex_property_table(const VertexPropertyTable vpt, + const Vertex v, const VertexProperty vp) { + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + if (_vp->first != _vpt->vtype || !_vpt->vertices.Contain(*_v)) return NULL; + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _vpt->g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return result; +} + +Row get_row_from_vertex_property_table(const VertexPropertyTable vpt, const Vertex v, + const VertexPropertyList vpl) { + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vpl = static_cast(vpl); + if (!_vpt->vertices.Contain(*_v)) return NULL; + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + + auto r = new Row_T(); + for (auto vp: *_vpl) { + if (vp.first != _vpt->vtype) return NULL; + auto array = _vpt->g->vertex_data_table(vp.first)->column(vp.second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + r->push_back(result); + } + return r; +} +#endif + +#ifdef WITH_EDGE_PROPERTY +void destroy_edge_property_table(EdgePropertyTable ept) { + auto _ept = static_cast(ept); + delete _ept; +} + +EdgePropertyTable get_edge_property_table_by_type(const Graph g, const EdgeType etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto ept = new EdgePropertyTable_T(); + ept->g = _g; + ept->etype = *_etype; + ept->num = _g->edge_data_table(*_etype)->num_rows(); + return ept; +} + +const void* get_value_from_edge_property_table(const EdgePropertyTable ept, + const Edge e, const EdgeProperty ep) { + auto _ept = static_cast(ept); + auto _e = static_cast(e); + auto _ep = static_cast(ep); + if (_ep->first != _ept->etype || _e->eid >= _ept->num) return NULL; + auto offset = _e->eid; + auto array = _ept->g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return result; +} + +Row get_row_from_edge_property_table(const EdgePropertyTable ept, const Edge v, + const EdgePropertyList epl) { + auto _ept = static_cast(ept); + auto _e = static_cast(v); + auto _epl = static_cast(epl); + if (_e->eid >= _ept->num) return NULL; + auto offset = _e->eid; + + auto r = new Row_T(); + for (auto ep: *_epl) { + if (ep.first != _ept->etype) return NULL; + auto array = _ept->g->edge_data_table(ep.first)->column(ep.second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + r->push_back(result); + } + return r; +} +#endif diff --git a/grin/src/property/type.cc b/grin/src/property/type.cc new file mode 100644 index 000000000..08686dad4 --- /dev/null +++ b/grin/src/property/type.cc @@ -0,0 +1,211 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/include/property/type.h" + +#ifdef WITH_VERTEX_PROPERTY +VertexType get_vertex_type(const Graph g, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto vt = new VertexType_T(_g->vertex_label(*_v)); + return vt; +} + +char* get_vertex_type_name(const Graph g, const VertexType vt) { + auto _g = static_cast(g); + auto _vt = static_cast(vt); + auto s = std::move(_g->schema().GetVertexLabelName(*_vt)); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} + +VertexType get_vertex_type_by_name(const Graph g, char* name) { + auto _g = static_cast(g); + auto s = std::string(name); + auto vt = new VertexType_T(_g->schema().GetVertexLabelId(s)); + return vt; +} + +VertexTypeList get_vertex_type_list(const Graph g) { + auto _g = static_cast(g); + auto vtl = new VertexTypeList_T(); + for (auto i = 0; i < _g->vertex_label_num(); ++i) { + vtl->push_back(i); + } + return vtl; +} + +void destroy_vertex_type_list(VertexTypeList vtl) { + auto _vtl = static_cast(vtl); + delete _vtl; +} + +VertexTypeList create_vertex_type_list() { + auto vtl = new VertexTypeList_T(); + return vtl; +} + +bool insert_vertex_type_to_list(VertexTypeList vtl, const VertexType vt) { + auto _vtl = static_cast(vtl); + auto _vt = static_cast(vt); + _vtl->push_back(*_vt); + return true; +} + +size_t get_vertex_type_list_size(const VertexTypeList vtl) { + auto _vtl = static_cast(vtl); + return _vtl->size(); +} + +VertexType get_vertex_type_from_list(const VertexTypeList vtl, const size_t idx) { + auto _vtl = static_cast(vtl); + auto vt = new VertexType_T((*_vtl)[idx]); + return vt; +} +#endif + + +#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT +VertexTypeID get_vertex_type_id(const VertexType vt) { + auto _vt = static_cast(vt); + return *_vt; +} + +VertexType get_vertex_type_from_id(const VertexTypeID vti) { + auto vt = new VertexType_T(vti); + return vt; +} +#endif + + +#ifdef WITH_EDGE_PROPERTY +EdgeType get_edge_type(const Graph g, const Edge e) { + auto _e = static_cast(e); + auto et = new EdgeType_T(_e->etype); + return et; +} + +char* get_edge_type_name(const Graph g, const EdgeType et) { + auto _g = static_cast(g); + auto _et = static_cast(et); + auto s = std::move(_g->schema().GetEdgeLabelName(*_et)); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} + +EdgeType get_edge_type_by_name(const Graph g, char* name) { + auto _g = static_cast(g); + auto s = std::string(name); + auto et = new EdgeType_T(_g->schema().GetEdgeLabelId(s)); + return et; +} + +EdgeTypeList get_edge_type_list(const Graph g) { + auto _g = static_cast(g); + auto etl = new EdgeTypeList_T(); + for (auto i = 0; i < _g->edge_label_num(); ++i) { + etl->push_back(i); + } + return etl; +} + +void destroy_edge_type_list(EdgeTypeList etl) { + auto _etl = static_cast(etl); + delete _etl; +} + +EdgeTypeList create_edge_type_list() { + auto etl = new EdgeTypeList_T(); + return etl; +} + +bool insert_edge_type_to_list(EdgeTypeList etl, const EdgeType et) { + auto _etl = static_cast(etl); + auto _et = static_cast(et); + _etl->push_back(*_et); + return true; +} + +size_t get_edge_type_list_size(const EdgeTypeList etl) { + auto _etl = static_cast(etl); + return _etl->size(); +} + +EdgeType get_edge_type_from_list(const EdgeTypeList etl, const size_t idx) { + auto _etl = static_cast(etl); + auto et = new VertexType_T((*_etl)[idx]); + return et; +} +#endif + + +#ifdef NATURAL_EDGE_TYPE_ID_TRAIT +EdgeTypeID get_edge_type_id(const EdgeType et) { + auto _et = static_cast(et); + return *_et; +} + +EdgeType get_edge_type_from_id(const EdgeTypeID eti) { + auto et = new EdgeType_T(eti); + return et; +} +#endif + + +#if defined(WITH_VERTEX_PROPERTY) && defined(WITH_EDGE_PROPERTY) +VertexTypeList get_src_types_from_edge_type(const Graph g, const EdgeType etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto entry = _g->schema().GetEntry(*_etype, "EDGE"); + auto vtl = new VertexTypeList_T(); + for (auto& pair : entry.relations) { + vtl->push_back(VertexType_T(_g->schema().GetVertexLabelId(pair.first))); + } + return vtl; +} + +VertexTypeList get_dst_types_from_edge_type(const Graph g, const EdgeType etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto entry = _g->schema().GetEntry(*_etype, "EDGE"); + auto vtl = new VertexTypeList_T(); + for (auto& pair : entry.relations) { + vtl->push_back(VertexType_T(_g->schema().GetVertexLabelId(pair.second))); + } + return vtl; +} + +EdgeTypeList get_edge_types_from_vertex_type_pair(const Graph g, const VertexType src_vt, + const VertexType dst_vt) { + auto _g = static_cast(g); + auto _v1 = static_cast(src_vt); + auto _v2 = static_cast(dst_vt); + auto str_v1 = _g->schema().GetVertexLabelName(*_v1); + auto str_v2 = _g->schema().GetVertexLabelName(*_v2); + + auto etl = new EdgeTypeList_T(); + for (auto etype = 0; etype < _g->edge_label_num(); ++etype) { + auto entry = _g->schema().GetEntry(etype, "EDGE"); + for (auto& pair : entry.relations) { + if (pair.first == str_v1 && pair.second == str_v2) { + etl->push_back(EdgeType_T(etype)); + } + } + } + return etl; +} +#endif diff --git a/grin/src/topology/adjacentlist.cc b/grin/src/topology/adjacentlist.cc index 487cb66e8..1476aa22f 100644 --- a/grin/src/topology/adjacentlist.cc +++ b/grin/src/topology/adjacentlist.cc @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "grin/src/predefine.h" -#include "grin/include/topology/adjacentlist.h" +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/include/topology/adjacentlist.h" #ifdef ENABLE_ADJACENT_LIST AdjacentList get_adjacent_list(const Graph g, const Direction d, const Vertex v) { @@ -23,31 +23,31 @@ AdjacentList get_adjacent_list(const Graph g, const Direction d, const Vertex v) auto al = new AdjacentList_T(); al->v = v; al->dir = d; - al->elabel = _g->edge_label_num(); - for (EdgeLabel_T elabel = 0; elabel < al->elabel; ++elabel) { + al->etype = _g->edge_label_num(); + for (EdgeType_T etype = 0; etype < al->etype; ++etype) { if (d == Direction::IN) { - al->data.push_back(_g->GetIncomingRawAdjList(*_v, elabel)); + al->data.push_back(_g->GetIncomingRawAdjList(*_v, etype)); } else { - al->data.push_back(_g->GetOutgoingRawAdjList(*_v, elabel)); + al->data.push_back(_g->GetOutgoingRawAdjList(*_v, etype)); } } return al; } -#ifdef WITH_EDGE_LABEL -AdjacentList get_adjacent_list_by_edge_label(const Graph g, const Direction d, - const Vertex v, const EdgeLabel elabel) { +#ifdef WITH_EDGE_PROPERTY +AdjacentList get_adjacent_list_by_edge_type(const Graph g, const Direction d, + const Vertex v, const EdgeType etype) { auto _g = static_cast(g); auto _v = static_cast(v); - auto _elabel = static_cast(elabel); + auto _etype = static_cast(etype); auto al = new AdjacentList_T(); al->v = v; al->dir = d; - al->elabel = *_elabel; + al->etype = *_etype; if (d == Direction::IN) { - al->data.push_back(_g->GetIncomingRawAdjList(*_v, *_elabel)); + al->data.push_back(_g->GetIncomingRawAdjList(*_v, *_etype)); } else { - al->data.push_back(_g->GetOutgoingRawAdjList(*_v, *_elabel)); + al->data.push_back(_g->GetOutgoingRawAdjList(*_v, *_etype)); } return al; } @@ -85,7 +85,7 @@ Vertex get_neighbor_from_adjacent_list(const AdjacentList al, size_t idx) { Edge get_edge_from_adjacent_list(const AdjacentList al, size_t idx) { auto _al = static_cast(al); size_t result = 0; - for (unsigned i = 0; i < _al->data.size(); ++i) { + for (auto i = 0; i < _al->data.size(); ++i) { result += _al->data[i].Size(); if (idx < result) { auto _idx = idx - (result - _al->data[i].Size()); @@ -95,12 +95,11 @@ Edge get_edge_from_adjacent_list(const AdjacentList al, size_t idx) { e->src = _al->v; e->dst = v; e->dir = _al->dir; - e->elabel = _al->data.size() > 1 ? i : _al->elabel; + e->etype = _al->data.size() > 1 ? i : _al->etype; e->eid = _nbr->eid; return e; } } return NULL_EDGE; } - #endif \ No newline at end of file diff --git a/grin/src/topology/edgelist.cc b/grin/src/topology/edgelist.cc deleted file mode 100644 index 50cef92d3..000000000 --- a/grin/src/topology/edgelist.cc +++ /dev/null @@ -1,48 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "../predefine.h" - -#ifdef ENABLE_EDGE_LIST - -EdgeList get_edge_list(const Graph, const Direction); - -#ifdef WITH_EDGE_LABEL -EdgeList get_edge_list_by_label(const Graph, const EdgeLabel); -#endif - -void destroy_edge_list(EdgeList); - -EdgeList create_edge_list(); - -bool insert_edge_to_list(EdgeList, const Edge); - -size_t get_edge_list_size(const EdgeList); - -Edge get_edge_from_list(const EdgeList, size_t); - -#ifdef ENABLE_EDGE_LIST_ITERATOR -EdgeListIterator get_edge_list_begin(const Graph); - -#ifdef WITH_EDGE_LABEL -EdgeListIterator get_edge_list_begin_by_label(const Graph, const EdgeLabel); -#endif - -bool get_next_edge_list_iter(EdgeListIterator); - -Edge get_edge_from_iter(EdgeListIterator); -#endif - -#endif diff --git a/grin/src/topology/structure.cc b/grin/src/topology/structure.cc index 27a9778b1..43bb9295f 100644 --- a/grin/src/topology/structure.cc +++ b/grin/src/topology/structure.cc @@ -13,11 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "grin/src/predefine.h" -#include "grin/include/topology/structure.h" +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/include/topology/structure.h" - -// Graph bool is_directed(const Graph g) { auto _g = static_cast(g); return _g->directed(); @@ -31,17 +29,17 @@ bool is_multigraph(const Graph g) { size_t get_vertex_num(const Graph g) { auto _g = static_cast(g); size_t result = 0; - for (VertexLabel_T vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { - result += _g->GetVerticesNum(vlabel); + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + result += _g->GetVerticesNum(vtype); } return result; } -#ifdef WITH_VERTEX_LABEL -size_t get_vertex_num_by_label(const Graph g, const VertexLabel vlabel) { +#ifdef WITH_VERTEX_PROPERTY +size_t get_vertex_num_by_type(const Graph g, const VertexType vtype) { auto _g = static_cast(g); - auto _vlabel = static_cast(vlabel); - return _g->GetVerticesNum(*_vlabel); + auto _vtype = static_cast(vtype); + return _g->GetVerticesNum(*_vtype); } #endif @@ -50,11 +48,11 @@ size_t get_edge_num(const Graph g) { return _g->GetEdgeNum(); } -#ifdef WITH_EDGE_LABEL -size_t get_edge_num_by_label(const Graph g, const EdgeLabel elabel) { +#ifdef WITH_EDGE_PROPERTY +size_t get_edge_num_by_type(const Graph g, const EdgeType etype) { auto _g = static_cast(g); - auto _elabel = static_cast(elabel); - return _g->edge_data_table(*_elabel)->num_rows(); + auto _etype = static_cast(etype); + return _g->edge_data_table(*_etype)->num_rows(); } #endif @@ -64,12 +62,12 @@ void destroy_vertex(Vertex v) { delete _v; } -#ifdef WITH_VERTEX_ORIGIN_ID -Vertex get_vertex_from_origin_id(const Graph g, const OriginID oid) { +#ifdef WITH_VERTEX_ORIGINAL_ID +Vertex get_vertex_from_original_id(const Graph g, const OriginalID oid) { auto _g = static_cast(g); Vertex result; - for (VertexLabel_T vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { - result = get_vertex_from_label_origin_id(g, &vlabel, oid); + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + result = get_vertex_from_original_id_by_type(g, &vtype, oid); if (result != NULL_VERTEX) { return result; } @@ -77,36 +75,35 @@ Vertex get_vertex_from_origin_id(const Graph g, const OriginID oid) { return NULL_VERTEX; } -#ifdef WITH_VERTEX_LABEL -Vertex get_vertex_from_label_origin_id(const Graph g, const VertexLabel vlabel, const OriginID oid) { - auto _g = static_cast(g); - auto _vlabel = static_cast(vlabel); - auto _oid = static_cast(oid); - Graph_T::vid_t gid; - auto v = new Vertex_T(); - if (_g->Oid2Gid(*_vlabel, *_oid, gid)) { - if (_g->Gid2Vertex(gid, *v)) { - return v; - } - } - return NULL_VERTEX; -} -#endif - -OriginID get_vertex_origin_id(const Graph g, const Vertex v) { +OriginalID get_vertex_original_id(const Graph g, const Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); auto gid = _g->Vertex2Gid(*_v); - auto oid = new OriginID_T(_g->Gid2Oid(gid)); + auto oid = new OriginalID_T(_g->Gid2Oid(gid)); return oid; } -void destroy_vertex_origin_id(OriginID oid) { - auto _oid = static_cast(oid); +void destroy_vertex_original_id(OriginalID oid) { + auto _oid = static_cast(oid); delete _oid; } #endif +#if defined(WITH_VERTEX_ORIGINAL_ID) && defined(WITH_VERTEX_PROPERTY) +Vertex get_vertex_from_original_id_by_type(const Graph g, const VertexType vtype, const OriginalID oid) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto _oid = static_cast(oid); + Graph_T::vid_t gid; + auto v = new Vertex_T(); + if (_g->Oid2Gid(*_vtype, *_oid, gid)) { + if (_g->Gid2Vertex(gid, *v)) { + return v; + } + } + return NULL_VERTEX; +} +#endif // Edge void destroy_edge(Edge e) { diff --git a/grin/src/topology/vertexlist.cc b/grin/src/topology/vertexlist.cc index 7e39e73b4..36d40c101 100644 --- a/grin/src/topology/vertexlist.cc +++ b/grin/src/topology/vertexlist.cc @@ -13,26 +13,25 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "grin/src/predefine.h" -#include "grin/include/topology/vertexlist.h" +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/include/topology/vertexlist.h" #ifdef ENABLE_VERTEX_LIST - VertexList get_vertex_list(const Graph g) { auto _g = static_cast(g); auto vl = new VertexList_T(); - for (VertexLabel_T vlabel = 0; vlabel < _g->vertex_label_num(); ++vlabel) { - vl->push_back(_g->Vertices(vlabel)); + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + vl->push_back(_g->Vertices(vtype)); } return vl; } -#ifdef WITH_VERTEX_LABEL -VertexList get_vertex_list_by_label(const Graph g, const VertexLabel vlabel) { +#ifdef WITH_VERTEX_PROPERTY +VertexList get_vertex_list_by_type(const Graph g, const VertexType vtype) { auto _g = static_cast(g); auto vl = new VertexList_T(); - auto _vlabel = static_cast(vlabel); - vl->push_back(_g->Vertices(*_vlabel)); + auto _vtype = static_cast(vtype); + vl->push_back(_g->Vertices(*_vtype)); return vl; } #endif @@ -76,47 +75,4 @@ Vertex get_vertex_from_list(const VertexList vl, const size_t idx) { } return NULL_VERTEX; } - -#ifdef CONTINUOUS_VERTEX_ID_TRAIT -bool is_vertex_list_continuous(const VertexList vl) { - auto _vl = static_cast(vl); - return _vl->size() == 1; -} - -VertexID get_begin_vertex_id_from_list(const VertexList vl) { - auto _vl = static_cast(vl); - auto _vid = (*_vl)[0].begin_value(); - auto vid = new VertexID_T(_vid); - return vid; -} - -VertexID get_end_vertex_id_from_list(const VertexList vl) { - auto _vl = static_cast(vl); - auto _vid = (*_vl)[0].end_value(); - auto vid = new VertexID_T(_vid); - return vid; -} - -DataType get_vertex_id_data_type(const Graph g) { - return DataTypeEnum::value; -} - -VertexID get_vertex_id(const Vertex v) { - auto _v = static_cast(v); - auto vid = new VertexID_T(_v->GetValue()); - return vid; -} - -Vertex get_vertex_from_id(const VertexID vid) { - auto _vid = static_cast(vid); - auto v = new Vertex_T(*_vid); - return v; -} - -void destroy_vertex_id(VertexID vid) { - auto _vid = static_cast(vid); - delete _vid; -} -#endif - #endif diff --git a/modules/graph/CMakeLists.txt b/modules/graph/CMakeLists.txt index b00b9bdb8..89e189354 100644 --- a/modules/graph/CMakeLists.txt +++ b/modules/graph/CMakeLists.txt @@ -42,6 +42,7 @@ add_custom_target(vineyard_graph_java_gen add_dependencies(vineyard_graph_gen vineyard_basic_gen) file(GLOB_RECURSE GRAPH_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}" "fragment/*.cc" + "modules/graph/grin/*.cc" "loader/*.cc" "utils/*.cc" "vertex_map/*.cc" diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index cca0a6e19..5069de715 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -50,14 +50,14 @@ limitations under the License. #include "graph/vertex_map/arrow_vertex_map.h" extern "C" { -#include "grin/include/topology/structure.h" -#include "grin/include/topology/vertexlist.h" -#include "grin/include/topology/edgelist.h" -#include "grin/include/topology/adjacentlist.h" -#include "grin/include/partition/partition.h" -#include "grin/include/propertygraph/label.h" -#include "grin/include/propertygraph/property.h" -#include "grin/include/propertygraph/propertygraph.h" +#include "modules/graph/grin/include/topology/structure.h" +#include "modules/graph/grin/include/topology/vertexlist.h" +#include "modules/graph/grin/include/topology/edgelist.h" +#include "modules/graph/grin/include/topology/adjacentlist.h" +#include "modules/graph/grin/include/partition/partition.h" +#include "modules/graph/grin/include/propertygraph/label.h" +#include "modules/graph/grin/include/propertygraph/property.h" +#include "modules/graph/grin/include/propertygraph/propertygraph.h" } namespace gs { diff --git a/modules/graph/grin/.gitignore b/modules/graph/grin/.gitignore new file mode 100644 index 000000000..c116ba07d --- /dev/null +++ b/modules/graph/grin/.gitignore @@ -0,0 +1,2 @@ +/docs/_build/ +/docs/Doxyfile.bak \ No newline at end of file diff --git a/grin/docs/Doxyfile b/modules/graph/grin/docs/Doxyfile similarity index 99% rename from grin/docs/Doxyfile rename to modules/graph/grin/docs/Doxyfile index ae4615685..e1f2275a1 100644 --- a/grin/docs/Doxyfile +++ b/modules/graph/grin/docs/Doxyfile @@ -2285,10 +2285,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = WITH_VERTEX_LABEL \ - WITH_VERTEX_PRIMARY_KEYS \ - ENABLE_VERTEX_LIST_ITERATOR \ - WITH_VERTEX_DATA +PREDEFINED = DOXYGEN_SKIP # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/grin/docs/README.md b/modules/graph/grin/docs/README.md similarity index 70% rename from grin/docs/README.md rename to modules/graph/grin/docs/README.md index 3ac2f61fa..4db20c9a5 100644 --- a/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -23,11 +23,28 @@ because, although properties with the same name usually provide the same semantic in the graph, they may have different data types in the underlying storage for efficiency concerns (e.g., short date and long date). - To avoid the incompatibility with storage engines, we made the design choice to bind properties under vertex and edge types. Meanwhile, GRIN provides an API to get all the property handlers with the (same) given property name. +### Label +- GRIN does NOT distinguish label on vertices and edges, that means a vertex and an edge may have a same label. +- However the storage can tell GRIN whether labels are enabled in vertices or edges seperatedly with macros of `WITH_VERTEX_LABEL` and `WITH_EDGE_LABEL` respectively. + ### Reference - GRIN introduces the reference concept in partitioned graph. It stands for the reference of an instance that can be recognized in partitions other than the current partition where the instance is accessed. - For example, a `VertexRef` is a reference of a `Vertex` that can be recognized in other partitions. +### Master and Mirror +- Master & mirror vertices are the concept borrowed from vertexcut partition strategy. When a vertex is recognized in +serveral partitions, we refer one of them as the master vertex while others as mirrors. This is primarily for data +aggregation purpose to share a common centural node for every one. +- While in edgecut partition, the concept becomes inner & outer vertices. GRIN uses `master == inner` and `mirror == outer` to unify these concepts. + +### Local Complete +- The concept of local complete is with repect of whether a graph component adhere to a vertex or an edge is complete locally in the partition. +- Take vertex and properties as example. We say the vertex is "property local complete" if we can get all the properties of the vertex locally in the partition. +- We can also have "edge property local complete", "vertex neighbor local complete" and so on. +- We do NOT assume any local complete on master vertices. Since in some extremely cases, master vertices +may NOT contain all the data or properties locally. + ## Traits ### Natural ID Trait - Concepts represent the schema of the graph, such as vertex type and properties bound to a certain edge type, are usually numbered naturally from `0` to its `num - 1` in many storage engines. To facilitate further optimizations diff --git a/grin/src/property/primarykey.cc b/modules/graph/grin/example/example.c similarity index 55% rename from grin/src/property/primarykey.cc rename to modules/graph/grin/example/example.c index 7ad07f251..0dbb04cca 100644 --- a/grin/src/property/primarykey.cc +++ b/modules/graph/grin/example/example.c @@ -10,14 +10,19 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This header file is not available for libgrape-lite. +#include "../include/topology/structure.h" +#include "../include/topology/vertexlist.h" +#include "../include/topology/adjacentlist.h" +#include "../include/partition/partition.h" +#include "../include/property/type.h" +#include "../include/property/property.h" +#include "../include/property/propertylist.h" +#include "../include/property/propertytable.h" -#include "grin/src/predefine.h" -#ifdef WITH_VERTEX_PRIMARTY_KEYS - -PropertyList get_primary_keys(const Graph); - -Vertex get_vertex_from_primay_keys(const Graph, const Row); - -#endif +int main(int argc, char* argv[]) { + // travere graph + void* g; + void* vl = get_vertex_list(g); + return 0; +} \ No newline at end of file diff --git a/grin/include/index/label.h b/modules/graph/grin/include/index/label.h similarity index 100% rename from grin/include/index/label.h rename to modules/graph/grin/include/index/label.h diff --git a/grin/include/partition/partition.h b/modules/graph/grin/include/partition/partition.h similarity index 76% rename from grin/include/partition/partition.h rename to modules/graph/grin/include/partition/partition.h index 8ca032cea..a8cf6b123 100644 --- a/grin/include/partition/partition.h +++ b/modules/graph/grin/include/partition/partition.h @@ -13,13 +13,16 @@ See the License for the specific language governing permissions and limitations under the License. */ +/** + @file partition.h + @brief Define the partition related APIs +*/ + #ifndef GRIN_INCLUDE_PARTITION_PARTITION_H_ #define GRIN_INCLUDE_PARTITION_PARTITION_H_ #include "../predefine.h" -**** add enable_vertex/edge_ref macros **** - #ifdef ENABLE_GRAPH_PARTITION size_t get_total_partitions_number(const PartitionedGraph); @@ -35,16 +38,18 @@ size_t get_partition_list_size(const PartitionList); Partition get_partition_from_list(const PartitionList, const size_t); -#ifdef NATURAL_PARTITION_ID_TRAIT -Partition get_partition_from_id(const PartitionID); - -PartitionID get_partition_id(const Partition); -#endif +void destroy_partition(Partition); void* get_partition_info(const PartitionedGraph, const Partition); Graph get_local_graph_from_partition(const PartitionedGraph, const Partition); +#endif +#ifdef NATURAL_PARTITION_ID_TRAIT +Partition get_partition_from_id(const PartitionID); + +PartitionID get_partition_id(const Partition); +#endif // master & mirror vertices for vertexcut partition // while they refer to inner & outer vertices in edgecut partition @@ -65,10 +70,30 @@ VertexList get_mirror_vertices_by_type_partition(const Graph, const VertexType, #endif #if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_ADJACENT_LIST) +/** + * @brief get the adjacentlist of a vertex where the neigbors are only master vertices + * @param Graph the graph + * @param Direction incoming or outgoing + * @param Vertex the vertex + */ AdjacentList get_adjacent_master_list(const Graph, const Direction, const Vertex); +/** + * @brief get the adjacentlist of a vertex where the neigbors are only mirror vertices + * @param Graph the graph + * @param Direction incoming or outgoing + * @param Vertex the vertex + */ AdjacentList get_adjacent_mirror_list(const Graph, const Direction, const Vertex); +/** + * @brief get the adjacentlist of a vertex where the neigbors are only mirror vertices + * whose master vertices are in a specific partition + * @param Graph the graph + * @param Direction incoming or outgoing + * @param Paritition the specific partition + * @param Vertex the vertex + */ AdjacentList get_adjacent_mirror_list_by_partition(const Graph, const Direction, const Partition, const Vertex); #endif @@ -77,16 +102,32 @@ AdjacentList get_adjacent_mirror_list_by_partition(const Graph, const Direction, // Vertex ref refers to the same vertex referred in other partitions, // while edge ref is likewise. Both can be serialized to char* for // message transporting and deserialized on the other end. +#ifdef ENABLE_VERTEX_REF VertexRef get_vertex_ref_for_vertex(const Graph, const Partition, const Vertex); +/** + * @brief get the local vertex from the vertex ref + * if the vertex ref is not regconized, a null vertex is returned + * @param Graph the graph + * @param VertexRef the vertex ref + */ Vertex get_vertex_from_vertex_ref(const Graph, const VertexRef); +/** + * @brief get the master partition of a vertex ref. + * Some storage can still provide the master partition of the vertex ref, + * even if the vertex ref can NOT be recognized locally. + * @param Graph the graph + * @param VertexRef the vertex ref + */ Partition get_master_partition_from_vertex_ref(const Graph, const VertexRef); char* serialize_vertex_ref(const Graph, const VertexRef); VertexRef deserialize_to_vertex_ref(const Graph, const char*); +#endif +#ifdef ENABLE_EDGE_REF EdgeRef get_edge_ref_for_edge(const Graph, const Partition, const Edge); Edge get_edge_from_edge_ref(const Graph, const EdgeRef); @@ -96,6 +137,7 @@ Partition get_master_partition_from_edge_ref(const Graph, const EdgeRef); char* serialize_edge_ref(const Graph, const EdgeRef); EdgeRef deserialize_to_edge_ref(const Graph, const char*); +#endif // The concept of local_complete refers to whether we can get complete data or properties // locally in the partition. It is orthogonal to the concept of master/mirror which @@ -103,6 +145,12 @@ EdgeRef deserialize_to_edge_ref(const Graph, const char*); // may NOT contain all the data or properties locally. bool is_vertex_neighbor_local_complete(const Graph, const Vertex); +/** + * @brief get the partitions whose combination can provide the complete + * neighbors of a vertex. + * @param Graph the graph + * @param Vertex the vertex + */ PartitionList vertex_neighbor_complete_partitions(const Graph, const Vertex); #ifdef WITH_VERTEX_DATA @@ -129,6 +177,4 @@ bool is_edge_property_local_complete(const Graph, const Edge); PartitionList edge_data_complete_partitions(const Graph, const Edge); #endif -#endif - #endif // GRIN_INCLUDE_PARTITION_PARTITION_H_ diff --git a/grin/include/predefine.h b/modules/graph/grin/include/predefine.h similarity index 97% rename from grin/include/predefine.h rename to modules/graph/grin/include/predefine.h index d14a37178..c8b8cbec7 100644 --- a/grin/include/predefine.h +++ b/modules/graph/grin/include/predefine.h @@ -107,12 +107,14 @@ typedef enum { */ #define ENABLE_ADJACENT_LIST_ITERATOR +#ifndef DOXYGEN_SKIP #undef WITH_VERTEX_DATA #undef WITH_EDGE_DATA #undef ENABLE_VERTEX_LIST_ITERATOR #undef ENABLE_EDGE_LIST #undef ENABLE_EDGE_LIST_ITERATOR #undef ENABLE_ADJACENT_LIST_ITERATOR +#endif ///@} @@ -150,7 +152,9 @@ typedef enum { #undef NATURAL_PARTITION_ID_TRAIT #endif +#ifndef DOXYGEN_SKIP #undef ENABLE_EDGE_REF +#endif ///@} @@ -183,7 +187,7 @@ typedef enum { * is NOT defined, in which case, one can use WITH_VERTEX_ORIGINAL_ID when vertices have * no properties. */ -#define WITH_VERTEX_PRIMARTY_KEYS +#define WITH_VERTEX_PRIMARY_KEYS /** @ingroup PropertyMacros * @brief The storage provides natural number IDs for vertex types. @@ -200,7 +204,7 @@ typedef enum { #define WITH_EDGE_PROPERTY // There is any property for edges. -#define WITH_EDGE_PRIMARTY_KEYS // There is cross-type property name. +#define WITH_EDGE_PRIMARY_KEYS // There is cross-type property name. #define NATURAL_EDGE_TYPE_ID_TRAIT // Edge type has natural continuous id from 0. #define NATURAL_EDGE_PROPERTY_ID_TRAIT // Edge property has natural continuous id from 0. @@ -222,14 +226,15 @@ typedef enum { #endif #ifndef WITH_EDGE_PROPERTY -#undef WITH_EDGE_PRIMARTY_KEYS +#undef WITH_EDGE_PRIMARY_KEYS #undef NATURAL_EDGE_TYPE_ID_TRAIT #undef NATURAL_EDGE_PROPERTY_ID_TRAIT #endif -#undef WITH_VERTEX_PRIMARTY_KEYS - -#undef WITH_LABEL +#ifndef DOXYGEN_SKIP +#undef WITH_VERTEX_PRIMARY_KEYS +#undef WITH_EDGE_PRIMARY_KEYS +#endif ///@} /** @name PredicateMacros @@ -257,8 +262,10 @@ typedef enum { */ #define WITH_EDGE_LABEL +#ifndef DOXYGEN_SKIP #undef WITH_VERTEX_LABEL #undef WITH_EDGE_LABEL +#endif ///@} /** @name NullValues diff --git a/grin/include/property/primarykey.h b/modules/graph/grin/include/property/primarykey.h similarity index 100% rename from grin/include/property/primarykey.h rename to modules/graph/grin/include/property/primarykey.h diff --git a/grin/include/property/property.h b/modules/graph/grin/include/property/property.h similarity index 92% rename from grin/include/property/property.h rename to modules/graph/grin/include/property/property.h index 6cf647a82..74d4c93e2 100644 --- a/grin/include/property/property.h +++ b/modules/graph/grin/include/property/property.h @@ -21,6 +21,11 @@ limitations under the License. #include "../predefine.h" #ifdef WITH_PROPERTY_NAME +/** + * @brief get the vertex property name + * @param Graph the graph + * @param VertexProperty the vertex property + */ char* get_vertex_property_name(const Graph, const VertexProperty); /** @@ -38,6 +43,11 @@ VertexProperty get_vertex_property_by_name(const Graph, const VertexType, const */ VertexPropertyList get_vertex_properties_by_name(const Graph, const char*); +/** + * @brief get the edge property name + * @param Graph the graph + * @param EdgeProperty the edge property + */ char* get_edge_property_name(const Graph, const EdgeProperty); /** diff --git a/grin/include/property/propertylist.h b/modules/graph/grin/include/property/propertylist.h similarity index 99% rename from grin/include/property/propertylist.h rename to modules/graph/grin/include/property/propertylist.h index 0c7e5508a..7c74991b4 100644 --- a/grin/include/property/propertylist.h +++ b/modules/graph/grin/include/property/propertylist.h @@ -20,7 +20,6 @@ limitations under the License. #include "../predefine.h" -// Property list #ifdef WITH_VERTEX_PROPERTY VertexPropertyList get_vertex_property_list_by_type(const Graph, const VertexType); diff --git a/grin/include/property/propertytable.h b/modules/graph/grin/include/property/propertytable.h similarity index 93% rename from grin/include/property/propertytable.h rename to modules/graph/grin/include/property/propertytable.h index 889298ce3..afe18ef8f 100644 --- a/grin/include/property/propertytable.h +++ b/modules/graph/grin/include/property/propertytable.h @@ -32,13 +32,13 @@ limitations under the License. void destroy_row(Row); /** @brief the value of a property from row by its position in row */ -void* get_value_from_row(Row, const size_t); +const void* get_value_from_row(Row, const size_t); /** @brief create a row, usually to get vertex/edge by primary keys */ Row create_row(); /** @brief insert a value to the end of the row */ -bool insert_value_to_row(Row, const void*); +bool insert_value_to_row(Row, void*); #endif ///@} @@ -68,7 +68,7 @@ VertexPropertyTable get_vertex_property_table_by_type(const Graph, const VertexT * @param VertexProperty the vertex property which is the column index * @return can be casted to the property data type by the caller */ -void* get_value_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexProperty); +const void* get_value_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexProperty); /** * @brief get vertex row from table @@ -115,7 +115,7 @@ EdgePropertyTable get_edge_property_table_by_type(const Graph, const EdgeType); * @param EdgeProperty the edge property which is the column index * @return can be casted to the property data type by the caller */ -void* get_value_from_edge_property_table(const EdgePropertyTable, const Edge, const EdgeProperty); +const void* get_value_from_edge_property_table(const EdgePropertyTable, const Edge, const EdgeProperty); /** * @brief get edge row from table diff --git a/grin/include/property/type.h b/modules/graph/grin/include/property/type.h similarity index 100% rename from grin/include/property/type.h rename to modules/graph/grin/include/property/type.h diff --git a/grin/include/topology/adjacentlist.h b/modules/graph/grin/include/topology/adjacentlist.h similarity index 100% rename from grin/include/topology/adjacentlist.h rename to modules/graph/grin/include/topology/adjacentlist.h diff --git a/grin/include/topology/edgelist.h b/modules/graph/grin/include/topology/edgelist.h similarity index 100% rename from grin/include/topology/edgelist.h rename to modules/graph/grin/include/topology/edgelist.h diff --git a/grin/include/topology/structure.h b/modules/graph/grin/include/topology/structure.h similarity index 91% rename from grin/include/topology/structure.h rename to modules/graph/grin/include/topology/structure.h index 1ff0764aa..8ecf1013e 100644 --- a/grin/include/topology/structure.h +++ b/modules/graph/grin/include/topology/structure.h @@ -50,15 +50,15 @@ void destroy_vertex_data(VertexData); #ifdef WITH_VERTEX_ORIGINAL_ID Vertex get_vertex_from_original_id(const Graph, const OriginalID); -#ifdef WITH_VERTEX_PROPERTY -Vertex get_vertex_from_type_original_id(const Graph, const VertexType, const OriginalID); -#endif - OriginalID get_vertex_original_id(const Graph, const Vertex); void destroy_vertex_original_id(OriginalID); #endif +#if defined(WITH_VERTEX_ORIGINAL_ID) && defined(WITH_VERTEX_PROPERTY) +Vertex get_vertex_from_original_id_by_type(const Graph, const VertexType, const OriginalID); +#endif + // Edge void destroy_edge(Edge); diff --git a/grin/include/topology/vertexlist.h b/modules/graph/grin/include/topology/vertexlist.h similarity index 100% rename from grin/include/topology/vertexlist.h rename to modules/graph/grin/include/topology/vertexlist.h diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc new file mode 100644 index 000000000..b6e7674c9 --- /dev/null +++ b/modules/graph/grin/src/partition/partition.cc @@ -0,0 +1,246 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/src/utils.h" +#include "modules/graph/grin/include/partition/partition.h" +#include "modules/graph/fragment/property_graph_types.h" +#include "src/client/client.h" + + +#ifdef ENABLE_GRAPH_PARTITION +size_t get_total_partitions_number(const PartitionedGraph pg) { + auto _pg = static_cast(pg); + return _pg->total_frag_num(); +} + +PartitionList get_local_partition_list(const PartitionedGraph pg) { + auto _pg = static_cast(pg); + auto pl = new PartitionList_T(); + vineyard::Client client; + client.Connect(); + for (const auto & [fid, location] : _pg->FragmentLocations()) { + if (location == client.instance_id()) { + pl->push_back(fid); + } + } + return pl; +} + +void destroy_partition_list(PartitionList pl) { + auto _pl = static_cast(pl); + delete _pl; +} + +PartitionList create_partition_list() { + auto pl = new PartitionList_T(); + return pl; +} + +bool insert_partition_to_list(PartitionList pl, const Partition p) { + auto _pl = static_cast(pl); + auto _p = static_cast(p); + _pl->push_back(*_p); + return true; +} + +size_t get_partition_list_size(const PartitionList pl) { + auto _pl = static_cast(pl); + return _pl->size(); +} + +Partition get_partition_from_list(const PartitionList pl, const size_t idx) { + auto _pl = static_cast(pl); + auto p = new Partition_T((*_pl)[idx]); + return p; +} + +void destroy_partition(Partition p) { + auto _p = static_cast(p); + delete _p; +} + +void* get_partition_info(const PartitionedGraph pg, const Partition p) { + return NULL; +} + +Graph get_local_graph_from_partition(const PartitionedGraph pg, const Partition p) { + auto _pg = static_cast(pg); + auto _p = static_cast(p); + vineyard::Client client; + client.Connect(); + return get_graph_by_object_id(client, _pg->Fragments().at(*_p)); +} +#endif + +#ifdef NATURAL_PARTITION_ID_TRAIT +Partition get_partition_from_id(const PartitionID pid) { + auto p = new Partition_T(pid); + return p; +} + +PartitionID get_partition_id(const Partition p) { + auto _p = static_cast(p); + return *_p; +} +#endif + + +#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST) +VertexList get_master_vertices(const Graph g) { + auto _g = static_cast(g); + auto _vl = new VertexList_T(); + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + _vl->push_back(_g->InnerVertices(vtype)); + } + return _vl; +} + +VertexList get_mirror_vertices(const Graph g) { + auto _g = static_cast(g); + auto _vl = new VertexList_T(); + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + _vl->push_back(_g->OuterVertices(vtype)); + } + return _vl; +} + +VertexList get_mirror_vertices_by_partition(const Graph g, const Partition p) { + return NULL_LIST; +} + +#ifdef WITH_VERTEX_PROPERTY +VertexList get_master_vertices_by_type(const Graph g, const VertexType vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto _vl = new VertexList_T(); + _vl->push_back(_g->InnerVertices(*_vtype)); + return _vl; +} + +VertexList get_mirror_vertices_by_type(const Graph g, const VertexType vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto _vl = new VertexList_T(); + _vl->push_back(_g->OuterVertices(*_vtype)); + return _vl; +} + +VertexList get_mirror_vertices_by_type_partition(const Graph g, const VertexType vtype, + const Partition p) { + return NULL_LIST; +} +#endif +#endif + +#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_ADJACENT_LIST) +AdjacentList get_adjacent_master_list(const Graph g, const Direction d, const Vertex v) { + return NULL_LIST; +} + +AdjacentList get_adjacent_mirror_list(const Graph g, const Direction d, const Vertex v) { + return NULL_LIST; +} + +AdjacentList get_adjacent_mirror_list_by_partition(const Graph g, const Direction d, + const Partition p, const Vertex v) { + return NULL_LIST; +} +#endif + + +#ifdef ENABLE_VERTEX_REF +VertexRef get_vertex_ref_for_vertex(const Graph g, const Partition p, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto gid = _g->Vertex2Gid(*_v); + auto vr = new VertexRef_T(gid); + return vr; +} + +Vertex get_vertex_from_vertex_ref(const Graph g, const VertexRef vr) { + auto _g = static_cast(g); + auto _vr = static_cast(vr); + auto v = new Vertex_T(); + if (_g->Gid2Vertex(*_vr, *v)) { + return v; + } + return NULL_VERTEX; +} + +Partition get_master_partition_from_vertex_ref(const Graph g, const VertexRef vr) { + auto _g = static_cast(g); + auto _vr = static_cast(vr); + auto id_parser = vineyard::IdParser(); + id_parser.Init(_g->fnum(), _g->vertex_label_num()); + auto p = new Partition_T(id_parser.GetFid(*_vr)); + return p; +} + +char* serialize_vertex_ref(const Graph g, const VertexRef vr) { + auto _vr = static_cast(vr); + std::stringstream ss; + ss << *_vr; + int len = ss.str().length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", ss.str().c_str()); + return out; +} + +VertexRef deserialize_to_vertex_ref(const Graph g, const char* msg) { + std::stringstream ss(msg); + VertexRef_T gid; + ss >> gid; + auto vr = new VertexRef_T(gid); + return vr; +} +#endif + +#ifdef ENABLE_GRAPH_PARTITION +bool is_vertex_neighbor_local_complete(const Graph g, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + return _g->IsInnerVertex(*_v); +} + +PartitionList vertex_neighbor_complete_partitions(const Graph g, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto pl = new PartitionList_T(); + pl->push_back(_g->GetFragId(*_v)); + return pl; +} +#endif + +#ifdef WITH_VERTEX_PROPERTY +bool is_vertex_property_local_complete(const Graph g, const Vertex v) { + return is_vertex_neighbor_local_complete(g, v); +} + +PartitionList vertex_property_complete_partitions(const Graph g, const Vertex v) { + return vertex_neighbor_complete_partitions(g, v); +} +#endif + + +#ifdef WITH_EDGE_PROPERTY +bool is_edge_property_local_complete(const Graph g, const Edge e) { + return true; +} + +PartitionList edge_property_complete_partitions(const Graph g, const Edge e) { + return NULL_LIST; +} +#endif diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h new file mode 100644 index 000000000..456e570e8 --- /dev/null +++ b/modules/graph/grin/src/predefine.h @@ -0,0 +1,192 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +#include "modules/graph/grin/include/predefine.h" +#include "modules/graph/fragment/arrow_fragment.h" +#include "modules/graph/fragment/arrow_fragment_group.h" + +#include "arrow/api.h" + + +#ifndef GRIN_SRC_PREDEFINE_H_ +#define GRIN_SRC_PREDEFINE_H_ + +template +struct DataTypeEnum { + static constexpr DataType value = DataType::Undefined; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Int32; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::UInt32; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Int64; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::UInt64; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Float; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Double; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::String; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Date32; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Date64; +}; + +std::string GetDataTypeName(DataType type) { + switch (type) { + case DataType::Int32: + return "int32"; + case DataType::UInt32: + return "uint32"; + case DataType::Int64: + return "int64"; + case DataType::UInt64: + return "uint64"; + case DataType::Float: + return "float"; + case DataType::Double: + return "double"; + case DataType::String: + return "string"; + case DataType::Date32: + return "date32"; + case DataType::Date64: + return "date64"; + default: + return "undefined"; + } +} + +DataType ArrowToDataType(std::shared_ptr type) { + if (type == nullptr) { + return DataType::Undefined; + } else if (arrow::int32()->Equals(type)) { + return DataType::Int32; + } else if (arrow::int64()->Equals(type)) { + return DataType::Int64; + } else if (arrow::float32()->Equals(type)) { + return DataType::Float; + } else if (arrow::uint32()->Equals(type)) { + return DataType::UInt32; + } else if (arrow::uint64()->Equals(type)) { + return DataType::UInt64; + } else if (arrow::float64()->Equals(type)) { + return DataType::Double; + } else if (arrow::utf8()->Equals(type)) { + return DataType::String; + } else if (arrow::large_utf8()->Equals(type)) { + return DataType::String; + } + return DataType::Undefined; +} + +#define G_OID_T int +#define G_VID_T unsigned + +/* The following data types shall be defined through typedef. */ +typedef vineyard::ArrowFragment Graph_T; +typedef Graph_T::vertex_t Vertex_T; +struct Edge_T { + Vertex src; + Vertex dst; + Direction dir; + unsigned etype; + Graph_T::eid_t eid; +}; + +#ifdef WITH_VERTEX_ORIGINAL_ID +typedef Graph_T::oid_t OriginalID_T; +#endif + +#ifdef ENABLE_VERTEX_LIST +typedef std::vector VertexList_T; +#endif + +#ifdef ENABLE_ADJACENT_LIST +struct AdjacentList_T { + Vertex v; + Direction dir; + unsigned etype; + std::vector data; +}; +#endif + +#ifdef ENABLE_GRAPH_PARTITION +typedef vineyard::ArrowFragmentGroup PartitionedGraph_T; +typedef unsigned Partition_T; +typedef std::vector PartitionList_T; +#endif + +#ifdef ENABLE_VERTEX_REF +typedef Graph_T::vid_t VertexRef_T; +#endif + +#ifdef WITH_VERTEX_PROPERTY +typedef unsigned VertexType_T; +typedef std::vector VertexTypeList_T; +typedef std::pair VertexProperty_T; +typedef std::vector VertexPropertyList_T; +struct VertexPropertyTable_T { + Graph_T* g, + unsigned vtype, + Graph_T::vertices_t vertices +}; +#endif + +#ifdef WITH_EDGE_PROPERTY +typedef unsigned EdgeType_T; +typedef std::vector EdgeTypeList_T; +typedef std::pair EdgeProperty_T; +typedef std::vector EdgePropertyList_T; +struct EdgePropertyTable_T { + Graph_T* g, + unsigned etype, + unsigned num +}; +#endif + +#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) +typedef std::vector Row_T; +#endif + +#endif // GRIN_SRC_PREDEFINE_H_ diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc new file mode 100644 index 000000000..f582cbfa8 --- /dev/null +++ b/modules/graph/grin/src/property/property.cc @@ -0,0 +1,115 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "modules/graph/grin/src/predefine.h" + +#ifdef WITH_PROPERTY_NAME +char* get_vertex_property_name(const Graph g, const VertexProperty vp) { + auto _g = static_cast(g); + auto _vp = static_cast(vp); + auto s = _g->schema().GetVertexPropertyName(_vp->first, _vp->second); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} + +VertexProperty get_vertex_property_by_name(const Graph g, const VertexType vtype, + const char* name) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto s = std::string(name); + auto vp = new VertexProperty_T(*_vtype, _g->schema().GetVertexPropertyId(*_vtype, s)); + return vp; +} + +VertexPropertyList get_vertex_properties_by_name(const Graph g, const char* name) { + auto _g = static_cast(g); + auto s = std::string(name); + auto vpl = new VertexPropertyList_T(); + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + vpl->push_back(VertexProperty_T(vtype, _g->schema().GetVertexPropertyId(vtype, s))); + } + return vpl; +} + +char* get_edge_property_name(const Graph g, const EdgeProperty ep) { + auto _g = static_cast(g); + auto _ep = static_cast(ep); + auto s = _g->schema().GetEdgePropertyName(_ep->first, _ep->second); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} + +EdgeProperty get_edge_property_by_name(const Graph g, const EdgeType etype, + const char* name) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto s = std::string(name); + auto ep = new EdgeProperty_T(*_etype, _g->schema().GetEdgePropertyId(*_etype, s)); + return ep; +} + +EdgePropertyList get_edge_properties_by_name(const Graph g, const char* name) { + auto _g = static_cast(g); + auto s = std::string(name); + auto epl = new EdgePropertyList_T(); + for (auto etype = 0; etype < _g->edge_label_num(); ++etype) { + epl->push_back(EdgeProperty_T(etype, _g->schema().GetVertexPropertyId(etype, s))); + } + return epl; +} +#endif + + +#ifdef WITH_VERTEX_PROPERTY +void destroy_vertex_property(VertexProperty vp) { + auto _vp = static_cast(vp); + delete _vp; +} + +DataType get_vertex_property_data_type(const Graph g, const VertexProperty vp) { + auto _g = static_cast(g); + auto _vp = static_cast(vp); + auto dt = _g->schema().GetVertexPropertyType(_vp->first, _vp->second); + return ArrowToDataType(dt); +} + +VertexType get_vertex_property_vertex_type(VertexProperty vp) { + auto _vp = static_cast(vp); + auto vt = new VertexType_T(_vp->first); + return vt; +} +#endif + + +#ifdef WITH_EDGE_PROPERTY +void destroy_edge_property(EdgeProperty ep) { + auto _ep = static_cast(ep); + delete _ep; +} + +DataType get_edge_property_type(const Graph g, const EdgeProperty ep) { + auto _g = static_cast(g); + auto _ep = static_cast(ep); + auto dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); + return ArrowToDataType(dt); +} + +EdgeType get_edge_property_edge_type(EdgeProperty ep) { + auto _ep = static_cast(ep); + auto et = new EdgeType_T(_ep->first); + return et; +} +#endif diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc new file mode 100644 index 000000000..37a03ef6e --- /dev/null +++ b/modules/graph/grin/src/property/propertylist.cc @@ -0,0 +1,167 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/src/utils.h" +#include "modules/graph/grin/include/property/propertylist.h" + +#ifdef WITH_VERTEX_PROPERTY +VertexPropertyList get_all_vertex_properties_by_type(const Graph g, const VertexType vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto vpl = new VertexPropertyList_T(); + for (auto p = 0; p < _g->vertex_property_num(*_vtype); ++p) { + vpl->push_back(VertexProperty_T(*_vtype, p)); + } + return vpl; +} + +size_t get_vertex_property_list_size(const VertexPropertyList vpl) { + auto _vpl = static_cast(vpl); + return _vpl->size(); +} + +VertexProperty get_vertex_property_from_list(const VertexPropertyList vpl, const size_t idx) { + auto _vpl = static_cast(vpl); + auto vp = new VertexProperty_T((*_vpl)[idx]); + return vp; +} + +VertexPropertyList create_vertex_property_list() { + auto vpl = new VertexPropertyList_T(); + return vpl; +} + +void destroy_vertex_property_list(VertexPropertyList vpl) { + auto _vpl = static_cast(vpl); + delete _vpl; +} + +bool insert_vertex_property_to_list(VertexPropertyList vpl, const VertexProperty vp) { + auto _vpl = static_cast(vpl); + auto _vp = static_cast(vp); + _vpl->push_back(*_vp); + return true; +} +#endif + + +#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT +VertexProperty get_vertex_property_from_id(const VertexType vtype, const VertexPropertyID vpi) { + auto _vtype = static_cast(vtype); + auto vp = new VertexProperty_T(*_vtype, vpi); + return vp; +} + +VertexPropertyID get_vertex_property_id(const VertexType vtype, const VertexProperty vp) { + auto _vtype = static_cast(vtype); + auto _vp = static_cast(vp); + if (*_vtype != _vp->first) return NULL_NATURAL_ID; + return _vp->second; +} +#endif + + +#ifdef WITH_EDGE_PROPERTY +EdgePropertyList get_all_edge_properties_by_type(const Graph g, const EdgeType etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto epl = new EdgePropertyList_T(); + for (auto p = 0; p < _g->edge_property_num(*_etype); ++p) { + epl->push_back(EdgeProperty_T(*_etype, p)); + } + return epl; +} + +size_t get_edge_property_list_size(const EdgePropertyList epl) { + auto _epl = static_cast(epl); + return _epl->size(); +} + +EdgeProperty get_edge_property_from_list(const EdgePropertyList epl, const size_t idx) { + auto _epl = static_cast(epl); + auto ep = new EdgeProperty_T((*_epl)[idx]); + return ep; +} + +EdgePropertyList create_edge_property_list() { + auto epl = new EdgePropertyList_T(); + return epl; +} + +void destroy_edge_property_list(EdgePropertyList epl) { + auto _epl = static_cast(epl); + delete _epl; +} + +bool insert_edge_property_to_list(EdgePropertyList epl, const EdgeProperty ep) { + auto _epl = static_cast(epl); + auto _ep = static_cast(ep); + _epl->push_back(*_ep); + return true; +} +#endif + + +#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT +EdgeProperty get_edge_property_from_id(const EdgeType etype, const EdgePropertyID epi) { + auto _etype = static_cast(etype); + auto ep = new EdgeProperty_T(*_etype, epi); + return ep; +} + +EdgePropertyID get_edge_property_id(const EdgeType etype, const EdgeProperty ep) { + auto _etype = static_cast(etype); + auto _ep = static_cast(ep); + if (*_etype != _ep->first) return NULL_NATURAL_ID; + return _ep->second; +} +#endif + + +#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE_TRAIT) +Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { + auto _g = static_cast(g); + auto _vpl = static_cast(vpl); + std::map> vertices, edges; + for (auto& p: *_vpl) { + if (vertices.find(p.first) == vertices.end()) { + vertices.insert(p.first, {p.second}); + } else { + vertices[p.first].push_back(p.second); + } + } + vineyard::Client client; + client.Connect(); + auto object_id = _g->Project(client, vertices, edges); + return get_graph_by_object_id(client, object_id.value()); +} +#endif + +#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE_TRAIT) +Graph select_edge_properteis(const Graph g, const EdgePropertyList epl) { + auto _g = static_cast(g); + auto _epl = static_cast(epl); + std::map> vertices, edges; + for (auto& p: *_epl) { + if (edges.find(p.first) == edges.end()) { + edges.insert(p.first, {p.second}); + } else { + edges[p.first].push_back(p.second); + } + } + vineyard::Client client; + client.Connect(); + auto object_id = _g->Project(client, vertices, edges); + return get_graph_by_object_id(client, object_id.value()); +} +#endif \ No newline at end of file diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc new file mode 100644 index 000000000..91699dc77 --- /dev/null +++ b/modules/graph/grin/src/property/propertytable.cc @@ -0,0 +1,132 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/include/property/propertytable.h" + +#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) +void destroy_row(Row r) { + auto _r = static_cast(r); + delete _r; +} + +const void* get_value_from_row(Row r, const size_t idx) { + auto _r = static_cast(r); + return (*_r)[idx]; +} + +Row create_row() { + auto r = new Row_T(); + return r; +} + +bool insert_value_to_row(Row r, const void* value) { + auto _r = static_cast(r); + _r->push_back(value); + return true; +} +#endif + + +#ifdef WITH_VERTEX_PROPERTY +void destroy_vertex_property_table(VertexPropertyTable vpt) { + auto _vpt = static_cast(vpt); + delete _vpt; +} + +VertexPropertyTable get_vertex_property_table_by_type(const Graph g, const VertexType vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto vpt = new VertexPropertyTable_T(); + vpt->g = _g; + vpt->vtype = *_vtype; + vpt->vertices = _g->InnerVertices(*_vtype); + return vpt; +} + +const void* get_value_from_vertex_property_table(const VertexPropertyTable vpt, + const Vertex v, const VertexProperty vp) { + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + if (_vp->first != _vpt->vtype || !_vpt->vertices.Contain(*_v)) return NULL; + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _vpt->g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return result; +} + +Row get_row_from_vertex_property_table(const VertexPropertyTable vpt, const Vertex v, + const VertexPropertyList vpl) { + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vpl = static_cast(vpl); + if (!_vpt->vertices.Contain(*_v)) return NULL; + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + + auto r = new Row_T(); + for (auto vp: *_vpl) { + if (vp.first != _vpt->vtype) return NULL; + auto array = _vpt->g->vertex_data_table(vp.first)->column(vp.second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + r->push_back(result); + } + return r; +} +#endif + +#ifdef WITH_EDGE_PROPERTY +void destroy_edge_property_table(EdgePropertyTable ept) { + auto _ept = static_cast(ept); + delete _ept; +} + +EdgePropertyTable get_edge_property_table_by_type(const Graph g, const EdgeType etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto ept = new EdgePropertyTable_T(); + ept->g = _g; + ept->etype = *_etype; + ept->num = _g->edge_data_table(*_etype)->num_rows(); + return ept; +} + +const void* get_value_from_edge_property_table(const EdgePropertyTable ept, + const Edge e, const EdgeProperty ep) { + auto _ept = static_cast(ept); + auto _e = static_cast(e); + auto _ep = static_cast(ep); + if (_ep->first != _ept->etype || _e->eid >= _ept->num) return NULL; + auto offset = _e->eid; + auto array = _ept->g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return result; +} + +Row get_row_from_edge_property_table(const EdgePropertyTable ept, const Edge v, + const EdgePropertyList epl) { + auto _ept = static_cast(ept); + auto _e = static_cast(v); + auto _epl = static_cast(epl); + if (_e->eid >= _ept->num) return NULL; + auto offset = _e->eid; + + auto r = new Row_T(); + for (auto ep: *_epl) { + if (ep.first != _ept->etype) return NULL; + auto array = _ept->g->edge_data_table(ep.first)->column(ep.second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + r->push_back(result); + } + return r; +} +#endif diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc new file mode 100644 index 000000000..08686dad4 --- /dev/null +++ b/modules/graph/grin/src/property/type.cc @@ -0,0 +1,211 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/include/property/type.h" + +#ifdef WITH_VERTEX_PROPERTY +VertexType get_vertex_type(const Graph g, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto vt = new VertexType_T(_g->vertex_label(*_v)); + return vt; +} + +char* get_vertex_type_name(const Graph g, const VertexType vt) { + auto _g = static_cast(g); + auto _vt = static_cast(vt); + auto s = std::move(_g->schema().GetVertexLabelName(*_vt)); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} + +VertexType get_vertex_type_by_name(const Graph g, char* name) { + auto _g = static_cast(g); + auto s = std::string(name); + auto vt = new VertexType_T(_g->schema().GetVertexLabelId(s)); + return vt; +} + +VertexTypeList get_vertex_type_list(const Graph g) { + auto _g = static_cast(g); + auto vtl = new VertexTypeList_T(); + for (auto i = 0; i < _g->vertex_label_num(); ++i) { + vtl->push_back(i); + } + return vtl; +} + +void destroy_vertex_type_list(VertexTypeList vtl) { + auto _vtl = static_cast(vtl); + delete _vtl; +} + +VertexTypeList create_vertex_type_list() { + auto vtl = new VertexTypeList_T(); + return vtl; +} + +bool insert_vertex_type_to_list(VertexTypeList vtl, const VertexType vt) { + auto _vtl = static_cast(vtl); + auto _vt = static_cast(vt); + _vtl->push_back(*_vt); + return true; +} + +size_t get_vertex_type_list_size(const VertexTypeList vtl) { + auto _vtl = static_cast(vtl); + return _vtl->size(); +} + +VertexType get_vertex_type_from_list(const VertexTypeList vtl, const size_t idx) { + auto _vtl = static_cast(vtl); + auto vt = new VertexType_T((*_vtl)[idx]); + return vt; +} +#endif + + +#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT +VertexTypeID get_vertex_type_id(const VertexType vt) { + auto _vt = static_cast(vt); + return *_vt; +} + +VertexType get_vertex_type_from_id(const VertexTypeID vti) { + auto vt = new VertexType_T(vti); + return vt; +} +#endif + + +#ifdef WITH_EDGE_PROPERTY +EdgeType get_edge_type(const Graph g, const Edge e) { + auto _e = static_cast(e); + auto et = new EdgeType_T(_e->etype); + return et; +} + +char* get_edge_type_name(const Graph g, const EdgeType et) { + auto _g = static_cast(g); + auto _et = static_cast(et); + auto s = std::move(_g->schema().GetEdgeLabelName(*_et)); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} + +EdgeType get_edge_type_by_name(const Graph g, char* name) { + auto _g = static_cast(g); + auto s = std::string(name); + auto et = new EdgeType_T(_g->schema().GetEdgeLabelId(s)); + return et; +} + +EdgeTypeList get_edge_type_list(const Graph g) { + auto _g = static_cast(g); + auto etl = new EdgeTypeList_T(); + for (auto i = 0; i < _g->edge_label_num(); ++i) { + etl->push_back(i); + } + return etl; +} + +void destroy_edge_type_list(EdgeTypeList etl) { + auto _etl = static_cast(etl); + delete _etl; +} + +EdgeTypeList create_edge_type_list() { + auto etl = new EdgeTypeList_T(); + return etl; +} + +bool insert_edge_type_to_list(EdgeTypeList etl, const EdgeType et) { + auto _etl = static_cast(etl); + auto _et = static_cast(et); + _etl->push_back(*_et); + return true; +} + +size_t get_edge_type_list_size(const EdgeTypeList etl) { + auto _etl = static_cast(etl); + return _etl->size(); +} + +EdgeType get_edge_type_from_list(const EdgeTypeList etl, const size_t idx) { + auto _etl = static_cast(etl); + auto et = new VertexType_T((*_etl)[idx]); + return et; +} +#endif + + +#ifdef NATURAL_EDGE_TYPE_ID_TRAIT +EdgeTypeID get_edge_type_id(const EdgeType et) { + auto _et = static_cast(et); + return *_et; +} + +EdgeType get_edge_type_from_id(const EdgeTypeID eti) { + auto et = new EdgeType_T(eti); + return et; +} +#endif + + +#if defined(WITH_VERTEX_PROPERTY) && defined(WITH_EDGE_PROPERTY) +VertexTypeList get_src_types_from_edge_type(const Graph g, const EdgeType etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto entry = _g->schema().GetEntry(*_etype, "EDGE"); + auto vtl = new VertexTypeList_T(); + for (auto& pair : entry.relations) { + vtl->push_back(VertexType_T(_g->schema().GetVertexLabelId(pair.first))); + } + return vtl; +} + +VertexTypeList get_dst_types_from_edge_type(const Graph g, const EdgeType etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto entry = _g->schema().GetEntry(*_etype, "EDGE"); + auto vtl = new VertexTypeList_T(); + for (auto& pair : entry.relations) { + vtl->push_back(VertexType_T(_g->schema().GetVertexLabelId(pair.second))); + } + return vtl; +} + +EdgeTypeList get_edge_types_from_vertex_type_pair(const Graph g, const VertexType src_vt, + const VertexType dst_vt) { + auto _g = static_cast(g); + auto _v1 = static_cast(src_vt); + auto _v2 = static_cast(dst_vt); + auto str_v1 = _g->schema().GetVertexLabelName(*_v1); + auto str_v2 = _g->schema().GetVertexLabelName(*_v2); + + auto etl = new EdgeTypeList_T(); + for (auto etype = 0; etype < _g->edge_label_num(); ++etype) { + auto entry = _g->schema().GetEntry(etype, "EDGE"); + for (auto& pair : entry.relations) { + if (pair.first == str_v1 && pair.second == str_v2) { + etl->push_back(EdgeType_T(etype)); + } + } + } + return etl; +} +#endif diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc new file mode 100644 index 000000000..1476aa22f --- /dev/null +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -0,0 +1,105 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/include/topology/adjacentlist.h" + +#ifdef ENABLE_ADJACENT_LIST +AdjacentList get_adjacent_list(const Graph g, const Direction d, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto al = new AdjacentList_T(); + al->v = v; + al->dir = d; + al->etype = _g->edge_label_num(); + for (EdgeType_T etype = 0; etype < al->etype; ++etype) { + if (d == Direction::IN) { + al->data.push_back(_g->GetIncomingRawAdjList(*_v, etype)); + } else { + al->data.push_back(_g->GetOutgoingRawAdjList(*_v, etype)); + } + } + return al; +} + +#ifdef WITH_EDGE_PROPERTY +AdjacentList get_adjacent_list_by_edge_type(const Graph g, const Direction d, + const Vertex v, const EdgeType etype) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto _etype = static_cast(etype); + auto al = new AdjacentList_T(); + al->v = v; + al->dir = d; + al->etype = *_etype; + if (d == Direction::IN) { + al->data.push_back(_g->GetIncomingRawAdjList(*_v, *_etype)); + } else { + al->data.push_back(_g->GetOutgoingRawAdjList(*_v, *_etype)); + } + return al; +} +#endif + +void destroy_adjacent_list(AdjacentList al) { + auto _al = static_cast(al); + delete _al; +} + +size_t get_adjacent_list_size(const AdjacentList al) { + auto _al = static_cast(al); + size_t result = 0; + for (auto &ral : _al->data) { + result += ral.Size(); + } + return result; +} + +Vertex get_neighbor_from_adjacent_list(const AdjacentList al, size_t idx) { + auto _al = static_cast(al); + size_t result = 0; + for (auto &ral : _al->data) { + result += ral.Size(); + if (idx < result) { + auto _idx = idx - (result - ral.size()); + auto _nbr = ral.begin() + _idx; + auto v = new Vertex_T(_nbr->vid); + return v; + } + } + return NULL_VERTEX; +} + +Edge get_edge_from_adjacent_list(const AdjacentList al, size_t idx) { + auto _al = static_cast(al); + size_t result = 0; + for (auto i = 0; i < _al->data.size(); ++i) { + result += _al->data[i].Size(); + if (idx < result) { + auto _idx = idx - (result - _al->data[i].Size()); + auto _nbr = _al->data[i].begin() + _idx; + auto v = new Vertex_T(_nbr->vid); + auto e = new Edge_T(); + e->src = _al->v; + e->dst = v; + e->dir = _al->dir; + e->etype = _al->data.size() > 1 ? i : _al->etype; + e->eid = _nbr->eid; + return e; + } + } + return NULL_EDGE; +} +#endif \ No newline at end of file diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc new file mode 100644 index 000000000..43bb9295f --- /dev/null +++ b/modules/graph/grin/src/topology/structure.cc @@ -0,0 +1,122 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/include/topology/structure.h" + +bool is_directed(const Graph g) { + auto _g = static_cast(g); + return _g->directed(); +} + +bool is_multigraph(const Graph g) { + auto _g = static_cast(g); + return _g->is_multigraph(); +} + +size_t get_vertex_num(const Graph g) { + auto _g = static_cast(g); + size_t result = 0; + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + result += _g->GetVerticesNum(vtype); + } + return result; +} + +#ifdef WITH_VERTEX_PROPERTY +size_t get_vertex_num_by_type(const Graph g, const VertexType vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + return _g->GetVerticesNum(*_vtype); +} +#endif + +size_t get_edge_num(const Graph g) { + auto _g = static_cast(g); + return _g->GetEdgeNum(); +} + +#ifdef WITH_EDGE_PROPERTY +size_t get_edge_num_by_type(const Graph g, const EdgeType etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + return _g->edge_data_table(*_etype)->num_rows(); +} +#endif + +// Vertex +void destroy_vertex(Vertex v) { + auto _v = static_cast(v); + delete _v; +} + +#ifdef WITH_VERTEX_ORIGINAL_ID +Vertex get_vertex_from_original_id(const Graph g, const OriginalID oid) { + auto _g = static_cast(g); + Vertex result; + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + result = get_vertex_from_original_id_by_type(g, &vtype, oid); + if (result != NULL_VERTEX) { + return result; + } + } + return NULL_VERTEX; +} + +OriginalID get_vertex_original_id(const Graph g, const Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto gid = _g->Vertex2Gid(*_v); + auto oid = new OriginalID_T(_g->Gid2Oid(gid)); + return oid; +} + +void destroy_vertex_original_id(OriginalID oid) { + auto _oid = static_cast(oid); + delete _oid; +} +#endif + +#if defined(WITH_VERTEX_ORIGINAL_ID) && defined(WITH_VERTEX_PROPERTY) +Vertex get_vertex_from_original_id_by_type(const Graph g, const VertexType vtype, const OriginalID oid) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto _oid = static_cast(oid); + Graph_T::vid_t gid; + auto v = new Vertex_T(); + if (_g->Oid2Gid(*_vtype, *_oid, gid)) { + if (_g->Gid2Vertex(gid, *v)) { + return v; + } + } + return NULL_VERTEX; +} +#endif + +// Edge +void destroy_edge(Edge e) { + auto _e = static_cast(e); + delete _e; +} + +Vertex get_edge_src(const Graph g, const Edge e) { + auto _e = static_cast(e); + return _e->src; +} + +Vertex get_edge_dst(const Graph g, const Edge e) { + auto _e = static_cast(e); + return _e->dst; +} diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc new file mode 100644 index 000000000..36d40c101 --- /dev/null +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -0,0 +1,78 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "modules/graph/grin/src/predefine.h" +#include "modules/graph/grin/include/topology/vertexlist.h" + +#ifdef ENABLE_VERTEX_LIST +VertexList get_vertex_list(const Graph g) { + auto _g = static_cast(g); + auto vl = new VertexList_T(); + for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { + vl->push_back(_g->Vertices(vtype)); + } + return vl; +} + +#ifdef WITH_VERTEX_PROPERTY +VertexList get_vertex_list_by_type(const Graph g, const VertexType vtype) { + auto _g = static_cast(g); + auto vl = new VertexList_T(); + auto _vtype = static_cast(vtype); + vl->push_back(_g->Vertices(*_vtype)); + return vl; +} +#endif + +void destroy_vertex_list(VertexList vl) { + auto _vl = static_cast(vl); + delete _vl; +} + +VertexList create_vertex_list() { + auto vl = new VertexList_T(); + return vl; +} + +bool insert_vertex_to_list(VertexList vl, const Vertex v) { + auto _vl = static_cast(vl); + auto _v = static_cast(v); + _vl->push_back(Graph_T::vertex_range_t(_v->GetValue(), _v->GetValue())); + return true; +} + +size_t get_vertex_list_size(const VertexList vl) { + auto _vl = static_cast(vl); + size_t result = 0; + for (auto &vr : *_vl) { + result += vr.size(); + } + return result; +} + +Vertex get_vertex_from_list(const VertexList vl, const size_t idx) { + auto _vl = static_cast(vl); + size_t result = 0; + for (auto &vr : *_vl) { + result += vr.size(); + if (idx < result) { + auto _idx = idx - (result - vr.size()); + auto v = new Vertex_T(vr.begin_value() + _idx); + return v; + } + } + return NULL_VERTEX; +} +#endif diff --git a/grin/src/utils.h b/modules/graph/grin/src/utils.h similarity index 95% rename from grin/src/utils.h rename to modules/graph/grin/src/utils.h index 65e07cac4..a576ca867 100644 --- a/grin/src/utils.h +++ b/modules/graph/grin/src/utils.h @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "grin/include/predefine.h" +#include "modules/graph/grin/include/predefine.h" #include "src/client/client.h" #include "modules/graph/fragment/arrow_fragment.h" From 8ee63d8eaece6c284cbeb836bd0678dd20d6dc96 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Mon, 27 Feb 2023 08:25:30 +0800 Subject: [PATCH 10/85] compile ok --- grin/src/partition/partition.cc | 246 ------------------ grin/src/property/propertylist.cc | 167 ------------ grin/src/property/propertytable.cc | 132 ---------- grin/src/property/type.cc | 211 --------------- grin/src/topology/adjacentlist.cc | 105 -------- grin/src/topology/structure.cc | 122 --------- grin/src/topology/vertexlist.cc | 78 ------ modules/graph/CMakeLists.txt | 4 +- modules/graph/fragment/arrow_fragment.grin.h | 16 +- modules/graph/grin/src/partition/partition.cc | 9 +- .../graph/grin/src/predefine.cc | 83 +----- modules/graph/grin/src/predefine.h | 126 ++------- modules/graph/grin/src/property/property.cc | 2 +- .../graph/grin/src/property/propertylist.cc | 27 +- .../graph/grin/src/property/propertytable.cc | 4 +- modules/graph/grin/src/property/type.cc | 8 +- .../graph/grin/src/topology/adjacentlist.cc | 4 +- modules/graph/grin/src/topology/structure.cc | 4 +- modules/graph/grin/src/topology/vertexlist.cc | 4 +- modules/graph/grin/src/utils.h | 28 -- 20 files changed, 64 insertions(+), 1316 deletions(-) delete mode 100644 grin/src/partition/partition.cc delete mode 100644 grin/src/property/propertylist.cc delete mode 100644 grin/src/property/propertytable.cc delete mode 100644 grin/src/property/type.cc delete mode 100644 grin/src/topology/adjacentlist.cc delete mode 100644 grin/src/topology/structure.cc delete mode 100644 grin/src/topology/vertexlist.cc rename grin/src/predefine.h => modules/graph/grin/src/predefine.cc (59%) delete mode 100644 modules/graph/grin/src/utils.h diff --git a/grin/src/partition/partition.cc b/grin/src/partition/partition.cc deleted file mode 100644 index b6e7674c9..000000000 --- a/grin/src/partition/partition.cc +++ /dev/null @@ -1,246 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/src/utils.h" -#include "modules/graph/grin/include/partition/partition.h" -#include "modules/graph/fragment/property_graph_types.h" -#include "src/client/client.h" - - -#ifdef ENABLE_GRAPH_PARTITION -size_t get_total_partitions_number(const PartitionedGraph pg) { - auto _pg = static_cast(pg); - return _pg->total_frag_num(); -} - -PartitionList get_local_partition_list(const PartitionedGraph pg) { - auto _pg = static_cast(pg); - auto pl = new PartitionList_T(); - vineyard::Client client; - client.Connect(); - for (const auto & [fid, location] : _pg->FragmentLocations()) { - if (location == client.instance_id()) { - pl->push_back(fid); - } - } - return pl; -} - -void destroy_partition_list(PartitionList pl) { - auto _pl = static_cast(pl); - delete _pl; -} - -PartitionList create_partition_list() { - auto pl = new PartitionList_T(); - return pl; -} - -bool insert_partition_to_list(PartitionList pl, const Partition p) { - auto _pl = static_cast(pl); - auto _p = static_cast(p); - _pl->push_back(*_p); - return true; -} - -size_t get_partition_list_size(const PartitionList pl) { - auto _pl = static_cast(pl); - return _pl->size(); -} - -Partition get_partition_from_list(const PartitionList pl, const size_t idx) { - auto _pl = static_cast(pl); - auto p = new Partition_T((*_pl)[idx]); - return p; -} - -void destroy_partition(Partition p) { - auto _p = static_cast(p); - delete _p; -} - -void* get_partition_info(const PartitionedGraph pg, const Partition p) { - return NULL; -} - -Graph get_local_graph_from_partition(const PartitionedGraph pg, const Partition p) { - auto _pg = static_cast(pg); - auto _p = static_cast(p); - vineyard::Client client; - client.Connect(); - return get_graph_by_object_id(client, _pg->Fragments().at(*_p)); -} -#endif - -#ifdef NATURAL_PARTITION_ID_TRAIT -Partition get_partition_from_id(const PartitionID pid) { - auto p = new Partition_T(pid); - return p; -} - -PartitionID get_partition_id(const Partition p) { - auto _p = static_cast(p); - return *_p; -} -#endif - - -#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST) -VertexList get_master_vertices(const Graph g) { - auto _g = static_cast(g); - auto _vl = new VertexList_T(); - for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - _vl->push_back(_g->InnerVertices(vtype)); - } - return _vl; -} - -VertexList get_mirror_vertices(const Graph g) { - auto _g = static_cast(g); - auto _vl = new VertexList_T(); - for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - _vl->push_back(_g->OuterVertices(vtype)); - } - return _vl; -} - -VertexList get_mirror_vertices_by_partition(const Graph g, const Partition p) { - return NULL_LIST; -} - -#ifdef WITH_VERTEX_PROPERTY -VertexList get_master_vertices_by_type(const Graph g, const VertexType vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto _vl = new VertexList_T(); - _vl->push_back(_g->InnerVertices(*_vtype)); - return _vl; -} - -VertexList get_mirror_vertices_by_type(const Graph g, const VertexType vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto _vl = new VertexList_T(); - _vl->push_back(_g->OuterVertices(*_vtype)); - return _vl; -} - -VertexList get_mirror_vertices_by_type_partition(const Graph g, const VertexType vtype, - const Partition p) { - return NULL_LIST; -} -#endif -#endif - -#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_ADJACENT_LIST) -AdjacentList get_adjacent_master_list(const Graph g, const Direction d, const Vertex v) { - return NULL_LIST; -} - -AdjacentList get_adjacent_mirror_list(const Graph g, const Direction d, const Vertex v) { - return NULL_LIST; -} - -AdjacentList get_adjacent_mirror_list_by_partition(const Graph g, const Direction d, - const Partition p, const Vertex v) { - return NULL_LIST; -} -#endif - - -#ifdef ENABLE_VERTEX_REF -VertexRef get_vertex_ref_for_vertex(const Graph g, const Partition p, const Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto gid = _g->Vertex2Gid(*_v); - auto vr = new VertexRef_T(gid); - return vr; -} - -Vertex get_vertex_from_vertex_ref(const Graph g, const VertexRef vr) { - auto _g = static_cast(g); - auto _vr = static_cast(vr); - auto v = new Vertex_T(); - if (_g->Gid2Vertex(*_vr, *v)) { - return v; - } - return NULL_VERTEX; -} - -Partition get_master_partition_from_vertex_ref(const Graph g, const VertexRef vr) { - auto _g = static_cast(g); - auto _vr = static_cast(vr); - auto id_parser = vineyard::IdParser(); - id_parser.Init(_g->fnum(), _g->vertex_label_num()); - auto p = new Partition_T(id_parser.GetFid(*_vr)); - return p; -} - -char* serialize_vertex_ref(const Graph g, const VertexRef vr) { - auto _vr = static_cast(vr); - std::stringstream ss; - ss << *_vr; - int len = ss.str().length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", ss.str().c_str()); - return out; -} - -VertexRef deserialize_to_vertex_ref(const Graph g, const char* msg) { - std::stringstream ss(msg); - VertexRef_T gid; - ss >> gid; - auto vr = new VertexRef_T(gid); - return vr; -} -#endif - -#ifdef ENABLE_GRAPH_PARTITION -bool is_vertex_neighbor_local_complete(const Graph g, const Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - return _g->IsInnerVertex(*_v); -} - -PartitionList vertex_neighbor_complete_partitions(const Graph g, const Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto pl = new PartitionList_T(); - pl->push_back(_g->GetFragId(*_v)); - return pl; -} -#endif - -#ifdef WITH_VERTEX_PROPERTY -bool is_vertex_property_local_complete(const Graph g, const Vertex v) { - return is_vertex_neighbor_local_complete(g, v); -} - -PartitionList vertex_property_complete_partitions(const Graph g, const Vertex v) { - return vertex_neighbor_complete_partitions(g, v); -} -#endif - - -#ifdef WITH_EDGE_PROPERTY -bool is_edge_property_local_complete(const Graph g, const Edge e) { - return true; -} - -PartitionList edge_property_complete_partitions(const Graph g, const Edge e) { - return NULL_LIST; -} -#endif diff --git a/grin/src/property/propertylist.cc b/grin/src/property/propertylist.cc deleted file mode 100644 index 37a03ef6e..000000000 --- a/grin/src/property/propertylist.cc +++ /dev/null @@ -1,167 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/src/utils.h" -#include "modules/graph/grin/include/property/propertylist.h" - -#ifdef WITH_VERTEX_PROPERTY -VertexPropertyList get_all_vertex_properties_by_type(const Graph g, const VertexType vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto vpl = new VertexPropertyList_T(); - for (auto p = 0; p < _g->vertex_property_num(*_vtype); ++p) { - vpl->push_back(VertexProperty_T(*_vtype, p)); - } - return vpl; -} - -size_t get_vertex_property_list_size(const VertexPropertyList vpl) { - auto _vpl = static_cast(vpl); - return _vpl->size(); -} - -VertexProperty get_vertex_property_from_list(const VertexPropertyList vpl, const size_t idx) { - auto _vpl = static_cast(vpl); - auto vp = new VertexProperty_T((*_vpl)[idx]); - return vp; -} - -VertexPropertyList create_vertex_property_list() { - auto vpl = new VertexPropertyList_T(); - return vpl; -} - -void destroy_vertex_property_list(VertexPropertyList vpl) { - auto _vpl = static_cast(vpl); - delete _vpl; -} - -bool insert_vertex_property_to_list(VertexPropertyList vpl, const VertexProperty vp) { - auto _vpl = static_cast(vpl); - auto _vp = static_cast(vp); - _vpl->push_back(*_vp); - return true; -} -#endif - - -#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT -VertexProperty get_vertex_property_from_id(const VertexType vtype, const VertexPropertyID vpi) { - auto _vtype = static_cast(vtype); - auto vp = new VertexProperty_T(*_vtype, vpi); - return vp; -} - -VertexPropertyID get_vertex_property_id(const VertexType vtype, const VertexProperty vp) { - auto _vtype = static_cast(vtype); - auto _vp = static_cast(vp); - if (*_vtype != _vp->first) return NULL_NATURAL_ID; - return _vp->second; -} -#endif - - -#ifdef WITH_EDGE_PROPERTY -EdgePropertyList get_all_edge_properties_by_type(const Graph g, const EdgeType etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); - auto epl = new EdgePropertyList_T(); - for (auto p = 0; p < _g->edge_property_num(*_etype); ++p) { - epl->push_back(EdgeProperty_T(*_etype, p)); - } - return epl; -} - -size_t get_edge_property_list_size(const EdgePropertyList epl) { - auto _epl = static_cast(epl); - return _epl->size(); -} - -EdgeProperty get_edge_property_from_list(const EdgePropertyList epl, const size_t idx) { - auto _epl = static_cast(epl); - auto ep = new EdgeProperty_T((*_epl)[idx]); - return ep; -} - -EdgePropertyList create_edge_property_list() { - auto epl = new EdgePropertyList_T(); - return epl; -} - -void destroy_edge_property_list(EdgePropertyList epl) { - auto _epl = static_cast(epl); - delete _epl; -} - -bool insert_edge_property_to_list(EdgePropertyList epl, const EdgeProperty ep) { - auto _epl = static_cast(epl); - auto _ep = static_cast(ep); - _epl->push_back(*_ep); - return true; -} -#endif - - -#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT -EdgeProperty get_edge_property_from_id(const EdgeType etype, const EdgePropertyID epi) { - auto _etype = static_cast(etype); - auto ep = new EdgeProperty_T(*_etype, epi); - return ep; -} - -EdgePropertyID get_edge_property_id(const EdgeType etype, const EdgeProperty ep) { - auto _etype = static_cast(etype); - auto _ep = static_cast(ep); - if (*_etype != _ep->first) return NULL_NATURAL_ID; - return _ep->second; -} -#endif - - -#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE_TRAIT) -Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { - auto _g = static_cast(g); - auto _vpl = static_cast(vpl); - std::map> vertices, edges; - for (auto& p: *_vpl) { - if (vertices.find(p.first) == vertices.end()) { - vertices.insert(p.first, {p.second}); - } else { - vertices[p.first].push_back(p.second); - } - } - vineyard::Client client; - client.Connect(); - auto object_id = _g->Project(client, vertices, edges); - return get_graph_by_object_id(client, object_id.value()); -} -#endif - -#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE_TRAIT) -Graph select_edge_properteis(const Graph g, const EdgePropertyList epl) { - auto _g = static_cast(g); - auto _epl = static_cast(epl); - std::map> vertices, edges; - for (auto& p: *_epl) { - if (edges.find(p.first) == edges.end()) { - edges.insert(p.first, {p.second}); - } else { - edges[p.first].push_back(p.second); - } - } - vineyard::Client client; - client.Connect(); - auto object_id = _g->Project(client, vertices, edges); - return get_graph_by_object_id(client, object_id.value()); -} -#endif \ No newline at end of file diff --git a/grin/src/property/propertytable.cc b/grin/src/property/propertytable.cc deleted file mode 100644 index 91699dc77..000000000 --- a/grin/src/property/propertytable.cc +++ /dev/null @@ -1,132 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/include/property/propertytable.h" - -#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) -void destroy_row(Row r) { - auto _r = static_cast(r); - delete _r; -} - -const void* get_value_from_row(Row r, const size_t idx) { - auto _r = static_cast(r); - return (*_r)[idx]; -} - -Row create_row() { - auto r = new Row_T(); - return r; -} - -bool insert_value_to_row(Row r, const void* value) { - auto _r = static_cast(r); - _r->push_back(value); - return true; -} -#endif - - -#ifdef WITH_VERTEX_PROPERTY -void destroy_vertex_property_table(VertexPropertyTable vpt) { - auto _vpt = static_cast(vpt); - delete _vpt; -} - -VertexPropertyTable get_vertex_property_table_by_type(const Graph g, const VertexType vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto vpt = new VertexPropertyTable_T(); - vpt->g = _g; - vpt->vtype = *_vtype; - vpt->vertices = _g->InnerVertices(*_vtype); - return vpt; -} - -const void* get_value_from_vertex_property_table(const VertexPropertyTable vpt, - const Vertex v, const VertexProperty vp) { - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - auto _vp = static_cast(vp); - if (_vp->first != _vpt->vtype || !_vpt->vertices.Contain(*_v)) return NULL; - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _vpt->g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - return result; -} - -Row get_row_from_vertex_property_table(const VertexPropertyTable vpt, const Vertex v, - const VertexPropertyList vpl) { - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - auto _vpl = static_cast(vpl); - if (!_vpt->vertices.Contain(*_v)) return NULL; - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - - auto r = new Row_T(); - for (auto vp: *_vpl) { - if (vp.first != _vpt->vtype) return NULL; - auto array = _vpt->g->vertex_data_table(vp.first)->column(vp.second)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - r->push_back(result); - } - return r; -} -#endif - -#ifdef WITH_EDGE_PROPERTY -void destroy_edge_property_table(EdgePropertyTable ept) { - auto _ept = static_cast(ept); - delete _ept; -} - -EdgePropertyTable get_edge_property_table_by_type(const Graph g, const EdgeType etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); - auto ept = new EdgePropertyTable_T(); - ept->g = _g; - ept->etype = *_etype; - ept->num = _g->edge_data_table(*_etype)->num_rows(); - return ept; -} - -const void* get_value_from_edge_property_table(const EdgePropertyTable ept, - const Edge e, const EdgeProperty ep) { - auto _ept = static_cast(ept); - auto _e = static_cast(e); - auto _ep = static_cast(ep); - if (_ep->first != _ept->etype || _e->eid >= _ept->num) return NULL; - auto offset = _e->eid; - auto array = _ept->g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - return result; -} - -Row get_row_from_edge_property_table(const EdgePropertyTable ept, const Edge v, - const EdgePropertyList epl) { - auto _ept = static_cast(ept); - auto _e = static_cast(v); - auto _epl = static_cast(epl); - if (_e->eid >= _ept->num) return NULL; - auto offset = _e->eid; - - auto r = new Row_T(); - for (auto ep: *_epl) { - if (ep.first != _ept->etype) return NULL; - auto array = _ept->g->edge_data_table(ep.first)->column(ep.second)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - r->push_back(result); - } - return r; -} -#endif diff --git a/grin/src/property/type.cc b/grin/src/property/type.cc deleted file mode 100644 index 08686dad4..000000000 --- a/grin/src/property/type.cc +++ /dev/null @@ -1,211 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/include/property/type.h" - -#ifdef WITH_VERTEX_PROPERTY -VertexType get_vertex_type(const Graph g, const Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto vt = new VertexType_T(_g->vertex_label(*_v)); - return vt; -} - -char* get_vertex_type_name(const Graph g, const VertexType vt) { - auto _g = static_cast(g); - auto _vt = static_cast(vt); - auto s = std::move(_g->schema().GetVertexLabelName(*_vt)); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; -} - -VertexType get_vertex_type_by_name(const Graph g, char* name) { - auto _g = static_cast(g); - auto s = std::string(name); - auto vt = new VertexType_T(_g->schema().GetVertexLabelId(s)); - return vt; -} - -VertexTypeList get_vertex_type_list(const Graph g) { - auto _g = static_cast(g); - auto vtl = new VertexTypeList_T(); - for (auto i = 0; i < _g->vertex_label_num(); ++i) { - vtl->push_back(i); - } - return vtl; -} - -void destroy_vertex_type_list(VertexTypeList vtl) { - auto _vtl = static_cast(vtl); - delete _vtl; -} - -VertexTypeList create_vertex_type_list() { - auto vtl = new VertexTypeList_T(); - return vtl; -} - -bool insert_vertex_type_to_list(VertexTypeList vtl, const VertexType vt) { - auto _vtl = static_cast(vtl); - auto _vt = static_cast(vt); - _vtl->push_back(*_vt); - return true; -} - -size_t get_vertex_type_list_size(const VertexTypeList vtl) { - auto _vtl = static_cast(vtl); - return _vtl->size(); -} - -VertexType get_vertex_type_from_list(const VertexTypeList vtl, const size_t idx) { - auto _vtl = static_cast(vtl); - auto vt = new VertexType_T((*_vtl)[idx]); - return vt; -} -#endif - - -#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT -VertexTypeID get_vertex_type_id(const VertexType vt) { - auto _vt = static_cast(vt); - return *_vt; -} - -VertexType get_vertex_type_from_id(const VertexTypeID vti) { - auto vt = new VertexType_T(vti); - return vt; -} -#endif - - -#ifdef WITH_EDGE_PROPERTY -EdgeType get_edge_type(const Graph g, const Edge e) { - auto _e = static_cast(e); - auto et = new EdgeType_T(_e->etype); - return et; -} - -char* get_edge_type_name(const Graph g, const EdgeType et) { - auto _g = static_cast(g); - auto _et = static_cast(et); - auto s = std::move(_g->schema().GetEdgeLabelName(*_et)); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; -} - -EdgeType get_edge_type_by_name(const Graph g, char* name) { - auto _g = static_cast(g); - auto s = std::string(name); - auto et = new EdgeType_T(_g->schema().GetEdgeLabelId(s)); - return et; -} - -EdgeTypeList get_edge_type_list(const Graph g) { - auto _g = static_cast(g); - auto etl = new EdgeTypeList_T(); - for (auto i = 0; i < _g->edge_label_num(); ++i) { - etl->push_back(i); - } - return etl; -} - -void destroy_edge_type_list(EdgeTypeList etl) { - auto _etl = static_cast(etl); - delete _etl; -} - -EdgeTypeList create_edge_type_list() { - auto etl = new EdgeTypeList_T(); - return etl; -} - -bool insert_edge_type_to_list(EdgeTypeList etl, const EdgeType et) { - auto _etl = static_cast(etl); - auto _et = static_cast(et); - _etl->push_back(*_et); - return true; -} - -size_t get_edge_type_list_size(const EdgeTypeList etl) { - auto _etl = static_cast(etl); - return _etl->size(); -} - -EdgeType get_edge_type_from_list(const EdgeTypeList etl, const size_t idx) { - auto _etl = static_cast(etl); - auto et = new VertexType_T((*_etl)[idx]); - return et; -} -#endif - - -#ifdef NATURAL_EDGE_TYPE_ID_TRAIT -EdgeTypeID get_edge_type_id(const EdgeType et) { - auto _et = static_cast(et); - return *_et; -} - -EdgeType get_edge_type_from_id(const EdgeTypeID eti) { - auto et = new EdgeType_T(eti); - return et; -} -#endif - - -#if defined(WITH_VERTEX_PROPERTY) && defined(WITH_EDGE_PROPERTY) -VertexTypeList get_src_types_from_edge_type(const Graph g, const EdgeType etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); - auto entry = _g->schema().GetEntry(*_etype, "EDGE"); - auto vtl = new VertexTypeList_T(); - for (auto& pair : entry.relations) { - vtl->push_back(VertexType_T(_g->schema().GetVertexLabelId(pair.first))); - } - return vtl; -} - -VertexTypeList get_dst_types_from_edge_type(const Graph g, const EdgeType etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); - auto entry = _g->schema().GetEntry(*_etype, "EDGE"); - auto vtl = new VertexTypeList_T(); - for (auto& pair : entry.relations) { - vtl->push_back(VertexType_T(_g->schema().GetVertexLabelId(pair.second))); - } - return vtl; -} - -EdgeTypeList get_edge_types_from_vertex_type_pair(const Graph g, const VertexType src_vt, - const VertexType dst_vt) { - auto _g = static_cast(g); - auto _v1 = static_cast(src_vt); - auto _v2 = static_cast(dst_vt); - auto str_v1 = _g->schema().GetVertexLabelName(*_v1); - auto str_v2 = _g->schema().GetVertexLabelName(*_v2); - - auto etl = new EdgeTypeList_T(); - for (auto etype = 0; etype < _g->edge_label_num(); ++etype) { - auto entry = _g->schema().GetEntry(etype, "EDGE"); - for (auto& pair : entry.relations) { - if (pair.first == str_v1 && pair.second == str_v2) { - etl->push_back(EdgeType_T(etype)); - } - } - } - return etl; -} -#endif diff --git a/grin/src/topology/adjacentlist.cc b/grin/src/topology/adjacentlist.cc deleted file mode 100644 index 1476aa22f..000000000 --- a/grin/src/topology/adjacentlist.cc +++ /dev/null @@ -1,105 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/include/topology/adjacentlist.h" - -#ifdef ENABLE_ADJACENT_LIST -AdjacentList get_adjacent_list(const Graph g, const Direction d, const Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto al = new AdjacentList_T(); - al->v = v; - al->dir = d; - al->etype = _g->edge_label_num(); - for (EdgeType_T etype = 0; etype < al->etype; ++etype) { - if (d == Direction::IN) { - al->data.push_back(_g->GetIncomingRawAdjList(*_v, etype)); - } else { - al->data.push_back(_g->GetOutgoingRawAdjList(*_v, etype)); - } - } - return al; -} - -#ifdef WITH_EDGE_PROPERTY -AdjacentList get_adjacent_list_by_edge_type(const Graph g, const Direction d, - const Vertex v, const EdgeType etype) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto _etype = static_cast(etype); - auto al = new AdjacentList_T(); - al->v = v; - al->dir = d; - al->etype = *_etype; - if (d == Direction::IN) { - al->data.push_back(_g->GetIncomingRawAdjList(*_v, *_etype)); - } else { - al->data.push_back(_g->GetOutgoingRawAdjList(*_v, *_etype)); - } - return al; -} -#endif - -void destroy_adjacent_list(AdjacentList al) { - auto _al = static_cast(al); - delete _al; -} - -size_t get_adjacent_list_size(const AdjacentList al) { - auto _al = static_cast(al); - size_t result = 0; - for (auto &ral : _al->data) { - result += ral.Size(); - } - return result; -} - -Vertex get_neighbor_from_adjacent_list(const AdjacentList al, size_t idx) { - auto _al = static_cast(al); - size_t result = 0; - for (auto &ral : _al->data) { - result += ral.Size(); - if (idx < result) { - auto _idx = idx - (result - ral.size()); - auto _nbr = ral.begin() + _idx; - auto v = new Vertex_T(_nbr->vid); - return v; - } - } - return NULL_VERTEX; -} - -Edge get_edge_from_adjacent_list(const AdjacentList al, size_t idx) { - auto _al = static_cast(al); - size_t result = 0; - for (auto i = 0; i < _al->data.size(); ++i) { - result += _al->data[i].Size(); - if (idx < result) { - auto _idx = idx - (result - _al->data[i].Size()); - auto _nbr = _al->data[i].begin() + _idx; - auto v = new Vertex_T(_nbr->vid); - auto e = new Edge_T(); - e->src = _al->v; - e->dst = v; - e->dir = _al->dir; - e->etype = _al->data.size() > 1 ? i : _al->etype; - e->eid = _nbr->eid; - return e; - } - } - return NULL_EDGE; -} -#endif \ No newline at end of file diff --git a/grin/src/topology/structure.cc b/grin/src/topology/structure.cc deleted file mode 100644 index 43bb9295f..000000000 --- a/grin/src/topology/structure.cc +++ /dev/null @@ -1,122 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/include/topology/structure.h" - -bool is_directed(const Graph g) { - auto _g = static_cast(g); - return _g->directed(); -} - -bool is_multigraph(const Graph g) { - auto _g = static_cast(g); - return _g->is_multigraph(); -} - -size_t get_vertex_num(const Graph g) { - auto _g = static_cast(g); - size_t result = 0; - for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - result += _g->GetVerticesNum(vtype); - } - return result; -} - -#ifdef WITH_VERTEX_PROPERTY -size_t get_vertex_num_by_type(const Graph g, const VertexType vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - return _g->GetVerticesNum(*_vtype); -} -#endif - -size_t get_edge_num(const Graph g) { - auto _g = static_cast(g); - return _g->GetEdgeNum(); -} - -#ifdef WITH_EDGE_PROPERTY -size_t get_edge_num_by_type(const Graph g, const EdgeType etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); - return _g->edge_data_table(*_etype)->num_rows(); -} -#endif - -// Vertex -void destroy_vertex(Vertex v) { - auto _v = static_cast(v); - delete _v; -} - -#ifdef WITH_VERTEX_ORIGINAL_ID -Vertex get_vertex_from_original_id(const Graph g, const OriginalID oid) { - auto _g = static_cast(g); - Vertex result; - for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - result = get_vertex_from_original_id_by_type(g, &vtype, oid); - if (result != NULL_VERTEX) { - return result; - } - } - return NULL_VERTEX; -} - -OriginalID get_vertex_original_id(const Graph g, const Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto gid = _g->Vertex2Gid(*_v); - auto oid = new OriginalID_T(_g->Gid2Oid(gid)); - return oid; -} - -void destroy_vertex_original_id(OriginalID oid) { - auto _oid = static_cast(oid); - delete _oid; -} -#endif - -#if defined(WITH_VERTEX_ORIGINAL_ID) && defined(WITH_VERTEX_PROPERTY) -Vertex get_vertex_from_original_id_by_type(const Graph g, const VertexType vtype, const OriginalID oid) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto _oid = static_cast(oid); - Graph_T::vid_t gid; - auto v = new Vertex_T(); - if (_g->Oid2Gid(*_vtype, *_oid, gid)) { - if (_g->Gid2Vertex(gid, *v)) { - return v; - } - } - return NULL_VERTEX; -} -#endif - -// Edge -void destroy_edge(Edge e) { - auto _e = static_cast(e); - delete _e; -} - -Vertex get_edge_src(const Graph g, const Edge e) { - auto _e = static_cast(e); - return _e->src; -} - -Vertex get_edge_dst(const Graph g, const Edge e) { - auto _e = static_cast(e); - return _e->dst; -} diff --git a/grin/src/topology/vertexlist.cc b/grin/src/topology/vertexlist.cc deleted file mode 100644 index 36d40c101..000000000 --- a/grin/src/topology/vertexlist.cc +++ /dev/null @@ -1,78 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/include/topology/vertexlist.h" - -#ifdef ENABLE_VERTEX_LIST -VertexList get_vertex_list(const Graph g) { - auto _g = static_cast(g); - auto vl = new VertexList_T(); - for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - vl->push_back(_g->Vertices(vtype)); - } - return vl; -} - -#ifdef WITH_VERTEX_PROPERTY -VertexList get_vertex_list_by_type(const Graph g, const VertexType vtype) { - auto _g = static_cast(g); - auto vl = new VertexList_T(); - auto _vtype = static_cast(vtype); - vl->push_back(_g->Vertices(*_vtype)); - return vl; -} -#endif - -void destroy_vertex_list(VertexList vl) { - auto _vl = static_cast(vl); - delete _vl; -} - -VertexList create_vertex_list() { - auto vl = new VertexList_T(); - return vl; -} - -bool insert_vertex_to_list(VertexList vl, const Vertex v) { - auto _vl = static_cast(vl); - auto _v = static_cast(v); - _vl->push_back(Graph_T::vertex_range_t(_v->GetValue(), _v->GetValue())); - return true; -} - -size_t get_vertex_list_size(const VertexList vl) { - auto _vl = static_cast(vl); - size_t result = 0; - for (auto &vr : *_vl) { - result += vr.size(); - } - return result; -} - -Vertex get_vertex_from_list(const VertexList vl, const size_t idx) { - auto _vl = static_cast(vl); - size_t result = 0; - for (auto &vr : *_vl) { - result += vr.size(); - if (idx < result) { - auto _idx = idx - (result - vr.size()); - auto v = new Vertex_T(vr.begin_value() + _idx); - return v; - } - } - return NULL_VERTEX; -} -#endif diff --git a/modules/graph/CMakeLists.txt b/modules/graph/CMakeLists.txt index 89e189354..3c112fbd1 100644 --- a/modules/graph/CMakeLists.txt +++ b/modules/graph/CMakeLists.txt @@ -42,13 +42,15 @@ add_custom_target(vineyard_graph_java_gen add_dependencies(vineyard_graph_gen vineyard_basic_gen) file(GLOB_RECURSE GRAPH_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}" "fragment/*.cc" - "modules/graph/grin/*.cc" + "grin/*.cc" "loader/*.cc" "utils/*.cc" "vertex_map/*.cc" "writer/*.cc" ) +message(${GRAPH_SRC_FILES}) + add_library(vineyard_graph ${GRAPH_SRC_FILES}) target_add_debuginfo(vineyard_graph) target_compile_options(vineyard_graph PUBLIC "-fopenmp") diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index 5069de715..9657b04f3 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -50,14 +50,14 @@ limitations under the License. #include "graph/vertex_map/arrow_vertex_map.h" extern "C" { -#include "modules/graph/grin/include/topology/structure.h" -#include "modules/graph/grin/include/topology/vertexlist.h" -#include "modules/graph/grin/include/topology/edgelist.h" -#include "modules/graph/grin/include/topology/adjacentlist.h" -#include "modules/graph/grin/include/partition/partition.h" -#include "modules/graph/grin/include/propertygraph/label.h" -#include "modules/graph/grin/include/propertygraph/property.h" -#include "modules/graph/grin/include/propertygraph/propertygraph.h" +#include "graph/grin/include/topology/structure.h" +#include "graph/grin/include/topology/vertexlist.h" +#include "graph/grin/include/topology/edgelist.h" +#include "graph/grin/include/topology/adjacentlist.h" +#include "graph/grin/include/partition/partition.h" +#include "graph/grin/include/propertygraph/label.h" +#include "graph/grin/include/propertygraph/property.h" +#include "graph/grin/include/propertygraph/propertygraph.h" } namespace gs { diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index b6e7674c9..294701371 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -13,11 +13,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/src/utils.h" -#include "modules/graph/grin/include/partition/partition.h" -#include "modules/graph/fragment/property_graph_types.h" -#include "src/client/client.h" +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/partition/partition.h" +#include "graph/fragment/property_graph_types.h" +#include "client/client.h" #ifdef ENABLE_GRAPH_PARTITION diff --git a/grin/src/predefine.h b/modules/graph/grin/src/predefine.cc similarity index 59% rename from grin/src/predefine.h rename to modules/graph/grin/src/predefine.cc index 456e570e8..67e787f0b 100644 --- a/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.cc @@ -12,15 +12,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "modules/graph/grin/include/predefine.h" -#include "modules/graph/fragment/arrow_fragment.h" -#include "modules/graph/fragment/arrow_fragment_group.h" -#include "arrow/api.h" +#include "graph/grin/src/predefine.h" - -#ifndef GRIN_SRC_PREDEFINE_H_ -#define GRIN_SRC_PREDEFINE_H_ +Graph get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { + auto frag = std::dynamic_pointer_cast>(client.GetObject(object_id)); + return frag.get(); +} template struct DataTypeEnum { @@ -119,74 +117,3 @@ DataType ArrowToDataType(std::shared_ptr type) { } return DataType::Undefined; } - -#define G_OID_T int -#define G_VID_T unsigned - -/* The following data types shall be defined through typedef. */ -typedef vineyard::ArrowFragment Graph_T; -typedef Graph_T::vertex_t Vertex_T; -struct Edge_T { - Vertex src; - Vertex dst; - Direction dir; - unsigned etype; - Graph_T::eid_t eid; -}; - -#ifdef WITH_VERTEX_ORIGINAL_ID -typedef Graph_T::oid_t OriginalID_T; -#endif - -#ifdef ENABLE_VERTEX_LIST -typedef std::vector VertexList_T; -#endif - -#ifdef ENABLE_ADJACENT_LIST -struct AdjacentList_T { - Vertex v; - Direction dir; - unsigned etype; - std::vector data; -}; -#endif - -#ifdef ENABLE_GRAPH_PARTITION -typedef vineyard::ArrowFragmentGroup PartitionedGraph_T; -typedef unsigned Partition_T; -typedef std::vector PartitionList_T; -#endif - -#ifdef ENABLE_VERTEX_REF -typedef Graph_T::vid_t VertexRef_T; -#endif - -#ifdef WITH_VERTEX_PROPERTY -typedef unsigned VertexType_T; -typedef std::vector VertexTypeList_T; -typedef std::pair VertexProperty_T; -typedef std::vector VertexPropertyList_T; -struct VertexPropertyTable_T { - Graph_T* g, - unsigned vtype, - Graph_T::vertices_t vertices -}; -#endif - -#ifdef WITH_EDGE_PROPERTY -typedef unsigned EdgeType_T; -typedef std::vector EdgeTypeList_T; -typedef std::pair EdgeProperty_T; -typedef std::vector EdgePropertyList_T; -struct EdgePropertyTable_T { - Graph_T* g, - unsigned etype, - unsigned num -}; -#endif - -#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) -typedef std::vector Row_T; -#endif - -#endif // GRIN_SRC_PREDEFINE_H_ diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 456e570e8..37096ab51 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -12,116 +12,24 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "modules/graph/grin/include/predefine.h" -#include "modules/graph/fragment/arrow_fragment.h" -#include "modules/graph/fragment/arrow_fragment_group.h" - -#include "arrow/api.h" - #ifndef GRIN_SRC_PREDEFINE_H_ #define GRIN_SRC_PREDEFINE_H_ -template -struct DataTypeEnum { - static constexpr DataType value = DataType::Undefined; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Int32; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::UInt32; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Int64; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::UInt64; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Float; -}; +#include "graph/grin/include/predefine.h" +#include "graph/fragment/arrow_fragment.h" +#include "graph/fragment/arrow_fragment_group.h" +#include "graph/fragment/arrow_fragment_impl.h" -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Double; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::String; -}; +#include "client/client.h" +#include "arrow/api.h" -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Date32; -}; +Graph get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id); +std::string GetDataTypeName(DataType); +DataType ArrowToDataType(std::shared_ptr); -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Date64; -}; - -std::string GetDataTypeName(DataType type) { - switch (type) { - case DataType::Int32: - return "int32"; - case DataType::UInt32: - return "uint32"; - case DataType::Int64: - return "int64"; - case DataType::UInt64: - return "uint64"; - case DataType::Float: - return "float"; - case DataType::Double: - return "double"; - case DataType::String: - return "string"; - case DataType::Date32: - return "date32"; - case DataType::Date64: - return "date64"; - default: - return "undefined"; - } -} - -DataType ArrowToDataType(std::shared_ptr type) { - if (type == nullptr) { - return DataType::Undefined; - } else if (arrow::int32()->Equals(type)) { - return DataType::Int32; - } else if (arrow::int64()->Equals(type)) { - return DataType::Int64; - } else if (arrow::float32()->Equals(type)) { - return DataType::Float; - } else if (arrow::uint32()->Equals(type)) { - return DataType::UInt32; - } else if (arrow::uint64()->Equals(type)) { - return DataType::UInt64; - } else if (arrow::float64()->Equals(type)) { - return DataType::Double; - } else if (arrow::utf8()->Equals(type)) { - return DataType::String; - } else if (arrow::large_utf8()->Equals(type)) { - return DataType::String; - } - return DataType::Undefined; -} - -#define G_OID_T int -#define G_VID_T unsigned +#define G_OID_T int64_t +#define G_VID_T uint64_t /* The following data types shall be defined through typedef. */ typedef vineyard::ArrowFragment Graph_T; @@ -167,9 +75,9 @@ typedef std::vector VertexTypeList_T; typedef std::pair VertexProperty_T; typedef std::vector VertexPropertyList_T; struct VertexPropertyTable_T { - Graph_T* g, - unsigned vtype, - Graph_T::vertices_t vertices + Graph_T* g; + unsigned vtype; + Graph_T::vertices_t vertices; }; #endif @@ -179,9 +87,9 @@ typedef std::vector EdgeTypeList_T; typedef std::pair EdgeProperty_T; typedef std::vector EdgePropertyList_T; struct EdgePropertyTable_T { - Graph_T* g, - unsigned etype, - unsigned num + Graph_T* g; + unsigned etype; + unsigned num; }; #endif diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index f582cbfa8..d72238974 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -10,7 +10,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "modules/graph/grin/src/predefine.h" +#include "graph/grin/src/predefine.h" #ifdef WITH_PROPERTY_NAME char* get_vertex_property_name(const Graph g, const VertexProperty vp) { diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index 37a03ef6e..4f9c30d6e 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -10,9 +10,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/src/utils.h" -#include "modules/graph/grin/include/property/propertylist.h" +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/property/propertylist.h" #ifdef WITH_VERTEX_PROPERTY VertexPropertyList get_all_vertex_properties_by_type(const Graph g, const VertexType vtype) { @@ -132,13 +131,14 @@ EdgePropertyID get_edge_property_id(const EdgeType etype, const EdgeProperty ep) Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { auto _g = static_cast(g); auto _vpl = static_cast(vpl); - std::map> vertices, edges; + std::map> vertices, edges; for (auto& p: *_vpl) { - if (vertices.find(p.first) == vertices.end()) { - vertices.insert(p.first, {p.second}); - } else { - vertices[p.first].push_back(p.second); + int vtype = static_cast(p.first); + int vp = static_cast(p.second); + if (vertices.find(vtype) == vertices.end()) { + vertices[vtype].clear(); } + vertices[vtype].push_back(vp); } vineyard::Client client; client.Connect(); @@ -151,13 +151,14 @@ Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { Graph select_edge_properteis(const Graph g, const EdgePropertyList epl) { auto _g = static_cast(g); auto _epl = static_cast(epl); - std::map> vertices, edges; + std::map> vertices, edges; for (auto& p: *_epl) { - if (edges.find(p.first) == edges.end()) { - edges.insert(p.first, {p.second}); - } else { - edges[p.first].push_back(p.second); + int etype = static_cast(p.first); + int ep = static_cast(p.second); + if (edges.find(etype) == edges.end()) { + edges[etype].clear(); } + edges[etype].push_back(ep); } vineyard::Client client; client.Connect(); diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 91699dc77..f0c0705c8 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -10,8 +10,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/include/property/propertytable.h" +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/property/propertytable.h" #if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) void destroy_row(Row r) { diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 08686dad4..4fca14cbc 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -10,8 +10,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/include/property/type.h" +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/property/type.h" #ifdef WITH_VERTEX_PROPERTY VertexType get_vertex_type(const Graph g, const Vertex v) { @@ -24,7 +24,7 @@ VertexType get_vertex_type(const Graph g, const Vertex v) { char* get_vertex_type_name(const Graph g, const VertexType vt) { auto _g = static_cast(g); auto _vt = static_cast(vt); - auto s = std::move(_g->schema().GetVertexLabelName(*_vt)); + auto s = _g->schema().GetVertexLabelName(*_vt); int len = s.length() + 1; char* out = new char[len]; snprintf(out, len, "%s", s.c_str()); @@ -100,7 +100,7 @@ EdgeType get_edge_type(const Graph g, const Edge e) { char* get_edge_type_name(const Graph g, const EdgeType et) { auto _g = static_cast(g); auto _et = static_cast(et); - auto s = std::move(_g->schema().GetEdgeLabelName(*_et)); + auto s = _g->schema().GetEdgeLabelName(*_et); int len = s.length() + 1; char* out = new char[len]; snprintf(out, len, "%s", s.c_str()); diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 1476aa22f..dd536d273 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/include/topology/adjacentlist.h" +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/topology/adjacentlist.h" #ifdef ENABLE_ADJACENT_LIST AdjacentList get_adjacent_list(const Graph g, const Direction d, const Vertex v) { diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 43bb9295f..2966da8b1 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/include/topology/structure.h" +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/topology/structure.h" bool is_directed(const Graph g) { auto _g = static_cast(g); diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index 36d40c101..d3c195875 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -13,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -#include "modules/graph/grin/src/predefine.h" -#include "modules/graph/grin/include/topology/vertexlist.h" +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/topology/vertexlist.h" #ifdef ENABLE_VERTEX_LIST VertexList get_vertex_list(const Graph g) { diff --git a/modules/graph/grin/src/utils.h b/modules/graph/grin/src/utils.h deleted file mode 100644 index a576ca867..000000000 --- a/modules/graph/grin/src/utils.h +++ /dev/null @@ -1,28 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -#include "modules/graph/grin/include/predefine.h" -#include "src/client/client.h" -#include "modules/graph/fragment/arrow_fragment.h" - - -#ifndef GRIN_SRC_UTILS_H_ -#define GRIN_SRC_UTILS_H_ - -Graph get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { - auto frag = std::dynamic_pointer_cast>(client.GetObject(object_id)); - return frag.get(); -} - -#endif // GRIN_SRC_UTILS_H_ \ No newline at end of file From fd890eb770d19b420736129b522cadcfffcd2a2f Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 1 Mar 2023 17:18:19 +0800 Subject: [PATCH 11/85] update docs --- modules/graph/fragment/arrow_fragment.grin.h | 1225 +++++------------ .../graph/fragment/arrow_fragment.grin.idea | 1026 ++++++++++++++ modules/graph/grin/docs/README.md | 130 +- modules/graph/grin/include/index/label.h | 24 +- .../graph/grin/include/partition/partition.h | 84 +- .../graph/grin/include/property/primarykey.h | 12 +- .../graph/grin/include/property/property.h | 29 +- .../grin/include/property/propertylist.h | 28 +- .../grin/include/property/propertytable.h | 18 +- modules/graph/grin/include/property/type.h | 42 +- .../grin/include/topology/adjacentlist.h | 16 +- .../graph/grin/include/topology/edgelist.h | 18 +- .../graph/grin/include/topology/structure.h | 32 +- .../graph/grin/include/topology/vertexlist.h | 18 +- modules/graph/grin/src/partition/partition.cc | 76 +- modules/graph/grin/src/predefine.cc | 60 +- modules/graph/grin/src/predefine.h | 51 + modules/graph/grin/src/property/property.cc | 16 +- .../graph/grin/src/property/propertylist.cc | 28 +- .../graph/grin/src/property/propertytable.cc | 24 +- modules/graph/grin/src/property/type.cc | 44 +- .../graph/grin/src/topology/adjacentlist.cc | 12 +- modules/graph/grin/src/topology/structure.cc | 32 +- modules/graph/grin/src/topology/vertexlist.cc | 10 +- .../graph/test/grin_arrow_fragment_test.cc | 175 +++ 25 files changed, 1997 insertions(+), 1233 deletions(-) create mode 100644 modules/graph/fragment/arrow_fragment.grin.idea create mode 100644 modules/graph/test/grin_arrow_fragment_test.cc diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index 9657b04f3..48679d984 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -1,6 +1,3 @@ -#ifndef MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H -#define MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H - /** Copyright 2020-2023 Alibaba Group Holding Limited. Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,8 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -#ifndef MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_MOD_H_ -#define MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_MOD_H_ +#ifndef MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H +#define MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H #include #include @@ -52,1067 +49,481 @@ limitations under the License. extern "C" { #include "graph/grin/include/topology/structure.h" #include "graph/grin/include/topology/vertexlist.h" -#include "graph/grin/include/topology/edgelist.h" #include "graph/grin/include/topology/adjacentlist.h" #include "graph/grin/include/partition/partition.h" -#include "graph/grin/include/propertygraph/label.h" -#include "graph/grin/include/propertygraph/property.h" -#include "graph/grin/include/propertygraph/propertygraph.h" +#include "graph/grin/include/property/type.h" +#include "graph/grin/include/property/property.h" +#include "graph/grin/include/property/propertylist.h" +#include "graph/grin/include/property/propertytable.h" } -namespace gs { +#include "graph/grin/src/predefine.h" -template -class ArrowProjectedFragment; +namespace vineyard { -} // namespace gs +std::shared_ptr GetArrowDataType(DataType type) { + switch (type) { + case DataType::Undefined: + return arrow::null(); + case DataType::Int32: + return arrow::int32(); + case DataType::UInt32: + return arrow::uint32(); + case DataType::Int64: + return arrow::int64(); + case DataType::UInt64: + return arrow::uint64(); + case DataType::Float: + return arrow::float32(); + case DataType::Double: + return arrow::float64(); + case DataType::String: + return arrow::large_utf8(); + case DataType::Date32: + return arrow::int32(); + case DataType::Date64: + return arrow::int64(); + default: + return arrow::null(); + } +} -namespace vineyard { -template struct GRIN_Nbr { - private: - using vid_t = VID_T; - using eid_t = EID_T; - using prop_id_t = property_graph_types::PROP_ID_TYPE; - public: - GRIN_Nbr(void* g, void* edge_label, void* adj_list, size_t current) { - g_ = g; - edge_label_ = edge_label; - adj_list_ = adj_list; - current_ = current; - if (current_ == 0) { - adj_list_iter_ = get_adjacent_list_begin(adj_list_); - property_list_ = get_all_edge_properties_from_label(edge_label_); - } else { - adj_list_iter_ = nullptr; - } + GRIN_Nbr() : al_(nullptr), cur_(0), ept_(nullptr) {} + GRIN_Nbr(void* al, size_t cur, void* ept) + : al_(al), cur_(cur), ept_(ept) {} + GRIN_Nbr(GRIN_Nbr& rhs) : al_(rhs.al_), cur_(rhs.cur_), ept_(rhs.ept_) {} + + GRIN_Nbr& operator=(const GRIN_Nbr& rhs) { + al_ = rhs.al_; + cur_ = rhs.cur_; + ept_ = rhs.ept_; + return *this; } - grape::Vertex neighbor() const { - return grape::Vertex(neighbor_); + GRIN_Nbr& operator=(GRIN_Nbr&& rhs) { + al_ = rhs.al_; + cur_ = rhs.cur_; + ept_ = rhs.ept_; + return *this; } - grape::Vertex get_neighbor() const { - return grape::Vertex(neighbor_); + void* neighbor() { + return get_neighbor_from_adjacent_list(al_, cur_); } - EID_T edge_id() const { return eid_; } + void* get_neighbor() { + return get_neighbor_from_adjacent_list(al_, cur_); + } - void* get_data(prop_id_t prop_id) const { - void* _row = get_edge_row(g_, edge_, property_list_); - void* _property = get_edge_property_from_id(edge_label_, prop_id); - return get_property_value_from_row(_row, _property); + void* get_edge() { + return get_edge_from_adjacent_list(al_, cur_); } template - T get_data(prop_id_t prop_id) const { - void* _data = get_data(prop_id); - return *(static_cast(_data)); + T get_data(void* prop) const { + auto _e = get_edge_from_adjacent_list(al_, cur_); + auto value = get_value_from_edge_property_table(ept_, _e, prop); + return property_graph_utils::ValueGetter::Value(value, 0); } - std::string get_str(prop_id_t prop_id) const { - void* _data = get_data(prop_id); - return *(static_cast(_data)); + std::string get_str(void* prop) const { + auto _e = get_edge_from_adjacent_list(al_, cur_); + auto value = get_value_from_edge_property_table(ept_, _e, prop); + return property_graph_utils::ValueGetter::Value(value, 0); } - double get_double(prop_id_t prop_id) const { - void* _data = get_data(prop_id); - return *(static_cast(_data)); + double get_double(void* prop) const { + auto _e = get_edge_from_adjacent_list(al_, cur_); + auto value = get_value_from_edge_property_table(ept_, _e, prop); + return property_graph_utils::ValueGetter::Value(value, 0); } - int64_t get_int(prop_id_t prop_id) const { - void* _data = get_data(prop_id); - return *(static_cast(_data)); + int64_t get_int(void* prop) const { + auto _e = get_edge_from_adjacent_list(al_, cur_); + auto value = get_value_from_edge_property_table(ept_, _e, prop); + return property_graph_utils::ValueGetter::Value(value, 0); } - inline const GRIN_Nbr& operator++() const { - ++current_; - add_current_value(); + inline GRIN_Nbr& operator++() { + cur_++; return *this; } - inline bool operator==(const GRIN_Nbr& rhs) const { - return (current_ == rhs.current_) && (adj_list_ == rhs.adj_list_); + inline GRIN_Nbr operator++(int) { + cur_++; + return *this; } + inline GRIN_Nbr& operator--() { + cur_--; + return *this; + } + + inline GRIN_Nbr operator--(int) { + cur_--; + return *this; + } + + inline bool operator==(const GRIN_Nbr& rhs) const { + return al_ == rhs.al_ && cur_ == rhs.cur_; + } inline bool operator!=(const GRIN_Nbr& rhs) const { - return (current_ != rhs.current_) || (adj_list_ != rhs.adj_list_); + return al_ != rhs.al_ || cur_ != rhs.cur_; } inline bool operator<(const GRIN_Nbr& rhs) const { - return (current_ < rhs.current_) && (adj_list_ == rhs.adj_list_);; + return al_ == rhs.al_ && cur_ < rhs.cur_; } - inline const GRIN_Nbr& operator*() const { return *this; } + inline GRIN_Nbr& operator*() { return *this; } private: - void add_current_value() { - adj_list_iter_ = get_next_adjacent_iter(adj_list_, adj_list_iter_); - void* _v = get_neighbor_from_iter(adj_list_, adj_list_iter_); - void* _vid = get_vertex_id(_v); - neighbor_ = *(static_cast(_vid)); - edge_ = get_edge_from_iter(adj_list_, adj_list_iter); - } - - void* g_; - void* edge_label_; - void* property_list_; - void* adj_list_; - void* adj_list_iter_; - size_t current_; - VID_T neighbor_; - void* edge_; + void* al_; + size_t cur_; + void* ept_; }; -template -using GRIN_NbrDefault = GRIN_Nbr; -template class GRIN_AdjList { public: - GRIN_AdjList() : g_(NULL), edge_label_(NULL), adj_list_(NULL), sz_(0), begin_(0), end_(0) {} - GRIN_AdjList(void* g, void* edge_label, void* adj_list, size_t sz) - : g_(g), edge_label_(edge_label), adj_list_(adj_list), sz_(sz), begin_(0), end_(sz) {} + GRIN_AdjList() : adj_list_(nullptr), ept_(nullptr), begin_(0), end_(0) {} + GRIN_AdjList(void* adj_list, void* ept, size_t begin, size_t end) + : adj_list_(adj_list), ept_(ept), begin_(begin), end_(end) {} - inline GRIN_Nbr begin() const { - return GRIN_Nbr(g_, edge_label_, adj_list_, begin_); + inline GRIN_Nbr begin() const { + return GRIN_Nbr(adj_list_, begin_, ept_); } - inline GRIN_Nbr end() const { - return GRIN_Nbr(g_, edge_label_, adj_list_, end_); + inline GRIN_Nbr end() const { + return GRIN_Nbr(adj_list_, end_, ept_); } - inline size_t Size() const { return sz_; } - - inline bool Empty() const { return sz_ == 0; } + inline size_t Size() const { return end_ - begin_; } - inline bool NotEmpty() const { return sz_ > 0; } + inline bool Empty() const { return begin_ == end_; } - size_t size() const { return sz_; } + inline bool NotEmpty() const { return begin_ < end_; } - //inline const NbrUnit* begin_unit() const { return begin_; } - - //inline const NbrUnit* end_unit() const { return end_; } + size_t size() const { return end_ - begin_; } private: - const void* g_; - const void* edge_label_; - const void* adj_list_; - const size_t sz_; - const size_t begin_; - const size_t end_; + void* adj_list_; + void* ept_; + size_t begin_; + size_t end_; }; -template -using GRIN_AdjListDefault = AdjList; +class GRIN_VertexRange { + public: + GRIN_VertexRange() {} + GRIN_VertexRange(void* vl, const size_t begin, const size_t end) + : vl_(vl), begin_(begin), end_(end) {} + GRIN_VertexRange(const GRIN_VertexRange& r) : vl_(r.vl_), begin_(r.begin_), end_(r.end_) {} -inline std::string generate_name_with_suffix( - const std::string& prefix, property_graph_types::LABEL_ID_TYPE label) { - return prefix + "_" + std::to_string(label); -} + class iterator { + using reference_type = void*; -inline std::string generate_name_with_suffix( - const std::string& prefix, property_graph_types::LABEL_ID_TYPE v_label, - property_graph_types::LABEL_ID_TYPE e_label) { - return prefix + "_" + std::to_string(v_label) + "_" + std::to_string(e_label); -} + private: + void* vl_; + size_t cur_; -template -class ArrowFragmentBaseBuilder; - -template ::type, VID_T>> -class __attribute__((annotate("vineyard"))) GRIN_ArrowFragment - : public ArrowFragmentBase, - public vineyard::BareRegistered< - ArrowFragment> { - -// public: -// static std::unique_ptr Create() __attribute__((used)) { -// return std::static_pointer_cast( -// std::unique_ptr>{ -// new ArrowFragment()}); -// } - - -// public: -// void Construct(const ObjectMeta& meta) override { -// std::string __type_name = type_name>(); -// VINEYARD_ASSERT( -// meta.GetTypeName() == __type_name, -// "Expect typename '" + __type_name + "', but got '" + meta.GetTypeName() + "'"); -// this->meta_ = meta; -// this->id_ = meta.GetId(); - -// meta.GetKeyValue("fid_", this->fid_); -// meta.GetKeyValue("fnum_", this->fnum_); -// meta.GetKeyValue("directed_", this->directed_); -// meta.GetKeyValue("is_multigraph_", this->is_multigraph_); -// meta.GetKeyValue("vertex_label_num_", this->vertex_label_num_); -// meta.GetKeyValue("edge_label_num_", this->edge_label_num_); -// meta.GetKeyValue("oid_type", this->oid_type); -// meta.GetKeyValue("vid_type", this->vid_type); -// this->ivnums_.Construct(meta.GetMemberMeta("ivnums_")); -// this->ovnums_.Construct(meta.GetMemberMeta("ovnums_")); -// this->tvnums_.Construct(meta.GetMemberMeta("tvnums_")); -// for (size_t __idx = 0; __idx < meta.GetKeyValue("__vertex_tables_-size"); ++__idx) { -// this->vertex_tables_.emplace_back(std::dynamic_pointer_cast( -// meta.GetMember("__vertex_tables_-" + std::to_string(__idx)))); -// } -// for (size_t __idx = 0; __idx < meta.GetKeyValue("__ovgid_lists_-size"); ++__idx) { -// this->ovgid_lists_.emplace_back(std::dynamic_pointer_cast( -// meta.GetMember("__ovgid_lists_-" + std::to_string(__idx)))); -// } -// for (size_t __idx = 0; __idx < meta.GetKeyValue("__ovg2l_maps_-size"); ++__idx) { -// this->ovg2l_maps_.emplace_back(std::dynamic_pointer_cast>( -// meta.GetMember("__ovg2l_maps_-" + std::to_string(__idx)))); -// } -// for (size_t __idx = 0; __idx < meta.GetKeyValue("__edge_tables_-size"); ++__idx) { -// this->edge_tables_.emplace_back(std::dynamic_pointer_cast
    ( -// meta.GetMember("__edge_tables_-" + std::to_string(__idx)))); -// } -// this->ie_lists_.resize(meta.GetKeyValue("__ie_lists_-size")); -// for (size_t __idx = 0; __idx < this->ie_lists_.size(); ++__idx) { -// for (size_t __idy = 0; __idy < meta.GetKeyValue( -// "__ie_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { -// this->ie_lists_[__idx].emplace_back(std::dynamic_pointer_cast( -// meta.GetMember("__ie_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); -// } -// } -// this->oe_lists_.resize(meta.GetKeyValue("__oe_lists_-size")); -// for (size_t __idx = 0; __idx < this->oe_lists_.size(); ++__idx) { -// for (size_t __idy = 0; __idy < meta.GetKeyValue( -// "__oe_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { -// this->oe_lists_[__idx].emplace_back(std::dynamic_pointer_cast( -// meta.GetMember("__oe_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); -// } -// } -// this->ie_offsets_lists_.resize(meta.GetKeyValue("__ie_offsets_lists_-size")); -// for (size_t __idx = 0; __idx < this->ie_offsets_lists_.size(); ++__idx) { -// for (size_t __idy = 0; __idy < meta.GetKeyValue( -// "__ie_offsets_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { -// this->ie_offsets_lists_[__idx].emplace_back(std::dynamic_pointer_cast( -// meta.GetMember("__ie_offsets_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); -// } -// } -// this->oe_offsets_lists_.resize(meta.GetKeyValue("__oe_offsets_lists_-size")); -// for (size_t __idx = 0; __idx < this->oe_offsets_lists_.size(); ++__idx) { -// for (size_t __idy = 0; __idy < meta.GetKeyValue( -// "__oe_offsets_lists_-" + std::to_string(__idx) + "-size"); ++__idy) { -// this->oe_offsets_lists_[__idx].emplace_back(std::dynamic_pointer_cast( -// meta.GetMember("__oe_offsets_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)))); -// } -// } -// this->vm_ptr_ = std::dynamic_pointer_cast(meta.GetMember("vm_ptr_")); -// meta.GetKeyValue("schema_json_", this->schema_json_); - - -// if (meta.IsLocal()) { -// this->PostConstruct(meta); -// } -// } - -// private: -public: - using oid_t = OID_T; - using vid_t = VID_T; - using internal_oid_t = typename InternalType::type; - using eid_t = property_graph_types::EID_TYPE; - using prop_id_t = property_graph_types::PROP_ID_TYPE; - using label_id_t = property_graph_types::LABEL_ID_TYPE; - using vertex_range_t = grape::VertexRange; - using inner_vertices_t = vertex_range_t; - using outer_vertices_t = vertex_range_t; - using vertices_t = vertex_range_t; - using nbr_t = property_graph_utils::Nbr; - using nbr_unit_t = property_graph_utils::NbrUnit; - using adj_list_t = property_graph_utils::AdjList; - using raw_adj_list_t = property_graph_utils::RawAdjList; - using vertex_map_t = VERTEX_MAP_T; - using vertex_t = grape::Vertex; - - using ovg2l_map_t = - ska::flat_hash_map::KeyHash>; - - using vid_array_t = ArrowArrayType; - using vid_vineyard_array_t = ArrowVineyardArrayType; - using vid_vineyard_builder_t = ArrowVineyardBuilderType; - using eid_array_t = ArrowArrayType; - using eid_vineyard_array_t = ArrowVineyardArrayType; - using eid_vineyard_builder_t = ArrowVineyardBuilderType; - - using vid_builder_t = ArrowBuilderType; - - template - using vertex_array_t = grape::VertexArray; - - template - using inner_vertex_array_t = grape::VertexArray; - - template - using outer_vertex_array_t = grape::VertexArray; - - static constexpr grape::LoadStrategy load_strategy = - grape::LoadStrategy::kBothOutIn; + public: + iterator() noexcept : vl_(nullptr), cur_() {} + explicit iterator(void* vl, size_t idx) noexcept : vl_(vl), cur_(idx) {} - public: - ~GRIN_ArrowFragment() = default; - // hide vertex_map - // vineyard::ObjectID vertex_map_id() const override { return vm_ptr_->id(); } + reference_type operator*() noexcept { return get_vertex_from_list(vl_, cur_); } - void init(void* partitioned_graph) { - pg_ = partitioned_graph; - assert(get_partition_list_size(pg_) == 1); - auto pl = get_local_partitions(pg_); - auto p = get_partition_from_list(pl, 0); - g_ = get_local_graph_from_partition(pg_, p); - - directed_ = is_directed(g_); - is_multigraph_ = is_multigraph(g_); - fid_ = p; - fnum_ = get_total_partitions_number(pg_); - } + iterator& operator++() noexcept { + ++cur_; + return *this; + } - bool directed() const override { - return directed_; - } + iterator operator++(int) noexcept { + return iterator(vl_, cur_ + 1); + } - bool is_multigraph() const override { - return is_multigraph_; - } + iterator& operator--() noexcept { + --cur_; + return *this; + } - const std::string vid_typename() const override { - auto dt = get_vertex_id_data_type(g_); - return GetDataTypeName(dt); - } + iterator operator--(int) noexcept { + return iterator(vl_, cur_--); + } - const std::string oid_typename() const override { - auto dt = DataTypeEnum::value(); - return GetDataTypeName(dt); - } + iterator operator+(size_t offset) const noexcept { + return iterator(vl_, cur_ + offset); + } - fid_t fid() const { return fid_; } + bool operator==(const iterator& rhs) const noexcept { + return cur_ == rhs.cur_; + } - fid_t fnum() const { return fnum_; } + bool operator!=(const iterator& rhs) const noexcept { + return cur_ != rhs.cur_; + } - void* vertex_label(const void* v) { - return get_vertex_label(g_, v); - } + bool operator<(const iterator& rhs) const noexcept { + return vl_ == rhs.vl_ && cur_ < rhs.cur_; + } + }; - label_id_t vertex_label(const vertex_t& v) const { - void* _v = get_vertex_from_id(v.GetValue()); - void* _label = vertex_label(_v); - void* _label_id = get_label_id(g_, _label); - return *(static_cast(_label_id)) - } + iterator begin() const { return iterator(vl_, begin_); } -// int64_t vertex_offset(const vertex_t& v) const { -// // to remove ---- -// return vid_parser_.GetOffset(v.GetValue()); -// } + iterator end() const { return iterator(vl_, end_); } - label_id_t vertex_label_num() const { - void* vll = get_vertex_labels(g_); - return get_vertex_label_list_size(vll); - } + size_t size() const { return end_ - begin_; } - label_id_t edge_label_num() const { - void* ell = get_edge_labels(g_); - return get_edge_label_list_size(ell); + void Swap(GRIN_VertexRange& rhs) { + std::swap(begin_, rhs.begin_); + std::swap(end_, rhs.end_); } - prop_id_t vertex_property_num(label_id_t label) const { - void* _label = get_vertex_label_from_id((void*)(&label)); - void* vpl = get_all_vertex_properties_from_label(g_, _label); - return get_property_list_size(vpl); + void SetRange(const size_t begin, const size_t end) { + begin_ = begin; + end_ = end; } - std::shared_ptr vertex_property_type(label_id_t label, - prop_id_t prop) const { - void* _label = get_vertex_label_from_id(label) - void* _property = get_vertex_property_from_id(_label, prop); - auto dt = get_property_type(_g, _property); - return GetArrowDataType(dt); - } + const size_t begin_value() const { return begin_; } - prop_id_t edge_property_num(label_id_t label) const { - void* _label = get_edge_label_from_id((void*)(&label)); - void* epl = get_all_edge_properties_from_label(g_, _label); - return get_property_list_size(epl); - } + const size_t end_value() const { return end_; } - std::shared_ptr edge_property_type(label_id_t label, - prop_id_t prop) const { - void* _label = get_edge_label_from_id(label) - void* _property = get_edge_property_from_id(_label, prop); - auto dt = get_property_type(_g, _property); - return GetArrowDataType(dt); - } + private: + void* vl_; + size_t begin_; + size_t end_; +}; -// std::shared_ptr vertex_data_table(label_id_t i) const { -// // maybe we should get rid of the method -// // there is no way we can provide the whole data with a C-style api -// return vertex_tables_[i]->GetTable(); -// } - -// std::shared_ptr edge_data_table(label_id_t i) const { -// // Ditto. -// return edge_tables_[i]->GetTable(); -// } - -// template -// property_graph_utils::EdgeDataColumn edge_data_column( -// label_id_t label, prop_id_t prop) const { -// // get rid of this method and EdgeDataColumn structure -// // this structure actually serves to get a specific property of an edge -// // and it can be replaced by grin property get_edge_row -// if (edge_tables_[label]->num_rows() == 0) { -// return property_graph_utils::EdgeDataColumn(); -// } else { -// // the finalized etables are guaranteed to have been concatenated -// return property_graph_utils::EdgeDataColumn( -// edge_tables_[label]->column(prop)->chunk(0)); -// } -// } - -// template -// property_graph_utils::VertexDataColumn vertex_data_column( -// label_id_t label, prop_id_t prop) const { -// // Ditto. it can be replaced by grin property get_vertex_row && get_property_value_from_row -// if (vertex_tables_[label]->num_rows() == 0) { -// return property_graph_utils::VertexDataColumn( -// InnerVertices(label)); -// } else { -// // the finalized vtables are guaranteed to have been concatenated -// return property_graph_utils::VertexDataColumn( -// InnerVertices(label), vertex_tables_[label]->column(prop)->chunk(0)); -// } -// } - - vertex_range_t Vertices(label_id_t label_id) const { - //continuous vid trait - void* _label = get_vertex_label_from_id((void*)(&label_id)); - void* vlh = get_vertex_list_by_label(pg_, fid_, _label); - void* beginh = get_begin_vertex_id_from_list(vlh); - VID_T* begin = static_cast(beginh); - void* endh = get_end_vertex_id_from_list(vlh); - VID_T* end = static_cast(endh); - return vertex_range_t(*begin, *end); - } - vertex_range_t InnerVertices(label_id_t label_id) const { - //continuous vid trait - void* _label = get_vertex_label_from_id((void*)(&label_id)); - void* vlh = get_local_vertices_by_label(pg_, fid_, _label); - void* beginh = get_begin_vertex_id_from_list(vlh); - VID_T* begin = static_cast(beginh); - void* endh = get_end_vertex_id_from_list(vlh); - VID_T* end = static_cast(endh); - return vertex_range_t(*begin, *end); - } +class GRIN_ArrowFragment { + public: + using vertex_range_t = GRIN_VertexRange; + using adj_list_t = GRIN_AdjList; - vertex_range_t OuterVertices(label_id_t label_id) const { - //continuous vid trait - void* _label = get_vertex_label_from_id((void*)(&label_id)); - void* vlh = get_remote_vertices_by_label(pg_, fid_, _label); - void* beginh = get_begin_vertex_id_from_list(vlh); - VID_T* begin = static_cast(beginh); - void* endh = get_end_vertex_id_from_list(vlh); - VID_T* end = static_cast(endh); - return vertex_range_t(*begin, *end); - } + public: + ~GRIN_ArrowFragment() = default; - vertex_range_t InnerVerticesSlice(label_id_t label_id, vid_t start, vid_t end) - const { - // continuous_vid_traits - vertex_range_t vr = InnerVertices(label_id); - size_t _end = vr.size(); - CHECK(start <= end && start <= _end); - if (end <= _end) { - return vr.SetRange(start, end); - } else { - return vr.SetRange(start, _end); - } + void init(void* partitioned_graph, size_t idx) { + pg_ = partitioned_graph; + auto pl = get_local_partition_list(pg_); + assert(idx < get_partition_list_size(pl)); + partition_ = get_partition_from_list(pl, idx); + g_ = get_local_graph_from_partition(pg_, partition_); } - inline vid_t GetVerticesNum(label_id_t label_id) const { - void* _label = get_vertex_label_from_id((void*)(&label_id)); - void* vlh = get_vertex_list_by_label(pg_, fid_, _label); - return get_vertex_list_size(vlh); + bool directed() const { + return is_directed(g_); } - bool GetVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { - void* _label = get_vertex_label_from_id((void*)(&label)); - void* _v = get_vertex_from_label_origin_id(_label, (void*)(&oid)); - if (_v == NULL_VERTEX) { - return false; - } - void* _id = get_vertex_id(_v); - v.SetValue(*(static_cast(_id))); - return true; + bool multigraph() const { + return is_multigraph(g_); } - oid_t GetId(const vertex_t& v) const { - void* _v = get_vertex_from_id((void*)(&v.GetValue())); - void* _id = get_vertex_origin_id(_v); - return *(static_cast(_id)); + const std::string oid_typename() const { + auto dt = get_vertex_original_id_type(g_); + return GetDataTypeName(dt); } -// internal_oid_t GetInternalId(const vertex_t& v) const { -// return IsInnerVertex(v) ? GetInnerVertexInternalId(v) -// : GetOuterVertexInternalId(v); -// } + size_t fnum() const { return get_total_partitions_number(pg_); } - fid_t GetFragId(const vertex_t& u) const { - auto rp = get_master_partition_for_vertex(pg_, fid_, (void*)(&u)); - if (rp == NULL_REMOTE_PARTITION) { - return fid_; - } - return rp; + void* vertex_label(void* v) { + return get_vertex_type(g_, v); } - size_t GetTotalNodesNum() const { - // secondary - return GetTotalVerticesNum() + size_t vertex_label_num() const { + auto vtl = get_vertex_type_list(g_); + return get_vertex_type_list_size(vtl); } - size_t GetTotalVerticesNum() const { - void* vl = get_vertex_list(g_); - return get_vertex_list_size(vl); - } - size_t GetTotalVerticesNum(label_id_t label) const { - void* _label = get_vertex_label_from_id((void*)(&label)); - void* vl = get_vertex_list_by_label(_label); - return get_vertex_list_size(vl); - } - - // secondary - size_t GetEdgeNum() const { return directed_ ? oenum_ + ienum_ : oenum_; } - // secondary - size_t GetInEdgeNum() const { return ienum_; } - // secondary - size_t GetOutEdgeNum() const { return oenum_; } - template - T GetData(const vertex_t& v, prop_id_t prop_id) const { - void* _v = get_vertex_from_id((void*)(&v.GetValue())); - void* _label = get_vertex_label(g_, _v); - void* _property = get_vertex_property_from_id(_lable, (void*)(&prop_id)); - void* _pl = get_all_vertex_properties_from_label(g_, _label); - void* _row = get_vertex_row(g_, _v, _pl); - void* _value = get_property_value_from_row(_row, _property); - return *(static_cast(_value)); + size_t edge_label_num() const { + auto etl = get_edge_type_list(g_); + return get_edge_type_list_size(etl); } - bool HasChild(const vertex_t& v, label_id_t e_label) const { - // secondary - return GetLocalOutDegree(v, e_label) != 0; + size_t vertex_property_num(void* label) const { + auto vpl = get_vertex_property_list_by_type(g_, label); + return get_vertex_property_list_size(vpl); } - bool HasParent(const vertex_t& v, label_id_t e_label) const { - // secondary - return GetLocalInDegree(v, e_label) != 0; + std::shared_ptr vertex_property_type(void* prop) const { + auto dt = get_vertex_property_data_type(g_, prop); + return GetArrowDataType(dt); } - - int GetLocalOutDegree(const vertex_t& v, label_id_t e_label) const { - // secondary - return GetOutgoingAdjList(v, e_label).Size(); + + size_t edge_property_num(void* label) const { + void* epl = get_edge_property_list_by_type(g_, label); + return get_edge_property_list_size(epl); } - int GetLocalInDegree(const vertex_t& v, label_id_t e_label) const { - // secondary - return GetIncomingAdjList(v, e_label).Size(); + std::shared_ptr edge_property_type(void* prop) const { + auto dt = get_edge_property_data_type(g_, prop); + return GetArrowDataType(dt); } - // FIXME: grape message buffer compatibility - bool Gid2Vertex(const vid_t& gid, vertex_t& v) const { - std::stringstream ss; - ss << gid; - void* vh = get_vertex_from_deserialization(pg_, fid_, ss.str().c_str()); - if (vh == NULL_VERTEX) { - return false; - } - vertex_t* _v = static_cast(vh); - v.SetValue(_v->GetValue()); - return true; + vertex_range_t Vertices(void* label) const { + auto vl = get_vertex_list_by_type(g_, label); + auto sz = get_vertex_list_size(vl); + return vertex_range_t(vl, 0, sz); } - vid_t Vertex2Gid(const vertex_t& v) const { - // secondary - return IsInnerVertex(v) ? GetInnerVertexGid(v) : GetOuterVertexGid(v); + vertex_range_t InnerVertices(void* label) const { + auto vl = get_master_vertices_by_type(g_, label); + auto sz = get_vertex_list_size(vl); + return vertex_range_t(vl, 0, sz); } - inline vid_t GetInnerVerticesNum(label_id_t label_id) const { - void* _label = get_vertex_label_from_id((void*)(&label_id)); - void* vlh = get_local_vertices_by_label(pg_, fid_, _label); - return get_vertex_list_size(vlh); + vertex_range_t OuterVertices(void* label) const { + auto vl = get_mirror_vertices_by_type(g_, label); + auto sz = get_vertex_list_size(vl); + return vertex_range_t(vl, 0, sz); } - inline vid_t GetOuterVerticesNum(label_id_t label_id) const { - void* _label = get_vertex_label_from_id((void*)(&label_id)); - void* vlh = get_remote_vertices_by_label(pg_, fid_, _label); - return get_vertex_list_size(vlh); + vertex_range_t InnerVerticesSlice(void* label, size_t start, size_t end) + const { + auto vl = get_master_vertices_by_type(g_, label); + auto _end = get_vertex_list_size(vl); + CHECK(start <= end && start <= _end); + if (end <= _end) { + return vertex_range_t(vl, start, end); + } else { + return vertex_range_t(vl, start, _end); + } } - inline bool IsInnerVertex(const vertex_t& v) const { - void* _v = get_vertex_from_id((void*)(&v.GetValue())); - return is_local_vertex(pg_, fid_, _v); + inline size_t GetVerticesNum(void* label) const { + auto vl = get_vertex_list_by_type(g_, label); + return get_vertex_list_size(vl); } - inline bool IsOuterVertex(const vertex_t& v) const { - void* _v = get_vertex_from_id((void*)(&v.GetValue())); - return is_remote_vertex(pg_, fid_, _v); + template + bool GetVertex(void* label, T& oid, void* v) { + if (DataTypeEnum::value != get_vertex_original_id_type(g_)) return false; + v = get_vertex_from_original_id_by_type(g_, label, (void*)(&oid)); + return v != NULL; } - bool GetInnerVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { - return GetVertex(label, oid, v); - // vid_t gid; - // if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { - // if (vid_parser_.GetFid(gid) == fid_) { - // v.SetValue(vid_parser_.GetLid(gid)); - // return true; - // } - // } - // return false; + template + bool GetId(void* v, T& oid) { + if (DataTypeEnum::value != get_vertex_original_id_type(g_)) return false; + auto _id = get_vertex_original_id(g_, v); + if (_id == NULL) return false; + auto _oid = static_cast(_id); + oid = *_oid; + return true; } - bool GetOuterVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { - return GetVertex(label, oid, v); - // vid_t gid; - // if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { - // return OuterVertexGid2Vertex(gid, v); - // } - // return false; + void* GetFragId(void* u) const { + auto vref = get_vertex_ref_for_vertex(g_, partition_, u); + return get_master_partition_from_vertex_ref(g_, vref); } - inline oid_t GetVertexOriginId(const vertex_t& v) const { - void* _v = get_vertex_from_id((void*)(&v.GetValue())); - void* _id = get_vertex_origin_id(g_, _v); - return *(static_cast(_id)); + size_t GetTotalNodesNum() const { + return GetTotalVerticesNum(); } - - inline oid_t GetInnerVertexId(const vertex_t& v) const { - return GetVertexOriginId(v); - // return oid_t(GetInnerVertexInternalId(v)); + + size_t GetTotalVerticesNum() const { + return get_vertex_num(g_); } -// inline internal_oid_t GetInnerVertexInternalId(const vertex_t& v) const { -// internal_oid_t internal_oid; -// vid_t gid = -// vid_parser_.GenerateId(fid_, vid_parser_.GetLabelId(v.GetValue()), -// vid_parser_.GetOffset(v.GetValue())); -// CHECK(vm_ptr_->GetOid(gid, internal_oid)); -// return internal_oid; -// } - - inline oid_t GetOuterVertexId(const vertex_t& v) const { - return GetVertexOriginId(v); - // return oid_t(GetOuterVertexInternalId(v)); + size_t GetTotalVerticesNum(void* label) const { + return get_vertex_num_by_type(g_, label); } -// inline internal_oid_t GetOuterVertexInternalId(const vertex_t& v) const { -// vid_t gid = GetOuterVertexGid(v); -// internal_oid_t internal_oid; -// CHECK(vm_ptr_->GetOid(gid, internal_oid)); -// return internal_oid; -// } - - inline oid_t Gid2Oid(const vid_t& gid) const { - vertex_t v; - Gid2Vertex(gid, v); - return GetVertexOriginId(v); - // internal_oid_t internal_oid; - // CHECK(vm_ptr_->GetOid(gid, internal_oid)); - // return oid_t(internal_oid); - } + size_t GetEdgeNum() const { return get_edge_num(g_, Direction::BOTH); } + size_t GetInEdgeNum() const { return get_edge_num(g_, Direction::IN); } + size_t GetOutEdgeNum() const { return get_edge_num(g_, Direction::OUT); } - inline bool Oid2Gid(label_id_t label, const oid_t& oid, vid_t& gid) const { - vertex_t v; - if (!GetVertex(label, oid, v)) { - return false; + template + bool GetData(void* v, void* prop, T& value) const { + if (DataTypeEnum::value != get_vertex_property_data_type(g_, prop)) return false; + auto vtype = get_vertex_type(g_, v); + auto vpt = get_vertex_property_table_by_type(g_, vtype); + auto _value = get_value_from_vertex_property_table(vpt, v, prop); + if (_value != NULL) { + value = *(static_cast(_value)); + return true; } - gid = Vertex2Gid(v); - return true; - // return vm_ptr_->GetGid(label, internal_oid_t(oid), gid); + return false; } - inline bool Oid2Gid(label_id_t label, const oid_t& oid, vertex_t& v) const { - vid_t gid; -// if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { - if (Oid2Gid(label, oid, gid)) { - v.SetValue(gid); + template + bool GetData(void* vpt, void* v, void* prop, T& value) const { + if (DataTypeEnum::value != get_vertex_property_data_type(g_, prop)) return false; + auto _value = get_value_from_vertex_property_table(vpt, v, prop); + if (_value != NULL) { + value = *(static_cast(_value)); return true; } return false; } - inline bool InnerVertexGid2Vertex(const vid_t& gid, vertex_t& v) const { - return Gid2Vertex(gid, v); - // v.SetValue(vid_parser_.GetLid(gid)); - // return true; - } - - inline bool OuterVertexGid2Vertex(const vid_t& gid, vertex_t& v) const { - return Gid2Vertex(gid, v); - // auto map = ovg2l_maps_ptr_[vid_parser_.GetLabelId(gid)]; - // auto iter = map->find(gid); - // if (iter != map->end()) { - // v.SetValue(iter->second); - // return true; - // } else { - // return false; - // } + void* GetVertePropertyTable(void* label) { + return get_vertex_property_table_by_type(g_, label); } - inline vid_t GetOuterVertexGid(const vertex_t& v) const { - void* _v = get_vertex_from_id((void*)(&v.GetValue())); - void* _mv = get_master_vertex_for_vertex(pg_, fid_, _v); - void* _id = get_vertex_id(_mv); - return *(static_cast(_id)); - // label_id_t v_label = vid_parser_.GetLabelId(v.GetValue()); - // return ovgid_lists_ptr_[v_label][vid_parser_.GetOffset(v.GetValue()) - - // static_cast(ivnums_[v_label])]; - } - inline vid_t GetInnerVertexGid(const vertex_t& v) const { - std::stringstream ss(serialize_remote_vertex(pg_, (void*)(&v))); - VID_T gid; - ss >> gid; - return gid; - // return vid_parser_.GenerateId(fid_, vid_parser_.GetLabelId(v.GetValue()), - // vid_parser_.GetOffset(v.GetValue())); + bool HasChild(void* v, void* e_label) const { + return GetLocalOutDegree(v, e_label) != 0; } - inline adj_list_t GetIncomingAdjList(const vertex_t& v, label_id_t e_label) - const { - void* _v = get_vertex_from_id((void*)(&v.GetValue())); - void* _label = get_edge_label_from_id((void*)(&e_label)); - void* al = get_adjacent_list_by_edge_label(g_, Direction::IN, (void*)(&v), _label); - return adj_list_t(g_, _label, al, get_adjacent_list_size(al)); - // // grin vertexlist continous_vid_trait get_vertex_from_vid ++++ - // vid_t vid = v.GetValue(); - // label_id_t v_label = vid_parser_.GetLabelId(vid); - // int64_t v_offset = vid_parser_.GetOffset(vid); - // const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; - // const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; - // return adj_list_t(&ie[offset_array[v_offset]], - // &ie[offset_array[v_offset + 1]], - // flatten_edge_tables_columns_[e_label]); + bool HasParent(void* v, void* e_label) const { + return GetLocalInDegree(v, e_label) != 0; } -// inline raw_adj_list_t GetIncomingRawAdjList(const vertex_t& v, -// label_id_t e_label) const { -// vid_t vid = v.GetValue(); -// label_id_t v_label = vid_parser_.GetLabelId(vid); -// int64_t v_offset = vid_parser_.GetOffset(vid); -// const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; -// const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; -// return raw_adj_list_t(&ie[offset_array[v_offset]], -// &ie[offset_array[v_offset + 1]]); -// } - - inline adj_list_t GetOutgoingAdjList(const vertex_t& v, label_id_t e_label) - const { - void* _v = get_vertex_from_id((void*)(&v.GetValue())); - void* _label = get_edge_label_from_id((void*)(&e_label)); - void* al = get_adjacent_list_by_edge_label(g_, Direction::OUT, (void*)(&v), _label); - return adj_list_t(g_, _label, al, get_adjacent_list_size(al)); - // vid_t vid = v.GetValue(); - // label_id_t v_label = vid_parser_.GetLabelId(vid); - // int64_t v_offset = vid_parser_.GetOffset(vid); - // const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; - // const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; - // return adj_list_t(&oe[offset_array[v_offset]], - // &oe[offset_array[v_offset + 1]], - // flatten_edge_tables_columns_[e_label]); + int GetLocalOutDegree(void* v, void* e_label) const { + return GetOutgoingAdjList(v, e_label).Size(); } -// inline raw_adj_list_t GetOutgoingRawAdjList(const vertex_t& v, -// label_id_t e_label) const { -// vid_t vid = v.GetValue(); -// label_id_t v_label = vid_parser_.GetLabelId(vid); -// int64_t v_offset = vid_parser_.GetOffset(vid); -// const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; -// const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; -// return raw_adj_list_t(&oe[offset_array[v_offset]], -// &oe[offset_array[v_offset + 1]]); -// } - -// /** -// * N.B.: as an temporary solution, for POC of graph-learn, will be removed -// * later. -// */ - -// inline const int64_t* GetIncomingOffsetArray(label_id_t v_label, -// label_id_t e_label) const { -// return ie_offsets_ptr_lists_[v_label][e_label]; -// } - -// inline const int64_t* GetOutgoingOffsetArray(label_id_t v_label, -// label_id_t e_label) const { -// return oe_offsets_ptr_lists_[v_label][e_label]; -// } - -// inline int64_t GetIncomingOffsetLength(label_id_t v_label, label_id_t e_label) -// const { -// return ie_offsets_lists_[v_label][e_label]->length(); -// } - -// inline int64_t GetOutgoingOffsetLength(label_id_t v_label, label_id_t e_label) -// const { -// return oe_offsets_lists_[v_label][e_label]->length(); -// } - -// inline std::pair GetOutgoingAdjOffsets( -// const vertex_t& v, label_id_t e_label) const { -// vid_t vid = v.GetValue(); -// label_id_t v_label = vid_parser_.GetLabelId(vid); -// int64_t v_offset = vid_parser_.GetOffset(vid); -// const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; -// return std::make_pair(offset_array[v_offset], offset_array[v_offset + 1]); -// } - - inline grape::DestList IEDests(const vertex_t& v, label_id_t e_label) const { - void* _v = get_vertex_from_id((void*)(v.GetValue())); - void* _vertex_label = get_vertex_label(_v); - int64_t offset = v.GetValue() - InnerVertices(_vertex_label).begin_value(); - - return grape::DestList(idoffset_[v_label][e_label][offset], - idoffset_[v_label][e_label][offset + 1]); + int GetLocalInDegree(void* v, void* e_label) const { + return GetIncomingAdjList(v, e_label).Size(); } - inline grape::DestList OEDests(const vertex_t& v, label_id_t e_label) const { - void* _v = get_vertex_from_id((void*)(v.GetValue())); - void* _vertex_label = get_vertex_label(_v); - int64_t offset = v.GetValue() - InnerVertices(_vertex_label).begin_value(); - return grape::DestList(odoffset_[v_label][e_label][offset], - odoffset_[v_label][e_label][offset + 1]); + inline size_t GetInnerVerticesNum(void* label) const { + auto vl = get_master_vertices_by_type(g_, label); + return get_vertex_list_size(vl); } - inline grape::DestList IOEDests(const vertex_t& v, label_id_t e_label) const { - void* _v = get_vertex_from_id((void*)(v.GetValue())); - void* _vertex_label = get_vertex_label(_v); - int64_t offset = v.GetValue() - InnerVertices(_vertex_label).begin_value(); - - return grape::DestList(iodoffset_[v_label][e_label][offset], - iodoffset_[v_label][e_label][offset + 1]); + inline size_t GetOuterVerticesNum(void* label) const { + auto vl = get_mirror_vertices_by_type(g_, label); + return get_vertex_list_size(vl); } -// std::shared_ptr GetVertexMap() { return vm_ptr_; } - -// const PropertyGraphSchema& schema() const override { return schema_; } - - void PrepareToRunApp(const grape::CommSpec& comm_spec, - grape::PrepareConf conf); -/* mutable functions are not supported in grin 0.1 - boost::leaf::result AddVerticesAndEdges( - Client & client, - std::map> && vertex_tables_map, - std::map> && edge_tables_map, - ObjectID vm_id, - const std::vector>>& - edge_relations, - int concurrency); - - boost::leaf::result AddVertices( - Client & client, - std::map> && vertex_tables_map, - ObjectID vm_id); - - boost::leaf::result AddEdges( - Client & client, - std::map> && edge_tables_map, - const std::vector>>& - edge_relations, - int concurrency); - - /// Add a set of new vertex labels and a set of new edge labels to graph. - /// Vertex label id started from vertex_label_num_, and edge label id - /// started from edge_label_num_. - boost::leaf::result AddNewVertexEdgeLabels( - Client & client, - std::vector> && vertex_tables, - std::vector> && edge_tables, ObjectID vm_id, - const std::vector>>& - edge_relations, - int concurrency); - - /// Add a set of new vertex labels to graph. Vertex label id started from - /// vertex_label_num_. - boost::leaf::result AddNewVertexLabels( - Client & client, - std::vector> && vertex_tables, - ObjectID vm_id); - - /// Add a set of new edge labels to graph. Edge label id started from - /// edge_label_num_. - boost::leaf::result AddNewEdgeLabels( - Client & client, - std::vector> && edge_tables, - const std::vector>>& - edge_relations, - int concurrency); - - boost::leaf::result AddVertexColumns( - vineyard::Client & client, - const std::map< - label_id_t, - std::vector>>> - columns, - bool replace = false) override; - - boost::leaf::result AddVertexColumns( - vineyard::Client & client, - const std::map>>> - columns, - bool replace = false) override; - - template - boost::leaf::result AddVertexColumnsImpl( - vineyard::Client & client, - const std::map< - label_id_t, - std::vector>>> - columns, - bool replace = false); - - boost::leaf::result AddEdgeColumns( - vineyard::Client & client, - const std::map< - label_id_t, - std::vector>>> - columns, - bool replace = false) override; - - boost::leaf::result AddEdgeColumns( - vineyard::Client & client, - const std::map>>> - columns, - bool replace = false) override; - - template - boost::leaf::result AddEdgeColumnsImpl( - vineyard::Client & client, - const std::map< - label_id_t, - std::vector>>> - columns, - bool replace = false); - - boost::leaf::result Project( - vineyard::Client & client, - std::map> vertices, - std::map> edges); - - boost::leaf::result TransformDirection( - vineyard::Client & client, int concurrency); - - boost::leaf::result ConsolidateVertexColumns( - vineyard::Client & client, const label_id_t vlabel, - std::vector const& prop_names, - std::string const& consolidate_name); - - boost::leaf::result ConsolidateVertexColumns( - vineyard::Client & client, const label_id_t vlabel, - std::vector const& props, std::string const& consolidate_name); - - boost::leaf::result ConsolidateEdgeColumns( - vineyard::Client & client, const label_id_t elabel, - std::vector const& prop_names, - std::string const& consolidate_name); - - boost::leaf::result ConsolidateEdgeColumns( - vineyard::Client & client, const label_id_t elabel, - std::vector const& props, std::string const& consolidate_name); -*/ - // we support projection by providing a "view" graph - void* Project( - vineyard::Client & client, - std::map> vertices, - std::map> edges) { - void* new_g; - for (auto& pair : vertices) { - void* vertex_label = get_vetex_label_from_id((void*)(&pair.first)); - void* property_list = create_property_list(); - for (auto& prop_id: pair.second) { - void* property = get_property_by_id(vertex_label, proper_id); - insert_property_to_list(property_list, property); - } - new_g = select_vertex_properties_for_label(g_, propertylist, vertex_label); - } - // same for edge - } - // use grin property "select" - private: - void initPointers(); - - void initDestFidList( - bool in_edge, bool out_edge, - std::vector>>& fid_lists, - std::vector>>& fid_lists_offset); - - __attribute__((annotate("shared"))) fid_t fid_, fnum_; - __attribute__((annotate("shared"))) bool directed_; - __attribute__((annotate("shared"))) bool is_multigraph_; - __attribute__((annotate("shared"))) property_graph_types::LABEL_ID_TYPE vertex_label_num_; - __attribute__((annotate("shared"))) property_graph_types::LABEL_ID_TYPE edge_label_num_; - size_t oenum_, ienum_; // FIXME: should be pre-computable - - __attribute__((annotate("shared"))) String oid_type, vid_type; - - __attribute__((annotate("shared"))) vineyard::Array ivnums_, ovnums_, tvnums_; - - __attribute__((annotate("shared"))) List> vertex_tables_; - std::vector> vertex_tables_columns_; - - __attribute__((annotate("shared"))) List> ovgid_lists_; - std::vector ovgid_lists_ptr_; - - __attribute__((annotate("shared"))) List>> ovg2l_maps_; - std::vector*> ovg2l_maps_ptr_; - - __attribute__((annotate("shared"))) List> edge_tables_; - std::vector> edge_tables_columns_; - std::vector flatten_edge_tables_columns_; - - __attribute__((annotate("shared"))) List>> ie_lists_, - oe_lists_; - std::vector> ie_ptr_lists_, oe_ptr_lists_; - __attribute__((annotate("shared"))) List>> ie_offsets_lists_, - oe_offsets_lists_; - std::vector> ie_offsets_ptr_lists_, - oe_offsets_ptr_lists_; - - std::vector>> idst_, odst_, iodst_; - std::vector>> idoffset_, odoffset_, - iodoffset_; + inline bool IsInnerVertex(void* v) const { + return is_master_vertex(g_, v); + } - __attribute__((annotate("shared"))) std::shared_ptr vm_ptr_; + inline bool IsOuterVertex(void* v) const { + return is_mirror_vertex(g_, v); + } - vineyard::IdParser vid_parser_; + inline adj_list_t GetIncomingAdjList(void* v, void* e_label) + const { + auto al = get_adjacent_list_by_edge_type(g_, Direction::IN, v, e_label); + auto sz = get_adjacent_list_size(al); + auto ept = get_edge_property_table_by_type(g_, e_label); + return adj_list_t(al, ept, 0, sz); + } - __attribute__((annotate("shared"))) json schema_json_; - PropertyGraphSchema schema_; + inline adj_list_t GetOutgoingAdjList(void* v, void* e_label) + const { + auto al = get_adjacent_list_by_edge_type(g_, Direction::OUT, v, e_label); + auto sz = get_adjacent_list_size(al); + auto ept = get_edge_property_table_by_type(g_, e_label); + return adj_list_t(al, ept, 0, sz); + } - friend class ArrowFragmentBaseBuilder; + void* get_graph() { return g_; } - template - friend class gs::ArrowProjectedFragment; + private: + void* pg_; + void* g_; + void* partition_; }; } // namespace vineyard -#endif // MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_MOD_H_ - -// vim: syntax=cpp - #endif // MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H diff --git a/modules/graph/fragment/arrow_fragment.grin.idea b/modules/graph/fragment/arrow_fragment.grin.idea new file mode 100644 index 000000000..30ad8ba1c --- /dev/null +++ b/modules/graph/fragment/arrow_fragment.grin.idea @@ -0,0 +1,1026 @@ +/** Copyright 2020-2023 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#ifndef MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H +#define MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H + +#include +#include +#include +#include +#include +#include +#include + +#include "arrow/api.h" +#include "arrow/io/api.h" + +#include "grape/fragment/fragment_base.h" +#include "grape/graph/adj_list.h" +#include "grape/utils/vertex_array.h" + +#include "client/ds/core_types.h" +#include "client/ds/object_meta.h" + +#include "basic/ds/arrow.h" +#include "basic/ds/arrow_utils.h" +#include "common/util/typename.h" + +#include "graph/fragment/arrow_fragment_base.h" +#include "graph/fragment/fragment_traits.h" +#include "graph/fragment/graph_schema.h" +#include "graph/fragment/property_graph_types.h" +#include "graph/utils/error.h" +#include "graph/vertex_map/arrow_local_vertex_map.h" +#include "graph/vertex_map/arrow_vertex_map.h" + +extern "C" { +#include "graph/grin/include/topology/structure.h" +#include "graph/grin/include/topology/vertexlist.h" +#include "graph/grin/include/topology/edgelist.h" +#include "graph/grin/include/topology/adjacentlist.h" +#include "graph/grin/include/partition/partition.h" +#include "graph/grin/include/propertygraph/label.h" +#include "graph/grin/include/propertygraph/property.h" +#include "graph/grin/include/propertygraph/propertygraph.h" +} + +namespace gs { + +template +class ArrowProjectedFragment; + +} // namespace gs + +namespace vineyard { + +template +struct GRIN_Nbr { + private: + using vid_t = VID_T; + using eid_t = EID_T; + using prop_id_t = property_graph_types::PROP_ID_TYPE; + + public: + GRIN_Nbr(void* g, void* edge_label, void* adj_list, size_t current) { + g_ = g; + edge_label_ = edge_label; + adj_list_ = adj_list; + current_ = current; + if (current_ == 0) { + adj_list_iter_ = get_adjacent_list_begin(adj_list_); + property_list_ = get_all_edge_properties_from_label(edge_label_); + } else { + adj_list_iter_ = nullptr; + } + } + + grape::Vertex neighbor() const { + return grape::Vertex(neighbor_); + } + + grape::Vertex get_neighbor() const { + return grape::Vertex(neighbor_); + } + + EID_T edge_id() const { return eid_; } + + void* get_data(prop_id_t prop_id) const { + void* _row = get_edge_row(g_, edge_, property_list_); + void* _property = get_edge_property_from_id(edge_label_, prop_id); + return get_property_value_from_row(_row, _property); + } + + template + T get_data(prop_id_t prop_id) const { + void* _data = get_data(prop_id); + return *(static_cast(_data)); + } + + std::string get_str(prop_id_t prop_id) const { + void* _data = get_data(prop_id); + return *(static_cast(_data)); + } + + double get_double(prop_id_t prop_id) const { + void* _data = get_data(prop_id); + return *(static_cast(_data)); + } + + int64_t get_int(prop_id_t prop_id) const { + void* _data = get_data(prop_id); + return *(static_cast(_data)); + } + + inline const GRIN_Nbr& operator++() const { + ++current_; + add_current_value(); + return *this; + } + + inline bool operator==(const GRIN_Nbr& rhs) const { + return (current_ == rhs.current_) && (adj_list_ == rhs.adj_list_); + } + + inline bool operator!=(const GRIN_Nbr& rhs) const { + return (current_ != rhs.current_) || (adj_list_ != rhs.adj_list_); + } + + inline bool operator<(const GRIN_Nbr& rhs) const { + return (current_ < rhs.current_) && (adj_list_ == rhs.adj_list_);; + } + + inline const GRIN_Nbr& operator*() const { return *this; } + + private: + void add_current_value() { + adj_list_iter_ = get_next_adjacent_iter(adj_list_, adj_list_iter_); + void* _v = get_neighbor_from_iter(adj_list_, adj_list_iter_); + void* _vid = get_vertex_id(_v); + neighbor_ = *(static_cast(_vid)); + edge_ = get_edge_from_iter(adj_list_, adj_list_iter); + } + + void* g_; + void* edge_label_; + void* property_list_; + void* adj_list_; + void* adj_list_iter_; + size_t current_; + VID_T neighbor_; + void* edge_; +}; + +template +using GRIN_NbrDefault = GRIN_Nbr; + +template +class GRIN_AdjList { + public: + GRIN_AdjList() : g_(NULL), edge_label_(NULL), adj_list_(NULL), sz_(0), begin_(0), end_(0) {} + GRIN_AdjList(void* g, void* edge_label, void* adj_list, size_t sz) + : g_(g), edge_label_(edge_label), adj_list_(adj_list), sz_(sz), begin_(0), end_(sz) {} + + inline GRIN_Nbr begin() const { + return GRIN_Nbr(g_, edge_label_, adj_list_, begin_); + } + + inline GRIN_Nbr end() const { + return GRIN_Nbr(g_, edge_label_, adj_list_, end_); + } + + inline size_t Size() const { return sz_; } + + inline bool Empty() const { return sz_ == 0; } + + inline bool NotEmpty() const { return sz_ > 0; } + + size_t size() const { return sz_; } + + //inline const NbrUnit* begin_unit() const { return begin_; } + + //inline const NbrUnit* end_unit() const { return end_; } + + private: + const void* g_; + const void* edge_label_; + const void* adj_list_; + const size_t sz_; + const size_t begin_; + const size_t end_; +}; + +template +using GRIN_AdjListDefault = AdjList; + + +inline std::string generate_name_with_suffix( + const std::string& prefix, property_graph_types::LABEL_ID_TYPE label) { + return prefix + "_" + std::to_string(label); +} + +inline std::string generate_name_with_suffix( + const std::string& prefix, property_graph_types::LABEL_ID_TYPE v_label, + property_graph_types::LABEL_ID_TYPE e_label) { + return prefix + "_" + std::to_string(v_label) + "_" + std::to_string(e_label); +} + +template +class ArrowFragmentBaseBuilder; + +template ::type, VID_T>> +class __attribute__((annotate("vineyard"))) GRIN_ArrowFragment + : public ArrowFragmentBase, + public vineyard::BareRegistered< + ArrowFragment> { +public: + using oid_t = OID_T; + using vid_t = VID_T; + using internal_oid_t = typename InternalType::type; + using eid_t = property_graph_types::EID_TYPE; + using prop_id_t = property_graph_types::PROP_ID_TYPE; + using label_id_t = property_graph_types::LABEL_ID_TYPE; + using vertex_range_t = grape::VertexRange; + using inner_vertices_t = vertex_range_t; + using outer_vertices_t = vertex_range_t; + using vertices_t = vertex_range_t; + using nbr_t = property_graph_utils::Nbr; + using nbr_unit_t = property_graph_utils::NbrUnit; + using adj_list_t = property_graph_utils::AdjList; + using raw_adj_list_t = property_graph_utils::RawAdjList; + using vertex_map_t = VERTEX_MAP_T; + using vertex_t = grape::Vertex; + + using ovg2l_map_t = + ska::flat_hash_map::KeyHash>; + + using vid_array_t = ArrowArrayType; + using vid_vineyard_array_t = ArrowVineyardArrayType; + using vid_vineyard_builder_t = ArrowVineyardBuilderType; + using eid_array_t = ArrowArrayType; + using eid_vineyard_array_t = ArrowVineyardArrayType; + using eid_vineyard_builder_t = ArrowVineyardBuilderType; + + using vid_builder_t = ArrowBuilderType; + + template + using vertex_array_t = grape::VertexArray; + + template + using inner_vertex_array_t = grape::VertexArray; + + template + using outer_vertex_array_t = grape::VertexArray; + + static constexpr grape::LoadStrategy load_strategy = + grape::LoadStrategy::kBothOutIn; + + public: + ~GRIN_ArrowFragment() = default; + // hide vertex_map + // vineyard::ObjectID vertex_map_id() const override { return vm_ptr_->id(); } + + void init(void* partitioned_graph) { + pg_ = partitioned_graph; + assert(get_partition_list_size(pg_) == 1); + auto pl = get_local_partitions(pg_); + auto p = get_partition_from_list(pl, 0); + g_ = get_local_graph_from_partition(pg_, p); + + directed_ = is_directed(g_); + is_multigraph_ = is_multigraph(g_); + fid_ = p; + fnum_ = get_total_partitions_number(pg_); + } + + bool directed() const override { + return directed_; + } + + bool is_multigraph() const override { + return is_multigraph_; + } + + const std::string vid_typename() const override { + auto dt = get_vertex_id_data_type(g_); + return GetDataTypeName(dt); + } + + const std::string oid_typename() const override { + auto dt = DataTypeEnum::value(); + return GetDataTypeName(dt); + } + + fid_t fid() const { return fid_; } + + fid_t fnum() const { return fnum_; } + + void* vertex_label(const void* v) { + return get_vertex_label(g_, v); + } + + label_id_t vertex_label(const vertex_t& v) const { + void* _v = get_vertex_from_id(v.GetValue()); + void* _label = vertex_label(_v); + void* _label_id = get_label_id(g_, _label); + return *(static_cast(_label_id)) + } + +// int64_t vertex_offset(const vertex_t& v) const { +// // to remove ---- +// return vid_parser_.GetOffset(v.GetValue()); +// } + + label_id_t vertex_label_num() const { + void* vll = get_vertex_labels(g_); + return get_vertex_label_list_size(vll); + } + + label_id_t edge_label_num() const { + void* ell = get_edge_labels(g_); + return get_edge_label_list_size(ell); + } + + prop_id_t vertex_property_num(label_id_t label) const { + void* _label = get_vertex_label_from_id((void*)(&label)); + void* vpl = get_all_vertex_properties_from_label(g_, _label); + return get_property_list_size(vpl); + } + + std::shared_ptr vertex_property_type(label_id_t label, + prop_id_t prop) const { + void* _label = get_vertex_label_from_id(label) + void* _property = get_vertex_property_from_id(_label, prop); + auto dt = get_property_type(_g, _property); + return GetArrowDataType(dt); + } + + prop_id_t edge_property_num(label_id_t label) const { + void* _label = get_edge_label_from_id((void*)(&label)); + void* epl = get_all_edge_properties_from_label(g_, _label); + return get_property_list_size(epl); + } + + std::shared_ptr edge_property_type(label_id_t label, + prop_id_t prop) const { + void* _label = get_edge_label_from_id(label) + void* _property = get_edge_property_from_id(_label, prop); + auto dt = get_property_type(_g, _property); + return GetArrowDataType(dt); + } + +// std::shared_ptr vertex_data_table(label_id_t i) const { +// // maybe we should get rid of the method +// // there is no way we can provide the whole data with a C-style api +// return vertex_tables_[i]->GetTable(); +// } + +// std::shared_ptr edge_data_table(label_id_t i) const { +// // Ditto. +// return edge_tables_[i]->GetTable(); +// } + +// template +// property_graph_utils::EdgeDataColumn edge_data_column( +// label_id_t label, prop_id_t prop) const { +// // get rid of this method and EdgeDataColumn structure +// // this structure actually serves to get a specific property of an edge +// // and it can be replaced by grin property get_edge_row +// if (edge_tables_[label]->num_rows() == 0) { +// return property_graph_utils::EdgeDataColumn(); +// } else { +// // the finalized etables are guaranteed to have been concatenated +// return property_graph_utils::EdgeDataColumn( +// edge_tables_[label]->column(prop)->chunk(0)); +// } +// } + +// template +// property_graph_utils::VertexDataColumn vertex_data_column( +// label_id_t label, prop_id_t prop) const { +// // Ditto. it can be replaced by grin property get_vertex_row && get_property_value_from_row +// if (vertex_tables_[label]->num_rows() == 0) { +// return property_graph_utils::VertexDataColumn( +// InnerVertices(label)); +// } else { +// // the finalized vtables are guaranteed to have been concatenated +// return property_graph_utils::VertexDataColumn( +// InnerVertices(label), vertex_tables_[label]->column(prop)->chunk(0)); +// } +// } + + vertex_range_t Vertices(label_id_t label_id) const { + //continuous vid trait + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_vertex_list_by_label(pg_, fid_, _label); + void* beginh = get_begin_vertex_id_from_list(vlh); + VID_T* begin = static_cast(beginh); + void* endh = get_end_vertex_id_from_list(vlh); + VID_T* end = static_cast(endh); + return vertex_range_t(*begin, *end); + } + + vertex_range_t InnerVertices(label_id_t label_id) const { + //continuous vid trait + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_local_vertices_by_label(pg_, fid_, _label); + void* beginh = get_begin_vertex_id_from_list(vlh); + VID_T* begin = static_cast(beginh); + void* endh = get_end_vertex_id_from_list(vlh); + VID_T* end = static_cast(endh); + return vertex_range_t(*begin, *end); + } + + vertex_range_t OuterVertices(label_id_t label_id) const { + //continuous vid trait + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_remote_vertices_by_label(pg_, fid_, _label); + void* beginh = get_begin_vertex_id_from_list(vlh); + VID_T* begin = static_cast(beginh); + void* endh = get_end_vertex_id_from_list(vlh); + VID_T* end = static_cast(endh); + return vertex_range_t(*begin, *end); + } + + vertex_range_t InnerVerticesSlice(label_id_t label_id, vid_t start, vid_t end) + const { + // continuous_vid_traits + vertex_range_t vr = InnerVertices(label_id); + size_t _end = vr.size(); + CHECK(start <= end && start <= _end); + if (end <= _end) { + return vr.SetRange(start, end); + } else { + return vr.SetRange(start, _end); + } + } + + inline vid_t GetVerticesNum(label_id_t label_id) const { + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_vertex_list_by_label(pg_, fid_, _label); + return get_vertex_list_size(vlh); + } + + bool GetVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { + void* _label = get_vertex_label_from_id((void*)(&label)); + void* _v = get_vertex_from_label_origin_id(_label, (void*)(&oid)); + if (_v == NULL_VERTEX) { + return false; + } + void* _id = get_vertex_id(_v); + v.SetValue(*(static_cast(_id))); + return true; + } + + oid_t GetId(const vertex_t& v) const { + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _id = get_vertex_origin_id(_v); + return *(static_cast(_id)); + } + +// internal_oid_t GetInternalId(const vertex_t& v) const { +// return IsInnerVertex(v) ? GetInnerVertexInternalId(v) +// : GetOuterVertexInternalId(v); +// } + + fid_t GetFragId(const vertex_t& u) const { + auto rp = get_master_partition_for_vertex(pg_, fid_, (void*)(&u)); + if (rp == NULL_REMOTE_PARTITION) { + return fid_; + } + return rp; + } + + size_t GetTotalNodesNum() const { + // secondary + return GetTotalVerticesNum() + } + size_t GetTotalVerticesNum() const { + void* vl = get_vertex_list(g_); + return get_vertex_list_size(vl); + } + size_t GetTotalVerticesNum(label_id_t label) const { + void* _label = get_vertex_label_from_id((void*)(&label)); + void* vl = get_vertex_list_by_label(_label); + return get_vertex_list_size(vl); + } + + // secondary + size_t GetEdgeNum() const { return directed_ ? oenum_ + ienum_ : oenum_; } + // secondary + size_t GetInEdgeNum() const { return ienum_; } + // secondary + size_t GetOutEdgeNum() const { return oenum_; } + + template + T GetData(const vertex_t& v, prop_id_t prop_id) const { + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _label = get_vertex_label(g_, _v); + void* _property = get_vertex_property_from_id(_lable, (void*)(&prop_id)); + void* _pl = get_all_vertex_properties_from_label(g_, _label); + void* _row = get_vertex_row(g_, _v, _pl); + void* _value = get_property_value_from_row(_row, _property); + return *(static_cast(_value)); + } + + bool HasChild(const vertex_t& v, label_id_t e_label) const { + // secondary + return GetLocalOutDegree(v, e_label) != 0; + } + + bool HasParent(const vertex_t& v, label_id_t e_label) const { + // secondary + return GetLocalInDegree(v, e_label) != 0; + } + + int GetLocalOutDegree(const vertex_t& v, label_id_t e_label) const { + // secondary + return GetOutgoingAdjList(v, e_label).Size(); + } + + int GetLocalInDegree(const vertex_t& v, label_id_t e_label) const { + // secondary + return GetIncomingAdjList(v, e_label).Size(); + } + + // FIXME: grape message buffer compatibility + bool Gid2Vertex(const vid_t& gid, vertex_t& v) const { + std::stringstream ss; + ss << gid; + void* vh = get_vertex_from_deserialization(pg_, fid_, ss.str().c_str()); + if (vh == NULL_VERTEX) { + return false; + } + vertex_t* _v = static_cast(vh); + v.SetValue(_v->GetValue()); + return true; + } + + vid_t Vertex2Gid(const vertex_t& v) const { + // secondary + return IsInnerVertex(v) ? GetInnerVertexGid(v) : GetOuterVertexGid(v); + } + + inline vid_t GetInnerVerticesNum(label_id_t label_id) const { + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_local_vertices_by_label(pg_, fid_, _label); + return get_vertex_list_size(vlh); + } + + inline vid_t GetOuterVerticesNum(label_id_t label_id) const { + void* _label = get_vertex_label_from_id((void*)(&label_id)); + void* vlh = get_remote_vertices_by_label(pg_, fid_, _label); + return get_vertex_list_size(vlh); + } + + inline bool IsInnerVertex(const vertex_t& v) const { + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + return is_local_vertex(pg_, fid_, _v); + } + + inline bool IsOuterVertex(const vertex_t& v) const { + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + return is_remote_vertex(pg_, fid_, _v); + } + + bool GetInnerVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { + return GetVertex(label, oid, v); + // vid_t gid; + // if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { + // if (vid_parser_.GetFid(gid) == fid_) { + // v.SetValue(vid_parser_.GetLid(gid)); + // return true; + // } + // } + // return false; + } + + bool GetOuterVertex(label_id_t label, const oid_t& oid, vertex_t& v) const { + return GetVertex(label, oid, v); + // vid_t gid; + // if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { + // return OuterVertexGid2Vertex(gid, v); + // } + // return false; + } + + inline oid_t GetVertexOriginId(const vertex_t& v) const { + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _id = get_vertex_origin_id(g_, _v); + return *(static_cast(_id)); + } + + inline oid_t GetInnerVertexId(const vertex_t& v) const { + return GetVertexOriginId(v); + // return oid_t(GetInnerVertexInternalId(v)); + } + +// inline internal_oid_t GetInnerVertexInternalId(const vertex_t& v) const { +// internal_oid_t internal_oid; +// vid_t gid = +// vid_parser_.GenerateId(fid_, vid_parser_.GetLabelId(v.GetValue()), +// vid_parser_.GetOffset(v.GetValue())); +// CHECK(vm_ptr_->GetOid(gid, internal_oid)); +// return internal_oid; +// } + + inline oid_t GetOuterVertexId(const vertex_t& v) const { + return GetVertexOriginId(v); + // return oid_t(GetOuterVertexInternalId(v)); + } + +// inline internal_oid_t GetOuterVertexInternalId(const vertex_t& v) const { +// vid_t gid = GetOuterVertexGid(v); +// internal_oid_t internal_oid; +// CHECK(vm_ptr_->GetOid(gid, internal_oid)); +// return internal_oid; +// } + + inline oid_t Gid2Oid(const vid_t& gid) const { + vertex_t v; + Gid2Vertex(gid, v); + return GetVertexOriginId(v); + // internal_oid_t internal_oid; + // CHECK(vm_ptr_->GetOid(gid, internal_oid)); + // return oid_t(internal_oid); + } + + inline bool Oid2Gid(label_id_t label, const oid_t& oid, vid_t& gid) const { + vertex_t v; + if (!GetVertex(label, oid, v)) { + return false; + } + gid = Vertex2Gid(v); + return true; + // return vm_ptr_->GetGid(label, internal_oid_t(oid), gid); + } + + inline bool Oid2Gid(label_id_t label, const oid_t& oid, vertex_t& v) const { + vid_t gid; +// if (vm_ptr_->GetGid(label, internal_oid_t(oid), gid)) { + if (Oid2Gid(label, oid, gid)) { + v.SetValue(gid); + return true; + } + return false; + } + + inline bool InnerVertexGid2Vertex(const vid_t& gid, vertex_t& v) const { + return Gid2Vertex(gid, v); + // v.SetValue(vid_parser_.GetLid(gid)); + // return true; + } + + inline bool OuterVertexGid2Vertex(const vid_t& gid, vertex_t& v) const { + return Gid2Vertex(gid, v); + // auto map = ovg2l_maps_ptr_[vid_parser_.GetLabelId(gid)]; + // auto iter = map->find(gid); + // if (iter != map->end()) { + // v.SetValue(iter->second); + // return true; + // } else { + // return false; + // } + } + + inline vid_t GetOuterVertexGid(const vertex_t& v) const { + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _mv = get_master_vertex_for_vertex(pg_, fid_, _v); + void* _id = get_vertex_id(_mv); + return *(static_cast(_id)); + // label_id_t v_label = vid_parser_.GetLabelId(v.GetValue()); + // return ovgid_lists_ptr_[v_label][vid_parser_.GetOffset(v.GetValue()) - + // static_cast(ivnums_[v_label])]; + } + inline vid_t GetInnerVertexGid(const vertex_t& v) const { + std::stringstream ss(serialize_remote_vertex(pg_, (void*)(&v))); + VID_T gid; + ss >> gid; + return gid; + // return vid_parser_.GenerateId(fid_, vid_parser_.GetLabelId(v.GetValue()), + // vid_parser_.GetOffset(v.GetValue())); + } + + inline adj_list_t GetIncomingAdjList(const vertex_t& v, label_id_t e_label) + const { + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _label = get_edge_label_from_id((void*)(&e_label)); + void* al = get_adjacent_list_by_edge_label(g_, Direction::IN, (void*)(&v), _label); + return adj_list_t(g_, _label, al, get_adjacent_list_size(al)); + // // grin vertexlist continous_vid_trait get_vertex_from_vid ++++ + // vid_t vid = v.GetValue(); + // label_id_t v_label = vid_parser_.GetLabelId(vid); + // int64_t v_offset = vid_parser_.GetOffset(vid); + // const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; + // const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; + // return adj_list_t(&ie[offset_array[v_offset]], + // &ie[offset_array[v_offset + 1]], + // flatten_edge_tables_columns_[e_label]); + } + +// inline raw_adj_list_t GetIncomingRawAdjList(const vertex_t& v, +// label_id_t e_label) const { +// vid_t vid = v.GetValue(); +// label_id_t v_label = vid_parser_.GetLabelId(vid); +// int64_t v_offset = vid_parser_.GetOffset(vid); +// const int64_t* offset_array = ie_offsets_ptr_lists_[v_label][e_label]; +// const nbr_unit_t* ie = ie_ptr_lists_[v_label][e_label]; +// return raw_adj_list_t(&ie[offset_array[v_offset]], +// &ie[offset_array[v_offset + 1]]); +// } + + inline adj_list_t GetOutgoingAdjList(const vertex_t& v, label_id_t e_label) + const { + void* _v = get_vertex_from_id((void*)(&v.GetValue())); + void* _label = get_edge_label_from_id((void*)(&e_label)); + void* al = get_adjacent_list_by_edge_label(g_, Direction::OUT, (void*)(&v), _label); + return adj_list_t(g_, _label, al, get_adjacent_list_size(al)); + // vid_t vid = v.GetValue(); + // label_id_t v_label = vid_parser_.GetLabelId(vid); + // int64_t v_offset = vid_parser_.GetOffset(vid); + // const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; + // const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; + // return adj_list_t(&oe[offset_array[v_offset]], + // &oe[offset_array[v_offset + 1]], + // flatten_edge_tables_columns_[e_label]); + } + +// inline raw_adj_list_t GetOutgoingRawAdjList(const vertex_t& v, +// label_id_t e_label) const { +// vid_t vid = v.GetValue(); +// label_id_t v_label = vid_parser_.GetLabelId(vid); +// int64_t v_offset = vid_parser_.GetOffset(vid); +// const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; +// const nbr_unit_t* oe = oe_ptr_lists_[v_label][e_label]; +// return raw_adj_list_t(&oe[offset_array[v_offset]], +// &oe[offset_array[v_offset + 1]]); +// } + +// /** +// * N.B.: as an temporary solution, for POC of graph-learn, will be removed +// * later. +// */ + +// inline const int64_t* GetIncomingOffsetArray(label_id_t v_label, +// label_id_t e_label) const { +// return ie_offsets_ptr_lists_[v_label][e_label]; +// } + +// inline const int64_t* GetOutgoingOffsetArray(label_id_t v_label, +// label_id_t e_label) const { +// return oe_offsets_ptr_lists_[v_label][e_label]; +// } + +// inline int64_t GetIncomingOffsetLength(label_id_t v_label, label_id_t e_label) +// const { +// return ie_offsets_lists_[v_label][e_label]->length(); +// } + +// inline int64_t GetOutgoingOffsetLength(label_id_t v_label, label_id_t e_label) +// const { +// return oe_offsets_lists_[v_label][e_label]->length(); +// } + +// inline std::pair GetOutgoingAdjOffsets( +// const vertex_t& v, label_id_t e_label) const { +// vid_t vid = v.GetValue(); +// label_id_t v_label = vid_parser_.GetLabelId(vid); +// int64_t v_offset = vid_parser_.GetOffset(vid); +// const int64_t* offset_array = oe_offsets_ptr_lists_[v_label][e_label]; +// return std::make_pair(offset_array[v_offset], offset_array[v_offset + 1]); +// } + + inline grape::DestList IEDests(const vertex_t& v, label_id_t e_label) const { + void* _v = get_vertex_from_id((void*)(v.GetValue())); + void* _vertex_label = get_vertex_label(_v); + int64_t offset = v.GetValue() - InnerVertices(_vertex_label).begin_value(); + + return grape::DestList(idoffset_[v_label][e_label][offset], + idoffset_[v_label][e_label][offset + 1]); + } + + inline grape::DestList OEDests(const vertex_t& v, label_id_t e_label) const { + void* _v = get_vertex_from_id((void*)(v.GetValue())); + void* _vertex_label = get_vertex_label(_v); + int64_t offset = v.GetValue() - InnerVertices(_vertex_label).begin_value(); + + return grape::DestList(odoffset_[v_label][e_label][offset], + odoffset_[v_label][e_label][offset + 1]); + } + + inline grape::DestList IOEDests(const vertex_t& v, label_id_t e_label) const { + void* _v = get_vertex_from_id((void*)(v.GetValue())); + void* _vertex_label = get_vertex_label(_v); + int64_t offset = v.GetValue() - InnerVertices(_vertex_label).begin_value(); + + return grape::DestList(iodoffset_[v_label][e_label][offset], + iodoffset_[v_label][e_label][offset + 1]); + } + +// std::shared_ptr GetVertexMap() { return vm_ptr_; } + +// const PropertyGraphSchema& schema() const override { return schema_; } + + void PrepareToRunApp(const grape::CommSpec& comm_spec, + grape::PrepareConf conf); +/* mutable functions are not supported in grin 0.1 + boost::leaf::result AddVerticesAndEdges( + Client & client, + std::map> && vertex_tables_map, + std::map> && edge_tables_map, + ObjectID vm_id, + const std::vector>>& + edge_relations, + int concurrency); + + boost::leaf::result AddVertices( + Client & client, + std::map> && vertex_tables_map, + ObjectID vm_id); + + boost::leaf::result AddEdges( + Client & client, + std::map> && edge_tables_map, + const std::vector>>& + edge_relations, + int concurrency); + + /// Add a set of new vertex labels and a set of new edge labels to graph. + /// Vertex label id started from vertex_label_num_, and edge label id + /// started from edge_label_num_. + boost::leaf::result AddNewVertexEdgeLabels( + Client & client, + std::vector> && vertex_tables, + std::vector> && edge_tables, ObjectID vm_id, + const std::vector>>& + edge_relations, + int concurrency); + + /// Add a set of new vertex labels to graph. Vertex label id started from + /// vertex_label_num_. + boost::leaf::result AddNewVertexLabels( + Client & client, + std::vector> && vertex_tables, + ObjectID vm_id); + + /// Add a set of new edge labels to graph. Edge label id started from + /// edge_label_num_. + boost::leaf::result AddNewEdgeLabels( + Client & client, + std::vector> && edge_tables, + const std::vector>>& + edge_relations, + int concurrency); + + boost::leaf::result AddVertexColumns( + vineyard::Client & client, + const std::map< + label_id_t, + std::vector>>> + columns, + bool replace = false) override; + + boost::leaf::result AddVertexColumns( + vineyard::Client & client, + const std::map>>> + columns, + bool replace = false) override; + + template + boost::leaf::result AddVertexColumnsImpl( + vineyard::Client & client, + const std::map< + label_id_t, + std::vector>>> + columns, + bool replace = false); + + boost::leaf::result AddEdgeColumns( + vineyard::Client & client, + const std::map< + label_id_t, + std::vector>>> + columns, + bool replace = false) override; + + boost::leaf::result AddEdgeColumns( + vineyard::Client & client, + const std::map>>> + columns, + bool replace = false) override; + + template + boost::leaf::result AddEdgeColumnsImpl( + vineyard::Client & client, + const std::map< + label_id_t, + std::vector>>> + columns, + bool replace = false); + + boost::leaf::result Project( + vineyard::Client & client, + std::map> vertices, + std::map> edges); + + boost::leaf::result TransformDirection( + vineyard::Client & client, int concurrency); + + boost::leaf::result ConsolidateVertexColumns( + vineyard::Client & client, const label_id_t vlabel, + std::vector const& prop_names, + std::string const& consolidate_name); + + boost::leaf::result ConsolidateVertexColumns( + vineyard::Client & client, const label_id_t vlabel, + std::vector const& props, std::string const& consolidate_name); + + boost::leaf::result ConsolidateEdgeColumns( + vineyard::Client & client, const label_id_t elabel, + std::vector const& prop_names, + std::string const& consolidate_name); + + boost::leaf::result ConsolidateEdgeColumns( + vineyard::Client & client, const label_id_t elabel, + std::vector const& props, std::string const& consolidate_name); +*/ + // we support projection by providing a "view" graph + void* Project( + vineyard::Client & client, + std::map> vertices, + std::map> edges) { + void* new_g; + for (auto& pair : vertices) { + void* vertex_label = get_vetex_label_from_id((void*)(&pair.first)); + void* property_list = create_property_list(); + for (auto& prop_id: pair.second) { + void* property = get_property_by_id(vertex_label, prop_id); + insert_property_to_list(property_list, property); + } + new_g = select_vertex_properties_for_label(g_, propertylist, vertex_label); + } + // same for edge + } + // use grin property "select" + private: + void initPointers(); + + void initDestFidList( + bool in_edge, bool out_edge, + std::vector>>& fid_lists, + std::vector>>& fid_lists_offset); + + __attribute__((annotate("shared"))) fid_t fid_, fnum_; + __attribute__((annotate("shared"))) bool directed_; + __attribute__((annotate("shared"))) bool is_multigraph_; + __attribute__((annotate("shared"))) property_graph_types::LABEL_ID_TYPE vertex_label_num_; + __attribute__((annotate("shared"))) property_graph_types::LABEL_ID_TYPE edge_label_num_; + size_t oenum_, ienum_; // FIXME: should be pre-computable + + __attribute__((annotate("shared"))) String oid_type, vid_type; + + __attribute__((annotate("shared"))) vineyard::Array ivnums_, ovnums_, tvnums_; + + __attribute__((annotate("shared"))) List> vertex_tables_; + std::vector> vertex_tables_columns_; + + __attribute__((annotate("shared"))) List> ovgid_lists_; + std::vector ovgid_lists_ptr_; + + __attribute__((annotate("shared"))) List>> ovg2l_maps_; + std::vector*> ovg2l_maps_ptr_; + + __attribute__((annotate("shared"))) List> edge_tables_; + std::vector> edge_tables_columns_; + std::vector flatten_edge_tables_columns_; + + __attribute__((annotate("shared"))) List>> ie_lists_, + oe_lists_; + std::vector> ie_ptr_lists_, oe_ptr_lists_; + __attribute__((annotate("shared"))) List>> ie_offsets_lists_, + oe_offsets_lists_; + std::vector> ie_offsets_ptr_lists_, + oe_offsets_ptr_lists_; + + std::vector>> idst_, odst_, iodst_; + std::vector>> idoffset_, odoffset_, + iodoffset_; + + __attribute__((annotate("shared"))) std::shared_ptr vm_ptr_; + + vineyard::IdParser vid_parser_; + + __attribute__((annotate("shared"))) json schema_json_; + PropertyGraphSchema schema_; + + friend class ArrowFragmentBaseBuilder; + + template + friend class gs::ArrowProjectedFragment; +}; + +} // namespace vineyard + +// vim: syntax=cpp + +#endif // MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GRIN_H diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index 4db20c9a5..7ec898966 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -1,28 +1,101 @@ # GRIN +GRIN is a series of C-style Graph Retrieval INterfaces for graph computing engines to access different +storage systems in a uniform way. + ## Assumptions -### Property Graph +### Property Graph Model - Vertices have types, so as Edges. - The relationship between edge type and pairs of vertex types is many-to-many. - Properties are bound to vertex and edge types, but some may have the same name. - Labels can be assigned to vertices and edges (NOT their types) primarily for query filtering, and labels have no properties. + ## Design Principles ### Handler - GRIN provides a series of handlers for graph concepts, such as vertex, edge and graph itself. - Since almost everything in GRIN are handlers except of only a few string names, the type for a graph concept and its handler is always mixed-used in GRIN. -- For example, we use the type Vertex to represent the type of a vertex handler, instead of using VertexHandler for clean code. +- For example, GRIN uses the type Vertex to represent the type of a vertex handler, instead of using VertexHandler for clean code. ### List -- A list handler, no matter what kind of list it represents, is available to the user only if the storage can provide the size of the list, and an element retrieval API by position (i.e., index of array). -- For the instance of Vertex, when some GRIN API returns a `VertexList`(handler), the user can get the size of the `VertexList` by calling `get_vertex_list_size` to get the `size`, and `get_vertex_from_list` to get a `vertex` by providing an index value ranges from `0` to `size-1`. +- A list handler, no matter what kind of list it represents, is available to the user only if the storage can provide the size of the list, and an element retrieval API by position (i.e., index of array). Otherwise, the storage should provide a list iterator, see next section. +- A vertex list example + + ```CPP + /* grin/topology/vertexlist.h */ + + VertexList get_vertex_list(Graph g); // get the vertexlist of a graph + + size_t get_vertex_list_size(VertexList vl); // the storage must implement the API to return the size of vertexlist + + Vertex get_vertex_from_list(VertexList vl, size_t idx); // the storage must implement the API to return the element of vertexlist by position + + + /* run.cc */ + { + auto vertexlist = get_vertex_list(g); // with a graph (handler) g + auto sz = get_vertex_list_size(vertexlist); + + for (auto i = 0; i < sz; ++i) { + auto v = get_vertex_from_list(vertexlist, i); + } + } + ``` + ### List Iterator - A list iterator handler, no matter what kind of list it represents, is available to the user if the list size is unknown or for sequential scan efficiency. -- Take Vertex as example again, users can get the iterator at the beginning using APIs like `get_vertex_list_begin`, and keeps on using `get_next_vertex_list_iter` to update the iterator till the end of the list when a `false` is returned. APIs like `get_vertex_from_iter` will return the `Vertex` from the vertex iterator. +- A vertex list iterator example + + ```CPP + /* grin/topology/vertexlist.h */ + + VertexListIterator get_vertex_list_begin(Graph g); // get the begin iterator of the vertexlist + + VertexListIterator get_next_vertex_list_iter(VertexListIterator); // get next iterator + + bool is_vertex_list_end(VertexListIterator); // check if reaches the end + + Vertex get_vertex_from_iter(VertexListIterator vli); // get the vertex from the iterator + + + /* run.cc */ + { + auto iter = get_vertex_list_begin(g); // with a graph (handler) g + + while (!is_vertex_list_end(iter)) { + auto v = get_vertex_from_iter(iter); + iter = get_next_vertex_list_iter(iter); + } + } + ``` + ### Property - Properties are bound to vertex and edge types. It means even some properties may have the same name, as long as they are bound to different vertex or edge types, GRIN will provide distinct handlers for these properties. This is because, although properties with the same name usually provide the same semantic in the graph, they may have different data types in the underlying storage for efficiency concerns (e.g., short date and long date). - To avoid the incompatibility with storage engines, we made the design choice to bind properties under vertex and edge types. Meanwhile, GRIN provides an API to get all the property handlers with the (same) given property name. + + ```CPP + /* grin/property/type.h */ + + VertexType get_vertex_type_by_name(Graph g, const char* name); + + + /* grin/property/property.h */ + + VertexProperty get_vertex_property_by_name(Graph, VertexType, const char* name); + + VertexPropertyList get_vertex_properties_by_name(Graph, const char* name); + + + /* run.cc */ + { + auto vtype = get_vertex_type_by_name(g, "Person"); // get the vertex type of Person + auto vprop = get_vertex_property_by_name(g, vtype, "Name"); // get the Name property bound to Person + + auto vpl = get_vertex_properties_by_name(g, "Name"); // get all the properties called Name under all the vertex types (e.g., Person, Company) in g + } + ``` + ### Label - GRIN does NOT distinguish label on vertices and edges, that means a vertex and an edge may have a same label. - However the storage can tell GRIN whether labels are enabled in vertices or edges seperatedly with macros of `WITH_VERTEX_LABEL` and `WITH_EDGE_LABEL` respectively. @@ -32,18 +105,53 @@ different data types in the underlying storage for efficiency concerns (e.g., sh be recognized in partitions other than the current partition where the instance is accessed. - For example, a `VertexRef` is a reference of a `Vertex` that can be recognized in other partitions. + ```CPP + /* grin/partition/partition.h */ + + VertexRef get_vertex_ref_for_vertex(Graph, Partition, Vertex); + + const char* serialize_vertex_ref(Graph, VertexRef); + + VertexRef deserialize_to_vertex_ref(Graph, const char*); + + Vertex get_vertex_from_vertex_ref(Graph, VertexRef); + + + /* run.cc in machine 1 */ + { + // p is the partition (handler) for the partition in machine 2 + + auto vref = get_vertex_ref_for_vertex(g, p, v); // get v's vertex ref which can be recgonized in machine 2 + + const char* msg = serialize_vertex_ref(g, vref); // serialize into a message + + // send the message to machine 2... + } + + + /* run.cc in machine 2 */ + { + // recieve the message from machine 1... + + auto vref = deserialize_to_vertex_ref(g, msg); // deserialize back to vertex ref + + auto v = get_vertex_from_vertex_ref(g, vref); // cast to vertex if g can recognize the vertex ref + } + ``` + ### Master and Mirror - Master & mirror vertices are the concept borrowed from vertexcut partition strategy. When a vertex is recognized in -serveral partitions, we refer one of them as the master vertex while others as mirrors. This is primarily for data +serveral partitions, GRIN refers one of them as the master vertex while others as mirrors. This is primarily for data aggregation purpose to share a common centural node for every one. -- While in edgecut partition, the concept becomes inner & outer vertices. GRIN uses `master == inner` and `mirror == outer` to unify these concepts. +- While in edgecut partition, the concept becomes inner & outer vertices. GRIN uses master & mirror vertices to represent inner & outer vertices respectively to unify these concepts. ### Local Complete -- The concept of local complete is with repect of whether a graph component adhere to a vertex or an edge is complete locally in the partition. -- Take vertex and properties as example. We say the vertex is "property local complete" if we can get all the properties of the vertex locally in the partition. -- We can also have "edge property local complete", "vertex neighbor local complete" and so on. -- We do NOT assume any local complete on master vertices. Since in some extremely cases, master vertices +- The concept of local complete is with repect to whether a graph component adhere to a vertex or an edge is locally complete within the partition. +- Take vertex and properties as example. GRIN considers the vertex is "property local complete" if it can get all the properties of the vertex locally in the partition. +- There are concepts like "edge property local complete", "vertex neighbor local complete" and so on. +- GRIN does NOT assume any local complete on master vertices. Since in some extremely cases, master vertices may NOT contain all the data or properties locally. +- GRIN currently provides vertex-level/edge-level local complete judgement APIs, while the introduction of type-level judgement APIs is open for discussion. ## Traits ### Natural ID Trait diff --git a/modules/graph/grin/include/index/label.h b/modules/graph/grin/include/index/label.h index 7b3a0fc88..bdc47ec61 100644 --- a/modules/graph/grin/include/index/label.h +++ b/modules/graph/grin/include/index/label.h @@ -21,17 +21,17 @@ limitations under the License. #include "../predefine.h" #if defined(WITH_VERTEX_LABEL) || defined(WITH_EDGE_LABEL) -Label get_label_by_name(const Graph, const char*); +Label get_label_by_name(Graph, const char*); -char* get_label_name(const Graph, const Label); +const char* get_label_name(Graph, Label); void destroy_label(Label); void destroy_label_list(LabelList); -size_t get_label_list_size(const LabelList); +size_t get_label_list_size(LabelList); -Label get_label_from_list(const LabelList, const size_t); +Label get_label_from_list(LabelList, size_t); #endif #ifdef WITH_VERTEX_LABEL @@ -42,28 +42,28 @@ Label get_label_from_list(const LabelList, const size_t); * @param Vertex the vertex * @return whether succeed */ -bool assign_label_to_vertex(const Graph, const Label, Vertex); +bool assign_label_to_vertex(Graph, Label, Vertex); /** * @brief get the label list of a vertex * @param Graph the graph * @param Vertex the vertex */ -LabelList get_vertex_label_list(const Graph, const Vertex); +LabelList get_vertex_label_list(Graph, Vertex); /** * @brief get the vertex list by label * @param Graph the graph * @param Label the label */ -VertexList get_vertex_list_by_label(const Graph, const Label); +VertexList get_vertex_list_by_label(Graph, Label); /** * @brief filtering an existing vertex list by label * @param VertexList the existing vertex list * @param Label the label */ -VertexList filter_vertex_list_by_label(const VertexList, const Label); +VertexList filter_vertex_list_by_label(VertexList, Label); #endif #ifdef WITH_EDGE_LABEL @@ -74,28 +74,28 @@ VertexList filter_vertex_list_by_label(const VertexList, const Label); * @param Edge the edge * @return whether succeed */ -bool assign_label_to_edge(const Graph, const Label, Edge); +bool assign_label_to_edge(Graph, Label, Edge); /** * @brief get the label list of a edge * @param Graph the graph * @param Edge the edge */ -LabelList get_edge_label_list(const Graph, const Edge); +LabelList get_edge_label_list(Graph, Edge); /** * @brief get the edge list by label * @param Graph the graph * @param Label the label */ -EdgeList get_edge_list_by_label(const Graph, const Label); +EdgeList get_edge_list_by_label(Graph, Label); /** * @brief filtering an existing edge list by label * @param EdgeList the existing edge list * @param Label the label */ -EdgeList filter_edge_list_by_label(const EdgeList, const Label); +EdgeList filter_edge_list_by_label(EdgeList, Label); #endif #endif // GRIN_INCLUDE_INDEX_LABEL_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/partition/partition.h b/modules/graph/grin/include/partition/partition.h index a8cf6b123..ef8594a9d 100644 --- a/modules/graph/grin/include/partition/partition.h +++ b/modules/graph/grin/include/partition/partition.h @@ -24,48 +24,48 @@ limitations under the License. #include "../predefine.h" #ifdef ENABLE_GRAPH_PARTITION -size_t get_total_partitions_number(const PartitionedGraph); +size_t get_total_partitions_number(PartitionedGraph); -PartitionList get_local_partition_list(const PartitionedGraph); +PartitionList get_local_partition_list(PartitionedGraph); void destroy_partition_list(PartitionList); PartitionList create_partition_list(); -bool insert_partition_to_list(PartitionList, const Partition); +bool insert_partition_to_list(PartitionList, Partition); -size_t get_partition_list_size(const PartitionList); +size_t get_partition_list_size(PartitionList); -Partition get_partition_from_list(const PartitionList, const size_t); +Partition get_partition_from_list(PartitionList, size_t); void destroy_partition(Partition); -void* get_partition_info(const PartitionedGraph, const Partition); +void* get_partition_info(PartitionedGraph, Partition); -Graph get_local_graph_from_partition(const PartitionedGraph, const Partition); +Graph get_local_graph_from_partition(PartitionedGraph, Partition); #endif #ifdef NATURAL_PARTITION_ID_TRAIT -Partition get_partition_from_id(const PartitionID); +Partition get_partition_from_id(PartitionID); -PartitionID get_partition_id(const Partition); +PartitionID get_partition_id(Partition); #endif // master & mirror vertices for vertexcut partition // while they refer to inner & outer vertices in edgecut partition #if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST) -VertexList get_master_vertices(const Graph); +VertexList get_master_vertices(Graph); -VertexList get_mirror_vertices(const Graph); +VertexList get_mirror_vertices(Graph); -VertexList get_mirror_vertices_by_partition(const Graph, const Partition); +VertexList get_mirror_vertices_by_partition(Graph, Partition); #ifdef WITH_VERTEX_PROPERTY -VertexList get_master_vertices_by_type(const Graph, const VertexType); +VertexList get_master_vertices_by_type(Graph, VertexType); -VertexList get_mirror_vertices_by_type(const Graph, const VertexType); +VertexList get_mirror_vertices_by_type(Graph, VertexType); -VertexList get_mirror_vertices_by_type_partition(const Graph, const VertexType, const Partition); +VertexList get_mirror_vertices_by_type_partition(Graph, VertexType, Partition); #endif #endif @@ -76,7 +76,7 @@ VertexList get_mirror_vertices_by_type_partition(const Graph, const VertexType, * @param Direction incoming or outgoing * @param Vertex the vertex */ -AdjacentList get_adjacent_master_list(const Graph, const Direction, const Vertex); +AdjacentList get_adjacent_master_list(Graph, Direction, Vertex); /** * @brief get the adjacentlist of a vertex where the neigbors are only mirror vertices @@ -84,7 +84,7 @@ AdjacentList get_adjacent_master_list(const Graph, const Direction, const Vertex * @param Direction incoming or outgoing * @param Vertex the vertex */ -AdjacentList get_adjacent_mirror_list(const Graph, const Direction, const Vertex); +AdjacentList get_adjacent_mirror_list(Graph, Direction, Vertex); /** * @brief get the adjacentlist of a vertex where the neigbors are only mirror vertices @@ -94,16 +94,16 @@ AdjacentList get_adjacent_mirror_list(const Graph, const Direction, const Vertex * @param Paritition the specific partition * @param Vertex the vertex */ -AdjacentList get_adjacent_mirror_list_by_partition(const Graph, const Direction, - const Partition, const Vertex); +AdjacentList get_adjacent_mirror_list_by_partition(Graph, Direction, + Partition, Vertex); #endif // Vertex ref refers to the same vertex referred in other partitions, -// while edge ref is likewise. Both can be serialized to char* for +// while edge ref is likewise. Both can be serialized to const char* for // message transporting and deserialized on the other end. #ifdef ENABLE_VERTEX_REF -VertexRef get_vertex_ref_for_vertex(const Graph, const Partition, const Vertex); +VertexRef get_vertex_ref_for_vertex(Graph, Partition, Vertex); /** * @brief get the local vertex from the vertex ref @@ -111,7 +111,7 @@ VertexRef get_vertex_ref_for_vertex(const Graph, const Partition, const Vertex); * @param Graph the graph * @param VertexRef the vertex ref */ -Vertex get_vertex_from_vertex_ref(const Graph, const VertexRef); +Vertex get_vertex_from_vertex_ref(Graph, VertexRef); /** * @brief get the master partition of a vertex ref. @@ -120,30 +120,34 @@ Vertex get_vertex_from_vertex_ref(const Graph, const VertexRef); * @param Graph the graph * @param VertexRef the vertex ref */ -Partition get_master_partition_from_vertex_ref(const Graph, const VertexRef); +bool is_master_vertex(Graph, Vertex); -char* serialize_vertex_ref(const Graph, const VertexRef); +bool is_mirror_vertex(Graph, Vertex); -VertexRef deserialize_to_vertex_ref(const Graph, const char*); +Partition get_master_partition_from_vertex_ref(Graph, VertexRef); + +const char* serialize_vertex_ref(Graph, VertexRef); + +VertexRef deserialize_to_vertex_ref(Graph, const char*); #endif #ifdef ENABLE_EDGE_REF -EdgeRef get_edge_ref_for_edge(const Graph, const Partition, const Edge); +EdgeRef get_edge_ref_for_edge(Graph, Partition, Edge); -Edge get_edge_from_edge_ref(const Graph, const EdgeRef); +Edge get_edge_from_edge_ref(Graph, EdgeRef); -Partition get_master_partition_from_edge_ref(const Graph, const EdgeRef); +Partition get_master_partition_from_edge_ref(Graph, EdgeRef); -char* serialize_edge_ref(const Graph, const EdgeRef); +const char* serialize_edge_ref(Graph, EdgeRef); -EdgeRef deserialize_to_edge_ref(const Graph, const char*); +EdgeRef deserialize_to_edge_ref(Graph, const char*); #endif // The concept of local_complete refers to whether we can get complete data or properties // locally in the partition. It is orthogonal to the concept of master/mirror which // is mainly designed for data aggregation. In some extremely cases, master vertices // may NOT contain all the data or properties locally. -bool is_vertex_neighbor_local_complete(const Graph, const Vertex); +bool is_vertex_neighbor_local_complete(Graph, Vertex); /** * @brief get the partitions whose combination can provide the complete @@ -151,30 +155,30 @@ bool is_vertex_neighbor_local_complete(const Graph, const Vertex); * @param Graph the graph * @param Vertex the vertex */ -PartitionList vertex_neighbor_complete_partitions(const Graph, const Vertex); +PartitionList vertex_neighbor_complete_partitions(Graph, Vertex); #ifdef WITH_VERTEX_DATA -bool is_vertex_data_local_complete(const Graph, const Vertex); +bool is_vertex_data_local_complete(Graph, Vertex); -PartitionList vertex_data_complete_partitions(const Graph, const Vertex); +PartitionList vertex_data_complete_partitions(Graph, Vertex); #endif #ifdef WITH_VERTEX_PROPERTY -bool is_vertex_property_local_complete(const Graph, const Vertex); +bool is_vertex_property_local_complete(Graph, Vertex); -PartitionList vertex_property_complete_partitions(const Graph, const Vertex); +PartitionList vertex_property_complete_partitions(Graph, Vertex); #endif #ifdef WITH_EDGE_DATA -bool is_edge_data_local_complete(const Graph, const Edge); +bool is_edge_data_local_complete(Graph, Edge); -PartitionList edge_data_complete_partitions(const Graph, const Edge); +PartitionList edge_data_complete_partitions(Graph, Edge); #endif #ifdef WITH_EDGE_PROPERTY -bool is_edge_property_local_complete(const Graph, const Edge); +bool is_edge_property_local_complete(Graph, Edge); -PartitionList edge_data_complete_partitions(const Graph, const Edge); +PartitionList edge_data_complete_partitions(Graph, Edge); #endif #endif // GRIN_INCLUDE_PARTITION_PARTITION_H_ diff --git a/modules/graph/grin/include/property/primarykey.h b/modules/graph/grin/include/property/primarykey.h index 5d26ff903..3e3c3745d 100644 --- a/modules/graph/grin/include/property/primarykey.h +++ b/modules/graph/grin/include/property/primarykey.h @@ -25,14 +25,14 @@ limitations under the License. * @brief get the vertex types with primary keys * @param Graph the graph */ -VertexTypeList get_vertex_types_with_primary_keys(const Graph); +VertexTypeList get_vertex_types_with_primary_keys(Graph); /** * @brief get the primary keys (property list) of a specific vertex type * @param Graph the graph * @param VertexType the vertex type */ -VertexPropertyList get_primary_keys_by_vertex_type(const Graph, const VertexType); +VertexPropertyList get_primary_keys_by_vertex_type(Graph, VertexType); /** * @brief get the vertex with the given primary keys @@ -40,7 +40,7 @@ VertexPropertyList get_primary_keys_by_vertex_type(const Graph, const VertexType * @param VertexPropertyList the primary keys * @param Row the values of primary keys */ -Vertex get_vertex_by_primay_keys(const Graph, const VertexPropertyList, const Row); +Vertex get_vertex_by_primay_keys(Graph, VertexPropertyList, Row); #endif #ifdef WITH_EDGE_PRIMARY_KEYS @@ -48,14 +48,14 @@ Vertex get_vertex_by_primay_keys(const Graph, const VertexPropertyList, const Ro * @brief get the edge types with primary keys * @param Graph the graph */ -EdgeTypeList get_edge_types_with_primary_keys(const Graph); +EdgeTypeList get_edge_types_with_primary_keys(Graph); /** * @brief get the primary keys (property list) of a specific edge type * @param Graph the graph * @param EdgeType the edge type */ -EdgePropertyList get_primary_keys_by_edge_type(const Graph, const EdgeType); +EdgePropertyList get_primary_keys_by_edge_type(Graph, EdgeType); /** * @brief get the edge with the given primary keys @@ -63,7 +63,7 @@ EdgePropertyList get_primary_keys_by_edge_type(const Graph, const EdgeType); * @param EdgePropertyList the primary keys * @param Row the values of primary keys */ -Edge get_edge_by_primay_keys(const Graph, const EdgePropertyList, const Row); +Edge get_edge_by_primay_keys(Graph, EdgePropertyList, Row); #endif #endif // GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/property.h b/modules/graph/grin/include/property/property.h index 74d4c93e2..cfd901bf1 100644 --- a/modules/graph/grin/include/property/property.h +++ b/modules/graph/grin/include/property/property.h @@ -20,50 +20,52 @@ limitations under the License. #include "../predefine.h" -#ifdef WITH_PROPERTY_NAME +#if defined(WITH_PROPERTY_NAME) && defined(WITH_VERTEX_PROPERTY) /** * @brief get the vertex property name * @param Graph the graph * @param VertexProperty the vertex property */ -char* get_vertex_property_name(const Graph, const VertexProperty); +const char* get_vertex_property_name(Graph, VertexProperty); /** * @brief get the vertex property with a given name under a specific vertex type * @param Graph the graph * @param VertexType the specific vertex type - * @param msg the name + * @param name the name */ -VertexProperty get_vertex_property_by_name(const Graph, const VertexType, const char* msg); +VertexProperty get_vertex_property_by_name(Graph, VertexType, const char* name); /** * @brief get all the vertex properties with a given name * @param Graph the graph - * @param msg the name + * @param name the name */ -VertexPropertyList get_vertex_properties_by_name(const Graph, const char*); +VertexPropertyList get_vertex_properties_by_name(Graph, const char* name); +#endif +#if defined(WITH_PROPERTY_NAME) && defined(WITH_EDGE_PROPERTY) /** * @brief get the edge property name * @param Graph the graph * @param EdgeProperty the edge property */ -char* get_edge_property_name(const Graph, const EdgeProperty); +const char* get_edge_property_name(Graph, EdgeProperty); /** * @brief get the edge property with a given name under a specific edge type * @param Graph the graph * @param EdgeType the specific edge type - * @param msg the name + * @param name the name */ -EdgeProperty get_edge_property_by_name(const Graph, const EdgeType, const char* msg); +EdgeProperty get_edge_property_by_name(Graph, EdgeType, const char* name); /** * @brief get all the edge properties with a given name * @param Graph the graph - * @param msg the name + * @param name the name */ -EdgePropertyList get_edge_properties_by_name(const Graph, const char*); +EdgePropertyList get_edge_properties_by_name(Graph, const char* name); #endif @@ -78,7 +80,7 @@ void destroy_vertex_property(VertexProperty); * @brief get property data type * @param VertexProperty vertex property */ -DataType get_vertex_property_data_type(VertexProperty); +DataType get_vertex_property_data_type(Graph, VertexProperty); /** * @brief get the vertex type that the property is bound to @@ -87,6 +89,7 @@ DataType get_vertex_property_data_type(VertexProperty); VertexType get_vertex_property_vertex_type(VertexProperty); #endif + #ifdef WITH_EDGE_PROPERTY /** * @brief destroy edge property @@ -98,7 +101,7 @@ void destroy_edge_property(EdgeProperty); * @brief get property data type * @param EdgeProperty edge property */ -DataType get_edge_property_data_type(EdgeProperty); +DataType get_edge_property_data_type(Graph, EdgeProperty); /** * @brief get the edge type that the property is bound to diff --git a/modules/graph/grin/include/property/propertylist.h b/modules/graph/grin/include/property/propertylist.h index 7c74991b4..cc697c612 100644 --- a/modules/graph/grin/include/property/propertylist.h +++ b/modules/graph/grin/include/property/propertylist.h @@ -21,44 +21,44 @@ limitations under the License. #include "../predefine.h" #ifdef WITH_VERTEX_PROPERTY -VertexPropertyList get_vertex_property_list_by_type(const Graph, const VertexType); +VertexPropertyList get_vertex_property_list_by_type(Graph, VertexType); -size_t get_vertex_property_list_size(const VertexPropertyList); +size_t get_vertex_property_list_size(VertexPropertyList); -VertexProperty get_vertex_property_from_list(const VertexPropertyList, const size_t); +VertexProperty get_vertex_property_from_list(VertexPropertyList, size_t); VertexPropertyList create_vertex_property_list(); void destroy_vertex_property_list(VertexPropertyList); -bool insert_vertex_property_to_list(VertexPropertyList, const VertexProperty); +bool insert_vertex_property_to_list(VertexPropertyList, VertexProperty); #endif #ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT -VertexProperty get_vertex_property_from_id(const VertexType, const VertexPropertyID); +VertexProperty get_vertex_property_from_id(VertexType, VertexPropertyID); -VertexPropertyID get_vertex_property_id(const VertexType, const VertexProperty); +VertexPropertyID get_vertex_property_id(VertexType, VertexProperty); #endif #ifdef WITH_EDGE_PROPERTY -EdgePropertyList get_edge_property_list_by_type(const Graph, const EdgeType); +EdgePropertyList get_edge_property_list_by_type(Graph, EdgeType); -size_t get_edge_property_list_size(const EdgePropertyList); +size_t get_edge_property_list_size(EdgePropertyList); -EdgeProperty get_edge_property_from_list(const EdgePropertyList, const size_t); +EdgeProperty get_edge_property_from_list(EdgePropertyList, size_t); EdgePropertyList create_edge_property_list(); void destroy_edge_property_list(EdgePropertyList); -bool insert_edge_property_to_list(EdgePropertyList, const EdgeProperty); +bool insert_edge_property_to_list(EdgePropertyList, EdgeProperty); #endif #ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT -EdgeProperty get_edge_property_from_id(const EdgeType, const EdgePropertyID); +EdgeProperty get_edge_property_from_id(EdgeType, EdgePropertyID); -EdgePropertyID get_edge_property_id(const EdgeType, const EdgeProperty); +EdgePropertyID get_edge_property_id(EdgeType, EdgeProperty); #endif @@ -73,12 +73,12 @@ EdgePropertyID get_edge_property_id(const EdgeType, const EdgeProperty); ///@{ #if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE_TRAIT) /** @brief project vertex properties */ -Graph select_vertex_properties(const Graph, const VertexPropertyList); +Graph select_vertex_properties(Graph, VertexPropertyList); #endif #if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE_TRAIT) /** @brief project edge properties */ -Graph select_edge_properteis(const Graph, const EdgePropertyList); +Graph select_edge_properteis(Graph, EdgePropertyList); #endif #endif // GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/propertytable.h b/modules/graph/grin/include/property/propertytable.h index afe18ef8f..64c55f88f 100644 --- a/modules/graph/grin/include/property/propertytable.h +++ b/modules/graph/grin/include/property/propertytable.h @@ -32,7 +32,7 @@ limitations under the License. void destroy_row(Row); /** @brief the value of a property from row by its position in row */ -const void* get_value_from_row(Row, const size_t); +const void* get_value_from_row(Row, size_t); /** @brief create a row, usually to get vertex/edge by primary keys */ Row create_row(); @@ -59,7 +59,7 @@ void destroy_vertex_property_table(VertexPropertyTable); * @param Graph the graph * @param VertexType the vertex type */ -VertexPropertyTable get_vertex_property_table_by_type(const Graph, const VertexType); +VertexPropertyTable get_vertex_property_table_by_type(Graph, VertexType); /** * @brief get vertex property value from table @@ -68,7 +68,7 @@ VertexPropertyTable get_vertex_property_table_by_type(const Graph, const VertexT * @param VertexProperty the vertex property which is the column index * @return can be casted to the property data type by the caller */ -const void* get_value_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexProperty); +const void* get_value_from_vertex_property_table(VertexPropertyTable, Vertex, VertexProperty); /** * @brief get vertex row from table @@ -76,7 +76,7 @@ const void* get_value_from_vertex_property_table(const VertexPropertyTable, cons * @param Vertex the vertex which is the row index * @param VertexPropertyList the vertex property list as columns */ -Row get_row_from_vertex_property_table(const VertexPropertyTable, const Vertex, const VertexPropertyList); +Row get_row_from_vertex_property_table(VertexPropertyTable, Vertex, VertexPropertyList); #ifndef COLUMN_STORE_TRAIT /** @@ -85,7 +85,7 @@ Row get_row_from_vertex_property_table(const VertexPropertyTable, const Vertex, * @param Vertex the vertex which is the row index * @param VertexPropertyList the vertex property list as columns */ -Row get_vertex_row(const Graph, const Vertex, const VertexPropertyList); +Row get_vertex_row(Graph, Vertex, VertexPropertyList); #endif #endif @@ -106,7 +106,7 @@ void destroy_edge_property_table(EdgePropertyTable); * @param Graph the graph * @param EdgeType the edge type */ -EdgePropertyTable get_edge_property_table_by_type(const Graph, const EdgeType); +EdgePropertyTable get_edge_property_table_by_type(Graph, EdgeType); /** * @brief get edge property value from table @@ -115,7 +115,7 @@ EdgePropertyTable get_edge_property_table_by_type(const Graph, const EdgeType); * @param EdgeProperty the edge property which is the column index * @return can be casted to the property data type by the caller */ -const void* get_value_from_edge_property_table(const EdgePropertyTable, const Edge, const EdgeProperty); +const void* get_value_from_edge_property_table(EdgePropertyTable, Edge, EdgeProperty); /** * @brief get edge row from table @@ -123,7 +123,7 @@ const void* get_value_from_edge_property_table(const EdgePropertyTable, const Ed * @param Edge the edge which is the row index * @param EdgePropertyList the edge property list as columns */ -Row get_row_from_edge_property_table(const EdgePropertyTable, const Edge, const EdgePropertyList); +Row get_row_from_edge_property_table(EdgePropertyTable, Edge, EdgePropertyList); #ifndef COLUMN_STORE_TRAIT /** @@ -132,7 +132,7 @@ Row get_row_from_edge_property_table(const EdgePropertyTable, const Edge, const * @param Edge the edge which is the row index * @param EdgePropertyList the edge property list as columns */ -Row get_edge_row(const Graph, const Edge, const EdgePropertyList); +Row get_edge_row(Graph, Edge, EdgePropertyList); #endif #endif diff --git a/modules/graph/grin/include/property/type.h b/modules/graph/grin/include/property/type.h index 7709439b3..8cd2ae346 100644 --- a/modules/graph/grin/include/property/type.h +++ b/modules/graph/grin/include/property/type.h @@ -22,60 +22,60 @@ limitations under the License. #ifdef WITH_VERTEX_PROPERTY // Vertex type -VertexType get_vertex_type(const Graph, const Vertex); +VertexType get_vertex_type(Graph, Vertex); -char* get_vertex_type_name(const Graph, const VertexType); +const char* get_vertex_type_name(Graph, VertexType); -VertexType get_vertex_type_by_name(const Graph, char*); +VertexType get_vertex_type_by_name(Graph, const char*); // Vertex type list -VertexTypeList get_vertex_type_list(const Graph); +VertexTypeList get_vertex_type_list(Graph); void destroy_vertex_type_list(VertexTypeList); VertexTypeList create_vertex_type_list(); -bool insert_vertex_type_to_list(VertexTypeList, const VertexType); +bool insert_vertex_type_to_list(VertexTypeList, VertexType); -size_t get_vertex_type_list_size(const VertexTypeList); +size_t get_vertex_type_list_size(VertexTypeList); -VertexType get_vertex_type_from_list(const VertexTypeList, const size_t); +VertexType get_vertex_type_from_list(VertexTypeList, size_t); #endif #ifdef NATURAL_VERTEX_TYPE_ID_TRAIT -VertexTypeID get_vertex_type_id(const VertexType); +VertexTypeID get_vertex_type_id(VertexType); -VertexType get_vertex_type_from_id(const VertexTypeID); +VertexType get_vertex_type_from_id(VertexTypeID); #endif #ifdef WITH_EDGE_PROPERTY // Edge type -EdgeType get_edge_type(const Graph, const Edge); +EdgeType get_edge_type(Graph, Edge); -char* get_edge_type_name(const Graph, const EdgeType); +const char* get_edge_type_name(Graph, EdgeType); -EdgeType get_edge_type_by_name(const Graph, char*); +EdgeType get_edge_type_by_name(Graph, const char*); // Edge type list -EdgeTypeList get_edge_type_list(const Graph); +EdgeTypeList get_edge_type_list(Graph); void destroy_edge_type_list(EdgeTypeList); EdgeTypeList create_edge_type_list(); -bool insert_edge_type_to_list(EdgeTypeList, const EdgeType); +bool insert_edge_type_to_list(EdgeTypeList, EdgeType); -size_t get_edge_type_list_size(const EdgeTypeList); +size_t get_edge_type_list_size(EdgeTypeList); -EdgeType get_edge_type_from_list(const EdgeTypeList, const size_t); +EdgeType get_edge_type_from_list(EdgeTypeList, size_t); #endif #ifdef NATURAL_EDGE_TYPE_ID_TRAIT -EdgeTypeID get_edge_type_id(const EdgeType); +EdgeTypeID get_edge_type_id(EdgeType); -EdgeType get_edge_type_from_id(const EdgeTypeID); +EdgeType get_edge_type_from_id(EdgeTypeID); #endif /** @name VertexEdgeTypeRelation @@ -86,13 +86,13 @@ EdgeType get_edge_type_from_id(const EdgeTypeID); ///@{ #if defined(WITH_VERTEX_PROPERTY) && defined(WITH_EDGE_PROPERTY) /** @brief the src vertex type list */ -VertexTypeList get_src_types_from_edge_type(const Graph, const EdgeType); +VertexTypeList get_src_types_from_edge_type(Graph, EdgeType); /** @brief get the dst vertex type list */ -VertexTypeList get_dst_types_from_edge_type(const Graph, const EdgeType); +VertexTypeList get_dst_types_from_edge_type(Graph, EdgeType); /** @brief get the edge type list related to a given pair of vertex types */ -EdgeTypeList get_edge_types_from_vertex_type_pair(const Graph, const VertexType, const VertexType); +EdgeTypeList get_edge_types_from_vertex_type_pair(Graph, VertexType, VertexType); #endif ///@} diff --git a/modules/graph/grin/include/topology/adjacentlist.h b/modules/graph/grin/include/topology/adjacentlist.h index e0f524d8e..f81b30566 100644 --- a/modules/graph/grin/include/topology/adjacentlist.h +++ b/modules/graph/grin/include/topology/adjacentlist.h @@ -19,24 +19,26 @@ limitations under the License. #include "../predefine.h" #ifdef ENABLE_ADJACENT_LIST -AdjacentList get_adjacent_list(const Graph, const Direction, Vertex); +AdjacentList get_adjacent_list(Graph, Direction, Vertex); #ifdef WITH_EDGE_PROPERTY -AdjacentList get_adjacent_list_by_edge_type(const Graph, const Direction, Vertex, EdgeType); +AdjacentList get_adjacent_list_by_edge_type(Graph, Direction, Vertex, EdgeType); #endif void destroy_adjacent_list(AdjacentList); -size_t get_adjacent_list_size(const AdjacentList); +size_t get_adjacent_list_size(AdjacentList); -Vertex get_neighbor_from_adjacent_list(const AdjacentList, size_t); +Vertex get_neighbor_from_adjacent_list(AdjacentList, size_t); -Edge get_edge_from_adjacent_list(const AdjacentList, size_t); +Edge get_edge_from_adjacent_list(AdjacentList, size_t); #ifdef ENABLE_ADJACENT_LIST_ITERATOR -AdjacentListIterator get_adjacent_list_begin(const Graph); +AdjacentListIterator get_adjacent_list_begin(Graph); -bool get_next_adjacent_list_iter(AdjacentListIterator); +AdjacentListIterator get_next_adjacent_list_iter(AdjacentListIterator); + +bool is_adjacent_list_end(AdjacentListIterator); Vertex get_neighbor_from_iter(AdjacentListIterator); diff --git a/modules/graph/grin/include/topology/edgelist.h b/modules/graph/grin/include/topology/edgelist.h index 4393d2394..e92fa6175 100644 --- a/modules/graph/grin/include/topology/edgelist.h +++ b/modules/graph/grin/include/topology/edgelist.h @@ -20,30 +20,32 @@ limitations under the License. #ifdef ENABLE_EDGE_LIST -EdgeList get_edge_list(const Graph, const Direction); +EdgeList get_edge_list(Graph, Direction); #ifdef WITH_EDGE_PROPERTY -EdgeList get_edge_list_by_type(const Graph, const EdgeType); +EdgeList get_edge_list_by_type(Graph, EdgeType); #endif void destroy_edge_list(EdgeList); EdgeList create_edge_list(); -bool insert_edge_to_list(EdgeList, const Edge); +bool insert_edge_to_list(EdgeList, Edge); -size_t get_edge_list_size(const EdgeList); +size_t get_edge_list_size(EdgeList); -Edge get_edge_from_list(const EdgeList, size_t); +Edge get_edge_from_list(EdgeList, size_t); #ifdef ENABLE_EDGE_LIST_ITERATOR -EdgeListIterator get_edge_list_begin(const Graph); +EdgeListIterator get_edge_list_begin(Graph); #ifdef WITH_EDGE_PROPERTY -EdgeListIterator get_edge_list_begin_by_type(const Graph, const EdgeType); +EdgeListIterator get_edge_list_begin_by_type(Graph, EdgeType); #endif -bool get_next_edge_list_iter(EdgeListIterator); +EdgeListIterator get_next_edge_list_iter(EdgeListIterator); + +bool is_edge_list_end(EdgeListIterator); Edge get_edge_from_iter(EdgeListIterator); #endif diff --git a/modules/graph/grin/include/topology/structure.h b/modules/graph/grin/include/topology/structure.h index 8ecf1013e..0b18cecdf 100644 --- a/modules/graph/grin/include/topology/structure.h +++ b/modules/graph/grin/include/topology/structure.h @@ -19,20 +19,20 @@ limitations under the License. #include "../predefine.h" // Graph -bool is_directed(const Graph); +bool is_directed(Graph); -bool is_multigraph(const Graph); +bool is_multigraph(Graph); -size_t get_vertex_num(const Graph); +size_t get_vertex_num(Graph); #ifdef WITH_VERTEX_PROPERTY -size_t get_vertex_num_by_type(const Graph, const VertexType); +size_t get_vertex_num_by_type(Graph, VertexType); #endif -size_t get_edge_num(const Graph); +size_t get_edge_num(Graph, Direction d); #ifdef WITH_EDGE_PROPERTY -size_t get_edge_num_by_type(const Graph, const EdgeType); +size_t get_edge_num_by_type(Graph, Direction d, EdgeType); #endif @@ -40,37 +40,39 @@ size_t get_edge_num_by_type(const Graph, const EdgeType); void destroy_vertex(Vertex); #ifdef WITH_VERTEX_DATA -DataType get_vertex_data_type(const Graph, const Vertex); +DataType get_vertex_data_type(Graph, Vertex); -VertexData get_vertex_data_value(const Graph, const Vertex); +VertexData get_vertex_data_value(Graph, Vertex); void destroy_vertex_data(VertexData); #endif #ifdef WITH_VERTEX_ORIGINAL_ID -Vertex get_vertex_from_original_id(const Graph, const OriginalID); +Vertex get_vertex_from_original_id(Graph, OriginalID); -OriginalID get_vertex_original_id(const Graph, const Vertex); +DataType get_vertex_original_id_type(Graph); + +OriginalID get_vertex_original_id(Graph, Vertex); void destroy_vertex_original_id(OriginalID); #endif #if defined(WITH_VERTEX_ORIGINAL_ID) && defined(WITH_VERTEX_PROPERTY) -Vertex get_vertex_from_original_id_by_type(const Graph, const VertexType, const OriginalID); +Vertex get_vertex_from_original_id_by_type(Graph, VertexType, OriginalID); #endif // Edge void destroy_edge(Edge); -Vertex get_edge_src(const Graph, const Edge); +Vertex get_edge_src(Graph, Edge); -Vertex get_edge_dst(const Graph, const Edge); +Vertex get_edge_dst(Graph, Edge); #ifdef WITH_EDGE_DATA -DataType get_edge_data_type(const Graph, const Edge); +DataType get_edge_data_type(Graph, Edge); -EdgeData get_edge_data_value(const Graph, const Edge); +EdgeData get_edge_data_value(Graph, Edge); void destroy_edge_data(EdgeData); #endif diff --git a/modules/graph/grin/include/topology/vertexlist.h b/modules/graph/grin/include/topology/vertexlist.h index b88e3c99a..9cf26c4bb 100644 --- a/modules/graph/grin/include/topology/vertexlist.h +++ b/modules/graph/grin/include/topology/vertexlist.h @@ -20,30 +20,32 @@ limitations under the License. #ifdef ENABLE_VERTEX_LIST -VertexList get_vertex_list(const Graph); +VertexList get_vertex_list(Graph); #ifdef WITH_VERTEX_PROPERTY -VertexList get_vertex_list_by_type(const Graph, const VertexType); +VertexList get_vertex_list_by_type(Graph, VertexType); #endif void destroy_vertex_list(VertexList); VertexList create_vertex_list(); -bool insert_vertex_to_list(VertexList, const Vertex); +bool insert_vertex_to_list(VertexList, Vertex); -size_t get_vertex_list_size(const VertexList); +size_t get_vertex_list_size(VertexList); -Vertex get_vertex_from_list(const VertexList, const size_t); +Vertex get_vertex_from_list(VertexList, size_t); #ifdef ENABLE_VERTEX_LIST_ITERATOR -VertexListIterator get_vertex_list_begin(const Graph); +VertexListIterator get_vertex_list_begin(Graph); #ifdef WITH_VERTEX_PROPERTY -VertexListIterator get_vertex_list_begin_by_type(const Graph, const VertexType); +VertexListIterator get_vertex_list_begin_by_type(Graph, VertexType); #endif -bool get_next_vertex_list_iter(VertexListIterator); +VertexListIterator get_next_vertex_list_iter(VertexListIterator); + +bool is_vertex_list_end(VertexListIterator); Vertex get_vertex_from_iter(VertexListIterator); #endif diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index 294701371..51d3b2ae4 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -20,17 +20,17 @@ limitations under the License. #ifdef ENABLE_GRAPH_PARTITION -size_t get_total_partitions_number(const PartitionedGraph pg) { +size_t get_total_partitions_number(PartitionedGraph pg) { auto _pg = static_cast(pg); return _pg->total_frag_num(); } -PartitionList get_local_partition_list(const PartitionedGraph pg) { +PartitionList get_local_partition_list(PartitionedGraph pg) { auto _pg = static_cast(pg); auto pl = new PartitionList_T(); vineyard::Client client; client.Connect(); - for (const auto & [fid, location] : _pg->FragmentLocations()) { + for (auto & [fid, location] : _pg->FragmentLocations()) { if (location == client.instance_id()) { pl->push_back(fid); } @@ -48,19 +48,19 @@ PartitionList create_partition_list() { return pl; } -bool insert_partition_to_list(PartitionList pl, const Partition p) { +bool insert_partition_to_list(PartitionList pl, Partition p) { auto _pl = static_cast(pl); auto _p = static_cast(p); _pl->push_back(*_p); return true; } -size_t get_partition_list_size(const PartitionList pl) { +size_t get_partition_list_size(PartitionList pl) { auto _pl = static_cast(pl); return _pl->size(); } -Partition get_partition_from_list(const PartitionList pl, const size_t idx) { +Partition get_partition_from_list(PartitionList pl, size_t idx) { auto _pl = static_cast(pl); auto p = new Partition_T((*_pl)[idx]); return p; @@ -71,11 +71,11 @@ void destroy_partition(Partition p) { delete _p; } -void* get_partition_info(const PartitionedGraph pg, const Partition p) { +void* get_partition_info(PartitionedGraph pg, Partition p) { return NULL; } -Graph get_local_graph_from_partition(const PartitionedGraph pg, const Partition p) { +Graph get_local_graph_from_partition(PartitionedGraph pg, Partition p) { auto _pg = static_cast(pg); auto _p = static_cast(p); vineyard::Client client; @@ -85,12 +85,12 @@ Graph get_local_graph_from_partition(const PartitionedGraph pg, const Partition #endif #ifdef NATURAL_PARTITION_ID_TRAIT -Partition get_partition_from_id(const PartitionID pid) { +Partition get_partition_from_id(PartitionID pid) { auto p = new Partition_T(pid); return p; } -PartitionID get_partition_id(const Partition p) { +PartitionID get_partition_id(Partition p) { auto _p = static_cast(p); return *_p; } @@ -98,7 +98,7 @@ PartitionID get_partition_id(const Partition p) { #if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST) -VertexList get_master_vertices(const Graph g) { +VertexList get_master_vertices(Graph g) { auto _g = static_cast(g); auto _vl = new VertexList_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { @@ -107,7 +107,7 @@ VertexList get_master_vertices(const Graph g) { return _vl; } -VertexList get_mirror_vertices(const Graph g) { +VertexList get_mirror_vertices(Graph g) { auto _g = static_cast(g); auto _vl = new VertexList_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { @@ -116,12 +116,12 @@ VertexList get_mirror_vertices(const Graph g) { return _vl; } -VertexList get_mirror_vertices_by_partition(const Graph g, const Partition p) { +VertexList get_mirror_vertices_by_partition(Graph g, Partition p) { return NULL_LIST; } #ifdef WITH_VERTEX_PROPERTY -VertexList get_master_vertices_by_type(const Graph g, const VertexType vtype) { +VertexList get_master_vertices_by_type(Graph g, VertexType vtype) { auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto _vl = new VertexList_T(); @@ -129,7 +129,7 @@ VertexList get_master_vertices_by_type(const Graph g, const VertexType vtype) { return _vl; } -VertexList get_mirror_vertices_by_type(const Graph g, const VertexType vtype) { +VertexList get_mirror_vertices_by_type(Graph g, VertexType vtype) { auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto _vl = new VertexList_T(); @@ -137,31 +137,31 @@ VertexList get_mirror_vertices_by_type(const Graph g, const VertexType vtype) { return _vl; } -VertexList get_mirror_vertices_by_type_partition(const Graph g, const VertexType vtype, - const Partition p) { +VertexList get_mirror_vertices_by_type_partition(Graph g, VertexType vtype, + Partition p) { return NULL_LIST; } #endif #endif #if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_ADJACENT_LIST) -AdjacentList get_adjacent_master_list(const Graph g, const Direction d, const Vertex v) { +AdjacentList get_adjacent_master_list(Graph g, Direction d, Vertex v) { return NULL_LIST; } -AdjacentList get_adjacent_mirror_list(const Graph g, const Direction d, const Vertex v) { +AdjacentList get_adjacent_mirror_list(Graph g, Direction d, Vertex v) { return NULL_LIST; } -AdjacentList get_adjacent_mirror_list_by_partition(const Graph g, const Direction d, - const Partition p, const Vertex v) { +AdjacentList get_adjacent_mirror_list_by_partition(Graph g, Direction d, + Partition p, Vertex v) { return NULL_LIST; } #endif #ifdef ENABLE_VERTEX_REF -VertexRef get_vertex_ref_for_vertex(const Graph g, const Partition p, const Vertex v) { +VertexRef get_vertex_ref_for_vertex(Graph g, Partition p, Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); auto gid = _g->Vertex2Gid(*_v); @@ -169,7 +169,7 @@ VertexRef get_vertex_ref_for_vertex(const Graph g, const Partition p, const Vert return vr; } -Vertex get_vertex_from_vertex_ref(const Graph g, const VertexRef vr) { +Vertex get_vertex_from_vertex_ref(Graph g, VertexRef vr) { auto _g = static_cast(g); auto _vr = static_cast(vr); auto v = new Vertex_T(); @@ -179,7 +179,19 @@ Vertex get_vertex_from_vertex_ref(const Graph g, const VertexRef vr) { return NULL_VERTEX; } -Partition get_master_partition_from_vertex_ref(const Graph g, const VertexRef vr) { +bool is_master_vertex(Graph g, Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + return _g->IsInnerVertex(*_v); +} + +bool is_mirror_vertex(Graph g, Vertex v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + return _g->IsOuterVertex(*_v); +} + +Partition get_master_partition_from_vertex_ref(Graph g, VertexRef vr) { auto _g = static_cast(g); auto _vr = static_cast(vr); auto id_parser = vineyard::IdParser(); @@ -188,7 +200,7 @@ Partition get_master_partition_from_vertex_ref(const Graph g, const VertexRef vr return p; } -char* serialize_vertex_ref(const Graph g, const VertexRef vr) { +const char* serialize_vertex_ref(Graph g, VertexRef vr) { auto _vr = static_cast(vr); std::stringstream ss; ss << *_vr; @@ -198,7 +210,7 @@ char* serialize_vertex_ref(const Graph g, const VertexRef vr) { return out; } -VertexRef deserialize_to_vertex_ref(const Graph g, const char* msg) { +VertexRef deserialize_to_vertex_ref(Graph g, const char* msg) { std::stringstream ss(msg); VertexRef_T gid; ss >> gid; @@ -208,13 +220,13 @@ VertexRef deserialize_to_vertex_ref(const Graph g, const char* msg) { #endif #ifdef ENABLE_GRAPH_PARTITION -bool is_vertex_neighbor_local_complete(const Graph g, const Vertex v) { +bool is_vertex_neighbor_local_complete(Graph g, Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); return _g->IsInnerVertex(*_v); } -PartitionList vertex_neighbor_complete_partitions(const Graph g, const Vertex v) { +PartitionList vertex_neighbor_complete_partitions(Graph g, Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); auto pl = new PartitionList_T(); @@ -224,22 +236,22 @@ PartitionList vertex_neighbor_complete_partitions(const Graph g, const Vertex v) #endif #ifdef WITH_VERTEX_PROPERTY -bool is_vertex_property_local_complete(const Graph g, const Vertex v) { +bool is_vertex_property_local_complete(Graph g, Vertex v) { return is_vertex_neighbor_local_complete(g, v); } -PartitionList vertex_property_complete_partitions(const Graph g, const Vertex v) { +PartitionList vertex_property_complete_partitions(Graph g, Vertex v) { return vertex_neighbor_complete_partitions(g, v); } #endif #ifdef WITH_EDGE_PROPERTY -bool is_edge_property_local_complete(const Graph g, const Edge e) { +bool is_edge_property_local_complete(Graph g, Edge e) { return true; } -PartitionList edge_property_complete_partitions(const Graph g, const Edge e) { +PartitionList edge_property_complete_partitions(Graph g, Edge e) { return NULL_LIST; } #endif diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 67e787f0b..77fcdf481 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -15,60 +15,16 @@ limitations under the License. #include "graph/grin/src/predefine.h" -Graph get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { - auto frag = std::dynamic_pointer_cast>(client.GetObject(object_id)); - return frag.get(); -} - -template -struct DataTypeEnum { - static constexpr DataType value = DataType::Undefined; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Int32; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::UInt32; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Int64; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::UInt64; -}; -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Float; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Double; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::String; -}; - -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Date32; -}; +PartitionedGraph get_partitioned_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { + auto pg = std::dynamic_pointer_cast(client.GetObject(object_id)); + return pg.get(); +} -template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Date64; -}; +Graph get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { + auto frag = std::dynamic_pointer_cast>(client.GetObject(object_id)); + return frag.get(); +} std::string GetDataTypeName(DataType type) { switch (type) { diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 37096ab51..5c1b87dd3 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -24,6 +24,57 @@ limitations under the License. #include "client/client.h" #include "arrow/api.h" +template +struct DataTypeEnum { + static constexpr DataType value = DataType::Undefined; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Int32; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::UInt32; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Int64; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::UInt64; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Float; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Double; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::String; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Date32; +}; + +template <> +struct DataTypeEnum { + static constexpr DataType value = DataType::Date64; +}; + +PartitionedGraph get_partitioned_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id); Graph get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id); std::string GetDataTypeName(DataType); DataType ArrowToDataType(std::shared_ptr); diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index d72238974..8d494ea0a 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -13,7 +13,7 @@ limitations under the License. #include "graph/grin/src/predefine.h" #ifdef WITH_PROPERTY_NAME -char* get_vertex_property_name(const Graph g, const VertexProperty vp) { +const char* get_vertex_property_name(Graph g, VertexProperty vp) { auto _g = static_cast(g); auto _vp = static_cast(vp); auto s = _g->schema().GetVertexPropertyName(_vp->first, _vp->second); @@ -23,7 +23,7 @@ char* get_vertex_property_name(const Graph g, const VertexProperty vp) { return out; } -VertexProperty get_vertex_property_by_name(const Graph g, const VertexType vtype, +VertexProperty get_vertex_property_by_name(Graph g, VertexType vtype, const char* name) { auto _g = static_cast(g); auto _vtype = static_cast(vtype); @@ -32,7 +32,7 @@ VertexProperty get_vertex_property_by_name(const Graph g, const VertexType vtype return vp; } -VertexPropertyList get_vertex_properties_by_name(const Graph g, const char* name) { +VertexPropertyList get_vertex_properties_by_name(Graph g, const char* name) { auto _g = static_cast(g); auto s = std::string(name); auto vpl = new VertexPropertyList_T(); @@ -42,7 +42,7 @@ VertexPropertyList get_vertex_properties_by_name(const Graph g, const char* name return vpl; } -char* get_edge_property_name(const Graph g, const EdgeProperty ep) { +const char* get_edge_property_name(Graph g, EdgeProperty ep) { auto _g = static_cast(g); auto _ep = static_cast(ep); auto s = _g->schema().GetEdgePropertyName(_ep->first, _ep->second); @@ -52,7 +52,7 @@ char* get_edge_property_name(const Graph g, const EdgeProperty ep) { return out; } -EdgeProperty get_edge_property_by_name(const Graph g, const EdgeType etype, +EdgeProperty get_edge_property_by_name(Graph g, EdgeType etype, const char* name) { auto _g = static_cast(g); auto _etype = static_cast(etype); @@ -61,7 +61,7 @@ EdgeProperty get_edge_property_by_name(const Graph g, const EdgeType etype, return ep; } -EdgePropertyList get_edge_properties_by_name(const Graph g, const char* name) { +EdgePropertyList get_edge_properties_by_name(Graph g, const char* name) { auto _g = static_cast(g); auto s = std::string(name); auto epl = new EdgePropertyList_T(); @@ -79,7 +79,7 @@ void destroy_vertex_property(VertexProperty vp) { delete _vp; } -DataType get_vertex_property_data_type(const Graph g, const VertexProperty vp) { +DataType get_vertex_property_data_type(Graph g, VertexProperty vp) { auto _g = static_cast(g); auto _vp = static_cast(vp); auto dt = _g->schema().GetVertexPropertyType(_vp->first, _vp->second); @@ -100,7 +100,7 @@ void destroy_edge_property(EdgeProperty ep) { delete _ep; } -DataType get_edge_property_type(const Graph g, const EdgeProperty ep) { +DataType get_edge_property_type(Graph g, EdgeProperty ep) { auto _g = static_cast(g); auto _ep = static_cast(ep); auto dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index 4f9c30d6e..89ea7e4ab 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -14,7 +14,7 @@ limitations under the License. #include "graph/grin/include/property/propertylist.h" #ifdef WITH_VERTEX_PROPERTY -VertexPropertyList get_all_vertex_properties_by_type(const Graph g, const VertexType vtype) { +VertexPropertyList get_all_vertex_properties_by_type(Graph g, VertexType vtype) { auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto vpl = new VertexPropertyList_T(); @@ -24,12 +24,12 @@ VertexPropertyList get_all_vertex_properties_by_type(const Graph g, const Vertex return vpl; } -size_t get_vertex_property_list_size(const VertexPropertyList vpl) { +size_t get_vertex_property_list_size(VertexPropertyList vpl) { auto _vpl = static_cast(vpl); return _vpl->size(); } -VertexProperty get_vertex_property_from_list(const VertexPropertyList vpl, const size_t idx) { +VertexProperty get_vertex_property_from_list(VertexPropertyList vpl, size_t idx) { auto _vpl = static_cast(vpl); auto vp = new VertexProperty_T((*_vpl)[idx]); return vp; @@ -45,7 +45,7 @@ void destroy_vertex_property_list(VertexPropertyList vpl) { delete _vpl; } -bool insert_vertex_property_to_list(VertexPropertyList vpl, const VertexProperty vp) { +bool insert_vertex_property_to_list(VertexPropertyList vpl, VertexProperty vp) { auto _vpl = static_cast(vpl); auto _vp = static_cast(vp); _vpl->push_back(*_vp); @@ -55,13 +55,13 @@ bool insert_vertex_property_to_list(VertexPropertyList vpl, const VertexProperty #ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT -VertexProperty get_vertex_property_from_id(const VertexType vtype, const VertexPropertyID vpi) { +VertexProperty get_vertex_property_from_id(VertexType vtype, VertexPropertyID vpi) { auto _vtype = static_cast(vtype); auto vp = new VertexProperty_T(*_vtype, vpi); return vp; } -VertexPropertyID get_vertex_property_id(const VertexType vtype, const VertexProperty vp) { +VertexPropertyID get_vertex_property_id(VertexType vtype, VertexProperty vp) { auto _vtype = static_cast(vtype); auto _vp = static_cast(vp); if (*_vtype != _vp->first) return NULL_NATURAL_ID; @@ -71,7 +71,7 @@ VertexPropertyID get_vertex_property_id(const VertexType vtype, const VertexProp #ifdef WITH_EDGE_PROPERTY -EdgePropertyList get_all_edge_properties_by_type(const Graph g, const EdgeType etype) { +EdgePropertyList get_all_edge_properties_by_type(Graph g, EdgeType etype) { auto _g = static_cast(g); auto _etype = static_cast(etype); auto epl = new EdgePropertyList_T(); @@ -81,12 +81,12 @@ EdgePropertyList get_all_edge_properties_by_type(const Graph g, const EdgeType e return epl; } -size_t get_edge_property_list_size(const EdgePropertyList epl) { +size_t get_edge_property_list_size(EdgePropertyList epl) { auto _epl = static_cast(epl); return _epl->size(); } -EdgeProperty get_edge_property_from_list(const EdgePropertyList epl, const size_t idx) { +EdgeProperty get_edge_property_from_list(EdgePropertyList epl, size_t idx) { auto _epl = static_cast(epl); auto ep = new EdgeProperty_T((*_epl)[idx]); return ep; @@ -102,7 +102,7 @@ void destroy_edge_property_list(EdgePropertyList epl) { delete _epl; } -bool insert_edge_property_to_list(EdgePropertyList epl, const EdgeProperty ep) { +bool insert_edge_property_to_list(EdgePropertyList epl, EdgeProperty ep) { auto _epl = static_cast(epl); auto _ep = static_cast(ep); _epl->push_back(*_ep); @@ -112,13 +112,13 @@ bool insert_edge_property_to_list(EdgePropertyList epl, const EdgeProperty ep) { #ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT -EdgeProperty get_edge_property_from_id(const EdgeType etype, const EdgePropertyID epi) { +EdgeProperty get_edge_property_from_id(EdgeType etype, EdgePropertyID epi) { auto _etype = static_cast(etype); auto ep = new EdgeProperty_T(*_etype, epi); return ep; } -EdgePropertyID get_edge_property_id(const EdgeType etype, const EdgeProperty ep) { +EdgePropertyID get_edge_property_id(EdgeType etype, EdgeProperty ep) { auto _etype = static_cast(etype); auto _ep = static_cast(ep); if (*_etype != _ep->first) return NULL_NATURAL_ID; @@ -128,7 +128,7 @@ EdgePropertyID get_edge_property_id(const EdgeType etype, const EdgeProperty ep) #if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE_TRAIT) -Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { +Graph select_vertex_properties(Graph g, VertexPropertyList vpl) { auto _g = static_cast(g); auto _vpl = static_cast(vpl); std::map> vertices, edges; @@ -148,7 +148,7 @@ Graph select_vertex_properties(const Graph g, const VertexPropertyList vpl) { #endif #if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE_TRAIT) -Graph select_edge_properteis(const Graph g, const EdgePropertyList epl) { +Graph select_edge_properteis(Graph g, EdgePropertyList epl) { auto _g = static_cast(g); auto _epl = static_cast(epl); std::map> vertices, edges; diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index f0c0705c8..866f3a9ec 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -19,7 +19,7 @@ void destroy_row(Row r) { delete _r; } -const void* get_value_from_row(Row r, const size_t idx) { +const void* get_value_from_row(Row r, size_t idx) { auto _r = static_cast(r); return (*_r)[idx]; } @@ -29,7 +29,7 @@ Row create_row() { return r; } -bool insert_value_to_row(Row r, const void* value) { +bool insert_value_to_row(Row r, void* value) { auto _r = static_cast(r); _r->push_back(value); return true; @@ -43,7 +43,7 @@ void destroy_vertex_property_table(VertexPropertyTable vpt) { delete _vpt; } -VertexPropertyTable get_vertex_property_table_by_type(const Graph g, const VertexType vtype) { +VertexPropertyTable get_vertex_property_table_by_type(Graph g, VertexType vtype) { auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto vpt = new VertexPropertyTable_T(); @@ -53,8 +53,8 @@ VertexPropertyTable get_vertex_property_table_by_type(const Graph g, const Verte return vpt; } -const void* get_value_from_vertex_property_table(const VertexPropertyTable vpt, - const Vertex v, const VertexProperty vp) { +const void* get_value_from_vertex_property_table(VertexPropertyTable vpt, + Vertex v, VertexProperty vp) { auto _vpt = static_cast(vpt); auto _v = static_cast(v); auto _vp = static_cast(vp); @@ -65,8 +65,8 @@ const void* get_value_from_vertex_property_table(const VertexPropertyTable vpt, return result; } -Row get_row_from_vertex_property_table(const VertexPropertyTable vpt, const Vertex v, - const VertexPropertyList vpl) { +Row get_row_from_vertex_property_table(VertexPropertyTable vpt, Vertex v, + VertexPropertyList vpl) { auto _vpt = static_cast(vpt); auto _v = static_cast(v); auto _vpl = static_cast(vpl); @@ -90,7 +90,7 @@ void destroy_edge_property_table(EdgePropertyTable ept) { delete _ept; } -EdgePropertyTable get_edge_property_table_by_type(const Graph g, const EdgeType etype) { +EdgePropertyTable get_edge_property_table_by_type(Graph g, EdgeType etype) { auto _g = static_cast(g); auto _etype = static_cast(etype); auto ept = new EdgePropertyTable_T(); @@ -100,8 +100,8 @@ EdgePropertyTable get_edge_property_table_by_type(const Graph g, const EdgeType return ept; } -const void* get_value_from_edge_property_table(const EdgePropertyTable ept, - const Edge e, const EdgeProperty ep) { +const void* get_value_from_edge_property_table(EdgePropertyTable ept, + Edge e, EdgeProperty ep) { auto _ept = static_cast(ept); auto _e = static_cast(e); auto _ep = static_cast(ep); @@ -112,8 +112,8 @@ const void* get_value_from_edge_property_table(const EdgePropertyTable ept, return result; } -Row get_row_from_edge_property_table(const EdgePropertyTable ept, const Edge v, - const EdgePropertyList epl) { +Row get_row_from_edge_property_table(EdgePropertyTable ept, Edge v, + EdgePropertyList epl) { auto _ept = static_cast(ept); auto _e = static_cast(v); auto _epl = static_cast(epl); diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 4fca14cbc..d3178c063 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -14,14 +14,14 @@ limitations under the License. #include "graph/grin/include/property/type.h" #ifdef WITH_VERTEX_PROPERTY -VertexType get_vertex_type(const Graph g, const Vertex v) { +VertexType get_vertex_type(Graph g, Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); auto vt = new VertexType_T(_g->vertex_label(*_v)); return vt; } -char* get_vertex_type_name(const Graph g, const VertexType vt) { +const char* get_vertex_type_name(Graph g, VertexType vt) { auto _g = static_cast(g); auto _vt = static_cast(vt); auto s = _g->schema().GetVertexLabelName(*_vt); @@ -31,14 +31,14 @@ char* get_vertex_type_name(const Graph g, const VertexType vt) { return out; } -VertexType get_vertex_type_by_name(const Graph g, char* name) { +VertexType get_vertex_type_by_name(Graph g, const char* name) { auto _g = static_cast(g); auto s = std::string(name); auto vt = new VertexType_T(_g->schema().GetVertexLabelId(s)); return vt; } -VertexTypeList get_vertex_type_list(const Graph g) { +VertexTypeList get_vertex_type_list(Graph g) { auto _g = static_cast(g); auto vtl = new VertexTypeList_T(); for (auto i = 0; i < _g->vertex_label_num(); ++i) { @@ -57,19 +57,19 @@ VertexTypeList create_vertex_type_list() { return vtl; } -bool insert_vertex_type_to_list(VertexTypeList vtl, const VertexType vt) { +bool insert_vertex_type_to_list(VertexTypeList vtl, VertexType vt) { auto _vtl = static_cast(vtl); auto _vt = static_cast(vt); _vtl->push_back(*_vt); return true; } -size_t get_vertex_type_list_size(const VertexTypeList vtl) { +size_t get_vertex_type_list_size(VertexTypeList vtl) { auto _vtl = static_cast(vtl); return _vtl->size(); } -VertexType get_vertex_type_from_list(const VertexTypeList vtl, const size_t idx) { +VertexType get_vertex_type_from_list(VertexTypeList vtl, size_t idx) { auto _vtl = static_cast(vtl); auto vt = new VertexType_T((*_vtl)[idx]); return vt; @@ -78,12 +78,12 @@ VertexType get_vertex_type_from_list(const VertexTypeList vtl, const size_t idx) #ifdef NATURAL_VERTEX_TYPE_ID_TRAIT -VertexTypeID get_vertex_type_id(const VertexType vt) { +VertexTypeID get_vertex_type_id(VertexType vt) { auto _vt = static_cast(vt); return *_vt; } -VertexType get_vertex_type_from_id(const VertexTypeID vti) { +VertexType get_vertex_type_from_id(VertexTypeID vti) { auto vt = new VertexType_T(vti); return vt; } @@ -91,13 +91,13 @@ VertexType get_vertex_type_from_id(const VertexTypeID vti) { #ifdef WITH_EDGE_PROPERTY -EdgeType get_edge_type(const Graph g, const Edge e) { +EdgeType get_edge_type(Graph g, Edge e) { auto _e = static_cast(e); auto et = new EdgeType_T(_e->etype); return et; } -char* get_edge_type_name(const Graph g, const EdgeType et) { +const char* get_edge_type_name(Graph g, EdgeType et) { auto _g = static_cast(g); auto _et = static_cast(et); auto s = _g->schema().GetEdgeLabelName(*_et); @@ -107,14 +107,14 @@ char* get_edge_type_name(const Graph g, const EdgeType et) { return out; } -EdgeType get_edge_type_by_name(const Graph g, char* name) { +EdgeType get_edge_type_by_name(Graph g, const char* name) { auto _g = static_cast(g); auto s = std::string(name); auto et = new EdgeType_T(_g->schema().GetEdgeLabelId(s)); return et; } -EdgeTypeList get_edge_type_list(const Graph g) { +EdgeTypeList get_edge_type_list(Graph g) { auto _g = static_cast(g); auto etl = new EdgeTypeList_T(); for (auto i = 0; i < _g->edge_label_num(); ++i) { @@ -133,19 +133,19 @@ EdgeTypeList create_edge_type_list() { return etl; } -bool insert_edge_type_to_list(EdgeTypeList etl, const EdgeType et) { +bool insert_edge_type_to_list(EdgeTypeList etl, EdgeType et) { auto _etl = static_cast(etl); auto _et = static_cast(et); _etl->push_back(*_et); return true; } -size_t get_edge_type_list_size(const EdgeTypeList etl) { +size_t get_edge_type_list_size(EdgeTypeList etl) { auto _etl = static_cast(etl); return _etl->size(); } -EdgeType get_edge_type_from_list(const EdgeTypeList etl, const size_t idx) { +EdgeType get_edge_type_from_list(EdgeTypeList etl, size_t idx) { auto _etl = static_cast(etl); auto et = new VertexType_T((*_etl)[idx]); return et; @@ -154,12 +154,12 @@ EdgeType get_edge_type_from_list(const EdgeTypeList etl, const size_t idx) { #ifdef NATURAL_EDGE_TYPE_ID_TRAIT -EdgeTypeID get_edge_type_id(const EdgeType et) { +EdgeTypeID get_edge_type_id(EdgeType et) { auto _et = static_cast(et); return *_et; } -EdgeType get_edge_type_from_id(const EdgeTypeID eti) { +EdgeType get_edge_type_from_id(EdgeTypeID eti) { auto et = new EdgeType_T(eti); return et; } @@ -167,7 +167,7 @@ EdgeType get_edge_type_from_id(const EdgeTypeID eti) { #if defined(WITH_VERTEX_PROPERTY) && defined(WITH_EDGE_PROPERTY) -VertexTypeList get_src_types_from_edge_type(const Graph g, const EdgeType etype) { +VertexTypeList get_src_types_from_edge_type(Graph g, EdgeType etype) { auto _g = static_cast(g); auto _etype = static_cast(etype); auto entry = _g->schema().GetEntry(*_etype, "EDGE"); @@ -178,7 +178,7 @@ VertexTypeList get_src_types_from_edge_type(const Graph g, const EdgeType etype) return vtl; } -VertexTypeList get_dst_types_from_edge_type(const Graph g, const EdgeType etype) { +VertexTypeList get_dst_types_from_edge_type(Graph g, EdgeType etype) { auto _g = static_cast(g); auto _etype = static_cast(etype); auto entry = _g->schema().GetEntry(*_etype, "EDGE"); @@ -189,8 +189,8 @@ VertexTypeList get_dst_types_from_edge_type(const Graph g, const EdgeType etype) return vtl; } -EdgeTypeList get_edge_types_from_vertex_type_pair(const Graph g, const VertexType src_vt, - const VertexType dst_vt) { +EdgeTypeList get_edge_types_from_vertex_type_pair(Graph g, VertexType src_vt, + VertexType dst_vt) { auto _g = static_cast(g); auto _v1 = static_cast(src_vt); auto _v2 = static_cast(dst_vt); diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index dd536d273..92456c561 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -17,7 +17,7 @@ limitations under the License. #include "graph/grin/include/topology/adjacentlist.h" #ifdef ENABLE_ADJACENT_LIST -AdjacentList get_adjacent_list(const Graph g, const Direction d, const Vertex v) { +AdjacentList get_adjacent_list(Graph g, Direction d, Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); auto al = new AdjacentList_T(); @@ -35,8 +35,8 @@ AdjacentList get_adjacent_list(const Graph g, const Direction d, const Vertex v) } #ifdef WITH_EDGE_PROPERTY -AdjacentList get_adjacent_list_by_edge_type(const Graph g, const Direction d, - const Vertex v, const EdgeType etype) { +AdjacentList get_adjacent_list_by_edge_type(Graph g, Direction d, + Vertex v, EdgeType etype) { auto _g = static_cast(g); auto _v = static_cast(v); auto _etype = static_cast(etype); @@ -58,7 +58,7 @@ void destroy_adjacent_list(AdjacentList al) { delete _al; } -size_t get_adjacent_list_size(const AdjacentList al) { +size_t get_adjacent_list_size(AdjacentList al) { auto _al = static_cast(al); size_t result = 0; for (auto &ral : _al->data) { @@ -67,7 +67,7 @@ size_t get_adjacent_list_size(const AdjacentList al) { return result; } -Vertex get_neighbor_from_adjacent_list(const AdjacentList al, size_t idx) { +Vertex get_neighbor_from_adjacent_list(AdjacentList al, size_t idx) { auto _al = static_cast(al); size_t result = 0; for (auto &ral : _al->data) { @@ -82,7 +82,7 @@ Vertex get_neighbor_from_adjacent_list(const AdjacentList al, size_t idx) { return NULL_VERTEX; } -Edge get_edge_from_adjacent_list(const AdjacentList al, size_t idx) { +Edge get_edge_from_adjacent_list(AdjacentList al, size_t idx) { auto _al = static_cast(al); size_t result = 0; for (auto i = 0; i < _al->data.size(); ++i) { diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 2966da8b1..ef416c87d 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -16,17 +16,17 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/topology/structure.h" -bool is_directed(const Graph g) { +bool is_directed(Graph g) { auto _g = static_cast(g); return _g->directed(); } -bool is_multigraph(const Graph g) { +bool is_multigraph(Graph g) { auto _g = static_cast(g); return _g->is_multigraph(); } -size_t get_vertex_num(const Graph g) { +size_t get_vertex_num(Graph g) { auto _g = static_cast(g); size_t result = 0; for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { @@ -36,20 +36,25 @@ size_t get_vertex_num(const Graph g) { } #ifdef WITH_VERTEX_PROPERTY -size_t get_vertex_num_by_type(const Graph g, const VertexType vtype) { +size_t get_vertex_num_by_type(Graph g, VertexType vtype) { auto _g = static_cast(g); auto _vtype = static_cast(vtype); return _g->GetVerticesNum(*_vtype); } #endif -size_t get_edge_num(const Graph g) { +size_t get_edge_num(Graph g, Direction d) { auto _g = static_cast(g); + if (d == IN) { + return _g->GetInEdgeNum(); + } else if (d == OUT) { + return _g->GetOutEdgeNum(); + } return _g->GetEdgeNum(); } #ifdef WITH_EDGE_PROPERTY -size_t get_edge_num_by_type(const Graph g, const EdgeType etype) { +size_t get_edge_num_by_type(Graph g, Direction d, EdgeType etype) { auto _g = static_cast(g); auto _etype = static_cast(etype); return _g->edge_data_table(*_etype)->num_rows(); @@ -63,7 +68,7 @@ void destroy_vertex(Vertex v) { } #ifdef WITH_VERTEX_ORIGINAL_ID -Vertex get_vertex_from_original_id(const Graph g, const OriginalID oid) { +Vertex get_vertex_from_original_id(Graph g, OriginalID oid) { auto _g = static_cast(g); Vertex result; for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { @@ -75,7 +80,12 @@ Vertex get_vertex_from_original_id(const Graph g, const OriginalID oid) { return NULL_VERTEX; } -OriginalID get_vertex_original_id(const Graph g, const Vertex v) { +DataType get_vertex_original_id_type(Graph g) { + return DataTypeEnum::value; +} + + +OriginalID get_vertex_original_id(Graph g, Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); auto gid = _g->Vertex2Gid(*_v); @@ -90,7 +100,7 @@ void destroy_vertex_original_id(OriginalID oid) { #endif #if defined(WITH_VERTEX_ORIGINAL_ID) && defined(WITH_VERTEX_PROPERTY) -Vertex get_vertex_from_original_id_by_type(const Graph g, const VertexType vtype, const OriginalID oid) { +Vertex get_vertex_from_original_id_by_type(Graph g, VertexType vtype, OriginalID oid) { auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto _oid = static_cast(oid); @@ -111,12 +121,12 @@ void destroy_edge(Edge e) { delete _e; } -Vertex get_edge_src(const Graph g, const Edge e) { +Vertex get_edge_src(Graph g, Edge e) { auto _e = static_cast(e); return _e->src; } -Vertex get_edge_dst(const Graph g, const Edge e) { +Vertex get_edge_dst(Graph g, Edge e) { auto _e = static_cast(e); return _e->dst; } diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index d3c195875..90618970a 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -17,7 +17,7 @@ limitations under the License. #include "graph/grin/include/topology/vertexlist.h" #ifdef ENABLE_VERTEX_LIST -VertexList get_vertex_list(const Graph g) { +VertexList get_vertex_list(Graph g) { auto _g = static_cast(g); auto vl = new VertexList_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { @@ -27,7 +27,7 @@ VertexList get_vertex_list(const Graph g) { } #ifdef WITH_VERTEX_PROPERTY -VertexList get_vertex_list_by_type(const Graph g, const VertexType vtype) { +VertexList get_vertex_list_by_type(Graph g, VertexType vtype) { auto _g = static_cast(g); auto vl = new VertexList_T(); auto _vtype = static_cast(vtype); @@ -46,14 +46,14 @@ VertexList create_vertex_list() { return vl; } -bool insert_vertex_to_list(VertexList vl, const Vertex v) { +bool insert_vertex_to_list(VertexList vl, Vertex v) { auto _vl = static_cast(vl); auto _v = static_cast(v); _vl->push_back(Graph_T::vertex_range_t(_v->GetValue(), _v->GetValue())); return true; } -size_t get_vertex_list_size(const VertexList vl) { +size_t get_vertex_list_size(VertexList vl) { auto _vl = static_cast(vl); size_t result = 0; for (auto &vr : *_vl) { @@ -62,7 +62,7 @@ size_t get_vertex_list_size(const VertexList vl) { return result; } -Vertex get_vertex_from_list(const VertexList vl, const size_t idx) { +Vertex get_vertex_from_list(VertexList vl, size_t idx) { auto _vl = static_cast(vl); size_t result = 0; for (auto &vr : *_vl) { diff --git a/modules/graph/test/grin_arrow_fragment_test.cc b/modules/graph/test/grin_arrow_fragment_test.cc new file mode 100644 index 000000000..5123a028d --- /dev/null +++ b/modules/graph/test/grin_arrow_fragment_test.cc @@ -0,0 +1,175 @@ +/** Copyright 2020-2023 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include + +#include +#include + +#include "client/client.h" +#include "common/util/logging.h" + +#include "graph/fragment/arrow_fragment.grin.h" +#include "graph/fragment/graph_schema.h" +#include "graph/loader/arrow_fragment_loader.h" + +using namespace vineyard; // NOLINT(build/namespaces) + +using GraphType = ArrowFragment; +using LabelType = typename GraphType::label_id_t; + +void TraverseLocalGraph(vineyard::Client& client, const grape::CommSpec& comm_spec, + vineyard::ObjectID fragment_group_id) { + LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; + + auto pg = get_partitioned_graph_by_object_id(client, fragment_group_id); + + GRIN_ArrowFragment gaf; + gaf.init(pg, 0); + + auto g = gaf.get_graph(); + + auto elabels = get_edge_type_list(g); + auto e_label_num = get_edge_type_list_size(elabels); + auto vlabels = get_vertex_type_list(g); + auto v_label_num = get_vertex_type_list_size(vlabels); + + for (auto i = 0; i < e_label_num; ++i) { + auto elabel = get_edge_type_from_list(elabels, i); + auto props = get_edge_property_list_by_type(g, elabel); + auto prop = get_edge_property_from_list(props, 0); + auto prop_dt = get_edge_property_data_type(g, prop); + auto dt_name = GetDataTypeName(prop_dt); + for (auto j = 0; j < v_label_num; ++j) { + auto vlabel = get_vertex_type_from_list(vlabels, j); + auto iv = gaf.InnerVertices(vlabel); + for (auto v: iv) { + auto al = gaf.GetOutgoingAdjList(v, elabel); + for (auto it: al) { + auto neighbor = it.get_neighbor(); + auto edge = it.get_edge(); + if (dt_name == "double") { + auto value = it.get_data(prop); + } + } + } + } + } + +} + +int main(int argc, char** argv) { + if (argc < 6) { + printf( + "usage: ./arrow_fragment_test " + " [directed]\n"); + return 1; + } + int index = 1; + std::string ipc_socket = std::string(argv[index++]); + + int edge_label_num = atoi(argv[index++]); + std::vector efiles; + for (int i = 0; i < edge_label_num; ++i) { + efiles.push_back(argv[index++]); + } + + int vertex_label_num = atoi(argv[index++]); + std::vector vfiles; + for (int i = 0; i < vertex_label_num; ++i) { + vfiles.push_back(argv[index++]); + } + + int directed = 1; + if (argc > index) { + directed = atoi(argv[index]); + } + + vineyard::Client client; + VINEYARD_CHECK_OK(client.Connect(ipc_socket)); + + LOG(INFO) << "Connected to IPCServer: " << ipc_socket; + + grape::InitMPIComm(); + + { + grape::CommSpec comm_spec; + comm_spec.Init(MPI_COMM_WORLD); + + // Load from efiles and vfiles +#if 0 + vineyard::ObjectID fragment_id = InvalidObjectID(); + MPI_Barrier(MPI_COMM_WORLD); + double t = -GetCurrentTime(); + { +#if 0 + auto loader = + std::make_unique>( + client, comm_spec, efiles, vfiles, directed != 0); +#else + vfiles.clear(); + auto loader = + std::make_unique>( + client, comm_spec, efiles, directed != 0); +#endif + fragment_id = loader->LoadFragment().value(); + } + MPI_Barrier(MPI_COMM_WORLD); + t += GetCurrentTime(); + if (comm_spec.fid() == 0) { + LOG(INFO) << "loading time: " << t; + } + + { + std::shared_ptr graph = + std::dynamic_pointer_cast(client.GetObject(fragment_id)); + LOG(INFO) << "[frag-" << graph->fid() + << "]: " << ObjectIDToString(fragment_id); + traverse_graph(graph, + "./xx/output_graph_" + std::to_string(graph->fid())); + } + // client.DelData(fragment_id, true, true); +#else + { + auto loader = + std::make_unique>( + client, comm_spec, efiles, vfiles, directed != 0); + vineyard::ObjectID fragment_group_id = + loader->LoadFragmentAsFragmentGroup().value(); + TraverseLocalGraph(client, comm_spec, fragment_group_id); + } + + // Load from efiles + { + auto loader = + std::make_unique>( + client, comm_spec, efiles, directed != 0); + vineyard::ObjectID fragment_group_id = + loader->LoadFragmentAsFragmentGroup().value(); + TraverseLocalGraph(client, comm_spec, fragment_group_id); + } +#endif + } + grape::FinalizeMPIComm(); + + LOG(INFO) << "Passed arrow fragment test..."; + + return 0; +} From b6f3a1ded014ddcf474630df698f892f91c212d0 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Thu, 2 Mar 2023 15:22:02 +0800 Subject: [PATCH 12/85] a mixed example and updated docs --- modules/graph/fragment/arrow_fragment.grin.h | 12 +- modules/graph/grin/docs/README.md | 91 ++++++++ .../graph/grin/include/partition/partition.h | 4 +- .../graph/grin/include/property/property.h | 4 + modules/graph/grin/include/property/type.h | 4 + modules/graph/grin/src/partition/partition.cc | 8 +- modules/graph/grin/src/property/property.cc | 18 +- .../graph/grin/src/property/propertylist.cc | 4 +- modules/graph/grin/src/property/type.cc | 12 + .../graph/test/grin_arrow_fragment_test.cc | 45 ++-- modules/graph/test/grin_test.cc | 217 ++++++++++++++++++ 11 files changed, 386 insertions(+), 33 deletions(-) create mode 100644 modules/graph/test/grin_test.cc diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index 48679d984..ecef4fbb9 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -46,7 +46,6 @@ limitations under the License. #include "graph/vertex_map/arrow_local_vertex_map.h" #include "graph/vertex_map/arrow_vertex_map.h" -extern "C" { #include "graph/grin/include/topology/structure.h" #include "graph/grin/include/topology/vertexlist.h" #include "graph/grin/include/topology/adjacentlist.h" @@ -55,7 +54,6 @@ extern "C" { #include "graph/grin/include/property/property.h" #include "graph/grin/include/property/propertylist.h" #include "graph/grin/include/property/propertytable.h" -} #include "graph/grin/src/predefine.h" @@ -307,12 +305,10 @@ class GRIN_ArrowFragment { public: ~GRIN_ArrowFragment() = default; - void init(void* partitioned_graph, size_t idx) { + void init(void* partitioned_graph, void* partition) { pg_ = partitioned_graph; - auto pl = get_local_partition_list(pg_); - assert(idx < get_partition_list_size(pl)); - partition_ = get_partition_from_list(pl, idx); - g_ = get_local_graph_from_partition(pg_, partition_); + partition_ = partition; + g_ = get_local_graph_from_partition(pg_, partition_); } bool directed() const { @@ -417,7 +413,7 @@ class GRIN_ArrowFragment { } void* GetFragId(void* u) const { - auto vref = get_vertex_ref_for_vertex(g_, partition_, u); + auto vref = get_vertex_ref_for_vertex(g_, u); return get_master_partition_from_vertex_ref(g_, vref); } diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index 7ec898966..43b8f7157 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -3,6 +3,8 @@ GRIN is a series of C-style Graph Retrieval INterfaces for graph computing engines to access different storage systems in a uniform way. +----- + ## Assumptions ### Property Graph Model - Vertices have types, so as Edges. @@ -10,6 +12,8 @@ storage systems in a uniform way. - Properties are bound to vertex and edge types, but some may have the same name. - Labels can be assigned to vertices and edges (NOT their types) primarily for query filtering, and labels have no properties. +----- + ## Design Principles ### Handler - GRIN provides a series of handlers for graph concepts, such as vertex, edge and graph itself. @@ -153,9 +157,96 @@ aggregation purpose to share a common centural node for every one. may NOT contain all the data or properties locally. - GRIN currently provides vertex-level/edge-level local complete judgement APIs, while the introduction of type-level judgement APIs is open for discussion. +----- + ## Traits ### Natural ID Trait - Concepts represent the schema of the graph, such as vertex type and properties bound to a certain edge type, are usually numbered naturally from `0` to its `num - 1` in many storage engines. To facilitate further optimizations in the upper computing engines, GRIN provides the natural number ID trait. A storage can provide such a trait if it also uses the natural numbering for graph schema concepts. +----- + +## Examples +### Example A +A mixed example with structure, partition and property + +```CPP + void sync_property(void* partitioned_graph, void* partition, const char* edge_type_name, const char* vertex_property_name) { + /* + This example illustrates how to sync property values of vertices related to certain edge type. + + The input parameters are the partitioned_graph, the local partition, + the edge_type_name (e.g., likes), the vertex_property_name (e.g., features) + + The task is to find all the destination vertices of "boundary edges" with type named "likes", and the vertices + must have a property named "features". Here a boundary edge is an edge whose source vertex is a master vertex and + the destination is a mirror vertex, given the context of "edge-cut" partition strategy that the underlying storage uses. + Then for each of these vertices, we send the value of the "features" property to its master partition. + */ + auto g = get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition + + auto etype = get_edge_type_by_name(g, edge_type_name); // get edge type from name + auto src_vtypes = get_src_types_from_edge_type(g, etype); // get related source vertex type list + auto dst_vtypes = get_dst_types_from_edge_type(g, etype); // get related destination vertex type list + + auto src_vtypes_num = get_vertex_type_list_size(src_vtypes); + auto dst_vtypes_num = get_vertex_type_list_size(dst_vtypes); + assert(src_vtypes_num == dst_vtypes_num); // the src & dst vertex type lists must be aligned + + for (auto i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type + auto src_vtype = get_vertex_type_from_list(src_vtypes, i); // get src type + auto dst_vtype = get_vertex_type_from_list(dst_vtypes, i); // get dst type + + auto dst_vp = get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type + if (dst_vp == NULL_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" + + auto dst_vpt = get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use + auto dst_vp_dt = get_vertex_property_data_type(g, dst_vp); // prepare property type for later use + + auto src_vl = get_master_vertices_by_type(g, src_vtype); // we only need master vertices under source type + + auto src_vl_num = get_vertex_list_size(src_vl); + for (auto j = 0; j < src_vl_num; ++j) { // iterate the src vertex + auto v = get_vertex_from_list(src_vl, j); + auto adj_list = get_adjacent_list_by_edge_type(g, Direction::OUT, v, etype); // get the adjacent list of v with edges under etype + bool check_flag = false; + if (adj_list == NULL_LIST) { // NULL_LIST means the storage does NOT support getting adj_list by edge type, note that list with size 0 is NOT a NULL_LIST + adj_list = get_adjacent_list(g, Direction::OUT, v); + check_flag = true; // Then we should scan the full adj list and filter edge type by ourselves. + } + + auto al_sz = get_adjacent_list_size(adj_list); + for (auto k = 0; k < al_sz; ++k) { + if (check_flag) { + auto edge = get_edge_from_adjacent_list(adj_list, k); + auto edge_type = get_edge_type(g, edge); + if (!equal_edge_type(edge_type, etype)) continue; + } + auto u = get_neighbor_from_adjacent_list(adj_list, k); // get the dst vertex u + auto value = get_value_from_vertex_property_table(dst_vpt, u, dst_vp); // get the property value of "features" of u + + auto uref = get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions + auto u_master_partition = get_master_partition_from_vertex_ref(g, uref); // get the master partition for u + + send_value(u_master_partition, uref, dst_vp_dt, value); // the value must be casted to the correct type based on dst_vp_dt before sending + } + } + } + } + + void run(vineyard::Client& client, const grape::CommSpec& comm_spec, + vineyard::ObjectID fragment_group_id) { + LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; + + auto pg = get_partitioned_graph_by_object_id(client, fragment_group_id); + auto local_partitions = get_local_partition_list(pg); + size_t pnum = get_partition_list_size(local_partitions); + assert(pnum > 0); + + // we only sync the first partition as example + auto partition = get_partition_from_list(local_partitions, 0); + sync_property(pg, partition, "likes", "features"); + } +``` + diff --git a/modules/graph/grin/include/partition/partition.h b/modules/graph/grin/include/partition/partition.h index ef8594a9d..b33c07283 100644 --- a/modules/graph/grin/include/partition/partition.h +++ b/modules/graph/grin/include/partition/partition.h @@ -38,6 +38,8 @@ size_t get_partition_list_size(PartitionList); Partition get_partition_from_list(PartitionList, size_t); +bool equal_partition(Partition, Partition); + void destroy_partition(Partition); void* get_partition_info(PartitionedGraph, Partition); @@ -103,7 +105,7 @@ AdjacentList get_adjacent_mirror_list_by_partition(Graph, Direction, // while edge ref is likewise. Both can be serialized to const char* for // message transporting and deserialized on the other end. #ifdef ENABLE_VERTEX_REF -VertexRef get_vertex_ref_for_vertex(Graph, Partition, Vertex); +VertexRef get_vertex_ref_for_vertex(Graph, Vertex); /** * @brief get the local vertex from the vertex ref diff --git a/modules/graph/grin/include/property/property.h b/modules/graph/grin/include/property/property.h index cfd901bf1..b98a96e43 100644 --- a/modules/graph/grin/include/property/property.h +++ b/modules/graph/grin/include/property/property.h @@ -70,6 +70,8 @@ EdgePropertyList get_edge_properties_by_name(Graph, const char* name); #ifdef WITH_VERTEX_PROPERTY +bool equal_vertex_property(VertexProperty, VertexProperty); + /** * @brief destroy vertex property * @param VertexProperty vertex property @@ -91,6 +93,8 @@ VertexType get_vertex_property_vertex_type(VertexProperty); #ifdef WITH_EDGE_PROPERTY +bool equal_edge_property(EdgeProperty, EdgeProperty); + /** * @brief destroy edge property * @param EdgeProperty edge property diff --git a/modules/graph/grin/include/property/type.h b/modules/graph/grin/include/property/type.h index 8cd2ae346..597d93867 100644 --- a/modules/graph/grin/include/property/type.h +++ b/modules/graph/grin/include/property/type.h @@ -22,6 +22,8 @@ limitations under the License. #ifdef WITH_VERTEX_PROPERTY // Vertex type +bool equal_vertex_type(VertexType, VertexType); + VertexType get_vertex_type(Graph, Vertex); const char* get_vertex_type_name(Graph, VertexType); @@ -52,6 +54,8 @@ VertexType get_vertex_type_from_id(VertexTypeID); #ifdef WITH_EDGE_PROPERTY // Edge type +bool equal_edge_type(EdgeType, EdgeType); + EdgeType get_edge_type(Graph, Edge); const char* get_edge_type_name(Graph, EdgeType); diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index 51d3b2ae4..68de5c53e 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -66,6 +66,12 @@ Partition get_partition_from_list(PartitionList pl, size_t idx) { return p; } +bool equal_partition(Partition p1, Partition p2) { + auto _p1 = static_cast(p1); + auto _p2 = static_cast(p2); + return (*_p1 == *_p2); +} + void destroy_partition(Partition p) { auto _p = static_cast(p); delete _p; @@ -161,7 +167,7 @@ AdjacentList get_adjacent_mirror_list_by_partition(Graph g, Direction d, #ifdef ENABLE_VERTEX_REF -VertexRef get_vertex_ref_for_vertex(Graph g, Partition p, Vertex v) { +VertexRef get_vertex_ref_for_vertex(Graph g, Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); auto gid = _g->Vertex2Gid(*_v); diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 8d494ea0a..47f58f516 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -12,7 +12,7 @@ limitations under the License. #include "graph/grin/src/predefine.h" -#ifdef WITH_PROPERTY_NAME +#if defined(WITH_PROPERTY_NAME) && defined(WITH_VERTEX_PROPERTY) const char* get_vertex_property_name(Graph g, VertexProperty vp) { auto _g = static_cast(g); auto _vp = static_cast(vp); @@ -41,7 +41,9 @@ VertexPropertyList get_vertex_properties_by_name(Graph g, const char* name) { } return vpl; } +#endif +#if defined(WITH_PROPERTY_NAME) && defined(WITH_EDGE_PROPERTY) const char* get_edge_property_name(Graph g, EdgeProperty ep) { auto _g = static_cast(g); auto _ep = static_cast(ep); @@ -74,6 +76,12 @@ EdgePropertyList get_edge_properties_by_name(Graph g, const char* name) { #ifdef WITH_VERTEX_PROPERTY +bool equal_vertex_property(VertexProperty vp1, VertexProperty vp2) { + auto _vp1 = static_cast(vp1); + auto _vp2 = static_cast(vp2); + return (*_vp1 == *_vp2); +} + void destroy_vertex_property(VertexProperty vp) { auto _vp = static_cast(vp); delete _vp; @@ -95,12 +103,18 @@ VertexType get_vertex_property_vertex_type(VertexProperty vp) { #ifdef WITH_EDGE_PROPERTY +bool equal_edge_property(EdgeProperty ep1, EdgeProperty ep2) { + auto _ep1 = static_cast(ep1); + auto _ep2 = static_cast(ep2); + return (*_ep1 == *_ep2); +} + void destroy_edge_property(EdgeProperty ep) { auto _ep = static_cast(ep); delete _ep; } -DataType get_edge_property_type(Graph g, EdgeProperty ep) { +DataType get_edge_property_data_type(Graph g, EdgeProperty ep) { auto _g = static_cast(g); auto _ep = static_cast(ep); auto dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index 89ea7e4ab..9d3776c76 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -14,7 +14,7 @@ limitations under the License. #include "graph/grin/include/property/propertylist.h" #ifdef WITH_VERTEX_PROPERTY -VertexPropertyList get_all_vertex_properties_by_type(Graph g, VertexType vtype) { +VertexPropertyList get_vertex_property_list_by_type(Graph g, VertexType vtype) { auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto vpl = new VertexPropertyList_T(); @@ -71,7 +71,7 @@ VertexPropertyID get_vertex_property_id(VertexType vtype, VertexProperty vp) { #ifdef WITH_EDGE_PROPERTY -EdgePropertyList get_all_edge_properties_by_type(Graph g, EdgeType etype) { +EdgePropertyList get_edge_property_list_by_type(Graph g, EdgeType etype) { auto _g = static_cast(g); auto _etype = static_cast(etype); auto epl = new EdgePropertyList_T(); diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index d3178c063..00090fd21 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -14,6 +14,12 @@ limitations under the License. #include "graph/grin/include/property/type.h" #ifdef WITH_VERTEX_PROPERTY +bool equal_vertex_type(VertexType vt1, VertexType vt2) { + auto _vt1 = static_cast(vt1); + auto _vt2 = static_cast(vt2); + return (*_vt1 == *_vt2); +} + VertexType get_vertex_type(Graph g, Vertex v) { auto _g = static_cast(g); auto _v = static_cast(v); @@ -91,6 +97,12 @@ VertexType get_vertex_type_from_id(VertexTypeID vti) { #ifdef WITH_EDGE_PROPERTY +bool equal_edge_type(EdgeType et1, EdgeType et2) { + auto _et1 = static_cast(et1); + auto _et2 = static_cast(et2); + return (*_et1 == *_et2); +} + EdgeType get_edge_type(Graph g, Edge e) { auto _e = static_cast(e); auto et = new EdgeType_T(_e->etype); diff --git a/modules/graph/test/grin_arrow_fragment_test.cc b/modules/graph/test/grin_arrow_fragment_test.cc index 5123a028d..349441c50 100644 --- a/modules/graph/test/grin_arrow_fragment_test.cc +++ b/modules/graph/test/grin_arrow_fragment_test.cc @@ -25,21 +25,14 @@ limitations under the License. #include "graph/fragment/graph_schema.h" #include "graph/loader/arrow_fragment_loader.h" -using namespace vineyard; // NOLINT(build/namespaces) - -using GraphType = ArrowFragment; +using GraphType = vineyard::ArrowFragment; using LabelType = typename GraphType::label_id_t; -void TraverseLocalGraph(vineyard::Client& client, const grape::CommSpec& comm_spec, - vineyard::ObjectID fragment_group_id) { - LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; - - auto pg = get_partitioned_graph_by_object_id(client, fragment_group_id); - - GRIN_ArrowFragment gaf; - gaf.init(pg, 0); +void TraverseLocalGraph(void* partitioned_graph, void* partition) { + vineyard::GRIN_ArrowFragment gaf; + gaf.init(partitioned_graph, partition); auto g = gaf.get_graph(); auto elabels = get_edge_type_list(g); @@ -68,13 +61,27 @@ void TraverseLocalGraph(vineyard::Client& client, const grape::CommSpec& comm_sp } } } +} + +void traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, + vineyard::ObjectID fragment_group_id) { + LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; + + auto pg = get_partitioned_graph_by_object_id(client, fragment_group_id); + auto local_partitions = get_local_partition_list(pg); + size_t pnum = get_partition_list_size(local_partitions); + assert(pnum > 0); + + // we only traverse the first partition for test + auto partition = get_partition_from_list(local_partitions, 0); + TraverseLocalGraph(pg, partition); } int main(int argc, char** argv) { if (argc < 6) { printf( - "usage: ./arrow_fragment_test " + "usage: ./grin_arrow_fragment_test " " [directed]\n"); return 1; } @@ -147,23 +154,23 @@ int main(int argc, char** argv) { #else { auto loader = - std::make_unique>( + std::make_unique>( client, comm_spec, efiles, vfiles, directed != 0); vineyard::ObjectID fragment_group_id = loader->LoadFragmentAsFragmentGroup().value(); - TraverseLocalGraph(client, comm_spec, fragment_group_id); + traverse(client, comm_spec, fragment_group_id); } // Load from efiles { auto loader = - std::make_unique>( + std::make_unique>( client, comm_spec, efiles, directed != 0); vineyard::ObjectID fragment_group_id = loader->LoadFragmentAsFragmentGroup().value(); - TraverseLocalGraph(client, comm_spec, fragment_group_id); + traverse(client, comm_spec, fragment_group_id); } #endif } diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc new file mode 100644 index 000000000..19e8bd81e --- /dev/null +++ b/modules/graph/test/grin_test.cc @@ -0,0 +1,217 @@ +/** Copyright 2020-2023 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include + +#include +#include + +#include "client/client.h" +#include "common/util/logging.h" + +#include "graph/fragment/arrow_fragment.grin.h" +#include "graph/fragment/graph_schema.h" +#include "graph/loader/arrow_fragment_loader.h" + +using namespace vineyard; // NOLINT(build/namespaces) + +using GraphType = ArrowFragment; +using LabelType = typename GraphType::label_id_t; + + + +void sync_property(void* partitioned_graph, void* partition, + const char* edge_type_name, const char* vertex_property_name) { + /* + This example illustrates how to sync property values of vertices related to certain edge type. + + The input parameters are the partitioned_graph, the local partition, + the edge_type_name (e.g., likes), the vertex_property_name (e.g., features) + + The task is to find all the destination vertices of "boundary edges" with type named "likes", and the vertices + must have a property named "features". Here a boundary edge is an edge whose source vertex is a master vertex and + the destination is a mirror vertex, given the context of "edge-cut" partition strategy that the underlying storage uses. + Then for each of these vertices, we send the value of the "features" property to its master partition. + */ + auto g = get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition + + auto etype = get_edge_type_by_name(g, edge_type_name); // get edge type from name + auto src_vtypes = get_src_types_from_edge_type(g, etype); // get related source vertex type list + auto dst_vtypes = get_dst_types_from_edge_type(g, etype); // get related destination vertex type list + + auto src_vtypes_num = get_vertex_type_list_size(src_vtypes); + auto dst_vtypes_num = get_vertex_type_list_size(dst_vtypes); + assert(src_vtypes_num == dst_vtypes_num); // the src & dst vertex type lists must be aligned + + for (auto i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type + auto src_vtype = get_vertex_type_from_list(src_vtypes, i); // get src type + auto dst_vtype = get_vertex_type_from_list(dst_vtypes, i); // get dst type + + auto dst_vp = get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type + if (dst_vp == NULL_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" + + auto dst_vpt = get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use + auto dst_vp_dt = get_vertex_property_data_type(g, dst_vp); // prepare property type for later use + + auto src_vl = get_master_vertices_by_type(g, src_vtype); // we only need master vertices under source type + + auto src_vl_num = get_vertex_list_size(src_vl); + for (auto j = 0; j < src_vl_num; ++j) { // iterate the src vertex + auto v = get_vertex_from_list(src_vl, j); + auto adj_list = get_adjacent_list_by_edge_type(g, Direction::OUT, v, etype); // get the adjacent list of v with edges under etype + bool check_flag = false; + if (adj_list == NULL_LIST) { // NULL_LIST means the storage does NOT support getting adj_list by edge type, note that list with size 0 is NOT a NULL_LIST + // Then we should scan the full adj list and filter edge type by ourselves. + adj_list = get_adjacent_list(g, Direction::OUT, v); + bool check_flag = true; + } + + auto al_sz = get_adjacent_list_size(adj_list); + for (auto k = 0; k < al_sz; ++k) { + if (check_flag) { + auto edge = get_edge_from_adjacent_list(adj_list, k); + auto edge_type = get_edge_type(g, edge); + if (!equal_edge_type(edge_type, etype)) continue; + } + auto u = get_neighbor_from_adjacent_list(adj_list, k); // get the dst vertex u + auto value = get_value_from_vertex_property_table(dst_vpt, u, dst_vp); // get the property value of "features" of u + + auto uref = get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions + auto u_master_partition = get_master_partition_from_vertex_ref(g, uref); // get the master partition for u + + // send_value(u_master_partition, uref, dst_vp_dt, value); // the value must be casted to the correct type based on dst_vp_dt before sending + } + } + } +} + + +void traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, + vineyard::ObjectID fragment_group_id) { + LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; + + auto pg = get_partitioned_graph_by_object_id(client, fragment_group_id); + auto local_partitions = get_local_partition_list(pg); + size_t pnum = get_partition_list_size(local_partitions); + assert(pnum > 0); + + // we only traverse the first partition for test + auto partition = get_partition_from_list(local_partitions, 0); + sync_property(pg, partition, "likes", "features"); +} + +int main(int argc, char** argv) { + if (argc < 6) { + printf( + "usage: ./grin_test " + " [directed]\n"); + return 1; + } + int index = 1; + std::string ipc_socket = std::string(argv[index++]); + + int edge_label_num = atoi(argv[index++]); + std::vector efiles; + for (int i = 0; i < edge_label_num; ++i) { + efiles.push_back(argv[index++]); + } + + int vertex_label_num = atoi(argv[index++]); + std::vector vfiles; + for (int i = 0; i < vertex_label_num; ++i) { + vfiles.push_back(argv[index++]); + } + + int directed = 1; + if (argc > index) { + directed = atoi(argv[index]); + } + + vineyard::Client client; + VINEYARD_CHECK_OK(client.Connect(ipc_socket)); + + LOG(INFO) << "Connected to IPCServer: " << ipc_socket; + + grape::InitMPIComm(); + + { + grape::CommSpec comm_spec; + comm_spec.Init(MPI_COMM_WORLD); + + // Load from efiles and vfiles +#if 0 + vineyard::ObjectID fragment_id = InvalidObjectID(); + MPI_Barrier(MPI_COMM_WORLD); + double t = -GetCurrentTime(); + { +#if 0 + auto loader = + std::make_unique>( + client, comm_spec, efiles, vfiles, directed != 0); +#else + vfiles.clear(); + auto loader = + std::make_unique>( + client, comm_spec, efiles, directed != 0); +#endif + fragment_id = loader->LoadFragment().value(); + } + MPI_Barrier(MPI_COMM_WORLD); + t += GetCurrentTime(); + if (comm_spec.fid() == 0) { + LOG(INFO) << "loading time: " << t; + } + + { + std::shared_ptr graph = + std::dynamic_pointer_cast(client.GetObject(fragment_id)); + LOG(INFO) << "[frag-" << graph->fid() + << "]: " << ObjectIDToString(fragment_id); + traverse_graph(graph, + "./xx/output_graph_" + std::to_string(graph->fid())); + } + // client.DelData(fragment_id, true, true); +#else + { + auto loader = + std::make_unique>( + client, comm_spec, efiles, vfiles, directed != 0); + vineyard::ObjectID fragment_group_id = + loader->LoadFragmentAsFragmentGroup().value(); + traverse(client, comm_spec, fragment_group_id); + } + + // Load from efiles + { + auto loader = + std::make_unique>( + client, comm_spec, efiles, directed != 0); + vineyard::ObjectID fragment_group_id = + loader->LoadFragmentAsFragmentGroup().value(); + traverse(client, comm_spec, fragment_group_id); + } +#endif + } + grape::FinalizeMPIComm(); + + LOG(INFO) << "Passed arrow fragment test..."; + + return 0; +} From ee9f86cb34d76b6066efd5b853dbfc5510bd4b2a Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 3 Mar 2023 17:56:24 +0800 Subject: [PATCH 13/85] refactor macro/type/func names --- modules/graph/fragment/arrow_fragment.grin.h | 311 +++++++++--------- modules/graph/grin/docs/Doxyfile | 2 +- modules/graph/grin/include/index/label.h | 66 ++-- .../graph/grin/include/partition/partition.h | 142 ++++---- modules/graph/grin/include/predefine.h | 284 ++++++++-------- .../graph/grin/include/property/primarykey.h | 40 +-- .../graph/grin/include/property/property.h | 68 ++-- .../grin/include/property/propertylist.h | 52 +-- .../grin/include/property/propertytable.h | 88 ++--- modules/graph/grin/include/property/type.h | 68 ++-- .../grin/include/topology/adjacentlist.h | 28 +- .../graph/grin/include/topology/edgelist.h | 32 +- .../graph/grin/include/topology/structure.h | 56 ++-- .../graph/grin/include/topology/vertexlist.h | 32 +- modules/graph/grin/src/partition/partition.cc | 208 ++++++------ modules/graph/grin/src/predefine.cc | 48 +-- modules/graph/grin/src/predefine.h | 130 ++++---- modules/graph/grin/src/property/property.cc | 96 +++--- .../graph/grin/src/property/propertylist.cc | 120 +++---- .../graph/grin/src/property/propertytable.cc | 90 ++--- modules/graph/grin/src/property/type.cc | 170 +++++----- .../graph/grin/src/topology/adjacentlist.cc | 56 ++-- modules/graph/grin/src/topology/structure.cc | 96 +++--- modules/graph/grin/src/topology/vertexlist.cc | 46 +-- .../graph/test/grin_arrow_fragment_test.cc | 26 +- modules/graph/test/grin_test.cc | 70 ++-- 26 files changed, 1218 insertions(+), 1207 deletions(-) diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index ecef4fbb9..94ccb5201 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -59,27 +59,27 @@ limitations under the License. namespace vineyard { -std::shared_ptr GetArrowDataType(DataType type) { +std::shared_ptr GetArrowDataType(GRIN_DATATYPE type) { switch (type) { - case DataType::Undefined: + case GRIN_DATATYPE::Undefined: return arrow::null(); - case DataType::Int32: + case GRIN_DATATYPE::Int32: return arrow::int32(); - case DataType::UInt32: + case GRIN_DATATYPE::UInt32: return arrow::uint32(); - case DataType::Int64: + case GRIN_DATATYPE::Int64: return arrow::int64(); - case DataType::UInt64: + case GRIN_DATATYPE::UInt64: return arrow::uint64(); - case DataType::Float: + case GRIN_DATATYPE::Float: return arrow::float32(); - case DataType::Double: + case GRIN_DATATYPE::Double: return arrow::float64(); - case DataType::String: + case GRIN_DATATYPE::String: return arrow::large_utf8(); - case DataType::Date32: + case GRIN_DATATYPE::Date32: return arrow::int32(); - case DataType::Date64: + case GRIN_DATATYPE::Date64: return arrow::int64(); default: return arrow::null(); @@ -89,12 +89,13 @@ std::shared_ptr GetArrowDataType(DataType type) { struct GRIN_Nbr { public: - GRIN_Nbr() : al_(nullptr), cur_(0), ept_(nullptr) {} - GRIN_Nbr(void* al, size_t cur, void* ept) - : al_(al), cur_(cur), ept_(ept) {} - GRIN_Nbr(GRIN_Nbr& rhs) : al_(rhs.al_), cur_(rhs.cur_), ept_(rhs.ept_) {} + GRIN_Nbr() : g_{nullptr}, al_(nullptr), cur_(0), ept_(nullptr) {} + GRIN_Nbr(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t cur, GRIN_EDGE_PROPERTY_TABLE ept) + : g_{g}, al_(al), cur_(cur), ept_(ept) {} + GRIN_Nbr(GRIN_Nbr& rhs) : g_{rhs.g_}, al_(rhs.al_), cur_(rhs.cur_), ept_(rhs.ept_) {} GRIN_Nbr& operator=(const GRIN_Nbr& rhs) { + g_ = rhs.g_; al_ = rhs.al_; cur_ = rhs.cur_; ept_ = rhs.ept_; @@ -102,46 +103,47 @@ struct GRIN_Nbr { } GRIN_Nbr& operator=(GRIN_Nbr&& rhs) { + g_ = rhs.g_; al_ = rhs.al_; cur_ = rhs.cur_; ept_ = rhs.ept_; return *this; } - void* neighbor() { - return get_neighbor_from_adjacent_list(al_, cur_); + GRIN_VERTEX neighbor() { + return grin_get_neighbor_from_adjacent_list(g_, al_, cur_); } - void* get_neighbor() { - return get_neighbor_from_adjacent_list(al_, cur_); + GRIN_VERTEX get_neighbor() { + return grin_get_neighbor_from_adjacent_list(g_, al_, cur_); } - void* get_edge() { - return get_edge_from_adjacent_list(al_, cur_); + GRIN_EDGE get_edge() { + return grin_get_edge_from_adjacent_list(g_, al_, cur_); } template - T get_data(void* prop) const { - auto _e = get_edge_from_adjacent_list(al_, cur_); - auto value = get_value_from_edge_property_table(ept_, _e, prop); + T get_data(GRIN_EDGE_PROPERTY prop) const { + auto _e = grin_get_edge_from_adjacent_list(g_, al_, cur_); + auto value = grin_get_value_from_edge_property_table(ept_, _e, prop); return property_graph_utils::ValueGetter::Value(value, 0); } - std::string get_str(void* prop) const { - auto _e = get_edge_from_adjacent_list(al_, cur_); - auto value = get_value_from_edge_property_table(ept_, _e, prop); + std::string get_str(GRIN_EDGE_PROPERTY prop) const { + auto _e = grin_get_edge_from_adjacent_list(g_, al_, cur_); + auto value = grin_get_value_from_edge_property_table(ept_, _e, prop); return property_graph_utils::ValueGetter::Value(value, 0); } - double get_double(void* prop) const { - auto _e = get_edge_from_adjacent_list(al_, cur_); - auto value = get_value_from_edge_property_table(ept_, _e, prop); + double get_double(GRIN_EDGE_PROPERTY prop) const { + auto _e = grin_get_edge_from_adjacent_list(g_, al_, cur_); + auto value = grin_get_value_from_edge_property_table(ept_, _e, prop); return property_graph_utils::ValueGetter::Value(value, 0); } - int64_t get_int(void* prop) const { - auto _e = get_edge_from_adjacent_list(al_, cur_); - auto value = get_value_from_edge_property_table(ept_, _e, prop); + int64_t get_int(GRIN_EDGE_PROPERTY prop) const { + auto _e = grin_get_edge_from_adjacent_list(g_, al_, cur_); + auto value = grin_get_value_from_edge_property_table(ept_, _e, prop); return property_graph_utils::ValueGetter::Value(value, 0); } @@ -179,24 +181,25 @@ struct GRIN_Nbr { inline GRIN_Nbr& operator*() { return *this; } private: - void* al_; + GRIN_GRAPH g_; + GRIN_ADJACENT_LIST al_; size_t cur_; - void* ept_; + GRIN_EDGE_PROPERTY_TABLE ept_; }; class GRIN_AdjList { public: - GRIN_AdjList() : adj_list_(nullptr), ept_(nullptr), begin_(0), end_(0) {} - GRIN_AdjList(void* adj_list, void* ept, size_t begin, size_t end) - : adj_list_(adj_list), ept_(ept), begin_(begin), end_(end) {} + GRIN_AdjList(): g_(nullptr), adj_list_(nullptr), ept_(nullptr), begin_(0), end_(0) {} + GRIN_AdjList(GRIN_GRAPH g, GRIN_ADJACENT_LIST adj_list, GRIN_EDGE_PROPERTY_TABLE ept, size_t begin, size_t end) + : g_{g}, adj_list_(adj_list), ept_(ept), begin_(begin), end_(end) {} inline GRIN_Nbr begin() const { - return GRIN_Nbr(adj_list_, begin_, ept_); + return GRIN_Nbr(g_, adj_list_, begin_, ept_); } inline GRIN_Nbr end() const { - return GRIN_Nbr(adj_list_, end_, ept_); + return GRIN_Nbr(g_, adj_list_, end_, ept_); } inline size_t Size() const { return end_ - begin_; } @@ -208,8 +211,9 @@ class GRIN_AdjList { size_t size() const { return end_ - begin_; } private: - void* adj_list_; - void* ept_; + GRIN_GRAPH g_; + GRIN_ADJACENT_LIST adj_list_; + GRIN_EDGE_PROPERTY_TABLE ept_; size_t begin_; size_t end_; }; @@ -218,22 +222,23 @@ class GRIN_AdjList { class GRIN_VertexRange { public: GRIN_VertexRange() {} - GRIN_VertexRange(void* vl, const size_t begin, const size_t end) - : vl_(vl), begin_(begin), end_(end) {} - GRIN_VertexRange(const GRIN_VertexRange& r) : vl_(r.vl_), begin_(r.begin_), end_(r.end_) {} + GRIN_VertexRange(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, const size_t begin, const size_t end) + : g_(g), vl_(vl), begin_(begin), end_(end) {} + GRIN_VertexRange(const GRIN_VertexRange& r) : g_(r.g_), vl_(r.vl_), begin_(r.begin_), end_(r.end_) {} class iterator { - using reference_type = void*; + using reference_type = GRIN_VERTEX; private: - void* vl_; + GRIN_GRAPH g_; + GRIN_VERTEX_LIST vl_; size_t cur_; public: - iterator() noexcept : vl_(nullptr), cur_() {} - explicit iterator(void* vl, size_t idx) noexcept : vl_(vl), cur_(idx) {} + iterator() noexcept : g_(nullptr), vl_(nullptr), cur_() {} + explicit iterator(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t idx) noexcept : g_(g), vl_(vl), cur_(idx) {} - reference_type operator*() noexcept { return get_vertex_from_list(vl_, cur_); } + reference_type operator*() noexcept { return grin_get_vertex_from_list(g_, vl_, cur_); } iterator& operator++() noexcept { ++cur_; @@ -241,7 +246,7 @@ class GRIN_VertexRange { } iterator operator++(int) noexcept { - return iterator(vl_, cur_ + 1); + return iterator(g_, vl_, cur_ + 1); } iterator& operator--() noexcept { @@ -250,11 +255,11 @@ class GRIN_VertexRange { } iterator operator--(int) noexcept { - return iterator(vl_, cur_--); + return iterator(g_, vl_, cur_--); } iterator operator+(size_t offset) const noexcept { - return iterator(vl_, cur_ + offset); + return iterator(g_, vl_, cur_ + offset); } bool operator==(const iterator& rhs) const noexcept { @@ -270,9 +275,9 @@ class GRIN_VertexRange { } }; - iterator begin() const { return iterator(vl_, begin_); } + iterator begin() const { return iterator(g_, vl_, begin_); } - iterator end() const { return iterator(vl_, end_); } + iterator end() const { return iterator(g_, vl_, end_); } size_t size() const { return end_ - begin_; } @@ -291,7 +296,8 @@ class GRIN_VertexRange { const size_t end_value() const { return end_; } private: - void* vl_; + GRIN_GRAPH g_; + GRIN_VERTEX_LIST vl_; size_t begin_; size_t end_; }; @@ -305,140 +311,143 @@ class GRIN_ArrowFragment { public: ~GRIN_ArrowFragment() = default; - void init(void* partitioned_graph, void* partition) { + void init(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION partition) { pg_ = partitioned_graph; partition_ = partition; - g_ = get_local_graph_from_partition(pg_, partition_); + g_ = grin_get_local_graph_from_partition(pg_, partition_); } bool directed() const { - return is_directed(g_); + return grin_is_directed(g_); } bool multigraph() const { - return is_multigraph(g_); + return grin_is_multigraph(g_); } const std::string oid_typename() const { - auto dt = get_vertex_original_id_type(g_); + auto dt = grin_get_vertex_original_id_type(g_); return GetDataTypeName(dt); } - size_t fnum() const { return get_total_partitions_number(pg_); } + size_t fnum() const { return grin_get_total_partitions_number(pg_); } - void* vertex_label(void* v) { - return get_vertex_type(g_, v); + GRIN_VERTEX_TYPE vertex_label(GRIN_VERTEX v) { + return grin_get_vertex_type(g_, v); } size_t vertex_label_num() const { - auto vtl = get_vertex_type_list(g_); - return get_vertex_type_list_size(vtl); + auto vtl = grin_get_vertex_type_list(g_); + return grin_get_vertex_type_list_size(vtl); } size_t edge_label_num() const { - auto etl = get_edge_type_list(g_); - return get_edge_type_list_size(etl); + auto etl = grin_get_edge_type_list(g_); + return grin_get_edge_type_list_size(etl); } - size_t vertex_property_num(void* label) const { - auto vpl = get_vertex_property_list_by_type(g_, label); - return get_vertex_property_list_size(vpl); + size_t vertex_property_num(GRIN_VERTEX_TYPE label) const { + auto vpl = grin_get_vertex_property_list_by_type(g_, label); + return grin_get_vertex_property_list_size(vpl); } - std::shared_ptr vertex_property_type(void* prop) const { - auto dt = get_vertex_property_data_type(g_, prop); + std::shared_ptr vertex_property_type(GRIN_VERTEX_PROPERTY prop) const { + auto dt = grin_get_vertex_property_data_type(g_, prop); return GetArrowDataType(dt); } - size_t edge_property_num(void* label) const { - void* epl = get_edge_property_list_by_type(g_, label); - return get_edge_property_list_size(epl); + size_t edge_property_num(GRIN_EDGE_TYPE label) const { + auto epl = grin_get_edge_property_list_by_type(g_, label); + return grin_get_edge_property_list_size(epl); } - std::shared_ptr edge_property_type(void* prop) const { - auto dt = get_edge_property_data_type(g_, prop); + std::shared_ptr edge_property_type(GRIN_EDGE_PROPERTY prop) const { + auto dt = grin_get_edge_property_data_type(g_, prop); return GetArrowDataType(dt); } - vertex_range_t Vertices(void* label) const { - auto vl = get_vertex_list_by_type(g_, label); - auto sz = get_vertex_list_size(vl); - return vertex_range_t(vl, 0, sz); + vertex_range_t Vertices(GRIN_VERTEX_TYPE label) const { + auto vl = grin_get_vertex_list_by_type(g_, label); + auto sz = grin_get_vertex_list_size(g_, vl); + return vertex_range_t(g_, vl, 0, sz); } - vertex_range_t InnerVertices(void* label) const { - auto vl = get_master_vertices_by_type(g_, label); - auto sz = get_vertex_list_size(vl); - return vertex_range_t(vl, 0, sz); + vertex_range_t InnerVertices(GRIN_VERTEX_TYPE label) const { + auto vl = grin_get_master_vertices_by_type(g_, label); + auto sz = grin_get_vertex_list_size(g_, vl); + return vertex_range_t(g_, vl, 0, sz); } - vertex_range_t OuterVertices(void* label) const { - auto vl = get_mirror_vertices_by_type(g_, label); - auto sz = get_vertex_list_size(vl); - return vertex_range_t(vl, 0, sz); + vertex_range_t OuterVertices(GRIN_VERTEX_TYPE label) const { + auto vl = grin_get_mirror_vertices_by_type(g_, label); + auto sz = grin_get_vertex_list_size(g_, vl); + return vertex_range_t(g_, vl, 0, sz); } - vertex_range_t InnerVerticesSlice(void* label, size_t start, size_t end) + vertex_range_t InnerVerticesSlice(GRIN_VERTEX_TYPE label, size_t start, size_t end) const { - auto vl = get_master_vertices_by_type(g_, label); - auto _end = get_vertex_list_size(vl); + auto vl = grin_get_master_vertices_by_type(g_, label); + auto _end = grin_get_vertex_list_size(g_, vl); CHECK(start <= end && start <= _end); if (end <= _end) { - return vertex_range_t(vl, start, end); + return vertex_range_t(g_, vl, start, end); } else { - return vertex_range_t(vl, start, _end); + return vertex_range_t(g_, vl, start, _end); } } - inline size_t GetVerticesNum(void* label) const { - auto vl = get_vertex_list_by_type(g_, label); - return get_vertex_list_size(vl); + inline size_t GetVerticesNum(GRIN_VERTEX_TYPE label) const { + auto vl = grin_get_vertex_list_by_type(g_, label); + return grin_get_vertex_list_size(g_, vl); } template - bool GetVertex(void* label, T& oid, void* v) { - if (DataTypeEnum::value != get_vertex_original_id_type(g_)) return false; - v = get_vertex_from_original_id_by_type(g_, label, (void*)(&oid)); + bool GetVertex(GRIN_VERTEX_TYPE label, T& oid, GRIN_VERTEX v) { + if (GRIN_DATATYPE_ENUM::value != grin_get_vertex_original_id_type(g_)) return false; + v = grin_get_vertex_from_original_id_by_type(g_, label, (GRIN_VERTEX_ORIGINAL_ID)(&oid)); return v != NULL; } template - bool GetId(void* v, T& oid) { - if (DataTypeEnum::value != get_vertex_original_id_type(g_)) return false; - auto _id = get_vertex_original_id(g_, v); + bool GetId(GRIN_VERTEX v, T& oid) { + if (GRIN_DATATYPE_ENUM::value != grin_get_vertex_original_id_type(g_)) return false; + auto _id = grin_get_vertex_original_id(g_, v); if (_id == NULL) return false; auto _oid = static_cast(_id); oid = *_oid; return true; } - void* GetFragId(void* u) const { - auto vref = get_vertex_ref_for_vertex(g_, u); - return get_master_partition_from_vertex_ref(g_, vref); +#ifdef GRIN_NATURAL_PARTITION_ID_TRAIT + GRIN_PARTITION_ID GetPartition(GRIN_VERTEX u) const { + auto vref = grin_get_vertex_ref_for_vertex(g_, u); + auto partition = grin_get_master_partition_from_vertex_ref(g_, vref); + return grin_get_partition_id(pg_, partition); } +#endif size_t GetTotalNodesNum() const { return GetTotalVerticesNum(); } size_t GetTotalVerticesNum() const { - return get_vertex_num(g_); + return grin_get_vertex_num(g_); } - size_t GetTotalVerticesNum(void* label) const { - return get_vertex_num_by_type(g_, label); + size_t GetTotalVerticesNum(GRIN_VERTEX_TYPE label) const { + return grin_get_vertex_num_by_type(g_, label); } - size_t GetEdgeNum() const { return get_edge_num(g_, Direction::BOTH); } - size_t GetInEdgeNum() const { return get_edge_num(g_, Direction::IN); } - size_t GetOutEdgeNum() const { return get_edge_num(g_, Direction::OUT); } + size_t GetEdgeNum() const { return grin_get_edge_num(g_, GRIN_DIRECTION::BOTH); } + size_t GetInEdgeNum() const { return grin_get_edge_num(g_, GRIN_DIRECTION::IN); } + size_t GetOutEdgeNum() const { return grin_get_edge_num(g_, GRIN_DIRECTION::OUT); } template - bool GetData(void* v, void* prop, T& value) const { - if (DataTypeEnum::value != get_vertex_property_data_type(g_, prop)) return false; - auto vtype = get_vertex_type(g_, v); - auto vpt = get_vertex_property_table_by_type(g_, vtype); - auto _value = get_value_from_vertex_property_table(vpt, v, prop); + bool GetData(GRIN_VERTEX v, GRIN_VERTEX_PROPERTY prop, T& value) const { + if (GRIN_DATATYPE_ENUM::value != grin_get_vertex_property_data_type(g_, prop)) return false; + auto vtype = grin_get_vertex_type(g_, v); + auto vpt = grin_get_vertex_property_table_by_type(g_, vtype); + auto _value = grin_get_value_from_vertex_property_table(vpt, v, prop); if (_value != NULL) { value = *(static_cast(_value)); return true; @@ -447,9 +456,9 @@ class GRIN_ArrowFragment { } template - bool GetData(void* vpt, void* v, void* prop, T& value) const { - if (DataTypeEnum::value != get_vertex_property_data_type(g_, prop)) return false; - auto _value = get_value_from_vertex_property_table(vpt, v, prop); + bool GetData(GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY prop, T& value) const { + if (GRIN_DATATYPE_ENUM::value != grin_get_vertex_property_data_type(g_, prop)) return false; + auto _value = grin_get_value_from_vertex_property_table(vpt, v, prop); if (_value != NULL) { value = *(static_cast(_value)); return true; @@ -457,67 +466,67 @@ class GRIN_ArrowFragment { return false; } - void* GetVertePropertyTable(void* label) { - return get_vertex_property_table_by_type(g_, label); + GRIN_VERTEX_PROPERTY_TABLE GetVertePropertyTable(GRIN_VERTEX_TYPE label) { + return grin_get_vertex_property_table_by_type(g_, label); } - bool HasChild(void* v, void* e_label) const { + bool HasChild(GRIN_VERTEX v, GRIN_EDGE_TYPE e_label) const { return GetLocalOutDegree(v, e_label) != 0; } - bool HasParent(void* v, void* e_label) const { + bool HasParent(GRIN_VERTEX v, GRIN_EDGE_TYPE e_label) const { return GetLocalInDegree(v, e_label) != 0; } - int GetLocalOutDegree(void* v, void* e_label) const { + int GetLocalOutDegree(GRIN_VERTEX v, GRIN_EDGE_TYPE e_label) const { return GetOutgoingAdjList(v, e_label).Size(); } - int GetLocalInDegree(void* v, void* e_label) const { + int GetLocalInDegree(GRIN_VERTEX v, GRIN_EDGE_TYPE e_label) const { return GetIncomingAdjList(v, e_label).Size(); } - inline size_t GetInnerVerticesNum(void* label) const { - auto vl = get_master_vertices_by_type(g_, label); - return get_vertex_list_size(vl); + inline size_t GetInnerVerticesNum(GRIN_VERTEX_TYPE label) const { + auto vl = grin_get_master_vertices_by_type(g_, label); + return grin_get_vertex_list_size(g_, vl); } - inline size_t GetOuterVerticesNum(void* label) const { - auto vl = get_mirror_vertices_by_type(g_, label); - return get_vertex_list_size(vl); + inline size_t GetOuterVerticesNum(GRIN_VERTEX_TYPE label) const { + auto vl = grin_get_mirror_vertices_by_type(g_, label); + return grin_get_vertex_list_size(g_, vl); } - inline bool IsInnerVertex(void* v) const { - return is_master_vertex(g_, v); + inline bool IsInnerVertex(GRIN_VERTEX v) const { + return grin_is_master_vertex(g_, v); } - inline bool IsOuterVertex(void* v) const { - return is_mirror_vertex(g_, v); + inline bool IsOuterVertex(GRIN_VERTEX v) const { + return grin_is_mirror_vertex(g_, v); } - inline adj_list_t GetIncomingAdjList(void* v, void* e_label) + inline adj_list_t GetIncomingAdjList(GRIN_VERTEX v, GRIN_EDGE_TYPE e_label) const { - auto al = get_adjacent_list_by_edge_type(g_, Direction::IN, v, e_label); - auto sz = get_adjacent_list_size(al); - auto ept = get_edge_property_table_by_type(g_, e_label); - return adj_list_t(al, ept, 0, sz); + auto al = grin_get_adjacent_list_by_edge_type(g_, GRIN_DIRECTION::IN, v, e_label); + auto sz = grin_get_adjacent_list_size(g_, al); + auto ept = grin_get_edge_property_table_by_type(g_, e_label); + return adj_list_t(g_, al, ept, 0, sz); } - inline adj_list_t GetOutgoingAdjList(void* v, void* e_label) + inline adj_list_t GetOutgoingAdjList(GRIN_VERTEX v, GRIN_EDGE_TYPE e_label) const { - auto al = get_adjacent_list_by_edge_type(g_, Direction::OUT, v, e_label); - auto sz = get_adjacent_list_size(al); - auto ept = get_edge_property_table_by_type(g_, e_label); - return adj_list_t(al, ept, 0, sz); + auto al = grin_get_adjacent_list_by_edge_type(g_, GRIN_DIRECTION::OUT, v, e_label); + auto sz = grin_get_adjacent_list_size(g_, al); + auto ept = grin_get_edge_property_table_by_type(g_, e_label); + return adj_list_t(g_, al, ept, 0, sz); } - void* get_graph() { return g_; } + GRIN_GRAPH get_graph() { return g_; } private: - void* pg_; - void* g_; - void* partition_; + GRIN_PARTITIONED_GRAPH pg_; + GRIN_GRAPH g_; + GRIN_PARTITION partition_; }; } // namespace vineyard diff --git a/modules/graph/grin/docs/Doxyfile b/modules/graph/grin/docs/Doxyfile index e1f2275a1..cea363936 100644 --- a/modules/graph/grin/docs/Doxyfile +++ b/modules/graph/grin/docs/Doxyfile @@ -2285,7 +2285,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = DOXYGEN_SKIP +PREDEFINED = GRIN_DOXYGEN_SKIP # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/modules/graph/grin/include/index/label.h b/modules/graph/grin/include/index/label.h index bdc47ec61..b2faa812c 100644 --- a/modules/graph/grin/include/index/label.h +++ b/modules/graph/grin/include/index/label.h @@ -20,82 +20,82 @@ limitations under the License. #include "../predefine.h" -#if defined(WITH_VERTEX_LABEL) || defined(WITH_EDGE_LABEL) -Label get_label_by_name(Graph, const char*); +#if defined(GRIN_WITH_VERTEX_LABEL) || defined(GRIN_WITH_EDGE_LABEL) +GRIN_LABEL grin_get_label_by_name(GRIN_GRAPH, const char*); -const char* get_label_name(Graph, Label); +const char* grin_get_label_name(GRIN_GRAPH, GRIN_LABEL); -void destroy_label(Label); +void grin_destroy_label(GRIN_GRAPH, GRIN_LABEL); -void destroy_label_list(LabelList); +void grin_destroy_label_list(GRIN_GRAPH, GRIN_LABEL_LIST); -size_t get_label_list_size(LabelList); +size_t grin_get_label_list_size(GRIN_GRAPH, GRIN_LABEL_LIST); -Label get_label_from_list(LabelList, size_t); +GRIN_LABEL grin_get_label_from_list(GRIN_GRAPH, GRIN_LABEL_LIST, size_t); #endif -#ifdef WITH_VERTEX_LABEL +#ifdef GRIN_WITH_VERTEX_LABEL /** * @brief assign a label to a vertex - * @param Graph the graph - * @param Label the label + * @param GRIN_GRAPH the graph + * @param GRIN_LABEL the label * @param Vertex the vertex * @return whether succeed */ -bool assign_label_to_vertex(Graph, Label, Vertex); +bool grin_assign_label_to_vertex(GRIN_GRAPH, GRIN_LABEL, GRIN_VERTEX); /** * @brief get the label list of a vertex - * @param Graph the graph + * @param GRIN_GRAPH the graph * @param Vertex the vertex */ -LabelList get_vertex_label_list(Graph, Vertex); +GRIN_LABEL_LIST grin_get_vertex_label_list(GRIN_GRAPH, GRIN_VERTEX); /** * @brief get the vertex list by label - * @param Graph the graph - * @param Label the label + * @param GRIN_GRAPH the graph + * @param GRIN_LABEL the label */ -VertexList get_vertex_list_by_label(Graph, Label); +GRIN_VERTEX_LIST grin_get_vertex_list_by_label(GRIN_GRAPH, GRIN_LABEL); /** * @brief filtering an existing vertex list by label - * @param VertexList the existing vertex list - * @param Label the label + * @param GRIN_VERTEX_LIST the existing vertex list + * @param GRIN_LABEL the label */ -VertexList filter_vertex_list_by_label(VertexList, Label); +GRIN_VERTEX_LIST grin_filter_vertex_list_by_label(GRIN_GRAPH, GRIN_VERTEX_LIST, GRIN_LABEL); #endif -#ifdef WITH_EDGE_LABEL +#ifdef GRIN_WITH_EDGE_LABEL /** * @brief assign a label to a edge - * @param Graph the graph - * @param Label the label - * @param Edge the edge + * @param GRIN_GRAPH the graph + * @param GRIN_LABEL the label + * @param GRIN_EDGE the edge * @return whether succeed */ -bool assign_label_to_edge(Graph, Label, Edge); +bool grin_assign_label_to_edge(GRIN_GRAPH, GRIN_LABEL, GRIN_EDGE); /** * @brief get the label list of a edge - * @param Graph the graph - * @param Edge the edge + * @param GRIN_GRAPH the graph + * @param GRIN_EDGE the edge */ -LabelList get_edge_label_list(Graph, Edge); +GRIN_LABEL_LIST grin_get_edge_label_list(GRIN_GRAPH, GRIN_EDGE); /** * @brief get the edge list by label - * @param Graph the graph - * @param Label the label + * @param GRIN_GRAPH the graph + * @param GRIN_LABEL the label */ -EdgeList get_edge_list_by_label(Graph, Label); +GRIN_EDGE_LIST grin_get_edge_list_by_label(GRIN_GRAPH, GRIN_LABEL); /** * @brief filtering an existing edge list by label - * @param EdgeList the existing edge list - * @param Label the label + * @param GRIN_EDGE_LIST the existing edge list + * @param GRIN_LABEL the label */ -EdgeList filter_edge_list_by_label(EdgeList, Label); +GRIN_EDGE_LIST grin_filter_edge_list_by_label(GRIN_GRAPH, GRIN_EDGE_LIST, GRIN_LABEL); #endif #endif // GRIN_INCLUDE_INDEX_LABEL_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/partition/partition.h b/modules/graph/grin/include/partition/partition.h index b33c07283..d8d3f45d4 100644 --- a/modules/graph/grin/include/partition/partition.h +++ b/modules/graph/grin/include/partition/partition.h @@ -23,164 +23,164 @@ limitations under the License. #include "../predefine.h" -#ifdef ENABLE_GRAPH_PARTITION -size_t get_total_partitions_number(PartitionedGraph); +#ifdef GRIN_ENABLE_GRAPH_PARTITION +size_t grin_get_total_partitions_number(GRIN_PARTITIONED_GRAPH); -PartitionList get_local_partition_list(PartitionedGraph); +GRIN_PARTITION_LIST grin_get_local_partition_list(GRIN_PARTITIONED_GRAPH); -void destroy_partition_list(PartitionList); +void grin_destroy_partition_list(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_LIST); -PartitionList create_partition_list(); +GRIN_PARTITION_LIST grin_create_partition_list(GRIN_PARTITIONED_GRAPH); -bool insert_partition_to_list(PartitionList, Partition); +bool grin_insert_partition_to_list(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_LIST, GRIN_PARTITION); -size_t get_partition_list_size(PartitionList); +size_t grin_get_partition_list_size(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_LIST); -Partition get_partition_from_list(PartitionList, size_t); +GRIN_PARTITION grin_get_partition_from_list(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_LIST, size_t); -bool equal_partition(Partition, Partition); +bool grin_equal_partition(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION, GRIN_PARTITION); -void destroy_partition(Partition); +void grin_destroy_partition(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); -void* get_partition_info(PartitionedGraph, Partition); +void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); -Graph get_local_graph_from_partition(PartitionedGraph, Partition); +GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); #endif -#ifdef NATURAL_PARTITION_ID_TRAIT -Partition get_partition_from_id(PartitionID); +#ifdef GRIN_NATURAL_PARTITION_ID_TRAIT +GRIN_PARTITION grin_get_partition_from_id(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_ID); -PartitionID get_partition_id(Partition); +GRIN_PARTITION_ID grin_get_partition_id(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); #endif // master & mirror vertices for vertexcut partition // while they refer to inner & outer vertices in edgecut partition -#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST) -VertexList get_master_vertices(Graph); +#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_ENABLE_VERTEX_LIST) +GRIN_VERTEX_LIST grin_get_master_vertices(GRIN_GRAPH); -VertexList get_mirror_vertices(Graph); +GRIN_VERTEX_LIST grin_get_mirror_vertices(GRIN_GRAPH); -VertexList get_mirror_vertices_by_partition(Graph, Partition); +GRIN_VERTEX_LIST grin_get_mirror_vertices_by_partition(GRIN_GRAPH, GRIN_PARTITION); -#ifdef WITH_VERTEX_PROPERTY -VertexList get_master_vertices_by_type(Graph, VertexType); +#ifdef GRIN_WITH_VERTEX_PROPERTY +GRIN_VERTEX_LIST grin_get_master_vertices_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); -VertexList get_mirror_vertices_by_type(Graph, VertexType); +GRIN_VERTEX_LIST grin_get_mirror_vertices_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); -VertexList get_mirror_vertices_by_type_partition(Graph, VertexType, Partition); +GRIN_VERTEX_LIST grin_get_mirror_vertices_by_type_partition(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_PARTITION); #endif #endif -#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_ADJACENT_LIST) +#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_ENABLE_ADJACENT_LIST) /** * @brief get the adjacentlist of a vertex where the neigbors are only master vertices - * @param Graph the graph - * @param Direction incoming or outgoing - * @param Vertex the vertex + * @param GRIN_GRAPH the graph + * @param GRIN_DIRECTION incoming or outgoing + * @param GRIN_VERTEX the vertex */ -AdjacentList get_adjacent_master_list(Graph, Direction, Vertex); +GRIN_ADJACENT_LIST grin_get_adjacent_master_list(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); /** * @brief get the adjacentlist of a vertex where the neigbors are only mirror vertices - * @param Graph the graph - * @param Direction incoming or outgoing - * @param Vertex the vertex + * @param GRIN_GRAPH the graph + * @param GRIN_DIRECTION incoming or outgoing + * @param GRIN_VERTEX the vertex */ -AdjacentList get_adjacent_mirror_list(Graph, Direction, Vertex); +GRIN_ADJACENT_LIST grin_get_adjacent_mirror_list(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); /** * @brief get the adjacentlist of a vertex where the neigbors are only mirror vertices * whose master vertices are in a specific partition - * @param Graph the graph - * @param Direction incoming or outgoing - * @param Paritition the specific partition - * @param Vertex the vertex + * @param GRIN_GRAPH the graph + * @param GRIN_DIRECTION incoming or outgoing + * @param GRIN_PARTITION the specific partition + * @param GRIN_VERTEX the vertex */ -AdjacentList get_adjacent_mirror_list_by_partition(Graph, Direction, - Partition, Vertex); +GRIN_ADJACENT_LIST grin_get_adjacent_mirror_list_by_partition(GRIN_GRAPH, GRIN_DIRECTION, + GRIN_PARTITION, GRIN_VERTEX); #endif // Vertex ref refers to the same vertex referred in other partitions, // while edge ref is likewise. Both can be serialized to const char* for // message transporting and deserialized on the other end. -#ifdef ENABLE_VERTEX_REF -VertexRef get_vertex_ref_for_vertex(Graph, Vertex); +#ifdef GRIN_ENABLE_VERTEX_REF +GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH, GRIN_VERTEX); /** * @brief get the local vertex from the vertex ref * if the vertex ref is not regconized, a null vertex is returned - * @param Graph the graph - * @param VertexRef the vertex ref + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_REF the vertex ref */ -Vertex get_vertex_from_vertex_ref(Graph, VertexRef); +GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); /** * @brief get the master partition of a vertex ref. * Some storage can still provide the master partition of the vertex ref, * even if the vertex ref can NOT be recognized locally. - * @param Graph the graph - * @param VertexRef the vertex ref + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_REF the vertex ref */ -bool is_master_vertex(Graph, Vertex); +bool grin_is_master_vertex(GRIN_GRAPH, GRIN_VERTEX); -bool is_mirror_vertex(Graph, Vertex); +bool grin_is_mirror_vertex(GRIN_GRAPH, GRIN_VERTEX); -Partition get_master_partition_from_vertex_ref(Graph, VertexRef); +GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); -const char* serialize_vertex_ref(Graph, VertexRef); +const char* grin_serialize_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); -VertexRef deserialize_to_vertex_ref(Graph, const char*); +GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH, const char*); #endif -#ifdef ENABLE_EDGE_REF -EdgeRef get_edge_ref_for_edge(Graph, Partition, Edge); +#ifdef GRIN_ENABLE_EDGE_REF +GRIN_EDGE_REF grin_get_edge_ref_for_edge(GRIN_GRAPH, GRIN_PARTITION, GRIN_EDGE); -Edge get_edge_from_edge_ref(Graph, EdgeRef); +GRIN_EDGE grin_get_edge_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); -Partition get_master_partition_from_edge_ref(Graph, EdgeRef); +Partition grin_get_master_partition_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); -const char* serialize_edge_ref(Graph, EdgeRef); +const char* grin_serialize_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); -EdgeRef deserialize_to_edge_ref(Graph, const char*); +GRIN_EDGE_REF grin_deserialize_to_edge_ref(GRIN_GRAPH, const char*); #endif // The concept of local_complete refers to whether we can get complete data or properties // locally in the partition. It is orthogonal to the concept of master/mirror which // is mainly designed for data aggregation. In some extremely cases, master vertices // may NOT contain all the data or properties locally. -bool is_vertex_neighbor_local_complete(Graph, Vertex); +bool grin_is_vertex_neighbor_local_complete(GRIN_GRAPH, GRIN_VERTEX); /** * @brief get the partitions whose combination can provide the complete * neighbors of a vertex. - * @param Graph the graph + * @param GRIN_GRAPH the graph * @param Vertex the vertex */ -PartitionList vertex_neighbor_complete_partitions(Graph, Vertex); +GRIN_PARTITION_LIST grin_vertex_neighbor_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); -#ifdef WITH_VERTEX_DATA -bool is_vertex_data_local_complete(Graph, Vertex); +#ifdef GRIN_WITH_VERTEX_DATA +bool grin_is_vertex_data_local_complete(GRIN_GRAPH, Vertex); -PartitionList vertex_data_complete_partitions(Graph, Vertex); +GRIN_PARTITION_LIST grin_vertex_data_complete_partitions(GRIN_GRAPH, Vertex); #endif -#ifdef WITH_VERTEX_PROPERTY -bool is_vertex_property_local_complete(Graph, Vertex); +#ifdef GRIN_WITH_VERTEX_PROPERTY +bool grin_is_vertex_property_local_complete(GRIN_GRAPH, GRIN_VERTEX); -PartitionList vertex_property_complete_partitions(Graph, Vertex); +GRIN_PARTITION_LIST grin_vertex_property_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); #endif -#ifdef WITH_EDGE_DATA -bool is_edge_data_local_complete(Graph, Edge); +#ifdef GRIN_WITH_EDGE_DATA +bool grin_is_edge_data_local_complete(GRIN_GRAPH, GRIN_EDGE); -PartitionList edge_data_complete_partitions(Graph, Edge); +GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); #endif -#ifdef WITH_EDGE_PROPERTY -bool is_edge_property_local_complete(Graph, Edge); +#ifdef GRIN_WITH_EDGE_PROPERTY +bool grin_is_edge_property_local_complete(GRIN_GRAPH, GRIN_EDGE); -PartitionList edge_data_complete_partitions(Graph, Edge); +GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); #endif #endif // GRIN_INCLUDE_PARTITION_PARTITION_H_ diff --git a/modules/graph/grin/include/predefine.h b/modules/graph/grin/include/predefine.h index c8b8cbec7..52bf9f564 100644 --- a/modules/graph/grin/include/predefine.h +++ b/modules/graph/grin/include/predefine.h @@ -34,21 +34,21 @@ typedef enum { IN = 0, ///< incoming OUT = 1, ///< outgoing BOTH = 2, ///< incoming & outgoing -} Direction; +} GRIN_DIRECTION; /// Enumerates the datatype supported in the storage typedef enum { - Undefined = 0, ///< other unknown types - Int32 = 1, ///< int - UInt32 = 2, ///< unsigned int - Int64 = 3, ///< long int - UInt64 = 4, ///< unsigned long int - Float = 5, ///< float - Double = 6, ///< double - String = 7, ///< string - Date32 = 8, ///< short date - Date64 = 9, ///< long date -} DataType; + Undefined = 0, ///< other unknown types + Int32 = 1, ///< int + UInt32 = 2, ///< unsigned int + Int64 = 3, ///< long int + UInt64 = 4, ///< unsigned long int + Float = 5, ///< float + Double = 6, ///< double + String = 7, ///< string + Date32 = 8, ///< short date + Date64 = 9, ///< long date +} GRIN_DATATYPE; /** @name TopologyMacros * @brief Macros for basic graph topology features @@ -59,61 +59,61 @@ typedef enum { * This facilitates queries starting from a specific vertex, * since one can get the vertex handler directly using its original ID. */ -#define WITH_VERTEX_ORIGINAL_ID +#define GRIN_WITH_VERTEX_ORIGINAL_ID /** @ingroup TopologyMacros * @brief There is data on vertex. E.g., the PageRank value of a vertex. */ -#define WITH_VERTEX_DATA +#define GRIN_WITH_VERTEX_DATA /** @ingroup TopologyMacros * @brief There is data on edge. E.g., the weight of an edge. */ -#define WITH_EDGE_DATA +#define GRIN_WITH_EDGE_DATA /** @ingroup TopologyMacros * @brief Enable the vertex list structure. * The vertex list related APIs follow the design principle of GRIN List. */ -#define ENABLE_VERTEX_LIST +#define GRIN_ENABLE_VERTEX_LIST /** @ingroup TopologyMacros * @brief Enable the vertex list iterator. * The vertex list iterator related APIs follow the design principle of GRIN Iterator. */ -#define ENABLE_VERTEX_LIST_ITERATOR +#define GRIN_ENABLE_VERTEX_LIST_ITERATOR /** @ingroup TopologyMacros * @brief Enable the edge list structure. * The edge list related APIs follow the design principle of GRIN List. */ -#define ENABLE_EDGE_LIST +#define GRIN_ENABLE_EDGE_LIST /** @ingroup TopologyMacros * @brief Enable the edge list iterator. * The edge list iterator related APIs follow the design principle of GRIN Iterator. */ -#define ENABLE_EDGE_LIST_ITERATOR +#define GRIN_ENABLE_EDGE_LIST_ITERATOR /** @ingroup TopologyMacros * @brief Enable the adjacent list structure. * The adjacent list related APIs follow the design principle of GRIN List. */ -#define ENABLE_ADJACENT_LIST +#define GRIN_ENABLE_ADJACENT_LIST /** @ingroup TopologyMacros * @brief Enable the adjacent list iterator. * The adjacent list iterator related APIs follow the design principle of GRIN Iterator. */ -#define ENABLE_ADJACENT_LIST_ITERATOR - -#ifndef DOXYGEN_SKIP -#undef WITH_VERTEX_DATA -#undef WITH_EDGE_DATA -#undef ENABLE_VERTEX_LIST_ITERATOR -#undef ENABLE_EDGE_LIST -#undef ENABLE_EDGE_LIST_ITERATOR -#undef ENABLE_ADJACENT_LIST_ITERATOR +#define GRIN_ENABLE_ADJACENT_LIST_ITERATOR + +#ifndef GRIN_DOXYGEN_SKIP +#undef GRIN_WITH_VERTEX_DATA +#undef GRIN_WITH_EDGE_DATA +#undef GRIN_ENABLE_VERTEX_LIST_ITERATOR +#undef GRIN_ENABLE_EDGE_LIST +#undef GRIN_ENABLE_EDGE_LIST_ITERATOR +#undef GRIN_ENABLE_ADJACENT_LIST_ITERATOR #endif ///@} @@ -125,35 +125,35 @@ typedef enum { /** @ingroup PartitionMacros * @brief Enable partitioned graph. A partitioned graph usually contains * several fragments (i.e., local graphs) that are distributedly stored - * in a cluster. In GRIN, Graph represents to a single fragment that can + * in a cluster. In GRIN, GRIN_GRAPH represents to a single fragment that can * be locally accessed. */ -#define ENABLE_GRAPH_PARTITION +#define GRIN_ENABLE_GRAPH_PARTITION /** @ingroup PartitionMacros * @brief The storage provides natural number IDs for partitions. * It follows the design principle of natural number ID trait in GRIN. */ -#define NATURAL_PARTITION_ID_TRAIT +#define GRIN_NATURAL_PARTITION_ID_TRAIT /** @ingroup PartitionMacros * @brief The storage provides reference of vertex that can be * recognized in other partitions where the vertex also appears. */ -#define ENABLE_VERTEX_REF +#define GRIN_ENABLE_VERTEX_REF /** @ingroup PartitionMacros * @brief The storage provides reference of edge that can be * recognized in other partitions where the edge also appears. */ -#define ENABLE_EDGE_REF +#define GRIN_ENABLE_EDGE_REF -#ifndef ENABLE_GRAPH_PARTITION -#undef NATURAL_PARTITION_ID_TRAIT +#ifndef GRIN_ENABLE_GRAPH_PARTITION +#undef GRIN_NATURAL_PARTITION_ID_TRAIT #endif -#ifndef DOXYGEN_SKIP -#undef ENABLE_EDGE_REF +#ifndef GRIN_DOXYGEN_SKIP +#undef GRIN_ENABLE_EDGE_REF #endif ///@} @@ -168,13 +168,13 @@ typedef enum { * types are distinguished even they may share the same property name. Please refer to * the design principle of Property for details. */ -#define WITH_PROPERTY_NAME +#define GRIN_WITH_PROPERTY_NAME /** @ingroup PropertyMacros * @brief There are properties bound to vertices. When vertices are typed, vertex * properties are bound to vertex types, according to the definition of vertex type. */ -#define WITH_VERTEX_PROPERTY +#define GRIN_WITH_VERTEX_PROPERTY /** @ingroup PropertyMacros * @brief There are primary keys for vertices. Vertex primary keys is @@ -183,57 +183,57 @@ typedef enum { * that type. * * With primary keys, one can get the vertex from the graph or a certain type - * by providing the values of the primary keys. The macro is unset if WITH_VERTEX_PROPERTY - * is NOT defined, in which case, one can use WITH_VERTEX_ORIGINAL_ID when vertices have + * by providing the values of the primary keys. The macro is unset if GRIN_WITH_VERTEX_PROPERTY + * is NOT defined, in which case, one can use GRIN_WITH_VERTEX_ORIGINAL_ID when vertices have * no properties. */ -#define WITH_VERTEX_PRIMARY_KEYS +#define GRIN_WITH_VERTEX_PRIMARY_KEYS /** @ingroup PropertyMacros * @brief The storage provides natural number IDs for vertex types. * It follows the design principle of natural ID trait in GRIN. */ -#define NATURAL_VERTEX_TYPE_ID_TRAIT +#define GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT /** @ingroup PropertyMacros * @brief The storage provides natural number IDs for properties bound to * a certain vertex type. * It follows the design principle of natural ID trait in GRIN. */ -#define NATURAL_VERTEX_PROPERTY_ID_TRAIT +#define GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT -#define WITH_EDGE_PROPERTY // There is any property for edges. -#define WITH_EDGE_PRIMARY_KEYS // There is cross-type property name. -#define NATURAL_EDGE_TYPE_ID_TRAIT // Edge type has natural continuous id from 0. -#define NATURAL_EDGE_PROPERTY_ID_TRAIT // Edge property has natural continuous id from 0. +#define GRIN_WITH_EDGE_PROPERTY // There is any property for edges. +#define GRIN_WITH_EDGE_PRIMARY_KEYS // There is cross-type property name. +#define GRIN_NATURAL_EDGE_TYPE_ID_TRAIT // Edge type has natural continuous id from 0. +#define GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT // Edge property has natural continuous id from 0. /** @ingroup PropertyMacros * @brief The storage uses column store for properties. * This enables efficient property selections for vertices and edges. */ -#define COLUMN_STORE_TRAIT +#define GRIN_COLUMN_STORE_TRAIT -#if !defined(WITH_VERTEX_PROPERTY) && !defined(WITH_EDGE_PROPERTY) -#undef WITH_PROPERTY_NAME +#if !defined(GRIN_WITH_VERTEX_PROPERTY) && !defined(GRIN_WITH_EDGE_PROPERTY) +#undef GRIN_WITH_PROPERTY_NAME #endif -#ifndef WITH_VERTEX_PROPERTY -#undef WITH_VERTEX_PRIMARTY_KEYS -#undef NATURAL_VERTEX_TYPE_ID_TRAIT -#undef NATURAL_VERTEX_PROPERTY_ID_TRAIT +#ifndef GRIN_WITH_VERTEX_PROPERTY +#undef GRIN_WITH_VERTEX_PRIMARY_KEYS +#undef GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT +#undef GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT #endif -#ifndef WITH_EDGE_PROPERTY -#undef WITH_EDGE_PRIMARY_KEYS -#undef NATURAL_EDGE_TYPE_ID_TRAIT -#undef NATURAL_EDGE_PROPERTY_ID_TRAIT +#ifndef GRIN_WITH_EDGE_PROPERTY +#undef GRIN_WITH_EDGE_PRIMARY_KEYS +#undef GRIN_NATURAL_EDGE_TYPE_ID_TRAIT +#undef GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT #endif -#ifndef DOXYGEN_SKIP -#undef WITH_VERTEX_PRIMARY_KEYS -#undef WITH_EDGE_PRIMARY_KEYS +#ifndef GRIN_DOXYGEN_SKIP +#undef GRIN_WITH_VERTEX_PRIMARY_KEYS +#undef GRIN_WITH_EDGE_PRIMARY_KEYS #endif ///@} @@ -244,8 +244,8 @@ typedef enum { /** @ingroup PredicateMacros * @brief Enable predicates on graph. */ -#define ENABLE_PREDICATE -#undef ENABLE_PREDICATE +#define GRIN_ENABLE_PREDICATE +#undef GRIN_ENABLE_PREDICATE ///@} /** @name IndexMacros @@ -255,16 +255,16 @@ typedef enum { /** @ingroup IndexMacros * @brief Enable vertex label on graph. */ -#define WITH_VERTEX_LABEL +#define GRIN_WITH_VERTEX_LABEL /** @ingroup IndexMacros * @brief Enable edge label on graph. */ -#define WITH_EDGE_LABEL +#define GRIN_WITH_EDGE_LABEL -#ifndef DOXYGEN_SKIP -#undef WITH_VERTEX_LABEL -#undef WITH_EDGE_LABEL +#ifndef GRIN_DOXYGEN_SKIP +#undef GRIN_WITH_VERTEX_LABEL +#undef GRIN_WITH_EDGE_LABEL #endif ///@} @@ -272,134 +272,136 @@ typedef enum { * Macros for Null(invalid) values */ ///@{ -/** @brief Null type (undefined data type) */ -#define NULL_TYPE Undefined +/** @brief Null data type (undefined data type) */ +#define GRIN_NULL_DATATYPE Undefined /** @brief Null graph (invalid return value) */ -#define NULL_GRAPH NULL +#define GRIN_NULL_GRAPH NULL /** @brief Non-existing vertex (invalid return value) */ -#define NULL_VERTEX NULL +#define GRIN_NULL_VERTEX NULL /** @brief Non-existing edge (invalid return value) */ -#define NULL_EDGE NULL +#define GRIN_NULL_EDGE NULL /** @brief Null list of any kind (invalid return value) */ -#define NULL_LIST NULL +#define GRIN_NULL_LIST NULL /** @brief Non-existing partition (invalid return value) */ -#define NULL_PARTITION NULL +#define GRIN_NULL_PARTITION NULL /** @brief Null vertex reference (invalid return value) */ -#define NULL_VERTEX_REF NULL +#define GRIN_NULL_VERTEX_REF NULL /** @brief Null edge reference (invalid return value) */ -#define NULL_EDGE_REF NULL +#define GRIN_NULL_EDGE_REF NULL /** @brief Non-existing vertex type (invalid return value) */ -#define NULL_VERTEX_TYPE NULL +#define GRIN_NULL_VERTEX_TYPE NULL /** @brief Non-existing edge type (invalid return value) */ -#define NULL_EDGE_TYPE NULL -/** @brief Non-existing property (invalid return value) */ -#define NULL_PROPERTY NULL +#define GRIN_NULL_EDGE_TYPE NULL +/** @brief Non-existing vertex property (invalid return value) */ +#define GRIN_NULL_VERTEX_PROPERTY NULL +/** @brief Non-existing vertex property (invalid return value) */ +#define GRIN_NULL_EDGE_PROPERTY NULL /** @brief Null row (invalid return value) */ -#define NULL_ROW NULL +#define GRIN_NULL_ROW NULL /** @brief Null natural id of any kind (invalid return value) */ -#define NULL_NATURAL_ID UINT_MAX +#define GRIN_NULL_NATURAL_ID UINT_MAX ///@} /* Define the handlers using typedef */ -typedef void* Graph; -typedef void* Vertex; -typedef void* Edge; +typedef void* GRIN_GRAPH; +typedef void* GRIN_VERTEX; +typedef void* GRIN_EDGE; -#ifdef WITH_VERTEX_ORIGINAL_ID -typedef void* OriginalID; +#ifdef GRIN_WITH_VERTEX_ORIGINAL_ID +typedef void* GRIN_VERTEX_ORIGINAL_ID; #endif -#ifdef WITH_VERTEX_DATA -typedef void* VertexData; +#ifdef GRIN_WITH_VERTEX_DATA +typedef void* GRIN_VERTEX_DATA; #endif -#ifdef ENABLE_VERTEX_LIST -typedef void* VertexList; +#ifdef GRIN_ENABLE_VERTEX_LIST +typedef void* GRIN_VERTEX_LIST; #endif -#ifdef ENABLE_VERTEX_LIST_ITERATOR -typedef void* VertexListIterator; +#ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR +typedef void* GRIN_VERTEX_LIST_ITERATOR; #endif -#ifdef ENABLE_ADJACENT_LIST -typedef void* AdjacentList; +#ifdef GRIN_ENABLE_ADJACENT_LIST +typedef void* GRIN_ADJACENT_LIST; #endif -#ifdef ENABLE_ADJACENT_LIST_ITERATOR -typedef void* AdjacentListIterator; +#ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR +typedef void* GRIN_ADJACENT_LIST_ITERATOR; #endif -#ifdef WITH_EDGE_DATA -typedef void* EdgeData; +#ifdef GRIN_WITH_EDGE_DATA +typedef void* GRIN_EDGE_DATA; #endif -#ifdef ENABLE_EDGE_LIST -typedef void* EdgeList; +#ifdef GRIN_ENABLE_EDGE_LIST +typedef void* GRIN_EDGE_LIST; #endif -#ifdef ENABLE_EDGE_LIST_ITERATOR -typedef void* EdgeListIterator; +#ifdef GRIN_ENABLE_EDGE_LIST_ITERATOR +typedef void* GRIN_EDGE_LIST_ITERATOR; #endif -#ifdef ENABLE_GRAPH_PARTITION -typedef void* PartitionedGraph; -typedef void* Partition; -typedef void* PartitionList; +#ifdef GRIN_ENABLE_GRAPH_PARTITION +typedef void* GRIN_PARTITIONED_GRAPH; +typedef void* GRIN_PARTITION; +typedef void* GRIN_PARTITION_LIST; #endif -#ifdef NATURAL_PARTITION_ID_TRAIT -typedef unsigned PartitionID; +#ifdef GRIN_NATURAL_PARTITION_ID_TRAIT +typedef unsigned GRIN_PARTITION_ID; #endif -#ifdef ENABLE_VERTEX_REF -typedef void* VertexRef; +#ifdef GRIN_ENABLE_VERTEX_REF +typedef void* GRIN_VERTEX_REF; #endif -#ifdef ENABLE_EDGE_REF -typedef void* EdgeRef; +#ifdef GRIN_ENABLE_EDGE_REF +typedef void* GRIN_EDGE_REF; #endif -#ifdef WITH_VERTEX_PROPERTY -typedef void* VertexType; -typedef void* VertexTypeList; -typedef void* VertexProperty; -typedef void* VertexPropertyList; -typedef void* VertexPropertyTable; +#ifdef GRIN_WITH_VERTEX_PROPERTY +typedef void* GRIN_VERTEX_TYPE; +typedef void* GRIN_VERTEX_TYPE_LIST; +typedef void* GRIN_VERTEX_PROPERTY; +typedef void* GRIN_VERTEX_PROPERTY_LIST; +typedef void* GRIN_VERTEX_PROPERTY_TABLE; #endif -#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT -typedef unsigned VertexTypeID; +#ifdef GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT +typedef unsigned GRIN_VERTEX_TYPE_ID; #endif -#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT -typedef unsigned VertexPropertyID; +#ifdef GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT +typedef unsigned GRIN_VERTEX_PROPERTY_ID; #endif -#ifdef WITH_EDGE_PROPERTY -typedef void* EdgeType; -typedef void* EdgeTypeList; -typedef void* EdgeProperty; -typedef void* EdgePropertyList; -typedef void* EdgePropertyTable; +#ifdef GRIN_WITH_EDGE_PROPERTY +typedef void* GRIN_EDGE_TYPE; +typedef void* GRIN_EDGE_TYPE_LIST; +typedef void* GRIN_EDGE_PROPERTY; +typedef void* GRIN_EDGE_PROPERTY_LIST; +typedef void* GRIN_EDGE_PROPERTY_TABLE; #endif -#ifdef NATURAL_EDGE_TYPE_ID_TRAIT -typedef unsigned EdgeTypeID; +#ifdef GRIN_NATURAL_EDGE_TYPE_ID_TRAIT +typedef unsigned GRIN_EDGE_TYPE_ID; #endif -#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT -typedef unsigned EdgePropertyID; +#ifdef GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT +typedef unsigned GRIN_EDGE_PROPERTY_ID; #endif -#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) -typedef void* Row; +#if defined(GRIN_WITH_VERTEX_PROPERTY) || defined(GRIN_WITH_EDGE_PROPERTY) +typedef void* GRIN_ROW; #endif -#ifdef WITH_LABEL -typedef void* Label -typedef void* LabelList +#if defined(GRIN_WITH_VERTEX_LABEL) || defined(GRIN_WITH_EDGE_LABEL) +typedef void* GRIN_LABEL +typedef void* GRIN_LABEL_LIST #endif #endif // GRIN_INCLUDE_PREDEFINE_H_ diff --git a/modules/graph/grin/include/property/primarykey.h b/modules/graph/grin/include/property/primarykey.h index 3e3c3745d..698880fd3 100644 --- a/modules/graph/grin/include/property/primarykey.h +++ b/modules/graph/grin/include/property/primarykey.h @@ -20,50 +20,50 @@ limitations under the License. #include "../predefine.h" -#ifdef WITH_VERTEX_PRIMARY_KEYS +#ifdef GRIN_WITH_VERTEX_PRIMARY_KEYS /** * @brief get the vertex types with primary keys - * @param Graph the graph + * @param GRIN_GRAPH the graph */ -VertexTypeList get_vertex_types_with_primary_keys(Graph); +GRIN_VERTEX_TYPE_LIST grin_get_vertex_types_with_primary_keys(GRIN_GRAPH); /** * @brief get the primary keys (property list) of a specific vertex type - * @param Graph the graph - * @param VertexType the vertex type + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_TYPE the vertex type */ -VertexPropertyList get_primary_keys_by_vertex_type(Graph, VertexType); +GRIN_VERTEX_PROPERTY_LIST grin_get_primary_keys_by_vertex_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); /** * @brief get the vertex with the given primary keys - * @param Graph the graph - * @param VertexPropertyList the primary keys - * @param Row the values of primary keys + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_PROPERTY_LIST the primary keys + * @param GRIN_ROW the values of primary keys */ -Vertex get_vertex_by_primay_keys(Graph, VertexPropertyList, Row); +Vertex grin_get_vertex_by_primay_keys(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST, GRIN_ROW); #endif -#ifdef WITH_EDGE_PRIMARY_KEYS +#ifdef GRIN_WITH_EDGE_PRIMARY_KEYS /** * @brief get the edge types with primary keys - * @param Graph the graph + * @param GRIN_GRAPH the graph */ -EdgeTypeList get_edge_types_with_primary_keys(Graph); +GRIN_EDGE_TYPE_LIST grin_get_edge_types_with_primary_keys(GRIN_GRAPH); /** * @brief get the primary keys (property list) of a specific edge type - * @param Graph the graph - * @param EdgeType the edge type + * @param GRIN_GRAPH the graph + * @param GRIN_EDGE_TYPE the edge type */ -EdgePropertyList get_primary_keys_by_edge_type(Graph, EdgeType); +GRIN_EDGE_PROPERTY_LIST grin_get_primary_keys_by_edge_type(GRIN_GRAPH, GRIN_EDGE_TYPE); /** * @brief get the edge with the given primary keys - * @param Graph the graph - * @param EdgePropertyList the primary keys - * @param Row the values of primary keys + * @param GRIN_GRAPH the graph + * @param GRIN_EDGE_PROPERTY_LIST the primary keys + * @param GRIN_ROW the values of primary keys */ -Edge get_edge_by_primay_keys(Graph, EdgePropertyList, Row); +GRIN_EDGE grin_get_edge_by_primay_keys(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST, GRIN_ROW); #endif #endif // GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/property.h b/modules/graph/grin/include/property/property.h index b98a96e43..040aa67eb 100644 --- a/modules/graph/grin/include/property/property.h +++ b/modules/graph/grin/include/property/property.h @@ -20,98 +20,98 @@ limitations under the License. #include "../predefine.h" -#if defined(WITH_PROPERTY_NAME) && defined(WITH_VERTEX_PROPERTY) +#if defined(GRIN_WITH_PROPERTY_NAME) && defined(GRIN_WITH_VERTEX_PROPERTY) /** * @brief get the vertex property name - * @param Graph the graph - * @param VertexProperty the vertex property + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_PROPERTY the vertex property */ -const char* get_vertex_property_name(Graph, VertexProperty); +const char* grin_get_vertex_property_name(GRIN_GRAPH, GRIN_VERTEX_PROPERTY); /** * @brief get the vertex property with a given name under a specific vertex type - * @param Graph the graph - * @param VertexType the specific vertex type + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_TYPE the specific vertex type * @param name the name */ -VertexProperty get_vertex_property_by_name(Graph, VertexType, const char* name); +GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH, GRIN_VERTEX_TYPE, const char* name); /** * @brief get all the vertex properties with a given name - * @param Graph the graph + * @param GRIN_GRAPH the graph * @param name the name */ -VertexPropertyList get_vertex_properties_by_name(Graph, const char* name); +GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH, const char* name); #endif -#if defined(WITH_PROPERTY_NAME) && defined(WITH_EDGE_PROPERTY) +#if defined(GRIN_WITH_PROPERTY_NAME) && defined(GRIN_WITH_EDGE_PROPERTY) /** * @brief get the edge property name - * @param Graph the graph - * @param EdgeProperty the edge property + * @param GRIN_GRAPH the graph + * @param GRIN_EDGE_PROPERTY the edge property */ -const char* get_edge_property_name(Graph, EdgeProperty); +const char* grin_get_edge_property_name(GRIN_GRAPH, GRIN_EDGE_PROPERTY); /** * @brief get the edge property with a given name under a specific edge type - * @param Graph the graph - * @param EdgeType the specific edge type + * @param GRIN_GRAPH the graph + * @param GRIN_EDGE_TYPE the specific edge type * @param name the name */ -EdgeProperty get_edge_property_by_name(Graph, EdgeType, const char* name); +GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH, GRIN_EDGE_TYPE, const char* name); /** * @brief get all the edge properties with a given name - * @param Graph the graph + * @param GRIN_GRAPH the graph * @param name the name */ -EdgePropertyList get_edge_properties_by_name(Graph, const char* name); +GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH, const char* name); #endif -#ifdef WITH_VERTEX_PROPERTY -bool equal_vertex_property(VertexProperty, VertexProperty); +#ifdef GRIN_WITH_VERTEX_PROPERTY +bool grin_equal_vertex_property(GRIN_VERTEX_PROPERTY, GRIN_VERTEX_PROPERTY); /** * @brief destroy vertex property - * @param VertexProperty vertex property + * @param GRIN_VERTEX_PROPERTY vertex property */ -void destroy_vertex_property(VertexProperty); +void grin_destroy_vertex_property(GRIN_VERTEX_PROPERTY); /** * @brief get property data type - * @param VertexProperty vertex property + * @param GRIN_VERTEX_PROPERTY vertex property */ -DataType get_vertex_property_data_type(Graph, VertexProperty); +GRIN_DATATYPE grin_get_vertex_property_data_type(GRIN_GRAPH, GRIN_VERTEX_PROPERTY); /** * @brief get the vertex type that the property is bound to - * @param VertexProperty vertex property + * @param GRIN_VERTEX_PROPERTY vertex property */ -VertexType get_vertex_property_vertex_type(VertexProperty); +GRIN_VERTEX_TYPE grin_get_vertex_property_vertex_type(GRIN_VERTEX_PROPERTY); #endif -#ifdef WITH_EDGE_PROPERTY -bool equal_edge_property(EdgeProperty, EdgeProperty); +#ifdef GRIN_WITH_EDGE_PROPERTY +bool grin_equal_edge_property(GRIN_EDGE_PROPERTY, GRIN_EDGE_PROPERTY); /** * @brief destroy edge property - * @param EdgeProperty edge property + * @param GRIN_EDGE_PROPERTY edge property */ -void destroy_edge_property(EdgeProperty); +void grin_destroy_edge_property(GRIN_EDGE_PROPERTY); /** * @brief get property data type - * @param EdgeProperty edge property + * @param GRIN_EDGE_PROPERTY edge property */ -DataType get_edge_property_data_type(Graph, EdgeProperty); +GRIN_DATATYPE grin_get_edge_property_data_type(GRIN_GRAPH, GRIN_EDGE_PROPERTY); /** * @brief get the edge type that the property is bound to - * @param EdgeProperty edge property + * @param GRIN_EDGE_PROPERTY edge property */ -EdgeType get_edge_property_edge_type(EdgeProperty); +GRIN_EDGE_TYPE grin_get_edge_property_edge_type(GRIN_EDGE_PROPERTY); #endif #endif // GRIN_INCLUDE_PROPERTY_PROPERTY_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/propertylist.h b/modules/graph/grin/include/property/propertylist.h index cc697c612..bc976683e 100644 --- a/modules/graph/grin/include/property/propertylist.h +++ b/modules/graph/grin/include/property/propertylist.h @@ -20,50 +20,50 @@ limitations under the License. #include "../predefine.h" -#ifdef WITH_VERTEX_PROPERTY -VertexPropertyList get_vertex_property_list_by_type(Graph, VertexType); +#ifdef GRIN_WITH_VERTEX_PROPERTY +GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_property_list_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); -size_t get_vertex_property_list_size(VertexPropertyList); +size_t grin_get_vertex_property_list_size(GRIN_VERTEX_PROPERTY_LIST); -VertexProperty get_vertex_property_from_list(VertexPropertyList, size_t); +GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_list(GRIN_VERTEX_PROPERTY_LIST, size_t); -VertexPropertyList create_vertex_property_list(); +GRIN_VERTEX_PROPERTY_LIST grin_create_vertex_property_list(); -void destroy_vertex_property_list(VertexPropertyList); +void grin_destroy_vertex_property_list(GRIN_VERTEX_PROPERTY_LIST); -bool insert_vertex_property_to_list(VertexPropertyList, VertexProperty); +bool grin_insert_vertex_property_to_list(GRIN_VERTEX_PROPERTY_LIST, GRIN_VERTEX_PROPERTY); #endif -#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT -VertexProperty get_vertex_property_from_id(VertexType, VertexPropertyID); +#ifdef GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT +GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_VERTEX_TYPE, GRIN_VERTEX_PROPERTY_ID); -VertexPropertyID get_vertex_property_id(VertexType, VertexProperty); +GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_VERTEX_TYPE, GRIN_VERTEX_PROPERTY); #endif -#ifdef WITH_EDGE_PROPERTY -EdgePropertyList get_edge_property_list_by_type(Graph, EdgeType); +#ifdef GRIN_WITH_EDGE_PROPERTY +GRIN_EDGE_PROPERTY_LIST grin_get_edge_property_list_by_type(GRIN_GRAPH, GRIN_EDGE_TYPE); -size_t get_edge_property_list_size(EdgePropertyList); +size_t grin_get_edge_property_list_size(GRIN_EDGE_PROPERTY_LIST); -EdgeProperty get_edge_property_from_list(EdgePropertyList, size_t); +GRIN_EDGE_PROPERTY grin_get_edge_property_from_list(GRIN_EDGE_PROPERTY_LIST, size_t); -EdgePropertyList create_edge_property_list(); +GRIN_EDGE_PROPERTY_LIST grin_create_edge_property_list(); -void destroy_edge_property_list(EdgePropertyList); +void grin_destroy_edge_property_list(GRIN_EDGE_PROPERTY_LIST); -bool insert_edge_property_to_list(EdgePropertyList, EdgeProperty); +bool grin_insert_edge_property_to_list(GRIN_EDGE_PROPERTY_LIST, GRIN_EDGE_PROPERTY); #endif -#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT -EdgeProperty get_edge_property_from_id(EdgeType, EdgePropertyID); +#ifdef GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT +GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_EDGE_TYPE, GRIN_EDGE_PROPERTY_ID); -EdgePropertyID get_edge_property_id(EdgeType, EdgeProperty); +GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_EDGE_TYPE, GRIN_EDGE_PROPERTY); #endif -/** @name GraphProjection - * Graph projection mainly works to shrink the properties into a subset +/** @name Graph Projection + * GRIN_GRAPH projection mainly works to shrink the properties into a subset * in need to improve the retrieval efficiency. Note that only the vertex/edge * type with at least one property left in the vertex/edge property list will * be kept after the projection. @@ -71,14 +71,14 @@ EdgePropertyID get_edge_property_id(EdgeType, EdgeProperty); * The projection only works on column store systems. */ ///@{ -#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE_TRAIT) +#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_COLUMN_STORE_TRAIT) /** @brief project vertex properties */ -Graph select_vertex_properties(Graph, VertexPropertyList); +GRIN_GRAPH grin_select_vertex_properties(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST); #endif -#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE_TRAIT) +#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_COLUMN_STORE_TRAIT) /** @brief project edge properties */ -Graph select_edge_properteis(Graph, EdgePropertyList); +GRIN_GRAPH grin_select_edge_properteis(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST); #endif #endif // GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/propertytable.h b/modules/graph/grin/include/property/propertytable.h index 64c55f88f..26c54508f 100644 --- a/modules/graph/grin/include/property/propertytable.h +++ b/modules/graph/grin/include/property/propertytable.h @@ -20,119 +20,119 @@ limitations under the License. #include "../predefine.h" -/** @name Row - * Row works as the pure value array for the properties of a vertex or an edge. - * In general, you can think of Row as an array of void*, where each void* points to +/** @name GRIN_ROW + * GRIN_ROW works as the pure value array for the properties of a vertex or an edge. + * In general, you can think of GRIN_ROW as an array of void*, where each void* points to * the value of a property. GRIN assumes the user already knows the corresponding * property list beforehead, so that she/he knows how to cast the void* into the * property's data type. */ ///@{ -#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) -void destroy_row(Row); +#if defined(GRIN_WITH_VERTEX_PROPERTY) || defined(GRIN_WITH_EDGE_PROPERTY) +void grin_destroy_row(GRIN_ROW); /** @brief the value of a property from row by its position in row */ -const void* get_value_from_row(Row, size_t); +const void* grin_get_value_from_row(GRIN_ROW, size_t); /** @brief create a row, usually to get vertex/edge by primary keys */ -Row create_row(); +GRIN_ROW grin_create_row(); /** @brief insert a value to the end of the row */ -bool insert_value_to_row(Row, void*); +bool grin_insert_value_to_row(GRIN_ROW, void*); #endif ///@} -#ifdef WITH_VERTEX_PROPERTY +#ifdef GRIN_WITH_VERTEX_PROPERTY /** * @brief destroy vertex property table - * @param VertexPropertyTable vertex property table + * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table */ -void destroy_vertex_property_table(VertexPropertyTable); +void grin_destroy_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE); /** * @brief get the vertex property table of a certain vertex type * No matter column or row store strategy is used in the storage, * GRIN recommends to first get the property table of the vertex type, * and then fetch values(rows) by vertex and property(list). However, - * GRIN does provide direct row fetching API when COLUMN_STORE_TRAIT + * GRIN does provide direct row fetching API when GRIN_COLUMN_STORE_TRAIT * is NOT set. - * @param Graph the graph - * @param VertexType the vertex type + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_TYPE the vertex type */ -VertexPropertyTable get_vertex_property_table_by_type(Graph, VertexType); +GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); /** * @brief get vertex property value from table - * @param VertexPropertyTable vertex property table + * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table * @param Vertex the vertex which is the row index * @param VertexProperty the vertex property which is the column index * @return can be casted to the property data type by the caller */ -const void* get_value_from_vertex_property_table(VertexPropertyTable, Vertex, VertexProperty); +const void* grin_get_value_from_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY); /** * @brief get vertex row from table - * @param VertexPropertyTable vertex property table + * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table * @param Vertex the vertex which is the row index - * @param VertexPropertyList the vertex property list as columns + * @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns */ -Row get_row_from_vertex_property_table(VertexPropertyTable, Vertex, VertexPropertyList); +GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); -#ifndef COLUMN_STORE_TRAIT +#ifndef GRIN_COLUMN_STORE_TRAIT /** * @brief get vertex row directly from the graph, this API only works for row store system - * @param Graph the graph + * @param GRIN_GRAPH the graph * @param Vertex the vertex which is the row index - * @param VertexPropertyList the vertex property list as columns + * @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns */ -Row get_vertex_row(Graph, Vertex, VertexPropertyList); +GRIN_ROW grin_get_vertex_row(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); #endif #endif -#ifdef WITH_EDGE_PROPERTY +#ifdef GRIN_WITH_EDGE_PROPERTY /** * @brief destroy edge property table - * @param EdgePropertyTable edge property table + * @param GRIN_EDGE_PROPERTY_TABLE edge property table */ -void destroy_edge_property_table(EdgePropertyTable); +void grin_destroy_edge_property_table(GRIN_EDGE_PROPERTY_TABLE); /** * @brief get the edge property table of a certain edge type * No matter column or row store strategy is used in the storage, * GRIN recommends to first get the property table of the edge type, * and then fetch values(rows) by edge and property(list). However, - * GRIN does provide direct row fetching API when COLUMN_STORE_TRAIT + * GRIN does provide direct row fetching API when GRIN_COLUMN_STORE_TRAIT * is NOT set. - * @param Graph the graph - * @param EdgeType the edge type + * @param GRIN_GRAPH the graph + * @param GRIN_EDGE_TYPE the edge type */ -EdgePropertyTable get_edge_property_table_by_type(Graph, EdgeType); +GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH, GRIN_EDGE_TYPE); /** * @brief get edge property value from table - * @param EdgePropertyTable edge property table - * @param Edge the edge which is the row index - * @param EdgeProperty the edge property which is the column index + * @param GRIN_EDGE_PROPERTY_TABLE edge property table + * @param GRIN_EDGE the edge which is the row index + * @param GRIN_EDGE_PROPERTY the edge property which is the column index * @return can be casted to the property data type by the caller */ -const void* get_value_from_edge_property_table(EdgePropertyTable, Edge, EdgeProperty); +const void* grin_get_value_from_edge_property_table(GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY); /** * @brief get edge row from table - * @param EdgePropertyTable edge property table - * @param Edge the edge which is the row index - * @param EdgePropertyList the edge property list as columns + * @param GRIN_EDGE_PROPERTY_TABLE edge property table + * @param GRIN_EDGE the edge which is the row index + * @param GRIN_EDGE_PROPERTY_LIST the edge property list as columns */ -Row get_row_from_edge_property_table(EdgePropertyTable, Edge, EdgePropertyList); +GRIN_ROW grin_get_row_from_edge_property_table(GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY_LIST); -#ifndef COLUMN_STORE_TRAIT +#ifndef GRIN_COLUMN_STORE_TRAIT /** * @brief get edge row directly from the graph, this API only works for row store system - * @param Graph the graph - * @param Edge the edge which is the row index - * @param EdgePropertyList the edge property list as columns + * @param GRIN_GRAPH the graph + * @param GRIN_EDGE the edge which is the row index + * @param GRIN_EDGE_PROPERTY_LIST the edge property list as columns */ -Row get_edge_row(Graph, Edge, EdgePropertyList); +GRIN_ROW grin_get_edge_row(GRIN_GRAPH, GRIN_EDGE, GRIN_EDGE_PROPERTY_LIST); #endif #endif diff --git a/modules/graph/grin/include/property/type.h b/modules/graph/grin/include/property/type.h index 597d93867..b874261c6 100644 --- a/modules/graph/grin/include/property/type.h +++ b/modules/graph/grin/include/property/type.h @@ -20,66 +20,66 @@ limitations under the License. #include "../predefine.h" -#ifdef WITH_VERTEX_PROPERTY +#ifdef GRIN_WITH_VERTEX_PROPERTY // Vertex type -bool equal_vertex_type(VertexType, VertexType); +bool grin_equal_vertex_type(GRIN_VERTEX_TYPE, GRIN_VERTEX_TYPE); -VertexType get_vertex_type(Graph, Vertex); +GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH, GRIN_VERTEX); -const char* get_vertex_type_name(Graph, VertexType); +const char* grin_get_vertex_type_name(GRIN_GRAPH, GRIN_VERTEX_TYPE); -VertexType get_vertex_type_by_name(Graph, const char*); +GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH, const char*); // Vertex type list -VertexTypeList get_vertex_type_list(Graph); +GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH); -void destroy_vertex_type_list(VertexTypeList); +void grin_destroy_vertex_type_list(GRIN_VERTEX_TYPE_LIST); -VertexTypeList create_vertex_type_list(); +GRIN_VERTEX_TYPE_LIST grin_create_vertex_type_list(); -bool insert_vertex_type_to_list(VertexTypeList, VertexType); +bool grin_insert_vertex_type_to_list(GRIN_VERTEX_TYPE_LIST, GRIN_VERTEX_TYPE); -size_t get_vertex_type_list_size(VertexTypeList); +size_t grin_get_vertex_type_list_size(GRIN_VERTEX_TYPE_LIST); -VertexType get_vertex_type_from_list(VertexTypeList, size_t); +GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_VERTEX_TYPE_LIST, size_t); #endif -#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT -VertexTypeID get_vertex_type_id(VertexType); +#ifdef GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT +GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_VERTEX_TYPE); -VertexType get_vertex_type_from_id(VertexTypeID); +GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_VERTEX_TYPE_ID); #endif -#ifdef WITH_EDGE_PROPERTY -// Edge type -bool equal_edge_type(EdgeType, EdgeType); +#ifdef GRIN_WITH_EDGE_PROPERTY +// GRIN_EDGE type +bool grin_equal_edge_type(GRIN_EDGE_TYPE, GRIN_EDGE_TYPE); -EdgeType get_edge_type(Graph, Edge); +GRIN_EDGE_TYPE grin_get_edge_type(GRIN_GRAPH, GRIN_EDGE); -const char* get_edge_type_name(Graph, EdgeType); +const char* grin_get_edge_type_name(GRIN_GRAPH, GRIN_EDGE_TYPE); -EdgeType get_edge_type_by_name(Graph, const char*); +GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH, const char*); -// Edge type list -EdgeTypeList get_edge_type_list(Graph); +// GRIN_EDGE type list +GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH); -void destroy_edge_type_list(EdgeTypeList); +void grin_destroy_edge_type_list(GRIN_EDGE_TYPE_LIST); -EdgeTypeList create_edge_type_list(); +GRIN_EDGE_TYPE_LIST grin_create_edge_type_list(); -bool insert_edge_type_to_list(EdgeTypeList, EdgeType); +bool grin_insert_edge_type_to_list(GRIN_EDGE_TYPE_LIST, GRIN_EDGE_TYPE); -size_t get_edge_type_list_size(EdgeTypeList); +size_t grin_get_edge_type_list_size(GRIN_EDGE_TYPE_LIST); -EdgeType get_edge_type_from_list(EdgeTypeList, size_t); +GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_EDGE_TYPE_LIST, size_t); #endif -#ifdef NATURAL_EDGE_TYPE_ID_TRAIT -EdgeTypeID get_edge_type_id(EdgeType); +#ifdef GRIN_NATURAL_EDGE_TYPE_ID_TRAIT +GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_EDGE_TYPE); -EdgeType get_edge_type_from_id(EdgeTypeID); +GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_EDGE_TYPE_ID); #endif /** @name VertexEdgeTypeRelation @@ -88,15 +88,15 @@ EdgeType get_edge_type_from_id(EdgeTypeID); * lists of the same size, and the src/dst vertex types are aligned with their positions in the lists. */ ///@{ -#if defined(WITH_VERTEX_PROPERTY) && defined(WITH_EDGE_PROPERTY) +#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_WITH_EDGE_PROPERTY) /** @brief the src vertex type list */ -VertexTypeList get_src_types_from_edge_type(Graph, EdgeType); +GRIN_VERTEX_TYPE_LIST grin_get_src_types_from_edge_type(GRIN_GRAPH, GRIN_EDGE_TYPE); /** @brief get the dst vertex type list */ -VertexTypeList get_dst_types_from_edge_type(Graph, EdgeType); +GRIN_VERTEX_TYPE_LIST grin_get_dst_types_from_edge_type(GRIN_GRAPH, GRIN_EDGE_TYPE); /** @brief get the edge type list related to a given pair of vertex types */ -EdgeTypeList get_edge_types_from_vertex_type_pair(Graph, VertexType, VertexType); +GRIN_EDGE_TYPE_LIST grin_get_edge_types_from_vertex_type_pair(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_TYPE); #endif ///@} diff --git a/modules/graph/grin/include/topology/adjacentlist.h b/modules/graph/grin/include/topology/adjacentlist.h index f81b30566..ef35021ce 100644 --- a/modules/graph/grin/include/topology/adjacentlist.h +++ b/modules/graph/grin/include/topology/adjacentlist.h @@ -18,31 +18,31 @@ limitations under the License. #include "../predefine.h" -#ifdef ENABLE_ADJACENT_LIST -AdjacentList get_adjacent_list(Graph, Direction, Vertex); +#ifdef GRIN_ENABLE_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); -#ifdef WITH_EDGE_PROPERTY -AdjacentList get_adjacent_list_by_edge_type(Graph, Direction, Vertex, EdgeType); +#ifdef GRIN_WITH_EDGE_PROPERTY +GRIN_ADJACENT_LIST grin_get_adjacent_list_by_edge_type(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX, GRIN_EDGE_TYPE); #endif -void destroy_adjacent_list(AdjacentList); +void grin_destroy_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); -size_t get_adjacent_list_size(AdjacentList); +size_t grin_get_adjacent_list_size(GRIN_GRAPH, GRIN_ADJACENT_LIST); -Vertex get_neighbor_from_adjacent_list(AdjacentList, size_t); +GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST, size_t); -Edge get_edge_from_adjacent_list(AdjacentList, size_t); +GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST, size_t); -#ifdef ENABLE_ADJACENT_LIST_ITERATOR -AdjacentListIterator get_adjacent_list_begin(Graph); +#ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR +GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH); -AdjacentListIterator get_next_adjacent_list_iter(AdjacentListIterator); +GRIN_ADJACENT_LIST_ITERATOR grin_get_next_adjacent_list_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); -bool is_adjacent_list_end(AdjacentListIterator); +bool grin_is_adjacent_list_end(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); -Vertex get_neighbor_from_iter(AdjacentListIterator); +Vertex grin_get_neighbor_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); -Edge get_edge_from_iter(AdjacentListIterator); +GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); #endif #endif diff --git a/modules/graph/grin/include/topology/edgelist.h b/modules/graph/grin/include/topology/edgelist.h index e92fa6175..7fd5980aa 100644 --- a/modules/graph/grin/include/topology/edgelist.h +++ b/modules/graph/grin/include/topology/edgelist.h @@ -18,36 +18,36 @@ limitations under the License. #include "../predefine.h" -#ifdef ENABLE_EDGE_LIST +#ifdef GRIN_ENABLE_EDGE_LIST -EdgeList get_edge_list(Graph, Direction); +GRIN_EDGE_LIST grin_get_edge_list(GRIN_GRAPH, GRIN_DIRECTION); -#ifdef WITH_EDGE_PROPERTY -EdgeList get_edge_list_by_type(Graph, EdgeType); +#ifdef GRIN_WITH_EDGE_PROPERTY +GRIN_EDGE_LIST grin_get_edge_list_by_type(GRIN_GRAPH, EdgeType); #endif -void destroy_edge_list(EdgeList); +void grin_destroy_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); -EdgeList create_edge_list(); +GRIN_EDGE_LIST grin_create_edge_list(GRIN_GRAPH); -bool insert_edge_to_list(EdgeList, Edge); +bool grin_insert_edge_to_list(GRIN_GRAPH, GRIN_EDGE_LIST, GRIN_EDGE); -size_t get_edge_list_size(EdgeList); +size_t grin_get_edge_list_size(GRIN_GRAPH, GRIN_EDGE_LIST); -Edge get_edge_from_list(EdgeList, size_t); +GRIN_EDGE grin_get_edge_from_list(GRIN_GRAPH, GRIN_EDGE_LIST, size_t); -#ifdef ENABLE_EDGE_LIST_ITERATOR -EdgeListIterator get_edge_list_begin(Graph); +#ifdef GRIN_ENABLE_EDGE_LIST_ITERATOR +GRIN_EDGE_LIST_ITERATOR grin_get_edge_list_begin(GRIN_GRAPH); -#ifdef WITH_EDGE_PROPERTY -EdgeListIterator get_edge_list_begin_by_type(Graph, EdgeType); +#ifdef GRIN_WITH_EDGE_PROPERTY +GRIN_EDGE_LIST_ITERATOR grin_get_edge_list_begin_by_type(GRIN_GRAPH, EdgeType); #endif -EdgeListIterator get_next_edge_list_iter(EdgeListIterator); +GRIN_EDGE_LIST_ITERATOR grin_get_next_edge_list_iter(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); -bool is_edge_list_end(EdgeListIterator); +bool grin_is_edge_list_end(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); -Edge get_edge_from_iter(EdgeListIterator); +GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); #endif #endif diff --git a/modules/graph/grin/include/topology/structure.h b/modules/graph/grin/include/topology/structure.h index 0b18cecdf..34199f0c5 100644 --- a/modules/graph/grin/include/topology/structure.h +++ b/modules/graph/grin/include/topology/structure.h @@ -19,62 +19,62 @@ limitations under the License. #include "../predefine.h" // Graph -bool is_directed(Graph); +bool grin_is_directed(GRIN_GRAPH); -bool is_multigraph(Graph); +bool grin_is_multigraph(GRIN_GRAPH); -size_t get_vertex_num(Graph); +size_t grin_get_vertex_num(GRIN_GRAPH); -#ifdef WITH_VERTEX_PROPERTY -size_t get_vertex_num_by_type(Graph, VertexType); +#ifdef GRIN_WITH_VERTEX_PROPERTY +size_t grin_get_vertex_num_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); #endif -size_t get_edge_num(Graph, Direction d); +size_t grin_get_edge_num(GRIN_GRAPH, GRIN_DIRECTION); -#ifdef WITH_EDGE_PROPERTY -size_t get_edge_num_by_type(Graph, Direction d, EdgeType); +#ifdef GRIN_WITH_EDGE_PROPERTY +size_t grin_get_edge_num_by_type(GRIN_GRAPH, GRIN_DIRECTION, GRIN_EDGE_TYPE); #endif // Vertex -void destroy_vertex(Vertex); +void grin_destroy_vertex(GRIN_GRAPH, GRIN_VERTEX); -#ifdef WITH_VERTEX_DATA -DataType get_vertex_data_type(Graph, Vertex); +#ifdef GRIN_WITH_VERTEX_DATA +GRIN_DATATYPE grin_get_vertex_data_type(GRIN_GRAPH, Vertex); -VertexData get_vertex_data_value(Graph, Vertex); +GRIN_VERTEX_DATA grin_get_vertex_data_value(GRIN_GRAPH, Vertex); -void destroy_vertex_data(VertexData); +void grin_destroy_vertex_data(GRIN_GRAPH, GRIN_VERTEX_DATA); #endif -#ifdef WITH_VERTEX_ORIGINAL_ID -Vertex get_vertex_from_original_id(Graph, OriginalID); +#ifdef GRIN_WITH_VERTEX_ORIGINAL_ID +GRIN_VERTEX grin_get_vertex_from_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); -DataType get_vertex_original_id_type(Graph); +GRIN_DATATYPE grin_get_vertex_original_id_type(GRIN_GRAPH); -OriginalID get_vertex_original_id(Graph, Vertex); +GRIN_VERTEX_ORIGINAL_ID grin_get_vertex_original_id(GRIN_GRAPH, GRIN_VERTEX); -void destroy_vertex_original_id(OriginalID); +void grin_destroy_vertex_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); #endif -#if defined(WITH_VERTEX_ORIGINAL_ID) && defined(WITH_VERTEX_PROPERTY) -Vertex get_vertex_from_original_id_by_type(Graph, VertexType, OriginalID); +#if defined(GRIN_WITH_VERTEX_ORIGINAL_ID) && defined(GRIN_WITH_VERTEX_PROPERTY) +GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_ORIGINAL_ID); #endif -// Edge -void destroy_edge(Edge); +// GRIN_EDGE +void grin_destroy_edge(GRIN_GRAPH, GRIN_EDGE); -Vertex get_edge_src(Graph, Edge); +GRIN_VERTEX grin_get_edge_src(GRIN_GRAPH, GRIN_EDGE); -Vertex get_edge_dst(Graph, Edge); +GRIN_VERTEX grin_get_edge_dst(GRIN_GRAPH, GRIN_EDGE); -#ifdef WITH_EDGE_DATA -DataType get_edge_data_type(Graph, Edge); +#ifdef GRIN_WITH_EDGE_DATA +GRIN_DATATYPE grin_get_edge_data_type(GRIN_GRAPH, GRIN_EDGE); -EdgeData get_edge_data_value(Graph, Edge); +GRIN_EDGE_DATA grin_get_edge_data_value(GRIN_GRAPH, GRIN_EDGE); -void destroy_edge_data(EdgeData); +void grin_destroy_edge_data(GRIN_GRAPH, GRIN_EDGE_DATA); #endif #endif // GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ diff --git a/modules/graph/grin/include/topology/vertexlist.h b/modules/graph/grin/include/topology/vertexlist.h index 9cf26c4bb..71f78e179 100644 --- a/modules/graph/grin/include/topology/vertexlist.h +++ b/modules/graph/grin/include/topology/vertexlist.h @@ -18,36 +18,36 @@ limitations under the License. #include "../predefine.h" -#ifdef ENABLE_VERTEX_LIST +#ifdef GRIN_ENABLE_VERTEX_LIST -VertexList get_vertex_list(Graph); +GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH); -#ifdef WITH_VERTEX_PROPERTY -VertexList get_vertex_list_by_type(Graph, VertexType); +#ifdef GRIN_WITH_VERTEX_PROPERTY +GRIN_VERTEX_LIST grin_get_vertex_list_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); #endif -void destroy_vertex_list(VertexList); +void grin_destroy_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); -VertexList create_vertex_list(); +GRIN_VERTEX_LIST grin_create_vertex_list(GRIN_GRAPH); -bool insert_vertex_to_list(VertexList, Vertex); +bool grin_insert_vertex_to_list(GRIN_GRAPH, GRIN_VERTEX_LIST, GRIN_VERTEX); -size_t get_vertex_list_size(VertexList); +size_t grin_get_vertex_list_size(GRIN_GRAPH, GRIN_VERTEX_LIST); -Vertex get_vertex_from_list(VertexList, size_t); +GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH, GRIN_VERTEX_LIST, size_t); -#ifdef ENABLE_VERTEX_LIST_ITERATOR -VertexListIterator get_vertex_list_begin(Graph); +#ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR +GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH); -#ifdef WITH_VERTEX_PROPERTY -VertexListIterator get_vertex_list_begin_by_type(Graph, VertexType); +#ifdef GRIN_WITH_VERTEX_PROPERTY +GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); #endif -VertexListIterator get_next_vertex_list_iter(VertexListIterator); +GRIN_VERTEX_LIST_ITERATOR grin_get_next_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); -bool is_vertex_list_end(VertexListIterator); +bool grin_is_vertex_list_end(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); -Vertex get_vertex_from_iter(VertexListIterator); +Vertex grin_get_vertex_from_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); #endif diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index 68de5c53e..a3c6bdab7 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -19,15 +19,15 @@ limitations under the License. #include "client/client.h" -#ifdef ENABLE_GRAPH_PARTITION -size_t get_total_partitions_number(PartitionedGraph pg) { - auto _pg = static_cast(pg); +#ifdef GRIN_ENABLE_GRAPH_PARTITION +size_t grin_get_total_partitions_number(GRIN_PARTITIONED_GRAPH pg) { + auto _pg = static_cast(pg); return _pg->total_frag_num(); } -PartitionList get_local_partition_list(PartitionedGraph pg) { - auto _pg = static_cast(pg); - auto pl = new PartitionList_T(); +GRIN_PARTITION_LIST grin_get_local_partition_list(GRIN_PARTITIONED_GRAPH pg) { + auto _pg = static_cast(pg); + auto pl = new GRIN_PARTITION_LIST_T(); vineyard::Client client; client.Connect(); for (auto & [fid, location] : _pg->FragmentLocations()) { @@ -38,176 +38,176 @@ PartitionList get_local_partition_list(PartitionedGraph pg) { return pl; } -void destroy_partition_list(PartitionList pl) { - auto _pl = static_cast(pl); +void grin_destroy_partition_list(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_LIST pl) { + auto _pl = static_cast(pl); delete _pl; } -PartitionList create_partition_list() { - auto pl = new PartitionList_T(); +GRIN_PARTITION_LIST grin_create_partition_list(GRIN_PARTITIONED_GRAPH pg) { + auto pl = new GRIN_PARTITION_LIST_T(); return pl; } -bool insert_partition_to_list(PartitionList pl, Partition p) { - auto _pl = static_cast(pl); - auto _p = static_cast(p); +bool grin_insert_partition_to_list(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_LIST pl, GRIN_PARTITION p) { + auto _pl = static_cast(pl); + auto _p = static_cast(p); _pl->push_back(*_p); return true; } -size_t get_partition_list_size(PartitionList pl) { - auto _pl = static_cast(pl); +size_t grin_get_partition_list_size(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_LIST pl) { + auto _pl = static_cast(pl); return _pl->size(); } -Partition get_partition_from_list(PartitionList pl, size_t idx) { - auto _pl = static_cast(pl); - auto p = new Partition_T((*_pl)[idx]); +GRIN_PARTITION grin_get_partition_from_list(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_LIST pl, size_t idx) { + auto _pl = static_cast(pl); + auto p = new GRIN_PARTITION_T((*_pl)[idx]); return p; } -bool equal_partition(Partition p1, Partition p2) { - auto _p1 = static_cast(p1); - auto _p2 = static_cast(p2); +bool grin_equal_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p1, GRIN_PARTITION p2) { + auto _p1 = static_cast(p1); + auto _p2 = static_cast(p2); return (*_p1 == *_p2); } -void destroy_partition(Partition p) { - auto _p = static_cast(p); +void grin_destroy_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { + auto _p = static_cast(p); delete _p; } -void* get_partition_info(PartitionedGraph pg, Partition p) { +void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { return NULL; } -Graph get_local_graph_from_partition(PartitionedGraph pg, Partition p) { - auto _pg = static_cast(pg); - auto _p = static_cast(p); +GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { + auto _pg = static_cast(pg); + auto _p = static_cast(p); vineyard::Client client; client.Connect(); return get_graph_by_object_id(client, _pg->Fragments().at(*_p)); } #endif -#ifdef NATURAL_PARTITION_ID_TRAIT -Partition get_partition_from_id(PartitionID pid) { - auto p = new Partition_T(pid); +#ifdef GRIN_NATURAL_PARTITION_ID_TRAIT +GRIN_PARTITION grin_get_partition_from_id(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_ID pid) { + auto p = new GRIN_PARTITION_T(pid); return p; } -PartitionID get_partition_id(Partition p) { - auto _p = static_cast(p); +GRIN_PARTITION_ID grin_get_partition_id(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { + auto _p = static_cast(p); return *_p; } #endif -#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_VERTEX_LIST) -VertexList get_master_vertices(Graph g) { - auto _g = static_cast(g); - auto _vl = new VertexList_T(); +#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_ENABLE_VERTEX_LIST) +GRIN_VERTEX_LIST grin_get_master_vertices(GRIN_GRAPH g) { + auto _g = static_cast(g); + auto _vl = new GRIN_VERTEX_LIST_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { _vl->push_back(_g->InnerVertices(vtype)); } return _vl; } -VertexList get_mirror_vertices(Graph g) { - auto _g = static_cast(g); - auto _vl = new VertexList_T(); +GRIN_VERTEX_LIST grin_get_mirror_vertices(GRIN_GRAPH g) { + auto _g = static_cast(g); + auto _vl = new GRIN_VERTEX_LIST_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { _vl->push_back(_g->OuterVertices(vtype)); } return _vl; } -VertexList get_mirror_vertices_by_partition(Graph g, Partition p) { - return NULL_LIST; +GRIN_VERTEX_LIST grin_get_mirror_vertices_by_partition(GRIN_GRAPH g, GRIN_PARTITION p) { + return GRIN_NULL_LIST; } -#ifdef WITH_VERTEX_PROPERTY -VertexList get_master_vertices_by_type(Graph g, VertexType vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto _vl = new VertexList_T(); +#ifdef GRIN_WITH_VERTEX_PROPERTY +GRIN_VERTEX_LIST grin_get_master_vertices_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto _vl = new GRIN_VERTEX_LIST_T(); _vl->push_back(_g->InnerVertices(*_vtype)); return _vl; } -VertexList get_mirror_vertices_by_type(Graph g, VertexType vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto _vl = new VertexList_T(); +GRIN_VERTEX_LIST grin_get_mirror_vertices_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto _vl = new GRIN_VERTEX_LIST_T(); _vl->push_back(_g->OuterVertices(*_vtype)); return _vl; } -VertexList get_mirror_vertices_by_type_partition(Graph g, VertexType vtype, - Partition p) { - return NULL_LIST; +GRIN_VERTEX_LIST grin_get_mirror_vertices_by_type_partition(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, + GRIN_PARTITION p) { + return GRIN_NULL_LIST; } #endif #endif -#if defined(ENABLE_GRAPH_PARTITION) && defined(ENABLE_ADJACENT_LIST) -AdjacentList get_adjacent_master_list(Graph g, Direction d, Vertex v) { - return NULL_LIST; +#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_ENABLE_ADJACENT_LIST) +GRIN_ADJACENT_LIST grin_get_adjacent_master_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_VERTEX v) { + return GRIN_NULL_LIST; } -AdjacentList get_adjacent_mirror_list(Graph g, Direction d, Vertex v) { - return NULL_LIST; +GRIN_ADJACENT_LIST grin_get_adjacent_mirror_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_VERTEX v) { + return GRIN_NULL_LIST; } -AdjacentList get_adjacent_mirror_list_by_partition(Graph g, Direction d, - Partition p, Vertex v) { - return NULL_LIST; +GRIN_ADJACENT_LIST grin_get_adjacent_mirror_list_by_partition(GRIN_GRAPH g, GRIN_DIRECTION d, + GRIN_PARTITION p, GRIN_VERTEX v) { + return GRIN_NULL_LIST; } #endif -#ifdef ENABLE_VERTEX_REF -VertexRef get_vertex_ref_for_vertex(Graph g, Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); +#ifdef GRIN_ENABLE_VERTEX_REF +GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); auto gid = _g->Vertex2Gid(*_v); - auto vr = new VertexRef_T(gid); + auto vr = new GRIN_VERTEX_REF_T(gid); return vr; } -Vertex get_vertex_from_vertex_ref(Graph g, VertexRef vr) { - auto _g = static_cast(g); - auto _vr = static_cast(vr); - auto v = new Vertex_T(); +GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { + auto _g = static_cast(g); + auto _vr = static_cast(vr); + auto v = new GRIN_VERTEX_T(); if (_g->Gid2Vertex(*_vr, *v)) { return v; } - return NULL_VERTEX; + return GRIN_NULL_VERTEX; } -bool is_master_vertex(Graph g, Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); +bool grin_is_master_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); return _g->IsInnerVertex(*_v); } -bool is_mirror_vertex(Graph g, Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); +bool grin_is_mirror_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); return _g->IsOuterVertex(*_v); } -Partition get_master_partition_from_vertex_ref(Graph g, VertexRef vr) { - auto _g = static_cast(g); - auto _vr = static_cast(vr); - auto id_parser = vineyard::IdParser(); +GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { + auto _g = static_cast(g); + auto _vr = static_cast(vr); + auto id_parser = vineyard::IdParser(); id_parser.Init(_g->fnum(), _g->vertex_label_num()); - auto p = new Partition_T(id_parser.GetFid(*_vr)); + auto p = new GRIN_PARTITION_T(id_parser.GetFid(*_vr)); return p; } -const char* serialize_vertex_ref(Graph g, VertexRef vr) { - auto _vr = static_cast(vr); +const char* grin_serialize_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { + auto _vr = static_cast(vr); std::stringstream ss; ss << *_vr; int len = ss.str().length() + 1; @@ -216,48 +216,48 @@ const char* serialize_vertex_ref(Graph g, VertexRef vr) { return out; } -VertexRef deserialize_to_vertex_ref(Graph g, const char* msg) { +GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH g, const char* msg) { std::stringstream ss(msg); - VertexRef_T gid; + GRIN_VERTEX_REF_T gid; ss >> gid; - auto vr = new VertexRef_T(gid); + auto vr = new GRIN_VERTEX_REF_T(gid); return vr; } #endif -#ifdef ENABLE_GRAPH_PARTITION -bool is_vertex_neighbor_local_complete(Graph g, Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); +#ifdef GRIN_ENABLE_GRAPH_PARTITION +bool grin_is_vertex_neighbor_local_complete(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); return _g->IsInnerVertex(*_v); } -PartitionList vertex_neighbor_complete_partitions(Graph g, Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto pl = new PartitionList_T(); +GRIN_PARTITION_LIST grin_vertex_neighbor_complete_partitions(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto pl = new GRIN_PARTITION_LIST_T(); pl->push_back(_g->GetFragId(*_v)); return pl; } #endif -#ifdef WITH_VERTEX_PROPERTY -bool is_vertex_property_local_complete(Graph g, Vertex v) { - return is_vertex_neighbor_local_complete(g, v); +#ifdef GRIN_WITH_VERTEX_PROPERTY +bool grin_is_vertex_property_local_complete(GRIN_GRAPH g, GRIN_VERTEX v) { + return grin_is_vertex_neighbor_local_complete(g, v); } -PartitionList vertex_property_complete_partitions(Graph g, Vertex v) { - return vertex_neighbor_complete_partitions(g, v); +GRIN_PARTITION_LIST grin_vertex_property_complete_partitions(GRIN_GRAPH g, GRIN_VERTEX v) { + return grin_vertex_neighbor_complete_partitions(g, v); } #endif -#ifdef WITH_EDGE_PROPERTY -bool is_edge_property_local_complete(Graph g, Edge e) { +#ifdef GRIN_WITH_EDGE_PROPERTY +bool grin_is_edge_property_local_complete(GRIN_GRAPH g, GRIN_EDGE e) { return true; } -PartitionList edge_property_complete_partitions(Graph g, Edge e) { - return NULL_LIST; +GRIN_PARTITION_LIST edge_property_complete_partitions(GRIN_GRAPH g, GRIN_EDGE e) { + return GRIN_NULL_LIST; } #endif diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 77fcdf481..de40c54b8 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -16,60 +16,60 @@ limitations under the License. #include "graph/grin/src/predefine.h" -PartitionedGraph get_partitioned_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { +GRIN_PARTITIONED_GRAPH get_partitioned_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { auto pg = std::dynamic_pointer_cast(client.GetObject(object_id)); return pg.get(); } -Graph get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { - auto frag = std::dynamic_pointer_cast>(client.GetObject(object_id)); +GRIN_GRAPH get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { + auto frag = std::dynamic_pointer_cast>(client.GetObject(object_id)); return frag.get(); } -std::string GetDataTypeName(DataType type) { +std::string GetDataTypeName(GRIN_DATATYPE type) { switch (type) { - case DataType::Int32: + case GRIN_DATATYPE::Int32: return "int32"; - case DataType::UInt32: + case GRIN_DATATYPE::UInt32: return "uint32"; - case DataType::Int64: + case GRIN_DATATYPE::Int64: return "int64"; - case DataType::UInt64: + case GRIN_DATATYPE::UInt64: return "uint64"; - case DataType::Float: + case GRIN_DATATYPE::Float: return "float"; - case DataType::Double: + case GRIN_DATATYPE::Double: return "double"; - case DataType::String: + case GRIN_DATATYPE::String: return "string"; - case DataType::Date32: + case GRIN_DATATYPE::Date32: return "date32"; - case DataType::Date64: + case GRIN_DATATYPE::Date64: return "date64"; default: return "undefined"; } } -DataType ArrowToDataType(std::shared_ptr type) { +GRIN_DATATYPE ArrowToDataType(std::shared_ptr type) { if (type == nullptr) { - return DataType::Undefined; + return GRIN_DATATYPE::Undefined; } else if (arrow::int32()->Equals(type)) { - return DataType::Int32; + return GRIN_DATATYPE::Int32; } else if (arrow::int64()->Equals(type)) { - return DataType::Int64; + return GRIN_DATATYPE::Int64; } else if (arrow::float32()->Equals(type)) { - return DataType::Float; + return GRIN_DATATYPE::Float; } else if (arrow::uint32()->Equals(type)) { - return DataType::UInt32; + return GRIN_DATATYPE::UInt32; } else if (arrow::uint64()->Equals(type)) { - return DataType::UInt64; + return GRIN_DATATYPE::UInt64; } else if (arrow::float64()->Equals(type)) { - return DataType::Double; + return GRIN_DATATYPE::Double; } else if (arrow::utf8()->Equals(type)) { - return DataType::String; + return GRIN_DATATYPE::String; } else if (arrow::large_utf8()->Equals(type)) { - return DataType::String; + return GRIN_DATATYPE::String; } - return DataType::Undefined; + return GRIN_DATATYPE::Undefined; } diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 5c1b87dd3..5180bd931 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -25,127 +25,127 @@ limitations under the License. #include "arrow/api.h" template -struct DataTypeEnum { - static constexpr DataType value = DataType::Undefined; +struct GRIN_DATATYPE_ENUM { + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Undefined; }; template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Int32; +struct GRIN_DATATYPE_ENUM { + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Int32; }; template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::UInt32; +struct GRIN_DATATYPE_ENUM { + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::UInt32; }; template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Int64; +struct GRIN_DATATYPE_ENUM { + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Int64; }; template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::UInt64; +struct GRIN_DATATYPE_ENUM { + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::UInt64; }; template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Float; +struct GRIN_DATATYPE_ENUM { + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Float; }; template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Double; +struct GRIN_DATATYPE_ENUM { + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Double; }; template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::String; +struct GRIN_DATATYPE_ENUM { + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::String; }; template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Date32; +struct GRIN_DATATYPE_ENUM { + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Date32; }; template <> -struct DataTypeEnum { - static constexpr DataType value = DataType::Date64; +struct GRIN_DATATYPE_ENUM { + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Date64; }; -PartitionedGraph get_partitioned_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id); -Graph get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id); -std::string GetDataTypeName(DataType); -DataType ArrowToDataType(std::shared_ptr); +GRIN_PARTITIONED_GRAPH get_partitioned_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id); +GRIN_GRAPH get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id); +std::string GetDataTypeName(GRIN_DATATYPE); +GRIN_DATATYPE ArrowToDataType(std::shared_ptr); -#define G_OID_T int64_t -#define G_VID_T uint64_t +#define GRIN_OID_T int64_t +#define GRIN_VID_T uint64_t /* The following data types shall be defined through typedef. */ -typedef vineyard::ArrowFragment Graph_T; -typedef Graph_T::vertex_t Vertex_T; -struct Edge_T { - Vertex src; - Vertex dst; - Direction dir; +typedef vineyard::ArrowFragment GRIN_GRAPH_T; +typedef GRIN_GRAPH_T::vertex_t GRIN_VERTEX_T; +struct GRIN_EDGE_T { + GRIN_VERTEX src; + GRIN_VERTEX dst; + GRIN_DIRECTION dir; unsigned etype; - Graph_T::eid_t eid; + GRIN_GRAPH_T::eid_t eid; }; -#ifdef WITH_VERTEX_ORIGINAL_ID -typedef Graph_T::oid_t OriginalID_T; +#ifdef GRIN_WITH_VERTEX_ORIGINAL_ID +typedef GRIN_GRAPH_T::oid_t VERTEX_ORIGINAL_ID_T; #endif -#ifdef ENABLE_VERTEX_LIST -typedef std::vector VertexList_T; +#ifdef GRIN_ENABLE_VERTEX_LIST +typedef std::vector GRIN_VERTEX_LIST_T; #endif -#ifdef ENABLE_ADJACENT_LIST -struct AdjacentList_T { - Vertex v; - Direction dir; +#ifdef GRIN_ENABLE_ADJACENT_LIST +struct GRIN_ADJACENT_LIST_T { + GRIN_VERTEX v; + GRIN_DIRECTION dir; unsigned etype; - std::vector data; + std::vector data; }; #endif -#ifdef ENABLE_GRAPH_PARTITION -typedef vineyard::ArrowFragmentGroup PartitionedGraph_T; -typedef unsigned Partition_T; -typedef std::vector PartitionList_T; +#ifdef GRIN_ENABLE_GRAPH_PARTITION +typedef vineyard::ArrowFragmentGroup GRIN_PARTITIONED_GRAPH_T; +typedef unsigned GRIN_PARTITION_T; +typedef std::vector GRIN_PARTITION_LIST_T; #endif -#ifdef ENABLE_VERTEX_REF -typedef Graph_T::vid_t VertexRef_T; +#ifdef GRIN_ENABLE_VERTEX_REF +typedef GRIN_GRAPH_T::vid_t GRIN_VERTEX_REF_T; #endif -#ifdef WITH_VERTEX_PROPERTY -typedef unsigned VertexType_T; -typedef std::vector VertexTypeList_T; -typedef std::pair VertexProperty_T; -typedef std::vector VertexPropertyList_T; -struct VertexPropertyTable_T { - Graph_T* g; +#ifdef GRIN_WITH_VERTEX_PROPERTY +typedef unsigned GRIN_VERTEX_TYPE_T; +typedef std::vector GRIN_VERTEX_TYPE_LIST_T; +typedef std::pair GRIN_VERTEX_PROPERTY_T; +typedef std::vector GRIN_VERTEX_PROPERTY_LIST_T; +struct GRIN_VERTEX_PROPERTY_TABLE_T { + GRIN_GRAPH_T* g; unsigned vtype; - Graph_T::vertices_t vertices; + GRIN_GRAPH_T::vertices_t vertices; }; #endif -#ifdef WITH_EDGE_PROPERTY -typedef unsigned EdgeType_T; -typedef std::vector EdgeTypeList_T; -typedef std::pair EdgeProperty_T; -typedef std::vector EdgePropertyList_T; -struct EdgePropertyTable_T { - Graph_T* g; +#ifdef GRIN_WITH_EDGE_PROPERTY +typedef unsigned GRIN_EDGE_TYPE_T; +typedef std::vector GRIN_EDGE_TYPE_LIST_T; +typedef std::pair GRIN_EDGE_PROPERTY_T; +typedef std::vector GRIN_EDGE_PROPERTY_LIST_T; +struct GRIN_EDGE_PROPERTY_TABLE_T { + GRIN_GRAPH_T* g; unsigned etype; unsigned num; }; #endif -#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) -typedef std::vector Row_T; +#if defined(GRIN_WITH_VERTEX_PROPERTY) || defined(GRIN_WITH_EDGE_PROPERTY) +typedef std::vector GRIN_ROW_T; #endif #endif // GRIN_SRC_PREDEFINE_H_ diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 47f58f516..f749a7354 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -12,10 +12,10 @@ limitations under the License. #include "graph/grin/src/predefine.h" -#if defined(WITH_PROPERTY_NAME) && defined(WITH_VERTEX_PROPERTY) -const char* get_vertex_property_name(Graph g, VertexProperty vp) { - auto _g = static_cast(g); - auto _vp = static_cast(vp); +#if defined(GRIN_WITH_PROPERTY_NAME) && defined(GRIN_WITH_VERTEX_PROPERTY) +const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g); + auto _vp = static_cast(vp); auto s = _g->schema().GetVertexPropertyName(_vp->first, _vp->second); int len = s.length() + 1; char* out = new char[len]; @@ -23,30 +23,30 @@ const char* get_vertex_property_name(Graph g, VertexProperty vp) { return out; } -VertexProperty get_vertex_property_by_name(Graph g, VertexType vtype, +GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, const char* name) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); auto s = std::string(name); - auto vp = new VertexProperty_T(*_vtype, _g->schema().GetVertexPropertyId(*_vtype, s)); + auto vp = new GRIN_VERTEX_PROPERTY_T(*_vtype, _g->schema().GetVertexPropertyId(*_vtype, s)); return vp; } -VertexPropertyList get_vertex_properties_by_name(Graph g, const char* name) { - auto _g = static_cast(g); +GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const char* name) { + auto _g = static_cast(g); auto s = std::string(name); - auto vpl = new VertexPropertyList_T(); + auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - vpl->push_back(VertexProperty_T(vtype, _g->schema().GetVertexPropertyId(vtype, s))); + vpl->push_back(GRIN_VERTEX_PROPERTY_T(vtype, _g->schema().GetVertexPropertyId(vtype, s))); } return vpl; } #endif -#if defined(WITH_PROPERTY_NAME) && defined(WITH_EDGE_PROPERTY) -const char* get_edge_property_name(Graph g, EdgeProperty ep) { - auto _g = static_cast(g); - auto _ep = static_cast(ep); +#if defined(GRIN_WITH_PROPERTY_NAME) && defined(GRIN_WITH_EDGE_PROPERTY) +const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g); + auto _ep = static_cast(ep); auto s = _g->schema().GetEdgePropertyName(_ep->first, _ep->second); int len = s.length() + 1; char* out = new char[len]; @@ -54,76 +54,76 @@ const char* get_edge_property_name(Graph g, EdgeProperty ep) { return out; } -EdgeProperty get_edge_property_by_name(Graph g, EdgeType etype, +GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, const char* name) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); + auto _g = static_cast(g); + auto _etype = static_cast(etype); auto s = std::string(name); - auto ep = new EdgeProperty_T(*_etype, _g->schema().GetEdgePropertyId(*_etype, s)); + auto ep = new GRIN_EDGE_PROPERTY_T(*_etype, _g->schema().GetEdgePropertyId(*_etype, s)); return ep; } -EdgePropertyList get_edge_properties_by_name(Graph g, const char* name) { - auto _g = static_cast(g); +GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH g, const char* name) { + auto _g = static_cast(g); auto s = std::string(name); - auto epl = new EdgePropertyList_T(); + auto epl = new GRIN_EDGE_PROPERTY_LIST_T(); for (auto etype = 0; etype < _g->edge_label_num(); ++etype) { - epl->push_back(EdgeProperty_T(etype, _g->schema().GetVertexPropertyId(etype, s))); + epl->push_back(GRIN_EDGE_PROPERTY_T(etype, _g->schema().GetVertexPropertyId(etype, s))); } return epl; } #endif -#ifdef WITH_VERTEX_PROPERTY -bool equal_vertex_property(VertexProperty vp1, VertexProperty vp2) { - auto _vp1 = static_cast(vp1); - auto _vp2 = static_cast(vp2); +#ifdef GRIN_WITH_VERTEX_PROPERTY +bool grin_equal_vertex_property(GRIN_VERTEX_PROPERTY vp1, GRIN_VERTEX_PROPERTY vp2) { + auto _vp1 = static_cast(vp1); + auto _vp2 = static_cast(vp2); return (*_vp1 == *_vp2); } -void destroy_vertex_property(VertexProperty vp) { - auto _vp = static_cast(vp); +void grin_destroy_vertex_property(GRIN_VERTEX_PROPERTY vp) { + auto _vp = static_cast(vp); delete _vp; } -DataType get_vertex_property_data_type(Graph g, VertexProperty vp) { - auto _g = static_cast(g); - auto _vp = static_cast(vp); +GRIN_DATATYPE grin_get_vertex_property_data_type(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g); + auto _vp = static_cast(vp); auto dt = _g->schema().GetVertexPropertyType(_vp->first, _vp->second); return ArrowToDataType(dt); } -VertexType get_vertex_property_vertex_type(VertexProperty vp) { - auto _vp = static_cast(vp); - auto vt = new VertexType_T(_vp->first); +GRIN_VERTEX_TYPE grin_get_vertex_property_vertex_type(GRIN_VERTEX_PROPERTY vp) { + auto _vp = static_cast(vp); + auto vt = new GRIN_VERTEX_TYPE_T(_vp->first); return vt; } #endif -#ifdef WITH_EDGE_PROPERTY -bool equal_edge_property(EdgeProperty ep1, EdgeProperty ep2) { - auto _ep1 = static_cast(ep1); - auto _ep2 = static_cast(ep2); +#ifdef GRIN_WITH_EDGE_PROPERTY +bool grin_equal_edge_property(GRIN_EDGE_PROPERTY ep1, GRIN_EDGE_PROPERTY ep2) { + auto _ep1 = static_cast(ep1); + auto _ep2 = static_cast(ep2); return (*_ep1 == *_ep2); } -void destroy_edge_property(EdgeProperty ep) { - auto _ep = static_cast(ep); +void grin_destroy_edge_property(GRIN_EDGE_PROPERTY ep) { + auto _ep = static_cast(ep); delete _ep; } -DataType get_edge_property_data_type(Graph g, EdgeProperty ep) { - auto _g = static_cast(g); - auto _ep = static_cast(ep); +GRIN_DATATYPE grin_get_edge_property_data_type(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g); + auto _ep = static_cast(ep); auto dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); return ArrowToDataType(dt); } -EdgeType get_edge_property_edge_type(EdgeProperty ep) { - auto _ep = static_cast(ep); - auto et = new EdgeType_T(_ep->first); +GRIN_EDGE_TYPE grin_get_edge_property_edge_type(GRIN_EDGE_PROPERTY ep) { + auto _ep = static_cast(ep); + auto et = new GRIN_EDGE_TYPE_T(_ep->first); return et; } #endif diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index 9d3776c76..6ef93aa46 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -13,124 +13,124 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/property/propertylist.h" -#ifdef WITH_VERTEX_PROPERTY -VertexPropertyList get_vertex_property_list_by_type(Graph g, VertexType vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto vpl = new VertexPropertyList_T(); +#ifdef GRIN_WITH_VERTEX_PROPERTY +GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_property_list_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); for (auto p = 0; p < _g->vertex_property_num(*_vtype); ++p) { - vpl->push_back(VertexProperty_T(*_vtype, p)); + vpl->push_back(GRIN_VERTEX_PROPERTY_T(*_vtype, p)); } return vpl; } -size_t get_vertex_property_list_size(VertexPropertyList vpl) { - auto _vpl = static_cast(vpl); +size_t grin_get_vertex_property_list_size(GRIN_VERTEX_PROPERTY_LIST vpl) { + auto _vpl = static_cast(vpl); return _vpl->size(); } -VertexProperty get_vertex_property_from_list(VertexPropertyList vpl, size_t idx) { - auto _vpl = static_cast(vpl); - auto vp = new VertexProperty_T((*_vpl)[idx]); +GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_list(GRIN_VERTEX_PROPERTY_LIST vpl, size_t idx) { + auto _vpl = static_cast(vpl); + auto vp = new GRIN_VERTEX_PROPERTY_T((*_vpl)[idx]); return vp; } -VertexPropertyList create_vertex_property_list() { - auto vpl = new VertexPropertyList_T(); +GRIN_VERTEX_PROPERTY_LIST grin_create_vertex_property_list() { + auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); return vpl; } -void destroy_vertex_property_list(VertexPropertyList vpl) { - auto _vpl = static_cast(vpl); +void grin_destroy_vertex_property_list(GRIN_VERTEX_PROPERTY_LIST vpl) { + auto _vpl = static_cast(vpl); delete _vpl; } -bool insert_vertex_property_to_list(VertexPropertyList vpl, VertexProperty vp) { - auto _vpl = static_cast(vpl); - auto _vp = static_cast(vp); +bool grin_insert_vertex_property_to_list(GRIN_VERTEX_PROPERTY_LIST vpl, GRIN_VERTEX_PROPERTY vp) { + auto _vpl = static_cast(vpl); + auto _vp = static_cast(vp); _vpl->push_back(*_vp); return true; } #endif -#ifdef NATURAL_VERTEX_PROPERTY_ID_TRAIT -VertexProperty get_vertex_property_from_id(VertexType vtype, VertexPropertyID vpi) { - auto _vtype = static_cast(vtype); - auto vp = new VertexProperty_T(*_vtype, vpi); +#ifdef GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT +GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY_ID vpi) { + auto _vtype = static_cast(vtype); + auto vp = new GRIN_VERTEX_PROPERTY_T(*_vtype, vpi); return vp; } -VertexPropertyID get_vertex_property_id(VertexType vtype, VertexProperty vp) { - auto _vtype = static_cast(vtype); - auto _vp = static_cast(vp); - if (*_vtype != _vp->first) return NULL_NATURAL_ID; +GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY vp) { + auto _vtype = static_cast(vtype); + auto _vp = static_cast(vp); + if (*_vtype != _vp->first) return GRIN_NULL_NATURAL_ID; return _vp->second; } #endif -#ifdef WITH_EDGE_PROPERTY -EdgePropertyList get_edge_property_list_by_type(Graph g, EdgeType etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); - auto epl = new EdgePropertyList_T(); +#ifdef GRIN_WITH_EDGE_PROPERTY +GRIN_EDGE_PROPERTY_LIST grin_get_edge_property_list_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto epl = new GRIN_EDGE_PROPERTY_LIST_T(); for (auto p = 0; p < _g->edge_property_num(*_etype); ++p) { - epl->push_back(EdgeProperty_T(*_etype, p)); + epl->push_back(GRIN_EDGE_PROPERTY_T(*_etype, p)); } return epl; } -size_t get_edge_property_list_size(EdgePropertyList epl) { - auto _epl = static_cast(epl); +size_t grin_get_edge_property_list_size(GRIN_EDGE_PROPERTY_LIST epl) { + auto _epl = static_cast(epl); return _epl->size(); } -EdgeProperty get_edge_property_from_list(EdgePropertyList epl, size_t idx) { - auto _epl = static_cast(epl); - auto ep = new EdgeProperty_T((*_epl)[idx]); +GRIN_EDGE_PROPERTY grin_get_edge_property_from_list(GRIN_EDGE_PROPERTY_LIST epl, size_t idx) { + auto _epl = static_cast(epl); + auto ep = new GRIN_EDGE_PROPERTY_T((*_epl)[idx]); return ep; } -EdgePropertyList create_edge_property_list() { - auto epl = new EdgePropertyList_T(); +GRIN_EDGE_PROPERTY_LIST grin_create_edge_property_list() { + auto epl = new GRIN_EDGE_PROPERTY_LIST_T(); return epl; } -void destroy_edge_property_list(EdgePropertyList epl) { - auto _epl = static_cast(epl); +void grin_destroy_edge_property_list(GRIN_EDGE_PROPERTY_LIST epl) { + auto _epl = static_cast(epl); delete _epl; } -bool insert_edge_property_to_list(EdgePropertyList epl, EdgeProperty ep) { - auto _epl = static_cast(epl); - auto _ep = static_cast(ep); +bool grin_insert_edge_property_to_list(GRIN_EDGE_PROPERTY_LIST epl, GRIN_EDGE_PROPERTY ep) { + auto _epl = static_cast(epl); + auto _ep = static_cast(ep); _epl->push_back(*_ep); return true; } #endif -#ifdef NATURAL_EDGE_PROPERTY_ID_TRAIT -EdgeProperty get_edge_property_from_id(EdgeType etype, EdgePropertyID epi) { - auto _etype = static_cast(etype); - auto ep = new EdgeProperty_T(*_etype, epi); +#ifdef GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT +GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY_ID epi) { + auto _etype = static_cast(etype); + auto ep = new GRIN_EDGE_PROPERTY_T(*_etype, epi); return ep; } -EdgePropertyID get_edge_property_id(EdgeType etype, EdgeProperty ep) { - auto _etype = static_cast(etype); - auto _ep = static_cast(ep); - if (*_etype != _ep->first) return NULL_NATURAL_ID; +GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY ep) { + auto _etype = static_cast(etype); + auto _ep = static_cast(ep); + if (*_etype != _ep->first) return GRIN_NULL_NATURAL_ID; return _ep->second; } #endif -#if defined(WITH_VERTEX_PROPERTY) && defined(COLUMN_STORE_TRAIT) -Graph select_vertex_properties(Graph g, VertexPropertyList vpl) { - auto _g = static_cast(g); - auto _vpl = static_cast(vpl); +#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_COLUMN_STORE_TRAIT) +GRIN_GRAPH grin_select_vertex_properties(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl) { + auto _g = static_cast(g); + auto _vpl = static_cast(vpl); std::map> vertices, edges; for (auto& p: *_vpl) { int vtype = static_cast(p.first); @@ -147,10 +147,10 @@ Graph select_vertex_properties(Graph g, VertexPropertyList vpl) { } #endif -#if defined(WITH_EDGE_PROPERTY) && defined(COLUMN_STORE_TRAIT) -Graph select_edge_properteis(Graph g, EdgePropertyList epl) { - auto _g = static_cast(g); - auto _epl = static_cast(epl); +#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_COLUMN_STORE_TRAIT) +GRIN_GRAPH grin_select_edge_properteis(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl) { + auto _g = static_cast(g); + auto _epl = static_cast(epl); std::map> vertices, edges; for (auto& p: *_epl) { int etype = static_cast(p.first); diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 866f3a9ec..8dadee46a 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -13,51 +13,51 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/property/propertytable.h" -#if defined(WITH_VERTEX_PROPERTY) || defined(WITH_EDGE_PROPERTY) -void destroy_row(Row r) { - auto _r = static_cast(r); +#if defined(GRIN_WITH_VERTEX_PROPERTY) || defined(GRIN_WITH_EDGE_PROPERTY) +void grin_destroy_row(GRIN_ROW r) { + auto _r = static_cast(r); delete _r; } -const void* get_value_from_row(Row r, size_t idx) { - auto _r = static_cast(r); +const void* grin_get_value_from_row(GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); return (*_r)[idx]; } -Row create_row() { - auto r = new Row_T(); +GRIN_ROW grin_create_row() { + auto r = new GRIN_ROW_T(); return r; } -bool insert_value_to_row(Row r, void* value) { - auto _r = static_cast(r); +bool grin_insert_value_to_row(GRIN_ROW r, void* value) { + auto _r = static_cast(r); _r->push_back(value); return true; } #endif -#ifdef WITH_VERTEX_PROPERTY -void destroy_vertex_property_table(VertexPropertyTable vpt) { - auto _vpt = static_cast(vpt); +#ifdef GRIN_WITH_VERTEX_PROPERTY +void grin_destroy_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE vpt) { + auto _vpt = static_cast(vpt); delete _vpt; } -VertexPropertyTable get_vertex_property_table_by_type(Graph g, VertexType vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto vpt = new VertexPropertyTable_T(); +GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto vpt = new GRIN_VERTEX_PROPERTY_TABLE_T(); vpt->g = _g; vpt->vtype = *_vtype; vpt->vertices = _g->InnerVertices(*_vtype); return vpt; } -const void* get_value_from_vertex_property_table(VertexPropertyTable vpt, - Vertex v, VertexProperty vp) { - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - auto _vp = static_cast(vp); +const void* grin_get_value_from_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE vpt, + GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); if (_vp->first != _vpt->vtype || !_vpt->vertices.Contain(*_v)) return NULL; auto offset = _v->GetValue() - _vpt->vertices.begin_value(); auto array = _vpt->g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); @@ -65,15 +65,15 @@ const void* get_value_from_vertex_property_table(VertexPropertyTable vpt, return result; } -Row get_row_from_vertex_property_table(VertexPropertyTable vpt, Vertex v, - VertexPropertyList vpl) { - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - auto _vpl = static_cast(vpl); +GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, + GRIN_VERTEX_PROPERTY_LIST vpl) { + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vpl = static_cast(vpl); if (!_vpt->vertices.Contain(*_v)) return NULL; auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto r = new Row_T(); + auto r = new GRIN_ROW_T(); for (auto vp: *_vpl) { if (vp.first != _vpt->vtype) return NULL; auto array = _vpt->g->vertex_data_table(vp.first)->column(vp.second)->chunk(0); @@ -84,27 +84,27 @@ Row get_row_from_vertex_property_table(VertexPropertyTable vpt, Vertex v, } #endif -#ifdef WITH_EDGE_PROPERTY -void destroy_edge_property_table(EdgePropertyTable ept) { - auto _ept = static_cast(ept); +#ifdef GRIN_WITH_EDGE_PROPERTY +void grin_destroy_edge_property_table(GRIN_EDGE_PROPERTY_TABLE ept) { + auto _ept = static_cast(ept); delete _ept; } -EdgePropertyTable get_edge_property_table_by_type(Graph g, EdgeType etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); - auto ept = new EdgePropertyTable_T(); +GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto ept = new GRIN_EDGE_PROPERTY_TABLE_T(); ept->g = _g; ept->etype = *_etype; ept->num = _g->edge_data_table(*_etype)->num_rows(); return ept; } -const void* get_value_from_edge_property_table(EdgePropertyTable ept, - Edge e, EdgeProperty ep) { - auto _ept = static_cast(ept); - auto _e = static_cast(e); - auto _ep = static_cast(ep); +const void* grin_get_value_from_edge_property_table(GRIN_EDGE_PROPERTY_TABLE ept, + GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _ept = static_cast(ept); + auto _e = static_cast(e); + auto _ep = static_cast(ep); if (_ep->first != _ept->etype || _e->eid >= _ept->num) return NULL; auto offset = _e->eid; auto array = _ept->g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); @@ -112,15 +112,15 @@ const void* get_value_from_edge_property_table(EdgePropertyTable ept, return result; } -Row get_row_from_edge_property_table(EdgePropertyTable ept, Edge v, - EdgePropertyList epl) { - auto _ept = static_cast(ept); - auto _e = static_cast(v); - auto _epl = static_cast(epl); +GRIN_ROW grin_get_row_from_edge_property_table(GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE v, + GRIN_EDGE_PROPERTY_LIST epl) { + auto _ept = static_cast(ept); + auto _e = static_cast(v); + auto _epl = static_cast(epl); if (_e->eid >= _ept->num) return NULL; auto offset = _e->eid; - auto r = new Row_T(); + auto r = new GRIN_ROW_T(); for (auto ep: *_epl) { if (ep.first != _ept->etype) return NULL; auto array = _ept->g->edge_data_table(ep.first)->column(ep.second)->chunk(0); diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 00090fd21..1aa2c0765 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -13,23 +13,23 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/property/type.h" -#ifdef WITH_VERTEX_PROPERTY -bool equal_vertex_type(VertexType vt1, VertexType vt2) { - auto _vt1 = static_cast(vt1); - auto _vt2 = static_cast(vt2); +#ifdef GRIN_WITH_VERTEX_PROPERTY +bool grin_equal_vertex_type(GRIN_VERTEX_TYPE vt1, GRIN_VERTEX_TYPE vt2) { + auto _vt1 = static_cast(vt1); + auto _vt2 = static_cast(vt2); return (*_vt1 == *_vt2); } -VertexType get_vertex_type(Graph g, Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto vt = new VertexType_T(_g->vertex_label(*_v)); +GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto vt = new GRIN_VERTEX_TYPE_T(_g->vertex_label(*_v)); return vt; } -const char* get_vertex_type_name(Graph g, VertexType vt) { - auto _g = static_cast(g); - auto _vt = static_cast(vt); +const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { + auto _g = static_cast(g); + auto _vt = static_cast(vt); auto s = _g->schema().GetVertexLabelName(*_vt); int len = s.length() + 1; char* out = new char[len]; @@ -37,81 +37,81 @@ const char* get_vertex_type_name(Graph g, VertexType vt) { return out; } -VertexType get_vertex_type_by_name(Graph g, const char* name) { - auto _g = static_cast(g); +GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { + auto _g = static_cast(g); auto s = std::string(name); - auto vt = new VertexType_T(_g->schema().GetVertexLabelId(s)); + auto vt = new GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(s)); return vt; } -VertexTypeList get_vertex_type_list(Graph g) { - auto _g = static_cast(g); - auto vtl = new VertexTypeList_T(); +GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH g) { + auto _g = static_cast(g); + auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); for (auto i = 0; i < _g->vertex_label_num(); ++i) { vtl->push_back(i); } return vtl; } -void destroy_vertex_type_list(VertexTypeList vtl) { - auto _vtl = static_cast(vtl); +void grin_destroy_vertex_type_list(GRIN_VERTEX_TYPE_LIST vtl) { + auto _vtl = static_cast(vtl); delete _vtl; } -VertexTypeList create_vertex_type_list() { - auto vtl = new VertexTypeList_T(); +GRIN_VERTEX_TYPE_LIST grin_create_vertex_type_list() { + auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); return vtl; } -bool insert_vertex_type_to_list(VertexTypeList vtl, VertexType vt) { - auto _vtl = static_cast(vtl); - auto _vt = static_cast(vt); +bool grin_insert_vertex_type_to_list(GRIN_VERTEX_TYPE_LIST vtl, GRIN_VERTEX_TYPE vt) { + auto _vtl = static_cast(vtl); + auto _vt = static_cast(vt); _vtl->push_back(*_vt); return true; } -size_t get_vertex_type_list_size(VertexTypeList vtl) { - auto _vtl = static_cast(vtl); +size_t grin_get_vertex_type_list_size(GRIN_VERTEX_TYPE_LIST vtl) { + auto _vtl = static_cast(vtl); return _vtl->size(); } -VertexType get_vertex_type_from_list(VertexTypeList vtl, size_t idx) { - auto _vtl = static_cast(vtl); - auto vt = new VertexType_T((*_vtl)[idx]); +GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_VERTEX_TYPE_LIST vtl, size_t idx) { + auto _vtl = static_cast(vtl); + auto vt = new GRIN_VERTEX_TYPE_T((*_vtl)[idx]); return vt; } #endif -#ifdef NATURAL_VERTEX_TYPE_ID_TRAIT -VertexTypeID get_vertex_type_id(VertexType vt) { - auto _vt = static_cast(vt); +#ifdef GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT +GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_VERTEX_TYPE vt) { + auto _vt = static_cast(vt); return *_vt; } -VertexType get_vertex_type_from_id(VertexTypeID vti) { - auto vt = new VertexType_T(vti); +GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_VERTEX_TYPE_ID vti) { + auto vt = new GRIN_VERTEX_TYPE_T(vti); return vt; } #endif -#ifdef WITH_EDGE_PROPERTY -bool equal_edge_type(EdgeType et1, EdgeType et2) { - auto _et1 = static_cast(et1); - auto _et2 = static_cast(et2); +#ifdef GRIN_WITH_EDGE_PROPERTY +bool grin_equal_edge_type(GRIN_EDGE_TYPE et1, GRIN_EDGE_TYPE et2) { + auto _et1 = static_cast(et1); + auto _et2 = static_cast(et2); return (*_et1 == *_et2); } -EdgeType get_edge_type(Graph g, Edge e) { - auto _e = static_cast(e); - auto et = new EdgeType_T(_e->etype); +GRIN_EDGE_TYPE grin_get_edge_type(GRIN_GRAPH g, GRIN_EDGE e) { + auto _e = static_cast(e); + auto et = new GRIN_EDGE_TYPE_T(_e->etype); return et; } -const char* get_edge_type_name(Graph g, EdgeType et) { - auto _g = static_cast(g); - auto _et = static_cast(et); +const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { + auto _g = static_cast(g); + auto _et = static_cast(et); auto s = _g->schema().GetEdgeLabelName(*_et); int len = s.length() + 1; char* out = new char[len]; @@ -119,102 +119,102 @@ const char* get_edge_type_name(Graph g, EdgeType et) { return out; } -EdgeType get_edge_type_by_name(Graph g, const char* name) { - auto _g = static_cast(g); +GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { + auto _g = static_cast(g); auto s = std::string(name); - auto et = new EdgeType_T(_g->schema().GetEdgeLabelId(s)); + auto et = new GRIN_EDGE_TYPE_T(_g->schema().GetEdgeLabelId(s)); return et; } -EdgeTypeList get_edge_type_list(Graph g) { - auto _g = static_cast(g); - auto etl = new EdgeTypeList_T(); +GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH g) { + auto _g = static_cast(g); + auto etl = new GRIN_EDGE_TYPE_LIST_T(); for (auto i = 0; i < _g->edge_label_num(); ++i) { etl->push_back(i); } return etl; } -void destroy_edge_type_list(EdgeTypeList etl) { - auto _etl = static_cast(etl); +void grin_destroy_edge_type_list(GRIN_EDGE_TYPE_LIST etl) { + auto _etl = static_cast(etl); delete _etl; } -EdgeTypeList create_edge_type_list() { - auto etl = new EdgeTypeList_T(); +GRIN_EDGE_TYPE_LIST grin_create_edge_type_list() { + auto etl = new GRIN_EDGE_TYPE_LIST_T(); return etl; } -bool insert_edge_type_to_list(EdgeTypeList etl, EdgeType et) { - auto _etl = static_cast(etl); - auto _et = static_cast(et); +bool grin_insert_edge_type_to_list(GRIN_EDGE_TYPE_LIST etl, GRIN_EDGE_TYPE et) { + auto _etl = static_cast(etl); + auto _et = static_cast(et); _etl->push_back(*_et); return true; } -size_t get_edge_type_list_size(EdgeTypeList etl) { - auto _etl = static_cast(etl); +size_t grin_get_edge_type_list_size(GRIN_EDGE_TYPE_LIST etl) { + auto _etl = static_cast(etl); return _etl->size(); } -EdgeType get_edge_type_from_list(EdgeTypeList etl, size_t idx) { - auto _etl = static_cast(etl); - auto et = new VertexType_T((*_etl)[idx]); +GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_EDGE_TYPE_LIST etl, size_t idx) { + auto _etl = static_cast(etl); + auto et = new GRIN_VERTEX_TYPE_T((*_etl)[idx]); return et; } #endif -#ifdef NATURAL_EDGE_TYPE_ID_TRAIT -EdgeTypeID get_edge_type_id(EdgeType et) { - auto _et = static_cast(et); +#ifdef GRIN_NATURAL_EDGE_TYPE_ID_TRAIT +GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_EDGE_TYPE et) { + auto _et = static_cast(et); return *_et; } -EdgeType get_edge_type_from_id(EdgeTypeID eti) { - auto et = new EdgeType_T(eti); +GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_EDGE_TYPE_ID eti) { + auto et = new GRIN_EDGE_TYPE_T(eti); return et; } #endif -#if defined(WITH_VERTEX_PROPERTY) && defined(WITH_EDGE_PROPERTY) -VertexTypeList get_src_types_from_edge_type(Graph g, EdgeType etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); +#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_WITH_EDGE_PROPERTY) +GRIN_VERTEX_TYPE_LIST grin_get_src_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); auto entry = _g->schema().GetEntry(*_etype, "EDGE"); - auto vtl = new VertexTypeList_T(); + auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); for (auto& pair : entry.relations) { - vtl->push_back(VertexType_T(_g->schema().GetVertexLabelId(pair.first))); + vtl->push_back(GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(pair.first))); } return vtl; } -VertexTypeList get_dst_types_from_edge_type(Graph g, EdgeType etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); +GRIN_VERTEX_TYPE_LIST grin_get_dst_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); auto entry = _g->schema().GetEntry(*_etype, "EDGE"); - auto vtl = new VertexTypeList_T(); + auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); for (auto& pair : entry.relations) { - vtl->push_back(VertexType_T(_g->schema().GetVertexLabelId(pair.second))); + vtl->push_back(GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(pair.second))); } return vtl; } -EdgeTypeList get_edge_types_from_vertex_type_pair(Graph g, VertexType src_vt, - VertexType dst_vt) { - auto _g = static_cast(g); - auto _v1 = static_cast(src_vt); - auto _v2 = static_cast(dst_vt); +GRIN_EDGE_TYPE_LIST grin_get_edge_types_from_vertex_type_pair(GRIN_GRAPH g, GRIN_VERTEX_TYPE src_vt, + GRIN_VERTEX_TYPE dst_vt) { + auto _g = static_cast(g); + auto _v1 = static_cast(src_vt); + auto _v2 = static_cast(dst_vt); auto str_v1 = _g->schema().GetVertexLabelName(*_v1); auto str_v2 = _g->schema().GetVertexLabelName(*_v2); - auto etl = new EdgeTypeList_T(); + auto etl = new GRIN_EDGE_TYPE_LIST_T(); for (auto etype = 0; etype < _g->edge_label_num(); ++etype) { auto entry = _g->schema().GetEntry(etype, "EDGE"); for (auto& pair : entry.relations) { if (pair.first == str_v1 && pair.second == str_v2) { - etl->push_back(EdgeType_T(etype)); + etl->push_back(GRIN_EDGE_TYPE_T(etype)); } } } diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 92456c561..928ffe85d 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -16,16 +16,16 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/topology/adjacentlist.h" -#ifdef ENABLE_ADJACENT_LIST -AdjacentList get_adjacent_list(Graph g, Direction d, Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto al = new AdjacentList_T(); +#ifdef GRIN_ENABLE_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto al = new GRIN_ADJACENT_LIST_T(); al->v = v; al->dir = d; al->etype = _g->edge_label_num(); - for (EdgeType_T etype = 0; etype < al->etype; ++etype) { - if (d == Direction::IN) { + for (GRIN_EDGE_TYPE_T etype = 0; etype < al->etype; ++etype) { + if (d == GRIN_DIRECTION::IN) { al->data.push_back(_g->GetIncomingRawAdjList(*_v, etype)); } else { al->data.push_back(_g->GetOutgoingRawAdjList(*_v, etype)); @@ -34,17 +34,17 @@ AdjacentList get_adjacent_list(Graph g, Direction d, Vertex v) { return al; } -#ifdef WITH_EDGE_PROPERTY -AdjacentList get_adjacent_list_by_edge_type(Graph g, Direction d, - Vertex v, EdgeType etype) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto _etype = static_cast(etype); - auto al = new AdjacentList_T(); +#ifdef GRIN_WITH_EDGE_PROPERTY +GRIN_ADJACENT_LIST grin_get_adjacent_list_by_edge_type(GRIN_GRAPH g, GRIN_DIRECTION d, + GRIN_VERTEX v, GRIN_EDGE_TYPE etype) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto _etype = static_cast(etype); + auto al = new GRIN_ADJACENT_LIST_T(); al->v = v; al->dir = d; al->etype = *_etype; - if (d == Direction::IN) { + if (d == GRIN_DIRECTION::IN) { al->data.push_back(_g->GetIncomingRawAdjList(*_v, *_etype)); } else { al->data.push_back(_g->GetOutgoingRawAdjList(*_v, *_etype)); @@ -53,13 +53,13 @@ AdjacentList get_adjacent_list_by_edge_type(Graph g, Direction d, } #endif -void destroy_adjacent_list(AdjacentList al) { - auto _al = static_cast(al); +void grin_destroy_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { + auto _al = static_cast(al); delete _al; } -size_t get_adjacent_list_size(AdjacentList al) { - auto _al = static_cast(al); +size_t grin_get_adjacent_list_size(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { + auto _al = static_cast(al); size_t result = 0; for (auto &ral : _al->data) { result += ral.Size(); @@ -67,31 +67,31 @@ size_t get_adjacent_list_size(AdjacentList al) { return result; } -Vertex get_neighbor_from_adjacent_list(AdjacentList al, size_t idx) { - auto _al = static_cast(al); +GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { + auto _al = static_cast(al); size_t result = 0; for (auto &ral : _al->data) { result += ral.Size(); if (idx < result) { auto _idx = idx - (result - ral.size()); auto _nbr = ral.begin() + _idx; - auto v = new Vertex_T(_nbr->vid); + auto v = new GRIN_VERTEX_T(_nbr->vid); return v; } } - return NULL_VERTEX; + return GRIN_NULL_VERTEX; } -Edge get_edge_from_adjacent_list(AdjacentList al, size_t idx) { - auto _al = static_cast(al); +GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { + auto _al = static_cast(al); size_t result = 0; for (auto i = 0; i < _al->data.size(); ++i) { result += _al->data[i].Size(); if (idx < result) { auto _idx = idx - (result - _al->data[i].Size()); auto _nbr = _al->data[i].begin() + _idx; - auto v = new Vertex_T(_nbr->vid); - auto e = new Edge_T(); + auto v = new GRIN_VERTEX_T(_nbr->vid); + auto e = new GRIN_EDGE_T(); e->src = _al->v; e->dst = v; e->dir = _al->dir; @@ -100,6 +100,6 @@ Edge get_edge_from_adjacent_list(AdjacentList al, size_t idx) { return e; } } - return NULL_EDGE; + return GRIN_NULL_EDGE; } #endif \ No newline at end of file diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index ef416c87d..beabaa466 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -16,18 +16,18 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/topology/structure.h" -bool is_directed(Graph g) { - auto _g = static_cast(g); +bool grin_is_directed(GRIN_GRAPH g) { + auto _g = static_cast(g); return _g->directed(); } -bool is_multigraph(Graph g) { - auto _g = static_cast(g); +bool grin_is_multigraph(GRIN_GRAPH g) { + auto _g = static_cast(g); return _g->is_multigraph(); } -size_t get_vertex_num(Graph g) { - auto _g = static_cast(g); +size_t grin_get_vertex_num(GRIN_GRAPH g) { + auto _g = static_cast(g); size_t result = 0; for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { result += _g->GetVerticesNum(vtype); @@ -35,16 +35,16 @@ size_t get_vertex_num(Graph g) { return result; } -#ifdef WITH_VERTEX_PROPERTY -size_t get_vertex_num_by_type(Graph g, VertexType vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); +#ifdef GRIN_WITH_VERTEX_PROPERTY +size_t grin_get_vertex_num_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); return _g->GetVerticesNum(*_vtype); } #endif -size_t get_edge_num(Graph g, Direction d) { - auto _g = static_cast(g); +size_t grin_get_edge_num(GRIN_GRAPH g, GRIN_DIRECTION d) { + auto _g = static_cast(g); if (d == IN) { return _g->GetInEdgeNum(); } else if (d == OUT) { @@ -53,80 +53,80 @@ size_t get_edge_num(Graph g, Direction d) { return _g->GetEdgeNum(); } -#ifdef WITH_EDGE_PROPERTY -size_t get_edge_num_by_type(Graph g, Direction d, EdgeType etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); +#ifdef GRIN_WITH_EDGE_PROPERTY +size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_EDGE_TYPE etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); return _g->edge_data_table(*_etype)->num_rows(); } #endif // Vertex -void destroy_vertex(Vertex v) { - auto _v = static_cast(v); +void grin_destroy_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _v = static_cast(v); delete _v; } -#ifdef WITH_VERTEX_ORIGINAL_ID -Vertex get_vertex_from_original_id(Graph g, OriginalID oid) { - auto _g = static_cast(g); - Vertex result; +#ifdef GRIN_WITH_VERTEX_ORIGINAL_ID +GRIN_VERTEX grin_get_vertex_from_original_id(GRIN_GRAPH g, GRIN_VERTEX_ORIGINAL_ID oid) { + auto _g = static_cast(g); + GRIN_VERTEX result; for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - result = get_vertex_from_original_id_by_type(g, &vtype, oid); - if (result != NULL_VERTEX) { + result = grin_get_vertex_from_original_id_by_type(g, &vtype, oid); + if (result != GRIN_NULL_VERTEX) { return result; } } - return NULL_VERTEX; + return GRIN_NULL_VERTEX; } -DataType get_vertex_original_id_type(Graph g) { - return DataTypeEnum::value; +GRIN_DATATYPE grin_get_vertex_original_id_type(GRIN_GRAPH g) { + return GRIN_DATATYPE_ENUM::value; } -OriginalID get_vertex_original_id(Graph g, Vertex v) { - auto _g = static_cast(g); - auto _v = static_cast(v); +GRIN_VERTEX_ORIGINAL_ID grin_get_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); auto gid = _g->Vertex2Gid(*_v); - auto oid = new OriginalID_T(_g->Gid2Oid(gid)); + auto oid = new VERTEX_ORIGINAL_ID_T(_g->Gid2Oid(gid)); return oid; } -void destroy_vertex_original_id(OriginalID oid) { - auto _oid = static_cast(oid); +void grin_destroy_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX_ORIGINAL_ID oid) { + auto _oid = static_cast(oid); delete _oid; } #endif -#if defined(WITH_VERTEX_ORIGINAL_ID) && defined(WITH_VERTEX_PROPERTY) -Vertex get_vertex_from_original_id_by_type(Graph g, VertexType vtype, OriginalID oid) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto _oid = static_cast(oid); - Graph_T::vid_t gid; - auto v = new Vertex_T(); +#if defined(GRIN_WITH_VERTEX_ORIGINAL_ID) && defined(GRIN_WITH_VERTEX_PROPERTY) +GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_ORIGINAL_ID oid) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto _oid = static_cast(oid); + GRIN_GRAPH_T::vid_t gid; + auto v = new GRIN_VERTEX_T(); if (_g->Oid2Gid(*_vtype, *_oid, gid)) { if (_g->Gid2Vertex(gid, *v)) { return v; } } - return NULL_VERTEX; + return GRIN_NULL_VERTEX; } #endif -// Edge -void destroy_edge(Edge e) { - auto _e = static_cast(e); +// GRIN_EDGE +void grin_destroy_edge(GRIN_GRAPH g, GRIN_EDGE e) { + auto _e = static_cast(e); delete _e; } -Vertex get_edge_src(Graph g, Edge e) { - auto _e = static_cast(e); +GRIN_VERTEX grin_get_edge_src(GRIN_GRAPH g, GRIN_EDGE e) { + auto _e = static_cast(e); return _e->src; } -Vertex get_edge_dst(Graph g, Edge e) { - auto _e = static_cast(e); +GRIN_VERTEX grin_get_edge_dst(GRIN_GRAPH g, GRIN_EDGE e) { + auto _e = static_cast(e); return _e->dst; } diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index 90618970a..b7169ed98 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -16,45 +16,45 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/topology/vertexlist.h" -#ifdef ENABLE_VERTEX_LIST -VertexList get_vertex_list(Graph g) { - auto _g = static_cast(g); - auto vl = new VertexList_T(); +#ifdef GRIN_ENABLE_VERTEX_LIST +GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g) { + auto _g = static_cast(g); + auto vl = new GRIN_VERTEX_LIST_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { vl->push_back(_g->Vertices(vtype)); } return vl; } -#ifdef WITH_VERTEX_PROPERTY -VertexList get_vertex_list_by_type(Graph g, VertexType vtype) { - auto _g = static_cast(g); - auto vl = new VertexList_T(); - auto _vtype = static_cast(vtype); +#ifdef GRIN_WITH_VERTEX_PROPERTY +GRIN_VERTEX_LIST grin_get_vertex_list_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { + auto _g = static_cast(g); + auto vl = new GRIN_VERTEX_LIST_T(); + auto _vtype = static_cast(vtype); vl->push_back(_g->Vertices(*_vtype)); return vl; } #endif -void destroy_vertex_list(VertexList vl) { - auto _vl = static_cast(vl); +void grin_destroy_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { + auto _vl = static_cast(vl); delete _vl; } -VertexList create_vertex_list() { - auto vl = new VertexList_T(); +GRIN_VERTEX_LIST grin_create_vertex_list(GRIN_GRAPH g) { + auto vl = new GRIN_VERTEX_LIST_T(); return vl; } -bool insert_vertex_to_list(VertexList vl, Vertex v) { - auto _vl = static_cast(vl); - auto _v = static_cast(v); - _vl->push_back(Graph_T::vertex_range_t(_v->GetValue(), _v->GetValue())); +bool grin_insert_vertex_to_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v) { + auto _vl = static_cast(vl); + auto _v = static_cast(v); + _vl->push_back(GRIN_GRAPH_T::vertex_range_t(_v->GetValue(), _v->GetValue())); return true; } -size_t get_vertex_list_size(VertexList vl) { - auto _vl = static_cast(vl); +size_t grin_get_vertex_list_size(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { + auto _vl = static_cast(vl); size_t result = 0; for (auto &vr : *_vl) { result += vr.size(); @@ -62,17 +62,17 @@ size_t get_vertex_list_size(VertexList vl) { return result; } -Vertex get_vertex_from_list(VertexList vl, size_t idx) { - auto _vl = static_cast(vl); +GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t idx) { + auto _vl = static_cast(vl); size_t result = 0; for (auto &vr : *_vl) { result += vr.size(); if (idx < result) { auto _idx = idx - (result - vr.size()); - auto v = new Vertex_T(vr.begin_value() + _idx); + auto v = new GRIN_VERTEX_T(vr.begin_value() + _idx); return v; } } - return NULL_VERTEX; + return GRIN_NULL_VERTEX; } #endif diff --git a/modules/graph/test/grin_arrow_fragment_test.cc b/modules/graph/test/grin_arrow_fragment_test.cc index 349441c50..420809a3d 100644 --- a/modules/graph/test/grin_arrow_fragment_test.cc +++ b/modules/graph/test/grin_arrow_fragment_test.cc @@ -30,24 +30,24 @@ using GraphType = vineyard::ArrowFragment 0); // we only traverse the first partition for test - auto partition = get_partition_from_list(local_partitions, 0); + auto partition = grin_get_partition_from_list(pg, local_partitions, 0); TraverseLocalGraph(pg, partition); } diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index 19e8bd81e..f6b0f34ec 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -33,7 +33,7 @@ using LabelType = typename GraphType::label_id_t; -void sync_property(void* partitioned_graph, void* partition, +void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION partition, const char* edge_type_name, const char* vertex_property_name) { /* This example illustrates how to sync property values of vertices related to certain edge type. @@ -46,51 +46,51 @@ void sync_property(void* partitioned_graph, void* partition, the destination is a mirror vertex, given the context of "edge-cut" partition strategy that the underlying storage uses. Then for each of these vertices, we send the value of the "features" property to its master partition. */ - auto g = get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition + GRIN_GRAPH g = grin_get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition - auto etype = get_edge_type_by_name(g, edge_type_name); // get edge type from name - auto src_vtypes = get_src_types_from_edge_type(g, etype); // get related source vertex type list - auto dst_vtypes = get_dst_types_from_edge_type(g, etype); // get related destination vertex type list + GRIN_EDGE_TYPE etype = grin_get_edge_type_by_name(g, edge_type_name); // get edge type from name + GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_from_edge_type(g, etype); // get related source vertex type list + GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_from_edge_type(g, etype); // get related destination vertex type list - auto src_vtypes_num = get_vertex_type_list_size(src_vtypes); - auto dst_vtypes_num = get_vertex_type_list_size(dst_vtypes); + size_t src_vtypes_num = grin_get_vertex_type_list_size(src_vtypes); + size_t dst_vtypes_num = grin_get_vertex_type_list_size(dst_vtypes); assert(src_vtypes_num == dst_vtypes_num); // the src & dst vertex type lists must be aligned - for (auto i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type - auto src_vtype = get_vertex_type_from_list(src_vtypes, i); // get src type - auto dst_vtype = get_vertex_type_from_list(dst_vtypes, i); // get dst type + for (size_t i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type + GRIN_VERTEX_TYPE src_vtype = grin_get_vertex_type_from_list(src_vtypes, i); // get src type + GRIN_VERTEX_TYPE dst_vtype = grin_get_vertex_type_from_list(dst_vtypes, i); // get dst type - auto dst_vp = get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type - if (dst_vp == NULL_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" + GRIN_VERTEX_PROPERTY dst_vp = grin_get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type + if (dst_vp == GRIN_NULL_VERTEX_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" - auto dst_vpt = get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use - auto dst_vp_dt = get_vertex_property_data_type(g, dst_vp); // prepare property type for later use + GRIN_VERTEX_PROPERTY_TABLE dst_vpt = grin_get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use + GRIN_DATATYPE dst_vp_dt = grin_get_vertex_property_data_type(g, dst_vp); // prepare property type for later use - auto src_vl = get_master_vertices_by_type(g, src_vtype); // we only need master vertices under source type + GRIN_VERTEX_LIST src_vl = grin_get_master_vertices_by_type(g, src_vtype); // we only need master vertices under source type - auto src_vl_num = get_vertex_list_size(src_vl); - for (auto j = 0; j < src_vl_num; ++j) { // iterate the src vertex - auto v = get_vertex_from_list(src_vl, j); - auto adj_list = get_adjacent_list_by_edge_type(g, Direction::OUT, v, etype); // get the adjacent list of v with edges under etype + size_t src_vl_num = grin_get_vertex_list_size(g, src_vl); + for (size_t j = 0; j < src_vl_num; ++j) { // iterate the src vertex + GRIN_VERTEX v = grin_get_vertex_from_list(g, src_vl, j); + GRIN_ADJACENT_LIST adj_list = grin_get_adjacent_list_by_edge_type(g, GRIN_DIRECTION::OUT, v, etype); // get the adjacent list of v with edges under etype bool check_flag = false; - if (adj_list == NULL_LIST) { // NULL_LIST means the storage does NOT support getting adj_list by edge type, note that list with size 0 is NOT a NULL_LIST + if (adj_list == GRIN_NULL_LIST) { // NULL_LIST means the storage does NOT support getting adj_list by edge type, note that list with size 0 is NOT a NULL_LIST // Then we should scan the full adj list and filter edge type by ourselves. - adj_list = get_adjacent_list(g, Direction::OUT, v); - bool check_flag = true; + adj_list = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); + check_flag = true; } - auto al_sz = get_adjacent_list_size(adj_list); - for (auto k = 0; k < al_sz; ++k) { + size_t al_sz = grin_get_adjacent_list_size(g, adj_list); + for (size_t k = 0; k < al_sz; ++k) { if (check_flag) { - auto edge = get_edge_from_adjacent_list(adj_list, k); - auto edge_type = get_edge_type(g, edge); - if (!equal_edge_type(edge_type, etype)) continue; + GRIN_EDGE edge = grin_get_edge_from_adjacent_list(g, adj_list, k); + GRIN_EDGE_TYPE edge_type = grin_get_edge_type(g, edge); + if (!grin_equal_edge_type(edge_type, etype)) continue; } - auto u = get_neighbor_from_adjacent_list(adj_list, k); // get the dst vertex u - auto value = get_value_from_vertex_property_table(dst_vpt, u, dst_vp); // get the property value of "features" of u + GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list(g, adj_list, k); // get the dst vertex u + const void* value = grin_get_value_from_vertex_property_table(dst_vpt, u, dst_vp); // get the property value of "features" of u - auto uref = get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions - auto u_master_partition = get_master_partition_from_vertex_ref(g, uref); // get the master partition for u + GRIN_VERTEX_REF uref = grin_get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions + GRIN_PARTITION u_master_partition = grin_get_master_partition_from_vertex_ref(g, uref); // get the master partition for u // send_value(u_master_partition, uref, dst_vp_dt, value); // the value must be casted to the correct type based on dst_vp_dt before sending } @@ -103,13 +103,13 @@ void traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, vineyard::ObjectID fragment_group_id) { LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; - auto pg = get_partitioned_graph_by_object_id(client, fragment_group_id); - auto local_partitions = get_local_partition_list(pg); - size_t pnum = get_partition_list_size(local_partitions); + GRIN_PARTITIONED_GRAPH pg = get_partitioned_graph_by_object_id(client, fragment_group_id); + GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); + size_t pnum = grin_get_partition_list_size(pg, local_partitions); assert(pnum > 0); // we only traverse the first partition for test - auto partition = get_partition_from_list(local_partitions, 0); + GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); sync_property(pg, partition, "likes", "features"); } From 9ab9bb3f9a264450b019a3f72cd76622324e1e67 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Mon, 6 Mar 2023 21:10:04 +0800 Subject: [PATCH 14/85] format func parameters & add vertex ordering predicate --- modules/graph/fragment/arrow_fragment.grin.h | 20 +++---- modules/graph/grin/include/index/label.h | 4 +- .../graph/grin/include/partition/partition.h | 6 +-- modules/graph/grin/include/predefine.h | 20 +++++-- modules/graph/grin/include/predicate/order.h | 44 ++++++++++++++++ .../graph/grin/include/property/primarykey.h | 2 +- .../graph/grin/include/property/property.h | 12 ++--- .../grin/include/property/propertylist.h | 28 +++++----- .../grin/include/property/propertytable.h | 28 +++++----- modules/graph/grin/include/property/type.h | 32 ++++++------ .../grin/include/topology/adjacentlist.h | 5 +- .../graph/grin/include/topology/edgelist.h | 8 ++- .../graph/grin/include/topology/structure.h | 4 +- .../graph/grin/include/topology/vertexlist.h | 7 +-- modules/graph/grin/src/partition/partition.cc | 8 +-- modules/graph/grin/src/predefine.h | 5 +- modules/graph/grin/src/predicate/order.cc | 52 +++++++++++++++++++ modules/graph/grin/src/property/property.cc | 13 ++--- .../graph/grin/src/property/propertylist.cc | 28 +++++----- .../graph/grin/src/property/propertytable.cc | 34 ++++++------ modules/graph/grin/src/property/type.cc | 32 ++++++------ modules/graph/grin/src/topology/vertexlist.cc | 20 +++---- .../graph/test/grin_arrow_fragment_test.cc | 10 ++-- modules/graph/test/grin_test.cc | 12 ++--- 24 files changed, 269 insertions(+), 165 deletions(-) create mode 100644 modules/graph/grin/include/predicate/order.h create mode 100644 modules/graph/grin/src/predicate/order.cc diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index 94ccb5201..15532b34e 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -125,25 +125,25 @@ struct GRIN_Nbr { template T get_data(GRIN_EDGE_PROPERTY prop) const { auto _e = grin_get_edge_from_adjacent_list(g_, al_, cur_); - auto value = grin_get_value_from_edge_property_table(ept_, _e, prop); + auto value = grin_get_value_from_edge_property_table(g_, ept_, _e, prop); return property_graph_utils::ValueGetter::Value(value, 0); } std::string get_str(GRIN_EDGE_PROPERTY prop) const { auto _e = grin_get_edge_from_adjacent_list(g_, al_, cur_); - auto value = grin_get_value_from_edge_property_table(ept_, _e, prop); + auto value = grin_get_value_from_edge_property_table(g_, ept_, _e, prop); return property_graph_utils::ValueGetter::Value(value, 0); } double get_double(GRIN_EDGE_PROPERTY prop) const { auto _e = grin_get_edge_from_adjacent_list(g_, al_, cur_); - auto value = grin_get_value_from_edge_property_table(ept_, _e, prop); + auto value = grin_get_value_from_edge_property_table(g_, ept_, _e, prop); return property_graph_utils::ValueGetter::Value(value, 0); } int64_t get_int(GRIN_EDGE_PROPERTY prop) const { auto _e = grin_get_edge_from_adjacent_list(g_, al_, cur_); - auto value = grin_get_value_from_edge_property_table(ept_, _e, prop); + auto value = grin_get_value_from_edge_property_table(g_, ept_, _e, prop); return property_graph_utils::ValueGetter::Value(value, 0); } @@ -338,17 +338,17 @@ class GRIN_ArrowFragment { size_t vertex_label_num() const { auto vtl = grin_get_vertex_type_list(g_); - return grin_get_vertex_type_list_size(vtl); + return grin_get_vertex_type_list_size(g_, vtl); } size_t edge_label_num() const { auto etl = grin_get_edge_type_list(g_); - return grin_get_edge_type_list_size(etl); + return grin_get_edge_type_list_size(g_, etl); } size_t vertex_property_num(GRIN_VERTEX_TYPE label) const { auto vpl = grin_get_vertex_property_list_by_type(g_, label); - return grin_get_vertex_property_list_size(vpl); + return grin_get_vertex_property_list_size(g_, vpl); } std::shared_ptr vertex_property_type(GRIN_VERTEX_PROPERTY prop) const { @@ -358,7 +358,7 @@ class GRIN_ArrowFragment { size_t edge_property_num(GRIN_EDGE_TYPE label) const { auto epl = grin_get_edge_property_list_by_type(g_, label); - return grin_get_edge_property_list_size(epl); + return grin_get_edge_property_list_size(g_, epl); } std::shared_ptr edge_property_type(GRIN_EDGE_PROPERTY prop) const { @@ -447,7 +447,7 @@ class GRIN_ArrowFragment { if (GRIN_DATATYPE_ENUM::value != grin_get_vertex_property_data_type(g_, prop)) return false; auto vtype = grin_get_vertex_type(g_, v); auto vpt = grin_get_vertex_property_table_by_type(g_, vtype); - auto _value = grin_get_value_from_vertex_property_table(vpt, v, prop); + auto _value = grin_get_value_from_vertex_property_table(g_, vpt, v, prop); if (_value != NULL) { value = *(static_cast(_value)); return true; @@ -458,7 +458,7 @@ class GRIN_ArrowFragment { template bool GetData(GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY prop, T& value) const { if (GRIN_DATATYPE_ENUM::value != grin_get_vertex_property_data_type(g_, prop)) return false; - auto _value = grin_get_value_from_vertex_property_table(vpt, v, prop); + auto _value = grin_get_value_from_vertex_property_table(g_, vpt, v, prop); if (_value != NULL) { value = *(static_cast(_value)); return true; diff --git a/modules/graph/grin/include/index/label.h b/modules/graph/grin/include/index/label.h index b2faa812c..bbb3fa796 100644 --- a/modules/graph/grin/include/index/label.h +++ b/modules/graph/grin/include/index/label.h @@ -39,7 +39,7 @@ GRIN_LABEL grin_get_label_from_list(GRIN_GRAPH, GRIN_LABEL_LIST, size_t); * @brief assign a label to a vertex * @param GRIN_GRAPH the graph * @param GRIN_LABEL the label - * @param Vertex the vertex + * @param GRIN_VERTEX the vertex * @return whether succeed */ bool grin_assign_label_to_vertex(GRIN_GRAPH, GRIN_LABEL, GRIN_VERTEX); @@ -47,7 +47,7 @@ bool grin_assign_label_to_vertex(GRIN_GRAPH, GRIN_LABEL, GRIN_VERTEX); /** * @brief get the label list of a vertex * @param GRIN_GRAPH the graph - * @param Vertex the vertex + * @param GRIN_VERTEX the vertex */ GRIN_LABEL_LIST grin_get_vertex_label_list(GRIN_GRAPH, GRIN_VERTEX); diff --git a/modules/graph/grin/include/partition/partition.h b/modules/graph/grin/include/partition/partition.h index d8d3f45d4..ead1c742e 100644 --- a/modules/graph/grin/include/partition/partition.h +++ b/modules/graph/grin/include/partition/partition.h @@ -155,14 +155,14 @@ bool grin_is_vertex_neighbor_local_complete(GRIN_GRAPH, GRIN_VERTEX); * @brief get the partitions whose combination can provide the complete * neighbors of a vertex. * @param GRIN_GRAPH the graph - * @param Vertex the vertex + * @param GRIN_VERTEX the vertex */ GRIN_PARTITION_LIST grin_vertex_neighbor_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); #ifdef GRIN_WITH_VERTEX_DATA -bool grin_is_vertex_data_local_complete(GRIN_GRAPH, Vertex); +bool grin_is_vertex_data_local_complete(GRIN_GRAPH, GRIN_VERTEX); -GRIN_PARTITION_LIST grin_vertex_data_complete_partitions(GRIN_GRAPH, Vertex); +GRIN_PARTITION_LIST grin_vertex_data_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); #endif #ifdef GRIN_WITH_VERTEX_PROPERTY diff --git a/modules/graph/grin/include/predefine.h b/modules/graph/grin/include/predefine.h index 52bf9f564..d8fd5dd26 100644 --- a/modules/graph/grin/include/predefine.h +++ b/modules/graph/grin/include/predefine.h @@ -107,6 +107,17 @@ typedef enum { */ #define GRIN_ENABLE_ADJACENT_LIST_ITERATOR +/** + * +*/ +#define GRIN_GRANULA_ENALBE_VERTEX_LIST_BY_TYPE + +#define GRIN_GRANULA_ENABLE_ADJACENT_LIST_BY_PARTITION + +#define GRIN_GRANULA_ENABLE_ADJACENT_LIST_BY_TYPE + +#define GRIN_GRANULA_ENABLE_ADJACENT_LIST_BY_PARTITION_TYPE + #ifndef GRIN_DOXYGEN_SKIP #undef GRIN_WITH_VERTEX_DATA #undef GRIN_WITH_EDGE_DATA @@ -242,10 +253,9 @@ typedef enum { */ ///@{ /** @ingroup PredicateMacros - * @brief Enable predicates on graph. + * @brief Enable vertex ordering predicate */ -#define GRIN_ENABLE_PREDICATE -#undef GRIN_ENABLE_PREDICATE +#define GRIN_PREDICATE_ENABLE_VERTEX_ORDERING ///@} /** @name IndexMacros @@ -400,8 +410,8 @@ typedef void* GRIN_ROW; #endif #if defined(GRIN_WITH_VERTEX_LABEL) || defined(GRIN_WITH_EDGE_LABEL) -typedef void* GRIN_LABEL -typedef void* GRIN_LABEL_LIST +typedef void* GRIN_LABEL; +typedef void* GRIN_LABEL_LIST; #endif #endif // GRIN_INCLUDE_PREDEFINE_H_ diff --git a/modules/graph/grin/include/predicate/order.h b/modules/graph/grin/include/predicate/order.h new file mode 100644 index 000000000..42188b3cb --- /dev/null +++ b/modules/graph/grin/include/predicate/order.h @@ -0,0 +1,44 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/** + @file order.h + @brief Define the vertex ordering predicate APIs +*/ + +#ifndef GRIN_INCLUDE_PREDICATE_ORDER_H_ +#define GRIN_INCLUDE_PREDICATE_ORDER_H_ + +#include "../predefine.h" + +#ifdef GRIN_PREDICATE_ENABLE_VERTEX_ORDERING +/** + * @brief sort a vertex list + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_LIST the vertex list to sort + * @return whether succeed +*/ +bool grin_sort_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); + +/** + * @brief get the position of a vertex in a sorted list + * caller must guarantee the input vertex list is sorted to get the correct result + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_LIST the sorted vertex list + * @param VERTEX the vertex to find + * @param pos the returned position of the vertex + * @return false if the vertex is not found +*/ +bool grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH, GRIN_VERTEX_LIST, GRIN_VERTEX, size_t& pos); +#endif + +#endif // GRIN_INCLUDE_PREDICATE_ORDER_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/primarykey.h b/modules/graph/grin/include/property/primarykey.h index 698880fd3..89141fd8f 100644 --- a/modules/graph/grin/include/property/primarykey.h +++ b/modules/graph/grin/include/property/primarykey.h @@ -40,7 +40,7 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_primary_keys_by_vertex_type(GRIN_GRAPH, GRIN_ * @param GRIN_VERTEX_PROPERTY_LIST the primary keys * @param GRIN_ROW the values of primary keys */ -Vertex grin_get_vertex_by_primay_keys(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST, GRIN_ROW); +GRIN_VERTEX grin_get_vertex_by_primay_keys(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST, GRIN_ROW); #endif #ifdef GRIN_WITH_EDGE_PRIMARY_KEYS diff --git a/modules/graph/grin/include/property/property.h b/modules/graph/grin/include/property/property.h index 040aa67eb..4b248af01 100644 --- a/modules/graph/grin/include/property/property.h +++ b/modules/graph/grin/include/property/property.h @@ -70,13 +70,13 @@ GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH, const char* #ifdef GRIN_WITH_VERTEX_PROPERTY -bool grin_equal_vertex_property(GRIN_VERTEX_PROPERTY, GRIN_VERTEX_PROPERTY); +bool grin_equal_vertex_property(GRIN_GRAPH, GRIN_VERTEX_PROPERTY, GRIN_VERTEX_PROPERTY); /** * @brief destroy vertex property * @param GRIN_VERTEX_PROPERTY vertex property */ -void grin_destroy_vertex_property(GRIN_VERTEX_PROPERTY); +void grin_destroy_vertex_property(GRIN_GRAPH, GRIN_VERTEX_PROPERTY); /** * @brief get property data type @@ -88,18 +88,18 @@ GRIN_DATATYPE grin_get_vertex_property_data_type(GRIN_GRAPH, GRIN_VERTEX_PROPERT * @brief get the vertex type that the property is bound to * @param GRIN_VERTEX_PROPERTY vertex property */ -GRIN_VERTEX_TYPE grin_get_vertex_property_vertex_type(GRIN_VERTEX_PROPERTY); +GRIN_VERTEX_TYPE grin_get_vertex_property_vertex_type(GRIN_GRAPH, GRIN_VERTEX_PROPERTY); #endif #ifdef GRIN_WITH_EDGE_PROPERTY -bool grin_equal_edge_property(GRIN_EDGE_PROPERTY, GRIN_EDGE_PROPERTY); +bool grin_equal_edge_property(GRIN_GRAPH, GRIN_EDGE_PROPERTY, GRIN_EDGE_PROPERTY); /** * @brief destroy edge property * @param GRIN_EDGE_PROPERTY edge property */ -void grin_destroy_edge_property(GRIN_EDGE_PROPERTY); +void grin_destroy_edge_property(GRIN_GRAPH, GRIN_EDGE_PROPERTY); /** * @brief get property data type @@ -111,7 +111,7 @@ GRIN_DATATYPE grin_get_edge_property_data_type(GRIN_GRAPH, GRIN_EDGE_PROPERTY); * @brief get the edge type that the property is bound to * @param GRIN_EDGE_PROPERTY edge property */ -GRIN_EDGE_TYPE grin_get_edge_property_edge_type(GRIN_EDGE_PROPERTY); +GRIN_EDGE_TYPE grin_get_edge_property_edge_type(GRIN_GRAPH, GRIN_EDGE_PROPERTY); #endif #endif // GRIN_INCLUDE_PROPERTY_PROPERTY_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/propertylist.h b/modules/graph/grin/include/property/propertylist.h index bc976683e..2a64de49d 100644 --- a/modules/graph/grin/include/property/propertylist.h +++ b/modules/graph/grin/include/property/propertylist.h @@ -23,42 +23,42 @@ limitations under the License. #ifdef GRIN_WITH_VERTEX_PROPERTY GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_property_list_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); -size_t grin_get_vertex_property_list_size(GRIN_VERTEX_PROPERTY_LIST); +size_t grin_get_vertex_property_list_size(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST); -GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_list(GRIN_VERTEX_PROPERTY_LIST, size_t); +GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_list(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST, size_t); -GRIN_VERTEX_PROPERTY_LIST grin_create_vertex_property_list(); +GRIN_VERTEX_PROPERTY_LIST grin_create_vertex_property_list(GRIN_GRAPH); -void grin_destroy_vertex_property_list(GRIN_VERTEX_PROPERTY_LIST); +void grin_destroy_vertex_property_list(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST); -bool grin_insert_vertex_property_to_list(GRIN_VERTEX_PROPERTY_LIST, GRIN_VERTEX_PROPERTY); +bool grin_insert_vertex_property_to_list(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST, GRIN_VERTEX_PROPERTY); #endif #ifdef GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT -GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_VERTEX_TYPE, GRIN_VERTEX_PROPERTY_ID); +GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_PROPERTY_ID); -GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_VERTEX_TYPE, GRIN_VERTEX_PROPERTY); +GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_PROPERTY); #endif #ifdef GRIN_WITH_EDGE_PROPERTY GRIN_EDGE_PROPERTY_LIST grin_get_edge_property_list_by_type(GRIN_GRAPH, GRIN_EDGE_TYPE); -size_t grin_get_edge_property_list_size(GRIN_EDGE_PROPERTY_LIST); +size_t grin_get_edge_property_list_size(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST); -GRIN_EDGE_PROPERTY grin_get_edge_property_from_list(GRIN_EDGE_PROPERTY_LIST, size_t); +GRIN_EDGE_PROPERTY grin_get_edge_property_from_list(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST, size_t); -GRIN_EDGE_PROPERTY_LIST grin_create_edge_property_list(); +GRIN_EDGE_PROPERTY_LIST grin_create_edge_property_list(GRIN_GRAPH); -void grin_destroy_edge_property_list(GRIN_EDGE_PROPERTY_LIST); +void grin_destroy_edge_property_list(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST); -bool grin_insert_edge_property_to_list(GRIN_EDGE_PROPERTY_LIST, GRIN_EDGE_PROPERTY); +bool grin_insert_edge_property_to_list(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST, GRIN_EDGE_PROPERTY); #endif #ifdef GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT -GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_EDGE_TYPE, GRIN_EDGE_PROPERTY_ID); +GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_PROPERTY_ID); -GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_EDGE_TYPE, GRIN_EDGE_PROPERTY); +GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_PROPERTY); #endif diff --git a/modules/graph/grin/include/property/propertytable.h b/modules/graph/grin/include/property/propertytable.h index 26c54508f..128133ada 100644 --- a/modules/graph/grin/include/property/propertytable.h +++ b/modules/graph/grin/include/property/propertytable.h @@ -29,16 +29,16 @@ limitations under the License. */ ///@{ #if defined(GRIN_WITH_VERTEX_PROPERTY) || defined(GRIN_WITH_EDGE_PROPERTY) -void grin_destroy_row(GRIN_ROW); +void grin_destroy_row(GRIN_GRAPH, GRIN_ROW); /** @brief the value of a property from row by its position in row */ -const void* grin_get_value_from_row(GRIN_ROW, size_t); +const void* grin_get_value_from_row(GRIN_GRAPH, GRIN_ROW, size_t); /** @brief create a row, usually to get vertex/edge by primary keys */ -GRIN_ROW grin_create_row(); +GRIN_ROW grin_create_row(GRIN_GRAPH); /** @brief insert a value to the end of the row */ -bool grin_insert_value_to_row(GRIN_ROW, void*); +bool grin_insert_value_to_row(GRIN_GRAPH, GRIN_ROW, void*); #endif ///@} @@ -47,7 +47,7 @@ bool grin_insert_value_to_row(GRIN_ROW, void*); * @brief destroy vertex property table * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table */ -void grin_destroy_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE); +void grin_destroy_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE); /** * @brief get the vertex property table of a certain vertex type @@ -64,25 +64,25 @@ GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH, GR /** * @brief get vertex property value from table * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table - * @param Vertex the vertex which is the row index - * @param VertexProperty the vertex property which is the column index + * @param GRIN_VERTEX the vertex which is the row index + * @param GRIN_VERTEX_PROPERTY the vertex property which is the column index * @return can be casted to the property data type by the caller */ -const void* grin_get_value_from_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY); +const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY); /** * @brief get vertex row from table * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table - * @param Vertex the vertex which is the row index + * @param GRIN_VERTEX the vertex which is the row index * @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns */ -GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); +GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); #ifndef GRIN_COLUMN_STORE_TRAIT /** * @brief get vertex row directly from the graph, this API only works for row store system * @param GRIN_GRAPH the graph - * @param Vertex the vertex which is the row index + * @param GRIN_VERTEX the vertex which is the row index * @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns */ GRIN_ROW grin_get_vertex_row(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); @@ -94,7 +94,7 @@ GRIN_ROW grin_get_vertex_row(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST) * @brief destroy edge property table * @param GRIN_EDGE_PROPERTY_TABLE edge property table */ -void grin_destroy_edge_property_table(GRIN_EDGE_PROPERTY_TABLE); +void grin_destroy_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE); /** * @brief get the edge property table of a certain edge type @@ -115,7 +115,7 @@ GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH, GRIN_E * @param GRIN_EDGE_PROPERTY the edge property which is the column index * @return can be casted to the property data type by the caller */ -const void* grin_get_value_from_edge_property_table(GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY); +const void* grin_get_value_from_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY); /** * @brief get edge row from table @@ -123,7 +123,7 @@ const void* grin_get_value_from_edge_property_table(GRIN_EDGE_PROPERTY_TABLE, GR * @param GRIN_EDGE the edge which is the row index * @param GRIN_EDGE_PROPERTY_LIST the edge property list as columns */ -GRIN_ROW grin_get_row_from_edge_property_table(GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY_LIST); +GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY_LIST); #ifndef GRIN_COLUMN_STORE_TRAIT /** diff --git a/modules/graph/grin/include/property/type.h b/modules/graph/grin/include/property/type.h index b874261c6..8bf162df3 100644 --- a/modules/graph/grin/include/property/type.h +++ b/modules/graph/grin/include/property/type.h @@ -22,7 +22,7 @@ limitations under the License. #ifdef GRIN_WITH_VERTEX_PROPERTY // Vertex type -bool grin_equal_vertex_type(GRIN_VERTEX_TYPE, GRIN_VERTEX_TYPE); +bool grin_equal_vertex_type(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_TYPE); GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH, GRIN_VERTEX); @@ -33,28 +33,28 @@ GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH, const char*); // Vertex type list GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH); -void grin_destroy_vertex_type_list(GRIN_VERTEX_TYPE_LIST); +void grin_destroy_vertex_type_list(GRIN_GRAPH, GRIN_VERTEX_TYPE_LIST); -GRIN_VERTEX_TYPE_LIST grin_create_vertex_type_list(); +GRIN_VERTEX_TYPE_LIST grin_create_vertex_type_list(GRIN_GRAPH); -bool grin_insert_vertex_type_to_list(GRIN_VERTEX_TYPE_LIST, GRIN_VERTEX_TYPE); +bool grin_insert_vertex_type_to_list(GRIN_GRAPH, GRIN_VERTEX_TYPE_LIST, GRIN_VERTEX_TYPE); -size_t grin_get_vertex_type_list_size(GRIN_VERTEX_TYPE_LIST); +size_t grin_get_vertex_type_list_size(GRIN_GRAPH, GRIN_VERTEX_TYPE_LIST); -GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_VERTEX_TYPE_LIST, size_t); +GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_GRAPH, GRIN_VERTEX_TYPE_LIST, size_t); #endif #ifdef GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT -GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_VERTEX_TYPE); +GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_GRAPH, GRIN_VERTEX_TYPE); -GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_VERTEX_TYPE_ID); +GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_GRAPH, GRIN_VERTEX_TYPE_ID); #endif #ifdef GRIN_WITH_EDGE_PROPERTY // GRIN_EDGE type -bool grin_equal_edge_type(GRIN_EDGE_TYPE, GRIN_EDGE_TYPE); +bool grin_equal_edge_type(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_TYPE); GRIN_EDGE_TYPE grin_get_edge_type(GRIN_GRAPH, GRIN_EDGE); @@ -65,21 +65,21 @@ GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH, const char*); // GRIN_EDGE type list GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH); -void grin_destroy_edge_type_list(GRIN_EDGE_TYPE_LIST); +void grin_destroy_edge_type_list(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST); -GRIN_EDGE_TYPE_LIST grin_create_edge_type_list(); +GRIN_EDGE_TYPE_LIST grin_create_edge_type_list(GRIN_GRAPH); -bool grin_insert_edge_type_to_list(GRIN_EDGE_TYPE_LIST, GRIN_EDGE_TYPE); +bool grin_insert_edge_type_to_list(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST, GRIN_EDGE_TYPE); -size_t grin_get_edge_type_list_size(GRIN_EDGE_TYPE_LIST); +size_t grin_get_edge_type_list_size(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST); -GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_EDGE_TYPE_LIST, size_t); +GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST, size_t); #endif #ifdef GRIN_NATURAL_EDGE_TYPE_ID_TRAIT -GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_EDGE_TYPE); +GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_GRAPH, GRIN_EDGE_TYPE); -GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_EDGE_TYPE_ID); +GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_GRAPH, GRIN_EDGE_TYPE_ID); #endif /** @name VertexEdgeTypeRelation diff --git a/modules/graph/grin/include/topology/adjacentlist.h b/modules/graph/grin/include/topology/adjacentlist.h index ef35021ce..56ab2ec2d 100644 --- a/modules/graph/grin/include/topology/adjacentlist.h +++ b/modules/graph/grin/include/topology/adjacentlist.h @@ -32,6 +32,7 @@ size_t grin_get_adjacent_list_size(GRIN_GRAPH, GRIN_ADJACENT_LIST); GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST, size_t); GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST, size_t); +#endif #ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH); @@ -40,11 +41,9 @@ GRIN_ADJACENT_LIST_ITERATOR grin_get_next_adjacent_list_iter(GRIN_GRAPH, GRIN_AD bool grin_is_adjacent_list_end(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); -Vertex grin_get_neighbor_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); +GRIN_VERTEX grin_get_neighbor_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); #endif -#endif - #endif // GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ diff --git a/modules/graph/grin/include/topology/edgelist.h b/modules/graph/grin/include/topology/edgelist.h index 7fd5980aa..8f75cfa4d 100644 --- a/modules/graph/grin/include/topology/edgelist.h +++ b/modules/graph/grin/include/topology/edgelist.h @@ -19,11 +19,10 @@ limitations under the License. #include "../predefine.h" #ifdef GRIN_ENABLE_EDGE_LIST - GRIN_EDGE_LIST grin_get_edge_list(GRIN_GRAPH, GRIN_DIRECTION); #ifdef GRIN_WITH_EDGE_PROPERTY -GRIN_EDGE_LIST grin_get_edge_list_by_type(GRIN_GRAPH, EdgeType); +GRIN_EDGE_LIST grin_get_edge_list_by_type(GRIN_GRAPH, GRIN_EDGE_TYPE); #endif void grin_destroy_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); @@ -35,12 +34,13 @@ bool grin_insert_edge_to_list(GRIN_GRAPH, GRIN_EDGE_LIST, GRIN_EDGE); size_t grin_get_edge_list_size(GRIN_GRAPH, GRIN_EDGE_LIST); GRIN_EDGE grin_get_edge_from_list(GRIN_GRAPH, GRIN_EDGE_LIST, size_t); +#endif #ifdef GRIN_ENABLE_EDGE_LIST_ITERATOR GRIN_EDGE_LIST_ITERATOR grin_get_edge_list_begin(GRIN_GRAPH); #ifdef GRIN_WITH_EDGE_PROPERTY -GRIN_EDGE_LIST_ITERATOR grin_get_edge_list_begin_by_type(GRIN_GRAPH, EdgeType); +GRIN_EDGE_LIST_ITERATOR grin_get_edge_list_begin_by_type(GRIN_GRAPH, GRIN_EDGE_TYPE); #endif GRIN_EDGE_LIST_ITERATOR grin_get_next_edge_list_iter(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); @@ -50,6 +50,4 @@ bool grin_is_edge_list_end(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); #endif -#endif - #endif // GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ diff --git a/modules/graph/grin/include/topology/structure.h b/modules/graph/grin/include/topology/structure.h index 34199f0c5..91a16c26c 100644 --- a/modules/graph/grin/include/topology/structure.h +++ b/modules/graph/grin/include/topology/structure.h @@ -40,9 +40,9 @@ size_t grin_get_edge_num_by_type(GRIN_GRAPH, GRIN_DIRECTION, GRIN_EDGE_TYPE); void grin_destroy_vertex(GRIN_GRAPH, GRIN_VERTEX); #ifdef GRIN_WITH_VERTEX_DATA -GRIN_DATATYPE grin_get_vertex_data_type(GRIN_GRAPH, Vertex); +GRIN_DATATYPE grin_get_vertex_data_type(GRIN_GRAPH, GRIN_VERTEX); -GRIN_VERTEX_DATA grin_get_vertex_data_value(GRIN_GRAPH, Vertex); +GRIN_VERTEX_DATA grin_get_vertex_data_value(GRIN_GRAPH, GRIN_VERTEX); void grin_destroy_vertex_data(GRIN_GRAPH, GRIN_VERTEX_DATA); #endif diff --git a/modules/graph/grin/include/topology/vertexlist.h b/modules/graph/grin/include/topology/vertexlist.h index 71f78e179..2a4f05b83 100644 --- a/modules/graph/grin/include/topology/vertexlist.h +++ b/modules/graph/grin/include/topology/vertexlist.h @@ -19,7 +19,6 @@ limitations under the License. #include "../predefine.h" #ifdef GRIN_ENABLE_VERTEX_LIST - GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH); #ifdef GRIN_WITH_VERTEX_PROPERTY @@ -35,6 +34,7 @@ bool grin_insert_vertex_to_list(GRIN_GRAPH, GRIN_VERTEX_LIST, GRIN_VERTEX); size_t grin_get_vertex_list_size(GRIN_GRAPH, GRIN_VERTEX_LIST); GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH, GRIN_VERTEX_LIST, size_t); +#endif #ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH); @@ -47,10 +47,7 @@ GRIN_VERTEX_LIST_ITERATOR grin_get_next_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX bool grin_is_vertex_list_end(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); -Vertex grin_get_vertex_from_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); -#endif - - +GRIN_VERTEX grin_get_vertex_from_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); #endif #endif // GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index a3c6bdab7..ff86f90fc 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -108,7 +108,7 @@ GRIN_VERTEX_LIST grin_get_master_vertices(GRIN_GRAPH g) { auto _g = static_cast(g); auto _vl = new GRIN_VERTEX_LIST_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - _vl->push_back(_g->InnerVertices(vtype)); + _vl->push_back(_GRIN_TYPED_VERTICES_T(vtype, _g->InnerVertices(vtype))); } return _vl; } @@ -117,7 +117,7 @@ GRIN_VERTEX_LIST grin_get_mirror_vertices(GRIN_GRAPH g) { auto _g = static_cast(g); auto _vl = new GRIN_VERTEX_LIST_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - _vl->push_back(_g->OuterVertices(vtype)); + _vl->push_back(_GRIN_TYPED_VERTICES_T(vtype, _g->OuterVertices(vtype))); } return _vl; } @@ -131,7 +131,7 @@ GRIN_VERTEX_LIST grin_get_master_vertices_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto _vl = new GRIN_VERTEX_LIST_T(); - _vl->push_back(_g->InnerVertices(*_vtype)); + _vl->push_back(_GRIN_TYPED_VERTICES_T(*_vtype, _g->InnerVertices(*_vtype))); return _vl; } @@ -139,7 +139,7 @@ GRIN_VERTEX_LIST grin_get_mirror_vertices_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto _vl = new GRIN_VERTEX_LIST_T(); - _vl->push_back(_g->OuterVertices(*_vtype)); + _vl->push_back(_GRIN_TYPED_VERTICES_T(*_vtype, _g->OuterVertices(*_vtype))); return _vl; } diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 5180bd931..010b84c3f 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -98,7 +98,8 @@ typedef GRIN_GRAPH_T::oid_t VERTEX_ORIGINAL_ID_T; #endif #ifdef GRIN_ENABLE_VERTEX_LIST -typedef std::vector GRIN_VERTEX_LIST_T; +typedef std::pair _GRIN_TYPED_VERTICES_T; +typedef std::vector<_GRIN_TYPED_VERTICES_T> GRIN_VERTEX_LIST_T; #endif #ifdef GRIN_ENABLE_ADJACENT_LIST @@ -126,7 +127,6 @@ typedef std::vector GRIN_VERTEX_TYPE_LIST_T; typedef std::pair GRIN_VERTEX_PROPERTY_T; typedef std::vector GRIN_VERTEX_PROPERTY_LIST_T; struct GRIN_VERTEX_PROPERTY_TABLE_T { - GRIN_GRAPH_T* g; unsigned vtype; GRIN_GRAPH_T::vertices_t vertices; }; @@ -138,7 +138,6 @@ typedef std::vector GRIN_EDGE_TYPE_LIST_T; typedef std::pair GRIN_EDGE_PROPERTY_T; typedef std::vector GRIN_EDGE_PROPERTY_LIST_T; struct GRIN_EDGE_PROPERTY_TABLE_T { - GRIN_GRAPH_T* g; unsigned etype; unsigned num; }; diff --git a/modules/graph/grin/src/predicate/order.cc b/modules/graph/grin/src/predicate/order.cc new file mode 100644 index 000000000..78bdeae6a --- /dev/null +++ b/modules/graph/grin/src/predicate/order.cc @@ -0,0 +1,52 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/predicate/order.h" + +#ifdef GRIN_PREDICATE_ENABLE_VERTEX_ORDERING +struct less_than_key { + inline bool operator() (const _GRIN_TYPED_VERTICES_T& tv1, const _GRIN_TYPED_VERTICES_T& tv2) { + if (tv1.first == tv2.first) { + return tv1.second.begin_value() < tv2.second.begin_value(); + } + return tv1.first < tv2.first; + } +}; + +bool grin_sort_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { + auto _vl = static_cast(vl); + std::sort(_vl->begin(), _vl->end(), less_than_key()); + return true; +}; + +bool grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v, size_t& pos) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto _vl = static_cast(vl); + auto vtype = _g->vertex_label(*_v); + pos = 0; + for (auto &tv : *_vl) { + if (tv.first < vtype) pos += tv.second.size(); + else if (tv.first > vtype) return false; + else { + if (tv.second.Contain(*_v)) { + pos += _v->GetValue() - tv.second.begin_value(); + return true; + } else { + return false; + } + } + } + return false; +}; +#endif diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index f749a7354..5eebf5d59 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -11,6 +11,7 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +#include "graph/grin/include/property/property.h" #if defined(GRIN_WITH_PROPERTY_NAME) && defined(GRIN_WITH_VERTEX_PROPERTY) const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { @@ -76,13 +77,13 @@ GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH g, const cha #ifdef GRIN_WITH_VERTEX_PROPERTY -bool grin_equal_vertex_property(GRIN_VERTEX_PROPERTY vp1, GRIN_VERTEX_PROPERTY vp2) { +bool grin_equal_vertex_property(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp1, GRIN_VERTEX_PROPERTY vp2) { auto _vp1 = static_cast(vp1); auto _vp2 = static_cast(vp2); return (*_vp1 == *_vp2); } -void grin_destroy_vertex_property(GRIN_VERTEX_PROPERTY vp) { +void grin_destroy_vertex_property(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { auto _vp = static_cast(vp); delete _vp; } @@ -94,7 +95,7 @@ GRIN_DATATYPE grin_get_vertex_property_data_type(GRIN_GRAPH g, GRIN_VERTEX_PROPE return ArrowToDataType(dt); } -GRIN_VERTEX_TYPE grin_get_vertex_property_vertex_type(GRIN_VERTEX_PROPERTY vp) { +GRIN_VERTEX_TYPE grin_get_vertex_property_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { auto _vp = static_cast(vp); auto vt = new GRIN_VERTEX_TYPE_T(_vp->first); return vt; @@ -103,13 +104,13 @@ GRIN_VERTEX_TYPE grin_get_vertex_property_vertex_type(GRIN_VERTEX_PROPERTY vp) { #ifdef GRIN_WITH_EDGE_PROPERTY -bool grin_equal_edge_property(GRIN_EDGE_PROPERTY ep1, GRIN_EDGE_PROPERTY ep2) { +bool grin_equal_edge_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep1, GRIN_EDGE_PROPERTY ep2) { auto _ep1 = static_cast(ep1); auto _ep2 = static_cast(ep2); return (*_ep1 == *_ep2); } -void grin_destroy_edge_property(GRIN_EDGE_PROPERTY ep) { +void grin_destroy_edge_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { auto _ep = static_cast(ep); delete _ep; } @@ -121,7 +122,7 @@ GRIN_DATATYPE grin_get_edge_property_data_type(GRIN_GRAPH g, GRIN_EDGE_PROPERTY return ArrowToDataType(dt); } -GRIN_EDGE_TYPE grin_get_edge_property_edge_type(GRIN_EDGE_PROPERTY ep) { +GRIN_EDGE_TYPE grin_get_edge_property_edge_type(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { auto _ep = static_cast(ep); auto et = new GRIN_EDGE_TYPE_T(_ep->first); return et; diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index 6ef93aa46..72b1f67b9 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -24,28 +24,28 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_property_list_by_type(GRIN_GRAPH g, GR return vpl; } -size_t grin_get_vertex_property_list_size(GRIN_VERTEX_PROPERTY_LIST vpl) { +size_t grin_get_vertex_property_list_size(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl) { auto _vpl = static_cast(vpl); return _vpl->size(); } -GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_list(GRIN_VERTEX_PROPERTY_LIST vpl, size_t idx) { +GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_list(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl, size_t idx) { auto _vpl = static_cast(vpl); auto vp = new GRIN_VERTEX_PROPERTY_T((*_vpl)[idx]); return vp; } -GRIN_VERTEX_PROPERTY_LIST grin_create_vertex_property_list() { +GRIN_VERTEX_PROPERTY_LIST grin_create_vertex_property_list(GRIN_GRAPH g) { auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); return vpl; } -void grin_destroy_vertex_property_list(GRIN_VERTEX_PROPERTY_LIST vpl) { +void grin_destroy_vertex_property_list(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl) { auto _vpl = static_cast(vpl); delete _vpl; } -bool grin_insert_vertex_property_to_list(GRIN_VERTEX_PROPERTY_LIST vpl, GRIN_VERTEX_PROPERTY vp) { +bool grin_insert_vertex_property_to_list(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl, GRIN_VERTEX_PROPERTY vp) { auto _vpl = static_cast(vpl); auto _vp = static_cast(vp); _vpl->push_back(*_vp); @@ -55,13 +55,13 @@ bool grin_insert_vertex_property_to_list(GRIN_VERTEX_PROPERTY_LIST vpl, GRIN_VER #ifdef GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT -GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY_ID vpi) { +GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY_ID vpi) { auto _vtype = static_cast(vtype); auto vp = new GRIN_VERTEX_PROPERTY_T(*_vtype, vpi); return vp; } -GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY vp) { +GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY vp) { auto _vtype = static_cast(vtype); auto _vp = static_cast(vp); if (*_vtype != _vp->first) return GRIN_NULL_NATURAL_ID; @@ -81,28 +81,28 @@ GRIN_EDGE_PROPERTY_LIST grin_get_edge_property_list_by_type(GRIN_GRAPH g, GRIN_E return epl; } -size_t grin_get_edge_property_list_size(GRIN_EDGE_PROPERTY_LIST epl) { +size_t grin_get_edge_property_list_size(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl) { auto _epl = static_cast(epl); return _epl->size(); } -GRIN_EDGE_PROPERTY grin_get_edge_property_from_list(GRIN_EDGE_PROPERTY_LIST epl, size_t idx) { +GRIN_EDGE_PROPERTY grin_get_edge_property_from_list(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl, size_t idx) { auto _epl = static_cast(epl); auto ep = new GRIN_EDGE_PROPERTY_T((*_epl)[idx]); return ep; } -GRIN_EDGE_PROPERTY_LIST grin_create_edge_property_list() { +GRIN_EDGE_PROPERTY_LIST grin_create_edge_property_list(GRIN_GRAPH g) { auto epl = new GRIN_EDGE_PROPERTY_LIST_T(); return epl; } -void grin_destroy_edge_property_list(GRIN_EDGE_PROPERTY_LIST epl) { +void grin_destroy_edge_property_list(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl) { auto _epl = static_cast(epl); delete _epl; } -bool grin_insert_edge_property_to_list(GRIN_EDGE_PROPERTY_LIST epl, GRIN_EDGE_PROPERTY ep) { +bool grin_insert_edge_property_to_list(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl, GRIN_EDGE_PROPERTY ep) { auto _epl = static_cast(epl); auto _ep = static_cast(ep); _epl->push_back(*_ep); @@ -112,13 +112,13 @@ bool grin_insert_edge_property_to_list(GRIN_EDGE_PROPERTY_LIST epl, GRIN_EDGE_PR #ifdef GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT -GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY_ID epi) { +GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY_ID epi) { auto _etype = static_cast(etype); auto ep = new GRIN_EDGE_PROPERTY_T(*_etype, epi); return ep; } -GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY ep) { +GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY ep) { auto _etype = static_cast(etype); auto _ep = static_cast(ep); if (*_etype != _ep->first) return GRIN_NULL_NATURAL_ID; diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 8dadee46a..d4e84802a 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -14,22 +14,22 @@ limitations under the License. #include "graph/grin/include/property/propertytable.h" #if defined(GRIN_WITH_VERTEX_PROPERTY) || defined(GRIN_WITH_EDGE_PROPERTY) -void grin_destroy_row(GRIN_ROW r) { +void grin_destroy_row(GRIN_GRAPH g, GRIN_ROW r) { auto _r = static_cast(r); delete _r; } -const void* grin_get_value_from_row(GRIN_ROW r, size_t idx) { +const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { auto _r = static_cast(r); return (*_r)[idx]; } -GRIN_ROW grin_create_row() { +GRIN_ROW grin_create_row(GRIN_GRAPH g) { auto r = new GRIN_ROW_T(); return r; } -bool grin_insert_value_to_row(GRIN_ROW r, void* value) { +bool grin_insert_value_to_row(GRIN_GRAPH g, GRIN_ROW r, void* value) { auto _r = static_cast(r); _r->push_back(value); return true; @@ -38,7 +38,7 @@ bool grin_insert_value_to_row(GRIN_ROW r, void* value) { #ifdef GRIN_WITH_VERTEX_PROPERTY -void grin_destroy_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE vpt) { +void grin_destroy_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt) { auto _vpt = static_cast(vpt); delete _vpt; } @@ -47,26 +47,27 @@ GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto vpt = new GRIN_VERTEX_PROPERTY_TABLE_T(); - vpt->g = _g; vpt->vtype = *_vtype; vpt->vertices = _g->InnerVertices(*_vtype); return vpt; } -const void* grin_get_value_from_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE vpt, +const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g); auto _vpt = static_cast(vpt); auto _v = static_cast(v); auto _vp = static_cast(vp); if (_vp->first != _vpt->vtype || !_vpt->vertices.Contain(*_v)) return NULL; auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _vpt->g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return result; } -GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, +GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY_LIST vpl) { + auto _g = static_cast(g); auto _vpt = static_cast(vpt); auto _v = static_cast(v); auto _vpl = static_cast(vpl); @@ -76,7 +77,7 @@ GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE vpt, auto r = new GRIN_ROW_T(); for (auto vp: *_vpl) { if (vp.first != _vpt->vtype) return NULL; - auto array = _vpt->g->vertex_data_table(vp.first)->column(vp.second)->chunk(0); + auto array = _g->vertex_data_table(vp.first)->column(vp.second)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); r->push_back(result); } @@ -85,7 +86,7 @@ GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_VERTEX_PROPERTY_TABLE vpt, #endif #ifdef GRIN_WITH_EDGE_PROPERTY -void grin_destroy_edge_property_table(GRIN_EDGE_PROPERTY_TABLE ept) { +void grin_destroy_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept) { auto _ept = static_cast(ept); delete _ept; } @@ -94,26 +95,27 @@ GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH g, GRIN auto _g = static_cast(g); auto _etype = static_cast(etype); auto ept = new GRIN_EDGE_PROPERTY_TABLE_T(); - ept->g = _g; ept->etype = *_etype; ept->num = _g->edge_data_table(*_etype)->num_rows(); return ept; } -const void* grin_get_value_from_edge_property_table(GRIN_EDGE_PROPERTY_TABLE ept, +const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g); auto _ept = static_cast(ept); auto _e = static_cast(e); auto _ep = static_cast(ep); if (_ep->first != _ept->etype || _e->eid >= _ept->num) return NULL; auto offset = _e->eid; - auto array = _ept->g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return result; } -GRIN_ROW grin_get_row_from_edge_property_table(GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE v, +GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE v, GRIN_EDGE_PROPERTY_LIST epl) { + auto _g = static_cast(g); auto _ept = static_cast(ept); auto _e = static_cast(v); auto _epl = static_cast(epl); @@ -123,7 +125,7 @@ GRIN_ROW grin_get_row_from_edge_property_table(GRIN_EDGE_PROPERTY_TABLE ept, GRI auto r = new GRIN_ROW_T(); for (auto ep: *_epl) { if (ep.first != _ept->etype) return NULL; - auto array = _ept->g->edge_data_table(ep.first)->column(ep.second)->chunk(0); + auto array = _g->edge_data_table(ep.first)->column(ep.second)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); r->push_back(result); } diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 1aa2c0765..951de142a 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -14,7 +14,7 @@ limitations under the License. #include "graph/grin/include/property/type.h" #ifdef GRIN_WITH_VERTEX_PROPERTY -bool grin_equal_vertex_type(GRIN_VERTEX_TYPE vt1, GRIN_VERTEX_TYPE vt2) { +bool grin_equal_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt1, GRIN_VERTEX_TYPE vt2) { auto _vt1 = static_cast(vt1); auto _vt2 = static_cast(vt2); return (*_vt1 == *_vt2); @@ -53,29 +53,29 @@ GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH g) { return vtl; } -void grin_destroy_vertex_type_list(GRIN_VERTEX_TYPE_LIST vtl) { +void grin_destroy_vertex_type_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE_LIST vtl) { auto _vtl = static_cast(vtl); delete _vtl; } -GRIN_VERTEX_TYPE_LIST grin_create_vertex_type_list() { +GRIN_VERTEX_TYPE_LIST grin_create_vertex_type_list(GRIN_GRAPH g) { auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); return vtl; } -bool grin_insert_vertex_type_to_list(GRIN_VERTEX_TYPE_LIST vtl, GRIN_VERTEX_TYPE vt) { +bool grin_insert_vertex_type_to_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE_LIST vtl, GRIN_VERTEX_TYPE vt) { auto _vtl = static_cast(vtl); auto _vt = static_cast(vt); _vtl->push_back(*_vt); return true; } -size_t grin_get_vertex_type_list_size(GRIN_VERTEX_TYPE_LIST vtl) { +size_t grin_get_vertex_type_list_size(GRIN_GRAPH g, GRIN_VERTEX_TYPE_LIST vtl) { auto _vtl = static_cast(vtl); return _vtl->size(); } -GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_VERTEX_TYPE_LIST vtl, size_t idx) { +GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE_LIST vtl, size_t idx) { auto _vtl = static_cast(vtl); auto vt = new GRIN_VERTEX_TYPE_T((*_vtl)[idx]); return vt; @@ -84,12 +84,12 @@ GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_VERTEX_TYPE_LIST vtl, size_ #ifdef GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT -GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_VERTEX_TYPE vt) { +GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { auto _vt = static_cast(vt); return *_vt; } -GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_VERTEX_TYPE_ID vti) { +GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE_ID vti) { auto vt = new GRIN_VERTEX_TYPE_T(vti); return vt; } @@ -97,7 +97,7 @@ GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_VERTEX_TYPE_ID vti) { #ifdef GRIN_WITH_EDGE_PROPERTY -bool grin_equal_edge_type(GRIN_EDGE_TYPE et1, GRIN_EDGE_TYPE et2) { +bool grin_equal_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE et1, GRIN_EDGE_TYPE et2) { auto _et1 = static_cast(et1); auto _et2 = static_cast(et2); return (*_et1 == *_et2); @@ -135,29 +135,29 @@ GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH g) { return etl; } -void grin_destroy_edge_type_list(GRIN_EDGE_TYPE_LIST etl) { +void grin_destroy_edge_type_list(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST etl) { auto _etl = static_cast(etl); delete _etl; } -GRIN_EDGE_TYPE_LIST grin_create_edge_type_list() { +GRIN_EDGE_TYPE_LIST grin_create_edge_type_list(GRIN_GRAPH g) { auto etl = new GRIN_EDGE_TYPE_LIST_T(); return etl; } -bool grin_insert_edge_type_to_list(GRIN_EDGE_TYPE_LIST etl, GRIN_EDGE_TYPE et) { +bool grin_insert_edge_type_to_list(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST etl, GRIN_EDGE_TYPE et) { auto _etl = static_cast(etl); auto _et = static_cast(et); _etl->push_back(*_et); return true; } -size_t grin_get_edge_type_list_size(GRIN_EDGE_TYPE_LIST etl) { +size_t grin_get_edge_type_list_size(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST etl) { auto _etl = static_cast(etl); return _etl->size(); } -GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_EDGE_TYPE_LIST etl, size_t idx) { +GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST etl, size_t idx) { auto _etl = static_cast(etl); auto et = new GRIN_VERTEX_TYPE_T((*_etl)[idx]); return et; @@ -166,12 +166,12 @@ GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_EDGE_TYPE_LIST etl, size_t idx) #ifdef GRIN_NATURAL_EDGE_TYPE_ID_TRAIT -GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_EDGE_TYPE et) { +GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { auto _et = static_cast(et); return *_et; } -GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_EDGE_TYPE_ID eti) { +GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_GRAPH g, GRIN_EDGE_TYPE_ID eti) { auto et = new GRIN_EDGE_TYPE_T(eti); return et; } diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index b7169ed98..9b25013d6 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -21,7 +21,7 @@ GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g) { auto _g = static_cast(g); auto vl = new GRIN_VERTEX_LIST_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - vl->push_back(_g->Vertices(vtype)); + vl->push_back(_GRIN_TYPED_VERTICES_T(vtype, _g->Vertices(vtype))); } return vl; } @@ -31,7 +31,7 @@ GRIN_VERTEX_LIST grin_get_vertex_list_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vty auto _g = static_cast(g); auto vl = new GRIN_VERTEX_LIST_T(); auto _vtype = static_cast(vtype); - vl->push_back(_g->Vertices(*_vtype)); + vl->push_back(_GRIN_TYPED_VERTICES_T(*_vtype, _g->Vertices(*_vtype))); return vl; } #endif @@ -47,17 +47,19 @@ GRIN_VERTEX_LIST grin_create_vertex_list(GRIN_GRAPH g) { } bool grin_insert_vertex_to_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v) { + auto _g = static_cast(g); auto _vl = static_cast(vl); auto _v = static_cast(v); - _vl->push_back(GRIN_GRAPH_T::vertex_range_t(_v->GetValue(), _v->GetValue())); + auto vtype = _g->vertex_label(*_v); + _vl->push_back(_GRIN_TYPED_VERTICES_T(vtype, GRIN_GRAPH_T::vertex_range_t(_v->GetValue(), _v->GetValue()))); return true; } size_t grin_get_vertex_list_size(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _vl = static_cast(vl); size_t result = 0; - for (auto &vr : *_vl) { - result += vr.size(); + for (auto &tv : *_vl) { + result += tv.second.size(); } return result; } @@ -65,11 +67,11 @@ size_t grin_get_vertex_list_size(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t idx) { auto _vl = static_cast(vl); size_t result = 0; - for (auto &vr : *_vl) { - result += vr.size(); + for (auto &tv : *_vl) { + result += tv.second.size(); if (idx < result) { - auto _idx = idx - (result - vr.size()); - auto v = new GRIN_VERTEX_T(vr.begin_value() + _idx); + auto _idx = idx - (result - tv.second.size()); + auto v = new GRIN_VERTEX_T(tv.second.begin_value() + _idx); return v; } } diff --git a/modules/graph/test/grin_arrow_fragment_test.cc b/modules/graph/test/grin_arrow_fragment_test.cc index 420809a3d..0888d5483 100644 --- a/modules/graph/test/grin_arrow_fragment_test.cc +++ b/modules/graph/test/grin_arrow_fragment_test.cc @@ -36,18 +36,18 @@ void TraverseLocalGraph(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION auto g = gaf.get_graph(); auto elabels = grin_get_edge_type_list(g); - auto e_label_num = grin_get_edge_type_list_size(elabels); + auto e_label_num = grin_get_edge_type_list_size(g, elabels); auto vlabels = grin_get_vertex_type_list(g); - auto v_label_num = grin_get_vertex_type_list_size(vlabels); + auto v_label_num = grin_get_vertex_type_list_size(g, vlabels); for (auto i = 0; i < e_label_num; ++i) { - auto elabel = grin_get_edge_type_from_list(elabels, i); + auto elabel = grin_get_edge_type_from_list(g, elabels, i); auto props = grin_get_edge_property_list_by_type(g, elabel); - auto prop = grin_get_edge_property_from_list(props, 0); + auto prop = grin_get_edge_property_from_list(g, props, 0); auto prop_dt = grin_get_edge_property_data_type(g, prop); auto dt_name = GetDataTypeName(prop_dt); for (auto j = 0; j < v_label_num; ++j) { - auto vlabel = grin_get_vertex_type_from_list(vlabels, j); + auto vlabel = grin_get_vertex_type_from_list(g, vlabels, j); auto iv = gaf.InnerVertices(vlabel); for (auto v: iv) { auto al = gaf.GetOutgoingAdjList(v, elabel); diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index f6b0f34ec..14fb3e19d 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -52,13 +52,13 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_from_edge_type(g, etype); // get related source vertex type list GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_from_edge_type(g, etype); // get related destination vertex type list - size_t src_vtypes_num = grin_get_vertex_type_list_size(src_vtypes); - size_t dst_vtypes_num = grin_get_vertex_type_list_size(dst_vtypes); + size_t src_vtypes_num = grin_get_vertex_type_list_size(g, src_vtypes); + size_t dst_vtypes_num = grin_get_vertex_type_list_size(g, dst_vtypes); assert(src_vtypes_num == dst_vtypes_num); // the src & dst vertex type lists must be aligned for (size_t i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type - GRIN_VERTEX_TYPE src_vtype = grin_get_vertex_type_from_list(src_vtypes, i); // get src type - GRIN_VERTEX_TYPE dst_vtype = grin_get_vertex_type_from_list(dst_vtypes, i); // get dst type + GRIN_VERTEX_TYPE src_vtype = grin_get_vertex_type_from_list(g, src_vtypes, i); // get src type + GRIN_VERTEX_TYPE dst_vtype = grin_get_vertex_type_from_list(g, dst_vtypes, i); // get dst type GRIN_VERTEX_PROPERTY dst_vp = grin_get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type if (dst_vp == GRIN_NULL_VERTEX_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" @@ -84,10 +84,10 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part if (check_flag) { GRIN_EDGE edge = grin_get_edge_from_adjacent_list(g, adj_list, k); GRIN_EDGE_TYPE edge_type = grin_get_edge_type(g, edge); - if (!grin_equal_edge_type(edge_type, etype)) continue; + if (!grin_equal_edge_type(g, edge_type, etype)) continue; } GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list(g, adj_list, k); // get the dst vertex u - const void* value = grin_get_value_from_vertex_property_table(dst_vpt, u, dst_vp); // get the property value of "features" of u + const void* value = grin_get_value_from_vertex_property_table(g, dst_vpt, u, dst_vp); // get the property value of "features" of u GRIN_VERTEX_REF uref = grin_get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions GRIN_PARTITION u_master_partition = grin_get_master_partition_from_vertex_ref(g, uref); // get the master partition for u From caf908c91c8de5fc90924184ecb23e8acdc04730 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Thu, 9 Mar 2023 21:27:01 +0800 Subject: [PATCH 15/85] update macros and docs --- modules/graph/fragment/arrow_fragment.grin.h | 63 +- modules/graph/grin/docs/README.md | 102 ++- .../graph/grin/include/partition/partition.h | 132 +--- .../graph/grin/include/partition/reference.h | 90 +++ .../graph/grin/include/partition/topology.h | 104 +++ modules/graph/grin/include/predefine.h | 661 ++++++++++++++++-- modules/graph/grin/include/predicate/order.h | 2 +- .../graph/grin/include/property/partition.h | 93 +++ .../graph/grin/include/property/primarykey.h | 2 +- .../graph/grin/include/property/property.h | 4 +- .../grin/include/property/propertylist.h | 8 +- .../grin/include/property/propertytable.h | 22 +- .../graph/grin/include/property/topology.h | 52 ++ modules/graph/grin/include/property/type.h | 27 +- .../grin/include/topology/adjacentlist.h | 8 +- .../graph/grin/include/topology/edgelist.h | 12 +- .../graph/grin/include/topology/structure.h | 33 +- .../graph/grin/include/topology/vertexlist.h | 12 +- modules/graph/grin/src/partition/partition.cc | 161 +---- modules/graph/grin/src/partition/reference.cc | 109 +++ modules/graph/grin/src/partition/topology.cc | 106 +++ modules/graph/grin/src/predefine.cc | 46 ++ modules/graph/grin/src/predefine.h | 46 +- modules/graph/grin/src/predicate/order.cc | 29 +- modules/graph/grin/src/property/property.cc | 4 +- .../graph/grin/src/property/propertylist.cc | 8 +- .../graph/grin/src/property/propertytable.cc | 30 +- modules/graph/grin/src/property/topology.cc | 79 +++ modules/graph/grin/src/property/type.cc | 75 +- .../graph/grin/src/topology/adjacentlist.cc | 77 +- modules/graph/grin/src/topology/structure.cc | 67 +- modules/graph/grin/src/topology/vertexlist.cc | 58 +- .../graph/test/grin_arrow_fragment_test.cc | 1 + modules/graph/test/grin_test.cc | 28 +- 34 files changed, 1653 insertions(+), 698 deletions(-) create mode 100644 modules/graph/grin/include/partition/reference.h create mode 100644 modules/graph/grin/include/partition/topology.h create mode 100644 modules/graph/grin/include/property/partition.h create mode 100644 modules/graph/grin/include/property/topology.h create mode 100644 modules/graph/grin/src/partition/reference.cc create mode 100644 modules/graph/grin/src/partition/topology.cc create mode 100644 modules/graph/grin/src/property/topology.cc diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index 15532b34e..466ed9739 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -50,10 +50,13 @@ limitations under the License. #include "graph/grin/include/topology/vertexlist.h" #include "graph/grin/include/topology/adjacentlist.h" #include "graph/grin/include/partition/partition.h" +#include "graph/grin/include/partition/topology.h" +#include "graph/grin/include/partition/reference.h" #include "graph/grin/include/property/type.h" #include "graph/grin/include/property/property.h" #include "graph/grin/include/property/propertylist.h" #include "graph/grin/include/property/propertytable.h" +#include "graph/grin/include/property/topology.h" #include "graph/grin/src/predefine.h" @@ -367,38 +370,44 @@ class GRIN_ArrowFragment { } vertex_range_t Vertices(GRIN_VERTEX_TYPE label) const { - auto vl = grin_get_vertex_list_by_type(g_, label); - auto sz = grin_get_vertex_list_size(g_, vl); - return vertex_range_t(g_, vl, 0, sz); + auto vl = grin_get_vertex_list(g_); + auto vl1 = grin_filter_type_for_vertex_list(g_, label, vl); + auto sz = grin_get_vertex_list_size(g_, vl1); + return vertex_range_t(g_, vl1, 0, sz); } vertex_range_t InnerVertices(GRIN_VERTEX_TYPE label) const { - auto vl = grin_get_master_vertices_by_type(g_, label); - auto sz = grin_get_vertex_list_size(g_, vl); - return vertex_range_t(g_, vl, 0, sz); + auto vl = grin_get_vertex_list(g_); + auto vl1 = grin_filter_type_for_vertex_list(g_, label, vl); + auto vl2 = grin_filter_master_for_vertex_list(g_, vl1); + auto sz = grin_get_vertex_list_size(g_, vl2); + return vertex_range_t(g_, vl2, 0, sz); } vertex_range_t OuterVertices(GRIN_VERTEX_TYPE label) const { - auto vl = grin_get_mirror_vertices_by_type(g_, label); - auto sz = grin_get_vertex_list_size(g_, vl); - return vertex_range_t(g_, vl, 0, sz); + auto vl = grin_get_vertex_list(g_); + auto vl1 = grin_filter_type_for_vertex_list(g_, label, vl); + auto vl2 = grin_filter_mirror_for_vertex_list(g_, vl1); + auto sz = grin_get_vertex_list_size(g_, vl2); + return vertex_range_t(g_, vl2, 0, sz); } vertex_range_t InnerVerticesSlice(GRIN_VERTEX_TYPE label, size_t start, size_t end) const { - auto vl = grin_get_master_vertices_by_type(g_, label); - auto _end = grin_get_vertex_list_size(g_, vl); + auto vl = grin_get_vertex_list(g_); + auto vl1 = grin_filter_type_for_vertex_list(g_, label, vl); + auto vl2 = grin_filter_master_for_vertex_list(g_, vl1); + auto _end = grin_get_vertex_list_size(g_, vl2); CHECK(start <= end && start <= _end); if (end <= _end) { - return vertex_range_t(g_, vl, start, end); + return vertex_range_t(g_, vl2, start, end); } else { - return vertex_range_t(g_, vl, start, _end); + return vertex_range_t(g_, vl2, start, _end); } } inline size_t GetVerticesNum(GRIN_VERTEX_TYPE label) const { - auto vl = grin_get_vertex_list_by_type(g_, label); - return grin_get_vertex_list_size(g_, vl); + return grin_get_vertex_num_by_type(g_, label); } template @@ -488,13 +497,15 @@ class GRIN_ArrowFragment { inline size_t GetInnerVerticesNum(GRIN_VERTEX_TYPE label) const { - auto vl = grin_get_master_vertices_by_type(g_, label); - return grin_get_vertex_list_size(g_, vl); + auto vl = grin_get_vertex_list(g_); + auto vl1 = grin_filter_type_for_vertex_list(g_, label, vl); + return grin_get_vertex_list_size(g_, vl1); } inline size_t GetOuterVerticesNum(GRIN_VERTEX_TYPE label) const { - auto vl = grin_get_mirror_vertices_by_type(g_, label); - return grin_get_vertex_list_size(g_, vl); + auto vl = grin_get_vertex_list(g_); + auto vl1 = grin_filter_type_for_vertex_list(g_, label, vl); + return grin_get_vertex_list_size(g_, vl1); } inline bool IsInnerVertex(GRIN_VERTEX v) const { @@ -507,18 +518,20 @@ class GRIN_ArrowFragment { inline adj_list_t GetIncomingAdjList(GRIN_VERTEX v, GRIN_EDGE_TYPE e_label) const { - auto al = grin_get_adjacent_list_by_edge_type(g_, GRIN_DIRECTION::IN, v, e_label); - auto sz = grin_get_adjacent_list_size(g_, al); + auto al = grin_get_adjacent_list(g_, GRIN_DIRECTION::IN, v); + auto al1 = grin_filter_edge_type_for_adjacent_list(g_, e_label, al); + auto sz = grin_get_adjacent_list_size(g_, al1); auto ept = grin_get_edge_property_table_by_type(g_, e_label); - return adj_list_t(g_, al, ept, 0, sz); + return adj_list_t(g_, al1, ept, 0, sz); } inline adj_list_t GetOutgoingAdjList(GRIN_VERTEX v, GRIN_EDGE_TYPE e_label) const { - auto al = grin_get_adjacent_list_by_edge_type(g_, GRIN_DIRECTION::OUT, v, e_label); - auto sz = grin_get_adjacent_list_size(g_, al); + auto al = grin_get_adjacent_list(g_, GRIN_DIRECTION::OUT, v); + auto al1 = grin_filter_edge_type_for_adjacent_list(g_, e_label, al); + auto sz = grin_get_adjacent_list_size(g_, al1); auto ept = grin_get_edge_property_table_by_type(g_, e_label); - return adj_list_t(g_, al, ept, 0, sz); + return adj_list_t(g_, al1, ept, 0, sz); } GRIN_GRAPH get_graph() { return g_; } diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index 43b8f7157..ad4f31dc7 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -12,6 +12,33 @@ storage systems in a uniform way. - Properties are bound to vertex and edge types, but some may have the same name. - Labels can be assigned to vertices and edges (NOT their types) primarily for query filtering, and labels have no properties. +### Partition Strategies +#### Edge-cut Partition Strategy +- Vertex data are local complete for master vertices +- Edge data are local complete for all edges +- Neighbors are local complete for master vertices +- Vertex properties are local complete for master vertices +- Edge properties are local complete for all edges + +#### Vertex-cut Partition Strategy +- Vertex data are local complete for all vertices +- Edge data are local complete for all edges +- Mirror partition list is available for master vertices to broadcast messages +- Vertex properties are local complete for all vertices +- Edge properties are local complete for all edges + +### Assumption Macros +- GRIN also provides granula assumption macros to describe storage assumptions. +- Some assumptions may dominate others, so storage providers should take care when setting these assumptions. +- Take assumptions on vertex property local complete as example, GRIN provides four macros: + 1. GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE + 2. GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE + 3. GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE + 4. GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +- Here 1. dominates others, 2. dominates 4., and 3. also dominates 4., that means 2. to 4. are undefined when 1. is defined. +- Suppose only 3. is defined, it means vertices of certain types have all the properties locally complete, no matter the vertex is master or mirror. In this case, GRIN provides an API to return +these vertex types. + ----- ## Design Principles @@ -184,50 +211,53 @@ A mixed example with structure, partition and property the destination is a mirror vertex, given the context of "edge-cut" partition strategy that the underlying storage uses. Then for each of these vertices, we send the value of the "features" property to its master partition. */ - auto g = get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition + GRIN_GRAPH g = grin_get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition - auto etype = get_edge_type_by_name(g, edge_type_name); // get edge type from name - auto src_vtypes = get_src_types_from_edge_type(g, etype); // get related source vertex type list - auto dst_vtypes = get_dst_types_from_edge_type(g, etype); // get related destination vertex type list + GRIN_EDGE_TYPE etype = grin_get_edge_type_by_name(g, edge_type_name); // get edge type from name + GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_from_edge_type(g, etype); // get related source vertex type list + GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_from_edge_type(g, etype); // get related destination vertex type list - auto src_vtypes_num = get_vertex_type_list_size(src_vtypes); - auto dst_vtypes_num = get_vertex_type_list_size(dst_vtypes); + size_t src_vtypes_num = grin_get_vertex_type_list_size(g, src_vtypes); + size_t dst_vtypes_num = grin_get_vertex_type_list_size(g, dst_vtypes); assert(src_vtypes_num == dst_vtypes_num); // the src & dst vertex type lists must be aligned - for (auto i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type - auto src_vtype = get_vertex_type_from_list(src_vtypes, i); // get src type - auto dst_vtype = get_vertex_type_from_list(dst_vtypes, i); // get dst type + for (size_t i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type + GRIN_VERTEX_TYPE src_vtype = grin_get_vertex_type_from_list(g, src_vtypes, i); // get src type + GRIN_VERTEX_TYPE dst_vtype = grin_get_vertex_type_from_list(g, dst_vtypes, i); // get dst type - auto dst_vp = get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type - if (dst_vp == NULL_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" + GRIN_VERTEX_PROPERTY dst_vp = grin_get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type + if (dst_vp == GRIN_NULL_VERTEX_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" - auto dst_vpt = get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use - auto dst_vp_dt = get_vertex_property_data_type(g, dst_vp); // prepare property type for later use + GRIN_VERTEX_PROPERTY_TABLE dst_vpt = grin_get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use + GRIN_DATATYPE dst_vp_dt = grin_get_vertex_property_data_type(g, dst_vp); // prepare property type for later use - auto src_vl = get_master_vertices_by_type(g, src_vtype); // we only need master vertices under source type + GRIN_VERTEX_LIST __src_vl = grin_get_vertex_list(g); // get the vertex list + GRIN_VERTEX_LIST _src_vl = grin_filter_type_for_vertex_list(g, src_vtype, __src_vl); // filter the vertex of source type + GRIN_VERTEX_LIST src_vl = grin_filter_master_for_vertex_list(g, _src_vl); // filter master vertices under source type - auto src_vl_num = get_vertex_list_size(src_vl); - for (auto j = 0; j < src_vl_num; ++j) { // iterate the src vertex - auto v = get_vertex_from_list(src_vl, j); - auto adj_list = get_adjacent_list_by_edge_type(g, Direction::OUT, v, etype); // get the adjacent list of v with edges under etype - bool check_flag = false; - if (adj_list == NULL_LIST) { // NULL_LIST means the storage does NOT support getting adj_list by edge type, note that list with size 0 is NOT a NULL_LIST - adj_list = get_adjacent_list(g, Direction::OUT, v); - check_flag = true; // Then we should scan the full adj list and filter edge type by ourselves. - } - - auto al_sz = get_adjacent_list_size(adj_list); - for (auto k = 0; k < al_sz; ++k) { - if (check_flag) { - auto edge = get_edge_from_adjacent_list(adj_list, k); - auto edge_type = get_edge_type(g, edge); - if (!equal_edge_type(edge_type, etype)) continue; - } - auto u = get_neighbor_from_adjacent_list(adj_list, k); // get the dst vertex u - auto value = get_value_from_vertex_property_table(dst_vpt, u, dst_vp); // get the property value of "features" of u - - auto uref = get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions - auto u_master_partition = get_master_partition_from_vertex_ref(g, uref); // get the master partition for u + size_t src_vl_num = grin_get_vertex_list_size(g, src_vl); + for (size_t j = 0; j < src_vl_num; ++j) { // iterate the src vertex + GRIN_VERTEX v = grin_get_vertex_from_list(g, src_vl, j); + + #ifdef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST + GRIN_ADJACENT_LIST _adj_list = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v + GRIN_ADJACENT_LIST adj_list = grin_filter_edge_type_for_adjacent_list(g, etype, _adj_list); // filter edges under etype + #else + GRIN_ADJACENT_LIST adj_lsit = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v + #endif + + size_t al_sz = grin_get_adjacent_list_size(g, adj_list); + for (size_t k = 0; k < al_sz; ++k) { + #ifndef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST + GRIN_EDGE edge = grin_get_edge_from_adjacent_list(g, adj_list, k); + GRIN_EDGE_TYPE edge_type = grin_get_edge_type(g, edge); + if (!grin_equal_edge_type(g, edge_type, etype)) continue; + #endif + GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list(g, adj_list, k); // get the dst vertex u + const void* value = grin_get_value_from_vertex_property_table(g, dst_vpt, u, dst_vp); // get the property value of "features" of u + + GRIN_VERTEX_REF uref = grin_get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions + GRIN_PARTITION u_master_partition = grin_get_master_partition_from_vertex_ref(g, uref); // get the master partition for u send_value(u_master_partition, uref, dst_vp_dt, value); // the value must be casted to the correct type based on dst_vp_dt before sending } diff --git a/modules/graph/grin/include/partition/partition.h b/modules/graph/grin/include/partition/partition.h index ead1c742e..8a588d78e 100644 --- a/modules/graph/grin/include/partition/partition.h +++ b/modules/graph/grin/include/partition/partition.h @@ -47,140 +47,10 @@ void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); #endif -#ifdef GRIN_NATURAL_PARTITION_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION GRIN_PARTITION grin_get_partition_from_id(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_ID); GRIN_PARTITION_ID grin_get_partition_id(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); #endif -// master & mirror vertices for vertexcut partition -// while they refer to inner & outer vertices in edgecut partition -#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_ENABLE_VERTEX_LIST) -GRIN_VERTEX_LIST grin_get_master_vertices(GRIN_GRAPH); - -GRIN_VERTEX_LIST grin_get_mirror_vertices(GRIN_GRAPH); - -GRIN_VERTEX_LIST grin_get_mirror_vertices_by_partition(GRIN_GRAPH, GRIN_PARTITION); - -#ifdef GRIN_WITH_VERTEX_PROPERTY -GRIN_VERTEX_LIST grin_get_master_vertices_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); - -GRIN_VERTEX_LIST grin_get_mirror_vertices_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); - -GRIN_VERTEX_LIST grin_get_mirror_vertices_by_type_partition(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_PARTITION); -#endif -#endif - -#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_ENABLE_ADJACENT_LIST) -/** - * @brief get the adjacentlist of a vertex where the neigbors are only master vertices - * @param GRIN_GRAPH the graph - * @param GRIN_DIRECTION incoming or outgoing - * @param GRIN_VERTEX the vertex - */ -GRIN_ADJACENT_LIST grin_get_adjacent_master_list(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); - -/** - * @brief get the adjacentlist of a vertex where the neigbors are only mirror vertices - * @param GRIN_GRAPH the graph - * @param GRIN_DIRECTION incoming or outgoing - * @param GRIN_VERTEX the vertex - */ -GRIN_ADJACENT_LIST grin_get_adjacent_mirror_list(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); - -/** - * @brief get the adjacentlist of a vertex where the neigbors are only mirror vertices - * whose master vertices are in a specific partition - * @param GRIN_GRAPH the graph - * @param GRIN_DIRECTION incoming or outgoing - * @param GRIN_PARTITION the specific partition - * @param GRIN_VERTEX the vertex - */ -GRIN_ADJACENT_LIST grin_get_adjacent_mirror_list_by_partition(GRIN_GRAPH, GRIN_DIRECTION, - GRIN_PARTITION, GRIN_VERTEX); -#endif - - -// Vertex ref refers to the same vertex referred in other partitions, -// while edge ref is likewise. Both can be serialized to const char* for -// message transporting and deserialized on the other end. -#ifdef GRIN_ENABLE_VERTEX_REF -GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH, GRIN_VERTEX); - -/** - * @brief get the local vertex from the vertex ref - * if the vertex ref is not regconized, a null vertex is returned - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_REF the vertex ref - */ -GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); - -/** - * @brief get the master partition of a vertex ref. - * Some storage can still provide the master partition of the vertex ref, - * even if the vertex ref can NOT be recognized locally. - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_REF the vertex ref - */ -bool grin_is_master_vertex(GRIN_GRAPH, GRIN_VERTEX); - -bool grin_is_mirror_vertex(GRIN_GRAPH, GRIN_VERTEX); - -GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); - -const char* grin_serialize_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); - -GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH, const char*); -#endif - -#ifdef GRIN_ENABLE_EDGE_REF -GRIN_EDGE_REF grin_get_edge_ref_for_edge(GRIN_GRAPH, GRIN_PARTITION, GRIN_EDGE); - -GRIN_EDGE grin_get_edge_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); - -Partition grin_get_master_partition_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); - -const char* grin_serialize_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); - -GRIN_EDGE_REF grin_deserialize_to_edge_ref(GRIN_GRAPH, const char*); -#endif - -// The concept of local_complete refers to whether we can get complete data or properties -// locally in the partition. It is orthogonal to the concept of master/mirror which -// is mainly designed for data aggregation. In some extremely cases, master vertices -// may NOT contain all the data or properties locally. -bool grin_is_vertex_neighbor_local_complete(GRIN_GRAPH, GRIN_VERTEX); - -/** - * @brief get the partitions whose combination can provide the complete - * neighbors of a vertex. - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX the vertex - */ -GRIN_PARTITION_LIST grin_vertex_neighbor_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); - -#ifdef GRIN_WITH_VERTEX_DATA -bool grin_is_vertex_data_local_complete(GRIN_GRAPH, GRIN_VERTEX); - -GRIN_PARTITION_LIST grin_vertex_data_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); -#endif - -#ifdef GRIN_WITH_VERTEX_PROPERTY -bool grin_is_vertex_property_local_complete(GRIN_GRAPH, GRIN_VERTEX); - -GRIN_PARTITION_LIST grin_vertex_property_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); -#endif - -#ifdef GRIN_WITH_EDGE_DATA -bool grin_is_edge_data_local_complete(GRIN_GRAPH, GRIN_EDGE); - -GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); -#endif - -#ifdef GRIN_WITH_EDGE_PROPERTY -bool grin_is_edge_property_local_complete(GRIN_GRAPH, GRIN_EDGE); - -GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); -#endif - #endif // GRIN_INCLUDE_PARTITION_PARTITION_H_ diff --git a/modules/graph/grin/include/partition/reference.h b/modules/graph/grin/include/partition/reference.h new file mode 100644 index 000000000..6483564e1 --- /dev/null +++ b/modules/graph/grin/include/partition/reference.h @@ -0,0 +1,90 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/** + @file reference.h + @brief Define the reference related APIs +*/ + +#ifndef GRIN_INCLUDE_PARTITION_REFERENCE_H_ +#define GRIN_INCLUDE_PARTITION_REFERENCE_H_ + +#include "../predefine.h" + +// Vertex ref refers to the same vertex referred in other partitions, +// while edge ref is likewise. Both can be serialized to const char* for +// message transporting and deserialized on the other end. +#ifdef GRIN_ENABLE_VERTEX_REF +GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH, GRIN_VERTEX); + +/** + * @brief get the local vertex from the vertex ref + * if the vertex ref is not regconized, a null vertex is returned + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_REF the vertex ref + */ +GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); + +/** + * @brief get the master partition of a vertex ref. + * Some storage can still provide the master partition of the vertex ref, + * even if the vertex ref can NOT be recognized locally. + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_REF the vertex ref + */ +GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); + +const char* grin_serialize_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); + +GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH, const char*); + +bool grin_is_master_vertex(GRIN_GRAPH, GRIN_VERTEX); + +bool grin_is_mirror_vertex(GRIN_GRAPH, GRIN_VERTEX); +#endif + +#ifdef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST +GRIN_PARTITION_LIST grin_get_master_vertex_mirror_partition_list(GRIN_GRAPH, GRIN_VERTEX); +#endif + +#ifdef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST +GRIN_PARTITION_LIST grin_get_mirror_vertex_mirror_partition_list(GRIN_GRAPH, GRIN_VERTEX); +#endif + +#ifdef GRIN_ENABLE_EDGE_REF +GRIN_EDGE_REF grin_get_edge_ref_for_edge(GRIN_GRAPH, GRIN_EDGE); + +GRIN_EDGE grin_get_edge_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); + +GRIN_PARTITION grin_get_master_partition_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); + +const char* grin_serialize_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); + +GRIN_EDGE_REF grin_deserialize_to_edge_ref(GRIN_GRAPH, const char*); + +bool grin_is_master_edge(GRIN_GRAPH, GRIN_EDGE); + +bool grin_is_mirror_edge(GRIN_GRAPH, GRIN_EDGE); +#endif + +#ifdef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST +GRIN_PARTITION_LIST grin_get_master_edge_mirror_partition_list(GRIN_GRAPH, GRIN_EDGE); +#endif + +#ifdef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST +GRIN_PARTITION_LIST grin_get_mirror_edge_mirror_partition_list(GRIN_GRAPH, GRIN_EDGE); +#endif + +#endif // GRIN_INCLUDE_PARTITION_REFERENCE_H_ diff --git a/modules/graph/grin/include/partition/topology.h b/modules/graph/grin/include/partition/topology.h new file mode 100644 index 000000000..7e0dd9bd3 --- /dev/null +++ b/modules/graph/grin/include/partition/topology.h @@ -0,0 +1,104 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/** + @file partition/topology.h + @brief Define the topoloy related APIs under partitioned graph +*/ + +#ifndef GRIN_INCLUDE_PARTITION_TOPOLOGY_H_ +#define GRIN_INCLUDE_PARTITION_TOPOLOGY_H_ + +#include "../predefine.h" + +#if defined(GRIN_WITH_VERTEX_DATA) && \ + !defined(GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE) +bool grin_is_vertex_data_local_complete(GRIN_GRAPH, GRIN_VERTEX); + +GRIN_PARTITION_LIST grin_vertex_data_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); +#endif + +#if defined(GRIN_WITH_EDGE_DATA) && \ + !defined(GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE) +bool grin_is_edge_data_local_complete(GRIN_GRAPH, GRIN_EDGE); + +GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); +#endif + + +#ifdef GRIN_TRAIT_FILTER_MASTER_FOR_VERTEX_LIST +GRIN_VERTEX_LIST grin_filter_master_for_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); + +GRIN_VERTEX_LIST grin_filter_mirror_for_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); +#endif + + +#ifdef GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST +GRIN_VERTEX_LIST grin_filter_partition_for_vertex_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_VERTEX_LIST); +#endif + + + +#ifdef GRIN_TRAIT_FILTER_MASTER_FOR_EDGE_LIST +GRIN_EDGE_LIST grin_filter_master_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); + +GRIN_EDGE_LIST grin_filter_mirror_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); +#endif + + +#ifdef GRIN_TRAIT_FILTER_PARTITION_FOR_EDGE_LIST +GRIN_EDGE_LIST grin_filter_partition_for_edge_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_EDGE_LIST); +#endif + + +#if defined(GRIN_ENABLE_ADJACENT_LIST) && \ + !defined(GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE) +// The concept of local_complete refers to whether we can get complete data or properties +// locally in the partition. It is orthogonal to the concept of master/mirror which +// is mainly designed for data aggregation. In some extremely cases, master vertices +// may NOT contain all the data or properties locally. +bool grin_is_vertex_neighbor_local_complete(GRIN_GRAPH, GRIN_VERTEX); + +/** + * @brief get the partitions whose combination can provide the complete + * neighbors of a vertex. + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX the vertex + */ +GRIN_PARTITION_LIST grin_vertex_neighbor_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); +#endif + + +#ifdef GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_filter_master_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); + +GRIN_ADJACENT_LIST grin_filter_mirror_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); +#endif + +#ifdef GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_filter_neighbor_partition_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); +#endif + + +#endif // GRIN_INCLUDE_PARTITION_TOPOLOGY_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/predefine.h b/modules/graph/grin/include/predefine.h index d8fd5dd26..9cee465ae 100644 --- a/modules/graph/grin/include/predefine.h +++ b/modules/graph/grin/include/predefine.h @@ -107,18 +107,8 @@ typedef enum { */ #define GRIN_ENABLE_ADJACENT_LIST_ITERATOR -/** - * -*/ -#define GRIN_GRANULA_ENALBE_VERTEX_LIST_BY_TYPE - -#define GRIN_GRANULA_ENABLE_ADJACENT_LIST_BY_PARTITION -#define GRIN_GRANULA_ENABLE_ADJACENT_LIST_BY_TYPE - -#define GRIN_GRANULA_ENABLE_ADJACENT_LIST_BY_PARTITION_TYPE - -#ifndef GRIN_DOXYGEN_SKIP +#ifndef GRIN_DOXYGEN_SKIP // disabled by storage #undef GRIN_WITH_VERTEX_DATA #undef GRIN_WITH_EDGE_DATA #undef GRIN_ENABLE_VERTEX_LIST_ITERATOR @@ -145,7 +135,7 @@ typedef enum { * @brief The storage provides natural number IDs for partitions. * It follows the design principle of natural number ID trait in GRIN. */ -#define GRIN_NATURAL_PARTITION_ID_TRAIT +#define GRIN_TRAIT_NATURAL_ID_FOR_PARTITION /** @ingroup PartitionMacros * @brief The storage provides reference of vertex that can be @@ -158,28 +148,254 @@ typedef enum { * recognized in other partitions where the edge also appears. */ #define GRIN_ENABLE_EDGE_REF +///@} -#ifndef GRIN_ENABLE_GRAPH_PARTITION -#undef GRIN_NATURAL_PARTITION_ID_TRAIT + + +/** @name PartitionStrategyMacros + * @brief Macros to define partition strategy assumptions, a partition strategy + * can be seen as a combination of detail partition assumptions which are defined after + * the strategies. Please refer to the documents for strategy details. +*/ +///@{ +/** @ingroup PartitionStrategyMacros + * @brief The storage ONLY uses edge-cut partition strategy. This means the + * storage's entire partition strategy complies with edge-cut strategy + * definition in GRIN. +*/ +#define GRIN_ASSUME_EDGE_CUT_PARTITION + +/** @ingroup PartitionStrategyMacros + * @brief The storage ONLY uses vertex-cut partition strategy. This means the + * storage's entire partition strategy complies with vertex-cut strategy + * definition in GRIN. +*/ +#define GRIN_ASSUME_VERTEX_CUT_PARTITION +///@} + +/** @name PartitionAssumptionMacros + * @brief Macros to define detailed partition assumptions with respect to the + * concept of local complete. Please refer to the documents for the meaning of + * local complete. +*/ +///@{ +/** @ingroup PartitionAssumptionMacros + * @brief Assume the vertex data are local complete for all the vertices, + * thus there is no need to fetch vertex data from other partitions. +*/ +#define GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE + +/** @ingroup PartitionAssumptionMacros + * @brief Assume the vertex data are local complete for master vertices, + * and the vertex data of a mirror vertex can be fetched from its master partition. +*/ +#define GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE + +/** @ingroup PartitionAssumptionMacros + * @brief Assume the edge data are local complete for all the edges, + * thus there is no need to fetch edge data from other partitions. +*/ +#define GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE + +/** @ingroup PartitionAssumptionMacros + * @brief Assume the edge data are local complete for master edges, + * and the edge data of a mirror edge can be fetched from its master partition. +*/ +#define GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE + +/** @ingroup PartitionAssumptionMacros + * @brief Assume neighbors of a vertex is always local complete for all vertices. +*/ +#define GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE + +/** @ingroup PartitionAssumptionMacros + * @brief Assume neighbors of a vertex is always local complete for master vertices. +*/ +#define GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +///@} + +/** @name TraitMirrorPartitionMacros + * @brief Macros for storage that provides the partition list where the mirror + * vertices are located. This trait is usually enabled by storages using vertex-cut + * partition strategy. +*/ +///@{ +/** @ingroup TraitMirrorPartitionMacros + * @brief The storage provides the partition list where the mirror + * vertices are located of a local master vertex. +*/ +#define GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST + +/** @ingroup TraitMirrorPartitionMacros + * @brief The storage provides the partition list where the mirror + * vertices are located of a local mirror vertex +*/ +#define GRIN_TRAIT_MIRROR_VERTEX_MIRROR_PARTITION_LIST + +/** @ingroup TraitMirrorPartitionMacros + * @brief The storage provides the partition list where the mirror + * edges are located of a local master edge +*/ +#define GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST + +/** @ingroup TraitMirrorPartitionMacros + * @brief The storage provides the partition list where the mirror + * edges are located of a local mirror edge +*/ +#define GRIN_TRAIT_MIRROR_EDGE_MIRROR_PARTITION_LIST +///@} + +/** @name TraitFilterMacros + * @brief Macros for storage that provides filtering ability of partitions for structures + * like vertex list or adjacent list. This trait is usually enabled for efficient graph traversal. +*/ +///@{ +/** @ingroup TraitFilterMacros + * @brief The storage provides a filtering predicate of master vertices + * for vertex list iterator. That means, the caller can use the predicate + * to make a master-only vertex list iterator from the original iterator. +*/ +#define GRIN_TRAIT_FILTER_MASTER_FOR_VERTEX_LIST + +/** @ingroup TraitFilterMacros + * @brief The storage provides a filtering predicate of single partition vertices + * for vertex list iterator. That means, the caller can use the predicate + * to make a single-partition vertex list iterator from the original iterator. +*/ +#define GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST + +/** @ingroup TraitFilterMacros + * @brief The storage provides a filtering predicate of master edges + * for edge list iterator. That means, the caller can use the predicate + * to make a master-only edge list iterator from the original iterator. +*/ +#define GRIN_TRAIT_FILTER_MASTER_FOR_EDGE_LIST + +/** @ingroup TraitFilterMacros + * @brief The storage provides a filtering predicate of single partition edges + * for edge list iterator. That means, the caller can use the predicate + * to make a single-partition edge list iterator from the original iterator. +*/ +#define GRIN_TRAIT_FILTER_PARTITION_FOR_EDGE_LIST + +/** @ingroup TraitFilterMacros + * @brief The storage provides a filtering predicate of master neighbors + * for adjacent list iterator. That means, the caller can use the predicate + * to make a master-only adjacent list iterator from the original iterator. +*/ +#define GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST + +/** @ingroup TraitFilterMacros + * @brief The storage provides a filtering predicate of single-partition vertices + * for adjacent list iterator. That means, the caller can use the predicate + * to make a single-partition adjacent list iterator from the original iterator. +*/ +#define GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST +///@} + +#ifndef GRIN_DOXYGEN_SKIP +// disable GRIN_ASSUME by default +#undef GRIN_ASSUME_EDGE_CUT_PARTITION +#undef GRIN_ASSUME_VERTEX_CUT_PARTITION +#undef GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE + +// diabled by storage +#undef GRIN_ASSUME_VERTEX_CUT_PARTITION +#undef GRIN_ENABLE_EDGE_REF +#undef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST +#undef GRIN_TRAIT_MIRROR_VERTEX_MIRROR_PARTITION_LIST +#undef GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST +#undef GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST +#undef GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST +// enabled by storage +#define GRIN_ASSUME_EDGE_CUT_PARTITION + +#ifdef GRIN_ASSUME_EDGE_CUT_PARTITION +#define GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#define GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE +#define GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE #endif -#ifndef GRIN_DOXYGEN_SKIP +#ifdef GRIN_ASSUME_VERTEX_CUT_PARTITION +#define GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE +#define GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE +#define GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST +#endif + +#ifndef GRIN_ENABLE_GRAPH_PARTITION +#undef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION +#undef GRIN_ENABLE_VERTEX_REF #undef GRIN_ENABLE_EDGE_REF +#undef GRIN_ASSUME_EDGE_CUT_PARTITION +#undef GRIN_ASSUME_VERTEX_CUT_PARTITION +#endif + +#ifndef GRIN_ENABLE_VERTEX_REF // enable vertex pref is the prerequisite +#undef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST +#undef GRIN_TRAIT_MIRROR_VERTEX_MIRROR_PARTITION_LIST +#undef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_TRAIT_FILTER_MASTER_FOR_VERTEX_LIST +#endif + +#ifndef GRIN_ENABLE_EDGE_REF // enable edge pref is the prerequisite +#undef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST +#undef GRIN_TRAIT_MIRROR_EDGE_MIRROR_PARTITION_LIST +#undef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_TRAIT_FILTER_MASTER_FOR_EDGE_LIST +#endif + +#ifndef GRIN_WITH_VERTEX_DATA // enable vertex data is the prerequisite +#undef GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#endif + +#ifndef GRIN_WITH_EDGE_DATA // enable edge data is the prerequisite +#undef GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE +#endif + +#ifndef GRIN_ENABLE_VERTEX_LIST // enable vertex list iterator is the prerequisite +#undef GRIN_TRAIT_FILTER_MASTER_FOR_VERTEX_LIST +#undef GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST +#endif + +#ifndef GRIN_ENABLE_EDGE_LIST // enable edge list iterator is the prerequisite +#undef GRIN_TRAIT_FILTER_MASTER_FOR_EDGE_LIST +#undef GRIN_TRAIT_FILTER_PARTITION_FOR_EDGE_LIST +#endif + +#ifndef GRIN_ENABLE_ADJACENT_LIST // enable adjacent list iterator is the prerequisite +#undef GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST +#undef GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST #endif -///@} + +#ifdef GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#endif +#endif // GRIN_DOXY_SKIP /** @name PropertyMacros - * @brief Macros for property graph features + * @brief Macros for basic property graph features */ ///@{ /** @ingroup PropertyMacros - * @brief There are property names for properties. The relationship between property - * name and properties is one-to-many, because properties bound to different vertex/edge - * types are distinguished even they may share the same property name. Please refer to - * the design principle of Property for details. + * @brief Enable the pure data structure Row, which is used in primary keys and tables. */ -#define GRIN_WITH_PROPERTY_NAME +#define GRIN_ENABLE_ROW /** @ingroup PropertyMacros * @brief There are properties bound to vertices. When vertices are typed, vertex @@ -187,6 +403,31 @@ typedef enum { */ #define GRIN_WITH_VERTEX_PROPERTY +/** @ingroup PropertyMacros + * @brief There are property names for vertex properties. The relationship between property + * name and properties is one-to-many, because properties bound to different vertex/edge + * types are distinguished even they may share the same property name. Please refer to + * the design principle of Property for details. +*/ +#define GRIN_WITH_VERTEX_PROPERTY_NAME + +/** @ingroup PropertyMacros + * @brief There are unique names for each vertex type. +*/ +#define GRIN_WITH_VERTEX_TYPE_NAME + +/** @ingroup PropertyMacros + * @brief The storage provides natural number IDs for vertex types. + * It follows the design principle of natural ID trait in GRIN. +*/ +#define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE + +/** @ingroup PropertyMacros + * @brief Enable the vertex property table structure, from where the value of property + * can be fetched using vertex as row index and property as column index. +*/ +#define GRIN_ENABLE_VERTEX_PROPERTY_TABLE + /** @ingroup PropertyMacros * @brief There are primary keys for vertices. Vertex primary keys is * a set of vertex properties whose values can distinguish vertices. When vertices are @@ -198,55 +439,369 @@ typedef enum { * is NOT defined, in which case, one can use GRIN_WITH_VERTEX_ORIGINAL_ID when vertices have * no properties. */ -#define GRIN_WITH_VERTEX_PRIMARY_KEYS +#define GRIN_ENABLE_VERTEX_PRIMARY_KEYS /** @ingroup PropertyMacros - * @brief The storage provides natural number IDs for vertex types. + * @brief The storage provides natural number IDs for properties bound to + * a certain vertex type. * It follows the design principle of natural ID trait in GRIN. */ -#define GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT +#define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY + +/** @ingroup PropertyMacros + * @brief Assume the original id is ONLY unique under each vertex type. This means + * to get a vertex from the original id, the caller must also provide the vertex type. +*/ +#define GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID + + +/** @ingroup PropertyMacros + * @brief There are properties bound to edges. When edges are typed, edge + * properties are bound to edge types, according to the definition of edge type. +*/ +#define GRIN_WITH_EDGE_PROPERTY + +/** @ingroup PropertyMacros + * @brief There are property names for edge properties. The relationship between property + * name and properties is one-to-many, because properties bound to different vertex/edge + * types are distinguished even they may share the same property name. Please refer to + * the design principle of Property for details. +*/ +#define GRIN_WITH_EDGE_PROPERTY_NAME + +/** @ingroup PropertyMacros + * @brief There are unique names for each edge type. +*/ +#define GRIN_WITH_EDGE_TYPE_NAME + +/** @ingroup PropertyMacros + * @brief The storage provides natural number IDs for edge types. + * It follows the design principle of natural ID trait in GRIN. +*/ +#define GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE + +/** @ingroup PropertyMacros + * @brief Enable the edge property table structure, from where the value of property + * can be fetched using edge as row index and property as column index. +*/ +#define GRIN_ENABLE_EDGE_PROPERTY_TABLE + +/** @ingroup PropertyMacros + * @brief There are primary keys for edges. Edge primary keys is + * a set of edge properties whose values can distinguish edges. When edges are + * typed, each edge type has its own primary keys which distinguishes the edges of + * that type. + * + * With primary keys, one can get the edge from the graph or a certain type + * by providing the values of the primary keys. The macro is unset if GRIN_WITH_EDGE_PROPERTY + * is NOT defined, in which case, one can use GRIN_WITH_EDGE_ORIGINAL_ID when edges have + * no properties. +*/ +#define GRIN_ENABLE_EDGE_PRIMARY_KEYS /** @ingroup PropertyMacros * @brief The storage provides natural number IDs for properties bound to - * a certain vertex type. + * a certain edge type. * It follows the design principle of natural ID trait in GRIN. */ -#define GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT +#define GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY +///@} + +/** @name TraitFilterTypeMacros + * @brief Macros of traits to filter vertex/edge type for + * structures like vertex list and adjacent list. + */ +///@{ +/** @ingroup TraitFilterTypeMacros + * @brief The storage provides a filtering predicate of single-type vertices + * for vertex list iterator. That means, the caller can use the predicate + * to make a vertex list iterator for a certain type of vertices from the + * original iterator. +*/ +#define GRIN_TRAIT_FILTER_TYPE_FOR_VERTEX_LIST +/** @ingroup TraitFilterTypeMacros + * @brief The storage provides a filtering predicate of single-type edges + * for edge list iterator. That means, the caller can use the predicate + * to make an edge list iterator for a certain type of edges from the + * original iterator. +*/ +#define GRIN_TRAIT_FILTER_TYPE_FOR_EDGE_LIST -#define GRIN_WITH_EDGE_PROPERTY // There is any property for edges. -#define GRIN_WITH_EDGE_PRIMARY_KEYS // There is cross-type property name. -#define GRIN_NATURAL_EDGE_TYPE_ID_TRAIT // Edge type has natural continuous id from 0. -#define GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT // Edge property has natural continuous id from 0. +/** @ingroup TraitFilterTypeMacros + * @brief The storage provides a filtering predicate of single-type neighbors + * for adjacent list iterator. That means, the caller can use the predicate + * to make an adjacent list iterator of neighbors with a certain type from + * the original iterator. +*/ +#define GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST +/** @ingroup TraitFilterTypeMacros + * @brief The storage provides a filtering predicate of single-type edges + * for adjacent list iterator. That means, the caller can use the predicate + * to make an adjacent list iterator of edges with a certain type from + * the original iterator. +*/ +#define GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST +///@} -/** @ingroup PropertyMacros + +/** @name PropetyAssumptionMacros + * @brief Macros of assumptions for property local complete, and particularly define + * the by type local complete assumptions for hybrid partiton strategy. + */ +///@{ +/** @ingroup PropetyAssumptionMacros + * @brief Assume property values of a vertex is always local complete for all vertices. +*/ +#define GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume property values of a vertex is ONLY local complete for master vertices. +*/ +#define GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume property values of a vertex is local complete for all vertices with a certain type. +*/ +#define GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume property values of a vertex is local complete for master vertices with a certain type. +*/ +#define GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume vertex data is local complete for all vertices with a certain type. +*/ +#define GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume vertex data is local complete for master vertices with a certain type. +*/ +#define GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume property values of a edge is always local complete for all edges. +*/ +#define GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume property values of a edge is ONLY local complete for master edges. +*/ +#define GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume property values of a edge is local complete for all edges with a certain type. +*/ +#define GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume property values of a edge is local complete for master edges with a certain type. +*/ +#define GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume edge data is local complete for all edges with a certain type. +*/ +#define GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume edge data is local complete for master edges with a certain type. +*/ +#define GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume vertex neighbor is local complete for all vertices with a certain type. +*/ +#define GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros + * @brief Assume vertex data is local complete for master vertices with a certain type. +*/ +#define GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE + +/** @ingroup PropetyAssumptionMacros * @brief The storage uses column store for properties. * This enables efficient property selections for vertices and edges. */ -#define GRIN_COLUMN_STORE_TRAIT +#define GRIN_ASSUME_COLUMN_STORE +///@} + +#ifndef GRIN_DOXYGEN_SKIP +// disable GRIN_ASSUME by default +#undef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID +#undef GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_COLUMN_STORE + +// disabled by storage +#undef GRIN_ENABLE_VERTEX_PRIMARY_KEYS +#undef GRIN_ENABLE_EDGE_PRIMARY_KEYS +#undef GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST + +// enabled by storage +#define GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID +#define GRIN_ASSUME_COLUMN_STORE + +#ifdef GRIN_ASSUME_EDGE_CUT_PARTITION +#define GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#define GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_VERTEX_CUT_PARTITION +#define GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#define GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#endif -#if !defined(GRIN_WITH_VERTEX_PROPERTY) && !defined(GRIN_WITH_EDGE_PROPERTY) -#undef GRIN_WITH_PROPERTY_NAME +#ifndef GRIN_ENABLE_ROW +#undef GRIN_ENABLE_VERTEX_PRIMARY_KEYS +#undef GRIN_ENABLE_EDGE_PRIMARY_KEYS #endif #ifndef GRIN_WITH_VERTEX_PROPERTY -#undef GRIN_WITH_VERTEX_PRIMARY_KEYS -#undef GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT -#undef GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT +#undef GRIN_WITH_VERTEX_PROPERTY_NAME +#undef GRIN_WITH_VERTEX_TYPE_NAME +#undef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE +#undef GRIN_ENABLE_VERTEX_PROPERTY_TABLE +#undef GRIN_ENABLE_VERTEX_PRIMARY_KEYS +#undef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY +#undef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID +#undef GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE #endif #ifndef GRIN_WITH_EDGE_PROPERTY -#undef GRIN_WITH_EDGE_PRIMARY_KEYS -#undef GRIN_NATURAL_EDGE_TYPE_ID_TRAIT -#undef GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT +#undef GRIN_WITH_EDGE_PROPERTY_NAME +#undef GRIN_WITH_EDGE_TYPE_NAME +#undef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE +#undef GRIN_ENABLE_EDGE_PROPERTY_TABLE +#undef GRIN_ENABLE_EDGE_PRIMARY_KEYS +#undef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY +#undef GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE #endif -#ifndef GRIN_DOXYGEN_SKIP -#undef GRIN_WITH_VERTEX_PRIMARY_KEYS -#undef GRIN_WITH_EDGE_PRIMARY_KEYS +#ifndef GRIN_WITH_VERTEX_ORIGINAL_ID +#undef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID #endif -///@} + +#ifndef GRIN_WITH_VERTEX_DATA +#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#endif + +#ifndef GRIN_WITH_EDGE_DATA +#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE +#endif + +#ifndef GRIN_ENABLE_VERTEX_LIST // enable vertex list iterator is the prerequisite +#undef GRIN_TRAIT_FILTER_TYPE_FOR_VERTEX_LIST +#endif + +#ifndef GRIN_ENABLE_EDGE_LIST // enable edge list iterator is the prerequisite +#undef GRIN_TRAIT_FILTER_TYPE_FOR_EDGE_LIST +#endif + +#ifndef GRIN_ENABLE_ADJACENT_LIST // enable adjacent list iterator is the prerequisite +#undef GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST +#undef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST +#endif + +// assumption on vertex property +#ifdef GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#endif + +// assumption on vertex data +#ifdef GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#endif + +// assumption on edge property +#ifdef GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE +#endif + +// assumption on edge data +#ifdef GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE +#endif + +// assumption on vertex neighbor +#ifdef GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#endif +#endif // GRIN_DOXY_SKIP + /** @name PredicateMacros * @brief Macros for predicate features @@ -255,7 +810,7 @@ typedef enum { /** @ingroup PredicateMacros * @brief Enable vertex ordering predicate */ -#define GRIN_PREDICATE_ENABLE_VERTEX_ORDERING +#define GRIN_PREDICATE_VERTEX_ORDERING ///@} /** @name IndexMacros @@ -292,6 +847,8 @@ typedef enum { #define GRIN_NULL_EDGE NULL /** @brief Null list of any kind (invalid return value) */ #define GRIN_NULL_LIST NULL +/** @brief Null list iterator of any kind (invalid return value) */ +#define GRIN_NULL_LIST_ITERATOR NULL /** @brief Non-existing partition (invalid return value) */ #define GRIN_NULL_PARTITION NULL /** @brief Null vertex reference (invalid return value) */ @@ -360,7 +917,7 @@ typedef void* GRIN_PARTITION; typedef void* GRIN_PARTITION_LIST; #endif -#ifdef GRIN_NATURAL_PARTITION_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION typedef unsigned GRIN_PARTITION_ID; #endif @@ -381,11 +938,11 @@ typedef void* GRIN_VERTEX_PROPERTY_LIST; typedef void* GRIN_VERTEX_PROPERTY_TABLE; #endif -#ifdef GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE typedef unsigned GRIN_VERTEX_TYPE_ID; #endif -#ifdef GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY typedef unsigned GRIN_VERTEX_PROPERTY_ID; #endif @@ -397,15 +954,15 @@ typedef void* GRIN_EDGE_PROPERTY_LIST; typedef void* GRIN_EDGE_PROPERTY_TABLE; #endif -#ifdef GRIN_NATURAL_EDGE_TYPE_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE typedef unsigned GRIN_EDGE_TYPE_ID; #endif -#ifdef GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY typedef unsigned GRIN_EDGE_PROPERTY_ID; #endif -#if defined(GRIN_WITH_VERTEX_PROPERTY) || defined(GRIN_WITH_EDGE_PROPERTY) +#ifdef GRIN_ENABLE_ROW typedef void* GRIN_ROW; #endif diff --git a/modules/graph/grin/include/predicate/order.h b/modules/graph/grin/include/predicate/order.h index 42188b3cb..61b6479d5 100644 --- a/modules/graph/grin/include/predicate/order.h +++ b/modules/graph/grin/include/predicate/order.h @@ -20,7 +20,7 @@ limitations under the License. #include "../predefine.h" -#ifdef GRIN_PREDICATE_ENABLE_VERTEX_ORDERING +#ifdef GRIN_PREDICATE_VERTEX_ORDERING /** * @brief sort a vertex list * @param GRIN_GRAPH the graph diff --git a/modules/graph/grin/include/property/partition.h b/modules/graph/grin/include/property/partition.h new file mode 100644 index 000000000..9bcc56dc0 --- /dev/null +++ b/modules/graph/grin/include/property/partition.h @@ -0,0 +1,93 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/** + @file property/partition.h + @brief Define the partition related APIs under property graph +*/ + +#ifndef GRIN_INCLUDE_PROPERTY_PARTITION_H_ +#define GRIN_INCLUDE_PROPERTY_PARTITION_H_ + +#include "../predefine.h" + + +#if defined(GRIN_WITH_VERTEX_PROPERTY) && \ + !defined(GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE) +bool grin_is_vertex_property_local_complete(GRIN_GRAPH, GRIN_VERTEX); + +GRIN_PARTITION_LIST grin_vertex_property_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +GRIN_VERTEX_TYPE_LIST grin_get_master_vertex_property_local_complete_types(GRIN_GRAPH); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +GRIN_VERTEX_TYPE_LIST grin_get_all_vertex_property_local_complete_types(GRIN_GRAPH); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE +GRIN_VERTEX_TYPE_LIST grin_get_master_vertex_data_local_complete_types(GRIN_GRAPH); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE +GRIN_VERTEX_TYPE_LIST grin_get_all_vertex_data_local_complete_types(GRIN_GRAPH); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +GRIN_VERTEX_TYPE_LIST grin_get_master_vertex_neighbor_local_complete_types(GRIN_GRAPH); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE +GRIN_VERTEX_TYPE_LIST grin_get_all_vertex_neighbor_local_complete_types(GRIN_GRAPH); +#endif + +#if defined(GRIN_WITH_EDGE_PROPERTY) && \ + !defined(GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE) +bool grin_is_edge_property_local_complete(GRIN_GRAPH, GRIN_EDGE); + +GRIN_PARTITION_LIST grin_edge_property_complete_partitions(GRIN_GRAPH, GRIN_EDGE); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE +GRIN_EDGE_TYPE_LIST grin_get_master_edge_property_local_complete_types(GRIN_GRAPH); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +GRIN_EDGE_TYPE_LIST grin_get_all_edge_property_local_complete_types(GRIN_GRAPH); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE +GRIN_EDGE_TYPE_LIST grin_get_master_edge_data_local_complete_types(GRIN_GRAPH); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE +GRIN_EDGE_TYPE_LIST grin_get_all_edge_data_local_complete_types(GRIN_GRAPH); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_NEIGHBOR_LOCAL_COMPLETE +GRIN_EDGE_TYPE_LIST grin_get_master_edge_neighbor_local_complete_types(GRIN_GRAPH); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_ALL_EDGE_NEIGHBOR_LOCAL_COMPLETE +GRIN_EDGE_TYPE_LIST grin_get_all_edge_neighbor_local_complete_types(GRIN_GRAPH); +#endif + + +#endif // GRIN_INCLUDE_PROPERTY_PARTITION_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/primarykey.h b/modules/graph/grin/include/property/primarykey.h index 89141fd8f..13927167e 100644 --- a/modules/graph/grin/include/property/primarykey.h +++ b/modules/graph/grin/include/property/primarykey.h @@ -20,7 +20,7 @@ limitations under the License. #include "../predefine.h" -#ifdef GRIN_WITH_VERTEX_PRIMARY_KEYS +#ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS /** * @brief get the vertex types with primary keys * @param GRIN_GRAPH the graph diff --git a/modules/graph/grin/include/property/property.h b/modules/graph/grin/include/property/property.h index 4b248af01..ce4a8ca47 100644 --- a/modules/graph/grin/include/property/property.h +++ b/modules/graph/grin/include/property/property.h @@ -20,7 +20,7 @@ limitations under the License. #include "../predefine.h" -#if defined(GRIN_WITH_PROPERTY_NAME) && defined(GRIN_WITH_VERTEX_PROPERTY) +#ifdef GRIN_WITH_VERTEX_PROPERTY_NAME /** * @brief get the vertex property name * @param GRIN_GRAPH the graph @@ -44,7 +44,7 @@ GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH, GRIN_VERTEX_TY GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH, const char* name); #endif -#if defined(GRIN_WITH_PROPERTY_NAME) && defined(GRIN_WITH_EDGE_PROPERTY) +#ifdef GRIN_WITH_EDGE_PROPERTY_NAME /** * @brief get the edge property name * @param GRIN_GRAPH the graph diff --git a/modules/graph/grin/include/property/propertylist.h b/modules/graph/grin/include/property/propertylist.h index 2a64de49d..2161f57c4 100644 --- a/modules/graph/grin/include/property/propertylist.h +++ b/modules/graph/grin/include/property/propertylist.h @@ -34,7 +34,7 @@ void grin_destroy_vertex_property_list(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST); bool grin_insert_vertex_property_to_list(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST, GRIN_VERTEX_PROPERTY); #endif -#ifdef GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_PROPERTY_ID); GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_PROPERTY); @@ -55,7 +55,7 @@ void grin_destroy_edge_property_list(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST); bool grin_insert_edge_property_to_list(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST, GRIN_EDGE_PROPERTY); #endif -#ifdef GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_PROPERTY_ID); GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_PROPERTY); @@ -71,12 +71,12 @@ GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN * The projection only works on column store systems. */ ///@{ -#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_COLUMN_STORE_TRAIT) +#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) /** @brief project vertex properties */ GRIN_GRAPH grin_select_vertex_properties(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST); #endif -#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_COLUMN_STORE_TRAIT) +#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) /** @brief project edge properties */ GRIN_GRAPH grin_select_edge_properteis(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST); #endif diff --git a/modules/graph/grin/include/property/propertytable.h b/modules/graph/grin/include/property/propertytable.h index 128133ada..f85790fae 100644 --- a/modules/graph/grin/include/property/propertytable.h +++ b/modules/graph/grin/include/property/propertytable.h @@ -28,7 +28,7 @@ limitations under the License. * property's data type. */ ///@{ -#if defined(GRIN_WITH_VERTEX_PROPERTY) || defined(GRIN_WITH_EDGE_PROPERTY) +#ifdef GRIN_ENABLE_ROW void grin_destroy_row(GRIN_GRAPH, GRIN_ROW); /** @brief the value of a property from row by its position in row */ @@ -42,7 +42,7 @@ bool grin_insert_value_to_row(GRIN_GRAPH, GRIN_ROW, void*); #endif ///@} -#ifdef GRIN_WITH_VERTEX_PROPERTY +#ifdef GRIN_ENABLE_VERTEX_PROPERTY_TABLE /** * @brief destroy vertex property table * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table @@ -54,7 +54,7 @@ void grin_destroy_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE); * No matter column or row store strategy is used in the storage, * GRIN recommends to first get the property table of the vertex type, * and then fetch values(rows) by vertex and property(list). However, - * GRIN does provide direct row fetching API when GRIN_COLUMN_STORE_TRAIT + * GRIN does provide direct row fetching API when GRIN_ASSUME_COLUMN_STORE * is NOT set. * @param GRIN_GRAPH the graph * @param GRIN_VERTEX_TYPE the vertex type @@ -69,7 +69,9 @@ GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH, GR * @return can be casted to the property data type by the caller */ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY); +#endif +#if defined(GRIN_ENABLE_VERTEX_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) /** * @brief get vertex row from table * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table @@ -77,8 +79,9 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PR * @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns */ GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); +#endif -#ifndef GRIN_COLUMN_STORE_TRAIT +#if !defined(GRIN_ASSUME_COLUMN_STORE) && defined(GRIN_ENABLE_ROW) /** * @brief get vertex row directly from the graph, this API only works for row store system * @param GRIN_GRAPH the graph @@ -87,9 +90,8 @@ GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERT */ GRIN_ROW grin_get_vertex_row(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); #endif -#endif -#ifdef GRIN_WITH_EDGE_PROPERTY +#ifdef GRIN_ENABLE_EDGE_PROPERTY_TABLE /** * @brief destroy edge property table * @param GRIN_EDGE_PROPERTY_TABLE edge property table @@ -101,7 +103,7 @@ void grin_destroy_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE); * No matter column or row store strategy is used in the storage, * GRIN recommends to first get the property table of the edge type, * and then fetch values(rows) by edge and property(list). However, - * GRIN does provide direct row fetching API when GRIN_COLUMN_STORE_TRAIT + * GRIN does provide direct row fetching API when GRIN_ASSUME_COLUMN_STORE * is NOT set. * @param GRIN_GRAPH the graph * @param GRIN_EDGE_TYPE the edge type @@ -116,7 +118,9 @@ GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH, GRIN_E * @return can be casted to the property data type by the caller */ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY); +#endif +#if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) /** * @brief get edge row from table * @param GRIN_EDGE_PROPERTY_TABLE edge property table @@ -124,8 +128,9 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPER * @param GRIN_EDGE_PROPERTY_LIST the edge property list as columns */ GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY_LIST); +#endif -#ifndef GRIN_COLUMN_STORE_TRAIT +#if !defined(GRIN_ASSUME_COLUMN_STORE) && defined(GRIN_ENABLE_ROW) /** * @brief get edge row directly from the graph, this API only works for row store system * @param GRIN_GRAPH the graph @@ -134,6 +139,5 @@ GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TA */ GRIN_ROW grin_get_edge_row(GRIN_GRAPH, GRIN_EDGE, GRIN_EDGE_PROPERTY_LIST); #endif -#endif #endif // GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/topology.h b/modules/graph/grin/include/property/topology.h new file mode 100644 index 000000000..7f8bd54a4 --- /dev/null +++ b/modules/graph/grin/include/property/topology.h @@ -0,0 +1,52 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/** + @file property/topology.h + @brief Define the topology related APIs under property graph +*/ + +#ifndef GRIN_INCLUDE_PROPERTY_TOPOLOGY_H_ +#define GRIN_INCLUDE_PROPERTY_TOPOLOGY_H_ + +#include "../predefine.h" + +#ifdef GRIN_WITH_VERTEX_PROPERTY +size_t grin_get_vertex_num_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); +#endif + +#ifdef GRIN_WITH_EDGE_PROPERTY +size_t grin_get_edge_num_by_type(GRIN_GRAPH, GRIN_DIRECTION, GRIN_EDGE_TYPE); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID +GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_ORIGINAL_ID); +#endif + +#ifdef GRIN_TRAIT_FILTER_TYPE_FOR_VERTEX_LIST +GRIN_VERTEX_LIST grin_filter_type_for_vertex_list(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_LIST); +#endif + +#ifdef GRIN_TRAIT_FILTER_TYPE_FOR_EDGE_LIST +GRIN_EDGE_LIST grin_filter_type_for_edge_list(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_LIST); +#endif + +#ifdef GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_filter_neighbor_type_for_adjacent_list(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_ADJACENT_LIST); +#endif + +#ifdef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_filter_edge_type_for_adjacent_list(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_ADJACENT_LIST); +#endif + + +#endif // GRIN_INCLUDE_PROPERTY_TOPOLOGY_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/type.h b/modules/graph/grin/include/property/type.h index 8bf162df3..16e80d1d7 100644 --- a/modules/graph/grin/include/property/type.h +++ b/modules/graph/grin/include/property/type.h @@ -26,10 +26,6 @@ bool grin_equal_vertex_type(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_TYPE); GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH, GRIN_VERTEX); -const char* grin_get_vertex_type_name(GRIN_GRAPH, GRIN_VERTEX_TYPE); - -GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH, const char*); - // Vertex type list GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH); @@ -44,8 +40,13 @@ size_t grin_get_vertex_type_list_size(GRIN_GRAPH, GRIN_VERTEX_TYPE_LIST); GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_GRAPH, GRIN_VERTEX_TYPE_LIST, size_t); #endif +#ifdef GRIN_WITH_VERTEX_TYPE_NAME +const char* grin_get_vertex_type_name(GRIN_GRAPH, GRIN_VERTEX_TYPE); -#ifdef GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT +GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH, const char*); +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_GRAPH, GRIN_VERTEX_TYPE); GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_GRAPH, GRIN_VERTEX_TYPE_ID); @@ -53,16 +54,12 @@ GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_GRAPH, GRIN_VERTEX_TYPE_ID); #ifdef GRIN_WITH_EDGE_PROPERTY -// GRIN_EDGE type +// Edge type bool grin_equal_edge_type(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_TYPE); GRIN_EDGE_TYPE grin_get_edge_type(GRIN_GRAPH, GRIN_EDGE); -const char* grin_get_edge_type_name(GRIN_GRAPH, GRIN_EDGE_TYPE); - -GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH, const char*); - -// GRIN_EDGE type list +// Edge type list GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH); void grin_destroy_edge_type_list(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST); @@ -76,7 +73,13 @@ size_t grin_get_edge_type_list_size(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST); GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST, size_t); #endif -#ifdef GRIN_NATURAL_EDGE_TYPE_ID_TRAIT +#ifdef GRIN_WITH_EDGE_TYPE_NAME +const char* grin_get_edge_type_name(GRIN_GRAPH, GRIN_EDGE_TYPE); + +GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH, const char*); +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_GRAPH, GRIN_EDGE_TYPE); GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_GRAPH, GRIN_EDGE_TYPE_ID); diff --git a/modules/graph/grin/include/topology/adjacentlist.h b/modules/graph/grin/include/topology/adjacentlist.h index 56ab2ec2d..136e3fed8 100644 --- a/modules/graph/grin/include/topology/adjacentlist.h +++ b/modules/graph/grin/include/topology/adjacentlist.h @@ -21,10 +21,6 @@ limitations under the License. #ifdef GRIN_ENABLE_ADJACENT_LIST GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); -#ifdef GRIN_WITH_EDGE_PROPERTY -GRIN_ADJACENT_LIST grin_get_adjacent_list_by_edge_type(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX, GRIN_EDGE_TYPE); -#endif - void grin_destroy_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); size_t grin_get_adjacent_list_size(GRIN_GRAPH, GRIN_ADJACENT_LIST); @@ -35,7 +31,9 @@ GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST, size_ #endif #ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR -GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH); +GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); + +void grin_destroy_adjacent_list_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); GRIN_ADJACENT_LIST_ITERATOR grin_get_next_adjacent_list_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); diff --git a/modules/graph/grin/include/topology/edgelist.h b/modules/graph/grin/include/topology/edgelist.h index 8f75cfa4d..20ac65c7a 100644 --- a/modules/graph/grin/include/topology/edgelist.h +++ b/modules/graph/grin/include/topology/edgelist.h @@ -21,16 +21,8 @@ limitations under the License. #ifdef GRIN_ENABLE_EDGE_LIST GRIN_EDGE_LIST grin_get_edge_list(GRIN_GRAPH, GRIN_DIRECTION); -#ifdef GRIN_WITH_EDGE_PROPERTY -GRIN_EDGE_LIST grin_get_edge_list_by_type(GRIN_GRAPH, GRIN_EDGE_TYPE); -#endif - void grin_destroy_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); -GRIN_EDGE_LIST grin_create_edge_list(GRIN_GRAPH); - -bool grin_insert_edge_to_list(GRIN_GRAPH, GRIN_EDGE_LIST, GRIN_EDGE); - size_t grin_get_edge_list_size(GRIN_GRAPH, GRIN_EDGE_LIST); GRIN_EDGE grin_get_edge_from_list(GRIN_GRAPH, GRIN_EDGE_LIST, size_t); @@ -39,9 +31,7 @@ GRIN_EDGE grin_get_edge_from_list(GRIN_GRAPH, GRIN_EDGE_LIST, size_t); #ifdef GRIN_ENABLE_EDGE_LIST_ITERATOR GRIN_EDGE_LIST_ITERATOR grin_get_edge_list_begin(GRIN_GRAPH); -#ifdef GRIN_WITH_EDGE_PROPERTY -GRIN_EDGE_LIST_ITERATOR grin_get_edge_list_begin_by_type(GRIN_GRAPH, GRIN_EDGE_TYPE); -#endif +void grin_destroy_edge_list_iter(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); GRIN_EDGE_LIST_ITERATOR grin_get_next_edge_list_iter(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); diff --git a/modules/graph/grin/include/topology/structure.h b/modules/graph/grin/include/topology/structure.h index 91a16c26c..24ff57a43 100644 --- a/modules/graph/grin/include/topology/structure.h +++ b/modules/graph/grin/include/topology/structure.h @@ -25,44 +25,33 @@ bool grin_is_multigraph(GRIN_GRAPH); size_t grin_get_vertex_num(GRIN_GRAPH); -#ifdef GRIN_WITH_VERTEX_PROPERTY -size_t grin_get_vertex_num_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); -#endif - size_t grin_get_edge_num(GRIN_GRAPH, GRIN_DIRECTION); -#ifdef GRIN_WITH_EDGE_PROPERTY -size_t grin_get_edge_num_by_type(GRIN_GRAPH, GRIN_DIRECTION, GRIN_EDGE_TYPE); -#endif - // Vertex void grin_destroy_vertex(GRIN_GRAPH, GRIN_VERTEX); -#ifdef GRIN_WITH_VERTEX_DATA -GRIN_DATATYPE grin_get_vertex_data_type(GRIN_GRAPH, GRIN_VERTEX); - -GRIN_VERTEX_DATA grin_get_vertex_data_value(GRIN_GRAPH, GRIN_VERTEX); - -void grin_destroy_vertex_data(GRIN_GRAPH, GRIN_VERTEX_DATA); -#endif - #ifdef GRIN_WITH_VERTEX_ORIGINAL_ID -GRIN_VERTEX grin_get_vertex_from_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); +void grin_destroy_vertex_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); GRIN_DATATYPE grin_get_vertex_original_id_type(GRIN_GRAPH); GRIN_VERTEX_ORIGINAL_ID grin_get_vertex_original_id(GRIN_GRAPH, GRIN_VERTEX); - -void grin_destroy_vertex_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); #endif -#if defined(GRIN_WITH_VERTEX_ORIGINAL_ID) && defined(GRIN_WITH_VERTEX_PROPERTY) -GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_ORIGINAL_ID); +#if defined(GRIN_WITH_VERTEX_ORIGINAL_ID) && !defined(GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID) +GRIN_VERTEX grin_get_vertex_from_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); #endif +#ifdef GRIN_WITH_VERTEX_DATA +GRIN_DATATYPE grin_get_vertex_data_type(GRIN_GRAPH, GRIN_VERTEX); + +GRIN_VERTEX_DATA grin_get_vertex_data_value(GRIN_GRAPH, GRIN_VERTEX); + +void grin_destroy_vertex_data(GRIN_GRAPH, GRIN_VERTEX_DATA); +#endif -// GRIN_EDGE +// Edge void grin_destroy_edge(GRIN_GRAPH, GRIN_EDGE); GRIN_VERTEX grin_get_edge_src(GRIN_GRAPH, GRIN_EDGE); diff --git a/modules/graph/grin/include/topology/vertexlist.h b/modules/graph/grin/include/topology/vertexlist.h index 2a4f05b83..3ec857dd7 100644 --- a/modules/graph/grin/include/topology/vertexlist.h +++ b/modules/graph/grin/include/topology/vertexlist.h @@ -21,16 +21,8 @@ limitations under the License. #ifdef GRIN_ENABLE_VERTEX_LIST GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH); -#ifdef GRIN_WITH_VERTEX_PROPERTY -GRIN_VERTEX_LIST grin_get_vertex_list_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); -#endif - void grin_destroy_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); -GRIN_VERTEX_LIST grin_create_vertex_list(GRIN_GRAPH); - -bool grin_insert_vertex_to_list(GRIN_GRAPH, GRIN_VERTEX_LIST, GRIN_VERTEX); - size_t grin_get_vertex_list_size(GRIN_GRAPH, GRIN_VERTEX_LIST); GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH, GRIN_VERTEX_LIST, size_t); @@ -39,9 +31,7 @@ GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH, GRIN_VERTEX_LIST, size_t); #ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH); -#ifdef GRIN_WITH_VERTEX_PROPERTY -GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); -#endif +void grin_destroy_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); GRIN_VERTEX_LIST_ITERATOR grin_get_next_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index ff86f90fc..b574dd4ea 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -90,7 +90,7 @@ GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_P } #endif -#ifdef GRIN_NATURAL_PARTITION_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION GRIN_PARTITION grin_get_partition_from_id(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_ID pid) { auto p = new GRIN_PARTITION_T(pid); return p; @@ -102,162 +102,3 @@ GRIN_PARTITION_ID grin_get_partition_id(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITIO } #endif - -#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_ENABLE_VERTEX_LIST) -GRIN_VERTEX_LIST grin_get_master_vertices(GRIN_GRAPH g) { - auto _g = static_cast(g); - auto _vl = new GRIN_VERTEX_LIST_T(); - for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - _vl->push_back(_GRIN_TYPED_VERTICES_T(vtype, _g->InnerVertices(vtype))); - } - return _vl; -} - -GRIN_VERTEX_LIST grin_get_mirror_vertices(GRIN_GRAPH g) { - auto _g = static_cast(g); - auto _vl = new GRIN_VERTEX_LIST_T(); - for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - _vl->push_back(_GRIN_TYPED_VERTICES_T(vtype, _g->OuterVertices(vtype))); - } - return _vl; -} - -GRIN_VERTEX_LIST grin_get_mirror_vertices_by_partition(GRIN_GRAPH g, GRIN_PARTITION p) { - return GRIN_NULL_LIST; -} - -#ifdef GRIN_WITH_VERTEX_PROPERTY -GRIN_VERTEX_LIST grin_get_master_vertices_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto _vl = new GRIN_VERTEX_LIST_T(); - _vl->push_back(_GRIN_TYPED_VERTICES_T(*_vtype, _g->InnerVertices(*_vtype))); - return _vl; -} - -GRIN_VERTEX_LIST grin_get_mirror_vertices_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto _vl = new GRIN_VERTEX_LIST_T(); - _vl->push_back(_GRIN_TYPED_VERTICES_T(*_vtype, _g->OuterVertices(*_vtype))); - return _vl; -} - -GRIN_VERTEX_LIST grin_get_mirror_vertices_by_type_partition(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, - GRIN_PARTITION p) { - return GRIN_NULL_LIST; -} -#endif -#endif - -#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_ENABLE_ADJACENT_LIST) -GRIN_ADJACENT_LIST grin_get_adjacent_master_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_VERTEX v) { - return GRIN_NULL_LIST; -} - -GRIN_ADJACENT_LIST grin_get_adjacent_mirror_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_VERTEX v) { - return GRIN_NULL_LIST; -} - -GRIN_ADJACENT_LIST grin_get_adjacent_mirror_list_by_partition(GRIN_GRAPH g, GRIN_DIRECTION d, - GRIN_PARTITION p, GRIN_VERTEX v) { - return GRIN_NULL_LIST; -} -#endif - - -#ifdef GRIN_ENABLE_VERTEX_REF -GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto gid = _g->Vertex2Gid(*_v); - auto vr = new GRIN_VERTEX_REF_T(gid); - return vr; -} - -GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { - auto _g = static_cast(g); - auto _vr = static_cast(vr); - auto v = new GRIN_VERTEX_T(); - if (_g->Gid2Vertex(*_vr, *v)) { - return v; - } - return GRIN_NULL_VERTEX; -} - -bool grin_is_master_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - return _g->IsInnerVertex(*_v); -} - -bool grin_is_mirror_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - return _g->IsOuterVertex(*_v); -} - -GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { - auto _g = static_cast(g); - auto _vr = static_cast(vr); - auto id_parser = vineyard::IdParser(); - id_parser.Init(_g->fnum(), _g->vertex_label_num()); - auto p = new GRIN_PARTITION_T(id_parser.GetFid(*_vr)); - return p; -} - -const char* grin_serialize_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { - auto _vr = static_cast(vr); - std::stringstream ss; - ss << *_vr; - int len = ss.str().length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", ss.str().c_str()); - return out; -} - -GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH g, const char* msg) { - std::stringstream ss(msg); - GRIN_VERTEX_REF_T gid; - ss >> gid; - auto vr = new GRIN_VERTEX_REF_T(gid); - return vr; -} -#endif - -#ifdef GRIN_ENABLE_GRAPH_PARTITION -bool grin_is_vertex_neighbor_local_complete(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - return _g->IsInnerVertex(*_v); -} - -GRIN_PARTITION_LIST grin_vertex_neighbor_complete_partitions(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto pl = new GRIN_PARTITION_LIST_T(); - pl->push_back(_g->GetFragId(*_v)); - return pl; -} -#endif - -#ifdef GRIN_WITH_VERTEX_PROPERTY -bool grin_is_vertex_property_local_complete(GRIN_GRAPH g, GRIN_VERTEX v) { - return grin_is_vertex_neighbor_local_complete(g, v); -} - -GRIN_PARTITION_LIST grin_vertex_property_complete_partitions(GRIN_GRAPH g, GRIN_VERTEX v) { - return grin_vertex_neighbor_complete_partitions(g, v); -} -#endif - - -#ifdef GRIN_WITH_EDGE_PROPERTY -bool grin_is_edge_property_local_complete(GRIN_GRAPH g, GRIN_EDGE e) { - return true; -} - -GRIN_PARTITION_LIST edge_property_complete_partitions(GRIN_GRAPH g, GRIN_EDGE e) { - return GRIN_NULL_LIST; -} -#endif diff --git a/modules/graph/grin/src/partition/reference.cc b/modules/graph/grin/src/partition/reference.cc new file mode 100644 index 000000000..630b651d9 --- /dev/null +++ b/modules/graph/grin/src/partition/reference.cc @@ -0,0 +1,109 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/partition/reference.h" + + +#ifdef GRIN_ENABLE_VERTEX_REF +GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + auto gid = _g->Vertex2Gid(*_v); + auto vr = new GRIN_VERTEX_REF_T(gid); + return vr; +} + +GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { + auto _g = static_cast(g); + auto _vr = static_cast(vr); + auto v = new GRIN_VERTEX_T(); + if (_g->Gid2Vertex(*_vr, *v)) { + return v; + } + return GRIN_NULL_VERTEX; +} + +GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { + auto _g = static_cast(g); + auto _vr = static_cast(vr); + auto id_parser = vineyard::IdParser(); + id_parser.Init(_g->fnum(), _g->vertex_label_num()); + auto p = new GRIN_PARTITION_T(id_parser.GetFid(*_vr)); + return p; +} + +const char* grin_serialize_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { + auto _vr = static_cast(vr); + std::stringstream ss; + ss << *_vr; + int len = ss.str().length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", ss.str().c_str()); + return out; +} + +GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH g, const char* msg) { + std::stringstream ss(msg); + GRIN_VERTEX_REF_T gid; + ss >> gid; + auto vr = new GRIN_VERTEX_REF_T(gid); + return vr; +} + +bool grin_is_master_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + return _g->IsInnerVertex(*_v); +} + +bool grin_is_mirror_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g); + auto _v = static_cast(v); + return _g->IsOuterVertex(*_v); +} +#endif + +#ifdef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST +GRIN_PARTITION_LIST grin_get_master_vertex_mirror_partition_list(GRIN_GRAPH, GRIN_VERTEX); +#endif + +#ifdef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST +GRIN_PARTITION_LIST grin_get_mirror_vertex_mirror_partition_list(GRIN_GRAPH, GRIN_VERTEX); +#endif + +#ifdef GRIN_ENABLE_EDGE_REF +GRIN_EDGE_REF grin_get_edge_ref_for_edge(GRIN_GRAPH, GRIN_EDGE); + +GRIN_EDGE grin_get_edge_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); + +GRIN_PARTITION grin_get_master_partition_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); + +const char* grin_serialize_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); + +GRIN_EDGE_REF grin_deserialize_to_edge_ref(GRIN_GRAPH, const char*); + +bool grin_is_master_edge(GRIN_GRAPH, GRIN_EDGE); + +bool grin_is_mirror_edge(GRIN_GRAPH, GRIN_EDGE); +#endif + +#ifdef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST +GRIN_PARTITION_LIST grin_get_master_edge_mirror_partition_list(GRIN_GRAPH, GRIN_EDGE); +#endif + +#ifdef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST +GRIN_PARTITION_LIST grin_get_mirror_edge_mirror_partition_list(GRIN_GRAPH, GRIN_EDGE); +#endif diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc new file mode 100644 index 000000000..61d8ec4d4 --- /dev/null +++ b/modules/graph/grin/src/partition/topology.cc @@ -0,0 +1,106 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/partition/topology.h" + +#if defined(GRIN_WITH_VERTEX_DATA) && \ + !defined(GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE) +bool grin_is_vertex_data_local_complete(GRIN_GRAPH, GRIN_VERTEX); + +GRIN_PARTITION_LIST grin_vertex_data_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); +#endif + +#if defined(GRIN_WITH_EDGE_DATA) && \ + !defined(GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE) +bool grin_is_edge_data_local_complete(GRIN_GRAPH, GRIN_EDGE); + +GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); +#endif + + +#ifdef GRIN_TRAIT_FILTER_MASTER_FOR_VERTEX_LIST +GRIN_VERTEX_LIST grin_filter_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { + auto _g = static_cast(g); + auto _vl = static_cast(vl); + _vl->all_master_mirror = 1; + __grin_init_vertex_list(_g, _vl); + return _vl; +} + +GRIN_VERTEX_LIST grin_filter_mirror_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { + auto _g = static_cast(g); + auto _vl = static_cast(vl); + _vl->all_master_mirror = 2; + __grin_init_vertex_list(_g, _vl); + return _vl; +} +#endif + + +#ifdef GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST +GRIN_VERTEX_LIST grin_filter_partition_for_vertex_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_VERTEX_LIST); +#endif + + + +#ifdef GRIN_TRAIT_FILTER_MASTER_FOR_EDGE_LIST +GRIN_EDGE_LIST grin_filter_master_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); + +GRIN_EDGE_LIST grin_filter_mirror_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); +#endif + + +#ifdef GRIN_TRAIT_FILTER_PARTITION_FOR_EDGE_LIST +GRIN_EDGE_LIST grin_filter_partition_for_edge_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_EDGE_LIST); +#endif + + +#if defined(GRIN_ENABLE_ADJACENT_LIST) && \ + !defined(GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ + !defined(GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE) +// The concept of local_complete refers to whether we can get complete data or properties +// locally in the partition. It is orthogonal to the concept of master/mirror which +// is mainly designed for data aggregation. In some extremely cases, master vertices +// may NOT contain all the data or properties locally. +bool grin_is_vertex_neighbor_local_complete(GRIN_GRAPH, GRIN_VERTEX); + +/** + * @brief get the partitions whose combination can provide the complete + * neighbors of a vertex. + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX the vertex + */ +GRIN_PARTITION_LIST grin_vertex_neighbor_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); +#endif + + +#ifdef GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_filter_master_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); + +GRIN_ADJACENT_LIST grin_filter_mirror_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); +#endif + +#ifdef GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_filter_neighbor_partition_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); +#endif diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index de40c54b8..cb1025e63 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -73,3 +73,49 @@ GRIN_DATATYPE ArrowToDataType(std::shared_ptr type) { } return GRIN_DATATYPE::Undefined; } + +#ifdef GRIN_ENABLE_VERTEX_LIST +void __grin_init_vertex_list(GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { + vl->current = 0; + vl->type_current = vl->type_begin; + vl->offsets.clear(); + vl->vrs.clear(); + GRIN_GRAPH_T::vertices_t vr; + vl->offsets.push_back(0); + unsigned sum = 0; + for (auto vtype = vl->type_begin; vtype < vl->type_end; ++vtype) { + if (vl->all_master_mirror == 0) { + vr = g->Vertices(vtype); + } else if (vl->all_master_mirror == 1) { + vr = g->InnerVertices(vtype); + } else { + vr = g->OuterVertices(vtype); + } + sum += vr.size(); + vl->offsets.push_back(sum); + vl->vrs.push_back(vr); + } +} +#endif + +#ifdef GRIN_ENABLE_ADJACENT_LIST +void __grin_init_adjacent_list(GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { + al->current = 0; + al->etype_current = al->etype_begin; + al->offsets.clear(); + al->data.clear(); + GRIN_GRAPH_T::raw_adj_list_t ral; + al->offsets.push_back(0); + unsigned sum = 0; + for (auto etype = al->etype_begin; etype < al->etype_end; ++etype) { + if (al->dir == GRIN_DIRECTION::IN) { + ral = g->GetIncomingRawAdjList(*(al->v), etype); + } else { + ral = g->GetOutgoingRawAdjList(*(al->v), etype); + } + sum += ral.size(); + al->offsets.push_back(sum); + al->data.push_back(ral); + } +} +#endif \ No newline at end of file diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 010b84c3f..879f4ed94 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -98,17 +98,53 @@ typedef GRIN_GRAPH_T::oid_t VERTEX_ORIGINAL_ID_T; #endif #ifdef GRIN_ENABLE_VERTEX_LIST -typedef std::pair _GRIN_TYPED_VERTICES_T; -typedef std::vector<_GRIN_TYPED_VERTICES_T> GRIN_VERTEX_LIST_T; +struct GRIN_VERTEX_LIST_T { + unsigned type_begin; + unsigned type_end; + unsigned all_master_mirror; + unsigned type_current; + unsigned current; + std::vector offsets; + std::vector vrs; +}; +void __grin_init_vertex_list(GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl); +#endif + +#ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR +struct GRIN_VERTEX_LIST_ITERATOR_T { + unsigned type_begin; + unsigned type_end; + unsigned all_master_mirror; + unsigned type_current; + unsigned current; + GRIN_GRAPH_T::vertices_t vr; +}; #endif #ifdef GRIN_ENABLE_ADJACENT_LIST struct GRIN_ADJACENT_LIST_T { - GRIN_VERTEX v; + GRIN_VERTEX_T* v; GRIN_DIRECTION dir; - unsigned etype; + unsigned etype_begin; + unsigned etype_end; + unsigned etype_current; + unsigned current; + std::vector offsets; std::vector data; -}; +}; +void __grin_init_adjacent_list(GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al); +#endif + +#ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR +struct GRIN_ADJACENT_LIST_ITERATOR_T { + GRIN_VERTEX_T* v; + GRIN_DIRECTION dir; + unsigned etype_begin; + unsigned etype_end; + unsigned etype_current; + unsigned current; + GRIN_GRAPH_T::raw_adj_list_t data; +}; #endif #ifdef GRIN_ENABLE_GRAPH_PARTITION diff --git a/modules/graph/grin/src/predicate/order.cc b/modules/graph/grin/src/predicate/order.cc index 78bdeae6a..c0f7750ad 100644 --- a/modules/graph/grin/src/predicate/order.cc +++ b/modules/graph/grin/src/predicate/order.cc @@ -13,19 +13,8 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/predicate/order.h" -#ifdef GRIN_PREDICATE_ENABLE_VERTEX_ORDERING -struct less_than_key { - inline bool operator() (const _GRIN_TYPED_VERTICES_T& tv1, const _GRIN_TYPED_VERTICES_T& tv2) { - if (tv1.first == tv2.first) { - return tv1.second.begin_value() < tv2.second.begin_value(); - } - return tv1.first < tv2.first; - } -}; - +#ifdef GRIN_PREDICATE_VERTEX_ORDERING bool grin_sort_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { - auto _vl = static_cast(vl); - std::sort(_vl->begin(), _vl->end(), less_than_key()); return true; }; @@ -34,18 +23,12 @@ bool grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LIST auto _v = static_cast(v); auto _vl = static_cast(vl); auto vtype = _g->vertex_label(*_v); + if (vtype < _vl->type_begin || vtype >= _vl->type_end) return false; pos = 0; - for (auto &tv : *_vl) { - if (tv.first < vtype) pos += tv.second.size(); - else if (tv.first > vtype) return false; - else { - if (tv.second.Contain(*_v)) { - pos += _v->GetValue() - tv.second.begin_value(); - return true; - } else { - return false; - } - } + auto offset = _v->GetValue() - _vl->vrs[vtype - _vl->type_begin].begin_value(); + if (offset < _vl->vrs[vtype - _vl->type_begin].size()) { + pos = _vl->offsets[vtype - _vl->type_begin] + offset; + return true; } return false; }; diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 5eebf5d59..cbaafe1bb 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -13,7 +13,7 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/property/property.h" -#if defined(GRIN_WITH_PROPERTY_NAME) && defined(GRIN_WITH_VERTEX_PROPERTY) +#ifdef GRIN_WITH_VERTEX_PROPERTY_NAME const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { auto _g = static_cast(g); auto _vp = static_cast(vp); @@ -44,7 +44,7 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const } #endif -#if defined(GRIN_WITH_PROPERTY_NAME) && defined(GRIN_WITH_EDGE_PROPERTY) +#ifdef GRIN_WITH_EDGE_PROPERTY_NAME const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g); auto _ep = static_cast(ep); diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index 72b1f67b9..fa5739153 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -54,7 +54,7 @@ bool grin_insert_vertex_property_to_list(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST #endif -#ifdef GRIN_NATURAL_VERTEX_PROPERTY_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY_ID vpi) { auto _vtype = static_cast(vtype); auto vp = new GRIN_VERTEX_PROPERTY_T(*_vtype, vpi); @@ -111,7 +111,7 @@ bool grin_insert_edge_property_to_list(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl #endif -#ifdef GRIN_NATURAL_EDGE_PROPERTY_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY_ID epi) { auto _etype = static_cast(etype); auto ep = new GRIN_EDGE_PROPERTY_T(*_etype, epi); @@ -127,7 +127,7 @@ GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH g, GRIN_EDGE_TYPE ety #endif -#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_COLUMN_STORE_TRAIT) +#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) GRIN_GRAPH grin_select_vertex_properties(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl) { auto _g = static_cast(g); auto _vpl = static_cast(vpl); @@ -147,7 +147,7 @@ GRIN_GRAPH grin_select_vertex_properties(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST } #endif -#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_COLUMN_STORE_TRAIT) +#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) GRIN_GRAPH grin_select_edge_properteis(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl) { auto _g = static_cast(g); auto _epl = static_cast(epl); diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index d4e84802a..6ea3d061a 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -13,7 +13,7 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/property/propertytable.h" -#if defined(GRIN_WITH_VERTEX_PROPERTY) || defined(GRIN_WITH_EDGE_PROPERTY) +#ifdef GRIN_ENABLE_ROW void grin_destroy_row(GRIN_GRAPH g, GRIN_ROW r) { auto _r = static_cast(r); delete _r; @@ -37,7 +37,7 @@ bool grin_insert_value_to_row(GRIN_GRAPH g, GRIN_ROW r, void* value) { #endif -#ifdef GRIN_WITH_VERTEX_PROPERTY +#ifdef GRIN_ENABLE_VERTEX_PROPERTY_TABLE void grin_destroy_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt) { auto _vpt = static_cast(vpt); delete _vpt; @@ -64,7 +64,9 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ auto result = vineyard::get_arrow_array_data_element(array, offset); return result; } +#endif +#if defined(GRIN_ENABLE_VERTEX_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY_LIST vpl) { auto _g = static_cast(g); @@ -85,7 +87,17 @@ GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPE } #endif -#ifdef GRIN_WITH_EDGE_PROPERTY +#if !defined(GRIN_ASSUME_COLUMN_STORE) && defined(GRIN_ENABLE_ROW) +/** + * @brief get vertex row directly from the graph, this API only works for row store system + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX the vertex which is the row index + * @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns + */ +GRIN_ROW grin_get_vertex_row(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); +#endif + +#ifdef GRIN_ENABLE_EDGE_PROPERTY_TABLE void grin_destroy_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept) { auto _ept = static_cast(ept); delete _ept; @@ -112,7 +124,9 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP auto result = vineyard::get_arrow_array_data_element(array, offset); return result; } +#endif +#if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE v, GRIN_EDGE_PROPERTY_LIST epl) { auto _g = static_cast(g); @@ -132,3 +146,13 @@ GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_ return r; } #endif + +#if !defined(GRIN_ASSUME_COLUMN_STORE) && defined(GRIN_ENABLE_ROW) +/** + * @brief get edge row directly from the graph, this API only works for row store system + * @param GRIN_GRAPH the graph + * @param GRIN_EDGE the edge which is the row index + * @param GRIN_EDGE_PROPERTY_LIST the edge property list as columns + */ +GRIN_ROW grin_get_edge_row(GRIN_GRAPH, GRIN_EDGE, GRIN_EDGE_PROPERTY_LIST); +#endif \ No newline at end of file diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc new file mode 100644 index 000000000..020b12d3f --- /dev/null +++ b/modules/graph/grin/src/property/topology.cc @@ -0,0 +1,79 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/property/topology.h" + + +#ifdef GRIN_WITH_VERTEX_PROPERTY +size_t grin_get_vertex_num_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + return _g->GetVerticesNum(*_vtype); +} +#endif + +#ifdef GRIN_WITH_EDGE_PROPERTY +size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_EDGE_TYPE etype) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + return _g->edge_data_table(*_etype)->num_rows(); +} +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID +GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_ORIGINAL_ID oid) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto _oid = static_cast(oid); + GRIN_GRAPH_T::vid_t gid; + auto v = new GRIN_VERTEX_T(); + if (_g->Oid2Gid(*_vtype, *_oid, gid)) { + if (_g->Gid2Vertex(gid, *v)) { + return v; + } + } + return GRIN_NULL_VERTEX; +} +#endif + +#ifdef GRIN_TRAIT_FILTER_TYPE_FOR_VERTEX_LIST +GRIN_VERTEX_LIST grin_filter_type_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_LIST vl) { + auto _g = static_cast(g); + auto _vtype = static_cast(vtype); + auto _vl = static_cast(vl); + _vl->type_begin = *_vtype; + _vl->type_end = *_vtype + 1; + __grin_init_vertex_list(_g, _vl); + return _vl; +} +#endif + +#ifdef GRIN_TRAIT_FILTER_TYPE_FOR_EDGE_LIST +GRIN_EDGE_LIST grin_filter_type_for_edge_list(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_LIST); +#endif + +#ifdef GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_filter_neighbor_type_for_adjacent_list(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_ADJACENT_LIST); +#endif + +#ifdef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_filter_edge_type_for_adjacent_list(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_ADJACENT_LIST al) { + auto _g = static_cast(g); + auto _etype = static_cast(etype); + auto _al = static_cast(al); + _al->etype_begin = *_etype; + _al->etype_end = *_etype + 1; + __grin_init_adjacent_list(_g, _al); + return _al; +} +#endif \ No newline at end of file diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 951de142a..aed919e72 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -27,23 +27,6 @@ GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH g, GRIN_VERTEX v) { return vt; } -const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { - auto _g = static_cast(g); - auto _vt = static_cast(vt); - auto s = _g->schema().GetVertexLabelName(*_vt); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; -} - -GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { - auto _g = static_cast(g); - auto s = std::string(name); - auto vt = new GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(s)); - return vt; -} - GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH g) { auto _g = static_cast(g); auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); @@ -82,8 +65,26 @@ GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE_L } #endif +#ifdef GRIN_WITH_VERTEX_TYPE_NAME +const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { + auto _g = static_cast(g); + auto _vt = static_cast(vt); + auto s = _g->schema().GetVertexLabelName(*_vt); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} -#ifdef GRIN_NATURAL_VERTEX_TYPE_ID_TRAIT +GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { + auto _g = static_cast(g); + auto s = std::string(name); + auto vt = new GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(s)); + return vt; +} +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { auto _vt = static_cast(vt); return *_vt; @@ -109,23 +110,6 @@ GRIN_EDGE_TYPE grin_get_edge_type(GRIN_GRAPH g, GRIN_EDGE e) { return et; } -const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { - auto _g = static_cast(g); - auto _et = static_cast(et); - auto s = _g->schema().GetEdgeLabelName(*_et); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; -} - -GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { - auto _g = static_cast(g); - auto s = std::string(name); - auto et = new GRIN_EDGE_TYPE_T(_g->schema().GetEdgeLabelId(s)); - return et; -} - GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH g) { auto _g = static_cast(g); auto etl = new GRIN_EDGE_TYPE_LIST_T(); @@ -164,8 +148,27 @@ GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST et } #endif +#ifdef GRIN_WITH_EDGE_TYPE_NAME +const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { + auto _g = static_cast(g); + auto _et = static_cast(et); + auto s = _g->schema().GetEdgeLabelName(*_et); + int len = s.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s.c_str()); + return out; +} + +GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { + auto _g = static_cast(g); + auto s = std::string(name); + auto et = new GRIN_EDGE_TYPE_T(_g->schema().GetEdgeLabelId(s)); + return et; +} +#endif + -#ifdef GRIN_NATURAL_EDGE_TYPE_ID_TRAIT +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { auto _et = static_cast(et); return *_et; diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 928ffe85d..a29743d43 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -18,41 +18,18 @@ limitations under the License. #ifdef GRIN_ENABLE_ADJACENT_LIST GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_VERTEX v) { + if (d == GRIN_DIRECTION::BOTH) return GRIN_NULL_LIST; auto _g = static_cast(g); auto _v = static_cast(v); auto al = new GRIN_ADJACENT_LIST_T(); - al->v = v; + al->v = _v; al->dir = d; - al->etype = _g->edge_label_num(); - for (GRIN_EDGE_TYPE_T etype = 0; etype < al->etype; ++etype) { - if (d == GRIN_DIRECTION::IN) { - al->data.push_back(_g->GetIncomingRawAdjList(*_v, etype)); - } else { - al->data.push_back(_g->GetOutgoingRawAdjList(*_v, etype)); - } - } + al->etype_begin = 0; + al->etype_end = _g->edge_label_num(); + __grin_init_adjacent_list(_g, al); return al; } -#ifdef GRIN_WITH_EDGE_PROPERTY -GRIN_ADJACENT_LIST grin_get_adjacent_list_by_edge_type(GRIN_GRAPH g, GRIN_DIRECTION d, - GRIN_VERTEX v, GRIN_EDGE_TYPE etype) { - auto _g = static_cast(g); - auto _v = static_cast(v); - auto _etype = static_cast(etype); - auto al = new GRIN_ADJACENT_LIST_T(); - al->v = v; - al->dir = d; - al->etype = *_etype; - if (d == GRIN_DIRECTION::IN) { - al->data.push_back(_g->GetIncomingRawAdjList(*_v, *_etype)); - } else { - al->data.push_back(_g->GetOutgoingRawAdjList(*_v, *_etype)); - } - return al; -} -#endif - void grin_destroy_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { auto _al = static_cast(al); delete _al; @@ -60,21 +37,15 @@ void grin_destroy_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { size_t grin_get_adjacent_list_size(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { auto _al = static_cast(al); - size_t result = 0; - for (auto &ral : _al->data) { - result += ral.Size(); - } - return result; + return _al->offsets[_al->etype_end - _al->etype_begin]; } GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { auto _al = static_cast(al); - size_t result = 0; - for (auto &ral : _al->data) { - result += ral.Size(); - if (idx < result) { - auto _idx = idx - (result - ral.size()); - auto _nbr = ral.begin() + _idx; + for (auto i = 0; i < _al->etype_end - _al->etype_begin; ++i) { + if (idx < _al->offsets[i+1]) { + auto _idx = idx - _al->offsets[i]; + auto _nbr = _al->data[i].begin() + _idx; auto v = new GRIN_VERTEX_T(_nbr->vid); return v; } @@ -83,23 +54,35 @@ GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIS } GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { - auto _al = static_cast(al); - size_t result = 0; - for (auto i = 0; i < _al->data.size(); ++i) { - result += _al->data[i].Size(); - if (idx < result) { - auto _idx = idx - (result - _al->data[i].Size()); + auto _al = static_cast(al); + for (auto i = 0; i < _al->etype_end - _al->etype_begin; ++i) { + if (idx < _al->offsets[i+1]) { + auto _idx = idx - _al->offsets[i]; auto _nbr = _al->data[i].begin() + _idx; auto v = new GRIN_VERTEX_T(_nbr->vid); auto e = new GRIN_EDGE_T(); e->src = _al->v; e->dst = v; e->dir = _al->dir; - e->etype = _al->data.size() > 1 ? i : _al->etype; + e->etype = _al->etype_begin + i; e->eid = _nbr->eid; - return e; + return e; } } return GRIN_NULL_EDGE; } +#endif + +#ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR +GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); + +void grin_destroy_adjacent_list_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); + +GRIN_ADJACENT_LIST_ITERATOR grin_get_next_adjacent_list_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); + +bool grin_is_adjacent_list_end(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); + +GRIN_VERTEX grin_get_neighbor_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); + +GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); #endif \ No newline at end of file diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index beabaa466..52c237041 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -35,14 +35,6 @@ size_t grin_get_vertex_num(GRIN_GRAPH g) { return result; } -#ifdef GRIN_WITH_VERTEX_PROPERTY -size_t grin_get_vertex_num_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - return _g->GetVerticesNum(*_vtype); -} -#endif - size_t grin_get_edge_num(GRIN_GRAPH g, GRIN_DIRECTION d) { auto _g = static_cast(g); if (d == IN) { @@ -53,13 +45,6 @@ size_t grin_get_edge_num(GRIN_GRAPH g, GRIN_DIRECTION d) { return _g->GetEdgeNum(); } -#ifdef GRIN_WITH_EDGE_PROPERTY -size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_EDGE_TYPE etype) { - auto _g = static_cast(g); - auto _etype = static_cast(etype); - return _g->edge_data_table(*_etype)->num_rows(); -} -#endif // Vertex void grin_destroy_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { @@ -68,17 +53,10 @@ void grin_destroy_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { } #ifdef GRIN_WITH_VERTEX_ORIGINAL_ID -GRIN_VERTEX grin_get_vertex_from_original_id(GRIN_GRAPH g, GRIN_VERTEX_ORIGINAL_ID oid) { - auto _g = static_cast(g); - GRIN_VERTEX result; - for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - result = grin_get_vertex_from_original_id_by_type(g, &vtype, oid); - if (result != GRIN_NULL_VERTEX) { - return result; - } - } - return GRIN_NULL_VERTEX; -} +void grin_destroy_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX_ORIGINAL_ID oid) { + auto _oid = static_cast(oid); + delete _oid; +} GRIN_DATATYPE grin_get_vertex_original_id_type(GRIN_GRAPH g) { return GRIN_DATATYPE_ENUM::value; @@ -92,30 +70,21 @@ GRIN_VERTEX_ORIGINAL_ID grin_get_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX v) auto oid = new VERTEX_ORIGINAL_ID_T(_g->Gid2Oid(gid)); return oid; } +#endif -void grin_destroy_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX_ORIGINAL_ID oid) { - auto _oid = static_cast(oid); - delete _oid; -} +#if defined(GRIN_WITH_VERTEX_ORIGINAL_ID) && !defined(GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID) +GRIN_VERTEX grin_get_vertex_from_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); #endif -#if defined(GRIN_WITH_VERTEX_ORIGINAL_ID) && defined(GRIN_WITH_VERTEX_PROPERTY) -GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_ORIGINAL_ID oid) { - auto _g = static_cast(g); - auto _vtype = static_cast(vtype); - auto _oid = static_cast(oid); - GRIN_GRAPH_T::vid_t gid; - auto v = new GRIN_VERTEX_T(); - if (_g->Oid2Gid(*_vtype, *_oid, gid)) { - if (_g->Gid2Vertex(gid, *v)) { - return v; - } - } - return GRIN_NULL_VERTEX; -} +#ifdef GRIN_WITH_VERTEX_DATA +GRIN_DATATYPE grin_get_vertex_data_type(GRIN_GRAPH, GRIN_VERTEX); + +GRIN_VERTEX_DATA grin_get_vertex_data_value(GRIN_GRAPH, GRIN_VERTEX); + +void grin_destroy_vertex_data(GRIN_GRAPH, GRIN_VERTEX_DATA); #endif -// GRIN_EDGE +// Edge void grin_destroy_edge(GRIN_GRAPH g, GRIN_EDGE e) { auto _e = static_cast(e); delete _e; @@ -130,3 +99,11 @@ GRIN_VERTEX grin_get_edge_dst(GRIN_GRAPH g, GRIN_EDGE e) { auto _e = static_cast(e); return _e->dst; } + +#ifdef GRIN_WITH_EDGE_DATA +GRIN_DATATYPE grin_get_edge_data_type(GRIN_GRAPH, GRIN_EDGE); + +GRIN_EDGE_DATA grin_get_edge_data_value(GRIN_GRAPH, GRIN_EDGE); + +void grin_destroy_edge_data(GRIN_GRAPH, GRIN_EDGE_DATA); +#endif \ No newline at end of file diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index 9b25013d6..815b18152 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -20,61 +20,43 @@ limitations under the License. GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g) { auto _g = static_cast(g); auto vl = new GRIN_VERTEX_LIST_T(); - for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - vl->push_back(_GRIN_TYPED_VERTICES_T(vtype, _g->Vertices(vtype))); - } + vl->type_begin = 0; + vl->type_end = _g->vertex_label_num(); + __grin_init_vertex_list(_g, vl); return vl; } -#ifdef GRIN_WITH_VERTEX_PROPERTY -GRIN_VERTEX_LIST grin_get_vertex_list_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { - auto _g = static_cast(g); - auto vl = new GRIN_VERTEX_LIST_T(); - auto _vtype = static_cast(vtype); - vl->push_back(_GRIN_TYPED_VERTICES_T(*_vtype, _g->Vertices(*_vtype))); - return vl; -} -#endif - void grin_destroy_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _vl = static_cast(vl); delete _vl; } -GRIN_VERTEX_LIST grin_create_vertex_list(GRIN_GRAPH g) { - auto vl = new GRIN_VERTEX_LIST_T(); - return vl; -} - -bool grin_insert_vertex_to_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v) { - auto _g = static_cast(g); - auto _vl = static_cast(vl); - auto _v = static_cast(v); - auto vtype = _g->vertex_label(*_v); - _vl->push_back(_GRIN_TYPED_VERTICES_T(vtype, GRIN_GRAPH_T::vertex_range_t(_v->GetValue(), _v->GetValue()))); - return true; -} - size_t grin_get_vertex_list_size(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _vl = static_cast(vl); - size_t result = 0; - for (auto &tv : *_vl) { - result += tv.second.size(); - } - return result; + return _vl->offsets[_vl->type_end - _vl->type_begin]; } GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t idx) { auto _vl = static_cast(vl); - size_t result = 0; - for (auto &tv : *_vl) { - result += tv.second.size(); - if (idx < result) { - auto _idx = idx - (result - tv.second.size()); - auto v = new GRIN_VERTEX_T(tv.second.begin_value() + _idx); + for (auto i = 0; i < _vl->type_end - _vl->type_begin; ++i) { + if (idx < _vl->offsets[i+1]) { + auto _idx = idx - _vl->offsets[i]; + auto v = new GRIN_VERTEX_T(_vl->vrs[i].begin_value() + _idx); return v; } } return GRIN_NULL_VERTEX; } #endif + +#ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR +GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH); + +void grin_destroy_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); + +GRIN_VERTEX_LIST_ITERATOR grin_get_next_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); + +bool grin_is_vertex_list_end(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); + +GRIN_VERTEX grin_get_vertex_from_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); +#endif diff --git a/modules/graph/test/grin_arrow_fragment_test.cc b/modules/graph/test/grin_arrow_fragment_test.cc index 0888d5483..e6aeac96f 100644 --- a/modules/graph/test/grin_arrow_fragment_test.cc +++ b/modules/graph/test/grin_arrow_fragment_test.cc @@ -56,6 +56,7 @@ void TraverseLocalGraph(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION auto edge = it.get_edge(); if (dt_name == "double") { auto value = it.get_data(prop); + std::cout << value << std::endl; } } } diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index 14fb3e19d..de8f6af8b 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -66,26 +66,28 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part GRIN_VERTEX_PROPERTY_TABLE dst_vpt = grin_get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use GRIN_DATATYPE dst_vp_dt = grin_get_vertex_property_data_type(g, dst_vp); // prepare property type for later use - GRIN_VERTEX_LIST src_vl = grin_get_master_vertices_by_type(g, src_vtype); // we only need master vertices under source type + GRIN_VERTEX_LIST __src_vl = grin_get_vertex_list(g); // get the vertex list + GRIN_VERTEX_LIST _src_vl = grin_filter_type_for_vertex_list(g, src_vtype, __src_vl); // filter the vertex of source type + GRIN_VERTEX_LIST src_vl = grin_filter_master_for_vertex_list(g, _src_vl); // filter master vertices under source type size_t src_vl_num = grin_get_vertex_list_size(g, src_vl); for (size_t j = 0; j < src_vl_num; ++j) { // iterate the src vertex GRIN_VERTEX v = grin_get_vertex_from_list(g, src_vl, j); - GRIN_ADJACENT_LIST adj_list = grin_get_adjacent_list_by_edge_type(g, GRIN_DIRECTION::OUT, v, etype); // get the adjacent list of v with edges under etype - bool check_flag = false; - if (adj_list == GRIN_NULL_LIST) { // NULL_LIST means the storage does NOT support getting adj_list by edge type, note that list with size 0 is NOT a NULL_LIST - // Then we should scan the full adj list and filter edge type by ourselves. - adj_list = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); - check_flag = true; - } + +#ifdef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST + GRIN_ADJACENT_LIST _adj_list = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v + GRIN_ADJACENT_LIST adj_list = grin_filter_edge_type_for_adjacent_list(g, etype, _adj_list); // filter edges under etype +#else + GRIN_ADJACENT_LIST adj_lsit = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v +#endif size_t al_sz = grin_get_adjacent_list_size(g, adj_list); for (size_t k = 0; k < al_sz; ++k) { - if (check_flag) { - GRIN_EDGE edge = grin_get_edge_from_adjacent_list(g, adj_list, k); - GRIN_EDGE_TYPE edge_type = grin_get_edge_type(g, edge); - if (!grin_equal_edge_type(g, edge_type, etype)) continue; - } +#ifndef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST + GRIN_EDGE edge = grin_get_edge_from_adjacent_list(g, adj_list, k); + GRIN_EDGE_TYPE edge_type = grin_get_edge_type(g, edge); + if (!grin_equal_edge_type(g, edge_type, etype)) continue; +#endif GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list(g, adj_list, k); // get the dst vertex u const void* value = grin_get_value_from_vertex_property_table(g, dst_vpt, u, dst_vp); // get the property value of "features" of u From 62d008a519ef3becf9a4ca1bab290174498a0311 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 10 Mar 2023 11:09:14 +0800 Subject: [PATCH 16/85] update docs --- modules/graph/grin/docs/README.md | 70 +++++++++++++++---------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index ad4f31dc7..76795dee6 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -29,15 +29,17 @@ storage systems in a uniform way. ### Assumption Macros - GRIN also provides granula assumption macros to describe storage assumptions. -- Some assumptions may dominate others, so storage providers should take care when setting these assumptions. +- Some assumptions may dominate other. It means some assumption applies in a wider range than others. Hence, storage providers should take care when setting these assumptions. - Take assumptions on vertex property local complete as example, GRIN provides four macros: 1. GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE 2. GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE 3. GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE 4. GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -- Here 1. dominates others, 2. dominates 4., and 3. also dominates 4., that means 2. to 4. are undefined when 1. is defined. -- Suppose only 3. is defined, it means vertices of certain types have all the properties locally complete, no matter the vertex is master or mirror. In this case, GRIN provides an API to return -these vertex types. +- Here 1. dominates others, which means 2. to 4. are undefined when 1. is defined. Also, there are 2. dominates 4., and 3. dominates 4., +- GRIN provides different API under different assumptions. +- Suppose only 3. is defined, it means vertices of certain types have all the properties locally complete, no matter the vertex is master or mirror. +In this case, GRIN provides an API to return these local complete vertex types. +- While in case that none of these four macros is defined, GRIN will provide a per-vertex API to tell whether the vertex property is local complete. ----- @@ -54,20 +56,20 @@ these vertex types. ```CPP /* grin/topology/vertexlist.h */ - VertexList get_vertex_list(Graph g); // get the vertexlist of a graph + GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g); // get the vertexlist of a graph - size_t get_vertex_list_size(VertexList vl); // the storage must implement the API to return the size of vertexlist + size_t grin_get_vertex_list_size(GRIN_GRAPH g, GRIN_VERTEX_LIST vl); // the storage must implement the API to return the size of vertexlist - Vertex get_vertex_from_list(VertexList vl, size_t idx); // the storage must implement the API to return the element of vertexlist by position + GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t idx); // the storage must implement the API to return the element of vertexlist by position /* run.cc */ { - auto vertexlist = get_vertex_list(g); // with a graph (handler) g - auto sz = get_vertex_list_size(vertexlist); + auto vertexlist = grin_get_vertex_list(g); // with a graph (handler) g + auto sz = grin_get_vertex_list_size(g, vertexlist); for (auto i = 0; i < sz; ++i) { - auto v = get_vertex_from_list(vertexlist, i); + auto v = grin_get_vertex_from_list(g, vertexlist, i); } } ``` @@ -79,22 +81,22 @@ these vertex types. ```CPP /* grin/topology/vertexlist.h */ - VertexListIterator get_vertex_list_begin(Graph g); // get the begin iterator of the vertexlist + GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH g); // get the begin iterator of the vertexlist - VertexListIterator get_next_vertex_list_iter(VertexListIterator); // get next iterator + GRIN_VERTEX_LIST_ITERATOR grin_get_next_vertex_list_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli); // get next iterator - bool is_vertex_list_end(VertexListIterator); // check if reaches the end + bool grin_is_vertex_list_end(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli); // check if reaches the end - Vertex get_vertex_from_iter(VertexListIterator vli); // get the vertex from the iterator + GRIN_VERTEX grin_get_vertex_from_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli); // get the vertex from the iterator /* run.cc */ { - auto iter = get_vertex_list_begin(g); // with a graph (handler) g + auto iter = grin_get_vertex_list_begin(g); // with a graph (handler) g - while (!is_vertex_list_end(iter)) { - auto v = get_vertex_from_iter(iter); - iter = get_next_vertex_list_iter(iter); + while (!grin_is_vertex_list_end(g, iter)) { + auto v = grin_get_vertex_from_iter(g, iter); + iter = grin_get_next_vertex_list_iter(g, iter); } } ``` @@ -108,22 +110,22 @@ different data types in the underlying storage for efficiency concerns (e.g., sh ```CPP /* grin/property/type.h */ - VertexType get_vertex_type_by_name(Graph g, const char* name); + GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name); /* grin/property/property.h */ - VertexProperty get_vertex_property_by_name(Graph, VertexType, const char* name); + GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, const char* name); - VertexPropertyList get_vertex_properties_by_name(Graph, const char* name); + GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const char* name); /* run.cc */ { - auto vtype = get_vertex_type_by_name(g, "Person"); // get the vertex type of Person - auto vprop = get_vertex_property_by_name(g, vtype, "Name"); // get the Name property bound to Person + auto vtype = grin_get_vertex_type_by_name(g, "Person"); // get the vertex type of Person + auto vprop = grin_get_vertex_property_by_name(g, vtype, "Name"); // get the Name property bound to Person - auto vpl = get_vertex_properties_by_name(g, "Name"); // get all the properties called Name under all the vertex types (e.g., Person, Company) in g + auto vpl = grin_get_vertex_properties_by_name(g, "Name"); // get all the properties called Name under all the vertex types (e.g., Person, Company) in g } ``` @@ -134,27 +136,25 @@ different data types in the underlying storage for efficiency concerns (e.g., sh ### Reference - GRIN introduces the reference concept in partitioned graph. It stands for the reference of an instance that can be recognized in partitions other than the current partition where the instance is accessed. -- For example, a `VertexRef` is a reference of a `Vertex` that can be recognized in other partitions. +- For example, a `GRIN_VERTEX_REF` is a reference of a `Vertex` that can be recognized in other partitions. ```CPP /* grin/partition/partition.h */ - VertexRef get_vertex_ref_for_vertex(Graph, Partition, Vertex); + GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH, GRIN_VERTEX); - const char* serialize_vertex_ref(Graph, VertexRef); + const char* grin_serialize_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); - VertexRef deserialize_to_vertex_ref(Graph, const char*); + GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH, const char*); - Vertex get_vertex_from_vertex_ref(Graph, VertexRef); + GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); /* run.cc in machine 1 */ { - // p is the partition (handler) for the partition in machine 2 + auto vref = grin_get_vertex_ref_for_vertex(g, v); // get v's vertex ref which can be recgonized in machine 2 - auto vref = get_vertex_ref_for_vertex(g, p, v); // get v's vertex ref which can be recgonized in machine 2 - - const char* msg = serialize_vertex_ref(g, vref); // serialize into a message + const char* msg = grin_serialize_vertex_ref(g, vref); // serialize into a message // send the message to machine 2... } @@ -164,9 +164,9 @@ be recognized in partitions other than the current partition where the instance { // recieve the message from machine 1... - auto vref = deserialize_to_vertex_ref(g, msg); // deserialize back to vertex ref + auto vref = grin_deserialize_to_vertex_ref(g, msg); // deserialize back to vertex ref - auto v = get_vertex_from_vertex_ref(g, vref); // cast to vertex if g can recognize the vertex ref + auto v = grin_get_vertex_from_vertex_ref(g, vref); // cast to vertex if g can recognize the vertex ref } ``` From 5d58284ec19652dcb1627daec1840e8b5c978969 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 15 Mar 2023 16:57:07 +0800 Subject: [PATCH 17/85] refactor array-style access & vertex ordering --- modules/graph/grin/docs/README.md | 104 ++++++++----- .../grin/include/{predicate => index}/order.h | 22 ++- modules/graph/grin/include/predefine.h | 139 ++++++++++++++---- .../grin/include/topology/adjacentlist.h | 4 +- .../graph/grin/include/topology/edgelist.h | 4 +- .../graph/grin/include/topology/structure.h | 2 + .../graph/grin/include/topology/vertexlist.h | 4 +- .../grin/src/{predicate => index}/order.cc | 15 +- modules/graph/grin/src/topology/structure.cc | 8 + 9 files changed, 225 insertions(+), 77 deletions(-) rename modules/graph/grin/include/{predicate => index}/order.h (68%) rename modules/graph/grin/src/{predicate => index}/order.cc (73%) diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index 76795dee6..7f91e4327 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -1,45 +1,69 @@ # GRIN -GRIN is a series of C-style Graph Retrieval INterfaces for graph computing engines to access different -storage systems in a uniform way. + +GRIN is a series of C-style Graph Retrieval INterfaces for graph computing engines to access different storage systems in a uniform way. + +The latest version of headers can be found in [v6d/dev/grin](https://github.com/v6d-io/v6d/tree/dev/grin/modules/graph/grin/include). Note that the predefine.h has been modified for v6d. ----- +## Implementation Guideline +### For computing engine +- Implement a wrapper class (normally grin_fragment or grin_graph) using GRIN APIs. +- When you find some function is hard or inefficient to implement, discuss with GRIN designers. +- Write or modify apps using the wrapper class (e.g., grin_fragment). +- Find a storage implementation to setup an end-to-end test. + +### For storage engine +- Copy header (source) files from documents. +- Modify the StorageSpecific part in the predefine.h based on the features of the storage. +- Implement the headers in another folder (e.g., src). If you find the time complexity of +some function is NOT sub-linear to the graph size, discuss with GRIN designers. +- Write a storage-specific method to get a graph handler from your storage. +- Run a graph traversal test. + ## Assumptions + ### Property Graph Model -- Vertices have types, so as Edges. -- The relationship between edge type and pairs of vertex types is many-to-many. -- Properties are bound to vertex and edge types, but some may have the same name. + +- Vertices have types, as do edges. +- The relationship between edge types and pairs of vertex types is many-to-many. +- Properties are bound to vertex and edge types, but some properties may have the same name. - Labels can be assigned to vertices and edges (NOT their types) primarily for query filtering, and labels have no properties. + ### Partition Strategies + #### Edge-cut Partition Strategy -- Vertex data are local complete for master vertices -- Edge data are local complete for all edges -- Neighbors are local complete for master vertices -- Vertex properties are local complete for master vertices -- Edge properties are local complete for all edges + +- Vertex data is locally complete for master vertices. +- Edge data is locally complete for all edges. +- Neighbors are locally complete for master vertices. +- Vertex properties are locally complete for master vertices. +- Edge properties are locally complete for all edges. #### Vertex-cut Partition Strategy -- Vertex data are local complete for all vertices -- Edge data are local complete for all edges -- Mirror partition list is available for master vertices to broadcast messages -- Vertex properties are local complete for all vertices -- Edge properties are local complete for all edges + +- Vertex data is locally complete for all vertices. +- Edge data is locally complete for all edges. +- Mirror partition list is available for master vertices to broadcast messages. +- Vertex properties are locally complete for all vertices. +- Edge properties are locally complete for all edges. ### Assumption Macros -- GRIN also provides granula assumption macros to describe storage assumptions. -- Some assumptions may dominate other. It means some assumption applies in a wider range than others. Hence, storage providers should take care when setting these assumptions. -- Take assumptions on vertex property local complete as example, GRIN provides four macros: + +- GRIN provides granularity assumption macros to describe storage assumptions. +- Some assumptions may dominate others, which means that some assumptions apply in a wider range than others. Therefore, storage providers should be careful when setting these assumptions. +- Taking the assumptions on vertex property local completeness as an example, GRIN provides four macros: 1. GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE 2. GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE 3. GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE 4. GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -- Here 1. dominates others, which means 2. to 4. are undefined when 1. is defined. Also, there are 2. dominates 4., and 3. dominates 4., -- GRIN provides different API under different assumptions. -- Suppose only 3. is defined, it means vertices of certain types have all the properties locally complete, no matter the vertex is master or mirror. -In this case, GRIN provides an API to return these local complete vertex types. -- While in case that none of these four macros is defined, GRIN will provide a per-vertex API to tell whether the vertex property is local complete. +- Here, 1 dominates the others, which means that 2 to 4 are undefined when 1 is defined. Additionally, 2 dominates 4, and 3 dominates 4. +- GRIN provides different APIs under different assumptions. +- Suppose only 3 is defined; it means that vertices of certain types have all the properties locally complete, regardless of whether the vertex is master or mirror. In this case, GRIN provides an API to return these locally complete vertex types. +- In the case that none of these four macros is defined, GRIN will provide a per-vertex API to tell whether the vertex property is locally complete. + ----- @@ -50,18 +74,25 @@ In this case, GRIN provides an API to return these local complete vertex types. - For example, GRIN uses the type Vertex to represent the type of a vertex handler, instead of using VertexHandler for clean code. ### List -- A list handler, no matter what kind of list it represents, is available to the user only if the storage can provide the size of the list, and an element retrieval API by position (i.e., index of array). Otherwise, the storage should provide a list iterator, see next section. -- A vertex list example +GRIN provides two alternative approaches, namely array-style retrieval and iterator, for list retrieval of GRIN_VERTEX_LIST, GRIN_EDGE_LIST, and GRIN_ADJACENT_LIST. + +For other schema-level lists like GRIN_VERTEX_TYPE_LIST or GRIN_PARTITION_LIST, GRIN generally assume the array-style list retrieval, and does NOT provide a ENALBE_ macro for these lists. + +#### Array-style Retrieval +- The array-style retrieval of a list handler is available to the user only if the storage can provide the size of the list, and an element retrieval API by position (i.e., index of array). Otherwise, the storage should provide a list iterator, see next section. +- Usually the array-style retrieval is controlled by the macros ended with _LIST_ARRAY +- A vertex list array-style retrieval example ```CPP /* grin/topology/vertexlist.h */ GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g); // get the vertexlist of a graph - size_t grin_get_vertex_list_size(GRIN_GRAPH g, GRIN_VERTEX_LIST vl); // the storage must implement the API to return the size of vertexlist - - GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t idx); // the storage must implement the API to return the element of vertexlist by position + #ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY + size_t grin_get_vertex_list_size(GRIN_GRAPH g, GRIN_VERTEX_LIST vl); // implement the API to return the size of vertexlist + GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t idx); // implement the API to return the element of vertexlist by position + #endif /* run.cc */ { @@ -74,25 +105,27 @@ In this case, GRIN provides an API to return these local complete vertex types. } ``` -### List Iterator -- A list iterator handler, no matter what kind of list it represents, is available to the user if the list size is unknown or for sequential scan efficiency. +#### List Iterator +- A list iterator handler is provided to caller if the list size is unknown or for sequential scan efficiency. +- Usually the iterators are enabled by macros ended with _LIST_ITERATOR - A vertex list iterator example ```CPP /* grin/topology/vertexlist.h */ - GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH g); // get the begin iterator of the vertexlist + #ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR + GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH g, GRIN_VERTEX_LIST vl); // get the begin iterator of the vertexlist GRIN_VERTEX_LIST_ITERATOR grin_get_next_vertex_list_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli); // get next iterator bool grin_is_vertex_list_end(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli); // check if reaches the end GRIN_VERTEX grin_get_vertex_from_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli); // get the vertex from the iterator - + #endif /* run.cc */ { - auto iter = grin_get_vertex_list_begin(g); // with a graph (handler) g + auto iter = grin_get_vertex_list_begin(g, vl); // with a graph (handler) g and vertexlist vl while (!grin_is_vertex_list_end(g, iter)) { auto v = grin_get_vertex_from_iter(g, iter); @@ -133,6 +166,11 @@ different data types in the underlying storage for efficiency concerns (e.g., sh - GRIN does NOT distinguish label on vertices and edges, that means a vertex and an edge may have a same label. - However the storage can tell GRIN whether labels are enabled in vertices or edges seperatedly with macros of `WITH_VERTEX_LABEL` and `WITH_EDGE_LABEL` respectively. +### Order +- GRIN provides sorted vertex list assumptions. +- GRIN also assumes that if a vertex list sorted, then there is complete ordering for the vertices from the list. +- Sorted vertex list faciliates computations like vertex list join and data structures like vertex array which uses vertex as the index of the array. + ### Reference - GRIN introduces the reference concept in partitioned graph. It stands for the reference of an instance that can be recognized in partitions other than the current partition where the instance is accessed. diff --git a/modules/graph/grin/include/predicate/order.h b/modules/graph/grin/include/index/order.h similarity index 68% rename from modules/graph/grin/include/predicate/order.h rename to modules/graph/grin/include/index/order.h index 61b6479d5..fa68efe51 100644 --- a/modules/graph/grin/include/predicate/order.h +++ b/modules/graph/grin/include/index/order.h @@ -15,20 +15,26 @@ limitations under the License. @brief Define the vertex ordering predicate APIs */ -#ifndef GRIN_INCLUDE_PREDICATE_ORDER_H_ -#define GRIN_INCLUDE_PREDICATE_ORDER_H_ +#ifndef GRIN_INCLUDE_INDEX_ORDER_H_ +#define GRIN_INCLUDE_INDEX_ORDER_H_ #include "../predefine.h" -#ifdef GRIN_PREDICATE_VERTEX_ORDERING +#ifndef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED /** - * @brief sort a vertex list + * @brief check whether a vertex list is sorted * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_LIST the vertex list to sort - * @return whether succeed + * @param GRIN_VERTEX_LIST the vertex list + * @return whether sorted */ -bool grin_sort_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); +bool grin_is_vertex_list_sorted(GRIN_GRAPH, GRIN_VERTEX_LIST); +#endif + +#ifdef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED +bool grin_smaller_vertex(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX); +#endif +#if defined(GRIN_ASSUME_ALL_VERTEX_LIST_SORTED) && defined(GRIN_ENABLE_VERTEX_LIST_ARRAY) /** * @brief get the position of a vertex in a sorted list * caller must guarantee the input vertex list is sorted to get the correct result @@ -41,4 +47,4 @@ bool grin_sort_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); bool grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH, GRIN_VERTEX_LIST, GRIN_VERTEX, size_t& pos); #endif -#endif // GRIN_INCLUDE_PREDICATE_ORDER_H_ \ No newline at end of file +#endif // GRIN_INCLUDE_INDEX_ORDER_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/predefine.h b/modules/graph/grin/include/predefine.h index 9cee465ae..9550fe0ca 100644 --- a/modules/graph/grin/include/predefine.h +++ b/modules/graph/grin/include/predefine.h @@ -16,9 +16,13 @@ limitations under the License. /** * @file predefine.h * @brief Pre-defined macros for storage features. - * Undefine the macros of features that the storage does NOT support, - * so that APIs under unsupported features will NOT be available to - * the callers to avoid ambiguity. + * The macros are divided into several sections such as topology, partition, + * and so on. + * In each section, the first part lists all available macros, and undefines + * all GRIN_ASSUME_ macros by default. + * After that is the MOST IMPORTANT part for storage implementors, i.e., the StorageSpecific area. + * Storage implementors should turn ON/OFF the macros in this area based the features of the storage. + * The final part is the rule part to handle dependencies between macros which should not be edited. */ #ifndef GRIN_INCLUDE_PREDEFINE_H_ @@ -28,7 +32,6 @@ limitations under the License. #include #include - /// Enumerates the directions of edges with respect to a certain vertex typedef enum { IN = 0, ///< incoming @@ -50,6 +53,8 @@ typedef enum { Date64 = 9, ///< long date } GRIN_DATATYPE; +/* Section 1: Toplogy */ + /** @name TopologyMacros * @brief Macros for basic graph topology features */ @@ -77,6 +82,12 @@ typedef enum { */ #define GRIN_ENABLE_VERTEX_LIST +/** @ingroup TopologyMacros + * @brief Enable the vertex list array-style retrieval. + * The vertex list related APIs follow the design principle of GRIN List. +*/ +#define GRIN_ENABLE_VERTEX_LIST_ARRAY + /** @ingroup TopologyMacros * @brief Enable the vertex list iterator. * The vertex list iterator related APIs follow the design principle of GRIN Iterator. @@ -89,6 +100,12 @@ typedef enum { */ #define GRIN_ENABLE_EDGE_LIST +/** @ingroup TopologyMacros + * @brief Enable the edge list array-style retrieval. + * The edge list related APIs follow the design principle of GRIN List. +*/ +#define GRIN_ENABLE_EDGE_LIST_ARRAY + /** @ingroup TopologyMacros * @brief Enable the edge list iterator. * The edge list iterator related APIs follow the design principle of GRIN Iterator. @@ -101,23 +118,56 @@ typedef enum { */ #define GRIN_ENABLE_ADJACENT_LIST +/** @ingroup TopologyMacros + * @brief Enable the adjacent list array-style retrieval. + * The adjacent list related APIs follow the design principle of GRIN List. +*/ +#define GRIN_ENABLE_ADJACENT_LIST_ARRAY + /** @ingroup TopologyMacros * @brief Enable the adjacent list iterator. * The adjacent list iterator related APIs follow the design principle of GRIN Iterator. */ #define GRIN_ENABLE_ADJACENT_LIST_ITERATOR +///@} -#ifndef GRIN_DOXYGEN_SKIP // disabled by storage +#ifndef GRIN_DOXYGEN_SKIP +/* StorageSpecific */ + +/* Disable the unsupported features */ #undef GRIN_WITH_VERTEX_DATA #undef GRIN_WITH_EDGE_DATA #undef GRIN_ENABLE_VERTEX_LIST_ITERATOR #undef GRIN_ENABLE_EDGE_LIST #undef GRIN_ENABLE_EDGE_LIST_ITERATOR #undef GRIN_ENABLE_ADJACENT_LIST_ITERATOR +/* End of Disable */ + +/* Enable the supported features */ +/* End of Enable */ + +/* End of StorageSpecific */ + +#ifndef GRIN_ENABLE_VERTEX_LIST +#undef GRIN_ENABLE_VERTEX_LIST_ARRAY +#undef GRIN_ENABLE_VERTEX_LIST_ITERATOR #endif -///@} +#ifndef GRIN_ENABLE_EDGE_LIST +#undef GRIN_ENABLE_EDGE_LIST_ARRAY +#undef GRIN_ENABLE_EDGE_LIST_ITERATOR +#endif + +#ifndef GRIN_ENABLE_ADJACENT_LIST +#undef GRIN_ENABLE_ADJACENT_LIST_ARRAY +#undef GRIN_ENABLE_ADJACENT_LIST_ITERATOR +#endif + +#endif // GRIN_DOXYGEN_SKIP +/* End of Section 1 */ + +/* Section 2. Partition */ /** @name PartitionMacros * @brief Macros for partitioned graph features @@ -304,7 +354,9 @@ typedef enum { #undef GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE #undef GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE -// diabled by storage +/* StorageSpecific */ + +/* Disable the unsupported features */ #undef GRIN_ASSUME_VERTEX_CUT_PARTITION #undef GRIN_ENABLE_EDGE_REF #undef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST @@ -312,8 +364,13 @@ typedef enum { #undef GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST #undef GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST #undef GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST -// enabled by storage +/* End of Disable */ + +/* Enable the supported features */ #define GRIN_ASSUME_EDGE_CUT_PARTITION +/* End of Enable */ + +/* End of StorageSpecific */ #ifdef GRIN_ASSUME_EDGE_CUT_PARTITION #define GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE @@ -386,7 +443,9 @@ typedef enum { #undef GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE #endif #endif // GRIN_DOXY_SKIP +/* End of Section 2 */ +/* Section 3. Property */ /** @name PropertyMacros * @brief Macros for basic property graph features @@ -647,14 +706,20 @@ typedef enum { #undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE #undef GRIN_ASSUME_COLUMN_STORE -// disabled by storage +/* StorageSpecific */ + +/* Disable the unsupported features */ #undef GRIN_ENABLE_VERTEX_PRIMARY_KEYS #undef GRIN_ENABLE_EDGE_PRIMARY_KEYS #undef GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST +/* End of Disable */ -// enabled by storage +/* Enable the supported features */ #define GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID #define GRIN_ASSUME_COLUMN_STORE +/* End of Enable */ + +/* End of StorageSpecific */ #ifdef GRIN_ASSUME_EDGE_CUT_PARTITION #define GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE @@ -801,37 +866,55 @@ typedef enum { #undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE #endif #endif // GRIN_DOXY_SKIP +/* End of Section 3 */ - -/** @name PredicateMacros - * @brief Macros for predicate features - */ -///@{ -/** @ingroup PredicateMacros - * @brief Enable vertex ordering predicate -*/ -#define GRIN_PREDICATE_VERTEX_ORDERING -///@} - -/** @name IndexMacros - * @brief Macros for index features +/* Section 4. Index */ +/** @name IndexLabelMacros + * @brief Macros for label features */ ///@{ -/** @ingroup IndexMacros +/** @ingroup IndexLabelMacros * @brief Enable vertex label on graph. */ #define GRIN_WITH_VERTEX_LABEL -/** @ingroup IndexMacros +/** @ingroup IndexLabelMacros * @brief Enable edge label on graph. */ #define GRIN_WITH_EDGE_LABEL +///@} -#ifndef GRIN_DOXYGEN_SKIP +/** @name IndexOrderMacros + * @brief Macros for ordering features. + * Please refer to the order section in the documents for details. + */ +///@{ +/** @ingroup IndexOrderMacros + * @brief assume all vertex list are sorted. + * We will expend the assumption to support master/mirror or + * by type in the future if needed. +*/ +#define GRIN_ASSUME_ALL_VERTEX_LIST_SORTED +///@} + +#ifndef GRIN_DOXYGEN_SKIP +// disable assumption by default +#undef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED + +/* StorageSpecific */ + +/* Disable the unsupported features */ #undef GRIN_WITH_VERTEX_LABEL #undef GRIN_WITH_EDGE_LABEL -#endif -///@} +/* End of Disable */ + +/* Enable the supported features */ +#define GRIN_ASSUME_ALL_VERTEX_LIST_SORTED +/* End of Enable */ + +/* End of StorageSpecific */ +#endif // GRIN_DOXYGEN_SKIP +/* End of Section 4 */ /** @name NullValues * Macros for Null(invalid) values diff --git a/modules/graph/grin/include/topology/adjacentlist.h b/modules/graph/grin/include/topology/adjacentlist.h index 136e3fed8..8a23776fb 100644 --- a/modules/graph/grin/include/topology/adjacentlist.h +++ b/modules/graph/grin/include/topology/adjacentlist.h @@ -22,7 +22,9 @@ limitations under the License. GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); void grin_destroy_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); +#endif +#ifdef GRIN_ENABLE_ADJACENT_LIST_ARRAY size_t grin_get_adjacent_list_size(GRIN_GRAPH, GRIN_ADJACENT_LIST); GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST, size_t); @@ -31,7 +33,7 @@ GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST, size_ #endif #ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR -GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); +GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH, GRIN_ADJACENT_LIST); void grin_destroy_adjacent_list_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); diff --git a/modules/graph/grin/include/topology/edgelist.h b/modules/graph/grin/include/topology/edgelist.h index 20ac65c7a..22f3c5323 100644 --- a/modules/graph/grin/include/topology/edgelist.h +++ b/modules/graph/grin/include/topology/edgelist.h @@ -22,14 +22,16 @@ limitations under the License. GRIN_EDGE_LIST grin_get_edge_list(GRIN_GRAPH, GRIN_DIRECTION); void grin_destroy_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); +#endif +#ifdef GRIN_ENABLE_EDGE_LIST_ARRAY size_t grin_get_edge_list_size(GRIN_GRAPH, GRIN_EDGE_LIST); GRIN_EDGE grin_get_edge_from_list(GRIN_GRAPH, GRIN_EDGE_LIST, size_t); #endif #ifdef GRIN_ENABLE_EDGE_LIST_ITERATOR -GRIN_EDGE_LIST_ITERATOR grin_get_edge_list_begin(GRIN_GRAPH); +GRIN_EDGE_LIST_ITERATOR grin_get_edge_list_begin(GRIN_GRAPH, GRIN_EDGE_LIST); void grin_destroy_edge_list_iter(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); diff --git a/modules/graph/grin/include/topology/structure.h b/modules/graph/grin/include/topology/structure.h index 24ff57a43..9f6c6e8cb 100644 --- a/modules/graph/grin/include/topology/structure.h +++ b/modules/graph/grin/include/topology/structure.h @@ -31,6 +31,8 @@ size_t grin_get_edge_num(GRIN_GRAPH, GRIN_DIRECTION); // Vertex void grin_destroy_vertex(GRIN_GRAPH, GRIN_VERTEX); +bool grin_equal_vertex(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX); + #ifdef GRIN_WITH_VERTEX_ORIGINAL_ID void grin_destroy_vertex_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); diff --git a/modules/graph/grin/include/topology/vertexlist.h b/modules/graph/grin/include/topology/vertexlist.h index 3ec857dd7..e16728ac9 100644 --- a/modules/graph/grin/include/topology/vertexlist.h +++ b/modules/graph/grin/include/topology/vertexlist.h @@ -22,14 +22,16 @@ limitations under the License. GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH); void grin_destroy_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); +#endif +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY size_t grin_get_vertex_list_size(GRIN_GRAPH, GRIN_VERTEX_LIST); GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH, GRIN_VERTEX_LIST, size_t); #endif #ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR -GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH); +GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH, GRIN_VERTEX_LIST); void grin_destroy_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); diff --git a/modules/graph/grin/src/predicate/order.cc b/modules/graph/grin/src/index/order.cc similarity index 73% rename from modules/graph/grin/src/predicate/order.cc rename to modules/graph/grin/src/index/order.cc index c0f7750ad..b4266995d 100644 --- a/modules/graph/grin/src/predicate/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -11,13 +11,18 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" -#include "graph/grin/include/predicate/order.h" +#include "graph/grin/include/index/order.h" -#ifdef GRIN_PREDICATE_VERTEX_ORDERING -bool grin_sort_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { - return true; -}; +#ifdef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED +bool grin_smaller_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { + auto _g = static_cast(g); + auto _v1 = static_cast(v1); + auto _v2 = static_cast(v2); + return _g->Vertex2Gid(*_v1) < _g->Vertex2Gid(*_v2); +} +#endif +#if defined(GRIN_ASSUME_ALL_VERTEX_LIST_SORTED) && defined(GRIN_ENABLE_VERTEX_LIST_ARRAY) bool grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v, size_t& pos) { auto _g = static_cast(g); auto _v = static_cast(v); diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 52c237041..4bb9b9a5e 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -52,6 +52,14 @@ void grin_destroy_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { delete _v; } +bool grin_equal_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { + auto _g = static_cast(g); + auto _v1 = static_cast(v1); + auto _v2 = static_cast(v2); + return _g->Vertex2Gid(*_v1) == _g->Vertex2Gid(*_v2); +} + + #ifdef GRIN_WITH_VERTEX_ORIGINAL_ID void grin_destroy_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX_ORIGINAL_ID oid) { auto _oid = static_cast(oid); From faabc0c6e1ad5f450b57037e3ab51e8276e6bd6e Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 15 Mar 2023 17:17:31 +0800 Subject: [PATCH 18/85] quick fix --- modules/graph/fragment/arrow_fragment.grin.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index 466ed9739..d2a844959 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -499,13 +499,15 @@ class GRIN_ArrowFragment { inline size_t GetInnerVerticesNum(GRIN_VERTEX_TYPE label) const { auto vl = grin_get_vertex_list(g_); auto vl1 = grin_filter_type_for_vertex_list(g_, label, vl); - return grin_get_vertex_list_size(g_, vl1); + auto vl2 = grin_filter_master_for_vertex_list(g_, vl1); + return grin_get_vertex_list_size(g_, vl2); } inline size_t GetOuterVerticesNum(GRIN_VERTEX_TYPE label) const { auto vl = grin_get_vertex_list(g_); auto vl1 = grin_filter_type_for_vertex_list(g_, label, vl); - return grin_get_vertex_list_size(g_, vl1); + auto vl2 = grin_filter_mirror_for_vertex_list(g_, vl1); + return grin_get_vertex_list_size(g_, vl2); } inline bool IsInnerVertex(GRIN_VERTEX v) const { From c0221844efdc5d8b167f9c97822b5970ffe973dc Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Thu, 16 Mar 2023 15:21:25 +0800 Subject: [PATCH 19/85] reorg --- modules/graph/grin/docs/Doxyfile | 2 +- modules/graph/grin/docs/README.md | 129 +++++++++++++++- modules/graph/grin/include/index/label.h | 101 ------------- modules/graph/grin/include/index/order.h | 50 ------ .../graph/grin/include/partition/partition.h | 56 ------- .../graph/grin/include/partition/reference.h | 90 ----------- .../graph/grin/include/partition/topology.h | 104 ------------- .../graph/grin/include/property/partition.h | 93 ------------ .../graph/grin/include/property/primarykey.h | 69 --------- .../graph/grin/include/property/property.h | 117 -------------- .../grin/include/property/propertylist.h | 84 ---------- .../grin/include/property/propertytable.h | 143 ------------------ .../graph/grin/include/property/topology.h | 52 ------- modules/graph/grin/include/property/type.h | 106 ------------- .../grin/include/topology/adjacentlist.h | 49 ------ .../graph/grin/include/topology/edgelist.h | 45 ------ .../graph/grin/include/topology/structure.h | 71 --------- .../graph/grin/include/topology/vertexlist.h | 45 ------ modules/graph/grin/{include => }/predefine.h | 21 +++ modules/graph/grin/src/topology/structure.cc | 5 +- 20 files changed, 151 insertions(+), 1281 deletions(-) delete mode 100644 modules/graph/grin/include/index/label.h delete mode 100644 modules/graph/grin/include/index/order.h delete mode 100644 modules/graph/grin/include/partition/partition.h delete mode 100644 modules/graph/grin/include/partition/reference.h delete mode 100644 modules/graph/grin/include/partition/topology.h delete mode 100644 modules/graph/grin/include/property/partition.h delete mode 100644 modules/graph/grin/include/property/primarykey.h delete mode 100644 modules/graph/grin/include/property/property.h delete mode 100644 modules/graph/grin/include/property/propertylist.h delete mode 100644 modules/graph/grin/include/property/propertytable.h delete mode 100644 modules/graph/grin/include/property/topology.h delete mode 100644 modules/graph/grin/include/property/type.h delete mode 100644 modules/graph/grin/include/topology/adjacentlist.h delete mode 100644 modules/graph/grin/include/topology/edgelist.h delete mode 100644 modules/graph/grin/include/topology/structure.h delete mode 100644 modules/graph/grin/include/topology/vertexlist.h rename modules/graph/grin/{include => }/predefine.h (98%) diff --git a/modules/graph/grin/docs/Doxyfile b/modules/graph/grin/docs/Doxyfile index cea363936..59cde0452 100644 --- a/modules/graph/grin/docs/Doxyfile +++ b/modules/graph/grin/docs/Doxyfile @@ -1267,7 +1267,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = rtfi.css # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index 7f91e4327..0abb224ce 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -1,11 +1,132 @@ - # GRIN +GRIN is a proposed standard graph retrieval interface in GraphScope. The goal of GRIN is to provide a common way for the graph computing engines to retrieve graph data stored in different storage engines in GraphScope, and to simplify the integration of these engines with each other. + +GRIN is defined in C, which makes it portable to systems written in different programming languages, such as C++, Rust and Java. It provides a set of common operations and data structure handlers that can be used to access graph data, regardless of the underlying storage engine. + +These operations include: +* Traversal: navigating the graph structure to explore relationships between vertices +* Retrieval: retrieving the data and properties of vertices and edges +* Filter: filtering data structures with partitioning or property conditions -GRIN is a series of C-style Graph Retrieval INterfaces for graph computing engines to access different storage systems in a uniform way. +GRIN is designed to be read-only, meaning that it does not provide operations for modifying the graph data. This decision was made to simplify the implementation of GRIN and ensure that it can be used safely with any storage engine. The latest version of headers can be found in [v6d/dev/grin](https://github.com/v6d-io/v6d/tree/dev/grin/modules/graph/grin/include). Note that the predefine.h has been modified for v6d. ----- + +## Motivations +The motivations behind GRIN are driven by the need for a common standard for accessing graph data for the computing engines of GraphScope. There are a number of factors that have contributed to this need: +1. Complexity of integrating multiple graph computing engines and storage engines: GraphScope consists of many different graph computing engines and storage engines, each with their own data model, query language, and API. This can make it difficult to integrate these engines with each other, as each engine requires a separate integration effort. +2. Need for interoperability and collaboration: To fully realize the potential of GraphScope, there is a need for greater interoperability and collaboration between the different components. A common standard for accessing graph data could help to accelerate the development of GraphScope and make it more accessible to a wider range of users. +3. Growing demand for big graph processing: With the increasing amount of data being generated, there is a growing demand for big graph processing systems that can efficiently analyze large-scale graph data. A common standard for accessing graph data could help to accelerate the development of new features for engines in GraphScope. + +By defining the interfaces of GRIN in C, GRIN can be easily integrated with a variety of programming languages, including Java, Python, and Rust, using foreign function interfaces (FFIs) that allow these languages to call C functions. In addition, it becomes a language-agnostic standard that can be used across different programming environments, without requiring each environment to have its own implementation of the standard. This can greatly simplify the development and maintenance of graph computing systems that rely on GRIN, as it allows developers to use their preferred programming languages and tools, while still being able to access and process graph data using a common standard. + + +## Unified Graph Retrieval + +As mentioned above, GRIN provides a set of common operations of graph traversal, data retrieval, and conditional filter for computing engines to access the graphs in different storage engines in a uniform way. +These operations are defined as C functions while their return values and parameters are generally handlers of graph concepts, such as vertices and edges. + +Next is an example showing how to handle a graph query using GRIN APIs. +The data types with prefix GRIN_ are handlers while the functions with prefix grin_ are +the APIs in GRIN. Moreover, the macros started with GRIN_ are provided by GRIN to reflect +the storage features. Each storage engine that implements GRIN APIs can set up these macros +based on their own features, such as graph partition strategies and list retrieval styles. +The storage provider of this example is [Vineyard](https://v6d.io). + +In particular, the example illustrates how to sync property values of vertices related to certain edge type. +The input parameters are the partitioned_graph, the local partition, +the edge_type_name (e.g., likes), the vertex_property_name (e.g., features). +The task is to find all the destination vertices of "boundary edges" with type named "likes", and the vertices +must have a property named "features". Here a boundary edge is an edge whose source vertex is a master vertex and +the destination is a mirror vertex, given the context of "edge-cut" partition strategy that the underlying storage uses. +Then for each of these vertices, we send the value of the "features" property to its master partition. + +```CPP + void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION partition, const char* edge_type_name, const char* vertex_property_name) { + GRIN_GRAPH g = grin_get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition + + GRIN_EDGE_TYPE etype = grin_get_edge_type_by_name(g, edge_type_name); // get edge type from name + GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_from_edge_type(g, etype); // get related source vertex type list + GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_from_edge_type(g, etype); // get related destination vertex type list + + size_t src_vtypes_num = grin_get_vertex_type_list_size(g, src_vtypes); + size_t dst_vtypes_num = grin_get_vertex_type_list_size(g, dst_vtypes); + assert(src_vtypes_num == dst_vtypes_num); // the src & dst vertex type lists must be aligned + + for (size_t i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type + GRIN_VERTEX_TYPE src_vtype = grin_get_vertex_type_from_list(g, src_vtypes, i); // get src type + GRIN_VERTEX_TYPE dst_vtype = grin_get_vertex_type_from_list(g, dst_vtypes, i); // get dst type + + GRIN_VERTEX_PROPERTY dst_vp = grin_get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type + if (dst_vp == GRIN_NULL_VERTEX_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" + + GRIN_VERTEX_PROPERTY_TABLE dst_vpt = grin_get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use + GRIN_DATATYPE dst_vp_dt = grin_get_vertex_property_data_type(g, dst_vp); // prepare property type for later use + + GRIN_VERTEX_LIST __src_vl = grin_get_vertex_list(g); // get the vertex list + GRIN_VERTEX_LIST _src_vl = grin_filter_type_for_vertex_list(g, src_vtype, __src_vl); // filter the vertex of source type + GRIN_VERTEX_LIST src_vl = grin_filter_master_for_vertex_list(g, _src_vl); // filter master vertices under source type + + size_t src_vl_num = grin_get_vertex_list_size(g, src_vl); + for (size_t j = 0; j < src_vl_num; ++j) { // iterate the src vertex + GRIN_VERTEX v = grin_get_vertex_from_list(g, src_vl, j); + + #ifdef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST + GRIN_ADJACENT_LIST _adj_list = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v + GRIN_ADJACENT_LIST adj_list = grin_filter_edge_type_for_adjacent_list(g, etype, _adj_list); // filter edges under etype + #else + GRIN_ADJACENT_LIST adj_lsit = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v + #endif + + size_t al_sz = grin_get_adjacent_list_size(g, adj_list); + for (size_t k = 0; k < al_sz; ++k) { + #ifndef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST + GRIN_EDGE edge = grin_get_edge_from_adjacent_list(g, adj_list, k); + GRIN_EDGE_TYPE edge_type = grin_get_edge_type(g, edge); + if (!grin_equal_edge_type(g, edge_type, etype)) continue; + #endif + GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list(g, adj_list, k); // get the dst vertex u + const void* value = grin_get_value_from_vertex_property_table(g, dst_vpt, u, dst_vp); // get the property value of "features" of u + + GRIN_VERTEX_REF uref = grin_get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions + GRIN_PARTITION u_master_partition = grin_get_master_partition_from_vertex_ref(g, uref); // get the master partition for u + + send_value(u_master_partition, uref, dst_vp_dt, value); // the value must be casted to the correct type based on dst_vp_dt before sending + } + } + } + } + + void run(vineyard::Client& client, const grape::CommSpec& comm_spec, + vineyard::ObjectID fragment_group_id) { + LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; + + auto pg = get_partitioned_graph_by_object_id(client, fragment_group_id); + auto local_partitions = get_local_partition_list(pg); + size_t pnum = get_partition_list_size(local_partitions); + assert(pnum > 0); + + // we only sync the first partition as example + auto partition = get_partition_from_list(local_partitions, 0); + sync_property(pg, partition, "likes", "features"); + } +``` + +## Design Principles + +### Assume System to describe storage features + +### Property Graph Model + +## Implementation Guideline +### for computing engine +### for storage engine + + + GRIN is a series of C-style Graph Retrieval INterfaces for graph computing engines to access different storage systems in a uniform way. + ## Implementation Guideline ### For computing engine - Implement a wrapper class (normally grin_fragment or grin_graph) using GRIN APIs. @@ -16,8 +137,8 @@ The latest version of headers can be found in [v6d/dev/grin](https://github.com/ ### For storage engine - Copy header (source) files from documents. - Modify the StorageSpecific part in the predefine.h based on the features of the storage. -- Implement the headers in another folder (e.g., src). If you find the time complexity of -some function is NOT sub-linear to the graph size, discuss with GRIN designers. +- Implement the headers as much as possible in another folder (e.g., src). If you find the time +complexity of some function is NOT sub-linear to the graph size, discuss with GRIN designers. - Write a storage-specific method to get a graph handler from your storage. - Run a graph traversal test. diff --git a/modules/graph/grin/include/index/label.h b/modules/graph/grin/include/index/label.h deleted file mode 100644 index bbb3fa796..000000000 --- a/modules/graph/grin/include/index/label.h +++ /dev/null @@ -1,101 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file label.h - @brief Define the label related APIs -*/ - -#ifndef GRIN_INCLUDE_INDEX_LABEL_H_ -#define GRIN_INCLUDE_INDEX_LABEL_H_ - -#include "../predefine.h" - -#if defined(GRIN_WITH_VERTEX_LABEL) || defined(GRIN_WITH_EDGE_LABEL) -GRIN_LABEL grin_get_label_by_name(GRIN_GRAPH, const char*); - -const char* grin_get_label_name(GRIN_GRAPH, GRIN_LABEL); - -void grin_destroy_label(GRIN_GRAPH, GRIN_LABEL); - -void grin_destroy_label_list(GRIN_GRAPH, GRIN_LABEL_LIST); - -size_t grin_get_label_list_size(GRIN_GRAPH, GRIN_LABEL_LIST); - -GRIN_LABEL grin_get_label_from_list(GRIN_GRAPH, GRIN_LABEL_LIST, size_t); -#endif - -#ifdef GRIN_WITH_VERTEX_LABEL -/** - * @brief assign a label to a vertex - * @param GRIN_GRAPH the graph - * @param GRIN_LABEL the label - * @param GRIN_VERTEX the vertex - * @return whether succeed -*/ -bool grin_assign_label_to_vertex(GRIN_GRAPH, GRIN_LABEL, GRIN_VERTEX); - -/** - * @brief get the label list of a vertex - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX the vertex -*/ -GRIN_LABEL_LIST grin_get_vertex_label_list(GRIN_GRAPH, GRIN_VERTEX); - -/** - * @brief get the vertex list by label - * @param GRIN_GRAPH the graph - * @param GRIN_LABEL the label -*/ -GRIN_VERTEX_LIST grin_get_vertex_list_by_label(GRIN_GRAPH, GRIN_LABEL); - -/** - * @brief filtering an existing vertex list by label - * @param GRIN_VERTEX_LIST the existing vertex list - * @param GRIN_LABEL the label -*/ -GRIN_VERTEX_LIST grin_filter_vertex_list_by_label(GRIN_GRAPH, GRIN_VERTEX_LIST, GRIN_LABEL); -#endif - -#ifdef GRIN_WITH_EDGE_LABEL -/** - * @brief assign a label to a edge - * @param GRIN_GRAPH the graph - * @param GRIN_LABEL the label - * @param GRIN_EDGE the edge - * @return whether succeed -*/ -bool grin_assign_label_to_edge(GRIN_GRAPH, GRIN_LABEL, GRIN_EDGE); - -/** - * @brief get the label list of a edge - * @param GRIN_GRAPH the graph - * @param GRIN_EDGE the edge -*/ -GRIN_LABEL_LIST grin_get_edge_label_list(GRIN_GRAPH, GRIN_EDGE); - -/** - * @brief get the edge list by label - * @param GRIN_GRAPH the graph - * @param GRIN_LABEL the label -*/ -GRIN_EDGE_LIST grin_get_edge_list_by_label(GRIN_GRAPH, GRIN_LABEL); - -/** - * @brief filtering an existing edge list by label - * @param GRIN_EDGE_LIST the existing edge list - * @param GRIN_LABEL the label -*/ -GRIN_EDGE_LIST grin_filter_edge_list_by_label(GRIN_GRAPH, GRIN_EDGE_LIST, GRIN_LABEL); -#endif - -#endif // GRIN_INCLUDE_INDEX_LABEL_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/index/order.h b/modules/graph/grin/include/index/order.h deleted file mode 100644 index fa68efe51..000000000 --- a/modules/graph/grin/include/index/order.h +++ /dev/null @@ -1,50 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file order.h - @brief Define the vertex ordering predicate APIs -*/ - -#ifndef GRIN_INCLUDE_INDEX_ORDER_H_ -#define GRIN_INCLUDE_INDEX_ORDER_H_ - -#include "../predefine.h" - -#ifndef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED -/** - * @brief check whether a vertex list is sorted - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_LIST the vertex list - * @return whether sorted -*/ -bool grin_is_vertex_list_sorted(GRIN_GRAPH, GRIN_VERTEX_LIST); -#endif - -#ifdef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED -bool grin_smaller_vertex(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX); -#endif - -#if defined(GRIN_ASSUME_ALL_VERTEX_LIST_SORTED) && defined(GRIN_ENABLE_VERTEX_LIST_ARRAY) -/** - * @brief get the position of a vertex in a sorted list - * caller must guarantee the input vertex list is sorted to get the correct result - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_LIST the sorted vertex list - * @param VERTEX the vertex to find - * @param pos the returned position of the vertex - * @return false if the vertex is not found -*/ -bool grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH, GRIN_VERTEX_LIST, GRIN_VERTEX, size_t& pos); -#endif - -#endif // GRIN_INCLUDE_INDEX_ORDER_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/partition/partition.h b/modules/graph/grin/include/partition/partition.h deleted file mode 100644 index 8a588d78e..000000000 --- a/modules/graph/grin/include/partition/partition.h +++ /dev/null @@ -1,56 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file partition.h - @brief Define the partition related APIs -*/ - -#ifndef GRIN_INCLUDE_PARTITION_PARTITION_H_ -#define GRIN_INCLUDE_PARTITION_PARTITION_H_ - -#include "../predefine.h" - -#ifdef GRIN_ENABLE_GRAPH_PARTITION -size_t grin_get_total_partitions_number(GRIN_PARTITIONED_GRAPH); - -GRIN_PARTITION_LIST grin_get_local_partition_list(GRIN_PARTITIONED_GRAPH); - -void grin_destroy_partition_list(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_LIST); - -GRIN_PARTITION_LIST grin_create_partition_list(GRIN_PARTITIONED_GRAPH); - -bool grin_insert_partition_to_list(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_LIST, GRIN_PARTITION); - -size_t grin_get_partition_list_size(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_LIST); - -GRIN_PARTITION grin_get_partition_from_list(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_LIST, size_t); - -bool grin_equal_partition(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION, GRIN_PARTITION); - -void grin_destroy_partition(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); - -void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); - -GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); -#endif - -#ifdef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION -GRIN_PARTITION grin_get_partition_from_id(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION_ID); - -GRIN_PARTITION_ID grin_get_partition_id(GRIN_PARTITIONED_GRAPH, GRIN_PARTITION); -#endif - -#endif // GRIN_INCLUDE_PARTITION_PARTITION_H_ diff --git a/modules/graph/grin/include/partition/reference.h b/modules/graph/grin/include/partition/reference.h deleted file mode 100644 index 6483564e1..000000000 --- a/modules/graph/grin/include/partition/reference.h +++ /dev/null @@ -1,90 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file reference.h - @brief Define the reference related APIs -*/ - -#ifndef GRIN_INCLUDE_PARTITION_REFERENCE_H_ -#define GRIN_INCLUDE_PARTITION_REFERENCE_H_ - -#include "../predefine.h" - -// Vertex ref refers to the same vertex referred in other partitions, -// while edge ref is likewise. Both can be serialized to const char* for -// message transporting and deserialized on the other end. -#ifdef GRIN_ENABLE_VERTEX_REF -GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH, GRIN_VERTEX); - -/** - * @brief get the local vertex from the vertex ref - * if the vertex ref is not regconized, a null vertex is returned - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_REF the vertex ref - */ -GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); - -/** - * @brief get the master partition of a vertex ref. - * Some storage can still provide the master partition of the vertex ref, - * even if the vertex ref can NOT be recognized locally. - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_REF the vertex ref - */ -GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); - -const char* grin_serialize_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); - -GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH, const char*); - -bool grin_is_master_vertex(GRIN_GRAPH, GRIN_VERTEX); - -bool grin_is_mirror_vertex(GRIN_GRAPH, GRIN_VERTEX); -#endif - -#ifdef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST -GRIN_PARTITION_LIST grin_get_master_vertex_mirror_partition_list(GRIN_GRAPH, GRIN_VERTEX); -#endif - -#ifdef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST -GRIN_PARTITION_LIST grin_get_mirror_vertex_mirror_partition_list(GRIN_GRAPH, GRIN_VERTEX); -#endif - -#ifdef GRIN_ENABLE_EDGE_REF -GRIN_EDGE_REF grin_get_edge_ref_for_edge(GRIN_GRAPH, GRIN_EDGE); - -GRIN_EDGE grin_get_edge_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); - -GRIN_PARTITION grin_get_master_partition_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); - -const char* grin_serialize_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); - -GRIN_EDGE_REF grin_deserialize_to_edge_ref(GRIN_GRAPH, const char*); - -bool grin_is_master_edge(GRIN_GRAPH, GRIN_EDGE); - -bool grin_is_mirror_edge(GRIN_GRAPH, GRIN_EDGE); -#endif - -#ifdef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST -GRIN_PARTITION_LIST grin_get_master_edge_mirror_partition_list(GRIN_GRAPH, GRIN_EDGE); -#endif - -#ifdef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST -GRIN_PARTITION_LIST grin_get_mirror_edge_mirror_partition_list(GRIN_GRAPH, GRIN_EDGE); -#endif - -#endif // GRIN_INCLUDE_PARTITION_REFERENCE_H_ diff --git a/modules/graph/grin/include/partition/topology.h b/modules/graph/grin/include/partition/topology.h deleted file mode 100644 index 7e0dd9bd3..000000000 --- a/modules/graph/grin/include/partition/topology.h +++ /dev/null @@ -1,104 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file partition/topology.h - @brief Define the topoloy related APIs under partitioned graph -*/ - -#ifndef GRIN_INCLUDE_PARTITION_TOPOLOGY_H_ -#define GRIN_INCLUDE_PARTITION_TOPOLOGY_H_ - -#include "../predefine.h" - -#if defined(GRIN_WITH_VERTEX_DATA) && \ - !defined(GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE) -bool grin_is_vertex_data_local_complete(GRIN_GRAPH, GRIN_VERTEX); - -GRIN_PARTITION_LIST grin_vertex_data_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); -#endif - -#if defined(GRIN_WITH_EDGE_DATA) && \ - !defined(GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE) -bool grin_is_edge_data_local_complete(GRIN_GRAPH, GRIN_EDGE); - -GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); -#endif - - -#ifdef GRIN_TRAIT_FILTER_MASTER_FOR_VERTEX_LIST -GRIN_VERTEX_LIST grin_filter_master_for_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); - -GRIN_VERTEX_LIST grin_filter_mirror_for_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); -#endif - - -#ifdef GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST -GRIN_VERTEX_LIST grin_filter_partition_for_vertex_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_VERTEX_LIST); -#endif - - - -#ifdef GRIN_TRAIT_FILTER_MASTER_FOR_EDGE_LIST -GRIN_EDGE_LIST grin_filter_master_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); - -GRIN_EDGE_LIST grin_filter_mirror_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); -#endif - - -#ifdef GRIN_TRAIT_FILTER_PARTITION_FOR_EDGE_LIST -GRIN_EDGE_LIST grin_filter_partition_for_edge_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_EDGE_LIST); -#endif - - -#if defined(GRIN_ENABLE_ADJACENT_LIST) && \ - !defined(GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE) -// The concept of local_complete refers to whether we can get complete data or properties -// locally in the partition. It is orthogonal to the concept of master/mirror which -// is mainly designed for data aggregation. In some extremely cases, master vertices -// may NOT contain all the data or properties locally. -bool grin_is_vertex_neighbor_local_complete(GRIN_GRAPH, GRIN_VERTEX); - -/** - * @brief get the partitions whose combination can provide the complete - * neighbors of a vertex. - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX the vertex - */ -GRIN_PARTITION_LIST grin_vertex_neighbor_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); -#endif - - -#ifdef GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST -GRIN_ADJACENT_LIST grin_filter_master_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); - -GRIN_ADJACENT_LIST grin_filter_mirror_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); -#endif - -#ifdef GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST -GRIN_ADJACENT_LIST grin_filter_neighbor_partition_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); -#endif - - -#endif // GRIN_INCLUDE_PARTITION_TOPOLOGY_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/partition.h b/modules/graph/grin/include/property/partition.h deleted file mode 100644 index 9bcc56dc0..000000000 --- a/modules/graph/grin/include/property/partition.h +++ /dev/null @@ -1,93 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file property/partition.h - @brief Define the partition related APIs under property graph -*/ - -#ifndef GRIN_INCLUDE_PROPERTY_PARTITION_H_ -#define GRIN_INCLUDE_PROPERTY_PARTITION_H_ - -#include "../predefine.h" - - -#if defined(GRIN_WITH_VERTEX_PROPERTY) && \ - !defined(GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE) -bool grin_is_vertex_property_local_complete(GRIN_GRAPH, GRIN_VERTEX); - -GRIN_PARTITION_LIST grin_vertex_property_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -GRIN_VERTEX_TYPE_LIST grin_get_master_vertex_property_local_complete_types(GRIN_GRAPH); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE -GRIN_VERTEX_TYPE_LIST grin_get_all_vertex_property_local_complete_types(GRIN_GRAPH); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE -GRIN_VERTEX_TYPE_LIST grin_get_master_vertex_data_local_complete_types(GRIN_GRAPH); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE -GRIN_VERTEX_TYPE_LIST grin_get_all_vertex_data_local_complete_types(GRIN_GRAPH); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE -GRIN_VERTEX_TYPE_LIST grin_get_master_vertex_neighbor_local_complete_types(GRIN_GRAPH); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE -GRIN_VERTEX_TYPE_LIST grin_get_all_vertex_neighbor_local_complete_types(GRIN_GRAPH); -#endif - -#if defined(GRIN_WITH_EDGE_PROPERTY) && \ - !defined(GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE) -bool grin_is_edge_property_local_complete(GRIN_GRAPH, GRIN_EDGE); - -GRIN_PARTITION_LIST grin_edge_property_complete_partitions(GRIN_GRAPH, GRIN_EDGE); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -GRIN_EDGE_TYPE_LIST grin_get_master_edge_property_local_complete_types(GRIN_GRAPH); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE -GRIN_EDGE_TYPE_LIST grin_get_all_edge_property_local_complete_types(GRIN_GRAPH); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE -GRIN_EDGE_TYPE_LIST grin_get_master_edge_data_local_complete_types(GRIN_GRAPH); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE -GRIN_EDGE_TYPE_LIST grin_get_all_edge_data_local_complete_types(GRIN_GRAPH); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_NEIGHBOR_LOCAL_COMPLETE -GRIN_EDGE_TYPE_LIST grin_get_master_edge_neighbor_local_complete_types(GRIN_GRAPH); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_ALL_EDGE_NEIGHBOR_LOCAL_COMPLETE -GRIN_EDGE_TYPE_LIST grin_get_all_edge_neighbor_local_complete_types(GRIN_GRAPH); -#endif - - -#endif // GRIN_INCLUDE_PROPERTY_PARTITION_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/primarykey.h b/modules/graph/grin/include/property/primarykey.h deleted file mode 100644 index 13927167e..000000000 --- a/modules/graph/grin/include/property/primarykey.h +++ /dev/null @@ -1,69 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file primarykey.h - @brief Define the primary key related APIs -*/ - -#ifndef GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ -#define GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ - -#include "../predefine.h" - -#ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS -/** - * @brief get the vertex types with primary keys - * @param GRIN_GRAPH the graph -*/ -GRIN_VERTEX_TYPE_LIST grin_get_vertex_types_with_primary_keys(GRIN_GRAPH); - -/** - * @brief get the primary keys (property list) of a specific vertex type - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_TYPE the vertex type -*/ -GRIN_VERTEX_PROPERTY_LIST grin_get_primary_keys_by_vertex_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); - -/** - * @brief get the vertex with the given primary keys - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_PROPERTY_LIST the primary keys - * @param GRIN_ROW the values of primary keys -*/ -GRIN_VERTEX grin_get_vertex_by_primay_keys(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST, GRIN_ROW); -#endif - -#ifdef GRIN_WITH_EDGE_PRIMARY_KEYS -/** - * @brief get the edge types with primary keys - * @param GRIN_GRAPH the graph -*/ -GRIN_EDGE_TYPE_LIST grin_get_edge_types_with_primary_keys(GRIN_GRAPH); - -/** - * @brief get the primary keys (property list) of a specific edge type - * @param GRIN_GRAPH the graph - * @param GRIN_EDGE_TYPE the edge type -*/ -GRIN_EDGE_PROPERTY_LIST grin_get_primary_keys_by_edge_type(GRIN_GRAPH, GRIN_EDGE_TYPE); - -/** - * @brief get the edge with the given primary keys - * @param GRIN_GRAPH the graph - * @param GRIN_EDGE_PROPERTY_LIST the primary keys - * @param GRIN_ROW the values of primary keys -*/ -GRIN_EDGE grin_get_edge_by_primay_keys(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST, GRIN_ROW); -#endif - -#endif // GRIN_INCLUDE_PROPERTY_PRIMARY_KEY_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/property.h b/modules/graph/grin/include/property/property.h deleted file mode 100644 index ce4a8ca47..000000000 --- a/modules/graph/grin/include/property/property.h +++ /dev/null @@ -1,117 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file property.h - @brief Define the property related APIs -*/ - -#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_H_ -#define GRIN_INCLUDE_PROPERTY_PROPERTY_H_ - -#include "../predefine.h" - -#ifdef GRIN_WITH_VERTEX_PROPERTY_NAME -/** - * @brief get the vertex property name - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_PROPERTY the vertex property - */ -const char* grin_get_vertex_property_name(GRIN_GRAPH, GRIN_VERTEX_PROPERTY); - -/** - * @brief get the vertex property with a given name under a specific vertex type - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_TYPE the specific vertex type - * @param name the name - */ -GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH, GRIN_VERTEX_TYPE, const char* name); - -/** - * @brief get all the vertex properties with a given name - * @param GRIN_GRAPH the graph - * @param name the name - */ -GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH, const char* name); -#endif - -#ifdef GRIN_WITH_EDGE_PROPERTY_NAME -/** - * @brief get the edge property name - * @param GRIN_GRAPH the graph - * @param GRIN_EDGE_PROPERTY the edge property - */ -const char* grin_get_edge_property_name(GRIN_GRAPH, GRIN_EDGE_PROPERTY); - -/** - * @brief get the edge property with a given name under a specific edge type - * @param GRIN_GRAPH the graph - * @param GRIN_EDGE_TYPE the specific edge type - * @param name the name - */ -GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH, GRIN_EDGE_TYPE, const char* name); - -/** - * @brief get all the edge properties with a given name - * @param GRIN_GRAPH the graph - * @param name the name - */ -GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH, const char* name); -#endif - - -#ifdef GRIN_WITH_VERTEX_PROPERTY -bool grin_equal_vertex_property(GRIN_GRAPH, GRIN_VERTEX_PROPERTY, GRIN_VERTEX_PROPERTY); - -/** - * @brief destroy vertex property - * @param GRIN_VERTEX_PROPERTY vertex property - */ -void grin_destroy_vertex_property(GRIN_GRAPH, GRIN_VERTEX_PROPERTY); - -/** - * @brief get property data type - * @param GRIN_VERTEX_PROPERTY vertex property - */ -GRIN_DATATYPE grin_get_vertex_property_data_type(GRIN_GRAPH, GRIN_VERTEX_PROPERTY); - -/** - * @brief get the vertex type that the property is bound to - * @param GRIN_VERTEX_PROPERTY vertex property - */ -GRIN_VERTEX_TYPE grin_get_vertex_property_vertex_type(GRIN_GRAPH, GRIN_VERTEX_PROPERTY); -#endif - - -#ifdef GRIN_WITH_EDGE_PROPERTY -bool grin_equal_edge_property(GRIN_GRAPH, GRIN_EDGE_PROPERTY, GRIN_EDGE_PROPERTY); - -/** - * @brief destroy edge property - * @param GRIN_EDGE_PROPERTY edge property - */ -void grin_destroy_edge_property(GRIN_GRAPH, GRIN_EDGE_PROPERTY); - -/** - * @brief get property data type - * @param GRIN_EDGE_PROPERTY edge property - */ -GRIN_DATATYPE grin_get_edge_property_data_type(GRIN_GRAPH, GRIN_EDGE_PROPERTY); - -/** - * @brief get the edge type that the property is bound to - * @param GRIN_EDGE_PROPERTY edge property - */ -GRIN_EDGE_TYPE grin_get_edge_property_edge_type(GRIN_GRAPH, GRIN_EDGE_PROPERTY); -#endif - -#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/propertylist.h b/modules/graph/grin/include/property/propertylist.h deleted file mode 100644 index 2161f57c4..000000000 --- a/modules/graph/grin/include/property/propertylist.h +++ /dev/null @@ -1,84 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file propertylist.h - @brief Define the property list related and graph projection APIs -*/ - -#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ -#define GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ - -#include "../predefine.h" - -#ifdef GRIN_WITH_VERTEX_PROPERTY -GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_property_list_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); - -size_t grin_get_vertex_property_list_size(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST); - -GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_list(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST, size_t); - -GRIN_VERTEX_PROPERTY_LIST grin_create_vertex_property_list(GRIN_GRAPH); - -void grin_destroy_vertex_property_list(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST); - -bool grin_insert_vertex_property_to_list(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST, GRIN_VERTEX_PROPERTY); -#endif - -#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY -GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_PROPERTY_ID); - -GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_PROPERTY); -#endif - - -#ifdef GRIN_WITH_EDGE_PROPERTY -GRIN_EDGE_PROPERTY_LIST grin_get_edge_property_list_by_type(GRIN_GRAPH, GRIN_EDGE_TYPE); - -size_t grin_get_edge_property_list_size(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST); - -GRIN_EDGE_PROPERTY grin_get_edge_property_from_list(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST, size_t); - -GRIN_EDGE_PROPERTY_LIST grin_create_edge_property_list(GRIN_GRAPH); - -void grin_destroy_edge_property_list(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST); - -bool grin_insert_edge_property_to_list(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST, GRIN_EDGE_PROPERTY); -#endif - -#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY -GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_PROPERTY_ID); - -GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_PROPERTY); -#endif - - -/** @name Graph Projection - * GRIN_GRAPH projection mainly works to shrink the properties into a subset - * in need to improve the retrieval efficiency. Note that only the vertex/edge - * type with at least one property left in the vertex/edge property list will - * be kept after the projection. - * - * The projection only works on column store systems. - */ -///@{ -#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) -/** @brief project vertex properties */ -GRIN_GRAPH grin_select_vertex_properties(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_LIST); -#endif - -#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) -/** @brief project edge properties */ -GRIN_GRAPH grin_select_edge_properteis(GRIN_GRAPH, GRIN_EDGE_PROPERTY_LIST); -#endif - -#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_LIST_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/propertytable.h b/modules/graph/grin/include/property/propertytable.h deleted file mode 100644 index f85790fae..000000000 --- a/modules/graph/grin/include/property/propertytable.h +++ /dev/null @@ -1,143 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file propertytable.h - @brief Define the property table related APIs -*/ - -#ifndef GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ -#define GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ - -#include "../predefine.h" - -/** @name GRIN_ROW - * GRIN_ROW works as the pure value array for the properties of a vertex or an edge. - * In general, you can think of GRIN_ROW as an array of void*, where each void* points to - * the value of a property. GRIN assumes the user already knows the corresponding - * property list beforehead, so that she/he knows how to cast the void* into the - * property's data type. - */ -///@{ -#ifdef GRIN_ENABLE_ROW -void grin_destroy_row(GRIN_GRAPH, GRIN_ROW); - -/** @brief the value of a property from row by its position in row */ -const void* grin_get_value_from_row(GRIN_GRAPH, GRIN_ROW, size_t); - -/** @brief create a row, usually to get vertex/edge by primary keys */ -GRIN_ROW grin_create_row(GRIN_GRAPH); - -/** @brief insert a value to the end of the row */ -bool grin_insert_value_to_row(GRIN_GRAPH, GRIN_ROW, void*); -#endif -///@} - -#ifdef GRIN_ENABLE_VERTEX_PROPERTY_TABLE -/** - * @brief destroy vertex property table - * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table - */ -void grin_destroy_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE); - -/** - * @brief get the vertex property table of a certain vertex type - * No matter column or row store strategy is used in the storage, - * GRIN recommends to first get the property table of the vertex type, - * and then fetch values(rows) by vertex and property(list). However, - * GRIN does provide direct row fetching API when GRIN_ASSUME_COLUMN_STORE - * is NOT set. - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX_TYPE the vertex type - */ -GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); - -/** - * @brief get vertex property value from table - * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table - * @param GRIN_VERTEX the vertex which is the row index - * @param GRIN_VERTEX_PROPERTY the vertex property which is the column index - * @return can be casted to the property data type by the caller - */ -const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY); -#endif - -#if defined(GRIN_ENABLE_VERTEX_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) -/** - * @brief get vertex row from table - * @param GRIN_VERTEX_PROPERTY_TABLE vertex property table - * @param GRIN_VERTEX the vertex which is the row index - * @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns - */ -GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); -#endif - -#if !defined(GRIN_ASSUME_COLUMN_STORE) && defined(GRIN_ENABLE_ROW) -/** - * @brief get vertex row directly from the graph, this API only works for row store system - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX the vertex which is the row index - * @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns - */ -GRIN_ROW grin_get_vertex_row(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); -#endif - -#ifdef GRIN_ENABLE_EDGE_PROPERTY_TABLE -/** - * @brief destroy edge property table - * @param GRIN_EDGE_PROPERTY_TABLE edge property table - */ -void grin_destroy_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE); - -/** - * @brief get the edge property table of a certain edge type - * No matter column or row store strategy is used in the storage, - * GRIN recommends to first get the property table of the edge type, - * and then fetch values(rows) by edge and property(list). However, - * GRIN does provide direct row fetching API when GRIN_ASSUME_COLUMN_STORE - * is NOT set. - * @param GRIN_GRAPH the graph - * @param GRIN_EDGE_TYPE the edge type - */ -GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH, GRIN_EDGE_TYPE); - -/** - * @brief get edge property value from table - * @param GRIN_EDGE_PROPERTY_TABLE edge property table - * @param GRIN_EDGE the edge which is the row index - * @param GRIN_EDGE_PROPERTY the edge property which is the column index - * @return can be casted to the property data type by the caller - */ -const void* grin_get_value_from_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY); -#endif - -#if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) -/** - * @brief get edge row from table - * @param GRIN_EDGE_PROPERTY_TABLE edge property table - * @param GRIN_EDGE the edge which is the row index - * @param GRIN_EDGE_PROPERTY_LIST the edge property list as columns - */ -GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY_LIST); -#endif - -#if !defined(GRIN_ASSUME_COLUMN_STORE) && defined(GRIN_ENABLE_ROW) -/** - * @brief get edge row directly from the graph, this API only works for row store system - * @param GRIN_GRAPH the graph - * @param GRIN_EDGE the edge which is the row index - * @param GRIN_EDGE_PROPERTY_LIST the edge property list as columns - */ -GRIN_ROW grin_get_edge_row(GRIN_GRAPH, GRIN_EDGE, GRIN_EDGE_PROPERTY_LIST); -#endif - -#endif // GRIN_INCLUDE_PROPERTY_PROPERTY_TABLE_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/topology.h b/modules/graph/grin/include/property/topology.h deleted file mode 100644 index 7f8bd54a4..000000000 --- a/modules/graph/grin/include/property/topology.h +++ /dev/null @@ -1,52 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file property/topology.h - @brief Define the topology related APIs under property graph -*/ - -#ifndef GRIN_INCLUDE_PROPERTY_TOPOLOGY_H_ -#define GRIN_INCLUDE_PROPERTY_TOPOLOGY_H_ - -#include "../predefine.h" - -#ifdef GRIN_WITH_VERTEX_PROPERTY -size_t grin_get_vertex_num_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE); -#endif - -#ifdef GRIN_WITH_EDGE_PROPERTY -size_t grin_get_edge_num_by_type(GRIN_GRAPH, GRIN_DIRECTION, GRIN_EDGE_TYPE); -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID -GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_ORIGINAL_ID); -#endif - -#ifdef GRIN_TRAIT_FILTER_TYPE_FOR_VERTEX_LIST -GRIN_VERTEX_LIST grin_filter_type_for_vertex_list(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_LIST); -#endif - -#ifdef GRIN_TRAIT_FILTER_TYPE_FOR_EDGE_LIST -GRIN_EDGE_LIST grin_filter_type_for_edge_list(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_LIST); -#endif - -#ifdef GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST -GRIN_ADJACENT_LIST grin_filter_neighbor_type_for_adjacent_list(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_ADJACENT_LIST); -#endif - -#ifdef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST -GRIN_ADJACENT_LIST grin_filter_edge_type_for_adjacent_list(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_ADJACENT_LIST); -#endif - - -#endif // GRIN_INCLUDE_PROPERTY_TOPOLOGY_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/property/type.h b/modules/graph/grin/include/property/type.h deleted file mode 100644 index 16e80d1d7..000000000 --- a/modules/graph/grin/include/property/type.h +++ /dev/null @@ -1,106 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/** - @file type.h - @brief Define the vertex/edge type related APIs -*/ - -#ifndef GRIN_INCLUDE_PROPERTY_TYPE_H_ -#define GRIN_INCLUDE_PROPERTY_TYPE_H_ - -#include "../predefine.h" - -#ifdef GRIN_WITH_VERTEX_PROPERTY -// Vertex type -bool grin_equal_vertex_type(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_TYPE); - -GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH, GRIN_VERTEX); - -// Vertex type list -GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH); - -void grin_destroy_vertex_type_list(GRIN_GRAPH, GRIN_VERTEX_TYPE_LIST); - -GRIN_VERTEX_TYPE_LIST grin_create_vertex_type_list(GRIN_GRAPH); - -bool grin_insert_vertex_type_to_list(GRIN_GRAPH, GRIN_VERTEX_TYPE_LIST, GRIN_VERTEX_TYPE); - -size_t grin_get_vertex_type_list_size(GRIN_GRAPH, GRIN_VERTEX_TYPE_LIST); - -GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_GRAPH, GRIN_VERTEX_TYPE_LIST, size_t); -#endif - -#ifdef GRIN_WITH_VERTEX_TYPE_NAME -const char* grin_get_vertex_type_name(GRIN_GRAPH, GRIN_VERTEX_TYPE); - -GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH, const char*); -#endif - -#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE -GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_GRAPH, GRIN_VERTEX_TYPE); - -GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_GRAPH, GRIN_VERTEX_TYPE_ID); -#endif - - -#ifdef GRIN_WITH_EDGE_PROPERTY -// Edge type -bool grin_equal_edge_type(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_TYPE); - -GRIN_EDGE_TYPE grin_get_edge_type(GRIN_GRAPH, GRIN_EDGE); - -// Edge type list -GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH); - -void grin_destroy_edge_type_list(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST); - -GRIN_EDGE_TYPE_LIST grin_create_edge_type_list(GRIN_GRAPH); - -bool grin_insert_edge_type_to_list(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST, GRIN_EDGE_TYPE); - -size_t grin_get_edge_type_list_size(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST); - -GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_GRAPH, GRIN_EDGE_TYPE_LIST, size_t); -#endif - -#ifdef GRIN_WITH_EDGE_TYPE_NAME -const char* grin_get_edge_type_name(GRIN_GRAPH, GRIN_EDGE_TYPE); - -GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH, const char*); -#endif - -#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE -GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_GRAPH, GRIN_EDGE_TYPE); - -GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_GRAPH, GRIN_EDGE_TYPE_ID); -#endif - -/** @name VertexEdgeTypeRelation - * GRIN assumes the relation between edge type and pairs of vertex types is many-to-many. - * Thus GRIN returns the pairs of vertex types related to an edge type as a pair of vertex type - * lists of the same size, and the src/dst vertex types are aligned with their positions in the lists. - */ -///@{ -#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_WITH_EDGE_PROPERTY) -/** @brief the src vertex type list */ -GRIN_VERTEX_TYPE_LIST grin_get_src_types_from_edge_type(GRIN_GRAPH, GRIN_EDGE_TYPE); - -/** @brief get the dst vertex type list */ -GRIN_VERTEX_TYPE_LIST grin_get_dst_types_from_edge_type(GRIN_GRAPH, GRIN_EDGE_TYPE); - -/** @brief get the edge type list related to a given pair of vertex types */ -GRIN_EDGE_TYPE_LIST grin_get_edge_types_from_vertex_type_pair(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_VERTEX_TYPE); -#endif -///@} - -#endif // GRIN_INCLUDE_PROPERTY_TYPE_H_ \ No newline at end of file diff --git a/modules/graph/grin/include/topology/adjacentlist.h b/modules/graph/grin/include/topology/adjacentlist.h deleted file mode 100644 index 8a23776fb..000000000 --- a/modules/graph/grin/include/topology/adjacentlist.h +++ /dev/null @@ -1,49 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#ifndef GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ -#define GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ - -#include "../predefine.h" - -#ifdef GRIN_ENABLE_ADJACENT_LIST -GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); - -void grin_destroy_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); -#endif - -#ifdef GRIN_ENABLE_ADJACENT_LIST_ARRAY -size_t grin_get_adjacent_list_size(GRIN_GRAPH, GRIN_ADJACENT_LIST); - -GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST, size_t); - -GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST, size_t); -#endif - -#ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR -GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH, GRIN_ADJACENT_LIST); - -void grin_destroy_adjacent_list_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); - -GRIN_ADJACENT_LIST_ITERATOR grin_get_next_adjacent_list_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); - -bool grin_is_adjacent_list_end(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); - -GRIN_VERTEX grin_get_neighbor_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); - -GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); -#endif - -#endif // GRIN_INCLUDE_TOPOLOGY_ADJACENTLIST_H_ diff --git a/modules/graph/grin/include/topology/edgelist.h b/modules/graph/grin/include/topology/edgelist.h deleted file mode 100644 index 22f3c5323..000000000 --- a/modules/graph/grin/include/topology/edgelist.h +++ /dev/null @@ -1,45 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#ifndef GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ -#define GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ - -#include "../predefine.h" - -#ifdef GRIN_ENABLE_EDGE_LIST -GRIN_EDGE_LIST grin_get_edge_list(GRIN_GRAPH, GRIN_DIRECTION); - -void grin_destroy_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); -#endif - -#ifdef GRIN_ENABLE_EDGE_LIST_ARRAY -size_t grin_get_edge_list_size(GRIN_GRAPH, GRIN_EDGE_LIST); - -GRIN_EDGE grin_get_edge_from_list(GRIN_GRAPH, GRIN_EDGE_LIST, size_t); -#endif - -#ifdef GRIN_ENABLE_EDGE_LIST_ITERATOR -GRIN_EDGE_LIST_ITERATOR grin_get_edge_list_begin(GRIN_GRAPH, GRIN_EDGE_LIST); - -void grin_destroy_edge_list_iter(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); - -GRIN_EDGE_LIST_ITERATOR grin_get_next_edge_list_iter(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); - -bool grin_is_edge_list_end(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); - -GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH, GRIN_EDGE_LIST_ITERATOR); -#endif - -#endif // GRIN_INCLUDE_TOPOLOGY_EDGELIST_H_ diff --git a/modules/graph/grin/include/topology/structure.h b/modules/graph/grin/include/topology/structure.h deleted file mode 100644 index 9f6c6e8cb..000000000 --- a/modules/graph/grin/include/topology/structure.h +++ /dev/null @@ -1,71 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#ifndef GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ -#define GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ - -#include "../predefine.h" - -// Graph -bool grin_is_directed(GRIN_GRAPH); - -bool grin_is_multigraph(GRIN_GRAPH); - -size_t grin_get_vertex_num(GRIN_GRAPH); - -size_t grin_get_edge_num(GRIN_GRAPH, GRIN_DIRECTION); - - -// Vertex -void grin_destroy_vertex(GRIN_GRAPH, GRIN_VERTEX); - -bool grin_equal_vertex(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX); - -#ifdef GRIN_WITH_VERTEX_ORIGINAL_ID -void grin_destroy_vertex_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); - -GRIN_DATATYPE grin_get_vertex_original_id_type(GRIN_GRAPH); - -GRIN_VERTEX_ORIGINAL_ID grin_get_vertex_original_id(GRIN_GRAPH, GRIN_VERTEX); -#endif - -#if defined(GRIN_WITH_VERTEX_ORIGINAL_ID) && !defined(GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID) -GRIN_VERTEX grin_get_vertex_from_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); -#endif - -#ifdef GRIN_WITH_VERTEX_DATA -GRIN_DATATYPE grin_get_vertex_data_type(GRIN_GRAPH, GRIN_VERTEX); - -GRIN_VERTEX_DATA grin_get_vertex_data_value(GRIN_GRAPH, GRIN_VERTEX); - -void grin_destroy_vertex_data(GRIN_GRAPH, GRIN_VERTEX_DATA); -#endif - -// Edge -void grin_destroy_edge(GRIN_GRAPH, GRIN_EDGE); - -GRIN_VERTEX grin_get_edge_src(GRIN_GRAPH, GRIN_EDGE); - -GRIN_VERTEX grin_get_edge_dst(GRIN_GRAPH, GRIN_EDGE); - -#ifdef GRIN_WITH_EDGE_DATA -GRIN_DATATYPE grin_get_edge_data_type(GRIN_GRAPH, GRIN_EDGE); - -GRIN_EDGE_DATA grin_get_edge_data_value(GRIN_GRAPH, GRIN_EDGE); - -void grin_destroy_edge_data(GRIN_GRAPH, GRIN_EDGE_DATA); -#endif - -#endif // GRIN_INCLUDE_TOPOLOGY_STRUCTURE_H_ diff --git a/modules/graph/grin/include/topology/vertexlist.h b/modules/graph/grin/include/topology/vertexlist.h deleted file mode 100644 index e16728ac9..000000000 --- a/modules/graph/grin/include/topology/vertexlist.h +++ /dev/null @@ -1,45 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#ifndef GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ -#define GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ - -#include "../predefine.h" - -#ifdef GRIN_ENABLE_VERTEX_LIST -GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH); - -void grin_destroy_vertex_list(GRIN_GRAPH, GRIN_VERTEX_LIST); -#endif - -#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY -size_t grin_get_vertex_list_size(GRIN_GRAPH, GRIN_VERTEX_LIST); - -GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH, GRIN_VERTEX_LIST, size_t); -#endif - -#ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR -GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH, GRIN_VERTEX_LIST); - -void grin_destroy_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); - -GRIN_VERTEX_LIST_ITERATOR grin_get_next_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); - -bool grin_is_vertex_list_end(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); - -GRIN_VERTEX grin_get_vertex_from_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); -#endif - -#endif // GRIN_INCLUDE_TOPOLOGY_VERTEXLIST_H_ diff --git a/modules/graph/grin/include/predefine.h b/modules/graph/grin/predefine.h similarity index 98% rename from modules/graph/grin/include/predefine.h rename to modules/graph/grin/predefine.h index 9550fe0ca..8fa545db7 100644 --- a/modules/graph/grin/include/predefine.h +++ b/modules/graph/grin/predefine.h @@ -59,6 +59,22 @@ typedef enum { * @brief Macros for basic graph topology features */ ///@{ +/** @ingroup TopologyMacros + * @brief The storage only support directed graphs. + */ +#define GRIN_ASSUME_GRAPH_DIRECTED + +/** @ingroup TopologyMacros + * @brief The storage only support undirected graphs. + */ +#define GRIN_ASSUME_GRAPH_UNDIRECTED + +/** @ingroup TopologyMacros + * @brief The storage only support graphs with single + * edge between a pair of vertices. + */ +#define GRIN_ASSUME_GRAPH_SINGLE_EDGE + /** @ingroup TopologyMacros * @brief There is original ID for a vertex. * This facilitates queries starting from a specific vertex, @@ -136,6 +152,9 @@ typedef enum { /* StorageSpecific */ /* Disable the unsupported features */ +#undef GRIN_ASSUME_GRAPH_DIRECTED +#undef GRIN_ASSUME_GRAPH_UNDIRECTED +#undef GRIN_ASSUME_GRAPH_SINGLE_EDGE #undef GRIN_WITH_VERTEX_DATA #undef GRIN_WITH_EDGE_DATA #undef GRIN_ENABLE_VERTEX_LIST_ITERATOR @@ -950,6 +969,8 @@ typedef enum { #define GRIN_NULL_ROW NULL /** @brief Null natural id of any kind (invalid return value) */ #define GRIN_NULL_NATURAL_ID UINT_MAX +/** @brief Null size (invalid return value) */ +#define GRIN_NULL_SIZE UINT_MAX ///@} diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 4bb9b9a5e..f18966894 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -16,15 +16,19 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/topology/structure.h" +#if !defined(GRIN_ASSUME_GRAPH_DIRECTED) && !defined(GRIN_ASSUME_GRAPH_UNDIRECTED) bool grin_is_directed(GRIN_GRAPH g) { auto _g = static_cast(g); return _g->directed(); } +#endif +#ifndef GRIN_ASSUME_GRAPH_SINGLE_EDGE bool grin_is_multigraph(GRIN_GRAPH g) { auto _g = static_cast(g); return _g->is_multigraph(); } +#endif size_t grin_get_vertex_num(GRIN_GRAPH g) { auto _g = static_cast(g); @@ -45,7 +49,6 @@ size_t grin_get_edge_num(GRIN_GRAPH g, GRIN_DIRECTION d) { return _g->GetEdgeNum(); } - // Vertex void grin_destroy_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { auto _v = static_cast(v); From aa267a2a5245cef4a48d8dd0b10e136a458be188 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Thu, 16 Mar 2023 15:25:07 +0800 Subject: [PATCH 20/85] use grin headers as submodule --- .gitmodules | 3 +++ modules/graph/grin/include | 1 + 2 files changed, 4 insertions(+) create mode 160000 modules/graph/grin/include diff --git a/.gitmodules b/.gitmodules index 63ca4a1e9..a233207bc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -54,3 +54,6 @@ path = modules/graph/thirdparty/libgrape-lite url = https://github.com/alibaba/libgrape-lite.git shallow = true +[submodule "modules/graph/grin/include"] + path = modules/graph/grin/include + url = https://github.com/GraphScope/GRIN.git diff --git a/modules/graph/grin/include b/modules/graph/grin/include new file mode 160000 index 000000000..05dac194c --- /dev/null +++ b/modules/graph/grin/include @@ -0,0 +1 @@ +Subproject commit 05dac194c3aa2949b22975e7424adb37eaab8669 From 0c6d17adb5ac82d85792beb5927b850ddf2af18a Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 17 Mar 2023 11:01:12 +0800 Subject: [PATCH 21/85] update docs --- modules/graph/grin/docs/README.md | 226 +++++++++-------------------- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 32 ++-- modules/graph/grin/src/predefine.h | 2 +- 4 files changed, 83 insertions(+), 179 deletions(-) diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index 0abb224ce..f1b4043e6 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -1,47 +1,33 @@ # GRIN -GRIN is a proposed standard graph retrieval interface in GraphScope. The goal of GRIN is to provide a common way for the graph computing engines to retrieve graph data stored in different storage engines in GraphScope, and to simplify the integration of these engines with each other. +GRIN is a proposed standard graph retrieval interface in GraphScope. Its goal is to provide a common way for graph computing engines to retrieve graph data stored in different storage engines within GraphScope, and to simplify the integration of these engines with each other. -GRIN is defined in C, which makes it portable to systems written in different programming languages, such as C++, Rust and Java. It provides a set of common operations and data structure handlers that can be used to access graph data, regardless of the underlying storage engine. - -These operations include: +GRIN is defined in C, making it portable to systems written in different programming languages, such as C++, Rust, and Java. It provides a set of common operations and data structure handlers that can be used to access graph data, regardless of the underlying storage engine. * Traversal: navigating the graph structure to explore relationships between vertices * Retrieval: retrieving the data and properties of vertices and edges -* Filter: filtering data structures with partitioning or property conditions - -GRIN is designed to be read-only, meaning that it does not provide operations for modifying the graph data. This decision was made to simplify the implementation of GRIN and ensure that it can be used safely with any storage engine. +* Filter: filtering data structures based on partitioning or property conditions -The latest version of headers can be found in [v6d/dev/grin](https://github.com/v6d-io/v6d/tree/dev/grin/modules/graph/grin/include). Note that the predefine.h has been modified for v6d. +The latest version of headers can be found in [GRIN](https://github.com/GraphScope/GRIN). +A Vineyard implementation for both computing and storage can be found in [Vineyard](https://github.com/v6d-io/v6d/tree/dev/grin/modules/graph/grin/include). ----- ## Motivations -The motivations behind GRIN are driven by the need for a common standard for accessing graph data for the computing engines of GraphScope. There are a number of factors that have contributed to this need: -1. Complexity of integrating multiple graph computing engines and storage engines: GraphScope consists of many different graph computing engines and storage engines, each with their own data model, query language, and API. This can make it difficult to integrate these engines with each other, as each engine requires a separate integration effort. -2. Need for interoperability and collaboration: To fully realize the potential of GraphScope, there is a need for greater interoperability and collaboration between the different components. A common standard for accessing graph data could help to accelerate the development of GraphScope and make it more accessible to a wider range of users. -3. Growing demand for big graph processing: With the increasing amount of data being generated, there is a growing demand for big graph processing systems that can efficiently analyze large-scale graph data. A common standard for accessing graph data could help to accelerate the development of new features for engines in GraphScope. +The motivations behind GRIN are driven by the need for a common standard for accessing graph data for the computing engines of GraphScope. There are several factors that have contributed to this need: +1. Complexity of integrating multiple graph computing engines and storage engines: GraphScope consists of numerous graph computing engines and storage engines, each with its own data model, query language, and API. This can make it challenging to integrate these engines with one another, as each engine requires a separate integration effort. +2. Need for interoperability and collaboration: To fully realize GraphScope's potential, greater interoperability and collaboration between different components are necessary. A common standard for accessing graph data could help accelerate GraphScope's development and make it more accessible to a broader range of users. +3. Growing demand for large-scale graph processing: As the volume of data being generated increases, there is a growing demand for graph processing systems that can efficiently analyze large-scale graph data. A common standard for accessing graph data could help accelerate the development of new features for engines in GraphScope. -By defining the interfaces of GRIN in C, GRIN can be easily integrated with a variety of programming languages, including Java, Python, and Rust, using foreign function interfaces (FFIs) that allow these languages to call C functions. In addition, it becomes a language-agnostic standard that can be used across different programming environments, without requiring each environment to have its own implementation of the standard. This can greatly simplify the development and maintenance of graph computing systems that rely on GRIN, as it allows developers to use their preferred programming languages and tools, while still being able to access and process graph data using a common standard. +By defining the GRIN interfaces in C, it can be easily integrated with various programming languages, including Java, Python, and Rust, using foreign function interfaces (FFIs) that enable these languages to call C functions. Moreover, GRIN becomes a language-agnostic standard that can be utilized across different programming environments without requiring each environment to have its own implementation of the standard. This greatly simplifies the development and maintenance of graph computing systems relying on GRIN, as it allows developers to use their preferred programming languages and tools while still being able to access and process graph data using a common standard. +------- ## Unified Graph Retrieval -As mentioned above, GRIN provides a set of common operations of graph traversal, data retrieval, and conditional filter for computing engines to access the graphs in different storage engines in a uniform way. -These operations are defined as C functions while their return values and parameters are generally handlers of graph concepts, such as vertices and edges. +As previously mentioned, GRIN offers computing engines a consistent method for accessing graphs stored in various storage engines through a set of common operations for graph traversal, data retrieval, and conditional filtering. These operations are defined as C functions, and their return values and parameters are typically handlers for graph concepts, such as vertices and edges. -Next is an example showing how to handle a graph query using GRIN APIs. -The data types with prefix GRIN_ are handlers while the functions with prefix grin_ are -the APIs in GRIN. Moreover, the macros started with GRIN_ are provided by GRIN to reflect -the storage features. Each storage engine that implements GRIN APIs can set up these macros -based on their own features, such as graph partition strategies and list retrieval styles. -The storage provider of this example is [Vineyard](https://v6d.io). +Here is an example showing how to handle a graph query using GRIN APIs. The data types with the prefix GRIN_ are handlers, while the functions with the prefix grin_ are the APIs in GRIN. Moreover, macros that start with GRIN_ are provided by GRIN to reflect storage features. Each storage engine that implements GRIN APIs can set up these macros based on their own features, such as graph partition strategies and list retrieval styles. The storage provider for this example is Vineyard. -In particular, the example illustrates how to sync property values of vertices related to certain edge type. -The input parameters are the partitioned_graph, the local partition, -the edge_type_name (e.g., likes), the vertex_property_name (e.g., features). -The task is to find all the destination vertices of "boundary edges" with type named "likes", and the vertices -must have a property named "features". Here a boundary edge is an edge whose source vertex is a master vertex and -the destination is a mirror vertex, given the context of "edge-cut" partition strategy that the underlying storage uses. -Then for each of these vertices, we send the value of the "features" property to its master partition. +The example demonstrates how to synchronize property values of vertices associated with a specific edge type. The input parameters are partitioned_graph, the local partition, edge_type_name (e.g., likes), and vertex_property_name (e.g., features). The task is to find all the destination vertices of "boundary edges" with a type named "likes", and the vertices must have a property named "features". Here, a boundary edge is an edge whose source vertex is a master vertex, and the destination is a mirror vertex, given the context of the "edge-cut" partition strategy that the underlying storage uses. For each of these vertices, we send the value of the "features" property to its master partition. ```CPP void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION partition, const char* edge_type_name, const char* vertex_property_name) { @@ -114,46 +100,36 @@ Then for each of these vertices, we send the value of the "features" property to } ``` -## Design Principles - -### Assume System to describe storage features - -### Property Graph Model +-------- -## Implementation Guideline -### for computing engine -### for storage engine +## GRIN Concepts +This section explains the key concepts in GRIN to help users understand GRIN APIs more easily. - GRIN is a series of C-style Graph Retrieval INterfaces for graph computing engines to access different storage systems in a uniform way. +### Predefined Macros -## Implementation Guideline -### For computing engine -- Implement a wrapper class (normally grin_fragment or grin_graph) using GRIN APIs. -- When you find some function is hard or inefficient to implement, discuss with GRIN designers. -- Write or modify apps using the wrapper class (e.g., grin_fragment). -- Find a storage implementation to setup an end-to-end test. +GRIN provides a set of predefined C macros for storage engines to describe their features. When a storage engine implements the GRIN APIs, it should first set up the macros to present its features such as partition strategies and enabled indices. -### For storage engine -- Copy header (source) files from documents. -- Modify the StorageSpecific part in the predefine.h based on the features of the storage. -- Implement the headers as much as possible in another folder (e.g., src). If you find the time -complexity of some function is NOT sub-linear to the graph size, discuss with GRIN designers. -- Write a storage-specific method to get a graph handler from your storage. -- Run a graph traversal test. +The benefit is two-fold: +1. On the computing engine side, developers can implement their methods using alternative logic and GRIN APIs when some features are claimed or disclaimed by different storage engines. This makes the code switch based on storage feature claims happens in the compiling stage rather than in runtime. Thus, it extends the versatility of methods implemented by GRINs without sacrificing efficiency. -## Assumptions +2. On the storage engine side, the predefined macros can filter out a large number of unnecessary APIs to avoid developers implementing them with boilerplate or inefficient code, since the design of storage engines may differ enormously from each other. -### Property Graph Model +What follows is an example of predefined macros regarding the locally completeness of vertex properties. -- Vertices have types, as do edges. -- The relationship between edge types and pairs of vertex types is many-to-many. -- Properties are bound to vertex and edge types, but some properties may have the same name. -- Labels can be assigned to vertices and edges (NOT their types) primarily for query filtering, and labels have no properties. +- Four macros are provided: + 1. GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE + 2. GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE + 3. GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE + 4. GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +- Some assumptions may dominate others, which means that some assumptions apply in a wider range than others. Therefore, storage providers should be careful when setting these assumptions. Here, 1 dominates the others, which means that 2 to 4 are undefined when 1 is defined. Additionally, 2 dominates 4, and 3 dominates 4. +- GRIN provides different APIs under different assumptions. Suppose only 3 is defined; it means that vertices of certain types have all the properties locally complete, regardless of whether the vertex is master or mirror. In this case, GRIN provides an API to return these locally complete vertex types. +- In the case that none of these four macros is defined, GRIN will provide a per-vertex API to tell whether the vertex property is locally complete. -### Partition Strategies +### Partition Strategy +GRIN provides two types (i.e., edge-cut and vertex-cut) of predefined partition strategies. Each strategy can be seen as a set of granular predefined macros based on the common understanding of the partition strategy. For storages using hybrid partition strategy, developers can set up the granular macros one after another. #### Edge-cut Partition Strategy @@ -171,24 +147,43 @@ complexity of some function is NOT sub-linear to the graph size, discuss with GR - Vertex properties are locally complete for all vertices. - Edge properties are locally complete for all edges. -### Assumption Macros +### Property Graph Model +GRIN makes the following assumptions for its property graph model. +- Vertices have types, as do edges. +- The relationship between edge types and pairs of vertex types is many-to-many. +- Properties are bound to vertex and edge types, but some properties may have the same name. +- Labels can be assigned to vertices and edges (NOT their types) primarily for query filtering, and labels have no properties. -- GRIN provides granularity assumption macros to describe storage assumptions. -- Some assumptions may dominate others, which means that some assumptions apply in a wider range than others. Therefore, storage providers should be careful when setting these assumptions. -- Taking the assumptions on vertex property local completeness as an example, GRIN provides four macros: - 1. GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE - 2. GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE - 3. GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE - 4. GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -- Here, 1 dominates the others, which means that 2 to 4 are undefined when 1 is defined. Additionally, 2 dominates 4, and 3 dominates 4. -- GRIN provides different APIs under different assumptions. -- Suppose only 3 is defined; it means that vertices of certain types have all the properties locally complete, regardless of whether the vertex is master or mirror. In this case, GRIN provides an API to return these locally complete vertex types. -- In the case that none of these four macros is defined, GRIN will provide a per-vertex API to tell whether the vertex property is locally complete. +------- + +## Implementation Guideline + +### For computing engine +- Get GRIN APIs from [GRIN](https://github.com/GraphScope/GRIN) +- Implement a wrapper class (normally grin_fragment or grin_graph) using GRIN APIs. +- When you find some function is hard or inefficient to implement, discuss with GRIN designers. +- Write or modify apps using the wrapper class (e.g., grin_fragment). +- Find a storage implementation to set up an end-to-end test. + +### For storage engine +- Make a grin folder in your system, and navigate into the grin folder. +- Add GRIN as a submodule and copy the predefine.template out as the predefine.h +```console + $ git submodule add https://github.com/GraphScope/GRIN.git include + + $ cp include/predefine.template predefine.h +``` +- Modify the StorageSpecific part in the predefine.h based on the features of the storage. +- Implement the headers as much as possible in another folder (e.g., src) under grin. +If you find the time complexity of some function is NOT sub-linear to the graph size, +discuss with GRIN designers. +- Write a storage-specific method to get a graph handler from your storage. +- Run a graph traversal test. ----- -## Design Principles +## Design Details ### Handler - GRIN provides a series of handlers for graph concepts, such as vertex, edge and graph itself. - Since almost everything in GRIN are handlers except of only a few string names, the type for a graph concept and its handler is always mixed-used in GRIN. @@ -343,99 +338,8 @@ aggregation purpose to share a common centural node for every one. may NOT contain all the data or properties locally. - GRIN currently provides vertex-level/edge-level local complete judgement APIs, while the introduction of type-level judgement APIs is open for discussion. ------ - -## Traits ### Natural ID Trait - Concepts represent the schema of the graph, such as vertex type and properties bound to a certain edge type, are usually numbered naturally from `0` to its `num - 1` in many storage engines. To facilitate further optimizations in the upper computing engines, GRIN provides the natural number ID trait. A storage can provide such a trait if it also uses the natural numbering for graph schema concepts. ------ - -## Examples -### Example A -A mixed example with structure, partition and property - -```CPP - void sync_property(void* partitioned_graph, void* partition, const char* edge_type_name, const char* vertex_property_name) { - /* - This example illustrates how to sync property values of vertices related to certain edge type. - - The input parameters are the partitioned_graph, the local partition, - the edge_type_name (e.g., likes), the vertex_property_name (e.g., features) - - The task is to find all the destination vertices of "boundary edges" with type named "likes", and the vertices - must have a property named "features". Here a boundary edge is an edge whose source vertex is a master vertex and - the destination is a mirror vertex, given the context of "edge-cut" partition strategy that the underlying storage uses. - Then for each of these vertices, we send the value of the "features" property to its master partition. - */ - GRIN_GRAPH g = grin_get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition - - GRIN_EDGE_TYPE etype = grin_get_edge_type_by_name(g, edge_type_name); // get edge type from name - GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_from_edge_type(g, etype); // get related source vertex type list - GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_from_edge_type(g, etype); // get related destination vertex type list - - size_t src_vtypes_num = grin_get_vertex_type_list_size(g, src_vtypes); - size_t dst_vtypes_num = grin_get_vertex_type_list_size(g, dst_vtypes); - assert(src_vtypes_num == dst_vtypes_num); // the src & dst vertex type lists must be aligned - - for (size_t i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type - GRIN_VERTEX_TYPE src_vtype = grin_get_vertex_type_from_list(g, src_vtypes, i); // get src type - GRIN_VERTEX_TYPE dst_vtype = grin_get_vertex_type_from_list(g, dst_vtypes, i); // get dst type - - GRIN_VERTEX_PROPERTY dst_vp = grin_get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type - if (dst_vp == GRIN_NULL_VERTEX_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" - - GRIN_VERTEX_PROPERTY_TABLE dst_vpt = grin_get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use - GRIN_DATATYPE dst_vp_dt = grin_get_vertex_property_data_type(g, dst_vp); // prepare property type for later use - - GRIN_VERTEX_LIST __src_vl = grin_get_vertex_list(g); // get the vertex list - GRIN_VERTEX_LIST _src_vl = grin_filter_type_for_vertex_list(g, src_vtype, __src_vl); // filter the vertex of source type - GRIN_VERTEX_LIST src_vl = grin_filter_master_for_vertex_list(g, _src_vl); // filter master vertices under source type - - size_t src_vl_num = grin_get_vertex_list_size(g, src_vl); - for (size_t j = 0; j < src_vl_num; ++j) { // iterate the src vertex - GRIN_VERTEX v = grin_get_vertex_from_list(g, src_vl, j); - - #ifdef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST - GRIN_ADJACENT_LIST _adj_list = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v - GRIN_ADJACENT_LIST adj_list = grin_filter_edge_type_for_adjacent_list(g, etype, _adj_list); // filter edges under etype - #else - GRIN_ADJACENT_LIST adj_lsit = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v - #endif - - size_t al_sz = grin_get_adjacent_list_size(g, adj_list); - for (size_t k = 0; k < al_sz; ++k) { - #ifndef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST - GRIN_EDGE edge = grin_get_edge_from_adjacent_list(g, adj_list, k); - GRIN_EDGE_TYPE edge_type = grin_get_edge_type(g, edge); - if (!grin_equal_edge_type(g, edge_type, etype)) continue; - #endif - GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list(g, adj_list, k); // get the dst vertex u - const void* value = grin_get_value_from_vertex_property_table(g, dst_vpt, u, dst_vp); // get the property value of "features" of u - - GRIN_VERTEX_REF uref = grin_get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions - GRIN_PARTITION u_master_partition = grin_get_master_partition_from_vertex_ref(g, uref); // get the master partition for u - - send_value(u_master_partition, uref, dst_vp_dt, value); // the value must be casted to the correct type based on dst_vp_dt before sending - } - } - } - } - - void run(vineyard::Client& client, const grape::CommSpec& comm_spec, - vineyard::ObjectID fragment_group_id) { - LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; - - auto pg = get_partitioned_graph_by_object_id(client, fragment_group_id); - auto local_partitions = get_local_partition_list(pg); - size_t pnum = get_partition_list_size(local_partitions); - assert(pnum > 0); - - // we only sync the first partition as example - auto partition = get_partition_from_list(local_partitions, 0); - sync_property(pg, partition, "likes", "features"); - } -``` - diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 05dac194c..67c4cf0bf 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 05dac194c3aa2949b22975e7424adb37eaab8669 +Subproject commit 67c4cf0bf2b14812259de34a16703f1b7b6aa931 diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 8fa545db7..342c2b5d3 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -94,55 +94,55 @@ typedef enum { /** @ingroup TopologyMacros * @brief Enable the vertex list structure. - * The vertex list related APIs follow the design principle of GRIN List. + * The vertex list related APIs follow the design of GRIN List. */ #define GRIN_ENABLE_VERTEX_LIST /** @ingroup TopologyMacros * @brief Enable the vertex list array-style retrieval. - * The vertex list related APIs follow the design principle of GRIN List. + * The vertex list related APIs follow the design of GRIN List. */ #define GRIN_ENABLE_VERTEX_LIST_ARRAY /** @ingroup TopologyMacros * @brief Enable the vertex list iterator. - * The vertex list iterator related APIs follow the design principle of GRIN Iterator. + * The vertex list iterator related APIs follow the design of GRIN Iterator. */ #define GRIN_ENABLE_VERTEX_LIST_ITERATOR /** @ingroup TopologyMacros * @brief Enable the edge list structure. - * The edge list related APIs follow the design principle of GRIN List. + * The edge list related APIs follow the design of GRIN List. */ #define GRIN_ENABLE_EDGE_LIST /** @ingroup TopologyMacros * @brief Enable the edge list array-style retrieval. - * The edge list related APIs follow the design principle of GRIN List. + * The edge list related APIs follow the design of GRIN List. */ #define GRIN_ENABLE_EDGE_LIST_ARRAY /** @ingroup TopologyMacros * @brief Enable the edge list iterator. - * The edge list iterator related APIs follow the design principle of GRIN Iterator. + * The edge list iterator related APIs follow the design of GRIN Iterator. */ #define GRIN_ENABLE_EDGE_LIST_ITERATOR /** @ingroup TopologyMacros * @brief Enable the adjacent list structure. - * The adjacent list related APIs follow the design principle of GRIN List. + * The adjacent list related APIs follow the design of GRIN List. */ #define GRIN_ENABLE_ADJACENT_LIST /** @ingroup TopologyMacros * @brief Enable the adjacent list array-style retrieval. - * The adjacent list related APIs follow the design principle of GRIN List. + * The adjacent list related APIs follow the design of GRIN List. */ #define GRIN_ENABLE_ADJACENT_LIST_ARRAY /** @ingroup TopologyMacros * @brief Enable the adjacent list iterator. - * The adjacent list iterator related APIs follow the design principle of GRIN Iterator. + * The adjacent list iterator related APIs follow the design of GRIN Iterator. */ #define GRIN_ENABLE_ADJACENT_LIST_ITERATOR ///@} @@ -202,7 +202,7 @@ typedef enum { /** @ingroup PartitionMacros * @brief The storage provides natural number IDs for partitions. - * It follows the design principle of natural number ID trait in GRIN. + * It follows the design of natural number ID trait in GRIN. */ #define GRIN_TRAIT_NATURAL_ID_FOR_PARTITION @@ -485,7 +485,7 @@ typedef enum { * @brief There are property names for vertex properties. The relationship between property * name and properties is one-to-many, because properties bound to different vertex/edge * types are distinguished even they may share the same property name. Please refer to - * the design principle of Property for details. + * the design of Property for details. */ #define GRIN_WITH_VERTEX_PROPERTY_NAME @@ -496,7 +496,7 @@ typedef enum { /** @ingroup PropertyMacros * @brief The storage provides natural number IDs for vertex types. - * It follows the design principle of natural ID trait in GRIN. + * It follows the design of natural ID trait in GRIN. */ #define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE @@ -522,7 +522,7 @@ typedef enum { /** @ingroup PropertyMacros * @brief The storage provides natural number IDs for properties bound to * a certain vertex type. - * It follows the design principle of natural ID trait in GRIN. + * It follows the design of natural ID trait in GRIN. */ #define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY @@ -543,7 +543,7 @@ typedef enum { * @brief There are property names for edge properties. The relationship between property * name and properties is one-to-many, because properties bound to different vertex/edge * types are distinguished even they may share the same property name. Please refer to - * the design principle of Property for details. + * the design of Property for details. */ #define GRIN_WITH_EDGE_PROPERTY_NAME @@ -554,7 +554,7 @@ typedef enum { /** @ingroup PropertyMacros * @brief The storage provides natural number IDs for edge types. - * It follows the design principle of natural ID trait in GRIN. + * It follows the design of natural ID trait in GRIN. */ #define GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE @@ -580,7 +580,7 @@ typedef enum { /** @ingroup PropertyMacros * @brief The storage provides natural number IDs for properties bound to * a certain edge type. - * It follows the design principle of natural ID trait in GRIN. + * It follows the design of natural ID trait in GRIN. */ #define GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY ///@} diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 879f4ed94..ff9221ecc 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -16,7 +16,7 @@ limitations under the License. #ifndef GRIN_SRC_PREDEFINE_H_ #define GRIN_SRC_PREDEFINE_H_ -#include "graph/grin/include/predefine.h" +#include "graph/grin/predefine.h" #include "graph/fragment/arrow_fragment.h" #include "graph/fragment/arrow_fragment_group.h" #include "graph/fragment/arrow_fragment_impl.h" From 5de8334295b93790e5f35103e6397f66fd40c2a1 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 17 Mar 2023 14:14:27 +0800 Subject: [PATCH 22/85] add iterators --- modules/graph/grin/docs/Doxyfile | 2 +- modules/graph/grin/predefine.h | 2 - modules/graph/grin/src/predefine.cc | 4 -- modules/graph/grin/src/predefine.h | 4 -- .../graph/grin/src/topology/adjacentlist.cc | 64 +++++++++++++++++-- modules/graph/grin/src/topology/vertexlist.cc | 55 ++++++++++++++-- 6 files changed, 109 insertions(+), 22 deletions(-) diff --git a/modules/graph/grin/docs/Doxyfile b/modules/graph/grin/docs/Doxyfile index 59cde0452..61a62cc9b 100644 --- a/modules/graph/grin/docs/Doxyfile +++ b/modules/graph/grin/docs/Doxyfile @@ -917,7 +917,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = README.md ../include +INPUT = README.md ../include ../predefine.h # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 342c2b5d3..0f743b817 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -157,10 +157,8 @@ typedef enum { #undef GRIN_ASSUME_GRAPH_SINGLE_EDGE #undef GRIN_WITH_VERTEX_DATA #undef GRIN_WITH_EDGE_DATA -#undef GRIN_ENABLE_VERTEX_LIST_ITERATOR #undef GRIN_ENABLE_EDGE_LIST #undef GRIN_ENABLE_EDGE_LIST_ITERATOR -#undef GRIN_ENABLE_ADJACENT_LIST_ITERATOR /* End of Disable */ /* Enable the supported features */ diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index cb1025e63..95ffa27e3 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -76,8 +76,6 @@ GRIN_DATATYPE ArrowToDataType(std::shared_ptr type) { #ifdef GRIN_ENABLE_VERTEX_LIST void __grin_init_vertex_list(GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { - vl->current = 0; - vl->type_current = vl->type_begin; vl->offsets.clear(); vl->vrs.clear(); GRIN_GRAPH_T::vertices_t vr; @@ -100,8 +98,6 @@ void __grin_init_vertex_list(GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { #ifdef GRIN_ENABLE_ADJACENT_LIST void __grin_init_adjacent_list(GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { - al->current = 0; - al->etype_current = al->etype_begin; al->offsets.clear(); al->data.clear(); GRIN_GRAPH_T::raw_adj_list_t ral; diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index ff9221ecc..7e8db0b45 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -102,8 +102,6 @@ struct GRIN_VERTEX_LIST_T { unsigned type_begin; unsigned type_end; unsigned all_master_mirror; - unsigned type_current; - unsigned current; std::vector offsets; std::vector vrs; }; @@ -127,8 +125,6 @@ struct GRIN_ADJACENT_LIST_T { GRIN_DIRECTION dir; unsigned etype_begin; unsigned etype_end; - unsigned etype_current; - unsigned current; std::vector offsets; std::vector data; }; diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index a29743d43..4418d5b75 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -74,15 +74,67 @@ GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, #endif #ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR -GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH, GRIN_DIRECTION, GRIN_VERTEX); +GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { + auto _g = static_cast(g); + auto _al = static_cast(al); + auto ali = new GRIN_ADJACENT_LIST_ITERATOR_T(); + ali->v = _al->v; + ali->dir = _al->dir; + ali->etype_begin = _al->etype_begin; + ali->etype_end = _al->etype_end; + ali->etype_current = _al->etype_begin; + ali->current = 0; + if (ali->dir == GRIN_DIRECTION::IN) { + ali->data = _g->GetIncomingRawAdjList(*(ali->v), ali->etype_current); + } else { + ali->data = _g->GetOutgoingRawAdjList(*(ali->v), ali->etype_current); + } + return ali; +} -void grin_destroy_adjacent_list_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); +void grin_destroy_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { + auto _ali = static_cast(ali); + delete _ali; +} -GRIN_ADJACENT_LIST_ITERATOR grin_get_next_adjacent_list_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); +void grin_get_next_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { + auto _g = static_cast(g); + auto _ali = static_cast(ali); + _ali->current++; + while (_ali->etype_current < _ali->etype_end) { + if (_ali->current < _ali->data.size()) break; + _ali->etype_current++; + _ali->current = 0; + if (_ali->dir == GRIN_DIRECTION::IN) { + _ali->data = _g->GetIncomingRawAdjList(*(_ali->v), _ali->etype_current); + } else { + _ali->data = _g->GetOutgoingRawAdjList(*(_ali->v), _ali->etype_current); + } + } +} -bool grin_is_adjacent_list_end(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); +bool grin_is_adjacent_list_end(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { + auto _ali = static_cast(ali); + return _ali->etype_current >= _ali->etype_end; +} -GRIN_VERTEX grin_get_neighbor_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); +GRIN_VERTEX grin_get_neighbor_from_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { + auto _ali = static_cast(ali); + auto _nbr = _ali->data.begin() + _ali->current; + auto v = new GRIN_VERTEX_T(_nbr->vid); + return v; +} -GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH, GRIN_ADJACENT_LIST_ITERATOR); +GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { + auto _ali = static_cast(ali); + auto _nbr = _ali->data.begin() + _ali->current; + auto v = new GRIN_VERTEX_T(_nbr->vid); + auto e = new GRIN_EDGE_T(); + e->src = _ali->v; + e->dst = v; + e->dir = _ali->dir; + e->etype = _ali->etype_current; + e->eid = _nbr->eid; + return e; +} #endif \ No newline at end of file diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index 815b18152..b662cbc87 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -50,13 +50,58 @@ GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t #endif #ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR -GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH); +GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { + auto _g = static_cast(g); + auto _vl = static_cast(vl); + auto vli = new GRIN_VERTEX_LIST_ITERATOR_T(); + vli->type_begin = _vl->type_begin; + vli->type_end = _vl->type_end; + vli->type_current = _vl->type_begin; + vli->current = 0; + vli->all_master_mirror = _vl->all_master_mirror; + if (vli->all_master_mirror == 0) { + vli->vr = _g->Vertices(vli->type_current); + } else if (vli->all_master_mirror == 1) { + vli->vr = _g->InnerVertices(vli->type_current); + } else { + vli->vr = _g->OuterVertices(vli->type_current); + } + return vli; +} -void grin_destroy_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); +void grin_destroy_vertex_list_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { + auto _vli = static_cast(vli); + delete _vli; +} -GRIN_VERTEX_LIST_ITERATOR grin_get_next_vertex_list_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); +void grin_get_next_vertex_list_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { + auto _g = static_cast(g); + auto _vli = static_cast(vli); + _vli->current++; + while (_vli->type_current < _vli->type_end) { + if (_vli->current < _vli->vr.size()) break; + _vli->type_current++; + _vli->current = 0; + if (_vli->type_current < _vli->type_end) { + if (_vli->all_master_mirror == 0) { + _vli->vr = _g->Vertices(_vli->type_current); + } else if (_vli->all_master_mirror == 1) { + _vli->vr = _g->InnerVertices(_vli->type_current); + } else { + _vli->vr = _g->OuterVertices(_vli->type_current); + } + } + } +} -bool grin_is_vertex_list_end(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); +bool grin_is_vertex_list_end(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { + auto _vli = static_cast(vli); + return _vli->type_current >= _vli->type_end; +} -GRIN_VERTEX grin_get_vertex_from_iter(GRIN_GRAPH, GRIN_VERTEX_LIST_ITERATOR); +GRIN_VERTEX grin_get_vertex_from_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { + auto _vli = static_cast(vli); + auto v = new GRIN_VERTEX_T(_vli->vr.begin_value() + _vli->current); + return v; +} #endif From 0268287dd76abacaa17fdb9fe8ab85a9657116a6 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Mon, 20 Mar 2023 16:37:38 +0800 Subject: [PATCH 23/85] remove pointers in _T structs --- modules/graph/grin/src/predefine.cc | 4 ++-- modules/graph/grin/src/predefine.h | 8 +++---- .../graph/grin/src/property/propertytable.cc | 6 ++--- .../graph/grin/src/topology/adjacentlist.cc | 22 +++++++++---------- modules/graph/grin/src/topology/structure.cc | 6 +++-- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 95ffa27e3..8b36fa862 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -105,9 +105,9 @@ void __grin_init_adjacent_list(GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { unsigned sum = 0; for (auto etype = al->etype_begin; etype < al->etype_end; ++etype) { if (al->dir == GRIN_DIRECTION::IN) { - ral = g->GetIncomingRawAdjList(*(al->v), etype); + ral = g->GetIncomingRawAdjList(GRIN_GRAPH_T::vertex_t(al->vid), etype); } else { - ral = g->GetOutgoingRawAdjList(*(al->v), etype); + ral = g->GetOutgoingRawAdjList(GRIN_GRAPH_T::vertex_t(al->vid), etype); } sum += ral.size(); al->offsets.push_back(sum); diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 7e8db0b45..a2cbcaa6f 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -86,8 +86,8 @@ GRIN_DATATYPE ArrowToDataType(std::shared_ptr); typedef vineyard::ArrowFragment GRIN_GRAPH_T; typedef GRIN_GRAPH_T::vertex_t GRIN_VERTEX_T; struct GRIN_EDGE_T { - GRIN_VERTEX src; - GRIN_VERTEX dst; + GRIN_GRAPH_T::vid_t src; + GRIN_GRAPH_T::vid_t dst; GRIN_DIRECTION dir; unsigned etype; GRIN_GRAPH_T::eid_t eid; @@ -121,7 +121,7 @@ struct GRIN_VERTEX_LIST_ITERATOR_T { #ifdef GRIN_ENABLE_ADJACENT_LIST struct GRIN_ADJACENT_LIST_T { - GRIN_VERTEX_T* v; + GRIN_GRAPH_T::vid_t vid; GRIN_DIRECTION dir; unsigned etype_begin; unsigned etype_end; @@ -133,7 +133,7 @@ void __grin_init_adjacent_list(GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al); #ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR struct GRIN_ADJACENT_LIST_ITERATOR_T { - GRIN_VERTEX_T* v; + GRIN_GRAPH_T::vid_t vid; GRIN_DIRECTION dir; unsigned etype_begin; unsigned etype_end; diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 6ea3d061a..3412480cb 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -127,11 +127,11 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP #endif #if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) -GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE v, - GRIN_EDGE_PROPERTY_LIST epl) { +GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, + GRIN_EDGE_PROPERTY_LIST epl) { auto _g = static_cast(g); auto _ept = static_cast(ept); - auto _e = static_cast(v); + auto _e = static_cast(e); auto _epl = static_cast(epl); if (_e->eid >= _ept->num) return NULL; auto offset = _e->eid; diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 4418d5b75..ba645824c 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -22,7 +22,7 @@ GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_V auto _g = static_cast(g); auto _v = static_cast(v); auto al = new GRIN_ADJACENT_LIST_T(); - al->v = _v; + al->vid = _v->GetValue(); al->dir = d; al->etype_begin = 0; al->etype_end = _g->edge_label_num(); @@ -59,10 +59,9 @@ GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, if (idx < _al->offsets[i+1]) { auto _idx = idx - _al->offsets[i]; auto _nbr = _al->data[i].begin() + _idx; - auto v = new GRIN_VERTEX_T(_nbr->vid); auto e = new GRIN_EDGE_T(); - e->src = _al->v; - e->dst = v; + e->src = _al->vid; + e->dst = _nbr->vid; e->dir = _al->dir; e->etype = _al->etype_begin + i; e->eid = _nbr->eid; @@ -78,16 +77,16 @@ GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH g, GRIN_ADJA auto _g = static_cast(g); auto _al = static_cast(al); auto ali = new GRIN_ADJACENT_LIST_ITERATOR_T(); - ali->v = _al->v; + ali->vid = _al->vid; ali->dir = _al->dir; ali->etype_begin = _al->etype_begin; ali->etype_end = _al->etype_end; ali->etype_current = _al->etype_begin; ali->current = 0; if (ali->dir == GRIN_DIRECTION::IN) { - ali->data = _g->GetIncomingRawAdjList(*(ali->v), ali->etype_current); + ali->data = _g->GetIncomingRawAdjList(GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); } else { - ali->data = _g->GetOutgoingRawAdjList(*(ali->v), ali->etype_current); + ali->data = _g->GetOutgoingRawAdjList(GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); } return ali; } @@ -106,9 +105,9 @@ void grin_get_next_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR _ali->etype_current++; _ali->current = 0; if (_ali->dir == GRIN_DIRECTION::IN) { - _ali->data = _g->GetIncomingRawAdjList(*(_ali->v), _ali->etype_current); + _ali->data = _g->GetIncomingRawAdjList(GRIN_GRAPH_T::vertex_t(_ali->vid), _ali->etype_current); } else { - _ali->data = _g->GetOutgoingRawAdjList(*(_ali->v), _ali->etype_current); + _ali->data = _g->GetOutgoingRawAdjList(GRIN_GRAPH_T::vertex_t(_ali->vid), _ali->etype_current); } } } @@ -128,10 +127,9 @@ GRIN_VERTEX grin_get_neighbor_from_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATO GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { auto _ali = static_cast(ali); auto _nbr = _ali->data.begin() + _ali->current; - auto v = new GRIN_VERTEX_T(_nbr->vid); auto e = new GRIN_EDGE_T(); - e->src = _ali->v; - e->dst = v; + e->src = _ali->vid; + e->dst = _nbr->vid; e->dir = _ali->dir; e->etype = _ali->etype_current; e->eid = _nbr->eid; diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index f18966894..ce45c60f4 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -103,12 +103,14 @@ void grin_destroy_edge(GRIN_GRAPH g, GRIN_EDGE e) { GRIN_VERTEX grin_get_edge_src(GRIN_GRAPH g, GRIN_EDGE e) { auto _e = static_cast(e); - return _e->src; + auto v = new GRIN_VERTEX_T(_e->src); + return v; } GRIN_VERTEX grin_get_edge_dst(GRIN_GRAPH g, GRIN_EDGE e) { auto _e = static_cast(e); - return _e->dst; + auto v = new GRIN_VERTEX_T(_e->dst); + return v; } #ifdef GRIN_WITH_EDGE_DATA From b16338a122f2028b8fea8d8e8f97ec46d23c1b53 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 21 Mar 2023 00:03:45 +0800 Subject: [PATCH 24/85] refine partition impl --- modules/graph/grin/src/partition/partition.cc | 13 +- modules/graph/grin/src/predefine.cc | 19 ++- modules/graph/grin/src/predefine.h | 6 +- .../graph/grin/src/property/propertylist.cc | 78 ++++----- modules/graph/test/grin_test.cc | 156 +++++++++++------- 5 files changed, 151 insertions(+), 121 deletions(-) diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index b574dd4ea..6fce82ee6 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -16,22 +16,19 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/partition/partition.h" #include "graph/fragment/property_graph_types.h" -#include "client/client.h" #ifdef GRIN_ENABLE_GRAPH_PARTITION size_t grin_get_total_partitions_number(GRIN_PARTITIONED_GRAPH pg) { auto _pg = static_cast(pg); - return _pg->total_frag_num(); + return _pg->pg->total_frag_num(); } GRIN_PARTITION_LIST grin_get_local_partition_list(GRIN_PARTITIONED_GRAPH pg) { auto _pg = static_cast(pg); auto pl = new GRIN_PARTITION_LIST_T(); - vineyard::Client client; - client.Connect(); - for (auto & [fid, location] : _pg->FragmentLocations()) { - if (location == client.instance_id()) { + for (auto fid = 0; fid < _pg->pg->total_frag_num(); ++fid) { + if (_pg->lgs[fid] != nullptr) { pl->push_back(fid); } } @@ -84,9 +81,7 @@ void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { auto _pg = static_cast(pg); auto _p = static_cast(p); - vineyard::Client client; - client.Connect(); - return get_graph_by_object_id(client, _pg->Fragments().at(*_p)); + return _pg->lgs[*_p]; } #endif diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 8b36fa862..3871677f4 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -17,13 +17,18 @@ limitations under the License. GRIN_PARTITIONED_GRAPH get_partitioned_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { - auto pg = std::dynamic_pointer_cast(client.GetObject(object_id)); - return pg.get(); -} - -GRIN_GRAPH get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { - auto frag = std::dynamic_pointer_cast>(client.GetObject(object_id)); - return frag.get(); + auto _pg = std::dynamic_pointer_cast(client.GetObject(object_id)); + auto pg = new GRIN_PARTITIONED_GRAPH_T(); + pg->pg = _pg.get(); + pg->lgs.resize(_pg->total_frag_num(), nullptr); + for (auto & [fid, location] : _pg->FragmentLocations()) { + if (location == client.instance_id()) { + auto obj_id = _pg->Fragments().at(fid); + auto frag = std::dynamic_pointer_cast>(client.GetObject(obj_id)); + pg->lgs[fid] = frag.get(); + } + } + return pg; } std::string GetDataTypeName(GRIN_DATATYPE type) { diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index a2cbcaa6f..01e2f0489 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -75,7 +75,6 @@ struct GRIN_DATATYPE_ENUM { }; GRIN_PARTITIONED_GRAPH get_partitioned_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id); -GRIN_GRAPH get_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id); std::string GetDataTypeName(GRIN_DATATYPE); GRIN_DATATYPE ArrowToDataType(std::shared_ptr); @@ -144,7 +143,10 @@ struct GRIN_ADJACENT_LIST_ITERATOR_T { #endif #ifdef GRIN_ENABLE_GRAPH_PARTITION -typedef vineyard::ArrowFragmentGroup GRIN_PARTITIONED_GRAPH_T; +struct GRIN_PARTITIONED_GRAPH_T { + vineyard::ArrowFragmentGroup* pg; + std::vector lgs; +}; typedef unsigned GRIN_PARTITION_T; typedef std::vector GRIN_PARTITION_LIST_T; #endif diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index fa5739153..aa515e74f 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -127,42 +127,42 @@ GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH g, GRIN_EDGE_TYPE ety #endif -#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) -GRIN_GRAPH grin_select_vertex_properties(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl) { - auto _g = static_cast(g); - auto _vpl = static_cast(vpl); - std::map> vertices, edges; - for (auto& p: *_vpl) { - int vtype = static_cast(p.first); - int vp = static_cast(p.second); - if (vertices.find(vtype) == vertices.end()) { - vertices[vtype].clear(); - } - vertices[vtype].push_back(vp); - } - vineyard::Client client; - client.Connect(); - auto object_id = _g->Project(client, vertices, edges); - return get_graph_by_object_id(client, object_id.value()); -} -#endif - -#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) -GRIN_GRAPH grin_select_edge_properteis(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl) { - auto _g = static_cast(g); - auto _epl = static_cast(epl); - std::map> vertices, edges; - for (auto& p: *_epl) { - int etype = static_cast(p.first); - int ep = static_cast(p.second); - if (edges.find(etype) == edges.end()) { - edges[etype].clear(); - } - edges[etype].push_back(ep); - } - vineyard::Client client; - client.Connect(); - auto object_id = _g->Project(client, vertices, edges); - return get_graph_by_object_id(client, object_id.value()); -} -#endif \ No newline at end of file +// #if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) +// GRIN_GRAPH grin_select_vertex_properties(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl) { +// auto _g = static_cast(g); +// auto _vpl = static_cast(vpl); +// std::map> vertices, edges; +// for (auto& p: *_vpl) { +// int vtype = static_cast(p.first); +// int vp = static_cast(p.second); +// if (vertices.find(vtype) == vertices.end()) { +// vertices[vtype].clear(); +// } +// vertices[vtype].push_back(vp); +// } +// vineyard::Client client; +// client.Connect(); +// auto object_id = _g->Project(client, vertices, edges); +// return get_graph_by_object_id(client, object_id.value()); +// } +// #endif + +// #if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) +// GRIN_GRAPH grin_select_edge_properteis(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl) { +// auto _g = static_cast(g); +// auto _epl = static_cast(epl); +// std::map> vertices, edges; +// for (auto& p: *_epl) { +// int etype = static_cast(p.first); +// int ep = static_cast(p.second); +// if (edges.find(etype) == edges.end()) { +// edges[etype].clear(); +// } +// edges[etype].push_back(ep); +// } +// vineyard::Client client; +// client.Connect(); +// auto object_id = _g->Project(client, vertices, edges); +// return get_graph_by_object_id(client, object_id.value()); +// } +// #endif \ No newline at end of file diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index de8f6af8b..19a8a9d19 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -21,7 +21,21 @@ limitations under the License. #include "client/client.h" #include "common/util/logging.h" -#include "graph/fragment/arrow_fragment.grin.h" +#include "graph/grin/predefine.h" +#include "graph/grin/include/topology/structure.h" +#include "graph/grin/include/topology/vertexlist.h" +#include "graph/grin/include/topology/adjacentlist.h" +#include "graph/grin/include/partition/partition.h" +#include "graph/grin/include/partition/topology.h" +#include "graph/grin/include/partition/reference.h" +#include "graph/grin/include/property/type.h" +#include "graph/grin/include/property/topology.h" +#include "graph/grin/include/property/partition.h" +#include "graph/grin/include/property/propertylist.h" +#include "graph/grin/include/property/property.h" +#include "graph/grin/include/property/propertytable.h" + +#include "graph/grin/src/predefine.h" #include "graph/fragment/graph_schema.h" #include "graph/loader/arrow_fragment_loader.h" @@ -31,8 +45,6 @@ using GraphType = ArrowFragment; using LabelType = typename GraphType::label_id_t; - - void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION partition, const char* edge_type_name, const char* vertex_property_name) { /* @@ -101,47 +113,100 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part } -void traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, +void Traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, vineyard::ObjectID fragment_group_id) { LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; GRIN_PARTITIONED_GRAPH pg = get_partitioned_graph_by_object_id(client, fragment_group_id); + LOG(INFO) << "Got partition num: " << grin_get_total_partitions_number(pg); + GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); size_t pnum = grin_get_partition_list_size(pg, local_partitions); - assert(pnum > 0); + LOG(INFO) << "Got partition num: " << pnum; +// assert(pnum > 0); // we only traverse the first partition for test - GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); - sync_property(pg, partition, "likes", "features"); +// GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); +// sync_property(pg, partition, "likes", "features"); +} + + +namespace detail { + +std::shared_ptr makeInt64Array() { + std::vector data = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + arrow::Int64Builder builder; + CHECK_ARROW_ERROR(builder.AppendValues(data)); + std::shared_ptr out; + CHECK_ARROW_ERROR(builder.Finish(&out)); + return arrow::ChunkedArray::Make({out}).ValueOrDie(); +} + +std::shared_ptr attachMetadata( + std::shared_ptr schema, std::string const& key, + std::string const& value) { + std::shared_ptr metadata; + if (schema->HasMetadata()) { + metadata = schema->metadata()->Copy(); + } else { + metadata = std::make_shared(); + } + metadata->Append(key, value); + return schema->WithMetadata(metadata); +} + +std::vector> makeVTables() { + auto schema = std::make_shared( + std::vector>{ + arrow::field("id", arrow::int64()), + arrow::field("value1", arrow::int64()), + arrow::field("value2", arrow::int64()), + arrow::field("value3", arrow::int64()), + arrow::field("value4", arrow::int64()), + }); + schema = attachMetadata(schema, "label", "person"); + auto table = arrow::Table::Make( + schema, {makeInt64Array(), makeInt64Array(), makeInt64Array(), + makeInt64Array(), makeInt64Array()}); + return {table}; } +std::vector>> makeETables() { + auto schema = std::make_shared( + std::vector>{ + arrow::field("src_id", arrow::int64()), + arrow::field("dst_id", arrow::int64()), + arrow::field("value1", arrow::int64()), + arrow::field("value2", arrow::int64()), + arrow::field("value3", arrow::int64()), + arrow::field("value4", arrow::int64()), + }); + schema = attachMetadata(schema, "label", "knows"); + schema = attachMetadata(schema, "src_label", "person"); + schema = attachMetadata(schema, "dst_label", "person"); + auto table = arrow::Table::Make( + schema, {makeInt64Array(), makeInt64Array(), makeInt64Array(), + makeInt64Array(), makeInt64Array(), makeInt64Array()}); + return {{table}}; +} +} // namespace detail + int main(int argc, char** argv) { - if (argc < 6) { - printf( - "usage: ./grin_test " - " [directed]\n"); + if (argc < 2) { + printf("usage: ./arrow_fragment_test [directed]\n"); return 1; } int index = 1; std::string ipc_socket = std::string(argv[index++]); - int edge_label_num = atoi(argv[index++]); - std::vector efiles; - for (int i = 0; i < edge_label_num; ++i) { - efiles.push_back(argv[index++]); - } - - int vertex_label_num = atoi(argv[index++]); - std::vector vfiles; - for (int i = 0; i < vertex_label_num; ++i) { - vfiles.push_back(argv[index++]); - } - int directed = 1; if (argc > index) { directed = atoi(argv[index]); } + auto vtables = ::detail::makeVTables(); + auto etables = ::detail::makeETables(); + vineyard::Client client; VINEYARD_CHECK_OK(client.Connect(ipc_socket)); @@ -153,50 +218,14 @@ int main(int argc, char** argv) { grape::CommSpec comm_spec; comm_spec.Init(MPI_COMM_WORLD); - // Load from efiles and vfiles -#if 0 - vineyard::ObjectID fragment_id = InvalidObjectID(); - MPI_Barrier(MPI_COMM_WORLD); - double t = -GetCurrentTime(); - { -#if 0 - auto loader = - std::make_unique>( - client, comm_spec, efiles, vfiles, directed != 0); -#else - vfiles.clear(); - auto loader = - std::make_unique>( - client, comm_spec, efiles, directed != 0); -#endif - fragment_id = loader->LoadFragment().value(); - } - MPI_Barrier(MPI_COMM_WORLD); - t += GetCurrentTime(); - if (comm_spec.fid() == 0) { - LOG(INFO) << "loading time: " << t; - } - - { - std::shared_ptr graph = - std::dynamic_pointer_cast(client.GetObject(fragment_id)); - LOG(INFO) << "[frag-" << graph->fid() - << "]: " << ObjectIDToString(fragment_id); - traverse_graph(graph, - "./xx/output_graph_" + std::to_string(graph->fid())); - } - // client.DelData(fragment_id, true, true); -#else { auto loader = std::make_unique>( - client, comm_spec, efiles, vfiles, directed != 0); + client, comm_spec, vtables, etables, directed != 0); vineyard::ObjectID fragment_group_id = loader->LoadFragmentAsFragmentGroup().value(); - traverse(client, comm_spec, fragment_group_id); + Traverse(client, comm_spec, fragment_group_id); } // Load from efiles @@ -204,12 +233,11 @@ int main(int argc, char** argv) { auto loader = std::make_unique>( - client, comm_spec, efiles, directed != 0); + client, comm_spec, etables, directed != 0); vineyard::ObjectID fragment_group_id = loader->LoadFragmentAsFragmentGroup().value(); - traverse(client, comm_spec, fragment_group_id); + Traverse(client, comm_spec, fragment_group_id); } -#endif } grape::FinalizeMPIComm(); From 9ba798a34e7919da873e182ad725c9188f49da6a Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 21 Mar 2023 11:16:55 +0800 Subject: [PATCH 25/85] refine partition & update headers --- modules/graph/grin/include | 2 +- modules/graph/grin/src/partition/partition.cc | 2 +- modules/graph/grin/src/predefine.cc | 2 +- modules/graph/grin/src/predefine.h | 2 +- modules/graph/test/grin_test.cc | 33 ++++++++++++++++--- 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 67c4cf0bf..b9deb784e 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 67c4cf0bf2b14812259de34a16703f1b7b6aa931 +Subproject commit b9deb784e62d47ac18b934a762a23946bd857e58 diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index 6fce82ee6..a8ca0b0ae 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -81,7 +81,7 @@ void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { auto _pg = static_cast(pg); auto _p = static_cast(p); - return _pg->lgs[*_p]; + return _pg->lgs[*_p].get(); } #endif diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 3871677f4..7d2e67607 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -25,7 +25,7 @@ GRIN_PARTITIONED_GRAPH get_partitioned_graph_by_object_id(vineyard::Client& clie if (location == client.instance_id()) { auto obj_id = _pg->Fragments().at(fid); auto frag = std::dynamic_pointer_cast>(client.GetObject(obj_id)); - pg->lgs[fid] = frag.get(); + pg->lgs[fid] = frag; } } return pg; diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 01e2f0489..ff5058b8a 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -145,7 +145,7 @@ struct GRIN_ADJACENT_LIST_ITERATOR_T { #ifdef GRIN_ENABLE_GRAPH_PARTITION struct GRIN_PARTITIONED_GRAPH_T { vineyard::ArrowFragmentGroup* pg; - std::vector lgs; + std::vector> lgs; }; typedef unsigned GRIN_PARTITION_T; typedef std::vector GRIN_PARTITION_LIST_T; diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index 19a8a9d19..8d9fa5845 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -59,30 +59,49 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part Then for each of these vertices, we send the value of the "features" property to its master partition. */ GRIN_GRAPH g = grin_get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition + auto _g = static_cast(g); + + LOG(INFO) << "Vnum: " << _g->GetTotalNodesNum() << " Enum: " << _g->GetEdgeNum(); + + LOG(INFO) << "Got graph: " << _g->vertex_label_num() << " " << _g->edge_label_num(); + + LOG(INFO) << "Got etype: " << edge_type_name << " " << _g->schema().GetEdgeLabelId(std::string(edge_type_name)); GRIN_EDGE_TYPE etype = grin_get_edge_type_by_name(g, edge_type_name); // get edge type from name + LOG(INFO) << "Etype: " << *(static_cast(etype)); + GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_from_edge_type(g, etype); // get related source vertex type list GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_from_edge_type(g, etype); // get related destination vertex type list size_t src_vtypes_num = grin_get_vertex_type_list_size(g, src_vtypes); size_t dst_vtypes_num = grin_get_vertex_type_list_size(g, dst_vtypes); - assert(src_vtypes_num == dst_vtypes_num); // the src & dst vertex type lists must be aligned + LOG(INFO) << src_vtypes_num << " " << dst_vtypes_num; for (size_t i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type GRIN_VERTEX_TYPE src_vtype = grin_get_vertex_type_from_list(g, src_vtypes, i); // get src type GRIN_VERTEX_TYPE dst_vtype = grin_get_vertex_type_from_list(g, dst_vtypes, i); // get dst type + LOG(INFO) << "Src Vtype: " << *(static_cast(src_vtype)) << " Dst Vtype: " << *(static_cast(dst_vtype)); + + GRIN_VERTEX_PROPERTY dst_vp = grin_get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type if (dst_vp == GRIN_NULL_VERTEX_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" + LOG(INFO) << "Dst VProp: " << grin_get_vertex_property_id(g, dst_vtype, dst_vp); + GRIN_VERTEX_PROPERTY_TABLE dst_vpt = grin_get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use GRIN_DATATYPE dst_vp_dt = grin_get_vertex_property_data_type(g, dst_vp); // prepare property type for later use + LOG(INFO) << "Dst VProp DT: " << GetDataTypeName(dst_vp_dt); + GRIN_VERTEX_LIST __src_vl = grin_get_vertex_list(g); // get the vertex list GRIN_VERTEX_LIST _src_vl = grin_filter_type_for_vertex_list(g, src_vtype, __src_vl); // filter the vertex of source type GRIN_VERTEX_LIST src_vl = grin_filter_master_for_vertex_list(g, _src_vl); // filter master vertices under source type size_t src_vl_num = grin_get_vertex_list_size(g, src_vl); + + LOG(INFO) << "Vertex List Num: " << src_vl_num; + for (size_t j = 0; j < src_vl_num; ++j) { // iterate the src vertex GRIN_VERTEX v = grin_get_vertex_from_list(g, src_vl, j); @@ -105,6 +124,11 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part GRIN_VERTEX_REF uref = grin_get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions GRIN_PARTITION u_master_partition = grin_get_master_partition_from_vertex_ref(g, uref); // get the master partition for u + const char* uref_ser = grin_serialize_vertex_ref(g, uref); + + if (dst_vp_dt == GRIN_DATATYPE::Int64) { + LOG(INFO) << "Message:" << uref_ser << *(static_cast(value)); + } // send_value(u_master_partition, uref, dst_vp_dt, value); // the value must be casted to the correct type based on dst_vp_dt before sending } @@ -118,16 +142,15 @@ void Traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; GRIN_PARTITIONED_GRAPH pg = get_partitioned_graph_by_object_id(client, fragment_group_id); - LOG(INFO) << "Got partition num: " << grin_get_total_partitions_number(pg); GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); size_t pnum = grin_get_partition_list_size(pg, local_partitions); LOG(INFO) << "Got partition num: " << pnum; -// assert(pnum > 0); // we only traverse the first partition for test -// GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); -// sync_property(pg, partition, "likes", "features"); + GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); + LOG(INFO) << "Partition: " << *(static_cast(partition)); + sync_property(pg, partition, "knows", "value3"); } From b8f21e1e83ecf7a369f597ddf8b335ab690d97bd Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 21 Mar 2023 14:29:04 +0800 Subject: [PATCH 26/85] debug grin_test --- modules/graph/fragment/graph_schema.grin.h | 251 --------------------- modules/graph/test/grin_test.cc | 32 +-- 2 files changed, 2 insertions(+), 281 deletions(-) delete mode 100644 modules/graph/fragment/graph_schema.grin.h diff --git a/modules/graph/fragment/graph_schema.grin.h b/modules/graph/fragment/graph_schema.grin.h deleted file mode 100644 index c7cfc9cc2..000000000 --- a/modules/graph/fragment/graph_schema.grin.h +++ /dev/null @@ -1,251 +0,0 @@ -/** Copyright 2020-2023 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#ifndef MODULES_GRAPH_FRAGMENT_GRAPH_SCHEMA_GRIN_H_ -#define MODULES_GRAPH_FRAGMENT_GRAPH_SCHEMA_GRIN_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "arrow/api.h" -#include "arrow/io/api.h" - -#include "common/util/json.h" -#include "graph/fragment/property_graph_types.h" -#include "graph/utils/error.h" - -namespace vineyard { - -class MaxGraphSchema; - -using PropertyType = std::shared_ptr; -class Entry { - // it seems entry is mostly for schema edition - // we will get rid of it - public: - using LabelId = int; - using PropertyId = int; - struct PropertyDef { - PropertyId id; - std::string name; - PropertyType type; - - json ToJSON() const; - void FromJSON(const json& root); - }; - LabelId id; - std::string label; - std::string type; - std::vector props_; - std::vector primary_keys; - std::vector> relations; - std::vector valid_properties; - - std::vector mapping; // old prop id -> new prop id - std::vector reverse_mapping; // new prop id -> old prop id - - void AddProperty(const std::string& name, PropertyType type); - void RemoveProperty(const std::string& name); - void RemoveProperty(const size_t index); - - void AddPrimaryKey(const std::string& key_name); - void AddPrimaryKeys(const std::vector& key_name_list); - void AddPrimaryKeys(size_t key_count, - const std::vector& key_name_list); - void AddRelation(const std::string& src, const std::string& dst); - - size_t property_num() const; - - std::vector properties() const; - - PropertyId GetPropertyId(const std::string& name) const; - PropertyType GetPropertyType(PropertyId prop_id) const; - std::string GetPropertyName(PropertyId prop_id) const; - - json ToJSON() const; - void FromJSON(const json& root); - - void InvalidateProperty(PropertyId id) { valid_properties[id] = 0; } -}; - -class PropertyGraphSchema { - public: - // try to get rid of labelId and propertyId - // also put get_vertex_id & get_vertex_by_id methods in continous_vid_trait - // same can be done for labelId and propertyId - using LabelId = int; - using PropertyId = int; - - PropertyGraphSchema() = default; - - //explicit PropertyGraphSchema(json const& json) { FromJSON(json); } - - PropertyId GetVertexPropertyId(LabelId label_id, - const std::string& name) const; - // grin get property by name ++++ - PropertyType GetVertexPropertyType(LabelId label_id, - PropertyId prop_id) const; - // grin get property type - std::string GetVertexPropertyName(LabelId label_id, PropertyId prop_id) const; - // grin get property name - - PropertyId GetEdgePropertyId(LabelId label_id, const std::string& name) const; - PropertyType GetEdgePropertyType(LabelId label_id, PropertyId prop_id) const; - std::string GetEdgePropertyName(LabelId label_id, PropertyId prop_id) const; - // Ditto. - - LabelId GetVertexLabelId(const std::string& name) const; - // grin get vertex label by name - std::string GetVertexLabelName(LabelId label_id) const; - // grin get vertex label name - - LabelId GetEdgeLabelId(const std::string& name) const; - std::string GetEdgeLabelName(LabelId label_id) const; - // Ditto. - - /* try to get rid of entry - Entry* CreateEntry(const std::string& name, const std::string& type); - - void AddEntry(const Entry& entry); - - const Entry& GetEntry(LabelId label_id, const std::string& type) const; - - Entry& GetMutableEntry(const std::string& label, const std::string& type); - - Entry& GetMutableEntry(const LabelId label_id, const std::string& type); - */ - - json ToJSON() const; - void ToJSON(json& root) const; - //mutable void FromJSON(json const& root); - - std::string ToJSONString() const; - //mutable void FromJSONString(std::string const& schema); - - //mutable void set_fnum(size_t fnum) { fnum_ = fnum; } - size_t fnum() const { return fnum_; } - - //std::vector vertex_entries() const; - - //std::vector edge_entries() const; - - std::vector GetVertexLabels() const; - // grin vertex label list - // grin get vertex name - - std::vector GetEdgeLabels() const; - // Ditto. - - std::vector> GetVertexPropertyListByLabel( - const std::string& label) const; - // grin vertex property list - std::vector> GetVertexPropertyListByLabel( - LabelId label_id) const; - // grin vertex property list - - std::vector> GetEdgePropertyListByLabel( - const std::string& label) const; - std::vector> GetEdgePropertyListByLabel( - LabelId label_id) const; - //Ditto. - - //mutable bool Validate(std::string& message); - - const std::map& GetPropertyNameToIDMapping() const; - // get from grin and build - void DumpToFile(std::string const& path); - // similar - // mutable void InvalidateVertex(LabelId label_id) { valid_vertices_[label_id] = 0; } - - // mutable void InvalidateEdge(LabelId label_id) { valid_edges_[label_id] = 0; } - - size_t vertex_label_num() const { - // grin get_vertex_label_list_size - return std::accumulate(valid_vertices_.begin(), valid_vertices_.end(), 0); - } - - size_t edge_label_num() const { - // grin get_edge_label_list_size - return std::accumulate(valid_edges_.begin(), valid_edges_.end(), 0); - } - - // For internal use, get all vertex label number include invalid ones. - size_t all_vertex_label_num() const { return vertex_entries_.size(); } - // no diff since immutable - - // For internal use, get all edge label number include invalid ones. - size_t all_edge_label_num() const { return edge_entries_.size(); } - - friend MaxGraphSchema; - - private: - size_t fnum_; - std::vector vertex_entries_; - std::vector edge_entries_; - std::vector valid_vertices_; - std::vector valid_edges_; - std::map name_to_idx_; -}; - -/* transformation is currently out of the scope of grin -// In Analytical engine, assume label ids of vertex entries are continuous -// from zero, and property ids of each label is also continuous from zero. -// When transform schema to Maxgraph style, we gather all property names and -// unique them, assign each name a id (index of the vector), then preserve a -// vector for each label, stores mappings from original id to transformed -// id. -class MaxGraphSchema { - public: - using LabelId = int; - using PropertyId = int; - explicit MaxGraphSchema(const PropertyGraphSchema& schema); - PropertyId GetPropertyId(const std::string& name); - PropertyType GetPropertyType(LabelId label_id, PropertyId prop_id); - std::string GetPropertyName(PropertyId prop_id); - - LabelId GetLabelId(const std::string& name); - std::string GetLabelName(LabelId label_id); - - void set_fnum(size_t fnum) { fnum_ = fnum; } - - void AddEntry(const Entry& entry) { entries_.push_back(entry); } - - void ToJSON(json& root) const; - void FromJSON(json const& root); - - std::string ToJSONString() const; - void FromJSONString(std::string const& schema); - - size_t fnum() const { return fnum_; } - - void DumpToFile(std::string const& path); - - private: - size_t fnum_; - std::vector entries_; -}; -*/ - -} // namespace vineyard - -#endif // MODULES_GRAPH_FRAGMENT_GRAPH_SCHEMA_GRIN_H_ diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index 8d9fa5845..7edc4f457 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -61,47 +61,30 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part GRIN_GRAPH g = grin_get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition auto _g = static_cast(g); - LOG(INFO) << "Vnum: " << _g->GetTotalNodesNum() << " Enum: " << _g->GetEdgeNum(); - - LOG(INFO) << "Got graph: " << _g->vertex_label_num() << " " << _g->edge_label_num(); - - LOG(INFO) << "Got etype: " << edge_type_name << " " << _g->schema().GetEdgeLabelId(std::string(edge_type_name)); - GRIN_EDGE_TYPE etype = grin_get_edge_type_by_name(g, edge_type_name); // get edge type from name - LOG(INFO) << "Etype: " << *(static_cast(etype)); GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_from_edge_type(g, etype); // get related source vertex type list GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_from_edge_type(g, etype); // get related destination vertex type list size_t src_vtypes_num = grin_get_vertex_type_list_size(g, src_vtypes); size_t dst_vtypes_num = grin_get_vertex_type_list_size(g, dst_vtypes); - LOG(INFO) << src_vtypes_num << " " << dst_vtypes_num; for (size_t i = 0; i < src_vtypes_num; ++i) { // iterate all pairs of src & dst vertex type GRIN_VERTEX_TYPE src_vtype = grin_get_vertex_type_from_list(g, src_vtypes, i); // get src type GRIN_VERTEX_TYPE dst_vtype = grin_get_vertex_type_from_list(g, dst_vtypes, i); // get dst type - LOG(INFO) << "Src Vtype: " << *(static_cast(src_vtype)) << " Dst Vtype: " << *(static_cast(dst_vtype)); - - GRIN_VERTEX_PROPERTY dst_vp = grin_get_vertex_property_by_name(g, dst_vtype, vertex_property_name); // get the property called "features" under dst type if (dst_vp == GRIN_NULL_VERTEX_PROPERTY) continue; // filter out the pairs whose dst type does NOT have such a property called "features" - LOG(INFO) << "Dst VProp: " << grin_get_vertex_property_id(g, dst_vtype, dst_vp); - GRIN_VERTEX_PROPERTY_TABLE dst_vpt = grin_get_vertex_property_table_by_type(g, dst_vtype); // prepare property table of dst vertex type for later use GRIN_DATATYPE dst_vp_dt = grin_get_vertex_property_data_type(g, dst_vp); // prepare property type for later use - LOG(INFO) << "Dst VProp DT: " << GetDataTypeName(dst_vp_dt); - GRIN_VERTEX_LIST __src_vl = grin_get_vertex_list(g); // get the vertex list GRIN_VERTEX_LIST _src_vl = grin_filter_type_for_vertex_list(g, src_vtype, __src_vl); // filter the vertex of source type GRIN_VERTEX_LIST src_vl = grin_filter_master_for_vertex_list(g, _src_vl); // filter master vertices under source type size_t src_vl_num = grin_get_vertex_list_size(g, src_vl); - LOG(INFO) << "Vertex List Num: " << src_vl_num; - for (size_t j = 0; j < src_vl_num; ++j) { // iterate the src vertex GRIN_VERTEX v = grin_get_vertex_from_list(g, src_vl, j); @@ -127,7 +110,7 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part const char* uref_ser = grin_serialize_vertex_ref(g, uref); if (dst_vp_dt == GRIN_DATATYPE::Int64) { - LOG(INFO) << "Message:" << uref_ser << *(static_cast(value)); + LOG(INFO) << "Message:" << uref_ser << " " << *(static_cast(value)); } // send_value(u_master_partition, uref, dst_vp_dt, value); // the value must be casted to the correct type based on dst_vp_dt before sending @@ -245,18 +228,7 @@ int main(int argc, char** argv) { auto loader = std::make_unique>( - client, comm_spec, vtables, etables, directed != 0); - vineyard::ObjectID fragment_group_id = - loader->LoadFragmentAsFragmentGroup().value(); - Traverse(client, comm_spec, fragment_group_id); - } - - // Load from efiles - { - auto loader = - std::make_unique>( - client, comm_spec, etables, directed != 0); + client, comm_spec, vtables, etables, directed != 0, true, true); vineyard::ObjectID fragment_group_id = loader->LoadFragmentAsFragmentGroup().value(); Traverse(client, comm_spec, fragment_group_id); From 3d848a7717d3a488638bf5126d80841b04e6fa78 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 21 Mar 2023 17:02:23 +0800 Subject: [PATCH 27/85] hot fix grin header --- modules/graph/grin/include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index b9deb784e..ea0e1c40a 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit b9deb784e62d47ac18b934a762a23946bd857e58 +Subproject commit ea0e1c40ab658360d664577b39b89c615260ab57 From d3082d64fb20ebe6ca6b531f25f88fcb8ea29cf8 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 21 Mar 2023 17:55:10 +0800 Subject: [PATCH 28/85] fix list filter return new value --- modules/graph/grin/src/partition/topology.cc | 22 +++++++++++----- modules/graph/grin/src/property/topology.cc | 27 ++++++++++++++------ 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc index 61d8ec4d4..1f8678013 100644 --- a/modules/graph/grin/src/partition/topology.cc +++ b/modules/graph/grin/src/partition/topology.cc @@ -41,17 +41,27 @@ GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); GRIN_VERTEX_LIST grin_filter_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _g = static_cast(g); auto _vl = static_cast(vl); - _vl->all_master_mirror = 1; - __grin_init_vertex_list(_g, _vl); - return _vl; + if (_vl->all_master_mirror > 0) return GRIN_NULL_LIST; + + auto fvl = new GRIN_VERTEX_LIST_T(); + fvl->type_begin = _vl->type_begin; + fvl->type_end = _vl->type_end; + fvl->all_master_mirror = 1; + __grin_init_vertex_list(_g, fvl); + return fvl; } GRIN_VERTEX_LIST grin_filter_mirror_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _g = static_cast(g); auto _vl = static_cast(vl); - _vl->all_master_mirror = 2; - __grin_init_vertex_list(_g, _vl); - return _vl; + if (_vl->all_master_mirror > 0) return GRIN_NULL_LIST; + + auto fvl = new GRIN_VERTEX_LIST_T(); + fvl->type_begin = _vl->type_begin; + fvl->type_end = _vl->type_end; + fvl->all_master_mirror = 2; + __grin_init_vertex_list(_g, fvl); + return fvl; } #endif diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index 020b12d3f..723286c6e 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -51,10 +51,15 @@ GRIN_VERTEX_LIST grin_filter_type_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto _vl = static_cast(vl); - _vl->type_begin = *_vtype; - _vl->type_end = *_vtype + 1; - __grin_init_vertex_list(_g, _vl); - return _vl; + + if (_vl->type_begin > *_vtype || _vl->type_end <= *_vtype) return GRIN_NULL_LIST; + + auto fvl = new GRIN_VERTEX_LIST_T(); + fvl->all_master_mirror = _vl->all_master_mirror; + fvl->type_begin = *_vtype; + fvl->type_end = *_vtype + 1; + __grin_init_vertex_list(_g, fvl); + return fvl; } #endif @@ -71,9 +76,15 @@ GRIN_ADJACENT_LIST grin_filter_edge_type_for_adjacent_list(GRIN_GRAPH g, GRIN_ED auto _g = static_cast(g); auto _etype = static_cast(etype); auto _al = static_cast(al); - _al->etype_begin = *_etype; - _al->etype_end = *_etype + 1; - __grin_init_adjacent_list(_g, _al); - return _al; + + if (_al->etype_begin > *_etype || _al->etype_end <= *_etype) return GRIN_NULL_LIST; + + auto fal = new GRIN_ADJACENT_LIST_T(); + fal->vid = _al->vid; + fal->dir = _al->dir; + fal->etype_begin = *_etype; + fal->etype_end = *_etype + 1; + __grin_init_adjacent_list(_g, fal); + return fal; } #endif \ No newline at end of file From 90cc4954044294e5834ca7866f023c3fedb94737 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 21 Mar 2023 19:26:20 +0800 Subject: [PATCH 29/85] build libvineyard_grin lib --- modules/graph/CMakeLists.txt | 32 ++- .../graph/test/grin_arrow_fragment_test.cc | 183 ------------------ 2 files changed, 31 insertions(+), 184 deletions(-) delete mode 100644 modules/graph/test/grin_arrow_fragment_test.cc diff --git a/modules/graph/CMakeLists.txt b/modules/graph/CMakeLists.txt index 3c112fbd1..59416949f 100644 --- a/modules/graph/CMakeLists.txt +++ b/modules/graph/CMakeLists.txt @@ -42,7 +42,6 @@ add_custom_target(vineyard_graph_java_gen add_dependencies(vineyard_graph_gen vineyard_basic_gen) file(GLOB_RECURSE GRAPH_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}" "fragment/*.cc" - "grin/*.cc" "loader/*.cc" "utils/*.cc" "vertex_map/*.cc" @@ -151,6 +150,7 @@ add_dependencies(vineyard_tests vineyard_graph_tests) if(BUILD_VINEYARD_TESTS) enable_testing() file(GLOB TEST_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/test" "${CMAKE_CURRENT_SOURCE_DIR}/test/*.cc") + list(REMOVE_ITEM TEST_FILES "grin_test.cc") foreach(f ${TEST_FILES}) string(REGEX MATCH "^(.*)\\.[^.]*$" dummy ${f}) set(T_NAME ${CMAKE_MATCH_1}) @@ -171,3 +171,33 @@ if(BUILD_VINEYARD_TESTS) add_dependencies(vineyard_graph_tests ${T_NAME}) endforeach() endif() + +# grin lib +file(GLOB_RECURSE GRIN_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}" "grin/*.cc") +add_library(vineyard_grin ${GRIN_SRC_FILES}) +target_link_libraries(vineyard_grin PRIVATE vineyard_graph) + +# grin test +if(BUILD_VINEYARD_TESTS) + enable_testing() + file(GLOB TEST_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/test" "${CMAKE_CURRENT_SOURCE_DIR}/test/grin_*.cc") + foreach(f ${TEST_FILES}) + string(REGEX MATCH "^(.*)\\.[^.]*$" dummy ${f}) + set(T_NAME ${CMAKE_MATCH_1}) + message(STATUS "Found unit_test - " ${T_NAME}) + if(BUILD_VINEYARD_TESTS_ALL) + add_executable(${T_NAME} test/${T_NAME}.cc) + else() + add_executable(${T_NAME} EXCLUDE_FROM_ALL test/${T_NAME}.cc) + endif() + target_link_libraries(${T_NAME} PRIVATE + vineyard_graph + vineyard_grin + ${ARROW_SHARED_LIB} + ${MPI_CXX_LIBRARIES}) + if(${LIBUNWIND_FOUND}) + target_link_libraries(${T_NAME} PRIVATE ${LIBUNWIND_LIBRARIES}) + endif() + add_test(${T_NAME}, ${T_NAME}) + endforeach() +endif() \ No newline at end of file diff --git a/modules/graph/test/grin_arrow_fragment_test.cc b/modules/graph/test/grin_arrow_fragment_test.cc deleted file mode 100644 index e6aeac96f..000000000 --- a/modules/graph/test/grin_arrow_fragment_test.cc +++ /dev/null @@ -1,183 +0,0 @@ -/** Copyright 2020-2023 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include - -#include -#include - -#include "client/client.h" -#include "common/util/logging.h" - -#include "graph/fragment/arrow_fragment.grin.h" -#include "graph/fragment/graph_schema.h" -#include "graph/loader/arrow_fragment_loader.h" - -using GraphType = vineyard::ArrowFragment; -using LabelType = typename GraphType::label_id_t; - - -void TraverseLocalGraph(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION partition) { - vineyard::GRIN_ArrowFragment gaf; - gaf.init(partitioned_graph, partition); - auto g = gaf.get_graph(); - - auto elabels = grin_get_edge_type_list(g); - auto e_label_num = grin_get_edge_type_list_size(g, elabels); - auto vlabels = grin_get_vertex_type_list(g); - auto v_label_num = grin_get_vertex_type_list_size(g, vlabels); - - for (auto i = 0; i < e_label_num; ++i) { - auto elabel = grin_get_edge_type_from_list(g, elabels, i); - auto props = grin_get_edge_property_list_by_type(g, elabel); - auto prop = grin_get_edge_property_from_list(g, props, 0); - auto prop_dt = grin_get_edge_property_data_type(g, prop); - auto dt_name = GetDataTypeName(prop_dt); - for (auto j = 0; j < v_label_num; ++j) { - auto vlabel = grin_get_vertex_type_from_list(g, vlabels, j); - auto iv = gaf.InnerVertices(vlabel); - for (auto v: iv) { - auto al = gaf.GetOutgoingAdjList(v, elabel); - for (auto it: al) { - auto neighbor = it.get_neighbor(); - auto edge = it.get_edge(); - if (dt_name == "double") { - auto value = it.get_data(prop); - std::cout << value << std::endl; - } - } - } - } - } -} - - -void traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, - vineyard::ObjectID fragment_group_id) { - LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; - - auto pg = get_partitioned_graph_by_object_id(client, fragment_group_id); - auto local_partitions = grin_get_local_partition_list(pg); - size_t pnum = grin_get_partition_list_size(pg, local_partitions); - assert(pnum > 0); - - // we only traverse the first partition for test - auto partition = grin_get_partition_from_list(pg, local_partitions, 0); - TraverseLocalGraph(pg, partition); -} - -int main(int argc, char** argv) { - if (argc < 6) { - printf( - "usage: ./grin_arrow_fragment_test " - " [directed]\n"); - return 1; - } - int index = 1; - std::string ipc_socket = std::string(argv[index++]); - - int edge_label_num = atoi(argv[index++]); - std::vector efiles; - for (int i = 0; i < edge_label_num; ++i) { - efiles.push_back(argv[index++]); - } - - int vertex_label_num = atoi(argv[index++]); - std::vector vfiles; - for (int i = 0; i < vertex_label_num; ++i) { - vfiles.push_back(argv[index++]); - } - - int directed = 1; - if (argc > index) { - directed = atoi(argv[index]); - } - - vineyard::Client client; - VINEYARD_CHECK_OK(client.Connect(ipc_socket)); - - LOG(INFO) << "Connected to IPCServer: " << ipc_socket; - - grape::InitMPIComm(); - - { - grape::CommSpec comm_spec; - comm_spec.Init(MPI_COMM_WORLD); - - // Load from efiles and vfiles -#if 0 - vineyard::ObjectID fragment_id = InvalidObjectID(); - MPI_Barrier(MPI_COMM_WORLD); - double t = -GetCurrentTime(); - { -#if 0 - auto loader = - std::make_unique>( - client, comm_spec, efiles, vfiles, directed != 0); -#else - vfiles.clear(); - auto loader = - std::make_unique>( - client, comm_spec, efiles, directed != 0); -#endif - fragment_id = loader->LoadFragment().value(); - } - MPI_Barrier(MPI_COMM_WORLD); - t += GetCurrentTime(); - if (comm_spec.fid() == 0) { - LOG(INFO) << "loading time: " << t; - } - - { - std::shared_ptr graph = - std::dynamic_pointer_cast(client.GetObject(fragment_id)); - LOG(INFO) << "[frag-" << graph->fid() - << "]: " << ObjectIDToString(fragment_id); - traverse_graph(graph, - "./xx/output_graph_" + std::to_string(graph->fid())); - } - // client.DelData(fragment_id, true, true); -#else - { - auto loader = - std::make_unique>( - client, comm_spec, efiles, vfiles, directed != 0); - vineyard::ObjectID fragment_group_id = - loader->LoadFragmentAsFragmentGroup().value(); - traverse(client, comm_spec, fragment_group_id); - } - - // Load from efiles - { - auto loader = - std::make_unique>( - client, comm_spec, efiles, directed != 0); - vineyard::ObjectID fragment_group_id = - loader->LoadFragmentAsFragmentGroup().value(); - traverse(client, comm_spec, fragment_group_id); - } -#endif - } - grape::FinalizeMPIComm(); - - LOG(INFO) << "Passed arrow fragment test..."; - - return 0; -} From 161b5c73dd8e6582b864f13554df68c8be25a531 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 22 Mar 2023 13:48:33 +0800 Subject: [PATCH 30/85] fix get edge from adjacentlist --- modules/graph/grin/docs/README.md | 3 +++ .../graph/grin/src/topology/adjacentlist.cc | 20 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index f1b4043e6..4fde51c87 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -189,6 +189,9 @@ discuss with GRIN designers. - Since almost everything in GRIN are handlers except of only a few string names, the type for a graph concept and its handler is always mixed-used in GRIN. - For example, GRIN uses the type Vertex to represent the type of a vertex handler, instead of using VertexHandler for clean code. +### Edge +- For any directed edge (u, v) where the direction goes from u to v, u is the source vertex, whereas v is the destination vertex. + ### List GRIN provides two alternative approaches, namely array-style retrieval and iterator, for list retrieval of GRIN_VERTEX_LIST, GRIN_EDGE_LIST, and GRIN_ADJACENT_LIST. diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index ba645824c..b2e3f70d8 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -59,12 +59,17 @@ GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, if (idx < _al->offsets[i+1]) { auto _idx = idx - _al->offsets[i]; auto _nbr = _al->data[i].begin() + _idx; - auto e = new GRIN_EDGE_T(); - e->src = _al->vid; - e->dst = _nbr->vid; + auto e = new GRIN_EDGE_T(); e->dir = _al->dir; e->etype = _al->etype_begin + i; e->eid = _nbr->eid; + if (_al->dir == GRIN_DIRECTION::OUT) { + e->src = _al->vid; + e->dst = _nbr->vid; + } else { + e->src = _nbr->vid; + e->dst = _al->vid; + } return e; } } @@ -128,11 +133,16 @@ GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) auto _ali = static_cast(ali); auto _nbr = _ali->data.begin() + _ali->current; auto e = new GRIN_EDGE_T(); - e->src = _ali->vid; - e->dst = _nbr->vid; e->dir = _ali->dir; e->etype = _ali->etype_current; e->eid = _nbr->eid; + if (_ali->dir == GRIN_DIRECTION::OUT) { + e->src = _ali->vid; + e->dst = _nbr->vid; + } else { + e->src = _nbr->vid; + e->dst = _ali->vid; + } return e; } #endif \ No newline at end of file From 0c275e5b158d6948bc4908209e71b26bc6ccd593 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 24 Mar 2023 15:28:52 +0800 Subject: [PATCH 31/85] implement vertex/edge total num (by type) methods --- modules/graph/fragment/arrow_fragment_group.cc | 17 +++++++++++++++++ modules/graph/fragment/arrow_fragment_group.h | 9 +++++++++ modules/graph/grin/docs/Doxyfile | 2 +- modules/graph/grin/include | 2 +- modules/graph/grin/src/partition/topology.cc | 13 +++++++++++++ modules/graph/grin/src/property/topology.cc | 18 ++++++++++++++++++ modules/graph/test/grin_test.cc | 4 +++- 7 files changed, 62 insertions(+), 3 deletions(-) diff --git a/modules/graph/fragment/arrow_fragment_group.cc b/modules/graph/fragment/arrow_fragment_group.cc index 21606662f..a939ace59 100644 --- a/modules/graph/fragment/arrow_fragment_group.cc +++ b/modules/graph/fragment/arrow_fragment_group.cc @@ -36,7 +36,24 @@ void ArrowFragmentGroup::Construct(const vineyard::ObjectMeta& meta) { meta.GetKeyValue("vertex_label_num"); edge_label_num_ = meta.GetKeyValue("edge_label_num"); + + tot_edge_num_by_type_.resize(edge_label_num_, 0); + tot_edge_num_ = 0; + for (fid_t idx = 0; idx < total_frag_num_; ++idx) { + auto current_fragment_id = meta.GetMemberMeta("frag_object_id_" + std::to_string(idx)).GetId(); + ObjectMeta tmp_meta; + meta.GetClient()->GetMetaData(current_fragment_id, tmp_meta); + + for (size_t __idx = 0; __idx < this->vertex_label_num_; ++__idx) { + for (size_t __idy = 0; __idy < edge_label_num_; ++__idy) { + size_t sz = 0; + tmp_meta.GetMemberMeta("__oe_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)).GetKeyValue("length_", sz); + tot_edge_num_by_type_[__idy] += sz; + tot_edge_num_ += sz; + } + } + fragments_.emplace( meta.GetKeyValue("fid_" + std::to_string(idx)), meta.GetMemberMeta("frag_object_id_" + std::to_string(idx)).GetId()); diff --git a/modules/graph/fragment/arrow_fragment_group.h b/modules/graph/fragment/arrow_fragment_group.h index aa957b7c9..569636b68 100644 --- a/modules/graph/fragment/arrow_fragment_group.h +++ b/modules/graph/fragment/arrow_fragment_group.h @@ -49,6 +49,13 @@ class ArrowFragmentGroup : public Registered, GlobalObject { const std::unordered_map& FragmentLocations() { return fragment_locations_; } + size_t total_edge_num_by_type(property_graph_types::LABEL_ID_TYPE etype) { + return tot_edge_num_by_type_[etype]; + } + + size_t total_edge_num() { + return tot_edge_num_; + } void Construct(const vineyard::ObjectMeta& meta) override; @@ -58,6 +65,8 @@ class ArrowFragmentGroup : public Registered, GlobalObject { property_graph_types::LABEL_ID_TYPE edge_label_num_; std::unordered_map fragments_; std::unordered_map fragment_locations_; + std::vector tot_edge_num_by_type_; + size_t tot_edge_num_; friend ArrowFragmentGroupBuilder; }; diff --git a/modules/graph/grin/docs/Doxyfile b/modules/graph/grin/docs/Doxyfile index 61a62cc9b..be27d5f55 100644 --- a/modules/graph/grin/docs/Doxyfile +++ b/modules/graph/grin/docs/Doxyfile @@ -1267,7 +1267,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = rtfi.css +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets diff --git a/modules/graph/grin/include b/modules/graph/grin/include index ea0e1c40a..5fed500da 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit ea0e1c40ab658360d664577b39b89c615260ab57 +Subproject commit 5fed500dace5e15bc75bf1a80db9ab56269e91c5 diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc index 1f8678013..ed6b55c98 100644 --- a/modules/graph/grin/src/partition/topology.cc +++ b/modules/graph/grin/src/partition/topology.cc @@ -16,6 +16,19 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/partition/topology.h" +#ifdef GRIN_ENABLE_GRAPH_PARTITION +size_t grin_get_total_vertex_num(GRIN_PARTITIONED_GRAPH pg) { + auto _pg = static_cast(pg); + if (_pg->lgs.size() == 0) return 0; + return _pg->lgs[0]->GetTotalVerticesNum(); +} + +size_t grin_get_total_edge_num(GRIN_PARTITIONED_GRAPH pg, GRIN_DIRECTION d) { + auto _pg = static_cast(pg); + return _pg->pg->total_edge_num(); +} +#endif + #if defined(GRIN_WITH_VERTEX_DATA) && \ !defined(GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE) && \ !defined(GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE) && \ diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index 723286c6e..1c5f80b11 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -30,6 +30,24 @@ size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_EDGE_TYPE } #endif +#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_WITH_VERTEX_PROPERTY) +size_t grin_get_total_vertex_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_VERTEX_TYPE vtype) { + auto _pg = static_cast(pg); + auto _vtype = static_cast(vtype); + if (_pg->lgs.size() == 0) return 0; + return _pg->lgs[0]->GetTotalVerticesNum(*_vtype); +} +#endif + +#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_WITH_EDGE_PROPERTY) +size_t grin_get_total_edge_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_DIRECTION d, GRIN_EDGE_TYPE etype) { + auto _pg = static_cast(pg); + auto _etype = static_cast(etype); + return _pg->pg->total_edge_num_by_type(*_etype); +} +#endif + + #ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_ORIGINAL_ID oid) { auto _g = static_cast(g); diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index 7edc4f457..dea42133f 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -128,7 +128,9 @@ void Traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); size_t pnum = grin_get_partition_list_size(pg, local_partitions); - LOG(INFO) << "Got partition num: " << pnum; + size_t vnum = grin_get_total_vertex_num(pg); + size_t enumber = grin_get_total_edge_num(pg, GRIN_DIRECTION::OUT); + LOG(INFO) << "Got partition num: " << pnum << " vertex num: " << vnum << " edge num: " << enumber; // we only traverse the first partition for test GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); From 722725bccc27ea6bdfff8013e61fff1061d17d8e Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 24 Mar 2023 17:38:14 +0800 Subject: [PATCH 32/85] implement iodests in grin fragment --- modules/graph/fragment/arrow_fragment.grin.h | 135 +++++++++++++++++++ 1 file changed, 135 insertions(+) diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index d2a844959..c93a5b16c 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -57,6 +57,7 @@ limitations under the License. #include "graph/grin/include/property/propertylist.h" #include "graph/grin/include/property/propertytable.h" #include "graph/grin/include/property/topology.h" +#include "graph/grin/include/index/order.h" #include "graph/grin/src/predefine.h" @@ -538,10 +539,144 @@ class GRIN_ArrowFragment { GRIN_GRAPH get_graph() { return g_; } + // pos means the vertex position in the inner vertex list under vertex type + inline grape::DestList IEDests(GRIN_VERTEX_TYPE v_label, size_t pos, GRIN_EDGE_TYPE e_label) const { +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE + auto vtype = static_cast(v_label); +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE + auto etype = static_cast(e_label); +#endif + + return grape::DestList(idoffset_[*vtype][*etype][pos], + idoffset_[*vtype][*etype][pos + 1]); + } + + inline grape::DestList OEDests(GRIN_VERTEX_TYPE v_label, size_t pos, GRIN_EDGE_TYPE e_label) const { +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE + auto vtype = static_cast(v_label); +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE + auto etype = static_cast(e_label); +#endif + + return grape::DestList(odoffset_[*vtype][*etype][pos], + odoffset_[*vtype][*etype][pos + 1]); + } + + inline grape::DestList IOEDests(GRIN_VERTEX_TYPE v_label, size_t pos, GRIN_EDGE_TYPE e_label) const { +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE + auto vtype = static_cast(v_label); +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE + auto etype = static_cast(e_label); +#endif + + return grape::DestList(iodoffset_[*vtype][*etype][pos], + iodoffset_[*vtype][*etype][pos + 1]); + } + + void initDestFidList( + bool in_edge, bool out_edge, + std::vector>>& fid_lists, + std::vector>>& fid_lists_offset) { + auto vtl = grin_get_vertex_type_list(g_); + auto vtl_sz = grin_get_vertex_type_list_size(g_, vtl); + auto etl = grin_get_edge_type_list(g_); + auto etl_sz = grin_get_edge_type_list_size(g_, etl); + + for (auto vti = 0; vti < vtl_sz; vti++) { + auto vtype = grin_get_vertex_type_from_list(g_, vtl, vti); + auto inner_vertices = InnerVertices(vtype); + auto ivnum_ = inner_vertices.size(); + + for (auto eti = 0; eti < etl_sz; eti++) { + std::vector id_num(ivnum_, 0); + std::set dstset; + + auto etype = grin_get_edge_type_from_list(g_, etl, eti); + auto v = inner_vertices.begin(); + auto& fid_list = fid_lists[vti][eti]; + auto& fid_list_offset = fid_lists_offset[vti][eti]; + + if (!fid_list_offset.empty()) { + return; + } + fid_list_offset.resize(ivnum_ + 1, NULL); + for (auto i = 0; i < ivnum_; ++i) { + dstset.clear(); + + if (in_edge) { + auto es = GetIncomingAdjList(*v, etype); + for (auto& e : es) { + auto vref = grin_get_vertex_ref_for_vertex(g_, e.neighbor()); + auto p = grin_get_master_partition_from_vertex_ref(g_, vref); + + if (!grin_equal_partition(g_, p, partition_)) { +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION + auto f = static_cast(p); + dstset.insert(*f); +#else + // todo +#endif + } + } + } + if (out_edge) { + auto es = GetOutgoingAdjList(*v, etype); + for (auto& e : es) { + auto vref = grin_get_vertex_ref_for_vertex(g_, e.neighbor()); + auto p = grin_get_master_partition_from_vertex_ref(g_, vref); + + if (!grin_equal_partition(g_, p, partition_)) { +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION + auto f = static_cast(p); + dstset.insert(*f); +#else + // todo +#endif + } + } + } + id_num[i] = dstset.size(); + for (auto fid : dstset) { + fid_list.push_back(fid); + } + ++v; + } + + fid_list.shrink_to_fit(); + fid_list_offset[0] = fid_list.data(); + for (auto i = 0; i < ivnum_; ++i) { + fid_list_offset[i + 1] = fid_list_offset[i] + id_num[i]; + } + } + } + } + + void PrepareToRunApp(const grape::CommSpec& comm_spec, grape::PrepareConf conf) { + if (conf.message_strategy == + grape::MessageStrategy::kAlongEdgeToOuterVertex) { + initDestFidList(true, true, iodst_, iodoffset_); + } else if (conf.message_strategy == + grape::MessageStrategy::kAlongIncomingEdgeToOuterVertex) { + initDestFidList(true, false, idst_, idoffset_); + } else if (conf.message_strategy == + grape::MessageStrategy::kAlongOutgoingEdgeToOuterVertex) { + initDestFidList(false, true, odst_, odoffset_); + } + } + private: GRIN_PARTITIONED_GRAPH pg_; GRIN_GRAPH g_; GRIN_PARTITION partition_; + std::vector>> idst_, odst_, iodst_; + std::vector>> idoffset_, odoffset_, + iodoffset_; }; } // namespace vineyard From 5323302fc92a357147fee8f5230b343bfe7d3f82 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 24 Mar 2023 17:41:54 +0800 Subject: [PATCH 33/85] update docs --- modules/graph/grin/docs/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index 4fde51c87..4c25b90c2 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -90,12 +90,12 @@ The example demonstrates how to synchronize property values of vertices associat LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; auto pg = get_partitioned_graph_by_object_id(client, fragment_group_id); - auto local_partitions = get_local_partition_list(pg); - size_t pnum = get_partition_list_size(local_partitions); + auto local_partitions = grin_get_local_partition_list(pg); + size_t pnum = grin_get_partition_list_size(local_partitions); assert(pnum > 0); // we only sync the first partition as example - auto partition = get_partition_from_list(local_partitions, 0); + auto partition = grin_get_partition_from_list(local_partitions, 0); sync_property(pg, partition, "likes", "features"); } ``` From b24167791bf3a71bc704b3868dc21677ed75a57a Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 28 Mar 2023 10:16:57 +0800 Subject: [PATCH 34/85] implement destroys --- modules/graph/grin/.gitignore | 3 ++- modules/graph/grin/include | 2 +- modules/graph/grin/src/partition/reference.cc | 13 +++++++++++++ modules/graph/grin/src/property/property.cc | 8 ++++++++ .../graph/grin/src/property/propertytable.cc | 10 +++++++++- modules/graph/grin/src/property/type.cc | 18 ++++++++++++++++++ 6 files changed, 51 insertions(+), 3 deletions(-) diff --git a/modules/graph/grin/.gitignore b/modules/graph/grin/.gitignore index c116ba07d..d172bac81 100644 --- a/modules/graph/grin/.gitignore +++ b/modules/graph/grin/.gitignore @@ -1,2 +1,3 @@ /docs/_build/ -/docs/Doxyfile.bak \ No newline at end of file +/docs/Doxyfile.bak +/rust \ No newline at end of file diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 5fed500da..452872032 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 5fed500dace5e15bc75bf1a80db9ab56269e91c5 +Subproject commit 452872032b2dd9a012b0230bebc90c57d98c58d6 diff --git a/modules/graph/grin/src/partition/reference.cc b/modules/graph/grin/src/partition/reference.cc index 630b651d9..428deaad9 100644 --- a/modules/graph/grin/src/partition/reference.cc +++ b/modules/graph/grin/src/partition/reference.cc @@ -26,6 +26,11 @@ GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { return vr; } +void grin_destroy_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { + auto _vr = static_cast(vr); + delete _vr; +} + GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { auto _g = static_cast(g); auto _vr = static_cast(vr); @@ -55,6 +60,10 @@ const char* grin_serialize_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { return out; } +void grin_destroy_serialized_vertex_ref(GRIN_GRAPH g, const char* msg) { + delete[] msg; +} + GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH g, const char* msg) { std::stringstream ss(msg); GRIN_VERTEX_REF_T gid; @@ -87,12 +96,16 @@ GRIN_PARTITION_LIST grin_get_mirror_vertex_mirror_partition_list(GRIN_GRAPH, GRI #ifdef GRIN_ENABLE_EDGE_REF GRIN_EDGE_REF grin_get_edge_ref_for_edge(GRIN_GRAPH, GRIN_EDGE); +void grin_destroy_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); + GRIN_EDGE grin_get_edge_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); GRIN_PARTITION grin_get_master_partition_from_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); const char* grin_serialize_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); +void grin_destroy_serialized_edge_ref(GRIN_GRAPH, const char*); + GRIN_EDGE_REF grin_deserialize_to_edge_ref(GRIN_GRAPH, const char*); bool grin_is_master_edge(GRIN_GRAPH, GRIN_EDGE); diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index cbaafe1bb..444b51a11 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -24,6 +24,10 @@ const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) return out; } +void destroy_vertex_property_name(GRIN_GRAPH g, const char* name) { + delete[] name; +} + GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, const char* name) { auto _g = static_cast(g); @@ -55,6 +59,10 @@ const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { return out; } +void destroy_edge_property_name(GRIN_GRAPH g, const char* name) { + delete[] name; +} + GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, const char* name) { auto _g = static_cast(g); diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 3412480cb..148040391 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -29,7 +29,7 @@ GRIN_ROW grin_create_row(GRIN_GRAPH g) { return r; } -bool grin_insert_value_to_row(GRIN_GRAPH g, GRIN_ROW r, void* value) { +bool grin_insert_value_to_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, void* value) { auto _r = static_cast(r); _r->push_back(value); return true; @@ -64,6 +64,10 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ auto result = vineyard::get_arrow_array_data_element(array, offset); return result; } + +void grin_destroy_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_DATATYPE dt, const void* value) { + // do nothing +} #endif #if defined(GRIN_ENABLE_VERTEX_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) @@ -124,6 +128,10 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP auto result = vineyard::get_arrow_array_data_element(array, offset); return result; } + +void grin_destroy_value_from_edge_property_table(GRIN_GRAPH g, GRIN_DATATYPE dt, const void* value) { + // do nothing +} #endif #if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index aed919e72..c6303a867 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -27,6 +27,11 @@ GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH g, GRIN_VERTEX v) { return vt; } +void grin_destroy_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { + auto _vt = static_cast(vt); + delete _vt; +} + GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH g) { auto _g = static_cast(g); auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); @@ -76,6 +81,10 @@ const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { return out; } +void grin_destroy_vertex_type_name(GRIN_GRAPH g, const char* name) { + delete[] name; +} + GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { auto _g = static_cast(g); auto s = std::string(name); @@ -110,6 +119,11 @@ GRIN_EDGE_TYPE grin_get_edge_type(GRIN_GRAPH g, GRIN_EDGE e) { return et; } +void grin_destroy_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { + auto _et = static_cast(et); + delete _et; +} + GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH g) { auto _g = static_cast(g); auto etl = new GRIN_EDGE_TYPE_LIST_T(); @@ -159,6 +173,10 @@ const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { return out; } +void grin_destroy_edge_type_name(GRIN_GRAPH g, const char* name) { + delete[] name; +} + GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { auto _g = static_cast(g); auto s = std::string(name); From 165ffaa86a2d441d30ec7a1747d4e125e8d1fb20 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 28 Mar 2023 16:46:30 +0800 Subject: [PATCH 35/85] rename & update impl --- modules/graph/grin/docs/README.md | 10 ++-- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 52 ++++++++++---------- modules/graph/grin/src/partition/topology.cc | 32 ++++++------ modules/graph/grin/src/property/topology.cc | 20 ++++---- modules/graph/grin/src/topology/structure.cc | 7 +-- modules/graph/test/grin_test.cc | 12 ++--- 7 files changed, 65 insertions(+), 70 deletions(-) diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index 4c25b90c2..1793eb8d4 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -52,23 +52,23 @@ The example demonstrates how to synchronize property values of vertices associat GRIN_DATATYPE dst_vp_dt = grin_get_vertex_property_data_type(g, dst_vp); // prepare property type for later use GRIN_VERTEX_LIST __src_vl = grin_get_vertex_list(g); // get the vertex list - GRIN_VERTEX_LIST _src_vl = grin_filter_type_for_vertex_list(g, src_vtype, __src_vl); // filter the vertex of source type - GRIN_VERTEX_LIST src_vl = grin_filter_master_for_vertex_list(g, _src_vl); // filter master vertices under source type + GRIN_VERTEX_LIST _src_vl = grin_select_type_for_vertex_list(g, src_vtype, __src_vl); // filter the vertex of source type + GRIN_VERTEX_LIST src_vl = grin_select_master_for_vertex_list(g, _src_vl); // filter master vertices under source type size_t src_vl_num = grin_get_vertex_list_size(g, src_vl); for (size_t j = 0; j < src_vl_num; ++j) { // iterate the src vertex GRIN_VERTEX v = grin_get_vertex_from_list(g, src_vl, j); - #ifdef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST + #ifdef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST GRIN_ADJACENT_LIST _adj_list = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v - GRIN_ADJACENT_LIST adj_list = grin_filter_edge_type_for_adjacent_list(g, etype, _adj_list); // filter edges under etype + GRIN_ADJACENT_LIST adj_list = grin_select_edge_type_for_adjacent_list(g, etype, _adj_list); // filter edges under etype #else GRIN_ADJACENT_LIST adj_lsit = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v #endif size_t al_sz = grin_get_adjacent_list_size(g, adj_list); for (size_t k = 0; k < al_sz; ++k) { - #ifndef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST + #ifndef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST GRIN_EDGE edge = grin_get_edge_from_adjacent_list(g, adj_list, k); GRIN_EDGE_TYPE edge_type = grin_get_edge_type(g, edge); if (!grin_equal_edge_type(g, edge_type, etype)) continue; diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 452872032..23963e303 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 452872032b2dd9a012b0230bebc90c57d98c58d6 +Subproject commit 23963e3031a0b44c5c23d523fdc73862d682d52a diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 0f743b817..5ed3695a3 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -322,42 +322,42 @@ typedef enum { * for vertex list iterator. That means, the caller can use the predicate * to make a master-only vertex list iterator from the original iterator. */ -#define GRIN_TRAIT_FILTER_MASTER_FOR_VERTEX_LIST +#define GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST /** @ingroup TraitFilterMacros * @brief The storage provides a filtering predicate of single partition vertices * for vertex list iterator. That means, the caller can use the predicate * to make a single-partition vertex list iterator from the original iterator. */ -#define GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST +#define GRIN_TRAIT_SELECT_PARTITION_FOR_VERTEX_LIST /** @ingroup TraitFilterMacros * @brief The storage provides a filtering predicate of master edges * for edge list iterator. That means, the caller can use the predicate * to make a master-only edge list iterator from the original iterator. */ -#define GRIN_TRAIT_FILTER_MASTER_FOR_EDGE_LIST +#define GRIN_TRAIT_SELECT_MASTER_FOR_EDGE_LIST /** @ingroup TraitFilterMacros * @brief The storage provides a filtering predicate of single partition edges * for edge list iterator. That means, the caller can use the predicate * to make a single-partition edge list iterator from the original iterator. */ -#define GRIN_TRAIT_FILTER_PARTITION_FOR_EDGE_LIST +#define GRIN_TRAIT_SELECT_PARTITION_FOR_EDGE_LIST /** @ingroup TraitFilterMacros * @brief The storage provides a filtering predicate of master neighbors * for adjacent list iterator. That means, the caller can use the predicate * to make a master-only adjacent list iterator from the original iterator. */ -#define GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST +#define GRIN_TRAIT_SELECT_MASTER_NEIGHBOR_FOR_ADJACENT_LIST /** @ingroup TraitFilterMacros * @brief The storage provides a filtering predicate of single-partition vertices * for adjacent list iterator. That means, the caller can use the predicate * to make a single-partition adjacent list iterator from the original iterator. */ -#define GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST +#define GRIN_TRAIT_SELECT_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST ///@} #ifndef GRIN_DOXYGEN_SKIP @@ -378,9 +378,9 @@ typedef enum { #undef GRIN_ENABLE_EDGE_REF #undef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST #undef GRIN_TRAIT_MIRROR_VERTEX_MIRROR_PARTITION_LIST -#undef GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST -#undef GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST -#undef GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST +#undef GRIN_TRAIT_SELECT_PARTITION_FOR_VERTEX_LIST +#undef GRIN_TRAIT_SELECT_MASTER_NEIGHBOR_FOR_ADJACENT_LIST +#undef GRIN_TRAIT_SELECT_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST /* End of Disable */ /* Enable the supported features */ @@ -413,14 +413,14 @@ typedef enum { #undef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST #undef GRIN_TRAIT_MIRROR_VERTEX_MIRROR_PARTITION_LIST #undef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_TRAIT_FILTER_MASTER_FOR_VERTEX_LIST +#undef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST #endif #ifndef GRIN_ENABLE_EDGE_REF // enable edge pref is the prerequisite #undef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST #undef GRIN_TRAIT_MIRROR_EDGE_MIRROR_PARTITION_LIST #undef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_TRAIT_FILTER_MASTER_FOR_EDGE_LIST +#undef GRIN_TRAIT_SELECT_MASTER_FOR_EDGE_LIST #endif #ifndef GRIN_WITH_VERTEX_DATA // enable vertex data is the prerequisite @@ -434,18 +434,18 @@ typedef enum { #endif #ifndef GRIN_ENABLE_VERTEX_LIST // enable vertex list iterator is the prerequisite -#undef GRIN_TRAIT_FILTER_MASTER_FOR_VERTEX_LIST -#undef GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST +#undef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST +#undef GRIN_TRAIT_SELECT_PARTITION_FOR_VERTEX_LIST #endif #ifndef GRIN_ENABLE_EDGE_LIST // enable edge list iterator is the prerequisite -#undef GRIN_TRAIT_FILTER_MASTER_FOR_EDGE_LIST -#undef GRIN_TRAIT_FILTER_PARTITION_FOR_EDGE_LIST +#undef GRIN_TRAIT_SELECT_MASTER_FOR_EDGE_LIST +#undef GRIN_TRAIT_SELECT_PARTITION_FOR_EDGE_LIST #endif #ifndef GRIN_ENABLE_ADJACENT_LIST // enable adjacent list iterator is the prerequisite -#undef GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST -#undef GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST +#undef GRIN_TRAIT_SELECT_MASTER_NEIGHBOR_FOR_ADJACENT_LIST +#undef GRIN_TRAIT_SELECT_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST #endif #ifdef GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE @@ -594,7 +594,7 @@ typedef enum { * to make a vertex list iterator for a certain type of vertices from the * original iterator. */ -#define GRIN_TRAIT_FILTER_TYPE_FOR_VERTEX_LIST +#define GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST /** @ingroup TraitFilterTypeMacros * @brief The storage provides a filtering predicate of single-type edges @@ -602,7 +602,7 @@ typedef enum { * to make an edge list iterator for a certain type of edges from the * original iterator. */ -#define GRIN_TRAIT_FILTER_TYPE_FOR_EDGE_LIST +#define GRIN_TRAIT_SELECT_TYPE_FOR_EDGE_LIST /** @ingroup TraitFilterTypeMacros * @brief The storage provides a filtering predicate of single-type neighbors @@ -610,7 +610,7 @@ typedef enum { * to make an adjacent list iterator of neighbors with a certain type from * the original iterator. */ -#define GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST +#define GRIN_TRAIT_SELECT_NEIGHBOR_TYPE_FOR_ADJACENT_LIST /** @ingroup TraitFilterTypeMacros * @brief The storage provides a filtering predicate of single-type edges @@ -618,7 +618,7 @@ typedef enum { * to make an adjacent list iterator of edges with a certain type from * the original iterator. */ -#define GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST +#define GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST ///@} @@ -728,7 +728,7 @@ typedef enum { /* Disable the unsupported features */ #undef GRIN_ENABLE_VERTEX_PRIMARY_KEYS #undef GRIN_ENABLE_EDGE_PRIMARY_KEYS -#undef GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST +#undef GRIN_TRAIT_SELECT_NEIGHBOR_TYPE_FOR_ADJACENT_LIST /* End of Disable */ /* Enable the supported features */ @@ -799,16 +799,16 @@ typedef enum { #endif #ifndef GRIN_ENABLE_VERTEX_LIST // enable vertex list iterator is the prerequisite -#undef GRIN_TRAIT_FILTER_TYPE_FOR_VERTEX_LIST +#undef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST #endif #ifndef GRIN_ENABLE_EDGE_LIST // enable edge list iterator is the prerequisite -#undef GRIN_TRAIT_FILTER_TYPE_FOR_EDGE_LIST +#undef GRIN_TRAIT_SELECT_TYPE_FOR_EDGE_LIST #endif #ifndef GRIN_ENABLE_ADJACENT_LIST // enable adjacent list iterator is the prerequisite -#undef GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST -#undef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST +#undef GRIN_TRAIT_SELECT_NEIGHBOR_TYPE_FOR_ADJACENT_LIST +#undef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST #endif // assumption on vertex property diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc index ed6b55c98..170fc90d3 100644 --- a/modules/graph/grin/src/partition/topology.cc +++ b/modules/graph/grin/src/partition/topology.cc @@ -23,7 +23,7 @@ size_t grin_get_total_vertex_num(GRIN_PARTITIONED_GRAPH pg) { return _pg->lgs[0]->GetTotalVerticesNum(); } -size_t grin_get_total_edge_num(GRIN_PARTITIONED_GRAPH pg, GRIN_DIRECTION d) { +size_t grin_get_total_edge_num(GRIN_PARTITIONED_GRAPH pg) { auto _pg = static_cast(pg); return _pg->pg->total_edge_num(); } @@ -50,8 +50,8 @@ GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); #endif -#ifdef GRIN_TRAIT_FILTER_MASTER_FOR_VERTEX_LIST -GRIN_VERTEX_LIST grin_filter_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { +#ifdef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST +GRIN_VERTEX_LIST grin_select_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _g = static_cast(g); auto _vl = static_cast(vl); if (_vl->all_master_mirror > 0) return GRIN_NULL_LIST; @@ -64,7 +64,7 @@ GRIN_VERTEX_LIST grin_filter_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LI return fvl; } -GRIN_VERTEX_LIST grin_filter_mirror_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { +GRIN_VERTEX_LIST grin_select_mirror_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _g = static_cast(g); auto _vl = static_cast(vl); if (_vl->all_master_mirror > 0) return GRIN_NULL_LIST; @@ -79,21 +79,21 @@ GRIN_VERTEX_LIST grin_filter_mirror_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LI #endif -#ifdef GRIN_TRAIT_FILTER_PARTITION_FOR_VERTEX_LIST -GRIN_VERTEX_LIST grin_filter_partition_for_vertex_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_VERTEX_LIST); +#ifdef GRIN_TRAIT_SELECT_PARTITION_FOR_VERTEX_LIST +GRIN_VERTEX_LIST grin_select_partition_for_vertex_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_VERTEX_LIST); #endif -#ifdef GRIN_TRAIT_FILTER_MASTER_FOR_EDGE_LIST -GRIN_EDGE_LIST grin_filter_master_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); +#ifdef GRIN_TRAIT_SELECT_MASTER_FOR_EDGE_LIST +GRIN_EDGE_LIST grin_select_master_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); -GRIN_EDGE_LIST grin_filter_mirror_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); +GRIN_EDGE_LIST grin_select_mirror_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); #endif -#ifdef GRIN_TRAIT_FILTER_PARTITION_FOR_EDGE_LIST -GRIN_EDGE_LIST grin_filter_partition_for_edge_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_EDGE_LIST); +#ifdef GRIN_TRAIT_SELECT_PARTITION_FOR_EDGE_LIST +GRIN_EDGE_LIST grin_select_partition_for_edge_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_EDGE_LIST); #endif @@ -118,12 +118,12 @@ GRIN_PARTITION_LIST grin_vertex_neighbor_complete_partitions(GRIN_GRAPH, GRIN_VE #endif -#ifdef GRIN_TRAIT_FILTER_MASTER_NEIGHBOR_FOR_ADJACENT_LIST -GRIN_ADJACENT_LIST grin_filter_master_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); +#ifdef GRIN_TRAIT_SELECT_MASTER_NEIGHBOR_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_select_master_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); -GRIN_ADJACENT_LIST grin_filter_mirror_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); +GRIN_ADJACENT_LIST grin_select_mirror_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); #endif -#ifdef GRIN_TRAIT_FILTER_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST -GRIN_ADJACENT_LIST grin_filter_neighbor_partition_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); +#ifdef GRIN_TRAIT_SELECT_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_select_neighbor_partition_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); #endif diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index 1c5f80b11..69b4a7d3d 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -23,7 +23,7 @@ size_t grin_get_vertex_num_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { #endif #ifdef GRIN_WITH_EDGE_PROPERTY -size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_EDGE_TYPE etype) { +size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g); auto _etype = static_cast(etype); return _g->edge_data_table(*_etype)->num_rows(); @@ -40,7 +40,7 @@ size_t grin_get_total_vertex_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_VERTEX_ #endif #if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_WITH_EDGE_PROPERTY) -size_t grin_get_total_edge_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_DIRECTION d, GRIN_EDGE_TYPE etype) { +size_t grin_get_total_edge_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_EDGE_TYPE etype) { auto _pg = static_cast(pg); auto _etype = static_cast(etype); return _pg->pg->total_edge_num_by_type(*_etype); @@ -64,8 +64,8 @@ GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_T } #endif -#ifdef GRIN_TRAIT_FILTER_TYPE_FOR_VERTEX_LIST -GRIN_VERTEX_LIST grin_filter_type_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_LIST vl) { +#ifdef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST +GRIN_VERTEX_LIST grin_select_type_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_LIST vl) { auto _g = static_cast(g); auto _vtype = static_cast(vtype); auto _vl = static_cast(vl); @@ -81,16 +81,16 @@ GRIN_VERTEX_LIST grin_filter_type_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE } #endif -#ifdef GRIN_TRAIT_FILTER_TYPE_FOR_EDGE_LIST -GRIN_EDGE_LIST grin_filter_type_for_edge_list(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_LIST); +#ifdef GRIN_TRAIT_SELECT_TYPE_FOR_EDGE_LIST +GRIN_EDGE_LIST grin_select_type_for_edge_list(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_EDGE_LIST); #endif -#ifdef GRIN_TRAIT_FILTER_NEIGHBOR_TYPE_FOR_ADJACENT_LIST -GRIN_ADJACENT_LIST grin_filter_neighbor_type_for_adjacent_list(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_ADJACENT_LIST); +#ifdef GRIN_TRAIT_SELECT_NEIGHBOR_TYPE_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_select_neighbor_type_for_adjacent_list(GRIN_GRAPH, GRIN_VERTEX_TYPE, GRIN_ADJACENT_LIST); #endif -#ifdef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST -GRIN_ADJACENT_LIST grin_filter_edge_type_for_adjacent_list(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_ADJACENT_LIST al) { +#ifdef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST +GRIN_ADJACENT_LIST grin_select_edge_type_for_adjacent_list(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_ADJACENT_LIST al) { auto _g = static_cast(g); auto _etype = static_cast(etype); auto _al = static_cast(al); diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index ce45c60f4..43d3b30cc 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -39,13 +39,8 @@ size_t grin_get_vertex_num(GRIN_GRAPH g) { return result; } -size_t grin_get_edge_num(GRIN_GRAPH g, GRIN_DIRECTION d) { +size_t grin_get_edge_num(GRIN_GRAPH g) { auto _g = static_cast(g); - if (d == IN) { - return _g->GetInEdgeNum(); - } else if (d == OUT) { - return _g->GetOutEdgeNum(); - } return _g->GetEdgeNum(); } diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index dea42133f..576b37641 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -80,24 +80,24 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part GRIN_DATATYPE dst_vp_dt = grin_get_vertex_property_data_type(g, dst_vp); // prepare property type for later use GRIN_VERTEX_LIST __src_vl = grin_get_vertex_list(g); // get the vertex list - GRIN_VERTEX_LIST _src_vl = grin_filter_type_for_vertex_list(g, src_vtype, __src_vl); // filter the vertex of source type - GRIN_VERTEX_LIST src_vl = grin_filter_master_for_vertex_list(g, _src_vl); // filter master vertices under source type + GRIN_VERTEX_LIST _src_vl = grin_select_type_for_vertex_list(g, src_vtype, __src_vl); // filter the vertex of source type + GRIN_VERTEX_LIST src_vl = grin_select_master_for_vertex_list(g, _src_vl); // filter master vertices under source type size_t src_vl_num = grin_get_vertex_list_size(g, src_vl); for (size_t j = 0; j < src_vl_num; ++j) { // iterate the src vertex GRIN_VERTEX v = grin_get_vertex_from_list(g, src_vl, j); -#ifdef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST +#ifdef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST GRIN_ADJACENT_LIST _adj_list = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v - GRIN_ADJACENT_LIST adj_list = grin_filter_edge_type_for_adjacent_list(g, etype, _adj_list); // filter edges under etype + GRIN_ADJACENT_LIST adj_list = grin_select_edge_type_for_adjacent_list(g, etype, _adj_list); // filter edges under etype #else GRIN_ADJACENT_LIST adj_lsit = grin_get_adjacent_list(g, GRIN_DIRECTION::OUT, v); // get the outgoing adjacent list of v #endif size_t al_sz = grin_get_adjacent_list_size(g, adj_list); for (size_t k = 0; k < al_sz; ++k) { -#ifndef GRIN_TRAIT_FILTER_EDGE_TYPE_FOR_ADJACENT_LIST +#ifndef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST GRIN_EDGE edge = grin_get_edge_from_adjacent_list(g, adj_list, k); GRIN_EDGE_TYPE edge_type = grin_get_edge_type(g, edge); if (!grin_equal_edge_type(g, edge_type, etype)) continue; @@ -129,7 +129,7 @@ void Traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); size_t pnum = grin_get_partition_list_size(pg, local_partitions); size_t vnum = grin_get_total_vertex_num(pg); - size_t enumber = grin_get_total_edge_num(pg, GRIN_DIRECTION::OUT); + size_t enumber = grin_get_total_edge_num(pg); LOG(INFO) << "Got partition num: " << pnum << " vertex num: " << vnum << " edge num: " << enumber; // we only traverse the first partition for test From b0c0fef9f8b9e4ad2c44837ca2e1475f4d4bdb42 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 28 Mar 2023 17:11:11 +0800 Subject: [PATCH 36/85] fix get properties by name --- modules/graph/grin/src/property/property.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 444b51a11..9466c299b 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -42,7 +42,10 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const auto s = std::string(name); auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { - vpl->push_back(GRIN_VERTEX_PROPERTY_T(vtype, _g->schema().GetVertexPropertyId(vtype, s))); + auto pid = _g->schema().GetVertexPropertyId(vtype, s); + if (pid >= 0) { + vpl->push_back(GRIN_VERTEX_PROPERTY_T(vtype, pid)); + } } return vpl; } @@ -77,7 +80,10 @@ GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH g, const cha auto s = std::string(name); auto epl = new GRIN_EDGE_PROPERTY_LIST_T(); for (auto etype = 0; etype < _g->edge_label_num(); ++etype) { - epl->push_back(GRIN_EDGE_PROPERTY_T(etype, _g->schema().GetVertexPropertyId(etype, s))); + auto pid = _g->schema().GetEdgePropertyId(etype, s); + if (pid >= 0) { + epl->push_back(GRIN_EDGE_PROPERTY_T(etype, pid)); + } } return epl; } From 799109d9d8950c119c516a8a3c2a8df55d926c97 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 29 Mar 2023 12:11:23 +0800 Subject: [PATCH 37/85] fix for destroy value and name --- modules/graph/grin/include | 2 +- modules/graph/grin/src/property/property.cc | 8 --- .../graph/grin/src/property/propertytable.cc | 68 ++++++++++++++++--- modules/graph/grin/src/property/type.cc | 8 --- modules/graph/grin/src/topology/structure.cc | 43 ++++++++++-- 5 files changed, 97 insertions(+), 32 deletions(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 23963e303..561aafe95 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 23963e3031a0b44c5c23d523fdc73862d682d52a +Subproject commit 561aafe9516dac163095aaa60bf2293d548ce4e7 diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 9466c299b..000e31a55 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -24,10 +24,6 @@ const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) return out; } -void destroy_vertex_property_name(GRIN_GRAPH g, const char* name) { - delete[] name; -} - GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, const char* name) { auto _g = static_cast(g); @@ -62,10 +58,6 @@ const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { return out; } -void destroy_edge_property_name(GRIN_GRAPH g, const char* name) { - delete[] name; -} - GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, const char* name) { auto _g = static_cast(g); diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 148040391..0e5a82779 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -19,9 +19,31 @@ void grin_destroy_row(GRIN_GRAPH g, GRIN_ROW r) { delete _r; } -const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { +const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, size_t idx) { auto _r = static_cast(r); - return (*_r)[idx]; + switch (dt) { + case GRIN_DATATYPE::Int32: + return new int32_t(*(const int32_t*)((*_r)[idx])); + case GRIN_DATATYPE::UInt32: + return new uint32_t(*(const uint32_t*)((*_r)[idx])); + case GRIN_DATATYPE::Int64: + return new int64_t(*(const int64_t*)((*_r)[idx])); + case GRIN_DATATYPE::UInt64: + return new uint64_t(*(const uint64_t*)((*_r)[idx])); + case GRIN_DATATYPE::Float: + return new float(*(const float*)((*_r)[idx])); + case GRIN_DATATYPE::Double: + return new double(*(const double*)((*_r)[idx])); + case GRIN_DATATYPE::String: + return new std::string(*(const std::string*)((*_r)[idx])); + case GRIN_DATATYPE::Date32: + return new int32_t(*(const int32_t*)((*_r)[idx])); + case GRIN_DATATYPE::Date64: + return new int64_t(*(const int64_t*)((*_r)[idx])); + default: + return NULL; + } + return NULL; } GRIN_ROW grin_create_row(GRIN_GRAPH g) { @@ -31,7 +53,39 @@ GRIN_ROW grin_create_row(GRIN_GRAPH g) { bool grin_insert_value_to_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, void* value) { auto _r = static_cast(r); - _r->push_back(value); + void* _value = NULL; + switch (dt) { + case GRIN_DATATYPE::Int32: + _value = new int32_t(*static_cast(value)); + break; + case GRIN_DATATYPE::UInt32: + _value = new uint32_t(*static_cast(value)); + break; + case GRIN_DATATYPE::Int64: + _value = new int64_t(*static_cast(value)); + break; + case GRIN_DATATYPE::UInt64: + _value = new uint64_t(*static_cast(value)); + break; + case GRIN_DATATYPE::Float: + _value = new float(*static_cast(value)); + break; + case GRIN_DATATYPE::Double: + _value = new double(*static_cast(value)); + break; + case GRIN_DATATYPE::String: + _value = new std::string(*static_cast(value)); + break; + case GRIN_DATATYPE::Date32: + _value = new int32_t(*static_cast(value)); + break; + case GRIN_DATATYPE::Date64: + _value = new int64_t(*static_cast(value)); + break; + default: + _value = NULL; + } + _r->push_back(_value); return true; } #endif @@ -64,10 +118,6 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ auto result = vineyard::get_arrow_array_data_element(array, offset); return result; } - -void grin_destroy_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_DATATYPE dt, const void* value) { - // do nothing -} #endif #if defined(GRIN_ENABLE_VERTEX_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) @@ -128,10 +178,6 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP auto result = vineyard::get_arrow_array_data_element(array, offset); return result; } - -void grin_destroy_value_from_edge_property_table(GRIN_GRAPH g, GRIN_DATATYPE dt, const void* value) { - // do nothing -} #endif #if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index c6303a867..b5c6cc4af 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -81,10 +81,6 @@ const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { return out; } -void grin_destroy_vertex_type_name(GRIN_GRAPH g, const char* name) { - delete[] name; -} - GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { auto _g = static_cast(g); auto s = std::string(name); @@ -173,10 +169,6 @@ const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { return out; } -void grin_destroy_edge_type_name(GRIN_GRAPH g, const char* name) { - delete[] name; -} - GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { auto _g = static_cast(g); auto s = std::string(name); diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 43d3b30cc..b062d4981 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -82,12 +82,49 @@ GRIN_VERTEX_ORIGINAL_ID grin_get_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX v) GRIN_VERTEX grin_get_vertex_from_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); #endif +// Data +void grin_destroy_value(GRIN_GRAPH g, GRIN_DATATYPE dt, void* value) { + switch (dt) { + case GRIN_DATATYPE::Int32: + delete static_cast(value); + break; + case GRIN_DATATYPE::UInt32: + delete static_cast(value); + break; + case GRIN_DATATYPE::Int64: + delete static_cast(value); + break; + case GRIN_DATATYPE::UInt64: + delete static_cast(value); + break; + case GRIN_DATATYPE::Float: + delete static_cast(value); + break; + case GRIN_DATATYPE::Double: + delete static_cast(value); + break; + case GRIN_DATATYPE::String: + delete static_cast(value); + break; + case GRIN_DATATYPE::Date32: + delete static_cast(value); + break; + case GRIN_DATATYPE::Date64: + delete static_cast(value); + break; + default: + break; + } +} + +void grin_destroy_name(GRIN_GRAPH g, const char* name) { + delete[] name; +} + #ifdef GRIN_WITH_VERTEX_DATA GRIN_DATATYPE grin_get_vertex_data_type(GRIN_GRAPH, GRIN_VERTEX); GRIN_VERTEX_DATA grin_get_vertex_data_value(GRIN_GRAPH, GRIN_VERTEX); - -void grin_destroy_vertex_data(GRIN_GRAPH, GRIN_VERTEX_DATA); #endif // Edge @@ -112,6 +149,4 @@ GRIN_VERTEX grin_get_edge_dst(GRIN_GRAPH g, GRIN_EDGE e) { GRIN_DATATYPE grin_get_edge_data_type(GRIN_GRAPH, GRIN_EDGE); GRIN_EDGE_DATA grin_get_edge_data_value(GRIN_GRAPH, GRIN_EDGE); - -void grin_destroy_edge_data(GRIN_GRAPH, GRIN_EDGE_DATA); #endif \ No newline at end of file From b924bef42c05b110d6050a045b77ec523b4c593e Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 29 Mar 2023 13:28:30 +0800 Subject: [PATCH 38/85] add destroy partitioned graph handler impl --- modules/graph/grin/src/partition/partition.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index a8ca0b0ae..fea2d85b2 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -19,6 +19,11 @@ limitations under the License. #ifdef GRIN_ENABLE_GRAPH_PARTITION +void grin_destroy_partitioned_graph(GRIN_PARTITIONED_GRAPH pg) { + auto _pg = static_cast(pg); + delete _pg; +} + size_t grin_get_total_partitions_number(GRIN_PARTITIONED_GRAPH pg) { auto _pg = static_cast(pg); return _pg->pg->total_frag_num(); From 5560acf7af3dbea249c54b01f0c6b0304ddfe3bb Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 29 Mar 2023 18:04:49 +0800 Subject: [PATCH 39/85] add get graph from storage --- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 18 +++++-- modules/graph/grin/src/index/order.cc | 4 +- modules/graph/grin/src/partition/partition.cc | 29 +++++++++-- modules/graph/grin/src/partition/reference.cc | 10 ++-- modules/graph/grin/src/partition/topology.cc | 4 +- modules/graph/grin/src/predefine.cc | 28 +++-------- modules/graph/grin/src/predefine.h | 42 +++++++++------- modules/graph/grin/src/property/property.cc | 16 +++--- .../graph/grin/src/property/propertylist.cc | 12 ++--- .../graph/grin/src/property/propertytable.cc | 36 ++++++------- modules/graph/grin/src/property/topology.cc | 12 ++--- modules/graph/grin/src/property/type.cc | 20 ++++---- .../graph/grin/src/topology/adjacentlist.cc | 14 +++--- modules/graph/grin/src/topology/structure.cc | 50 +++++++++++++------ modules/graph/grin/src/topology/vertexlist.cc | 6 +-- modules/graph/test/grin_test.cc | 21 ++++++-- 17 files changed, 186 insertions(+), 138 deletions(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 561aafe95..238191929 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 561aafe9516dac163095aaa60bf2293d548ce4e7 +Subproject commit 238191929edea26cf2815ad3f1b16c9af2f1bd72 diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 5ed3695a3..41776a341 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -698,10 +698,16 @@ typedef enum { #define GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE /** @ingroup PropetyAssumptionMacros - * @brief The storage uses column store for properties. - * This enables efficient property selections for vertices and edges. + * @brief The storage uses column store for vertex properties. + * This enables efficient property selections for vertices. */ -#define GRIN_ASSUME_COLUMN_STORE +#define GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY + +/** @ingroup PropetyAssumptionMacros + * @brief The storage uses column store for edge properties. + * This enables efficient property selections for edges. +*/ +#define GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY ///@} #ifndef GRIN_DOXYGEN_SKIP @@ -721,7 +727,8 @@ typedef enum { #undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE #undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE #undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#undef GRIN_ASSUME_COLUMN_STORE +#undef GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY +#undef GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY /* StorageSpecific */ @@ -733,7 +740,8 @@ typedef enum { /* Enable the supported features */ #define GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID -#define GRIN_ASSUME_COLUMN_STORE +#define GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY +#define GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY /* End of Enable */ /* End of StorageSpecific */ diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index b4266995d..e56484ecb 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -15,7 +15,7 @@ limitations under the License. #ifdef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED bool grin_smaller_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _v1 = static_cast(v1); auto _v2 = static_cast(v2); return _g->Vertex2Gid(*_v1) < _g->Vertex2Gid(*_v2); @@ -24,7 +24,7 @@ bool grin_smaller_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { #if defined(GRIN_ASSUME_ALL_VERTEX_LIST_SORTED) && defined(GRIN_ENABLE_VERTEX_LIST_ARRAY) bool grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v, size_t& pos) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _v = static_cast(v); auto _vl = static_cast(vl); auto vtype = _g->vertex_label(*_v); diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index fea2d85b2..17a6dce93 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -19,6 +19,27 @@ limitations under the License. #ifdef GRIN_ENABLE_GRAPH_PARTITION +GRIN_PARTITIONED_GRAPH grin_get_partitioned_graph_from_storage(int argc, char** argv) { + if (argc < 2) { + return nullptr; + } + auto pg = new GRIN_PARTITIONED_GRAPH_T(); + pg->client.Connect(argv[0]); + vineyard::ObjectID obj_id; + std::stringstream ss(argv[1]); + ss >> obj_id; + pg->pg = std::dynamic_pointer_cast(pg->client.GetObject(obj_id)); + pg->lgs.resize(pg->pg->total_frag_num(), nullptr); + for (auto & [fid, location] : pg->pg->FragmentLocations()) { + if (location == pg->client.instance_id()) { + auto obj_id = pg->pg->Fragments().at(fid); + auto frag = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(pg->client.GetObject(obj_id)); + pg->lgs[fid] = frag; + } + } + return pg; +} + void grin_destroy_partitioned_graph(GRIN_PARTITIONED_GRAPH pg) { auto _pg = static_cast(pg); delete _pg; @@ -33,7 +54,7 @@ GRIN_PARTITION_LIST grin_get_local_partition_list(GRIN_PARTITIONED_GRAPH pg) { auto _pg = static_cast(pg); auto pl = new GRIN_PARTITION_LIST_T(); for (auto fid = 0; fid < _pg->pg->total_frag_num(); ++fid) { - if (_pg->lgs[fid] != nullptr) { + if (_pg->lgs[fid] != 0) { pl->push_back(fid); } } @@ -79,14 +100,16 @@ void grin_destroy_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { delete _p; } -void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { +const void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { return NULL; } GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { auto _pg = static_cast(pg); auto _p = static_cast(p); - return _pg->lgs[*_p].get(); + auto g = new GRIN_GRAPH_T(); + g->g = _pg->lgs[*_p]; + return g; } #endif diff --git a/modules/graph/grin/src/partition/reference.cc b/modules/graph/grin/src/partition/reference.cc index 428deaad9..d4b85719b 100644 --- a/modules/graph/grin/src/partition/reference.cc +++ b/modules/graph/grin/src/partition/reference.cc @@ -19,7 +19,7 @@ limitations under the License. #ifdef GRIN_ENABLE_VERTEX_REF GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _v = static_cast(v); auto gid = _g->Vertex2Gid(*_v); auto vr = new GRIN_VERTEX_REF_T(gid); @@ -32,7 +32,7 @@ void grin_destroy_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { } GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vr = static_cast(vr); auto v = new GRIN_VERTEX_T(); if (_g->Gid2Vertex(*_vr, *v)) { @@ -42,7 +42,7 @@ GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { } GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vr = static_cast(vr); auto id_parser = vineyard::IdParser(); id_parser.Init(_g->fnum(), _g->vertex_label_num()); @@ -73,13 +73,13 @@ GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH g, const char* msg) { } bool grin_is_master_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _v = static_cast(v); return _g->IsInnerVertex(*_v); } bool grin_is_mirror_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _v = static_cast(v); return _g->IsOuterVertex(*_v); } diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc index 170fc90d3..5d18705f8 100644 --- a/modules/graph/grin/src/partition/topology.cc +++ b/modules/graph/grin/src/partition/topology.cc @@ -52,7 +52,7 @@ GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); #ifdef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST GRIN_VERTEX_LIST grin_select_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vl = static_cast(vl); if (_vl->all_master_mirror > 0) return GRIN_NULL_LIST; @@ -65,7 +65,7 @@ GRIN_VERTEX_LIST grin_select_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LI } GRIN_VERTEX_LIST grin_select_mirror_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vl = static_cast(vl); if (_vl->all_master_mirror > 0) return GRIN_NULL_LIST; diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 7d2e67607..3e1f069b4 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -15,22 +15,6 @@ limitations under the License. #include "graph/grin/src/predefine.h" - -GRIN_PARTITIONED_GRAPH get_partitioned_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id) { - auto _pg = std::dynamic_pointer_cast(client.GetObject(object_id)); - auto pg = new GRIN_PARTITIONED_GRAPH_T(); - pg->pg = _pg.get(); - pg->lgs.resize(_pg->total_frag_num(), nullptr); - for (auto & [fid, location] : _pg->FragmentLocations()) { - if (location == client.instance_id()) { - auto obj_id = _pg->Fragments().at(fid); - auto frag = std::dynamic_pointer_cast>(client.GetObject(obj_id)); - pg->lgs[fid] = frag; - } - } - return pg; -} - std::string GetDataTypeName(GRIN_DATATYPE type) { switch (type) { case GRIN_DATATYPE::Int32: @@ -80,10 +64,10 @@ GRIN_DATATYPE ArrowToDataType(std::shared_ptr type) { } #ifdef GRIN_ENABLE_VERTEX_LIST -void __grin_init_vertex_list(GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { +void __grin_init_vertex_list(std::shared_ptr<_GRIN_GRAPH_T> g, GRIN_VERTEX_LIST_T* vl) { vl->offsets.clear(); vl->vrs.clear(); - GRIN_GRAPH_T::vertices_t vr; + _GRIN_GRAPH_T::vertices_t vr; vl->offsets.push_back(0); unsigned sum = 0; for (auto vtype = vl->type_begin; vtype < vl->type_end; ++vtype) { @@ -102,17 +86,17 @@ void __grin_init_vertex_list(GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { #endif #ifdef GRIN_ENABLE_ADJACENT_LIST -void __grin_init_adjacent_list(GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { +void __grin_init_adjacent_list(std::shared_ptr<_GRIN_GRAPH_T> g, GRIN_ADJACENT_LIST_T* al) { al->offsets.clear(); al->data.clear(); - GRIN_GRAPH_T::raw_adj_list_t ral; + _GRIN_GRAPH_T::raw_adj_list_t ral; al->offsets.push_back(0); unsigned sum = 0; for (auto etype = al->etype_begin; etype < al->etype_end; ++etype) { if (al->dir == GRIN_DIRECTION::IN) { - ral = g->GetIncomingRawAdjList(GRIN_GRAPH_T::vertex_t(al->vid), etype); + ral = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); } else { - ral = g->GetOutgoingRawAdjList(GRIN_GRAPH_T::vertex_t(al->vid), etype); + ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); } sum += ral.size(); al->offsets.push_back(sum); diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index ff5058b8a..91158a7fd 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -74,7 +74,6 @@ struct GRIN_DATATYPE_ENUM { static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Date64; }; -GRIN_PARTITIONED_GRAPH get_partitioned_graph_by_object_id(vineyard::Client& client, const vineyard::ObjectID& object_id); std::string GetDataTypeName(GRIN_DATATYPE); GRIN_DATATYPE ArrowToDataType(std::shared_ptr); @@ -82,18 +81,22 @@ GRIN_DATATYPE ArrowToDataType(std::shared_ptr); #define GRIN_VID_T uint64_t /* The following data types shall be defined through typedef. */ -typedef vineyard::ArrowFragment GRIN_GRAPH_T; -typedef GRIN_GRAPH_T::vertex_t GRIN_VERTEX_T; +typedef vineyard::ArrowFragment _GRIN_GRAPH_T; +struct GRIN_GRAPH_T { + vineyard::Client client; + std::shared_ptr<_GRIN_GRAPH_T> g; +}; +typedef _GRIN_GRAPH_T::vertex_t GRIN_VERTEX_T; struct GRIN_EDGE_T { - GRIN_GRAPH_T::vid_t src; - GRIN_GRAPH_T::vid_t dst; + _GRIN_GRAPH_T::vid_t src; + _GRIN_GRAPH_T::vid_t dst; GRIN_DIRECTION dir; unsigned etype; - GRIN_GRAPH_T::eid_t eid; + _GRIN_GRAPH_T::eid_t eid; }; #ifdef GRIN_WITH_VERTEX_ORIGINAL_ID -typedef GRIN_GRAPH_T::oid_t VERTEX_ORIGINAL_ID_T; +typedef _GRIN_GRAPH_T::oid_t VERTEX_ORIGINAL_ID_T; #endif #ifdef GRIN_ENABLE_VERTEX_LIST @@ -102,9 +105,9 @@ struct GRIN_VERTEX_LIST_T { unsigned type_end; unsigned all_master_mirror; std::vector offsets; - std::vector vrs; + std::vector<_GRIN_GRAPH_T::vertices_t> vrs; }; -void __grin_init_vertex_list(GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl); +void __grin_init_vertex_list(std::shared_ptr<_GRIN_GRAPH_T> g, GRIN_VERTEX_LIST_T* vl); #endif #ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR @@ -114,45 +117,46 @@ struct GRIN_VERTEX_LIST_ITERATOR_T { unsigned all_master_mirror; unsigned type_current; unsigned current; - GRIN_GRAPH_T::vertices_t vr; + _GRIN_GRAPH_T::vertices_t vr; }; #endif #ifdef GRIN_ENABLE_ADJACENT_LIST struct GRIN_ADJACENT_LIST_T { - GRIN_GRAPH_T::vid_t vid; + _GRIN_GRAPH_T::vid_t vid; GRIN_DIRECTION dir; unsigned etype_begin; unsigned etype_end; std::vector offsets; - std::vector data; + std::vector<_GRIN_GRAPH_T::raw_adj_list_t> data; }; -void __grin_init_adjacent_list(GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al); +void __grin_init_adjacent_list(std::shared_ptr<_GRIN_GRAPH_T> g, GRIN_ADJACENT_LIST_T* al); #endif #ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR struct GRIN_ADJACENT_LIST_ITERATOR_T { - GRIN_GRAPH_T::vid_t vid; + _GRIN_GRAPH_T::vid_t vid; GRIN_DIRECTION dir; unsigned etype_begin; unsigned etype_end; unsigned etype_current; unsigned current; - GRIN_GRAPH_T::raw_adj_list_t data; + _GRIN_GRAPH_T::raw_adj_list_t data; }; #endif #ifdef GRIN_ENABLE_GRAPH_PARTITION struct GRIN_PARTITIONED_GRAPH_T { - vineyard::ArrowFragmentGroup* pg; - std::vector> lgs; + vineyard::Client client; + std::shared_ptr pg; + std::vector> lgs; }; typedef unsigned GRIN_PARTITION_T; typedef std::vector GRIN_PARTITION_LIST_T; #endif #ifdef GRIN_ENABLE_VERTEX_REF -typedef GRIN_GRAPH_T::vid_t GRIN_VERTEX_REF_T; +typedef _GRIN_GRAPH_T::vid_t GRIN_VERTEX_REF_T; #endif #ifdef GRIN_WITH_VERTEX_PROPERTY @@ -162,7 +166,7 @@ typedef std::pair GRIN_VERTEX_PROPERTY_T; typedef std::vector GRIN_VERTEX_PROPERTY_LIST_T; struct GRIN_VERTEX_PROPERTY_TABLE_T { unsigned vtype; - GRIN_GRAPH_T::vertices_t vertices; + _GRIN_GRAPH_T::vertices_t vertices; }; #endif diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 000e31a55..27ab644b6 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -15,7 +15,7 @@ limitations under the License. #ifdef GRIN_WITH_VERTEX_PROPERTY_NAME const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vp = static_cast(vp); auto s = _g->schema().GetVertexPropertyName(_vp->first, _vp->second); int len = s.length() + 1; @@ -26,7 +26,7 @@ const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, const char* name) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vtype = static_cast(vtype); auto s = std::string(name); auto vp = new GRIN_VERTEX_PROPERTY_T(*_vtype, _g->schema().GetVertexPropertyId(*_vtype, s)); @@ -34,7 +34,7 @@ GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_ } GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const char* name) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto s = std::string(name); auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { @@ -49,7 +49,7 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const #ifdef GRIN_WITH_EDGE_PROPERTY_NAME const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _ep = static_cast(ep); auto s = _g->schema().GetEdgePropertyName(_ep->first, _ep->second); int len = s.length() + 1; @@ -60,7 +60,7 @@ const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, const char* name) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _etype = static_cast(etype); auto s = std::string(name); auto ep = new GRIN_EDGE_PROPERTY_T(*_etype, _g->schema().GetEdgePropertyId(*_etype, s)); @@ -68,7 +68,7 @@ GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH g, GRIN_EDGE_TYPE e } GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH g, const char* name) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto s = std::string(name); auto epl = new GRIN_EDGE_PROPERTY_LIST_T(); for (auto etype = 0; etype < _g->edge_label_num(); ++etype) { @@ -95,7 +95,7 @@ void grin_destroy_vertex_property(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { } GRIN_DATATYPE grin_get_vertex_property_data_type(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vp = static_cast(vp); auto dt = _g->schema().GetVertexPropertyType(_vp->first, _vp->second); return ArrowToDataType(dt); @@ -122,7 +122,7 @@ void grin_destroy_edge_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { } GRIN_DATATYPE grin_get_edge_property_data_type(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _ep = static_cast(ep); auto dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); return ArrowToDataType(dt); diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index aa515e74f..25fc2c1f2 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -15,7 +15,7 @@ limitations under the License. #ifdef GRIN_WITH_VERTEX_PROPERTY GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_property_list_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vtype = static_cast(vtype); auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); for (auto p = 0; p < _g->vertex_property_num(*_vtype); ++p) { @@ -72,7 +72,7 @@ GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_GRAPH g, GRIN_VERTEX_TY #ifdef GRIN_WITH_EDGE_PROPERTY GRIN_EDGE_PROPERTY_LIST grin_get_edge_property_list_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _etype = static_cast(etype); auto epl = new GRIN_EDGE_PROPERTY_LIST_T(); for (auto p = 0; p < _g->edge_property_num(*_etype); ++p) { @@ -127,9 +127,9 @@ GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH g, GRIN_EDGE_TYPE ety #endif -// #if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) +// #if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY) // GRIN_GRAPH grin_select_vertex_properties(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl) { -// auto _g = static_cast(g); +// auto _g = static_cast(g)->g; // auto _vpl = static_cast(vpl); // std::map> vertices, edges; // for (auto& p: *_vpl) { @@ -147,9 +147,9 @@ GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH g, GRIN_EDGE_TYPE ety // } // #endif -// #if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE) +// #if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY) // GRIN_GRAPH grin_select_edge_properteis(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl) { -// auto _g = static_cast(g); +// auto _g = static_cast(g)->g; // auto _epl = static_cast(epl); // std::map> vertices, edges; // for (auto& p: *_epl) { diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 0e5a82779..24d84b505 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -51,36 +51,36 @@ GRIN_ROW grin_create_row(GRIN_GRAPH g) { return r; } -bool grin_insert_value_to_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, void* value) { +bool grin_insert_value_to_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, const void* value) { auto _r = static_cast(r); void* _value = NULL; switch (dt) { case GRIN_DATATYPE::Int32: - _value = new int32_t(*static_cast(value)); + _value = new int32_t(*static_cast(value)); break; case GRIN_DATATYPE::UInt32: - _value = new uint32_t(*static_cast(value)); + _value = new uint32_t(*static_cast(value)); break; case GRIN_DATATYPE::Int64: - _value = new int64_t(*static_cast(value)); + _value = new int64_t(*static_cast(value)); break; case GRIN_DATATYPE::UInt64: - _value = new uint64_t(*static_cast(value)); + _value = new uint64_t(*static_cast(value)); break; case GRIN_DATATYPE::Float: - _value = new float(*static_cast(value)); + _value = new float(*static_cast(value)); break; case GRIN_DATATYPE::Double: - _value = new double(*static_cast(value)); + _value = new double(*static_cast(value)); break; case GRIN_DATATYPE::String: - _value = new std::string(*static_cast(value)); + _value = new std::string(*static_cast(value)); break; case GRIN_DATATYPE::Date32: - _value = new int32_t(*static_cast(value)); + _value = new int32_t(*static_cast(value)); break; case GRIN_DATATYPE::Date64: - _value = new int64_t(*static_cast(value)); + _value = new int64_t(*static_cast(value)); break; default: _value = NULL; @@ -98,7 +98,7 @@ void grin_destroy_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE } GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vtype = static_cast(vtype); auto vpt = new GRIN_VERTEX_PROPERTY_TABLE_T(); vpt->vtype = *_vtype; @@ -108,7 +108,7 @@ GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); auto _vp = static_cast(vp); @@ -123,7 +123,7 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ #if defined(GRIN_ENABLE_VERTEX_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY_LIST vpl) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); auto _vpl = static_cast(vpl); @@ -141,7 +141,7 @@ GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPE } #endif -#if !defined(GRIN_ASSUME_COLUMN_STORE) && defined(GRIN_ENABLE_ROW) +#if !defined(GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY) && defined(GRIN_ENABLE_ROW) /** * @brief get vertex row directly from the graph, this API only works for row store system * @param GRIN_GRAPH the graph @@ -158,7 +158,7 @@ void grin_destroy_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept } GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _etype = static_cast(etype); auto ept = new GRIN_EDGE_PROPERTY_TABLE_T(); ept->etype = *_etype; @@ -168,7 +168,7 @@ GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH g, GRIN const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); auto _ep = static_cast(ep); @@ -183,7 +183,7 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP #if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY_LIST epl) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); auto _epl = static_cast(epl); @@ -201,7 +201,7 @@ GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_ } #endif -#if !defined(GRIN_ASSUME_COLUMN_STORE) && defined(GRIN_ENABLE_ROW) +#if !defined(GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY) && defined(GRIN_ENABLE_ROW) /** * @brief get edge row directly from the graph, this API only works for row store system * @param GRIN_GRAPH the graph diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index 69b4a7d3d..d45103331 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -16,7 +16,7 @@ limitations under the License. #ifdef GRIN_WITH_VERTEX_PROPERTY size_t grin_get_vertex_num_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vtype = static_cast(vtype); return _g->GetVerticesNum(*_vtype); } @@ -24,7 +24,7 @@ size_t grin_get_vertex_num_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { #ifdef GRIN_WITH_EDGE_PROPERTY size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _etype = static_cast(etype); return _g->edge_data_table(*_etype)->num_rows(); } @@ -50,10 +50,10 @@ size_t grin_get_total_edge_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_EDGE_TYPE #ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_ORIGINAL_ID oid) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vtype = static_cast(vtype); auto _oid = static_cast(oid); - GRIN_GRAPH_T::vid_t gid; + _GRIN_GRAPH_T::vid_t gid; auto v = new GRIN_VERTEX_T(); if (_g->Oid2Gid(*_vtype, *_oid, gid)) { if (_g->Gid2Vertex(gid, *v)) { @@ -66,7 +66,7 @@ GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_T #ifdef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST GRIN_VERTEX_LIST grin_select_type_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_LIST vl) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vtype = static_cast(vtype); auto _vl = static_cast(vl); @@ -91,7 +91,7 @@ GRIN_ADJACENT_LIST grin_select_neighbor_type_for_adjacent_list(GRIN_GRAPH, GRIN_ #ifdef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST GRIN_ADJACENT_LIST grin_select_edge_type_for_adjacent_list(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_ADJACENT_LIST al) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _etype = static_cast(etype); auto _al = static_cast(al); diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index b5c6cc4af..0856a7c98 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -21,7 +21,7 @@ bool grin_equal_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt1, GRIN_VERTEX_TYPE } GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _v = static_cast(v); auto vt = new GRIN_VERTEX_TYPE_T(_g->vertex_label(*_v)); return vt; @@ -33,7 +33,7 @@ void grin_destroy_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { } GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH g) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); for (auto i = 0; i < _g->vertex_label_num(); ++i) { vtl->push_back(i); @@ -72,7 +72,7 @@ GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE_L #ifdef GRIN_WITH_VERTEX_TYPE_NAME const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vt = static_cast(vt); auto s = _g->schema().GetVertexLabelName(*_vt); int len = s.length() + 1; @@ -82,7 +82,7 @@ const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { } GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto s = std::string(name); auto vt = new GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(s)); return vt; @@ -121,7 +121,7 @@ void grin_destroy_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { } GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH g) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto etl = new GRIN_EDGE_TYPE_LIST_T(); for (auto i = 0; i < _g->edge_label_num(); ++i) { etl->push_back(i); @@ -160,7 +160,7 @@ GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST et #ifdef GRIN_WITH_EDGE_TYPE_NAME const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _et = static_cast(et); auto s = _g->schema().GetEdgeLabelName(*_et); int len = s.length() + 1; @@ -170,7 +170,7 @@ const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { } GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto s = std::string(name); auto et = new GRIN_EDGE_TYPE_T(_g->schema().GetEdgeLabelId(s)); return et; @@ -193,7 +193,7 @@ GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_GRAPH g, GRIN_EDGE_TYPE_ID eti) { #if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_WITH_EDGE_PROPERTY) GRIN_VERTEX_TYPE_LIST grin_get_src_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _etype = static_cast(etype); auto entry = _g->schema().GetEntry(*_etype, "EDGE"); auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); @@ -204,7 +204,7 @@ GRIN_VERTEX_TYPE_LIST grin_get_src_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_ } GRIN_VERTEX_TYPE_LIST grin_get_dst_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _etype = static_cast(etype); auto entry = _g->schema().GetEntry(*_etype, "EDGE"); auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); @@ -216,7 +216,7 @@ GRIN_VERTEX_TYPE_LIST grin_get_dst_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_ GRIN_EDGE_TYPE_LIST grin_get_edge_types_from_vertex_type_pair(GRIN_GRAPH g, GRIN_VERTEX_TYPE src_vt, GRIN_VERTEX_TYPE dst_vt) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _v1 = static_cast(src_vt); auto _v2 = static_cast(dst_vt); auto str_v1 = _g->schema().GetVertexLabelName(*_v1); diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index b2e3f70d8..f17cd8a1b 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -19,7 +19,7 @@ limitations under the License. #ifdef GRIN_ENABLE_ADJACENT_LIST GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_VERTEX v) { if (d == GRIN_DIRECTION::BOTH) return GRIN_NULL_LIST; - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _v = static_cast(v); auto al = new GRIN_ADJACENT_LIST_T(); al->vid = _v->GetValue(); @@ -79,7 +79,7 @@ GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, #ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _al = static_cast(al); auto ali = new GRIN_ADJACENT_LIST_ITERATOR_T(); ali->vid = _al->vid; @@ -89,9 +89,9 @@ GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH g, GRIN_ADJA ali->etype_current = _al->etype_begin; ali->current = 0; if (ali->dir == GRIN_DIRECTION::IN) { - ali->data = _g->GetIncomingRawAdjList(GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); + ali->data = _g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); } else { - ali->data = _g->GetOutgoingRawAdjList(GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); + ali->data = _g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); } return ali; } @@ -102,7 +102,7 @@ void grin_destroy_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR a } void grin_get_next_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _ali = static_cast(ali); _ali->current++; while (_ali->etype_current < _ali->etype_end) { @@ -110,9 +110,9 @@ void grin_get_next_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR _ali->etype_current++; _ali->current = 0; if (_ali->dir == GRIN_DIRECTION::IN) { - _ali->data = _g->GetIncomingRawAdjList(GRIN_GRAPH_T::vertex_t(_ali->vid), _ali->etype_current); + _ali->data = _g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(_ali->vid), _ali->etype_current); } else { - _ali->data = _g->GetOutgoingRawAdjList(GRIN_GRAPH_T::vertex_t(_ali->vid), _ali->etype_current); + _ali->data = _g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(_ali->vid), _ali->etype_current); } } } diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index b062d4981..6b99fa30c 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -16,22 +16,40 @@ limitations under the License. #include "graph/grin/src/predefine.h" #include "graph/grin/include/topology/structure.h" +GRIN_GRAPH grin_get_graph_from_storage(int argc, char** argv) { + if (argc < 2) { + return nullptr; + } + auto g = new GRIN_GRAPH_T(); + g->client.Connect(argv[0]); + vineyard::ObjectID obj_id; + std::stringstream ss(argv[1]); + ss >> obj_id; + g->g = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(g->client.GetObject(obj_id)); + return g; +} + +void grin_destroy_graph(GRIN_GRAPH g) { + auto _g = static_cast(g); + delete _g; +} + #if !defined(GRIN_ASSUME_GRAPH_DIRECTED) && !defined(GRIN_ASSUME_GRAPH_UNDIRECTED) bool grin_is_directed(GRIN_GRAPH g) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; return _g->directed(); } #endif #ifndef GRIN_ASSUME_GRAPH_SINGLE_EDGE bool grin_is_multigraph(GRIN_GRAPH g) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; return _g->is_multigraph(); } #endif size_t grin_get_vertex_num(GRIN_GRAPH g) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; size_t result = 0; for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { result += _g->GetVerticesNum(vtype); @@ -40,7 +58,7 @@ size_t grin_get_vertex_num(GRIN_GRAPH g) { } size_t grin_get_edge_num(GRIN_GRAPH g) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; return _g->GetEdgeNum(); } @@ -51,7 +69,7 @@ void grin_destroy_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { } bool grin_equal_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _v1 = static_cast(v1); auto _v2 = static_cast(v2); return _g->Vertex2Gid(*_v1) == _g->Vertex2Gid(*_v2); @@ -70,7 +88,7 @@ GRIN_DATATYPE grin_get_vertex_original_id_type(GRIN_GRAPH g) { GRIN_VERTEX_ORIGINAL_ID grin_get_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _v = static_cast(v); auto gid = _g->Vertex2Gid(*_v); auto oid = new VERTEX_ORIGINAL_ID_T(_g->Gid2Oid(gid)); @@ -83,34 +101,34 @@ GRIN_VERTEX grin_get_vertex_from_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID #endif // Data -void grin_destroy_value(GRIN_GRAPH g, GRIN_DATATYPE dt, void* value) { +void grin_destroy_value(GRIN_GRAPH g, GRIN_DATATYPE dt, const void* value) { switch (dt) { case GRIN_DATATYPE::Int32: - delete static_cast(value); + delete static_cast(value); break; case GRIN_DATATYPE::UInt32: - delete static_cast(value); + delete static_cast(value); break; case GRIN_DATATYPE::Int64: - delete static_cast(value); + delete static_cast(value); break; case GRIN_DATATYPE::UInt64: - delete static_cast(value); + delete static_cast(value); break; case GRIN_DATATYPE::Float: - delete static_cast(value); + delete static_cast(value); break; case GRIN_DATATYPE::Double: - delete static_cast(value); + delete static_cast(value); break; case GRIN_DATATYPE::String: - delete static_cast(value); + delete static_cast(value); break; case GRIN_DATATYPE::Date32: - delete static_cast(value); + delete static_cast(value); break; case GRIN_DATATYPE::Date64: - delete static_cast(value); + delete static_cast(value); break; default: break; diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index b662cbc87..dfbb627ba 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -18,7 +18,7 @@ limitations under the License. #ifdef GRIN_ENABLE_VERTEX_LIST GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto vl = new GRIN_VERTEX_LIST_T(); vl->type_begin = 0; vl->type_end = _g->vertex_label_num(); @@ -51,7 +51,7 @@ GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t #ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vl = static_cast(vl); auto vli = new GRIN_VERTEX_LIST_ITERATOR_T(); vli->type_begin = _vl->type_begin; @@ -75,7 +75,7 @@ void grin_destroy_vertex_list_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) } void grin_get_next_vertex_list_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { - auto _g = static_cast(g); + auto _g = static_cast(g)->g; auto _vli = static_cast(vli); _vli->current++; while (_vli->type_current < _vli->type_end) { diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index 576b37641..1840de3eb 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -35,7 +35,6 @@ limitations under the License. #include "graph/grin/include/property/property.h" #include "graph/grin/include/property/propertytable.h" -#include "graph/grin/src/predefine.h" #include "graph/fragment/graph_schema.h" #include "graph/loader/arrow_fragment_loader.h" @@ -59,7 +58,6 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part Then for each of these vertices, we send the value of the "features" property to its master partition. */ GRIN_GRAPH g = grin_get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition - auto _g = static_cast(g); GRIN_EDGE_TYPE etype = grin_get_edge_type_by_name(g, edge_type_name); // get edge type from name @@ -120,11 +118,20 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part } -void Traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, +void Traverse(std::string ipc_socket, const grape::CommSpec& comm_spec, vineyard::ObjectID fragment_group_id) { LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; - GRIN_PARTITIONED_GRAPH pg = get_partitioned_graph_by_object_id(client, fragment_group_id); + std::string fg_id_str = std::to_string(fragment_group_id); + + char** argv = new char*[2]; + argv[0] = new char[ipc_socket.length() + 1]; + argv[1] = new char[fg_id_str.length() + 1]; + + strcpy(argv[0], ipc_socket.c_str()); + strcpy(argv[1], fg_id_str.c_str()); + + GRIN_PARTITIONED_GRAPH pg = grin_get_partitioned_graph_from_storage(2, argv); GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); size_t pnum = grin_get_partition_list_size(pg, local_partitions); @@ -136,6 +143,10 @@ void Traverse(vineyard::Client& client, const grape::CommSpec& comm_spec, GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); LOG(INFO) << "Partition: " << *(static_cast(partition)); sync_property(pg, partition, "knows", "value3"); + + delete[] argv[0]; + delete[] argv[1]; + delete[] argv; } @@ -233,7 +244,7 @@ int main(int argc, char** argv) { client, comm_spec, vtables, etables, directed != 0, true, true); vineyard::ObjectID fragment_group_id = loader->LoadFragmentAsFragmentGroup().value(); - Traverse(client, comm_spec, fragment_group_id); + Traverse(ipc_socket, comm_spec, fragment_group_id); } } grape::FinalizeMPIComm(); From 102ec98693c0f5281cf7d75f102e27a6fdc05c84 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 29 Mar 2023 19:40:28 +0800 Subject: [PATCH 40/85] refine get value from property table --- .../graph/grin/src/property/propertytable.cc | 52 +++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 24d84b505..276918014 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -107,7 +107,7 @@ GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, } const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, - GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); @@ -116,7 +116,30 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ auto offset = _v->GetValue() - _vpt->vertices.begin_value(); auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); - return result; + auto _dt = _g->schema().GetVertexPropertyType(_vp->first, _vp->second); + auto dt = ArrowToDataType(_dt); + switch (dt) { + case GRIN_DATATYPE::Int32: + return new int32_t(*(const int32_t*)(result)); + case GRIN_DATATYPE::UInt32: + return new uint32_t(*(const uint32_t*)(result)); + case GRIN_DATATYPE::Int64: + return new int64_t(*(const int64_t*)(result)); + case GRIN_DATATYPE::UInt64: + return new uint64_t(*(const uint64_t*)(result)); + case GRIN_DATATYPE::Float: + return new float(*(const float*)(result)); + case GRIN_DATATYPE::Double: + return new double(*(const double*)(result)); + case GRIN_DATATYPE::String: + return new std::string(*(const std::string*)(result)); + case GRIN_DATATYPE::Date32: + return new int32_t(*(const int32_t*)(result)); + case GRIN_DATATYPE::Date64: + return new int64_t(*(const int64_t*)(result)); + default: + return NULL; + } } #endif @@ -176,7 +199,30 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP auto offset = _e->eid; auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); - return result; + auto _dt = _g->schema().GetVertexPropertyType(_ep->first, _ep->second); + auto dt = ArrowToDataType(_dt); + switch (dt) { + case GRIN_DATATYPE::Int32: + return new int32_t(*(const int32_t*)(result)); + case GRIN_DATATYPE::UInt32: + return new uint32_t(*(const uint32_t*)(result)); + case GRIN_DATATYPE::Int64: + return new int64_t(*(const int64_t*)(result)); + case GRIN_DATATYPE::UInt64: + return new uint64_t(*(const uint64_t*)(result)); + case GRIN_DATATYPE::Float: + return new float(*(const float*)(result)); + case GRIN_DATATYPE::Double: + return new double(*(const double*)(result)); + case GRIN_DATATYPE::String: + return new std::string(*(const std::string*)(result)); + case GRIN_DATATYPE::Date32: + return new int32_t(*(const int32_t*)(result)); + case GRIN_DATATYPE::Date64: + return new int64_t(*(const int64_t*)(result)); + default: + return NULL; + } } #endif From a17798af93eb587dbb72e64f003c04038d8de119 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Thu, 30 Mar 2023 16:09:08 +0800 Subject: [PATCH 41/85] refine type cast --- .../graph/grin/src/property/propertytable.cc | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 276918014..525390c4d 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -23,23 +23,23 @@ const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, auto _r = static_cast(r); switch (dt) { case GRIN_DATATYPE::Int32: - return new int32_t(*(const int32_t*)((*_r)[idx])); + return new int32_t(*static_cast((*_r)[idx])); case GRIN_DATATYPE::UInt32: - return new uint32_t(*(const uint32_t*)((*_r)[idx])); + return new uint32_t(*static_cast((*_r)[idx])); case GRIN_DATATYPE::Int64: - return new int64_t(*(const int64_t*)((*_r)[idx])); + return new int64_t(*static_cast((*_r)[idx])); case GRIN_DATATYPE::UInt64: - return new uint64_t(*(const uint64_t*)((*_r)[idx])); + return new uint64_t(*static_cast((*_r)[idx])); case GRIN_DATATYPE::Float: - return new float(*(const float*)((*_r)[idx])); + return new float(*static_cast((*_r)[idx])); case GRIN_DATATYPE::Double: - return new double(*(const double*)((*_r)[idx])); + return new double(*static_cast((*_r)[idx])); case GRIN_DATATYPE::String: - return new std::string(*(const std::string*)((*_r)[idx])); + return new std::string(*static_cast((*_r)[idx])); case GRIN_DATATYPE::Date32: - return new int32_t(*(const int32_t*)((*_r)[idx])); + return new int32_t(*static_cast((*_r)[idx])); case GRIN_DATATYPE::Date64: - return new int64_t(*(const int64_t*)((*_r)[idx])); + return new int64_t(*static_cast((*_r)[idx])); default: return NULL; } @@ -120,23 +120,23 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ auto dt = ArrowToDataType(_dt); switch (dt) { case GRIN_DATATYPE::Int32: - return new int32_t(*(const int32_t*)(result)); + return new int32_t(*static_cast(result)); case GRIN_DATATYPE::UInt32: - return new uint32_t(*(const uint32_t*)(result)); + return new uint32_t(*static_cast(result)); case GRIN_DATATYPE::Int64: - return new int64_t(*(const int64_t*)(result)); + return new int64_t(*static_cast(result)); case GRIN_DATATYPE::UInt64: - return new uint64_t(*(const uint64_t*)(result)); + return new uint64_t(*static_cast(result)); case GRIN_DATATYPE::Float: - return new float(*(const float*)(result)); + return new float(*static_cast(result)); case GRIN_DATATYPE::Double: - return new double(*(const double*)(result)); + return new double(*static_cast(result)); case GRIN_DATATYPE::String: - return new std::string(*(const std::string*)(result)); + return new std::string(*static_cast(result)); case GRIN_DATATYPE::Date32: - return new int32_t(*(const int32_t*)(result)); + return new int32_t(*static_cast(result)); case GRIN_DATATYPE::Date64: - return new int64_t(*(const int64_t*)(result)); + return new int64_t(*static_cast(result)); default: return NULL; } @@ -203,23 +203,23 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP auto dt = ArrowToDataType(_dt); switch (dt) { case GRIN_DATATYPE::Int32: - return new int32_t(*(const int32_t*)(result)); + return new int32_t(*static_cast(result)); case GRIN_DATATYPE::UInt32: - return new uint32_t(*(const uint32_t*)(result)); + return new uint32_t(*static_cast(result)); case GRIN_DATATYPE::Int64: - return new int64_t(*(const int64_t*)(result)); + return new int64_t(*static_cast(result)); case GRIN_DATATYPE::UInt64: - return new uint64_t(*(const uint64_t*)(result)); + return new uint64_t(*static_cast(result)); case GRIN_DATATYPE::Float: - return new float(*(const float*)(result)); + return new float(*static_cast(result)); case GRIN_DATATYPE::Double: - return new double(*(const double*)(result)); + return new double(*static_cast(result)); case GRIN_DATATYPE::String: - return new std::string(*(const std::string*)(result)); + return new std::string(*static_cast(result)); case GRIN_DATATYPE::Date32: - return new int32_t(*(const int32_t*)(result)); + return new int32_t(*static_cast(result)); case GRIN_DATATYPE::Date64: - return new int64_t(*(const int64_t*)(result)); + return new int64_t(*static_cast(result)); default: return NULL; } From 86d8b371864aa5d74feb074bc02cde0d27e413a6 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 31 Mar 2023 10:55:12 +0800 Subject: [PATCH 42/85] remove limits.h --- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 5 ++--- modules/graph/grin/src/index/order.cc | 12 +++++------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 238191929..d6eaa956e 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 238191929edea26cf2815ad3f1b16c9af2f1bd72 +Subproject commit d6eaa956eba8897c79fd66cb2794c5992702d7f2 diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 41776a341..8bf7bdb3b 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -28,7 +28,6 @@ limitations under the License. #ifndef GRIN_INCLUDE_PREDEFINE_H_ #define GRIN_INCLUDE_PREDEFINE_H_ -#include #include #include @@ -974,9 +973,9 @@ typedef enum { /** @brief Null row (invalid return value) */ #define GRIN_NULL_ROW NULL /** @brief Null natural id of any kind (invalid return value) */ -#define GRIN_NULL_NATURAL_ID UINT_MAX +#define GRIN_NULL_NATURAL_ID (unsigned)~0 /** @brief Null size (invalid return value) */ -#define GRIN_NULL_SIZE UINT_MAX +#define GRIN_NULL_SIZE (unsigned)~0 ///@} diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index e56484ecb..886e850f0 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -23,18 +23,16 @@ bool grin_smaller_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { #endif #if defined(GRIN_ASSUME_ALL_VERTEX_LIST_SORTED) && defined(GRIN_ENABLE_VERTEX_LIST_ARRAY) -bool grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v, size_t& pos) { +size_t grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v) { auto _g = static_cast(g)->g; auto _v = static_cast(v); auto _vl = static_cast(vl); auto vtype = _g->vertex_label(*_v); - if (vtype < _vl->type_begin || vtype >= _vl->type_end) return false; - pos = 0; + if (vtype < _vl->type_begin || vtype >= _vl->type_end) return GRIN_NULL_SIZE; auto offset = _v->GetValue() - _vl->vrs[vtype - _vl->type_begin].begin_value(); if (offset < _vl->vrs[vtype - _vl->type_begin].size()) { - pos = _vl->offsets[vtype - _vl->type_begin] + offset; - return true; + return _vl->offsets[vtype - _vl->type_begin] + offset; } - return false; -}; + return GRIN_NULL_SIZE; +} #endif From 1716bba63ea81f70c3972a3b2719fa7bc35b5a97 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Fri, 31 Mar 2023 16:09:52 +0800 Subject: [PATCH 43/85] add rust gen and reorg predefine.h --- modules/graph/grin/.gitignore | 3 +- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 352 ++----- modules/graph/grin/rust/Cargo.toml | 83 ++ modules/graph/grin/rust/grin_v6d.rs | 945 +++++++++++++++++++ modules/graph/grin/rust/parse.py | 166 ++++ modules/graph/grin/rust/v6d_all.h | 17 + modules/graph/grin/src/predefine.h | 2 +- modules/graph/grin/src/topology/structure.cc | 8 +- 9 files changed, 1319 insertions(+), 259 deletions(-) create mode 100644 modules/graph/grin/rust/Cargo.toml create mode 100644 modules/graph/grin/rust/grin_v6d.rs create mode 100644 modules/graph/grin/rust/parse.py create mode 100644 modules/graph/grin/rust/v6d_all.h diff --git a/modules/graph/grin/.gitignore b/modules/graph/grin/.gitignore index d172bac81..c116ba07d 100644 --- a/modules/graph/grin/.gitignore +++ b/modules/graph/grin/.gitignore @@ -1,3 +1,2 @@ /docs/_build/ -/docs/Doxyfile.bak -/rust \ No newline at end of file +/docs/Doxyfile.bak \ No newline at end of file diff --git a/modules/graph/grin/include b/modules/graph/grin/include index d6eaa956e..752060c94 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit d6eaa956eba8897c79fd66cb2794c5992702d7f2 +Subproject commit 752060c94e82dd24e000b37ecf3ceba30784d600 diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 8bf7bdb3b..ec2ce7dfc 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -61,18 +61,18 @@ typedef enum { /** @ingroup TopologyMacros * @brief The storage only support directed graphs. */ -#define GRIN_ASSUME_GRAPH_DIRECTED +#define GRIN_ASSUME_HAS_DIRECTED_GRAPH /** @ingroup TopologyMacros * @brief The storage only support undirected graphs. */ -#define GRIN_ASSUME_GRAPH_UNDIRECTED +#define GRIN_ASSUME_HAS_UNDIRECTED_GRAPH /** @ingroup TopologyMacros * @brief The storage only support graphs with single * edge between a pair of vertices. */ -#define GRIN_ASSUME_GRAPH_SINGLE_EDGE +#define GRIN_ASSUME_HAS_MULTI_EDGE_GRAPH /** @ingroup TopologyMacros * @brief There is original ID for a vertex. @@ -148,37 +148,39 @@ typedef enum { #ifndef GRIN_DOXYGEN_SKIP -/* StorageSpecific */ - -/* Disable the unsupported features */ -#undef GRIN_ASSUME_GRAPH_DIRECTED -#undef GRIN_ASSUME_GRAPH_UNDIRECTED -#undef GRIN_ASSUME_GRAPH_SINGLE_EDGE +// GRIN_DEFAULT_DISABLE +#undef GRIN_ASSUME_HAS_DIRECTED_GRAPH +#undef GRIN_ASSUME_HAS_UNDIRECTED_GRAPH +#undef GRIN_ASSUME_HAS_MULTI_EDGE_GRAPH +#undef GRIN_WITH_VERTEX_ORIGINAL_ID #undef GRIN_WITH_VERTEX_DATA #undef GRIN_WITH_EDGE_DATA -#undef GRIN_ENABLE_EDGE_LIST -#undef GRIN_ENABLE_EDGE_LIST_ITERATOR -/* End of Disable */ - -/* Enable the supported features */ -/* End of Enable */ - -/* End of StorageSpecific */ - -#ifndef GRIN_ENABLE_VERTEX_LIST +#undef GRIN_ENABLE_VERTEX_LIST #undef GRIN_ENABLE_VERTEX_LIST_ARRAY #undef GRIN_ENABLE_VERTEX_LIST_ITERATOR -#endif - -#ifndef GRIN_ENABLE_EDGE_LIST +#undef GRIN_ENABLE_EDGE_LIST #undef GRIN_ENABLE_EDGE_LIST_ARRAY #undef GRIN_ENABLE_EDGE_LIST_ITERATOR -#endif - -#ifndef GRIN_ENABLE_ADJACENT_LIST +#undef GRIN_ENABLE_ADJACENT_LIST #undef GRIN_ENABLE_ADJACENT_LIST_ARRAY #undef GRIN_ENABLE_ADJACENT_LIST_ITERATOR -#endif +// GRIN_END + +// GRIN_STORAGE_ENABLE +#define GRIN_ASSUME_HAS_DIRECTED_GRAPH +#define GRIN_ASSUME_HAS_UNDIRECTED_GRAPH +#define GRIN_ASSUME_HAS_MULTI_EDGE_GRAPH +#define GRIN_WITH_VERTEX_ORIGINAL_ID +#define GRIN_ENABLE_VERTEX_LIST +#define GRIN_ENABLE_VERTEX_LIST_ARRAY +#define GRIN_ENABLE_VERTEX_LIST_ITERATOR +#define GRIN_ENABLE_ADJACENT_LIST +#define GRIN_ENABLE_ADJACENT_LIST_ARRAY +#define GRIN_ENABLE_ADJACENT_LIST_ITERATOR +// GRIN_END + +// GRIN_FEATURE_DEPENDENCY +// GRIN_END #endif // GRIN_DOXYGEN_SKIP /* End of Section 1 */ @@ -360,7 +362,11 @@ typedef enum { ///@} #ifndef GRIN_DOXYGEN_SKIP -// disable GRIN_ASSUME by default +// GRIN_DEFAULT_DISABLE +#undef GRIN_ENABLE_GRAPH_PARTITION +#undef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION +#undef GRIN_ENABLE_VERTEX_REF +#undef GRIN_ENABLE_EDGE_REF #undef GRIN_ASSUME_EDGE_CUT_PARTITION #undef GRIN_ASSUME_VERTEX_CUT_PARTITION #undef GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE @@ -369,25 +375,27 @@ typedef enum { #undef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE #undef GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE #undef GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE - -/* StorageSpecific */ - -/* Disable the unsupported features */ -#undef GRIN_ASSUME_VERTEX_CUT_PARTITION -#undef GRIN_ENABLE_EDGE_REF #undef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST #undef GRIN_TRAIT_MIRROR_VERTEX_MIRROR_PARTITION_LIST +#undef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST +#undef GRIN_TRAIT_MIRROR_EDGE_MIRROR_PARTITION_LIST +#undef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST #undef GRIN_TRAIT_SELECT_PARTITION_FOR_VERTEX_LIST +#undef GRIN_TRAIT_SELECT_MASTER_FOR_EDGE_LIST +#undef GRIN_TRAIT_SELECT_PARTITION_FOR_EDGE_LIST #undef GRIN_TRAIT_SELECT_MASTER_NEIGHBOR_FOR_ADJACENT_LIST #undef GRIN_TRAIT_SELECT_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST -/* End of Disable */ +// GRIN_END -/* Enable the supported features */ -#define GRIN_ASSUME_EDGE_CUT_PARTITION -/* End of Enable */ - -/* End of StorageSpecific */ +// GRIN_STORAGE_ENABLE +#define GRIN_ENABLE_GRAPH_PARTITION +#define GRIN_TRAIT_NATURAL_ID_FOR_PARTITION +#define GRIN_ENABLE_VERTEX_REF +#define GRIN_ASSUME_EDGE_CUT_PARTITION +#define GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST +// GRIN_END +// GRIN_FEATURE_DEPENDENCY #ifdef GRIN_ASSUME_EDGE_CUT_PARTITION #define GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE #define GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE @@ -399,65 +407,8 @@ typedef enum { #define GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE #define GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST #endif +// GRIN_END -#ifndef GRIN_ENABLE_GRAPH_PARTITION -#undef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION -#undef GRIN_ENABLE_VERTEX_REF -#undef GRIN_ENABLE_EDGE_REF -#undef GRIN_ASSUME_EDGE_CUT_PARTITION -#undef GRIN_ASSUME_VERTEX_CUT_PARTITION -#endif - -#ifndef GRIN_ENABLE_VERTEX_REF // enable vertex pref is the prerequisite -#undef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST -#undef GRIN_TRAIT_MIRROR_VERTEX_MIRROR_PARTITION_LIST -#undef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST -#endif - -#ifndef GRIN_ENABLE_EDGE_REF // enable edge pref is the prerequisite -#undef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST -#undef GRIN_TRAIT_MIRROR_EDGE_MIRROR_PARTITION_LIST -#undef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_TRAIT_SELECT_MASTER_FOR_EDGE_LIST -#endif - -#ifndef GRIN_WITH_VERTEX_DATA // enable vertex data is the prerequisite -#undef GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#endif - -#ifndef GRIN_WITH_EDGE_DATA // enable edge data is the prerequisite -#undef GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE -#endif - -#ifndef GRIN_ENABLE_VERTEX_LIST // enable vertex list iterator is the prerequisite -#undef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST -#undef GRIN_TRAIT_SELECT_PARTITION_FOR_VERTEX_LIST -#endif - -#ifndef GRIN_ENABLE_EDGE_LIST // enable edge list iterator is the prerequisite -#undef GRIN_TRAIT_SELECT_MASTER_FOR_EDGE_LIST -#undef GRIN_TRAIT_SELECT_PARTITION_FOR_EDGE_LIST -#endif - -#ifndef GRIN_ENABLE_ADJACENT_LIST // enable adjacent list iterator is the prerequisite -#undef GRIN_TRAIT_SELECT_MASTER_NEIGHBOR_FOR_ADJACENT_LIST -#undef GRIN_TRAIT_SELECT_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST -#endif - -#ifdef GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#endif - -#ifdef GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE -#endif - -#ifdef GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#endif #endif // GRIN_DOXY_SKIP /* End of Section 2 */ @@ -709,58 +660,10 @@ typedef enum { #define GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY ///@} -#ifndef GRIN_DOXYGEN_SKIP -// disable GRIN_ASSUME by default -#undef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID -#undef GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#undef GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY -#undef GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY - -/* StorageSpecific */ - -/* Disable the unsupported features */ -#undef GRIN_ENABLE_VERTEX_PRIMARY_KEYS -#undef GRIN_ENABLE_EDGE_PRIMARY_KEYS -#undef GRIN_TRAIT_SELECT_NEIGHBOR_TYPE_FOR_ADJACENT_LIST -/* End of Disable */ - -/* Enable the supported features */ -#define GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID -#define GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY -#define GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY -/* End of Enable */ - -/* End of StorageSpecific */ - -#ifdef GRIN_ASSUME_EDGE_CUT_PARTITION -#define GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#define GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE -#endif - -#ifdef GRIN_ASSUME_VERTEX_CUT_PARTITION -#define GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE -#define GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE -#endif - -#ifndef GRIN_ENABLE_ROW -#undef GRIN_ENABLE_VERTEX_PRIMARY_KEYS -#undef GRIN_ENABLE_EDGE_PRIMARY_KEYS -#endif - -#ifndef GRIN_WITH_VERTEX_PROPERTY +#ifndef GRIN_DOXYGEN_SKIP +// GRIN_DEFAULT_DISABLE +#undef GRIN_ENABLE_ROW +#undef GRIN_WITH_VERTEX_PROPERTY #undef GRIN_WITH_VERTEX_PROPERTY_NAME #undef GRIN_WITH_VERTEX_TYPE_NAME #undef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE @@ -768,127 +671,76 @@ typedef enum { #undef GRIN_ENABLE_VERTEX_PRIMARY_KEYS #undef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY #undef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID -#undef GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#endif - -#ifndef GRIN_WITH_EDGE_PROPERTY +#undef GRIN_WITH_EDGE_PROPERTY #undef GRIN_WITH_EDGE_PROPERTY_NAME #undef GRIN_WITH_EDGE_TYPE_NAME #undef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE #undef GRIN_ENABLE_EDGE_PROPERTY_TABLE #undef GRIN_ENABLE_EDGE_PRIMARY_KEYS #undef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY -#undef GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE -#endif - -#ifndef GRIN_WITH_VERTEX_ORIGINAL_ID -#undef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID -#endif - -#ifndef GRIN_WITH_VERTEX_DATA -#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#endif - -#ifndef GRIN_WITH_EDGE_DATA -#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE -#endif - -#ifndef GRIN_ENABLE_VERTEX_LIST // enable vertex list iterator is the prerequisite #undef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST -#endif - -#ifndef GRIN_ENABLE_EDGE_LIST // enable edge list iterator is the prerequisite #undef GRIN_TRAIT_SELECT_TYPE_FOR_EDGE_LIST -#endif - -#ifndef GRIN_ENABLE_ADJACENT_LIST // enable adjacent list iterator is the prerequisite #undef GRIN_TRAIT_SELECT_NEIGHBOR_TYPE_FOR_ADJACENT_LIST #undef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST -#endif - -// assumption on vertex property -#ifdef GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE #undef GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE #undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE #undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#endif - -#ifdef GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#endif - -// assumption on vertex data -#ifdef GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE #undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE #undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#endif - -#ifdef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#endif - -// assumption on edge property -#ifdef GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#undef GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE #undef GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE #undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE #undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -#endif - -#ifdef GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -#endif - -#ifdef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -#endif - -// assumption on edge data -#ifdef GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE #undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE #undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE -#endif +#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY +#undef GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY +// GRIN_END -#ifdef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE -#endif +// GRIN_STORAGE_ENABLE +#define GRIN_ENABLE_ROW +#define GRIN_WITH_VERTEX_PROPERTY +#define GRIN_WITH_VERTEX_PROPERTY_NAME +#define GRIN_WITH_VERTEX_TYPE_NAME +#define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE +#define GRIN_ENABLE_VERTEX_PROPERTY_TABLE +#define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY +#define GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID +#define GRIN_WITH_EDGE_PROPERTY +#define GRIN_WITH_EDGE_PROPERTY_NAME +#define GRIN_WITH_EDGE_TYPE_NAME +#define GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE +#define GRIN_ENABLE_EDGE_PROPERTY_TABLE +#define GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY +#define GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST +#define GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST +#define GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY +#define GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY +// GRIN_END -#ifdef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE +// GRIN_FEATURE_DEPENDENCY +#ifdef GRIN_ASSUME_EDGE_CUT_PARTITION +#define GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#define GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE #endif -// assumption on vertex neighbor -#ifdef GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#ifdef GRIN_ASSUME_VERTEX_CUT_PARTITION +#define GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#define GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE #endif -#ifdef GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS +#define GRIN_ENABLE_ROW #endif -#ifdef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#ifdef GRIN_ENABLE_EDGE_PRIMARY_KEYS +#define GRIN_ENABLE_ROW #endif +// GRIN_END + #endif // GRIN_DOXY_SKIP /* End of Section 3 */ @@ -922,21 +774,19 @@ typedef enum { ///@} #ifndef GRIN_DOXYGEN_SKIP -// disable assumption by default -#undef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED - -/* StorageSpecific */ - -/* Disable the unsupported features */ +// GRIN_DEFAULT_DISABLE #undef GRIN_WITH_VERTEX_LABEL #undef GRIN_WITH_EDGE_LABEL -/* End of Disable */ +#undef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED +// GRIN_END -/* Enable the supported features */ +// GRIN_STORAGE_ENABLE #define GRIN_ASSUME_ALL_VERTEX_LIST_SORTED -/* End of Enable */ +// GRIN_END + +// GRIN_FEATURE_DEPENDENCY +// GRIN_END -/* End of StorageSpecific */ #endif // GRIN_DOXYGEN_SKIP /* End of Section 4 */ diff --git a/modules/graph/grin/rust/Cargo.toml b/modules/graph/grin/rust/Cargo.toml new file mode 100644 index 000000000..6fb1a3779 --- /dev/null +++ b/modules/graph/grin/rust/Cargo.toml @@ -0,0 +1,83 @@ +[package] +name = "grin_v6d" +version = "0.1.0" +authors = ["dijie"] + +[features] +default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_with_vertex_original_id", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_property_table", "grin_trait_natural_id_for_vertex_property", "grin_assume_by_type_vertex_original_id", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_enable_edge_property_table", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_column_store_for_vertex_property", "grin_assume_column_store_for_edge_property", "grin_assume_all_vertex_list_sorted"] +grin_assume_has_directed_graph = [] +grin_assume_has_undirected_graph = [] +grin_assume_has_multi_edge_graph = [] +grin_with_vertex_original_id = [] +grin_with_vertex_data = [] +grin_with_edge_data = [] +grin_enable_vertex_list = [] +grin_enable_vertex_list_array = [] +grin_enable_vertex_list_iterator = [] +grin_enable_edge_list = [] +grin_enable_edge_list_array = [] +grin_enable_edge_list_iterator = [] +grin_enable_adjacent_list = [] +grin_enable_adjacent_list_array = [] +grin_enable_adjacent_list_iterator = [] +grin_enable_graph_partition = [] +grin_trait_natural_id_for_partition = [] +grin_enable_vertex_ref = [] +grin_enable_edge_ref = [] +grin_assume_edge_cut_partition = ["grin_assume_master_vertex_data_local_complete", "grin_assume_all_edge_data_local_complete", "grin_assume_master_vertex_neighbor_local_complete", "grin_assume_master_vertex_property_local_complete", "grin_assume_all_edge_property_local_complete"] +grin_assume_vertex_cut_partition = ["grin_assume_all_vertex_data_local_complete", "grin_assume_all_edge_data_local_complete", "grin_trait_master_vertex_mirror_partition_list", "grin_assume_all_vertex_property_local_complete", "grin_assume_all_edge_property_local_complete"] +grin_assume_all_vertex_data_local_complete = [] +grin_assume_master_vertex_data_local_complete = [] +grin_assume_all_edge_data_local_complete = [] +grin_assume_master_edge_data_local_complete = [] +grin_assume_all_vertex_neighbor_local_complete = [] +grin_assume_master_vertex_neighbor_local_complete = [] +grin_trait_master_vertex_mirror_partition_list = [] +grin_trait_mirror_vertex_mirror_partition_list = [] +grin_trait_master_edge_mirror_partition_list = [] +grin_trait_mirror_edge_mirror_partition_list = [] +grin_trait_select_master_for_vertex_list = [] +grin_trait_select_partition_for_vertex_list = [] +grin_trait_select_master_for_edge_list = [] +grin_trait_select_partition_for_edge_list = [] +grin_trait_select_master_neighbor_for_adjacent_list = [] +grin_trait_select_neighbor_partition_for_adjacent_list = [] +grin_enable_row = [] +grin_with_vertex_property = [] +grin_with_vertex_property_name = [] +grin_with_vertex_type_name = [] +grin_trait_natural_id_for_vertex_type = [] +grin_enable_vertex_property_table = [] +grin_enable_vertex_primary_keys = ["grin_enable_row"] +grin_trait_natural_id_for_vertex_property = [] +grin_assume_by_type_vertex_original_id = [] +grin_with_edge_property = [] +grin_with_edge_property_name = [] +grin_with_edge_type_name = [] +grin_trait_natural_id_for_edge_type = [] +grin_enable_edge_property_table = [] +grin_enable_edge_primary_keys = ["grin_enable_row"] +grin_trait_natural_id_for_edge_property = [] +grin_trait_select_type_for_vertex_list = [] +grin_trait_select_type_for_edge_list = [] +grin_trait_select_neighbor_type_for_adjacent_list = [] +grin_trait_select_edge_type_for_adjacent_list = [] +grin_assume_all_vertex_property_local_complete = [] +grin_assume_master_vertex_property_local_complete = [] +grin_assume_by_type_all_vertex_property_local_complete = [] +grin_assume_by_type_master_vertex_property_local_complete = [] +grin_assume_by_type_all_vertex_data_local_complete = [] +grin_assume_by_type_master_vertex_data_local_complete = [] +grin_assume_all_edge_property_local_complete = [] +grin_assume_master_edge_property_local_complete = [] +grin_assume_by_type_all_edge_property_local_complete = [] +grin_assume_by_type_master_edge_property_local_complete = [] +grin_assume_by_type_all_edge_data_local_complete = [] +grin_assume_by_type_master_edge_data_local_complete = [] +grin_assume_by_type_all_vertex_neighbor_local_complete = [] +grin_assume_by_type_master_vertex_neighbor_local_complete = [] +grin_assume_column_store_for_vertex_property = [] +grin_assume_column_store_for_edge_property = [] +grin_with_vertex_label = [] +grin_with_edge_label = [] +grin_assume_all_vertex_list_sorted = [] diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs new file mode 100644 index 000000000..06abdb8a5 --- /dev/null +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -0,0 +1,945 @@ +#[doc = "< incoming"] +pub const GRIN_DIRECTION_IN: GRIN_DIRECTION = 0; +#[doc = "< outgoing"] +pub const GRIN_DIRECTION_OUT: GRIN_DIRECTION = 1; +#[doc = "< incoming & outgoing"] +pub const GRIN_DIRECTION_BOTH: GRIN_DIRECTION = 2; +#[doc = " Enumerates the directions of edges with respect to a certain vertex"] +pub type GRIN_DIRECTION = ::std::os::raw::c_uint; +#[doc = "< other unknown types"] +pub const GRIN_DATATYPE_Undefined: GRIN_DATATYPE = 0; +#[doc = "< int"] +pub const GRIN_DATATYPE_Int32: GRIN_DATATYPE = 1; +#[doc = "< unsigned int"] +pub const GRIN_DATATYPE_UInt32: GRIN_DATATYPE = 2; +#[doc = "< long int"] +pub const GRIN_DATATYPE_Int64: GRIN_DATATYPE = 3; +#[doc = "< unsigned long int"] +pub const GRIN_DATATYPE_UInt64: GRIN_DATATYPE = 4; +#[doc = "< float"] +pub const GRIN_DATATYPE_Float: GRIN_DATATYPE = 5; +#[doc = "< double"] +pub const GRIN_DATATYPE_Double: GRIN_DATATYPE = 6; +#[doc = "< string"] +pub const GRIN_DATATYPE_String: GRIN_DATATYPE = 7; +#[doc = "< short date"] +pub const GRIN_DATATYPE_Date32: GRIN_DATATYPE = 8; +#[doc = "< long date"] +pub const GRIN_DATATYPE_Date64: GRIN_DATATYPE = 9; +#[doc = " Enumerates the datatype supported in the storage"] +pub type GRIN_DATATYPE = ::std::os::raw::c_uint; +#[doc = "@}"] +pub type GRIN_GRAPH = *mut ::std::os::raw::c_void; +pub type GRIN_VERTEX = *mut ::std::os::raw::c_void; +pub type GRIN_EDGE = *mut ::std::os::raw::c_void; +pub type GRIN_VERTEX_ORIGINAL_ID = *mut ::std::os::raw::c_void; +pub type GRIN_VERTEX_LIST = *mut ::std::os::raw::c_void; +pub type GRIN_VERTEX_LIST_ITERATOR = *mut ::std::os::raw::c_void; +pub type GRIN_ADJACENT_LIST = *mut ::std::os::raw::c_void; +pub type GRIN_ADJACENT_LIST_ITERATOR = *mut ::std::os::raw::c_void; +pub type GRIN_PARTITIONED_GRAPH = *mut ::std::os::raw::c_void; +pub type GRIN_PARTITION = *mut ::std::os::raw::c_void; +pub type GRIN_PARTITION_LIST = *mut ::std::os::raw::c_void; +pub type GRIN_PARTITION_ID = ::std::os::raw::c_uint; +pub type GRIN_VERTEX_REF = *mut ::std::os::raw::c_void; +pub type GRIN_VERTEX_TYPE = *mut ::std::os::raw::c_void; +pub type GRIN_VERTEX_TYPE_LIST = *mut ::std::os::raw::c_void; +pub type GRIN_VERTEX_PROPERTY = *mut ::std::os::raw::c_void; +pub type GRIN_VERTEX_PROPERTY_LIST = *mut ::std::os::raw::c_void; +pub type GRIN_VERTEX_PROPERTY_TABLE = *mut ::std::os::raw::c_void; +pub type GRIN_VERTEX_TYPE_ID = ::std::os::raw::c_uint; +pub type GRIN_VERTEX_PROPERTY_ID = ::std::os::raw::c_uint; +pub type GRIN_EDGE_TYPE = *mut ::std::os::raw::c_void; +pub type GRIN_EDGE_TYPE_LIST = *mut ::std::os::raw::c_void; +pub type GRIN_EDGE_PROPERTY = *mut ::std::os::raw::c_void; +pub type GRIN_EDGE_PROPERTY_LIST = *mut ::std::os::raw::c_void; +pub type GRIN_EDGE_PROPERTY_TABLE = *mut ::std::os::raw::c_void; +pub type GRIN_EDGE_TYPE_ID = ::std::os::raw::c_uint; +pub type GRIN_EDGE_PROPERTY_ID = ::std::os::raw::c_uint; +pub type GRIN_ROW = *mut ::std::os::raw::c_void; +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list")] + pub fn grin_get_adjacent_list( + arg1: GRIN_GRAPH, + arg2: GRIN_DIRECTION, + arg3: GRIN_VERTEX, + ) -> GRIN_ADJACENT_LIST; +} +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list")] + pub fn grin_destroy_adjacent_list(arg1: GRIN_GRAPH, arg2: GRIN_ADJACENT_LIST); +} +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list_array")] + pub fn grin_get_adjacent_list_size(arg1: GRIN_GRAPH, arg2: GRIN_ADJACENT_LIST) -> usize; +} +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list_array")] + pub fn grin_get_neighbor_from_adjacent_list( + arg1: GRIN_GRAPH, + arg2: GRIN_ADJACENT_LIST, + arg3: usize, + ) -> GRIN_VERTEX; +} +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list_array")] + pub fn grin_get_edge_from_adjacent_list( + arg1: GRIN_GRAPH, + arg2: GRIN_ADJACENT_LIST, + arg3: usize, + ) -> GRIN_EDGE; +} +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list_iterator")] + pub fn grin_get_adjacent_list_begin( + arg1: GRIN_GRAPH, + arg2: GRIN_ADJACENT_LIST, + ) -> GRIN_ADJACENT_LIST_ITERATOR; +} +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list_iterator")] + pub fn grin_destroy_adjacent_list_iter(arg1: GRIN_GRAPH, arg2: GRIN_ADJACENT_LIST_ITERATOR); +} +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list_iterator")] + pub fn grin_get_next_adjacent_list_iter(arg1: GRIN_GRAPH, arg2: GRIN_ADJACENT_LIST_ITERATOR); +} +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list_iterator")] + pub fn grin_is_adjacent_list_end(arg1: GRIN_GRAPH, arg2: GRIN_ADJACENT_LIST_ITERATOR) -> bool; +} +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list_iterator")] + pub fn grin_get_neighbor_from_adjacent_list_iter( + arg1: GRIN_GRAPH, + arg2: GRIN_ADJACENT_LIST_ITERATOR, + ) -> GRIN_VERTEX; +} +extern "C" { + #[cfg(feature = "grin_enable_adjacent_list_iterator")] + pub fn grin_get_edge_from_adjacent_list_iter( + arg1: GRIN_GRAPH, + arg2: GRIN_ADJACENT_LIST_ITERATOR, + ) -> GRIN_EDGE; +} +extern "C" { + #[cfg(all(feature = "grin_assume_has_directed_graph", feature = "grin_assume_has_undirected_graph"))] + pub fn grin_get_graph_from_storage( + arg1: ::std::os::raw::c_int, + arg2: *mut *mut ::std::os::raw::c_char, + ) -> GRIN_GRAPH; +} +extern "C" { + #[cfg(all(feature = "grin_assume_has_directed_graph", feature = "grin_assume_has_undirected_graph"))] + pub fn grin_destroy_graph(arg1: GRIN_GRAPH); +} +extern "C" { + #[cfg(all(feature = "grin_assume_has_directed_graph", feature = "grin_assume_has_undirected_graph"))] + pub fn grin_is_directed(arg1: GRIN_GRAPH) -> bool; +} +extern "C" { + #[cfg(feature = "grin_assume_has_multi_edge_graph")] + pub fn grin_is_multigraph(arg1: GRIN_GRAPH) -> bool; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_original_id")] + pub fn grin_get_vertex_num(arg1: GRIN_GRAPH) -> usize; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_original_id")] + pub fn grin_get_edge_num(arg1: GRIN_GRAPH) -> usize; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_original_id")] + pub fn grin_destroy_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX); +} +extern "C" { + #[cfg(feature = "grin_with_vertex_original_id")] + pub fn grin_equal_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX, arg3: GRIN_VERTEX) -> bool; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_original_id")] + pub fn grin_destroy_vertex_original_id(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_ORIGINAL_ID); +} +extern "C" { + #[cfg(feature = "grin_with_vertex_original_id")] + pub fn grin_get_vertex_original_id_type(arg1: GRIN_GRAPH) -> GRIN_DATATYPE; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_original_id")] + pub fn grin_get_vertex_original_id( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX, + ) -> GRIN_VERTEX_ORIGINAL_ID; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_data")] + pub fn grin_destroy_value( + arg1: GRIN_GRAPH, + arg2: GRIN_DATATYPE, + arg3: *const ::std::os::raw::c_void, + ); +} +extern "C" { + #[cfg(feature = "grin_with_vertex_data")] + pub fn grin_destroy_name(arg1: GRIN_GRAPH, arg2: *const ::std::os::raw::c_char); +} +extern "C" { + #[cfg(feature = "grin_with_edge_data")] + pub fn grin_destroy_edge(arg1: GRIN_GRAPH, arg2: GRIN_EDGE); +} +extern "C" { + #[cfg(feature = "grin_with_edge_data")] + pub fn grin_get_edge_src(arg1: GRIN_GRAPH, arg2: GRIN_EDGE) -> GRIN_VERTEX; +} +extern "C" { + #[cfg(feature = "grin_with_edge_data")] + pub fn grin_get_edge_dst(arg1: GRIN_GRAPH, arg2: GRIN_EDGE) -> GRIN_VERTEX; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_list")] + pub fn grin_get_vertex_list(arg1: GRIN_GRAPH) -> GRIN_VERTEX_LIST; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_list")] + pub fn grin_destroy_vertex_list(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_LIST); +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_list_array")] + pub fn grin_get_vertex_list_size(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_LIST) -> usize; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_list_array")] + pub fn grin_get_vertex_from_list( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_LIST, + arg3: usize, + ) -> GRIN_VERTEX; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_list_iterator")] + pub fn grin_get_vertex_list_begin( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_LIST, + ) -> GRIN_VERTEX_LIST_ITERATOR; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_list_iterator")] + pub fn grin_destroy_vertex_list_iter(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_LIST_ITERATOR); +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_list_iterator")] + pub fn grin_get_next_vertex_list_iter(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_LIST_ITERATOR); +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_list_iterator")] + pub fn grin_is_vertex_list_end(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_LIST_ITERATOR) -> bool; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_list_iterator")] + pub fn grin_get_vertex_from_iter( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_LIST_ITERATOR, + ) -> GRIN_VERTEX; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_get_partitioned_graph_from_storage( + arg1: ::std::os::raw::c_int, + arg2: *mut *mut ::std::os::raw::c_char, + ) -> GRIN_PARTITIONED_GRAPH; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_destroy_partitioned_graph(arg1: GRIN_PARTITIONED_GRAPH); +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_get_total_partitions_number(arg1: GRIN_PARTITIONED_GRAPH) -> usize; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_get_local_partition_list(arg1: GRIN_PARTITIONED_GRAPH) -> GRIN_PARTITION_LIST; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_destroy_partition_list(arg1: GRIN_PARTITIONED_GRAPH, arg2: GRIN_PARTITION_LIST); +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_create_partition_list(arg1: GRIN_PARTITIONED_GRAPH) -> GRIN_PARTITION_LIST; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_insert_partition_to_list( + arg1: GRIN_PARTITIONED_GRAPH, + arg2: GRIN_PARTITION_LIST, + arg3: GRIN_PARTITION, + ) -> bool; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_get_partition_list_size( + arg1: GRIN_PARTITIONED_GRAPH, + arg2: GRIN_PARTITION_LIST, + ) -> usize; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_get_partition_from_list( + arg1: GRIN_PARTITIONED_GRAPH, + arg2: GRIN_PARTITION_LIST, + arg3: usize, + ) -> GRIN_PARTITION; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_equal_partition( + arg1: GRIN_PARTITIONED_GRAPH, + arg2: GRIN_PARTITION, + arg3: GRIN_PARTITION, + ) -> bool; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_destroy_partition(arg1: GRIN_PARTITIONED_GRAPH, arg2: GRIN_PARTITION); +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_get_partition_info( + arg1: GRIN_PARTITIONED_GRAPH, + arg2: GRIN_PARTITION, + ) -> *const ::std::os::raw::c_void; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_get_local_graph_from_partition( + arg1: GRIN_PARTITIONED_GRAPH, + arg2: GRIN_PARTITION, + ) -> GRIN_GRAPH; +} +extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_partition")] + pub fn grin_get_partition_from_id( + arg1: GRIN_PARTITIONED_GRAPH, + arg2: GRIN_PARTITION_ID, + ) -> GRIN_PARTITION; +} +extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_partition")] + pub fn grin_get_partition_id( + arg1: GRIN_PARTITIONED_GRAPH, + arg2: GRIN_PARTITION, + ) -> GRIN_PARTITION_ID; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_ref")] + pub fn grin_get_vertex_ref_for_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX) -> GRIN_VERTEX_REF; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_ref")] + pub fn grin_destroy_vertex_ref(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_REF); +} +extern "C" { + #[doc = " @brief get the local vertex from the vertex ref\n if the vertex ref is not regconized, a null vertex is returned\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_REF the vertex ref"] + #[cfg(feature = "grin_enable_vertex_ref")] + pub fn grin_get_vertex_from_vertex_ref(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_REF) -> GRIN_VERTEX; +} +extern "C" { + #[doc = " @brief get the master partition of a vertex ref.\n Some storage can still provide the master partition of the vertex ref,\n even if the vertex ref can NOT be recognized locally.\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_REF the vertex ref"] + #[cfg(feature = "grin_enable_vertex_ref")] + pub fn grin_get_master_partition_from_vertex_ref( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_REF, + ) -> GRIN_PARTITION; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_ref")] + pub fn grin_serialize_vertex_ref( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_REF, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_ref")] + pub fn grin_destroy_serialized_vertex_ref( + arg1: GRIN_GRAPH, + arg2: *const ::std::os::raw::c_char, + ); +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_ref")] + pub fn grin_deserialize_to_vertex_ref( + arg1: GRIN_GRAPH, + arg2: *const ::std::os::raw::c_char, + ) -> GRIN_VERTEX_REF; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_ref")] + pub fn grin_is_master_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX) -> bool; +} +extern "C" { + #[cfg(feature = "grin_enable_vertex_ref")] + pub fn grin_is_mirror_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX) -> bool; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_get_total_vertex_num(arg1: GRIN_PARTITIONED_GRAPH) -> usize; +} +extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] + pub fn grin_get_total_edge_num(arg1: GRIN_PARTITIONED_GRAPH) -> usize; +} +extern "C" { + #[cfg(feature = "grin_trait_select_master_for_vertex_list")] + pub fn grin_select_master_for_vertex_list( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_LIST, + ) -> GRIN_VERTEX_LIST; +} +extern "C" { + #[cfg(feature = "grin_trait_select_master_for_vertex_list")] + pub fn grin_select_mirror_for_vertex_list( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_LIST, + ) -> GRIN_VERTEX_LIST; +} +extern "C" { + #[doc = " @brief get the vertex property name\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_PROPERTY the vertex property"] + #[cfg(feature = "grin_with_vertex_property_name")] + pub fn grin_get_vertex_property_name( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_PROPERTY, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[doc = " @brief get the vertex property with a given name under a specific vertex type\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_TYPE the specific vertex type\n @param name the name"] + #[cfg(feature = "grin_with_vertex_property_name")] + pub fn grin_get_vertex_property_by_name( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE, + name: *const ::std::os::raw::c_char, + ) -> GRIN_VERTEX_PROPERTY; +} +extern "C" { + #[doc = " @brief get all the vertex properties with a given name\n @param GRIN_GRAPH the graph\n @param name the name"] + #[cfg(feature = "grin_with_vertex_property_name")] + pub fn grin_get_vertex_properties_by_name( + arg1: GRIN_GRAPH, + name: *const ::std::os::raw::c_char, + ) -> GRIN_VERTEX_PROPERTY_LIST; +} +extern "C" { + #[doc = " @brief get the edge property name\n @param GRIN_GRAPH the graph\n @param GRIN_EDGE_PROPERTY the edge property"] + #[cfg(feature = "grin_with_edge_property_name")] + pub fn grin_get_edge_property_name( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_PROPERTY, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[doc = " @brief get the edge property with a given name under a specific edge type\n @param GRIN_GRAPH the graph\n @param GRIN_EDGE_TYPE the specific edge type\n @param name the name"] + #[cfg(feature = "grin_with_edge_property_name")] + pub fn grin_get_edge_property_by_name( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE, + name: *const ::std::os::raw::c_char, + ) -> GRIN_EDGE_PROPERTY; +} +extern "C" { + #[doc = " @brief get all the edge properties with a given name\n @param GRIN_GRAPH the graph\n @param name the name"] + #[cfg(feature = "grin_with_edge_property_name")] + pub fn grin_get_edge_properties_by_name( + arg1: GRIN_GRAPH, + name: *const ::std::os::raw::c_char, + ) -> GRIN_EDGE_PROPERTY_LIST; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_equal_vertex_property( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_PROPERTY, + arg3: GRIN_VERTEX_PROPERTY, + ) -> bool; +} +extern "C" { + #[doc = " @brief destroy vertex property\n @param GRIN_VERTEX_PROPERTY vertex property"] + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_destroy_vertex_property(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_PROPERTY); +} +extern "C" { + #[doc = " @brief get property data type\n @param GRIN_VERTEX_PROPERTY vertex property"] + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_get_vertex_property_data_type( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_PROPERTY, + ) -> GRIN_DATATYPE; +} +extern "C" { + #[doc = " @brief get the vertex type that the property is bound to\n @param GRIN_VERTEX_PROPERTY vertex property"] + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_get_vertex_property_vertex_type( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_PROPERTY, + ) -> GRIN_VERTEX_TYPE; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_equal_edge_property( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_PROPERTY, + arg3: GRIN_EDGE_PROPERTY, + ) -> bool; +} +extern "C" { + #[doc = " @brief destroy edge property\n @param GRIN_EDGE_PROPERTY edge property"] + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_destroy_edge_property(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_PROPERTY); +} +extern "C" { + #[doc = " @brief get property data type\n @param GRIN_EDGE_PROPERTY edge property"] + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_get_edge_property_data_type( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_PROPERTY, + ) -> GRIN_DATATYPE; +} +extern "C" { + #[doc = " @brief get the edge type that the property is bound to\n @param GRIN_EDGE_PROPERTY edge property"] + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_get_edge_property_edge_type( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_PROPERTY, + ) -> GRIN_EDGE_TYPE; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_get_vertex_property_list_by_type( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE, + ) -> GRIN_VERTEX_PROPERTY_LIST; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_get_vertex_property_list_size( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_PROPERTY_LIST, + ) -> usize; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_get_vertex_property_from_list( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_PROPERTY_LIST, + arg3: usize, + ) -> GRIN_VERTEX_PROPERTY; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_create_vertex_property_list(arg1: GRIN_GRAPH) -> GRIN_VERTEX_PROPERTY_LIST; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_destroy_vertex_property_list(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_PROPERTY_LIST); +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_insert_vertex_property_to_list( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_PROPERTY_LIST, + arg3: GRIN_VERTEX_PROPERTY, + ) -> bool; +} +extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_vertex_property")] + pub fn grin_get_vertex_property_from_id( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE, + arg3: GRIN_VERTEX_PROPERTY_ID, + ) -> GRIN_VERTEX_PROPERTY; +} +extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_vertex_property")] + pub fn grin_get_vertex_property_id( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE, + arg3: GRIN_VERTEX_PROPERTY, + ) -> GRIN_VERTEX_PROPERTY_ID; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_get_edge_property_list_by_type( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE, + ) -> GRIN_EDGE_PROPERTY_LIST; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_get_edge_property_list_size( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_PROPERTY_LIST, + ) -> usize; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_get_edge_property_from_list( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_PROPERTY_LIST, + arg3: usize, + ) -> GRIN_EDGE_PROPERTY; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_create_edge_property_list(arg1: GRIN_GRAPH) -> GRIN_EDGE_PROPERTY_LIST; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_destroy_edge_property_list(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_PROPERTY_LIST); +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_insert_edge_property_to_list( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_PROPERTY_LIST, + arg3: GRIN_EDGE_PROPERTY, + ) -> bool; +} +extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_edge_property")] + pub fn grin_get_edge_property_from_id( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE, + arg3: GRIN_EDGE_PROPERTY_ID, + ) -> GRIN_EDGE_PROPERTY; +} +extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_edge_property")] + pub fn grin_get_edge_property_id( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE, + arg3: GRIN_EDGE_PROPERTY, + ) -> GRIN_EDGE_PROPERTY_ID; +} +extern "C" { + #[cfg(feature = "grin_enable_row")] + pub fn grin_destroy_row(arg1: GRIN_GRAPH, arg2: GRIN_ROW); +} +extern "C" { + #[doc = " @brief the value of a property from row by its position in row"] + #[cfg(feature = "grin_enable_row")] + pub fn grin_get_value_from_row( + arg1: GRIN_GRAPH, + arg2: GRIN_ROW, + arg3: GRIN_DATATYPE, + arg4: usize, + ) -> *const ::std::os::raw::c_void; +} +extern "C" { + #[doc = " @brief create a row, usually to get vertex/edge by primary keys"] + #[cfg(feature = "grin_enable_row")] + pub fn grin_create_row(arg1: GRIN_GRAPH) -> GRIN_ROW; +} +extern "C" { + #[doc = " @brief insert a value to the end of the row"] + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_value_to_row( + arg1: GRIN_GRAPH, + arg2: GRIN_ROW, + arg3: GRIN_DATATYPE, + arg4: *const ::std::os::raw::c_void, + ) -> bool; +} +extern "C" { + #[doc = " @brief destroy vertex property table\n @param GRIN_VERTEX_PROPERTY_TABLE vertex property table"] + #[cfg(feature = "grin_enable_vertex_property_table")] + pub fn grin_destroy_vertex_property_table(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_PROPERTY_TABLE); +} +extern "C" { + #[doc = " @brief get the vertex property table of a certain vertex type\n No matter column or row store strategy is used in the storage,\n GRIN recommends to first get the property table of the vertex type,\n and then fetch values(rows) by vertex and property(list). However,\n GRIN does provide direct row fetching API when GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY\n is NOT set.\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_TYPE the vertex type"] + #[cfg(feature = "grin_enable_vertex_property_table")] + pub fn grin_get_vertex_property_table_by_type( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE, + ) -> GRIN_VERTEX_PROPERTY_TABLE; +} +extern "C" { + #[doc = " @brief get vertex property value from table\n @param GRIN_VERTEX_PROPERTY_TABLE vertex property table\n @param GRIN_VERTEX the vertex which is the row index\n @param GRIN_VERTEX_PROPERTY the vertex property which is the column index\n @return can be casted to the property data type by the caller"] + #[cfg(feature = "grin_enable_vertex_property_table")] + pub fn grin_get_value_from_vertex_property_table( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_PROPERTY_TABLE, + arg3: GRIN_VERTEX, + arg4: GRIN_VERTEX_PROPERTY, + ) -> *const ::std::os::raw::c_void; +} +extern "C" { + #[doc = " @brief get vertex row from table\n @param GRIN_VERTEX_PROPERTY_TABLE vertex property table\n @param GRIN_VERTEX the vertex which is the row index\n @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns"] + #[cfg(all(feature = "grin_enable_vertex_property_table", feature = "grin_enable_row"))] + pub fn grin_get_row_from_vertex_property_table( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_PROPERTY_TABLE, + arg3: GRIN_VERTEX, + arg4: GRIN_VERTEX_PROPERTY_LIST, + ) -> GRIN_ROW; +} +extern "C" { + #[doc = " @brief destroy edge property table\n @param GRIN_EDGE_PROPERTY_TABLE edge property table"] + #[cfg(feature = "grin_enable_edge_property_table")] + pub fn grin_destroy_edge_property_table(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_PROPERTY_TABLE); +} +extern "C" { + #[doc = " @brief get the edge property table of a certain edge type\n No matter column or row store strategy is used in the storage,\n GRIN recommends to first get the property table of the edge type,\n and then fetch values(rows) by edge and property(list). However,\n GRIN does provide direct row fetching API when GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY\n is NOT set.\n @param GRIN_GRAPH the graph\n @param GRIN_EDGE_TYPE the edge type"] + #[cfg(feature = "grin_enable_edge_property_table")] + pub fn grin_get_edge_property_table_by_type( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE, + ) -> GRIN_EDGE_PROPERTY_TABLE; +} +extern "C" { + #[doc = " @brief get edge property value from table\n @param GRIN_EDGE_PROPERTY_TABLE edge property table\n @param GRIN_EDGE the edge which is the row index\n @param GRIN_EDGE_PROPERTY the edge property which is the column index\n @return can be casted to the property data type by the caller"] + #[cfg(feature = "grin_enable_edge_property_table")] + pub fn grin_get_value_from_edge_property_table( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_PROPERTY_TABLE, + arg3: GRIN_EDGE, + arg4: GRIN_EDGE_PROPERTY, + ) -> *const ::std::os::raw::c_void; +} +extern "C" { + #[doc = " @brief get edge row from table\n @param GRIN_EDGE_PROPERTY_TABLE edge property table\n @param GRIN_EDGE the edge which is the row index\n @param GRIN_EDGE_PROPERTY_LIST the edge property list as columns"] + #[cfg(all(feature = "grin_enable_edge_property_table", feature = "grin_enable_row"))] + pub fn grin_get_row_from_edge_property_table( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_PROPERTY_TABLE, + arg3: GRIN_EDGE, + arg4: GRIN_EDGE_PROPERTY_LIST, + ) -> GRIN_ROW; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_get_vertex_num_by_type(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_TYPE) -> usize; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_get_edge_num_by_type(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE) -> usize; +} +extern "C" { + #[cfg(all(feature = "grin_enable_graph_partition", feature = "grin_with_vertex_property"))] + pub fn grin_get_total_vertex_num_by_type( + arg1: GRIN_PARTITIONED_GRAPH, + arg2: GRIN_VERTEX_TYPE, + ) -> usize; +} +extern "C" { + #[cfg(all(feature = "grin_enable_graph_partition", feature = "grin_with_edge_property"))] + pub fn grin_get_total_edge_num_by_type( + arg1: GRIN_PARTITIONED_GRAPH, + arg2: GRIN_EDGE_TYPE, + ) -> usize; +} +extern "C" { + #[cfg(feature = "grin_assume_by_type_vertex_original_id")] + pub fn grin_get_vertex_from_original_id_by_type( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE, + arg3: GRIN_VERTEX_ORIGINAL_ID, + ) -> GRIN_VERTEX; +} +extern "C" { + #[cfg(feature = "grin_trait_select_type_for_vertex_list")] + pub fn grin_select_type_for_vertex_list( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE, + arg3: GRIN_VERTEX_LIST, + ) -> GRIN_VERTEX_LIST; +} +extern "C" { + #[cfg(feature = "grin_trait_select_edge_type_for_adjacent_list")] + pub fn grin_select_edge_type_for_adjacent_list( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE, + arg3: GRIN_ADJACENT_LIST, + ) -> GRIN_ADJACENT_LIST; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_equal_vertex_type( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE, + arg3: GRIN_VERTEX_TYPE, + ) -> bool; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_get_vertex_type(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX) -> GRIN_VERTEX_TYPE; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_destroy_vertex_type(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_TYPE); +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_get_vertex_type_list(arg1: GRIN_GRAPH) -> GRIN_VERTEX_TYPE_LIST; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_destroy_vertex_type_list(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_TYPE_LIST); +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_create_vertex_type_list(arg1: GRIN_GRAPH) -> GRIN_VERTEX_TYPE_LIST; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_insert_vertex_type_to_list( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE_LIST, + arg3: GRIN_VERTEX_TYPE, + ) -> bool; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_get_vertex_type_list_size(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_TYPE_LIST) -> usize; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_property")] + pub fn grin_get_vertex_type_from_list( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE_LIST, + arg3: usize, + ) -> GRIN_VERTEX_TYPE; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_type_name")] + pub fn grin_get_vertex_type_name( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[cfg(feature = "grin_with_vertex_type_name")] + pub fn grin_get_vertex_type_by_name( + arg1: GRIN_GRAPH, + arg2: *const ::std::os::raw::c_char, + ) -> GRIN_VERTEX_TYPE; +} +extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_vertex_type")] + pub fn grin_get_vertex_type_id(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_TYPE) + -> GRIN_VERTEX_TYPE_ID; +} +extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_vertex_type")] + pub fn grin_get_vertex_type_from_id( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE_ID, + ) -> GRIN_VERTEX_TYPE; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_equal_edge_type( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE, + arg3: GRIN_EDGE_TYPE, + ) -> bool; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_get_edge_type(arg1: GRIN_GRAPH, arg2: GRIN_EDGE) -> GRIN_EDGE_TYPE; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_destroy_edge_type(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE); +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_get_edge_type_list(arg1: GRIN_GRAPH) -> GRIN_EDGE_TYPE_LIST; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_destroy_edge_type_list(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE_LIST); +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_create_edge_type_list(arg1: GRIN_GRAPH) -> GRIN_EDGE_TYPE_LIST; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_insert_edge_type_to_list( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE_LIST, + arg3: GRIN_EDGE_TYPE, + ) -> bool; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_get_edge_type_list_size(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE_LIST) -> usize; +} +extern "C" { + #[cfg(feature = "grin_with_edge_property")] + pub fn grin_get_edge_type_from_list( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE_LIST, + arg3: usize, + ) -> GRIN_EDGE_TYPE; +} +extern "C" { + #[cfg(feature = "grin_with_edge_type_name")] + pub fn grin_get_edge_type_name( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE, + ) -> *const ::std::os::raw::c_char; +} +extern "C" { + #[cfg(feature = "grin_with_edge_type_name")] + pub fn grin_get_edge_type_by_name( + arg1: GRIN_GRAPH, + arg2: *const ::std::os::raw::c_char, + ) -> GRIN_EDGE_TYPE; +} +extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_edge_type")] + pub fn grin_get_edge_type_id(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE) -> GRIN_EDGE_TYPE_ID; +} +extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_edge_type")] + pub fn grin_get_edge_type_from_id(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE_ID) -> GRIN_EDGE_TYPE; +} +extern "C" { + #[doc = " @brief the src vertex type list"] + #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] + pub fn grin_get_src_types_from_edge_type( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE, + ) -> GRIN_VERTEX_TYPE_LIST; +} +extern "C" { + #[doc = " @brief get the dst vertex type list"] + #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] + pub fn grin_get_dst_types_from_edge_type( + arg1: GRIN_GRAPH, + arg2: GRIN_EDGE_TYPE, + ) -> GRIN_VERTEX_TYPE_LIST; +} +extern "C" { + #[doc = " @brief get the edge type list related to a given pair of vertex types"] + #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] + pub fn grin_get_edge_types_from_vertex_type_pair( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_TYPE, + arg3: GRIN_VERTEX_TYPE, + ) -> GRIN_EDGE_TYPE_LIST; +} +extern "C" { + #[cfg(feature = "grin_assume_all_vertex_list_sorted")] + pub fn grin_smaller_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX, arg3: GRIN_VERTEX) -> bool; +} +extern "C" { + #[doc = " @brief get the position of a vertex in a sorted list\n caller must guarantee the input vertex list is sorted to get the correct result\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_LIST the sorted vertex list\n @param VERTEX the vertex to find\n @param pos the returned position of the vertex\n @return false if the vertex is not found"] + #[cfg(all(feature = "grin_assume_all_vertex_list_sorted", feature = "grin_enable_vertex_list_array"))] + pub fn grin_get_position_of_vertex_from_sorted_list( + arg1: GRIN_GRAPH, + arg2: GRIN_VERTEX_LIST, + arg3: GRIN_VERTEX, + ) -> usize; +} diff --git a/modules/graph/grin/rust/parse.py b/modules/graph/grin/rust/parse.py new file mode 100644 index 000000000..98f028738 --- /dev/null +++ b/modules/graph/grin/rust/parse.py @@ -0,0 +1,166 @@ +import os +import subprocess +from pathlib import Path + +def get_func_name(line): + return line.split('(')[0].strip().split(' ')[-1].strip() + +def get_macro_name(line): + return ('one', [('yes', line.split(' ')[1].strip())]) + +def parse_expr(line): + line = line.strip() + assert(line.startswith('#if ')) + line = line[4:] + defs = line.split() + res = [] + rel = '' + for d in defs: + if d.startswith('!'): + res.append(('not', d[1+8: -1])) + elif d.startswith('defined'): + res.append(('yes', d[8: -1])) + elif d == '&&': + assert(rel == '' or rel == 'and') + rel = 'and' + elif d == '||': + assert(rel == '' or rel == 'or') + rel = 'or' + else: + assert False, f'unknown: {d}' + assert(rel != '') + return (rel, res) + +def parse(path): + res = {} + macros = [] + prefix = '' + with open(path) as f: + for _line in f: + if _line.strip().endswith('\\'): + prefix += _line.strip()[:-1] + continue + line = prefix + _line + prefix = '' + if line.startswith(('GRIN_', 'void', 'bool', 'size_t', 'const')): + func_name = get_func_name(line) + res[func_name] = macros + elif line.startswith('#ifdef'): + assert(len(macros) == 0) + macro_name = get_macro_name(line) + macros.append(macro_name) + elif line.startswith('#endif'): + assert(len(macros) <= 1) + if len(macros) == 1: + macros = macros[:-1] + elif line.startswith('#if '): + assert(len(macros) == 0) + macro_name = parse_expr(line) + macros.append(macro_name) + return res + +def to_rust(deps): + assert(len(deps) == 1) + one_foramt = '#[cfg(feature = \"{}\")]' + yes_format = 'feature = \"{}\"' + not_format = 'not(feature = \"{}\")' + all_format = '#[cfg(all({}))]' + any_format = '#[cfg(any({}))]' + + deps = deps[0] + if deps[0] == 'one': + assert(len(deps[1]) == 1) + assert(deps[1][0][0] == 'yes') + return one_foramt.format(deps[1][0][1].lower()) + elif deps[0] == 'and': + conds = [not_format.format(d[1].lower()) if d[0] == 'not' else yes_format.format(d[1].lower()) for d in deps[1]] + return all_format.format(", ".join(conds)) + elif deps[0] == 'or': + conds = [not_format.format(d[1].lower()) if d[0] == 'not' else yes_format.format(d[1].lower()) for d in deps[1]] + return any_format.format(", ".join(conds)) + else: + assert False, f'unknown: {deps}' + +def rewrite(file, r, strip=7): + with open(file) as f: + lines = f.readlines() + with open(file, 'w') as f: + for i, line in enumerate(lines): + if i < strip: + continue + if line.find('pub fn') != -1: + func_name = line + func_name = func_name[func_name.find('pub fn')+7:] + func_name = func_name.split('(')[0] + if func_name in r: + f.write(f' {r[func_name]}\n') + f.write(line) + +def parse_to_rs(path, dst): + r = {} + for f in path.glob('include/**/*.h'): + r |= parse(f) + print(r) + for k in r: + r[k] = to_rust(r[k]) + print(r) + rewrite(f'{dst}.rs', r) + +def parse_to_toml(path, dst): + with open(path / 'predefine.h') as f: + lines = f.readlines() + states = ['none'] + enables = [] + deps = {} + for line in lines: + if line.startswith('// GRIN_DEFAULT_DISABLE'): + assert(states[-1] == 'none') + states.append('disable') + elif line.startswith('// GRIN_STORAGE_ENABLE'): + assert(states[-1] == 'none') + states.append('enable') + elif line.startswith('// GRIN_FEATURE_DEPENDENCY'): + assert(states[-1] == 'none') + states.append('dependency') + elif line.startswith('// GRIN_END'): + assert(len(states) > 1) + states = states[:-1] + else: + status = states[-1] + if status == 'enable': + assert(line.startswith('#define ')) + enables.append(line[8:].strip().lower()) + elif status == 'disable': + assert(line.startswith('#undef ')) + deps[line[7:].strip().lower()] = [] + elif status == 'dependency': + if line.startswith('#ifdef'): + k = line.split(' ')[1].strip().lower() + elif line.startswith('#define'): + v = line.split(' ')[1].strip().lower() + deps[k].append(v) + print(enables) + print(deps) + with open('Cargo.toml', 'w') as f: + f.write('[package]\n') + f.write(f'name = \"{dst}\"\n') + f.write('version = \"0.1.0\"\n') + f.write('authors = [\"dijie\"]\n') + f.write('\n') + f.write('[features]\n') + f.write('default = [{}]\n'.format(', '.join([f'\"{e}\"' for e in enables]))) + for k in deps: + f.write(f'{k} = [') + f.write(', '.join([f'\"{v}\"' for v in deps[k]])) + f.write(']\n') + +def bindgen(src, dst): + subprocess.run(['bindgen', src, '-o', f'{dst}.rs']) + +if __name__ == '__main__': + src = 'v6d_all.h' + dst = 'grin_v6d' + path = Path('..') + bindgen(src, dst) + parse_to_rs(path, dst) + parse_to_toml(path, dst) \ No newline at end of file diff --git a/modules/graph/grin/rust/v6d_all.h b/modules/graph/grin/rust/v6d_all.h new file mode 100644 index 000000000..45abd6244 --- /dev/null +++ b/modules/graph/grin/rust/v6d_all.h @@ -0,0 +1,17 @@ +# +#include "../include/topology/adjacentlist.h" +#include "../include/topology/edgelist.h" +#include "../include/topology/structure.h" +#include "../include/topology/vertexlist.h" +#include "../include/partition/partition.h" +#include "../include/partition/reference.h" +#include "../include/partition/topology.h" +#include "../include/property/partition.h" +#include "../include/property/primarykey.h" +#include "../include/property/property.h" +#include "../include/property/propertylist.h" +#include "../include/property/propertytable.h" +#include "../include/property/topology.h" +#include "../include/property/type.h" +#include "../include/index/label.h" +#include "../include/index/order.h" \ No newline at end of file diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 91158a7fd..eb6e73412 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -181,7 +181,7 @@ struct GRIN_EDGE_PROPERTY_TABLE_T { }; #endif -#if defined(GRIN_WITH_VERTEX_PROPERTY) || defined(GRIN_WITH_EDGE_PROPERTY) +#ifdef GRIN_ENABLE_ROW typedef std::vector GRIN_ROW_T; #endif diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 6b99fa30c..2e79429ee 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -34,14 +34,14 @@ void grin_destroy_graph(GRIN_GRAPH g) { delete _g; } -#if !defined(GRIN_ASSUME_GRAPH_DIRECTED) && !defined(GRIN_ASSUME_GRAPH_UNDIRECTED) +#if defined(GRIN_ASSUME_HAS_DIRECTED_GRAPH) && defined(GRIN_ASSUME_HAS_UNDIRECTED_GRAPH) bool grin_is_directed(GRIN_GRAPH g) { auto _g = static_cast(g)->g; return _g->directed(); } #endif -#ifndef GRIN_ASSUME_GRAPH_SINGLE_EDGE +#ifdef GRIN_ASSUME_HAS_MULTI_EDGE_GRAPH bool grin_is_multigraph(GRIN_GRAPH g) { auto _g = static_cast(g)->g; return _g->is_multigraph(); @@ -142,7 +142,7 @@ void grin_destroy_name(GRIN_GRAPH g, const char* name) { #ifdef GRIN_WITH_VERTEX_DATA GRIN_DATATYPE grin_get_vertex_data_type(GRIN_GRAPH, GRIN_VERTEX); -GRIN_VERTEX_DATA grin_get_vertex_data_value(GRIN_GRAPH, GRIN_VERTEX); +const void* grin_get_vertex_data_value(GRIN_GRAPH, GRIN_VERTEX); #endif // Edge @@ -166,5 +166,5 @@ GRIN_VERTEX grin_get_edge_dst(GRIN_GRAPH g, GRIN_EDGE e) { #ifdef GRIN_WITH_EDGE_DATA GRIN_DATATYPE grin_get_edge_data_type(GRIN_GRAPH, GRIN_EDGE); -GRIN_EDGE_DATA grin_get_edge_data_value(GRIN_GRAPH, GRIN_EDGE); +const void* grin_get_edge_data_value(GRIN_GRAPH, GRIN_EDGE); #endif \ No newline at end of file From 6cff974b8b3145117ac8b9b55e3f0c0fccf657ad Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 12 Apr 2023 14:16:02 +0800 Subject: [PATCH 44/85] refine rust codegen --- modules/graph/grin/rust/grin_v6d.rs | 1151 ++++++++++++--------------- modules/graph/grin/rust/parse.py | 23 + 2 files changed, 527 insertions(+), 647 deletions(-) diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index 06abdb8a5..4cd13b103 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -1,945 +1,802 @@ #[doc = "< incoming"] -pub const GRIN_DIRECTION_IN: GRIN_DIRECTION = 0; +pub const GRIN_DIRECTION_IN: GrinDirection = 0; #[doc = "< outgoing"] -pub const GRIN_DIRECTION_OUT: GRIN_DIRECTION = 1; +pub const GRIN_DIRECTION_OUT: GrinDirection = 1; #[doc = "< incoming & outgoing"] -pub const GRIN_DIRECTION_BOTH: GRIN_DIRECTION = 2; +pub const GRIN_DIRECTION_BOTH: GrinDirection = 2; #[doc = " Enumerates the directions of edges with respect to a certain vertex"] -pub type GRIN_DIRECTION = ::std::os::raw::c_uint; +pub type GrinDirection = ::std::os::raw::c_uint; #[doc = "< other unknown types"] -pub const GRIN_DATATYPE_Undefined: GRIN_DATATYPE = 0; +pub const GRIN_DATATYPE_UNDEFINED: GrinDatatype = 0; #[doc = "< int"] -pub const GRIN_DATATYPE_Int32: GRIN_DATATYPE = 1; +pub const GRIN_DATATYPE_INT32: GrinDatatype = 1; #[doc = "< unsigned int"] -pub const GRIN_DATATYPE_UInt32: GRIN_DATATYPE = 2; +pub const GRIN_DATATYPE_UINT32: GrinDatatype = 2; #[doc = "< long int"] -pub const GRIN_DATATYPE_Int64: GRIN_DATATYPE = 3; +pub const GRIN_DATATYPE_INT64: GrinDatatype = 3; #[doc = "< unsigned long int"] -pub const GRIN_DATATYPE_UInt64: GRIN_DATATYPE = 4; +pub const GRIN_DATATYPE_UINT64: GrinDatatype = 4; #[doc = "< float"] -pub const GRIN_DATATYPE_Float: GRIN_DATATYPE = 5; +pub const GRIN_DATATYPE_FLOAT: GrinDatatype = 5; #[doc = "< double"] -pub const GRIN_DATATYPE_Double: GRIN_DATATYPE = 6; +pub const GRIN_DATATYPE_DOUBLE: GrinDatatype = 6; #[doc = "< string"] -pub const GRIN_DATATYPE_String: GRIN_DATATYPE = 7; +pub const GRIN_DATATYPE_STRING: GrinDatatype = 7; #[doc = "< short date"] -pub const GRIN_DATATYPE_Date32: GRIN_DATATYPE = 8; +pub const GRIN_DATATYPE_DATE32: GrinDatatype = 8; #[doc = "< long date"] -pub const GRIN_DATATYPE_Date64: GRIN_DATATYPE = 9; +pub const GRIN_DATATYPE_DATE64: GrinDatatype = 9; #[doc = " Enumerates the datatype supported in the storage"] -pub type GRIN_DATATYPE = ::std::os::raw::c_uint; +pub type GrinDatatype = ::std::os::raw::c_uint; #[doc = "@}"] -pub type GRIN_GRAPH = *mut ::std::os::raw::c_void; -pub type GRIN_VERTEX = *mut ::std::os::raw::c_void; -pub type GRIN_EDGE = *mut ::std::os::raw::c_void; -pub type GRIN_VERTEX_ORIGINAL_ID = *mut ::std::os::raw::c_void; -pub type GRIN_VERTEX_LIST = *mut ::std::os::raw::c_void; -pub type GRIN_VERTEX_LIST_ITERATOR = *mut ::std::os::raw::c_void; -pub type GRIN_ADJACENT_LIST = *mut ::std::os::raw::c_void; -pub type GRIN_ADJACENT_LIST_ITERATOR = *mut ::std::os::raw::c_void; -pub type GRIN_PARTITIONED_GRAPH = *mut ::std::os::raw::c_void; -pub type GRIN_PARTITION = *mut ::std::os::raw::c_void; -pub type GRIN_PARTITION_LIST = *mut ::std::os::raw::c_void; -pub type GRIN_PARTITION_ID = ::std::os::raw::c_uint; -pub type GRIN_VERTEX_REF = *mut ::std::os::raw::c_void; -pub type GRIN_VERTEX_TYPE = *mut ::std::os::raw::c_void; -pub type GRIN_VERTEX_TYPE_LIST = *mut ::std::os::raw::c_void; -pub type GRIN_VERTEX_PROPERTY = *mut ::std::os::raw::c_void; -pub type GRIN_VERTEX_PROPERTY_LIST = *mut ::std::os::raw::c_void; -pub type GRIN_VERTEX_PROPERTY_TABLE = *mut ::std::os::raw::c_void; -pub type GRIN_VERTEX_TYPE_ID = ::std::os::raw::c_uint; -pub type GRIN_VERTEX_PROPERTY_ID = ::std::os::raw::c_uint; -pub type GRIN_EDGE_TYPE = *mut ::std::os::raw::c_void; -pub type GRIN_EDGE_TYPE_LIST = *mut ::std::os::raw::c_void; -pub type GRIN_EDGE_PROPERTY = *mut ::std::os::raw::c_void; -pub type GRIN_EDGE_PROPERTY_LIST = *mut ::std::os::raw::c_void; -pub type GRIN_EDGE_PROPERTY_TABLE = *mut ::std::os::raw::c_void; -pub type GRIN_EDGE_TYPE_ID = ::std::os::raw::c_uint; -pub type GRIN_EDGE_PROPERTY_ID = ::std::os::raw::c_uint; -pub type GRIN_ROW = *mut ::std::os::raw::c_void; +pub type GrinGraph = *mut ::std::os::raw::c_void; +pub type GrinVertex = *mut ::std::os::raw::c_void; +pub type GrinEdge = *mut ::std::os::raw::c_void; +pub type GrinVertexOriginalId = *mut ::std::os::raw::c_void; +pub type GrinVertexList = *mut ::std::os::raw::c_void; +pub type GrinVertexListIterator = *mut ::std::os::raw::c_void; +pub type GrinAdjacentList = *mut ::std::os::raw::c_void; +pub type GrinAdjacentListIterator = *mut ::std::os::raw::c_void; +pub type GrinPartitionedGraph = *mut ::std::os::raw::c_void; +pub type GrinPartition = *mut ::std::os::raw::c_void; +pub type GrinPartitionList = *mut ::std::os::raw::c_void; +pub type GrinPartitionId = ::std::os::raw::c_uint; +pub type GrinVertexRef = *mut ::std::os::raw::c_void; +pub type GrinVertexType = *mut ::std::os::raw::c_void; +pub type GrinVertexTypeList = *mut ::std::os::raw::c_void; +pub type GrinVertexProperty = *mut ::std::os::raw::c_void; +pub type GrinVertexPropertyList = *mut ::std::os::raw::c_void; +pub type GrinVertexPropertyTable = *mut ::std::os::raw::c_void; +pub type GrinVertexTypeId = ::std::os::raw::c_uint; +pub type GrinVertexPropertyId = ::std::os::raw::c_uint; +pub type GrinEdgeType = *mut ::std::os::raw::c_void; +pub type GrinEdgeTypeList = *mut ::std::os::raw::c_void; +pub type GrinEdgeProperty = *mut ::std::os::raw::c_void; +pub type GrinEdgePropertyList = *mut ::std::os::raw::c_void; +pub type GrinEdgePropertyTable = *mut ::std::os::raw::c_void; +pub type GrinEdgeTypeId = ::std::os::raw::c_uint; +pub type GrinEdgePropertyId = ::std::os::raw::c_uint; +pub type GrinRow = *mut ::std::os::raw::c_void; extern "C" { #[cfg(feature = "grin_enable_adjacent_list")] pub fn grin_get_adjacent_list( - arg1: GRIN_GRAPH, - arg2: GRIN_DIRECTION, - arg3: GRIN_VERTEX, - ) -> GRIN_ADJACENT_LIST; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinDirection, + arg3: GrinVertex, + ) -> GrinAdjacentList; + #[cfg(feature = "grin_enable_adjacent_list")] - pub fn grin_destroy_adjacent_list(arg1: GRIN_GRAPH, arg2: GRIN_ADJACENT_LIST); -} -extern "C" { + pub fn grin_destroy_adjacent_list(arg1: GrinGraph, arg2: GrinAdjacentList); + #[cfg(feature = "grin_enable_adjacent_list_array")] - pub fn grin_get_adjacent_list_size(arg1: GRIN_GRAPH, arg2: GRIN_ADJACENT_LIST) -> usize; -} -extern "C" { + pub fn grin_get_adjacent_list_size(arg1: GrinGraph, arg2: GrinAdjacentList) -> usize; + #[cfg(feature = "grin_enable_adjacent_list_array")] pub fn grin_get_neighbor_from_adjacent_list( - arg1: GRIN_GRAPH, - arg2: GRIN_ADJACENT_LIST, + arg1: GrinGraph, + arg2: GrinAdjacentList, arg3: usize, - ) -> GRIN_VERTEX; -} -extern "C" { + ) -> GrinVertex; + #[cfg(feature = "grin_enable_adjacent_list_array")] pub fn grin_get_edge_from_adjacent_list( - arg1: GRIN_GRAPH, - arg2: GRIN_ADJACENT_LIST, + arg1: GrinGraph, + arg2: GrinAdjacentList, arg3: usize, - ) -> GRIN_EDGE; -} -extern "C" { + ) -> GrinEdge; + #[cfg(feature = "grin_enable_adjacent_list_iterator")] pub fn grin_get_adjacent_list_begin( - arg1: GRIN_GRAPH, - arg2: GRIN_ADJACENT_LIST, - ) -> GRIN_ADJACENT_LIST_ITERATOR; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinAdjacentList, + ) -> GrinAdjacentListIterator; + #[cfg(feature = "grin_enable_adjacent_list_iterator")] - pub fn grin_destroy_adjacent_list_iter(arg1: GRIN_GRAPH, arg2: GRIN_ADJACENT_LIST_ITERATOR); -} -extern "C" { + pub fn grin_destroy_adjacent_list_iter(arg1: GrinGraph, arg2: GrinAdjacentListIterator); + #[cfg(feature = "grin_enable_adjacent_list_iterator")] - pub fn grin_get_next_adjacent_list_iter(arg1: GRIN_GRAPH, arg2: GRIN_ADJACENT_LIST_ITERATOR); -} -extern "C" { + pub fn grin_get_next_adjacent_list_iter(arg1: GrinGraph, arg2: GrinAdjacentListIterator); + #[cfg(feature = "grin_enable_adjacent_list_iterator")] - pub fn grin_is_adjacent_list_end(arg1: GRIN_GRAPH, arg2: GRIN_ADJACENT_LIST_ITERATOR) -> bool; -} -extern "C" { + pub fn grin_is_adjacent_list_end(arg1: GrinGraph, arg2: GrinAdjacentListIterator) -> bool; + #[cfg(feature = "grin_enable_adjacent_list_iterator")] pub fn grin_get_neighbor_from_adjacent_list_iter( - arg1: GRIN_GRAPH, - arg2: GRIN_ADJACENT_LIST_ITERATOR, - ) -> GRIN_VERTEX; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinAdjacentListIterator, + ) -> GrinVertex; + #[cfg(feature = "grin_enable_adjacent_list_iterator")] pub fn grin_get_edge_from_adjacent_list_iter( - arg1: GRIN_GRAPH, - arg2: GRIN_ADJACENT_LIST_ITERATOR, - ) -> GRIN_EDGE; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinAdjacentListIterator, + ) -> GrinEdge; + #[cfg(all(feature = "grin_assume_has_directed_graph", feature = "grin_assume_has_undirected_graph"))] pub fn grin_get_graph_from_storage( arg1: ::std::os::raw::c_int, arg2: *mut *mut ::std::os::raw::c_char, - ) -> GRIN_GRAPH; -} -extern "C" { + ) -> GrinGraph; + #[cfg(all(feature = "grin_assume_has_directed_graph", feature = "grin_assume_has_undirected_graph"))] - pub fn grin_destroy_graph(arg1: GRIN_GRAPH); -} -extern "C" { + pub fn grin_destroy_graph(arg1: GrinGraph); + #[cfg(all(feature = "grin_assume_has_directed_graph", feature = "grin_assume_has_undirected_graph"))] - pub fn grin_is_directed(arg1: GRIN_GRAPH) -> bool; -} -extern "C" { + pub fn grin_is_directed(arg1: GrinGraph) -> bool; + #[cfg(feature = "grin_assume_has_multi_edge_graph")] - pub fn grin_is_multigraph(arg1: GRIN_GRAPH) -> bool; -} -extern "C" { + pub fn grin_is_multigraph(arg1: GrinGraph) -> bool; + #[cfg(feature = "grin_with_vertex_original_id")] - pub fn grin_get_vertex_num(arg1: GRIN_GRAPH) -> usize; -} -extern "C" { + pub fn grin_get_vertex_num(arg1: GrinGraph) -> usize; + #[cfg(feature = "grin_with_vertex_original_id")] - pub fn grin_get_edge_num(arg1: GRIN_GRAPH) -> usize; -} -extern "C" { + pub fn grin_get_edge_num(arg1: GrinGraph) -> usize; + #[cfg(feature = "grin_with_vertex_original_id")] - pub fn grin_destroy_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX); -} -extern "C" { + pub fn grin_destroy_vertex(arg1: GrinGraph, arg2: GrinVertex); + #[cfg(feature = "grin_with_vertex_original_id")] - pub fn grin_equal_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX, arg3: GRIN_VERTEX) -> bool; -} -extern "C" { + pub fn grin_equal_vertex(arg1: GrinGraph, arg2: GrinVertex, arg3: GrinVertex) -> bool; + #[cfg(feature = "grin_with_vertex_original_id")] - pub fn grin_destroy_vertex_original_id(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_ORIGINAL_ID); -} -extern "C" { + pub fn grin_destroy_vertex_original_id(arg1: GrinGraph, arg2: GrinVertexOriginalId); + #[cfg(feature = "grin_with_vertex_original_id")] - pub fn grin_get_vertex_original_id_type(arg1: GRIN_GRAPH) -> GRIN_DATATYPE; -} -extern "C" { + pub fn grin_get_vertex_original_id_type(arg1: GrinGraph) -> GrinDatatype; + #[cfg(feature = "grin_with_vertex_original_id")] pub fn grin_get_vertex_original_id( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX, - ) -> GRIN_VERTEX_ORIGINAL_ID; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertex, + ) -> GrinVertexOriginalId; + #[cfg(feature = "grin_with_vertex_data")] pub fn grin_destroy_value( - arg1: GRIN_GRAPH, - arg2: GRIN_DATATYPE, + arg1: GrinGraph, + arg2: GrinDatatype, arg3: *const ::std::os::raw::c_void, ); -} -extern "C" { + #[cfg(feature = "grin_with_vertex_data")] - pub fn grin_destroy_name(arg1: GRIN_GRAPH, arg2: *const ::std::os::raw::c_char); -} -extern "C" { + pub fn grin_destroy_name(arg1: GrinGraph, arg2: *const ::std::os::raw::c_char); + #[cfg(feature = "grin_with_edge_data")] - pub fn grin_destroy_edge(arg1: GRIN_GRAPH, arg2: GRIN_EDGE); -} -extern "C" { + pub fn grin_destroy_edge(arg1: GrinGraph, arg2: GrinEdge); + #[cfg(feature = "grin_with_edge_data")] - pub fn grin_get_edge_src(arg1: GRIN_GRAPH, arg2: GRIN_EDGE) -> GRIN_VERTEX; -} -extern "C" { + pub fn grin_get_edge_src(arg1: GrinGraph, arg2: GrinEdge) -> GrinVertex; + #[cfg(feature = "grin_with_edge_data")] - pub fn grin_get_edge_dst(arg1: GRIN_GRAPH, arg2: GRIN_EDGE) -> GRIN_VERTEX; -} -extern "C" { + pub fn grin_get_edge_dst(arg1: GrinGraph, arg2: GrinEdge) -> GrinVertex; + #[cfg(feature = "grin_enable_vertex_list")] - pub fn grin_get_vertex_list(arg1: GRIN_GRAPH) -> GRIN_VERTEX_LIST; -} -extern "C" { + pub fn grin_get_vertex_list(arg1: GrinGraph) -> GrinVertexList; + #[cfg(feature = "grin_enable_vertex_list")] - pub fn grin_destroy_vertex_list(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_LIST); -} -extern "C" { + pub fn grin_destroy_vertex_list(arg1: GrinGraph, arg2: GrinVertexList); + #[cfg(feature = "grin_enable_vertex_list_array")] - pub fn grin_get_vertex_list_size(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_LIST) -> usize; -} -extern "C" { + pub fn grin_get_vertex_list_size(arg1: GrinGraph, arg2: GrinVertexList) -> usize; + #[cfg(feature = "grin_enable_vertex_list_array")] pub fn grin_get_vertex_from_list( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_LIST, + arg1: GrinGraph, + arg2: GrinVertexList, arg3: usize, - ) -> GRIN_VERTEX; -} -extern "C" { + ) -> GrinVertex; + #[cfg(feature = "grin_enable_vertex_list_iterator")] pub fn grin_get_vertex_list_begin( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_LIST, - ) -> GRIN_VERTEX_LIST_ITERATOR; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexList, + ) -> GrinVertexListIterator; + #[cfg(feature = "grin_enable_vertex_list_iterator")] - pub fn grin_destroy_vertex_list_iter(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_LIST_ITERATOR); -} -extern "C" { + pub fn grin_destroy_vertex_list_iter(arg1: GrinGraph, arg2: GrinVertexListIterator); + #[cfg(feature = "grin_enable_vertex_list_iterator")] - pub fn grin_get_next_vertex_list_iter(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_LIST_ITERATOR); -} -extern "C" { + pub fn grin_get_next_vertex_list_iter(arg1: GrinGraph, arg2: GrinVertexListIterator); + #[cfg(feature = "grin_enable_vertex_list_iterator")] - pub fn grin_is_vertex_list_end(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_LIST_ITERATOR) -> bool; -} -extern "C" { + pub fn grin_is_vertex_list_end(arg1: GrinGraph, arg2: GrinVertexListIterator) -> bool; + #[cfg(feature = "grin_enable_vertex_list_iterator")] pub fn grin_get_vertex_from_iter( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_LIST_ITERATOR, - ) -> GRIN_VERTEX; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexListIterator, + ) -> GrinVertex; + #[cfg(feature = "grin_enable_graph_partition")] pub fn grin_get_partitioned_graph_from_storage( arg1: ::std::os::raw::c_int, arg2: *mut *mut ::std::os::raw::c_char, - ) -> GRIN_PARTITIONED_GRAPH; -} -extern "C" { + ) -> GrinPartitionedGraph; + #[cfg(feature = "grin_enable_graph_partition")] - pub fn grin_destroy_partitioned_graph(arg1: GRIN_PARTITIONED_GRAPH); -} -extern "C" { + pub fn grin_destroy_partitioned_graph(arg1: GrinPartitionedGraph); + #[cfg(feature = "grin_enable_graph_partition")] - pub fn grin_get_total_partitions_number(arg1: GRIN_PARTITIONED_GRAPH) -> usize; -} -extern "C" { + pub fn grin_get_total_partitions_number(arg1: GrinPartitionedGraph) -> usize; + #[cfg(feature = "grin_enable_graph_partition")] - pub fn grin_get_local_partition_list(arg1: GRIN_PARTITIONED_GRAPH) -> GRIN_PARTITION_LIST; -} -extern "C" { + pub fn grin_get_local_partition_list(arg1: GrinPartitionedGraph) -> GrinPartitionList; + #[cfg(feature = "grin_enable_graph_partition")] - pub fn grin_destroy_partition_list(arg1: GRIN_PARTITIONED_GRAPH, arg2: GRIN_PARTITION_LIST); -} -extern "C" { + pub fn grin_destroy_partition_list(arg1: GrinPartitionedGraph, arg2: GrinPartitionList); + #[cfg(feature = "grin_enable_graph_partition")] - pub fn grin_create_partition_list(arg1: GRIN_PARTITIONED_GRAPH) -> GRIN_PARTITION_LIST; -} -extern "C" { + pub fn grin_create_partition_list(arg1: GrinPartitionedGraph) -> GrinPartitionList; + #[cfg(feature = "grin_enable_graph_partition")] pub fn grin_insert_partition_to_list( - arg1: GRIN_PARTITIONED_GRAPH, - arg2: GRIN_PARTITION_LIST, - arg3: GRIN_PARTITION, + arg1: GrinPartitionedGraph, + arg2: GrinPartitionList, + arg3: GrinPartition, ) -> bool; -} -extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] pub fn grin_get_partition_list_size( - arg1: GRIN_PARTITIONED_GRAPH, - arg2: GRIN_PARTITION_LIST, + arg1: GrinPartitionedGraph, + arg2: GrinPartitionList, ) -> usize; -} -extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] pub fn grin_get_partition_from_list( - arg1: GRIN_PARTITIONED_GRAPH, - arg2: GRIN_PARTITION_LIST, + arg1: GrinPartitionedGraph, + arg2: GrinPartitionList, arg3: usize, - ) -> GRIN_PARTITION; -} -extern "C" { + ) -> GrinPartition; + #[cfg(feature = "grin_enable_graph_partition")] pub fn grin_equal_partition( - arg1: GRIN_PARTITIONED_GRAPH, - arg2: GRIN_PARTITION, - arg3: GRIN_PARTITION, + arg1: GrinPartitionedGraph, + arg2: GrinPartition, + arg3: GrinPartition, ) -> bool; -} -extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] - pub fn grin_destroy_partition(arg1: GRIN_PARTITIONED_GRAPH, arg2: GRIN_PARTITION); -} -extern "C" { + pub fn grin_destroy_partition(arg1: GrinPartitionedGraph, arg2: GrinPartition); + #[cfg(feature = "grin_enable_graph_partition")] pub fn grin_get_partition_info( - arg1: GRIN_PARTITIONED_GRAPH, - arg2: GRIN_PARTITION, + arg1: GrinPartitionedGraph, + arg2: GrinPartition, ) -> *const ::std::os::raw::c_void; -} -extern "C" { + #[cfg(feature = "grin_enable_graph_partition")] pub fn grin_get_local_graph_from_partition( - arg1: GRIN_PARTITIONED_GRAPH, - arg2: GRIN_PARTITION, - ) -> GRIN_GRAPH; -} -extern "C" { + arg1: GrinPartitionedGraph, + arg2: GrinPartition, + ) -> GrinGraph; + #[cfg(feature = "grin_trait_natural_id_for_partition")] pub fn grin_get_partition_from_id( - arg1: GRIN_PARTITIONED_GRAPH, - arg2: GRIN_PARTITION_ID, - ) -> GRIN_PARTITION; -} -extern "C" { + arg1: GrinPartitionedGraph, + arg2: GrinPartitionId, + ) -> GrinPartition; + #[cfg(feature = "grin_trait_natural_id_for_partition")] pub fn grin_get_partition_id( - arg1: GRIN_PARTITIONED_GRAPH, - arg2: GRIN_PARTITION, - ) -> GRIN_PARTITION_ID; -} -extern "C" { + arg1: GrinPartitionedGraph, + arg2: GrinPartition, + ) -> GrinPartitionId; + #[cfg(feature = "grin_enable_vertex_ref")] - pub fn grin_get_vertex_ref_for_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX) -> GRIN_VERTEX_REF; -} -extern "C" { + pub fn grin_get_vertex_ref_for_vertex(arg1: GrinGraph, arg2: GrinVertex) -> GrinVertexRef; + #[cfg(feature = "grin_enable_vertex_ref")] - pub fn grin_destroy_vertex_ref(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_REF); -} -extern "C" { - #[doc = " @brief get the local vertex from the vertex ref\n if the vertex ref is not regconized, a null vertex is returned\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_REF the vertex ref"] + pub fn grin_destroy_vertex_ref(arg1: GrinGraph, arg2: GrinVertexRef); + + #[doc = " @brief get the local vertex from the vertex ref\n if the vertex ref is not regconized, a null vertex is returned\n @param GrinGraph the graph\n @param GrinVertexRef the vertex ref"] #[cfg(feature = "grin_enable_vertex_ref")] - pub fn grin_get_vertex_from_vertex_ref(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_REF) -> GRIN_VERTEX; -} -extern "C" { - #[doc = " @brief get the master partition of a vertex ref.\n Some storage can still provide the master partition of the vertex ref,\n even if the vertex ref can NOT be recognized locally.\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_REF the vertex ref"] + pub fn grin_get_vertex_from_vertex_ref(arg1: GrinGraph, arg2: GrinVertexRef) -> GrinVertex; + + #[doc = " @brief get the master partition of a vertex ref.\n Some storage can still provide the master partition of the vertex ref,\n even if the vertex ref can NOT be recognized locally.\n @param GrinGraph the graph\n @param GrinVertexRef the vertex ref"] #[cfg(feature = "grin_enable_vertex_ref")] pub fn grin_get_master_partition_from_vertex_ref( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_REF, - ) -> GRIN_PARTITION; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexRef, + ) -> GrinPartition; + #[cfg(feature = "grin_enable_vertex_ref")] pub fn grin_serialize_vertex_ref( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_REF, + arg1: GrinGraph, + arg2: GrinVertexRef, ) -> *const ::std::os::raw::c_char; -} -extern "C" { + #[cfg(feature = "grin_enable_vertex_ref")] pub fn grin_destroy_serialized_vertex_ref( - arg1: GRIN_GRAPH, + arg1: GrinGraph, arg2: *const ::std::os::raw::c_char, ); -} -extern "C" { + #[cfg(feature = "grin_enable_vertex_ref")] pub fn grin_deserialize_to_vertex_ref( - arg1: GRIN_GRAPH, + arg1: GrinGraph, arg2: *const ::std::os::raw::c_char, - ) -> GRIN_VERTEX_REF; -} -extern "C" { + ) -> GrinVertexRef; + #[cfg(feature = "grin_enable_vertex_ref")] - pub fn grin_is_master_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX) -> bool; -} -extern "C" { + pub fn grin_is_master_vertex(arg1: GrinGraph, arg2: GrinVertex) -> bool; + #[cfg(feature = "grin_enable_vertex_ref")] - pub fn grin_is_mirror_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX) -> bool; -} -extern "C" { + pub fn grin_is_mirror_vertex(arg1: GrinGraph, arg2: GrinVertex) -> bool; + #[cfg(feature = "grin_enable_graph_partition")] - pub fn grin_get_total_vertex_num(arg1: GRIN_PARTITIONED_GRAPH) -> usize; -} -extern "C" { + pub fn grin_get_total_vertex_num(arg1: GrinPartitionedGraph) -> usize; + #[cfg(feature = "grin_enable_graph_partition")] - pub fn grin_get_total_edge_num(arg1: GRIN_PARTITIONED_GRAPH) -> usize; -} -extern "C" { + pub fn grin_get_total_edge_num(arg1: GrinPartitionedGraph) -> usize; + #[cfg(feature = "grin_trait_select_master_for_vertex_list")] pub fn grin_select_master_for_vertex_list( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_LIST, - ) -> GRIN_VERTEX_LIST; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexList, + ) -> GrinVertexList; + #[cfg(feature = "grin_trait_select_master_for_vertex_list")] pub fn grin_select_mirror_for_vertex_list( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_LIST, - ) -> GRIN_VERTEX_LIST; -} -extern "C" { - #[doc = " @brief get the vertex property name\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_PROPERTY the vertex property"] + arg1: GrinGraph, + arg2: GrinVertexList, + ) -> GrinVertexList; + + #[doc = " @brief get the vertex property name\n @param GrinGraph the graph\n @param GrinVertexProperty the vertex property"] #[cfg(feature = "grin_with_vertex_property_name")] pub fn grin_get_vertex_property_name( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_PROPERTY, + arg1: GrinGraph, + arg2: GrinVertexProperty, ) -> *const ::std::os::raw::c_char; -} -extern "C" { - #[doc = " @brief get the vertex property with a given name under a specific vertex type\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_TYPE the specific vertex type\n @param name the name"] + + #[doc = " @brief get the vertex property with a given name under a specific vertex type\n @param GrinGraph the graph\n @param GrinVertexType the specific vertex type\n @param name the name"] #[cfg(feature = "grin_with_vertex_property_name")] pub fn grin_get_vertex_property_by_name( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE, + arg1: GrinGraph, + arg2: GrinVertexType, name: *const ::std::os::raw::c_char, - ) -> GRIN_VERTEX_PROPERTY; -} -extern "C" { - #[doc = " @brief get all the vertex properties with a given name\n @param GRIN_GRAPH the graph\n @param name the name"] + ) -> GrinVertexProperty; + + #[doc = " @brief get all the vertex properties with a given name\n @param GrinGraph the graph\n @param name the name"] #[cfg(feature = "grin_with_vertex_property_name")] pub fn grin_get_vertex_properties_by_name( - arg1: GRIN_GRAPH, + arg1: GrinGraph, name: *const ::std::os::raw::c_char, - ) -> GRIN_VERTEX_PROPERTY_LIST; -} -extern "C" { - #[doc = " @brief get the edge property name\n @param GRIN_GRAPH the graph\n @param GRIN_EDGE_PROPERTY the edge property"] + ) -> GrinVertexPropertyList; + + #[doc = " @brief get the edge property name\n @param GrinGraph the graph\n @param GrinEdgeProperty the edge property"] #[cfg(feature = "grin_with_edge_property_name")] pub fn grin_get_edge_property_name( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_PROPERTY, + arg1: GrinGraph, + arg2: GrinEdgeProperty, ) -> *const ::std::os::raw::c_char; -} -extern "C" { - #[doc = " @brief get the edge property with a given name under a specific edge type\n @param GRIN_GRAPH the graph\n @param GRIN_EDGE_TYPE the specific edge type\n @param name the name"] + + #[doc = " @brief get the edge property with a given name under a specific edge type\n @param GrinGraph the graph\n @param GrinEdgeType the specific edge type\n @param name the name"] #[cfg(feature = "grin_with_edge_property_name")] pub fn grin_get_edge_property_by_name( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE, + arg1: GrinGraph, + arg2: GrinEdgeType, name: *const ::std::os::raw::c_char, - ) -> GRIN_EDGE_PROPERTY; -} -extern "C" { - #[doc = " @brief get all the edge properties with a given name\n @param GRIN_GRAPH the graph\n @param name the name"] + ) -> GrinEdgeProperty; + + #[doc = " @brief get all the edge properties with a given name\n @param GrinGraph the graph\n @param name the name"] #[cfg(feature = "grin_with_edge_property_name")] pub fn grin_get_edge_properties_by_name( - arg1: GRIN_GRAPH, + arg1: GrinGraph, name: *const ::std::os::raw::c_char, - ) -> GRIN_EDGE_PROPERTY_LIST; -} -extern "C" { + ) -> GrinEdgePropertyList; + #[cfg(feature = "grin_with_vertex_property")] pub fn grin_equal_vertex_property( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_PROPERTY, - arg3: GRIN_VERTEX_PROPERTY, + arg1: GrinGraph, + arg2: GrinVertexProperty, + arg3: GrinVertexProperty, ) -> bool; -} -extern "C" { - #[doc = " @brief destroy vertex property\n @param GRIN_VERTEX_PROPERTY vertex property"] + + #[doc = " @brief destroy vertex property\n @param GrinVertexProperty vertex property"] #[cfg(feature = "grin_with_vertex_property")] - pub fn grin_destroy_vertex_property(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_PROPERTY); -} -extern "C" { - #[doc = " @brief get property data type\n @param GRIN_VERTEX_PROPERTY vertex property"] + pub fn grin_destroy_vertex_property(arg1: GrinGraph, arg2: GrinVertexProperty); + + #[doc = " @brief get property data type\n @param GrinVertexProperty vertex property"] #[cfg(feature = "grin_with_vertex_property")] pub fn grin_get_vertex_property_data_type( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_PROPERTY, - ) -> GRIN_DATATYPE; -} -extern "C" { - #[doc = " @brief get the vertex type that the property is bound to\n @param GRIN_VERTEX_PROPERTY vertex property"] + arg1: GrinGraph, + arg2: GrinVertexProperty, + ) -> GrinDatatype; + + #[doc = " @brief get the vertex type that the property is bound to\n @param GrinVertexProperty vertex property"] #[cfg(feature = "grin_with_vertex_property")] pub fn grin_get_vertex_property_vertex_type( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_PROPERTY, - ) -> GRIN_VERTEX_TYPE; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexProperty, + ) -> GrinVertexType; + #[cfg(feature = "grin_with_edge_property")] pub fn grin_equal_edge_property( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_PROPERTY, - arg3: GRIN_EDGE_PROPERTY, + arg1: GrinGraph, + arg2: GrinEdgeProperty, + arg3: GrinEdgeProperty, ) -> bool; -} -extern "C" { - #[doc = " @brief destroy edge property\n @param GRIN_EDGE_PROPERTY edge property"] + + #[doc = " @brief destroy edge property\n @param GrinEdgeProperty edge property"] #[cfg(feature = "grin_with_edge_property")] - pub fn grin_destroy_edge_property(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_PROPERTY); -} -extern "C" { - #[doc = " @brief get property data type\n @param GRIN_EDGE_PROPERTY edge property"] + pub fn grin_destroy_edge_property(arg1: GrinGraph, arg2: GrinEdgeProperty); + + #[doc = " @brief get property data type\n @param GrinEdgeProperty edge property"] #[cfg(feature = "grin_with_edge_property")] pub fn grin_get_edge_property_data_type( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_PROPERTY, - ) -> GRIN_DATATYPE; -} -extern "C" { - #[doc = " @brief get the edge type that the property is bound to\n @param GRIN_EDGE_PROPERTY edge property"] + arg1: GrinGraph, + arg2: GrinEdgeProperty, + ) -> GrinDatatype; + + #[doc = " @brief get the edge type that the property is bound to\n @param GrinEdgeProperty edge property"] #[cfg(feature = "grin_with_edge_property")] pub fn grin_get_edge_property_edge_type( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_PROPERTY, - ) -> GRIN_EDGE_TYPE; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinEdgeProperty, + ) -> GrinEdgeType; + #[cfg(feature = "grin_with_vertex_property")] pub fn grin_get_vertex_property_list_by_type( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE, - ) -> GRIN_VERTEX_PROPERTY_LIST; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexType, + ) -> GrinVertexPropertyList; + #[cfg(feature = "grin_with_vertex_property")] pub fn grin_get_vertex_property_list_size( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_PROPERTY_LIST, + arg1: GrinGraph, + arg2: GrinVertexPropertyList, ) -> usize; -} -extern "C" { + #[cfg(feature = "grin_with_vertex_property")] pub fn grin_get_vertex_property_from_list( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_PROPERTY_LIST, + arg1: GrinGraph, + arg2: GrinVertexPropertyList, arg3: usize, - ) -> GRIN_VERTEX_PROPERTY; -} -extern "C" { + ) -> GrinVertexProperty; + #[cfg(feature = "grin_with_vertex_property")] - pub fn grin_create_vertex_property_list(arg1: GRIN_GRAPH) -> GRIN_VERTEX_PROPERTY_LIST; -} -extern "C" { + pub fn grin_create_vertex_property_list(arg1: GrinGraph) -> GrinVertexPropertyList; + #[cfg(feature = "grin_with_vertex_property")] - pub fn grin_destroy_vertex_property_list(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_PROPERTY_LIST); -} -extern "C" { + pub fn grin_destroy_vertex_property_list(arg1: GrinGraph, arg2: GrinVertexPropertyList); + #[cfg(feature = "grin_with_vertex_property")] pub fn grin_insert_vertex_property_to_list( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_PROPERTY_LIST, - arg3: GRIN_VERTEX_PROPERTY, + arg1: GrinGraph, + arg2: GrinVertexPropertyList, + arg3: GrinVertexProperty, ) -> bool; -} -extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_vertex_property")] pub fn grin_get_vertex_property_from_id( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE, - arg3: GRIN_VERTEX_PROPERTY_ID, - ) -> GRIN_VERTEX_PROPERTY; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexType, + arg3: GrinVertexPropertyId, + ) -> GrinVertexProperty; + #[cfg(feature = "grin_trait_natural_id_for_vertex_property")] pub fn grin_get_vertex_property_id( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE, - arg3: GRIN_VERTEX_PROPERTY, - ) -> GRIN_VERTEX_PROPERTY_ID; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexType, + arg3: GrinVertexProperty, + ) -> GrinVertexPropertyId; + #[cfg(feature = "grin_with_edge_property")] pub fn grin_get_edge_property_list_by_type( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE, - ) -> GRIN_EDGE_PROPERTY_LIST; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinEdgeType, + ) -> GrinEdgePropertyList; + #[cfg(feature = "grin_with_edge_property")] pub fn grin_get_edge_property_list_size( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_PROPERTY_LIST, + arg1: GrinGraph, + arg2: GrinEdgePropertyList, ) -> usize; -} -extern "C" { + #[cfg(feature = "grin_with_edge_property")] pub fn grin_get_edge_property_from_list( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_PROPERTY_LIST, + arg1: GrinGraph, + arg2: GrinEdgePropertyList, arg3: usize, - ) -> GRIN_EDGE_PROPERTY; -} -extern "C" { + ) -> GrinEdgeProperty; + #[cfg(feature = "grin_with_edge_property")] - pub fn grin_create_edge_property_list(arg1: GRIN_GRAPH) -> GRIN_EDGE_PROPERTY_LIST; -} -extern "C" { + pub fn grin_create_edge_property_list(arg1: GrinGraph) -> GrinEdgePropertyList; + #[cfg(feature = "grin_with_edge_property")] - pub fn grin_destroy_edge_property_list(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_PROPERTY_LIST); -} -extern "C" { + pub fn grin_destroy_edge_property_list(arg1: GrinGraph, arg2: GrinEdgePropertyList); + #[cfg(feature = "grin_with_edge_property")] pub fn grin_insert_edge_property_to_list( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_PROPERTY_LIST, - arg3: GRIN_EDGE_PROPERTY, + arg1: GrinGraph, + arg2: GrinEdgePropertyList, + arg3: GrinEdgeProperty, ) -> bool; -} -extern "C" { + #[cfg(feature = "grin_trait_natural_id_for_edge_property")] pub fn grin_get_edge_property_from_id( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE, - arg3: GRIN_EDGE_PROPERTY_ID, - ) -> GRIN_EDGE_PROPERTY; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinEdgeType, + arg3: GrinEdgePropertyId, + ) -> GrinEdgeProperty; + #[cfg(feature = "grin_trait_natural_id_for_edge_property")] pub fn grin_get_edge_property_id( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE, - arg3: GRIN_EDGE_PROPERTY, - ) -> GRIN_EDGE_PROPERTY_ID; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinEdgeType, + arg3: GrinEdgeProperty, + ) -> GrinEdgePropertyId; + #[cfg(feature = "grin_enable_row")] - pub fn grin_destroy_row(arg1: GRIN_GRAPH, arg2: GRIN_ROW); -} -extern "C" { + pub fn grin_destroy_row(arg1: GrinGraph, arg2: GrinRow); + #[doc = " @brief the value of a property from row by its position in row"] #[cfg(feature = "grin_enable_row")] pub fn grin_get_value_from_row( - arg1: GRIN_GRAPH, - arg2: GRIN_ROW, - arg3: GRIN_DATATYPE, + arg1: GrinGraph, + arg2: GrinRow, + arg3: GrinDatatype, arg4: usize, ) -> *const ::std::os::raw::c_void; -} -extern "C" { + #[doc = " @brief create a row, usually to get vertex/edge by primary keys"] #[cfg(feature = "grin_enable_row")] - pub fn grin_create_row(arg1: GRIN_GRAPH) -> GRIN_ROW; -} -extern "C" { + pub fn grin_create_row(arg1: GrinGraph) -> GrinRow; + #[doc = " @brief insert a value to the end of the row"] #[cfg(feature = "grin_enable_row")] pub fn grin_insert_value_to_row( - arg1: GRIN_GRAPH, - arg2: GRIN_ROW, - arg3: GRIN_DATATYPE, + arg1: GrinGraph, + arg2: GrinRow, + arg3: GrinDatatype, arg4: *const ::std::os::raw::c_void, ) -> bool; -} -extern "C" { - #[doc = " @brief destroy vertex property table\n @param GRIN_VERTEX_PROPERTY_TABLE vertex property table"] + + #[doc = " @brief destroy vertex property table\n @param GrinVertexPropertyTable vertex property table"] #[cfg(feature = "grin_enable_vertex_property_table")] - pub fn grin_destroy_vertex_property_table(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_PROPERTY_TABLE); -} -extern "C" { - #[doc = " @brief get the vertex property table of a certain vertex type\n No matter column or row store strategy is used in the storage,\n GRIN recommends to first get the property table of the vertex type,\n and then fetch values(rows) by vertex and property(list). However,\n GRIN does provide direct row fetching API when GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY\n is NOT set.\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_TYPE the vertex type"] + pub fn grin_destroy_vertex_property_table(arg1: GrinGraph, arg2: GrinVertexPropertyTable); + + #[doc = " @brief get the vertex property table of a certain vertex type\n No matter column or row store strategy is used in the storage,\n GRIN recommends to first get the property table of the vertex type,\n and then fetch values(rows) by vertex and property(list). However,\n GRIN does provide direct row fetching API when GrinAssumeColumnStoreForVertexProperty\n is NOT set.\n @param GrinGraph the graph\n @param GrinVertexType the vertex type"] #[cfg(feature = "grin_enable_vertex_property_table")] pub fn grin_get_vertex_property_table_by_type( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE, - ) -> GRIN_VERTEX_PROPERTY_TABLE; -} -extern "C" { - #[doc = " @brief get vertex property value from table\n @param GRIN_VERTEX_PROPERTY_TABLE vertex property table\n @param GRIN_VERTEX the vertex which is the row index\n @param GRIN_VERTEX_PROPERTY the vertex property which is the column index\n @return can be casted to the property data type by the caller"] + arg1: GrinGraph, + arg2: GrinVertexType, + ) -> GrinVertexPropertyTable; + + #[doc = " @brief get vertex property value from table\n @param GrinVertexPropertyTable vertex property table\n @param GrinVertex the vertex which is the row index\n @param GrinVertexProperty the vertex property which is the column index\n @return can be casted to the property data type by the caller"] #[cfg(feature = "grin_enable_vertex_property_table")] pub fn grin_get_value_from_vertex_property_table( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_PROPERTY_TABLE, - arg3: GRIN_VERTEX, - arg4: GRIN_VERTEX_PROPERTY, + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, ) -> *const ::std::os::raw::c_void; -} -extern "C" { - #[doc = " @brief get vertex row from table\n @param GRIN_VERTEX_PROPERTY_TABLE vertex property table\n @param GRIN_VERTEX the vertex which is the row index\n @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns"] + + #[doc = " @brief get vertex row from table\n @param GrinVertexPropertyTable vertex property table\n @param GrinVertex the vertex which is the row index\n @param GrinVertexPropertyList the vertex property list as columns"] #[cfg(all(feature = "grin_enable_vertex_property_table", feature = "grin_enable_row"))] pub fn grin_get_row_from_vertex_property_table( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_PROPERTY_TABLE, - arg3: GRIN_VERTEX, - arg4: GRIN_VERTEX_PROPERTY_LIST, - ) -> GRIN_ROW; -} -extern "C" { - #[doc = " @brief destroy edge property table\n @param GRIN_EDGE_PROPERTY_TABLE edge property table"] + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexPropertyList, + ) -> GrinRow; + + #[doc = " @brief destroy edge property table\n @param GrinEdgePropertyTable edge property table"] #[cfg(feature = "grin_enable_edge_property_table")] - pub fn grin_destroy_edge_property_table(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_PROPERTY_TABLE); -} -extern "C" { - #[doc = " @brief get the edge property table of a certain edge type\n No matter column or row store strategy is used in the storage,\n GRIN recommends to first get the property table of the edge type,\n and then fetch values(rows) by edge and property(list). However,\n GRIN does provide direct row fetching API when GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY\n is NOT set.\n @param GRIN_GRAPH the graph\n @param GRIN_EDGE_TYPE the edge type"] + pub fn grin_destroy_edge_property_table(arg1: GrinGraph, arg2: GrinEdgePropertyTable); + + #[doc = " @brief get the edge property table of a certain edge type\n No matter column or row store strategy is used in the storage,\n GRIN recommends to first get the property table of the edge type,\n and then fetch values(rows) by edge and property(list). However,\n GRIN does provide direct row fetching API when GrinAssumeColumnStoreForEdgeProperty\n is NOT set.\n @param GrinGraph the graph\n @param GrinEdgeType the edge type"] #[cfg(feature = "grin_enable_edge_property_table")] pub fn grin_get_edge_property_table_by_type( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE, - ) -> GRIN_EDGE_PROPERTY_TABLE; -} -extern "C" { - #[doc = " @brief get edge property value from table\n @param GRIN_EDGE_PROPERTY_TABLE edge property table\n @param GRIN_EDGE the edge which is the row index\n @param GRIN_EDGE_PROPERTY the edge property which is the column index\n @return can be casted to the property data type by the caller"] + arg1: GrinGraph, + arg2: GrinEdgeType, + ) -> GrinEdgePropertyTable; + + #[doc = " @brief get edge property value from table\n @param GrinEdgePropertyTable edge property table\n @param GrinEdge the edge which is the row index\n @param GrinEdgeProperty the edge property which is the column index\n @return can be casted to the property data type by the caller"] #[cfg(feature = "grin_enable_edge_property_table")] pub fn grin_get_value_from_edge_property_table( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_PROPERTY_TABLE, - arg3: GRIN_EDGE, - arg4: GRIN_EDGE_PROPERTY, + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, ) -> *const ::std::os::raw::c_void; -} -extern "C" { - #[doc = " @brief get edge row from table\n @param GRIN_EDGE_PROPERTY_TABLE edge property table\n @param GRIN_EDGE the edge which is the row index\n @param GRIN_EDGE_PROPERTY_LIST the edge property list as columns"] + + #[doc = " @brief get edge row from table\n @param GrinEdgePropertyTable edge property table\n @param GrinEdge the edge which is the row index\n @param GrinEdgePropertyList the edge property list as columns"] #[cfg(all(feature = "grin_enable_edge_property_table", feature = "grin_enable_row"))] pub fn grin_get_row_from_edge_property_table( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_PROPERTY_TABLE, - arg3: GRIN_EDGE, - arg4: GRIN_EDGE_PROPERTY_LIST, - ) -> GRIN_ROW; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgePropertyList, + ) -> GrinRow; + #[cfg(feature = "grin_with_vertex_property")] - pub fn grin_get_vertex_num_by_type(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_TYPE) -> usize; -} -extern "C" { + pub fn grin_get_vertex_num_by_type(arg1: GrinGraph, arg2: GrinVertexType) -> usize; + #[cfg(feature = "grin_with_edge_property")] - pub fn grin_get_edge_num_by_type(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE) -> usize; -} -extern "C" { + pub fn grin_get_edge_num_by_type(arg1: GrinGraph, arg2: GrinEdgeType) -> usize; + #[cfg(all(feature = "grin_enable_graph_partition", feature = "grin_with_vertex_property"))] pub fn grin_get_total_vertex_num_by_type( - arg1: GRIN_PARTITIONED_GRAPH, - arg2: GRIN_VERTEX_TYPE, + arg1: GrinPartitionedGraph, + arg2: GrinVertexType, ) -> usize; -} -extern "C" { + #[cfg(all(feature = "grin_enable_graph_partition", feature = "grin_with_edge_property"))] pub fn grin_get_total_edge_num_by_type( - arg1: GRIN_PARTITIONED_GRAPH, - arg2: GRIN_EDGE_TYPE, + arg1: GrinPartitionedGraph, + arg2: GrinEdgeType, ) -> usize; -} -extern "C" { + #[cfg(feature = "grin_assume_by_type_vertex_original_id")] pub fn grin_get_vertex_from_original_id_by_type( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE, - arg3: GRIN_VERTEX_ORIGINAL_ID, - ) -> GRIN_VERTEX; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexType, + arg3: GrinVertexOriginalId, + ) -> GrinVertex; + #[cfg(feature = "grin_trait_select_type_for_vertex_list")] pub fn grin_select_type_for_vertex_list( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE, - arg3: GRIN_VERTEX_LIST, - ) -> GRIN_VERTEX_LIST; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexType, + arg3: GrinVertexList, + ) -> GrinVertexList; + #[cfg(feature = "grin_trait_select_edge_type_for_adjacent_list")] pub fn grin_select_edge_type_for_adjacent_list( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE, - arg3: GRIN_ADJACENT_LIST, - ) -> GRIN_ADJACENT_LIST; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinEdgeType, + arg3: GrinAdjacentList, + ) -> GrinAdjacentList; + #[cfg(feature = "grin_with_vertex_property")] pub fn grin_equal_vertex_type( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE, - arg3: GRIN_VERTEX_TYPE, + arg1: GrinGraph, + arg2: GrinVertexType, + arg3: GrinVertexType, ) -> bool; -} -extern "C" { + #[cfg(feature = "grin_with_vertex_property")] - pub fn grin_get_vertex_type(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX) -> GRIN_VERTEX_TYPE; -} -extern "C" { + pub fn grin_get_vertex_type(arg1: GrinGraph, arg2: GrinVertex) -> GrinVertexType; + #[cfg(feature = "grin_with_vertex_property")] - pub fn grin_destroy_vertex_type(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_TYPE); -} -extern "C" { + pub fn grin_destroy_vertex_type(arg1: GrinGraph, arg2: GrinVertexType); + #[cfg(feature = "grin_with_vertex_property")] - pub fn grin_get_vertex_type_list(arg1: GRIN_GRAPH) -> GRIN_VERTEX_TYPE_LIST; -} -extern "C" { + pub fn grin_get_vertex_type_list(arg1: GrinGraph) -> GrinVertexTypeList; + #[cfg(feature = "grin_with_vertex_property")] - pub fn grin_destroy_vertex_type_list(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_TYPE_LIST); -} -extern "C" { + pub fn grin_destroy_vertex_type_list(arg1: GrinGraph, arg2: GrinVertexTypeList); + #[cfg(feature = "grin_with_vertex_property")] - pub fn grin_create_vertex_type_list(arg1: GRIN_GRAPH) -> GRIN_VERTEX_TYPE_LIST; -} -extern "C" { + pub fn grin_create_vertex_type_list(arg1: GrinGraph) -> GrinVertexTypeList; + #[cfg(feature = "grin_with_vertex_property")] pub fn grin_insert_vertex_type_to_list( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE_LIST, - arg3: GRIN_VERTEX_TYPE, + arg1: GrinGraph, + arg2: GrinVertexTypeList, + arg3: GrinVertexType, ) -> bool; -} -extern "C" { + #[cfg(feature = "grin_with_vertex_property")] - pub fn grin_get_vertex_type_list_size(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_TYPE_LIST) -> usize; -} -extern "C" { + pub fn grin_get_vertex_type_list_size(arg1: GrinGraph, arg2: GrinVertexTypeList) -> usize; + #[cfg(feature = "grin_with_vertex_property")] pub fn grin_get_vertex_type_from_list( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE_LIST, + arg1: GrinGraph, + arg2: GrinVertexTypeList, arg3: usize, - ) -> GRIN_VERTEX_TYPE; -} -extern "C" { + ) -> GrinVertexType; + #[cfg(feature = "grin_with_vertex_type_name")] pub fn grin_get_vertex_type_name( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE, + arg1: GrinGraph, + arg2: GrinVertexType, ) -> *const ::std::os::raw::c_char; -} -extern "C" { + #[cfg(feature = "grin_with_vertex_type_name")] pub fn grin_get_vertex_type_by_name( - arg1: GRIN_GRAPH, + arg1: GrinGraph, arg2: *const ::std::os::raw::c_char, - ) -> GRIN_VERTEX_TYPE; -} -extern "C" { + ) -> GrinVertexType; + #[cfg(feature = "grin_trait_natural_id_for_vertex_type")] - pub fn grin_get_vertex_type_id(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX_TYPE) - -> GRIN_VERTEX_TYPE_ID; -} -extern "C" { + pub fn grin_get_vertex_type_id(arg1: GrinGraph, arg2: GrinVertexType) + -> GrinVertexTypeId; + #[cfg(feature = "grin_trait_natural_id_for_vertex_type")] pub fn grin_get_vertex_type_from_id( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE_ID, - ) -> GRIN_VERTEX_TYPE; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexTypeId, + ) -> GrinVertexType; + #[cfg(feature = "grin_with_edge_property")] pub fn grin_equal_edge_type( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE, - arg3: GRIN_EDGE_TYPE, + arg1: GrinGraph, + arg2: GrinEdgeType, + arg3: GrinEdgeType, ) -> bool; -} -extern "C" { + #[cfg(feature = "grin_with_edge_property")] - pub fn grin_get_edge_type(arg1: GRIN_GRAPH, arg2: GRIN_EDGE) -> GRIN_EDGE_TYPE; -} -extern "C" { + pub fn grin_get_edge_type(arg1: GrinGraph, arg2: GrinEdge) -> GrinEdgeType; + #[cfg(feature = "grin_with_edge_property")] - pub fn grin_destroy_edge_type(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE); -} -extern "C" { + pub fn grin_destroy_edge_type(arg1: GrinGraph, arg2: GrinEdgeType); + #[cfg(feature = "grin_with_edge_property")] - pub fn grin_get_edge_type_list(arg1: GRIN_GRAPH) -> GRIN_EDGE_TYPE_LIST; -} -extern "C" { + pub fn grin_get_edge_type_list(arg1: GrinGraph) -> GrinEdgeTypeList; + #[cfg(feature = "grin_with_edge_property")] - pub fn grin_destroy_edge_type_list(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE_LIST); -} -extern "C" { + pub fn grin_destroy_edge_type_list(arg1: GrinGraph, arg2: GrinEdgeTypeList); + #[cfg(feature = "grin_with_edge_property")] - pub fn grin_create_edge_type_list(arg1: GRIN_GRAPH) -> GRIN_EDGE_TYPE_LIST; -} -extern "C" { + pub fn grin_create_edge_type_list(arg1: GrinGraph) -> GrinEdgeTypeList; + #[cfg(feature = "grin_with_edge_property")] pub fn grin_insert_edge_type_to_list( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE_LIST, - arg3: GRIN_EDGE_TYPE, + arg1: GrinGraph, + arg2: GrinEdgeTypeList, + arg3: GrinEdgeType, ) -> bool; -} -extern "C" { + #[cfg(feature = "grin_with_edge_property")] - pub fn grin_get_edge_type_list_size(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE_LIST) -> usize; -} -extern "C" { + pub fn grin_get_edge_type_list_size(arg1: GrinGraph, arg2: GrinEdgeTypeList) -> usize; + #[cfg(feature = "grin_with_edge_property")] pub fn grin_get_edge_type_from_list( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE_LIST, + arg1: GrinGraph, + arg2: GrinEdgeTypeList, arg3: usize, - ) -> GRIN_EDGE_TYPE; -} -extern "C" { + ) -> GrinEdgeType; + #[cfg(feature = "grin_with_edge_type_name")] pub fn grin_get_edge_type_name( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE, + arg1: GrinGraph, + arg2: GrinEdgeType, ) -> *const ::std::os::raw::c_char; -} -extern "C" { + #[cfg(feature = "grin_with_edge_type_name")] pub fn grin_get_edge_type_by_name( - arg1: GRIN_GRAPH, + arg1: GrinGraph, arg2: *const ::std::os::raw::c_char, - ) -> GRIN_EDGE_TYPE; -} -extern "C" { + ) -> GrinEdgeType; + #[cfg(feature = "grin_trait_natural_id_for_edge_type")] - pub fn grin_get_edge_type_id(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE) -> GRIN_EDGE_TYPE_ID; -} -extern "C" { + pub fn grin_get_edge_type_id(arg1: GrinGraph, arg2: GrinEdgeType) -> GrinEdgeTypeId; + #[cfg(feature = "grin_trait_natural_id_for_edge_type")] - pub fn grin_get_edge_type_from_id(arg1: GRIN_GRAPH, arg2: GRIN_EDGE_TYPE_ID) -> GRIN_EDGE_TYPE; -} -extern "C" { + pub fn grin_get_edge_type_from_id(arg1: GrinGraph, arg2: GrinEdgeTypeId) -> GrinEdgeType; + #[doc = " @brief the src vertex type list"] #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] pub fn grin_get_src_types_from_edge_type( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE, - ) -> GRIN_VERTEX_TYPE_LIST; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinEdgeType, + ) -> GrinVertexTypeList; + #[doc = " @brief get the dst vertex type list"] #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] pub fn grin_get_dst_types_from_edge_type( - arg1: GRIN_GRAPH, - arg2: GRIN_EDGE_TYPE, - ) -> GRIN_VERTEX_TYPE_LIST; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinEdgeType, + ) -> GrinVertexTypeList; + #[doc = " @brief get the edge type list related to a given pair of vertex types"] #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] pub fn grin_get_edge_types_from_vertex_type_pair( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_TYPE, - arg3: GRIN_VERTEX_TYPE, - ) -> GRIN_EDGE_TYPE_LIST; -} -extern "C" { + arg1: GrinGraph, + arg2: GrinVertexType, + arg3: GrinVertexType, + ) -> GrinEdgeTypeList; + #[cfg(feature = "grin_assume_all_vertex_list_sorted")] - pub fn grin_smaller_vertex(arg1: GRIN_GRAPH, arg2: GRIN_VERTEX, arg3: GRIN_VERTEX) -> bool; -} -extern "C" { - #[doc = " @brief get the position of a vertex in a sorted list\n caller must guarantee the input vertex list is sorted to get the correct result\n @param GRIN_GRAPH the graph\n @param GRIN_VERTEX_LIST the sorted vertex list\n @param VERTEX the vertex to find\n @param pos the returned position of the vertex\n @return false if the vertex is not found"] + pub fn grin_smaller_vertex(arg1: GrinGraph, arg2: GrinVertex, arg3: GrinVertex) -> bool; + + #[doc = " @brief get the position of a vertex in a sorted list\n caller must guarantee the input vertex list is sorted to get the correct result\n @param GrinGraph the graph\n @param GrinVertexList the sorted vertex list\n @param VERTEX the vertex to find\n @param pos the returned position of the vertex\n @return false if the vertex is not found"] #[cfg(all(feature = "grin_assume_all_vertex_list_sorted", feature = "grin_enable_vertex_list_array"))] pub fn grin_get_position_of_vertex_from_sorted_list( - arg1: GRIN_GRAPH, - arg2: GRIN_VERTEX_LIST, - arg3: GRIN_VERTEX, + arg1: GrinGraph, + arg2: GrinVertexList, + arg3: GrinVertex, ) -> usize; } diff --git a/modules/graph/grin/rust/parse.py b/modules/graph/grin/rust/parse.py index 98f028738..4316eed68 100644 --- a/modules/graph/grin/rust/parse.py +++ b/modules/graph/grin/rust/parse.py @@ -80,14 +80,37 @@ def to_rust(deps): return any_format.format(", ".join(conds)) else: assert False, f'unknown: {deps}' + +def snake_to_camel(s): + if s.startswith(('GRIN_DATATYPE_', 'GRIN_DIRECTION_')): + return s.upper() + return ''.join([w.capitalize() for w in s.split('_')]) + +def snake_to_camel_line(line): + segs = line.split(' ') + return ' '.join([snake_to_camel(s) if s.startswith('GRIN_') else s for s in segs]) + def rewrite(file, r, strip=7): with open(file) as f: lines = f.readlines() + externc_flag = True with open(file, 'w') as f: for i, line in enumerate(lines): if i < strip: continue + line = snake_to_camel_line(line) + if line.startswith('extern '): + if externc_flag: + f.write('extern "C" {\n') + externc_flag = False + continue + if line.startswith('}'): + if i < len(lines) - 1: + f.write('\n') + else: + f.write('}\n') + continue if line.find('pub fn') != -1: func_name = line func_name = func_name[func_name.find('pub fn')+7:] From aa1d053677717d903d9c1eed551dc1f80279537f Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Wed, 12 Apr 2023 19:35:07 +0800 Subject: [PATCH 45/85] refine doc after removing local complete --- modules/graph/grin/docs/README.md | 51 +++--- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 169 ++++++++----------- modules/graph/grin/rust/Cargo.toml | 36 ++-- modules/graph/grin/rust/grin_v6d.rs | 2 + modules/graph/grin/src/partition/topology.cc | 43 ----- 6 files changed, 104 insertions(+), 199 deletions(-) diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index 1793eb8d4..f3d515b77 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -116,36 +116,35 @@ The benefit is two-fold: 2. On the storage engine side, the predefined macros can filter out a large number of unnecessary APIs to avoid developers implementing them with boilerplate or inefficient code, since the design of storage engines may differ enormously from each other. -What follows is an example of predefined macros regarding the locally completeness of vertex properties. +What follows is an example of predefined macros regarding the storage's partition strategy for vertices. -- Four macros are provided: - 1. GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE - 2. GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE - 3. GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE - 4. GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -- Some assumptions may dominate others, which means that some assumptions apply in a wider range than others. Therefore, storage providers should be careful when setting these assumptions. Here, 1 dominates the others, which means that 2 to 4 are undefined when 1 is defined. Additionally, 2 dominates 4, and 3 dominates 4. -- GRIN provides different APIs under different assumptions. Suppose only 3 is defined; it means that vertices of certain types have all the properties locally complete, regardless of whether the vertex is master or mirror. In this case, GRIN provides an API to return these locally complete vertex types. -- In the case that none of these four macros is defined, GRIN will provide a per-vertex API to tell whether the vertex property is locally complete. +GRIN provides three predefined macros for whole graph partition strategies, namely: + +- GRIN_ASSUME_ALL_REPLICATE_PARTITION +- GRIN_ASSUME_EDGE_CUT_PARTITION +- GRIN_ASSUME_VERTEX_CUT_PARTITION + +If none of the three macros is predefined, GRIN assumes the storage supports hybrid graph partition strategy, +which means different vertex partition strategies are applied to different vertex types. +Then, to allow the storage to expose the details, GRIN provides a set of APIs as follows: + +- GRIN_VERTEX_TYPE_LIST grin_get_all_replicated_partition_vertex_types(GRIN_GRAPH); +- GRIN_VERTEX_TYPE_LIST grin_get_disjoint_partition_vertex_types(GRIN_GRAPH); +- GRIN_VERTEX_TYPE_LIST grin_get_follow_edge_partition_vertex_types(GRIN_GRAPH); ### Partition Strategy -GRIN provides two types (i.e., edge-cut and vertex-cut) of predefined partition strategies. Each strategy can be seen as a set of granular predefined macros based on the common understanding of the partition strategy. For storages using hybrid partition strategy, developers can set up the granular macros one after another. +As mentioned above, GRIN provides three types (i.e., all-replicate, edge-cut and vertex-cut) of predefined partition strategies. Each strategy can be seen as a set of granular predefined macros based on the common understanding of the partition strategy, and also infers some partition facts. For storages using hybrid partition strategy, developers can set up the granular macros one after another. +Next, we present edge-cut partition strategy as an example. #### Edge-cut Partition Strategy -- Vertex data is locally complete for master vertices. -- Edge data is locally complete for all edges. -- Neighbors are locally complete for master vertices. -- Vertex properties are locally complete for master vertices. -- Edge properties are locally complete for all edges. +- Vertex data is partitioned following master vertices. +- Edge data is partitioned following master & mirror edges. +- (Infer) All neighbors can be found locally for master vertices. +- Vertex properties are partitioned following for master vertices. +- Edge properties are partitioned following master & mirror edges. -#### Vertex-cut Partition Strategy - -- Vertex data is locally complete for all vertices. -- Edge data is locally complete for all edges. -- Mirror partition list is available for master vertices to broadcast messages. -- Vertex properties are locally complete for all vertices. -- Edge properties are locally complete for all edges. ### Property Graph Model GRIN makes the following assumptions for its property graph model. @@ -333,14 +332,6 @@ serveral partitions, GRIN refers one of them as the master vertex while others a aggregation purpose to share a common centural node for every one. - While in edgecut partition, the concept becomes inner & outer vertices. GRIN uses master & mirror vertices to represent inner & outer vertices respectively to unify these concepts. -### Local Complete -- The concept of local complete is with repect to whether a graph component adhere to a vertex or an edge is locally complete within the partition. -- Take vertex and properties as example. GRIN considers the vertex is "property local complete" if it can get all the properties of the vertex locally in the partition. -- There are concepts like "edge property local complete", "vertex neighbor local complete" and so on. -- GRIN does NOT assume any local complete on master vertices. Since in some extremely cases, master vertices -may NOT contain all the data or properties locally. -- GRIN currently provides vertex-level/edge-level local complete judgement APIs, while the introduction of type-level judgement APIs is open for discussion. - ### Natural ID Trait - Concepts represent the schema of the graph, such as vertex type and properties bound to a certain edge type, are usually numbered naturally from `0` to its `num - 1` in many storage engines. To facilitate further optimizations in the upper computing engines, GRIN provides the natural number ID trait. A storage can provide such a trait if diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 752060c94..46f2fdacd 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 752060c94e82dd24e000b37ecf3ceba30784d600 +Subproject commit 46f2fdacdb60cf7101c0fe30740a347d4f1f4dcf diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index ec2ce7dfc..3ba1ae57b 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -226,6 +226,12 @@ typedef enum { * the strategies. Please refer to the documents for strategy details. */ ///@{ +/** @ingroup PartitionStrategyMacros + * @brief The storage ONLY uses all-replicate partition strategy. This means the + * storage's replicate the graph among all partitions. +*/ +#define GRIN_ASSUME_ALL_REPLICATE_PARTITION + /** @ingroup PartitionStrategyMacros * @brief The storage ONLY uses edge-cut partition strategy. This means the * storage's entire partition strategy complies with edge-cut strategy @@ -248,38 +254,24 @@ typedef enum { */ ///@{ /** @ingroup PartitionAssumptionMacros - * @brief Assume the vertex data are local complete for all the vertices, - * thus there is no need to fetch vertex data from other partitions. -*/ -#define GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE - -/** @ingroup PartitionAssumptionMacros - * @brief Assume the vertex data are local complete for master vertices, - * and the vertex data of a mirror vertex can be fetched from its master partition. + * @brief Assume the vertex data are only stored together with master vertices. */ -#define GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_DATA /** @ingroup PartitionAssumptionMacros - * @brief Assume the edge data are local complete for all the edges, - * thus there is no need to fetch edge data from other partitions. + * @brief Assume the vertex data are replicated on both master and mirror vertices. */ -#define GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_DATA /** @ingroup PartitionAssumptionMacros - * @brief Assume the edge data are local complete for master edges, - * and the edge data of a mirror edge can be fetched from its master partition. + * @brief Assume the edge data are only stored together with master edges. */ -#define GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_DATA /** @ingroup PartitionAssumptionMacros - * @brief Assume neighbors of a vertex is always local complete for all vertices. + * @brief Assume the edge data are replicated on both master and mirror edges. */ -#define GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE - -/** @ingroup PartitionAssumptionMacros - * @brief Assume neighbors of a vertex is always local complete for master vertices. -*/ -#define GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_DATA ///@} /** @name TraitMirrorPartitionMacros @@ -367,14 +359,13 @@ typedef enum { #undef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION #undef GRIN_ENABLE_VERTEX_REF #undef GRIN_ENABLE_EDGE_REF +#undef GRIN_ASSUME_ALL_REPLICATE_PARTITION #undef GRIN_ASSUME_EDGE_CUT_PARTITION #undef GRIN_ASSUME_VERTEX_CUT_PARTITION -#undef GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_DATA +#undef GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_DATA +#undef GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_DATA +#undef GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_DATA #undef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST #undef GRIN_TRAIT_MIRROR_VERTEX_MIRROR_PARTITION_LIST #undef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST @@ -396,15 +387,19 @@ typedef enum { // GRIN_END // GRIN_FEATURE_DEPENDENCY +#ifdef GRIN_ASSUME_ALL_REPLICATE_PARTITION +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_DATA +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_DATA +#endif + #ifdef GRIN_ASSUME_EDGE_CUT_PARTITION -#define GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#define GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE -#define GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_DATA +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_DATA #endif #ifdef GRIN_ASSUME_VERTEX_CUT_PARTITION -#define GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE -#define GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_DATA +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_DATA #define GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST #endif // GRIN_END @@ -569,6 +564,14 @@ typedef enum { * the original iterator. */ #define GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST + +/** @ingroup TraitFilterTypeMacros + * @brief The storage provides specific relationship description for each + * vertex-edge-vertex type traid. This means further optimizations can be + * applied by the callers for vev traid under certain relationships, such as + * one-to-one, one-to-many, or many-to-one. +*/ +#define GRIN_TRAIT_SPECIFIC_VEV_RELATION ///@} @@ -578,74 +581,34 @@ typedef enum { */ ///@{ /** @ingroup PropetyAssumptionMacros - * @brief Assume property values of a vertex is always local complete for all vertices. -*/ -#define GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE - -/** @ingroup PropetyAssumptionMacros - * @brief Assume property values of a vertex is ONLY local complete for master vertices. -*/ -#define GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE - -/** @ingroup PropetyAssumptionMacros - * @brief Assume property values of a vertex is local complete for all vertices with a certain type. + * @brief Assume full property values of a vertex are ONLY stored with master vertices. */ -#define GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_PROPERTY /** @ingroup PropetyAssumptionMacros - * @brief Assume property values of a vertex is local complete for master vertices with a certain type. + * @brief Assume full property values of a vertex are replicated with master and mirror vertices. */ -#define GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_PROPERTY /** @ingroup PropetyAssumptionMacros - * @brief Assume vertex data is local complete for all vertices with a certain type. + * @brief Assume full property values of a vertex are split among master and mirror vertices. */ -#define GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE +#define GRIN_ASSUME_SPLIT_MASTER_MIRROR_PARTITION_FOR_VERTEX_PROPERTY /** @ingroup PropetyAssumptionMacros - * @brief Assume vertex data is local complete for master vertices with a certain type. + * @brief Assume full property values of an edge are ONLY stored with master edges. */ -#define GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_PROPERTY /** @ingroup PropetyAssumptionMacros - * @brief Assume property values of a edge is always local complete for all edges. + * @brief Assume full property values of an edge are replicated with master and mirror edges. */ -#define GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY /** @ingroup PropetyAssumptionMacros - * @brief Assume property values of a edge is ONLY local complete for master edges. + * @brief Assume full property values of an edge are split among master and mirror edges. */ -#define GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE - -/** @ingroup PropetyAssumptionMacros - * @brief Assume property values of a edge is local complete for all edges with a certain type. -*/ -#define GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE - -/** @ingroup PropetyAssumptionMacros - * @brief Assume property values of a edge is local complete for master edges with a certain type. -*/ -#define GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE - -/** @ingroup PropetyAssumptionMacros - * @brief Assume edge data is local complete for all edges with a certain type. -*/ -#define GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE - -/** @ingroup PropetyAssumptionMacros - * @brief Assume edge data is local complete for master edges with a certain type. -*/ -#define GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE - -/** @ingroup PropetyAssumptionMacros - * @brief Assume vertex neighbor is local complete for all vertices with a certain type. -*/ -#define GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE - -/** @ingroup PropetyAssumptionMacros - * @brief Assume vertex data is local complete for master vertices with a certain type. -*/ -#define GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#define GRIN_ASSUME_SPLIT_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY /** @ingroup PropetyAssumptionMacros * @brief The storage uses column store for vertex properties. @@ -682,20 +645,13 @@ typedef enum { #undef GRIN_TRAIT_SELECT_TYPE_FOR_EDGE_LIST #undef GRIN_TRAIT_SELECT_NEIGHBOR_TYPE_FOR_ADJACENT_LIST #undef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST -#undef GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_PROPERTY_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE -#undef GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE +#undef GRIN_TRAIT_SPECIFIC_VEV_RELATION +#undef GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_PROPERTY +#undef GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_PROPERTY +#undef GRIN_ASSUME_SPLIT_MASTER_MIRROR_PARTITION_FOR_VERTEX_PROPERTY +#undef GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_PROPERTY +#undef GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY +#undef GRIN_ASSUME_SPLIT_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY #undef GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY #undef GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY // GRIN_END @@ -722,14 +678,19 @@ typedef enum { // GRIN_END // GRIN_FEATURE_DEPENDENCY +#ifdef GRIN_ASSUME_ALL_REPLICATE_PARTITION +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_PROPERTY +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY +#endif + #ifdef GRIN_ASSUME_EDGE_CUT_PARTITION -#define GRIN_ASSUME_MASTER_VERTEX_PROPERTY_LOCAL_COMPLETE -#define GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_PROPERTY +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY #endif #ifdef GRIN_ASSUME_VERTEX_CUT_PARTITION -#define GRIN_ASSUME_ALL_VERTEX_PROPERTY_LOCAL_COMPLETE -#define GRIN_ASSUME_ALL_EDGE_PROPERTY_LOCAL_COMPLETE +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_PROPERTY +#define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY #endif #ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS @@ -908,6 +869,8 @@ typedef unsigned GRIN_VERTEX_PROPERTY_ID; #ifdef GRIN_WITH_EDGE_PROPERTY typedef void* GRIN_EDGE_TYPE; typedef void* GRIN_EDGE_TYPE_LIST; +typedef void* GRIN_VEV_TYPE; +typedef void* GRIN_VEV_TYPE_LIST; typedef void* GRIN_EDGE_PROPERTY; typedef void* GRIN_EDGE_PROPERTY_LIST; typedef void* GRIN_EDGE_PROPERTY_TABLE; diff --git a/modules/graph/grin/rust/Cargo.toml b/modules/graph/grin/rust/Cargo.toml index 6fb1a3779..7d8d32f5a 100644 --- a/modules/graph/grin/rust/Cargo.toml +++ b/modules/graph/grin/rust/Cargo.toml @@ -24,14 +24,13 @@ grin_enable_graph_partition = [] grin_trait_natural_id_for_partition = [] grin_enable_vertex_ref = [] grin_enable_edge_ref = [] -grin_assume_edge_cut_partition = ["grin_assume_master_vertex_data_local_complete", "grin_assume_all_edge_data_local_complete", "grin_assume_master_vertex_neighbor_local_complete", "grin_assume_master_vertex_property_local_complete", "grin_assume_all_edge_property_local_complete"] -grin_assume_vertex_cut_partition = ["grin_assume_all_vertex_data_local_complete", "grin_assume_all_edge_data_local_complete", "grin_trait_master_vertex_mirror_partition_list", "grin_assume_all_vertex_property_local_complete", "grin_assume_all_edge_property_local_complete"] -grin_assume_all_vertex_data_local_complete = [] -grin_assume_master_vertex_data_local_complete = [] -grin_assume_all_edge_data_local_complete = [] -grin_assume_master_edge_data_local_complete = [] -grin_assume_all_vertex_neighbor_local_complete = [] -grin_assume_master_vertex_neighbor_local_complete = [] +grin_assume_all_replicate_partition = ["grin_assume_replicate_master_mirror_partition_for_vertex_data", "grin_assume_replicate_master_mirror_partition_for_edge_data", "grin_assume_replicate_master_mirror_partition_for_vertex_property", "grin_assume_replicate_master_mirror_partition_for_edge_property"] +grin_assume_edge_cut_partition = ["grin_assume_master_only_partition_for_vertex_data", "grin_assume_replicate_master_mirror_partition_for_edge_data", "grin_assume_master_only_partition_for_vertex_property", "grin_assume_replicate_master_mirror_partition_for_edge_property"] +grin_assume_vertex_cut_partition = ["grin_assume_replicate_master_mirror_partition_for_vertex_data", "grin_assume_replicate_master_mirror_partition_for_edge_data", "grin_trait_master_vertex_mirror_partition_list", "grin_assume_replicate_master_mirror_partition_for_vertex_property", "grin_assume_replicate_master_mirror_partition_for_edge_property"] +grin_assume_master_only_partition_for_vertex_data = [] +grin_assume_replicate_master_mirror_partition_for_vertex_data = [] +grin_assume_master_only_partition_for_edge_data = [] +grin_assume_replicate_master_mirror_partition_for_edge_data = [] grin_trait_master_vertex_mirror_partition_list = [] grin_trait_mirror_vertex_mirror_partition_list = [] grin_trait_master_edge_mirror_partition_list = [] @@ -62,20 +61,13 @@ grin_trait_select_type_for_vertex_list = [] grin_trait_select_type_for_edge_list = [] grin_trait_select_neighbor_type_for_adjacent_list = [] grin_trait_select_edge_type_for_adjacent_list = [] -grin_assume_all_vertex_property_local_complete = [] -grin_assume_master_vertex_property_local_complete = [] -grin_assume_by_type_all_vertex_property_local_complete = [] -grin_assume_by_type_master_vertex_property_local_complete = [] -grin_assume_by_type_all_vertex_data_local_complete = [] -grin_assume_by_type_master_vertex_data_local_complete = [] -grin_assume_all_edge_property_local_complete = [] -grin_assume_master_edge_property_local_complete = [] -grin_assume_by_type_all_edge_property_local_complete = [] -grin_assume_by_type_master_edge_property_local_complete = [] -grin_assume_by_type_all_edge_data_local_complete = [] -grin_assume_by_type_master_edge_data_local_complete = [] -grin_assume_by_type_all_vertex_neighbor_local_complete = [] -grin_assume_by_type_master_vertex_neighbor_local_complete = [] +grin_trait_specific_vev_relation = [] +grin_assume_master_only_partition_for_vertex_property = [] +grin_assume_replicate_master_mirror_partition_for_vertex_property = [] +grin_assume_split_master_mirror_partition_for_vertex_property = [] +grin_assume_master_only_partition_for_edge_property = [] +grin_assume_replicate_master_mirror_partition_for_edge_property = [] +grin_assume_split_master_mirror_partition_for_edge_property = [] grin_assume_column_store_for_vertex_property = [] grin_assume_column_store_for_edge_property = [] grin_with_vertex_label = [] diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index 4cd13b103..eeeb3bbd5 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -51,6 +51,8 @@ pub type GrinVertexTypeId = ::std::os::raw::c_uint; pub type GrinVertexPropertyId = ::std::os::raw::c_uint; pub type GrinEdgeType = *mut ::std::os::raw::c_void; pub type GrinEdgeTypeList = *mut ::std::os::raw::c_void; +pub type GrinVevType = *mut ::std::os::raw::c_void; +pub type GrinVevTypeList = *mut ::std::os::raw::c_void; pub type GrinEdgeProperty = *mut ::std::os::raw::c_void; pub type GrinEdgePropertyList = *mut ::std::os::raw::c_void; pub type GrinEdgePropertyTable = *mut ::std::os::raw::c_void; diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc index 5d18705f8..233c50d59 100644 --- a/modules/graph/grin/src/partition/topology.cc +++ b/modules/graph/grin/src/partition/topology.cc @@ -29,27 +29,6 @@ size_t grin_get_total_edge_num(GRIN_PARTITIONED_GRAPH pg) { } #endif -#if defined(GRIN_WITH_VERTEX_DATA) && \ - !defined(GRIN_ASSUME_ALL_VERTEX_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_MASTER_VERTEX_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_ALL_VERTEX_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_DATA_LOCAL_COMPLETE) -bool grin_is_vertex_data_local_complete(GRIN_GRAPH, GRIN_VERTEX); - -GRIN_PARTITION_LIST grin_vertex_data_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); -#endif - -#if defined(GRIN_WITH_EDGE_DATA) && \ - !defined(GRIN_ASSUME_ALL_EDGE_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_MASTER_EDGE_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_ALL_EDGE_DATA_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_MASTER_EDGE_DATA_LOCAL_COMPLETE) -bool grin_is_edge_data_local_complete(GRIN_GRAPH, GRIN_EDGE); - -GRIN_PARTITION_LIST grin_edge_data_complete_partitions(GRIN_GRAPH, GRIN_EDGE); -#endif - - #ifdef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST GRIN_VERTEX_LIST grin_select_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _g = static_cast(g)->g; @@ -96,28 +75,6 @@ GRIN_EDGE_LIST grin_select_mirror_for_edge_list(GRIN_GRAPH, GRIN_EDGE_LIST); GRIN_EDGE_LIST grin_select_partition_for_edge_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_EDGE_LIST); #endif - -#if defined(GRIN_ENABLE_ADJACENT_LIST) && \ - !defined(GRIN_ASSUME_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_ALL_VERTEX_NEIGHBOR_LOCAL_COMPLETE) && \ - !defined(GRIN_ASSUME_BY_TYPE_MASTER_VERTEX_NEIGHBOR_LOCAL_COMPLETE) -// The concept of local_complete refers to whether we can get complete data or properties -// locally in the partition. It is orthogonal to the concept of master/mirror which -// is mainly designed for data aggregation. In some extremely cases, master vertices -// may NOT contain all the data or properties locally. -bool grin_is_vertex_neighbor_local_complete(GRIN_GRAPH, GRIN_VERTEX); - -/** - * @brief get the partitions whose combination can provide the complete - * neighbors of a vertex. - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX the vertex - */ -GRIN_PARTITION_LIST grin_vertex_neighbor_complete_partitions(GRIN_GRAPH, GRIN_VERTEX); -#endif - - #ifdef GRIN_TRAIT_SELECT_MASTER_NEIGHBOR_FOR_ADJACENT_LIST GRIN_ADJACENT_LIST grin_select_master_neighbor_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); From 7cc40868de2bbb68ffe4d5d7d06991f779e8d587 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Thu, 13 Apr 2023 20:15:09 +0800 Subject: [PATCH 46/85] update storage feature protobuf impl --- modules/graph/CMakeLists.txt | 8 +- modules/graph/grin/include | 2 +- modules/graph/grin/src/proto/graph.pb.cc | 4354 ++++++++++++++++++++ modules/graph/grin/src/proto/graph.pb.h | 4800 ++++++++++++++++++++++ modules/graph/grin/src/proto/message.cc | 326 ++ modules/graph/test/grin_test.cc | 4 + 6 files changed, 9492 insertions(+), 2 deletions(-) create mode 100644 modules/graph/grin/src/proto/graph.pb.cc create mode 100644 modules/graph/grin/src/proto/graph.pb.h create mode 100644 modules/graph/grin/src/proto/message.cc diff --git a/modules/graph/CMakeLists.txt b/modules/graph/CMakeLists.txt index 59416949f..528348ac6 100644 --- a/modules/graph/CMakeLists.txt +++ b/modules/graph/CMakeLists.txt @@ -8,6 +8,11 @@ file(GLOB_RECURSE VINEYARD_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}" "*.h") find_package(MPI REQUIRED) +find_package(libgrapelite REQUIRED) +find_package(Protobuf REQUIRED) +include_directories(${Protobuf_INCLUDE_DIRS}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + if(VINEYARD_MOD_SRCS) vineyard_generate( @@ -175,7 +180,7 @@ endif() # grin lib file(GLOB_RECURSE GRIN_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}" "grin/*.cc") add_library(vineyard_grin ${GRIN_SRC_FILES}) -target_link_libraries(vineyard_grin PRIVATE vineyard_graph) +target_link_libraries(vineyard_grin PRIVATE vineyard_graph ${Protobuf_LIBRARIES}) # grin test if(BUILD_VINEYARD_TESTS) @@ -193,6 +198,7 @@ if(BUILD_VINEYARD_TESTS) target_link_libraries(${T_NAME} PRIVATE vineyard_graph vineyard_grin + ${Protobuf_LIBRARIES} ${ARROW_SHARED_LIB} ${MPI_CXX_LIBRARIES}) if(${LIBUNWIND_FOUND}) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 46f2fdacd..49798f3ae 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 46f2fdacdb60cf7101c0fe30740a347d4f1f4dcf +Subproject commit 49798f3aea07a53ff14b48ce02fdf4e6743249e9 diff --git a/modules/graph/grin/src/proto/graph.pb.cc b/modules/graph/grin/src/proto/graph.pb.cc new file mode 100644 index 000000000..a03699371 --- /dev/null +++ b/modules/graph/grin/src/proto/graph.pb.cc @@ -0,0 +1,4354 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: graph.proto + +#include "graph.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace grin { +PROTOBUF_CONSTEXPR TopologyTrait::TopologyTrait( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.vertex_list_retrievals_)*/{} + , /*decltype(_impl_._vertex_list_retrievals_cached_byte_size_)*/{0} + , /*decltype(_impl_.edge_list_retrievals_)*/{} + , /*decltype(_impl_._edge_list_retrievals_cached_byte_size_)*/{0} + , /*decltype(_impl_.adjacent_list_retrievals_)*/{} + , /*decltype(_impl_._adjacent_list_retrievals_cached_byte_size_)*/{0} + , /*decltype(_impl_.grin_assume_has_directed_graph_)*/false + , /*decltype(_impl_.grin_assume_has_undirected_graph_)*/false + , /*decltype(_impl_.grin_assume_has_multi_edge_graph_)*/false + , /*decltype(_impl_.grin_with_vertex_original_id_)*/false + , /*decltype(_impl_.grin_with_vertex_data_)*/false + , /*decltype(_impl_.grin_with_edge_data_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct TopologyTraitDefaultTypeInternal { + PROTOBUF_CONSTEXPR TopologyTraitDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~TopologyTraitDefaultTypeInternal() {} + union { + TopologyTrait _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TopologyTraitDefaultTypeInternal _TopologyTrait_default_instance_; +PROTOBUF_CONSTEXPR MirrorPartitionListTrait::MirrorPartitionListTrait( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.grin_trait_master_vertex_mirror_partition_list_)*/false + , /*decltype(_impl_.grin_trait_mirror_vertex_mirror_partition_list_)*/false + , /*decltype(_impl_.grin_trait_master_edge_mirror_partition_list_)*/false + , /*decltype(_impl_.grin_trait_mirror_edge_mirror_partition_list_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct MirrorPartitionListTraitDefaultTypeInternal { + PROTOBUF_CONSTEXPR MirrorPartitionListTraitDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~MirrorPartitionListTraitDefaultTypeInternal() {} + union { + MirrorPartitionListTrait _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MirrorPartitionListTraitDefaultTypeInternal _MirrorPartitionListTrait_default_instance_; +PROTOBUF_CONSTEXPR PartitionTrait::PartitionTrait( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.mirror_partition_list_trait_)*/nullptr + , /*decltype(_impl_.graph_partition_strategy_)*/0 + , /*decltype(_impl_.grin_trait_natural_id_for_partition_)*/false + , /*decltype(_impl_.grin_enable_vertex_ref_)*/false + , /*decltype(_impl_.grin_enable_edge_ref_)*/false + , /*decltype(_impl_.grin_trait_select_master_for_vertex_list_)*/false + , /*decltype(_impl_.vertex_data_)*/0 + , /*decltype(_impl_.edge_data_)*/0 + , /*decltype(_impl_.grin_trait_select_partition_for_vertex_list_)*/false + , /*decltype(_impl_.grin_trait_select_master_for_edge_list_)*/false + , /*decltype(_impl_.grin_trait_select_partition_for_edge_list_)*/false + , /*decltype(_impl_.grin_trait_select_master_neighbor_for_adjacent_list_)*/false + , /*decltype(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct PartitionTraitDefaultTypeInternal { + PROTOBUF_CONSTEXPR PartitionTraitDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PartitionTraitDefaultTypeInternal() {} + union { + PartitionTrait _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PartitionTraitDefaultTypeInternal _PartitionTrait_default_instance_; +PROTOBUF_CONSTEXPR VertexPropertyTrait::VertexPropertyTrait( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.grin_with_vertex_property_)*/false + , /*decltype(_impl_.grin_with_vertex_property_name_)*/false + , /*decltype(_impl_.grin_with_vertex_type_name_)*/false + , /*decltype(_impl_.grin_enable_vertex_property_table_)*/false + , /*decltype(_impl_.grin_enable_vertex_primary_keys_)*/false + , /*decltype(_impl_.grin_trait_natural_id_for_vertex_type_)*/false + , /*decltype(_impl_.grin_trait_natural_id_for_vertex_property_)*/false + , /*decltype(_impl_.grin_assume_by_type_vertex_original_id_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct VertexPropertyTraitDefaultTypeInternal { + PROTOBUF_CONSTEXPR VertexPropertyTraitDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~VertexPropertyTraitDefaultTypeInternal() {} + union { + VertexPropertyTrait _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VertexPropertyTraitDefaultTypeInternal _VertexPropertyTrait_default_instance_; +PROTOBUF_CONSTEXPR EdgePropertyTrait::EdgePropertyTrait( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.grin_with_edge_property_)*/false + , /*decltype(_impl_.grin_with_edge_property_name_)*/false + , /*decltype(_impl_.grin_with_edge_type_name_)*/false + , /*decltype(_impl_.grin_enable_edge_property_table_)*/false + , /*decltype(_impl_.grin_enable_edge_primary_keys_)*/false + , /*decltype(_impl_.grin_trait_natural_id_for_edge_type_)*/false + , /*decltype(_impl_.grin_trait_natural_id_for_edge_property_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct EdgePropertyTraitDefaultTypeInternal { + PROTOBUF_CONSTEXPR EdgePropertyTraitDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~EdgePropertyTraitDefaultTypeInternal() {} + union { + EdgePropertyTrait _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EdgePropertyTraitDefaultTypeInternal _EdgePropertyTrait_default_instance_; +PROTOBUF_CONSTEXPR PropertyTrait::PropertyTrait( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.vertex_property_trait_)*/nullptr + , /*decltype(_impl_.edge_property_trait_)*/nullptr + , /*decltype(_impl_.vertex_property_)*/0 + , /*decltype(_impl_.edge_property_)*/0 + , /*decltype(_impl_.grin_enable_row_)*/false + , /*decltype(_impl_.grin_assume_column_store_for_vertex_property_)*/false + , /*decltype(_impl_.grin_assume_column_store_for_edge_property_)*/false + , /*decltype(_impl_.grin_trait_select_type_for_vertex_list_)*/false + , /*decltype(_impl_.grin_trait_select_type_for_edge_list_)*/false + , /*decltype(_impl_.grin_trait_select_neighbor_type_for_adjacent_list_)*/false + , /*decltype(_impl_.grin_trait_select_edge_type_for_adjacent_list_)*/false + , /*decltype(_impl_.grin_trait_specific_vev_relation_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct PropertyTraitDefaultTypeInternal { + PROTOBUF_CONSTEXPR PropertyTraitDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PropertyTraitDefaultTypeInternal() {} + union { + PropertyTrait _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyTraitDefaultTypeInternal _PropertyTrait_default_instance_; +PROTOBUF_CONSTEXPR IndexTrait::IndexTrait( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.grin_with_vertex_label_)*/false + , /*decltype(_impl_.grin_with_edge_label_)*/false + , /*decltype(_impl_.grin_assume_all_vertex_list_sorted_)*/false + , /*decltype(_impl_._cached_size_)*/{}} {} +struct IndexTraitDefaultTypeInternal { + PROTOBUF_CONSTEXPR IndexTraitDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~IndexTraitDefaultTypeInternal() {} + union { + IndexTrait _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 IndexTraitDefaultTypeInternal _IndexTrait_default_instance_; +PROTOBUF_CONSTEXPR PredicateTrait::PredicateTrait( + ::_pbi::ConstantInitialized) {} +struct PredicateTraitDefaultTypeInternal { + PROTOBUF_CONSTEXPR PredicateTraitDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PredicateTraitDefaultTypeInternal() {} + union { + PredicateTrait _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PredicateTraitDefaultTypeInternal _PredicateTrait_default_instance_; +PROTOBUF_CONSTEXPR StorageTrait::StorageTrait( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.specific_trait_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}} {} +struct StorageTraitDefaultTypeInternal { + PROTOBUF_CONSTEXPR StorageTraitDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~StorageTraitDefaultTypeInternal() {} + union { + StorageTrait _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StorageTraitDefaultTypeInternal _StorageTrait_default_instance_; +PROTOBUF_CONSTEXPR Statistics::Statistics( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.vertex_count_)*/0 + , /*decltype(_impl_.edge_count_)*/0 + , /*decltype(_impl_.partition_count_)*/0 + , /*decltype(_impl_.vertex_type_count_)*/0 + , /*decltype(_impl_.edge_type_count_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct StatisticsDefaultTypeInternal { + PROTOBUF_CONSTEXPR StatisticsDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~StatisticsDefaultTypeInternal() {} + union { + Statistics _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StatisticsDefaultTypeInternal _Statistics_default_instance_; +PROTOBUF_CONSTEXPR Graph::Graph( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.traits_)*/{} + , /*decltype(_impl_.uri_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.grin_version_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.statistics_)*/nullptr + , /*decltype(_impl_._cached_size_)*/{}} {} +struct GraphDefaultTypeInternal { + PROTOBUF_CONSTEXPR GraphDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GraphDefaultTypeInternal() {} + union { + Graph _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GraphDefaultTypeInternal _Graph_default_instance_; +} // namespace grin +static ::_pb::Metadata file_level_metadata_graph_2eproto[11]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_graph_2eproto[3]; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_graph_2eproto = nullptr; + +const uint32_t TableStruct_graph_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_assume_has_directed_graph_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_assume_has_undirected_graph_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_assume_has_multi_edge_graph_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_with_vertex_original_id_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_with_vertex_data_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_with_edge_data_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.vertex_list_retrievals_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.edge_list_retrievals_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.adjacent_list_retrievals_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListTrait, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListTrait, _impl_.grin_trait_master_vertex_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListTrait, _impl_.grin_trait_mirror_vertex_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListTrait, _impl_.grin_trait_master_edge_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListTrait, _impl_.grin_trait_mirror_edge_mirror_partition_list_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.graph_partition_strategy_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_natural_id_for_partition_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_enable_vertex_ref_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_enable_edge_ref_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.vertex_data_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.edge_data_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.mirror_partition_list_trait_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_master_for_vertex_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_partition_for_vertex_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_master_for_edge_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_partition_for_edge_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_master_neighbor_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_with_vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_with_vertex_property_name_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_with_vertex_type_name_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_enable_vertex_property_table_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_enable_vertex_primary_keys_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_trait_natural_id_for_vertex_type_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_trait_natural_id_for_vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_assume_by_type_vertex_original_id_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_with_edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_with_edge_property_name_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_with_edge_type_name_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_enable_edge_property_table_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_enable_edge_primary_keys_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_trait_natural_id_for_edge_type_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_trait_natural_id_for_edge_property_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_enable_row_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.vertex_property_trait_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.edge_property_trait_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_assume_column_store_for_vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_assume_column_store_for_edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_trait_select_type_for_vertex_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_trait_select_type_for_edge_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_trait_select_neighbor_type_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_trait_select_edge_type_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_trait_specific_vev_relation_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::IndexTrait, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::grin::IndexTrait, _impl_.grin_with_vertex_label_), + PROTOBUF_FIELD_OFFSET(::grin::IndexTrait, _impl_.grin_with_edge_label_), + PROTOBUF_FIELD_OFFSET(::grin::IndexTrait, _impl_.grin_assume_all_vertex_list_sorted_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::PredicateTrait, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::StorageTrait, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::grin::StorageTrait, _impl_._oneof_case_[0]), + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::grin::StorageTrait, _impl_.specific_trait_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::Statistics, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::grin::Statistics, _impl_.vertex_count_), + PROTOBUF_FIELD_OFFSET(::grin::Statistics, _impl_.edge_count_), + PROTOBUF_FIELD_OFFSET(::grin::Statistics, _impl_.partition_count_), + PROTOBUF_FIELD_OFFSET(::grin::Statistics, _impl_.vertex_type_count_), + PROTOBUF_FIELD_OFFSET(::grin::Statistics, _impl_.edge_type_count_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::grin::Graph, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.uri_), + PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.grin_version_), + PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.traits_), + PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.statistics_), +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, -1, sizeof(::grin::TopologyTrait)}, + { 15, -1, -1, sizeof(::grin::MirrorPartitionListTrait)}, + { 25, -1, -1, sizeof(::grin::PartitionTrait)}, + { 44, -1, -1, sizeof(::grin::VertexPropertyTrait)}, + { 58, -1, -1, sizeof(::grin::EdgePropertyTrait)}, + { 71, -1, -1, sizeof(::grin::PropertyTrait)}, + { 89, -1, -1, sizeof(::grin::IndexTrait)}, + { 98, -1, -1, sizeof(::grin::PredicateTrait)}, + { 104, -1, -1, sizeof(::grin::StorageTrait)}, + { 116, -1, -1, sizeof(::grin::Statistics)}, + { 127, -1, -1, sizeof(::grin::Graph)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::grin::_TopologyTrait_default_instance_._instance, + &::grin::_MirrorPartitionListTrait_default_instance_._instance, + &::grin::_PartitionTrait_default_instance_._instance, + &::grin::_VertexPropertyTrait_default_instance_._instance, + &::grin::_EdgePropertyTrait_default_instance_._instance, + &::grin::_PropertyTrait_default_instance_._instance, + &::grin::_IndexTrait_default_instance_._instance, + &::grin::_PredicateTrait_default_instance_._instance, + &::grin::_StorageTrait_default_instance_._instance, + &::grin::_Statistics_default_instance_._instance, + &::grin::_Graph_default_instance_._instance, +}; + +const char descriptor_table_protodef_graph_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\013graph.proto\022\004grin\"\214\003\n\rTopologyTrait\022&\n" + "\036grin_assume_has_directed_graph\030\001 \001(\010\022(\n" + " grin_assume_has_undirected_graph\030\002 \001(\010\022" + "(\n grin_assume_has_multi_edge_graph\030\003 \001(" + "\010\022$\n\034grin_with_vertex_original_id\030\004 \001(\010\022" + "\035\n\025grin_with_vertex_data\030\005 \001(\010\022\033\n\023grin_w" + "ith_edge_data\030\006 \001(\010\0223\n\026vertex_list_retri" + "evals\030\007 \003(\0162\023.grin.ListRetrieval\0221\n\024edge" + "_list_retrievals\030\010 \003(\0162\023.grin.ListRetrie" + "val\0225\n\030adjacent_list_retrievals\030\t \003(\0162\023." + "grin.ListRetrieval\"\366\001\n\030MirrorPartitionLi" + "stTrait\0226\n.grin_trait_master_vertex_mirr" + "or_partition_list\030\001 \001(\010\0226\n.grin_trait_mi" + "rror_vertex_mirror_partition_list\030\002 \001(\010\022" + "4\n,grin_trait_master_edge_mirror_partiti" + "on_list\030\003 \001(\010\0224\n,grin_trait_mirror_edge_" + "mirror_partition_list\030\004 \001(\010\"\271\005\n\016Partitio" + "nTrait\022>\n\030graph_partition_strategy\030\001 \001(\016" + "2\034.grin.GraphPartitionStrategy\022+\n#grin_t" + "rait_natural_id_for_partition\030\002 \001(\010\022\036\n\026g" + "rin_enable_vertex_ref\030\003 \001(\010\022\034\n\024grin_enab" + "le_edge_ref\030\004 \001(\010\0228\n\013vertex_data\030\005 \001(\0162#" + ".grin.PropertyDataPartitionStrategy\0226\n\te" + "dge_data\030\006 \001(\0162#.grin.PropertyDataPartit" + "ionStrategy\022C\n\033mirror_partition_list_tra" + "it\030\007 \001(\0132\036.grin.MirrorPartitionListTrait" + "\0220\n(grin_trait_select_master_for_vertex_" + "list\030\010 \001(\010\0223\n+grin_trait_select_partitio" + "n_for_vertex_list\030\t \001(\010\022.\n&grin_trait_se" + "lect_master_for_edge_list\030\n \001(\010\0221\n)grin_" + "trait_select_partition_for_edge_list\030\013 \001" + "(\010\022;\n3grin_trait_select_master_neighbor_" + "for_adjacent_list\030\014 \001(\010\022>\n6grin_trait_se" + "lect_neighbor_partition_for_adjacent_lis" + "t\030\r \001(\010\"\352\002\n\023VertexPropertyTrait\022!\n\031grin_" + "with_vertex_property\030\001 \001(\010\022&\n\036grin_with_" + "vertex_property_name\030\002 \001(\010\022\"\n\032grin_with_" + "vertex_type_name\030\003 \001(\010\022)\n!grin_enable_ve" + "rtex_property_table\030\004 \001(\010\022\'\n\037grin_enable" + "_vertex_primary_keys\030\005 \001(\010\022-\n%grin_trait" + "_natural_id_for_vertex_type\030\006 \001(\010\0221\n)gri" + "n_trait_natural_id_for_vertex_property\030\007" + " \001(\010\022.\n&grin_assume_by_type_vertex_origi" + "nal_id\030\010 \001(\010\"\252\002\n\021EdgePropertyTrait\022\037\n\027gr" + "in_with_edge_property\030\001 \001(\010\022$\n\034grin_with" + "_edge_property_name\030\002 \001(\010\022 \n\030grin_with_e" + "dge_type_name\030\003 \001(\010\022\'\n\037grin_enable_edge_" + "property_table\030\004 \001(\010\022%\n\035grin_enable_edge" + "_primary_keys\030\005 \001(\010\022+\n#grin_trait_natura" + "l_id_for_edge_type\030\006 \001(\010\022/\n\'grin_trait_n" + "atural_id_for_edge_property\030\007 \001(\010\"\366\004\n\rPr" + "opertyTrait\022\027\n\017grin_enable_row\030\001 \001(\010\0228\n\025" + "vertex_property_trait\030\002 \001(\0132\031.grin.Verte" + "xPropertyTrait\0224\n\023edge_property_trait\030\003 " + "\001(\0132\027.grin.EdgePropertyTrait\022<\n\017vertex_p" + "roperty\030\004 \001(\0162#.grin.PropertyDataPartiti" + "onStrategy\022:\n\redge_property\030\005 \001(\0162#.grin" + ".PropertyDataPartitionStrategy\0224\n,grin_a" + "ssume_column_store_for_vertex_property\030\006" + " \001(\010\0222\n*grin_assume_column_store_for_edg" + "e_property\030\007 \001(\010\022.\n&grin_trait_select_ty" + "pe_for_vertex_list\030\010 \001(\010\022,\n$grin_trait_s" + "elect_type_for_edge_list\030\t \001(\010\0229\n1grin_t" + "rait_select_neighbor_type_for_adjacent_l" + "ist\030\n \001(\010\0225\n-grin_trait_select_edge_type" + "_for_adjacent_list\030\013 \001(\010\022(\n grin_trait_s" + "pecific_vev_relation\030\014 \001(\010\"v\n\nIndexTrait" + "\022\036\n\026grin_with_vertex_label\030\001 \001(\010\022\034\n\024grin" + "_with_edge_label\030\002 \001(\010\022*\n\"grin_assume_al" + "l_vertex_list_sorted\030\003 \001(\010\"\020\n\016PredicateT" + "rait\"\211\002\n\014StorageTrait\022-\n\016topology_trait\030" + "\001 \001(\0132\023.grin.TopologyTraitH\000\022/\n\017partitio" + "n_trait\030\002 \001(\0132\024.grin.PartitionTraitH\000\022-\n" + "\016property_trait\030\003 \001(\0132\023.grin.PropertyTra" + "itH\000\022\'\n\013index_trait\030\004 \001(\0132\020.grin.IndexTr" + "aitH\000\022/\n\017predicate_trait\030\005 \001(\0132\024.grin.Pr" + "edicateTraitH\000B\020\n\016specific_trait\"\203\001\n\nSta" + "tistics\022\024\n\014vertex_count\030\001 \001(\005\022\022\n\nedge_co" + "unt\030\002 \001(\005\022\027\n\017partition_count\030\003 \001(\005\022\031\n\021ve" + "rtex_type_count\030\004 \001(\005\022\027\n\017edge_type_count" + "\030\005 \001(\005\"t\n\005Graph\022\013\n\003uri\030\001 \001(\t\022\024\n\014grin_ver" + "sion\030\002 \001(\t\022\"\n\006traits\030\003 \003(\0132\022.grin.Storag" + "eTrait\022$\n\nstatistics\030\004 \001(\0132\020.grin.Statis" + "tics*>\n\rListRetrieval\022\t\n\005LR_NA\020\000\022\021\n\rLR_A" + "RRAY_LIKE\020\001\022\017\n\013LR_ITERATOR\020\002*u\n\026GraphPar" + "titionStrategy\022\n\n\006GPS_NA\020\000\022\025\n\021GPS_ALL_RE" + "PLICATE\020\001\022\020\n\014GPS_EDGE_CUT\020\002\022\022\n\016GPS_VERTE" + "X_CUT\020\003\022\022\n\016GPS_HYBRID_CUT\020\004*\202\001\n\035Property" + "DataPartitionStrategy\022\013\n\007PDPS_NA\020\000\022\024\n\020PD" + "PS_MASTER_ONLY\020\001\022 \n\034PDPS_REPLICATE_MASTE" + "R_MIRROR\020\002\022\034\n\030PDPS_SPLIT_MASTER_MIRROR\020\003" + "b\006proto3" + ; +static ::_pbi::once_flag descriptor_table_graph_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_graph_2eproto = { + false, false, 3648, descriptor_table_protodef_graph_2eproto, + "graph.proto", + &descriptor_table_graph_2eproto_once, nullptr, 0, 11, + schemas, file_default_instances, TableStruct_graph_2eproto::offsets, + file_level_metadata_graph_2eproto, file_level_enum_descriptors_graph_2eproto, + file_level_service_descriptors_graph_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_graph_2eproto_getter() { + return &descriptor_table_graph_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_graph_2eproto(&descriptor_table_graph_2eproto); +namespace grin { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ListRetrieval_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_graph_2eproto); + return file_level_enum_descriptors_graph_2eproto[0]; +} +bool ListRetrieval_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GraphPartitionStrategy_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_graph_2eproto); + return file_level_enum_descriptors_graph_2eproto[1]; +} +bool GraphPartitionStrategy_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PropertyDataPartitionStrategy_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_graph_2eproto); + return file_level_enum_descriptors_graph_2eproto[2]; +} +bool PropertyDataPartitionStrategy_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + + +// =================================================================== + +class TopologyTrait::_Internal { + public: +}; + +TopologyTrait::TopologyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:grin.TopologyTrait) +} +TopologyTrait::TopologyTrait(const TopologyTrait& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + TopologyTrait* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.vertex_list_retrievals_){from._impl_.vertex_list_retrievals_} + , /*decltype(_impl_._vertex_list_retrievals_cached_byte_size_)*/{0} + , decltype(_impl_.edge_list_retrievals_){from._impl_.edge_list_retrievals_} + , /*decltype(_impl_._edge_list_retrievals_cached_byte_size_)*/{0} + , decltype(_impl_.adjacent_list_retrievals_){from._impl_.adjacent_list_retrievals_} + , /*decltype(_impl_._adjacent_list_retrievals_cached_byte_size_)*/{0} + , decltype(_impl_.grin_assume_has_directed_graph_){} + , decltype(_impl_.grin_assume_has_undirected_graph_){} + , decltype(_impl_.grin_assume_has_multi_edge_graph_){} + , decltype(_impl_.grin_with_vertex_original_id_){} + , decltype(_impl_.grin_with_vertex_data_){} + , decltype(_impl_.grin_with_edge_data_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.grin_assume_has_directed_graph_, &from._impl_.grin_assume_has_directed_graph_, + static_cast(reinterpret_cast(&_impl_.grin_with_edge_data_) - + reinterpret_cast(&_impl_.grin_assume_has_directed_graph_)) + sizeof(_impl_.grin_with_edge_data_)); + // @@protoc_insertion_point(copy_constructor:grin.TopologyTrait) +} + +inline void TopologyTrait::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.vertex_list_retrievals_){arena} + , /*decltype(_impl_._vertex_list_retrievals_cached_byte_size_)*/{0} + , decltype(_impl_.edge_list_retrievals_){arena} + , /*decltype(_impl_._edge_list_retrievals_cached_byte_size_)*/{0} + , decltype(_impl_.adjacent_list_retrievals_){arena} + , /*decltype(_impl_._adjacent_list_retrievals_cached_byte_size_)*/{0} + , decltype(_impl_.grin_assume_has_directed_graph_){false} + , decltype(_impl_.grin_assume_has_undirected_graph_){false} + , decltype(_impl_.grin_assume_has_multi_edge_graph_){false} + , decltype(_impl_.grin_with_vertex_original_id_){false} + , decltype(_impl_.grin_with_vertex_data_){false} + , decltype(_impl_.grin_with_edge_data_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +TopologyTrait::~TopologyTrait() { + // @@protoc_insertion_point(destructor:grin.TopologyTrait) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void TopologyTrait::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.vertex_list_retrievals_.~RepeatedField(); + _impl_.edge_list_retrievals_.~RepeatedField(); + _impl_.adjacent_list_retrievals_.~RepeatedField(); +} + +void TopologyTrait::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void TopologyTrait::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.TopologyTrait) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.vertex_list_retrievals_.Clear(); + _impl_.edge_list_retrievals_.Clear(); + _impl_.adjacent_list_retrievals_.Clear(); + ::memset(&_impl_.grin_assume_has_directed_graph_, 0, static_cast( + reinterpret_cast(&_impl_.grin_with_edge_data_) - + reinterpret_cast(&_impl_.grin_assume_has_directed_graph_)) + sizeof(_impl_.grin_with_edge_data_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* TopologyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool grin_assume_has_directed_graph = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.grin_assume_has_directed_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_assume_has_undirected_graph = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.grin_assume_has_undirected_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_assume_has_multi_edge_graph = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.grin_assume_has_multi_edge_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_with_vertex_original_id = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _impl_.grin_with_vertex_original_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_with_vertex_data = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + _impl_.grin_with_vertex_data_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_with_edge_data = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + _impl_.grin_with_edge_data_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated .grin.ListRetrieval vertex_list_retrievals = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_vertex_list_retrievals(), ptr, ctx); + CHK_(ptr); + } else if (static_cast(tag) == 56) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_add_vertex_list_retrievals(static_cast<::grin::ListRetrieval>(val)); + } else + goto handle_unusual; + continue; + // repeated .grin.ListRetrieval edge_list_retrievals = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_edge_list_retrievals(), ptr, ctx); + CHK_(ptr); + } else if (static_cast(tag) == 64) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_add_edge_list_retrievals(static_cast<::grin::ListRetrieval>(val)); + } else + goto handle_unusual; + continue; + // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_adjacent_list_retrievals(), ptr, ctx); + CHK_(ptr); + } else if (static_cast(tag) == 72) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_add_adjacent_list_retrievals(static_cast<::grin::ListRetrieval>(val)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* TopologyTrait::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.TopologyTrait) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool grin_assume_has_directed_graph = 1; + if (this->_internal_grin_assume_has_directed_graph() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_assume_has_directed_graph(), target); + } + + // bool grin_assume_has_undirected_graph = 2; + if (this->_internal_grin_assume_has_undirected_graph() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_assume_has_undirected_graph(), target); + } + + // bool grin_assume_has_multi_edge_graph = 3; + if (this->_internal_grin_assume_has_multi_edge_graph() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_assume_has_multi_edge_graph(), target); + } + + // bool grin_with_vertex_original_id = 4; + if (this->_internal_grin_with_vertex_original_id() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_with_vertex_original_id(), target); + } + + // bool grin_with_vertex_data = 5; + if (this->_internal_grin_with_vertex_data() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_with_vertex_data(), target); + } + + // bool grin_with_edge_data = 6; + if (this->_internal_grin_with_edge_data() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_with_edge_data(), target); + } + + // repeated .grin.ListRetrieval vertex_list_retrievals = 7; + { + int byte_size = _impl_._vertex_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); + if (byte_size > 0) { + target = stream->WriteEnumPacked( + 7, _impl_.vertex_list_retrievals_, byte_size, target); + } + } + + // repeated .grin.ListRetrieval edge_list_retrievals = 8; + { + int byte_size = _impl_._edge_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); + if (byte_size > 0) { + target = stream->WriteEnumPacked( + 8, _impl_.edge_list_retrievals_, byte_size, target); + } + } + + // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; + { + int byte_size = _impl_._adjacent_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); + if (byte_size > 0) { + target = stream->WriteEnumPacked( + 9, _impl_.adjacent_list_retrievals_, byte_size, target); + } + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.TopologyTrait) + return target; +} + +size_t TopologyTrait::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.TopologyTrait) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .grin.ListRetrieval vertex_list_retrievals = 7; + { + size_t data_size = 0; + unsigned int count = static_cast(this->_internal_vertex_list_retrievals_size());for (unsigned int i = 0; i < count; i++) { + data_size += ::_pbi::WireFormatLite::EnumSize( + this->_internal_vertex_list_retrievals(static_cast(i))); + } + if (data_size > 0) { + total_size += 1 + + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + } + int cached_size = ::_pbi::ToCachedSize(data_size); + _impl_._vertex_list_retrievals_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // repeated .grin.ListRetrieval edge_list_retrievals = 8; + { + size_t data_size = 0; + unsigned int count = static_cast(this->_internal_edge_list_retrievals_size());for (unsigned int i = 0; i < count; i++) { + data_size += ::_pbi::WireFormatLite::EnumSize( + this->_internal_edge_list_retrievals(static_cast(i))); + } + if (data_size > 0) { + total_size += 1 + + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + } + int cached_size = ::_pbi::ToCachedSize(data_size); + _impl_._edge_list_retrievals_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; + { + size_t data_size = 0; + unsigned int count = static_cast(this->_internal_adjacent_list_retrievals_size());for (unsigned int i = 0; i < count; i++) { + data_size += ::_pbi::WireFormatLite::EnumSize( + this->_internal_adjacent_list_retrievals(static_cast(i))); + } + if (data_size > 0) { + total_size += 1 + + ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + } + int cached_size = ::_pbi::ToCachedSize(data_size); + _impl_._adjacent_list_retrievals_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // bool grin_assume_has_directed_graph = 1; + if (this->_internal_grin_assume_has_directed_graph() != 0) { + total_size += 1 + 1; + } + + // bool grin_assume_has_undirected_graph = 2; + if (this->_internal_grin_assume_has_undirected_graph() != 0) { + total_size += 1 + 1; + } + + // bool grin_assume_has_multi_edge_graph = 3; + if (this->_internal_grin_assume_has_multi_edge_graph() != 0) { + total_size += 1 + 1; + } + + // bool grin_with_vertex_original_id = 4; + if (this->_internal_grin_with_vertex_original_id() != 0) { + total_size += 1 + 1; + } + + // bool grin_with_vertex_data = 5; + if (this->_internal_grin_with_vertex_data() != 0) { + total_size += 1 + 1; + } + + // bool grin_with_edge_data = 6; + if (this->_internal_grin_with_edge_data() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TopologyTrait::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + TopologyTrait::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TopologyTrait::GetClassData() const { return &_class_data_; } + + +void TopologyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.TopologyTrait) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.vertex_list_retrievals_.MergeFrom(from._impl_.vertex_list_retrievals_); + _this->_impl_.edge_list_retrievals_.MergeFrom(from._impl_.edge_list_retrievals_); + _this->_impl_.adjacent_list_retrievals_.MergeFrom(from._impl_.adjacent_list_retrievals_); + if (from._internal_grin_assume_has_directed_graph() != 0) { + _this->_internal_set_grin_assume_has_directed_graph(from._internal_grin_assume_has_directed_graph()); + } + if (from._internal_grin_assume_has_undirected_graph() != 0) { + _this->_internal_set_grin_assume_has_undirected_graph(from._internal_grin_assume_has_undirected_graph()); + } + if (from._internal_grin_assume_has_multi_edge_graph() != 0) { + _this->_internal_set_grin_assume_has_multi_edge_graph(from._internal_grin_assume_has_multi_edge_graph()); + } + if (from._internal_grin_with_vertex_original_id() != 0) { + _this->_internal_set_grin_with_vertex_original_id(from._internal_grin_with_vertex_original_id()); + } + if (from._internal_grin_with_vertex_data() != 0) { + _this->_internal_set_grin_with_vertex_data(from._internal_grin_with_vertex_data()); + } + if (from._internal_grin_with_edge_data() != 0) { + _this->_internal_set_grin_with_edge_data(from._internal_grin_with_edge_data()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void TopologyTrait::CopyFrom(const TopologyTrait& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.TopologyTrait) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool TopologyTrait::IsInitialized() const { + return true; +} + +void TopologyTrait::InternalSwap(TopologyTrait* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.vertex_list_retrievals_.InternalSwap(&other->_impl_.vertex_list_retrievals_); + _impl_.edge_list_retrievals_.InternalSwap(&other->_impl_.edge_list_retrievals_); + _impl_.adjacent_list_retrievals_.InternalSwap(&other->_impl_.adjacent_list_retrievals_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(TopologyTrait, _impl_.grin_with_edge_data_) + + sizeof(TopologyTrait::_impl_.grin_with_edge_data_) + - PROTOBUF_FIELD_OFFSET(TopologyTrait, _impl_.grin_assume_has_directed_graph_)>( + reinterpret_cast(&_impl_.grin_assume_has_directed_graph_), + reinterpret_cast(&other->_impl_.grin_assume_has_directed_graph_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata TopologyTrait::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[0]); +} + +// =================================================================== + +class MirrorPartitionListTrait::_Internal { + public: +}; + +MirrorPartitionListTrait::MirrorPartitionListTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:grin.MirrorPartitionListTrait) +} +MirrorPartitionListTrait::MirrorPartitionListTrait(const MirrorPartitionListTrait& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + MirrorPartitionListTrait* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.grin_trait_master_vertex_mirror_partition_list_){} + , decltype(_impl_.grin_trait_mirror_vertex_mirror_partition_list_){} + , decltype(_impl_.grin_trait_master_edge_mirror_partition_list_){} + , decltype(_impl_.grin_trait_mirror_edge_mirror_partition_list_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.grin_trait_master_vertex_mirror_partition_list_, &from._impl_.grin_trait_master_vertex_mirror_partition_list_, + static_cast(reinterpret_cast(&_impl_.grin_trait_mirror_edge_mirror_partition_list_) - + reinterpret_cast(&_impl_.grin_trait_master_vertex_mirror_partition_list_)) + sizeof(_impl_.grin_trait_mirror_edge_mirror_partition_list_)); + // @@protoc_insertion_point(copy_constructor:grin.MirrorPartitionListTrait) +} + +inline void MirrorPartitionListTrait::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.grin_trait_master_vertex_mirror_partition_list_){false} + , decltype(_impl_.grin_trait_mirror_vertex_mirror_partition_list_){false} + , decltype(_impl_.grin_trait_master_edge_mirror_partition_list_){false} + , decltype(_impl_.grin_trait_mirror_edge_mirror_partition_list_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +MirrorPartitionListTrait::~MirrorPartitionListTrait() { + // @@protoc_insertion_point(destructor:grin.MirrorPartitionListTrait) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void MirrorPartitionListTrait::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void MirrorPartitionListTrait::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void MirrorPartitionListTrait::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.MirrorPartitionListTrait) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.grin_trait_master_vertex_mirror_partition_list_, 0, static_cast( + reinterpret_cast(&_impl_.grin_trait_mirror_edge_mirror_partition_list_) - + reinterpret_cast(&_impl_.grin_trait_master_vertex_mirror_partition_list_)) + sizeof(_impl_.grin_trait_mirror_edge_mirror_partition_list_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* MirrorPartitionListTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool grin_trait_master_vertex_mirror_partition_list = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.grin_trait_master_vertex_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_mirror_vertex_mirror_partition_list = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.grin_trait_mirror_vertex_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_master_edge_mirror_partition_list = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.grin_trait_master_edge_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_mirror_edge_mirror_partition_list = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _impl_.grin_trait_mirror_edge_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* MirrorPartitionListTrait::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.MirrorPartitionListTrait) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool grin_trait_master_vertex_mirror_partition_list = 1; + if (this->_internal_grin_trait_master_vertex_mirror_partition_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_trait_master_vertex_mirror_partition_list(), target); + } + + // bool grin_trait_mirror_vertex_mirror_partition_list = 2; + if (this->_internal_grin_trait_mirror_vertex_mirror_partition_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_trait_mirror_vertex_mirror_partition_list(), target); + } + + // bool grin_trait_master_edge_mirror_partition_list = 3; + if (this->_internal_grin_trait_master_edge_mirror_partition_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_trait_master_edge_mirror_partition_list(), target); + } + + // bool grin_trait_mirror_edge_mirror_partition_list = 4; + if (this->_internal_grin_trait_mirror_edge_mirror_partition_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_trait_mirror_edge_mirror_partition_list(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.MirrorPartitionListTrait) + return target; +} + +size_t MirrorPartitionListTrait::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.MirrorPartitionListTrait) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool grin_trait_master_vertex_mirror_partition_list = 1; + if (this->_internal_grin_trait_master_vertex_mirror_partition_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_mirror_vertex_mirror_partition_list = 2; + if (this->_internal_grin_trait_mirror_vertex_mirror_partition_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_master_edge_mirror_partition_list = 3; + if (this->_internal_grin_trait_master_edge_mirror_partition_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_mirror_edge_mirror_partition_list = 4; + if (this->_internal_grin_trait_mirror_edge_mirror_partition_list() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MirrorPartitionListTrait::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + MirrorPartitionListTrait::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MirrorPartitionListTrait::GetClassData() const { return &_class_data_; } + + +void MirrorPartitionListTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.MirrorPartitionListTrait) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_grin_trait_master_vertex_mirror_partition_list() != 0) { + _this->_internal_set_grin_trait_master_vertex_mirror_partition_list(from._internal_grin_trait_master_vertex_mirror_partition_list()); + } + if (from._internal_grin_trait_mirror_vertex_mirror_partition_list() != 0) { + _this->_internal_set_grin_trait_mirror_vertex_mirror_partition_list(from._internal_grin_trait_mirror_vertex_mirror_partition_list()); + } + if (from._internal_grin_trait_master_edge_mirror_partition_list() != 0) { + _this->_internal_set_grin_trait_master_edge_mirror_partition_list(from._internal_grin_trait_master_edge_mirror_partition_list()); + } + if (from._internal_grin_trait_mirror_edge_mirror_partition_list() != 0) { + _this->_internal_set_grin_trait_mirror_edge_mirror_partition_list(from._internal_grin_trait_mirror_edge_mirror_partition_list()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void MirrorPartitionListTrait::CopyFrom(const MirrorPartitionListTrait& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.MirrorPartitionListTrait) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MirrorPartitionListTrait::IsInitialized() const { + return true; +} + +void MirrorPartitionListTrait::InternalSwap(MirrorPartitionListTrait* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(MirrorPartitionListTrait, _impl_.grin_trait_mirror_edge_mirror_partition_list_) + + sizeof(MirrorPartitionListTrait::_impl_.grin_trait_mirror_edge_mirror_partition_list_) + - PROTOBUF_FIELD_OFFSET(MirrorPartitionListTrait, _impl_.grin_trait_master_vertex_mirror_partition_list_)>( + reinterpret_cast(&_impl_.grin_trait_master_vertex_mirror_partition_list_), + reinterpret_cast(&other->_impl_.grin_trait_master_vertex_mirror_partition_list_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata MirrorPartitionListTrait::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[1]); +} + +// =================================================================== + +class PartitionTrait::_Internal { + public: + static const ::grin::MirrorPartitionListTrait& mirror_partition_list_trait(const PartitionTrait* msg); +}; + +const ::grin::MirrorPartitionListTrait& +PartitionTrait::_Internal::mirror_partition_list_trait(const PartitionTrait* msg) { + return *msg->_impl_.mirror_partition_list_trait_; +} +PartitionTrait::PartitionTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:grin.PartitionTrait) +} +PartitionTrait::PartitionTrait(const PartitionTrait& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + PartitionTrait* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.mirror_partition_list_trait_){nullptr} + , decltype(_impl_.graph_partition_strategy_){} + , decltype(_impl_.grin_trait_natural_id_for_partition_){} + , decltype(_impl_.grin_enable_vertex_ref_){} + , decltype(_impl_.grin_enable_edge_ref_){} + , decltype(_impl_.grin_trait_select_master_for_vertex_list_){} + , decltype(_impl_.vertex_data_){} + , decltype(_impl_.edge_data_){} + , decltype(_impl_.grin_trait_select_partition_for_vertex_list_){} + , decltype(_impl_.grin_trait_select_master_for_edge_list_){} + , decltype(_impl_.grin_trait_select_partition_for_edge_list_){} + , decltype(_impl_.grin_trait_select_master_neighbor_for_adjacent_list_){} + , decltype(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_mirror_partition_list_trait()) { + _this->_impl_.mirror_partition_list_trait_ = new ::grin::MirrorPartitionListTrait(*from._impl_.mirror_partition_list_trait_); + } + ::memcpy(&_impl_.graph_partition_strategy_, &from._impl_.graph_partition_strategy_, + static_cast(reinterpret_cast(&_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) - + reinterpret_cast(&_impl_.graph_partition_strategy_)) + sizeof(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_)); + // @@protoc_insertion_point(copy_constructor:grin.PartitionTrait) +} + +inline void PartitionTrait::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.mirror_partition_list_trait_){nullptr} + , decltype(_impl_.graph_partition_strategy_){0} + , decltype(_impl_.grin_trait_natural_id_for_partition_){false} + , decltype(_impl_.grin_enable_vertex_ref_){false} + , decltype(_impl_.grin_enable_edge_ref_){false} + , decltype(_impl_.grin_trait_select_master_for_vertex_list_){false} + , decltype(_impl_.vertex_data_){0} + , decltype(_impl_.edge_data_){0} + , decltype(_impl_.grin_trait_select_partition_for_vertex_list_){false} + , decltype(_impl_.grin_trait_select_master_for_edge_list_){false} + , decltype(_impl_.grin_trait_select_partition_for_edge_list_){false} + , decltype(_impl_.grin_trait_select_master_neighbor_for_adjacent_list_){false} + , decltype(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +PartitionTrait::~PartitionTrait() { + // @@protoc_insertion_point(destructor:grin.PartitionTrait) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void PartitionTrait::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.mirror_partition_list_trait_; +} + +void PartitionTrait::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void PartitionTrait::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.PartitionTrait) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaForAllocation() == nullptr && _impl_.mirror_partition_list_trait_ != nullptr) { + delete _impl_.mirror_partition_list_trait_; + } + _impl_.mirror_partition_list_trait_ = nullptr; + ::memset(&_impl_.graph_partition_strategy_, 0, static_cast( + reinterpret_cast(&_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) - + reinterpret_cast(&_impl_.graph_partition_strategy_)) + sizeof(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PartitionTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .grin.GraphPartitionStrategy graph_partition_strategy = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_graph_partition_strategy(static_cast<::grin::GraphPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // bool grin_trait_natural_id_for_partition = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.grin_trait_natural_id_for_partition_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_enable_vertex_ref = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.grin_enable_vertex_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_enable_edge_ref = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _impl_.grin_enable_edge_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .grin.PropertyDataPartitionStrategy vertex_data = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_vertex_data(static_cast<::grin::PropertyDataPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // .grin.PropertyDataPartitionStrategy edge_data = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_edge_data(static_cast<::grin::PropertyDataPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // .grin.MirrorPartitionListTrait mirror_partition_list_trait = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + ptr = ctx->ParseMessage(_internal_mutable_mirror_partition_list_trait(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_select_master_for_vertex_list = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { + _impl_.grin_trait_select_master_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_select_partition_for_vertex_list = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 72)) { + _impl_.grin_trait_select_partition_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_select_master_for_edge_list = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { + _impl_.grin_trait_select_master_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_select_partition_for_edge_list = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 88)) { + _impl_.grin_trait_select_partition_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; + case 12: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 96)) { + _impl_.grin_trait_select_master_neighbor_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; + case 13: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 104)) { + _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* PartitionTrait::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.PartitionTrait) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .grin.GraphPartitionStrategy graph_partition_strategy = 1; + if (this->_internal_graph_partition_strategy() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_graph_partition_strategy(), target); + } + + // bool grin_trait_natural_id_for_partition = 2; + if (this->_internal_grin_trait_natural_id_for_partition() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_trait_natural_id_for_partition(), target); + } + + // bool grin_enable_vertex_ref = 3; + if (this->_internal_grin_enable_vertex_ref() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_enable_vertex_ref(), target); + } + + // bool grin_enable_edge_ref = 4; + if (this->_internal_grin_enable_edge_ref() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_edge_ref(), target); + } + + // .grin.PropertyDataPartitionStrategy vertex_data = 5; + if (this->_internal_vertex_data() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 5, this->_internal_vertex_data(), target); + } + + // .grin.PropertyDataPartitionStrategy edge_data = 6; + if (this->_internal_edge_data() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 6, this->_internal_edge_data(), target); + } + + // .grin.MirrorPartitionListTrait mirror_partition_list_trait = 7; + if (this->_internal_has_mirror_partition_list_trait()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(7, _Internal::mirror_partition_list_trait(this), + _Internal::mirror_partition_list_trait(this).GetCachedSize(), target, stream); + } + + // bool grin_trait_select_master_for_vertex_list = 8; + if (this->_internal_grin_trait_select_master_for_vertex_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_trait_select_master_for_vertex_list(), target); + } + + // bool grin_trait_select_partition_for_vertex_list = 9; + if (this->_internal_grin_trait_select_partition_for_vertex_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_grin_trait_select_partition_for_vertex_list(), target); + } + + // bool grin_trait_select_master_for_edge_list = 10; + if (this->_internal_grin_trait_select_master_for_edge_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(10, this->_internal_grin_trait_select_master_for_edge_list(), target); + } + + // bool grin_trait_select_partition_for_edge_list = 11; + if (this->_internal_grin_trait_select_partition_for_edge_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(11, this->_internal_grin_trait_select_partition_for_edge_list(), target); + } + + // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; + if (this->_internal_grin_trait_select_master_neighbor_for_adjacent_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_grin_trait_select_master_neighbor_for_adjacent_list(), target); + } + + // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; + if (this->_internal_grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(13, this->_internal_grin_trait_select_neighbor_partition_for_adjacent_list(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.PartitionTrait) + return target; +} + +size_t PartitionTrait::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.PartitionTrait) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .grin.MirrorPartitionListTrait mirror_partition_list_trait = 7; + if (this->_internal_has_mirror_partition_list_trait()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.mirror_partition_list_trait_); + } + + // .grin.GraphPartitionStrategy graph_partition_strategy = 1; + if (this->_internal_graph_partition_strategy() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_graph_partition_strategy()); + } + + // bool grin_trait_natural_id_for_partition = 2; + if (this->_internal_grin_trait_natural_id_for_partition() != 0) { + total_size += 1 + 1; + } + + // bool grin_enable_vertex_ref = 3; + if (this->_internal_grin_enable_vertex_ref() != 0) { + total_size += 1 + 1; + } + + // bool grin_enable_edge_ref = 4; + if (this->_internal_grin_enable_edge_ref() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_select_master_for_vertex_list = 8; + if (this->_internal_grin_trait_select_master_for_vertex_list() != 0) { + total_size += 1 + 1; + } + + // .grin.PropertyDataPartitionStrategy vertex_data = 5; + if (this->_internal_vertex_data() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_vertex_data()); + } + + // .grin.PropertyDataPartitionStrategy edge_data = 6; + if (this->_internal_edge_data() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_edge_data()); + } + + // bool grin_trait_select_partition_for_vertex_list = 9; + if (this->_internal_grin_trait_select_partition_for_vertex_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_select_master_for_edge_list = 10; + if (this->_internal_grin_trait_select_master_for_edge_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_select_partition_for_edge_list = 11; + if (this->_internal_grin_trait_select_partition_for_edge_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; + if (this->_internal_grin_trait_select_master_neighbor_for_adjacent_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; + if (this->_internal_grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PartitionTrait::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + PartitionTrait::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PartitionTrait::GetClassData() const { return &_class_data_; } + + +void PartitionTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.PartitionTrait) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_mirror_partition_list_trait()) { + _this->_internal_mutable_mirror_partition_list_trait()->::grin::MirrorPartitionListTrait::MergeFrom( + from._internal_mirror_partition_list_trait()); + } + if (from._internal_graph_partition_strategy() != 0) { + _this->_internal_set_graph_partition_strategy(from._internal_graph_partition_strategy()); + } + if (from._internal_grin_trait_natural_id_for_partition() != 0) { + _this->_internal_set_grin_trait_natural_id_for_partition(from._internal_grin_trait_natural_id_for_partition()); + } + if (from._internal_grin_enable_vertex_ref() != 0) { + _this->_internal_set_grin_enable_vertex_ref(from._internal_grin_enable_vertex_ref()); + } + if (from._internal_grin_enable_edge_ref() != 0) { + _this->_internal_set_grin_enable_edge_ref(from._internal_grin_enable_edge_ref()); + } + if (from._internal_grin_trait_select_master_for_vertex_list() != 0) { + _this->_internal_set_grin_trait_select_master_for_vertex_list(from._internal_grin_trait_select_master_for_vertex_list()); + } + if (from._internal_vertex_data() != 0) { + _this->_internal_set_vertex_data(from._internal_vertex_data()); + } + if (from._internal_edge_data() != 0) { + _this->_internal_set_edge_data(from._internal_edge_data()); + } + if (from._internal_grin_trait_select_partition_for_vertex_list() != 0) { + _this->_internal_set_grin_trait_select_partition_for_vertex_list(from._internal_grin_trait_select_partition_for_vertex_list()); + } + if (from._internal_grin_trait_select_master_for_edge_list() != 0) { + _this->_internal_set_grin_trait_select_master_for_edge_list(from._internal_grin_trait_select_master_for_edge_list()); + } + if (from._internal_grin_trait_select_partition_for_edge_list() != 0) { + _this->_internal_set_grin_trait_select_partition_for_edge_list(from._internal_grin_trait_select_partition_for_edge_list()); + } + if (from._internal_grin_trait_select_master_neighbor_for_adjacent_list() != 0) { + _this->_internal_set_grin_trait_select_master_neighbor_for_adjacent_list(from._internal_grin_trait_select_master_neighbor_for_adjacent_list()); + } + if (from._internal_grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { + _this->_internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(from._internal_grin_trait_select_neighbor_partition_for_adjacent_list()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PartitionTrait::CopyFrom(const PartitionTrait& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.PartitionTrait) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PartitionTrait::IsInitialized() const { + return true; +} + +void PartitionTrait::InternalSwap(PartitionTrait* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(PartitionTrait, _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) + + sizeof(PartitionTrait::_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) + - PROTOBUF_FIELD_OFFSET(PartitionTrait, _impl_.mirror_partition_list_trait_)>( + reinterpret_cast(&_impl_.mirror_partition_list_trait_), + reinterpret_cast(&other->_impl_.mirror_partition_list_trait_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PartitionTrait::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[2]); +} + +// =================================================================== + +class VertexPropertyTrait::_Internal { + public: +}; + +VertexPropertyTrait::VertexPropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:grin.VertexPropertyTrait) +} +VertexPropertyTrait::VertexPropertyTrait(const VertexPropertyTrait& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + VertexPropertyTrait* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.grin_with_vertex_property_){} + , decltype(_impl_.grin_with_vertex_property_name_){} + , decltype(_impl_.grin_with_vertex_type_name_){} + , decltype(_impl_.grin_enable_vertex_property_table_){} + , decltype(_impl_.grin_enable_vertex_primary_keys_){} + , decltype(_impl_.grin_trait_natural_id_for_vertex_type_){} + , decltype(_impl_.grin_trait_natural_id_for_vertex_property_){} + , decltype(_impl_.grin_assume_by_type_vertex_original_id_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.grin_with_vertex_property_, &from._impl_.grin_with_vertex_property_, + static_cast(reinterpret_cast(&_impl_.grin_assume_by_type_vertex_original_id_) - + reinterpret_cast(&_impl_.grin_with_vertex_property_)) + sizeof(_impl_.grin_assume_by_type_vertex_original_id_)); + // @@protoc_insertion_point(copy_constructor:grin.VertexPropertyTrait) +} + +inline void VertexPropertyTrait::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.grin_with_vertex_property_){false} + , decltype(_impl_.grin_with_vertex_property_name_){false} + , decltype(_impl_.grin_with_vertex_type_name_){false} + , decltype(_impl_.grin_enable_vertex_property_table_){false} + , decltype(_impl_.grin_enable_vertex_primary_keys_){false} + , decltype(_impl_.grin_trait_natural_id_for_vertex_type_){false} + , decltype(_impl_.grin_trait_natural_id_for_vertex_property_){false} + , decltype(_impl_.grin_assume_by_type_vertex_original_id_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +VertexPropertyTrait::~VertexPropertyTrait() { + // @@protoc_insertion_point(destructor:grin.VertexPropertyTrait) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void VertexPropertyTrait::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void VertexPropertyTrait::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void VertexPropertyTrait::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.VertexPropertyTrait) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.grin_with_vertex_property_, 0, static_cast( + reinterpret_cast(&_impl_.grin_assume_by_type_vertex_original_id_) - + reinterpret_cast(&_impl_.grin_with_vertex_property_)) + sizeof(_impl_.grin_assume_by_type_vertex_original_id_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* VertexPropertyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool grin_with_vertex_property = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.grin_with_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_with_vertex_property_name = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.grin_with_vertex_property_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_with_vertex_type_name = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.grin_with_vertex_type_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_enable_vertex_property_table = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _impl_.grin_enable_vertex_property_table_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_enable_vertex_primary_keys = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + _impl_.grin_enable_vertex_primary_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_natural_id_for_vertex_type = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + _impl_.grin_trait_natural_id_for_vertex_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_natural_id_for_vertex_property = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { + _impl_.grin_trait_natural_id_for_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_assume_by_type_vertex_original_id = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { + _impl_.grin_assume_by_type_vertex_original_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* VertexPropertyTrait::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.VertexPropertyTrait) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool grin_with_vertex_property = 1; + if (this->_internal_grin_with_vertex_property() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_vertex_property(), target); + } + + // bool grin_with_vertex_property_name = 2; + if (this->_internal_grin_with_vertex_property_name() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_vertex_property_name(), target); + } + + // bool grin_with_vertex_type_name = 3; + if (this->_internal_grin_with_vertex_type_name() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_with_vertex_type_name(), target); + } + + // bool grin_enable_vertex_property_table = 4; + if (this->_internal_grin_enable_vertex_property_table() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_vertex_property_table(), target); + } + + // bool grin_enable_vertex_primary_keys = 5; + if (this->_internal_grin_enable_vertex_primary_keys() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_enable_vertex_primary_keys(), target); + } + + // bool grin_trait_natural_id_for_vertex_type = 6; + if (this->_internal_grin_trait_natural_id_for_vertex_type() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_trait_natural_id_for_vertex_type(), target); + } + + // bool grin_trait_natural_id_for_vertex_property = 7; + if (this->_internal_grin_trait_natural_id_for_vertex_property() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_trait_natural_id_for_vertex_property(), target); + } + + // bool grin_assume_by_type_vertex_original_id = 8; + if (this->_internal_grin_assume_by_type_vertex_original_id() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_assume_by_type_vertex_original_id(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.VertexPropertyTrait) + return target; +} + +size_t VertexPropertyTrait::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.VertexPropertyTrait) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool grin_with_vertex_property = 1; + if (this->_internal_grin_with_vertex_property() != 0) { + total_size += 1 + 1; + } + + // bool grin_with_vertex_property_name = 2; + if (this->_internal_grin_with_vertex_property_name() != 0) { + total_size += 1 + 1; + } + + // bool grin_with_vertex_type_name = 3; + if (this->_internal_grin_with_vertex_type_name() != 0) { + total_size += 1 + 1; + } + + // bool grin_enable_vertex_property_table = 4; + if (this->_internal_grin_enable_vertex_property_table() != 0) { + total_size += 1 + 1; + } + + // bool grin_enable_vertex_primary_keys = 5; + if (this->_internal_grin_enable_vertex_primary_keys() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_natural_id_for_vertex_type = 6; + if (this->_internal_grin_trait_natural_id_for_vertex_type() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_natural_id_for_vertex_property = 7; + if (this->_internal_grin_trait_natural_id_for_vertex_property() != 0) { + total_size += 1 + 1; + } + + // bool grin_assume_by_type_vertex_original_id = 8; + if (this->_internal_grin_assume_by_type_vertex_original_id() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData VertexPropertyTrait::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + VertexPropertyTrait::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*VertexPropertyTrait::GetClassData() const { return &_class_data_; } + + +void VertexPropertyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.VertexPropertyTrait) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_grin_with_vertex_property() != 0) { + _this->_internal_set_grin_with_vertex_property(from._internal_grin_with_vertex_property()); + } + if (from._internal_grin_with_vertex_property_name() != 0) { + _this->_internal_set_grin_with_vertex_property_name(from._internal_grin_with_vertex_property_name()); + } + if (from._internal_grin_with_vertex_type_name() != 0) { + _this->_internal_set_grin_with_vertex_type_name(from._internal_grin_with_vertex_type_name()); + } + if (from._internal_grin_enable_vertex_property_table() != 0) { + _this->_internal_set_grin_enable_vertex_property_table(from._internal_grin_enable_vertex_property_table()); + } + if (from._internal_grin_enable_vertex_primary_keys() != 0) { + _this->_internal_set_grin_enable_vertex_primary_keys(from._internal_grin_enable_vertex_primary_keys()); + } + if (from._internal_grin_trait_natural_id_for_vertex_type() != 0) { + _this->_internal_set_grin_trait_natural_id_for_vertex_type(from._internal_grin_trait_natural_id_for_vertex_type()); + } + if (from._internal_grin_trait_natural_id_for_vertex_property() != 0) { + _this->_internal_set_grin_trait_natural_id_for_vertex_property(from._internal_grin_trait_natural_id_for_vertex_property()); + } + if (from._internal_grin_assume_by_type_vertex_original_id() != 0) { + _this->_internal_set_grin_assume_by_type_vertex_original_id(from._internal_grin_assume_by_type_vertex_original_id()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void VertexPropertyTrait::CopyFrom(const VertexPropertyTrait& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.VertexPropertyTrait) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool VertexPropertyTrait::IsInitialized() const { + return true; +} + +void VertexPropertyTrait::InternalSwap(VertexPropertyTrait* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(VertexPropertyTrait, _impl_.grin_assume_by_type_vertex_original_id_) + + sizeof(VertexPropertyTrait::_impl_.grin_assume_by_type_vertex_original_id_) + - PROTOBUF_FIELD_OFFSET(VertexPropertyTrait, _impl_.grin_with_vertex_property_)>( + reinterpret_cast(&_impl_.grin_with_vertex_property_), + reinterpret_cast(&other->_impl_.grin_with_vertex_property_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata VertexPropertyTrait::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[3]); +} + +// =================================================================== + +class EdgePropertyTrait::_Internal { + public: +}; + +EdgePropertyTrait::EdgePropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:grin.EdgePropertyTrait) +} +EdgePropertyTrait::EdgePropertyTrait(const EdgePropertyTrait& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + EdgePropertyTrait* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.grin_with_edge_property_){} + , decltype(_impl_.grin_with_edge_property_name_){} + , decltype(_impl_.grin_with_edge_type_name_){} + , decltype(_impl_.grin_enable_edge_property_table_){} + , decltype(_impl_.grin_enable_edge_primary_keys_){} + , decltype(_impl_.grin_trait_natural_id_for_edge_type_){} + , decltype(_impl_.grin_trait_natural_id_for_edge_property_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.grin_with_edge_property_, &from._impl_.grin_with_edge_property_, + static_cast(reinterpret_cast(&_impl_.grin_trait_natural_id_for_edge_property_) - + reinterpret_cast(&_impl_.grin_with_edge_property_)) + sizeof(_impl_.grin_trait_natural_id_for_edge_property_)); + // @@protoc_insertion_point(copy_constructor:grin.EdgePropertyTrait) +} + +inline void EdgePropertyTrait::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.grin_with_edge_property_){false} + , decltype(_impl_.grin_with_edge_property_name_){false} + , decltype(_impl_.grin_with_edge_type_name_){false} + , decltype(_impl_.grin_enable_edge_property_table_){false} + , decltype(_impl_.grin_enable_edge_primary_keys_){false} + , decltype(_impl_.grin_trait_natural_id_for_edge_type_){false} + , decltype(_impl_.grin_trait_natural_id_for_edge_property_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +EdgePropertyTrait::~EdgePropertyTrait() { + // @@protoc_insertion_point(destructor:grin.EdgePropertyTrait) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void EdgePropertyTrait::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void EdgePropertyTrait::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void EdgePropertyTrait::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.EdgePropertyTrait) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.grin_with_edge_property_, 0, static_cast( + reinterpret_cast(&_impl_.grin_trait_natural_id_for_edge_property_) - + reinterpret_cast(&_impl_.grin_with_edge_property_)) + sizeof(_impl_.grin_trait_natural_id_for_edge_property_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* EdgePropertyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool grin_with_edge_property = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.grin_with_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_with_edge_property_name = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.grin_with_edge_property_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_with_edge_type_name = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.grin_with_edge_type_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_enable_edge_property_table = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _impl_.grin_enable_edge_property_table_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_enable_edge_primary_keys = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + _impl_.grin_enable_edge_primary_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_natural_id_for_edge_type = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + _impl_.grin_trait_natural_id_for_edge_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_natural_id_for_edge_property = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { + _impl_.grin_trait_natural_id_for_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* EdgePropertyTrait::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.EdgePropertyTrait) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool grin_with_edge_property = 1; + if (this->_internal_grin_with_edge_property() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_edge_property(), target); + } + + // bool grin_with_edge_property_name = 2; + if (this->_internal_grin_with_edge_property_name() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_edge_property_name(), target); + } + + // bool grin_with_edge_type_name = 3; + if (this->_internal_grin_with_edge_type_name() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_with_edge_type_name(), target); + } + + // bool grin_enable_edge_property_table = 4; + if (this->_internal_grin_enable_edge_property_table() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_edge_property_table(), target); + } + + // bool grin_enable_edge_primary_keys = 5; + if (this->_internal_grin_enable_edge_primary_keys() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_enable_edge_primary_keys(), target); + } + + // bool grin_trait_natural_id_for_edge_type = 6; + if (this->_internal_grin_trait_natural_id_for_edge_type() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_trait_natural_id_for_edge_type(), target); + } + + // bool grin_trait_natural_id_for_edge_property = 7; + if (this->_internal_grin_trait_natural_id_for_edge_property() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_trait_natural_id_for_edge_property(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.EdgePropertyTrait) + return target; +} + +size_t EdgePropertyTrait::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.EdgePropertyTrait) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool grin_with_edge_property = 1; + if (this->_internal_grin_with_edge_property() != 0) { + total_size += 1 + 1; + } + + // bool grin_with_edge_property_name = 2; + if (this->_internal_grin_with_edge_property_name() != 0) { + total_size += 1 + 1; + } + + // bool grin_with_edge_type_name = 3; + if (this->_internal_grin_with_edge_type_name() != 0) { + total_size += 1 + 1; + } + + // bool grin_enable_edge_property_table = 4; + if (this->_internal_grin_enable_edge_property_table() != 0) { + total_size += 1 + 1; + } + + // bool grin_enable_edge_primary_keys = 5; + if (this->_internal_grin_enable_edge_primary_keys() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_natural_id_for_edge_type = 6; + if (this->_internal_grin_trait_natural_id_for_edge_type() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_natural_id_for_edge_property = 7; + if (this->_internal_grin_trait_natural_id_for_edge_property() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EdgePropertyTrait::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + EdgePropertyTrait::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EdgePropertyTrait::GetClassData() const { return &_class_data_; } + + +void EdgePropertyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.EdgePropertyTrait) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_grin_with_edge_property() != 0) { + _this->_internal_set_grin_with_edge_property(from._internal_grin_with_edge_property()); + } + if (from._internal_grin_with_edge_property_name() != 0) { + _this->_internal_set_grin_with_edge_property_name(from._internal_grin_with_edge_property_name()); + } + if (from._internal_grin_with_edge_type_name() != 0) { + _this->_internal_set_grin_with_edge_type_name(from._internal_grin_with_edge_type_name()); + } + if (from._internal_grin_enable_edge_property_table() != 0) { + _this->_internal_set_grin_enable_edge_property_table(from._internal_grin_enable_edge_property_table()); + } + if (from._internal_grin_enable_edge_primary_keys() != 0) { + _this->_internal_set_grin_enable_edge_primary_keys(from._internal_grin_enable_edge_primary_keys()); + } + if (from._internal_grin_trait_natural_id_for_edge_type() != 0) { + _this->_internal_set_grin_trait_natural_id_for_edge_type(from._internal_grin_trait_natural_id_for_edge_type()); + } + if (from._internal_grin_trait_natural_id_for_edge_property() != 0) { + _this->_internal_set_grin_trait_natural_id_for_edge_property(from._internal_grin_trait_natural_id_for_edge_property()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void EdgePropertyTrait::CopyFrom(const EdgePropertyTrait& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.EdgePropertyTrait) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EdgePropertyTrait::IsInitialized() const { + return true; +} + +void EdgePropertyTrait::InternalSwap(EdgePropertyTrait* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(EdgePropertyTrait, _impl_.grin_trait_natural_id_for_edge_property_) + + sizeof(EdgePropertyTrait::_impl_.grin_trait_natural_id_for_edge_property_) + - PROTOBUF_FIELD_OFFSET(EdgePropertyTrait, _impl_.grin_with_edge_property_)>( + reinterpret_cast(&_impl_.grin_with_edge_property_), + reinterpret_cast(&other->_impl_.grin_with_edge_property_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata EdgePropertyTrait::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[4]); +} + +// =================================================================== + +class PropertyTrait::_Internal { + public: + static const ::grin::VertexPropertyTrait& vertex_property_trait(const PropertyTrait* msg); + static const ::grin::EdgePropertyTrait& edge_property_trait(const PropertyTrait* msg); +}; + +const ::grin::VertexPropertyTrait& +PropertyTrait::_Internal::vertex_property_trait(const PropertyTrait* msg) { + return *msg->_impl_.vertex_property_trait_; +} +const ::grin::EdgePropertyTrait& +PropertyTrait::_Internal::edge_property_trait(const PropertyTrait* msg) { + return *msg->_impl_.edge_property_trait_; +} +PropertyTrait::PropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:grin.PropertyTrait) +} +PropertyTrait::PropertyTrait(const PropertyTrait& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + PropertyTrait* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.vertex_property_trait_){nullptr} + , decltype(_impl_.edge_property_trait_){nullptr} + , decltype(_impl_.vertex_property_){} + , decltype(_impl_.edge_property_){} + , decltype(_impl_.grin_enable_row_){} + , decltype(_impl_.grin_assume_column_store_for_vertex_property_){} + , decltype(_impl_.grin_assume_column_store_for_edge_property_){} + , decltype(_impl_.grin_trait_select_type_for_vertex_list_){} + , decltype(_impl_.grin_trait_select_type_for_edge_list_){} + , decltype(_impl_.grin_trait_select_neighbor_type_for_adjacent_list_){} + , decltype(_impl_.grin_trait_select_edge_type_for_adjacent_list_){} + , decltype(_impl_.grin_trait_specific_vev_relation_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_vertex_property_trait()) { + _this->_impl_.vertex_property_trait_ = new ::grin::VertexPropertyTrait(*from._impl_.vertex_property_trait_); + } + if (from._internal_has_edge_property_trait()) { + _this->_impl_.edge_property_trait_ = new ::grin::EdgePropertyTrait(*from._impl_.edge_property_trait_); + } + ::memcpy(&_impl_.vertex_property_, &from._impl_.vertex_property_, + static_cast(reinterpret_cast(&_impl_.grin_trait_specific_vev_relation_) - + reinterpret_cast(&_impl_.vertex_property_)) + sizeof(_impl_.grin_trait_specific_vev_relation_)); + // @@protoc_insertion_point(copy_constructor:grin.PropertyTrait) +} + +inline void PropertyTrait::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.vertex_property_trait_){nullptr} + , decltype(_impl_.edge_property_trait_){nullptr} + , decltype(_impl_.vertex_property_){0} + , decltype(_impl_.edge_property_){0} + , decltype(_impl_.grin_enable_row_){false} + , decltype(_impl_.grin_assume_column_store_for_vertex_property_){false} + , decltype(_impl_.grin_assume_column_store_for_edge_property_){false} + , decltype(_impl_.grin_trait_select_type_for_vertex_list_){false} + , decltype(_impl_.grin_trait_select_type_for_edge_list_){false} + , decltype(_impl_.grin_trait_select_neighbor_type_for_adjacent_list_){false} + , decltype(_impl_.grin_trait_select_edge_type_for_adjacent_list_){false} + , decltype(_impl_.grin_trait_specific_vev_relation_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +PropertyTrait::~PropertyTrait() { + // @@protoc_insertion_point(destructor:grin.PropertyTrait) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void PropertyTrait::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.vertex_property_trait_; + if (this != internal_default_instance()) delete _impl_.edge_property_trait_; +} + +void PropertyTrait::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void PropertyTrait::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.PropertyTrait) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaForAllocation() == nullptr && _impl_.vertex_property_trait_ != nullptr) { + delete _impl_.vertex_property_trait_; + } + _impl_.vertex_property_trait_ = nullptr; + if (GetArenaForAllocation() == nullptr && _impl_.edge_property_trait_ != nullptr) { + delete _impl_.edge_property_trait_; + } + _impl_.edge_property_trait_ = nullptr; + ::memset(&_impl_.vertex_property_, 0, static_cast( + reinterpret_cast(&_impl_.grin_trait_specific_vev_relation_) - + reinterpret_cast(&_impl_.vertex_property_)) + sizeof(_impl_.grin_trait_specific_vev_relation_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PropertyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool grin_enable_row = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.grin_enable_row_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .grin.VertexPropertyTrait vertex_property_trait = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_vertex_property_trait(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .grin.EdgePropertyTrait edge_property_trait = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_edge_property_trait(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .grin.PropertyDataPartitionStrategy vertex_property = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_vertex_property(static_cast<::grin::PropertyDataPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // .grin.PropertyDataPartitionStrategy edge_property = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_edge_property(static_cast<::grin::PropertyDataPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // bool grin_assume_column_store_for_vertex_property = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + _impl_.grin_assume_column_store_for_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_assume_column_store_for_edge_property = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { + _impl_.grin_assume_column_store_for_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_select_type_for_vertex_list = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { + _impl_.grin_trait_select_type_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_select_type_for_edge_list = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 72)) { + _impl_.grin_trait_select_type_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { + _impl_.grin_trait_select_neighbor_type_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_select_edge_type_for_adjacent_list = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 88)) { + _impl_.grin_trait_select_edge_type_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_trait_specific_vev_relation = 12; + case 12: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 96)) { + _impl_.grin_trait_specific_vev_relation_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* PropertyTrait::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.PropertyTrait) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool grin_enable_row = 1; + if (this->_internal_grin_enable_row() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_enable_row(), target); + } + + // .grin.VertexPropertyTrait vertex_property_trait = 2; + if (this->_internal_has_vertex_property_trait()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::vertex_property_trait(this), + _Internal::vertex_property_trait(this).GetCachedSize(), target, stream); + } + + // .grin.EdgePropertyTrait edge_property_trait = 3; + if (this->_internal_has_edge_property_trait()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::edge_property_trait(this), + _Internal::edge_property_trait(this).GetCachedSize(), target, stream); + } + + // .grin.PropertyDataPartitionStrategy vertex_property = 4; + if (this->_internal_vertex_property() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_vertex_property(), target); + } + + // .grin.PropertyDataPartitionStrategy edge_property = 5; + if (this->_internal_edge_property() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 5, this->_internal_edge_property(), target); + } + + // bool grin_assume_column_store_for_vertex_property = 6; + if (this->_internal_grin_assume_column_store_for_vertex_property() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_assume_column_store_for_vertex_property(), target); + } + + // bool grin_assume_column_store_for_edge_property = 7; + if (this->_internal_grin_assume_column_store_for_edge_property() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_assume_column_store_for_edge_property(), target); + } + + // bool grin_trait_select_type_for_vertex_list = 8; + if (this->_internal_grin_trait_select_type_for_vertex_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_trait_select_type_for_vertex_list(), target); + } + + // bool grin_trait_select_type_for_edge_list = 9; + if (this->_internal_grin_trait_select_type_for_edge_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_grin_trait_select_type_for_edge_list(), target); + } + + // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; + if (this->_internal_grin_trait_select_neighbor_type_for_adjacent_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(10, this->_internal_grin_trait_select_neighbor_type_for_adjacent_list(), target); + } + + // bool grin_trait_select_edge_type_for_adjacent_list = 11; + if (this->_internal_grin_trait_select_edge_type_for_adjacent_list() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(11, this->_internal_grin_trait_select_edge_type_for_adjacent_list(), target); + } + + // bool grin_trait_specific_vev_relation = 12; + if (this->_internal_grin_trait_specific_vev_relation() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_grin_trait_specific_vev_relation(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.PropertyTrait) + return target; +} + +size_t PropertyTrait::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.PropertyTrait) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .grin.VertexPropertyTrait vertex_property_trait = 2; + if (this->_internal_has_vertex_property_trait()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.vertex_property_trait_); + } + + // .grin.EdgePropertyTrait edge_property_trait = 3; + if (this->_internal_has_edge_property_trait()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.edge_property_trait_); + } + + // .grin.PropertyDataPartitionStrategy vertex_property = 4; + if (this->_internal_vertex_property() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_vertex_property()); + } + + // .grin.PropertyDataPartitionStrategy edge_property = 5; + if (this->_internal_edge_property() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_edge_property()); + } + + // bool grin_enable_row = 1; + if (this->_internal_grin_enable_row() != 0) { + total_size += 1 + 1; + } + + // bool grin_assume_column_store_for_vertex_property = 6; + if (this->_internal_grin_assume_column_store_for_vertex_property() != 0) { + total_size += 1 + 1; + } + + // bool grin_assume_column_store_for_edge_property = 7; + if (this->_internal_grin_assume_column_store_for_edge_property() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_select_type_for_vertex_list = 8; + if (this->_internal_grin_trait_select_type_for_vertex_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_select_type_for_edge_list = 9; + if (this->_internal_grin_trait_select_type_for_edge_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; + if (this->_internal_grin_trait_select_neighbor_type_for_adjacent_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_select_edge_type_for_adjacent_list = 11; + if (this->_internal_grin_trait_select_edge_type_for_adjacent_list() != 0) { + total_size += 1 + 1; + } + + // bool grin_trait_specific_vev_relation = 12; + if (this->_internal_grin_trait_specific_vev_relation() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PropertyTrait::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + PropertyTrait::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PropertyTrait::GetClassData() const { return &_class_data_; } + + +void PropertyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.PropertyTrait) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_vertex_property_trait()) { + _this->_internal_mutable_vertex_property_trait()->::grin::VertexPropertyTrait::MergeFrom( + from._internal_vertex_property_trait()); + } + if (from._internal_has_edge_property_trait()) { + _this->_internal_mutable_edge_property_trait()->::grin::EdgePropertyTrait::MergeFrom( + from._internal_edge_property_trait()); + } + if (from._internal_vertex_property() != 0) { + _this->_internal_set_vertex_property(from._internal_vertex_property()); + } + if (from._internal_edge_property() != 0) { + _this->_internal_set_edge_property(from._internal_edge_property()); + } + if (from._internal_grin_enable_row() != 0) { + _this->_internal_set_grin_enable_row(from._internal_grin_enable_row()); + } + if (from._internal_grin_assume_column_store_for_vertex_property() != 0) { + _this->_internal_set_grin_assume_column_store_for_vertex_property(from._internal_grin_assume_column_store_for_vertex_property()); + } + if (from._internal_grin_assume_column_store_for_edge_property() != 0) { + _this->_internal_set_grin_assume_column_store_for_edge_property(from._internal_grin_assume_column_store_for_edge_property()); + } + if (from._internal_grin_trait_select_type_for_vertex_list() != 0) { + _this->_internal_set_grin_trait_select_type_for_vertex_list(from._internal_grin_trait_select_type_for_vertex_list()); + } + if (from._internal_grin_trait_select_type_for_edge_list() != 0) { + _this->_internal_set_grin_trait_select_type_for_edge_list(from._internal_grin_trait_select_type_for_edge_list()); + } + if (from._internal_grin_trait_select_neighbor_type_for_adjacent_list() != 0) { + _this->_internal_set_grin_trait_select_neighbor_type_for_adjacent_list(from._internal_grin_trait_select_neighbor_type_for_adjacent_list()); + } + if (from._internal_grin_trait_select_edge_type_for_adjacent_list() != 0) { + _this->_internal_set_grin_trait_select_edge_type_for_adjacent_list(from._internal_grin_trait_select_edge_type_for_adjacent_list()); + } + if (from._internal_grin_trait_specific_vev_relation() != 0) { + _this->_internal_set_grin_trait_specific_vev_relation(from._internal_grin_trait_specific_vev_relation()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PropertyTrait::CopyFrom(const PropertyTrait& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.PropertyTrait) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PropertyTrait::IsInitialized() const { + return true; +} + +void PropertyTrait::InternalSwap(PropertyTrait* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(PropertyTrait, _impl_.grin_trait_specific_vev_relation_) + + sizeof(PropertyTrait::_impl_.grin_trait_specific_vev_relation_) + - PROTOBUF_FIELD_OFFSET(PropertyTrait, _impl_.vertex_property_trait_)>( + reinterpret_cast(&_impl_.vertex_property_trait_), + reinterpret_cast(&other->_impl_.vertex_property_trait_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PropertyTrait::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[5]); +} + +// =================================================================== + +class IndexTrait::_Internal { + public: +}; + +IndexTrait::IndexTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:grin.IndexTrait) +} +IndexTrait::IndexTrait(const IndexTrait& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + IndexTrait* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.grin_with_vertex_label_){} + , decltype(_impl_.grin_with_edge_label_){} + , decltype(_impl_.grin_assume_all_vertex_list_sorted_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.grin_with_vertex_label_, &from._impl_.grin_with_vertex_label_, + static_cast(reinterpret_cast(&_impl_.grin_assume_all_vertex_list_sorted_) - + reinterpret_cast(&_impl_.grin_with_vertex_label_)) + sizeof(_impl_.grin_assume_all_vertex_list_sorted_)); + // @@protoc_insertion_point(copy_constructor:grin.IndexTrait) +} + +inline void IndexTrait::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.grin_with_vertex_label_){false} + , decltype(_impl_.grin_with_edge_label_){false} + , decltype(_impl_.grin_assume_all_vertex_list_sorted_){false} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +IndexTrait::~IndexTrait() { + // @@protoc_insertion_point(destructor:grin.IndexTrait) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void IndexTrait::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void IndexTrait::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void IndexTrait::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.IndexTrait) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.grin_with_vertex_label_, 0, static_cast( + reinterpret_cast(&_impl_.grin_assume_all_vertex_list_sorted_) - + reinterpret_cast(&_impl_.grin_with_vertex_label_)) + sizeof(_impl_.grin_assume_all_vertex_list_sorted_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* IndexTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // bool grin_with_vertex_label = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.grin_with_vertex_label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_with_edge_label = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.grin_with_edge_label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // bool grin_assume_all_vertex_list_sorted = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.grin_assume_all_vertex_list_sorted_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* IndexTrait::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.IndexTrait) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // bool grin_with_vertex_label = 1; + if (this->_internal_grin_with_vertex_label() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_vertex_label(), target); + } + + // bool grin_with_edge_label = 2; + if (this->_internal_grin_with_edge_label() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_edge_label(), target); + } + + // bool grin_assume_all_vertex_list_sorted = 3; + if (this->_internal_grin_assume_all_vertex_list_sorted() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_assume_all_vertex_list_sorted(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.IndexTrait) + return target; +} + +size_t IndexTrait::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.IndexTrait) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // bool grin_with_vertex_label = 1; + if (this->_internal_grin_with_vertex_label() != 0) { + total_size += 1 + 1; + } + + // bool grin_with_edge_label = 2; + if (this->_internal_grin_with_edge_label() != 0) { + total_size += 1 + 1; + } + + // bool grin_assume_all_vertex_list_sorted = 3; + if (this->_internal_grin_assume_all_vertex_list_sorted() != 0) { + total_size += 1 + 1; + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData IndexTrait::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + IndexTrait::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*IndexTrait::GetClassData() const { return &_class_data_; } + + +void IndexTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.IndexTrait) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_grin_with_vertex_label() != 0) { + _this->_internal_set_grin_with_vertex_label(from._internal_grin_with_vertex_label()); + } + if (from._internal_grin_with_edge_label() != 0) { + _this->_internal_set_grin_with_edge_label(from._internal_grin_with_edge_label()); + } + if (from._internal_grin_assume_all_vertex_list_sorted() != 0) { + _this->_internal_set_grin_assume_all_vertex_list_sorted(from._internal_grin_assume_all_vertex_list_sorted()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void IndexTrait::CopyFrom(const IndexTrait& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.IndexTrait) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool IndexTrait::IsInitialized() const { + return true; +} + +void IndexTrait::InternalSwap(IndexTrait* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(IndexTrait, _impl_.grin_assume_all_vertex_list_sorted_) + + sizeof(IndexTrait::_impl_.grin_assume_all_vertex_list_sorted_) + - PROTOBUF_FIELD_OFFSET(IndexTrait, _impl_.grin_with_vertex_label_)>( + reinterpret_cast(&_impl_.grin_with_vertex_label_), + reinterpret_cast(&other->_impl_.grin_with_vertex_label_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata IndexTrait::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[6]); +} + +// =================================================================== + +class PredicateTrait::_Internal { + public: +}; + +PredicateTrait::PredicateTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { + // @@protoc_insertion_point(arena_constructor:grin.PredicateTrait) +} +PredicateTrait::PredicateTrait(const PredicateTrait& from) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { + PredicateTrait* const _this = this; (void)_this; + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:grin.PredicateTrait) +} + + + + + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PredicateTrait::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PredicateTrait::GetClassData() const { return &_class_data_; } + + + + + + + +::PROTOBUF_NAMESPACE_ID::Metadata PredicateTrait::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[7]); +} + +// =================================================================== + +class StorageTrait::_Internal { + public: + static const ::grin::TopologyTrait& topology_trait(const StorageTrait* msg); + static const ::grin::PartitionTrait& partition_trait(const StorageTrait* msg); + static const ::grin::PropertyTrait& property_trait(const StorageTrait* msg); + static const ::grin::IndexTrait& index_trait(const StorageTrait* msg); + static const ::grin::PredicateTrait& predicate_trait(const StorageTrait* msg); +}; + +const ::grin::TopologyTrait& +StorageTrait::_Internal::topology_trait(const StorageTrait* msg) { + return *msg->_impl_.specific_trait_.topology_trait_; +} +const ::grin::PartitionTrait& +StorageTrait::_Internal::partition_trait(const StorageTrait* msg) { + return *msg->_impl_.specific_trait_.partition_trait_; +} +const ::grin::PropertyTrait& +StorageTrait::_Internal::property_trait(const StorageTrait* msg) { + return *msg->_impl_.specific_trait_.property_trait_; +} +const ::grin::IndexTrait& +StorageTrait::_Internal::index_trait(const StorageTrait* msg) { + return *msg->_impl_.specific_trait_.index_trait_; +} +const ::grin::PredicateTrait& +StorageTrait::_Internal::predicate_trait(const StorageTrait* msg) { + return *msg->_impl_.specific_trait_.predicate_trait_; +} +void StorageTrait::set_allocated_topology_trait(::grin::TopologyTrait* topology_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + clear_specific_trait(); + if (topology_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(topology_trait); + if (message_arena != submessage_arena) { + topology_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, topology_trait, submessage_arena); + } + set_has_topology_trait(); + _impl_.specific_trait_.topology_trait_ = topology_trait; + } + // @@protoc_insertion_point(field_set_allocated:grin.StorageTrait.topology_trait) +} +void StorageTrait::set_allocated_partition_trait(::grin::PartitionTrait* partition_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + clear_specific_trait(); + if (partition_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(partition_trait); + if (message_arena != submessage_arena) { + partition_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, partition_trait, submessage_arena); + } + set_has_partition_trait(); + _impl_.specific_trait_.partition_trait_ = partition_trait; + } + // @@protoc_insertion_point(field_set_allocated:grin.StorageTrait.partition_trait) +} +void StorageTrait::set_allocated_property_trait(::grin::PropertyTrait* property_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + clear_specific_trait(); + if (property_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(property_trait); + if (message_arena != submessage_arena) { + property_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, property_trait, submessage_arena); + } + set_has_property_trait(); + _impl_.specific_trait_.property_trait_ = property_trait; + } + // @@protoc_insertion_point(field_set_allocated:grin.StorageTrait.property_trait) +} +void StorageTrait::set_allocated_index_trait(::grin::IndexTrait* index_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + clear_specific_trait(); + if (index_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(index_trait); + if (message_arena != submessage_arena) { + index_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, index_trait, submessage_arena); + } + set_has_index_trait(); + _impl_.specific_trait_.index_trait_ = index_trait; + } + // @@protoc_insertion_point(field_set_allocated:grin.StorageTrait.index_trait) +} +void StorageTrait::set_allocated_predicate_trait(::grin::PredicateTrait* predicate_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + clear_specific_trait(); + if (predicate_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(predicate_trait); + if (message_arena != submessage_arena) { + predicate_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, predicate_trait, submessage_arena); + } + set_has_predicate_trait(); + _impl_.specific_trait_.predicate_trait_ = predicate_trait; + } + // @@protoc_insertion_point(field_set_allocated:grin.StorageTrait.predicate_trait) +} +StorageTrait::StorageTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:grin.StorageTrait) +} +StorageTrait::StorageTrait(const StorageTrait& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + StorageTrait* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.specific_trait_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + clear_has_specific_trait(); + switch (from.specific_trait_case()) { + case kTopologyTrait: { + _this->_internal_mutable_topology_trait()->::grin::TopologyTrait::MergeFrom( + from._internal_topology_trait()); + break; + } + case kPartitionTrait: { + _this->_internal_mutable_partition_trait()->::grin::PartitionTrait::MergeFrom( + from._internal_partition_trait()); + break; + } + case kPropertyTrait: { + _this->_internal_mutable_property_trait()->::grin::PropertyTrait::MergeFrom( + from._internal_property_trait()); + break; + } + case kIndexTrait: { + _this->_internal_mutable_index_trait()->::grin::IndexTrait::MergeFrom( + from._internal_index_trait()); + break; + } + case kPredicateTrait: { + _this->_internal_mutable_predicate_trait()->::grin::PredicateTrait::MergeFrom( + from._internal_predicate_trait()); + break; + } + case SPECIFIC_TRAIT_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:grin.StorageTrait) +} + +inline void StorageTrait::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.specific_trait_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{} + }; + clear_has_specific_trait(); +} + +StorageTrait::~StorageTrait() { + // @@protoc_insertion_point(destructor:grin.StorageTrait) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void StorageTrait::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (has_specific_trait()) { + clear_specific_trait(); + } +} + +void StorageTrait::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void StorageTrait::clear_specific_trait() { +// @@protoc_insertion_point(one_of_clear_start:grin.StorageTrait) + switch (specific_trait_case()) { + case kTopologyTrait: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.specific_trait_.topology_trait_; + } + break; + } + case kPartitionTrait: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.specific_trait_.partition_trait_; + } + break; + } + case kPropertyTrait: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.specific_trait_.property_trait_; + } + break; + } + case kIndexTrait: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.specific_trait_.index_trait_; + } + break; + } + case kPredicateTrait: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.specific_trait_.predicate_trait_; + } + break; + } + case SPECIFIC_TRAIT_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = SPECIFIC_TRAIT_NOT_SET; +} + + +void StorageTrait::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.StorageTrait) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_specific_trait(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* StorageTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .grin.TopologyTrait topology_trait = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_topology_trait(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .grin.PartitionTrait partition_trait = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_partition_trait(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .grin.PropertyTrait property_trait = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_property_trait(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .grin.IndexTrait index_trait = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr = ctx->ParseMessage(_internal_mutable_index_trait(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .grin.PredicateTrait predicate_trait = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_predicate_trait(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* StorageTrait::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.StorageTrait) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .grin.TopologyTrait topology_trait = 1; + if (_internal_has_topology_trait()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::topology_trait(this), + _Internal::topology_trait(this).GetCachedSize(), target, stream); + } + + // .grin.PartitionTrait partition_trait = 2; + if (_internal_has_partition_trait()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::partition_trait(this), + _Internal::partition_trait(this).GetCachedSize(), target, stream); + } + + // .grin.PropertyTrait property_trait = 3; + if (_internal_has_property_trait()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, _Internal::property_trait(this), + _Internal::property_trait(this).GetCachedSize(), target, stream); + } + + // .grin.IndexTrait index_trait = 4; + if (_internal_has_index_trait()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::index_trait(this), + _Internal::index_trait(this).GetCachedSize(), target, stream); + } + + // .grin.PredicateTrait predicate_trait = 5; + if (_internal_has_predicate_trait()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(5, _Internal::predicate_trait(this), + _Internal::predicate_trait(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.StorageTrait) + return target; +} + +size_t StorageTrait::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.StorageTrait) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + switch (specific_trait_case()) { + // .grin.TopologyTrait topology_trait = 1; + case kTopologyTrait: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.specific_trait_.topology_trait_); + break; + } + // .grin.PartitionTrait partition_trait = 2; + case kPartitionTrait: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.specific_trait_.partition_trait_); + break; + } + // .grin.PropertyTrait property_trait = 3; + case kPropertyTrait: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.specific_trait_.property_trait_); + break; + } + // .grin.IndexTrait index_trait = 4; + case kIndexTrait: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.specific_trait_.index_trait_); + break; + } + // .grin.PredicateTrait predicate_trait = 5; + case kPredicateTrait: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.specific_trait_.predicate_trait_); + break; + } + case SPECIFIC_TRAIT_NOT_SET: { + break; + } + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData StorageTrait::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + StorageTrait::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*StorageTrait::GetClassData() const { return &_class_data_; } + + +void StorageTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.StorageTrait) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.specific_trait_case()) { + case kTopologyTrait: { + _this->_internal_mutable_topology_trait()->::grin::TopologyTrait::MergeFrom( + from._internal_topology_trait()); + break; + } + case kPartitionTrait: { + _this->_internal_mutable_partition_trait()->::grin::PartitionTrait::MergeFrom( + from._internal_partition_trait()); + break; + } + case kPropertyTrait: { + _this->_internal_mutable_property_trait()->::grin::PropertyTrait::MergeFrom( + from._internal_property_trait()); + break; + } + case kIndexTrait: { + _this->_internal_mutable_index_trait()->::grin::IndexTrait::MergeFrom( + from._internal_index_trait()); + break; + } + case kPredicateTrait: { + _this->_internal_mutable_predicate_trait()->::grin::PredicateTrait::MergeFrom( + from._internal_predicate_trait()); + break; + } + case SPECIFIC_TRAIT_NOT_SET: { + break; + } + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void StorageTrait::CopyFrom(const StorageTrait& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.StorageTrait) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool StorageTrait::IsInitialized() const { + return true; +} + +void StorageTrait::InternalSwap(StorageTrait* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.specific_trait_, other->_impl_.specific_trait_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata StorageTrait::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[8]); +} + +// =================================================================== + +class Statistics::_Internal { + public: +}; + +Statistics::Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:grin.Statistics) +} +Statistics::Statistics(const Statistics& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Statistics* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.vertex_count_){} + , decltype(_impl_.edge_count_){} + , decltype(_impl_.partition_count_){} + , decltype(_impl_.vertex_type_count_){} + , decltype(_impl_.edge_type_count_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.vertex_count_, &from._impl_.vertex_count_, + static_cast(reinterpret_cast(&_impl_.edge_type_count_) - + reinterpret_cast(&_impl_.vertex_count_)) + sizeof(_impl_.edge_type_count_)); + // @@protoc_insertion_point(copy_constructor:grin.Statistics) +} + +inline void Statistics::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.vertex_count_){0} + , decltype(_impl_.edge_count_){0} + , decltype(_impl_.partition_count_){0} + , decltype(_impl_.vertex_type_count_){0} + , decltype(_impl_.edge_type_count_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +Statistics::~Statistics() { + // @@protoc_insertion_point(destructor:grin.Statistics) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Statistics::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void Statistics::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Statistics::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.Statistics) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.vertex_count_, 0, static_cast( + reinterpret_cast(&_impl_.edge_type_count_) - + reinterpret_cast(&_impl_.vertex_count_)) + sizeof(_impl_.edge_type_count_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Statistics::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // int32 vertex_count = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.vertex_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // int32 edge_count = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.edge_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // int32 partition_count = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.partition_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // int32 vertex_type_count = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + _impl_.vertex_type_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // int32 edge_type_count = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + _impl_.edge_type_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Statistics::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.Statistics) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // int32 vertex_count = 1; + if (this->_internal_vertex_count() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_vertex_count(), target); + } + + // int32 edge_count = 2; + if (this->_internal_edge_count() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_edge_count(), target); + } + + // int32 partition_count = 3; + if (this->_internal_partition_count() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_partition_count(), target); + } + + // int32 vertex_type_count = 4; + if (this->_internal_vertex_type_count() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_vertex_type_count(), target); + } + + // int32 edge_type_count = 5; + if (this->_internal_edge_type_count() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_edge_type_count(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.Statistics) + return target; +} + +size_t Statistics::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.Statistics) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // int32 vertex_count = 1; + if (this->_internal_vertex_count() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_vertex_count()); + } + + // int32 edge_count = 2; + if (this->_internal_edge_count() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_edge_count()); + } + + // int32 partition_count = 3; + if (this->_internal_partition_count() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_partition_count()); + } + + // int32 vertex_type_count = 4; + if (this->_internal_vertex_type_count() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_vertex_type_count()); + } + + // int32 edge_type_count = 5; + if (this->_internal_edge_type_count() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_edge_type_count()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Statistics::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Statistics::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Statistics::GetClassData() const { return &_class_data_; } + + +void Statistics::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.Statistics) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_vertex_count() != 0) { + _this->_internal_set_vertex_count(from._internal_vertex_count()); + } + if (from._internal_edge_count() != 0) { + _this->_internal_set_edge_count(from._internal_edge_count()); + } + if (from._internal_partition_count() != 0) { + _this->_internal_set_partition_count(from._internal_partition_count()); + } + if (from._internal_vertex_type_count() != 0) { + _this->_internal_set_vertex_type_count(from._internal_vertex_type_count()); + } + if (from._internal_edge_type_count() != 0) { + _this->_internal_set_edge_type_count(from._internal_edge_type_count()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Statistics::CopyFrom(const Statistics& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.Statistics) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Statistics::IsInitialized() const { + return true; +} + +void Statistics::InternalSwap(Statistics* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Statistics, _impl_.edge_type_count_) + + sizeof(Statistics::_impl_.edge_type_count_) + - PROTOBUF_FIELD_OFFSET(Statistics, _impl_.vertex_count_)>( + reinterpret_cast(&_impl_.vertex_count_), + reinterpret_cast(&other->_impl_.vertex_count_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Statistics::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[9]); +} + +// =================================================================== + +class Graph::_Internal { + public: + static const ::grin::Statistics& statistics(const Graph* msg); +}; + +const ::grin::Statistics& +Graph::_Internal::statistics(const Graph* msg) { + return *msg->_impl_.statistics_; +} +Graph::Graph(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:grin.Graph) +} +Graph::Graph(const Graph& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Graph* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.traits_){from._impl_.traits_} + , decltype(_impl_.uri_){} + , decltype(_impl_.grin_version_){} + , decltype(_impl_.statistics_){nullptr} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.uri_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.uri_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_uri().empty()) { + _this->_impl_.uri_.Set(from._internal_uri(), + _this->GetArenaForAllocation()); + } + _impl_.grin_version_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.grin_version_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_grin_version().empty()) { + _this->_impl_.grin_version_.Set(from._internal_grin_version(), + _this->GetArenaForAllocation()); + } + if (from._internal_has_statistics()) { + _this->_impl_.statistics_ = new ::grin::Statistics(*from._impl_.statistics_); + } + // @@protoc_insertion_point(copy_constructor:grin.Graph) +} + +inline void Graph::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.traits_){arena} + , decltype(_impl_.uri_){} + , decltype(_impl_.grin_version_){} + , decltype(_impl_.statistics_){nullptr} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.uri_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.uri_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.grin_version_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.grin_version_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Graph::~Graph() { + // @@protoc_insertion_point(destructor:grin.Graph) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Graph::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.traits_.~RepeatedPtrField(); + _impl_.uri_.Destroy(); + _impl_.grin_version_.Destroy(); + if (this != internal_default_instance()) delete _impl_.statistics_; +} + +void Graph::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Graph::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.Graph) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.traits_.Clear(); + _impl_.uri_.ClearToEmpty(); + _impl_.grin_version_.ClearToEmpty(); + if (GetArenaForAllocation() == nullptr && _impl_.statistics_ != nullptr) { + delete _impl_.statistics_; + } + _impl_.statistics_ = nullptr; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Graph::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // string uri = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_uri(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "grin.Graph.uri")); + } else + goto handle_unusual; + continue; + // string grin_version = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_grin_version(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "grin.Graph.grin_version")); + } else + goto handle_unusual; + continue; + // repeated .grin.StorageTrait traits = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_traits(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); + } else + goto handle_unusual; + continue; + // .grin.Statistics statistics = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr = ctx->ParseMessage(_internal_mutable_statistics(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Graph::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.Graph) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string uri = 1; + if (!this->_internal_uri().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_uri().data(), static_cast(this->_internal_uri().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "grin.Graph.uri"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_uri(), target); + } + + // string grin_version = 2; + if (!this->_internal_grin_version().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_grin_version().data(), static_cast(this->_internal_grin_version().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "grin.Graph.grin_version"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_grin_version(), target); + } + + // repeated .grin.StorageTrait traits = 3; + for (unsigned i = 0, + n = static_cast(this->_internal_traits_size()); i < n; i++) { + const auto& repfield = this->_internal_traits(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); + } + + // .grin.Statistics statistics = 4; + if (this->_internal_has_statistics()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::statistics(this), + _Internal::statistics(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.Graph) + return target; +} + +size_t Graph::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.Graph) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .grin.StorageTrait traits = 3; + total_size += 1UL * this->_internal_traits_size(); + for (const auto& msg : this->_impl_.traits_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // string uri = 1; + if (!this->_internal_uri().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_uri()); + } + + // string grin_version = 2; + if (!this->_internal_grin_version().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_grin_version()); + } + + // .grin.Statistics statistics = 4; + if (this->_internal_has_statistics()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.statistics_); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Graph::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Graph::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Graph::GetClassData() const { return &_class_data_; } + + +void Graph::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.Graph) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.traits_.MergeFrom(from._impl_.traits_); + if (!from._internal_uri().empty()) { + _this->_internal_set_uri(from._internal_uri()); + } + if (!from._internal_grin_version().empty()) { + _this->_internal_set_grin_version(from._internal_grin_version()); + } + if (from._internal_has_statistics()) { + _this->_internal_mutable_statistics()->::grin::Statistics::MergeFrom( + from._internal_statistics()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Graph::CopyFrom(const Graph& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.Graph) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Graph::IsInitialized() const { + return true; +} + +void Graph::InternalSwap(Graph* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.traits_.InternalSwap(&other->_impl_.traits_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.uri_, lhs_arena, + &other->_impl_.uri_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.grin_version_, lhs_arena, + &other->_impl_.grin_version_, rhs_arena + ); + swap(_impl_.statistics_, other->_impl_.statistics_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Graph::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, + file_level_metadata_graph_2eproto[10]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace grin +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::grin::TopologyTrait* +Arena::CreateMaybeMessage< ::grin::TopologyTrait >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::TopologyTrait >(arena); +} +template<> PROTOBUF_NOINLINE ::grin::MirrorPartitionListTrait* +Arena::CreateMaybeMessage< ::grin::MirrorPartitionListTrait >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::MirrorPartitionListTrait >(arena); +} +template<> PROTOBUF_NOINLINE ::grin::PartitionTrait* +Arena::CreateMaybeMessage< ::grin::PartitionTrait >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::PartitionTrait >(arena); +} +template<> PROTOBUF_NOINLINE ::grin::VertexPropertyTrait* +Arena::CreateMaybeMessage< ::grin::VertexPropertyTrait >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::VertexPropertyTrait >(arena); +} +template<> PROTOBUF_NOINLINE ::grin::EdgePropertyTrait* +Arena::CreateMaybeMessage< ::grin::EdgePropertyTrait >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::EdgePropertyTrait >(arena); +} +template<> PROTOBUF_NOINLINE ::grin::PropertyTrait* +Arena::CreateMaybeMessage< ::grin::PropertyTrait >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::PropertyTrait >(arena); +} +template<> PROTOBUF_NOINLINE ::grin::IndexTrait* +Arena::CreateMaybeMessage< ::grin::IndexTrait >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::IndexTrait >(arena); +} +template<> PROTOBUF_NOINLINE ::grin::PredicateTrait* +Arena::CreateMaybeMessage< ::grin::PredicateTrait >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::PredicateTrait >(arena); +} +template<> PROTOBUF_NOINLINE ::grin::StorageTrait* +Arena::CreateMaybeMessage< ::grin::StorageTrait >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::StorageTrait >(arena); +} +template<> PROTOBUF_NOINLINE ::grin::Statistics* +Arena::CreateMaybeMessage< ::grin::Statistics >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::Statistics >(arena); +} +template<> PROTOBUF_NOINLINE ::grin::Graph* +Arena::CreateMaybeMessage< ::grin::Graph >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::Graph >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/modules/graph/grin/src/proto/graph.pb.h b/modules/graph/grin/src/proto/graph.pb.h new file mode 100644 index 000000000..0b0d081e8 --- /dev/null +++ b/modules/graph/grin/src/proto/graph.pb.h @@ -0,0 +1,4800 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: graph.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_graph_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_graph_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_graph_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_graph_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_graph_2eproto; +namespace grin { +class EdgePropertyTrait; +struct EdgePropertyTraitDefaultTypeInternal; +extern EdgePropertyTraitDefaultTypeInternal _EdgePropertyTrait_default_instance_; +class Graph; +struct GraphDefaultTypeInternal; +extern GraphDefaultTypeInternal _Graph_default_instance_; +class IndexTrait; +struct IndexTraitDefaultTypeInternal; +extern IndexTraitDefaultTypeInternal _IndexTrait_default_instance_; +class MirrorPartitionListTrait; +struct MirrorPartitionListTraitDefaultTypeInternal; +extern MirrorPartitionListTraitDefaultTypeInternal _MirrorPartitionListTrait_default_instance_; +class PartitionTrait; +struct PartitionTraitDefaultTypeInternal; +extern PartitionTraitDefaultTypeInternal _PartitionTrait_default_instance_; +class PredicateTrait; +struct PredicateTraitDefaultTypeInternal; +extern PredicateTraitDefaultTypeInternal _PredicateTrait_default_instance_; +class PropertyTrait; +struct PropertyTraitDefaultTypeInternal; +extern PropertyTraitDefaultTypeInternal _PropertyTrait_default_instance_; +class Statistics; +struct StatisticsDefaultTypeInternal; +extern StatisticsDefaultTypeInternal _Statistics_default_instance_; +class StorageTrait; +struct StorageTraitDefaultTypeInternal; +extern StorageTraitDefaultTypeInternal _StorageTrait_default_instance_; +class TopologyTrait; +struct TopologyTraitDefaultTypeInternal; +extern TopologyTraitDefaultTypeInternal _TopologyTrait_default_instance_; +class VertexPropertyTrait; +struct VertexPropertyTraitDefaultTypeInternal; +extern VertexPropertyTraitDefaultTypeInternal _VertexPropertyTrait_default_instance_; +} // namespace grin +PROTOBUF_NAMESPACE_OPEN +template<> ::grin::EdgePropertyTrait* Arena::CreateMaybeMessage<::grin::EdgePropertyTrait>(Arena*); +template<> ::grin::Graph* Arena::CreateMaybeMessage<::grin::Graph>(Arena*); +template<> ::grin::IndexTrait* Arena::CreateMaybeMessage<::grin::IndexTrait>(Arena*); +template<> ::grin::MirrorPartitionListTrait* Arena::CreateMaybeMessage<::grin::MirrorPartitionListTrait>(Arena*); +template<> ::grin::PartitionTrait* Arena::CreateMaybeMessage<::grin::PartitionTrait>(Arena*); +template<> ::grin::PredicateTrait* Arena::CreateMaybeMessage<::grin::PredicateTrait>(Arena*); +template<> ::grin::PropertyTrait* Arena::CreateMaybeMessage<::grin::PropertyTrait>(Arena*); +template<> ::grin::Statistics* Arena::CreateMaybeMessage<::grin::Statistics>(Arena*); +template<> ::grin::StorageTrait* Arena::CreateMaybeMessage<::grin::StorageTrait>(Arena*); +template<> ::grin::TopologyTrait* Arena::CreateMaybeMessage<::grin::TopologyTrait>(Arena*); +template<> ::grin::VertexPropertyTrait* Arena::CreateMaybeMessage<::grin::VertexPropertyTrait>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace grin { + +enum ListRetrieval : int { + LR_NA = 0, + LR_ARRAY_LIKE = 1, + LR_ITERATOR = 2, + ListRetrieval_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + ListRetrieval_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool ListRetrieval_IsValid(int value); +constexpr ListRetrieval ListRetrieval_MIN = LR_NA; +constexpr ListRetrieval ListRetrieval_MAX = LR_ITERATOR; +constexpr int ListRetrieval_ARRAYSIZE = ListRetrieval_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ListRetrieval_descriptor(); +template +inline const std::string& ListRetrieval_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function ListRetrieval_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + ListRetrieval_descriptor(), enum_t_value); +} +inline bool ListRetrieval_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ListRetrieval* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + ListRetrieval_descriptor(), name, value); +} +enum GraphPartitionStrategy : int { + GPS_NA = 0, + GPS_ALL_REPLICATE = 1, + GPS_EDGE_CUT = 2, + GPS_VERTEX_CUT = 3, + GPS_HYBRID_CUT = 4, + GraphPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + GraphPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool GraphPartitionStrategy_IsValid(int value); +constexpr GraphPartitionStrategy GraphPartitionStrategy_MIN = GPS_NA; +constexpr GraphPartitionStrategy GraphPartitionStrategy_MAX = GPS_HYBRID_CUT; +constexpr int GraphPartitionStrategy_ARRAYSIZE = GraphPartitionStrategy_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GraphPartitionStrategy_descriptor(); +template +inline const std::string& GraphPartitionStrategy_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function GraphPartitionStrategy_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + GraphPartitionStrategy_descriptor(), enum_t_value); +} +inline bool GraphPartitionStrategy_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GraphPartitionStrategy* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + GraphPartitionStrategy_descriptor(), name, value); +} +enum PropertyDataPartitionStrategy : int { + PDPS_NA = 0, + PDPS_MASTER_ONLY = 1, + PDPS_REPLICATE_MASTER_MIRROR = 2, + PDPS_SPLIT_MASTER_MIRROR = 3, + PropertyDataPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + PropertyDataPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool PropertyDataPartitionStrategy_IsValid(int value); +constexpr PropertyDataPartitionStrategy PropertyDataPartitionStrategy_MIN = PDPS_NA; +constexpr PropertyDataPartitionStrategy PropertyDataPartitionStrategy_MAX = PDPS_SPLIT_MASTER_MIRROR; +constexpr int PropertyDataPartitionStrategy_ARRAYSIZE = PropertyDataPartitionStrategy_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PropertyDataPartitionStrategy_descriptor(); +template +inline const std::string& PropertyDataPartitionStrategy_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function PropertyDataPartitionStrategy_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + PropertyDataPartitionStrategy_descriptor(), enum_t_value); +} +inline bool PropertyDataPartitionStrategy_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PropertyDataPartitionStrategy* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + PropertyDataPartitionStrategy_descriptor(), name, value); +} +// =================================================================== + +class TopologyTrait final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.TopologyTrait) */ { + public: + inline TopologyTrait() : TopologyTrait(nullptr) {} + ~TopologyTrait() override; + explicit PROTOBUF_CONSTEXPR TopologyTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + TopologyTrait(const TopologyTrait& from); + TopologyTrait(TopologyTrait&& from) noexcept + : TopologyTrait() { + *this = ::std::move(from); + } + + inline TopologyTrait& operator=(const TopologyTrait& from) { + CopyFrom(from); + return *this; + } + inline TopologyTrait& operator=(TopologyTrait&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const TopologyTrait& default_instance() { + return *internal_default_instance(); + } + static inline const TopologyTrait* internal_default_instance() { + return reinterpret_cast( + &_TopologyTrait_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(TopologyTrait& a, TopologyTrait& b) { + a.Swap(&b); + } + inline void Swap(TopologyTrait* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(TopologyTrait* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + TopologyTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const TopologyTrait& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const TopologyTrait& from) { + TopologyTrait::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(TopologyTrait* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.TopologyTrait"; + } + protected: + explicit TopologyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kVertexListRetrievalsFieldNumber = 7, + kEdgeListRetrievalsFieldNumber = 8, + kAdjacentListRetrievalsFieldNumber = 9, + kGrinAssumeHasDirectedGraphFieldNumber = 1, + kGrinAssumeHasUndirectedGraphFieldNumber = 2, + kGrinAssumeHasMultiEdgeGraphFieldNumber = 3, + kGrinWithVertexOriginalIdFieldNumber = 4, + kGrinWithVertexDataFieldNumber = 5, + kGrinWithEdgeDataFieldNumber = 6, + }; + // repeated .grin.ListRetrieval vertex_list_retrievals = 7; + int vertex_list_retrievals_size() const; + private: + int _internal_vertex_list_retrievals_size() const; + public: + void clear_vertex_list_retrievals(); + private: + ::grin::ListRetrieval _internal_vertex_list_retrievals(int index) const; + void _internal_add_vertex_list_retrievals(::grin::ListRetrieval value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField* _internal_mutable_vertex_list_retrievals(); + public: + ::grin::ListRetrieval vertex_list_retrievals(int index) const; + void set_vertex_list_retrievals(int index, ::grin::ListRetrieval value); + void add_vertex_list_retrievals(::grin::ListRetrieval value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField& vertex_list_retrievals() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField* mutable_vertex_list_retrievals(); + + // repeated .grin.ListRetrieval edge_list_retrievals = 8; + int edge_list_retrievals_size() const; + private: + int _internal_edge_list_retrievals_size() const; + public: + void clear_edge_list_retrievals(); + private: + ::grin::ListRetrieval _internal_edge_list_retrievals(int index) const; + void _internal_add_edge_list_retrievals(::grin::ListRetrieval value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField* _internal_mutable_edge_list_retrievals(); + public: + ::grin::ListRetrieval edge_list_retrievals(int index) const; + void set_edge_list_retrievals(int index, ::grin::ListRetrieval value); + void add_edge_list_retrievals(::grin::ListRetrieval value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField& edge_list_retrievals() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField* mutable_edge_list_retrievals(); + + // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; + int adjacent_list_retrievals_size() const; + private: + int _internal_adjacent_list_retrievals_size() const; + public: + void clear_adjacent_list_retrievals(); + private: + ::grin::ListRetrieval _internal_adjacent_list_retrievals(int index) const; + void _internal_add_adjacent_list_retrievals(::grin::ListRetrieval value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField* _internal_mutable_adjacent_list_retrievals(); + public: + ::grin::ListRetrieval adjacent_list_retrievals(int index) const; + void set_adjacent_list_retrievals(int index, ::grin::ListRetrieval value); + void add_adjacent_list_retrievals(::grin::ListRetrieval value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField& adjacent_list_retrievals() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField* mutable_adjacent_list_retrievals(); + + // bool grin_assume_has_directed_graph = 1; + void clear_grin_assume_has_directed_graph(); + bool grin_assume_has_directed_graph() const; + void set_grin_assume_has_directed_graph(bool value); + private: + bool _internal_grin_assume_has_directed_graph() const; + void _internal_set_grin_assume_has_directed_graph(bool value); + public: + + // bool grin_assume_has_undirected_graph = 2; + void clear_grin_assume_has_undirected_graph(); + bool grin_assume_has_undirected_graph() const; + void set_grin_assume_has_undirected_graph(bool value); + private: + bool _internal_grin_assume_has_undirected_graph() const; + void _internal_set_grin_assume_has_undirected_graph(bool value); + public: + + // bool grin_assume_has_multi_edge_graph = 3; + void clear_grin_assume_has_multi_edge_graph(); + bool grin_assume_has_multi_edge_graph() const; + void set_grin_assume_has_multi_edge_graph(bool value); + private: + bool _internal_grin_assume_has_multi_edge_graph() const; + void _internal_set_grin_assume_has_multi_edge_graph(bool value); + public: + + // bool grin_with_vertex_original_id = 4; + void clear_grin_with_vertex_original_id(); + bool grin_with_vertex_original_id() const; + void set_grin_with_vertex_original_id(bool value); + private: + bool _internal_grin_with_vertex_original_id() const; + void _internal_set_grin_with_vertex_original_id(bool value); + public: + + // bool grin_with_vertex_data = 5; + void clear_grin_with_vertex_data(); + bool grin_with_vertex_data() const; + void set_grin_with_vertex_data(bool value); + private: + bool _internal_grin_with_vertex_data() const; + void _internal_set_grin_with_vertex_data(bool value); + public: + + // bool grin_with_edge_data = 6; + void clear_grin_with_edge_data(); + bool grin_with_edge_data() const; + void set_grin_with_edge_data(bool value); + private: + bool _internal_grin_with_edge_data() const; + void _internal_set_grin_with_edge_data(bool value); + public: + + // @@protoc_insertion_point(class_scope:grin.TopologyTrait) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedField vertex_list_retrievals_; + mutable std::atomic _vertex_list_retrievals_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField edge_list_retrievals_; + mutable std::atomic _edge_list_retrievals_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField adjacent_list_retrievals_; + mutable std::atomic _adjacent_list_retrievals_cached_byte_size_; + bool grin_assume_has_directed_graph_; + bool grin_assume_has_undirected_graph_; + bool grin_assume_has_multi_edge_graph_; + bool grin_with_vertex_original_id_; + bool grin_with_vertex_data_; + bool grin_with_edge_data_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_graph_2eproto; +}; +// ------------------------------------------------------------------- + +class MirrorPartitionListTrait final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.MirrorPartitionListTrait) */ { + public: + inline MirrorPartitionListTrait() : MirrorPartitionListTrait(nullptr) {} + ~MirrorPartitionListTrait() override; + explicit PROTOBUF_CONSTEXPR MirrorPartitionListTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + MirrorPartitionListTrait(const MirrorPartitionListTrait& from); + MirrorPartitionListTrait(MirrorPartitionListTrait&& from) noexcept + : MirrorPartitionListTrait() { + *this = ::std::move(from); + } + + inline MirrorPartitionListTrait& operator=(const MirrorPartitionListTrait& from) { + CopyFrom(from); + return *this; + } + inline MirrorPartitionListTrait& operator=(MirrorPartitionListTrait&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const MirrorPartitionListTrait& default_instance() { + return *internal_default_instance(); + } + static inline const MirrorPartitionListTrait* internal_default_instance() { + return reinterpret_cast( + &_MirrorPartitionListTrait_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(MirrorPartitionListTrait& a, MirrorPartitionListTrait& b) { + a.Swap(&b); + } + inline void Swap(MirrorPartitionListTrait* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(MirrorPartitionListTrait* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + MirrorPartitionListTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const MirrorPartitionListTrait& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const MirrorPartitionListTrait& from) { + MirrorPartitionListTrait::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MirrorPartitionListTrait* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.MirrorPartitionListTrait"; + } + protected: + explicit MirrorPartitionListTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kGrinTraitMasterVertexMirrorPartitionListFieldNumber = 1, + kGrinTraitMirrorVertexMirrorPartitionListFieldNumber = 2, + kGrinTraitMasterEdgeMirrorPartitionListFieldNumber = 3, + kGrinTraitMirrorEdgeMirrorPartitionListFieldNumber = 4, + }; + // bool grin_trait_master_vertex_mirror_partition_list = 1; + void clear_grin_trait_master_vertex_mirror_partition_list(); + bool grin_trait_master_vertex_mirror_partition_list() const; + void set_grin_trait_master_vertex_mirror_partition_list(bool value); + private: + bool _internal_grin_trait_master_vertex_mirror_partition_list() const; + void _internal_set_grin_trait_master_vertex_mirror_partition_list(bool value); + public: + + // bool grin_trait_mirror_vertex_mirror_partition_list = 2; + void clear_grin_trait_mirror_vertex_mirror_partition_list(); + bool grin_trait_mirror_vertex_mirror_partition_list() const; + void set_grin_trait_mirror_vertex_mirror_partition_list(bool value); + private: + bool _internal_grin_trait_mirror_vertex_mirror_partition_list() const; + void _internal_set_grin_trait_mirror_vertex_mirror_partition_list(bool value); + public: + + // bool grin_trait_master_edge_mirror_partition_list = 3; + void clear_grin_trait_master_edge_mirror_partition_list(); + bool grin_trait_master_edge_mirror_partition_list() const; + void set_grin_trait_master_edge_mirror_partition_list(bool value); + private: + bool _internal_grin_trait_master_edge_mirror_partition_list() const; + void _internal_set_grin_trait_master_edge_mirror_partition_list(bool value); + public: + + // bool grin_trait_mirror_edge_mirror_partition_list = 4; + void clear_grin_trait_mirror_edge_mirror_partition_list(); + bool grin_trait_mirror_edge_mirror_partition_list() const; + void set_grin_trait_mirror_edge_mirror_partition_list(bool value); + private: + bool _internal_grin_trait_mirror_edge_mirror_partition_list() const; + void _internal_set_grin_trait_mirror_edge_mirror_partition_list(bool value); + public: + + // @@protoc_insertion_point(class_scope:grin.MirrorPartitionListTrait) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool grin_trait_master_vertex_mirror_partition_list_; + bool grin_trait_mirror_vertex_mirror_partition_list_; + bool grin_trait_master_edge_mirror_partition_list_; + bool grin_trait_mirror_edge_mirror_partition_list_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_graph_2eproto; +}; +// ------------------------------------------------------------------- + +class PartitionTrait final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PartitionTrait) */ { + public: + inline PartitionTrait() : PartitionTrait(nullptr) {} + ~PartitionTrait() override; + explicit PROTOBUF_CONSTEXPR PartitionTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PartitionTrait(const PartitionTrait& from); + PartitionTrait(PartitionTrait&& from) noexcept + : PartitionTrait() { + *this = ::std::move(from); + } + + inline PartitionTrait& operator=(const PartitionTrait& from) { + CopyFrom(from); + return *this; + } + inline PartitionTrait& operator=(PartitionTrait&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PartitionTrait& default_instance() { + return *internal_default_instance(); + } + static inline const PartitionTrait* internal_default_instance() { + return reinterpret_cast( + &_PartitionTrait_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(PartitionTrait& a, PartitionTrait& b) { + a.Swap(&b); + } + inline void Swap(PartitionTrait* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PartitionTrait* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PartitionTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const PartitionTrait& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const PartitionTrait& from) { + PartitionTrait::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PartitionTrait* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.PartitionTrait"; + } + protected: + explicit PartitionTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kMirrorPartitionListTraitFieldNumber = 7, + kGraphPartitionStrategyFieldNumber = 1, + kGrinTraitNaturalIdForPartitionFieldNumber = 2, + kGrinEnableVertexRefFieldNumber = 3, + kGrinEnableEdgeRefFieldNumber = 4, + kGrinTraitSelectMasterForVertexListFieldNumber = 8, + kVertexDataFieldNumber = 5, + kEdgeDataFieldNumber = 6, + kGrinTraitSelectPartitionForVertexListFieldNumber = 9, + kGrinTraitSelectMasterForEdgeListFieldNumber = 10, + kGrinTraitSelectPartitionForEdgeListFieldNumber = 11, + kGrinTraitSelectMasterNeighborForAdjacentListFieldNumber = 12, + kGrinTraitSelectNeighborPartitionForAdjacentListFieldNumber = 13, + }; + // .grin.MirrorPartitionListTrait mirror_partition_list_trait = 7; + bool has_mirror_partition_list_trait() const; + private: + bool _internal_has_mirror_partition_list_trait() const; + public: + void clear_mirror_partition_list_trait(); + const ::grin::MirrorPartitionListTrait& mirror_partition_list_trait() const; + PROTOBUF_NODISCARD ::grin::MirrorPartitionListTrait* release_mirror_partition_list_trait(); + ::grin::MirrorPartitionListTrait* mutable_mirror_partition_list_trait(); + void set_allocated_mirror_partition_list_trait(::grin::MirrorPartitionListTrait* mirror_partition_list_trait); + private: + const ::grin::MirrorPartitionListTrait& _internal_mirror_partition_list_trait() const; + ::grin::MirrorPartitionListTrait* _internal_mutable_mirror_partition_list_trait(); + public: + void unsafe_arena_set_allocated_mirror_partition_list_trait( + ::grin::MirrorPartitionListTrait* mirror_partition_list_trait); + ::grin::MirrorPartitionListTrait* unsafe_arena_release_mirror_partition_list_trait(); + + // .grin.GraphPartitionStrategy graph_partition_strategy = 1; + void clear_graph_partition_strategy(); + ::grin::GraphPartitionStrategy graph_partition_strategy() const; + void set_graph_partition_strategy(::grin::GraphPartitionStrategy value); + private: + ::grin::GraphPartitionStrategy _internal_graph_partition_strategy() const; + void _internal_set_graph_partition_strategy(::grin::GraphPartitionStrategy value); + public: + + // bool grin_trait_natural_id_for_partition = 2; + void clear_grin_trait_natural_id_for_partition(); + bool grin_trait_natural_id_for_partition() const; + void set_grin_trait_natural_id_for_partition(bool value); + private: + bool _internal_grin_trait_natural_id_for_partition() const; + void _internal_set_grin_trait_natural_id_for_partition(bool value); + public: + + // bool grin_enable_vertex_ref = 3; + void clear_grin_enable_vertex_ref(); + bool grin_enable_vertex_ref() const; + void set_grin_enable_vertex_ref(bool value); + private: + bool _internal_grin_enable_vertex_ref() const; + void _internal_set_grin_enable_vertex_ref(bool value); + public: + + // bool grin_enable_edge_ref = 4; + void clear_grin_enable_edge_ref(); + bool grin_enable_edge_ref() const; + void set_grin_enable_edge_ref(bool value); + private: + bool _internal_grin_enable_edge_ref() const; + void _internal_set_grin_enable_edge_ref(bool value); + public: + + // bool grin_trait_select_master_for_vertex_list = 8; + void clear_grin_trait_select_master_for_vertex_list(); + bool grin_trait_select_master_for_vertex_list() const; + void set_grin_trait_select_master_for_vertex_list(bool value); + private: + bool _internal_grin_trait_select_master_for_vertex_list() const; + void _internal_set_grin_trait_select_master_for_vertex_list(bool value); + public: + + // .grin.PropertyDataPartitionStrategy vertex_data = 5; + void clear_vertex_data(); + ::grin::PropertyDataPartitionStrategy vertex_data() const; + void set_vertex_data(::grin::PropertyDataPartitionStrategy value); + private: + ::grin::PropertyDataPartitionStrategy _internal_vertex_data() const; + void _internal_set_vertex_data(::grin::PropertyDataPartitionStrategy value); + public: + + // .grin.PropertyDataPartitionStrategy edge_data = 6; + void clear_edge_data(); + ::grin::PropertyDataPartitionStrategy edge_data() const; + void set_edge_data(::grin::PropertyDataPartitionStrategy value); + private: + ::grin::PropertyDataPartitionStrategy _internal_edge_data() const; + void _internal_set_edge_data(::grin::PropertyDataPartitionStrategy value); + public: + + // bool grin_trait_select_partition_for_vertex_list = 9; + void clear_grin_trait_select_partition_for_vertex_list(); + bool grin_trait_select_partition_for_vertex_list() const; + void set_grin_trait_select_partition_for_vertex_list(bool value); + private: + bool _internal_grin_trait_select_partition_for_vertex_list() const; + void _internal_set_grin_trait_select_partition_for_vertex_list(bool value); + public: + + // bool grin_trait_select_master_for_edge_list = 10; + void clear_grin_trait_select_master_for_edge_list(); + bool grin_trait_select_master_for_edge_list() const; + void set_grin_trait_select_master_for_edge_list(bool value); + private: + bool _internal_grin_trait_select_master_for_edge_list() const; + void _internal_set_grin_trait_select_master_for_edge_list(bool value); + public: + + // bool grin_trait_select_partition_for_edge_list = 11; + void clear_grin_trait_select_partition_for_edge_list(); + bool grin_trait_select_partition_for_edge_list() const; + void set_grin_trait_select_partition_for_edge_list(bool value); + private: + bool _internal_grin_trait_select_partition_for_edge_list() const; + void _internal_set_grin_trait_select_partition_for_edge_list(bool value); + public: + + // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; + void clear_grin_trait_select_master_neighbor_for_adjacent_list(); + bool grin_trait_select_master_neighbor_for_adjacent_list() const; + void set_grin_trait_select_master_neighbor_for_adjacent_list(bool value); + private: + bool _internal_grin_trait_select_master_neighbor_for_adjacent_list() const; + void _internal_set_grin_trait_select_master_neighbor_for_adjacent_list(bool value); + public: + + // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; + void clear_grin_trait_select_neighbor_partition_for_adjacent_list(); + bool grin_trait_select_neighbor_partition_for_adjacent_list() const; + void set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value); + private: + bool _internal_grin_trait_select_neighbor_partition_for_adjacent_list() const; + void _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value); + public: + + // @@protoc_insertion_point(class_scope:grin.PartitionTrait) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::grin::MirrorPartitionListTrait* mirror_partition_list_trait_; + int graph_partition_strategy_; + bool grin_trait_natural_id_for_partition_; + bool grin_enable_vertex_ref_; + bool grin_enable_edge_ref_; + bool grin_trait_select_master_for_vertex_list_; + int vertex_data_; + int edge_data_; + bool grin_trait_select_partition_for_vertex_list_; + bool grin_trait_select_master_for_edge_list_; + bool grin_trait_select_partition_for_edge_list_; + bool grin_trait_select_master_neighbor_for_adjacent_list_; + bool grin_trait_select_neighbor_partition_for_adjacent_list_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_graph_2eproto; +}; +// ------------------------------------------------------------------- + +class VertexPropertyTrait final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.VertexPropertyTrait) */ { + public: + inline VertexPropertyTrait() : VertexPropertyTrait(nullptr) {} + ~VertexPropertyTrait() override; + explicit PROTOBUF_CONSTEXPR VertexPropertyTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + VertexPropertyTrait(const VertexPropertyTrait& from); + VertexPropertyTrait(VertexPropertyTrait&& from) noexcept + : VertexPropertyTrait() { + *this = ::std::move(from); + } + + inline VertexPropertyTrait& operator=(const VertexPropertyTrait& from) { + CopyFrom(from); + return *this; + } + inline VertexPropertyTrait& operator=(VertexPropertyTrait&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const VertexPropertyTrait& default_instance() { + return *internal_default_instance(); + } + static inline const VertexPropertyTrait* internal_default_instance() { + return reinterpret_cast( + &_VertexPropertyTrait_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(VertexPropertyTrait& a, VertexPropertyTrait& b) { + a.Swap(&b); + } + inline void Swap(VertexPropertyTrait* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(VertexPropertyTrait* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + VertexPropertyTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const VertexPropertyTrait& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const VertexPropertyTrait& from) { + VertexPropertyTrait::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(VertexPropertyTrait* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.VertexPropertyTrait"; + } + protected: + explicit VertexPropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kGrinWithVertexPropertyFieldNumber = 1, + kGrinWithVertexPropertyNameFieldNumber = 2, + kGrinWithVertexTypeNameFieldNumber = 3, + kGrinEnableVertexPropertyTableFieldNumber = 4, + kGrinEnableVertexPrimaryKeysFieldNumber = 5, + kGrinTraitNaturalIdForVertexTypeFieldNumber = 6, + kGrinTraitNaturalIdForVertexPropertyFieldNumber = 7, + kGrinAssumeByTypeVertexOriginalIdFieldNumber = 8, + }; + // bool grin_with_vertex_property = 1; + void clear_grin_with_vertex_property(); + bool grin_with_vertex_property() const; + void set_grin_with_vertex_property(bool value); + private: + bool _internal_grin_with_vertex_property() const; + void _internal_set_grin_with_vertex_property(bool value); + public: + + // bool grin_with_vertex_property_name = 2; + void clear_grin_with_vertex_property_name(); + bool grin_with_vertex_property_name() const; + void set_grin_with_vertex_property_name(bool value); + private: + bool _internal_grin_with_vertex_property_name() const; + void _internal_set_grin_with_vertex_property_name(bool value); + public: + + // bool grin_with_vertex_type_name = 3; + void clear_grin_with_vertex_type_name(); + bool grin_with_vertex_type_name() const; + void set_grin_with_vertex_type_name(bool value); + private: + bool _internal_grin_with_vertex_type_name() const; + void _internal_set_grin_with_vertex_type_name(bool value); + public: + + // bool grin_enable_vertex_property_table = 4; + void clear_grin_enable_vertex_property_table(); + bool grin_enable_vertex_property_table() const; + void set_grin_enable_vertex_property_table(bool value); + private: + bool _internal_grin_enable_vertex_property_table() const; + void _internal_set_grin_enable_vertex_property_table(bool value); + public: + + // bool grin_enable_vertex_primary_keys = 5; + void clear_grin_enable_vertex_primary_keys(); + bool grin_enable_vertex_primary_keys() const; + void set_grin_enable_vertex_primary_keys(bool value); + private: + bool _internal_grin_enable_vertex_primary_keys() const; + void _internal_set_grin_enable_vertex_primary_keys(bool value); + public: + + // bool grin_trait_natural_id_for_vertex_type = 6; + void clear_grin_trait_natural_id_for_vertex_type(); + bool grin_trait_natural_id_for_vertex_type() const; + void set_grin_trait_natural_id_for_vertex_type(bool value); + private: + bool _internal_grin_trait_natural_id_for_vertex_type() const; + void _internal_set_grin_trait_natural_id_for_vertex_type(bool value); + public: + + // bool grin_trait_natural_id_for_vertex_property = 7; + void clear_grin_trait_natural_id_for_vertex_property(); + bool grin_trait_natural_id_for_vertex_property() const; + void set_grin_trait_natural_id_for_vertex_property(bool value); + private: + bool _internal_grin_trait_natural_id_for_vertex_property() const; + void _internal_set_grin_trait_natural_id_for_vertex_property(bool value); + public: + + // bool grin_assume_by_type_vertex_original_id = 8; + void clear_grin_assume_by_type_vertex_original_id(); + bool grin_assume_by_type_vertex_original_id() const; + void set_grin_assume_by_type_vertex_original_id(bool value); + private: + bool _internal_grin_assume_by_type_vertex_original_id() const; + void _internal_set_grin_assume_by_type_vertex_original_id(bool value); + public: + + // @@protoc_insertion_point(class_scope:grin.VertexPropertyTrait) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool grin_with_vertex_property_; + bool grin_with_vertex_property_name_; + bool grin_with_vertex_type_name_; + bool grin_enable_vertex_property_table_; + bool grin_enable_vertex_primary_keys_; + bool grin_trait_natural_id_for_vertex_type_; + bool grin_trait_natural_id_for_vertex_property_; + bool grin_assume_by_type_vertex_original_id_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_graph_2eproto; +}; +// ------------------------------------------------------------------- + +class EdgePropertyTrait final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.EdgePropertyTrait) */ { + public: + inline EdgePropertyTrait() : EdgePropertyTrait(nullptr) {} + ~EdgePropertyTrait() override; + explicit PROTOBUF_CONSTEXPR EdgePropertyTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + EdgePropertyTrait(const EdgePropertyTrait& from); + EdgePropertyTrait(EdgePropertyTrait&& from) noexcept + : EdgePropertyTrait() { + *this = ::std::move(from); + } + + inline EdgePropertyTrait& operator=(const EdgePropertyTrait& from) { + CopyFrom(from); + return *this; + } + inline EdgePropertyTrait& operator=(EdgePropertyTrait&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const EdgePropertyTrait& default_instance() { + return *internal_default_instance(); + } + static inline const EdgePropertyTrait* internal_default_instance() { + return reinterpret_cast( + &_EdgePropertyTrait_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(EdgePropertyTrait& a, EdgePropertyTrait& b) { + a.Swap(&b); + } + inline void Swap(EdgePropertyTrait* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(EdgePropertyTrait* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + EdgePropertyTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const EdgePropertyTrait& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const EdgePropertyTrait& from) { + EdgePropertyTrait::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(EdgePropertyTrait* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.EdgePropertyTrait"; + } + protected: + explicit EdgePropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kGrinWithEdgePropertyFieldNumber = 1, + kGrinWithEdgePropertyNameFieldNumber = 2, + kGrinWithEdgeTypeNameFieldNumber = 3, + kGrinEnableEdgePropertyTableFieldNumber = 4, + kGrinEnableEdgePrimaryKeysFieldNumber = 5, + kGrinTraitNaturalIdForEdgeTypeFieldNumber = 6, + kGrinTraitNaturalIdForEdgePropertyFieldNumber = 7, + }; + // bool grin_with_edge_property = 1; + void clear_grin_with_edge_property(); + bool grin_with_edge_property() const; + void set_grin_with_edge_property(bool value); + private: + bool _internal_grin_with_edge_property() const; + void _internal_set_grin_with_edge_property(bool value); + public: + + // bool grin_with_edge_property_name = 2; + void clear_grin_with_edge_property_name(); + bool grin_with_edge_property_name() const; + void set_grin_with_edge_property_name(bool value); + private: + bool _internal_grin_with_edge_property_name() const; + void _internal_set_grin_with_edge_property_name(bool value); + public: + + // bool grin_with_edge_type_name = 3; + void clear_grin_with_edge_type_name(); + bool grin_with_edge_type_name() const; + void set_grin_with_edge_type_name(bool value); + private: + bool _internal_grin_with_edge_type_name() const; + void _internal_set_grin_with_edge_type_name(bool value); + public: + + // bool grin_enable_edge_property_table = 4; + void clear_grin_enable_edge_property_table(); + bool grin_enable_edge_property_table() const; + void set_grin_enable_edge_property_table(bool value); + private: + bool _internal_grin_enable_edge_property_table() const; + void _internal_set_grin_enable_edge_property_table(bool value); + public: + + // bool grin_enable_edge_primary_keys = 5; + void clear_grin_enable_edge_primary_keys(); + bool grin_enable_edge_primary_keys() const; + void set_grin_enable_edge_primary_keys(bool value); + private: + bool _internal_grin_enable_edge_primary_keys() const; + void _internal_set_grin_enable_edge_primary_keys(bool value); + public: + + // bool grin_trait_natural_id_for_edge_type = 6; + void clear_grin_trait_natural_id_for_edge_type(); + bool grin_trait_natural_id_for_edge_type() const; + void set_grin_trait_natural_id_for_edge_type(bool value); + private: + bool _internal_grin_trait_natural_id_for_edge_type() const; + void _internal_set_grin_trait_natural_id_for_edge_type(bool value); + public: + + // bool grin_trait_natural_id_for_edge_property = 7; + void clear_grin_trait_natural_id_for_edge_property(); + bool grin_trait_natural_id_for_edge_property() const; + void set_grin_trait_natural_id_for_edge_property(bool value); + private: + bool _internal_grin_trait_natural_id_for_edge_property() const; + void _internal_set_grin_trait_natural_id_for_edge_property(bool value); + public: + + // @@protoc_insertion_point(class_scope:grin.EdgePropertyTrait) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool grin_with_edge_property_; + bool grin_with_edge_property_name_; + bool grin_with_edge_type_name_; + bool grin_enable_edge_property_table_; + bool grin_enable_edge_primary_keys_; + bool grin_trait_natural_id_for_edge_type_; + bool grin_trait_natural_id_for_edge_property_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_graph_2eproto; +}; +// ------------------------------------------------------------------- + +class PropertyTrait final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PropertyTrait) */ { + public: + inline PropertyTrait() : PropertyTrait(nullptr) {} + ~PropertyTrait() override; + explicit PROTOBUF_CONSTEXPR PropertyTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PropertyTrait(const PropertyTrait& from); + PropertyTrait(PropertyTrait&& from) noexcept + : PropertyTrait() { + *this = ::std::move(from); + } + + inline PropertyTrait& operator=(const PropertyTrait& from) { + CopyFrom(from); + return *this; + } + inline PropertyTrait& operator=(PropertyTrait&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PropertyTrait& default_instance() { + return *internal_default_instance(); + } + static inline const PropertyTrait* internal_default_instance() { + return reinterpret_cast( + &_PropertyTrait_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + friend void swap(PropertyTrait& a, PropertyTrait& b) { + a.Swap(&b); + } + inline void Swap(PropertyTrait* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PropertyTrait* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PropertyTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const PropertyTrait& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const PropertyTrait& from) { + PropertyTrait::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PropertyTrait* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.PropertyTrait"; + } + protected: + explicit PropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kVertexPropertyTraitFieldNumber = 2, + kEdgePropertyTraitFieldNumber = 3, + kVertexPropertyFieldNumber = 4, + kEdgePropertyFieldNumber = 5, + kGrinEnableRowFieldNumber = 1, + kGrinAssumeColumnStoreForVertexPropertyFieldNumber = 6, + kGrinAssumeColumnStoreForEdgePropertyFieldNumber = 7, + kGrinTraitSelectTypeForVertexListFieldNumber = 8, + kGrinTraitSelectTypeForEdgeListFieldNumber = 9, + kGrinTraitSelectNeighborTypeForAdjacentListFieldNumber = 10, + kGrinTraitSelectEdgeTypeForAdjacentListFieldNumber = 11, + kGrinTraitSpecificVevRelationFieldNumber = 12, + }; + // .grin.VertexPropertyTrait vertex_property_trait = 2; + bool has_vertex_property_trait() const; + private: + bool _internal_has_vertex_property_trait() const; + public: + void clear_vertex_property_trait(); + const ::grin::VertexPropertyTrait& vertex_property_trait() const; + PROTOBUF_NODISCARD ::grin::VertexPropertyTrait* release_vertex_property_trait(); + ::grin::VertexPropertyTrait* mutable_vertex_property_trait(); + void set_allocated_vertex_property_trait(::grin::VertexPropertyTrait* vertex_property_trait); + private: + const ::grin::VertexPropertyTrait& _internal_vertex_property_trait() const; + ::grin::VertexPropertyTrait* _internal_mutable_vertex_property_trait(); + public: + void unsafe_arena_set_allocated_vertex_property_trait( + ::grin::VertexPropertyTrait* vertex_property_trait); + ::grin::VertexPropertyTrait* unsafe_arena_release_vertex_property_trait(); + + // .grin.EdgePropertyTrait edge_property_trait = 3; + bool has_edge_property_trait() const; + private: + bool _internal_has_edge_property_trait() const; + public: + void clear_edge_property_trait(); + const ::grin::EdgePropertyTrait& edge_property_trait() const; + PROTOBUF_NODISCARD ::grin::EdgePropertyTrait* release_edge_property_trait(); + ::grin::EdgePropertyTrait* mutable_edge_property_trait(); + void set_allocated_edge_property_trait(::grin::EdgePropertyTrait* edge_property_trait); + private: + const ::grin::EdgePropertyTrait& _internal_edge_property_trait() const; + ::grin::EdgePropertyTrait* _internal_mutable_edge_property_trait(); + public: + void unsafe_arena_set_allocated_edge_property_trait( + ::grin::EdgePropertyTrait* edge_property_trait); + ::grin::EdgePropertyTrait* unsafe_arena_release_edge_property_trait(); + + // .grin.PropertyDataPartitionStrategy vertex_property = 4; + void clear_vertex_property(); + ::grin::PropertyDataPartitionStrategy vertex_property() const; + void set_vertex_property(::grin::PropertyDataPartitionStrategy value); + private: + ::grin::PropertyDataPartitionStrategy _internal_vertex_property() const; + void _internal_set_vertex_property(::grin::PropertyDataPartitionStrategy value); + public: + + // .grin.PropertyDataPartitionStrategy edge_property = 5; + void clear_edge_property(); + ::grin::PropertyDataPartitionStrategy edge_property() const; + void set_edge_property(::grin::PropertyDataPartitionStrategy value); + private: + ::grin::PropertyDataPartitionStrategy _internal_edge_property() const; + void _internal_set_edge_property(::grin::PropertyDataPartitionStrategy value); + public: + + // bool grin_enable_row = 1; + void clear_grin_enable_row(); + bool grin_enable_row() const; + void set_grin_enable_row(bool value); + private: + bool _internal_grin_enable_row() const; + void _internal_set_grin_enable_row(bool value); + public: + + // bool grin_assume_column_store_for_vertex_property = 6; + void clear_grin_assume_column_store_for_vertex_property(); + bool grin_assume_column_store_for_vertex_property() const; + void set_grin_assume_column_store_for_vertex_property(bool value); + private: + bool _internal_grin_assume_column_store_for_vertex_property() const; + void _internal_set_grin_assume_column_store_for_vertex_property(bool value); + public: + + // bool grin_assume_column_store_for_edge_property = 7; + void clear_grin_assume_column_store_for_edge_property(); + bool grin_assume_column_store_for_edge_property() const; + void set_grin_assume_column_store_for_edge_property(bool value); + private: + bool _internal_grin_assume_column_store_for_edge_property() const; + void _internal_set_grin_assume_column_store_for_edge_property(bool value); + public: + + // bool grin_trait_select_type_for_vertex_list = 8; + void clear_grin_trait_select_type_for_vertex_list(); + bool grin_trait_select_type_for_vertex_list() const; + void set_grin_trait_select_type_for_vertex_list(bool value); + private: + bool _internal_grin_trait_select_type_for_vertex_list() const; + void _internal_set_grin_trait_select_type_for_vertex_list(bool value); + public: + + // bool grin_trait_select_type_for_edge_list = 9; + void clear_grin_trait_select_type_for_edge_list(); + bool grin_trait_select_type_for_edge_list() const; + void set_grin_trait_select_type_for_edge_list(bool value); + private: + bool _internal_grin_trait_select_type_for_edge_list() const; + void _internal_set_grin_trait_select_type_for_edge_list(bool value); + public: + + // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; + void clear_grin_trait_select_neighbor_type_for_adjacent_list(); + bool grin_trait_select_neighbor_type_for_adjacent_list() const; + void set_grin_trait_select_neighbor_type_for_adjacent_list(bool value); + private: + bool _internal_grin_trait_select_neighbor_type_for_adjacent_list() const; + void _internal_set_grin_trait_select_neighbor_type_for_adjacent_list(bool value); + public: + + // bool grin_trait_select_edge_type_for_adjacent_list = 11; + void clear_grin_trait_select_edge_type_for_adjacent_list(); + bool grin_trait_select_edge_type_for_adjacent_list() const; + void set_grin_trait_select_edge_type_for_adjacent_list(bool value); + private: + bool _internal_grin_trait_select_edge_type_for_adjacent_list() const; + void _internal_set_grin_trait_select_edge_type_for_adjacent_list(bool value); + public: + + // bool grin_trait_specific_vev_relation = 12; + void clear_grin_trait_specific_vev_relation(); + bool grin_trait_specific_vev_relation() const; + void set_grin_trait_specific_vev_relation(bool value); + private: + bool _internal_grin_trait_specific_vev_relation() const; + void _internal_set_grin_trait_specific_vev_relation(bool value); + public: + + // @@protoc_insertion_point(class_scope:grin.PropertyTrait) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::grin::VertexPropertyTrait* vertex_property_trait_; + ::grin::EdgePropertyTrait* edge_property_trait_; + int vertex_property_; + int edge_property_; + bool grin_enable_row_; + bool grin_assume_column_store_for_vertex_property_; + bool grin_assume_column_store_for_edge_property_; + bool grin_trait_select_type_for_vertex_list_; + bool grin_trait_select_type_for_edge_list_; + bool grin_trait_select_neighbor_type_for_adjacent_list_; + bool grin_trait_select_edge_type_for_adjacent_list_; + bool grin_trait_specific_vev_relation_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_graph_2eproto; +}; +// ------------------------------------------------------------------- + +class IndexTrait final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.IndexTrait) */ { + public: + inline IndexTrait() : IndexTrait(nullptr) {} + ~IndexTrait() override; + explicit PROTOBUF_CONSTEXPR IndexTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + IndexTrait(const IndexTrait& from); + IndexTrait(IndexTrait&& from) noexcept + : IndexTrait() { + *this = ::std::move(from); + } + + inline IndexTrait& operator=(const IndexTrait& from) { + CopyFrom(from); + return *this; + } + inline IndexTrait& operator=(IndexTrait&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const IndexTrait& default_instance() { + return *internal_default_instance(); + } + static inline const IndexTrait* internal_default_instance() { + return reinterpret_cast( + &_IndexTrait_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + friend void swap(IndexTrait& a, IndexTrait& b) { + a.Swap(&b); + } + inline void Swap(IndexTrait* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(IndexTrait* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + IndexTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const IndexTrait& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const IndexTrait& from) { + IndexTrait::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(IndexTrait* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.IndexTrait"; + } + protected: + explicit IndexTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kGrinWithVertexLabelFieldNumber = 1, + kGrinWithEdgeLabelFieldNumber = 2, + kGrinAssumeAllVertexListSortedFieldNumber = 3, + }; + // bool grin_with_vertex_label = 1; + void clear_grin_with_vertex_label(); + bool grin_with_vertex_label() const; + void set_grin_with_vertex_label(bool value); + private: + bool _internal_grin_with_vertex_label() const; + void _internal_set_grin_with_vertex_label(bool value); + public: + + // bool grin_with_edge_label = 2; + void clear_grin_with_edge_label(); + bool grin_with_edge_label() const; + void set_grin_with_edge_label(bool value); + private: + bool _internal_grin_with_edge_label() const; + void _internal_set_grin_with_edge_label(bool value); + public: + + // bool grin_assume_all_vertex_list_sorted = 3; + void clear_grin_assume_all_vertex_list_sorted(); + bool grin_assume_all_vertex_list_sorted() const; + void set_grin_assume_all_vertex_list_sorted(bool value); + private: + bool _internal_grin_assume_all_vertex_list_sorted() const; + void _internal_set_grin_assume_all_vertex_list_sorted(bool value); + public: + + // @@protoc_insertion_point(class_scope:grin.IndexTrait) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + bool grin_with_vertex_label_; + bool grin_with_edge_label_; + bool grin_assume_all_vertex_list_sorted_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_graph_2eproto; +}; +// ------------------------------------------------------------------- + +class PredicateTrait final : + public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:grin.PredicateTrait) */ { + public: + inline PredicateTrait() : PredicateTrait(nullptr) {} + explicit PROTOBUF_CONSTEXPR PredicateTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PredicateTrait(const PredicateTrait& from); + PredicateTrait(PredicateTrait&& from) noexcept + : PredicateTrait() { + *this = ::std::move(from); + } + + inline PredicateTrait& operator=(const PredicateTrait& from) { + CopyFrom(from); + return *this; + } + inline PredicateTrait& operator=(PredicateTrait&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PredicateTrait& default_instance() { + return *internal_default_instance(); + } + static inline const PredicateTrait* internal_default_instance() { + return reinterpret_cast( + &_PredicateTrait_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + friend void swap(PredicateTrait& a, PredicateTrait& b) { + a.Swap(&b); + } + inline void Swap(PredicateTrait* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PredicateTrait* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PredicateTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; + inline void CopyFrom(const PredicateTrait& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; + void MergeFrom(const PredicateTrait& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); + } + public: + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.PredicateTrait"; + } + protected: + explicit PredicateTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:grin.PredicateTrait) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + }; + friend struct ::TableStruct_graph_2eproto; +}; +// ------------------------------------------------------------------- + +class StorageTrait final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.StorageTrait) */ { + public: + inline StorageTrait() : StorageTrait(nullptr) {} + ~StorageTrait() override; + explicit PROTOBUF_CONSTEXPR StorageTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + StorageTrait(const StorageTrait& from); + StorageTrait(StorageTrait&& from) noexcept + : StorageTrait() { + *this = ::std::move(from); + } + + inline StorageTrait& operator=(const StorageTrait& from) { + CopyFrom(from); + return *this; + } + inline StorageTrait& operator=(StorageTrait&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const StorageTrait& default_instance() { + return *internal_default_instance(); + } + enum SpecificTraitCase { + kTopologyTrait = 1, + kPartitionTrait = 2, + kPropertyTrait = 3, + kIndexTrait = 4, + kPredicateTrait = 5, + SPECIFIC_TRAIT_NOT_SET = 0, + }; + + static inline const StorageTrait* internal_default_instance() { + return reinterpret_cast( + &_StorageTrait_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + friend void swap(StorageTrait& a, StorageTrait& b) { + a.Swap(&b); + } + inline void Swap(StorageTrait* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(StorageTrait* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + StorageTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const StorageTrait& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const StorageTrait& from) { + StorageTrait::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(StorageTrait* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.StorageTrait"; + } + protected: + explicit StorageTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kTopologyTraitFieldNumber = 1, + kPartitionTraitFieldNumber = 2, + kPropertyTraitFieldNumber = 3, + kIndexTraitFieldNumber = 4, + kPredicateTraitFieldNumber = 5, + }; + // .grin.TopologyTrait topology_trait = 1; + bool has_topology_trait() const; + private: + bool _internal_has_topology_trait() const; + public: + void clear_topology_trait(); + const ::grin::TopologyTrait& topology_trait() const; + PROTOBUF_NODISCARD ::grin::TopologyTrait* release_topology_trait(); + ::grin::TopologyTrait* mutable_topology_trait(); + void set_allocated_topology_trait(::grin::TopologyTrait* topology_trait); + private: + const ::grin::TopologyTrait& _internal_topology_trait() const; + ::grin::TopologyTrait* _internal_mutable_topology_trait(); + public: + void unsafe_arena_set_allocated_topology_trait( + ::grin::TopologyTrait* topology_trait); + ::grin::TopologyTrait* unsafe_arena_release_topology_trait(); + + // .grin.PartitionTrait partition_trait = 2; + bool has_partition_trait() const; + private: + bool _internal_has_partition_trait() const; + public: + void clear_partition_trait(); + const ::grin::PartitionTrait& partition_trait() const; + PROTOBUF_NODISCARD ::grin::PartitionTrait* release_partition_trait(); + ::grin::PartitionTrait* mutable_partition_trait(); + void set_allocated_partition_trait(::grin::PartitionTrait* partition_trait); + private: + const ::grin::PartitionTrait& _internal_partition_trait() const; + ::grin::PartitionTrait* _internal_mutable_partition_trait(); + public: + void unsafe_arena_set_allocated_partition_trait( + ::grin::PartitionTrait* partition_trait); + ::grin::PartitionTrait* unsafe_arena_release_partition_trait(); + + // .grin.PropertyTrait property_trait = 3; + bool has_property_trait() const; + private: + bool _internal_has_property_trait() const; + public: + void clear_property_trait(); + const ::grin::PropertyTrait& property_trait() const; + PROTOBUF_NODISCARD ::grin::PropertyTrait* release_property_trait(); + ::grin::PropertyTrait* mutable_property_trait(); + void set_allocated_property_trait(::grin::PropertyTrait* property_trait); + private: + const ::grin::PropertyTrait& _internal_property_trait() const; + ::grin::PropertyTrait* _internal_mutable_property_trait(); + public: + void unsafe_arena_set_allocated_property_trait( + ::grin::PropertyTrait* property_trait); + ::grin::PropertyTrait* unsafe_arena_release_property_trait(); + + // .grin.IndexTrait index_trait = 4; + bool has_index_trait() const; + private: + bool _internal_has_index_trait() const; + public: + void clear_index_trait(); + const ::grin::IndexTrait& index_trait() const; + PROTOBUF_NODISCARD ::grin::IndexTrait* release_index_trait(); + ::grin::IndexTrait* mutable_index_trait(); + void set_allocated_index_trait(::grin::IndexTrait* index_trait); + private: + const ::grin::IndexTrait& _internal_index_trait() const; + ::grin::IndexTrait* _internal_mutable_index_trait(); + public: + void unsafe_arena_set_allocated_index_trait( + ::grin::IndexTrait* index_trait); + ::grin::IndexTrait* unsafe_arena_release_index_trait(); + + // .grin.PredicateTrait predicate_trait = 5; + bool has_predicate_trait() const; + private: + bool _internal_has_predicate_trait() const; + public: + void clear_predicate_trait(); + const ::grin::PredicateTrait& predicate_trait() const; + PROTOBUF_NODISCARD ::grin::PredicateTrait* release_predicate_trait(); + ::grin::PredicateTrait* mutable_predicate_trait(); + void set_allocated_predicate_trait(::grin::PredicateTrait* predicate_trait); + private: + const ::grin::PredicateTrait& _internal_predicate_trait() const; + ::grin::PredicateTrait* _internal_mutable_predicate_trait(); + public: + void unsafe_arena_set_allocated_predicate_trait( + ::grin::PredicateTrait* predicate_trait); + ::grin::PredicateTrait* unsafe_arena_release_predicate_trait(); + + void clear_specific_trait(); + SpecificTraitCase specific_trait_case() const; + // @@protoc_insertion_point(class_scope:grin.StorageTrait) + private: + class _Internal; + void set_has_topology_trait(); + void set_has_partition_trait(); + void set_has_property_trait(); + void set_has_index_trait(); + void set_has_predicate_trait(); + + inline bool has_specific_trait() const; + inline void clear_has_specific_trait(); + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + union SpecificTraitUnion { + constexpr SpecificTraitUnion() : _constinit_{} {} + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; + ::grin::TopologyTrait* topology_trait_; + ::grin::PartitionTrait* partition_trait_; + ::grin::PropertyTrait* property_trait_; + ::grin::IndexTrait* index_trait_; + ::grin::PredicateTrait* predicate_trait_; + } specific_trait_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + uint32_t _oneof_case_[1]; + + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_graph_2eproto; +}; +// ------------------------------------------------------------------- + +class Statistics final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.Statistics) */ { + public: + inline Statistics() : Statistics(nullptr) {} + ~Statistics() override; + explicit PROTOBUF_CONSTEXPR Statistics(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Statistics(const Statistics& from); + Statistics(Statistics&& from) noexcept + : Statistics() { + *this = ::std::move(from); + } + + inline Statistics& operator=(const Statistics& from) { + CopyFrom(from); + return *this; + } + inline Statistics& operator=(Statistics&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Statistics& default_instance() { + return *internal_default_instance(); + } + static inline const Statistics* internal_default_instance() { + return reinterpret_cast( + &_Statistics_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + friend void swap(Statistics& a, Statistics& b) { + a.Swap(&b); + } + inline void Swap(Statistics* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Statistics* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Statistics* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Statistics& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Statistics& from) { + Statistics::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Statistics* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.Statistics"; + } + protected: + explicit Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kVertexCountFieldNumber = 1, + kEdgeCountFieldNumber = 2, + kPartitionCountFieldNumber = 3, + kVertexTypeCountFieldNumber = 4, + kEdgeTypeCountFieldNumber = 5, + }; + // int32 vertex_count = 1; + void clear_vertex_count(); + int32_t vertex_count() const; + void set_vertex_count(int32_t value); + private: + int32_t _internal_vertex_count() const; + void _internal_set_vertex_count(int32_t value); + public: + + // int32 edge_count = 2; + void clear_edge_count(); + int32_t edge_count() const; + void set_edge_count(int32_t value); + private: + int32_t _internal_edge_count() const; + void _internal_set_edge_count(int32_t value); + public: + + // int32 partition_count = 3; + void clear_partition_count(); + int32_t partition_count() const; + void set_partition_count(int32_t value); + private: + int32_t _internal_partition_count() const; + void _internal_set_partition_count(int32_t value); + public: + + // int32 vertex_type_count = 4; + void clear_vertex_type_count(); + int32_t vertex_type_count() const; + void set_vertex_type_count(int32_t value); + private: + int32_t _internal_vertex_type_count() const; + void _internal_set_vertex_type_count(int32_t value); + public: + + // int32 edge_type_count = 5; + void clear_edge_type_count(); + int32_t edge_type_count() const; + void set_edge_type_count(int32_t value); + private: + int32_t _internal_edge_type_count() const; + void _internal_set_edge_type_count(int32_t value); + public: + + // @@protoc_insertion_point(class_scope:grin.Statistics) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + int32_t vertex_count_; + int32_t edge_count_; + int32_t partition_count_; + int32_t vertex_type_count_; + int32_t edge_type_count_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_graph_2eproto; +}; +// ------------------------------------------------------------------- + +class Graph final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.Graph) */ { + public: + inline Graph() : Graph(nullptr) {} + ~Graph() override; + explicit PROTOBUF_CONSTEXPR Graph(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Graph(const Graph& from); + Graph(Graph&& from) noexcept + : Graph() { + *this = ::std::move(from); + } + + inline Graph& operator=(const Graph& from) { + CopyFrom(from); + return *this; + } + inline Graph& operator=(Graph&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Graph& default_instance() { + return *internal_default_instance(); + } + static inline const Graph* internal_default_instance() { + return reinterpret_cast( + &_Graph_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + friend void swap(Graph& a, Graph& b) { + a.Swap(&b); + } + inline void Swap(Graph* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Graph* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Graph* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Graph& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Graph& from) { + Graph::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Graph* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "grin.Graph"; + } + protected: + explicit Graph(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kTraitsFieldNumber = 3, + kUriFieldNumber = 1, + kGrinVersionFieldNumber = 2, + kStatisticsFieldNumber = 4, + }; + // repeated .grin.StorageTrait traits = 3; + int traits_size() const; + private: + int _internal_traits_size() const; + public: + void clear_traits(); + ::grin::StorageTrait* mutable_traits(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageTrait >* + mutable_traits(); + private: + const ::grin::StorageTrait& _internal_traits(int index) const; + ::grin::StorageTrait* _internal_add_traits(); + public: + const ::grin::StorageTrait& traits(int index) const; + ::grin::StorageTrait* add_traits(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageTrait >& + traits() const; + + // string uri = 1; + void clear_uri(); + const std::string& uri() const; + template + void set_uri(ArgT0&& arg0, ArgT... args); + std::string* mutable_uri(); + PROTOBUF_NODISCARD std::string* release_uri(); + void set_allocated_uri(std::string* uri); + private: + const std::string& _internal_uri() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_uri(const std::string& value); + std::string* _internal_mutable_uri(); + public: + + // string grin_version = 2; + void clear_grin_version(); + const std::string& grin_version() const; + template + void set_grin_version(ArgT0&& arg0, ArgT... args); + std::string* mutable_grin_version(); + PROTOBUF_NODISCARD std::string* release_grin_version(); + void set_allocated_grin_version(std::string* grin_version); + private: + const std::string& _internal_grin_version() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_grin_version(const std::string& value); + std::string* _internal_mutable_grin_version(); + public: + + // .grin.Statistics statistics = 4; + bool has_statistics() const; + private: + bool _internal_has_statistics() const; + public: + void clear_statistics(); + const ::grin::Statistics& statistics() const; + PROTOBUF_NODISCARD ::grin::Statistics* release_statistics(); + ::grin::Statistics* mutable_statistics(); + void set_allocated_statistics(::grin::Statistics* statistics); + private: + const ::grin::Statistics& _internal_statistics() const; + ::grin::Statistics* _internal_mutable_statistics(); + public: + void unsafe_arena_set_allocated_statistics( + ::grin::Statistics* statistics); + ::grin::Statistics* unsafe_arena_release_statistics(); + + // @@protoc_insertion_point(class_scope:grin.Graph) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageTrait > traits_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uri_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr grin_version_; + ::grin::Statistics* statistics_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_graph_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// TopologyTrait + +// bool grin_assume_has_directed_graph = 1; +inline void TopologyTrait::clear_grin_assume_has_directed_graph() { + _impl_.grin_assume_has_directed_graph_ = false; +} +inline bool TopologyTrait::_internal_grin_assume_has_directed_graph() const { + return _impl_.grin_assume_has_directed_graph_; +} +inline bool TopologyTrait::grin_assume_has_directed_graph() const { + // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_assume_has_directed_graph) + return _internal_grin_assume_has_directed_graph(); +} +inline void TopologyTrait::_internal_set_grin_assume_has_directed_graph(bool value) { + + _impl_.grin_assume_has_directed_graph_ = value; +} +inline void TopologyTrait::set_grin_assume_has_directed_graph(bool value) { + _internal_set_grin_assume_has_directed_graph(value); + // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_assume_has_directed_graph) +} + +// bool grin_assume_has_undirected_graph = 2; +inline void TopologyTrait::clear_grin_assume_has_undirected_graph() { + _impl_.grin_assume_has_undirected_graph_ = false; +} +inline bool TopologyTrait::_internal_grin_assume_has_undirected_graph() const { + return _impl_.grin_assume_has_undirected_graph_; +} +inline bool TopologyTrait::grin_assume_has_undirected_graph() const { + // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_assume_has_undirected_graph) + return _internal_grin_assume_has_undirected_graph(); +} +inline void TopologyTrait::_internal_set_grin_assume_has_undirected_graph(bool value) { + + _impl_.grin_assume_has_undirected_graph_ = value; +} +inline void TopologyTrait::set_grin_assume_has_undirected_graph(bool value) { + _internal_set_grin_assume_has_undirected_graph(value); + // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_assume_has_undirected_graph) +} + +// bool grin_assume_has_multi_edge_graph = 3; +inline void TopologyTrait::clear_grin_assume_has_multi_edge_graph() { + _impl_.grin_assume_has_multi_edge_graph_ = false; +} +inline bool TopologyTrait::_internal_grin_assume_has_multi_edge_graph() const { + return _impl_.grin_assume_has_multi_edge_graph_; +} +inline bool TopologyTrait::grin_assume_has_multi_edge_graph() const { + // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_assume_has_multi_edge_graph) + return _internal_grin_assume_has_multi_edge_graph(); +} +inline void TopologyTrait::_internal_set_grin_assume_has_multi_edge_graph(bool value) { + + _impl_.grin_assume_has_multi_edge_graph_ = value; +} +inline void TopologyTrait::set_grin_assume_has_multi_edge_graph(bool value) { + _internal_set_grin_assume_has_multi_edge_graph(value); + // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_assume_has_multi_edge_graph) +} + +// bool grin_with_vertex_original_id = 4; +inline void TopologyTrait::clear_grin_with_vertex_original_id() { + _impl_.grin_with_vertex_original_id_ = false; +} +inline bool TopologyTrait::_internal_grin_with_vertex_original_id() const { + return _impl_.grin_with_vertex_original_id_; +} +inline bool TopologyTrait::grin_with_vertex_original_id() const { + // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_with_vertex_original_id) + return _internal_grin_with_vertex_original_id(); +} +inline void TopologyTrait::_internal_set_grin_with_vertex_original_id(bool value) { + + _impl_.grin_with_vertex_original_id_ = value; +} +inline void TopologyTrait::set_grin_with_vertex_original_id(bool value) { + _internal_set_grin_with_vertex_original_id(value); + // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_with_vertex_original_id) +} + +// bool grin_with_vertex_data = 5; +inline void TopologyTrait::clear_grin_with_vertex_data() { + _impl_.grin_with_vertex_data_ = false; +} +inline bool TopologyTrait::_internal_grin_with_vertex_data() const { + return _impl_.grin_with_vertex_data_; +} +inline bool TopologyTrait::grin_with_vertex_data() const { + // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_with_vertex_data) + return _internal_grin_with_vertex_data(); +} +inline void TopologyTrait::_internal_set_grin_with_vertex_data(bool value) { + + _impl_.grin_with_vertex_data_ = value; +} +inline void TopologyTrait::set_grin_with_vertex_data(bool value) { + _internal_set_grin_with_vertex_data(value); + // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_with_vertex_data) +} + +// bool grin_with_edge_data = 6; +inline void TopologyTrait::clear_grin_with_edge_data() { + _impl_.grin_with_edge_data_ = false; +} +inline bool TopologyTrait::_internal_grin_with_edge_data() const { + return _impl_.grin_with_edge_data_; +} +inline bool TopologyTrait::grin_with_edge_data() const { + // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_with_edge_data) + return _internal_grin_with_edge_data(); +} +inline void TopologyTrait::_internal_set_grin_with_edge_data(bool value) { + + _impl_.grin_with_edge_data_ = value; +} +inline void TopologyTrait::set_grin_with_edge_data(bool value) { + _internal_set_grin_with_edge_data(value); + // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_with_edge_data) +} + +// repeated .grin.ListRetrieval vertex_list_retrievals = 7; +inline int TopologyTrait::_internal_vertex_list_retrievals_size() const { + return _impl_.vertex_list_retrievals_.size(); +} +inline int TopologyTrait::vertex_list_retrievals_size() const { + return _internal_vertex_list_retrievals_size(); +} +inline void TopologyTrait::clear_vertex_list_retrievals() { + _impl_.vertex_list_retrievals_.Clear(); +} +inline ::grin::ListRetrieval TopologyTrait::_internal_vertex_list_retrievals(int index) const { + return static_cast< ::grin::ListRetrieval >(_impl_.vertex_list_retrievals_.Get(index)); +} +inline ::grin::ListRetrieval TopologyTrait::vertex_list_retrievals(int index) const { + // @@protoc_insertion_point(field_get:grin.TopologyTrait.vertex_list_retrievals) + return _internal_vertex_list_retrievals(index); +} +inline void TopologyTrait::set_vertex_list_retrievals(int index, ::grin::ListRetrieval value) { + _impl_.vertex_list_retrievals_.Set(index, value); + // @@protoc_insertion_point(field_set:grin.TopologyTrait.vertex_list_retrievals) +} +inline void TopologyTrait::_internal_add_vertex_list_retrievals(::grin::ListRetrieval value) { + _impl_.vertex_list_retrievals_.Add(value); +} +inline void TopologyTrait::add_vertex_list_retrievals(::grin::ListRetrieval value) { + _internal_add_vertex_list_retrievals(value); + // @@protoc_insertion_point(field_add:grin.TopologyTrait.vertex_list_retrievals) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& +TopologyTrait::vertex_list_retrievals() const { + // @@protoc_insertion_point(field_list:grin.TopologyTrait.vertex_list_retrievals) + return _impl_.vertex_list_retrievals_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* +TopologyTrait::_internal_mutable_vertex_list_retrievals() { + return &_impl_.vertex_list_retrievals_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* +TopologyTrait::mutable_vertex_list_retrievals() { + // @@protoc_insertion_point(field_mutable_list:grin.TopologyTrait.vertex_list_retrievals) + return _internal_mutable_vertex_list_retrievals(); +} + +// repeated .grin.ListRetrieval edge_list_retrievals = 8; +inline int TopologyTrait::_internal_edge_list_retrievals_size() const { + return _impl_.edge_list_retrievals_.size(); +} +inline int TopologyTrait::edge_list_retrievals_size() const { + return _internal_edge_list_retrievals_size(); +} +inline void TopologyTrait::clear_edge_list_retrievals() { + _impl_.edge_list_retrievals_.Clear(); +} +inline ::grin::ListRetrieval TopologyTrait::_internal_edge_list_retrievals(int index) const { + return static_cast< ::grin::ListRetrieval >(_impl_.edge_list_retrievals_.Get(index)); +} +inline ::grin::ListRetrieval TopologyTrait::edge_list_retrievals(int index) const { + // @@protoc_insertion_point(field_get:grin.TopologyTrait.edge_list_retrievals) + return _internal_edge_list_retrievals(index); +} +inline void TopologyTrait::set_edge_list_retrievals(int index, ::grin::ListRetrieval value) { + _impl_.edge_list_retrievals_.Set(index, value); + // @@protoc_insertion_point(field_set:grin.TopologyTrait.edge_list_retrievals) +} +inline void TopologyTrait::_internal_add_edge_list_retrievals(::grin::ListRetrieval value) { + _impl_.edge_list_retrievals_.Add(value); +} +inline void TopologyTrait::add_edge_list_retrievals(::grin::ListRetrieval value) { + _internal_add_edge_list_retrievals(value); + // @@protoc_insertion_point(field_add:grin.TopologyTrait.edge_list_retrievals) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& +TopologyTrait::edge_list_retrievals() const { + // @@protoc_insertion_point(field_list:grin.TopologyTrait.edge_list_retrievals) + return _impl_.edge_list_retrievals_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* +TopologyTrait::_internal_mutable_edge_list_retrievals() { + return &_impl_.edge_list_retrievals_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* +TopologyTrait::mutable_edge_list_retrievals() { + // @@protoc_insertion_point(field_mutable_list:grin.TopologyTrait.edge_list_retrievals) + return _internal_mutable_edge_list_retrievals(); +} + +// repeated .grin.ListRetrieval adjacent_list_retrievals = 9; +inline int TopologyTrait::_internal_adjacent_list_retrievals_size() const { + return _impl_.adjacent_list_retrievals_.size(); +} +inline int TopologyTrait::adjacent_list_retrievals_size() const { + return _internal_adjacent_list_retrievals_size(); +} +inline void TopologyTrait::clear_adjacent_list_retrievals() { + _impl_.adjacent_list_retrievals_.Clear(); +} +inline ::grin::ListRetrieval TopologyTrait::_internal_adjacent_list_retrievals(int index) const { + return static_cast< ::grin::ListRetrieval >(_impl_.adjacent_list_retrievals_.Get(index)); +} +inline ::grin::ListRetrieval TopologyTrait::adjacent_list_retrievals(int index) const { + // @@protoc_insertion_point(field_get:grin.TopologyTrait.adjacent_list_retrievals) + return _internal_adjacent_list_retrievals(index); +} +inline void TopologyTrait::set_adjacent_list_retrievals(int index, ::grin::ListRetrieval value) { + _impl_.adjacent_list_retrievals_.Set(index, value); + // @@protoc_insertion_point(field_set:grin.TopologyTrait.adjacent_list_retrievals) +} +inline void TopologyTrait::_internal_add_adjacent_list_retrievals(::grin::ListRetrieval value) { + _impl_.adjacent_list_retrievals_.Add(value); +} +inline void TopologyTrait::add_adjacent_list_retrievals(::grin::ListRetrieval value) { + _internal_add_adjacent_list_retrievals(value); + // @@protoc_insertion_point(field_add:grin.TopologyTrait.adjacent_list_retrievals) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& +TopologyTrait::adjacent_list_retrievals() const { + // @@protoc_insertion_point(field_list:grin.TopologyTrait.adjacent_list_retrievals) + return _impl_.adjacent_list_retrievals_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* +TopologyTrait::_internal_mutable_adjacent_list_retrievals() { + return &_impl_.adjacent_list_retrievals_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* +TopologyTrait::mutable_adjacent_list_retrievals() { + // @@protoc_insertion_point(field_mutable_list:grin.TopologyTrait.adjacent_list_retrievals) + return _internal_mutable_adjacent_list_retrievals(); +} + +// ------------------------------------------------------------------- + +// MirrorPartitionListTrait + +// bool grin_trait_master_vertex_mirror_partition_list = 1; +inline void MirrorPartitionListTrait::clear_grin_trait_master_vertex_mirror_partition_list() { + _impl_.grin_trait_master_vertex_mirror_partition_list_ = false; +} +inline bool MirrorPartitionListTrait::_internal_grin_trait_master_vertex_mirror_partition_list() const { + return _impl_.grin_trait_master_vertex_mirror_partition_list_; +} +inline bool MirrorPartitionListTrait::grin_trait_master_vertex_mirror_partition_list() const { + // @@protoc_insertion_point(field_get:grin.MirrorPartitionListTrait.grin_trait_master_vertex_mirror_partition_list) + return _internal_grin_trait_master_vertex_mirror_partition_list(); +} +inline void MirrorPartitionListTrait::_internal_set_grin_trait_master_vertex_mirror_partition_list(bool value) { + + _impl_.grin_trait_master_vertex_mirror_partition_list_ = value; +} +inline void MirrorPartitionListTrait::set_grin_trait_master_vertex_mirror_partition_list(bool value) { + _internal_set_grin_trait_master_vertex_mirror_partition_list(value); + // @@protoc_insertion_point(field_set:grin.MirrorPartitionListTrait.grin_trait_master_vertex_mirror_partition_list) +} + +// bool grin_trait_mirror_vertex_mirror_partition_list = 2; +inline void MirrorPartitionListTrait::clear_grin_trait_mirror_vertex_mirror_partition_list() { + _impl_.grin_trait_mirror_vertex_mirror_partition_list_ = false; +} +inline bool MirrorPartitionListTrait::_internal_grin_trait_mirror_vertex_mirror_partition_list() const { + return _impl_.grin_trait_mirror_vertex_mirror_partition_list_; +} +inline bool MirrorPartitionListTrait::grin_trait_mirror_vertex_mirror_partition_list() const { + // @@protoc_insertion_point(field_get:grin.MirrorPartitionListTrait.grin_trait_mirror_vertex_mirror_partition_list) + return _internal_grin_trait_mirror_vertex_mirror_partition_list(); +} +inline void MirrorPartitionListTrait::_internal_set_grin_trait_mirror_vertex_mirror_partition_list(bool value) { + + _impl_.grin_trait_mirror_vertex_mirror_partition_list_ = value; +} +inline void MirrorPartitionListTrait::set_grin_trait_mirror_vertex_mirror_partition_list(bool value) { + _internal_set_grin_trait_mirror_vertex_mirror_partition_list(value); + // @@protoc_insertion_point(field_set:grin.MirrorPartitionListTrait.grin_trait_mirror_vertex_mirror_partition_list) +} + +// bool grin_trait_master_edge_mirror_partition_list = 3; +inline void MirrorPartitionListTrait::clear_grin_trait_master_edge_mirror_partition_list() { + _impl_.grin_trait_master_edge_mirror_partition_list_ = false; +} +inline bool MirrorPartitionListTrait::_internal_grin_trait_master_edge_mirror_partition_list() const { + return _impl_.grin_trait_master_edge_mirror_partition_list_; +} +inline bool MirrorPartitionListTrait::grin_trait_master_edge_mirror_partition_list() const { + // @@protoc_insertion_point(field_get:grin.MirrorPartitionListTrait.grin_trait_master_edge_mirror_partition_list) + return _internal_grin_trait_master_edge_mirror_partition_list(); +} +inline void MirrorPartitionListTrait::_internal_set_grin_trait_master_edge_mirror_partition_list(bool value) { + + _impl_.grin_trait_master_edge_mirror_partition_list_ = value; +} +inline void MirrorPartitionListTrait::set_grin_trait_master_edge_mirror_partition_list(bool value) { + _internal_set_grin_trait_master_edge_mirror_partition_list(value); + // @@protoc_insertion_point(field_set:grin.MirrorPartitionListTrait.grin_trait_master_edge_mirror_partition_list) +} + +// bool grin_trait_mirror_edge_mirror_partition_list = 4; +inline void MirrorPartitionListTrait::clear_grin_trait_mirror_edge_mirror_partition_list() { + _impl_.grin_trait_mirror_edge_mirror_partition_list_ = false; +} +inline bool MirrorPartitionListTrait::_internal_grin_trait_mirror_edge_mirror_partition_list() const { + return _impl_.grin_trait_mirror_edge_mirror_partition_list_; +} +inline bool MirrorPartitionListTrait::grin_trait_mirror_edge_mirror_partition_list() const { + // @@protoc_insertion_point(field_get:grin.MirrorPartitionListTrait.grin_trait_mirror_edge_mirror_partition_list) + return _internal_grin_trait_mirror_edge_mirror_partition_list(); +} +inline void MirrorPartitionListTrait::_internal_set_grin_trait_mirror_edge_mirror_partition_list(bool value) { + + _impl_.grin_trait_mirror_edge_mirror_partition_list_ = value; +} +inline void MirrorPartitionListTrait::set_grin_trait_mirror_edge_mirror_partition_list(bool value) { + _internal_set_grin_trait_mirror_edge_mirror_partition_list(value); + // @@protoc_insertion_point(field_set:grin.MirrorPartitionListTrait.grin_trait_mirror_edge_mirror_partition_list) +} + +// ------------------------------------------------------------------- + +// PartitionTrait + +// .grin.GraphPartitionStrategy graph_partition_strategy = 1; +inline void PartitionTrait::clear_graph_partition_strategy() { + _impl_.graph_partition_strategy_ = 0; +} +inline ::grin::GraphPartitionStrategy PartitionTrait::_internal_graph_partition_strategy() const { + return static_cast< ::grin::GraphPartitionStrategy >(_impl_.graph_partition_strategy_); +} +inline ::grin::GraphPartitionStrategy PartitionTrait::graph_partition_strategy() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.graph_partition_strategy) + return _internal_graph_partition_strategy(); +} +inline void PartitionTrait::_internal_set_graph_partition_strategy(::grin::GraphPartitionStrategy value) { + + _impl_.graph_partition_strategy_ = value; +} +inline void PartitionTrait::set_graph_partition_strategy(::grin::GraphPartitionStrategy value) { + _internal_set_graph_partition_strategy(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.graph_partition_strategy) +} + +// bool grin_trait_natural_id_for_partition = 2; +inline void PartitionTrait::clear_grin_trait_natural_id_for_partition() { + _impl_.grin_trait_natural_id_for_partition_ = false; +} +inline bool PartitionTrait::_internal_grin_trait_natural_id_for_partition() const { + return _impl_.grin_trait_natural_id_for_partition_; +} +inline bool PartitionTrait::grin_trait_natural_id_for_partition() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_natural_id_for_partition) + return _internal_grin_trait_natural_id_for_partition(); +} +inline void PartitionTrait::_internal_set_grin_trait_natural_id_for_partition(bool value) { + + _impl_.grin_trait_natural_id_for_partition_ = value; +} +inline void PartitionTrait::set_grin_trait_natural_id_for_partition(bool value) { + _internal_set_grin_trait_natural_id_for_partition(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_natural_id_for_partition) +} + +// bool grin_enable_vertex_ref = 3; +inline void PartitionTrait::clear_grin_enable_vertex_ref() { + _impl_.grin_enable_vertex_ref_ = false; +} +inline bool PartitionTrait::_internal_grin_enable_vertex_ref() const { + return _impl_.grin_enable_vertex_ref_; +} +inline bool PartitionTrait::grin_enable_vertex_ref() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_enable_vertex_ref) + return _internal_grin_enable_vertex_ref(); +} +inline void PartitionTrait::_internal_set_grin_enable_vertex_ref(bool value) { + + _impl_.grin_enable_vertex_ref_ = value; +} +inline void PartitionTrait::set_grin_enable_vertex_ref(bool value) { + _internal_set_grin_enable_vertex_ref(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_enable_vertex_ref) +} + +// bool grin_enable_edge_ref = 4; +inline void PartitionTrait::clear_grin_enable_edge_ref() { + _impl_.grin_enable_edge_ref_ = false; +} +inline bool PartitionTrait::_internal_grin_enable_edge_ref() const { + return _impl_.grin_enable_edge_ref_; +} +inline bool PartitionTrait::grin_enable_edge_ref() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_enable_edge_ref) + return _internal_grin_enable_edge_ref(); +} +inline void PartitionTrait::_internal_set_grin_enable_edge_ref(bool value) { + + _impl_.grin_enable_edge_ref_ = value; +} +inline void PartitionTrait::set_grin_enable_edge_ref(bool value) { + _internal_set_grin_enable_edge_ref(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_enable_edge_ref) +} + +// .grin.PropertyDataPartitionStrategy vertex_data = 5; +inline void PartitionTrait::clear_vertex_data() { + _impl_.vertex_data_ = 0; +} +inline ::grin::PropertyDataPartitionStrategy PartitionTrait::_internal_vertex_data() const { + return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.vertex_data_); +} +inline ::grin::PropertyDataPartitionStrategy PartitionTrait::vertex_data() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.vertex_data) + return _internal_vertex_data(); +} +inline void PartitionTrait::_internal_set_vertex_data(::grin::PropertyDataPartitionStrategy value) { + + _impl_.vertex_data_ = value; +} +inline void PartitionTrait::set_vertex_data(::grin::PropertyDataPartitionStrategy value) { + _internal_set_vertex_data(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.vertex_data) +} + +// .grin.PropertyDataPartitionStrategy edge_data = 6; +inline void PartitionTrait::clear_edge_data() { + _impl_.edge_data_ = 0; +} +inline ::grin::PropertyDataPartitionStrategy PartitionTrait::_internal_edge_data() const { + return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.edge_data_); +} +inline ::grin::PropertyDataPartitionStrategy PartitionTrait::edge_data() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.edge_data) + return _internal_edge_data(); +} +inline void PartitionTrait::_internal_set_edge_data(::grin::PropertyDataPartitionStrategy value) { + + _impl_.edge_data_ = value; +} +inline void PartitionTrait::set_edge_data(::grin::PropertyDataPartitionStrategy value) { + _internal_set_edge_data(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.edge_data) +} + +// .grin.MirrorPartitionListTrait mirror_partition_list_trait = 7; +inline bool PartitionTrait::_internal_has_mirror_partition_list_trait() const { + return this != internal_default_instance() && _impl_.mirror_partition_list_trait_ != nullptr; +} +inline bool PartitionTrait::has_mirror_partition_list_trait() const { + return _internal_has_mirror_partition_list_trait(); +} +inline void PartitionTrait::clear_mirror_partition_list_trait() { + if (GetArenaForAllocation() == nullptr && _impl_.mirror_partition_list_trait_ != nullptr) { + delete _impl_.mirror_partition_list_trait_; + } + _impl_.mirror_partition_list_trait_ = nullptr; +} +inline const ::grin::MirrorPartitionListTrait& PartitionTrait::_internal_mirror_partition_list_trait() const { + const ::grin::MirrorPartitionListTrait* p = _impl_.mirror_partition_list_trait_; + return p != nullptr ? *p : reinterpret_cast( + ::grin::_MirrorPartitionListTrait_default_instance_); +} +inline const ::grin::MirrorPartitionListTrait& PartitionTrait::mirror_partition_list_trait() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.mirror_partition_list_trait) + return _internal_mirror_partition_list_trait(); +} +inline void PartitionTrait::unsafe_arena_set_allocated_mirror_partition_list_trait( + ::grin::MirrorPartitionListTrait* mirror_partition_list_trait) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.mirror_partition_list_trait_); + } + _impl_.mirror_partition_list_trait_ = mirror_partition_list_trait; + if (mirror_partition_list_trait) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PartitionTrait.mirror_partition_list_trait) +} +inline ::grin::MirrorPartitionListTrait* PartitionTrait::release_mirror_partition_list_trait() { + + ::grin::MirrorPartitionListTrait* temp = _impl_.mirror_partition_list_trait_; + _impl_.mirror_partition_list_trait_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::grin::MirrorPartitionListTrait* PartitionTrait::unsafe_arena_release_mirror_partition_list_trait() { + // @@protoc_insertion_point(field_release:grin.PartitionTrait.mirror_partition_list_trait) + + ::grin::MirrorPartitionListTrait* temp = _impl_.mirror_partition_list_trait_; + _impl_.mirror_partition_list_trait_ = nullptr; + return temp; +} +inline ::grin::MirrorPartitionListTrait* PartitionTrait::_internal_mutable_mirror_partition_list_trait() { + + if (_impl_.mirror_partition_list_trait_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::MirrorPartitionListTrait>(GetArenaForAllocation()); + _impl_.mirror_partition_list_trait_ = p; + } + return _impl_.mirror_partition_list_trait_; +} +inline ::grin::MirrorPartitionListTrait* PartitionTrait::mutable_mirror_partition_list_trait() { + ::grin::MirrorPartitionListTrait* _msg = _internal_mutable_mirror_partition_list_trait(); + // @@protoc_insertion_point(field_mutable:grin.PartitionTrait.mirror_partition_list_trait) + return _msg; +} +inline void PartitionTrait::set_allocated_mirror_partition_list_trait(::grin::MirrorPartitionListTrait* mirror_partition_list_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.mirror_partition_list_trait_; + } + if (mirror_partition_list_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(mirror_partition_list_trait); + if (message_arena != submessage_arena) { + mirror_partition_list_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, mirror_partition_list_trait, submessage_arena); + } + + } else { + + } + _impl_.mirror_partition_list_trait_ = mirror_partition_list_trait; + // @@protoc_insertion_point(field_set_allocated:grin.PartitionTrait.mirror_partition_list_trait) +} + +// bool grin_trait_select_master_for_vertex_list = 8; +inline void PartitionTrait::clear_grin_trait_select_master_for_vertex_list() { + _impl_.grin_trait_select_master_for_vertex_list_ = false; +} +inline bool PartitionTrait::_internal_grin_trait_select_master_for_vertex_list() const { + return _impl_.grin_trait_select_master_for_vertex_list_; +} +inline bool PartitionTrait::grin_trait_select_master_for_vertex_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_master_for_vertex_list) + return _internal_grin_trait_select_master_for_vertex_list(); +} +inline void PartitionTrait::_internal_set_grin_trait_select_master_for_vertex_list(bool value) { + + _impl_.grin_trait_select_master_for_vertex_list_ = value; +} +inline void PartitionTrait::set_grin_trait_select_master_for_vertex_list(bool value) { + _internal_set_grin_trait_select_master_for_vertex_list(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_master_for_vertex_list) +} + +// bool grin_trait_select_partition_for_vertex_list = 9; +inline void PartitionTrait::clear_grin_trait_select_partition_for_vertex_list() { + _impl_.grin_trait_select_partition_for_vertex_list_ = false; +} +inline bool PartitionTrait::_internal_grin_trait_select_partition_for_vertex_list() const { + return _impl_.grin_trait_select_partition_for_vertex_list_; +} +inline bool PartitionTrait::grin_trait_select_partition_for_vertex_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_partition_for_vertex_list) + return _internal_grin_trait_select_partition_for_vertex_list(); +} +inline void PartitionTrait::_internal_set_grin_trait_select_partition_for_vertex_list(bool value) { + + _impl_.grin_trait_select_partition_for_vertex_list_ = value; +} +inline void PartitionTrait::set_grin_trait_select_partition_for_vertex_list(bool value) { + _internal_set_grin_trait_select_partition_for_vertex_list(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_partition_for_vertex_list) +} + +// bool grin_trait_select_master_for_edge_list = 10; +inline void PartitionTrait::clear_grin_trait_select_master_for_edge_list() { + _impl_.grin_trait_select_master_for_edge_list_ = false; +} +inline bool PartitionTrait::_internal_grin_trait_select_master_for_edge_list() const { + return _impl_.grin_trait_select_master_for_edge_list_; +} +inline bool PartitionTrait::grin_trait_select_master_for_edge_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_master_for_edge_list) + return _internal_grin_trait_select_master_for_edge_list(); +} +inline void PartitionTrait::_internal_set_grin_trait_select_master_for_edge_list(bool value) { + + _impl_.grin_trait_select_master_for_edge_list_ = value; +} +inline void PartitionTrait::set_grin_trait_select_master_for_edge_list(bool value) { + _internal_set_grin_trait_select_master_for_edge_list(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_master_for_edge_list) +} + +// bool grin_trait_select_partition_for_edge_list = 11; +inline void PartitionTrait::clear_grin_trait_select_partition_for_edge_list() { + _impl_.grin_trait_select_partition_for_edge_list_ = false; +} +inline bool PartitionTrait::_internal_grin_trait_select_partition_for_edge_list() const { + return _impl_.grin_trait_select_partition_for_edge_list_; +} +inline bool PartitionTrait::grin_trait_select_partition_for_edge_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_partition_for_edge_list) + return _internal_grin_trait_select_partition_for_edge_list(); +} +inline void PartitionTrait::_internal_set_grin_trait_select_partition_for_edge_list(bool value) { + + _impl_.grin_trait_select_partition_for_edge_list_ = value; +} +inline void PartitionTrait::set_grin_trait_select_partition_for_edge_list(bool value) { + _internal_set_grin_trait_select_partition_for_edge_list(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_partition_for_edge_list) +} + +// bool grin_trait_select_master_neighbor_for_adjacent_list = 12; +inline void PartitionTrait::clear_grin_trait_select_master_neighbor_for_adjacent_list() { + _impl_.grin_trait_select_master_neighbor_for_adjacent_list_ = false; +} +inline bool PartitionTrait::_internal_grin_trait_select_master_neighbor_for_adjacent_list() const { + return _impl_.grin_trait_select_master_neighbor_for_adjacent_list_; +} +inline bool PartitionTrait::grin_trait_select_master_neighbor_for_adjacent_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_master_neighbor_for_adjacent_list) + return _internal_grin_trait_select_master_neighbor_for_adjacent_list(); +} +inline void PartitionTrait::_internal_set_grin_trait_select_master_neighbor_for_adjacent_list(bool value) { + + _impl_.grin_trait_select_master_neighbor_for_adjacent_list_ = value; +} +inline void PartitionTrait::set_grin_trait_select_master_neighbor_for_adjacent_list(bool value) { + _internal_set_grin_trait_select_master_neighbor_for_adjacent_list(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_master_neighbor_for_adjacent_list) +} + +// bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; +inline void PartitionTrait::clear_grin_trait_select_neighbor_partition_for_adjacent_list() { + _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_ = false; +} +inline bool PartitionTrait::_internal_grin_trait_select_neighbor_partition_for_adjacent_list() const { + return _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_; +} +inline bool PartitionTrait::grin_trait_select_neighbor_partition_for_adjacent_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_neighbor_partition_for_adjacent_list) + return _internal_grin_trait_select_neighbor_partition_for_adjacent_list(); +} +inline void PartitionTrait::_internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value) { + + _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_ = value; +} +inline void PartitionTrait::set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value) { + _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(value); + // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_neighbor_partition_for_adjacent_list) +} + +// ------------------------------------------------------------------- + +// VertexPropertyTrait + +// bool grin_with_vertex_property = 1; +inline void VertexPropertyTrait::clear_grin_with_vertex_property() { + _impl_.grin_with_vertex_property_ = false; +} +inline bool VertexPropertyTrait::_internal_grin_with_vertex_property() const { + return _impl_.grin_with_vertex_property_; +} +inline bool VertexPropertyTrait::grin_with_vertex_property() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_with_vertex_property) + return _internal_grin_with_vertex_property(); +} +inline void VertexPropertyTrait::_internal_set_grin_with_vertex_property(bool value) { + + _impl_.grin_with_vertex_property_ = value; +} +inline void VertexPropertyTrait::set_grin_with_vertex_property(bool value) { + _internal_set_grin_with_vertex_property(value); + // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_with_vertex_property) +} + +// bool grin_with_vertex_property_name = 2; +inline void VertexPropertyTrait::clear_grin_with_vertex_property_name() { + _impl_.grin_with_vertex_property_name_ = false; +} +inline bool VertexPropertyTrait::_internal_grin_with_vertex_property_name() const { + return _impl_.grin_with_vertex_property_name_; +} +inline bool VertexPropertyTrait::grin_with_vertex_property_name() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_with_vertex_property_name) + return _internal_grin_with_vertex_property_name(); +} +inline void VertexPropertyTrait::_internal_set_grin_with_vertex_property_name(bool value) { + + _impl_.grin_with_vertex_property_name_ = value; +} +inline void VertexPropertyTrait::set_grin_with_vertex_property_name(bool value) { + _internal_set_grin_with_vertex_property_name(value); + // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_with_vertex_property_name) +} + +// bool grin_with_vertex_type_name = 3; +inline void VertexPropertyTrait::clear_grin_with_vertex_type_name() { + _impl_.grin_with_vertex_type_name_ = false; +} +inline bool VertexPropertyTrait::_internal_grin_with_vertex_type_name() const { + return _impl_.grin_with_vertex_type_name_; +} +inline bool VertexPropertyTrait::grin_with_vertex_type_name() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_with_vertex_type_name) + return _internal_grin_with_vertex_type_name(); +} +inline void VertexPropertyTrait::_internal_set_grin_with_vertex_type_name(bool value) { + + _impl_.grin_with_vertex_type_name_ = value; +} +inline void VertexPropertyTrait::set_grin_with_vertex_type_name(bool value) { + _internal_set_grin_with_vertex_type_name(value); + // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_with_vertex_type_name) +} + +// bool grin_enable_vertex_property_table = 4; +inline void VertexPropertyTrait::clear_grin_enable_vertex_property_table() { + _impl_.grin_enable_vertex_property_table_ = false; +} +inline bool VertexPropertyTrait::_internal_grin_enable_vertex_property_table() const { + return _impl_.grin_enable_vertex_property_table_; +} +inline bool VertexPropertyTrait::grin_enable_vertex_property_table() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_enable_vertex_property_table) + return _internal_grin_enable_vertex_property_table(); +} +inline void VertexPropertyTrait::_internal_set_grin_enable_vertex_property_table(bool value) { + + _impl_.grin_enable_vertex_property_table_ = value; +} +inline void VertexPropertyTrait::set_grin_enable_vertex_property_table(bool value) { + _internal_set_grin_enable_vertex_property_table(value); + // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_enable_vertex_property_table) +} + +// bool grin_enable_vertex_primary_keys = 5; +inline void VertexPropertyTrait::clear_grin_enable_vertex_primary_keys() { + _impl_.grin_enable_vertex_primary_keys_ = false; +} +inline bool VertexPropertyTrait::_internal_grin_enable_vertex_primary_keys() const { + return _impl_.grin_enable_vertex_primary_keys_; +} +inline bool VertexPropertyTrait::grin_enable_vertex_primary_keys() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_enable_vertex_primary_keys) + return _internal_grin_enable_vertex_primary_keys(); +} +inline void VertexPropertyTrait::_internal_set_grin_enable_vertex_primary_keys(bool value) { + + _impl_.grin_enable_vertex_primary_keys_ = value; +} +inline void VertexPropertyTrait::set_grin_enable_vertex_primary_keys(bool value) { + _internal_set_grin_enable_vertex_primary_keys(value); + // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_enable_vertex_primary_keys) +} + +// bool grin_trait_natural_id_for_vertex_type = 6; +inline void VertexPropertyTrait::clear_grin_trait_natural_id_for_vertex_type() { + _impl_.grin_trait_natural_id_for_vertex_type_ = false; +} +inline bool VertexPropertyTrait::_internal_grin_trait_natural_id_for_vertex_type() const { + return _impl_.grin_trait_natural_id_for_vertex_type_; +} +inline bool VertexPropertyTrait::grin_trait_natural_id_for_vertex_type() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_trait_natural_id_for_vertex_type) + return _internal_grin_trait_natural_id_for_vertex_type(); +} +inline void VertexPropertyTrait::_internal_set_grin_trait_natural_id_for_vertex_type(bool value) { + + _impl_.grin_trait_natural_id_for_vertex_type_ = value; +} +inline void VertexPropertyTrait::set_grin_trait_natural_id_for_vertex_type(bool value) { + _internal_set_grin_trait_natural_id_for_vertex_type(value); + // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_trait_natural_id_for_vertex_type) +} + +// bool grin_trait_natural_id_for_vertex_property = 7; +inline void VertexPropertyTrait::clear_grin_trait_natural_id_for_vertex_property() { + _impl_.grin_trait_natural_id_for_vertex_property_ = false; +} +inline bool VertexPropertyTrait::_internal_grin_trait_natural_id_for_vertex_property() const { + return _impl_.grin_trait_natural_id_for_vertex_property_; +} +inline bool VertexPropertyTrait::grin_trait_natural_id_for_vertex_property() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_trait_natural_id_for_vertex_property) + return _internal_grin_trait_natural_id_for_vertex_property(); +} +inline void VertexPropertyTrait::_internal_set_grin_trait_natural_id_for_vertex_property(bool value) { + + _impl_.grin_trait_natural_id_for_vertex_property_ = value; +} +inline void VertexPropertyTrait::set_grin_trait_natural_id_for_vertex_property(bool value) { + _internal_set_grin_trait_natural_id_for_vertex_property(value); + // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_trait_natural_id_for_vertex_property) +} + +// bool grin_assume_by_type_vertex_original_id = 8; +inline void VertexPropertyTrait::clear_grin_assume_by_type_vertex_original_id() { + _impl_.grin_assume_by_type_vertex_original_id_ = false; +} +inline bool VertexPropertyTrait::_internal_grin_assume_by_type_vertex_original_id() const { + return _impl_.grin_assume_by_type_vertex_original_id_; +} +inline bool VertexPropertyTrait::grin_assume_by_type_vertex_original_id() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_assume_by_type_vertex_original_id) + return _internal_grin_assume_by_type_vertex_original_id(); +} +inline void VertexPropertyTrait::_internal_set_grin_assume_by_type_vertex_original_id(bool value) { + + _impl_.grin_assume_by_type_vertex_original_id_ = value; +} +inline void VertexPropertyTrait::set_grin_assume_by_type_vertex_original_id(bool value) { + _internal_set_grin_assume_by_type_vertex_original_id(value); + // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_assume_by_type_vertex_original_id) +} + +// ------------------------------------------------------------------- + +// EdgePropertyTrait + +// bool grin_with_edge_property = 1; +inline void EdgePropertyTrait::clear_grin_with_edge_property() { + _impl_.grin_with_edge_property_ = false; +} +inline bool EdgePropertyTrait::_internal_grin_with_edge_property() const { + return _impl_.grin_with_edge_property_; +} +inline bool EdgePropertyTrait::grin_with_edge_property() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_with_edge_property) + return _internal_grin_with_edge_property(); +} +inline void EdgePropertyTrait::_internal_set_grin_with_edge_property(bool value) { + + _impl_.grin_with_edge_property_ = value; +} +inline void EdgePropertyTrait::set_grin_with_edge_property(bool value) { + _internal_set_grin_with_edge_property(value); + // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_with_edge_property) +} + +// bool grin_with_edge_property_name = 2; +inline void EdgePropertyTrait::clear_grin_with_edge_property_name() { + _impl_.grin_with_edge_property_name_ = false; +} +inline bool EdgePropertyTrait::_internal_grin_with_edge_property_name() const { + return _impl_.grin_with_edge_property_name_; +} +inline bool EdgePropertyTrait::grin_with_edge_property_name() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_with_edge_property_name) + return _internal_grin_with_edge_property_name(); +} +inline void EdgePropertyTrait::_internal_set_grin_with_edge_property_name(bool value) { + + _impl_.grin_with_edge_property_name_ = value; +} +inline void EdgePropertyTrait::set_grin_with_edge_property_name(bool value) { + _internal_set_grin_with_edge_property_name(value); + // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_with_edge_property_name) +} + +// bool grin_with_edge_type_name = 3; +inline void EdgePropertyTrait::clear_grin_with_edge_type_name() { + _impl_.grin_with_edge_type_name_ = false; +} +inline bool EdgePropertyTrait::_internal_grin_with_edge_type_name() const { + return _impl_.grin_with_edge_type_name_; +} +inline bool EdgePropertyTrait::grin_with_edge_type_name() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_with_edge_type_name) + return _internal_grin_with_edge_type_name(); +} +inline void EdgePropertyTrait::_internal_set_grin_with_edge_type_name(bool value) { + + _impl_.grin_with_edge_type_name_ = value; +} +inline void EdgePropertyTrait::set_grin_with_edge_type_name(bool value) { + _internal_set_grin_with_edge_type_name(value); + // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_with_edge_type_name) +} + +// bool grin_enable_edge_property_table = 4; +inline void EdgePropertyTrait::clear_grin_enable_edge_property_table() { + _impl_.grin_enable_edge_property_table_ = false; +} +inline bool EdgePropertyTrait::_internal_grin_enable_edge_property_table() const { + return _impl_.grin_enable_edge_property_table_; +} +inline bool EdgePropertyTrait::grin_enable_edge_property_table() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_enable_edge_property_table) + return _internal_grin_enable_edge_property_table(); +} +inline void EdgePropertyTrait::_internal_set_grin_enable_edge_property_table(bool value) { + + _impl_.grin_enable_edge_property_table_ = value; +} +inline void EdgePropertyTrait::set_grin_enable_edge_property_table(bool value) { + _internal_set_grin_enable_edge_property_table(value); + // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_enable_edge_property_table) +} + +// bool grin_enable_edge_primary_keys = 5; +inline void EdgePropertyTrait::clear_grin_enable_edge_primary_keys() { + _impl_.grin_enable_edge_primary_keys_ = false; +} +inline bool EdgePropertyTrait::_internal_grin_enable_edge_primary_keys() const { + return _impl_.grin_enable_edge_primary_keys_; +} +inline bool EdgePropertyTrait::grin_enable_edge_primary_keys() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_enable_edge_primary_keys) + return _internal_grin_enable_edge_primary_keys(); +} +inline void EdgePropertyTrait::_internal_set_grin_enable_edge_primary_keys(bool value) { + + _impl_.grin_enable_edge_primary_keys_ = value; +} +inline void EdgePropertyTrait::set_grin_enable_edge_primary_keys(bool value) { + _internal_set_grin_enable_edge_primary_keys(value); + // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_enable_edge_primary_keys) +} + +// bool grin_trait_natural_id_for_edge_type = 6; +inline void EdgePropertyTrait::clear_grin_trait_natural_id_for_edge_type() { + _impl_.grin_trait_natural_id_for_edge_type_ = false; +} +inline bool EdgePropertyTrait::_internal_grin_trait_natural_id_for_edge_type() const { + return _impl_.grin_trait_natural_id_for_edge_type_; +} +inline bool EdgePropertyTrait::grin_trait_natural_id_for_edge_type() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_trait_natural_id_for_edge_type) + return _internal_grin_trait_natural_id_for_edge_type(); +} +inline void EdgePropertyTrait::_internal_set_grin_trait_natural_id_for_edge_type(bool value) { + + _impl_.grin_trait_natural_id_for_edge_type_ = value; +} +inline void EdgePropertyTrait::set_grin_trait_natural_id_for_edge_type(bool value) { + _internal_set_grin_trait_natural_id_for_edge_type(value); + // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_trait_natural_id_for_edge_type) +} + +// bool grin_trait_natural_id_for_edge_property = 7; +inline void EdgePropertyTrait::clear_grin_trait_natural_id_for_edge_property() { + _impl_.grin_trait_natural_id_for_edge_property_ = false; +} +inline bool EdgePropertyTrait::_internal_grin_trait_natural_id_for_edge_property() const { + return _impl_.grin_trait_natural_id_for_edge_property_; +} +inline bool EdgePropertyTrait::grin_trait_natural_id_for_edge_property() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_trait_natural_id_for_edge_property) + return _internal_grin_trait_natural_id_for_edge_property(); +} +inline void EdgePropertyTrait::_internal_set_grin_trait_natural_id_for_edge_property(bool value) { + + _impl_.grin_trait_natural_id_for_edge_property_ = value; +} +inline void EdgePropertyTrait::set_grin_trait_natural_id_for_edge_property(bool value) { + _internal_set_grin_trait_natural_id_for_edge_property(value); + // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_trait_natural_id_for_edge_property) +} + +// ------------------------------------------------------------------- + +// PropertyTrait + +// bool grin_enable_row = 1; +inline void PropertyTrait::clear_grin_enable_row() { + _impl_.grin_enable_row_ = false; +} +inline bool PropertyTrait::_internal_grin_enable_row() const { + return _impl_.grin_enable_row_; +} +inline bool PropertyTrait::grin_enable_row() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_enable_row) + return _internal_grin_enable_row(); +} +inline void PropertyTrait::_internal_set_grin_enable_row(bool value) { + + _impl_.grin_enable_row_ = value; +} +inline void PropertyTrait::set_grin_enable_row(bool value) { + _internal_set_grin_enable_row(value); + // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_enable_row) +} + +// .grin.VertexPropertyTrait vertex_property_trait = 2; +inline bool PropertyTrait::_internal_has_vertex_property_trait() const { + return this != internal_default_instance() && _impl_.vertex_property_trait_ != nullptr; +} +inline bool PropertyTrait::has_vertex_property_trait() const { + return _internal_has_vertex_property_trait(); +} +inline void PropertyTrait::clear_vertex_property_trait() { + if (GetArenaForAllocation() == nullptr && _impl_.vertex_property_trait_ != nullptr) { + delete _impl_.vertex_property_trait_; + } + _impl_.vertex_property_trait_ = nullptr; +} +inline const ::grin::VertexPropertyTrait& PropertyTrait::_internal_vertex_property_trait() const { + const ::grin::VertexPropertyTrait* p = _impl_.vertex_property_trait_; + return p != nullptr ? *p : reinterpret_cast( + ::grin::_VertexPropertyTrait_default_instance_); +} +inline const ::grin::VertexPropertyTrait& PropertyTrait::vertex_property_trait() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.vertex_property_trait) + return _internal_vertex_property_trait(); +} +inline void PropertyTrait::unsafe_arena_set_allocated_vertex_property_trait( + ::grin::VertexPropertyTrait* vertex_property_trait) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.vertex_property_trait_); + } + _impl_.vertex_property_trait_ = vertex_property_trait; + if (vertex_property_trait) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PropertyTrait.vertex_property_trait) +} +inline ::grin::VertexPropertyTrait* PropertyTrait::release_vertex_property_trait() { + + ::grin::VertexPropertyTrait* temp = _impl_.vertex_property_trait_; + _impl_.vertex_property_trait_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::grin::VertexPropertyTrait* PropertyTrait::unsafe_arena_release_vertex_property_trait() { + // @@protoc_insertion_point(field_release:grin.PropertyTrait.vertex_property_trait) + + ::grin::VertexPropertyTrait* temp = _impl_.vertex_property_trait_; + _impl_.vertex_property_trait_ = nullptr; + return temp; +} +inline ::grin::VertexPropertyTrait* PropertyTrait::_internal_mutable_vertex_property_trait() { + + if (_impl_.vertex_property_trait_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::VertexPropertyTrait>(GetArenaForAllocation()); + _impl_.vertex_property_trait_ = p; + } + return _impl_.vertex_property_trait_; +} +inline ::grin::VertexPropertyTrait* PropertyTrait::mutable_vertex_property_trait() { + ::grin::VertexPropertyTrait* _msg = _internal_mutable_vertex_property_trait(); + // @@protoc_insertion_point(field_mutable:grin.PropertyTrait.vertex_property_trait) + return _msg; +} +inline void PropertyTrait::set_allocated_vertex_property_trait(::grin::VertexPropertyTrait* vertex_property_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.vertex_property_trait_; + } + if (vertex_property_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(vertex_property_trait); + if (message_arena != submessage_arena) { + vertex_property_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, vertex_property_trait, submessage_arena); + } + + } else { + + } + _impl_.vertex_property_trait_ = vertex_property_trait; + // @@protoc_insertion_point(field_set_allocated:grin.PropertyTrait.vertex_property_trait) +} + +// .grin.EdgePropertyTrait edge_property_trait = 3; +inline bool PropertyTrait::_internal_has_edge_property_trait() const { + return this != internal_default_instance() && _impl_.edge_property_trait_ != nullptr; +} +inline bool PropertyTrait::has_edge_property_trait() const { + return _internal_has_edge_property_trait(); +} +inline void PropertyTrait::clear_edge_property_trait() { + if (GetArenaForAllocation() == nullptr && _impl_.edge_property_trait_ != nullptr) { + delete _impl_.edge_property_trait_; + } + _impl_.edge_property_trait_ = nullptr; +} +inline const ::grin::EdgePropertyTrait& PropertyTrait::_internal_edge_property_trait() const { + const ::grin::EdgePropertyTrait* p = _impl_.edge_property_trait_; + return p != nullptr ? *p : reinterpret_cast( + ::grin::_EdgePropertyTrait_default_instance_); +} +inline const ::grin::EdgePropertyTrait& PropertyTrait::edge_property_trait() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.edge_property_trait) + return _internal_edge_property_trait(); +} +inline void PropertyTrait::unsafe_arena_set_allocated_edge_property_trait( + ::grin::EdgePropertyTrait* edge_property_trait) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.edge_property_trait_); + } + _impl_.edge_property_trait_ = edge_property_trait; + if (edge_property_trait) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PropertyTrait.edge_property_trait) +} +inline ::grin::EdgePropertyTrait* PropertyTrait::release_edge_property_trait() { + + ::grin::EdgePropertyTrait* temp = _impl_.edge_property_trait_; + _impl_.edge_property_trait_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::grin::EdgePropertyTrait* PropertyTrait::unsafe_arena_release_edge_property_trait() { + // @@protoc_insertion_point(field_release:grin.PropertyTrait.edge_property_trait) + + ::grin::EdgePropertyTrait* temp = _impl_.edge_property_trait_; + _impl_.edge_property_trait_ = nullptr; + return temp; +} +inline ::grin::EdgePropertyTrait* PropertyTrait::_internal_mutable_edge_property_trait() { + + if (_impl_.edge_property_trait_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::EdgePropertyTrait>(GetArenaForAllocation()); + _impl_.edge_property_trait_ = p; + } + return _impl_.edge_property_trait_; +} +inline ::grin::EdgePropertyTrait* PropertyTrait::mutable_edge_property_trait() { + ::grin::EdgePropertyTrait* _msg = _internal_mutable_edge_property_trait(); + // @@protoc_insertion_point(field_mutable:grin.PropertyTrait.edge_property_trait) + return _msg; +} +inline void PropertyTrait::set_allocated_edge_property_trait(::grin::EdgePropertyTrait* edge_property_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.edge_property_trait_; + } + if (edge_property_trait) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(edge_property_trait); + if (message_arena != submessage_arena) { + edge_property_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, edge_property_trait, submessage_arena); + } + + } else { + + } + _impl_.edge_property_trait_ = edge_property_trait; + // @@protoc_insertion_point(field_set_allocated:grin.PropertyTrait.edge_property_trait) +} + +// .grin.PropertyDataPartitionStrategy vertex_property = 4; +inline void PropertyTrait::clear_vertex_property() { + _impl_.vertex_property_ = 0; +} +inline ::grin::PropertyDataPartitionStrategy PropertyTrait::_internal_vertex_property() const { + return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.vertex_property_); +} +inline ::grin::PropertyDataPartitionStrategy PropertyTrait::vertex_property() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.vertex_property) + return _internal_vertex_property(); +} +inline void PropertyTrait::_internal_set_vertex_property(::grin::PropertyDataPartitionStrategy value) { + + _impl_.vertex_property_ = value; +} +inline void PropertyTrait::set_vertex_property(::grin::PropertyDataPartitionStrategy value) { + _internal_set_vertex_property(value); + // @@protoc_insertion_point(field_set:grin.PropertyTrait.vertex_property) +} + +// .grin.PropertyDataPartitionStrategy edge_property = 5; +inline void PropertyTrait::clear_edge_property() { + _impl_.edge_property_ = 0; +} +inline ::grin::PropertyDataPartitionStrategy PropertyTrait::_internal_edge_property() const { + return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.edge_property_); +} +inline ::grin::PropertyDataPartitionStrategy PropertyTrait::edge_property() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.edge_property) + return _internal_edge_property(); +} +inline void PropertyTrait::_internal_set_edge_property(::grin::PropertyDataPartitionStrategy value) { + + _impl_.edge_property_ = value; +} +inline void PropertyTrait::set_edge_property(::grin::PropertyDataPartitionStrategy value) { + _internal_set_edge_property(value); + // @@protoc_insertion_point(field_set:grin.PropertyTrait.edge_property) +} + +// bool grin_assume_column_store_for_vertex_property = 6; +inline void PropertyTrait::clear_grin_assume_column_store_for_vertex_property() { + _impl_.grin_assume_column_store_for_vertex_property_ = false; +} +inline bool PropertyTrait::_internal_grin_assume_column_store_for_vertex_property() const { + return _impl_.grin_assume_column_store_for_vertex_property_; +} +inline bool PropertyTrait::grin_assume_column_store_for_vertex_property() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_assume_column_store_for_vertex_property) + return _internal_grin_assume_column_store_for_vertex_property(); +} +inline void PropertyTrait::_internal_set_grin_assume_column_store_for_vertex_property(bool value) { + + _impl_.grin_assume_column_store_for_vertex_property_ = value; +} +inline void PropertyTrait::set_grin_assume_column_store_for_vertex_property(bool value) { + _internal_set_grin_assume_column_store_for_vertex_property(value); + // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_assume_column_store_for_vertex_property) +} + +// bool grin_assume_column_store_for_edge_property = 7; +inline void PropertyTrait::clear_grin_assume_column_store_for_edge_property() { + _impl_.grin_assume_column_store_for_edge_property_ = false; +} +inline bool PropertyTrait::_internal_grin_assume_column_store_for_edge_property() const { + return _impl_.grin_assume_column_store_for_edge_property_; +} +inline bool PropertyTrait::grin_assume_column_store_for_edge_property() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_assume_column_store_for_edge_property) + return _internal_grin_assume_column_store_for_edge_property(); +} +inline void PropertyTrait::_internal_set_grin_assume_column_store_for_edge_property(bool value) { + + _impl_.grin_assume_column_store_for_edge_property_ = value; +} +inline void PropertyTrait::set_grin_assume_column_store_for_edge_property(bool value) { + _internal_set_grin_assume_column_store_for_edge_property(value); + // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_assume_column_store_for_edge_property) +} + +// bool grin_trait_select_type_for_vertex_list = 8; +inline void PropertyTrait::clear_grin_trait_select_type_for_vertex_list() { + _impl_.grin_trait_select_type_for_vertex_list_ = false; +} +inline bool PropertyTrait::_internal_grin_trait_select_type_for_vertex_list() const { + return _impl_.grin_trait_select_type_for_vertex_list_; +} +inline bool PropertyTrait::grin_trait_select_type_for_vertex_list() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_trait_select_type_for_vertex_list) + return _internal_grin_trait_select_type_for_vertex_list(); +} +inline void PropertyTrait::_internal_set_grin_trait_select_type_for_vertex_list(bool value) { + + _impl_.grin_trait_select_type_for_vertex_list_ = value; +} +inline void PropertyTrait::set_grin_trait_select_type_for_vertex_list(bool value) { + _internal_set_grin_trait_select_type_for_vertex_list(value); + // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_trait_select_type_for_vertex_list) +} + +// bool grin_trait_select_type_for_edge_list = 9; +inline void PropertyTrait::clear_grin_trait_select_type_for_edge_list() { + _impl_.grin_trait_select_type_for_edge_list_ = false; +} +inline bool PropertyTrait::_internal_grin_trait_select_type_for_edge_list() const { + return _impl_.grin_trait_select_type_for_edge_list_; +} +inline bool PropertyTrait::grin_trait_select_type_for_edge_list() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_trait_select_type_for_edge_list) + return _internal_grin_trait_select_type_for_edge_list(); +} +inline void PropertyTrait::_internal_set_grin_trait_select_type_for_edge_list(bool value) { + + _impl_.grin_trait_select_type_for_edge_list_ = value; +} +inline void PropertyTrait::set_grin_trait_select_type_for_edge_list(bool value) { + _internal_set_grin_trait_select_type_for_edge_list(value); + // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_trait_select_type_for_edge_list) +} + +// bool grin_trait_select_neighbor_type_for_adjacent_list = 10; +inline void PropertyTrait::clear_grin_trait_select_neighbor_type_for_adjacent_list() { + _impl_.grin_trait_select_neighbor_type_for_adjacent_list_ = false; +} +inline bool PropertyTrait::_internal_grin_trait_select_neighbor_type_for_adjacent_list() const { + return _impl_.grin_trait_select_neighbor_type_for_adjacent_list_; +} +inline bool PropertyTrait::grin_trait_select_neighbor_type_for_adjacent_list() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_trait_select_neighbor_type_for_adjacent_list) + return _internal_grin_trait_select_neighbor_type_for_adjacent_list(); +} +inline void PropertyTrait::_internal_set_grin_trait_select_neighbor_type_for_adjacent_list(bool value) { + + _impl_.grin_trait_select_neighbor_type_for_adjacent_list_ = value; +} +inline void PropertyTrait::set_grin_trait_select_neighbor_type_for_adjacent_list(bool value) { + _internal_set_grin_trait_select_neighbor_type_for_adjacent_list(value); + // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_trait_select_neighbor_type_for_adjacent_list) +} + +// bool grin_trait_select_edge_type_for_adjacent_list = 11; +inline void PropertyTrait::clear_grin_trait_select_edge_type_for_adjacent_list() { + _impl_.grin_trait_select_edge_type_for_adjacent_list_ = false; +} +inline bool PropertyTrait::_internal_grin_trait_select_edge_type_for_adjacent_list() const { + return _impl_.grin_trait_select_edge_type_for_adjacent_list_; +} +inline bool PropertyTrait::grin_trait_select_edge_type_for_adjacent_list() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_trait_select_edge_type_for_adjacent_list) + return _internal_grin_trait_select_edge_type_for_adjacent_list(); +} +inline void PropertyTrait::_internal_set_grin_trait_select_edge_type_for_adjacent_list(bool value) { + + _impl_.grin_trait_select_edge_type_for_adjacent_list_ = value; +} +inline void PropertyTrait::set_grin_trait_select_edge_type_for_adjacent_list(bool value) { + _internal_set_grin_trait_select_edge_type_for_adjacent_list(value); + // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_trait_select_edge_type_for_adjacent_list) +} + +// bool grin_trait_specific_vev_relation = 12; +inline void PropertyTrait::clear_grin_trait_specific_vev_relation() { + _impl_.grin_trait_specific_vev_relation_ = false; +} +inline bool PropertyTrait::_internal_grin_trait_specific_vev_relation() const { + return _impl_.grin_trait_specific_vev_relation_; +} +inline bool PropertyTrait::grin_trait_specific_vev_relation() const { + // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_trait_specific_vev_relation) + return _internal_grin_trait_specific_vev_relation(); +} +inline void PropertyTrait::_internal_set_grin_trait_specific_vev_relation(bool value) { + + _impl_.grin_trait_specific_vev_relation_ = value; +} +inline void PropertyTrait::set_grin_trait_specific_vev_relation(bool value) { + _internal_set_grin_trait_specific_vev_relation(value); + // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_trait_specific_vev_relation) +} + +// ------------------------------------------------------------------- + +// IndexTrait + +// bool grin_with_vertex_label = 1; +inline void IndexTrait::clear_grin_with_vertex_label() { + _impl_.grin_with_vertex_label_ = false; +} +inline bool IndexTrait::_internal_grin_with_vertex_label() const { + return _impl_.grin_with_vertex_label_; +} +inline bool IndexTrait::grin_with_vertex_label() const { + // @@protoc_insertion_point(field_get:grin.IndexTrait.grin_with_vertex_label) + return _internal_grin_with_vertex_label(); +} +inline void IndexTrait::_internal_set_grin_with_vertex_label(bool value) { + + _impl_.grin_with_vertex_label_ = value; +} +inline void IndexTrait::set_grin_with_vertex_label(bool value) { + _internal_set_grin_with_vertex_label(value); + // @@protoc_insertion_point(field_set:grin.IndexTrait.grin_with_vertex_label) +} + +// bool grin_with_edge_label = 2; +inline void IndexTrait::clear_grin_with_edge_label() { + _impl_.grin_with_edge_label_ = false; +} +inline bool IndexTrait::_internal_grin_with_edge_label() const { + return _impl_.grin_with_edge_label_; +} +inline bool IndexTrait::grin_with_edge_label() const { + // @@protoc_insertion_point(field_get:grin.IndexTrait.grin_with_edge_label) + return _internal_grin_with_edge_label(); +} +inline void IndexTrait::_internal_set_grin_with_edge_label(bool value) { + + _impl_.grin_with_edge_label_ = value; +} +inline void IndexTrait::set_grin_with_edge_label(bool value) { + _internal_set_grin_with_edge_label(value); + // @@protoc_insertion_point(field_set:grin.IndexTrait.grin_with_edge_label) +} + +// bool grin_assume_all_vertex_list_sorted = 3; +inline void IndexTrait::clear_grin_assume_all_vertex_list_sorted() { + _impl_.grin_assume_all_vertex_list_sorted_ = false; +} +inline bool IndexTrait::_internal_grin_assume_all_vertex_list_sorted() const { + return _impl_.grin_assume_all_vertex_list_sorted_; +} +inline bool IndexTrait::grin_assume_all_vertex_list_sorted() const { + // @@protoc_insertion_point(field_get:grin.IndexTrait.grin_assume_all_vertex_list_sorted) + return _internal_grin_assume_all_vertex_list_sorted(); +} +inline void IndexTrait::_internal_set_grin_assume_all_vertex_list_sorted(bool value) { + + _impl_.grin_assume_all_vertex_list_sorted_ = value; +} +inline void IndexTrait::set_grin_assume_all_vertex_list_sorted(bool value) { + _internal_set_grin_assume_all_vertex_list_sorted(value); + // @@protoc_insertion_point(field_set:grin.IndexTrait.grin_assume_all_vertex_list_sorted) +} + +// ------------------------------------------------------------------- + +// PredicateTrait + +// ------------------------------------------------------------------- + +// StorageTrait + +// .grin.TopologyTrait topology_trait = 1; +inline bool StorageTrait::_internal_has_topology_trait() const { + return specific_trait_case() == kTopologyTrait; +} +inline bool StorageTrait::has_topology_trait() const { + return _internal_has_topology_trait(); +} +inline void StorageTrait::set_has_topology_trait() { + _impl_._oneof_case_[0] = kTopologyTrait; +} +inline void StorageTrait::clear_topology_trait() { + if (_internal_has_topology_trait()) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.specific_trait_.topology_trait_; + } + clear_has_specific_trait(); + } +} +inline ::grin::TopologyTrait* StorageTrait::release_topology_trait() { + // @@protoc_insertion_point(field_release:grin.StorageTrait.topology_trait) + if (_internal_has_topology_trait()) { + clear_has_specific_trait(); + ::grin::TopologyTrait* temp = _impl_.specific_trait_.topology_trait_; + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + _impl_.specific_trait_.topology_trait_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::grin::TopologyTrait& StorageTrait::_internal_topology_trait() const { + return _internal_has_topology_trait() + ? *_impl_.specific_trait_.topology_trait_ + : reinterpret_cast< ::grin::TopologyTrait&>(::grin::_TopologyTrait_default_instance_); +} +inline const ::grin::TopologyTrait& StorageTrait::topology_trait() const { + // @@protoc_insertion_point(field_get:grin.StorageTrait.topology_trait) + return _internal_topology_trait(); +} +inline ::grin::TopologyTrait* StorageTrait::unsafe_arena_release_topology_trait() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageTrait.topology_trait) + if (_internal_has_topology_trait()) { + clear_has_specific_trait(); + ::grin::TopologyTrait* temp = _impl_.specific_trait_.topology_trait_; + _impl_.specific_trait_.topology_trait_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void StorageTrait::unsafe_arena_set_allocated_topology_trait(::grin::TopologyTrait* topology_trait) { + clear_specific_trait(); + if (topology_trait) { + set_has_topology_trait(); + _impl_.specific_trait_.topology_trait_ = topology_trait; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageTrait.topology_trait) +} +inline ::grin::TopologyTrait* StorageTrait::_internal_mutable_topology_trait() { + if (!_internal_has_topology_trait()) { + clear_specific_trait(); + set_has_topology_trait(); + _impl_.specific_trait_.topology_trait_ = CreateMaybeMessage< ::grin::TopologyTrait >(GetArenaForAllocation()); + } + return _impl_.specific_trait_.topology_trait_; +} +inline ::grin::TopologyTrait* StorageTrait::mutable_topology_trait() { + ::grin::TopologyTrait* _msg = _internal_mutable_topology_trait(); + // @@protoc_insertion_point(field_mutable:grin.StorageTrait.topology_trait) + return _msg; +} + +// .grin.PartitionTrait partition_trait = 2; +inline bool StorageTrait::_internal_has_partition_trait() const { + return specific_trait_case() == kPartitionTrait; +} +inline bool StorageTrait::has_partition_trait() const { + return _internal_has_partition_trait(); +} +inline void StorageTrait::set_has_partition_trait() { + _impl_._oneof_case_[0] = kPartitionTrait; +} +inline void StorageTrait::clear_partition_trait() { + if (_internal_has_partition_trait()) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.specific_trait_.partition_trait_; + } + clear_has_specific_trait(); + } +} +inline ::grin::PartitionTrait* StorageTrait::release_partition_trait() { + // @@protoc_insertion_point(field_release:grin.StorageTrait.partition_trait) + if (_internal_has_partition_trait()) { + clear_has_specific_trait(); + ::grin::PartitionTrait* temp = _impl_.specific_trait_.partition_trait_; + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + _impl_.specific_trait_.partition_trait_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::grin::PartitionTrait& StorageTrait::_internal_partition_trait() const { + return _internal_has_partition_trait() + ? *_impl_.specific_trait_.partition_trait_ + : reinterpret_cast< ::grin::PartitionTrait&>(::grin::_PartitionTrait_default_instance_); +} +inline const ::grin::PartitionTrait& StorageTrait::partition_trait() const { + // @@protoc_insertion_point(field_get:grin.StorageTrait.partition_trait) + return _internal_partition_trait(); +} +inline ::grin::PartitionTrait* StorageTrait::unsafe_arena_release_partition_trait() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageTrait.partition_trait) + if (_internal_has_partition_trait()) { + clear_has_specific_trait(); + ::grin::PartitionTrait* temp = _impl_.specific_trait_.partition_trait_; + _impl_.specific_trait_.partition_trait_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void StorageTrait::unsafe_arena_set_allocated_partition_trait(::grin::PartitionTrait* partition_trait) { + clear_specific_trait(); + if (partition_trait) { + set_has_partition_trait(); + _impl_.specific_trait_.partition_trait_ = partition_trait; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageTrait.partition_trait) +} +inline ::grin::PartitionTrait* StorageTrait::_internal_mutable_partition_trait() { + if (!_internal_has_partition_trait()) { + clear_specific_trait(); + set_has_partition_trait(); + _impl_.specific_trait_.partition_trait_ = CreateMaybeMessage< ::grin::PartitionTrait >(GetArenaForAllocation()); + } + return _impl_.specific_trait_.partition_trait_; +} +inline ::grin::PartitionTrait* StorageTrait::mutable_partition_trait() { + ::grin::PartitionTrait* _msg = _internal_mutable_partition_trait(); + // @@protoc_insertion_point(field_mutable:grin.StorageTrait.partition_trait) + return _msg; +} + +// .grin.PropertyTrait property_trait = 3; +inline bool StorageTrait::_internal_has_property_trait() const { + return specific_trait_case() == kPropertyTrait; +} +inline bool StorageTrait::has_property_trait() const { + return _internal_has_property_trait(); +} +inline void StorageTrait::set_has_property_trait() { + _impl_._oneof_case_[0] = kPropertyTrait; +} +inline void StorageTrait::clear_property_trait() { + if (_internal_has_property_trait()) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.specific_trait_.property_trait_; + } + clear_has_specific_trait(); + } +} +inline ::grin::PropertyTrait* StorageTrait::release_property_trait() { + // @@protoc_insertion_point(field_release:grin.StorageTrait.property_trait) + if (_internal_has_property_trait()) { + clear_has_specific_trait(); + ::grin::PropertyTrait* temp = _impl_.specific_trait_.property_trait_; + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + _impl_.specific_trait_.property_trait_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::grin::PropertyTrait& StorageTrait::_internal_property_trait() const { + return _internal_has_property_trait() + ? *_impl_.specific_trait_.property_trait_ + : reinterpret_cast< ::grin::PropertyTrait&>(::grin::_PropertyTrait_default_instance_); +} +inline const ::grin::PropertyTrait& StorageTrait::property_trait() const { + // @@protoc_insertion_point(field_get:grin.StorageTrait.property_trait) + return _internal_property_trait(); +} +inline ::grin::PropertyTrait* StorageTrait::unsafe_arena_release_property_trait() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageTrait.property_trait) + if (_internal_has_property_trait()) { + clear_has_specific_trait(); + ::grin::PropertyTrait* temp = _impl_.specific_trait_.property_trait_; + _impl_.specific_trait_.property_trait_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void StorageTrait::unsafe_arena_set_allocated_property_trait(::grin::PropertyTrait* property_trait) { + clear_specific_trait(); + if (property_trait) { + set_has_property_trait(); + _impl_.specific_trait_.property_trait_ = property_trait; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageTrait.property_trait) +} +inline ::grin::PropertyTrait* StorageTrait::_internal_mutable_property_trait() { + if (!_internal_has_property_trait()) { + clear_specific_trait(); + set_has_property_trait(); + _impl_.specific_trait_.property_trait_ = CreateMaybeMessage< ::grin::PropertyTrait >(GetArenaForAllocation()); + } + return _impl_.specific_trait_.property_trait_; +} +inline ::grin::PropertyTrait* StorageTrait::mutable_property_trait() { + ::grin::PropertyTrait* _msg = _internal_mutable_property_trait(); + // @@protoc_insertion_point(field_mutable:grin.StorageTrait.property_trait) + return _msg; +} + +// .grin.IndexTrait index_trait = 4; +inline bool StorageTrait::_internal_has_index_trait() const { + return specific_trait_case() == kIndexTrait; +} +inline bool StorageTrait::has_index_trait() const { + return _internal_has_index_trait(); +} +inline void StorageTrait::set_has_index_trait() { + _impl_._oneof_case_[0] = kIndexTrait; +} +inline void StorageTrait::clear_index_trait() { + if (_internal_has_index_trait()) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.specific_trait_.index_trait_; + } + clear_has_specific_trait(); + } +} +inline ::grin::IndexTrait* StorageTrait::release_index_trait() { + // @@protoc_insertion_point(field_release:grin.StorageTrait.index_trait) + if (_internal_has_index_trait()) { + clear_has_specific_trait(); + ::grin::IndexTrait* temp = _impl_.specific_trait_.index_trait_; + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + _impl_.specific_trait_.index_trait_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::grin::IndexTrait& StorageTrait::_internal_index_trait() const { + return _internal_has_index_trait() + ? *_impl_.specific_trait_.index_trait_ + : reinterpret_cast< ::grin::IndexTrait&>(::grin::_IndexTrait_default_instance_); +} +inline const ::grin::IndexTrait& StorageTrait::index_trait() const { + // @@protoc_insertion_point(field_get:grin.StorageTrait.index_trait) + return _internal_index_trait(); +} +inline ::grin::IndexTrait* StorageTrait::unsafe_arena_release_index_trait() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageTrait.index_trait) + if (_internal_has_index_trait()) { + clear_has_specific_trait(); + ::grin::IndexTrait* temp = _impl_.specific_trait_.index_trait_; + _impl_.specific_trait_.index_trait_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void StorageTrait::unsafe_arena_set_allocated_index_trait(::grin::IndexTrait* index_trait) { + clear_specific_trait(); + if (index_trait) { + set_has_index_trait(); + _impl_.specific_trait_.index_trait_ = index_trait; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageTrait.index_trait) +} +inline ::grin::IndexTrait* StorageTrait::_internal_mutable_index_trait() { + if (!_internal_has_index_trait()) { + clear_specific_trait(); + set_has_index_trait(); + _impl_.specific_trait_.index_trait_ = CreateMaybeMessage< ::grin::IndexTrait >(GetArenaForAllocation()); + } + return _impl_.specific_trait_.index_trait_; +} +inline ::grin::IndexTrait* StorageTrait::mutable_index_trait() { + ::grin::IndexTrait* _msg = _internal_mutable_index_trait(); + // @@protoc_insertion_point(field_mutable:grin.StorageTrait.index_trait) + return _msg; +} + +// .grin.PredicateTrait predicate_trait = 5; +inline bool StorageTrait::_internal_has_predicate_trait() const { + return specific_trait_case() == kPredicateTrait; +} +inline bool StorageTrait::has_predicate_trait() const { + return _internal_has_predicate_trait(); +} +inline void StorageTrait::set_has_predicate_trait() { + _impl_._oneof_case_[0] = kPredicateTrait; +} +inline void StorageTrait::clear_predicate_trait() { + if (_internal_has_predicate_trait()) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.specific_trait_.predicate_trait_; + } + clear_has_specific_trait(); + } +} +inline ::grin::PredicateTrait* StorageTrait::release_predicate_trait() { + // @@protoc_insertion_point(field_release:grin.StorageTrait.predicate_trait) + if (_internal_has_predicate_trait()) { + clear_has_specific_trait(); + ::grin::PredicateTrait* temp = _impl_.specific_trait_.predicate_trait_; + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + _impl_.specific_trait_.predicate_trait_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::grin::PredicateTrait& StorageTrait::_internal_predicate_trait() const { + return _internal_has_predicate_trait() + ? *_impl_.specific_trait_.predicate_trait_ + : reinterpret_cast< ::grin::PredicateTrait&>(::grin::_PredicateTrait_default_instance_); +} +inline const ::grin::PredicateTrait& StorageTrait::predicate_trait() const { + // @@protoc_insertion_point(field_get:grin.StorageTrait.predicate_trait) + return _internal_predicate_trait(); +} +inline ::grin::PredicateTrait* StorageTrait::unsafe_arena_release_predicate_trait() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageTrait.predicate_trait) + if (_internal_has_predicate_trait()) { + clear_has_specific_trait(); + ::grin::PredicateTrait* temp = _impl_.specific_trait_.predicate_trait_; + _impl_.specific_trait_.predicate_trait_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void StorageTrait::unsafe_arena_set_allocated_predicate_trait(::grin::PredicateTrait* predicate_trait) { + clear_specific_trait(); + if (predicate_trait) { + set_has_predicate_trait(); + _impl_.specific_trait_.predicate_trait_ = predicate_trait; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageTrait.predicate_trait) +} +inline ::grin::PredicateTrait* StorageTrait::_internal_mutable_predicate_trait() { + if (!_internal_has_predicate_trait()) { + clear_specific_trait(); + set_has_predicate_trait(); + _impl_.specific_trait_.predicate_trait_ = CreateMaybeMessage< ::grin::PredicateTrait >(GetArenaForAllocation()); + } + return _impl_.specific_trait_.predicate_trait_; +} +inline ::grin::PredicateTrait* StorageTrait::mutable_predicate_trait() { + ::grin::PredicateTrait* _msg = _internal_mutable_predicate_trait(); + // @@protoc_insertion_point(field_mutable:grin.StorageTrait.predicate_trait) + return _msg; +} + +inline bool StorageTrait::has_specific_trait() const { + return specific_trait_case() != SPECIFIC_TRAIT_NOT_SET; +} +inline void StorageTrait::clear_has_specific_trait() { + _impl_._oneof_case_[0] = SPECIFIC_TRAIT_NOT_SET; +} +inline StorageTrait::SpecificTraitCase StorageTrait::specific_trait_case() const { + return StorageTrait::SpecificTraitCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// Statistics + +// int32 vertex_count = 1; +inline void Statistics::clear_vertex_count() { + _impl_.vertex_count_ = 0; +} +inline int32_t Statistics::_internal_vertex_count() const { + return _impl_.vertex_count_; +} +inline int32_t Statistics::vertex_count() const { + // @@protoc_insertion_point(field_get:grin.Statistics.vertex_count) + return _internal_vertex_count(); +} +inline void Statistics::_internal_set_vertex_count(int32_t value) { + + _impl_.vertex_count_ = value; +} +inline void Statistics::set_vertex_count(int32_t value) { + _internal_set_vertex_count(value); + // @@protoc_insertion_point(field_set:grin.Statistics.vertex_count) +} + +// int32 edge_count = 2; +inline void Statistics::clear_edge_count() { + _impl_.edge_count_ = 0; +} +inline int32_t Statistics::_internal_edge_count() const { + return _impl_.edge_count_; +} +inline int32_t Statistics::edge_count() const { + // @@protoc_insertion_point(field_get:grin.Statistics.edge_count) + return _internal_edge_count(); +} +inline void Statistics::_internal_set_edge_count(int32_t value) { + + _impl_.edge_count_ = value; +} +inline void Statistics::set_edge_count(int32_t value) { + _internal_set_edge_count(value); + // @@protoc_insertion_point(field_set:grin.Statistics.edge_count) +} + +// int32 partition_count = 3; +inline void Statistics::clear_partition_count() { + _impl_.partition_count_ = 0; +} +inline int32_t Statistics::_internal_partition_count() const { + return _impl_.partition_count_; +} +inline int32_t Statistics::partition_count() const { + // @@protoc_insertion_point(field_get:grin.Statistics.partition_count) + return _internal_partition_count(); +} +inline void Statistics::_internal_set_partition_count(int32_t value) { + + _impl_.partition_count_ = value; +} +inline void Statistics::set_partition_count(int32_t value) { + _internal_set_partition_count(value); + // @@protoc_insertion_point(field_set:grin.Statistics.partition_count) +} + +// int32 vertex_type_count = 4; +inline void Statistics::clear_vertex_type_count() { + _impl_.vertex_type_count_ = 0; +} +inline int32_t Statistics::_internal_vertex_type_count() const { + return _impl_.vertex_type_count_; +} +inline int32_t Statistics::vertex_type_count() const { + // @@protoc_insertion_point(field_get:grin.Statistics.vertex_type_count) + return _internal_vertex_type_count(); +} +inline void Statistics::_internal_set_vertex_type_count(int32_t value) { + + _impl_.vertex_type_count_ = value; +} +inline void Statistics::set_vertex_type_count(int32_t value) { + _internal_set_vertex_type_count(value); + // @@protoc_insertion_point(field_set:grin.Statistics.vertex_type_count) +} + +// int32 edge_type_count = 5; +inline void Statistics::clear_edge_type_count() { + _impl_.edge_type_count_ = 0; +} +inline int32_t Statistics::_internal_edge_type_count() const { + return _impl_.edge_type_count_; +} +inline int32_t Statistics::edge_type_count() const { + // @@protoc_insertion_point(field_get:grin.Statistics.edge_type_count) + return _internal_edge_type_count(); +} +inline void Statistics::_internal_set_edge_type_count(int32_t value) { + + _impl_.edge_type_count_ = value; +} +inline void Statistics::set_edge_type_count(int32_t value) { + _internal_set_edge_type_count(value); + // @@protoc_insertion_point(field_set:grin.Statistics.edge_type_count) +} + +// ------------------------------------------------------------------- + +// Graph + +// string uri = 1; +inline void Graph::clear_uri() { + _impl_.uri_.ClearToEmpty(); +} +inline const std::string& Graph::uri() const { + // @@protoc_insertion_point(field_get:grin.Graph.uri) + return _internal_uri(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Graph::set_uri(ArgT0&& arg0, ArgT... args) { + + _impl_.uri_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:grin.Graph.uri) +} +inline std::string* Graph::mutable_uri() { + std::string* _s = _internal_mutable_uri(); + // @@protoc_insertion_point(field_mutable:grin.Graph.uri) + return _s; +} +inline const std::string& Graph::_internal_uri() const { + return _impl_.uri_.Get(); +} +inline void Graph::_internal_set_uri(const std::string& value) { + + _impl_.uri_.Set(value, GetArenaForAllocation()); +} +inline std::string* Graph::_internal_mutable_uri() { + + return _impl_.uri_.Mutable(GetArenaForAllocation()); +} +inline std::string* Graph::release_uri() { + // @@protoc_insertion_point(field_release:grin.Graph.uri) + return _impl_.uri_.Release(); +} +inline void Graph::set_allocated_uri(std::string* uri) { + if (uri != nullptr) { + + } else { + + } + _impl_.uri_.SetAllocated(uri, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.uri_.IsDefault()) { + _impl_.uri_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:grin.Graph.uri) +} + +// string grin_version = 2; +inline void Graph::clear_grin_version() { + _impl_.grin_version_.ClearToEmpty(); +} +inline const std::string& Graph::grin_version() const { + // @@protoc_insertion_point(field_get:grin.Graph.grin_version) + return _internal_grin_version(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Graph::set_grin_version(ArgT0&& arg0, ArgT... args) { + + _impl_.grin_version_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:grin.Graph.grin_version) +} +inline std::string* Graph::mutable_grin_version() { + std::string* _s = _internal_mutable_grin_version(); + // @@protoc_insertion_point(field_mutable:grin.Graph.grin_version) + return _s; +} +inline const std::string& Graph::_internal_grin_version() const { + return _impl_.grin_version_.Get(); +} +inline void Graph::_internal_set_grin_version(const std::string& value) { + + _impl_.grin_version_.Set(value, GetArenaForAllocation()); +} +inline std::string* Graph::_internal_mutable_grin_version() { + + return _impl_.grin_version_.Mutable(GetArenaForAllocation()); +} +inline std::string* Graph::release_grin_version() { + // @@protoc_insertion_point(field_release:grin.Graph.grin_version) + return _impl_.grin_version_.Release(); +} +inline void Graph::set_allocated_grin_version(std::string* grin_version) { + if (grin_version != nullptr) { + + } else { + + } + _impl_.grin_version_.SetAllocated(grin_version, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.grin_version_.IsDefault()) { + _impl_.grin_version_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:grin.Graph.grin_version) +} + +// repeated .grin.StorageTrait traits = 3; +inline int Graph::_internal_traits_size() const { + return _impl_.traits_.size(); +} +inline int Graph::traits_size() const { + return _internal_traits_size(); +} +inline void Graph::clear_traits() { + _impl_.traits_.Clear(); +} +inline ::grin::StorageTrait* Graph::mutable_traits(int index) { + // @@protoc_insertion_point(field_mutable:grin.Graph.traits) + return _impl_.traits_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageTrait >* +Graph::mutable_traits() { + // @@protoc_insertion_point(field_mutable_list:grin.Graph.traits) + return &_impl_.traits_; +} +inline const ::grin::StorageTrait& Graph::_internal_traits(int index) const { + return _impl_.traits_.Get(index); +} +inline const ::grin::StorageTrait& Graph::traits(int index) const { + // @@protoc_insertion_point(field_get:grin.Graph.traits) + return _internal_traits(index); +} +inline ::grin::StorageTrait* Graph::_internal_add_traits() { + return _impl_.traits_.Add(); +} +inline ::grin::StorageTrait* Graph::add_traits() { + ::grin::StorageTrait* _add = _internal_add_traits(); + // @@protoc_insertion_point(field_add:grin.Graph.traits) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageTrait >& +Graph::traits() const { + // @@protoc_insertion_point(field_list:grin.Graph.traits) + return _impl_.traits_; +} + +// .grin.Statistics statistics = 4; +inline bool Graph::_internal_has_statistics() const { + return this != internal_default_instance() && _impl_.statistics_ != nullptr; +} +inline bool Graph::has_statistics() const { + return _internal_has_statistics(); +} +inline void Graph::clear_statistics() { + if (GetArenaForAllocation() == nullptr && _impl_.statistics_ != nullptr) { + delete _impl_.statistics_; + } + _impl_.statistics_ = nullptr; +} +inline const ::grin::Statistics& Graph::_internal_statistics() const { + const ::grin::Statistics* p = _impl_.statistics_; + return p != nullptr ? *p : reinterpret_cast( + ::grin::_Statistics_default_instance_); +} +inline const ::grin::Statistics& Graph::statistics() const { + // @@protoc_insertion_point(field_get:grin.Graph.statistics) + return _internal_statistics(); +} +inline void Graph::unsafe_arena_set_allocated_statistics( + ::grin::Statistics* statistics) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.statistics_); + } + _impl_.statistics_ = statistics; + if (statistics) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.Graph.statistics) +} +inline ::grin::Statistics* Graph::release_statistics() { + + ::grin::Statistics* temp = _impl_.statistics_; + _impl_.statistics_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::grin::Statistics* Graph::unsafe_arena_release_statistics() { + // @@protoc_insertion_point(field_release:grin.Graph.statistics) + + ::grin::Statistics* temp = _impl_.statistics_; + _impl_.statistics_ = nullptr; + return temp; +} +inline ::grin::Statistics* Graph::_internal_mutable_statistics() { + + if (_impl_.statistics_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::Statistics>(GetArenaForAllocation()); + _impl_.statistics_ = p; + } + return _impl_.statistics_; +} +inline ::grin::Statistics* Graph::mutable_statistics() { + ::grin::Statistics* _msg = _internal_mutable_statistics(); + // @@protoc_insertion_point(field_mutable:grin.Graph.statistics) + return _msg; +} +inline void Graph::set_allocated_statistics(::grin::Statistics* statistics) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.statistics_; + } + if (statistics) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(statistics); + if (message_arena != submessage_arena) { + statistics = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, statistics, submessage_arena); + } + + } else { + + } + _impl_.statistics_ = statistics; + // @@protoc_insertion_point(field_set_allocated:grin.Graph.statistics) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace grin + +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::grin::ListRetrieval> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::grin::ListRetrieval>() { + return ::grin::ListRetrieval_descriptor(); +} +template <> struct is_proto_enum< ::grin::GraphPartitionStrategy> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::grin::GraphPartitionStrategy>() { + return ::grin::GraphPartitionStrategy_descriptor(); +} +template <> struct is_proto_enum< ::grin::PropertyDataPartitionStrategy> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::grin::PropertyDataPartitionStrategy>() { + return ::grin::PropertyDataPartitionStrategy_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_graph_2eproto diff --git a/modules/graph/grin/src/proto/message.cc b/modules/graph/grin/src/proto/message.cc new file mode 100644 index 000000000..abcfd23af --- /dev/null +++ b/modules/graph/grin/src/proto/message.cc @@ -0,0 +1,326 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include + +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/proto/message.h" +#include "graph.pb.h" + + +const char* grin_get_static_storage_feature_msg() { + grin::Graph g; + g.set_uri("v6d://"); + g.set_grin_version("0.1.0"); + +{ + auto storage_trait = g.add_traits(); + // topology + auto trait = storage_trait->mutable_topology_trait(); + +#ifdef GRIN_ASSUME_HAS_DIRECTED_GRAPH + trait->set_grin_assume_has_directed_graph(true); +#endif + +#ifdef GRIN_ASSUME_HAS_UNDIRECTED_GRAPH + trait->set_grin_assume_has_undirected_graph(true); +#endif + +#ifdef GRIN_ASSUME_HAS_MULTI_EDGE_GRAPH + trait->set_grin_assume_has_multi_edge_graph(true); +#endif + +#ifdef GRIN_WITH_VERTEX_ORIGINAL_ID + trait->set_grin_with_vertex_original_id(true); +#endif + +#ifdef GRIN_WITH_VERTEX_DATA + trait->set_grin_with_vertex_data(true); +#endif + +#ifdef GRIN_WITH_EDGE_DATA + trait->set_grin_with_edge_data(true); +#endif + +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY + #ifndef GRIN_ENABLE_VERTEX_LIST + LOG(ERROR) << "GRIN_ENABLE_VERTEX_LIST_ARRAY requires GRIN_ENABLE_VERTEX_LIST" + #endif + trait->add_vertex_list_retrievals(grin::ListRetrieval::LR_ARRAY_LIKE); +#endif + +#ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR + #ifndef GRIN_ENABLE_VERTEX_LIST + LOG(ERROR) << "GRIN_ENABLE_VERTEX_LIST_ITERATOR requires GRIN_ENABLE_VERTEX_LIST" + #endif + trait->add_vertex_list_retrievals(grin::ListRetrieval::LR_ITERATOR); +#endif + +#ifdef GRIN_ENABLE_EDGE_LIST_ARRAY + #ifndef GRIN_ENABLE_EDGE_LIST + LOG(ERROR) << "GRIN_ENABLE_EDGE_LIST_ARRAY requires GRIN_ENABLE_EDGE_LIST" + #endif + trait->add_edge_list_retrievals(grin::ListRetrieval::LR_ARRAY_LIKE); +#endif + +#ifdef GRIN_ENABLE_EDGE_LIST_ITERATOR + #ifndef GRIN_ENABLE_EDGE_LIST + LOG(ERROR) << "GRIN_ENABLE_EDGE_LIST_ITERATOR requires GRIN_ENABLE_EDGE_LIST" + #endif + trait->add_edge_list_retrievals(grin::ListRetrieval::LR_ITERATOR); +#endif + +#ifdef GRIN_ENABLE_ADJACENT_LIST_ARRAY + #ifndef GRIN_ENABLE_ADJACENT_LIST + LOG(ERROR) << "GRIN_ENABLE_ADJACENT_LIST_ARRAY requires GRIN_ENABLE_ADJACENT_LIST" + #endif + trait->add_adjacent_list_retrievals(grin::ListRetrieval::LR_ARRAY_LIKE); +#endif + +#ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR + #ifndef GRIN_ENABLE_ADJACENT_LIST + LOG(ERROR) << "GRIN_ENABLE_ADJACENT_LIST_ITERATOR requires GRIN_ENABLE_ADJACENT_LIST" + #endif + trait->add_adjacent_list_retrievals(grin::ListRetrieval::LR_ITERATOR); +#endif +} + +{ + auto storage_trait = g.add_traits(); + auto trait = storage_trait->mutable_partition_trait(); + auto cnt = 0; +#ifndef GRIN_ENABLE_GRAPH_PARTITION + trait->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_NA); +#else + #ifdef GRIN_ASSUME_ALL_REPLICATE_PARTITION + trait->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_ALL_REPLICATE); + cnt++; + #endif + + #ifdef GRIN_ASSUME_EDGE_CUT_PARTITION + trait->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_EDGE_CUT); + cnt++; + #endif + + #ifdef GRIN_ASSUME_VERTEX_CUT_PARTITION + trait->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_VERTEX_CUT); + cnt++; + #endif + if (cnt > 1) { + LOG(ERROR) << "More than one partition strategy is enabled"; + } +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION + trait->set_grin_trait_natural_id_for_partition(true); +#endif + +#ifdef GRIN_ENABLE_VERTEX_REF + trait->set_grin_enable_vertex_ref(true); +#endif + +#ifdef GRIN_ENABLE_EDGE_REF + trait->set_grin_enable_edge_ref(true); +#endif + +#ifdef GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_DATA + #ifdef GRIN_WITH_VERTEX_DATA + trait->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_MASTER_ONLY); + #else + trait->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_NA); + #endif +#endif + +#ifdef GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_DATA + #ifdef GRIN_WITH_VERTEX_DATA + trait->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_REPLICATE_MASTER_MIRROR); + #else + trait->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_NA); + #endif +#endif + +#ifdef GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_DATA + #ifdef GRIN_WITH_EDGE_DATA + trait->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_MASTER_ONLY); + #else + trait->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_NA); + #endif +#endif + +#ifdef GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_DATA + #ifdef GRIN_WITH_EDGE_DATA + trait->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_REPLICATE_MASTER_MIRROR); + #else + trait->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_NA); + #endif +#endif + + auto mpl_trait = trait->mutable_mirror_partition_list_trait(); +#ifdef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST + mpl_trait->set_grin_trait_master_vertex_mirror_partition_list(true); +#endif + +#ifdef GRIN_TRAIT_MIRROR_VERTEX_MIRROR_PARTITION_LIST + mpl_trait->set_grin_trait_mirror_vertex_mirror_partition_list(true); +#endif + +#ifdef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST + mpl_trait->set_grin_trait_master_edge_mirror_partition_list(true); +#endif + +#ifdef GRIN_TRAIT_MIRROR_EDGE_MIRROR_PARTITION_LIST + mpl_trait->set_grin_trait_mirror_edge_mirror_partition_list(true); +#endif + +#ifdef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST + trait->set_grin_trait_select_master_for_vertex_list(true); +#endif + +#ifdef GRIN_TRAIT_SELECT_PARTITION_FOR_VERTEX_LIST + trait->set_grin_trait_select_partition_for_vertex_list(true); +#endif + +#ifdef GRIN_TRAIT_SELECT_MASTER_FOR_EDGE_LIST + trait->set_grin_trait_select_master_for_edge_list(true); +#endif + +#ifdef GRIN_TRAIT_SELECT_PARTITION_FOR_EDGE_LIST + trait->set_grin_trait_select_partition_for_edge_list(true); +#endif + +#ifdef GRIN_TRAIT_SELECT_MASTER_NEIGHBOR_FOR_ADJACENT_LIST + trait->set_grin_trait_select_master_neighbor_for_adjacent_list(true); +#endif + +#ifdef GRIN_TRAIT_SELECT_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST + trait->set_grin_trait_select_partition_neighbor_for_adjacent_list(true); +#endif +} + +{ + auto storage_trait = g.add_traits(); + auto trait = storage_trait->mutable_property_trait(); +#ifdef GRIN_ENABLE_ROW + trait->set_grin_enable_row(true); +#endif + + auto vtrait = trait->mutable_vertex_property_trait(); +#ifdef GRIN_WITH_VERTEX_PROPERTY + vtrait->set_grin_with_vertex_property(true); +#endif + +#ifdef GRIN_WITH_VERTEX_PROPERTY_NAME + vtrait->set_grin_with_vertex_property_name(true); +#endif + +#ifdef GRIN_WITH_VERTEX_TYPE_NAME + vtrait->set_grin_with_vertex_type_name(true); +#endif + +#ifdef GRIN_ENABLE_VERTEX_PROPERTY_TABLE + vtrait->set_grin_enable_vertex_property_table(true); +#endif + +#ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS + vtrait->set_grin_enable_vertex_primary_keys(true); +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE + vtrait->set_grin_trait_natural_id_for_vertex_type(true); +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY + vtrait->set_grin_trait_natural_id_for_vertex_property(true); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID + vtrait->set_grin_assume_by_type_vertex_original_id(true); +#endif + + auto etrait = trait->mutable_edge_property_trait(); +#ifdef GRIN_WITH_EDGE_PROPERTY + etrait->set_grin_with_edge_property(true); +#endif + +#ifdef GRIN_WITH_EDGE_PROPERTY_NAME + etrait->set_grin_with_edge_property_name(true); +#endif + +#ifdef GRIN_WITH_EDGE_TYPE_NAME + etrait->set_grin_with_edge_type_name(true); +#endif + +#ifdef GRIN_ENABLE_EDGE_PROPERTY_TABLE + etrait->set_grin_enable_edge_property_table(true); +#endif + +#ifdef GRIN_ENABLE_EDGE_PRIMARY_KEYS + etrait->set_grin_enable_edge_primary_keys(true); +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE + etrait->set_grin_trait_natural_id_for_edge_type(true); +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY + etrait->set_grin_trait_natural_id_for_edge_property(true); +#endif + +#ifdef GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY + trait->set_grin_assume_column_store_for_vertex_property(true); +#endif + +#ifdef GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY + trait->set_grin_assume_column_store_for_edge_property(true); +#endif + +#ifdef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST + trait->set_grin_trait_select_type_for_vertex_list(true); +#endif + +#ifdef GRIN_TRAIT_SELECT_TYPE_FOR_EDGE_LIST + trait->set_grin_trait_select_type_for_edge_list(true); +#endif + +#ifdef GRIN_TRAIT_SELECT_NEIGHBOR_TYPE_FOR_ADJACENT_LIST + trait->set_grin_trait_select_neighbor_type_for_adjacent_list(true); +#endif + +#ifdef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST + trait->set_grin_trait_select_edge_type_for_adjacent_list(true); +#endif + +#ifdef GRIN_TRAIT_SPECIFIC_VEV_RELATION + trait->set_grin_trait_specific_vev_relation(true); +#endif +} + +{ + auto storage_trait = g.add_traits(); + auto trait = storage_trait->mutable_index_trait(); +#ifdef GRIN_WITH_VERTEX_LABEL + trait->set_grin_with_vertex_label(true); +#endif + +#ifdef GRIN_WITH_EDGE_LABEL + trait->set_grin_with_edge_label(true); +#endif + +#ifdef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED + trait->set_grin_assume_all_vertex_list_sorted(true); +#endif +} + + std::string graph_def; + google::protobuf::util::MessageToJsonString(g, &graph_def); + return graph_def.c_str(); +} diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index 1840de3eb..c1f846fd1 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -34,10 +34,12 @@ limitations under the License. #include "graph/grin/include/property/propertylist.h" #include "graph/grin/include/property/property.h" #include "graph/grin/include/property/propertytable.h" +#include "graph/grin/include/proto/message.h" #include "graph/fragment/graph_schema.h" #include "graph/loader/arrow_fragment_loader.h" + using namespace vineyard; // NOLINT(build/namespaces) using GraphType = ArrowFragment>> makeETables() { } // namespace detail int main(int argc, char** argv) { + std::cout << grin_get_static_storage_feature_msg() << std::endl; + if (argc < 2) { printf("usage: ./arrow_fragment_test [directed]\n"); return 1; From 305a1d8e1750575b7fbefea9c4a7225bfc2d17ed Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Mon, 17 Apr 2023 18:01:49 +0800 Subject: [PATCH 47/85] impl vertex primary key & gie schema converter --- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 39 + modules/graph/grin/src/property/primarykey.cc | 112 + modules/graph/grin/src/proto/gie_schema.pb.cc | 3240 +++++++++++++++ modules/graph/grin/src/proto/gie_schema.pb.h | 3636 +++++++++++++++++ modules/graph/grin/src/proto/message.cc | 6 +- modules/graph/test/grin_test.cc | 257 +- 7 files changed, 7196 insertions(+), 96 deletions(-) create mode 100644 modules/graph/grin/src/property/primarykey.cc create mode 100644 modules/graph/grin/src/proto/gie_schema.pb.cc create mode 100644 modules/graph/grin/src/proto/gie_schema.pb.h diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 49798f3ae..9f6d239de 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 49798f3aea07a53ff14b48ce02fdf4e6743249e9 +Subproject commit 9f6d239de0ad7efe074fa2b5b02d10ce6652c04b diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 3ba1ae57b..5d3c8e673 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -239,6 +239,22 @@ typedef enum { */ #define GRIN_ASSUME_EDGE_CUT_PARTITION +/** @ingroup PartitionStrategyMacros + * @brief The storage ONLY uses edge-cut partition & edges only follow src strategy. + * This means the storage's entire partition strategy complies with edge-cut strategy + * definition in GRIN, and edges are partitioned to the partition of the source vertex. +*/ +#define GRIN_ASSUME_EDGE_CUT_FOLLOW_SRC_PARTITION + + +/** @ingroup PartitionStrategyMacros + * @brief The storage ONLY uses edge-cut partition & edges only follow dst strategy. + * This means the storage's entire partition strategy complies with edge-cut strategy + * definition in GRIN, and edges are partitioned to the partition of the destination vertex. +*/ +#define GRIN_ASSUME_EDGE_CUT_FOLLOW_DST_PARTITION + + /** @ingroup PartitionStrategyMacros * @brief The storage ONLY uses vertex-cut partition strategy. This means the * storage's entire partition strategy complies with vertex-cut strategy @@ -361,6 +377,8 @@ typedef enum { #undef GRIN_ENABLE_EDGE_REF #undef GRIN_ASSUME_ALL_REPLICATE_PARTITION #undef GRIN_ASSUME_EDGE_CUT_PARTITION +#undef GRIN_ASSUME_EDGE_CUT_FOLLOW_SRC_PARTITION +#undef GRIN_ASSUME_EDGE_CUT_FOLLOW_DST_PARTITION #undef GRIN_ASSUME_VERTEX_CUT_PARTITION #undef GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_DATA #undef GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_DATA @@ -397,6 +415,16 @@ typedef enum { #define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_DATA #endif +#ifdef GRIN_ASSUME_EDGE_CUT_FOLLOW_SRC_PARTITION +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_DATA +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_DATA +#endif + +#ifdef GRIN_ASSUME_EDGE_CUT_FOLLOW_DST_PARTITION +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_DATA +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_DATA +#endif + #ifdef GRIN_ASSUME_VERTEX_CUT_PARTITION #define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_DATA #define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_DATA @@ -663,6 +691,7 @@ typedef enum { #define GRIN_WITH_VERTEX_TYPE_NAME #define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE #define GRIN_ENABLE_VERTEX_PROPERTY_TABLE +#define GRIN_ENABLE_VERTEX_PRIMARY_KEYS #define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY #define GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID #define GRIN_WITH_EDGE_PROPERTY @@ -688,6 +717,16 @@ typedef enum { #define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY #endif +#ifdef GRIN_ASSUME_EDGE_CUT_FOLLOW_SRC_PARTITION +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_PROPERTY +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_PROPERTY +#endif + +#ifdef GRIN_ASSUME_EDGE_CUT_FOLLOW_DST_PARTITION +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_PROPERTY +#define GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_PROPERTY +#endif + #ifdef GRIN_ASSUME_VERTEX_CUT_PARTITION #define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_PROPERTY #define GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY diff --git a/modules/graph/grin/src/property/primarykey.cc b/modules/graph/grin/src/property/primarykey.cc new file mode 100644 index 000000000..da09bda76 --- /dev/null +++ b/modules/graph/grin/src/property/primarykey.cc @@ -0,0 +1,112 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "graph/grin/src/predefine.h" +#include "graph/grin/include/property/primarykey.h" + +#ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS +/** + * @brief get the vertex types with primary keys + * @param GRIN_GRAPH the graph +*/ +GRIN_VERTEX_TYPE_LIST grin_get_vertex_types_with_primary_keys(GRIN_GRAPH g) { + auto _g = static_cast(g)->g; + auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); + for (auto i = 0; i < _g->vertex_label_num(); ++i) { + vtl->push_back(i); + } + return vtl; +} + +/** + * @brief get the primary keys (property list) of a specific vertex type + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_TYPE the vertex type +*/ +GRIN_VERTEX_PROPERTY_LIST grin_get_primary_keys_by_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { + auto _g = static_cast(g)->g; + auto _vtype = static_cast(vtype); + auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); + for (auto p = 0; p < _g->vertex_property_num(*_vtype); ++p) { + if (_g->schema().GetVertexPropertyName(*_vtype, p) == "id") { + vpl->push_back(GRIN_VERTEX_PROPERTY_T(*_vtype, p)); + break; + } + } + return vpl; +} + +/** + * @brief get the vertex with the given primary keys + * @param GRIN_GRAPH the graph + * @param GRIN_VERTEX_TYPE the vertex type which determines the property list for primary keys + * @param GRIN_ROW the values of primary keys +*/ +GRIN_VERTEX grin_get_vertex_by_primary_keys(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_ROW r) { + auto _g = static_cast(g)->g; + auto _vtype = static_cast(vtype); + auto _r = static_cast(r); + auto value = (*_r)[0]; + for (auto p = 0; p < _g->vertex_property_num(*_vtype); ++p) { + if (_g->schema().GetVertexPropertyName(*_vtype, p) == "id") { + auto arrow_dt = _g->schema().GetVertexPropertyType(*_vtype, p); + auto dt = ArrowToDataType(arrow_dt); + + if (dt == GRIN_DATATYPE::Int32) { + auto vid = static_cast(value); + auto _v = new GRIN_VERTEX_T(); + _g->GetVertex(*_vtype, *vid, *_v); + return _v; + } else if (dt == GRIN_DATATYPE::UInt32) { + auto vid = static_cast(value); + auto _v = new GRIN_VERTEX_T(); + _g->GetVertex(*_vtype, *vid, *_v); + return _v; + } else if (dt == GRIN_DATATYPE::Int64) { + auto vid = static_cast(value); + auto _v = new GRIN_VERTEX_T(); + _g->GetVertex(*_vtype, *vid, *_v); + return _v; + } else if (dt == GRIN_DATATYPE::UInt64) { + auto vid = static_cast(value); + auto _v = new GRIN_VERTEX_T(); + _g->GetVertex(*_vtype, *vid, *_v); + return _v; + } + } + } + return GRIN_NULL_VERTEX; +} +#endif + +#ifdef GRIN_WITH_EDGE_PRIMARY_KEYS +/** + * @brief get the edge types with primary keys + * @param GRIN_GRAPH the graph +*/ +GRIN_EDGE_TYPE_LIST grin_get_edge_types_with_primary_keys(GRIN_GRAPH); + +/** + * @brief get the primary keys (property list) of a specific edge type + * @param GRIN_GRAPH the graph + * @param GRIN_EDGE_TYPE the edge type +*/ +GRIN_EDGE_PROPERTY_LIST grin_get_primary_keys_by_edge_type(GRIN_GRAPH, GRIN_EDGE_TYPE); + +/** + * @brief get the edge with the given primary keys + * @param GRIN_GRAPH the graph + * @param GRIN_EDGE_PROPERTY_LIST the primary keys + * @param GRIN_ROW the values of primary keys +*/ +GRIN_EDGE grin_get_edge_by_primary_keys(GRIN_GRAPH, GRIN_EDGE_TYPE, GRIN_ROW); +#endif diff --git a/modules/graph/grin/src/proto/gie_schema.pb.cc b/modules/graph/grin/src/proto/gie_schema.pb.cc new file mode 100644 index 000000000..19965738d --- /dev/null +++ b/modules/graph/grin/src/proto/gie_schema.pb.cc @@ -0,0 +1,3240 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: gie_schema.proto + +#include "gie_schema.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include + +PROTOBUF_PRAGMA_INIT_SEG + +namespace _pb = ::PROTOBUF_NAMESPACE_ID; +namespace _pbi = _pb::internal; + +namespace gie { +PROTOBUF_CONSTEXPR PropertyPartitionByEntityStrategy::PropertyPartitionByEntityStrategy( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.vertex_property_partition_strategy_)*/0 + , /*decltype(_impl_.edge_property_partition_strategy_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct PropertyPartitionByEntityStrategyDefaultTypeInternal { + PROTOBUF_CONSTEXPR PropertyPartitionByEntityStrategyDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PropertyPartitionByEntityStrategyDefaultTypeInternal() {} + union { + PropertyPartitionByEntityStrategy _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyPartitionByEntityStrategyDefaultTypeInternal _PropertyPartitionByEntityStrategy_default_instance_; +PROTOBUF_CONSTEXPR PropertyPartitionByTypeStrategy::PropertyPartitionByTypeStrategy( + ::_pbi::ConstantInitialized) {} +struct PropertyPartitionByTypeStrategyDefaultTypeInternal { + PROTOBUF_CONSTEXPR PropertyPartitionByTypeStrategyDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PropertyPartitionByTypeStrategyDefaultTypeInternal() {} + union { + PropertyPartitionByTypeStrategy _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyPartitionByTypeStrategyDefaultTypeInternal _PropertyPartitionByTypeStrategy_default_instance_; +PROTOBUF_CONSTEXPR GraphPropertyPartitionStrategy::GraphPropertyPartitionStrategy( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.item_)*/{} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}} {} +struct GraphPropertyPartitionStrategyDefaultTypeInternal { + PROTOBUF_CONSTEXPR GraphPropertyPartitionStrategyDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GraphPropertyPartitionStrategyDefaultTypeInternal() {} + union { + GraphPropertyPartitionStrategy _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GraphPropertyPartitionStrategyDefaultTypeInternal _GraphPropertyPartitionStrategy_default_instance_; +PROTOBUF_CONSTEXPR GraphPartitionStrategy::GraphPartitionStrategy( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.property_)*/nullptr + , /*decltype(_impl_.topology_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct GraphPartitionStrategyDefaultTypeInternal { + PROTOBUF_CONSTEXPR GraphPartitionStrategyDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~GraphPartitionStrategyDefaultTypeInternal() {} + union { + GraphPartitionStrategy _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GraphPartitionStrategyDefaultTypeInternal _GraphPartitionStrategy_default_instance_; +PROTOBUF_CONSTEXPR SrcDstPair::SrcDstPair( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.src_type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.dst_type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.partition_strategy_)*/0 + , /*decltype(_impl_.property_partition_strategy_)*/0 + , /*decltype(_impl_.relation_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct SrcDstPairDefaultTypeInternal { + PROTOBUF_CONSTEXPR SrcDstPairDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~SrcDstPairDefaultTypeInternal() {} + union { + SrcDstPair _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SrcDstPairDefaultTypeInternal _SrcDstPair_default_instance_; +PROTOBUF_CONSTEXPR Property::Property( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.id_)*/0u + , /*decltype(_impl_.type_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct PropertyDefaultTypeInternal { + PROTOBUF_CONSTEXPR PropertyDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~PropertyDefaultTypeInternal() {} + union { + Property _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyDefaultTypeInternal _Property_default_instance_; +PROTOBUF_CONSTEXPR VertexType::VertexType( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.properties_)*/{} + , /*decltype(_impl_.primary_keys_)*/{} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.id_)*/0u + , /*decltype(_impl_.partition_strategy_)*/0 + , /*decltype(_impl_.total_num_)*/int64_t{0} + , /*decltype(_impl_.property_partition_strategy_)*/0 + , /*decltype(_impl_._cached_size_)*/{}} {} +struct VertexTypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR VertexTypeDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~VertexTypeDefaultTypeInternal() {} + union { + VertexType _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VertexTypeDefaultTypeInternal _VertexType_default_instance_; +PROTOBUF_CONSTEXPR EdgeType::EdgeType( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.properties_)*/{} + , /*decltype(_impl_.primary_keys_)*/{} + , /*decltype(_impl_.src_dst_pairs_)*/{} + , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} + , /*decltype(_impl_.total_num_)*/int64_t{0} + , /*decltype(_impl_.id_)*/0u + , /*decltype(_impl_._cached_size_)*/{}} {} +struct EdgeTypeDefaultTypeInternal { + PROTOBUF_CONSTEXPR EdgeTypeDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~EdgeTypeDefaultTypeInternal() {} + union { + EdgeType _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EdgeTypeDefaultTypeInternal _EdgeType_default_instance_; +PROTOBUF_CONSTEXPR Statistics::Statistics( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.num_vertices_)*/uint64_t{0u} + , /*decltype(_impl_.num_edges_)*/uint64_t{0u} + , /*decltype(_impl_.num_partitions_)*/0u + , /*decltype(_impl_._cached_size_)*/{}} {} +struct StatisticsDefaultTypeInternal { + PROTOBUF_CONSTEXPR StatisticsDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~StatisticsDefaultTypeInternal() {} + union { + Statistics _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StatisticsDefaultTypeInternal _Statistics_default_instance_; +PROTOBUF_CONSTEXPR Schema::Schema( + ::_pbi::ConstantInitialized): _impl_{ + /*decltype(_impl_.vertex_types_)*/{} + , /*decltype(_impl_.edge_types_)*/{} + , /*decltype(_impl_.partition_strategy_)*/nullptr + , /*decltype(_impl_.statistics_)*/nullptr + , /*decltype(_impl_._cached_size_)*/{}} {} +struct SchemaDefaultTypeInternal { + PROTOBUF_CONSTEXPR SchemaDefaultTypeInternal() + : _instance(::_pbi::ConstantInitialized{}) {} + ~SchemaDefaultTypeInternal() {} + union { + Schema _instance; + }; +}; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SchemaDefaultTypeInternal _Schema_default_instance_; +} // namespace gie +static ::_pb::Metadata file_level_metadata_gie_5fschema_2eproto[10]; +static const ::_pb::EnumDescriptor* file_level_enum_descriptors_gie_5fschema_2eproto[6]; +static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_gie_5fschema_2eproto = nullptr; + +const uint32_t TableStruct_gie_5fschema_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, _impl_.vertex_property_partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, _impl_.edge_property_partition_strategy_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByTypeStrategy, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, _internal_metadata_), + ~0u, // no _extensions_ + PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, _impl_._oneof_case_[0]), + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ::_pbi::kInvalidFieldOffsetTag, + ::_pbi::kInvalidFieldOffsetTag, + PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, _impl_.item_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, _impl_.topology_), + PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, _impl_.property_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _impl_.src_type_), + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _impl_.dst_type_), + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _impl_.partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _impl_.property_partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _impl_.relation_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::gie::Property, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::gie::Property, _impl_.id_), + PROTOBUF_FIELD_OFFSET(::gie::Property, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::gie::Property, _impl_.type_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::gie::VertexType, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.id_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.properties_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.primary_keys_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.property_partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.total_num_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.id_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.name_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.properties_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.primary_keys_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.src_dst_pairs_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.total_num_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::gie::Statistics, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::gie::Statistics, _impl_.num_partitions_), + PROTOBUF_FIELD_OFFSET(::gie::Statistics, _impl_.num_vertices_), + PROTOBUF_FIELD_OFFSET(::gie::Statistics, _impl_.num_edges_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::gie::Schema, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + PROTOBUF_FIELD_OFFSET(::gie::Schema, _impl_.partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::Schema, _impl_.vertex_types_), + PROTOBUF_FIELD_OFFSET(::gie::Schema, _impl_.edge_types_), + PROTOBUF_FIELD_OFFSET(::gie::Schema, _impl_.statistics_), +}; +static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, -1, sizeof(::gie::PropertyPartitionByEntityStrategy)}, + { 8, -1, -1, sizeof(::gie::PropertyPartitionByTypeStrategy)}, + { 14, -1, -1, sizeof(::gie::GraphPropertyPartitionStrategy)}, + { 23, -1, -1, sizeof(::gie::GraphPartitionStrategy)}, + { 31, -1, -1, sizeof(::gie::SrcDstPair)}, + { 42, -1, -1, sizeof(::gie::Property)}, + { 51, -1, -1, sizeof(::gie::VertexType)}, + { 64, -1, -1, sizeof(::gie::EdgeType)}, + { 76, -1, -1, sizeof(::gie::Statistics)}, + { 85, -1, -1, sizeof(::gie::Schema)}, +}; + +static const ::_pb::Message* const file_default_instances[] = { + &::gie::_PropertyPartitionByEntityStrategy_default_instance_._instance, + &::gie::_PropertyPartitionByTypeStrategy_default_instance_._instance, + &::gie::_GraphPropertyPartitionStrategy_default_instance_._instance, + &::gie::_GraphPartitionStrategy_default_instance_._instance, + &::gie::_SrcDstPair_default_instance_._instance, + &::gie::_Property_default_instance_._instance, + &::gie::_VertexType_default_instance_._instance, + &::gie::_EdgeType_default_instance_._instance, + &::gie::_Statistics_default_instance_._instance, + &::gie::_Schema_default_instance_._instance, +}; + +const char descriptor_table_protodef_gie_5fschema_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\020gie_schema.proto\022\003gie\"\271\001\n!PropertyPart" + "itionByEntityStrategy\022J\n\"vertex_property" + "_partition_strategy\030\001 \001(\0162\036.gie.Property" + "PartitionStrategy\022H\n edge_property_parti" + "tion_strategy\030\002 \001(\0162\036.gie.PropertyPartit" + "ionStrategy\"!\n\037PropertyPartitionByTypeSt" + "rategy\"\236\001\n\036GraphPropertyPartitionStrateg" + "y\022;\n\tby_entity\030\001 \001(\0132&.gie.PropertyParti" + "tionByEntityStrategyH\000\0227\n\007by_type\030\002 \001(\0132" + "$.gie.PropertyPartitionByTypeStrategyH\000B" + "\006\n\004item\"\206\001\n\026GraphPartitionStrategy\0225\n\010to" + "pology\030\001 \001(\0162#.gie.GraphTopologyPartitio" + "nStrategy\0225\n\010property\030\002 \001(\0132#.gie.GraphP" + "ropertyPartitionStrategy\"\316\001\n\nSrcDstPair\022" + "\020\n\010src_type\030\001 \001(\t\022\020\n\010dst_type\030\002 \001(\t\0226\n\022p" + "artition_strategy\030\003 \001(\0162\032.gie.EdgePartit" + "ionStrategy\022C\n\033property_partition_strate" + "gy\030\004 \001(\0162\036.gie.PropertyPartitionStrategy" + "\022\037\n\010relation\030\005 \001(\0162\r.gie.Relation\"A\n\010Pro" + "perty\022\n\n\002id\030\001 \001(\r\022\014\n\004name\030\002 \001(\t\022\033\n\004type\030" + "\003 \001(\0162\r.gie.DataType\"\361\001\n\nVertexType\022\n\n\002i" + "d\030\001 \001(\r\022\014\n\004name\030\002 \001(\t\022!\n\nproperties\030\003 \003(" + "\0132\r.gie.Property\022\024\n\014primary_keys\030\004 \003(\t\0228" + "\n\022partition_strategy\030\005 \001(\0162\034.gie.VertexP" + "artitionStrategy\022C\n\033property_partition_s" + "trategy\030\006 \001(\0162\036.gie.PropertyPartitionStr" + "ategy\022\021\n\ttotal_num\030\007 \001(\003\"\230\001\n\010EdgeType\022\n\n" + "\002id\030\001 \001(\r\022\014\n\004name\030\002 \001(\t\022!\n\nproperties\030\003 " + "\003(\0132\r.gie.Property\022\024\n\014primary_keys\030\004 \003(\t" + "\022&\n\rsrc_dst_pairs\030\005 \003(\0132\017.gie.SrcDstPair" + "\022\021\n\ttotal_num\030\006 \001(\003\"M\n\nStatistics\022\026\n\016num" + "_partitions\030\001 \001(\r\022\024\n\014num_vertices\030\002 \001(\004\022" + "\021\n\tnum_edges\030\003 \001(\004\"\260\001\n\006Schema\0227\n\022partiti" + "on_strategy\030\001 \001(\0132\033.gie.GraphPartitionSt" + "rategy\022%\n\014vertex_types\030\002 \003(\0132\017.gie.Verte" + "xType\022!\n\nedge_types\030\003 \003(\0132\r.gie.EdgeType" + "\022#\n\nstatistics\030\004 \001(\0132\017.gie.Statistics*[\n" + "\027VertexPartitionStrategy\022\021\n\rVPS_UNDEFINE" + "D\020\000\022\013\n\007VPS_ALL\020\001\022\013\n\007VPS_ONE\020\002\022\023\n\017VPS_FOL" + "LOW_EDGE\020\003*\201\001\n\025EdgePartitionStrategy\022\021\n\r" + "EPS_UNDEFINED\020\000\022\013\n\007EPS_ALL\020\001\022\013\n\007EPS_ONE\020" + "\002\022\022\n\016EPS_FOLLOW_SRC\020\003\022\022\n\016EPS_FOLLOW_DST\020" + "\004\022\023\n\017EPS_FOLLOW_BOTH\020\005*U\n\031PropertyPartit" + "ionStrategy\022\021\n\rPPS_UNDEFINED\020\000\022\016\n\nPPS_MA" + "STER\020\001\022\025\n\021PPS_MASTER_MIRROR\020\002*\306\001\n\036GraphT" + "opologyPartitionStrategy\022\021\n\rGPS_UNDEFINE" + "D\020\000\022\025\n\021GPS_ALL_REPLICATE\020\001\022\034\n\030GPS_EDGE_C" + "UT_FOLLOW_BOTH\020\002\022\033\n\027GPS_EDGE_CUT_FOLLOW_" + "SRC\020\003\022\033\n\027GPS_EDGE_CUT_FOLLOW_DST\020\004\022\022\n\016GP" + "S_VERTEX_CUT\020\005\022\016\n\nGPS_HYBRID\020\006*a\n\010Relati" + "on\022\021\n\rREL_UNDEFINED\020\000\022\020\n\014MANY_TO_MANY\020\001\022" + "\017\n\013MANY_TO_ONE\020\002\022\017\n\013ONE_TO_MANY\020\003\022\016\n\nONE" + "_TO_ONE\020\004*\312\001\n\010DataType\022\016\n\nDT_UNKNOWN\020\000\022\023" + "\n\017DT_SIGNED_INT32\020\001\022\025\n\021DT_UNSIGNED_INT32" + "\020\002\022\023\n\017DT_SIGNED_INT64\020\003\022\025\n\021DT_UNSIGNED_I" + "NT64\020\004\022\014\n\010DT_FLOAT\020\005\022\r\n\tDT_DOUBLE\020\006\022\r\n\tD" + "T_STRING\020\007\022\013\n\007DT_DATE\020\010\022\013\n\007DT_TIME\020\t\022\020\n\014" + "DT_TIMESTAMP\020\nB%\n#com.alibaba.graphscope" + ".proto.schemab\006proto3" + ; +static ::_pbi::once_flag descriptor_table_gie_5fschema_2eproto_once; +const ::_pbi::DescriptorTable descriptor_table_gie_5fschema_2eproto = { + false, false, 2341, descriptor_table_protodef_gie_5fschema_2eproto, + "gie_schema.proto", + &descriptor_table_gie_5fschema_2eproto_once, nullptr, 0, 10, + schemas, file_default_instances, TableStruct_gie_5fschema_2eproto::offsets, + file_level_metadata_gie_5fschema_2eproto, file_level_enum_descriptors_gie_5fschema_2eproto, + file_level_service_descriptors_gie_5fschema_2eproto, +}; +PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_gie_5fschema_2eproto_getter() { + return &descriptor_table_gie_5fschema_2eproto; +} + +// Force running AddDescriptors() at dynamic initialization time. +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_gie_5fschema_2eproto(&descriptor_table_gie_5fschema_2eproto); +namespace gie { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* VertexPartitionStrategy_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); + return file_level_enum_descriptors_gie_5fschema_2eproto[0]; +} +bool VertexPartitionStrategy_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdgePartitionStrategy_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); + return file_level_enum_descriptors_gie_5fschema_2eproto[1]; +} +bool EdgePartitionStrategy_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PropertyPartitionStrategy_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); + return file_level_enum_descriptors_gie_5fschema_2eproto[2]; +} +bool PropertyPartitionStrategy_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GraphTopologyPartitionStrategy_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); + return file_level_enum_descriptors_gie_5fschema_2eproto[3]; +} +bool GraphTopologyPartitionStrategy_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Relation_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); + return file_level_enum_descriptors_gie_5fschema_2eproto[4]; +} +bool Relation_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataType_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); + return file_level_enum_descriptors_gie_5fschema_2eproto[5]; +} +bool DataType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + return true; + default: + return false; + } +} + + +// =================================================================== + +class PropertyPartitionByEntityStrategy::_Internal { + public: +}; + +PropertyPartitionByEntityStrategy::PropertyPartitionByEntityStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:gie.PropertyPartitionByEntityStrategy) +} +PropertyPartitionByEntityStrategy::PropertyPartitionByEntityStrategy(const PropertyPartitionByEntityStrategy& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + PropertyPartitionByEntityStrategy* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.vertex_property_partition_strategy_){} + , decltype(_impl_.edge_property_partition_strategy_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.vertex_property_partition_strategy_, &from._impl_.vertex_property_partition_strategy_, + static_cast(reinterpret_cast(&_impl_.edge_property_partition_strategy_) - + reinterpret_cast(&_impl_.vertex_property_partition_strategy_)) + sizeof(_impl_.edge_property_partition_strategy_)); + // @@protoc_insertion_point(copy_constructor:gie.PropertyPartitionByEntityStrategy) +} + +inline void PropertyPartitionByEntityStrategy::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.vertex_property_partition_strategy_){0} + , decltype(_impl_.edge_property_partition_strategy_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +PropertyPartitionByEntityStrategy::~PropertyPartitionByEntityStrategy() { + // @@protoc_insertion_point(destructor:gie.PropertyPartitionByEntityStrategy) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void PropertyPartitionByEntityStrategy::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void PropertyPartitionByEntityStrategy::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void PropertyPartitionByEntityStrategy::Clear() { +// @@protoc_insertion_point(message_clear_start:gie.PropertyPartitionByEntityStrategy) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.vertex_property_partition_strategy_, 0, static_cast( + reinterpret_cast(&_impl_.edge_property_partition_strategy_) - + reinterpret_cast(&_impl_.vertex_property_partition_strategy_)) + sizeof(_impl_.edge_property_partition_strategy_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* PropertyPartitionByEntityStrategy::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_vertex_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_edge_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* PropertyPartitionByEntityStrategy::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:gie.PropertyPartitionByEntityStrategy) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; + if (this->_internal_vertex_property_partition_strategy() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_vertex_property_partition_strategy(), target); + } + + // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; + if (this->_internal_edge_property_partition_strategy() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 2, this->_internal_edge_property_partition_strategy(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:gie.PropertyPartitionByEntityStrategy) + return target; +} + +size_t PropertyPartitionByEntityStrategy::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:gie.PropertyPartitionByEntityStrategy) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; + if (this->_internal_vertex_property_partition_strategy() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_vertex_property_partition_strategy()); + } + + // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; + if (this->_internal_edge_property_partition_strategy() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_edge_property_partition_strategy()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PropertyPartitionByEntityStrategy::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + PropertyPartitionByEntityStrategy::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PropertyPartitionByEntityStrategy::GetClassData() const { return &_class_data_; } + + +void PropertyPartitionByEntityStrategy::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:gie.PropertyPartitionByEntityStrategy) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_vertex_property_partition_strategy() != 0) { + _this->_internal_set_vertex_property_partition_strategy(from._internal_vertex_property_partition_strategy()); + } + if (from._internal_edge_property_partition_strategy() != 0) { + _this->_internal_set_edge_property_partition_strategy(from._internal_edge_property_partition_strategy()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PropertyPartitionByEntityStrategy::CopyFrom(const PropertyPartitionByEntityStrategy& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:gie.PropertyPartitionByEntityStrategy) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PropertyPartitionByEntityStrategy::IsInitialized() const { + return true; +} + +void PropertyPartitionByEntityStrategy::InternalSwap(PropertyPartitionByEntityStrategy* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(PropertyPartitionByEntityStrategy, _impl_.edge_property_partition_strategy_) + + sizeof(PropertyPartitionByEntityStrategy::_impl_.edge_property_partition_strategy_) + - PROTOBUF_FIELD_OFFSET(PropertyPartitionByEntityStrategy, _impl_.vertex_property_partition_strategy_)>( + reinterpret_cast(&_impl_.vertex_property_partition_strategy_), + reinterpret_cast(&other->_impl_.vertex_property_partition_strategy_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata PropertyPartitionByEntityStrategy::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, + file_level_metadata_gie_5fschema_2eproto[0]); +} + +// =================================================================== + +class PropertyPartitionByTypeStrategy::_Internal { + public: +}; + +PropertyPartitionByTypeStrategy::PropertyPartitionByTypeStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { + // @@protoc_insertion_point(arena_constructor:gie.PropertyPartitionByTypeStrategy) +} +PropertyPartitionByTypeStrategy::PropertyPartitionByTypeStrategy(const PropertyPartitionByTypeStrategy& from) + : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { + PropertyPartitionByTypeStrategy* const _this = this; (void)_this; + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + // @@protoc_insertion_point(copy_constructor:gie.PropertyPartitionByTypeStrategy) +} + + + + + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PropertyPartitionByTypeStrategy::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PropertyPartitionByTypeStrategy::GetClassData() const { return &_class_data_; } + + + + + + + +::PROTOBUF_NAMESPACE_ID::Metadata PropertyPartitionByTypeStrategy::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, + file_level_metadata_gie_5fschema_2eproto[1]); +} + +// =================================================================== + +class GraphPropertyPartitionStrategy::_Internal { + public: + static const ::gie::PropertyPartitionByEntityStrategy& by_entity(const GraphPropertyPartitionStrategy* msg); + static const ::gie::PropertyPartitionByTypeStrategy& by_type(const GraphPropertyPartitionStrategy* msg); +}; + +const ::gie::PropertyPartitionByEntityStrategy& +GraphPropertyPartitionStrategy::_Internal::by_entity(const GraphPropertyPartitionStrategy* msg) { + return *msg->_impl_.item_.by_entity_; +} +const ::gie::PropertyPartitionByTypeStrategy& +GraphPropertyPartitionStrategy::_Internal::by_type(const GraphPropertyPartitionStrategy* msg) { + return *msg->_impl_.item_.by_type_; +} +void GraphPropertyPartitionStrategy::set_allocated_by_entity(::gie::PropertyPartitionByEntityStrategy* by_entity) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + clear_item(); + if (by_entity) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(by_entity); + if (message_arena != submessage_arena) { + by_entity = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, by_entity, submessage_arena); + } + set_has_by_entity(); + _impl_.item_.by_entity_ = by_entity; + } + // @@protoc_insertion_point(field_set_allocated:gie.GraphPropertyPartitionStrategy.by_entity) +} +void GraphPropertyPartitionStrategy::set_allocated_by_type(::gie::PropertyPartitionByTypeStrategy* by_type) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + clear_item(); + if (by_type) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(by_type); + if (message_arena != submessage_arena) { + by_type = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, by_type, submessage_arena); + } + set_has_by_type(); + _impl_.item_.by_type_ = by_type; + } + // @@protoc_insertion_point(field_set_allocated:gie.GraphPropertyPartitionStrategy.by_type) +} +GraphPropertyPartitionStrategy::GraphPropertyPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:gie.GraphPropertyPartitionStrategy) +} +GraphPropertyPartitionStrategy::GraphPropertyPartitionStrategy(const GraphPropertyPartitionStrategy& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + GraphPropertyPartitionStrategy* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.item_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + clear_has_item(); + switch (from.item_case()) { + case kByEntity: { + _this->_internal_mutable_by_entity()->::gie::PropertyPartitionByEntityStrategy::MergeFrom( + from._internal_by_entity()); + break; + } + case kByType: { + _this->_internal_mutable_by_type()->::gie::PropertyPartitionByTypeStrategy::MergeFrom( + from._internal_by_type()); + break; + } + case ITEM_NOT_SET: { + break; + } + } + // @@protoc_insertion_point(copy_constructor:gie.GraphPropertyPartitionStrategy) +} + +inline void GraphPropertyPartitionStrategy::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.item_){} + , /*decltype(_impl_._cached_size_)*/{} + , /*decltype(_impl_._oneof_case_)*/{} + }; + clear_has_item(); +} + +GraphPropertyPartitionStrategy::~GraphPropertyPartitionStrategy() { + // @@protoc_insertion_point(destructor:gie.GraphPropertyPartitionStrategy) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GraphPropertyPartitionStrategy::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (has_item()) { + clear_item(); + } +} + +void GraphPropertyPartitionStrategy::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void GraphPropertyPartitionStrategy::clear_item() { +// @@protoc_insertion_point(one_of_clear_start:gie.GraphPropertyPartitionStrategy) + switch (item_case()) { + case kByEntity: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.item_.by_entity_; + } + break; + } + case kByType: { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.item_.by_type_; + } + break; + } + case ITEM_NOT_SET: { + break; + } + } + _impl_._oneof_case_[0] = ITEM_NOT_SET; +} + + +void GraphPropertyPartitionStrategy::Clear() { +// @@protoc_insertion_point(message_clear_start:gie.GraphPropertyPartitionStrategy) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + clear_item(); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* GraphPropertyPartitionStrategy::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .gie.PropertyPartitionByEntityStrategy by_entity = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_by_entity(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // .gie.PropertyPartitionByTypeStrategy by_type = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_by_type(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* GraphPropertyPartitionStrategy::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:gie.GraphPropertyPartitionStrategy) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .gie.PropertyPartitionByEntityStrategy by_entity = 1; + if (_internal_has_by_entity()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::by_entity(this), + _Internal::by_entity(this).GetCachedSize(), target, stream); + } + + // .gie.PropertyPartitionByTypeStrategy by_type = 2; + if (_internal_has_by_type()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::by_type(this), + _Internal::by_type(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:gie.GraphPropertyPartitionStrategy) + return target; +} + +size_t GraphPropertyPartitionStrategy::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:gie.GraphPropertyPartitionStrategy) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + switch (item_case()) { + // .gie.PropertyPartitionByEntityStrategy by_entity = 1; + case kByEntity: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.item_.by_entity_); + break; + } + // .gie.PropertyPartitionByTypeStrategy by_type = 2; + case kByType: { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.item_.by_type_); + break; + } + case ITEM_NOT_SET: { + break; + } + } + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GraphPropertyPartitionStrategy::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GraphPropertyPartitionStrategy::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GraphPropertyPartitionStrategy::GetClassData() const { return &_class_data_; } + + +void GraphPropertyPartitionStrategy::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:gie.GraphPropertyPartitionStrategy) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + switch (from.item_case()) { + case kByEntity: { + _this->_internal_mutable_by_entity()->::gie::PropertyPartitionByEntityStrategy::MergeFrom( + from._internal_by_entity()); + break; + } + case kByType: { + _this->_internal_mutable_by_type()->::gie::PropertyPartitionByTypeStrategy::MergeFrom( + from._internal_by_type()); + break; + } + case ITEM_NOT_SET: { + break; + } + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void GraphPropertyPartitionStrategy::CopyFrom(const GraphPropertyPartitionStrategy& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:gie.GraphPropertyPartitionStrategy) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphPropertyPartitionStrategy::IsInitialized() const { + return true; +} + +void GraphPropertyPartitionStrategy::InternalSwap(GraphPropertyPartitionStrategy* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_.item_, other->_impl_.item_); + swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); +} + +::PROTOBUF_NAMESPACE_ID::Metadata GraphPropertyPartitionStrategy::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, + file_level_metadata_gie_5fschema_2eproto[2]); +} + +// =================================================================== + +class GraphPartitionStrategy::_Internal { + public: + static const ::gie::GraphPropertyPartitionStrategy& property(const GraphPartitionStrategy* msg); +}; + +const ::gie::GraphPropertyPartitionStrategy& +GraphPartitionStrategy::_Internal::property(const GraphPartitionStrategy* msg) { + return *msg->_impl_.property_; +} +GraphPartitionStrategy::GraphPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:gie.GraphPartitionStrategy) +} +GraphPartitionStrategy::GraphPartitionStrategy(const GraphPartitionStrategy& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + GraphPartitionStrategy* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.property_){nullptr} + , decltype(_impl_.topology_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_property()) { + _this->_impl_.property_ = new ::gie::GraphPropertyPartitionStrategy(*from._impl_.property_); + } + _this->_impl_.topology_ = from._impl_.topology_; + // @@protoc_insertion_point(copy_constructor:gie.GraphPartitionStrategy) +} + +inline void GraphPartitionStrategy::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.property_){nullptr} + , decltype(_impl_.topology_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +GraphPartitionStrategy::~GraphPartitionStrategy() { + // @@protoc_insertion_point(destructor:gie.GraphPartitionStrategy) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void GraphPartitionStrategy::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + if (this != internal_default_instance()) delete _impl_.property_; +} + +void GraphPartitionStrategy::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void GraphPartitionStrategy::Clear() { +// @@protoc_insertion_point(message_clear_start:gie.GraphPartitionStrategy) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArenaForAllocation() == nullptr && _impl_.property_ != nullptr) { + delete _impl_.property_; + } + _impl_.property_ = nullptr; + _impl_.topology_ = 0; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* GraphPartitionStrategy::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .gie.GraphTopologyPartitionStrategy topology = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_topology(static_cast<::gie::GraphTopologyPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // .gie.GraphPropertyPartitionStrategy property = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_property(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* GraphPartitionStrategy::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:gie.GraphPartitionStrategy) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .gie.GraphTopologyPartitionStrategy topology = 1; + if (this->_internal_topology() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 1, this->_internal_topology(), target); + } + + // .gie.GraphPropertyPartitionStrategy property = 2; + if (this->_internal_has_property()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, _Internal::property(this), + _Internal::property(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:gie.GraphPartitionStrategy) + return target; +} + +size_t GraphPartitionStrategy::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:gie.GraphPartitionStrategy) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .gie.GraphPropertyPartitionStrategy property = 2; + if (this->_internal_has_property()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.property_); + } + + // .gie.GraphTopologyPartitionStrategy topology = 1; + if (this->_internal_topology() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_topology()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GraphPartitionStrategy::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + GraphPartitionStrategy::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GraphPartitionStrategy::GetClassData() const { return &_class_data_; } + + +void GraphPartitionStrategy::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:gie.GraphPartitionStrategy) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_has_property()) { + _this->_internal_mutable_property()->::gie::GraphPropertyPartitionStrategy::MergeFrom( + from._internal_property()); + } + if (from._internal_topology() != 0) { + _this->_internal_set_topology(from._internal_topology()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void GraphPartitionStrategy::CopyFrom(const GraphPartitionStrategy& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:gie.GraphPartitionStrategy) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GraphPartitionStrategy::IsInitialized() const { + return true; +} + +void GraphPartitionStrategy::InternalSwap(GraphPartitionStrategy* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(GraphPartitionStrategy, _impl_.topology_) + + sizeof(GraphPartitionStrategy::_impl_.topology_) + - PROTOBUF_FIELD_OFFSET(GraphPartitionStrategy, _impl_.property_)>( + reinterpret_cast(&_impl_.property_), + reinterpret_cast(&other->_impl_.property_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata GraphPartitionStrategy::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, + file_level_metadata_gie_5fschema_2eproto[3]); +} + +// =================================================================== + +class SrcDstPair::_Internal { + public: +}; + +SrcDstPair::SrcDstPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:gie.SrcDstPair) +} +SrcDstPair::SrcDstPair(const SrcDstPair& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + SrcDstPair* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.src_type_){} + , decltype(_impl_.dst_type_){} + , decltype(_impl_.partition_strategy_){} + , decltype(_impl_.property_partition_strategy_){} + , decltype(_impl_.relation_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.src_type_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.src_type_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_src_type().empty()) { + _this->_impl_.src_type_.Set(from._internal_src_type(), + _this->GetArenaForAllocation()); + } + _impl_.dst_type_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.dst_type_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_dst_type().empty()) { + _this->_impl_.dst_type_.Set(from._internal_dst_type(), + _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.partition_strategy_, &from._impl_.partition_strategy_, + static_cast(reinterpret_cast(&_impl_.relation_) - + reinterpret_cast(&_impl_.partition_strategy_)) + sizeof(_impl_.relation_)); + // @@protoc_insertion_point(copy_constructor:gie.SrcDstPair) +} + +inline void SrcDstPair::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.src_type_){} + , decltype(_impl_.dst_type_){} + , decltype(_impl_.partition_strategy_){0} + , decltype(_impl_.property_partition_strategy_){0} + , decltype(_impl_.relation_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.src_type_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.src_type_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.dst_type_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.dst_type_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +SrcDstPair::~SrcDstPair() { + // @@protoc_insertion_point(destructor:gie.SrcDstPair) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void SrcDstPair::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.src_type_.Destroy(); + _impl_.dst_type_.Destroy(); +} + +void SrcDstPair::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void SrcDstPair::Clear() { +// @@protoc_insertion_point(message_clear_start:gie.SrcDstPair) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.src_type_.ClearToEmpty(); + _impl_.dst_type_.ClearToEmpty(); + ::memset(&_impl_.partition_strategy_, 0, static_cast( + reinterpret_cast(&_impl_.relation_) - + reinterpret_cast(&_impl_.partition_strategy_)) + sizeof(_impl_.relation_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SrcDstPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // string src_type = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + auto str = _internal_mutable_src_type(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "gie.SrcDstPair.src_type")); + } else + goto handle_unusual; + continue; + // string dst_type = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_dst_type(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "gie.SrcDstPair.dst_type")); + } else + goto handle_unusual; + continue; + // .gie.EdgePartitionStrategy partition_strategy = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_partition_strategy(static_cast<::gie::EdgePartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // .gie.PropertyPartitionStrategy property_partition_strategy = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // .gie.Relation relation = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_relation(static_cast<::gie::Relation>(val)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* SrcDstPair::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:gie.SrcDstPair) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // string src_type = 1; + if (!this->_internal_src_type().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_src_type().data(), static_cast(this->_internal_src_type().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "gie.SrcDstPair.src_type"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_src_type(), target); + } + + // string dst_type = 2; + if (!this->_internal_dst_type().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_dst_type().data(), static_cast(this->_internal_dst_type().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "gie.SrcDstPair.dst_type"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_dst_type(), target); + } + + // .gie.EdgePartitionStrategy partition_strategy = 3; + if (this->_internal_partition_strategy() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 3, this->_internal_partition_strategy(), target); + } + + // .gie.PropertyPartitionStrategy property_partition_strategy = 4; + if (this->_internal_property_partition_strategy() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 4, this->_internal_property_partition_strategy(), target); + } + + // .gie.Relation relation = 5; + if (this->_internal_relation() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 5, this->_internal_relation(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:gie.SrcDstPair) + return target; +} + +size_t SrcDstPair::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:gie.SrcDstPair) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string src_type = 1; + if (!this->_internal_src_type().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_src_type()); + } + + // string dst_type = 2; + if (!this->_internal_dst_type().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_dst_type()); + } + + // .gie.EdgePartitionStrategy partition_strategy = 3; + if (this->_internal_partition_strategy() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_partition_strategy()); + } + + // .gie.PropertyPartitionStrategy property_partition_strategy = 4; + if (this->_internal_property_partition_strategy() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_property_partition_strategy()); + } + + // .gie.Relation relation = 5; + if (this->_internal_relation() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_relation()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SrcDstPair::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + SrcDstPair::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SrcDstPair::GetClassData() const { return &_class_data_; } + + +void SrcDstPair::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:gie.SrcDstPair) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_src_type().empty()) { + _this->_internal_set_src_type(from._internal_src_type()); + } + if (!from._internal_dst_type().empty()) { + _this->_internal_set_dst_type(from._internal_dst_type()); + } + if (from._internal_partition_strategy() != 0) { + _this->_internal_set_partition_strategy(from._internal_partition_strategy()); + } + if (from._internal_property_partition_strategy() != 0) { + _this->_internal_set_property_partition_strategy(from._internal_property_partition_strategy()); + } + if (from._internal_relation() != 0) { + _this->_internal_set_relation(from._internal_relation()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void SrcDstPair::CopyFrom(const SrcDstPair& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:gie.SrcDstPair) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SrcDstPair::IsInitialized() const { + return true; +} + +void SrcDstPair::InternalSwap(SrcDstPair* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.src_type_, lhs_arena, + &other->_impl_.src_type_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.dst_type_, lhs_arena, + &other->_impl_.dst_type_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(SrcDstPair, _impl_.relation_) + + sizeof(SrcDstPair::_impl_.relation_) + - PROTOBUF_FIELD_OFFSET(SrcDstPair, _impl_.partition_strategy_)>( + reinterpret_cast(&_impl_.partition_strategy_), + reinterpret_cast(&other->_impl_.partition_strategy_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SrcDstPair::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, + file_level_metadata_gie_5fschema_2eproto[4]); +} + +// =================================================================== + +class Property::_Internal { + public: +}; + +Property::Property(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:gie.Property) +} +Property::Property(const Property& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Property* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.name_){} + , decltype(_impl_.id_){} + , decltype(_impl_.type_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_name().empty()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.id_, &from._impl_.id_, + static_cast(reinterpret_cast(&_impl_.type_) - + reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.type_)); + // @@protoc_insertion_point(copy_constructor:gie.Property) +} + +inline void Property::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.name_){} + , decltype(_impl_.id_){0u} + , decltype(_impl_.type_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +Property::~Property() { + // @@protoc_insertion_point(destructor:gie.Property) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Property::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.name_.Destroy(); +} + +void Property::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Property::Clear() { +// @@protoc_insertion_point(message_clear_start:gie.Property) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.name_.ClearToEmpty(); + ::memset(&_impl_.id_, 0, static_cast( + reinterpret_cast(&_impl_.type_) - + reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.type_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Property::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint32 id = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string name = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "gie.Property.name")); + } else + goto handle_unusual; + continue; + // .gie.DataType type = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_type(static_cast<::gie::DataType>(val)); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Property::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:gie.Property) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 id = 1; + if (this->_internal_id() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); + } + + // string name = 2; + if (!this->_internal_name().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "gie.Property.name"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_name(), target); + } + + // .gie.DataType type = 3; + if (this->_internal_type() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 3, this->_internal_type(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:gie.Property) + return target; +} + +size_t Property::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:gie.Property) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string name = 2; + if (!this->_internal_name().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // uint32 id = 1; + if (this->_internal_id() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_id()); + } + + // .gie.DataType type = 3; + if (this->_internal_type() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Property::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Property::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Property::GetClassData() const { return &_class_data_; } + + +void Property::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:gie.Property) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (!from._internal_name().empty()) { + _this->_internal_set_name(from._internal_name()); + } + if (from._internal_id() != 0) { + _this->_internal_set_id(from._internal_id()); + } + if (from._internal_type() != 0) { + _this->_internal_set_type(from._internal_type()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Property::CopyFrom(const Property& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:gie.Property) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Property::IsInitialized() const { + return true; +} + +void Property::InternalSwap(Property* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Property, _impl_.type_) + + sizeof(Property::_impl_.type_) + - PROTOBUF_FIELD_OFFSET(Property, _impl_.id_)>( + reinterpret_cast(&_impl_.id_), + reinterpret_cast(&other->_impl_.id_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Property::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, + file_level_metadata_gie_5fschema_2eproto[5]); +} + +// =================================================================== + +class VertexType::_Internal { + public: +}; + +VertexType::VertexType(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:gie.VertexType) +} +VertexType::VertexType(const VertexType& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + VertexType* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.properties_){from._impl_.properties_} + , decltype(_impl_.primary_keys_){from._impl_.primary_keys_} + , decltype(_impl_.name_){} + , decltype(_impl_.id_){} + , decltype(_impl_.partition_strategy_){} + , decltype(_impl_.total_num_){} + , decltype(_impl_.property_partition_strategy_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_name().empty()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.id_, &from._impl_.id_, + static_cast(reinterpret_cast(&_impl_.property_partition_strategy_) - + reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.property_partition_strategy_)); + // @@protoc_insertion_point(copy_constructor:gie.VertexType) +} + +inline void VertexType::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.properties_){arena} + , decltype(_impl_.primary_keys_){arena} + , decltype(_impl_.name_){} + , decltype(_impl_.id_){0u} + , decltype(_impl_.partition_strategy_){0} + , decltype(_impl_.total_num_){int64_t{0}} + , decltype(_impl_.property_partition_strategy_){0} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +VertexType::~VertexType() { + // @@protoc_insertion_point(destructor:gie.VertexType) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void VertexType::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.properties_.~RepeatedPtrField(); + _impl_.primary_keys_.~RepeatedPtrField(); + _impl_.name_.Destroy(); +} + +void VertexType::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void VertexType::Clear() { +// @@protoc_insertion_point(message_clear_start:gie.VertexType) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.properties_.Clear(); + _impl_.primary_keys_.Clear(); + _impl_.name_.ClearToEmpty(); + ::memset(&_impl_.id_, 0, static_cast( + reinterpret_cast(&_impl_.property_partition_strategy_) - + reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.property_partition_strategy_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* VertexType::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint32 id = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string name = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "gie.VertexType.name")); + } else + goto handle_unusual; + continue; + // repeated .gie.Property properties = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_properties(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); + } else + goto handle_unusual; + continue; + // repeated string primary_keys = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_primary_keys(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "gie.VertexType.primary_keys")); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + } else + goto handle_unusual; + continue; + // .gie.VertexPartitionStrategy partition_strategy = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_partition_strategy(static_cast<::gie::VertexPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // .gie.PropertyPartitionStrategy property_partition_strategy = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); + } else + goto handle_unusual; + continue; + // int64 total_num = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { + _impl_.total_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* VertexType::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:gie.VertexType) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 id = 1; + if (this->_internal_id() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); + } + + // string name = 2; + if (!this->_internal_name().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "gie.VertexType.name"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_name(), target); + } + + // repeated .gie.Property properties = 3; + for (unsigned i = 0, + n = static_cast(this->_internal_properties_size()); i < n; i++) { + const auto& repfield = this->_internal_properties(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); + } + + // repeated string primary_keys = 4; + for (int i = 0, n = this->_internal_primary_keys_size(); i < n; i++) { + const auto& s = this->_internal_primary_keys(i); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s.data(), static_cast(s.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "gie.VertexType.primary_keys"); + target = stream->WriteString(4, s, target); + } + + // .gie.VertexPartitionStrategy partition_strategy = 5; + if (this->_internal_partition_strategy() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 5, this->_internal_partition_strategy(), target); + } + + // .gie.PropertyPartitionStrategy property_partition_strategy = 6; + if (this->_internal_property_partition_strategy() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteEnumToArray( + 6, this->_internal_property_partition_strategy(), target); + } + + // int64 total_num = 7; + if (this->_internal_total_num() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(7, this->_internal_total_num(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:gie.VertexType) + return target; +} + +size_t VertexType::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:gie.VertexType) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .gie.Property properties = 3; + total_size += 1UL * this->_internal_properties_size(); + for (const auto& msg : this->_impl_.properties_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // repeated string primary_keys = 4; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.primary_keys_.size()); + for (int i = 0, n = _impl_.primary_keys_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + _impl_.primary_keys_.Get(i)); + } + + // string name = 2; + if (!this->_internal_name().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // uint32 id = 1; + if (this->_internal_id() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_id()); + } + + // .gie.VertexPartitionStrategy partition_strategy = 5; + if (this->_internal_partition_strategy() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_partition_strategy()); + } + + // int64 total_num = 7; + if (this->_internal_total_num() != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_total_num()); + } + + // .gie.PropertyPartitionStrategy property_partition_strategy = 6; + if (this->_internal_property_partition_strategy() != 0) { + total_size += 1 + + ::_pbi::WireFormatLite::EnumSize(this->_internal_property_partition_strategy()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData VertexType::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + VertexType::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*VertexType::GetClassData() const { return &_class_data_; } + + +void VertexType::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:gie.VertexType) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.properties_.MergeFrom(from._impl_.properties_); + _this->_impl_.primary_keys_.MergeFrom(from._impl_.primary_keys_); + if (!from._internal_name().empty()) { + _this->_internal_set_name(from._internal_name()); + } + if (from._internal_id() != 0) { + _this->_internal_set_id(from._internal_id()); + } + if (from._internal_partition_strategy() != 0) { + _this->_internal_set_partition_strategy(from._internal_partition_strategy()); + } + if (from._internal_total_num() != 0) { + _this->_internal_set_total_num(from._internal_total_num()); + } + if (from._internal_property_partition_strategy() != 0) { + _this->_internal_set_property_partition_strategy(from._internal_property_partition_strategy()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void VertexType::CopyFrom(const VertexType& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:gie.VertexType) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool VertexType::IsInitialized() const { + return true; +} + +void VertexType::InternalSwap(VertexType* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.properties_.InternalSwap(&other->_impl_.properties_); + _impl_.primary_keys_.InternalSwap(&other->_impl_.primary_keys_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(VertexType, _impl_.property_partition_strategy_) + + sizeof(VertexType::_impl_.property_partition_strategy_) + - PROTOBUF_FIELD_OFFSET(VertexType, _impl_.id_)>( + reinterpret_cast(&_impl_.id_), + reinterpret_cast(&other->_impl_.id_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata VertexType::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, + file_level_metadata_gie_5fschema_2eproto[6]); +} + +// =================================================================== + +class EdgeType::_Internal { + public: +}; + +EdgeType::EdgeType(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:gie.EdgeType) +} +EdgeType::EdgeType(const EdgeType& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + EdgeType* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.properties_){from._impl_.properties_} + , decltype(_impl_.primary_keys_){from._impl_.primary_keys_} + , decltype(_impl_.src_dst_pairs_){from._impl_.src_dst_pairs_} + , decltype(_impl_.name_){} + , decltype(_impl_.total_num_){} + , decltype(_impl_.id_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (!from._internal_name().empty()) { + _this->_impl_.name_.Set(from._internal_name(), + _this->GetArenaForAllocation()); + } + ::memcpy(&_impl_.total_num_, &from._impl_.total_num_, + static_cast(reinterpret_cast(&_impl_.id_) - + reinterpret_cast(&_impl_.total_num_)) + sizeof(_impl_.id_)); + // @@protoc_insertion_point(copy_constructor:gie.EdgeType) +} + +inline void EdgeType::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.properties_){arena} + , decltype(_impl_.primary_keys_){arena} + , decltype(_impl_.src_dst_pairs_){arena} + , decltype(_impl_.name_){} + , decltype(_impl_.total_num_){int64_t{0}} + , decltype(_impl_.id_){0u} + , /*decltype(_impl_._cached_size_)*/{} + }; + _impl_.name_.InitDefault(); + #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + _impl_.name_.Set("", GetArenaForAllocation()); + #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +} + +EdgeType::~EdgeType() { + // @@protoc_insertion_point(destructor:gie.EdgeType) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void EdgeType::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.properties_.~RepeatedPtrField(); + _impl_.primary_keys_.~RepeatedPtrField(); + _impl_.src_dst_pairs_.~RepeatedPtrField(); + _impl_.name_.Destroy(); +} + +void EdgeType::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void EdgeType::Clear() { +// @@protoc_insertion_point(message_clear_start:gie.EdgeType) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.properties_.Clear(); + _impl_.primary_keys_.Clear(); + _impl_.src_dst_pairs_.Clear(); + _impl_.name_.ClearToEmpty(); + ::memset(&_impl_.total_num_, 0, static_cast( + reinterpret_cast(&_impl_.id_) - + reinterpret_cast(&_impl_.total_num_)) + sizeof(_impl_.id_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* EdgeType::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint32 id = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // string name = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + auto str = _internal_mutable_name(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "gie.EdgeType.name")); + } else + goto handle_unusual; + continue; + // repeated .gie.Property properties = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_properties(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); + } else + goto handle_unusual; + continue; + // repeated string primary_keys = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr -= 1; + do { + ptr += 1; + auto str = _internal_add_primary_keys(); + ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + CHK_(ptr); + CHK_(::_pbi::VerifyUTF8(str, "gie.EdgeType.primary_keys")); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); + } else + goto handle_unusual; + continue; + // repeated .gie.SrcDstPair src_dst_pairs = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_src_dst_pairs(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); + } else + goto handle_unusual; + continue; + // int64 total_num = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { + _impl_.total_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* EdgeType::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:gie.EdgeType) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 id = 1; + if (this->_internal_id() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); + } + + // string name = 2; + if (!this->_internal_name().empty()) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "gie.EdgeType.name"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_name(), target); + } + + // repeated .gie.Property properties = 3; + for (unsigned i = 0, + n = static_cast(this->_internal_properties_size()); i < n; i++) { + const auto& repfield = this->_internal_properties(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); + } + + // repeated string primary_keys = 4; + for (int i = 0, n = this->_internal_primary_keys_size(); i < n; i++) { + const auto& s = this->_internal_primary_keys(i); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + s.data(), static_cast(s.length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "gie.EdgeType.primary_keys"); + target = stream->WriteString(4, s, target); + } + + // repeated .gie.SrcDstPair src_dst_pairs = 5; + for (unsigned i = 0, + n = static_cast(this->_internal_src_dst_pairs_size()); i < n; i++) { + const auto& repfield = this->_internal_src_dst_pairs(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(5, repfield, repfield.GetCachedSize(), target, stream); + } + + // int64 total_num = 6; + if (this->_internal_total_num() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray(6, this->_internal_total_num(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:gie.EdgeType) + return target; +} + +size_t EdgeType::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:gie.EdgeType) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .gie.Property properties = 3; + total_size += 1UL * this->_internal_properties_size(); + for (const auto& msg : this->_impl_.properties_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // repeated string primary_keys = 4; + total_size += 1 * + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.primary_keys_.size()); + for (int i = 0, n = _impl_.primary_keys_.size(); i < n; i++) { + total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + _impl_.primary_keys_.Get(i)); + } + + // repeated .gie.SrcDstPair src_dst_pairs = 5; + total_size += 1UL * this->_internal_src_dst_pairs_size(); + for (const auto& msg : this->_impl_.src_dst_pairs_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // string name = 2; + if (!this->_internal_name().empty()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // int64 total_num = 6; + if (this->_internal_total_num() != 0) { + total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_total_num()); + } + + // uint32 id = 1; + if (this->_internal_id() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_id()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EdgeType::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + EdgeType::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EdgeType::GetClassData() const { return &_class_data_; } + + +void EdgeType::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:gie.EdgeType) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.properties_.MergeFrom(from._impl_.properties_); + _this->_impl_.primary_keys_.MergeFrom(from._impl_.primary_keys_); + _this->_impl_.src_dst_pairs_.MergeFrom(from._impl_.src_dst_pairs_); + if (!from._internal_name().empty()) { + _this->_internal_set_name(from._internal_name()); + } + if (from._internal_total_num() != 0) { + _this->_internal_set_total_num(from._internal_total_num()); + } + if (from._internal_id() != 0) { + _this->_internal_set_id(from._internal_id()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void EdgeType::CopyFrom(const EdgeType& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:gie.EdgeType) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EdgeType::IsInitialized() const { + return true; +} + +void EdgeType::InternalSwap(EdgeType* other) { + using std::swap; + auto* lhs_arena = GetArenaForAllocation(); + auto* rhs_arena = other->GetArenaForAllocation(); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.properties_.InternalSwap(&other->_impl_.properties_); + _impl_.primary_keys_.InternalSwap(&other->_impl_.primary_keys_); + _impl_.src_dst_pairs_.InternalSwap(&other->_impl_.src_dst_pairs_); + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( + &_impl_.name_, lhs_arena, + &other->_impl_.name_, rhs_arena + ); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(EdgeType, _impl_.id_) + + sizeof(EdgeType::_impl_.id_) + - PROTOBUF_FIELD_OFFSET(EdgeType, _impl_.total_num_)>( + reinterpret_cast(&_impl_.total_num_), + reinterpret_cast(&other->_impl_.total_num_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata EdgeType::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, + file_level_metadata_gie_5fschema_2eproto[7]); +} + +// =================================================================== + +class Statistics::_Internal { + public: +}; + +Statistics::Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:gie.Statistics) +} +Statistics::Statistics(const Statistics& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Statistics* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.num_vertices_){} + , decltype(_impl_.num_edges_){} + , decltype(_impl_.num_partitions_){} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&_impl_.num_vertices_, &from._impl_.num_vertices_, + static_cast(reinterpret_cast(&_impl_.num_partitions_) - + reinterpret_cast(&_impl_.num_vertices_)) + sizeof(_impl_.num_partitions_)); + // @@protoc_insertion_point(copy_constructor:gie.Statistics) +} + +inline void Statistics::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.num_vertices_){uint64_t{0u}} + , decltype(_impl_.num_edges_){uint64_t{0u}} + , decltype(_impl_.num_partitions_){0u} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +Statistics::~Statistics() { + // @@protoc_insertion_point(destructor:gie.Statistics) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Statistics::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +} + +void Statistics::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Statistics::Clear() { +// @@protoc_insertion_point(message_clear_start:gie.Statistics) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&_impl_.num_vertices_, 0, static_cast( + reinterpret_cast(&_impl_.num_partitions_) - + reinterpret_cast(&_impl_.num_vertices_)) + sizeof(_impl_.num_partitions_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Statistics::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // uint32 num_partitions = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { + _impl_.num_partitions_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // uint64 num_vertices = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { + _impl_.num_vertices_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // uint64 num_edges = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { + _impl_.num_edges_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Statistics::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:gie.Statistics) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 num_partitions = 1; + if (this->_internal_num_partitions() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_num_partitions(), target); + } + + // uint64 num_vertices = 2; + if (this->_internal_num_vertices() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_num_vertices(), target); + } + + // uint64 num_edges = 3; + if (this->_internal_num_edges() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_num_edges(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:gie.Statistics) + return target; +} + +size_t Statistics::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:gie.Statistics) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // uint64 num_vertices = 2; + if (this->_internal_num_vertices() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_num_vertices()); + } + + // uint64 num_edges = 3; + if (this->_internal_num_edges() != 0) { + total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_num_edges()); + } + + // uint32 num_partitions = 1; + if (this->_internal_num_partitions() != 0) { + total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_num_partitions()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Statistics::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Statistics::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Statistics::GetClassData() const { return &_class_data_; } + + +void Statistics::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:gie.Statistics) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + if (from._internal_num_vertices() != 0) { + _this->_internal_set_num_vertices(from._internal_num_vertices()); + } + if (from._internal_num_edges() != 0) { + _this->_internal_set_num_edges(from._internal_num_edges()); + } + if (from._internal_num_partitions() != 0) { + _this->_internal_set_num_partitions(from._internal_num_partitions()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Statistics::CopyFrom(const Statistics& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:gie.Statistics) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Statistics::IsInitialized() const { + return true; +} + +void Statistics::InternalSwap(Statistics* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Statistics, _impl_.num_partitions_) + + sizeof(Statistics::_impl_.num_partitions_) + - PROTOBUF_FIELD_OFFSET(Statistics, _impl_.num_vertices_)>( + reinterpret_cast(&_impl_.num_vertices_), + reinterpret_cast(&other->_impl_.num_vertices_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Statistics::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, + file_level_metadata_gie_5fschema_2eproto[8]); +} + +// =================================================================== + +class Schema::_Internal { + public: + static const ::gie::GraphPartitionStrategy& partition_strategy(const Schema* msg); + static const ::gie::Statistics& statistics(const Schema* msg); +}; + +const ::gie::GraphPartitionStrategy& +Schema::_Internal::partition_strategy(const Schema* msg) { + return *msg->_impl_.partition_strategy_; +} +const ::gie::Statistics& +Schema::_Internal::statistics(const Schema* msg) { + return *msg->_impl_.statistics_; +} +Schema::Schema(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned) + : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { + SharedCtor(arena, is_message_owned); + // @@protoc_insertion_point(arena_constructor:gie.Schema) +} +Schema::Schema(const Schema& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + Schema* const _this = this; (void)_this; + new (&_impl_) Impl_{ + decltype(_impl_.vertex_types_){from._impl_.vertex_types_} + , decltype(_impl_.edge_types_){from._impl_.edge_types_} + , decltype(_impl_.partition_strategy_){nullptr} + , decltype(_impl_.statistics_){nullptr} + , /*decltype(_impl_._cached_size_)*/{}}; + + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_partition_strategy()) { + _this->_impl_.partition_strategy_ = new ::gie::GraphPartitionStrategy(*from._impl_.partition_strategy_); + } + if (from._internal_has_statistics()) { + _this->_impl_.statistics_ = new ::gie::Statistics(*from._impl_.statistics_); + } + // @@protoc_insertion_point(copy_constructor:gie.Schema) +} + +inline void Schema::SharedCtor( + ::_pb::Arena* arena, bool is_message_owned) { + (void)arena; + (void)is_message_owned; + new (&_impl_) Impl_{ + decltype(_impl_.vertex_types_){arena} + , decltype(_impl_.edge_types_){arena} + , decltype(_impl_.partition_strategy_){nullptr} + , decltype(_impl_.statistics_){nullptr} + , /*decltype(_impl_._cached_size_)*/{} + }; +} + +Schema::~Schema() { + // @@protoc_insertion_point(destructor:gie.Schema) + if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { + (void)arena; + return; + } + SharedDtor(); +} + +inline void Schema::SharedDtor() { + GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); + _impl_.vertex_types_.~RepeatedPtrField(); + _impl_.edge_types_.~RepeatedPtrField(); + if (this != internal_default_instance()) delete _impl_.partition_strategy_; + if (this != internal_default_instance()) delete _impl_.statistics_; +} + +void Schema::SetCachedSize(int size) const { + _impl_._cached_size_.Set(size); +} + +void Schema::Clear() { +// @@protoc_insertion_point(message_clear_start:gie.Schema) + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.vertex_types_.Clear(); + _impl_.edge_types_.Clear(); + if (GetArenaForAllocation() == nullptr && _impl_.partition_strategy_ != nullptr) { + delete _impl_.partition_strategy_; + } + _impl_.partition_strategy_ = nullptr; + if (GetArenaForAllocation() == nullptr && _impl_.statistics_ != nullptr) { + delete _impl_.statistics_; + } + _impl_.statistics_ = nullptr; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* Schema::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + while (!ctx->Done(&ptr)) { + uint32_t tag; + ptr = ::_pbi::ReadTag(ptr, &tag); + switch (tag >> 3) { + // .gie.GraphPartitionStrategy partition_strategy = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_partition_strategy(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + // repeated .gie.VertexType vertex_types = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_vertex_types(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); + } else + goto handle_unusual; + continue; + // repeated .gie.EdgeType edge_types = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_edge_types(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); + } else + goto handle_unusual; + continue; + // .gie.Statistics statistics = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + ptr = ctx->ParseMessage(_internal_mutable_statistics(), ptr); + CHK_(ptr); + } else + goto handle_unusual; + continue; + default: + goto handle_unusual; + } // switch + handle_unusual: + if ((tag == 0) || ((tag & 7) == 4)) { + CHK_(ptr); + ctx->SetLastTag(tag); + goto message_done; + } + ptr = UnknownFieldParse( + tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + } // while +message_done: + return ptr; +failure: + ptr = nullptr; + goto message_done; +#undef CHK_ +} + +uint8_t* Schema::_InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:gie.Schema) + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + // .gie.GraphPartitionStrategy partition_strategy = 1; + if (this->_internal_has_partition_strategy()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(1, _Internal::partition_strategy(this), + _Internal::partition_strategy(this).GetCachedSize(), target, stream); + } + + // repeated .gie.VertexType vertex_types = 2; + for (unsigned i = 0, + n = static_cast(this->_internal_vertex_types_size()); i < n; i++) { + const auto& repfield = this->_internal_vertex_types(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); + } + + // repeated .gie.EdgeType edge_types = 3; + for (unsigned i = 0, + n = static_cast(this->_internal_edge_types_size()); i < n; i++) { + const auto& repfield = this->_internal_edge_types(i); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); + } + + // .gie.Statistics statistics = 4; + if (this->_internal_has_statistics()) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(4, _Internal::statistics(this), + _Internal::statistics(this).GetCachedSize(), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:gie.Schema) + return target; +} + +size_t Schema::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:gie.Schema) + size_t total_size = 0; + + uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .gie.VertexType vertex_types = 2; + total_size += 1UL * this->_internal_vertex_types_size(); + for (const auto& msg : this->_impl_.vertex_types_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // repeated .gie.EdgeType edge_types = 3; + total_size += 1UL * this->_internal_edge_types_size(); + for (const auto& msg : this->_impl_.edge_types_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // .gie.GraphPartitionStrategy partition_strategy = 1; + if (this->_internal_has_partition_strategy()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.partition_strategy_); + } + + // .gie.Statistics statistics = 4; + if (this->_internal_has_statistics()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *_impl_.statistics_); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Schema::_class_data_ = { + ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, + Schema::MergeImpl +}; +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Schema::GetClassData() const { return &_class_data_; } + + +void Schema::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:gie.Schema) + GOOGLE_DCHECK_NE(&from, _this); + uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_impl_.vertex_types_.MergeFrom(from._impl_.vertex_types_); + _this->_impl_.edge_types_.MergeFrom(from._impl_.edge_types_); + if (from._internal_has_partition_strategy()) { + _this->_internal_mutable_partition_strategy()->::gie::GraphPartitionStrategy::MergeFrom( + from._internal_partition_strategy()); + } + if (from._internal_has_statistics()) { + _this->_internal_mutable_statistics()->::gie::Statistics::MergeFrom( + from._internal_statistics()); + } + _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Schema::CopyFrom(const Schema& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:gie.Schema) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool Schema::IsInitialized() const { + return true; +} + +void Schema::InternalSwap(Schema* other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.vertex_types_.InternalSwap(&other->_impl_.vertex_types_); + _impl_.edge_types_.InternalSwap(&other->_impl_.edge_types_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(Schema, _impl_.statistics_) + + sizeof(Schema::_impl_.statistics_) + - PROTOBUF_FIELD_OFFSET(Schema, _impl_.partition_strategy_)>( + reinterpret_cast(&_impl_.partition_strategy_), + reinterpret_cast(&other->_impl_.partition_strategy_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata Schema::GetMetadata() const { + return ::_pbi::AssignDescriptors( + &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, + file_level_metadata_gie_5fschema_2eproto[9]); +} + +// @@protoc_insertion_point(namespace_scope) +} // namespace gie +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::gie::PropertyPartitionByEntityStrategy* +Arena::CreateMaybeMessage< ::gie::PropertyPartitionByEntityStrategy >(Arena* arena) { + return Arena::CreateMessageInternal< ::gie::PropertyPartitionByEntityStrategy >(arena); +} +template<> PROTOBUF_NOINLINE ::gie::PropertyPartitionByTypeStrategy* +Arena::CreateMaybeMessage< ::gie::PropertyPartitionByTypeStrategy >(Arena* arena) { + return Arena::CreateMessageInternal< ::gie::PropertyPartitionByTypeStrategy >(arena); +} +template<> PROTOBUF_NOINLINE ::gie::GraphPropertyPartitionStrategy* +Arena::CreateMaybeMessage< ::gie::GraphPropertyPartitionStrategy >(Arena* arena) { + return Arena::CreateMessageInternal< ::gie::GraphPropertyPartitionStrategy >(arena); +} +template<> PROTOBUF_NOINLINE ::gie::GraphPartitionStrategy* +Arena::CreateMaybeMessage< ::gie::GraphPartitionStrategy >(Arena* arena) { + return Arena::CreateMessageInternal< ::gie::GraphPartitionStrategy >(arena); +} +template<> PROTOBUF_NOINLINE ::gie::SrcDstPair* +Arena::CreateMaybeMessage< ::gie::SrcDstPair >(Arena* arena) { + return Arena::CreateMessageInternal< ::gie::SrcDstPair >(arena); +} +template<> PROTOBUF_NOINLINE ::gie::Property* +Arena::CreateMaybeMessage< ::gie::Property >(Arena* arena) { + return Arena::CreateMessageInternal< ::gie::Property >(arena); +} +template<> PROTOBUF_NOINLINE ::gie::VertexType* +Arena::CreateMaybeMessage< ::gie::VertexType >(Arena* arena) { + return Arena::CreateMessageInternal< ::gie::VertexType >(arena); +} +template<> PROTOBUF_NOINLINE ::gie::EdgeType* +Arena::CreateMaybeMessage< ::gie::EdgeType >(Arena* arena) { + return Arena::CreateMessageInternal< ::gie::EdgeType >(arena); +} +template<> PROTOBUF_NOINLINE ::gie::Statistics* +Arena::CreateMaybeMessage< ::gie::Statistics >(Arena* arena) { + return Arena::CreateMessageInternal< ::gie::Statistics >(arena); +} +template<> PROTOBUF_NOINLINE ::gie::Schema* +Arena::CreateMaybeMessage< ::gie::Schema >(Arena* arena) { + return Arena::CreateMessageInternal< ::gie::Schema >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/modules/graph/grin/src/proto/gie_schema.pb.h b/modules/graph/grin/src/proto/gie_schema.pb.h new file mode 100644 index 000000000..befb7f6d2 --- /dev/null +++ b/modules/graph/grin/src/proto/gie_schema.pb.h @@ -0,0 +1,3636 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: gie_schema.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_gie_5fschema_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_gie_5fschema_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3021000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_gie_5fschema_2eproto { + static const uint32_t offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_gie_5fschema_2eproto; +namespace gie { +class EdgeType; +struct EdgeTypeDefaultTypeInternal; +extern EdgeTypeDefaultTypeInternal _EdgeType_default_instance_; +class GraphPartitionStrategy; +struct GraphPartitionStrategyDefaultTypeInternal; +extern GraphPartitionStrategyDefaultTypeInternal _GraphPartitionStrategy_default_instance_; +class GraphPropertyPartitionStrategy; +struct GraphPropertyPartitionStrategyDefaultTypeInternal; +extern GraphPropertyPartitionStrategyDefaultTypeInternal _GraphPropertyPartitionStrategy_default_instance_; +class Property; +struct PropertyDefaultTypeInternal; +extern PropertyDefaultTypeInternal _Property_default_instance_; +class PropertyPartitionByEntityStrategy; +struct PropertyPartitionByEntityStrategyDefaultTypeInternal; +extern PropertyPartitionByEntityStrategyDefaultTypeInternal _PropertyPartitionByEntityStrategy_default_instance_; +class PropertyPartitionByTypeStrategy; +struct PropertyPartitionByTypeStrategyDefaultTypeInternal; +extern PropertyPartitionByTypeStrategyDefaultTypeInternal _PropertyPartitionByTypeStrategy_default_instance_; +class Schema; +struct SchemaDefaultTypeInternal; +extern SchemaDefaultTypeInternal _Schema_default_instance_; +class SrcDstPair; +struct SrcDstPairDefaultTypeInternal; +extern SrcDstPairDefaultTypeInternal _SrcDstPair_default_instance_; +class Statistics; +struct StatisticsDefaultTypeInternal; +extern StatisticsDefaultTypeInternal _Statistics_default_instance_; +class VertexType; +struct VertexTypeDefaultTypeInternal; +extern VertexTypeDefaultTypeInternal _VertexType_default_instance_; +} // namespace gie +PROTOBUF_NAMESPACE_OPEN +template<> ::gie::EdgeType* Arena::CreateMaybeMessage<::gie::EdgeType>(Arena*); +template<> ::gie::GraphPartitionStrategy* Arena::CreateMaybeMessage<::gie::GraphPartitionStrategy>(Arena*); +template<> ::gie::GraphPropertyPartitionStrategy* Arena::CreateMaybeMessage<::gie::GraphPropertyPartitionStrategy>(Arena*); +template<> ::gie::Property* Arena::CreateMaybeMessage<::gie::Property>(Arena*); +template<> ::gie::PropertyPartitionByEntityStrategy* Arena::CreateMaybeMessage<::gie::PropertyPartitionByEntityStrategy>(Arena*); +template<> ::gie::PropertyPartitionByTypeStrategy* Arena::CreateMaybeMessage<::gie::PropertyPartitionByTypeStrategy>(Arena*); +template<> ::gie::Schema* Arena::CreateMaybeMessage<::gie::Schema>(Arena*); +template<> ::gie::SrcDstPair* Arena::CreateMaybeMessage<::gie::SrcDstPair>(Arena*); +template<> ::gie::Statistics* Arena::CreateMaybeMessage<::gie::Statistics>(Arena*); +template<> ::gie::VertexType* Arena::CreateMaybeMessage<::gie::VertexType>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace gie { + +enum VertexPartitionStrategy : int { + VPS_UNDEFINED = 0, + VPS_ALL = 1, + VPS_ONE = 2, + VPS_FOLLOW_EDGE = 3, + VertexPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + VertexPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool VertexPartitionStrategy_IsValid(int value); +constexpr VertexPartitionStrategy VertexPartitionStrategy_MIN = VPS_UNDEFINED; +constexpr VertexPartitionStrategy VertexPartitionStrategy_MAX = VPS_FOLLOW_EDGE; +constexpr int VertexPartitionStrategy_ARRAYSIZE = VertexPartitionStrategy_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* VertexPartitionStrategy_descriptor(); +template +inline const std::string& VertexPartitionStrategy_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function VertexPartitionStrategy_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + VertexPartitionStrategy_descriptor(), enum_t_value); +} +inline bool VertexPartitionStrategy_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, VertexPartitionStrategy* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + VertexPartitionStrategy_descriptor(), name, value); +} +enum EdgePartitionStrategy : int { + EPS_UNDEFINED = 0, + EPS_ALL = 1, + EPS_ONE = 2, + EPS_FOLLOW_SRC = 3, + EPS_FOLLOW_DST = 4, + EPS_FOLLOW_BOTH = 5, + EdgePartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + EdgePartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool EdgePartitionStrategy_IsValid(int value); +constexpr EdgePartitionStrategy EdgePartitionStrategy_MIN = EPS_UNDEFINED; +constexpr EdgePartitionStrategy EdgePartitionStrategy_MAX = EPS_FOLLOW_BOTH; +constexpr int EdgePartitionStrategy_ARRAYSIZE = EdgePartitionStrategy_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdgePartitionStrategy_descriptor(); +template +inline const std::string& EdgePartitionStrategy_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function EdgePartitionStrategy_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + EdgePartitionStrategy_descriptor(), enum_t_value); +} +inline bool EdgePartitionStrategy_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, EdgePartitionStrategy* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + EdgePartitionStrategy_descriptor(), name, value); +} +enum PropertyPartitionStrategy : int { + PPS_UNDEFINED = 0, + PPS_MASTER = 1, + PPS_MASTER_MIRROR = 2, + PropertyPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + PropertyPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool PropertyPartitionStrategy_IsValid(int value); +constexpr PropertyPartitionStrategy PropertyPartitionStrategy_MIN = PPS_UNDEFINED; +constexpr PropertyPartitionStrategy PropertyPartitionStrategy_MAX = PPS_MASTER_MIRROR; +constexpr int PropertyPartitionStrategy_ARRAYSIZE = PropertyPartitionStrategy_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PropertyPartitionStrategy_descriptor(); +template +inline const std::string& PropertyPartitionStrategy_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function PropertyPartitionStrategy_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + PropertyPartitionStrategy_descriptor(), enum_t_value); +} +inline bool PropertyPartitionStrategy_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PropertyPartitionStrategy* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + PropertyPartitionStrategy_descriptor(), name, value); +} +enum GraphTopologyPartitionStrategy : int { + GPS_UNDEFINED = 0, + GPS_ALL_REPLICATE = 1, + GPS_EDGE_CUT_FOLLOW_BOTH = 2, + GPS_EDGE_CUT_FOLLOW_SRC = 3, + GPS_EDGE_CUT_FOLLOW_DST = 4, + GPS_VERTEX_CUT = 5, + GPS_HYBRID = 6, + GraphTopologyPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + GraphTopologyPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool GraphTopologyPartitionStrategy_IsValid(int value); +constexpr GraphTopologyPartitionStrategy GraphTopologyPartitionStrategy_MIN = GPS_UNDEFINED; +constexpr GraphTopologyPartitionStrategy GraphTopologyPartitionStrategy_MAX = GPS_HYBRID; +constexpr int GraphTopologyPartitionStrategy_ARRAYSIZE = GraphTopologyPartitionStrategy_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GraphTopologyPartitionStrategy_descriptor(); +template +inline const std::string& GraphTopologyPartitionStrategy_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function GraphTopologyPartitionStrategy_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + GraphTopologyPartitionStrategy_descriptor(), enum_t_value); +} +inline bool GraphTopologyPartitionStrategy_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GraphTopologyPartitionStrategy* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + GraphTopologyPartitionStrategy_descriptor(), name, value); +} +enum Relation : int { + REL_UNDEFINED = 0, + MANY_TO_MANY = 1, + MANY_TO_ONE = 2, + ONE_TO_MANY = 3, + ONE_TO_ONE = 4, + Relation_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + Relation_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool Relation_IsValid(int value); +constexpr Relation Relation_MIN = REL_UNDEFINED; +constexpr Relation Relation_MAX = ONE_TO_ONE; +constexpr int Relation_ARRAYSIZE = Relation_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Relation_descriptor(); +template +inline const std::string& Relation_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function Relation_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + Relation_descriptor(), enum_t_value); +} +inline bool Relation_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Relation* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + Relation_descriptor(), name, value); +} +enum DataType : int { + DT_UNKNOWN = 0, + DT_SIGNED_INT32 = 1, + DT_UNSIGNED_INT32 = 2, + DT_SIGNED_INT64 = 3, + DT_UNSIGNED_INT64 = 4, + DT_FLOAT = 5, + DT_DOUBLE = 6, + DT_STRING = 7, + DT_DATE = 8, + DT_TIME = 9, + DT_TIMESTAMP = 10, + DataType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), + DataType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() +}; +bool DataType_IsValid(int value); +constexpr DataType DataType_MIN = DT_UNKNOWN; +constexpr DataType DataType_MAX = DT_TIMESTAMP; +constexpr int DataType_ARRAYSIZE = DataType_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataType_descriptor(); +template +inline const std::string& DataType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function DataType_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + DataType_descriptor(), enum_t_value); +} +inline bool DataType_Parse( + ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataType* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + DataType_descriptor(), name, value); +} +// =================================================================== + +class PropertyPartitionByEntityStrategy final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.PropertyPartitionByEntityStrategy) */ { + public: + inline PropertyPartitionByEntityStrategy() : PropertyPartitionByEntityStrategy(nullptr) {} + ~PropertyPartitionByEntityStrategy() override; + explicit PROTOBUF_CONSTEXPR PropertyPartitionByEntityStrategy(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PropertyPartitionByEntityStrategy(const PropertyPartitionByEntityStrategy& from); + PropertyPartitionByEntityStrategy(PropertyPartitionByEntityStrategy&& from) noexcept + : PropertyPartitionByEntityStrategy() { + *this = ::std::move(from); + } + + inline PropertyPartitionByEntityStrategy& operator=(const PropertyPartitionByEntityStrategy& from) { + CopyFrom(from); + return *this; + } + inline PropertyPartitionByEntityStrategy& operator=(PropertyPartitionByEntityStrategy&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PropertyPartitionByEntityStrategy& default_instance() { + return *internal_default_instance(); + } + static inline const PropertyPartitionByEntityStrategy* internal_default_instance() { + return reinterpret_cast( + &_PropertyPartitionByEntityStrategy_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(PropertyPartitionByEntityStrategy& a, PropertyPartitionByEntityStrategy& b) { + a.Swap(&b); + } + inline void Swap(PropertyPartitionByEntityStrategy* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PropertyPartitionByEntityStrategy* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PropertyPartitionByEntityStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const PropertyPartitionByEntityStrategy& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const PropertyPartitionByEntityStrategy& from) { + PropertyPartitionByEntityStrategy::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PropertyPartitionByEntityStrategy* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "gie.PropertyPartitionByEntityStrategy"; + } + protected: + explicit PropertyPartitionByEntityStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kVertexPropertyPartitionStrategyFieldNumber = 1, + kEdgePropertyPartitionStrategyFieldNumber = 2, + }; + // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; + void clear_vertex_property_partition_strategy(); + ::gie::PropertyPartitionStrategy vertex_property_partition_strategy() const; + void set_vertex_property_partition_strategy(::gie::PropertyPartitionStrategy value); + private: + ::gie::PropertyPartitionStrategy _internal_vertex_property_partition_strategy() const; + void _internal_set_vertex_property_partition_strategy(::gie::PropertyPartitionStrategy value); + public: + + // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; + void clear_edge_property_partition_strategy(); + ::gie::PropertyPartitionStrategy edge_property_partition_strategy() const; + void set_edge_property_partition_strategy(::gie::PropertyPartitionStrategy value); + private: + ::gie::PropertyPartitionStrategy _internal_edge_property_partition_strategy() const; + void _internal_set_edge_property_partition_strategy(::gie::PropertyPartitionStrategy value); + public: + + // @@protoc_insertion_point(class_scope:gie.PropertyPartitionByEntityStrategy) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + int vertex_property_partition_strategy_; + int edge_property_partition_strategy_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gie_5fschema_2eproto; +}; +// ------------------------------------------------------------------- + +class PropertyPartitionByTypeStrategy final : + public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:gie.PropertyPartitionByTypeStrategy) */ { + public: + inline PropertyPartitionByTypeStrategy() : PropertyPartitionByTypeStrategy(nullptr) {} + explicit PROTOBUF_CONSTEXPR PropertyPartitionByTypeStrategy(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + PropertyPartitionByTypeStrategy(const PropertyPartitionByTypeStrategy& from); + PropertyPartitionByTypeStrategy(PropertyPartitionByTypeStrategy&& from) noexcept + : PropertyPartitionByTypeStrategy() { + *this = ::std::move(from); + } + + inline PropertyPartitionByTypeStrategy& operator=(const PropertyPartitionByTypeStrategy& from) { + CopyFrom(from); + return *this; + } + inline PropertyPartitionByTypeStrategy& operator=(PropertyPartitionByTypeStrategy&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const PropertyPartitionByTypeStrategy& default_instance() { + return *internal_default_instance(); + } + static inline const PropertyPartitionByTypeStrategy* internal_default_instance() { + return reinterpret_cast( + &_PropertyPartitionByTypeStrategy_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(PropertyPartitionByTypeStrategy& a, PropertyPartitionByTypeStrategy& b) { + a.Swap(&b); + } + inline void Swap(PropertyPartitionByTypeStrategy* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(PropertyPartitionByTypeStrategy* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + PropertyPartitionByTypeStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; + inline void CopyFrom(const PropertyPartitionByTypeStrategy& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); + } + using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; + void MergeFrom(const PropertyPartitionByTypeStrategy& from) { + ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); + } + public: + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "gie.PropertyPartitionByTypeStrategy"; + } + protected: + explicit PropertyPartitionByTypeStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // @@protoc_insertion_point(class_scope:gie.PropertyPartitionByTypeStrategy) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + }; + friend struct ::TableStruct_gie_5fschema_2eproto; +}; +// ------------------------------------------------------------------- + +class GraphPropertyPartitionStrategy final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.GraphPropertyPartitionStrategy) */ { + public: + inline GraphPropertyPartitionStrategy() : GraphPropertyPartitionStrategy(nullptr) {} + ~GraphPropertyPartitionStrategy() override; + explicit PROTOBUF_CONSTEXPR GraphPropertyPartitionStrategy(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + GraphPropertyPartitionStrategy(const GraphPropertyPartitionStrategy& from); + GraphPropertyPartitionStrategy(GraphPropertyPartitionStrategy&& from) noexcept + : GraphPropertyPartitionStrategy() { + *this = ::std::move(from); + } + + inline GraphPropertyPartitionStrategy& operator=(const GraphPropertyPartitionStrategy& from) { + CopyFrom(from); + return *this; + } + inline GraphPropertyPartitionStrategy& operator=(GraphPropertyPartitionStrategy&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GraphPropertyPartitionStrategy& default_instance() { + return *internal_default_instance(); + } + enum ItemCase { + kByEntity = 1, + kByType = 2, + ITEM_NOT_SET = 0, + }; + + static inline const GraphPropertyPartitionStrategy* internal_default_instance() { + return reinterpret_cast( + &_GraphPropertyPartitionStrategy_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(GraphPropertyPartitionStrategy& a, GraphPropertyPartitionStrategy& b) { + a.Swap(&b); + } + inline void Swap(GraphPropertyPartitionStrategy* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GraphPropertyPartitionStrategy* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + GraphPropertyPartitionStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GraphPropertyPartitionStrategy& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GraphPropertyPartitionStrategy& from) { + GraphPropertyPartitionStrategy::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphPropertyPartitionStrategy* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "gie.GraphPropertyPartitionStrategy"; + } + protected: + explicit GraphPropertyPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kByEntityFieldNumber = 1, + kByTypeFieldNumber = 2, + }; + // .gie.PropertyPartitionByEntityStrategy by_entity = 1; + bool has_by_entity() const; + private: + bool _internal_has_by_entity() const; + public: + void clear_by_entity(); + const ::gie::PropertyPartitionByEntityStrategy& by_entity() const; + PROTOBUF_NODISCARD ::gie::PropertyPartitionByEntityStrategy* release_by_entity(); + ::gie::PropertyPartitionByEntityStrategy* mutable_by_entity(); + void set_allocated_by_entity(::gie::PropertyPartitionByEntityStrategy* by_entity); + private: + const ::gie::PropertyPartitionByEntityStrategy& _internal_by_entity() const; + ::gie::PropertyPartitionByEntityStrategy* _internal_mutable_by_entity(); + public: + void unsafe_arena_set_allocated_by_entity( + ::gie::PropertyPartitionByEntityStrategy* by_entity); + ::gie::PropertyPartitionByEntityStrategy* unsafe_arena_release_by_entity(); + + // .gie.PropertyPartitionByTypeStrategy by_type = 2; + bool has_by_type() const; + private: + bool _internal_has_by_type() const; + public: + void clear_by_type(); + const ::gie::PropertyPartitionByTypeStrategy& by_type() const; + PROTOBUF_NODISCARD ::gie::PropertyPartitionByTypeStrategy* release_by_type(); + ::gie::PropertyPartitionByTypeStrategy* mutable_by_type(); + void set_allocated_by_type(::gie::PropertyPartitionByTypeStrategy* by_type); + private: + const ::gie::PropertyPartitionByTypeStrategy& _internal_by_type() const; + ::gie::PropertyPartitionByTypeStrategy* _internal_mutable_by_type(); + public: + void unsafe_arena_set_allocated_by_type( + ::gie::PropertyPartitionByTypeStrategy* by_type); + ::gie::PropertyPartitionByTypeStrategy* unsafe_arena_release_by_type(); + + void clear_item(); + ItemCase item_case() const; + // @@protoc_insertion_point(class_scope:gie.GraphPropertyPartitionStrategy) + private: + class _Internal; + void set_has_by_entity(); + void set_has_by_type(); + + inline bool has_item() const; + inline void clear_has_item(); + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + union ItemUnion { + constexpr ItemUnion() : _constinit_{} {} + ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; + ::gie::PropertyPartitionByEntityStrategy* by_entity_; + ::gie::PropertyPartitionByTypeStrategy* by_type_; + } item_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + uint32_t _oneof_case_[1]; + + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gie_5fschema_2eproto; +}; +// ------------------------------------------------------------------- + +class GraphPartitionStrategy final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.GraphPartitionStrategy) */ { + public: + inline GraphPartitionStrategy() : GraphPartitionStrategy(nullptr) {} + ~GraphPartitionStrategy() override; + explicit PROTOBUF_CONSTEXPR GraphPartitionStrategy(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + GraphPartitionStrategy(const GraphPartitionStrategy& from); + GraphPartitionStrategy(GraphPartitionStrategy&& from) noexcept + : GraphPartitionStrategy() { + *this = ::std::move(from); + } + + inline GraphPartitionStrategy& operator=(const GraphPartitionStrategy& from) { + CopyFrom(from); + return *this; + } + inline GraphPartitionStrategy& operator=(GraphPartitionStrategy&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const GraphPartitionStrategy& default_instance() { + return *internal_default_instance(); + } + static inline const GraphPartitionStrategy* internal_default_instance() { + return reinterpret_cast( + &_GraphPartitionStrategy_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(GraphPartitionStrategy& a, GraphPartitionStrategy& b) { + a.Swap(&b); + } + inline void Swap(GraphPartitionStrategy* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GraphPartitionStrategy* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + GraphPartitionStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const GraphPartitionStrategy& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const GraphPartitionStrategy& from) { + GraphPartitionStrategy::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GraphPartitionStrategy* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "gie.GraphPartitionStrategy"; + } + protected: + explicit GraphPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kPropertyFieldNumber = 2, + kTopologyFieldNumber = 1, + }; + // .gie.GraphPropertyPartitionStrategy property = 2; + bool has_property() const; + private: + bool _internal_has_property() const; + public: + void clear_property(); + const ::gie::GraphPropertyPartitionStrategy& property() const; + PROTOBUF_NODISCARD ::gie::GraphPropertyPartitionStrategy* release_property(); + ::gie::GraphPropertyPartitionStrategy* mutable_property(); + void set_allocated_property(::gie::GraphPropertyPartitionStrategy* property); + private: + const ::gie::GraphPropertyPartitionStrategy& _internal_property() const; + ::gie::GraphPropertyPartitionStrategy* _internal_mutable_property(); + public: + void unsafe_arena_set_allocated_property( + ::gie::GraphPropertyPartitionStrategy* property); + ::gie::GraphPropertyPartitionStrategy* unsafe_arena_release_property(); + + // .gie.GraphTopologyPartitionStrategy topology = 1; + void clear_topology(); + ::gie::GraphTopologyPartitionStrategy topology() const; + void set_topology(::gie::GraphTopologyPartitionStrategy value); + private: + ::gie::GraphTopologyPartitionStrategy _internal_topology() const; + void _internal_set_topology(::gie::GraphTopologyPartitionStrategy value); + public: + + // @@protoc_insertion_point(class_scope:gie.GraphPartitionStrategy) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::gie::GraphPropertyPartitionStrategy* property_; + int topology_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gie_5fschema_2eproto; +}; +// ------------------------------------------------------------------- + +class SrcDstPair final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.SrcDstPair) */ { + public: + inline SrcDstPair() : SrcDstPair(nullptr) {} + ~SrcDstPair() override; + explicit PROTOBUF_CONSTEXPR SrcDstPair(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + SrcDstPair(const SrcDstPair& from); + SrcDstPair(SrcDstPair&& from) noexcept + : SrcDstPair() { + *this = ::std::move(from); + } + + inline SrcDstPair& operator=(const SrcDstPair& from) { + CopyFrom(from); + return *this; + } + inline SrcDstPair& operator=(SrcDstPair&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const SrcDstPair& default_instance() { + return *internal_default_instance(); + } + static inline const SrcDstPair* internal_default_instance() { + return reinterpret_cast( + &_SrcDstPair_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(SrcDstPair& a, SrcDstPair& b) { + a.Swap(&b); + } + inline void Swap(SrcDstPair* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SrcDstPair* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + SrcDstPair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const SrcDstPair& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const SrcDstPair& from) { + SrcDstPair::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SrcDstPair* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "gie.SrcDstPair"; + } + protected: + explicit SrcDstPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kSrcTypeFieldNumber = 1, + kDstTypeFieldNumber = 2, + kPartitionStrategyFieldNumber = 3, + kPropertyPartitionStrategyFieldNumber = 4, + kRelationFieldNumber = 5, + }; + // string src_type = 1; + void clear_src_type(); + const std::string& src_type() const; + template + void set_src_type(ArgT0&& arg0, ArgT... args); + std::string* mutable_src_type(); + PROTOBUF_NODISCARD std::string* release_src_type(); + void set_allocated_src_type(std::string* src_type); + private: + const std::string& _internal_src_type() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_src_type(const std::string& value); + std::string* _internal_mutable_src_type(); + public: + + // string dst_type = 2; + void clear_dst_type(); + const std::string& dst_type() const; + template + void set_dst_type(ArgT0&& arg0, ArgT... args); + std::string* mutable_dst_type(); + PROTOBUF_NODISCARD std::string* release_dst_type(); + void set_allocated_dst_type(std::string* dst_type); + private: + const std::string& _internal_dst_type() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_dst_type(const std::string& value); + std::string* _internal_mutable_dst_type(); + public: + + // .gie.EdgePartitionStrategy partition_strategy = 3; + void clear_partition_strategy(); + ::gie::EdgePartitionStrategy partition_strategy() const; + void set_partition_strategy(::gie::EdgePartitionStrategy value); + private: + ::gie::EdgePartitionStrategy _internal_partition_strategy() const; + void _internal_set_partition_strategy(::gie::EdgePartitionStrategy value); + public: + + // .gie.PropertyPartitionStrategy property_partition_strategy = 4; + void clear_property_partition_strategy(); + ::gie::PropertyPartitionStrategy property_partition_strategy() const; + void set_property_partition_strategy(::gie::PropertyPartitionStrategy value); + private: + ::gie::PropertyPartitionStrategy _internal_property_partition_strategy() const; + void _internal_set_property_partition_strategy(::gie::PropertyPartitionStrategy value); + public: + + // .gie.Relation relation = 5; + void clear_relation(); + ::gie::Relation relation() const; + void set_relation(::gie::Relation value); + private: + ::gie::Relation _internal_relation() const; + void _internal_set_relation(::gie::Relation value); + public: + + // @@protoc_insertion_point(class_scope:gie.SrcDstPair) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr src_type_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr dst_type_; + int partition_strategy_; + int property_partition_strategy_; + int relation_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gie_5fschema_2eproto; +}; +// ------------------------------------------------------------------- + +class Property final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.Property) */ { + public: + inline Property() : Property(nullptr) {} + ~Property() override; + explicit PROTOBUF_CONSTEXPR Property(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Property(const Property& from); + Property(Property&& from) noexcept + : Property() { + *this = ::std::move(from); + } + + inline Property& operator=(const Property& from) { + CopyFrom(from); + return *this; + } + inline Property& operator=(Property&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Property& default_instance() { + return *internal_default_instance(); + } + static inline const Property* internal_default_instance() { + return reinterpret_cast( + &_Property_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + friend void swap(Property& a, Property& b) { + a.Swap(&b); + } + inline void Swap(Property* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Property* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Property* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Property& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Property& from) { + Property::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Property* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "gie.Property"; + } + protected: + explicit Property(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameFieldNumber = 2, + kIdFieldNumber = 1, + kTypeFieldNumber = 3, + }; + // string name = 2; + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // uint32 id = 1; + void clear_id(); + uint32_t id() const; + void set_id(uint32_t value); + private: + uint32_t _internal_id() const; + void _internal_set_id(uint32_t value); + public: + + // .gie.DataType type = 3; + void clear_type(); + ::gie::DataType type() const; + void set_type(::gie::DataType value); + private: + ::gie::DataType _internal_type() const; + void _internal_set_type(::gie::DataType value); + public: + + // @@protoc_insertion_point(class_scope:gie.Property) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + uint32_t id_; + int type_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gie_5fschema_2eproto; +}; +// ------------------------------------------------------------------- + +class VertexType final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.VertexType) */ { + public: + inline VertexType() : VertexType(nullptr) {} + ~VertexType() override; + explicit PROTOBUF_CONSTEXPR VertexType(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + VertexType(const VertexType& from); + VertexType(VertexType&& from) noexcept + : VertexType() { + *this = ::std::move(from); + } + + inline VertexType& operator=(const VertexType& from) { + CopyFrom(from); + return *this; + } + inline VertexType& operator=(VertexType&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const VertexType& default_instance() { + return *internal_default_instance(); + } + static inline const VertexType* internal_default_instance() { + return reinterpret_cast( + &_VertexType_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + friend void swap(VertexType& a, VertexType& b) { + a.Swap(&b); + } + inline void Swap(VertexType* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(VertexType* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + VertexType* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const VertexType& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const VertexType& from) { + VertexType::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(VertexType* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "gie.VertexType"; + } + protected: + explicit VertexType(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kPropertiesFieldNumber = 3, + kPrimaryKeysFieldNumber = 4, + kNameFieldNumber = 2, + kIdFieldNumber = 1, + kPartitionStrategyFieldNumber = 5, + kTotalNumFieldNumber = 7, + kPropertyPartitionStrategyFieldNumber = 6, + }; + // repeated .gie.Property properties = 3; + int properties_size() const; + private: + int _internal_properties_size() const; + public: + void clear_properties(); + ::gie::Property* mutable_properties(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >* + mutable_properties(); + private: + const ::gie::Property& _internal_properties(int index) const; + ::gie::Property* _internal_add_properties(); + public: + const ::gie::Property& properties(int index) const; + ::gie::Property* add_properties(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >& + properties() const; + + // repeated string primary_keys = 4; + int primary_keys_size() const; + private: + int _internal_primary_keys_size() const; + public: + void clear_primary_keys(); + const std::string& primary_keys(int index) const; + std::string* mutable_primary_keys(int index); + void set_primary_keys(int index, const std::string& value); + void set_primary_keys(int index, std::string&& value); + void set_primary_keys(int index, const char* value); + void set_primary_keys(int index, const char* value, size_t size); + std::string* add_primary_keys(); + void add_primary_keys(const std::string& value); + void add_primary_keys(std::string&& value); + void add_primary_keys(const char* value); + void add_primary_keys(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& primary_keys() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_primary_keys(); + private: + const std::string& _internal_primary_keys(int index) const; + std::string* _internal_add_primary_keys(); + public: + + // string name = 2; + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // uint32 id = 1; + void clear_id(); + uint32_t id() const; + void set_id(uint32_t value); + private: + uint32_t _internal_id() const; + void _internal_set_id(uint32_t value); + public: + + // .gie.VertexPartitionStrategy partition_strategy = 5; + void clear_partition_strategy(); + ::gie::VertexPartitionStrategy partition_strategy() const; + void set_partition_strategy(::gie::VertexPartitionStrategy value); + private: + ::gie::VertexPartitionStrategy _internal_partition_strategy() const; + void _internal_set_partition_strategy(::gie::VertexPartitionStrategy value); + public: + + // int64 total_num = 7; + void clear_total_num(); + int64_t total_num() const; + void set_total_num(int64_t value); + private: + int64_t _internal_total_num() const; + void _internal_set_total_num(int64_t value); + public: + + // .gie.PropertyPartitionStrategy property_partition_strategy = 6; + void clear_property_partition_strategy(); + ::gie::PropertyPartitionStrategy property_partition_strategy() const; + void set_property_partition_strategy(::gie::PropertyPartitionStrategy value); + private: + ::gie::PropertyPartitionStrategy _internal_property_partition_strategy() const; + void _internal_set_property_partition_strategy(::gie::PropertyPartitionStrategy value); + public: + + // @@protoc_insertion_point(class_scope:gie.VertexType) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property > properties_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField primary_keys_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + uint32_t id_; + int partition_strategy_; + int64_t total_num_; + int property_partition_strategy_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gie_5fschema_2eproto; +}; +// ------------------------------------------------------------------- + +class EdgeType final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.EdgeType) */ { + public: + inline EdgeType() : EdgeType(nullptr) {} + ~EdgeType() override; + explicit PROTOBUF_CONSTEXPR EdgeType(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + EdgeType(const EdgeType& from); + EdgeType(EdgeType&& from) noexcept + : EdgeType() { + *this = ::std::move(from); + } + + inline EdgeType& operator=(const EdgeType& from) { + CopyFrom(from); + return *this; + } + inline EdgeType& operator=(EdgeType&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const EdgeType& default_instance() { + return *internal_default_instance(); + } + static inline const EdgeType* internal_default_instance() { + return reinterpret_cast( + &_EdgeType_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + friend void swap(EdgeType& a, EdgeType& b) { + a.Swap(&b); + } + inline void Swap(EdgeType* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(EdgeType* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + EdgeType* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const EdgeType& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const EdgeType& from) { + EdgeType::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(EdgeType* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "gie.EdgeType"; + } + protected: + explicit EdgeType(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kPropertiesFieldNumber = 3, + kPrimaryKeysFieldNumber = 4, + kSrcDstPairsFieldNumber = 5, + kNameFieldNumber = 2, + kTotalNumFieldNumber = 6, + kIdFieldNumber = 1, + }; + // repeated .gie.Property properties = 3; + int properties_size() const; + private: + int _internal_properties_size() const; + public: + void clear_properties(); + ::gie::Property* mutable_properties(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >* + mutable_properties(); + private: + const ::gie::Property& _internal_properties(int index) const; + ::gie::Property* _internal_add_properties(); + public: + const ::gie::Property& properties(int index) const; + ::gie::Property* add_properties(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >& + properties() const; + + // repeated string primary_keys = 4; + int primary_keys_size() const; + private: + int _internal_primary_keys_size() const; + public: + void clear_primary_keys(); + const std::string& primary_keys(int index) const; + std::string* mutable_primary_keys(int index); + void set_primary_keys(int index, const std::string& value); + void set_primary_keys(int index, std::string&& value); + void set_primary_keys(int index, const char* value); + void set_primary_keys(int index, const char* value, size_t size); + std::string* add_primary_keys(); + void add_primary_keys(const std::string& value); + void add_primary_keys(std::string&& value); + void add_primary_keys(const char* value); + void add_primary_keys(const char* value, size_t size); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& primary_keys() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_primary_keys(); + private: + const std::string& _internal_primary_keys(int index) const; + std::string* _internal_add_primary_keys(); + public: + + // repeated .gie.SrcDstPair src_dst_pairs = 5; + int src_dst_pairs_size() const; + private: + int _internal_src_dst_pairs_size() const; + public: + void clear_src_dst_pairs(); + ::gie::SrcDstPair* mutable_src_dst_pairs(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair >* + mutable_src_dst_pairs(); + private: + const ::gie::SrcDstPair& _internal_src_dst_pairs(int index) const; + ::gie::SrcDstPair* _internal_add_src_dst_pairs(); + public: + const ::gie::SrcDstPair& src_dst_pairs(int index) const; + ::gie::SrcDstPair* add_src_dst_pairs(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair >& + src_dst_pairs() const; + + // string name = 2; + void clear_name(); + const std::string& name() const; + template + void set_name(ArgT0&& arg0, ArgT... args); + std::string* mutable_name(); + PROTOBUF_NODISCARD std::string* release_name(); + void set_allocated_name(std::string* name); + private: + const std::string& _internal_name() const; + inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // int64 total_num = 6; + void clear_total_num(); + int64_t total_num() const; + void set_total_num(int64_t value); + private: + int64_t _internal_total_num() const; + void _internal_set_total_num(int64_t value); + public: + + // uint32 id = 1; + void clear_id(); + uint32_t id() const; + void set_id(uint32_t value); + private: + uint32_t _internal_id() const; + void _internal_set_id(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:gie.EdgeType) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property > properties_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField primary_keys_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair > src_dst_pairs_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + int64_t total_num_; + uint32_t id_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gie_5fschema_2eproto; +}; +// ------------------------------------------------------------------- + +class Statistics final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.Statistics) */ { + public: + inline Statistics() : Statistics(nullptr) {} + ~Statistics() override; + explicit PROTOBUF_CONSTEXPR Statistics(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Statistics(const Statistics& from); + Statistics(Statistics&& from) noexcept + : Statistics() { + *this = ::std::move(from); + } + + inline Statistics& operator=(const Statistics& from) { + CopyFrom(from); + return *this; + } + inline Statistics& operator=(Statistics&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Statistics& default_instance() { + return *internal_default_instance(); + } + static inline const Statistics* internal_default_instance() { + return reinterpret_cast( + &_Statistics_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + friend void swap(Statistics& a, Statistics& b) { + a.Swap(&b); + } + inline void Swap(Statistics* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Statistics* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Statistics* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Statistics& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Statistics& from) { + Statistics::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Statistics* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "gie.Statistics"; + } + protected: + explicit Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNumVerticesFieldNumber = 2, + kNumEdgesFieldNumber = 3, + kNumPartitionsFieldNumber = 1, + }; + // uint64 num_vertices = 2; + void clear_num_vertices(); + uint64_t num_vertices() const; + void set_num_vertices(uint64_t value); + private: + uint64_t _internal_num_vertices() const; + void _internal_set_num_vertices(uint64_t value); + public: + + // uint64 num_edges = 3; + void clear_num_edges(); + uint64_t num_edges() const; + void set_num_edges(uint64_t value); + private: + uint64_t _internal_num_edges() const; + void _internal_set_num_edges(uint64_t value); + public: + + // uint32 num_partitions = 1; + void clear_num_partitions(); + uint32_t num_partitions() const; + void set_num_partitions(uint32_t value); + private: + uint32_t _internal_num_partitions() const; + void _internal_set_num_partitions(uint32_t value); + public: + + // @@protoc_insertion_point(class_scope:gie.Statistics) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + uint64_t num_vertices_; + uint64_t num_edges_; + uint32_t num_partitions_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gie_5fschema_2eproto; +}; +// ------------------------------------------------------------------- + +class Schema final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.Schema) */ { + public: + inline Schema() : Schema(nullptr) {} + ~Schema() override; + explicit PROTOBUF_CONSTEXPR Schema(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + + Schema(const Schema& from); + Schema(Schema&& from) noexcept + : Schema() { + *this = ::std::move(from); + } + + inline Schema& operator=(const Schema& from) { + CopyFrom(from); + return *this; + } + inline Schema& operator=(Schema&& from) noexcept { + if (this == &from) return *this; + if (GetOwningArena() == from.GetOwningArena() + #ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetOwningArena() != nullptr + #endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const Schema& default_instance() { + return *internal_default_instance(); + } + static inline const Schema* internal_default_instance() { + return reinterpret_cast( + &_Schema_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + friend void swap(Schema& a, Schema& b) { + a.Swap(&b); + } + inline void Swap(Schema* other) { + if (other == this) return; + #ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() != nullptr && + GetOwningArena() == other->GetOwningArena()) { + #else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetOwningArena() == other->GetOwningArena()) { + #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Schema* other) { + if (other == this) return; + GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + Schema* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); + } + using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const Schema& from); + using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; + void MergeFrom( const Schema& from) { + Schema::MergeImpl(*this, from); + } + private: + static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); + public: + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + uint8_t* _InternalSerialize( + uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); + void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(Schema* other); + + private: + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "gie.Schema"; + } + protected: + explicit Schema(::PROTOBUF_NAMESPACE_ID::Arena* arena, + bool is_message_owned = false); + public: + + static const ClassData _class_data_; + const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kVertexTypesFieldNumber = 2, + kEdgeTypesFieldNumber = 3, + kPartitionStrategyFieldNumber = 1, + kStatisticsFieldNumber = 4, + }; + // repeated .gie.VertexType vertex_types = 2; + int vertex_types_size() const; + private: + int _internal_vertex_types_size() const; + public: + void clear_vertex_types(); + ::gie::VertexType* mutable_vertex_types(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType >* + mutable_vertex_types(); + private: + const ::gie::VertexType& _internal_vertex_types(int index) const; + ::gie::VertexType* _internal_add_vertex_types(); + public: + const ::gie::VertexType& vertex_types(int index) const; + ::gie::VertexType* add_vertex_types(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType >& + vertex_types() const; + + // repeated .gie.EdgeType edge_types = 3; + int edge_types_size() const; + private: + int _internal_edge_types_size() const; + public: + void clear_edge_types(); + ::gie::EdgeType* mutable_edge_types(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType >* + mutable_edge_types(); + private: + const ::gie::EdgeType& _internal_edge_types(int index) const; + ::gie::EdgeType* _internal_add_edge_types(); + public: + const ::gie::EdgeType& edge_types(int index) const; + ::gie::EdgeType* add_edge_types(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType >& + edge_types() const; + + // .gie.GraphPartitionStrategy partition_strategy = 1; + bool has_partition_strategy() const; + private: + bool _internal_has_partition_strategy() const; + public: + void clear_partition_strategy(); + const ::gie::GraphPartitionStrategy& partition_strategy() const; + PROTOBUF_NODISCARD ::gie::GraphPartitionStrategy* release_partition_strategy(); + ::gie::GraphPartitionStrategy* mutable_partition_strategy(); + void set_allocated_partition_strategy(::gie::GraphPartitionStrategy* partition_strategy); + private: + const ::gie::GraphPartitionStrategy& _internal_partition_strategy() const; + ::gie::GraphPartitionStrategy* _internal_mutable_partition_strategy(); + public: + void unsafe_arena_set_allocated_partition_strategy( + ::gie::GraphPartitionStrategy* partition_strategy); + ::gie::GraphPartitionStrategy* unsafe_arena_release_partition_strategy(); + + // .gie.Statistics statistics = 4; + bool has_statistics() const; + private: + bool _internal_has_statistics() const; + public: + void clear_statistics(); + const ::gie::Statistics& statistics() const; + PROTOBUF_NODISCARD ::gie::Statistics* release_statistics(); + ::gie::Statistics* mutable_statistics(); + void set_allocated_statistics(::gie::Statistics* statistics); + private: + const ::gie::Statistics& _internal_statistics() const; + ::gie::Statistics* _internal_mutable_statistics(); + public: + void unsafe_arena_set_allocated_statistics( + ::gie::Statistics* statistics); + ::gie::Statistics* unsafe_arena_release_statistics(); + + // @@protoc_insertion_point(class_scope:gie.Schema) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + struct Impl_ { + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType > vertex_types_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType > edge_types_; + ::gie::GraphPartitionStrategy* partition_strategy_; + ::gie::Statistics* statistics_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_gie_5fschema_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// PropertyPartitionByEntityStrategy + +// .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; +inline void PropertyPartitionByEntityStrategy::clear_vertex_property_partition_strategy() { + _impl_.vertex_property_partition_strategy_ = 0; +} +inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::_internal_vertex_property_partition_strategy() const { + return static_cast< ::gie::PropertyPartitionStrategy >(_impl_.vertex_property_partition_strategy_); +} +inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::vertex_property_partition_strategy() const { + // @@protoc_insertion_point(field_get:gie.PropertyPartitionByEntityStrategy.vertex_property_partition_strategy) + return _internal_vertex_property_partition_strategy(); +} +inline void PropertyPartitionByEntityStrategy::_internal_set_vertex_property_partition_strategy(::gie::PropertyPartitionStrategy value) { + + _impl_.vertex_property_partition_strategy_ = value; +} +inline void PropertyPartitionByEntityStrategy::set_vertex_property_partition_strategy(::gie::PropertyPartitionStrategy value) { + _internal_set_vertex_property_partition_strategy(value); + // @@protoc_insertion_point(field_set:gie.PropertyPartitionByEntityStrategy.vertex_property_partition_strategy) +} + +// .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; +inline void PropertyPartitionByEntityStrategy::clear_edge_property_partition_strategy() { + _impl_.edge_property_partition_strategy_ = 0; +} +inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::_internal_edge_property_partition_strategy() const { + return static_cast< ::gie::PropertyPartitionStrategy >(_impl_.edge_property_partition_strategy_); +} +inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::edge_property_partition_strategy() const { + // @@protoc_insertion_point(field_get:gie.PropertyPartitionByEntityStrategy.edge_property_partition_strategy) + return _internal_edge_property_partition_strategy(); +} +inline void PropertyPartitionByEntityStrategy::_internal_set_edge_property_partition_strategy(::gie::PropertyPartitionStrategy value) { + + _impl_.edge_property_partition_strategy_ = value; +} +inline void PropertyPartitionByEntityStrategy::set_edge_property_partition_strategy(::gie::PropertyPartitionStrategy value) { + _internal_set_edge_property_partition_strategy(value); + // @@protoc_insertion_point(field_set:gie.PropertyPartitionByEntityStrategy.edge_property_partition_strategy) +} + +// ------------------------------------------------------------------- + +// PropertyPartitionByTypeStrategy + +// ------------------------------------------------------------------- + +// GraphPropertyPartitionStrategy + +// .gie.PropertyPartitionByEntityStrategy by_entity = 1; +inline bool GraphPropertyPartitionStrategy::_internal_has_by_entity() const { + return item_case() == kByEntity; +} +inline bool GraphPropertyPartitionStrategy::has_by_entity() const { + return _internal_has_by_entity(); +} +inline void GraphPropertyPartitionStrategy::set_has_by_entity() { + _impl_._oneof_case_[0] = kByEntity; +} +inline void GraphPropertyPartitionStrategy::clear_by_entity() { + if (_internal_has_by_entity()) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.item_.by_entity_; + } + clear_has_item(); + } +} +inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy::release_by_entity() { + // @@protoc_insertion_point(field_release:gie.GraphPropertyPartitionStrategy.by_entity) + if (_internal_has_by_entity()) { + clear_has_item(); + ::gie::PropertyPartitionByEntityStrategy* temp = _impl_.item_.by_entity_; + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + _impl_.item_.by_entity_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::gie::PropertyPartitionByEntityStrategy& GraphPropertyPartitionStrategy::_internal_by_entity() const { + return _internal_has_by_entity() + ? *_impl_.item_.by_entity_ + : reinterpret_cast< ::gie::PropertyPartitionByEntityStrategy&>(::gie::_PropertyPartitionByEntityStrategy_default_instance_); +} +inline const ::gie::PropertyPartitionByEntityStrategy& GraphPropertyPartitionStrategy::by_entity() const { + // @@protoc_insertion_point(field_get:gie.GraphPropertyPartitionStrategy.by_entity) + return _internal_by_entity(); +} +inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy::unsafe_arena_release_by_entity() { + // @@protoc_insertion_point(field_unsafe_arena_release:gie.GraphPropertyPartitionStrategy.by_entity) + if (_internal_has_by_entity()) { + clear_has_item(); + ::gie::PropertyPartitionByEntityStrategy* temp = _impl_.item_.by_entity_; + _impl_.item_.by_entity_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void GraphPropertyPartitionStrategy::unsafe_arena_set_allocated_by_entity(::gie::PropertyPartitionByEntityStrategy* by_entity) { + clear_item(); + if (by_entity) { + set_has_by_entity(); + _impl_.item_.by_entity_ = by_entity; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.GraphPropertyPartitionStrategy.by_entity) +} +inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy::_internal_mutable_by_entity() { + if (!_internal_has_by_entity()) { + clear_item(); + set_has_by_entity(); + _impl_.item_.by_entity_ = CreateMaybeMessage< ::gie::PropertyPartitionByEntityStrategy >(GetArenaForAllocation()); + } + return _impl_.item_.by_entity_; +} +inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy::mutable_by_entity() { + ::gie::PropertyPartitionByEntityStrategy* _msg = _internal_mutable_by_entity(); + // @@protoc_insertion_point(field_mutable:gie.GraphPropertyPartitionStrategy.by_entity) + return _msg; +} + +// .gie.PropertyPartitionByTypeStrategy by_type = 2; +inline bool GraphPropertyPartitionStrategy::_internal_has_by_type() const { + return item_case() == kByType; +} +inline bool GraphPropertyPartitionStrategy::has_by_type() const { + return _internal_has_by_type(); +} +inline void GraphPropertyPartitionStrategy::set_has_by_type() { + _impl_._oneof_case_[0] = kByType; +} +inline void GraphPropertyPartitionStrategy::clear_by_type() { + if (_internal_has_by_type()) { + if (GetArenaForAllocation() == nullptr) { + delete _impl_.item_.by_type_; + } + clear_has_item(); + } +} +inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::release_by_type() { + // @@protoc_insertion_point(field_release:gie.GraphPropertyPartitionStrategy.by_type) + if (_internal_has_by_type()) { + clear_has_item(); + ::gie::PropertyPartitionByTypeStrategy* temp = _impl_.item_.by_type_; + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + _impl_.item_.by_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline const ::gie::PropertyPartitionByTypeStrategy& GraphPropertyPartitionStrategy::_internal_by_type() const { + return _internal_has_by_type() + ? *_impl_.item_.by_type_ + : reinterpret_cast< ::gie::PropertyPartitionByTypeStrategy&>(::gie::_PropertyPartitionByTypeStrategy_default_instance_); +} +inline const ::gie::PropertyPartitionByTypeStrategy& GraphPropertyPartitionStrategy::by_type() const { + // @@protoc_insertion_point(field_get:gie.GraphPropertyPartitionStrategy.by_type) + return _internal_by_type(); +} +inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::unsafe_arena_release_by_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:gie.GraphPropertyPartitionStrategy.by_type) + if (_internal_has_by_type()) { + clear_has_item(); + ::gie::PropertyPartitionByTypeStrategy* temp = _impl_.item_.by_type_; + _impl_.item_.by_type_ = nullptr; + return temp; + } else { + return nullptr; + } +} +inline void GraphPropertyPartitionStrategy::unsafe_arena_set_allocated_by_type(::gie::PropertyPartitionByTypeStrategy* by_type) { + clear_item(); + if (by_type) { + set_has_by_type(); + _impl_.item_.by_type_ = by_type; + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.GraphPropertyPartitionStrategy.by_type) +} +inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::_internal_mutable_by_type() { + if (!_internal_has_by_type()) { + clear_item(); + set_has_by_type(); + _impl_.item_.by_type_ = CreateMaybeMessage< ::gie::PropertyPartitionByTypeStrategy >(GetArenaForAllocation()); + } + return _impl_.item_.by_type_; +} +inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::mutable_by_type() { + ::gie::PropertyPartitionByTypeStrategy* _msg = _internal_mutable_by_type(); + // @@protoc_insertion_point(field_mutable:gie.GraphPropertyPartitionStrategy.by_type) + return _msg; +} + +inline bool GraphPropertyPartitionStrategy::has_item() const { + return item_case() != ITEM_NOT_SET; +} +inline void GraphPropertyPartitionStrategy::clear_has_item() { + _impl_._oneof_case_[0] = ITEM_NOT_SET; +} +inline GraphPropertyPartitionStrategy::ItemCase GraphPropertyPartitionStrategy::item_case() const { + return GraphPropertyPartitionStrategy::ItemCase(_impl_._oneof_case_[0]); +} +// ------------------------------------------------------------------- + +// GraphPartitionStrategy + +// .gie.GraphTopologyPartitionStrategy topology = 1; +inline void GraphPartitionStrategy::clear_topology() { + _impl_.topology_ = 0; +} +inline ::gie::GraphTopologyPartitionStrategy GraphPartitionStrategy::_internal_topology() const { + return static_cast< ::gie::GraphTopologyPartitionStrategy >(_impl_.topology_); +} +inline ::gie::GraphTopologyPartitionStrategy GraphPartitionStrategy::topology() const { + // @@protoc_insertion_point(field_get:gie.GraphPartitionStrategy.topology) + return _internal_topology(); +} +inline void GraphPartitionStrategy::_internal_set_topology(::gie::GraphTopologyPartitionStrategy value) { + + _impl_.topology_ = value; +} +inline void GraphPartitionStrategy::set_topology(::gie::GraphTopologyPartitionStrategy value) { + _internal_set_topology(value); + // @@protoc_insertion_point(field_set:gie.GraphPartitionStrategy.topology) +} + +// .gie.GraphPropertyPartitionStrategy property = 2; +inline bool GraphPartitionStrategy::_internal_has_property() const { + return this != internal_default_instance() && _impl_.property_ != nullptr; +} +inline bool GraphPartitionStrategy::has_property() const { + return _internal_has_property(); +} +inline void GraphPartitionStrategy::clear_property() { + if (GetArenaForAllocation() == nullptr && _impl_.property_ != nullptr) { + delete _impl_.property_; + } + _impl_.property_ = nullptr; +} +inline const ::gie::GraphPropertyPartitionStrategy& GraphPartitionStrategy::_internal_property() const { + const ::gie::GraphPropertyPartitionStrategy* p = _impl_.property_; + return p != nullptr ? *p : reinterpret_cast( + ::gie::_GraphPropertyPartitionStrategy_default_instance_); +} +inline const ::gie::GraphPropertyPartitionStrategy& GraphPartitionStrategy::property() const { + // @@protoc_insertion_point(field_get:gie.GraphPartitionStrategy.property) + return _internal_property(); +} +inline void GraphPartitionStrategy::unsafe_arena_set_allocated_property( + ::gie::GraphPropertyPartitionStrategy* property) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.property_); + } + _impl_.property_ = property; + if (property) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.GraphPartitionStrategy.property) +} +inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::release_property() { + + ::gie::GraphPropertyPartitionStrategy* temp = _impl_.property_; + _impl_.property_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::unsafe_arena_release_property() { + // @@protoc_insertion_point(field_release:gie.GraphPartitionStrategy.property) + + ::gie::GraphPropertyPartitionStrategy* temp = _impl_.property_; + _impl_.property_ = nullptr; + return temp; +} +inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::_internal_mutable_property() { + + if (_impl_.property_ == nullptr) { + auto* p = CreateMaybeMessage<::gie::GraphPropertyPartitionStrategy>(GetArenaForAllocation()); + _impl_.property_ = p; + } + return _impl_.property_; +} +inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::mutable_property() { + ::gie::GraphPropertyPartitionStrategy* _msg = _internal_mutable_property(); + // @@protoc_insertion_point(field_mutable:gie.GraphPartitionStrategy.property) + return _msg; +} +inline void GraphPartitionStrategy::set_allocated_property(::gie::GraphPropertyPartitionStrategy* property) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.property_; + } + if (property) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(property); + if (message_arena != submessage_arena) { + property = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, property, submessage_arena); + } + + } else { + + } + _impl_.property_ = property; + // @@protoc_insertion_point(field_set_allocated:gie.GraphPartitionStrategy.property) +} + +// ------------------------------------------------------------------- + +// SrcDstPair + +// string src_type = 1; +inline void SrcDstPair::clear_src_type() { + _impl_.src_type_.ClearToEmpty(); +} +inline const std::string& SrcDstPair::src_type() const { + // @@protoc_insertion_point(field_get:gie.SrcDstPair.src_type) + return _internal_src_type(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void SrcDstPair::set_src_type(ArgT0&& arg0, ArgT... args) { + + _impl_.src_type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:gie.SrcDstPair.src_type) +} +inline std::string* SrcDstPair::mutable_src_type() { + std::string* _s = _internal_mutable_src_type(); + // @@protoc_insertion_point(field_mutable:gie.SrcDstPair.src_type) + return _s; +} +inline const std::string& SrcDstPair::_internal_src_type() const { + return _impl_.src_type_.Get(); +} +inline void SrcDstPair::_internal_set_src_type(const std::string& value) { + + _impl_.src_type_.Set(value, GetArenaForAllocation()); +} +inline std::string* SrcDstPair::_internal_mutable_src_type() { + + return _impl_.src_type_.Mutable(GetArenaForAllocation()); +} +inline std::string* SrcDstPair::release_src_type() { + // @@protoc_insertion_point(field_release:gie.SrcDstPair.src_type) + return _impl_.src_type_.Release(); +} +inline void SrcDstPair::set_allocated_src_type(std::string* src_type) { + if (src_type != nullptr) { + + } else { + + } + _impl_.src_type_.SetAllocated(src_type, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.src_type_.IsDefault()) { + _impl_.src_type_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:gie.SrcDstPair.src_type) +} + +// string dst_type = 2; +inline void SrcDstPair::clear_dst_type() { + _impl_.dst_type_.ClearToEmpty(); +} +inline const std::string& SrcDstPair::dst_type() const { + // @@protoc_insertion_point(field_get:gie.SrcDstPair.dst_type) + return _internal_dst_type(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void SrcDstPair::set_dst_type(ArgT0&& arg0, ArgT... args) { + + _impl_.dst_type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:gie.SrcDstPair.dst_type) +} +inline std::string* SrcDstPair::mutable_dst_type() { + std::string* _s = _internal_mutable_dst_type(); + // @@protoc_insertion_point(field_mutable:gie.SrcDstPair.dst_type) + return _s; +} +inline const std::string& SrcDstPair::_internal_dst_type() const { + return _impl_.dst_type_.Get(); +} +inline void SrcDstPair::_internal_set_dst_type(const std::string& value) { + + _impl_.dst_type_.Set(value, GetArenaForAllocation()); +} +inline std::string* SrcDstPair::_internal_mutable_dst_type() { + + return _impl_.dst_type_.Mutable(GetArenaForAllocation()); +} +inline std::string* SrcDstPair::release_dst_type() { + // @@protoc_insertion_point(field_release:gie.SrcDstPair.dst_type) + return _impl_.dst_type_.Release(); +} +inline void SrcDstPair::set_allocated_dst_type(std::string* dst_type) { + if (dst_type != nullptr) { + + } else { + + } + _impl_.dst_type_.SetAllocated(dst_type, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.dst_type_.IsDefault()) { + _impl_.dst_type_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:gie.SrcDstPair.dst_type) +} + +// .gie.EdgePartitionStrategy partition_strategy = 3; +inline void SrcDstPair::clear_partition_strategy() { + _impl_.partition_strategy_ = 0; +} +inline ::gie::EdgePartitionStrategy SrcDstPair::_internal_partition_strategy() const { + return static_cast< ::gie::EdgePartitionStrategy >(_impl_.partition_strategy_); +} +inline ::gie::EdgePartitionStrategy SrcDstPair::partition_strategy() const { + // @@protoc_insertion_point(field_get:gie.SrcDstPair.partition_strategy) + return _internal_partition_strategy(); +} +inline void SrcDstPair::_internal_set_partition_strategy(::gie::EdgePartitionStrategy value) { + + _impl_.partition_strategy_ = value; +} +inline void SrcDstPair::set_partition_strategy(::gie::EdgePartitionStrategy value) { + _internal_set_partition_strategy(value); + // @@protoc_insertion_point(field_set:gie.SrcDstPair.partition_strategy) +} + +// .gie.PropertyPartitionStrategy property_partition_strategy = 4; +inline void SrcDstPair::clear_property_partition_strategy() { + _impl_.property_partition_strategy_ = 0; +} +inline ::gie::PropertyPartitionStrategy SrcDstPair::_internal_property_partition_strategy() const { + return static_cast< ::gie::PropertyPartitionStrategy >(_impl_.property_partition_strategy_); +} +inline ::gie::PropertyPartitionStrategy SrcDstPair::property_partition_strategy() const { + // @@protoc_insertion_point(field_get:gie.SrcDstPair.property_partition_strategy) + return _internal_property_partition_strategy(); +} +inline void SrcDstPair::_internal_set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { + + _impl_.property_partition_strategy_ = value; +} +inline void SrcDstPair::set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { + _internal_set_property_partition_strategy(value); + // @@protoc_insertion_point(field_set:gie.SrcDstPair.property_partition_strategy) +} + +// .gie.Relation relation = 5; +inline void SrcDstPair::clear_relation() { + _impl_.relation_ = 0; +} +inline ::gie::Relation SrcDstPair::_internal_relation() const { + return static_cast< ::gie::Relation >(_impl_.relation_); +} +inline ::gie::Relation SrcDstPair::relation() const { + // @@protoc_insertion_point(field_get:gie.SrcDstPair.relation) + return _internal_relation(); +} +inline void SrcDstPair::_internal_set_relation(::gie::Relation value) { + + _impl_.relation_ = value; +} +inline void SrcDstPair::set_relation(::gie::Relation value) { + _internal_set_relation(value); + // @@protoc_insertion_point(field_set:gie.SrcDstPair.relation) +} + +// ------------------------------------------------------------------- + +// Property + +// uint32 id = 1; +inline void Property::clear_id() { + _impl_.id_ = 0u; +} +inline uint32_t Property::_internal_id() const { + return _impl_.id_; +} +inline uint32_t Property::id() const { + // @@protoc_insertion_point(field_get:gie.Property.id) + return _internal_id(); +} +inline void Property::_internal_set_id(uint32_t value) { + + _impl_.id_ = value; +} +inline void Property::set_id(uint32_t value) { + _internal_set_id(value); + // @@protoc_insertion_point(field_set:gie.Property.id) +} + +// string name = 2; +inline void Property::clear_name() { + _impl_.name_.ClearToEmpty(); +} +inline const std::string& Property::name() const { + // @@protoc_insertion_point(field_get:gie.Property.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void Property::set_name(ArgT0&& arg0, ArgT... args) { + + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:gie.Property.name) +} +inline std::string* Property::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:gie.Property.name) + return _s; +} +inline const std::string& Property::_internal_name() const { + return _impl_.name_.Get(); +} +inline void Property::_internal_set_name(const std::string& value) { + + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* Property::_internal_mutable_name() { + + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* Property::release_name() { + // @@protoc_insertion_point(field_release:gie.Property.name) + return _impl_.name_.Release(); +} +inline void Property::set_allocated_name(std::string* name) { + if (name != nullptr) { + + } else { + + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:gie.Property.name) +} + +// .gie.DataType type = 3; +inline void Property::clear_type() { + _impl_.type_ = 0; +} +inline ::gie::DataType Property::_internal_type() const { + return static_cast< ::gie::DataType >(_impl_.type_); +} +inline ::gie::DataType Property::type() const { + // @@protoc_insertion_point(field_get:gie.Property.type) + return _internal_type(); +} +inline void Property::_internal_set_type(::gie::DataType value) { + + _impl_.type_ = value; +} +inline void Property::set_type(::gie::DataType value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:gie.Property.type) +} + +// ------------------------------------------------------------------- + +// VertexType + +// uint32 id = 1; +inline void VertexType::clear_id() { + _impl_.id_ = 0u; +} +inline uint32_t VertexType::_internal_id() const { + return _impl_.id_; +} +inline uint32_t VertexType::id() const { + // @@protoc_insertion_point(field_get:gie.VertexType.id) + return _internal_id(); +} +inline void VertexType::_internal_set_id(uint32_t value) { + + _impl_.id_ = value; +} +inline void VertexType::set_id(uint32_t value) { + _internal_set_id(value); + // @@protoc_insertion_point(field_set:gie.VertexType.id) +} + +// string name = 2; +inline void VertexType::clear_name() { + _impl_.name_.ClearToEmpty(); +} +inline const std::string& VertexType::name() const { + // @@protoc_insertion_point(field_get:gie.VertexType.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void VertexType::set_name(ArgT0&& arg0, ArgT... args) { + + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:gie.VertexType.name) +} +inline std::string* VertexType::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:gie.VertexType.name) + return _s; +} +inline const std::string& VertexType::_internal_name() const { + return _impl_.name_.Get(); +} +inline void VertexType::_internal_set_name(const std::string& value) { + + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* VertexType::_internal_mutable_name() { + + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* VertexType::release_name() { + // @@protoc_insertion_point(field_release:gie.VertexType.name) + return _impl_.name_.Release(); +} +inline void VertexType::set_allocated_name(std::string* name) { + if (name != nullptr) { + + } else { + + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:gie.VertexType.name) +} + +// repeated .gie.Property properties = 3; +inline int VertexType::_internal_properties_size() const { + return _impl_.properties_.size(); +} +inline int VertexType::properties_size() const { + return _internal_properties_size(); +} +inline void VertexType::clear_properties() { + _impl_.properties_.Clear(); +} +inline ::gie::Property* VertexType::mutable_properties(int index) { + // @@protoc_insertion_point(field_mutable:gie.VertexType.properties) + return _impl_.properties_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >* +VertexType::mutable_properties() { + // @@protoc_insertion_point(field_mutable_list:gie.VertexType.properties) + return &_impl_.properties_; +} +inline const ::gie::Property& VertexType::_internal_properties(int index) const { + return _impl_.properties_.Get(index); +} +inline const ::gie::Property& VertexType::properties(int index) const { + // @@protoc_insertion_point(field_get:gie.VertexType.properties) + return _internal_properties(index); +} +inline ::gie::Property* VertexType::_internal_add_properties() { + return _impl_.properties_.Add(); +} +inline ::gie::Property* VertexType::add_properties() { + ::gie::Property* _add = _internal_add_properties(); + // @@protoc_insertion_point(field_add:gie.VertexType.properties) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >& +VertexType::properties() const { + // @@protoc_insertion_point(field_list:gie.VertexType.properties) + return _impl_.properties_; +} + +// repeated string primary_keys = 4; +inline int VertexType::_internal_primary_keys_size() const { + return _impl_.primary_keys_.size(); +} +inline int VertexType::primary_keys_size() const { + return _internal_primary_keys_size(); +} +inline void VertexType::clear_primary_keys() { + _impl_.primary_keys_.Clear(); +} +inline std::string* VertexType::add_primary_keys() { + std::string* _s = _internal_add_primary_keys(); + // @@protoc_insertion_point(field_add_mutable:gie.VertexType.primary_keys) + return _s; +} +inline const std::string& VertexType::_internal_primary_keys(int index) const { + return _impl_.primary_keys_.Get(index); +} +inline const std::string& VertexType::primary_keys(int index) const { + // @@protoc_insertion_point(field_get:gie.VertexType.primary_keys) + return _internal_primary_keys(index); +} +inline std::string* VertexType::mutable_primary_keys(int index) { + // @@protoc_insertion_point(field_mutable:gie.VertexType.primary_keys) + return _impl_.primary_keys_.Mutable(index); +} +inline void VertexType::set_primary_keys(int index, const std::string& value) { + _impl_.primary_keys_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:gie.VertexType.primary_keys) +} +inline void VertexType::set_primary_keys(int index, std::string&& value) { + _impl_.primary_keys_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:gie.VertexType.primary_keys) +} +inline void VertexType::set_primary_keys(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.primary_keys_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:gie.VertexType.primary_keys) +} +inline void VertexType::set_primary_keys(int index, const char* value, size_t size) { + _impl_.primary_keys_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:gie.VertexType.primary_keys) +} +inline std::string* VertexType::_internal_add_primary_keys() { + return _impl_.primary_keys_.Add(); +} +inline void VertexType::add_primary_keys(const std::string& value) { + _impl_.primary_keys_.Add()->assign(value); + // @@protoc_insertion_point(field_add:gie.VertexType.primary_keys) +} +inline void VertexType::add_primary_keys(std::string&& value) { + _impl_.primary_keys_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:gie.VertexType.primary_keys) +} +inline void VertexType::add_primary_keys(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.primary_keys_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:gie.VertexType.primary_keys) +} +inline void VertexType::add_primary_keys(const char* value, size_t size) { + _impl_.primary_keys_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:gie.VertexType.primary_keys) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +VertexType::primary_keys() const { + // @@protoc_insertion_point(field_list:gie.VertexType.primary_keys) + return _impl_.primary_keys_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +VertexType::mutable_primary_keys() { + // @@protoc_insertion_point(field_mutable_list:gie.VertexType.primary_keys) + return &_impl_.primary_keys_; +} + +// .gie.VertexPartitionStrategy partition_strategy = 5; +inline void VertexType::clear_partition_strategy() { + _impl_.partition_strategy_ = 0; +} +inline ::gie::VertexPartitionStrategy VertexType::_internal_partition_strategy() const { + return static_cast< ::gie::VertexPartitionStrategy >(_impl_.partition_strategy_); +} +inline ::gie::VertexPartitionStrategy VertexType::partition_strategy() const { + // @@protoc_insertion_point(field_get:gie.VertexType.partition_strategy) + return _internal_partition_strategy(); +} +inline void VertexType::_internal_set_partition_strategy(::gie::VertexPartitionStrategy value) { + + _impl_.partition_strategy_ = value; +} +inline void VertexType::set_partition_strategy(::gie::VertexPartitionStrategy value) { + _internal_set_partition_strategy(value); + // @@protoc_insertion_point(field_set:gie.VertexType.partition_strategy) +} + +// .gie.PropertyPartitionStrategy property_partition_strategy = 6; +inline void VertexType::clear_property_partition_strategy() { + _impl_.property_partition_strategy_ = 0; +} +inline ::gie::PropertyPartitionStrategy VertexType::_internal_property_partition_strategy() const { + return static_cast< ::gie::PropertyPartitionStrategy >(_impl_.property_partition_strategy_); +} +inline ::gie::PropertyPartitionStrategy VertexType::property_partition_strategy() const { + // @@protoc_insertion_point(field_get:gie.VertexType.property_partition_strategy) + return _internal_property_partition_strategy(); +} +inline void VertexType::_internal_set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { + + _impl_.property_partition_strategy_ = value; +} +inline void VertexType::set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { + _internal_set_property_partition_strategy(value); + // @@protoc_insertion_point(field_set:gie.VertexType.property_partition_strategy) +} + +// int64 total_num = 7; +inline void VertexType::clear_total_num() { + _impl_.total_num_ = int64_t{0}; +} +inline int64_t VertexType::_internal_total_num() const { + return _impl_.total_num_; +} +inline int64_t VertexType::total_num() const { + // @@protoc_insertion_point(field_get:gie.VertexType.total_num) + return _internal_total_num(); +} +inline void VertexType::_internal_set_total_num(int64_t value) { + + _impl_.total_num_ = value; +} +inline void VertexType::set_total_num(int64_t value) { + _internal_set_total_num(value); + // @@protoc_insertion_point(field_set:gie.VertexType.total_num) +} + +// ------------------------------------------------------------------- + +// EdgeType + +// uint32 id = 1; +inline void EdgeType::clear_id() { + _impl_.id_ = 0u; +} +inline uint32_t EdgeType::_internal_id() const { + return _impl_.id_; +} +inline uint32_t EdgeType::id() const { + // @@protoc_insertion_point(field_get:gie.EdgeType.id) + return _internal_id(); +} +inline void EdgeType::_internal_set_id(uint32_t value) { + + _impl_.id_ = value; +} +inline void EdgeType::set_id(uint32_t value) { + _internal_set_id(value); + // @@protoc_insertion_point(field_set:gie.EdgeType.id) +} + +// string name = 2; +inline void EdgeType::clear_name() { + _impl_.name_.ClearToEmpty(); +} +inline const std::string& EdgeType::name() const { + // @@protoc_insertion_point(field_get:gie.EdgeType.name) + return _internal_name(); +} +template +inline PROTOBUF_ALWAYS_INLINE +void EdgeType::set_name(ArgT0&& arg0, ArgT... args) { + + _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); + // @@protoc_insertion_point(field_set:gie.EdgeType.name) +} +inline std::string* EdgeType::mutable_name() { + std::string* _s = _internal_mutable_name(); + // @@protoc_insertion_point(field_mutable:gie.EdgeType.name) + return _s; +} +inline const std::string& EdgeType::_internal_name() const { + return _impl_.name_.Get(); +} +inline void EdgeType::_internal_set_name(const std::string& value) { + + _impl_.name_.Set(value, GetArenaForAllocation()); +} +inline std::string* EdgeType::_internal_mutable_name() { + + return _impl_.name_.Mutable(GetArenaForAllocation()); +} +inline std::string* EdgeType::release_name() { + // @@protoc_insertion_point(field_release:gie.EdgeType.name) + return _impl_.name_.Release(); +} +inline void EdgeType::set_allocated_name(std::string* name) { + if (name != nullptr) { + + } else { + + } + _impl_.name_.SetAllocated(name, GetArenaForAllocation()); +#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING + if (_impl_.name_.IsDefault()) { + _impl_.name_.Set("", GetArenaForAllocation()); + } +#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + // @@protoc_insertion_point(field_set_allocated:gie.EdgeType.name) +} + +// repeated .gie.Property properties = 3; +inline int EdgeType::_internal_properties_size() const { + return _impl_.properties_.size(); +} +inline int EdgeType::properties_size() const { + return _internal_properties_size(); +} +inline void EdgeType::clear_properties() { + _impl_.properties_.Clear(); +} +inline ::gie::Property* EdgeType::mutable_properties(int index) { + // @@protoc_insertion_point(field_mutable:gie.EdgeType.properties) + return _impl_.properties_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >* +EdgeType::mutable_properties() { + // @@protoc_insertion_point(field_mutable_list:gie.EdgeType.properties) + return &_impl_.properties_; +} +inline const ::gie::Property& EdgeType::_internal_properties(int index) const { + return _impl_.properties_.Get(index); +} +inline const ::gie::Property& EdgeType::properties(int index) const { + // @@protoc_insertion_point(field_get:gie.EdgeType.properties) + return _internal_properties(index); +} +inline ::gie::Property* EdgeType::_internal_add_properties() { + return _impl_.properties_.Add(); +} +inline ::gie::Property* EdgeType::add_properties() { + ::gie::Property* _add = _internal_add_properties(); + // @@protoc_insertion_point(field_add:gie.EdgeType.properties) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >& +EdgeType::properties() const { + // @@protoc_insertion_point(field_list:gie.EdgeType.properties) + return _impl_.properties_; +} + +// repeated string primary_keys = 4; +inline int EdgeType::_internal_primary_keys_size() const { + return _impl_.primary_keys_.size(); +} +inline int EdgeType::primary_keys_size() const { + return _internal_primary_keys_size(); +} +inline void EdgeType::clear_primary_keys() { + _impl_.primary_keys_.Clear(); +} +inline std::string* EdgeType::add_primary_keys() { + std::string* _s = _internal_add_primary_keys(); + // @@protoc_insertion_point(field_add_mutable:gie.EdgeType.primary_keys) + return _s; +} +inline const std::string& EdgeType::_internal_primary_keys(int index) const { + return _impl_.primary_keys_.Get(index); +} +inline const std::string& EdgeType::primary_keys(int index) const { + // @@protoc_insertion_point(field_get:gie.EdgeType.primary_keys) + return _internal_primary_keys(index); +} +inline std::string* EdgeType::mutable_primary_keys(int index) { + // @@protoc_insertion_point(field_mutable:gie.EdgeType.primary_keys) + return _impl_.primary_keys_.Mutable(index); +} +inline void EdgeType::set_primary_keys(int index, const std::string& value) { + _impl_.primary_keys_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set:gie.EdgeType.primary_keys) +} +inline void EdgeType::set_primary_keys(int index, std::string&& value) { + _impl_.primary_keys_.Mutable(index)->assign(std::move(value)); + // @@protoc_insertion_point(field_set:gie.EdgeType.primary_keys) +} +inline void EdgeType::set_primary_keys(int index, const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.primary_keys_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:gie.EdgeType.primary_keys) +} +inline void EdgeType::set_primary_keys(int index, const char* value, size_t size) { + _impl_.primary_keys_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:gie.EdgeType.primary_keys) +} +inline std::string* EdgeType::_internal_add_primary_keys() { + return _impl_.primary_keys_.Add(); +} +inline void EdgeType::add_primary_keys(const std::string& value) { + _impl_.primary_keys_.Add()->assign(value); + // @@protoc_insertion_point(field_add:gie.EdgeType.primary_keys) +} +inline void EdgeType::add_primary_keys(std::string&& value) { + _impl_.primary_keys_.Add(std::move(value)); + // @@protoc_insertion_point(field_add:gie.EdgeType.primary_keys) +} +inline void EdgeType::add_primary_keys(const char* value) { + GOOGLE_DCHECK(value != nullptr); + _impl_.primary_keys_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:gie.EdgeType.primary_keys) +} +inline void EdgeType::add_primary_keys(const char* value, size_t size) { + _impl_.primary_keys_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:gie.EdgeType.primary_keys) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& +EdgeType::primary_keys() const { + // @@protoc_insertion_point(field_list:gie.EdgeType.primary_keys) + return _impl_.primary_keys_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* +EdgeType::mutable_primary_keys() { + // @@protoc_insertion_point(field_mutable_list:gie.EdgeType.primary_keys) + return &_impl_.primary_keys_; +} + +// repeated .gie.SrcDstPair src_dst_pairs = 5; +inline int EdgeType::_internal_src_dst_pairs_size() const { + return _impl_.src_dst_pairs_.size(); +} +inline int EdgeType::src_dst_pairs_size() const { + return _internal_src_dst_pairs_size(); +} +inline void EdgeType::clear_src_dst_pairs() { + _impl_.src_dst_pairs_.Clear(); +} +inline ::gie::SrcDstPair* EdgeType::mutable_src_dst_pairs(int index) { + // @@protoc_insertion_point(field_mutable:gie.EdgeType.src_dst_pairs) + return _impl_.src_dst_pairs_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair >* +EdgeType::mutable_src_dst_pairs() { + // @@protoc_insertion_point(field_mutable_list:gie.EdgeType.src_dst_pairs) + return &_impl_.src_dst_pairs_; +} +inline const ::gie::SrcDstPair& EdgeType::_internal_src_dst_pairs(int index) const { + return _impl_.src_dst_pairs_.Get(index); +} +inline const ::gie::SrcDstPair& EdgeType::src_dst_pairs(int index) const { + // @@protoc_insertion_point(field_get:gie.EdgeType.src_dst_pairs) + return _internal_src_dst_pairs(index); +} +inline ::gie::SrcDstPair* EdgeType::_internal_add_src_dst_pairs() { + return _impl_.src_dst_pairs_.Add(); +} +inline ::gie::SrcDstPair* EdgeType::add_src_dst_pairs() { + ::gie::SrcDstPair* _add = _internal_add_src_dst_pairs(); + // @@protoc_insertion_point(field_add:gie.EdgeType.src_dst_pairs) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair >& +EdgeType::src_dst_pairs() const { + // @@protoc_insertion_point(field_list:gie.EdgeType.src_dst_pairs) + return _impl_.src_dst_pairs_; +} + +// int64 total_num = 6; +inline void EdgeType::clear_total_num() { + _impl_.total_num_ = int64_t{0}; +} +inline int64_t EdgeType::_internal_total_num() const { + return _impl_.total_num_; +} +inline int64_t EdgeType::total_num() const { + // @@protoc_insertion_point(field_get:gie.EdgeType.total_num) + return _internal_total_num(); +} +inline void EdgeType::_internal_set_total_num(int64_t value) { + + _impl_.total_num_ = value; +} +inline void EdgeType::set_total_num(int64_t value) { + _internal_set_total_num(value); + // @@protoc_insertion_point(field_set:gie.EdgeType.total_num) +} + +// ------------------------------------------------------------------- + +// Statistics + +// uint32 num_partitions = 1; +inline void Statistics::clear_num_partitions() { + _impl_.num_partitions_ = 0u; +} +inline uint32_t Statistics::_internal_num_partitions() const { + return _impl_.num_partitions_; +} +inline uint32_t Statistics::num_partitions() const { + // @@protoc_insertion_point(field_get:gie.Statistics.num_partitions) + return _internal_num_partitions(); +} +inline void Statistics::_internal_set_num_partitions(uint32_t value) { + + _impl_.num_partitions_ = value; +} +inline void Statistics::set_num_partitions(uint32_t value) { + _internal_set_num_partitions(value); + // @@protoc_insertion_point(field_set:gie.Statistics.num_partitions) +} + +// uint64 num_vertices = 2; +inline void Statistics::clear_num_vertices() { + _impl_.num_vertices_ = uint64_t{0u}; +} +inline uint64_t Statistics::_internal_num_vertices() const { + return _impl_.num_vertices_; +} +inline uint64_t Statistics::num_vertices() const { + // @@protoc_insertion_point(field_get:gie.Statistics.num_vertices) + return _internal_num_vertices(); +} +inline void Statistics::_internal_set_num_vertices(uint64_t value) { + + _impl_.num_vertices_ = value; +} +inline void Statistics::set_num_vertices(uint64_t value) { + _internal_set_num_vertices(value); + // @@protoc_insertion_point(field_set:gie.Statistics.num_vertices) +} + +// uint64 num_edges = 3; +inline void Statistics::clear_num_edges() { + _impl_.num_edges_ = uint64_t{0u}; +} +inline uint64_t Statistics::_internal_num_edges() const { + return _impl_.num_edges_; +} +inline uint64_t Statistics::num_edges() const { + // @@protoc_insertion_point(field_get:gie.Statistics.num_edges) + return _internal_num_edges(); +} +inline void Statistics::_internal_set_num_edges(uint64_t value) { + + _impl_.num_edges_ = value; +} +inline void Statistics::set_num_edges(uint64_t value) { + _internal_set_num_edges(value); + // @@protoc_insertion_point(field_set:gie.Statistics.num_edges) +} + +// ------------------------------------------------------------------- + +// Schema + +// .gie.GraphPartitionStrategy partition_strategy = 1; +inline bool Schema::_internal_has_partition_strategy() const { + return this != internal_default_instance() && _impl_.partition_strategy_ != nullptr; +} +inline bool Schema::has_partition_strategy() const { + return _internal_has_partition_strategy(); +} +inline void Schema::clear_partition_strategy() { + if (GetArenaForAllocation() == nullptr && _impl_.partition_strategy_ != nullptr) { + delete _impl_.partition_strategy_; + } + _impl_.partition_strategy_ = nullptr; +} +inline const ::gie::GraphPartitionStrategy& Schema::_internal_partition_strategy() const { + const ::gie::GraphPartitionStrategy* p = _impl_.partition_strategy_; + return p != nullptr ? *p : reinterpret_cast( + ::gie::_GraphPartitionStrategy_default_instance_); +} +inline const ::gie::GraphPartitionStrategy& Schema::partition_strategy() const { + // @@protoc_insertion_point(field_get:gie.Schema.partition_strategy) + return _internal_partition_strategy(); +} +inline void Schema::unsafe_arena_set_allocated_partition_strategy( + ::gie::GraphPartitionStrategy* partition_strategy) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.partition_strategy_); + } + _impl_.partition_strategy_ = partition_strategy; + if (partition_strategy) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.Schema.partition_strategy) +} +inline ::gie::GraphPartitionStrategy* Schema::release_partition_strategy() { + + ::gie::GraphPartitionStrategy* temp = _impl_.partition_strategy_; + _impl_.partition_strategy_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::gie::GraphPartitionStrategy* Schema::unsafe_arena_release_partition_strategy() { + // @@protoc_insertion_point(field_release:gie.Schema.partition_strategy) + + ::gie::GraphPartitionStrategy* temp = _impl_.partition_strategy_; + _impl_.partition_strategy_ = nullptr; + return temp; +} +inline ::gie::GraphPartitionStrategy* Schema::_internal_mutable_partition_strategy() { + + if (_impl_.partition_strategy_ == nullptr) { + auto* p = CreateMaybeMessage<::gie::GraphPartitionStrategy>(GetArenaForAllocation()); + _impl_.partition_strategy_ = p; + } + return _impl_.partition_strategy_; +} +inline ::gie::GraphPartitionStrategy* Schema::mutable_partition_strategy() { + ::gie::GraphPartitionStrategy* _msg = _internal_mutable_partition_strategy(); + // @@protoc_insertion_point(field_mutable:gie.Schema.partition_strategy) + return _msg; +} +inline void Schema::set_allocated_partition_strategy(::gie::GraphPartitionStrategy* partition_strategy) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.partition_strategy_; + } + if (partition_strategy) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(partition_strategy); + if (message_arena != submessage_arena) { + partition_strategy = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, partition_strategy, submessage_arena); + } + + } else { + + } + _impl_.partition_strategy_ = partition_strategy; + // @@protoc_insertion_point(field_set_allocated:gie.Schema.partition_strategy) +} + +// repeated .gie.VertexType vertex_types = 2; +inline int Schema::_internal_vertex_types_size() const { + return _impl_.vertex_types_.size(); +} +inline int Schema::vertex_types_size() const { + return _internal_vertex_types_size(); +} +inline void Schema::clear_vertex_types() { + _impl_.vertex_types_.Clear(); +} +inline ::gie::VertexType* Schema::mutable_vertex_types(int index) { + // @@protoc_insertion_point(field_mutable:gie.Schema.vertex_types) + return _impl_.vertex_types_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType >* +Schema::mutable_vertex_types() { + // @@protoc_insertion_point(field_mutable_list:gie.Schema.vertex_types) + return &_impl_.vertex_types_; +} +inline const ::gie::VertexType& Schema::_internal_vertex_types(int index) const { + return _impl_.vertex_types_.Get(index); +} +inline const ::gie::VertexType& Schema::vertex_types(int index) const { + // @@protoc_insertion_point(field_get:gie.Schema.vertex_types) + return _internal_vertex_types(index); +} +inline ::gie::VertexType* Schema::_internal_add_vertex_types() { + return _impl_.vertex_types_.Add(); +} +inline ::gie::VertexType* Schema::add_vertex_types() { + ::gie::VertexType* _add = _internal_add_vertex_types(); + // @@protoc_insertion_point(field_add:gie.Schema.vertex_types) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType >& +Schema::vertex_types() const { + // @@protoc_insertion_point(field_list:gie.Schema.vertex_types) + return _impl_.vertex_types_; +} + +// repeated .gie.EdgeType edge_types = 3; +inline int Schema::_internal_edge_types_size() const { + return _impl_.edge_types_.size(); +} +inline int Schema::edge_types_size() const { + return _internal_edge_types_size(); +} +inline void Schema::clear_edge_types() { + _impl_.edge_types_.Clear(); +} +inline ::gie::EdgeType* Schema::mutable_edge_types(int index) { + // @@protoc_insertion_point(field_mutable:gie.Schema.edge_types) + return _impl_.edge_types_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType >* +Schema::mutable_edge_types() { + // @@protoc_insertion_point(field_mutable_list:gie.Schema.edge_types) + return &_impl_.edge_types_; +} +inline const ::gie::EdgeType& Schema::_internal_edge_types(int index) const { + return _impl_.edge_types_.Get(index); +} +inline const ::gie::EdgeType& Schema::edge_types(int index) const { + // @@protoc_insertion_point(field_get:gie.Schema.edge_types) + return _internal_edge_types(index); +} +inline ::gie::EdgeType* Schema::_internal_add_edge_types() { + return _impl_.edge_types_.Add(); +} +inline ::gie::EdgeType* Schema::add_edge_types() { + ::gie::EdgeType* _add = _internal_add_edge_types(); + // @@protoc_insertion_point(field_add:gie.Schema.edge_types) + return _add; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType >& +Schema::edge_types() const { + // @@protoc_insertion_point(field_list:gie.Schema.edge_types) + return _impl_.edge_types_; +} + +// .gie.Statistics statistics = 4; +inline bool Schema::_internal_has_statistics() const { + return this != internal_default_instance() && _impl_.statistics_ != nullptr; +} +inline bool Schema::has_statistics() const { + return _internal_has_statistics(); +} +inline void Schema::clear_statistics() { + if (GetArenaForAllocation() == nullptr && _impl_.statistics_ != nullptr) { + delete _impl_.statistics_; + } + _impl_.statistics_ = nullptr; +} +inline const ::gie::Statistics& Schema::_internal_statistics() const { + const ::gie::Statistics* p = _impl_.statistics_; + return p != nullptr ? *p : reinterpret_cast( + ::gie::_Statistics_default_instance_); +} +inline const ::gie::Statistics& Schema::statistics() const { + // @@protoc_insertion_point(field_get:gie.Schema.statistics) + return _internal_statistics(); +} +inline void Schema::unsafe_arena_set_allocated_statistics( + ::gie::Statistics* statistics) { + if (GetArenaForAllocation() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.statistics_); + } + _impl_.statistics_ = statistics; + if (statistics) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.Schema.statistics) +} +inline ::gie::Statistics* Schema::release_statistics() { + + ::gie::Statistics* temp = _impl_.statistics_; + _impl_.statistics_ = nullptr; +#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE + auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + if (GetArenaForAllocation() == nullptr) { delete old; } +#else // PROTOBUF_FORCE_COPY_IN_RELEASE + if (GetArenaForAllocation() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } +#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE + return temp; +} +inline ::gie::Statistics* Schema::unsafe_arena_release_statistics() { + // @@protoc_insertion_point(field_release:gie.Schema.statistics) + + ::gie::Statistics* temp = _impl_.statistics_; + _impl_.statistics_ = nullptr; + return temp; +} +inline ::gie::Statistics* Schema::_internal_mutable_statistics() { + + if (_impl_.statistics_ == nullptr) { + auto* p = CreateMaybeMessage<::gie::Statistics>(GetArenaForAllocation()); + _impl_.statistics_ = p; + } + return _impl_.statistics_; +} +inline ::gie::Statistics* Schema::mutable_statistics() { + ::gie::Statistics* _msg = _internal_mutable_statistics(); + // @@protoc_insertion_point(field_mutable:gie.Schema.statistics) + return _msg; +} +inline void Schema::set_allocated_statistics(::gie::Statistics* statistics) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + if (message_arena == nullptr) { + delete _impl_.statistics_; + } + if (statistics) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(statistics); + if (message_arena != submessage_arena) { + statistics = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, statistics, submessage_arena); + } + + } else { + + } + _impl_.statistics_ = statistics; + // @@protoc_insertion_point(field_set_allocated:gie.Schema.statistics) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace gie + +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::gie::VertexPartitionStrategy> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::gie::VertexPartitionStrategy>() { + return ::gie::VertexPartitionStrategy_descriptor(); +} +template <> struct is_proto_enum< ::gie::EdgePartitionStrategy> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::gie::EdgePartitionStrategy>() { + return ::gie::EdgePartitionStrategy_descriptor(); +} +template <> struct is_proto_enum< ::gie::PropertyPartitionStrategy> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::gie::PropertyPartitionStrategy>() { + return ::gie::PropertyPartitionStrategy_descriptor(); +} +template <> struct is_proto_enum< ::gie::GraphTopologyPartitionStrategy> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::gie::GraphTopologyPartitionStrategy>() { + return ::gie::GraphTopologyPartitionStrategy_descriptor(); +} +template <> struct is_proto_enum< ::gie::Relation> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::gie::Relation>() { + return ::gie::Relation_descriptor(); +} +template <> struct is_proto_enum< ::gie::DataType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::gie::DataType>() { + return ::gie::DataType_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_gie_5fschema_2eproto diff --git a/modules/graph/grin/src/proto/message.cc b/modules/graph/grin/src/proto/message.cc index abcfd23af..7ce5ca831 100644 --- a/modules/graph/grin/src/proto/message.cc +++ b/modules/graph/grin/src/proto/message.cc @@ -322,5 +322,9 @@ const char* grin_get_static_storage_feature_msg() { std::string graph_def; google::protobuf::util::MessageToJsonString(g, &graph_def); - return graph_def.c_str(); + + int len = graph_def.length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", graph_def.c_str()); + return out; } diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index c1f846fd1..fc96edf51 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -39,6 +39,10 @@ limitations under the License. #include "graph/fragment/graph_schema.h" #include "graph/loader/arrow_fragment_loader.h" +#include "graph/grin/src/proto/gie_schema.pb.h" + +#include "google/protobuf/util/json_util.h" + using namespace vineyard; // NOLINT(build/namespaces) @@ -120,21 +124,7 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part } -void Traverse(std::string ipc_socket, const grape::CommSpec& comm_spec, - vineyard::ObjectID fragment_group_id) { - LOG(INFO) << "Loaded graph to vineyard: " << fragment_group_id; - - std::string fg_id_str = std::to_string(fragment_group_id); - - char** argv = new char*[2]; - argv[0] = new char[ipc_socket.length() + 1]; - argv[1] = new char[fg_id_str.length() + 1]; - - strcpy(argv[0], ipc_socket.c_str()); - strcpy(argv[1], fg_id_str.c_str()); - - GRIN_PARTITIONED_GRAPH pg = grin_get_partitioned_graph_from_storage(2, argv); - +void Traverse(GRIN_PARTITIONED_GRAPH pg) { GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); size_t pnum = grin_get_partition_list_size(pg, local_partitions); size_t vnum = grin_get_total_vertex_num(pg); @@ -144,91 +134,162 @@ void Traverse(std::string ipc_socket, const grape::CommSpec& comm_spec, // we only traverse the first partition for test GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); LOG(INFO) << "Partition: " << *(static_cast(partition)); - sync_property(pg, partition, "knows", "value3"); + sync_property(pg, partition, "knows", "age"); +} - delete[] argv[0]; - delete[] argv[1]; - delete[] argv; +gie::DataType data_type_cast(GRIN_DATATYPE dt) { + switch (dt) { + case GRIN_DATATYPE::Undefined: + return gie::DataType::DT_UNKNOWN; + case GRIN_DATATYPE::Int32: + return gie::DataType::DT_SIGNED_INT32; + case GRIN_DATATYPE::UInt32: + return gie::DataType::DT_UNSIGNED_INT32; + case GRIN_DATATYPE::Int64: + return gie::DataType::DT_SIGNED_INT64; + case GRIN_DATATYPE::UInt64: + return gie::DataType::DT_UNSIGNED_INT64; + case GRIN_DATATYPE::Float: + return gie::DataType::DT_FLOAT; + case GRIN_DATATYPE::Double: + return gie::DataType::DT_DOUBLE; + case GRIN_DATATYPE::String: + return gie::DataType::DT_STRING; + case GRIN_DATATYPE::Date32: + return gie::DataType::DT_DATE; + case GRIN_DATATYPE::Date64: + return gie::DataType::DT_TIME; + default: + return gie::DataType::DT_UNKNOWN; + } } +std::string Convert(GRIN_PARTITIONED_GRAPH pg) { + gie::Schema schema; + // partition strategy + auto ps = schema.mutable_partition_strategy(); + ps->set_topology(gie::GraphTopologyPartitionStrategy::GPS_EDGE_CUT_FOLLOW_BOTH); + auto gpps = ps->mutable_property(); + auto item = gpps->mutable_by_entity(); + item->set_vertex_property_partition_strategy(gie::PropertyPartitionStrategy::PPS_MASTER); + item->set_edge_property_partition_strategy(gie::PropertyPartitionStrategy::PPS_MASTER_MIRROR); + + // statistics + GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); + auto stats = schema.mutable_statistics(); + stats->set_num_partitions(grin_get_partition_list_size(pg, local_partitions)); + stats->set_num_vertices(grin_get_total_vertex_num(pg)); + stats->set_num_edges(grin_get_total_edge_num(pg)); -namespace detail { + GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); + GRIN_GRAPH g = grin_get_local_graph_from_partition(pg, partition); -std::shared_ptr makeInt64Array() { - std::vector data = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; - arrow::Int64Builder builder; - CHECK_ARROW_ERROR(builder.AppendValues(data)); - std::shared_ptr out; - CHECK_ARROW_ERROR(builder.Finish(&out)); - return arrow::ChunkedArray::Make({out}).ValueOrDie(); -} + // vertex type + GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); + size_t sz = grin_get_vertex_type_list_size(g, vtl); + for (size_t i = 0; i < sz; ++i) { + GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, i); + auto vtype = schema.add_vertex_types(); + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE + vtype->set_id(i); +#endif -std::shared_ptr attachMetadata( - std::shared_ptr schema, std::string const& key, - std::string const& value) { - std::shared_ptr metadata; - if (schema->HasMetadata()) { - metadata = schema->metadata()->Copy(); - } else { - metadata = std::make_shared(); +#ifdef GRIN_WITH_VERTEX_TYPE_NAME + vtype->set_name(grin_get_vertex_type_name(g, vt)); +#endif + +#ifdef GRIN_WITH_VERTEX_PROPERTY + GRIN_VERTEX_PROPERTY_LIST vptl = grin_get_vertex_property_list_by_type(g, vt); + size_t vpt_sz = grin_get_vertex_property_list_size(g, vptl); + for (size_t j = 0; j < vpt_sz; ++j) { + GRIN_VERTEX_PROPERTY vpt = grin_get_vertex_property_from_list(g, vptl, j); + auto vprop = vtype->add_properties(); + + #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY + vprop->set_id(j); + #endif + + #ifdef GRIN_WITH_VERTEX_PROPERTY_NAME + vprop->set_name(grin_get_vertex_property_name(g, vpt)); + #endif + + auto dt = data_type_cast(grin_get_vertex_property_data_type(g, vpt)); + vprop->set_type(dt); + } +#endif + vtype->add_primary_keys("id"); + vtype->set_total_num(grin_get_vertex_num_by_type(g, vt)); } - metadata->Append(key, value); - return schema->WithMetadata(metadata); -} -std::vector> makeVTables() { - auto schema = std::make_shared( - std::vector>{ - arrow::field("id", arrow::int64()), - arrow::field("value1", arrow::int64()), - arrow::field("value2", arrow::int64()), - arrow::field("value3", arrow::int64()), - arrow::field("value4", arrow::int64()), - }); - schema = attachMetadata(schema, "label", "person"); - auto table = arrow::Table::Make( - schema, {makeInt64Array(), makeInt64Array(), makeInt64Array(), - makeInt64Array(), makeInt64Array()}); - return {table}; -} + // edge type + GRIN_EDGE_TYPE_LIST etl = grin_get_edge_type_list(g); + sz = grin_get_edge_type_list_size(g, etl); + for (size_t i = 0; i < sz; ++i) { + GRIN_EDGE_TYPE et = grin_get_edge_type_from_list(g, etl, i); + auto etype = schema.add_edge_types(); + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE + etype->set_id(i); +#endif + +#ifdef GRIN_WITH_EDGE_TYPE_NAME + etype->set_name(grin_get_edge_type_name(g, et)); +#endif + +#ifdef GRIN_WITH_EDGE_PROPERTY + GRIN_EDGE_PROPERTY_LIST eptl = grin_get_edge_property_list_by_type(g, et); + size_t ept_sz = grin_get_edge_property_list_size(g, eptl); + for (size_t j = 1; j < ept_sz; ++j) { + GRIN_EDGE_PROPERTY ept = grin_get_edge_property_from_list(g, eptl, j); + auto eprop = etype->add_properties(); + + #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY + eprop->set_id(j - 1); + #endif + + #ifdef GRIN_WITH_EDGE_PROPERTY_NAME + eprop->set_name(grin_get_edge_property_name(g, ept)); + #endif + + auto dt = data_type_cast(grin_get_edge_property_data_type(g, ept)); + eprop->set_type(dt); + } +#endif -std::vector>> makeETables() { - auto schema = std::make_shared( - std::vector>{ - arrow::field("src_id", arrow::int64()), - arrow::field("dst_id", arrow::int64()), - arrow::field("value1", arrow::int64()), - arrow::field("value2", arrow::int64()), - arrow::field("value3", arrow::int64()), - arrow::field("value4", arrow::int64()), - }); - schema = attachMetadata(schema, "label", "knows"); - schema = attachMetadata(schema, "src_label", "person"); - schema = attachMetadata(schema, "dst_label", "person"); - auto table = arrow::Table::Make( - schema, {makeInt64Array(), makeInt64Array(), makeInt64Array(), - makeInt64Array(), makeInt64Array(), makeInt64Array()}); - return {{table}}; +#ifdef GRIN_WITH_VERTEX_PROPERTY + auto src_vtypes = grin_get_src_types_from_edge_type(g, et); + auto dst_vtypes = grin_get_dst_types_from_edge_type(g, et); + auto pair_sz = grin_get_vertex_type_list_size(g, src_vtypes); + for (size_t j = 0; j < pair_sz; ++j) { + auto src_vt = grin_get_vertex_type_from_list(g, src_vtypes, j); + auto dst_vt = grin_get_vertex_type_from_list(g, dst_vtypes, j); + auto pair = etype->add_src_dst_pairs(); + #ifdef GRIN_WITH_VERTEX_TYPE_NAME + pair->set_src_type(grin_get_vertex_type_name(g, src_vt)); + pair->set_dst_type(grin_get_vertex_type_name(g, dst_vt)); + #endif + } +#endif + + etype->set_total_num(grin_get_edge_num_by_type(g, et)); + } + + std::string schema_def; + google::protobuf::util::MessageToJsonString(schema, &schema_def); + return schema_def; } -} // namespace detail int main(int argc, char** argv) { std::cout << grin_get_static_storage_feature_msg() << std::endl; - - if (argc < 2) { - printf("usage: ./arrow_fragment_test [directed]\n"); - return 1; - } - int index = 1; - std::string ipc_socket = std::string(argv[index++]); - int directed = 1; - if (argc > index) { - directed = atoi(argv[index]); + if (argc < 3) { + printf("usage: ./arrow_fragment_test \n"); + return 1; } - auto vtables = ::detail::makeVTables(); - auto etables = ::detail::makeETables(); + std::string ipc_socket = std::string(argv[1]); + vineyard::ObjectID obj_id = std::stoull(argv[2]); vineyard::Client client; VINEYARD_CHECK_OK(client.Connect(ipc_socket)); @@ -241,19 +302,27 @@ int main(int argc, char** argv) { grape::CommSpec comm_spec; comm_spec.Init(MPI_COMM_WORLD); - { - auto loader = - std::make_unique>( - client, comm_spec, vtables, etables, directed != 0, true, true); - vineyard::ObjectID fragment_group_id = - loader->LoadFragmentAsFragmentGroup().value(); - Traverse(ipc_socket, comm_spec, fragment_group_id); - } + LOG(INFO) << "Loaded graph to vineyard: " << obj_id; + std::string fg_id_str = std::to_string(obj_id); + char** argv = new char*[2]; + argv[0] = new char[ipc_socket.length() + 1]; + argv[1] = new char[fg_id_str.length() + 1]; + strcpy(argv[0], ipc_socket.c_str()); + strcpy(argv[1], fg_id_str.c_str()); + GRIN_PARTITIONED_GRAPH pg = grin_get_partitioned_graph_from_storage(2, argv); + + std::cout << Convert(pg) << std::endl; + + Traverse(pg); + + delete[] argv[0]; + delete[] argv[1]; + delete[] argv; } + grape::FinalizeMPIComm(); - LOG(INFO) << "Passed arrow fragment test..."; + LOG(INFO) << "Passed grin test..."; return 0; } From 4d8ff0417a6e3d948136f076af69927490f9cee9 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 18 Apr 2023 13:17:43 +0800 Subject: [PATCH 48/85] update gie schema proto in grin --- modules/graph/grin/include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 9f6d239de..a21e77d34 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 9f6d239de0ad7efe074fa2b5b02d10ce6652c04b +Subproject commit a21e77d34410405c2a0e429ebf14ac7f2c9ba185 From 9fba8d13e3e027818b2ef9ebc7b774ac61c6d483 Mon Sep 17 00:00:00 2001 From: "diwen.zdw" Date: Tue, 18 Apr 2023 15:19:56 +0800 Subject: [PATCH 49/85] rename trait in storage feature proto to feature to distinguish trait in rust --- modules/graph/grin/include | 2 +- modules/graph/grin/src/proto/graph.pb.cc | 1605 +++++++------- modules/graph/grin/src/proto/graph.pb.h | 2444 +++++++++++----------- modules/graph/grin/src/proto/message.cc | 150 +- 4 files changed, 2101 insertions(+), 2100 deletions(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index a21e77d34..c400929fe 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit a21e77d34410405c2a0e429ebf14ac7f2c9ba185 +Subproject commit c400929febf48914f07da2cae1105d551cfa7a46 diff --git a/modules/graph/grin/src/proto/graph.pb.cc b/modules/graph/grin/src/proto/graph.pb.cc index a03699371..56cc7ed80 100644 --- a/modules/graph/grin/src/proto/graph.pb.cc +++ b/modules/graph/grin/src/proto/graph.pb.cc @@ -21,7 +21,7 @@ namespace _pb = ::PROTOBUF_NAMESPACE_ID; namespace _pbi = _pb::internal; namespace grin { -PROTOBUF_CONSTEXPR TopologyTrait::TopologyTrait( +PROTOBUF_CONSTEXPR TopologyFeature::TopologyFeature( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.vertex_list_retrievals_)*/{} , /*decltype(_impl_._vertex_list_retrievals_cached_byte_size_)*/{0} @@ -36,34 +36,34 @@ PROTOBUF_CONSTEXPR TopologyTrait::TopologyTrait( , /*decltype(_impl_.grin_with_vertex_data_)*/false , /*decltype(_impl_.grin_with_edge_data_)*/false , /*decltype(_impl_._cached_size_)*/{}} {} -struct TopologyTraitDefaultTypeInternal { - PROTOBUF_CONSTEXPR TopologyTraitDefaultTypeInternal() +struct TopologyFeatureDefaultTypeInternal { + PROTOBUF_CONSTEXPR TopologyFeatureDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~TopologyTraitDefaultTypeInternal() {} + ~TopologyFeatureDefaultTypeInternal() {} union { - TopologyTrait _instance; + TopologyFeature _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TopologyTraitDefaultTypeInternal _TopologyTrait_default_instance_; -PROTOBUF_CONSTEXPR MirrorPartitionListTrait::MirrorPartitionListTrait( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TopologyFeatureDefaultTypeInternal _TopologyFeature_default_instance_; +PROTOBUF_CONSTEXPR MirrorPartitionListFeature::MirrorPartitionListFeature( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.grin_trait_master_vertex_mirror_partition_list_)*/false , /*decltype(_impl_.grin_trait_mirror_vertex_mirror_partition_list_)*/false , /*decltype(_impl_.grin_trait_master_edge_mirror_partition_list_)*/false , /*decltype(_impl_.grin_trait_mirror_edge_mirror_partition_list_)*/false , /*decltype(_impl_._cached_size_)*/{}} {} -struct MirrorPartitionListTraitDefaultTypeInternal { - PROTOBUF_CONSTEXPR MirrorPartitionListTraitDefaultTypeInternal() +struct MirrorPartitionListFeatureDefaultTypeInternal { + PROTOBUF_CONSTEXPR MirrorPartitionListFeatureDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~MirrorPartitionListTraitDefaultTypeInternal() {} + ~MirrorPartitionListFeatureDefaultTypeInternal() {} union { - MirrorPartitionListTrait _instance; + MirrorPartitionListFeature _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MirrorPartitionListTraitDefaultTypeInternal _MirrorPartitionListTrait_default_instance_; -PROTOBUF_CONSTEXPR PartitionTrait::PartitionTrait( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MirrorPartitionListFeatureDefaultTypeInternal _MirrorPartitionListFeature_default_instance_; +PROTOBUF_CONSTEXPR PartitionFeature::PartitionFeature( ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.mirror_partition_list_trait_)*/nullptr + /*decltype(_impl_.mirror_partition_list_feature_)*/nullptr , /*decltype(_impl_.graph_partition_strategy_)*/0 , /*decltype(_impl_.grin_trait_natural_id_for_partition_)*/false , /*decltype(_impl_.grin_enable_vertex_ref_)*/false @@ -77,16 +77,16 @@ PROTOBUF_CONSTEXPR PartitionTrait::PartitionTrait( , /*decltype(_impl_.grin_trait_select_master_neighbor_for_adjacent_list_)*/false , /*decltype(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_)*/false , /*decltype(_impl_._cached_size_)*/{}} {} -struct PartitionTraitDefaultTypeInternal { - PROTOBUF_CONSTEXPR PartitionTraitDefaultTypeInternal() +struct PartitionFeatureDefaultTypeInternal { + PROTOBUF_CONSTEXPR PartitionFeatureDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~PartitionTraitDefaultTypeInternal() {} + ~PartitionFeatureDefaultTypeInternal() {} union { - PartitionTrait _instance; + PartitionFeature _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PartitionTraitDefaultTypeInternal _PartitionTrait_default_instance_; -PROTOBUF_CONSTEXPR VertexPropertyTrait::VertexPropertyTrait( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PartitionFeatureDefaultTypeInternal _PartitionFeature_default_instance_; +PROTOBUF_CONSTEXPR VertexPropertyFeature::VertexPropertyFeature( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.grin_with_vertex_property_)*/false , /*decltype(_impl_.grin_with_vertex_property_name_)*/false @@ -97,16 +97,16 @@ PROTOBUF_CONSTEXPR VertexPropertyTrait::VertexPropertyTrait( , /*decltype(_impl_.grin_trait_natural_id_for_vertex_property_)*/false , /*decltype(_impl_.grin_assume_by_type_vertex_original_id_)*/false , /*decltype(_impl_._cached_size_)*/{}} {} -struct VertexPropertyTraitDefaultTypeInternal { - PROTOBUF_CONSTEXPR VertexPropertyTraitDefaultTypeInternal() +struct VertexPropertyFeatureDefaultTypeInternal { + PROTOBUF_CONSTEXPR VertexPropertyFeatureDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~VertexPropertyTraitDefaultTypeInternal() {} + ~VertexPropertyFeatureDefaultTypeInternal() {} union { - VertexPropertyTrait _instance; + VertexPropertyFeature _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VertexPropertyTraitDefaultTypeInternal _VertexPropertyTrait_default_instance_; -PROTOBUF_CONSTEXPR EdgePropertyTrait::EdgePropertyTrait( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VertexPropertyFeatureDefaultTypeInternal _VertexPropertyFeature_default_instance_; +PROTOBUF_CONSTEXPR EdgePropertyFeature::EdgePropertyFeature( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.grin_with_edge_property_)*/false , /*decltype(_impl_.grin_with_edge_property_name_)*/false @@ -116,19 +116,19 @@ PROTOBUF_CONSTEXPR EdgePropertyTrait::EdgePropertyTrait( , /*decltype(_impl_.grin_trait_natural_id_for_edge_type_)*/false , /*decltype(_impl_.grin_trait_natural_id_for_edge_property_)*/false , /*decltype(_impl_._cached_size_)*/{}} {} -struct EdgePropertyTraitDefaultTypeInternal { - PROTOBUF_CONSTEXPR EdgePropertyTraitDefaultTypeInternal() +struct EdgePropertyFeatureDefaultTypeInternal { + PROTOBUF_CONSTEXPR EdgePropertyFeatureDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~EdgePropertyTraitDefaultTypeInternal() {} + ~EdgePropertyFeatureDefaultTypeInternal() {} union { - EdgePropertyTrait _instance; + EdgePropertyFeature _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EdgePropertyTraitDefaultTypeInternal _EdgePropertyTrait_default_instance_; -PROTOBUF_CONSTEXPR PropertyTrait::PropertyTrait( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EdgePropertyFeatureDefaultTypeInternal _EdgePropertyFeature_default_instance_; +PROTOBUF_CONSTEXPR PropertyFeature::PropertyFeature( ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.vertex_property_trait_)*/nullptr - , /*decltype(_impl_.edge_property_trait_)*/nullptr + /*decltype(_impl_.vertex_property_feature_)*/nullptr + , /*decltype(_impl_.edge_property_feature_)*/nullptr , /*decltype(_impl_.vertex_property_)*/0 , /*decltype(_impl_.edge_property_)*/0 , /*decltype(_impl_.grin_enable_row_)*/false @@ -140,55 +140,55 @@ PROTOBUF_CONSTEXPR PropertyTrait::PropertyTrait( , /*decltype(_impl_.grin_trait_select_edge_type_for_adjacent_list_)*/false , /*decltype(_impl_.grin_trait_specific_vev_relation_)*/false , /*decltype(_impl_._cached_size_)*/{}} {} -struct PropertyTraitDefaultTypeInternal { - PROTOBUF_CONSTEXPR PropertyTraitDefaultTypeInternal() +struct PropertyFeatureDefaultTypeInternal { + PROTOBUF_CONSTEXPR PropertyFeatureDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~PropertyTraitDefaultTypeInternal() {} + ~PropertyFeatureDefaultTypeInternal() {} union { - PropertyTrait _instance; + PropertyFeature _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyTraitDefaultTypeInternal _PropertyTrait_default_instance_; -PROTOBUF_CONSTEXPR IndexTrait::IndexTrait( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyFeatureDefaultTypeInternal _PropertyFeature_default_instance_; +PROTOBUF_CONSTEXPR IndexFeature::IndexFeature( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.grin_with_vertex_label_)*/false , /*decltype(_impl_.grin_with_edge_label_)*/false , /*decltype(_impl_.grin_assume_all_vertex_list_sorted_)*/false , /*decltype(_impl_._cached_size_)*/{}} {} -struct IndexTraitDefaultTypeInternal { - PROTOBUF_CONSTEXPR IndexTraitDefaultTypeInternal() +struct IndexFeatureDefaultTypeInternal { + PROTOBUF_CONSTEXPR IndexFeatureDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~IndexTraitDefaultTypeInternal() {} + ~IndexFeatureDefaultTypeInternal() {} union { - IndexTrait _instance; + IndexFeature _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 IndexTraitDefaultTypeInternal _IndexTrait_default_instance_; -PROTOBUF_CONSTEXPR PredicateTrait::PredicateTrait( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 IndexFeatureDefaultTypeInternal _IndexFeature_default_instance_; +PROTOBUF_CONSTEXPR PredicateFeature::PredicateFeature( ::_pbi::ConstantInitialized) {} -struct PredicateTraitDefaultTypeInternal { - PROTOBUF_CONSTEXPR PredicateTraitDefaultTypeInternal() +struct PredicateFeatureDefaultTypeInternal { + PROTOBUF_CONSTEXPR PredicateFeatureDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~PredicateTraitDefaultTypeInternal() {} + ~PredicateFeatureDefaultTypeInternal() {} union { - PredicateTrait _instance; + PredicateFeature _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PredicateTraitDefaultTypeInternal _PredicateTrait_default_instance_; -PROTOBUF_CONSTEXPR StorageTrait::StorageTrait( +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PredicateFeatureDefaultTypeInternal _PredicateFeature_default_instance_; +PROTOBUF_CONSTEXPR StorageFeature::StorageFeature( ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.specific_trait_)*/{} + /*decltype(_impl_.specific_feature_)*/{} , /*decltype(_impl_._cached_size_)*/{} , /*decltype(_impl_._oneof_case_)*/{}} {} -struct StorageTraitDefaultTypeInternal { - PROTOBUF_CONSTEXPR StorageTraitDefaultTypeInternal() +struct StorageFeatureDefaultTypeInternal { + PROTOBUF_CONSTEXPR StorageFeatureDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} - ~StorageTraitDefaultTypeInternal() {} + ~StorageFeatureDefaultTypeInternal() {} union { - StorageTrait _instance; + StorageFeature _instance; }; }; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StorageTraitDefaultTypeInternal _StorageTrait_default_instance_; +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StorageFeatureDefaultTypeInternal _StorageFeature_default_instance_; PROTOBUF_CONSTEXPR Statistics::Statistics( ::_pbi::ConstantInitialized): _impl_{ /*decltype(_impl_.vertex_count_)*/0 @@ -208,7 +208,7 @@ struct StatisticsDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StatisticsDefaultTypeInternal _Statistics_default_instance_; PROTOBUF_CONSTEXPR Graph::Graph( ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.traits_)*/{} + /*decltype(_impl_.features_)*/{} , /*decltype(_impl_.uri_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.grin_version_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} , /*decltype(_impl_.statistics_)*/nullptr @@ -229,113 +229,113 @@ static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors const uint32_t TableStruct_graph_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_assume_has_directed_graph_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_assume_has_undirected_graph_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_assume_has_multi_edge_graph_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_with_vertex_original_id_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_with_vertex_data_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.grin_with_edge_data_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.vertex_list_retrievals_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.edge_list_retrievals_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyTrait, _impl_.adjacent_list_retrievals_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_assume_has_directed_graph_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_assume_has_undirected_graph_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_assume_has_multi_edge_graph_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_with_vertex_original_id_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_with_vertex_data_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_with_edge_data_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.vertex_list_retrievals_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.edge_list_retrievals_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.adjacent_list_retrievals_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListTrait, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListTrait, _impl_.grin_trait_master_vertex_mirror_partition_list_), - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListTrait, _impl_.grin_trait_mirror_vertex_mirror_partition_list_), - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListTrait, _impl_.grin_trait_master_edge_mirror_partition_list_), - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListTrait, _impl_.grin_trait_mirror_edge_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _impl_.grin_trait_master_vertex_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _impl_.grin_trait_mirror_vertex_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _impl_.grin_trait_master_edge_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _impl_.grin_trait_mirror_edge_mirror_partition_list_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.graph_partition_strategy_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_natural_id_for_partition_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_enable_vertex_ref_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_enable_edge_ref_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.vertex_data_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.edge_data_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.mirror_partition_list_trait_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_master_for_vertex_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_partition_for_vertex_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_master_for_edge_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_partition_for_edge_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_master_neighbor_for_adjacent_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionTrait, _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.graph_partition_strategy_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_natural_id_for_partition_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_enable_vertex_ref_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_enable_edge_ref_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.vertex_data_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.edge_data_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.mirror_partition_list_feature_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_master_for_vertex_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_partition_for_vertex_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_master_for_edge_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_partition_for_edge_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_master_neighbor_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_with_vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_with_vertex_property_name_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_with_vertex_type_name_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_enable_vertex_property_table_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_enable_vertex_primary_keys_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_trait_natural_id_for_vertex_type_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_trait_natural_id_for_vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyTrait, _impl_.grin_assume_by_type_vertex_original_id_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_with_vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_with_vertex_property_name_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_with_vertex_type_name_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_enable_vertex_property_table_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_enable_vertex_primary_keys_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_trait_natural_id_for_vertex_type_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_trait_natural_id_for_vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_assume_by_type_vertex_original_id_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_with_edge_property_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_with_edge_property_name_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_with_edge_type_name_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_enable_edge_property_table_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_enable_edge_primary_keys_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_trait_natural_id_for_edge_type_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyTrait, _impl_.grin_trait_natural_id_for_edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_with_edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_with_edge_property_name_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_with_edge_type_name_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_enable_edge_property_table_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_enable_edge_primary_keys_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_trait_natural_id_for_edge_type_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_trait_natural_id_for_edge_property_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_enable_row_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.vertex_property_trait_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.edge_property_trait_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.edge_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_assume_column_store_for_vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_assume_column_store_for_edge_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_trait_select_type_for_vertex_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_trait_select_type_for_edge_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_trait_select_neighbor_type_for_adjacent_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_trait_select_edge_type_for_adjacent_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyTrait, _impl_.grin_trait_specific_vev_relation_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_enable_row_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.vertex_property_feature_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.edge_property_feature_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_assume_column_store_for_vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_assume_column_store_for_edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_trait_select_type_for_vertex_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_trait_select_type_for_edge_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_trait_select_neighbor_type_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_trait_select_edge_type_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_trait_specific_vev_relation_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::IndexTrait, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::IndexTrait, _impl_.grin_with_vertex_label_), - PROTOBUF_FIELD_OFFSET(::grin::IndexTrait, _impl_.grin_with_edge_label_), - PROTOBUF_FIELD_OFFSET(::grin::IndexTrait, _impl_.grin_assume_all_vertex_list_sorted_), + PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, _impl_.grin_with_vertex_label_), + PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, _impl_.grin_with_edge_label_), + PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, _impl_.grin_assume_all_vertex_list_sorted_), ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::PredicateTrait, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::grin::PredicateFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::StorageTrait, _internal_metadata_), + PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::grin::StorageTrait, _impl_._oneof_case_[0]), + PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, _impl_._oneof_case_[0]), ~0u, // no _weak_field_map_ ~0u, // no _inlined_string_donated_ ::_pbi::kInvalidFieldOffsetTag, @@ -343,7 +343,7 @@ const uint32_t TableStruct_graph_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(pr ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::grin::StorageTrait, _impl_.specific_trait_), + PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, _impl_.specific_feature_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::Statistics, _internal_metadata_), ~0u, // no _extensions_ @@ -363,134 +363,135 @@ const uint32_t TableStruct_graph_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(pr ~0u, // no _inlined_string_donated_ PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.uri_), PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.grin_version_), - PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.traits_), + PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.features_), PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.statistics_), }; static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::grin::TopologyTrait)}, - { 15, -1, -1, sizeof(::grin::MirrorPartitionListTrait)}, - { 25, -1, -1, sizeof(::grin::PartitionTrait)}, - { 44, -1, -1, sizeof(::grin::VertexPropertyTrait)}, - { 58, -1, -1, sizeof(::grin::EdgePropertyTrait)}, - { 71, -1, -1, sizeof(::grin::PropertyTrait)}, - { 89, -1, -1, sizeof(::grin::IndexTrait)}, - { 98, -1, -1, sizeof(::grin::PredicateTrait)}, - { 104, -1, -1, sizeof(::grin::StorageTrait)}, + { 0, -1, -1, sizeof(::grin::TopologyFeature)}, + { 15, -1, -1, sizeof(::grin::MirrorPartitionListFeature)}, + { 25, -1, -1, sizeof(::grin::PartitionFeature)}, + { 44, -1, -1, sizeof(::grin::VertexPropertyFeature)}, + { 58, -1, -1, sizeof(::grin::EdgePropertyFeature)}, + { 71, -1, -1, sizeof(::grin::PropertyFeature)}, + { 89, -1, -1, sizeof(::grin::IndexFeature)}, + { 98, -1, -1, sizeof(::grin::PredicateFeature)}, + { 104, -1, -1, sizeof(::grin::StorageFeature)}, { 116, -1, -1, sizeof(::grin::Statistics)}, { 127, -1, -1, sizeof(::grin::Graph)}, }; static const ::_pb::Message* const file_default_instances[] = { - &::grin::_TopologyTrait_default_instance_._instance, - &::grin::_MirrorPartitionListTrait_default_instance_._instance, - &::grin::_PartitionTrait_default_instance_._instance, - &::grin::_VertexPropertyTrait_default_instance_._instance, - &::grin::_EdgePropertyTrait_default_instance_._instance, - &::grin::_PropertyTrait_default_instance_._instance, - &::grin::_IndexTrait_default_instance_._instance, - &::grin::_PredicateTrait_default_instance_._instance, - &::grin::_StorageTrait_default_instance_._instance, + &::grin::_TopologyFeature_default_instance_._instance, + &::grin::_MirrorPartitionListFeature_default_instance_._instance, + &::grin::_PartitionFeature_default_instance_._instance, + &::grin::_VertexPropertyFeature_default_instance_._instance, + &::grin::_EdgePropertyFeature_default_instance_._instance, + &::grin::_PropertyFeature_default_instance_._instance, + &::grin::_IndexFeature_default_instance_._instance, + &::grin::_PredicateFeature_default_instance_._instance, + &::grin::_StorageFeature_default_instance_._instance, &::grin::_Statistics_default_instance_._instance, &::grin::_Graph_default_instance_._instance, }; const char descriptor_table_protodef_graph_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\013graph.proto\022\004grin\"\214\003\n\rTopologyTrait\022&\n" - "\036grin_assume_has_directed_graph\030\001 \001(\010\022(\n" - " grin_assume_has_undirected_graph\030\002 \001(\010\022" - "(\n grin_assume_has_multi_edge_graph\030\003 \001(" - "\010\022$\n\034grin_with_vertex_original_id\030\004 \001(\010\022" - "\035\n\025grin_with_vertex_data\030\005 \001(\010\022\033\n\023grin_w" - "ith_edge_data\030\006 \001(\010\0223\n\026vertex_list_retri" - "evals\030\007 \003(\0162\023.grin.ListRetrieval\0221\n\024edge" - "_list_retrievals\030\010 \003(\0162\023.grin.ListRetrie" - "val\0225\n\030adjacent_list_retrievals\030\t \003(\0162\023." - "grin.ListRetrieval\"\366\001\n\030MirrorPartitionLi" - "stTrait\0226\n.grin_trait_master_vertex_mirr" - "or_partition_list\030\001 \001(\010\0226\n.grin_trait_mi" - "rror_vertex_mirror_partition_list\030\002 \001(\010\022" - "4\n,grin_trait_master_edge_mirror_partiti" - "on_list\030\003 \001(\010\0224\n,grin_trait_mirror_edge_" - "mirror_partition_list\030\004 \001(\010\"\271\005\n\016Partitio" - "nTrait\022>\n\030graph_partition_strategy\030\001 \001(\016" - "2\034.grin.GraphPartitionStrategy\022+\n#grin_t" - "rait_natural_id_for_partition\030\002 \001(\010\022\036\n\026g" - "rin_enable_vertex_ref\030\003 \001(\010\022\034\n\024grin_enab" - "le_edge_ref\030\004 \001(\010\0228\n\013vertex_data\030\005 \001(\0162#" - ".grin.PropertyDataPartitionStrategy\0226\n\te" - "dge_data\030\006 \001(\0162#.grin.PropertyDataPartit" - "ionStrategy\022C\n\033mirror_partition_list_tra" - "it\030\007 \001(\0132\036.grin.MirrorPartitionListTrait" - "\0220\n(grin_trait_select_master_for_vertex_" - "list\030\010 \001(\010\0223\n+grin_trait_select_partitio" - "n_for_vertex_list\030\t \001(\010\022.\n&grin_trait_se" - "lect_master_for_edge_list\030\n \001(\010\0221\n)grin_" - "trait_select_partition_for_edge_list\030\013 \001" - "(\010\022;\n3grin_trait_select_master_neighbor_" - "for_adjacent_list\030\014 \001(\010\022>\n6grin_trait_se" - "lect_neighbor_partition_for_adjacent_lis" - "t\030\r \001(\010\"\352\002\n\023VertexPropertyTrait\022!\n\031grin_" - "with_vertex_property\030\001 \001(\010\022&\n\036grin_with_" - "vertex_property_name\030\002 \001(\010\022\"\n\032grin_with_" - "vertex_type_name\030\003 \001(\010\022)\n!grin_enable_ve" - "rtex_property_table\030\004 \001(\010\022\'\n\037grin_enable" - "_vertex_primary_keys\030\005 \001(\010\022-\n%grin_trait" - "_natural_id_for_vertex_type\030\006 \001(\010\0221\n)gri" - "n_trait_natural_id_for_vertex_property\030\007" - " \001(\010\022.\n&grin_assume_by_type_vertex_origi" - "nal_id\030\010 \001(\010\"\252\002\n\021EdgePropertyTrait\022\037\n\027gr" - "in_with_edge_property\030\001 \001(\010\022$\n\034grin_with" - "_edge_property_name\030\002 \001(\010\022 \n\030grin_with_e" - "dge_type_name\030\003 \001(\010\022\'\n\037grin_enable_edge_" - "property_table\030\004 \001(\010\022%\n\035grin_enable_edge" - "_primary_keys\030\005 \001(\010\022+\n#grin_trait_natura" - "l_id_for_edge_type\030\006 \001(\010\022/\n\'grin_trait_n" - "atural_id_for_edge_property\030\007 \001(\010\"\366\004\n\rPr" - "opertyTrait\022\027\n\017grin_enable_row\030\001 \001(\010\0228\n\025" - "vertex_property_trait\030\002 \001(\0132\031.grin.Verte" - "xPropertyTrait\0224\n\023edge_property_trait\030\003 " - "\001(\0132\027.grin.EdgePropertyTrait\022<\n\017vertex_p" - "roperty\030\004 \001(\0162#.grin.PropertyDataPartiti" - "onStrategy\022:\n\redge_property\030\005 \001(\0162#.grin" - ".PropertyDataPartitionStrategy\0224\n,grin_a" - "ssume_column_store_for_vertex_property\030\006" - " \001(\010\0222\n*grin_assume_column_store_for_edg" - "e_property\030\007 \001(\010\022.\n&grin_trait_select_ty" - "pe_for_vertex_list\030\010 \001(\010\022,\n$grin_trait_s" - "elect_type_for_edge_list\030\t \001(\010\0229\n1grin_t" - "rait_select_neighbor_type_for_adjacent_l" - "ist\030\n \001(\010\0225\n-grin_trait_select_edge_type" - "_for_adjacent_list\030\013 \001(\010\022(\n grin_trait_s" - "pecific_vev_relation\030\014 \001(\010\"v\n\nIndexTrait" - "\022\036\n\026grin_with_vertex_label\030\001 \001(\010\022\034\n\024grin" - "_with_edge_label\030\002 \001(\010\022*\n\"grin_assume_al" - "l_vertex_list_sorted\030\003 \001(\010\"\020\n\016PredicateT" - "rait\"\211\002\n\014StorageTrait\022-\n\016topology_trait\030" - "\001 \001(\0132\023.grin.TopologyTraitH\000\022/\n\017partitio" - "n_trait\030\002 \001(\0132\024.grin.PartitionTraitH\000\022-\n" - "\016property_trait\030\003 \001(\0132\023.grin.PropertyTra" - "itH\000\022\'\n\013index_trait\030\004 \001(\0132\020.grin.IndexTr" - "aitH\000\022/\n\017predicate_trait\030\005 \001(\0132\024.grin.Pr" - "edicateTraitH\000B\020\n\016specific_trait\"\203\001\n\nSta" - "tistics\022\024\n\014vertex_count\030\001 \001(\005\022\022\n\nedge_co" - "unt\030\002 \001(\005\022\027\n\017partition_count\030\003 \001(\005\022\031\n\021ve" - "rtex_type_count\030\004 \001(\005\022\027\n\017edge_type_count" - "\030\005 \001(\005\"t\n\005Graph\022\013\n\003uri\030\001 \001(\t\022\024\n\014grin_ver" - "sion\030\002 \001(\t\022\"\n\006traits\030\003 \003(\0132\022.grin.Storag" - "eTrait\022$\n\nstatistics\030\004 \001(\0132\020.grin.Statis" - "tics*>\n\rListRetrieval\022\t\n\005LR_NA\020\000\022\021\n\rLR_A" - "RRAY_LIKE\020\001\022\017\n\013LR_ITERATOR\020\002*u\n\026GraphPar" - "titionStrategy\022\n\n\006GPS_NA\020\000\022\025\n\021GPS_ALL_RE" - "PLICATE\020\001\022\020\n\014GPS_EDGE_CUT\020\002\022\022\n\016GPS_VERTE" - "X_CUT\020\003\022\022\n\016GPS_HYBRID_CUT\020\004*\202\001\n\035Property" - "DataPartitionStrategy\022\013\n\007PDPS_NA\020\000\022\024\n\020PD" - "PS_MASTER_ONLY\020\001\022 \n\034PDPS_REPLICATE_MASTE" - "R_MIRROR\020\002\022\034\n\030PDPS_SPLIT_MASTER_MIRROR\020\003" - "b\006proto3" + "\n\013graph.proto\022\004grin\"\216\003\n\017TopologyFeature\022" + "&\n\036grin_assume_has_directed_graph\030\001 \001(\010\022" + "(\n grin_assume_has_undirected_graph\030\002 \001(" + "\010\022(\n grin_assume_has_multi_edge_graph\030\003 " + "\001(\010\022$\n\034grin_with_vertex_original_id\030\004 \001(" + "\010\022\035\n\025grin_with_vertex_data\030\005 \001(\010\022\033\n\023grin" + "_with_edge_data\030\006 \001(\010\0223\n\026vertex_list_ret" + "rievals\030\007 \003(\0162\023.grin.ListRetrieval\0221\n\024ed" + "ge_list_retrievals\030\010 \003(\0162\023.grin.ListRetr" + "ieval\0225\n\030adjacent_list_retrievals\030\t \003(\0162" + "\023.grin.ListRetrieval\"\370\001\n\032MirrorPartition" + "ListFeature\0226\n.grin_trait_master_vertex_" + "mirror_partition_list\030\001 \001(\010\0226\n.grin_trai" + "t_mirror_vertex_mirror_partition_list\030\002 " + "\001(\010\0224\n,grin_trait_master_edge_mirror_par" + "tition_list\030\003 \001(\010\0224\n,grin_trait_mirror_e" + "dge_mirror_partition_list\030\004 \001(\010\"\277\005\n\020Part" + "itionFeature\022>\n\030graph_partition_strategy" + "\030\001 \001(\0162\034.grin.GraphPartitionStrategy\022+\n#" + "grin_trait_natural_id_for_partition\030\002 \001(" + "\010\022\036\n\026grin_enable_vertex_ref\030\003 \001(\010\022\034\n\024gri" + "n_enable_edge_ref\030\004 \001(\010\0228\n\013vertex_data\030\005" + " \001(\0162#.grin.PropertyDataPartitionStrateg" + "y\0226\n\tedge_data\030\006 \001(\0162#.grin.PropertyData" + "PartitionStrategy\022G\n\035mirror_partition_li" + "st_feature\030\007 \001(\0132 .grin.MirrorPartitionL" + "istFeature\0220\n(grin_trait_select_master_f" + "or_vertex_list\030\010 \001(\010\0223\n+grin_trait_selec" + "t_partition_for_vertex_list\030\t \001(\010\022.\n&gri" + "n_trait_select_master_for_edge_list\030\n \001(" + "\010\0221\n)grin_trait_select_partition_for_edg" + "e_list\030\013 \001(\010\022;\n3grin_trait_select_master" + "_neighbor_for_adjacent_list\030\014 \001(\010\022>\n6gri" + "n_trait_select_neighbor_partition_for_ad" + "jacent_list\030\r \001(\010\"\354\002\n\025VertexPropertyFeat" + "ure\022!\n\031grin_with_vertex_property\030\001 \001(\010\022&" + "\n\036grin_with_vertex_property_name\030\002 \001(\010\022\"" + "\n\032grin_with_vertex_type_name\030\003 \001(\010\022)\n!gr" + "in_enable_vertex_property_table\030\004 \001(\010\022\'\n" + "\037grin_enable_vertex_primary_keys\030\005 \001(\010\022-" + "\n%grin_trait_natural_id_for_vertex_type\030" + "\006 \001(\010\0221\n)grin_trait_natural_id_for_verte" + "x_property\030\007 \001(\010\022.\n&grin_assume_by_type_" + "vertex_original_id\030\010 \001(\010\"\254\002\n\023EdgePropert" + "yFeature\022\037\n\027grin_with_edge_property\030\001 \001(" + "\010\022$\n\034grin_with_edge_property_name\030\002 \001(\010\022" + " \n\030grin_with_edge_type_name\030\003 \001(\010\022\'\n\037gri" + "n_enable_edge_property_table\030\004 \001(\010\022%\n\035gr" + "in_enable_edge_primary_keys\030\005 \001(\010\022+\n#gri" + "n_trait_natural_id_for_edge_type\030\006 \001(\010\022/" + "\n\'grin_trait_natural_id_for_edge_propert" + "y\030\007 \001(\010\"\200\005\n\017PropertyFeature\022\027\n\017grin_enab" + "le_row\030\001 \001(\010\022<\n\027vertex_property_feature\030" + "\002 \001(\0132\033.grin.VertexPropertyFeature\0228\n\025ed" + "ge_property_feature\030\003 \001(\0132\031.grin.EdgePro" + "pertyFeature\022<\n\017vertex_property\030\004 \001(\0162#." + "grin.PropertyDataPartitionStrategy\022:\n\red" + "ge_property\030\005 \001(\0162#.grin.PropertyDataPar" + "titionStrategy\0224\n,grin_assume_column_sto" + "re_for_vertex_property\030\006 \001(\010\0222\n*grin_ass" + "ume_column_store_for_edge_property\030\007 \001(\010" + "\022.\n&grin_trait_select_type_for_vertex_li" + "st\030\010 \001(\010\022,\n$grin_trait_select_type_for_e" + "dge_list\030\t \001(\010\0229\n1grin_trait_select_neig" + "hbor_type_for_adjacent_list\030\n \001(\010\0225\n-gri" + "n_trait_select_edge_type_for_adjacent_li" + "st\030\013 \001(\010\022(\n grin_trait_specific_vev_rela" + "tion\030\014 \001(\010\"x\n\014IndexFeature\022\036\n\026grin_with_" + "vertex_label\030\001 \001(\010\022\034\n\024grin_with_edge_lab" + "el\030\002 \001(\010\022*\n\"grin_assume_all_vertex_list_" + "sorted\030\003 \001(\010\"\022\n\020PredicateFeature\"\241\002\n\016Sto" + "rageFeature\0221\n\020topology_feature\030\001 \001(\0132\025." + "grin.TopologyFeatureH\000\0223\n\021partition_feat" + "ure\030\002 \001(\0132\026.grin.PartitionFeatureH\000\0221\n\020p" + "roperty_feature\030\003 \001(\0132\025.grin.PropertyFea" + "tureH\000\022+\n\rindex_feature\030\004 \001(\0132\022.grin.Ind" + "exFeatureH\000\0223\n\021predicate_feature\030\005 \001(\0132\026" + ".grin.PredicateFeatureH\000B\022\n\020specific_fea" + "ture\"\203\001\n\nStatistics\022\024\n\014vertex_count\030\001 \001(" + "\005\022\022\n\nedge_count\030\002 \001(\005\022\027\n\017partition_count" + "\030\003 \001(\005\022\031\n\021vertex_type_count\030\004 \001(\005\022\027\n\017edg" + "e_type_count\030\005 \001(\005\"x\n\005Graph\022\013\n\003uri\030\001 \001(\t" + "\022\024\n\014grin_version\030\002 \001(\t\022&\n\010features\030\003 \003(\013" + "2\024.grin.StorageFeature\022$\n\nstatistics\030\004 \001" + "(\0132\020.grin.Statistics*>\n\rListRetrieval\022\t\n" + "\005LR_NA\020\000\022\021\n\rLR_ARRAY_LIKE\020\001\022\017\n\013LR_ITERAT" + "OR\020\002*u\n\026GraphPartitionStrategy\022\n\n\006GPS_NA" + "\020\000\022\025\n\021GPS_ALL_REPLICATE\020\001\022\020\n\014GPS_EDGE_CU" + "T\020\002\022\022\n\016GPS_VERTEX_CUT\020\003\022\022\n\016GPS_HYBRID_CU" + "T\020\004*\202\001\n\035PropertyDataPartitionStrategy\022\013\n" + "\007PDPS_NA\020\000\022\024\n\020PDPS_MASTER_ONLY\020\001\022 \n\034PDPS" + "_REPLICATE_MASTER_MIRROR\020\002\022\034\n\030PDPS_SPLIT" + "_MASTER_MIRROR\020\003b\006proto3" ; static ::_pbi::once_flag descriptor_table_graph_2eproto_once; const ::_pbi::DescriptorTable descriptor_table_graph_2eproto = { - false, false, 3648, descriptor_table_protodef_graph_2eproto, + false, false, 3704, descriptor_table_protodef_graph_2eproto, "graph.proto", &descriptor_table_graph_2eproto_once, nullptr, 0, 11, schemas, file_default_instances, TableStruct_graph_2eproto::offsets, @@ -555,19 +556,19 @@ bool PropertyDataPartitionStrategy_IsValid(int value) { // =================================================================== -class TopologyTrait::_Internal { +class TopologyFeature::_Internal { public: }; -TopologyTrait::TopologyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, +TopologyFeature::TopologyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:grin.TopologyTrait) + // @@protoc_insertion_point(arena_constructor:grin.TopologyFeature) } -TopologyTrait::TopologyTrait(const TopologyTrait& from) +TopologyFeature::TopologyFeature(const TopologyFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - TopologyTrait* const _this = this; (void)_this; + TopologyFeature* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.vertex_list_retrievals_){from._impl_.vertex_list_retrievals_} , /*decltype(_impl_._vertex_list_retrievals_cached_byte_size_)*/{0} @@ -587,10 +588,10 @@ TopologyTrait::TopologyTrait(const TopologyTrait& from) ::memcpy(&_impl_.grin_assume_has_directed_graph_, &from._impl_.grin_assume_has_directed_graph_, static_cast(reinterpret_cast(&_impl_.grin_with_edge_data_) - reinterpret_cast(&_impl_.grin_assume_has_directed_graph_)) + sizeof(_impl_.grin_with_edge_data_)); - // @@protoc_insertion_point(copy_constructor:grin.TopologyTrait) + // @@protoc_insertion_point(copy_constructor:grin.TopologyFeature) } -inline void TopologyTrait::SharedCtor( +inline void TopologyFeature::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; @@ -611,8 +612,8 @@ inline void TopologyTrait::SharedCtor( }; } -TopologyTrait::~TopologyTrait() { - // @@protoc_insertion_point(destructor:grin.TopologyTrait) +TopologyFeature::~TopologyFeature() { + // @@protoc_insertion_point(destructor:grin.TopologyFeature) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -620,19 +621,19 @@ TopologyTrait::~TopologyTrait() { SharedDtor(); } -inline void TopologyTrait::SharedDtor() { +inline void TopologyFeature::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); _impl_.vertex_list_retrievals_.~RepeatedField(); _impl_.edge_list_retrievals_.~RepeatedField(); _impl_.adjacent_list_retrievals_.~RepeatedField(); } -void TopologyTrait::SetCachedSize(int size) const { +void TopologyFeature::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void TopologyTrait::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.TopologyTrait) +void TopologyFeature::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.TopologyFeature) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -646,7 +647,7 @@ void TopologyTrait::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* TopologyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* TopologyFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; @@ -759,9 +760,9 @@ const char* TopologyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* #undef CHK_ } -uint8_t* TopologyTrait::_InternalSerialize( +uint8_t* TopologyFeature::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.TopologyTrait) + // @@protoc_insertion_point(serialize_to_array_start:grin.TopologyFeature) uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -832,12 +833,12 @@ uint8_t* TopologyTrait::_InternalSerialize( target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:grin.TopologyTrait) + // @@protoc_insertion_point(serialize_to_array_end:grin.TopologyFeature) return target; } -size_t TopologyTrait::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.TopologyTrait) +size_t TopologyFeature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.TopologyFeature) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -928,17 +929,17 @@ size_t TopologyTrait::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TopologyTrait::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TopologyFeature::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - TopologyTrait::MergeImpl + TopologyFeature::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TopologyTrait::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TopologyFeature::GetClassData() const { return &_class_data_; } -void TopologyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.TopologyTrait) +void TopologyFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.TopologyFeature) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -967,32 +968,32 @@ void TopologyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const :: _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void TopologyTrait::CopyFrom(const TopologyTrait& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.TopologyTrait) +void TopologyFeature::CopyFrom(const TopologyFeature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.TopologyFeature) if (&from == this) return; Clear(); MergeFrom(from); } -bool TopologyTrait::IsInitialized() const { +bool TopologyFeature::IsInitialized() const { return true; } -void TopologyTrait::InternalSwap(TopologyTrait* other) { +void TopologyFeature::InternalSwap(TopologyFeature* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); _impl_.vertex_list_retrievals_.InternalSwap(&other->_impl_.vertex_list_retrievals_); _impl_.edge_list_retrievals_.InternalSwap(&other->_impl_.edge_list_retrievals_); _impl_.adjacent_list_retrievals_.InternalSwap(&other->_impl_.adjacent_list_retrievals_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(TopologyTrait, _impl_.grin_with_edge_data_) - + sizeof(TopologyTrait::_impl_.grin_with_edge_data_) - - PROTOBUF_FIELD_OFFSET(TopologyTrait, _impl_.grin_assume_has_directed_graph_)>( + PROTOBUF_FIELD_OFFSET(TopologyFeature, _impl_.grin_with_edge_data_) + + sizeof(TopologyFeature::_impl_.grin_with_edge_data_) + - PROTOBUF_FIELD_OFFSET(TopologyFeature, _impl_.grin_assume_has_directed_graph_)>( reinterpret_cast(&_impl_.grin_assume_has_directed_graph_), reinterpret_cast(&other->_impl_.grin_assume_has_directed_graph_)); } -::PROTOBUF_NAMESPACE_ID::Metadata TopologyTrait::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata TopologyFeature::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, file_level_metadata_graph_2eproto[0]); @@ -1000,19 +1001,19 @@ ::PROTOBUF_NAMESPACE_ID::Metadata TopologyTrait::GetMetadata() const { // =================================================================== -class MirrorPartitionListTrait::_Internal { +class MirrorPartitionListFeature::_Internal { public: }; -MirrorPartitionListTrait::MirrorPartitionListTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, +MirrorPartitionListFeature::MirrorPartitionListFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:grin.MirrorPartitionListTrait) + // @@protoc_insertion_point(arena_constructor:grin.MirrorPartitionListFeature) } -MirrorPartitionListTrait::MirrorPartitionListTrait(const MirrorPartitionListTrait& from) +MirrorPartitionListFeature::MirrorPartitionListFeature(const MirrorPartitionListFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - MirrorPartitionListTrait* const _this = this; (void)_this; + MirrorPartitionListFeature* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.grin_trait_master_vertex_mirror_partition_list_){} , decltype(_impl_.grin_trait_mirror_vertex_mirror_partition_list_){} @@ -1024,10 +1025,10 @@ MirrorPartitionListTrait::MirrorPartitionListTrait(const MirrorPartitionListTrai ::memcpy(&_impl_.grin_trait_master_vertex_mirror_partition_list_, &from._impl_.grin_trait_master_vertex_mirror_partition_list_, static_cast(reinterpret_cast(&_impl_.grin_trait_mirror_edge_mirror_partition_list_) - reinterpret_cast(&_impl_.grin_trait_master_vertex_mirror_partition_list_)) + sizeof(_impl_.grin_trait_mirror_edge_mirror_partition_list_)); - // @@protoc_insertion_point(copy_constructor:grin.MirrorPartitionListTrait) + // @@protoc_insertion_point(copy_constructor:grin.MirrorPartitionListFeature) } -inline void MirrorPartitionListTrait::SharedCtor( +inline void MirrorPartitionListFeature::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; @@ -1040,8 +1041,8 @@ inline void MirrorPartitionListTrait::SharedCtor( }; } -MirrorPartitionListTrait::~MirrorPartitionListTrait() { - // @@protoc_insertion_point(destructor:grin.MirrorPartitionListTrait) +MirrorPartitionListFeature::~MirrorPartitionListFeature() { + // @@protoc_insertion_point(destructor:grin.MirrorPartitionListFeature) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -1049,16 +1050,16 @@ MirrorPartitionListTrait::~MirrorPartitionListTrait() { SharedDtor(); } -inline void MirrorPartitionListTrait::SharedDtor() { +inline void MirrorPartitionListFeature::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void MirrorPartitionListTrait::SetCachedSize(int size) const { +void MirrorPartitionListFeature::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void MirrorPartitionListTrait::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.MirrorPartitionListTrait) +void MirrorPartitionListFeature::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.MirrorPartitionListFeature) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1069,7 +1070,7 @@ void MirrorPartitionListTrait::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* MirrorPartitionListTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* MirrorPartitionListFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; @@ -1130,9 +1131,9 @@ const char* MirrorPartitionListTrait::_InternalParse(const char* ptr, ::_pbi::Pa #undef CHK_ } -uint8_t* MirrorPartitionListTrait::_InternalSerialize( +uint8_t* MirrorPartitionListFeature::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.MirrorPartitionListTrait) + // @@protoc_insertion_point(serialize_to_array_start:grin.MirrorPartitionListFeature) uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -1164,12 +1165,12 @@ uint8_t* MirrorPartitionListTrait::_InternalSerialize( target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:grin.MirrorPartitionListTrait) + // @@protoc_insertion_point(serialize_to_array_end:grin.MirrorPartitionListFeature) return target; } -size_t MirrorPartitionListTrait::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.MirrorPartitionListTrait) +size_t MirrorPartitionListFeature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.MirrorPartitionListFeature) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -1199,17 +1200,17 @@ size_t MirrorPartitionListTrait::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MirrorPartitionListTrait::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MirrorPartitionListFeature::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - MirrorPartitionListTrait::MergeImpl + MirrorPartitionListFeature::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MirrorPartitionListTrait::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MirrorPartitionListFeature::GetClassData() const { return &_class_data_; } -void MirrorPartitionListTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.MirrorPartitionListTrait) +void MirrorPartitionListFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.MirrorPartitionListFeature) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -1229,29 +1230,29 @@ void MirrorPartitionListTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_ms _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void MirrorPartitionListTrait::CopyFrom(const MirrorPartitionListTrait& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.MirrorPartitionListTrait) +void MirrorPartitionListFeature::CopyFrom(const MirrorPartitionListFeature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.MirrorPartitionListFeature) if (&from == this) return; Clear(); MergeFrom(from); } -bool MirrorPartitionListTrait::IsInitialized() const { +bool MirrorPartitionListFeature::IsInitialized() const { return true; } -void MirrorPartitionListTrait::InternalSwap(MirrorPartitionListTrait* other) { +void MirrorPartitionListFeature::InternalSwap(MirrorPartitionListFeature* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MirrorPartitionListTrait, _impl_.grin_trait_mirror_edge_mirror_partition_list_) - + sizeof(MirrorPartitionListTrait::_impl_.grin_trait_mirror_edge_mirror_partition_list_) - - PROTOBUF_FIELD_OFFSET(MirrorPartitionListTrait, _impl_.grin_trait_master_vertex_mirror_partition_list_)>( + PROTOBUF_FIELD_OFFSET(MirrorPartitionListFeature, _impl_.grin_trait_mirror_edge_mirror_partition_list_) + + sizeof(MirrorPartitionListFeature::_impl_.grin_trait_mirror_edge_mirror_partition_list_) + - PROTOBUF_FIELD_OFFSET(MirrorPartitionListFeature, _impl_.grin_trait_master_vertex_mirror_partition_list_)>( reinterpret_cast(&_impl_.grin_trait_master_vertex_mirror_partition_list_), reinterpret_cast(&other->_impl_.grin_trait_master_vertex_mirror_partition_list_)); } -::PROTOBUF_NAMESPACE_ID::Metadata MirrorPartitionListTrait::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata MirrorPartitionListFeature::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, file_level_metadata_graph_2eproto[1]); @@ -1259,26 +1260,26 @@ ::PROTOBUF_NAMESPACE_ID::Metadata MirrorPartitionListTrait::GetMetadata() const // =================================================================== -class PartitionTrait::_Internal { +class PartitionFeature::_Internal { public: - static const ::grin::MirrorPartitionListTrait& mirror_partition_list_trait(const PartitionTrait* msg); + static const ::grin::MirrorPartitionListFeature& mirror_partition_list_feature(const PartitionFeature* msg); }; -const ::grin::MirrorPartitionListTrait& -PartitionTrait::_Internal::mirror_partition_list_trait(const PartitionTrait* msg) { - return *msg->_impl_.mirror_partition_list_trait_; +const ::grin::MirrorPartitionListFeature& +PartitionFeature::_Internal::mirror_partition_list_feature(const PartitionFeature* msg) { + return *msg->_impl_.mirror_partition_list_feature_; } -PartitionTrait::PartitionTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, +PartitionFeature::PartitionFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:grin.PartitionTrait) + // @@protoc_insertion_point(arena_constructor:grin.PartitionFeature) } -PartitionTrait::PartitionTrait(const PartitionTrait& from) +PartitionFeature::PartitionFeature(const PartitionFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - PartitionTrait* const _this = this; (void)_this; + PartitionFeature* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.mirror_partition_list_trait_){nullptr} + decltype(_impl_.mirror_partition_list_feature_){nullptr} , decltype(_impl_.graph_partition_strategy_){} , decltype(_impl_.grin_trait_natural_id_for_partition_){} , decltype(_impl_.grin_enable_vertex_ref_){} @@ -1294,21 +1295,21 @@ PartitionTrait::PartitionTrait(const PartitionTrait& from) , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - if (from._internal_has_mirror_partition_list_trait()) { - _this->_impl_.mirror_partition_list_trait_ = new ::grin::MirrorPartitionListTrait(*from._impl_.mirror_partition_list_trait_); + if (from._internal_has_mirror_partition_list_feature()) { + _this->_impl_.mirror_partition_list_feature_ = new ::grin::MirrorPartitionListFeature(*from._impl_.mirror_partition_list_feature_); } ::memcpy(&_impl_.graph_partition_strategy_, &from._impl_.graph_partition_strategy_, static_cast(reinterpret_cast(&_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) - reinterpret_cast(&_impl_.graph_partition_strategy_)) + sizeof(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_)); - // @@protoc_insertion_point(copy_constructor:grin.PartitionTrait) + // @@protoc_insertion_point(copy_constructor:grin.PartitionFeature) } -inline void PartitionTrait::SharedCtor( +inline void PartitionFeature::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.mirror_partition_list_trait_){nullptr} + decltype(_impl_.mirror_partition_list_feature_){nullptr} , decltype(_impl_.graph_partition_strategy_){0} , decltype(_impl_.grin_trait_natural_id_for_partition_){false} , decltype(_impl_.grin_enable_vertex_ref_){false} @@ -1325,8 +1326,8 @@ inline void PartitionTrait::SharedCtor( }; } -PartitionTrait::~PartitionTrait() { - // @@protoc_insertion_point(destructor:grin.PartitionTrait) +PartitionFeature::~PartitionFeature() { + // @@protoc_insertion_point(destructor:grin.PartitionFeature) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -1334,32 +1335,32 @@ PartitionTrait::~PartitionTrait() { SharedDtor(); } -inline void PartitionTrait::SharedDtor() { +inline void PartitionFeature::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.mirror_partition_list_trait_; + if (this != internal_default_instance()) delete _impl_.mirror_partition_list_feature_; } -void PartitionTrait::SetCachedSize(int size) const { +void PartitionFeature::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void PartitionTrait::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.PartitionTrait) +void PartitionFeature::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.PartitionFeature) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (GetArenaForAllocation() == nullptr && _impl_.mirror_partition_list_trait_ != nullptr) { - delete _impl_.mirror_partition_list_trait_; + if (GetArenaForAllocation() == nullptr && _impl_.mirror_partition_list_feature_ != nullptr) { + delete _impl_.mirror_partition_list_feature_; } - _impl_.mirror_partition_list_trait_ = nullptr; + _impl_.mirror_partition_list_feature_ = nullptr; ::memset(&_impl_.graph_partition_strategy_, 0, static_cast( reinterpret_cast(&_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) - reinterpret_cast(&_impl_.graph_partition_strategy_)) + sizeof(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* PartitionTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* PartitionFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; @@ -1416,10 +1417,10 @@ const char* PartitionTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext } else goto handle_unusual; continue; - // .grin.MirrorPartitionListTrait mirror_partition_list_trait = 7; + // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; case 7: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { - ptr = ctx->ParseMessage(_internal_mutable_mirror_partition_list_trait(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_mirror_partition_list_feature(), ptr); CHK_(ptr); } else goto handle_unusual; @@ -1495,9 +1496,9 @@ const char* PartitionTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext #undef CHK_ } -uint8_t* PartitionTrait::_InternalSerialize( +uint8_t* PartitionFeature::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.PartitionTrait) + // @@protoc_insertion_point(serialize_to_array_start:grin.PartitionFeature) uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -1540,11 +1541,11 @@ uint8_t* PartitionTrait::_InternalSerialize( 6, this->_internal_edge_data(), target); } - // .grin.MirrorPartitionListTrait mirror_partition_list_trait = 7; - if (this->_internal_has_mirror_partition_list_trait()) { + // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; + if (this->_internal_has_mirror_partition_list_feature()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(7, _Internal::mirror_partition_list_trait(this), - _Internal::mirror_partition_list_trait(this).GetCachedSize(), target, stream); + InternalWriteMessage(7, _Internal::mirror_partition_list_feature(this), + _Internal::mirror_partition_list_feature(this).GetCachedSize(), target, stream); } // bool grin_trait_select_master_for_vertex_list = 8; @@ -1587,23 +1588,23 @@ uint8_t* PartitionTrait::_InternalSerialize( target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:grin.PartitionTrait) + // @@protoc_insertion_point(serialize_to_array_end:grin.PartitionFeature) return target; } -size_t PartitionTrait::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.PartitionTrait) +size_t PartitionFeature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.PartitionFeature) size_t total_size = 0; uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // .grin.MirrorPartitionListTrait mirror_partition_list_trait = 7; - if (this->_internal_has_mirror_partition_list_trait()) { + // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; + if (this->_internal_has_mirror_partition_list_feature()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.mirror_partition_list_trait_); + *_impl_.mirror_partition_list_feature_); } // .grin.GraphPartitionStrategy graph_partition_strategy = 1; @@ -1672,24 +1673,24 @@ size_t PartitionTrait::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PartitionTrait::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PartitionFeature::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - PartitionTrait::MergeImpl + PartitionFeature::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PartitionTrait::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PartitionFeature::GetClassData() const { return &_class_data_; } -void PartitionTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.PartitionTrait) +void PartitionFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.PartitionFeature) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_has_mirror_partition_list_trait()) { - _this->_internal_mutable_mirror_partition_list_trait()->::grin::MirrorPartitionListTrait::MergeFrom( - from._internal_mirror_partition_list_trait()); + if (from._internal_has_mirror_partition_list_feature()) { + _this->_internal_mutable_mirror_partition_list_feature()->::grin::MirrorPartitionListFeature::MergeFrom( + from._internal_mirror_partition_list_feature()); } if (from._internal_graph_partition_strategy() != 0) { _this->_internal_set_graph_partition_strategy(from._internal_graph_partition_strategy()); @@ -1730,29 +1731,29 @@ void PartitionTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const : _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void PartitionTrait::CopyFrom(const PartitionTrait& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.PartitionTrait) +void PartitionFeature::CopyFrom(const PartitionFeature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.PartitionFeature) if (&from == this) return; Clear(); MergeFrom(from); } -bool PartitionTrait::IsInitialized() const { +bool PartitionFeature::IsInitialized() const { return true; } -void PartitionTrait::InternalSwap(PartitionTrait* other) { +void PartitionFeature::InternalSwap(PartitionFeature* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(PartitionTrait, _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) - + sizeof(PartitionTrait::_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) - - PROTOBUF_FIELD_OFFSET(PartitionTrait, _impl_.mirror_partition_list_trait_)>( - reinterpret_cast(&_impl_.mirror_partition_list_trait_), - reinterpret_cast(&other->_impl_.mirror_partition_list_trait_)); + PROTOBUF_FIELD_OFFSET(PartitionFeature, _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) + + sizeof(PartitionFeature::_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) + - PROTOBUF_FIELD_OFFSET(PartitionFeature, _impl_.mirror_partition_list_feature_)>( + reinterpret_cast(&_impl_.mirror_partition_list_feature_), + reinterpret_cast(&other->_impl_.mirror_partition_list_feature_)); } -::PROTOBUF_NAMESPACE_ID::Metadata PartitionTrait::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata PartitionFeature::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, file_level_metadata_graph_2eproto[2]); @@ -1760,19 +1761,19 @@ ::PROTOBUF_NAMESPACE_ID::Metadata PartitionTrait::GetMetadata() const { // =================================================================== -class VertexPropertyTrait::_Internal { +class VertexPropertyFeature::_Internal { public: }; -VertexPropertyTrait::VertexPropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, +VertexPropertyFeature::VertexPropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:grin.VertexPropertyTrait) + // @@protoc_insertion_point(arena_constructor:grin.VertexPropertyFeature) } -VertexPropertyTrait::VertexPropertyTrait(const VertexPropertyTrait& from) +VertexPropertyFeature::VertexPropertyFeature(const VertexPropertyFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - VertexPropertyTrait* const _this = this; (void)_this; + VertexPropertyFeature* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.grin_with_vertex_property_){} , decltype(_impl_.grin_with_vertex_property_name_){} @@ -1788,10 +1789,10 @@ VertexPropertyTrait::VertexPropertyTrait(const VertexPropertyTrait& from) ::memcpy(&_impl_.grin_with_vertex_property_, &from._impl_.grin_with_vertex_property_, static_cast(reinterpret_cast(&_impl_.grin_assume_by_type_vertex_original_id_) - reinterpret_cast(&_impl_.grin_with_vertex_property_)) + sizeof(_impl_.grin_assume_by_type_vertex_original_id_)); - // @@protoc_insertion_point(copy_constructor:grin.VertexPropertyTrait) + // @@protoc_insertion_point(copy_constructor:grin.VertexPropertyFeature) } -inline void VertexPropertyTrait::SharedCtor( +inline void VertexPropertyFeature::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; @@ -1808,8 +1809,8 @@ inline void VertexPropertyTrait::SharedCtor( }; } -VertexPropertyTrait::~VertexPropertyTrait() { - // @@protoc_insertion_point(destructor:grin.VertexPropertyTrait) +VertexPropertyFeature::~VertexPropertyFeature() { + // @@protoc_insertion_point(destructor:grin.VertexPropertyFeature) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -1817,16 +1818,16 @@ VertexPropertyTrait::~VertexPropertyTrait() { SharedDtor(); } -inline void VertexPropertyTrait::SharedDtor() { +inline void VertexPropertyFeature::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void VertexPropertyTrait::SetCachedSize(int size) const { +void VertexPropertyFeature::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void VertexPropertyTrait::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.VertexPropertyTrait) +void VertexPropertyFeature::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.VertexPropertyFeature) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -1837,7 +1838,7 @@ void VertexPropertyTrait::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* VertexPropertyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* VertexPropertyFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; @@ -1930,9 +1931,9 @@ const char* VertexPropertyTrait::_InternalParse(const char* ptr, ::_pbi::ParseCo #undef CHK_ } -uint8_t* VertexPropertyTrait::_InternalSerialize( +uint8_t* VertexPropertyFeature::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.VertexPropertyTrait) + // @@protoc_insertion_point(serialize_to_array_start:grin.VertexPropertyFeature) uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -1988,12 +1989,12 @@ uint8_t* VertexPropertyTrait::_InternalSerialize( target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:grin.VertexPropertyTrait) + // @@protoc_insertion_point(serialize_to_array_end:grin.VertexPropertyFeature) return target; } -size_t VertexPropertyTrait::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.VertexPropertyTrait) +size_t VertexPropertyFeature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.VertexPropertyFeature) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -2043,17 +2044,17 @@ size_t VertexPropertyTrait::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData VertexPropertyTrait::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData VertexPropertyFeature::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - VertexPropertyTrait::MergeImpl + VertexPropertyFeature::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*VertexPropertyTrait::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*VertexPropertyFeature::GetClassData() const { return &_class_data_; } -void VertexPropertyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.VertexPropertyTrait) +void VertexPropertyFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.VertexPropertyFeature) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -2085,29 +2086,29 @@ void VertexPropertyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, co _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void VertexPropertyTrait::CopyFrom(const VertexPropertyTrait& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.VertexPropertyTrait) +void VertexPropertyFeature::CopyFrom(const VertexPropertyFeature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.VertexPropertyFeature) if (&from == this) return; Clear(); MergeFrom(from); } -bool VertexPropertyTrait::IsInitialized() const { +bool VertexPropertyFeature::IsInitialized() const { return true; } -void VertexPropertyTrait::InternalSwap(VertexPropertyTrait* other) { +void VertexPropertyFeature::InternalSwap(VertexPropertyFeature* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(VertexPropertyTrait, _impl_.grin_assume_by_type_vertex_original_id_) - + sizeof(VertexPropertyTrait::_impl_.grin_assume_by_type_vertex_original_id_) - - PROTOBUF_FIELD_OFFSET(VertexPropertyTrait, _impl_.grin_with_vertex_property_)>( + PROTOBUF_FIELD_OFFSET(VertexPropertyFeature, _impl_.grin_assume_by_type_vertex_original_id_) + + sizeof(VertexPropertyFeature::_impl_.grin_assume_by_type_vertex_original_id_) + - PROTOBUF_FIELD_OFFSET(VertexPropertyFeature, _impl_.grin_with_vertex_property_)>( reinterpret_cast(&_impl_.grin_with_vertex_property_), reinterpret_cast(&other->_impl_.grin_with_vertex_property_)); } -::PROTOBUF_NAMESPACE_ID::Metadata VertexPropertyTrait::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata VertexPropertyFeature::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, file_level_metadata_graph_2eproto[3]); @@ -2115,19 +2116,19 @@ ::PROTOBUF_NAMESPACE_ID::Metadata VertexPropertyTrait::GetMetadata() const { // =================================================================== -class EdgePropertyTrait::_Internal { +class EdgePropertyFeature::_Internal { public: }; -EdgePropertyTrait::EdgePropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, +EdgePropertyFeature::EdgePropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:grin.EdgePropertyTrait) + // @@protoc_insertion_point(arena_constructor:grin.EdgePropertyFeature) } -EdgePropertyTrait::EdgePropertyTrait(const EdgePropertyTrait& from) +EdgePropertyFeature::EdgePropertyFeature(const EdgePropertyFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - EdgePropertyTrait* const _this = this; (void)_this; + EdgePropertyFeature* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.grin_with_edge_property_){} , decltype(_impl_.grin_with_edge_property_name_){} @@ -2142,10 +2143,10 @@ EdgePropertyTrait::EdgePropertyTrait(const EdgePropertyTrait& from) ::memcpy(&_impl_.grin_with_edge_property_, &from._impl_.grin_with_edge_property_, static_cast(reinterpret_cast(&_impl_.grin_trait_natural_id_for_edge_property_) - reinterpret_cast(&_impl_.grin_with_edge_property_)) + sizeof(_impl_.grin_trait_natural_id_for_edge_property_)); - // @@protoc_insertion_point(copy_constructor:grin.EdgePropertyTrait) + // @@protoc_insertion_point(copy_constructor:grin.EdgePropertyFeature) } -inline void EdgePropertyTrait::SharedCtor( +inline void EdgePropertyFeature::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; @@ -2161,8 +2162,8 @@ inline void EdgePropertyTrait::SharedCtor( }; } -EdgePropertyTrait::~EdgePropertyTrait() { - // @@protoc_insertion_point(destructor:grin.EdgePropertyTrait) +EdgePropertyFeature::~EdgePropertyFeature() { + // @@protoc_insertion_point(destructor:grin.EdgePropertyFeature) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -2170,16 +2171,16 @@ EdgePropertyTrait::~EdgePropertyTrait() { SharedDtor(); } -inline void EdgePropertyTrait::SharedDtor() { +inline void EdgePropertyFeature::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void EdgePropertyTrait::SetCachedSize(int size) const { +void EdgePropertyFeature::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void EdgePropertyTrait::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.EdgePropertyTrait) +void EdgePropertyFeature::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.EdgePropertyFeature) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -2190,7 +2191,7 @@ void EdgePropertyTrait::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* EdgePropertyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* EdgePropertyFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; @@ -2275,9 +2276,9 @@ const char* EdgePropertyTrait::_InternalParse(const char* ptr, ::_pbi::ParseCont #undef CHK_ } -uint8_t* EdgePropertyTrait::_InternalSerialize( +uint8_t* EdgePropertyFeature::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.EdgePropertyTrait) + // @@protoc_insertion_point(serialize_to_array_start:grin.EdgePropertyFeature) uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -2327,12 +2328,12 @@ uint8_t* EdgePropertyTrait::_InternalSerialize( target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:grin.EdgePropertyTrait) + // @@protoc_insertion_point(serialize_to_array_end:grin.EdgePropertyFeature) return target; } -size_t EdgePropertyTrait::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.EdgePropertyTrait) +size_t EdgePropertyFeature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.EdgePropertyFeature) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -2377,17 +2378,17 @@ size_t EdgePropertyTrait::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EdgePropertyTrait::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EdgePropertyFeature::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - EdgePropertyTrait::MergeImpl + EdgePropertyFeature::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EdgePropertyTrait::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EdgePropertyFeature::GetClassData() const { return &_class_data_; } -void EdgePropertyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.EdgePropertyTrait) +void EdgePropertyFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.EdgePropertyFeature) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -2416,29 +2417,29 @@ void EdgePropertyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, cons _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void EdgePropertyTrait::CopyFrom(const EdgePropertyTrait& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.EdgePropertyTrait) +void EdgePropertyFeature::CopyFrom(const EdgePropertyFeature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.EdgePropertyFeature) if (&from == this) return; Clear(); MergeFrom(from); } -bool EdgePropertyTrait::IsInitialized() const { +bool EdgePropertyFeature::IsInitialized() const { return true; } -void EdgePropertyTrait::InternalSwap(EdgePropertyTrait* other) { +void EdgePropertyFeature::InternalSwap(EdgePropertyFeature* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(EdgePropertyTrait, _impl_.grin_trait_natural_id_for_edge_property_) - + sizeof(EdgePropertyTrait::_impl_.grin_trait_natural_id_for_edge_property_) - - PROTOBUF_FIELD_OFFSET(EdgePropertyTrait, _impl_.grin_with_edge_property_)>( + PROTOBUF_FIELD_OFFSET(EdgePropertyFeature, _impl_.grin_trait_natural_id_for_edge_property_) + + sizeof(EdgePropertyFeature::_impl_.grin_trait_natural_id_for_edge_property_) + - PROTOBUF_FIELD_OFFSET(EdgePropertyFeature, _impl_.grin_with_edge_property_)>( reinterpret_cast(&_impl_.grin_with_edge_property_), reinterpret_cast(&other->_impl_.grin_with_edge_property_)); } -::PROTOBUF_NAMESPACE_ID::Metadata EdgePropertyTrait::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata EdgePropertyFeature::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, file_level_metadata_graph_2eproto[4]); @@ -2446,32 +2447,32 @@ ::PROTOBUF_NAMESPACE_ID::Metadata EdgePropertyTrait::GetMetadata() const { // =================================================================== -class PropertyTrait::_Internal { +class PropertyFeature::_Internal { public: - static const ::grin::VertexPropertyTrait& vertex_property_trait(const PropertyTrait* msg); - static const ::grin::EdgePropertyTrait& edge_property_trait(const PropertyTrait* msg); + static const ::grin::VertexPropertyFeature& vertex_property_feature(const PropertyFeature* msg); + static const ::grin::EdgePropertyFeature& edge_property_feature(const PropertyFeature* msg); }; -const ::grin::VertexPropertyTrait& -PropertyTrait::_Internal::vertex_property_trait(const PropertyTrait* msg) { - return *msg->_impl_.vertex_property_trait_; +const ::grin::VertexPropertyFeature& +PropertyFeature::_Internal::vertex_property_feature(const PropertyFeature* msg) { + return *msg->_impl_.vertex_property_feature_; } -const ::grin::EdgePropertyTrait& -PropertyTrait::_Internal::edge_property_trait(const PropertyTrait* msg) { - return *msg->_impl_.edge_property_trait_; +const ::grin::EdgePropertyFeature& +PropertyFeature::_Internal::edge_property_feature(const PropertyFeature* msg) { + return *msg->_impl_.edge_property_feature_; } -PropertyTrait::PropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, +PropertyFeature::PropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:grin.PropertyTrait) + // @@protoc_insertion_point(arena_constructor:grin.PropertyFeature) } -PropertyTrait::PropertyTrait(const PropertyTrait& from) +PropertyFeature::PropertyFeature(const PropertyFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - PropertyTrait* const _this = this; (void)_this; + PropertyFeature* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.vertex_property_trait_){nullptr} - , decltype(_impl_.edge_property_trait_){nullptr} + decltype(_impl_.vertex_property_feature_){nullptr} + , decltype(_impl_.edge_property_feature_){nullptr} , decltype(_impl_.vertex_property_){} , decltype(_impl_.edge_property_){} , decltype(_impl_.grin_enable_row_){} @@ -2485,25 +2486,25 @@ PropertyTrait::PropertyTrait(const PropertyTrait& from) , /*decltype(_impl_._cached_size_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - if (from._internal_has_vertex_property_trait()) { - _this->_impl_.vertex_property_trait_ = new ::grin::VertexPropertyTrait(*from._impl_.vertex_property_trait_); + if (from._internal_has_vertex_property_feature()) { + _this->_impl_.vertex_property_feature_ = new ::grin::VertexPropertyFeature(*from._impl_.vertex_property_feature_); } - if (from._internal_has_edge_property_trait()) { - _this->_impl_.edge_property_trait_ = new ::grin::EdgePropertyTrait(*from._impl_.edge_property_trait_); + if (from._internal_has_edge_property_feature()) { + _this->_impl_.edge_property_feature_ = new ::grin::EdgePropertyFeature(*from._impl_.edge_property_feature_); } ::memcpy(&_impl_.vertex_property_, &from._impl_.vertex_property_, static_cast(reinterpret_cast(&_impl_.grin_trait_specific_vev_relation_) - reinterpret_cast(&_impl_.vertex_property_)) + sizeof(_impl_.grin_trait_specific_vev_relation_)); - // @@protoc_insertion_point(copy_constructor:grin.PropertyTrait) + // @@protoc_insertion_point(copy_constructor:grin.PropertyFeature) } -inline void PropertyTrait::SharedCtor( +inline void PropertyFeature::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.vertex_property_trait_){nullptr} - , decltype(_impl_.edge_property_trait_){nullptr} + decltype(_impl_.vertex_property_feature_){nullptr} + , decltype(_impl_.edge_property_feature_){nullptr} , decltype(_impl_.vertex_property_){0} , decltype(_impl_.edge_property_){0} , decltype(_impl_.grin_enable_row_){false} @@ -2518,8 +2519,8 @@ inline void PropertyTrait::SharedCtor( }; } -PropertyTrait::~PropertyTrait() { - // @@protoc_insertion_point(destructor:grin.PropertyTrait) +PropertyFeature::~PropertyFeature() { + // @@protoc_insertion_point(destructor:grin.PropertyFeature) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -2527,37 +2528,37 @@ PropertyTrait::~PropertyTrait() { SharedDtor(); } -inline void PropertyTrait::SharedDtor() { +inline void PropertyFeature::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.vertex_property_trait_; - if (this != internal_default_instance()) delete _impl_.edge_property_trait_; + if (this != internal_default_instance()) delete _impl_.vertex_property_feature_; + if (this != internal_default_instance()) delete _impl_.edge_property_feature_; } -void PropertyTrait::SetCachedSize(int size) const { +void PropertyFeature::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void PropertyTrait::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.PropertyTrait) +void PropertyFeature::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.PropertyFeature) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (GetArenaForAllocation() == nullptr && _impl_.vertex_property_trait_ != nullptr) { - delete _impl_.vertex_property_trait_; + if (GetArenaForAllocation() == nullptr && _impl_.vertex_property_feature_ != nullptr) { + delete _impl_.vertex_property_feature_; } - _impl_.vertex_property_trait_ = nullptr; - if (GetArenaForAllocation() == nullptr && _impl_.edge_property_trait_ != nullptr) { - delete _impl_.edge_property_trait_; + _impl_.vertex_property_feature_ = nullptr; + if (GetArenaForAllocation() == nullptr && _impl_.edge_property_feature_ != nullptr) { + delete _impl_.edge_property_feature_; } - _impl_.edge_property_trait_ = nullptr; + _impl_.edge_property_feature_ = nullptr; ::memset(&_impl_.vertex_property_, 0, static_cast( reinterpret_cast(&_impl_.grin_trait_specific_vev_relation_) - reinterpret_cast(&_impl_.vertex_property_)) + sizeof(_impl_.grin_trait_specific_vev_relation_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* PropertyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* PropertyFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; @@ -2571,18 +2572,18 @@ const char* PropertyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* } else goto handle_unusual; continue; - // .grin.VertexPropertyTrait vertex_property_trait = 2; + // .grin.VertexPropertyFeature vertex_property_feature = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_vertex_property_trait(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_vertex_property_feature(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .grin.EdgePropertyTrait edge_property_trait = 3; + // .grin.EdgePropertyFeature edge_property_feature = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_edge_property_trait(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_edge_property_feature(), ptr); CHK_(ptr); } else goto handle_unusual; @@ -2684,9 +2685,9 @@ const char* PropertyTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* #undef CHK_ } -uint8_t* PropertyTrait::_InternalSerialize( +uint8_t* PropertyFeature::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.PropertyTrait) + // @@protoc_insertion_point(serialize_to_array_start:grin.PropertyFeature) uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -2696,18 +2697,18 @@ uint8_t* PropertyTrait::_InternalSerialize( target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_enable_row(), target); } - // .grin.VertexPropertyTrait vertex_property_trait = 2; - if (this->_internal_has_vertex_property_trait()) { + // .grin.VertexPropertyFeature vertex_property_feature = 2; + if (this->_internal_has_vertex_property_feature()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::vertex_property_trait(this), - _Internal::vertex_property_trait(this).GetCachedSize(), target, stream); + InternalWriteMessage(2, _Internal::vertex_property_feature(this), + _Internal::vertex_property_feature(this).GetCachedSize(), target, stream); } - // .grin.EdgePropertyTrait edge_property_trait = 3; - if (this->_internal_has_edge_property_trait()) { + // .grin.EdgePropertyFeature edge_property_feature = 3; + if (this->_internal_has_edge_property_feature()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::edge_property_trait(this), - _Internal::edge_property_trait(this).GetCachedSize(), target, stream); + InternalWriteMessage(3, _Internal::edge_property_feature(this), + _Internal::edge_property_feature(this).GetCachedSize(), target, stream); } // .grin.PropertyDataPartitionStrategy vertex_property = 4; @@ -2770,30 +2771,30 @@ uint8_t* PropertyTrait::_InternalSerialize( target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:grin.PropertyTrait) + // @@protoc_insertion_point(serialize_to_array_end:grin.PropertyFeature) return target; } -size_t PropertyTrait::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.PropertyTrait) +size_t PropertyFeature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.PropertyFeature) size_t total_size = 0; uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // .grin.VertexPropertyTrait vertex_property_trait = 2; - if (this->_internal_has_vertex_property_trait()) { + // .grin.VertexPropertyFeature vertex_property_feature = 2; + if (this->_internal_has_vertex_property_feature()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.vertex_property_trait_); + *_impl_.vertex_property_feature_); } - // .grin.EdgePropertyTrait edge_property_trait = 3; - if (this->_internal_has_edge_property_trait()) { + // .grin.EdgePropertyFeature edge_property_feature = 3; + if (this->_internal_has_edge_property_feature()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.edge_property_trait_); + *_impl_.edge_property_feature_); } // .grin.PropertyDataPartitionStrategy vertex_property = 4; @@ -2851,28 +2852,28 @@ size_t PropertyTrait::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PropertyTrait::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PropertyFeature::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - PropertyTrait::MergeImpl + PropertyFeature::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PropertyTrait::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PropertyFeature::GetClassData() const { return &_class_data_; } -void PropertyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.PropertyTrait) +void PropertyFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.PropertyFeature) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_has_vertex_property_trait()) { - _this->_internal_mutable_vertex_property_trait()->::grin::VertexPropertyTrait::MergeFrom( - from._internal_vertex_property_trait()); + if (from._internal_has_vertex_property_feature()) { + _this->_internal_mutable_vertex_property_feature()->::grin::VertexPropertyFeature::MergeFrom( + from._internal_vertex_property_feature()); } - if (from._internal_has_edge_property_trait()) { - _this->_internal_mutable_edge_property_trait()->::grin::EdgePropertyTrait::MergeFrom( - from._internal_edge_property_trait()); + if (from._internal_has_edge_property_feature()) { + _this->_internal_mutable_edge_property_feature()->::grin::EdgePropertyFeature::MergeFrom( + from._internal_edge_property_feature()); } if (from._internal_vertex_property() != 0) { _this->_internal_set_vertex_property(from._internal_vertex_property()); @@ -2907,29 +2908,29 @@ void PropertyTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const :: _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void PropertyTrait::CopyFrom(const PropertyTrait& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.PropertyTrait) +void PropertyFeature::CopyFrom(const PropertyFeature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.PropertyFeature) if (&from == this) return; Clear(); MergeFrom(from); } -bool PropertyTrait::IsInitialized() const { +bool PropertyFeature::IsInitialized() const { return true; } -void PropertyTrait::InternalSwap(PropertyTrait* other) { +void PropertyFeature::InternalSwap(PropertyFeature* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(PropertyTrait, _impl_.grin_trait_specific_vev_relation_) - + sizeof(PropertyTrait::_impl_.grin_trait_specific_vev_relation_) - - PROTOBUF_FIELD_OFFSET(PropertyTrait, _impl_.vertex_property_trait_)>( - reinterpret_cast(&_impl_.vertex_property_trait_), - reinterpret_cast(&other->_impl_.vertex_property_trait_)); + PROTOBUF_FIELD_OFFSET(PropertyFeature, _impl_.grin_trait_specific_vev_relation_) + + sizeof(PropertyFeature::_impl_.grin_trait_specific_vev_relation_) + - PROTOBUF_FIELD_OFFSET(PropertyFeature, _impl_.vertex_property_feature_)>( + reinterpret_cast(&_impl_.vertex_property_feature_), + reinterpret_cast(&other->_impl_.vertex_property_feature_)); } -::PROTOBUF_NAMESPACE_ID::Metadata PropertyTrait::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata PropertyFeature::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, file_level_metadata_graph_2eproto[5]); @@ -2937,19 +2938,19 @@ ::PROTOBUF_NAMESPACE_ID::Metadata PropertyTrait::GetMetadata() const { // =================================================================== -class IndexTrait::_Internal { +class IndexFeature::_Internal { public: }; -IndexTrait::IndexTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, +IndexFeature::IndexFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:grin.IndexTrait) + // @@protoc_insertion_point(arena_constructor:grin.IndexFeature) } -IndexTrait::IndexTrait(const IndexTrait& from) +IndexFeature::IndexFeature(const IndexFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - IndexTrait* const _this = this; (void)_this; + IndexFeature* const _this = this; (void)_this; new (&_impl_) Impl_{ decltype(_impl_.grin_with_vertex_label_){} , decltype(_impl_.grin_with_edge_label_){} @@ -2960,10 +2961,10 @@ IndexTrait::IndexTrait(const IndexTrait& from) ::memcpy(&_impl_.grin_with_vertex_label_, &from._impl_.grin_with_vertex_label_, static_cast(reinterpret_cast(&_impl_.grin_assume_all_vertex_list_sorted_) - reinterpret_cast(&_impl_.grin_with_vertex_label_)) + sizeof(_impl_.grin_assume_all_vertex_list_sorted_)); - // @@protoc_insertion_point(copy_constructor:grin.IndexTrait) + // @@protoc_insertion_point(copy_constructor:grin.IndexFeature) } -inline void IndexTrait::SharedCtor( +inline void IndexFeature::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; @@ -2975,8 +2976,8 @@ inline void IndexTrait::SharedCtor( }; } -IndexTrait::~IndexTrait() { - // @@protoc_insertion_point(destructor:grin.IndexTrait) +IndexFeature::~IndexFeature() { + // @@protoc_insertion_point(destructor:grin.IndexFeature) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -2984,16 +2985,16 @@ IndexTrait::~IndexTrait() { SharedDtor(); } -inline void IndexTrait::SharedDtor() { +inline void IndexFeature::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); } -void IndexTrait::SetCachedSize(int size) const { +void IndexFeature::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void IndexTrait::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.IndexTrait) +void IndexFeature::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.IndexFeature) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3004,7 +3005,7 @@ void IndexTrait::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* IndexTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* IndexFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; @@ -3057,9 +3058,9 @@ const char* IndexTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct #undef CHK_ } -uint8_t* IndexTrait::_InternalSerialize( +uint8_t* IndexFeature::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.IndexTrait) + // @@protoc_insertion_point(serialize_to_array_start:grin.IndexFeature) uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -3085,12 +3086,12 @@ uint8_t* IndexTrait::_InternalSerialize( target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:grin.IndexTrait) + // @@protoc_insertion_point(serialize_to_array_end:grin.IndexFeature) return target; } -size_t IndexTrait::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.IndexTrait) +size_t IndexFeature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.IndexFeature) size_t total_size = 0; uint32_t cached_has_bits = 0; @@ -3115,17 +3116,17 @@ size_t IndexTrait::ByteSizeLong() const { return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData IndexTrait::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData IndexFeature::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - IndexTrait::MergeImpl + IndexFeature::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*IndexTrait::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*IndexFeature::GetClassData() const { return &_class_data_; } -void IndexTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.IndexTrait) +void IndexFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.IndexFeature) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; @@ -3142,29 +3143,29 @@ void IndexTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PRO _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void IndexTrait::CopyFrom(const IndexTrait& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.IndexTrait) +void IndexFeature::CopyFrom(const IndexFeature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.IndexFeature) if (&from == this) return; Clear(); MergeFrom(from); } -bool IndexTrait::IsInitialized() const { +bool IndexFeature::IsInitialized() const { return true; } -void IndexTrait::InternalSwap(IndexTrait* other) { +void IndexFeature::InternalSwap(IndexFeature* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(IndexTrait, _impl_.grin_assume_all_vertex_list_sorted_) - + sizeof(IndexTrait::_impl_.grin_assume_all_vertex_list_sorted_) - - PROTOBUF_FIELD_OFFSET(IndexTrait, _impl_.grin_with_vertex_label_)>( + PROTOBUF_FIELD_OFFSET(IndexFeature, _impl_.grin_assume_all_vertex_list_sorted_) + + sizeof(IndexFeature::_impl_.grin_assume_all_vertex_list_sorted_) + - PROTOBUF_FIELD_OFFSET(IndexFeature, _impl_.grin_with_vertex_label_)>( reinterpret_cast(&_impl_.grin_with_vertex_label_), reinterpret_cast(&other->_impl_.grin_with_vertex_label_)); } -::PROTOBUF_NAMESPACE_ID::Metadata IndexTrait::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata IndexFeature::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, file_level_metadata_graph_2eproto[6]); @@ -3172,31 +3173,31 @@ ::PROTOBUF_NAMESPACE_ID::Metadata IndexTrait::GetMetadata() const { // =================================================================== -class PredicateTrait::_Internal { +class PredicateFeature::_Internal { public: }; -PredicateTrait::PredicateTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, +PredicateFeature::PredicateFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { - // @@protoc_insertion_point(arena_constructor:grin.PredicateTrait) + // @@protoc_insertion_point(arena_constructor:grin.PredicateFeature) } -PredicateTrait::PredicateTrait(const PredicateTrait& from) +PredicateFeature::PredicateFeature(const PredicateFeature& from) : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { - PredicateTrait* const _this = this; (void)_this; + PredicateFeature* const _this = this; (void)_this; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:grin.PredicateTrait) + // @@protoc_insertion_point(copy_constructor:grin.PredicateFeature) } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PredicateTrait::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PredicateFeature::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PredicateTrait::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PredicateFeature::GetClassData() const { return &_class_data_; } @@ -3204,7 +3205,7 @@ const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PredicateTrait::GetClassData() -::PROTOBUF_NAMESPACE_ID::Metadata PredicateTrait::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata PredicateFeature::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, file_level_metadata_graph_2eproto[7]); @@ -3212,173 +3213,173 @@ ::PROTOBUF_NAMESPACE_ID::Metadata PredicateTrait::GetMetadata() const { // =================================================================== -class StorageTrait::_Internal { +class StorageFeature::_Internal { public: - static const ::grin::TopologyTrait& topology_trait(const StorageTrait* msg); - static const ::grin::PartitionTrait& partition_trait(const StorageTrait* msg); - static const ::grin::PropertyTrait& property_trait(const StorageTrait* msg); - static const ::grin::IndexTrait& index_trait(const StorageTrait* msg); - static const ::grin::PredicateTrait& predicate_trait(const StorageTrait* msg); + static const ::grin::TopologyFeature& topology_feature(const StorageFeature* msg); + static const ::grin::PartitionFeature& partition_feature(const StorageFeature* msg); + static const ::grin::PropertyFeature& property_feature(const StorageFeature* msg); + static const ::grin::IndexFeature& index_feature(const StorageFeature* msg); + static const ::grin::PredicateFeature& predicate_feature(const StorageFeature* msg); }; -const ::grin::TopologyTrait& -StorageTrait::_Internal::topology_trait(const StorageTrait* msg) { - return *msg->_impl_.specific_trait_.topology_trait_; +const ::grin::TopologyFeature& +StorageFeature::_Internal::topology_feature(const StorageFeature* msg) { + return *msg->_impl_.specific_feature_.topology_feature_; } -const ::grin::PartitionTrait& -StorageTrait::_Internal::partition_trait(const StorageTrait* msg) { - return *msg->_impl_.specific_trait_.partition_trait_; +const ::grin::PartitionFeature& +StorageFeature::_Internal::partition_feature(const StorageFeature* msg) { + return *msg->_impl_.specific_feature_.partition_feature_; } -const ::grin::PropertyTrait& -StorageTrait::_Internal::property_trait(const StorageTrait* msg) { - return *msg->_impl_.specific_trait_.property_trait_; +const ::grin::PropertyFeature& +StorageFeature::_Internal::property_feature(const StorageFeature* msg) { + return *msg->_impl_.specific_feature_.property_feature_; } -const ::grin::IndexTrait& -StorageTrait::_Internal::index_trait(const StorageTrait* msg) { - return *msg->_impl_.specific_trait_.index_trait_; +const ::grin::IndexFeature& +StorageFeature::_Internal::index_feature(const StorageFeature* msg) { + return *msg->_impl_.specific_feature_.index_feature_; } -const ::grin::PredicateTrait& -StorageTrait::_Internal::predicate_trait(const StorageTrait* msg) { - return *msg->_impl_.specific_trait_.predicate_trait_; +const ::grin::PredicateFeature& +StorageFeature::_Internal::predicate_feature(const StorageFeature* msg) { + return *msg->_impl_.specific_feature_.predicate_feature_; } -void StorageTrait::set_allocated_topology_trait(::grin::TopologyTrait* topology_trait) { +void StorageFeature::set_allocated_topology_feature(::grin::TopologyFeature* topology_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - clear_specific_trait(); - if (topology_trait) { + clear_specific_feature(); + if (topology_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(topology_trait); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(topology_feature); if (message_arena != submessage_arena) { - topology_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, topology_trait, submessage_arena); + topology_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, topology_feature, submessage_arena); } - set_has_topology_trait(); - _impl_.specific_trait_.topology_trait_ = topology_trait; + set_has_topology_feature(); + _impl_.specific_feature_.topology_feature_ = topology_feature; } - // @@protoc_insertion_point(field_set_allocated:grin.StorageTrait.topology_trait) + // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.topology_feature) } -void StorageTrait::set_allocated_partition_trait(::grin::PartitionTrait* partition_trait) { +void StorageFeature::set_allocated_partition_feature(::grin::PartitionFeature* partition_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - clear_specific_trait(); - if (partition_trait) { + clear_specific_feature(); + if (partition_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(partition_trait); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(partition_feature); if (message_arena != submessage_arena) { - partition_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, partition_trait, submessage_arena); + partition_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, partition_feature, submessage_arena); } - set_has_partition_trait(); - _impl_.specific_trait_.partition_trait_ = partition_trait; + set_has_partition_feature(); + _impl_.specific_feature_.partition_feature_ = partition_feature; } - // @@protoc_insertion_point(field_set_allocated:grin.StorageTrait.partition_trait) + // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.partition_feature) } -void StorageTrait::set_allocated_property_trait(::grin::PropertyTrait* property_trait) { +void StorageFeature::set_allocated_property_feature(::grin::PropertyFeature* property_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - clear_specific_trait(); - if (property_trait) { + clear_specific_feature(); + if (property_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(property_trait); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(property_feature); if (message_arena != submessage_arena) { - property_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, property_trait, submessage_arena); + property_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, property_feature, submessage_arena); } - set_has_property_trait(); - _impl_.specific_trait_.property_trait_ = property_trait; + set_has_property_feature(); + _impl_.specific_feature_.property_feature_ = property_feature; } - // @@protoc_insertion_point(field_set_allocated:grin.StorageTrait.property_trait) + // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.property_feature) } -void StorageTrait::set_allocated_index_trait(::grin::IndexTrait* index_trait) { +void StorageFeature::set_allocated_index_feature(::grin::IndexFeature* index_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - clear_specific_trait(); - if (index_trait) { + clear_specific_feature(); + if (index_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(index_trait); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(index_feature); if (message_arena != submessage_arena) { - index_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, index_trait, submessage_arena); + index_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, index_feature, submessage_arena); } - set_has_index_trait(); - _impl_.specific_trait_.index_trait_ = index_trait; + set_has_index_feature(); + _impl_.specific_feature_.index_feature_ = index_feature; } - // @@protoc_insertion_point(field_set_allocated:grin.StorageTrait.index_trait) + // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.index_feature) } -void StorageTrait::set_allocated_predicate_trait(::grin::PredicateTrait* predicate_trait) { +void StorageFeature::set_allocated_predicate_feature(::grin::PredicateFeature* predicate_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); - clear_specific_trait(); - if (predicate_trait) { + clear_specific_feature(); + if (predicate_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(predicate_trait); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(predicate_feature); if (message_arena != submessage_arena) { - predicate_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, predicate_trait, submessage_arena); + predicate_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, predicate_feature, submessage_arena); } - set_has_predicate_trait(); - _impl_.specific_trait_.predicate_trait_ = predicate_trait; + set_has_predicate_feature(); + _impl_.specific_feature_.predicate_feature_ = predicate_feature; } - // @@protoc_insertion_point(field_set_allocated:grin.StorageTrait.predicate_trait) + // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.predicate_feature) } -StorageTrait::StorageTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, +StorageFeature::StorageFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned) : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { SharedCtor(arena, is_message_owned); - // @@protoc_insertion_point(arena_constructor:grin.StorageTrait) + // @@protoc_insertion_point(arena_constructor:grin.StorageFeature) } -StorageTrait::StorageTrait(const StorageTrait& from) +StorageFeature::StorageFeature(const StorageFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - StorageTrait* const _this = this; (void)_this; + StorageFeature* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.specific_trait_){} + decltype(_impl_.specific_feature_){} , /*decltype(_impl_._cached_size_)*/{} , /*decltype(_impl_._oneof_case_)*/{}}; _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - clear_has_specific_trait(); - switch (from.specific_trait_case()) { - case kTopologyTrait: { - _this->_internal_mutable_topology_trait()->::grin::TopologyTrait::MergeFrom( - from._internal_topology_trait()); + clear_has_specific_feature(); + switch (from.specific_feature_case()) { + case kTopologyFeature: { + _this->_internal_mutable_topology_feature()->::grin::TopologyFeature::MergeFrom( + from._internal_topology_feature()); break; } - case kPartitionTrait: { - _this->_internal_mutable_partition_trait()->::grin::PartitionTrait::MergeFrom( - from._internal_partition_trait()); + case kPartitionFeature: { + _this->_internal_mutable_partition_feature()->::grin::PartitionFeature::MergeFrom( + from._internal_partition_feature()); break; } - case kPropertyTrait: { - _this->_internal_mutable_property_trait()->::grin::PropertyTrait::MergeFrom( - from._internal_property_trait()); + case kPropertyFeature: { + _this->_internal_mutable_property_feature()->::grin::PropertyFeature::MergeFrom( + from._internal_property_feature()); break; } - case kIndexTrait: { - _this->_internal_mutable_index_trait()->::grin::IndexTrait::MergeFrom( - from._internal_index_trait()); + case kIndexFeature: { + _this->_internal_mutable_index_feature()->::grin::IndexFeature::MergeFrom( + from._internal_index_feature()); break; } - case kPredicateTrait: { - _this->_internal_mutable_predicate_trait()->::grin::PredicateTrait::MergeFrom( - from._internal_predicate_trait()); + case kPredicateFeature: { + _this->_internal_mutable_predicate_feature()->::grin::PredicateFeature::MergeFrom( + from._internal_predicate_feature()); break; } - case SPECIFIC_TRAIT_NOT_SET: { + case SPECIFIC_FEATURE_NOT_SET: { break; } } - // @@protoc_insertion_point(copy_constructor:grin.StorageTrait) + // @@protoc_insertion_point(copy_constructor:grin.StorageFeature) } -inline void StorageTrait::SharedCtor( +inline void StorageFeature::SharedCtor( ::_pb::Arena* arena, bool is_message_owned) { (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.specific_trait_){} + decltype(_impl_.specific_feature_){} , /*decltype(_impl_._cached_size_)*/{} , /*decltype(_impl_._oneof_case_)*/{} }; - clear_has_specific_trait(); + clear_has_specific_feature(); } -StorageTrait::~StorageTrait() { - // @@protoc_insertion_point(destructor:grin.StorageTrait) +StorageFeature::~StorageFeature() { + // @@protoc_insertion_point(destructor:grin.StorageFeature) if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { (void)arena; return; @@ -3386,110 +3387,110 @@ StorageTrait::~StorageTrait() { SharedDtor(); } -inline void StorageTrait::SharedDtor() { +inline void StorageFeature::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (has_specific_trait()) { - clear_specific_trait(); + if (has_specific_feature()) { + clear_specific_feature(); } } -void StorageTrait::SetCachedSize(int size) const { +void StorageFeature::SetCachedSize(int size) const { _impl_._cached_size_.Set(size); } -void StorageTrait::clear_specific_trait() { -// @@protoc_insertion_point(one_of_clear_start:grin.StorageTrait) - switch (specific_trait_case()) { - case kTopologyTrait: { +void StorageFeature::clear_specific_feature() { +// @@protoc_insertion_point(one_of_clear_start:grin.StorageFeature) + switch (specific_feature_case()) { + case kTopologyFeature: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_trait_.topology_trait_; + delete _impl_.specific_feature_.topology_feature_; } break; } - case kPartitionTrait: { + case kPartitionFeature: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_trait_.partition_trait_; + delete _impl_.specific_feature_.partition_feature_; } break; } - case kPropertyTrait: { + case kPropertyFeature: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_trait_.property_trait_; + delete _impl_.specific_feature_.property_feature_; } break; } - case kIndexTrait: { + case kIndexFeature: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_trait_.index_trait_; + delete _impl_.specific_feature_.index_feature_; } break; } - case kPredicateTrait: { + case kPredicateFeature: { if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_trait_.predicate_trait_; + delete _impl_.specific_feature_.predicate_feature_; } break; } - case SPECIFIC_TRAIT_NOT_SET: { + case SPECIFIC_FEATURE_NOT_SET: { break; } } - _impl_._oneof_case_[0] = SPECIFIC_TRAIT_NOT_SET; + _impl_._oneof_case_[0] = SPECIFIC_FEATURE_NOT_SET; } -void StorageTrait::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.StorageTrait) +void StorageFeature::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.StorageFeature) uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - clear_specific_trait(); + clear_specific_feature(); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* StorageTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* StorageFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure while (!ctx->Done(&ptr)) { uint32_t tag; ptr = ::_pbi::ReadTag(ptr, &tag); switch (tag >> 3) { - // .grin.TopologyTrait topology_trait = 1; + // .grin.TopologyFeature topology_feature = 1; case 1: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_topology_trait(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_topology_feature(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .grin.PartitionTrait partition_trait = 2; + // .grin.PartitionFeature partition_feature = 2; case 2: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_partition_trait(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_partition_feature(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .grin.PropertyTrait property_trait = 3; + // .grin.PropertyFeature property_feature = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_property_trait(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_property_feature(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .grin.IndexTrait index_trait = 4; + // .grin.IndexFeature index_feature = 4; case 4: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { - ptr = ctx->ParseMessage(_internal_mutable_index_trait(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_index_feature(), ptr); CHK_(ptr); } else goto handle_unusual; continue; - // .grin.PredicateTrait predicate_trait = 5; + // .grin.PredicateFeature predicate_feature = 5; case 5: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { - ptr = ctx->ParseMessage(_internal_mutable_predicate_trait(), ptr); + ptr = ctx->ParseMessage(_internal_mutable_predicate_feature(), ptr); CHK_(ptr); } else goto handle_unusual; @@ -3517,173 +3518,173 @@ const char* StorageTrait::_InternalParse(const char* ptr, ::_pbi::ParseContext* #undef CHK_ } -uint8_t* StorageTrait::_InternalSerialize( +uint8_t* StorageFeature::_InternalSerialize( uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.StorageTrait) + // @@protoc_insertion_point(serialize_to_array_start:grin.StorageFeature) uint32_t cached_has_bits = 0; (void) cached_has_bits; - // .grin.TopologyTrait topology_trait = 1; - if (_internal_has_topology_trait()) { + // .grin.TopologyFeature topology_feature = 1; + if (_internal_has_topology_feature()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::topology_trait(this), - _Internal::topology_trait(this).GetCachedSize(), target, stream); + InternalWriteMessage(1, _Internal::topology_feature(this), + _Internal::topology_feature(this).GetCachedSize(), target, stream); } - // .grin.PartitionTrait partition_trait = 2; - if (_internal_has_partition_trait()) { + // .grin.PartitionFeature partition_feature = 2; + if (_internal_has_partition_feature()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::partition_trait(this), - _Internal::partition_trait(this).GetCachedSize(), target, stream); + InternalWriteMessage(2, _Internal::partition_feature(this), + _Internal::partition_feature(this).GetCachedSize(), target, stream); } - // .grin.PropertyTrait property_trait = 3; - if (_internal_has_property_trait()) { + // .grin.PropertyFeature property_feature = 3; + if (_internal_has_property_feature()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::property_trait(this), - _Internal::property_trait(this).GetCachedSize(), target, stream); + InternalWriteMessage(3, _Internal::property_feature(this), + _Internal::property_feature(this).GetCachedSize(), target, stream); } - // .grin.IndexTrait index_trait = 4; - if (_internal_has_index_trait()) { + // .grin.IndexFeature index_feature = 4; + if (_internal_has_index_feature()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::index_trait(this), - _Internal::index_trait(this).GetCachedSize(), target, stream); + InternalWriteMessage(4, _Internal::index_feature(this), + _Internal::index_feature(this).GetCachedSize(), target, stream); } - // .grin.PredicateTrait predicate_trait = 5; - if (_internal_has_predicate_trait()) { + // .grin.PredicateFeature predicate_feature = 5; + if (_internal_has_predicate_feature()) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::predicate_trait(this), - _Internal::predicate_trait(this).GetCachedSize(), target, stream); + InternalWriteMessage(5, _Internal::predicate_feature(this), + _Internal::predicate_feature(this).GetCachedSize(), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } - // @@protoc_insertion_point(serialize_to_array_end:grin.StorageTrait) + // @@protoc_insertion_point(serialize_to_array_end:grin.StorageFeature) return target; } -size_t StorageTrait::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.StorageTrait) +size_t StorageFeature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.StorageFeature) size_t total_size = 0; uint32_t cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - switch (specific_trait_case()) { - // .grin.TopologyTrait topology_trait = 1; - case kTopologyTrait: { + switch (specific_feature_case()) { + // .grin.TopologyFeature topology_feature = 1; + case kTopologyFeature: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.specific_trait_.topology_trait_); + *_impl_.specific_feature_.topology_feature_); break; } - // .grin.PartitionTrait partition_trait = 2; - case kPartitionTrait: { + // .grin.PartitionFeature partition_feature = 2; + case kPartitionFeature: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.specific_trait_.partition_trait_); + *_impl_.specific_feature_.partition_feature_); break; } - // .grin.PropertyTrait property_trait = 3; - case kPropertyTrait: { + // .grin.PropertyFeature property_feature = 3; + case kPropertyFeature: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.specific_trait_.property_trait_); + *_impl_.specific_feature_.property_feature_); break; } - // .grin.IndexTrait index_trait = 4; - case kIndexTrait: { + // .grin.IndexFeature index_feature = 4; + case kIndexFeature: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.specific_trait_.index_trait_); + *_impl_.specific_feature_.index_feature_); break; } - // .grin.PredicateTrait predicate_trait = 5; - case kPredicateTrait: { + // .grin.PredicateFeature predicate_feature = 5; + case kPredicateFeature: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.specific_trait_.predicate_trait_); + *_impl_.specific_feature_.predicate_feature_); break; } - case SPECIFIC_TRAIT_NOT_SET: { + case SPECIFIC_FEATURE_NOT_SET: { break; } } return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData StorageTrait::_class_data_ = { +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData StorageFeature::_class_data_ = { ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - StorageTrait::MergeImpl + StorageFeature::MergeImpl }; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*StorageTrait::GetClassData() const { return &_class_data_; } +const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*StorageFeature::GetClassData() const { return &_class_data_; } -void StorageTrait::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.StorageTrait) +void StorageFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:grin.StorageFeature) GOOGLE_DCHECK_NE(&from, _this); uint32_t cached_has_bits = 0; (void) cached_has_bits; - switch (from.specific_trait_case()) { - case kTopologyTrait: { - _this->_internal_mutable_topology_trait()->::grin::TopologyTrait::MergeFrom( - from._internal_topology_trait()); + switch (from.specific_feature_case()) { + case kTopologyFeature: { + _this->_internal_mutable_topology_feature()->::grin::TopologyFeature::MergeFrom( + from._internal_topology_feature()); break; } - case kPartitionTrait: { - _this->_internal_mutable_partition_trait()->::grin::PartitionTrait::MergeFrom( - from._internal_partition_trait()); + case kPartitionFeature: { + _this->_internal_mutable_partition_feature()->::grin::PartitionFeature::MergeFrom( + from._internal_partition_feature()); break; } - case kPropertyTrait: { - _this->_internal_mutable_property_trait()->::grin::PropertyTrait::MergeFrom( - from._internal_property_trait()); + case kPropertyFeature: { + _this->_internal_mutable_property_feature()->::grin::PropertyFeature::MergeFrom( + from._internal_property_feature()); break; } - case kIndexTrait: { - _this->_internal_mutable_index_trait()->::grin::IndexTrait::MergeFrom( - from._internal_index_trait()); + case kIndexFeature: { + _this->_internal_mutable_index_feature()->::grin::IndexFeature::MergeFrom( + from._internal_index_feature()); break; } - case kPredicateTrait: { - _this->_internal_mutable_predicate_trait()->::grin::PredicateTrait::MergeFrom( - from._internal_predicate_trait()); + case kPredicateFeature: { + _this->_internal_mutable_predicate_feature()->::grin::PredicateFeature::MergeFrom( + from._internal_predicate_feature()); break; } - case SPECIFIC_TRAIT_NOT_SET: { + case SPECIFIC_FEATURE_NOT_SET: { break; } } _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); } -void StorageTrait::CopyFrom(const StorageTrait& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.StorageTrait) +void StorageFeature::CopyFrom(const StorageFeature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.StorageFeature) if (&from == this) return; Clear(); MergeFrom(from); } -bool StorageTrait::IsInitialized() const { +bool StorageFeature::IsInitialized() const { return true; } -void StorageTrait::InternalSwap(StorageTrait* other) { +void StorageFeature::InternalSwap(StorageFeature* other) { using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.specific_trait_, other->_impl_.specific_trait_); + swap(_impl_.specific_feature_, other->_impl_.specific_feature_); swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); } -::PROTOBUF_NAMESPACE_ID::Metadata StorageTrait::GetMetadata() const { +::PROTOBUF_NAMESPACE_ID::Metadata StorageFeature::GetMetadata() const { return ::_pbi::AssignDescriptors( &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, file_level_metadata_graph_2eproto[8]); @@ -3993,7 +3994,7 @@ Graph::Graph(const Graph& from) : ::PROTOBUF_NAMESPACE_ID::Message() { Graph* const _this = this; (void)_this; new (&_impl_) Impl_{ - decltype(_impl_.traits_){from._impl_.traits_} + decltype(_impl_.features_){from._impl_.features_} , decltype(_impl_.uri_){} , decltype(_impl_.grin_version_){} , decltype(_impl_.statistics_){nullptr} @@ -4027,7 +4028,7 @@ inline void Graph::SharedCtor( (void)arena; (void)is_message_owned; new (&_impl_) Impl_{ - decltype(_impl_.traits_){arena} + decltype(_impl_.features_){arena} , decltype(_impl_.uri_){} , decltype(_impl_.grin_version_){} , decltype(_impl_.statistics_){nullptr} @@ -4054,7 +4055,7 @@ Graph::~Graph() { inline void Graph::SharedDtor() { GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.traits_.~RepeatedPtrField(); + _impl_.features_.~RepeatedPtrField(); _impl_.uri_.Destroy(); _impl_.grin_version_.Destroy(); if (this != internal_default_instance()) delete _impl_.statistics_; @@ -4070,7 +4071,7 @@ void Graph::Clear() { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.traits_.Clear(); + _impl_.features_.Clear(); _impl_.uri_.ClearToEmpty(); _impl_.grin_version_.ClearToEmpty(); if (GetArenaForAllocation() == nullptr && _impl_.statistics_ != nullptr) { @@ -4106,13 +4107,13 @@ const char* Graph::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { } else goto handle_unusual; continue; - // repeated .grin.StorageTrait traits = 3; + // repeated .grin.StorageFeature features = 3; case 3: if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { ptr -= 1; do { ptr += 1; - ptr = ctx->ParseMessage(_internal_add_traits(), ptr); + ptr = ctx->ParseMessage(_internal_add_features(), ptr); CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); @@ -4176,10 +4177,10 @@ uint8_t* Graph::_InternalSerialize( 2, this->_internal_grin_version(), target); } - // repeated .grin.StorageTrait traits = 3; + // repeated .grin.StorageFeature features = 3; for (unsigned i = 0, - n = static_cast(this->_internal_traits_size()); i < n; i++) { - const auto& repfield = this->_internal_traits(i); + n = static_cast(this->_internal_features_size()); i < n; i++) { + const auto& repfield = this->_internal_features(i); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); } @@ -4207,9 +4208,9 @@ size_t Graph::ByteSizeLong() const { // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - // repeated .grin.StorageTrait traits = 3; - total_size += 1UL * this->_internal_traits_size(); - for (const auto& msg : this->_impl_.traits_) { + // repeated .grin.StorageFeature features = 3; + total_size += 1UL * this->_internal_features_size(); + for (const auto& msg : this->_impl_.features_) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } @@ -4253,7 +4254,7 @@ void Graph::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF uint32_t cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.traits_.MergeFrom(from._impl_.traits_); + _this->_impl_.features_.MergeFrom(from._impl_.features_); if (!from._internal_uri().empty()) { _this->_internal_set_uri(from._internal_uri()); } @@ -4283,7 +4284,7 @@ void Graph::InternalSwap(Graph* other) { auto* lhs_arena = GetArenaForAllocation(); auto* rhs_arena = other->GetArenaForAllocation(); _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.traits_.InternalSwap(&other->_impl_.traits_); + _impl_.features_.InternalSwap(&other->_impl_.features_); ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( &_impl_.uri_, lhs_arena, &other->_impl_.uri_, rhs_arena @@ -4304,41 +4305,41 @@ ::PROTOBUF_NAMESPACE_ID::Metadata Graph::GetMetadata() const { // @@protoc_insertion_point(namespace_scope) } // namespace grin PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::grin::TopologyTrait* -Arena::CreateMaybeMessage< ::grin::TopologyTrait >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::TopologyTrait >(arena); +template<> PROTOBUF_NOINLINE ::grin::TopologyFeature* +Arena::CreateMaybeMessage< ::grin::TopologyFeature >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::TopologyFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::MirrorPartitionListTrait* -Arena::CreateMaybeMessage< ::grin::MirrorPartitionListTrait >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::MirrorPartitionListTrait >(arena); +template<> PROTOBUF_NOINLINE ::grin::MirrorPartitionListFeature* +Arena::CreateMaybeMessage< ::grin::MirrorPartitionListFeature >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::MirrorPartitionListFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::PartitionTrait* -Arena::CreateMaybeMessage< ::grin::PartitionTrait >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::PartitionTrait >(arena); +template<> PROTOBUF_NOINLINE ::grin::PartitionFeature* +Arena::CreateMaybeMessage< ::grin::PartitionFeature >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::PartitionFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::VertexPropertyTrait* -Arena::CreateMaybeMessage< ::grin::VertexPropertyTrait >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::VertexPropertyTrait >(arena); +template<> PROTOBUF_NOINLINE ::grin::VertexPropertyFeature* +Arena::CreateMaybeMessage< ::grin::VertexPropertyFeature >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::VertexPropertyFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::EdgePropertyTrait* -Arena::CreateMaybeMessage< ::grin::EdgePropertyTrait >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::EdgePropertyTrait >(arena); +template<> PROTOBUF_NOINLINE ::grin::EdgePropertyFeature* +Arena::CreateMaybeMessage< ::grin::EdgePropertyFeature >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::EdgePropertyFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::PropertyTrait* -Arena::CreateMaybeMessage< ::grin::PropertyTrait >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::PropertyTrait >(arena); +template<> PROTOBUF_NOINLINE ::grin::PropertyFeature* +Arena::CreateMaybeMessage< ::grin::PropertyFeature >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::PropertyFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::IndexTrait* -Arena::CreateMaybeMessage< ::grin::IndexTrait >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::IndexTrait >(arena); +template<> PROTOBUF_NOINLINE ::grin::IndexFeature* +Arena::CreateMaybeMessage< ::grin::IndexFeature >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::IndexFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::PredicateTrait* -Arena::CreateMaybeMessage< ::grin::PredicateTrait >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::PredicateTrait >(arena); +template<> PROTOBUF_NOINLINE ::grin::PredicateFeature* +Arena::CreateMaybeMessage< ::grin::PredicateFeature >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::PredicateFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::StorageTrait* -Arena::CreateMaybeMessage< ::grin::StorageTrait >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::StorageTrait >(arena); +template<> PROTOBUF_NOINLINE ::grin::StorageFeature* +Arena::CreateMaybeMessage< ::grin::StorageFeature >(Arena* arena) { + return Arena::CreateMessageInternal< ::grin::StorageFeature >(arena); } template<> PROTOBUF_NOINLINE ::grin::Statistics* Arena::CreateMaybeMessage< ::grin::Statistics >(Arena* arena) { diff --git a/modules/graph/grin/src/proto/graph.pb.h b/modules/graph/grin/src/proto/graph.pb.h index 0b0d081e8..ad70762c8 100644 --- a/modules/graph/grin/src/proto/graph.pb.h +++ b/modules/graph/grin/src/proto/graph.pb.h @@ -47,52 +47,52 @@ struct TableStruct_graph_2eproto { }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_graph_2eproto; namespace grin { -class EdgePropertyTrait; -struct EdgePropertyTraitDefaultTypeInternal; -extern EdgePropertyTraitDefaultTypeInternal _EdgePropertyTrait_default_instance_; +class EdgePropertyFeature; +struct EdgePropertyFeatureDefaultTypeInternal; +extern EdgePropertyFeatureDefaultTypeInternal _EdgePropertyFeature_default_instance_; class Graph; struct GraphDefaultTypeInternal; extern GraphDefaultTypeInternal _Graph_default_instance_; -class IndexTrait; -struct IndexTraitDefaultTypeInternal; -extern IndexTraitDefaultTypeInternal _IndexTrait_default_instance_; -class MirrorPartitionListTrait; -struct MirrorPartitionListTraitDefaultTypeInternal; -extern MirrorPartitionListTraitDefaultTypeInternal _MirrorPartitionListTrait_default_instance_; -class PartitionTrait; -struct PartitionTraitDefaultTypeInternal; -extern PartitionTraitDefaultTypeInternal _PartitionTrait_default_instance_; -class PredicateTrait; -struct PredicateTraitDefaultTypeInternal; -extern PredicateTraitDefaultTypeInternal _PredicateTrait_default_instance_; -class PropertyTrait; -struct PropertyTraitDefaultTypeInternal; -extern PropertyTraitDefaultTypeInternal _PropertyTrait_default_instance_; +class IndexFeature; +struct IndexFeatureDefaultTypeInternal; +extern IndexFeatureDefaultTypeInternal _IndexFeature_default_instance_; +class MirrorPartitionListFeature; +struct MirrorPartitionListFeatureDefaultTypeInternal; +extern MirrorPartitionListFeatureDefaultTypeInternal _MirrorPartitionListFeature_default_instance_; +class PartitionFeature; +struct PartitionFeatureDefaultTypeInternal; +extern PartitionFeatureDefaultTypeInternal _PartitionFeature_default_instance_; +class PredicateFeature; +struct PredicateFeatureDefaultTypeInternal; +extern PredicateFeatureDefaultTypeInternal _PredicateFeature_default_instance_; +class PropertyFeature; +struct PropertyFeatureDefaultTypeInternal; +extern PropertyFeatureDefaultTypeInternal _PropertyFeature_default_instance_; class Statistics; struct StatisticsDefaultTypeInternal; extern StatisticsDefaultTypeInternal _Statistics_default_instance_; -class StorageTrait; -struct StorageTraitDefaultTypeInternal; -extern StorageTraitDefaultTypeInternal _StorageTrait_default_instance_; -class TopologyTrait; -struct TopologyTraitDefaultTypeInternal; -extern TopologyTraitDefaultTypeInternal _TopologyTrait_default_instance_; -class VertexPropertyTrait; -struct VertexPropertyTraitDefaultTypeInternal; -extern VertexPropertyTraitDefaultTypeInternal _VertexPropertyTrait_default_instance_; +class StorageFeature; +struct StorageFeatureDefaultTypeInternal; +extern StorageFeatureDefaultTypeInternal _StorageFeature_default_instance_; +class TopologyFeature; +struct TopologyFeatureDefaultTypeInternal; +extern TopologyFeatureDefaultTypeInternal _TopologyFeature_default_instance_; +class VertexPropertyFeature; +struct VertexPropertyFeatureDefaultTypeInternal; +extern VertexPropertyFeatureDefaultTypeInternal _VertexPropertyFeature_default_instance_; } // namespace grin PROTOBUF_NAMESPACE_OPEN -template<> ::grin::EdgePropertyTrait* Arena::CreateMaybeMessage<::grin::EdgePropertyTrait>(Arena*); +template<> ::grin::EdgePropertyFeature* Arena::CreateMaybeMessage<::grin::EdgePropertyFeature>(Arena*); template<> ::grin::Graph* Arena::CreateMaybeMessage<::grin::Graph>(Arena*); -template<> ::grin::IndexTrait* Arena::CreateMaybeMessage<::grin::IndexTrait>(Arena*); -template<> ::grin::MirrorPartitionListTrait* Arena::CreateMaybeMessage<::grin::MirrorPartitionListTrait>(Arena*); -template<> ::grin::PartitionTrait* Arena::CreateMaybeMessage<::grin::PartitionTrait>(Arena*); -template<> ::grin::PredicateTrait* Arena::CreateMaybeMessage<::grin::PredicateTrait>(Arena*); -template<> ::grin::PropertyTrait* Arena::CreateMaybeMessage<::grin::PropertyTrait>(Arena*); +template<> ::grin::IndexFeature* Arena::CreateMaybeMessage<::grin::IndexFeature>(Arena*); +template<> ::grin::MirrorPartitionListFeature* Arena::CreateMaybeMessage<::grin::MirrorPartitionListFeature>(Arena*); +template<> ::grin::PartitionFeature* Arena::CreateMaybeMessage<::grin::PartitionFeature>(Arena*); +template<> ::grin::PredicateFeature* Arena::CreateMaybeMessage<::grin::PredicateFeature>(Arena*); +template<> ::grin::PropertyFeature* Arena::CreateMaybeMessage<::grin::PropertyFeature>(Arena*); template<> ::grin::Statistics* Arena::CreateMaybeMessage<::grin::Statistics>(Arena*); -template<> ::grin::StorageTrait* Arena::CreateMaybeMessage<::grin::StorageTrait>(Arena*); -template<> ::grin::TopologyTrait* Arena::CreateMaybeMessage<::grin::TopologyTrait>(Arena*); -template<> ::grin::VertexPropertyTrait* Arena::CreateMaybeMessage<::grin::VertexPropertyTrait>(Arena*); +template<> ::grin::StorageFeature* Arena::CreateMaybeMessage<::grin::StorageFeature>(Arena*); +template<> ::grin::TopologyFeature* Arena::CreateMaybeMessage<::grin::TopologyFeature>(Arena*); +template<> ::grin::VertexPropertyFeature* Arena::CreateMaybeMessage<::grin::VertexPropertyFeature>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace grin { @@ -179,24 +179,24 @@ inline bool PropertyDataPartitionStrategy_Parse( } // =================================================================== -class TopologyTrait final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.TopologyTrait) */ { +class TopologyFeature final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.TopologyFeature) */ { public: - inline TopologyTrait() : TopologyTrait(nullptr) {} - ~TopologyTrait() override; - explicit PROTOBUF_CONSTEXPR TopologyTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline TopologyFeature() : TopologyFeature(nullptr) {} + ~TopologyFeature() override; + explicit PROTOBUF_CONSTEXPR TopologyFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - TopologyTrait(const TopologyTrait& from); - TopologyTrait(TopologyTrait&& from) noexcept - : TopologyTrait() { + TopologyFeature(const TopologyFeature& from); + TopologyFeature(TopologyFeature&& from) noexcept + : TopologyFeature() { *this = ::std::move(from); } - inline TopologyTrait& operator=(const TopologyTrait& from) { + inline TopologyFeature& operator=(const TopologyFeature& from) { CopyFrom(from); return *this; } - inline TopologyTrait& operator=(TopologyTrait&& from) noexcept { + inline TopologyFeature& operator=(TopologyFeature&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -219,20 +219,20 @@ class TopologyTrait final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const TopologyTrait& default_instance() { + static const TopologyFeature& default_instance() { return *internal_default_instance(); } - static inline const TopologyTrait* internal_default_instance() { - return reinterpret_cast( - &_TopologyTrait_default_instance_); + static inline const TopologyFeature* internal_default_instance() { + return reinterpret_cast( + &_TopologyFeature_default_instance_); } static constexpr int kIndexInFileMessages = 0; - friend void swap(TopologyTrait& a, TopologyTrait& b) { + friend void swap(TopologyFeature& a, TopologyFeature& b) { a.Swap(&b); } - inline void Swap(TopologyTrait* other) { + inline void Swap(TopologyFeature* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -245,7 +245,7 @@ class TopologyTrait final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(TopologyTrait* other) { + void UnsafeArenaSwap(TopologyFeature* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -253,14 +253,14 @@ class TopologyTrait final : // implements Message ---------------------------------------------- - TopologyTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + TopologyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const TopologyTrait& from); + void CopyFrom(const TopologyFeature& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const TopologyTrait& from) { - TopologyTrait::MergeImpl(*this, from); + void MergeFrom( const TopologyFeature& from) { + TopologyFeature::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -278,15 +278,15 @@ class TopologyTrait final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(TopologyTrait* other); + void InternalSwap(TopologyFeature* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.TopologyTrait"; + return "grin.TopologyFeature"; } protected: - explicit TopologyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit TopologyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -415,7 +415,7 @@ class TopologyTrait final : void _internal_set_grin_with_edge_data(bool value); public: - // @@protoc_insertion_point(class_scope:grin.TopologyTrait) + // @@protoc_insertion_point(class_scope:grin.TopologyFeature) private: class _Internal; @@ -442,24 +442,24 @@ class TopologyTrait final : }; // ------------------------------------------------------------------- -class MirrorPartitionListTrait final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.MirrorPartitionListTrait) */ { +class MirrorPartitionListFeature final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.MirrorPartitionListFeature) */ { public: - inline MirrorPartitionListTrait() : MirrorPartitionListTrait(nullptr) {} - ~MirrorPartitionListTrait() override; - explicit PROTOBUF_CONSTEXPR MirrorPartitionListTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline MirrorPartitionListFeature() : MirrorPartitionListFeature(nullptr) {} + ~MirrorPartitionListFeature() override; + explicit PROTOBUF_CONSTEXPR MirrorPartitionListFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - MirrorPartitionListTrait(const MirrorPartitionListTrait& from); - MirrorPartitionListTrait(MirrorPartitionListTrait&& from) noexcept - : MirrorPartitionListTrait() { + MirrorPartitionListFeature(const MirrorPartitionListFeature& from); + MirrorPartitionListFeature(MirrorPartitionListFeature&& from) noexcept + : MirrorPartitionListFeature() { *this = ::std::move(from); } - inline MirrorPartitionListTrait& operator=(const MirrorPartitionListTrait& from) { + inline MirrorPartitionListFeature& operator=(const MirrorPartitionListFeature& from) { CopyFrom(from); return *this; } - inline MirrorPartitionListTrait& operator=(MirrorPartitionListTrait&& from) noexcept { + inline MirrorPartitionListFeature& operator=(MirrorPartitionListFeature&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -482,20 +482,20 @@ class MirrorPartitionListTrait final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const MirrorPartitionListTrait& default_instance() { + static const MirrorPartitionListFeature& default_instance() { return *internal_default_instance(); } - static inline const MirrorPartitionListTrait* internal_default_instance() { - return reinterpret_cast( - &_MirrorPartitionListTrait_default_instance_); + static inline const MirrorPartitionListFeature* internal_default_instance() { + return reinterpret_cast( + &_MirrorPartitionListFeature_default_instance_); } static constexpr int kIndexInFileMessages = 1; - friend void swap(MirrorPartitionListTrait& a, MirrorPartitionListTrait& b) { + friend void swap(MirrorPartitionListFeature& a, MirrorPartitionListFeature& b) { a.Swap(&b); } - inline void Swap(MirrorPartitionListTrait* other) { + inline void Swap(MirrorPartitionListFeature* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -508,7 +508,7 @@ class MirrorPartitionListTrait final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(MirrorPartitionListTrait* other) { + void UnsafeArenaSwap(MirrorPartitionListFeature* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -516,14 +516,14 @@ class MirrorPartitionListTrait final : // implements Message ---------------------------------------------- - MirrorPartitionListTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + MirrorPartitionListFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const MirrorPartitionListTrait& from); + void CopyFrom(const MirrorPartitionListFeature& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const MirrorPartitionListTrait& from) { - MirrorPartitionListTrait::MergeImpl(*this, from); + void MergeFrom( const MirrorPartitionListFeature& from) { + MirrorPartitionListFeature::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -541,15 +541,15 @@ class MirrorPartitionListTrait final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(MirrorPartitionListTrait* other); + void InternalSwap(MirrorPartitionListFeature* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.MirrorPartitionListTrait"; + return "grin.MirrorPartitionListFeature"; } protected: - explicit MirrorPartitionListTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit MirrorPartitionListFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -604,7 +604,7 @@ class MirrorPartitionListTrait final : void _internal_set_grin_trait_mirror_edge_mirror_partition_list(bool value); public: - // @@protoc_insertion_point(class_scope:grin.MirrorPartitionListTrait) + // @@protoc_insertion_point(class_scope:grin.MirrorPartitionListFeature) private: class _Internal; @@ -623,24 +623,24 @@ class MirrorPartitionListTrait final : }; // ------------------------------------------------------------------- -class PartitionTrait final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PartitionTrait) */ { +class PartitionFeature final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PartitionFeature) */ { public: - inline PartitionTrait() : PartitionTrait(nullptr) {} - ~PartitionTrait() override; - explicit PROTOBUF_CONSTEXPR PartitionTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline PartitionFeature() : PartitionFeature(nullptr) {} + ~PartitionFeature() override; + explicit PROTOBUF_CONSTEXPR PartitionFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - PartitionTrait(const PartitionTrait& from); - PartitionTrait(PartitionTrait&& from) noexcept - : PartitionTrait() { + PartitionFeature(const PartitionFeature& from); + PartitionFeature(PartitionFeature&& from) noexcept + : PartitionFeature() { *this = ::std::move(from); } - inline PartitionTrait& operator=(const PartitionTrait& from) { + inline PartitionFeature& operator=(const PartitionFeature& from) { CopyFrom(from); return *this; } - inline PartitionTrait& operator=(PartitionTrait&& from) noexcept { + inline PartitionFeature& operator=(PartitionFeature&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -663,20 +663,20 @@ class PartitionTrait final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const PartitionTrait& default_instance() { + static const PartitionFeature& default_instance() { return *internal_default_instance(); } - static inline const PartitionTrait* internal_default_instance() { - return reinterpret_cast( - &_PartitionTrait_default_instance_); + static inline const PartitionFeature* internal_default_instance() { + return reinterpret_cast( + &_PartitionFeature_default_instance_); } static constexpr int kIndexInFileMessages = 2; - friend void swap(PartitionTrait& a, PartitionTrait& b) { + friend void swap(PartitionFeature& a, PartitionFeature& b) { a.Swap(&b); } - inline void Swap(PartitionTrait* other) { + inline void Swap(PartitionFeature* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -689,7 +689,7 @@ class PartitionTrait final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(PartitionTrait* other) { + void UnsafeArenaSwap(PartitionFeature* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -697,14 +697,14 @@ class PartitionTrait final : // implements Message ---------------------------------------------- - PartitionTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + PartitionFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const PartitionTrait& from); + void CopyFrom(const PartitionFeature& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const PartitionTrait& from) { - PartitionTrait::MergeImpl(*this, from); + void MergeFrom( const PartitionFeature& from) { + PartitionFeature::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -722,15 +722,15 @@ class PartitionTrait final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(PartitionTrait* other); + void InternalSwap(PartitionFeature* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.PartitionTrait"; + return "grin.PartitionFeature"; } protected: - explicit PartitionTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit PartitionFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -744,7 +744,7 @@ class PartitionTrait final : // accessors ------------------------------------------------------- enum : int { - kMirrorPartitionListTraitFieldNumber = 7, + kMirrorPartitionListFeatureFieldNumber = 7, kGraphPartitionStrategyFieldNumber = 1, kGrinTraitNaturalIdForPartitionFieldNumber = 2, kGrinEnableVertexRefFieldNumber = 3, @@ -758,23 +758,23 @@ class PartitionTrait final : kGrinTraitSelectMasterNeighborForAdjacentListFieldNumber = 12, kGrinTraitSelectNeighborPartitionForAdjacentListFieldNumber = 13, }; - // .grin.MirrorPartitionListTrait mirror_partition_list_trait = 7; - bool has_mirror_partition_list_trait() const; + // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; + bool has_mirror_partition_list_feature() const; private: - bool _internal_has_mirror_partition_list_trait() const; + bool _internal_has_mirror_partition_list_feature() const; public: - void clear_mirror_partition_list_trait(); - const ::grin::MirrorPartitionListTrait& mirror_partition_list_trait() const; - PROTOBUF_NODISCARD ::grin::MirrorPartitionListTrait* release_mirror_partition_list_trait(); - ::grin::MirrorPartitionListTrait* mutable_mirror_partition_list_trait(); - void set_allocated_mirror_partition_list_trait(::grin::MirrorPartitionListTrait* mirror_partition_list_trait); + void clear_mirror_partition_list_feature(); + const ::grin::MirrorPartitionListFeature& mirror_partition_list_feature() const; + PROTOBUF_NODISCARD ::grin::MirrorPartitionListFeature* release_mirror_partition_list_feature(); + ::grin::MirrorPartitionListFeature* mutable_mirror_partition_list_feature(); + void set_allocated_mirror_partition_list_feature(::grin::MirrorPartitionListFeature* mirror_partition_list_feature); private: - const ::grin::MirrorPartitionListTrait& _internal_mirror_partition_list_trait() const; - ::grin::MirrorPartitionListTrait* _internal_mutable_mirror_partition_list_trait(); + const ::grin::MirrorPartitionListFeature& _internal_mirror_partition_list_feature() const; + ::grin::MirrorPartitionListFeature* _internal_mutable_mirror_partition_list_feature(); public: - void unsafe_arena_set_allocated_mirror_partition_list_trait( - ::grin::MirrorPartitionListTrait* mirror_partition_list_trait); - ::grin::MirrorPartitionListTrait* unsafe_arena_release_mirror_partition_list_trait(); + void unsafe_arena_set_allocated_mirror_partition_list_feature( + ::grin::MirrorPartitionListFeature* mirror_partition_list_feature); + ::grin::MirrorPartitionListFeature* unsafe_arena_release_mirror_partition_list_feature(); // .grin.GraphPartitionStrategy graph_partition_strategy = 1; void clear_graph_partition_strategy(); @@ -884,7 +884,7 @@ class PartitionTrait final : void _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value); public: - // @@protoc_insertion_point(class_scope:grin.PartitionTrait) + // @@protoc_insertion_point(class_scope:grin.PartitionFeature) private: class _Internal; @@ -892,7 +892,7 @@ class PartitionTrait final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::grin::MirrorPartitionListTrait* mirror_partition_list_trait_; + ::grin::MirrorPartitionListFeature* mirror_partition_list_feature_; int graph_partition_strategy_; bool grin_trait_natural_id_for_partition_; bool grin_enable_vertex_ref_; @@ -912,24 +912,24 @@ class PartitionTrait final : }; // ------------------------------------------------------------------- -class VertexPropertyTrait final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.VertexPropertyTrait) */ { +class VertexPropertyFeature final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.VertexPropertyFeature) */ { public: - inline VertexPropertyTrait() : VertexPropertyTrait(nullptr) {} - ~VertexPropertyTrait() override; - explicit PROTOBUF_CONSTEXPR VertexPropertyTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline VertexPropertyFeature() : VertexPropertyFeature(nullptr) {} + ~VertexPropertyFeature() override; + explicit PROTOBUF_CONSTEXPR VertexPropertyFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - VertexPropertyTrait(const VertexPropertyTrait& from); - VertexPropertyTrait(VertexPropertyTrait&& from) noexcept - : VertexPropertyTrait() { + VertexPropertyFeature(const VertexPropertyFeature& from); + VertexPropertyFeature(VertexPropertyFeature&& from) noexcept + : VertexPropertyFeature() { *this = ::std::move(from); } - inline VertexPropertyTrait& operator=(const VertexPropertyTrait& from) { + inline VertexPropertyFeature& operator=(const VertexPropertyFeature& from) { CopyFrom(from); return *this; } - inline VertexPropertyTrait& operator=(VertexPropertyTrait&& from) noexcept { + inline VertexPropertyFeature& operator=(VertexPropertyFeature&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -952,20 +952,20 @@ class VertexPropertyTrait final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const VertexPropertyTrait& default_instance() { + static const VertexPropertyFeature& default_instance() { return *internal_default_instance(); } - static inline const VertexPropertyTrait* internal_default_instance() { - return reinterpret_cast( - &_VertexPropertyTrait_default_instance_); + static inline const VertexPropertyFeature* internal_default_instance() { + return reinterpret_cast( + &_VertexPropertyFeature_default_instance_); } static constexpr int kIndexInFileMessages = 3; - friend void swap(VertexPropertyTrait& a, VertexPropertyTrait& b) { + friend void swap(VertexPropertyFeature& a, VertexPropertyFeature& b) { a.Swap(&b); } - inline void Swap(VertexPropertyTrait* other) { + inline void Swap(VertexPropertyFeature* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -978,7 +978,7 @@ class VertexPropertyTrait final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(VertexPropertyTrait* other) { + void UnsafeArenaSwap(VertexPropertyFeature* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -986,14 +986,14 @@ class VertexPropertyTrait final : // implements Message ---------------------------------------------- - VertexPropertyTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + VertexPropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const VertexPropertyTrait& from); + void CopyFrom(const VertexPropertyFeature& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const VertexPropertyTrait& from) { - VertexPropertyTrait::MergeImpl(*this, from); + void MergeFrom( const VertexPropertyFeature& from) { + VertexPropertyFeature::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -1011,15 +1011,15 @@ class VertexPropertyTrait final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(VertexPropertyTrait* other); + void InternalSwap(VertexPropertyFeature* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.VertexPropertyTrait"; + return "grin.VertexPropertyFeature"; } protected: - explicit VertexPropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit VertexPropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -1114,7 +1114,7 @@ class VertexPropertyTrait final : void _internal_set_grin_assume_by_type_vertex_original_id(bool value); public: - // @@protoc_insertion_point(class_scope:grin.VertexPropertyTrait) + // @@protoc_insertion_point(class_scope:grin.VertexPropertyFeature) private: class _Internal; @@ -1137,24 +1137,24 @@ class VertexPropertyTrait final : }; // ------------------------------------------------------------------- -class EdgePropertyTrait final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.EdgePropertyTrait) */ { +class EdgePropertyFeature final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.EdgePropertyFeature) */ { public: - inline EdgePropertyTrait() : EdgePropertyTrait(nullptr) {} - ~EdgePropertyTrait() override; - explicit PROTOBUF_CONSTEXPR EdgePropertyTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline EdgePropertyFeature() : EdgePropertyFeature(nullptr) {} + ~EdgePropertyFeature() override; + explicit PROTOBUF_CONSTEXPR EdgePropertyFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - EdgePropertyTrait(const EdgePropertyTrait& from); - EdgePropertyTrait(EdgePropertyTrait&& from) noexcept - : EdgePropertyTrait() { + EdgePropertyFeature(const EdgePropertyFeature& from); + EdgePropertyFeature(EdgePropertyFeature&& from) noexcept + : EdgePropertyFeature() { *this = ::std::move(from); } - inline EdgePropertyTrait& operator=(const EdgePropertyTrait& from) { + inline EdgePropertyFeature& operator=(const EdgePropertyFeature& from) { CopyFrom(from); return *this; } - inline EdgePropertyTrait& operator=(EdgePropertyTrait&& from) noexcept { + inline EdgePropertyFeature& operator=(EdgePropertyFeature&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1177,20 +1177,20 @@ class EdgePropertyTrait final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const EdgePropertyTrait& default_instance() { + static const EdgePropertyFeature& default_instance() { return *internal_default_instance(); } - static inline const EdgePropertyTrait* internal_default_instance() { - return reinterpret_cast( - &_EdgePropertyTrait_default_instance_); + static inline const EdgePropertyFeature* internal_default_instance() { + return reinterpret_cast( + &_EdgePropertyFeature_default_instance_); } static constexpr int kIndexInFileMessages = 4; - friend void swap(EdgePropertyTrait& a, EdgePropertyTrait& b) { + friend void swap(EdgePropertyFeature& a, EdgePropertyFeature& b) { a.Swap(&b); } - inline void Swap(EdgePropertyTrait* other) { + inline void Swap(EdgePropertyFeature* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1203,7 +1203,7 @@ class EdgePropertyTrait final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(EdgePropertyTrait* other) { + void UnsafeArenaSwap(EdgePropertyFeature* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1211,14 +1211,14 @@ class EdgePropertyTrait final : // implements Message ---------------------------------------------- - EdgePropertyTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + EdgePropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const EdgePropertyTrait& from); + void CopyFrom(const EdgePropertyFeature& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const EdgePropertyTrait& from) { - EdgePropertyTrait::MergeImpl(*this, from); + void MergeFrom( const EdgePropertyFeature& from) { + EdgePropertyFeature::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -1236,15 +1236,15 @@ class EdgePropertyTrait final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(EdgePropertyTrait* other); + void InternalSwap(EdgePropertyFeature* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.EdgePropertyTrait"; + return "grin.EdgePropertyFeature"; } protected: - explicit EdgePropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit EdgePropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -1329,7 +1329,7 @@ class EdgePropertyTrait final : void _internal_set_grin_trait_natural_id_for_edge_property(bool value); public: - // @@protoc_insertion_point(class_scope:grin.EdgePropertyTrait) + // @@protoc_insertion_point(class_scope:grin.EdgePropertyFeature) private: class _Internal; @@ -1351,24 +1351,24 @@ class EdgePropertyTrait final : }; // ------------------------------------------------------------------- -class PropertyTrait final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PropertyTrait) */ { +class PropertyFeature final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PropertyFeature) */ { public: - inline PropertyTrait() : PropertyTrait(nullptr) {} - ~PropertyTrait() override; - explicit PROTOBUF_CONSTEXPR PropertyTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline PropertyFeature() : PropertyFeature(nullptr) {} + ~PropertyFeature() override; + explicit PROTOBUF_CONSTEXPR PropertyFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - PropertyTrait(const PropertyTrait& from); - PropertyTrait(PropertyTrait&& from) noexcept - : PropertyTrait() { + PropertyFeature(const PropertyFeature& from); + PropertyFeature(PropertyFeature&& from) noexcept + : PropertyFeature() { *this = ::std::move(from); } - inline PropertyTrait& operator=(const PropertyTrait& from) { + inline PropertyFeature& operator=(const PropertyFeature& from) { CopyFrom(from); return *this; } - inline PropertyTrait& operator=(PropertyTrait&& from) noexcept { + inline PropertyFeature& operator=(PropertyFeature&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1391,20 +1391,20 @@ class PropertyTrait final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const PropertyTrait& default_instance() { + static const PropertyFeature& default_instance() { return *internal_default_instance(); } - static inline const PropertyTrait* internal_default_instance() { - return reinterpret_cast( - &_PropertyTrait_default_instance_); + static inline const PropertyFeature* internal_default_instance() { + return reinterpret_cast( + &_PropertyFeature_default_instance_); } static constexpr int kIndexInFileMessages = 5; - friend void swap(PropertyTrait& a, PropertyTrait& b) { + friend void swap(PropertyFeature& a, PropertyFeature& b) { a.Swap(&b); } - inline void Swap(PropertyTrait* other) { + inline void Swap(PropertyFeature* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1417,7 +1417,7 @@ class PropertyTrait final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(PropertyTrait* other) { + void UnsafeArenaSwap(PropertyFeature* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1425,14 +1425,14 @@ class PropertyTrait final : // implements Message ---------------------------------------------- - PropertyTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + PropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const PropertyTrait& from); + void CopyFrom(const PropertyFeature& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const PropertyTrait& from) { - PropertyTrait::MergeImpl(*this, from); + void MergeFrom( const PropertyFeature& from) { + PropertyFeature::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -1450,15 +1450,15 @@ class PropertyTrait final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(PropertyTrait* other); + void InternalSwap(PropertyFeature* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.PropertyTrait"; + return "grin.PropertyFeature"; } protected: - explicit PropertyTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit PropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -1472,8 +1472,8 @@ class PropertyTrait final : // accessors ------------------------------------------------------- enum : int { - kVertexPropertyTraitFieldNumber = 2, - kEdgePropertyTraitFieldNumber = 3, + kVertexPropertyFeatureFieldNumber = 2, + kEdgePropertyFeatureFieldNumber = 3, kVertexPropertyFieldNumber = 4, kEdgePropertyFieldNumber = 5, kGrinEnableRowFieldNumber = 1, @@ -1485,41 +1485,41 @@ class PropertyTrait final : kGrinTraitSelectEdgeTypeForAdjacentListFieldNumber = 11, kGrinTraitSpecificVevRelationFieldNumber = 12, }; - // .grin.VertexPropertyTrait vertex_property_trait = 2; - bool has_vertex_property_trait() const; + // .grin.VertexPropertyFeature vertex_property_feature = 2; + bool has_vertex_property_feature() const; private: - bool _internal_has_vertex_property_trait() const; + bool _internal_has_vertex_property_feature() const; public: - void clear_vertex_property_trait(); - const ::grin::VertexPropertyTrait& vertex_property_trait() const; - PROTOBUF_NODISCARD ::grin::VertexPropertyTrait* release_vertex_property_trait(); - ::grin::VertexPropertyTrait* mutable_vertex_property_trait(); - void set_allocated_vertex_property_trait(::grin::VertexPropertyTrait* vertex_property_trait); + void clear_vertex_property_feature(); + const ::grin::VertexPropertyFeature& vertex_property_feature() const; + PROTOBUF_NODISCARD ::grin::VertexPropertyFeature* release_vertex_property_feature(); + ::grin::VertexPropertyFeature* mutable_vertex_property_feature(); + void set_allocated_vertex_property_feature(::grin::VertexPropertyFeature* vertex_property_feature); private: - const ::grin::VertexPropertyTrait& _internal_vertex_property_trait() const; - ::grin::VertexPropertyTrait* _internal_mutable_vertex_property_trait(); + const ::grin::VertexPropertyFeature& _internal_vertex_property_feature() const; + ::grin::VertexPropertyFeature* _internal_mutable_vertex_property_feature(); public: - void unsafe_arena_set_allocated_vertex_property_trait( - ::grin::VertexPropertyTrait* vertex_property_trait); - ::grin::VertexPropertyTrait* unsafe_arena_release_vertex_property_trait(); + void unsafe_arena_set_allocated_vertex_property_feature( + ::grin::VertexPropertyFeature* vertex_property_feature); + ::grin::VertexPropertyFeature* unsafe_arena_release_vertex_property_feature(); - // .grin.EdgePropertyTrait edge_property_trait = 3; - bool has_edge_property_trait() const; + // .grin.EdgePropertyFeature edge_property_feature = 3; + bool has_edge_property_feature() const; private: - bool _internal_has_edge_property_trait() const; + bool _internal_has_edge_property_feature() const; public: - void clear_edge_property_trait(); - const ::grin::EdgePropertyTrait& edge_property_trait() const; - PROTOBUF_NODISCARD ::grin::EdgePropertyTrait* release_edge_property_trait(); - ::grin::EdgePropertyTrait* mutable_edge_property_trait(); - void set_allocated_edge_property_trait(::grin::EdgePropertyTrait* edge_property_trait); + void clear_edge_property_feature(); + const ::grin::EdgePropertyFeature& edge_property_feature() const; + PROTOBUF_NODISCARD ::grin::EdgePropertyFeature* release_edge_property_feature(); + ::grin::EdgePropertyFeature* mutable_edge_property_feature(); + void set_allocated_edge_property_feature(::grin::EdgePropertyFeature* edge_property_feature); private: - const ::grin::EdgePropertyTrait& _internal_edge_property_trait() const; - ::grin::EdgePropertyTrait* _internal_mutable_edge_property_trait(); + const ::grin::EdgePropertyFeature& _internal_edge_property_feature() const; + ::grin::EdgePropertyFeature* _internal_mutable_edge_property_feature(); public: - void unsafe_arena_set_allocated_edge_property_trait( - ::grin::EdgePropertyTrait* edge_property_trait); - ::grin::EdgePropertyTrait* unsafe_arena_release_edge_property_trait(); + void unsafe_arena_set_allocated_edge_property_feature( + ::grin::EdgePropertyFeature* edge_property_feature); + ::grin::EdgePropertyFeature* unsafe_arena_release_edge_property_feature(); // .grin.PropertyDataPartitionStrategy vertex_property = 4; void clear_vertex_property(); @@ -1611,7 +1611,7 @@ class PropertyTrait final : void _internal_set_grin_trait_specific_vev_relation(bool value); public: - // @@protoc_insertion_point(class_scope:grin.PropertyTrait) + // @@protoc_insertion_point(class_scope:grin.PropertyFeature) private: class _Internal; @@ -1619,8 +1619,8 @@ class PropertyTrait final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::grin::VertexPropertyTrait* vertex_property_trait_; - ::grin::EdgePropertyTrait* edge_property_trait_; + ::grin::VertexPropertyFeature* vertex_property_feature_; + ::grin::EdgePropertyFeature* edge_property_feature_; int vertex_property_; int edge_property_; bool grin_enable_row_; @@ -1638,24 +1638,24 @@ class PropertyTrait final : }; // ------------------------------------------------------------------- -class IndexTrait final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.IndexTrait) */ { +class IndexFeature final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.IndexFeature) */ { public: - inline IndexTrait() : IndexTrait(nullptr) {} - ~IndexTrait() override; - explicit PROTOBUF_CONSTEXPR IndexTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline IndexFeature() : IndexFeature(nullptr) {} + ~IndexFeature() override; + explicit PROTOBUF_CONSTEXPR IndexFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - IndexTrait(const IndexTrait& from); - IndexTrait(IndexTrait&& from) noexcept - : IndexTrait() { + IndexFeature(const IndexFeature& from); + IndexFeature(IndexFeature&& from) noexcept + : IndexFeature() { *this = ::std::move(from); } - inline IndexTrait& operator=(const IndexTrait& from) { + inline IndexFeature& operator=(const IndexFeature& from) { CopyFrom(from); return *this; } - inline IndexTrait& operator=(IndexTrait&& from) noexcept { + inline IndexFeature& operator=(IndexFeature&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1678,20 +1678,20 @@ class IndexTrait final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const IndexTrait& default_instance() { + static const IndexFeature& default_instance() { return *internal_default_instance(); } - static inline const IndexTrait* internal_default_instance() { - return reinterpret_cast( - &_IndexTrait_default_instance_); + static inline const IndexFeature* internal_default_instance() { + return reinterpret_cast( + &_IndexFeature_default_instance_); } static constexpr int kIndexInFileMessages = 6; - friend void swap(IndexTrait& a, IndexTrait& b) { + friend void swap(IndexFeature& a, IndexFeature& b) { a.Swap(&b); } - inline void Swap(IndexTrait* other) { + inline void Swap(IndexFeature* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1704,7 +1704,7 @@ class IndexTrait final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(IndexTrait* other) { + void UnsafeArenaSwap(IndexFeature* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1712,14 +1712,14 @@ class IndexTrait final : // implements Message ---------------------------------------------- - IndexTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + IndexFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const IndexTrait& from); + void CopyFrom(const IndexFeature& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const IndexTrait& from) { - IndexTrait::MergeImpl(*this, from); + void MergeFrom( const IndexFeature& from) { + IndexFeature::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -1737,15 +1737,15 @@ class IndexTrait final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(IndexTrait* other); + void InternalSwap(IndexFeature* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.IndexTrait"; + return "grin.IndexFeature"; } protected: - explicit IndexTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit IndexFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -1790,7 +1790,7 @@ class IndexTrait final : void _internal_set_grin_assume_all_vertex_list_sorted(bool value); public: - // @@protoc_insertion_point(class_scope:grin.IndexTrait) + // @@protoc_insertion_point(class_scope:grin.IndexFeature) private: class _Internal; @@ -1808,23 +1808,23 @@ class IndexTrait final : }; // ------------------------------------------------------------------- -class PredicateTrait final : - public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:grin.PredicateTrait) */ { +class PredicateFeature final : + public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:grin.PredicateFeature) */ { public: - inline PredicateTrait() : PredicateTrait(nullptr) {} - explicit PROTOBUF_CONSTEXPR PredicateTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline PredicateFeature() : PredicateFeature(nullptr) {} + explicit PROTOBUF_CONSTEXPR PredicateFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - PredicateTrait(const PredicateTrait& from); - PredicateTrait(PredicateTrait&& from) noexcept - : PredicateTrait() { + PredicateFeature(const PredicateFeature& from); + PredicateFeature(PredicateFeature&& from) noexcept + : PredicateFeature() { *this = ::std::move(from); } - inline PredicateTrait& operator=(const PredicateTrait& from) { + inline PredicateFeature& operator=(const PredicateFeature& from) { CopyFrom(from); return *this; } - inline PredicateTrait& operator=(PredicateTrait&& from) noexcept { + inline PredicateFeature& operator=(PredicateFeature&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1847,20 +1847,20 @@ class PredicateTrait final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const PredicateTrait& default_instance() { + static const PredicateFeature& default_instance() { return *internal_default_instance(); } - static inline const PredicateTrait* internal_default_instance() { - return reinterpret_cast( - &_PredicateTrait_default_instance_); + static inline const PredicateFeature* internal_default_instance() { + return reinterpret_cast( + &_PredicateFeature_default_instance_); } static constexpr int kIndexInFileMessages = 7; - friend void swap(PredicateTrait& a, PredicateTrait& b) { + friend void swap(PredicateFeature& a, PredicateFeature& b) { a.Swap(&b); } - inline void Swap(PredicateTrait* other) { + inline void Swap(PredicateFeature* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -1873,7 +1873,7 @@ class PredicateTrait final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(PredicateTrait* other) { + void UnsafeArenaSwap(PredicateFeature* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -1881,15 +1881,15 @@ class PredicateTrait final : // implements Message ---------------------------------------------- - PredicateTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + PredicateFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; - inline void CopyFrom(const PredicateTrait& from) { + inline void CopyFrom(const PredicateFeature& from) { ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); } using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; - void MergeFrom(const PredicateTrait& from) { + void MergeFrom(const PredicateFeature& from) { ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); } public: @@ -1897,10 +1897,10 @@ class PredicateTrait final : private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.PredicateTrait"; + return "grin.PredicateFeature"; } protected: - explicit PredicateTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit PredicateFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -1913,7 +1913,7 @@ class PredicateTrait final : // accessors ------------------------------------------------------- - // @@protoc_insertion_point(class_scope:grin.PredicateTrait) + // @@protoc_insertion_point(class_scope:grin.PredicateFeature) private: class _Internal; @@ -1926,24 +1926,24 @@ class PredicateTrait final : }; // ------------------------------------------------------------------- -class StorageTrait final : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.StorageTrait) */ { +class StorageFeature final : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.StorageFeature) */ { public: - inline StorageTrait() : StorageTrait(nullptr) {} - ~StorageTrait() override; - explicit PROTOBUF_CONSTEXPR StorageTrait(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline StorageFeature() : StorageFeature(nullptr) {} + ~StorageFeature() override; + explicit PROTOBUF_CONSTEXPR StorageFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); - StorageTrait(const StorageTrait& from); - StorageTrait(StorageTrait&& from) noexcept - : StorageTrait() { + StorageFeature(const StorageFeature& from); + StorageFeature(StorageFeature&& from) noexcept + : StorageFeature() { *this = ::std::move(from); } - inline StorageTrait& operator=(const StorageTrait& from) { + inline StorageFeature& operator=(const StorageFeature& from) { CopyFrom(from); return *this; } - inline StorageTrait& operator=(StorageTrait&& from) noexcept { + inline StorageFeature& operator=(StorageFeature&& from) noexcept { if (this == &from) return *this; if (GetOwningArena() == from.GetOwningArena() #ifdef PROTOBUF_FORCE_COPY_IN_MOVE @@ -1966,29 +1966,29 @@ class StorageTrait final : static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { return default_instance().GetMetadata().reflection; } - static const StorageTrait& default_instance() { + static const StorageFeature& default_instance() { return *internal_default_instance(); } - enum SpecificTraitCase { - kTopologyTrait = 1, - kPartitionTrait = 2, - kPropertyTrait = 3, - kIndexTrait = 4, - kPredicateTrait = 5, - SPECIFIC_TRAIT_NOT_SET = 0, + enum SpecificFeatureCase { + kTopologyFeature = 1, + kPartitionFeature = 2, + kPropertyFeature = 3, + kIndexFeature = 4, + kPredicateFeature = 5, + SPECIFIC_FEATURE_NOT_SET = 0, }; - static inline const StorageTrait* internal_default_instance() { - return reinterpret_cast( - &_StorageTrait_default_instance_); + static inline const StorageFeature* internal_default_instance() { + return reinterpret_cast( + &_StorageFeature_default_instance_); } static constexpr int kIndexInFileMessages = 8; - friend void swap(StorageTrait& a, StorageTrait& b) { + friend void swap(StorageFeature& a, StorageFeature& b) { a.Swap(&b); } - inline void Swap(StorageTrait* other) { + inline void Swap(StorageFeature* other) { if (other == this) return; #ifdef PROTOBUF_FORCE_COPY_IN_SWAP if (GetOwningArena() != nullptr && @@ -2001,7 +2001,7 @@ class StorageTrait final : ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); } } - void UnsafeArenaSwap(StorageTrait* other) { + void UnsafeArenaSwap(StorageFeature* other) { if (other == this) return; GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); InternalSwap(other); @@ -2009,14 +2009,14 @@ class StorageTrait final : // implements Message ---------------------------------------------- - StorageTrait* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); + StorageFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + return CreateMaybeMessage(arena); } using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; - void CopyFrom(const StorageTrait& from); + void CopyFrom(const StorageFeature& from); using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const StorageTrait& from) { - StorageTrait::MergeImpl(*this, from); + void MergeFrom( const StorageFeature& from) { + StorageFeature::MergeImpl(*this, from); } private: static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); @@ -2034,15 +2034,15 @@ class StorageTrait final : void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); void SharedDtor(); void SetCachedSize(int size) const final; - void InternalSwap(StorageTrait* other); + void InternalSwap(StorageFeature* other); private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.StorageTrait"; + return "grin.StorageFeature"; } protected: - explicit StorageTrait(::PROTOBUF_NAMESPACE_ID::Arena* arena, + explicit StorageFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned = false); public: @@ -2056,129 +2056,129 @@ class StorageTrait final : // accessors ------------------------------------------------------- enum : int { - kTopologyTraitFieldNumber = 1, - kPartitionTraitFieldNumber = 2, - kPropertyTraitFieldNumber = 3, - kIndexTraitFieldNumber = 4, - kPredicateTraitFieldNumber = 5, + kTopologyFeatureFieldNumber = 1, + kPartitionFeatureFieldNumber = 2, + kPropertyFeatureFieldNumber = 3, + kIndexFeatureFieldNumber = 4, + kPredicateFeatureFieldNumber = 5, }; - // .grin.TopologyTrait topology_trait = 1; - bool has_topology_trait() const; + // .grin.TopologyFeature topology_feature = 1; + bool has_topology_feature() const; private: - bool _internal_has_topology_trait() const; + bool _internal_has_topology_feature() const; public: - void clear_topology_trait(); - const ::grin::TopologyTrait& topology_trait() const; - PROTOBUF_NODISCARD ::grin::TopologyTrait* release_topology_trait(); - ::grin::TopologyTrait* mutable_topology_trait(); - void set_allocated_topology_trait(::grin::TopologyTrait* topology_trait); + void clear_topology_feature(); + const ::grin::TopologyFeature& topology_feature() const; + PROTOBUF_NODISCARD ::grin::TopologyFeature* release_topology_feature(); + ::grin::TopologyFeature* mutable_topology_feature(); + void set_allocated_topology_feature(::grin::TopologyFeature* topology_feature); private: - const ::grin::TopologyTrait& _internal_topology_trait() const; - ::grin::TopologyTrait* _internal_mutable_topology_trait(); + const ::grin::TopologyFeature& _internal_topology_feature() const; + ::grin::TopologyFeature* _internal_mutable_topology_feature(); public: - void unsafe_arena_set_allocated_topology_trait( - ::grin::TopologyTrait* topology_trait); - ::grin::TopologyTrait* unsafe_arena_release_topology_trait(); + void unsafe_arena_set_allocated_topology_feature( + ::grin::TopologyFeature* topology_feature); + ::grin::TopologyFeature* unsafe_arena_release_topology_feature(); - // .grin.PartitionTrait partition_trait = 2; - bool has_partition_trait() const; + // .grin.PartitionFeature partition_feature = 2; + bool has_partition_feature() const; private: - bool _internal_has_partition_trait() const; + bool _internal_has_partition_feature() const; public: - void clear_partition_trait(); - const ::grin::PartitionTrait& partition_trait() const; - PROTOBUF_NODISCARD ::grin::PartitionTrait* release_partition_trait(); - ::grin::PartitionTrait* mutable_partition_trait(); - void set_allocated_partition_trait(::grin::PartitionTrait* partition_trait); + void clear_partition_feature(); + const ::grin::PartitionFeature& partition_feature() const; + PROTOBUF_NODISCARD ::grin::PartitionFeature* release_partition_feature(); + ::grin::PartitionFeature* mutable_partition_feature(); + void set_allocated_partition_feature(::grin::PartitionFeature* partition_feature); private: - const ::grin::PartitionTrait& _internal_partition_trait() const; - ::grin::PartitionTrait* _internal_mutable_partition_trait(); + const ::grin::PartitionFeature& _internal_partition_feature() const; + ::grin::PartitionFeature* _internal_mutable_partition_feature(); public: - void unsafe_arena_set_allocated_partition_trait( - ::grin::PartitionTrait* partition_trait); - ::grin::PartitionTrait* unsafe_arena_release_partition_trait(); + void unsafe_arena_set_allocated_partition_feature( + ::grin::PartitionFeature* partition_feature); + ::grin::PartitionFeature* unsafe_arena_release_partition_feature(); - // .grin.PropertyTrait property_trait = 3; - bool has_property_trait() const; + // .grin.PropertyFeature property_feature = 3; + bool has_property_feature() const; private: - bool _internal_has_property_trait() const; + bool _internal_has_property_feature() const; public: - void clear_property_trait(); - const ::grin::PropertyTrait& property_trait() const; - PROTOBUF_NODISCARD ::grin::PropertyTrait* release_property_trait(); - ::grin::PropertyTrait* mutable_property_trait(); - void set_allocated_property_trait(::grin::PropertyTrait* property_trait); + void clear_property_feature(); + const ::grin::PropertyFeature& property_feature() const; + PROTOBUF_NODISCARD ::grin::PropertyFeature* release_property_feature(); + ::grin::PropertyFeature* mutable_property_feature(); + void set_allocated_property_feature(::grin::PropertyFeature* property_feature); private: - const ::grin::PropertyTrait& _internal_property_trait() const; - ::grin::PropertyTrait* _internal_mutable_property_trait(); + const ::grin::PropertyFeature& _internal_property_feature() const; + ::grin::PropertyFeature* _internal_mutable_property_feature(); public: - void unsafe_arena_set_allocated_property_trait( - ::grin::PropertyTrait* property_trait); - ::grin::PropertyTrait* unsafe_arena_release_property_trait(); + void unsafe_arena_set_allocated_property_feature( + ::grin::PropertyFeature* property_feature); + ::grin::PropertyFeature* unsafe_arena_release_property_feature(); - // .grin.IndexTrait index_trait = 4; - bool has_index_trait() const; + // .grin.IndexFeature index_feature = 4; + bool has_index_feature() const; private: - bool _internal_has_index_trait() const; + bool _internal_has_index_feature() const; public: - void clear_index_trait(); - const ::grin::IndexTrait& index_trait() const; - PROTOBUF_NODISCARD ::grin::IndexTrait* release_index_trait(); - ::grin::IndexTrait* mutable_index_trait(); - void set_allocated_index_trait(::grin::IndexTrait* index_trait); + void clear_index_feature(); + const ::grin::IndexFeature& index_feature() const; + PROTOBUF_NODISCARD ::grin::IndexFeature* release_index_feature(); + ::grin::IndexFeature* mutable_index_feature(); + void set_allocated_index_feature(::grin::IndexFeature* index_feature); private: - const ::grin::IndexTrait& _internal_index_trait() const; - ::grin::IndexTrait* _internal_mutable_index_trait(); + const ::grin::IndexFeature& _internal_index_feature() const; + ::grin::IndexFeature* _internal_mutable_index_feature(); public: - void unsafe_arena_set_allocated_index_trait( - ::grin::IndexTrait* index_trait); - ::grin::IndexTrait* unsafe_arena_release_index_trait(); + void unsafe_arena_set_allocated_index_feature( + ::grin::IndexFeature* index_feature); + ::grin::IndexFeature* unsafe_arena_release_index_feature(); - // .grin.PredicateTrait predicate_trait = 5; - bool has_predicate_trait() const; + // .grin.PredicateFeature predicate_feature = 5; + bool has_predicate_feature() const; private: - bool _internal_has_predicate_trait() const; + bool _internal_has_predicate_feature() const; public: - void clear_predicate_trait(); - const ::grin::PredicateTrait& predicate_trait() const; - PROTOBUF_NODISCARD ::grin::PredicateTrait* release_predicate_trait(); - ::grin::PredicateTrait* mutable_predicate_trait(); - void set_allocated_predicate_trait(::grin::PredicateTrait* predicate_trait); + void clear_predicate_feature(); + const ::grin::PredicateFeature& predicate_feature() const; + PROTOBUF_NODISCARD ::grin::PredicateFeature* release_predicate_feature(); + ::grin::PredicateFeature* mutable_predicate_feature(); + void set_allocated_predicate_feature(::grin::PredicateFeature* predicate_feature); private: - const ::grin::PredicateTrait& _internal_predicate_trait() const; - ::grin::PredicateTrait* _internal_mutable_predicate_trait(); + const ::grin::PredicateFeature& _internal_predicate_feature() const; + ::grin::PredicateFeature* _internal_mutable_predicate_feature(); public: - void unsafe_arena_set_allocated_predicate_trait( - ::grin::PredicateTrait* predicate_trait); - ::grin::PredicateTrait* unsafe_arena_release_predicate_trait(); + void unsafe_arena_set_allocated_predicate_feature( + ::grin::PredicateFeature* predicate_feature); + ::grin::PredicateFeature* unsafe_arena_release_predicate_feature(); - void clear_specific_trait(); - SpecificTraitCase specific_trait_case() const; - // @@protoc_insertion_point(class_scope:grin.StorageTrait) + void clear_specific_feature(); + SpecificFeatureCase specific_feature_case() const; + // @@protoc_insertion_point(class_scope:grin.StorageFeature) private: class _Internal; - void set_has_topology_trait(); - void set_has_partition_trait(); - void set_has_property_trait(); - void set_has_index_trait(); - void set_has_predicate_trait(); + void set_has_topology_feature(); + void set_has_partition_feature(); + void set_has_property_feature(); + void set_has_index_feature(); + void set_has_predicate_feature(); - inline bool has_specific_trait() const; - inline void clear_has_specific_trait(); + inline bool has_specific_feature() const; + inline void clear_has_specific_feature(); template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - union SpecificTraitUnion { - constexpr SpecificTraitUnion() : _constinit_{} {} + union SpecificFeatureUnion { + constexpr SpecificFeatureUnion() : _constinit_{} {} ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; - ::grin::TopologyTrait* topology_trait_; - ::grin::PartitionTrait* partition_trait_; - ::grin::PropertyTrait* property_trait_; - ::grin::IndexTrait* index_trait_; - ::grin::PredicateTrait* predicate_trait_; - } specific_trait_; + ::grin::TopologyFeature* topology_feature_; + ::grin::PartitionFeature* partition_feature_; + ::grin::PropertyFeature* property_feature_; + ::grin::IndexFeature* index_feature_; + ::grin::PredicateFeature* predicate_feature_; + } specific_feature_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; uint32_t _oneof_case_[1]; @@ -2501,28 +2501,28 @@ class Graph final : // accessors ------------------------------------------------------- enum : int { - kTraitsFieldNumber = 3, + kFeaturesFieldNumber = 3, kUriFieldNumber = 1, kGrinVersionFieldNumber = 2, kStatisticsFieldNumber = 4, }; - // repeated .grin.StorageTrait traits = 3; - int traits_size() const; + // repeated .grin.StorageFeature features = 3; + int features_size() const; private: - int _internal_traits_size() const; + int _internal_features_size() const; public: - void clear_traits(); - ::grin::StorageTrait* mutable_traits(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageTrait >* - mutable_traits(); + void clear_features(); + ::grin::StorageFeature* mutable_features(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature >* + mutable_features(); private: - const ::grin::StorageTrait& _internal_traits(int index) const; - ::grin::StorageTrait* _internal_add_traits(); + const ::grin::StorageFeature& _internal_features(int index) const; + ::grin::StorageFeature* _internal_add_features(); public: - const ::grin::StorageTrait& traits(int index) const; - ::grin::StorageTrait* add_traits(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageTrait >& - traits() const; + const ::grin::StorageFeature& features(int index) const; + ::grin::StorageFeature* add_features(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature >& + features() const; // string uri = 1; void clear_uri(); @@ -2578,7 +2578,7 @@ class Graph final : typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageTrait > traits_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature > features_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uri_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr grin_version_; ::grin::Statistics* statistics_; @@ -2596,504 +2596,504 @@ class Graph final : #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ -// TopologyTrait +// TopologyFeature // bool grin_assume_has_directed_graph = 1; -inline void TopologyTrait::clear_grin_assume_has_directed_graph() { +inline void TopologyFeature::clear_grin_assume_has_directed_graph() { _impl_.grin_assume_has_directed_graph_ = false; } -inline bool TopologyTrait::_internal_grin_assume_has_directed_graph() const { +inline bool TopologyFeature::_internal_grin_assume_has_directed_graph() const { return _impl_.grin_assume_has_directed_graph_; } -inline bool TopologyTrait::grin_assume_has_directed_graph() const { - // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_assume_has_directed_graph) +inline bool TopologyFeature::grin_assume_has_directed_graph() const { + // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_assume_has_directed_graph) return _internal_grin_assume_has_directed_graph(); } -inline void TopologyTrait::_internal_set_grin_assume_has_directed_graph(bool value) { +inline void TopologyFeature::_internal_set_grin_assume_has_directed_graph(bool value) { _impl_.grin_assume_has_directed_graph_ = value; } -inline void TopologyTrait::set_grin_assume_has_directed_graph(bool value) { +inline void TopologyFeature::set_grin_assume_has_directed_graph(bool value) { _internal_set_grin_assume_has_directed_graph(value); - // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_assume_has_directed_graph) + // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_assume_has_directed_graph) } // bool grin_assume_has_undirected_graph = 2; -inline void TopologyTrait::clear_grin_assume_has_undirected_graph() { +inline void TopologyFeature::clear_grin_assume_has_undirected_graph() { _impl_.grin_assume_has_undirected_graph_ = false; } -inline bool TopologyTrait::_internal_grin_assume_has_undirected_graph() const { +inline bool TopologyFeature::_internal_grin_assume_has_undirected_graph() const { return _impl_.grin_assume_has_undirected_graph_; } -inline bool TopologyTrait::grin_assume_has_undirected_graph() const { - // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_assume_has_undirected_graph) +inline bool TopologyFeature::grin_assume_has_undirected_graph() const { + // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_assume_has_undirected_graph) return _internal_grin_assume_has_undirected_graph(); } -inline void TopologyTrait::_internal_set_grin_assume_has_undirected_graph(bool value) { +inline void TopologyFeature::_internal_set_grin_assume_has_undirected_graph(bool value) { _impl_.grin_assume_has_undirected_graph_ = value; } -inline void TopologyTrait::set_grin_assume_has_undirected_graph(bool value) { +inline void TopologyFeature::set_grin_assume_has_undirected_graph(bool value) { _internal_set_grin_assume_has_undirected_graph(value); - // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_assume_has_undirected_graph) + // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_assume_has_undirected_graph) } // bool grin_assume_has_multi_edge_graph = 3; -inline void TopologyTrait::clear_grin_assume_has_multi_edge_graph() { +inline void TopologyFeature::clear_grin_assume_has_multi_edge_graph() { _impl_.grin_assume_has_multi_edge_graph_ = false; } -inline bool TopologyTrait::_internal_grin_assume_has_multi_edge_graph() const { +inline bool TopologyFeature::_internal_grin_assume_has_multi_edge_graph() const { return _impl_.grin_assume_has_multi_edge_graph_; } -inline bool TopologyTrait::grin_assume_has_multi_edge_graph() const { - // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_assume_has_multi_edge_graph) +inline bool TopologyFeature::grin_assume_has_multi_edge_graph() const { + // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_assume_has_multi_edge_graph) return _internal_grin_assume_has_multi_edge_graph(); } -inline void TopologyTrait::_internal_set_grin_assume_has_multi_edge_graph(bool value) { +inline void TopologyFeature::_internal_set_grin_assume_has_multi_edge_graph(bool value) { _impl_.grin_assume_has_multi_edge_graph_ = value; } -inline void TopologyTrait::set_grin_assume_has_multi_edge_graph(bool value) { +inline void TopologyFeature::set_grin_assume_has_multi_edge_graph(bool value) { _internal_set_grin_assume_has_multi_edge_graph(value); - // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_assume_has_multi_edge_graph) + // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_assume_has_multi_edge_graph) } // bool grin_with_vertex_original_id = 4; -inline void TopologyTrait::clear_grin_with_vertex_original_id() { +inline void TopologyFeature::clear_grin_with_vertex_original_id() { _impl_.grin_with_vertex_original_id_ = false; } -inline bool TopologyTrait::_internal_grin_with_vertex_original_id() const { +inline bool TopologyFeature::_internal_grin_with_vertex_original_id() const { return _impl_.grin_with_vertex_original_id_; } -inline bool TopologyTrait::grin_with_vertex_original_id() const { - // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_with_vertex_original_id) +inline bool TopologyFeature::grin_with_vertex_original_id() const { + // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_with_vertex_original_id) return _internal_grin_with_vertex_original_id(); } -inline void TopologyTrait::_internal_set_grin_with_vertex_original_id(bool value) { +inline void TopologyFeature::_internal_set_grin_with_vertex_original_id(bool value) { _impl_.grin_with_vertex_original_id_ = value; } -inline void TopologyTrait::set_grin_with_vertex_original_id(bool value) { +inline void TopologyFeature::set_grin_with_vertex_original_id(bool value) { _internal_set_grin_with_vertex_original_id(value); - // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_with_vertex_original_id) + // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_with_vertex_original_id) } // bool grin_with_vertex_data = 5; -inline void TopologyTrait::clear_grin_with_vertex_data() { +inline void TopologyFeature::clear_grin_with_vertex_data() { _impl_.grin_with_vertex_data_ = false; } -inline bool TopologyTrait::_internal_grin_with_vertex_data() const { +inline bool TopologyFeature::_internal_grin_with_vertex_data() const { return _impl_.grin_with_vertex_data_; } -inline bool TopologyTrait::grin_with_vertex_data() const { - // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_with_vertex_data) +inline bool TopologyFeature::grin_with_vertex_data() const { + // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_with_vertex_data) return _internal_grin_with_vertex_data(); } -inline void TopologyTrait::_internal_set_grin_with_vertex_data(bool value) { +inline void TopologyFeature::_internal_set_grin_with_vertex_data(bool value) { _impl_.grin_with_vertex_data_ = value; } -inline void TopologyTrait::set_grin_with_vertex_data(bool value) { +inline void TopologyFeature::set_grin_with_vertex_data(bool value) { _internal_set_grin_with_vertex_data(value); - // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_with_vertex_data) + // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_with_vertex_data) } // bool grin_with_edge_data = 6; -inline void TopologyTrait::clear_grin_with_edge_data() { +inline void TopologyFeature::clear_grin_with_edge_data() { _impl_.grin_with_edge_data_ = false; } -inline bool TopologyTrait::_internal_grin_with_edge_data() const { +inline bool TopologyFeature::_internal_grin_with_edge_data() const { return _impl_.grin_with_edge_data_; } -inline bool TopologyTrait::grin_with_edge_data() const { - // @@protoc_insertion_point(field_get:grin.TopologyTrait.grin_with_edge_data) +inline bool TopologyFeature::grin_with_edge_data() const { + // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_with_edge_data) return _internal_grin_with_edge_data(); } -inline void TopologyTrait::_internal_set_grin_with_edge_data(bool value) { +inline void TopologyFeature::_internal_set_grin_with_edge_data(bool value) { _impl_.grin_with_edge_data_ = value; } -inline void TopologyTrait::set_grin_with_edge_data(bool value) { +inline void TopologyFeature::set_grin_with_edge_data(bool value) { _internal_set_grin_with_edge_data(value); - // @@protoc_insertion_point(field_set:grin.TopologyTrait.grin_with_edge_data) + // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_with_edge_data) } // repeated .grin.ListRetrieval vertex_list_retrievals = 7; -inline int TopologyTrait::_internal_vertex_list_retrievals_size() const { +inline int TopologyFeature::_internal_vertex_list_retrievals_size() const { return _impl_.vertex_list_retrievals_.size(); } -inline int TopologyTrait::vertex_list_retrievals_size() const { +inline int TopologyFeature::vertex_list_retrievals_size() const { return _internal_vertex_list_retrievals_size(); } -inline void TopologyTrait::clear_vertex_list_retrievals() { +inline void TopologyFeature::clear_vertex_list_retrievals() { _impl_.vertex_list_retrievals_.Clear(); } -inline ::grin::ListRetrieval TopologyTrait::_internal_vertex_list_retrievals(int index) const { +inline ::grin::ListRetrieval TopologyFeature::_internal_vertex_list_retrievals(int index) const { return static_cast< ::grin::ListRetrieval >(_impl_.vertex_list_retrievals_.Get(index)); } -inline ::grin::ListRetrieval TopologyTrait::vertex_list_retrievals(int index) const { - // @@protoc_insertion_point(field_get:grin.TopologyTrait.vertex_list_retrievals) +inline ::grin::ListRetrieval TopologyFeature::vertex_list_retrievals(int index) const { + // @@protoc_insertion_point(field_get:grin.TopologyFeature.vertex_list_retrievals) return _internal_vertex_list_retrievals(index); } -inline void TopologyTrait::set_vertex_list_retrievals(int index, ::grin::ListRetrieval value) { +inline void TopologyFeature::set_vertex_list_retrievals(int index, ::grin::ListRetrieval value) { _impl_.vertex_list_retrievals_.Set(index, value); - // @@protoc_insertion_point(field_set:grin.TopologyTrait.vertex_list_retrievals) + // @@protoc_insertion_point(field_set:grin.TopologyFeature.vertex_list_retrievals) } -inline void TopologyTrait::_internal_add_vertex_list_retrievals(::grin::ListRetrieval value) { +inline void TopologyFeature::_internal_add_vertex_list_retrievals(::grin::ListRetrieval value) { _impl_.vertex_list_retrievals_.Add(value); } -inline void TopologyTrait::add_vertex_list_retrievals(::grin::ListRetrieval value) { +inline void TopologyFeature::add_vertex_list_retrievals(::grin::ListRetrieval value) { _internal_add_vertex_list_retrievals(value); - // @@protoc_insertion_point(field_add:grin.TopologyTrait.vertex_list_retrievals) + // @@protoc_insertion_point(field_add:grin.TopologyFeature.vertex_list_retrievals) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& -TopologyTrait::vertex_list_retrievals() const { - // @@protoc_insertion_point(field_list:grin.TopologyTrait.vertex_list_retrievals) +TopologyFeature::vertex_list_retrievals() const { + // @@protoc_insertion_point(field_list:grin.TopologyFeature.vertex_list_retrievals) return _impl_.vertex_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyTrait::_internal_mutable_vertex_list_retrievals() { +TopologyFeature::_internal_mutable_vertex_list_retrievals() { return &_impl_.vertex_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyTrait::mutable_vertex_list_retrievals() { - // @@protoc_insertion_point(field_mutable_list:grin.TopologyTrait.vertex_list_retrievals) +TopologyFeature::mutable_vertex_list_retrievals() { + // @@protoc_insertion_point(field_mutable_list:grin.TopologyFeature.vertex_list_retrievals) return _internal_mutable_vertex_list_retrievals(); } // repeated .grin.ListRetrieval edge_list_retrievals = 8; -inline int TopologyTrait::_internal_edge_list_retrievals_size() const { +inline int TopologyFeature::_internal_edge_list_retrievals_size() const { return _impl_.edge_list_retrievals_.size(); } -inline int TopologyTrait::edge_list_retrievals_size() const { +inline int TopologyFeature::edge_list_retrievals_size() const { return _internal_edge_list_retrievals_size(); } -inline void TopologyTrait::clear_edge_list_retrievals() { +inline void TopologyFeature::clear_edge_list_retrievals() { _impl_.edge_list_retrievals_.Clear(); } -inline ::grin::ListRetrieval TopologyTrait::_internal_edge_list_retrievals(int index) const { +inline ::grin::ListRetrieval TopologyFeature::_internal_edge_list_retrievals(int index) const { return static_cast< ::grin::ListRetrieval >(_impl_.edge_list_retrievals_.Get(index)); } -inline ::grin::ListRetrieval TopologyTrait::edge_list_retrievals(int index) const { - // @@protoc_insertion_point(field_get:grin.TopologyTrait.edge_list_retrievals) +inline ::grin::ListRetrieval TopologyFeature::edge_list_retrievals(int index) const { + // @@protoc_insertion_point(field_get:grin.TopologyFeature.edge_list_retrievals) return _internal_edge_list_retrievals(index); } -inline void TopologyTrait::set_edge_list_retrievals(int index, ::grin::ListRetrieval value) { +inline void TopologyFeature::set_edge_list_retrievals(int index, ::grin::ListRetrieval value) { _impl_.edge_list_retrievals_.Set(index, value); - // @@protoc_insertion_point(field_set:grin.TopologyTrait.edge_list_retrievals) + // @@protoc_insertion_point(field_set:grin.TopologyFeature.edge_list_retrievals) } -inline void TopologyTrait::_internal_add_edge_list_retrievals(::grin::ListRetrieval value) { +inline void TopologyFeature::_internal_add_edge_list_retrievals(::grin::ListRetrieval value) { _impl_.edge_list_retrievals_.Add(value); } -inline void TopologyTrait::add_edge_list_retrievals(::grin::ListRetrieval value) { +inline void TopologyFeature::add_edge_list_retrievals(::grin::ListRetrieval value) { _internal_add_edge_list_retrievals(value); - // @@protoc_insertion_point(field_add:grin.TopologyTrait.edge_list_retrievals) + // @@protoc_insertion_point(field_add:grin.TopologyFeature.edge_list_retrievals) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& -TopologyTrait::edge_list_retrievals() const { - // @@protoc_insertion_point(field_list:grin.TopologyTrait.edge_list_retrievals) +TopologyFeature::edge_list_retrievals() const { + // @@protoc_insertion_point(field_list:grin.TopologyFeature.edge_list_retrievals) return _impl_.edge_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyTrait::_internal_mutable_edge_list_retrievals() { +TopologyFeature::_internal_mutable_edge_list_retrievals() { return &_impl_.edge_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyTrait::mutable_edge_list_retrievals() { - // @@protoc_insertion_point(field_mutable_list:grin.TopologyTrait.edge_list_retrievals) +TopologyFeature::mutable_edge_list_retrievals() { + // @@protoc_insertion_point(field_mutable_list:grin.TopologyFeature.edge_list_retrievals) return _internal_mutable_edge_list_retrievals(); } // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; -inline int TopologyTrait::_internal_adjacent_list_retrievals_size() const { +inline int TopologyFeature::_internal_adjacent_list_retrievals_size() const { return _impl_.adjacent_list_retrievals_.size(); } -inline int TopologyTrait::adjacent_list_retrievals_size() const { +inline int TopologyFeature::adjacent_list_retrievals_size() const { return _internal_adjacent_list_retrievals_size(); } -inline void TopologyTrait::clear_adjacent_list_retrievals() { +inline void TopologyFeature::clear_adjacent_list_retrievals() { _impl_.adjacent_list_retrievals_.Clear(); } -inline ::grin::ListRetrieval TopologyTrait::_internal_adjacent_list_retrievals(int index) const { +inline ::grin::ListRetrieval TopologyFeature::_internal_adjacent_list_retrievals(int index) const { return static_cast< ::grin::ListRetrieval >(_impl_.adjacent_list_retrievals_.Get(index)); } -inline ::grin::ListRetrieval TopologyTrait::adjacent_list_retrievals(int index) const { - // @@protoc_insertion_point(field_get:grin.TopologyTrait.adjacent_list_retrievals) +inline ::grin::ListRetrieval TopologyFeature::adjacent_list_retrievals(int index) const { + // @@protoc_insertion_point(field_get:grin.TopologyFeature.adjacent_list_retrievals) return _internal_adjacent_list_retrievals(index); } -inline void TopologyTrait::set_adjacent_list_retrievals(int index, ::grin::ListRetrieval value) { +inline void TopologyFeature::set_adjacent_list_retrievals(int index, ::grin::ListRetrieval value) { _impl_.adjacent_list_retrievals_.Set(index, value); - // @@protoc_insertion_point(field_set:grin.TopologyTrait.adjacent_list_retrievals) + // @@protoc_insertion_point(field_set:grin.TopologyFeature.adjacent_list_retrievals) } -inline void TopologyTrait::_internal_add_adjacent_list_retrievals(::grin::ListRetrieval value) { +inline void TopologyFeature::_internal_add_adjacent_list_retrievals(::grin::ListRetrieval value) { _impl_.adjacent_list_retrievals_.Add(value); } -inline void TopologyTrait::add_adjacent_list_retrievals(::grin::ListRetrieval value) { +inline void TopologyFeature::add_adjacent_list_retrievals(::grin::ListRetrieval value) { _internal_add_adjacent_list_retrievals(value); - // @@protoc_insertion_point(field_add:grin.TopologyTrait.adjacent_list_retrievals) + // @@protoc_insertion_point(field_add:grin.TopologyFeature.adjacent_list_retrievals) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& -TopologyTrait::adjacent_list_retrievals() const { - // @@protoc_insertion_point(field_list:grin.TopologyTrait.adjacent_list_retrievals) +TopologyFeature::adjacent_list_retrievals() const { + // @@protoc_insertion_point(field_list:grin.TopologyFeature.adjacent_list_retrievals) return _impl_.adjacent_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyTrait::_internal_mutable_adjacent_list_retrievals() { +TopologyFeature::_internal_mutable_adjacent_list_retrievals() { return &_impl_.adjacent_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyTrait::mutable_adjacent_list_retrievals() { - // @@protoc_insertion_point(field_mutable_list:grin.TopologyTrait.adjacent_list_retrievals) +TopologyFeature::mutable_adjacent_list_retrievals() { + // @@protoc_insertion_point(field_mutable_list:grin.TopologyFeature.adjacent_list_retrievals) return _internal_mutable_adjacent_list_retrievals(); } // ------------------------------------------------------------------- -// MirrorPartitionListTrait +// MirrorPartitionListFeature // bool grin_trait_master_vertex_mirror_partition_list = 1; -inline void MirrorPartitionListTrait::clear_grin_trait_master_vertex_mirror_partition_list() { +inline void MirrorPartitionListFeature::clear_grin_trait_master_vertex_mirror_partition_list() { _impl_.grin_trait_master_vertex_mirror_partition_list_ = false; } -inline bool MirrorPartitionListTrait::_internal_grin_trait_master_vertex_mirror_partition_list() const { +inline bool MirrorPartitionListFeature::_internal_grin_trait_master_vertex_mirror_partition_list() const { return _impl_.grin_trait_master_vertex_mirror_partition_list_; } -inline bool MirrorPartitionListTrait::grin_trait_master_vertex_mirror_partition_list() const { - // @@protoc_insertion_point(field_get:grin.MirrorPartitionListTrait.grin_trait_master_vertex_mirror_partition_list) +inline bool MirrorPartitionListFeature::grin_trait_master_vertex_mirror_partition_list() const { + // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_master_vertex_mirror_partition_list) return _internal_grin_trait_master_vertex_mirror_partition_list(); } -inline void MirrorPartitionListTrait::_internal_set_grin_trait_master_vertex_mirror_partition_list(bool value) { +inline void MirrorPartitionListFeature::_internal_set_grin_trait_master_vertex_mirror_partition_list(bool value) { _impl_.grin_trait_master_vertex_mirror_partition_list_ = value; } -inline void MirrorPartitionListTrait::set_grin_trait_master_vertex_mirror_partition_list(bool value) { +inline void MirrorPartitionListFeature::set_grin_trait_master_vertex_mirror_partition_list(bool value) { _internal_set_grin_trait_master_vertex_mirror_partition_list(value); - // @@protoc_insertion_point(field_set:grin.MirrorPartitionListTrait.grin_trait_master_vertex_mirror_partition_list) + // @@protoc_insertion_point(field_set:grin.MirrorPartitionListFeature.grin_trait_master_vertex_mirror_partition_list) } // bool grin_trait_mirror_vertex_mirror_partition_list = 2; -inline void MirrorPartitionListTrait::clear_grin_trait_mirror_vertex_mirror_partition_list() { +inline void MirrorPartitionListFeature::clear_grin_trait_mirror_vertex_mirror_partition_list() { _impl_.grin_trait_mirror_vertex_mirror_partition_list_ = false; } -inline bool MirrorPartitionListTrait::_internal_grin_trait_mirror_vertex_mirror_partition_list() const { +inline bool MirrorPartitionListFeature::_internal_grin_trait_mirror_vertex_mirror_partition_list() const { return _impl_.grin_trait_mirror_vertex_mirror_partition_list_; } -inline bool MirrorPartitionListTrait::grin_trait_mirror_vertex_mirror_partition_list() const { - // @@protoc_insertion_point(field_get:grin.MirrorPartitionListTrait.grin_trait_mirror_vertex_mirror_partition_list) +inline bool MirrorPartitionListFeature::grin_trait_mirror_vertex_mirror_partition_list() const { + // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_mirror_vertex_mirror_partition_list) return _internal_grin_trait_mirror_vertex_mirror_partition_list(); } -inline void MirrorPartitionListTrait::_internal_set_grin_trait_mirror_vertex_mirror_partition_list(bool value) { +inline void MirrorPartitionListFeature::_internal_set_grin_trait_mirror_vertex_mirror_partition_list(bool value) { _impl_.grin_trait_mirror_vertex_mirror_partition_list_ = value; } -inline void MirrorPartitionListTrait::set_grin_trait_mirror_vertex_mirror_partition_list(bool value) { +inline void MirrorPartitionListFeature::set_grin_trait_mirror_vertex_mirror_partition_list(bool value) { _internal_set_grin_trait_mirror_vertex_mirror_partition_list(value); - // @@protoc_insertion_point(field_set:grin.MirrorPartitionListTrait.grin_trait_mirror_vertex_mirror_partition_list) + // @@protoc_insertion_point(field_set:grin.MirrorPartitionListFeature.grin_trait_mirror_vertex_mirror_partition_list) } // bool grin_trait_master_edge_mirror_partition_list = 3; -inline void MirrorPartitionListTrait::clear_grin_trait_master_edge_mirror_partition_list() { +inline void MirrorPartitionListFeature::clear_grin_trait_master_edge_mirror_partition_list() { _impl_.grin_trait_master_edge_mirror_partition_list_ = false; } -inline bool MirrorPartitionListTrait::_internal_grin_trait_master_edge_mirror_partition_list() const { +inline bool MirrorPartitionListFeature::_internal_grin_trait_master_edge_mirror_partition_list() const { return _impl_.grin_trait_master_edge_mirror_partition_list_; } -inline bool MirrorPartitionListTrait::grin_trait_master_edge_mirror_partition_list() const { - // @@protoc_insertion_point(field_get:grin.MirrorPartitionListTrait.grin_trait_master_edge_mirror_partition_list) +inline bool MirrorPartitionListFeature::grin_trait_master_edge_mirror_partition_list() const { + // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_master_edge_mirror_partition_list) return _internal_grin_trait_master_edge_mirror_partition_list(); } -inline void MirrorPartitionListTrait::_internal_set_grin_trait_master_edge_mirror_partition_list(bool value) { +inline void MirrorPartitionListFeature::_internal_set_grin_trait_master_edge_mirror_partition_list(bool value) { _impl_.grin_trait_master_edge_mirror_partition_list_ = value; } -inline void MirrorPartitionListTrait::set_grin_trait_master_edge_mirror_partition_list(bool value) { +inline void MirrorPartitionListFeature::set_grin_trait_master_edge_mirror_partition_list(bool value) { _internal_set_grin_trait_master_edge_mirror_partition_list(value); - // @@protoc_insertion_point(field_set:grin.MirrorPartitionListTrait.grin_trait_master_edge_mirror_partition_list) + // @@protoc_insertion_point(field_set:grin.MirrorPartitionListFeature.grin_trait_master_edge_mirror_partition_list) } // bool grin_trait_mirror_edge_mirror_partition_list = 4; -inline void MirrorPartitionListTrait::clear_grin_trait_mirror_edge_mirror_partition_list() { +inline void MirrorPartitionListFeature::clear_grin_trait_mirror_edge_mirror_partition_list() { _impl_.grin_trait_mirror_edge_mirror_partition_list_ = false; } -inline bool MirrorPartitionListTrait::_internal_grin_trait_mirror_edge_mirror_partition_list() const { +inline bool MirrorPartitionListFeature::_internal_grin_trait_mirror_edge_mirror_partition_list() const { return _impl_.grin_trait_mirror_edge_mirror_partition_list_; } -inline bool MirrorPartitionListTrait::grin_trait_mirror_edge_mirror_partition_list() const { - // @@protoc_insertion_point(field_get:grin.MirrorPartitionListTrait.grin_trait_mirror_edge_mirror_partition_list) +inline bool MirrorPartitionListFeature::grin_trait_mirror_edge_mirror_partition_list() const { + // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_mirror_edge_mirror_partition_list) return _internal_grin_trait_mirror_edge_mirror_partition_list(); } -inline void MirrorPartitionListTrait::_internal_set_grin_trait_mirror_edge_mirror_partition_list(bool value) { +inline void MirrorPartitionListFeature::_internal_set_grin_trait_mirror_edge_mirror_partition_list(bool value) { _impl_.grin_trait_mirror_edge_mirror_partition_list_ = value; } -inline void MirrorPartitionListTrait::set_grin_trait_mirror_edge_mirror_partition_list(bool value) { +inline void MirrorPartitionListFeature::set_grin_trait_mirror_edge_mirror_partition_list(bool value) { _internal_set_grin_trait_mirror_edge_mirror_partition_list(value); - // @@protoc_insertion_point(field_set:grin.MirrorPartitionListTrait.grin_trait_mirror_edge_mirror_partition_list) + // @@protoc_insertion_point(field_set:grin.MirrorPartitionListFeature.grin_trait_mirror_edge_mirror_partition_list) } // ------------------------------------------------------------------- -// PartitionTrait +// PartitionFeature // .grin.GraphPartitionStrategy graph_partition_strategy = 1; -inline void PartitionTrait::clear_graph_partition_strategy() { +inline void PartitionFeature::clear_graph_partition_strategy() { _impl_.graph_partition_strategy_ = 0; } -inline ::grin::GraphPartitionStrategy PartitionTrait::_internal_graph_partition_strategy() const { +inline ::grin::GraphPartitionStrategy PartitionFeature::_internal_graph_partition_strategy() const { return static_cast< ::grin::GraphPartitionStrategy >(_impl_.graph_partition_strategy_); } -inline ::grin::GraphPartitionStrategy PartitionTrait::graph_partition_strategy() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.graph_partition_strategy) +inline ::grin::GraphPartitionStrategy PartitionFeature::graph_partition_strategy() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.graph_partition_strategy) return _internal_graph_partition_strategy(); } -inline void PartitionTrait::_internal_set_graph_partition_strategy(::grin::GraphPartitionStrategy value) { +inline void PartitionFeature::_internal_set_graph_partition_strategy(::grin::GraphPartitionStrategy value) { _impl_.graph_partition_strategy_ = value; } -inline void PartitionTrait::set_graph_partition_strategy(::grin::GraphPartitionStrategy value) { +inline void PartitionFeature::set_graph_partition_strategy(::grin::GraphPartitionStrategy value) { _internal_set_graph_partition_strategy(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.graph_partition_strategy) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.graph_partition_strategy) } // bool grin_trait_natural_id_for_partition = 2; -inline void PartitionTrait::clear_grin_trait_natural_id_for_partition() { +inline void PartitionFeature::clear_grin_trait_natural_id_for_partition() { _impl_.grin_trait_natural_id_for_partition_ = false; } -inline bool PartitionTrait::_internal_grin_trait_natural_id_for_partition() const { +inline bool PartitionFeature::_internal_grin_trait_natural_id_for_partition() const { return _impl_.grin_trait_natural_id_for_partition_; } -inline bool PartitionTrait::grin_trait_natural_id_for_partition() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_natural_id_for_partition) +inline bool PartitionFeature::grin_trait_natural_id_for_partition() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_natural_id_for_partition) return _internal_grin_trait_natural_id_for_partition(); } -inline void PartitionTrait::_internal_set_grin_trait_natural_id_for_partition(bool value) { +inline void PartitionFeature::_internal_set_grin_trait_natural_id_for_partition(bool value) { _impl_.grin_trait_natural_id_for_partition_ = value; } -inline void PartitionTrait::set_grin_trait_natural_id_for_partition(bool value) { +inline void PartitionFeature::set_grin_trait_natural_id_for_partition(bool value) { _internal_set_grin_trait_natural_id_for_partition(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_natural_id_for_partition) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_natural_id_for_partition) } // bool grin_enable_vertex_ref = 3; -inline void PartitionTrait::clear_grin_enable_vertex_ref() { +inline void PartitionFeature::clear_grin_enable_vertex_ref() { _impl_.grin_enable_vertex_ref_ = false; } -inline bool PartitionTrait::_internal_grin_enable_vertex_ref() const { +inline bool PartitionFeature::_internal_grin_enable_vertex_ref() const { return _impl_.grin_enable_vertex_ref_; } -inline bool PartitionTrait::grin_enable_vertex_ref() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_enable_vertex_ref) +inline bool PartitionFeature::grin_enable_vertex_ref() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_enable_vertex_ref) return _internal_grin_enable_vertex_ref(); } -inline void PartitionTrait::_internal_set_grin_enable_vertex_ref(bool value) { +inline void PartitionFeature::_internal_set_grin_enable_vertex_ref(bool value) { _impl_.grin_enable_vertex_ref_ = value; } -inline void PartitionTrait::set_grin_enable_vertex_ref(bool value) { +inline void PartitionFeature::set_grin_enable_vertex_ref(bool value) { _internal_set_grin_enable_vertex_ref(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_enable_vertex_ref) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_enable_vertex_ref) } // bool grin_enable_edge_ref = 4; -inline void PartitionTrait::clear_grin_enable_edge_ref() { +inline void PartitionFeature::clear_grin_enable_edge_ref() { _impl_.grin_enable_edge_ref_ = false; } -inline bool PartitionTrait::_internal_grin_enable_edge_ref() const { +inline bool PartitionFeature::_internal_grin_enable_edge_ref() const { return _impl_.grin_enable_edge_ref_; } -inline bool PartitionTrait::grin_enable_edge_ref() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_enable_edge_ref) +inline bool PartitionFeature::grin_enable_edge_ref() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_enable_edge_ref) return _internal_grin_enable_edge_ref(); } -inline void PartitionTrait::_internal_set_grin_enable_edge_ref(bool value) { +inline void PartitionFeature::_internal_set_grin_enable_edge_ref(bool value) { _impl_.grin_enable_edge_ref_ = value; } -inline void PartitionTrait::set_grin_enable_edge_ref(bool value) { +inline void PartitionFeature::set_grin_enable_edge_ref(bool value) { _internal_set_grin_enable_edge_ref(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_enable_edge_ref) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_enable_edge_ref) } // .grin.PropertyDataPartitionStrategy vertex_data = 5; -inline void PartitionTrait::clear_vertex_data() { +inline void PartitionFeature::clear_vertex_data() { _impl_.vertex_data_ = 0; } -inline ::grin::PropertyDataPartitionStrategy PartitionTrait::_internal_vertex_data() const { +inline ::grin::PropertyDataPartitionStrategy PartitionFeature::_internal_vertex_data() const { return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.vertex_data_); } -inline ::grin::PropertyDataPartitionStrategy PartitionTrait::vertex_data() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.vertex_data) +inline ::grin::PropertyDataPartitionStrategy PartitionFeature::vertex_data() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.vertex_data) return _internal_vertex_data(); } -inline void PartitionTrait::_internal_set_vertex_data(::grin::PropertyDataPartitionStrategy value) { +inline void PartitionFeature::_internal_set_vertex_data(::grin::PropertyDataPartitionStrategy value) { _impl_.vertex_data_ = value; } -inline void PartitionTrait::set_vertex_data(::grin::PropertyDataPartitionStrategy value) { +inline void PartitionFeature::set_vertex_data(::grin::PropertyDataPartitionStrategy value) { _internal_set_vertex_data(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.vertex_data) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.vertex_data) } // .grin.PropertyDataPartitionStrategy edge_data = 6; -inline void PartitionTrait::clear_edge_data() { +inline void PartitionFeature::clear_edge_data() { _impl_.edge_data_ = 0; } -inline ::grin::PropertyDataPartitionStrategy PartitionTrait::_internal_edge_data() const { +inline ::grin::PropertyDataPartitionStrategy PartitionFeature::_internal_edge_data() const { return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.edge_data_); } -inline ::grin::PropertyDataPartitionStrategy PartitionTrait::edge_data() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.edge_data) +inline ::grin::PropertyDataPartitionStrategy PartitionFeature::edge_data() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.edge_data) return _internal_edge_data(); } -inline void PartitionTrait::_internal_set_edge_data(::grin::PropertyDataPartitionStrategy value) { +inline void PartitionFeature::_internal_set_edge_data(::grin::PropertyDataPartitionStrategy value) { _impl_.edge_data_ = value; } -inline void PartitionTrait::set_edge_data(::grin::PropertyDataPartitionStrategy value) { +inline void PartitionFeature::set_edge_data(::grin::PropertyDataPartitionStrategy value) { _internal_set_edge_data(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.edge_data) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.edge_data) } -// .grin.MirrorPartitionListTrait mirror_partition_list_trait = 7; -inline bool PartitionTrait::_internal_has_mirror_partition_list_trait() const { - return this != internal_default_instance() && _impl_.mirror_partition_list_trait_ != nullptr; +// .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; +inline bool PartitionFeature::_internal_has_mirror_partition_list_feature() const { + return this != internal_default_instance() && _impl_.mirror_partition_list_feature_ != nullptr; } -inline bool PartitionTrait::has_mirror_partition_list_trait() const { - return _internal_has_mirror_partition_list_trait(); +inline bool PartitionFeature::has_mirror_partition_list_feature() const { + return _internal_has_mirror_partition_list_feature(); } -inline void PartitionTrait::clear_mirror_partition_list_trait() { - if (GetArenaForAllocation() == nullptr && _impl_.mirror_partition_list_trait_ != nullptr) { - delete _impl_.mirror_partition_list_trait_; +inline void PartitionFeature::clear_mirror_partition_list_feature() { + if (GetArenaForAllocation() == nullptr && _impl_.mirror_partition_list_feature_ != nullptr) { + delete _impl_.mirror_partition_list_feature_; } - _impl_.mirror_partition_list_trait_ = nullptr; + _impl_.mirror_partition_list_feature_ = nullptr; } -inline const ::grin::MirrorPartitionListTrait& PartitionTrait::_internal_mirror_partition_list_trait() const { - const ::grin::MirrorPartitionListTrait* p = _impl_.mirror_partition_list_trait_; - return p != nullptr ? *p : reinterpret_cast( - ::grin::_MirrorPartitionListTrait_default_instance_); +inline const ::grin::MirrorPartitionListFeature& PartitionFeature::_internal_mirror_partition_list_feature() const { + const ::grin::MirrorPartitionListFeature* p = _impl_.mirror_partition_list_feature_; + return p != nullptr ? *p : reinterpret_cast( + ::grin::_MirrorPartitionListFeature_default_instance_); } -inline const ::grin::MirrorPartitionListTrait& PartitionTrait::mirror_partition_list_trait() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.mirror_partition_list_trait) - return _internal_mirror_partition_list_trait(); +inline const ::grin::MirrorPartitionListFeature& PartitionFeature::mirror_partition_list_feature() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.mirror_partition_list_feature) + return _internal_mirror_partition_list_feature(); } -inline void PartitionTrait::unsafe_arena_set_allocated_mirror_partition_list_trait( - ::grin::MirrorPartitionListTrait* mirror_partition_list_trait) { +inline void PartitionFeature::unsafe_arena_set_allocated_mirror_partition_list_feature( + ::grin::MirrorPartitionListFeature* mirror_partition_list_feature) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.mirror_partition_list_trait_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.mirror_partition_list_feature_); } - _impl_.mirror_partition_list_trait_ = mirror_partition_list_trait; - if (mirror_partition_list_trait) { + _impl_.mirror_partition_list_feature_ = mirror_partition_list_feature; + if (mirror_partition_list_feature) { } else { } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PartitionTrait.mirror_partition_list_trait) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PartitionFeature.mirror_partition_list_feature) } -inline ::grin::MirrorPartitionListTrait* PartitionTrait::release_mirror_partition_list_trait() { +inline ::grin::MirrorPartitionListFeature* PartitionFeature::release_mirror_partition_list_feature() { - ::grin::MirrorPartitionListTrait* temp = _impl_.mirror_partition_list_trait_; - _impl_.mirror_partition_list_trait_ = nullptr; + ::grin::MirrorPartitionListFeature* temp = _impl_.mirror_partition_list_feature_; + _impl_.mirror_partition_list_feature_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -3105,537 +3105,537 @@ inline ::grin::MirrorPartitionListTrait* PartitionTrait::release_mirror_partitio #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::grin::MirrorPartitionListTrait* PartitionTrait::unsafe_arena_release_mirror_partition_list_trait() { - // @@protoc_insertion_point(field_release:grin.PartitionTrait.mirror_partition_list_trait) +inline ::grin::MirrorPartitionListFeature* PartitionFeature::unsafe_arena_release_mirror_partition_list_feature() { + // @@protoc_insertion_point(field_release:grin.PartitionFeature.mirror_partition_list_feature) - ::grin::MirrorPartitionListTrait* temp = _impl_.mirror_partition_list_trait_; - _impl_.mirror_partition_list_trait_ = nullptr; + ::grin::MirrorPartitionListFeature* temp = _impl_.mirror_partition_list_feature_; + _impl_.mirror_partition_list_feature_ = nullptr; return temp; } -inline ::grin::MirrorPartitionListTrait* PartitionTrait::_internal_mutable_mirror_partition_list_trait() { +inline ::grin::MirrorPartitionListFeature* PartitionFeature::_internal_mutable_mirror_partition_list_feature() { - if (_impl_.mirror_partition_list_trait_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::MirrorPartitionListTrait>(GetArenaForAllocation()); - _impl_.mirror_partition_list_trait_ = p; + if (_impl_.mirror_partition_list_feature_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::MirrorPartitionListFeature>(GetArenaForAllocation()); + _impl_.mirror_partition_list_feature_ = p; } - return _impl_.mirror_partition_list_trait_; + return _impl_.mirror_partition_list_feature_; } -inline ::grin::MirrorPartitionListTrait* PartitionTrait::mutable_mirror_partition_list_trait() { - ::grin::MirrorPartitionListTrait* _msg = _internal_mutable_mirror_partition_list_trait(); - // @@protoc_insertion_point(field_mutable:grin.PartitionTrait.mirror_partition_list_trait) +inline ::grin::MirrorPartitionListFeature* PartitionFeature::mutable_mirror_partition_list_feature() { + ::grin::MirrorPartitionListFeature* _msg = _internal_mutable_mirror_partition_list_feature(); + // @@protoc_insertion_point(field_mutable:grin.PartitionFeature.mirror_partition_list_feature) return _msg; } -inline void PartitionTrait::set_allocated_mirror_partition_list_trait(::grin::MirrorPartitionListTrait* mirror_partition_list_trait) { +inline void PartitionFeature::set_allocated_mirror_partition_list_feature(::grin::MirrorPartitionListFeature* mirror_partition_list_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.mirror_partition_list_trait_; + delete _impl_.mirror_partition_list_feature_; } - if (mirror_partition_list_trait) { + if (mirror_partition_list_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(mirror_partition_list_trait); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(mirror_partition_list_feature); if (message_arena != submessage_arena) { - mirror_partition_list_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, mirror_partition_list_trait, submessage_arena); + mirror_partition_list_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, mirror_partition_list_feature, submessage_arena); } } else { } - _impl_.mirror_partition_list_trait_ = mirror_partition_list_trait; - // @@protoc_insertion_point(field_set_allocated:grin.PartitionTrait.mirror_partition_list_trait) + _impl_.mirror_partition_list_feature_ = mirror_partition_list_feature; + // @@protoc_insertion_point(field_set_allocated:grin.PartitionFeature.mirror_partition_list_feature) } // bool grin_trait_select_master_for_vertex_list = 8; -inline void PartitionTrait::clear_grin_trait_select_master_for_vertex_list() { +inline void PartitionFeature::clear_grin_trait_select_master_for_vertex_list() { _impl_.grin_trait_select_master_for_vertex_list_ = false; } -inline bool PartitionTrait::_internal_grin_trait_select_master_for_vertex_list() const { +inline bool PartitionFeature::_internal_grin_trait_select_master_for_vertex_list() const { return _impl_.grin_trait_select_master_for_vertex_list_; } -inline bool PartitionTrait::grin_trait_select_master_for_vertex_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_master_for_vertex_list) +inline bool PartitionFeature::grin_trait_select_master_for_vertex_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_master_for_vertex_list) return _internal_grin_trait_select_master_for_vertex_list(); } -inline void PartitionTrait::_internal_set_grin_trait_select_master_for_vertex_list(bool value) { +inline void PartitionFeature::_internal_set_grin_trait_select_master_for_vertex_list(bool value) { _impl_.grin_trait_select_master_for_vertex_list_ = value; } -inline void PartitionTrait::set_grin_trait_select_master_for_vertex_list(bool value) { +inline void PartitionFeature::set_grin_trait_select_master_for_vertex_list(bool value) { _internal_set_grin_trait_select_master_for_vertex_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_master_for_vertex_list) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_master_for_vertex_list) } // bool grin_trait_select_partition_for_vertex_list = 9; -inline void PartitionTrait::clear_grin_trait_select_partition_for_vertex_list() { +inline void PartitionFeature::clear_grin_trait_select_partition_for_vertex_list() { _impl_.grin_trait_select_partition_for_vertex_list_ = false; } -inline bool PartitionTrait::_internal_grin_trait_select_partition_for_vertex_list() const { +inline bool PartitionFeature::_internal_grin_trait_select_partition_for_vertex_list() const { return _impl_.grin_trait_select_partition_for_vertex_list_; } -inline bool PartitionTrait::grin_trait_select_partition_for_vertex_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_partition_for_vertex_list) +inline bool PartitionFeature::grin_trait_select_partition_for_vertex_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_partition_for_vertex_list) return _internal_grin_trait_select_partition_for_vertex_list(); } -inline void PartitionTrait::_internal_set_grin_trait_select_partition_for_vertex_list(bool value) { +inline void PartitionFeature::_internal_set_grin_trait_select_partition_for_vertex_list(bool value) { _impl_.grin_trait_select_partition_for_vertex_list_ = value; } -inline void PartitionTrait::set_grin_trait_select_partition_for_vertex_list(bool value) { +inline void PartitionFeature::set_grin_trait_select_partition_for_vertex_list(bool value) { _internal_set_grin_trait_select_partition_for_vertex_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_partition_for_vertex_list) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_partition_for_vertex_list) } // bool grin_trait_select_master_for_edge_list = 10; -inline void PartitionTrait::clear_grin_trait_select_master_for_edge_list() { +inline void PartitionFeature::clear_grin_trait_select_master_for_edge_list() { _impl_.grin_trait_select_master_for_edge_list_ = false; } -inline bool PartitionTrait::_internal_grin_trait_select_master_for_edge_list() const { +inline bool PartitionFeature::_internal_grin_trait_select_master_for_edge_list() const { return _impl_.grin_trait_select_master_for_edge_list_; } -inline bool PartitionTrait::grin_trait_select_master_for_edge_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_master_for_edge_list) +inline bool PartitionFeature::grin_trait_select_master_for_edge_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_master_for_edge_list) return _internal_grin_trait_select_master_for_edge_list(); } -inline void PartitionTrait::_internal_set_grin_trait_select_master_for_edge_list(bool value) { +inline void PartitionFeature::_internal_set_grin_trait_select_master_for_edge_list(bool value) { _impl_.grin_trait_select_master_for_edge_list_ = value; } -inline void PartitionTrait::set_grin_trait_select_master_for_edge_list(bool value) { +inline void PartitionFeature::set_grin_trait_select_master_for_edge_list(bool value) { _internal_set_grin_trait_select_master_for_edge_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_master_for_edge_list) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_master_for_edge_list) } // bool grin_trait_select_partition_for_edge_list = 11; -inline void PartitionTrait::clear_grin_trait_select_partition_for_edge_list() { +inline void PartitionFeature::clear_grin_trait_select_partition_for_edge_list() { _impl_.grin_trait_select_partition_for_edge_list_ = false; } -inline bool PartitionTrait::_internal_grin_trait_select_partition_for_edge_list() const { +inline bool PartitionFeature::_internal_grin_trait_select_partition_for_edge_list() const { return _impl_.grin_trait_select_partition_for_edge_list_; } -inline bool PartitionTrait::grin_trait_select_partition_for_edge_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_partition_for_edge_list) +inline bool PartitionFeature::grin_trait_select_partition_for_edge_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_partition_for_edge_list) return _internal_grin_trait_select_partition_for_edge_list(); } -inline void PartitionTrait::_internal_set_grin_trait_select_partition_for_edge_list(bool value) { +inline void PartitionFeature::_internal_set_grin_trait_select_partition_for_edge_list(bool value) { _impl_.grin_trait_select_partition_for_edge_list_ = value; } -inline void PartitionTrait::set_grin_trait_select_partition_for_edge_list(bool value) { +inline void PartitionFeature::set_grin_trait_select_partition_for_edge_list(bool value) { _internal_set_grin_trait_select_partition_for_edge_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_partition_for_edge_list) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_partition_for_edge_list) } // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; -inline void PartitionTrait::clear_grin_trait_select_master_neighbor_for_adjacent_list() { +inline void PartitionFeature::clear_grin_trait_select_master_neighbor_for_adjacent_list() { _impl_.grin_trait_select_master_neighbor_for_adjacent_list_ = false; } -inline bool PartitionTrait::_internal_grin_trait_select_master_neighbor_for_adjacent_list() const { +inline bool PartitionFeature::_internal_grin_trait_select_master_neighbor_for_adjacent_list() const { return _impl_.grin_trait_select_master_neighbor_for_adjacent_list_; } -inline bool PartitionTrait::grin_trait_select_master_neighbor_for_adjacent_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_master_neighbor_for_adjacent_list) +inline bool PartitionFeature::grin_trait_select_master_neighbor_for_adjacent_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_master_neighbor_for_adjacent_list) return _internal_grin_trait_select_master_neighbor_for_adjacent_list(); } -inline void PartitionTrait::_internal_set_grin_trait_select_master_neighbor_for_adjacent_list(bool value) { +inline void PartitionFeature::_internal_set_grin_trait_select_master_neighbor_for_adjacent_list(bool value) { _impl_.grin_trait_select_master_neighbor_for_adjacent_list_ = value; } -inline void PartitionTrait::set_grin_trait_select_master_neighbor_for_adjacent_list(bool value) { +inline void PartitionFeature::set_grin_trait_select_master_neighbor_for_adjacent_list(bool value) { _internal_set_grin_trait_select_master_neighbor_for_adjacent_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_master_neighbor_for_adjacent_list) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_master_neighbor_for_adjacent_list) } // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; -inline void PartitionTrait::clear_grin_trait_select_neighbor_partition_for_adjacent_list() { +inline void PartitionFeature::clear_grin_trait_select_neighbor_partition_for_adjacent_list() { _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_ = false; } -inline bool PartitionTrait::_internal_grin_trait_select_neighbor_partition_for_adjacent_list() const { +inline bool PartitionFeature::_internal_grin_trait_select_neighbor_partition_for_adjacent_list() const { return _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_; } -inline bool PartitionTrait::grin_trait_select_neighbor_partition_for_adjacent_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionTrait.grin_trait_select_neighbor_partition_for_adjacent_list) +inline bool PartitionFeature::grin_trait_select_neighbor_partition_for_adjacent_list() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_neighbor_partition_for_adjacent_list) return _internal_grin_trait_select_neighbor_partition_for_adjacent_list(); } -inline void PartitionTrait::_internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value) { +inline void PartitionFeature::_internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value) { _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_ = value; } -inline void PartitionTrait::set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value) { +inline void PartitionFeature::set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value) { _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionTrait.grin_trait_select_neighbor_partition_for_adjacent_list) + // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_neighbor_partition_for_adjacent_list) } // ------------------------------------------------------------------- -// VertexPropertyTrait +// VertexPropertyFeature // bool grin_with_vertex_property = 1; -inline void VertexPropertyTrait::clear_grin_with_vertex_property() { +inline void VertexPropertyFeature::clear_grin_with_vertex_property() { _impl_.grin_with_vertex_property_ = false; } -inline bool VertexPropertyTrait::_internal_grin_with_vertex_property() const { +inline bool VertexPropertyFeature::_internal_grin_with_vertex_property() const { return _impl_.grin_with_vertex_property_; } -inline bool VertexPropertyTrait::grin_with_vertex_property() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_with_vertex_property) +inline bool VertexPropertyFeature::grin_with_vertex_property() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_with_vertex_property) return _internal_grin_with_vertex_property(); } -inline void VertexPropertyTrait::_internal_set_grin_with_vertex_property(bool value) { +inline void VertexPropertyFeature::_internal_set_grin_with_vertex_property(bool value) { _impl_.grin_with_vertex_property_ = value; } -inline void VertexPropertyTrait::set_grin_with_vertex_property(bool value) { +inline void VertexPropertyFeature::set_grin_with_vertex_property(bool value) { _internal_set_grin_with_vertex_property(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_with_vertex_property) + // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_with_vertex_property) } // bool grin_with_vertex_property_name = 2; -inline void VertexPropertyTrait::clear_grin_with_vertex_property_name() { +inline void VertexPropertyFeature::clear_grin_with_vertex_property_name() { _impl_.grin_with_vertex_property_name_ = false; } -inline bool VertexPropertyTrait::_internal_grin_with_vertex_property_name() const { +inline bool VertexPropertyFeature::_internal_grin_with_vertex_property_name() const { return _impl_.grin_with_vertex_property_name_; } -inline bool VertexPropertyTrait::grin_with_vertex_property_name() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_with_vertex_property_name) +inline bool VertexPropertyFeature::grin_with_vertex_property_name() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_with_vertex_property_name) return _internal_grin_with_vertex_property_name(); } -inline void VertexPropertyTrait::_internal_set_grin_with_vertex_property_name(bool value) { +inline void VertexPropertyFeature::_internal_set_grin_with_vertex_property_name(bool value) { _impl_.grin_with_vertex_property_name_ = value; } -inline void VertexPropertyTrait::set_grin_with_vertex_property_name(bool value) { +inline void VertexPropertyFeature::set_grin_with_vertex_property_name(bool value) { _internal_set_grin_with_vertex_property_name(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_with_vertex_property_name) + // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_with_vertex_property_name) } // bool grin_with_vertex_type_name = 3; -inline void VertexPropertyTrait::clear_grin_with_vertex_type_name() { +inline void VertexPropertyFeature::clear_grin_with_vertex_type_name() { _impl_.grin_with_vertex_type_name_ = false; } -inline bool VertexPropertyTrait::_internal_grin_with_vertex_type_name() const { +inline bool VertexPropertyFeature::_internal_grin_with_vertex_type_name() const { return _impl_.grin_with_vertex_type_name_; } -inline bool VertexPropertyTrait::grin_with_vertex_type_name() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_with_vertex_type_name) +inline bool VertexPropertyFeature::grin_with_vertex_type_name() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_with_vertex_type_name) return _internal_grin_with_vertex_type_name(); } -inline void VertexPropertyTrait::_internal_set_grin_with_vertex_type_name(bool value) { +inline void VertexPropertyFeature::_internal_set_grin_with_vertex_type_name(bool value) { _impl_.grin_with_vertex_type_name_ = value; } -inline void VertexPropertyTrait::set_grin_with_vertex_type_name(bool value) { +inline void VertexPropertyFeature::set_grin_with_vertex_type_name(bool value) { _internal_set_grin_with_vertex_type_name(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_with_vertex_type_name) + // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_with_vertex_type_name) } // bool grin_enable_vertex_property_table = 4; -inline void VertexPropertyTrait::clear_grin_enable_vertex_property_table() { +inline void VertexPropertyFeature::clear_grin_enable_vertex_property_table() { _impl_.grin_enable_vertex_property_table_ = false; } -inline bool VertexPropertyTrait::_internal_grin_enable_vertex_property_table() const { +inline bool VertexPropertyFeature::_internal_grin_enable_vertex_property_table() const { return _impl_.grin_enable_vertex_property_table_; } -inline bool VertexPropertyTrait::grin_enable_vertex_property_table() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_enable_vertex_property_table) +inline bool VertexPropertyFeature::grin_enable_vertex_property_table() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_enable_vertex_property_table) return _internal_grin_enable_vertex_property_table(); } -inline void VertexPropertyTrait::_internal_set_grin_enable_vertex_property_table(bool value) { +inline void VertexPropertyFeature::_internal_set_grin_enable_vertex_property_table(bool value) { _impl_.grin_enable_vertex_property_table_ = value; } -inline void VertexPropertyTrait::set_grin_enable_vertex_property_table(bool value) { +inline void VertexPropertyFeature::set_grin_enable_vertex_property_table(bool value) { _internal_set_grin_enable_vertex_property_table(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_enable_vertex_property_table) + // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_enable_vertex_property_table) } // bool grin_enable_vertex_primary_keys = 5; -inline void VertexPropertyTrait::clear_grin_enable_vertex_primary_keys() { +inline void VertexPropertyFeature::clear_grin_enable_vertex_primary_keys() { _impl_.grin_enable_vertex_primary_keys_ = false; } -inline bool VertexPropertyTrait::_internal_grin_enable_vertex_primary_keys() const { +inline bool VertexPropertyFeature::_internal_grin_enable_vertex_primary_keys() const { return _impl_.grin_enable_vertex_primary_keys_; } -inline bool VertexPropertyTrait::grin_enable_vertex_primary_keys() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_enable_vertex_primary_keys) +inline bool VertexPropertyFeature::grin_enable_vertex_primary_keys() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_enable_vertex_primary_keys) return _internal_grin_enable_vertex_primary_keys(); } -inline void VertexPropertyTrait::_internal_set_grin_enable_vertex_primary_keys(bool value) { +inline void VertexPropertyFeature::_internal_set_grin_enable_vertex_primary_keys(bool value) { _impl_.grin_enable_vertex_primary_keys_ = value; } -inline void VertexPropertyTrait::set_grin_enable_vertex_primary_keys(bool value) { +inline void VertexPropertyFeature::set_grin_enable_vertex_primary_keys(bool value) { _internal_set_grin_enable_vertex_primary_keys(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_enable_vertex_primary_keys) + // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_enable_vertex_primary_keys) } // bool grin_trait_natural_id_for_vertex_type = 6; -inline void VertexPropertyTrait::clear_grin_trait_natural_id_for_vertex_type() { +inline void VertexPropertyFeature::clear_grin_trait_natural_id_for_vertex_type() { _impl_.grin_trait_natural_id_for_vertex_type_ = false; } -inline bool VertexPropertyTrait::_internal_grin_trait_natural_id_for_vertex_type() const { +inline bool VertexPropertyFeature::_internal_grin_trait_natural_id_for_vertex_type() const { return _impl_.grin_trait_natural_id_for_vertex_type_; } -inline bool VertexPropertyTrait::grin_trait_natural_id_for_vertex_type() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_trait_natural_id_for_vertex_type) +inline bool VertexPropertyFeature::grin_trait_natural_id_for_vertex_type() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_trait_natural_id_for_vertex_type) return _internal_grin_trait_natural_id_for_vertex_type(); } -inline void VertexPropertyTrait::_internal_set_grin_trait_natural_id_for_vertex_type(bool value) { +inline void VertexPropertyFeature::_internal_set_grin_trait_natural_id_for_vertex_type(bool value) { _impl_.grin_trait_natural_id_for_vertex_type_ = value; } -inline void VertexPropertyTrait::set_grin_trait_natural_id_for_vertex_type(bool value) { +inline void VertexPropertyFeature::set_grin_trait_natural_id_for_vertex_type(bool value) { _internal_set_grin_trait_natural_id_for_vertex_type(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_trait_natural_id_for_vertex_type) + // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_trait_natural_id_for_vertex_type) } // bool grin_trait_natural_id_for_vertex_property = 7; -inline void VertexPropertyTrait::clear_grin_trait_natural_id_for_vertex_property() { +inline void VertexPropertyFeature::clear_grin_trait_natural_id_for_vertex_property() { _impl_.grin_trait_natural_id_for_vertex_property_ = false; } -inline bool VertexPropertyTrait::_internal_grin_trait_natural_id_for_vertex_property() const { +inline bool VertexPropertyFeature::_internal_grin_trait_natural_id_for_vertex_property() const { return _impl_.grin_trait_natural_id_for_vertex_property_; } -inline bool VertexPropertyTrait::grin_trait_natural_id_for_vertex_property() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_trait_natural_id_for_vertex_property) +inline bool VertexPropertyFeature::grin_trait_natural_id_for_vertex_property() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_trait_natural_id_for_vertex_property) return _internal_grin_trait_natural_id_for_vertex_property(); } -inline void VertexPropertyTrait::_internal_set_grin_trait_natural_id_for_vertex_property(bool value) { +inline void VertexPropertyFeature::_internal_set_grin_trait_natural_id_for_vertex_property(bool value) { _impl_.grin_trait_natural_id_for_vertex_property_ = value; } -inline void VertexPropertyTrait::set_grin_trait_natural_id_for_vertex_property(bool value) { +inline void VertexPropertyFeature::set_grin_trait_natural_id_for_vertex_property(bool value) { _internal_set_grin_trait_natural_id_for_vertex_property(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_trait_natural_id_for_vertex_property) + // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_trait_natural_id_for_vertex_property) } // bool grin_assume_by_type_vertex_original_id = 8; -inline void VertexPropertyTrait::clear_grin_assume_by_type_vertex_original_id() { +inline void VertexPropertyFeature::clear_grin_assume_by_type_vertex_original_id() { _impl_.grin_assume_by_type_vertex_original_id_ = false; } -inline bool VertexPropertyTrait::_internal_grin_assume_by_type_vertex_original_id() const { +inline bool VertexPropertyFeature::_internal_grin_assume_by_type_vertex_original_id() const { return _impl_.grin_assume_by_type_vertex_original_id_; } -inline bool VertexPropertyTrait::grin_assume_by_type_vertex_original_id() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyTrait.grin_assume_by_type_vertex_original_id) +inline bool VertexPropertyFeature::grin_assume_by_type_vertex_original_id() const { + // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_assume_by_type_vertex_original_id) return _internal_grin_assume_by_type_vertex_original_id(); } -inline void VertexPropertyTrait::_internal_set_grin_assume_by_type_vertex_original_id(bool value) { +inline void VertexPropertyFeature::_internal_set_grin_assume_by_type_vertex_original_id(bool value) { _impl_.grin_assume_by_type_vertex_original_id_ = value; } -inline void VertexPropertyTrait::set_grin_assume_by_type_vertex_original_id(bool value) { +inline void VertexPropertyFeature::set_grin_assume_by_type_vertex_original_id(bool value) { _internal_set_grin_assume_by_type_vertex_original_id(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyTrait.grin_assume_by_type_vertex_original_id) + // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_assume_by_type_vertex_original_id) } // ------------------------------------------------------------------- -// EdgePropertyTrait +// EdgePropertyFeature // bool grin_with_edge_property = 1; -inline void EdgePropertyTrait::clear_grin_with_edge_property() { +inline void EdgePropertyFeature::clear_grin_with_edge_property() { _impl_.grin_with_edge_property_ = false; } -inline bool EdgePropertyTrait::_internal_grin_with_edge_property() const { +inline bool EdgePropertyFeature::_internal_grin_with_edge_property() const { return _impl_.grin_with_edge_property_; } -inline bool EdgePropertyTrait::grin_with_edge_property() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_with_edge_property) +inline bool EdgePropertyFeature::grin_with_edge_property() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_with_edge_property) return _internal_grin_with_edge_property(); } -inline void EdgePropertyTrait::_internal_set_grin_with_edge_property(bool value) { +inline void EdgePropertyFeature::_internal_set_grin_with_edge_property(bool value) { _impl_.grin_with_edge_property_ = value; } -inline void EdgePropertyTrait::set_grin_with_edge_property(bool value) { +inline void EdgePropertyFeature::set_grin_with_edge_property(bool value) { _internal_set_grin_with_edge_property(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_with_edge_property) + // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_with_edge_property) } // bool grin_with_edge_property_name = 2; -inline void EdgePropertyTrait::clear_grin_with_edge_property_name() { +inline void EdgePropertyFeature::clear_grin_with_edge_property_name() { _impl_.grin_with_edge_property_name_ = false; } -inline bool EdgePropertyTrait::_internal_grin_with_edge_property_name() const { +inline bool EdgePropertyFeature::_internal_grin_with_edge_property_name() const { return _impl_.grin_with_edge_property_name_; } -inline bool EdgePropertyTrait::grin_with_edge_property_name() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_with_edge_property_name) +inline bool EdgePropertyFeature::grin_with_edge_property_name() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_with_edge_property_name) return _internal_grin_with_edge_property_name(); } -inline void EdgePropertyTrait::_internal_set_grin_with_edge_property_name(bool value) { +inline void EdgePropertyFeature::_internal_set_grin_with_edge_property_name(bool value) { _impl_.grin_with_edge_property_name_ = value; } -inline void EdgePropertyTrait::set_grin_with_edge_property_name(bool value) { +inline void EdgePropertyFeature::set_grin_with_edge_property_name(bool value) { _internal_set_grin_with_edge_property_name(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_with_edge_property_name) + // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_with_edge_property_name) } // bool grin_with_edge_type_name = 3; -inline void EdgePropertyTrait::clear_grin_with_edge_type_name() { +inline void EdgePropertyFeature::clear_grin_with_edge_type_name() { _impl_.grin_with_edge_type_name_ = false; } -inline bool EdgePropertyTrait::_internal_grin_with_edge_type_name() const { +inline bool EdgePropertyFeature::_internal_grin_with_edge_type_name() const { return _impl_.grin_with_edge_type_name_; } -inline bool EdgePropertyTrait::grin_with_edge_type_name() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_with_edge_type_name) +inline bool EdgePropertyFeature::grin_with_edge_type_name() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_with_edge_type_name) return _internal_grin_with_edge_type_name(); } -inline void EdgePropertyTrait::_internal_set_grin_with_edge_type_name(bool value) { +inline void EdgePropertyFeature::_internal_set_grin_with_edge_type_name(bool value) { _impl_.grin_with_edge_type_name_ = value; } -inline void EdgePropertyTrait::set_grin_with_edge_type_name(bool value) { +inline void EdgePropertyFeature::set_grin_with_edge_type_name(bool value) { _internal_set_grin_with_edge_type_name(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_with_edge_type_name) + // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_with_edge_type_name) } // bool grin_enable_edge_property_table = 4; -inline void EdgePropertyTrait::clear_grin_enable_edge_property_table() { +inline void EdgePropertyFeature::clear_grin_enable_edge_property_table() { _impl_.grin_enable_edge_property_table_ = false; } -inline bool EdgePropertyTrait::_internal_grin_enable_edge_property_table() const { +inline bool EdgePropertyFeature::_internal_grin_enable_edge_property_table() const { return _impl_.grin_enable_edge_property_table_; } -inline bool EdgePropertyTrait::grin_enable_edge_property_table() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_enable_edge_property_table) +inline bool EdgePropertyFeature::grin_enable_edge_property_table() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_enable_edge_property_table) return _internal_grin_enable_edge_property_table(); } -inline void EdgePropertyTrait::_internal_set_grin_enable_edge_property_table(bool value) { +inline void EdgePropertyFeature::_internal_set_grin_enable_edge_property_table(bool value) { _impl_.grin_enable_edge_property_table_ = value; } -inline void EdgePropertyTrait::set_grin_enable_edge_property_table(bool value) { +inline void EdgePropertyFeature::set_grin_enable_edge_property_table(bool value) { _internal_set_grin_enable_edge_property_table(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_enable_edge_property_table) + // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_enable_edge_property_table) } // bool grin_enable_edge_primary_keys = 5; -inline void EdgePropertyTrait::clear_grin_enable_edge_primary_keys() { +inline void EdgePropertyFeature::clear_grin_enable_edge_primary_keys() { _impl_.grin_enable_edge_primary_keys_ = false; } -inline bool EdgePropertyTrait::_internal_grin_enable_edge_primary_keys() const { +inline bool EdgePropertyFeature::_internal_grin_enable_edge_primary_keys() const { return _impl_.grin_enable_edge_primary_keys_; } -inline bool EdgePropertyTrait::grin_enable_edge_primary_keys() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_enable_edge_primary_keys) +inline bool EdgePropertyFeature::grin_enable_edge_primary_keys() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_enable_edge_primary_keys) return _internal_grin_enable_edge_primary_keys(); } -inline void EdgePropertyTrait::_internal_set_grin_enable_edge_primary_keys(bool value) { +inline void EdgePropertyFeature::_internal_set_grin_enable_edge_primary_keys(bool value) { _impl_.grin_enable_edge_primary_keys_ = value; } -inline void EdgePropertyTrait::set_grin_enable_edge_primary_keys(bool value) { +inline void EdgePropertyFeature::set_grin_enable_edge_primary_keys(bool value) { _internal_set_grin_enable_edge_primary_keys(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_enable_edge_primary_keys) + // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_enable_edge_primary_keys) } // bool grin_trait_natural_id_for_edge_type = 6; -inline void EdgePropertyTrait::clear_grin_trait_natural_id_for_edge_type() { +inline void EdgePropertyFeature::clear_grin_trait_natural_id_for_edge_type() { _impl_.grin_trait_natural_id_for_edge_type_ = false; } -inline bool EdgePropertyTrait::_internal_grin_trait_natural_id_for_edge_type() const { +inline bool EdgePropertyFeature::_internal_grin_trait_natural_id_for_edge_type() const { return _impl_.grin_trait_natural_id_for_edge_type_; } -inline bool EdgePropertyTrait::grin_trait_natural_id_for_edge_type() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_trait_natural_id_for_edge_type) +inline bool EdgePropertyFeature::grin_trait_natural_id_for_edge_type() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_trait_natural_id_for_edge_type) return _internal_grin_trait_natural_id_for_edge_type(); } -inline void EdgePropertyTrait::_internal_set_grin_trait_natural_id_for_edge_type(bool value) { +inline void EdgePropertyFeature::_internal_set_grin_trait_natural_id_for_edge_type(bool value) { _impl_.grin_trait_natural_id_for_edge_type_ = value; } -inline void EdgePropertyTrait::set_grin_trait_natural_id_for_edge_type(bool value) { +inline void EdgePropertyFeature::set_grin_trait_natural_id_for_edge_type(bool value) { _internal_set_grin_trait_natural_id_for_edge_type(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_trait_natural_id_for_edge_type) + // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_trait_natural_id_for_edge_type) } // bool grin_trait_natural_id_for_edge_property = 7; -inline void EdgePropertyTrait::clear_grin_trait_natural_id_for_edge_property() { +inline void EdgePropertyFeature::clear_grin_trait_natural_id_for_edge_property() { _impl_.grin_trait_natural_id_for_edge_property_ = false; } -inline bool EdgePropertyTrait::_internal_grin_trait_natural_id_for_edge_property() const { +inline bool EdgePropertyFeature::_internal_grin_trait_natural_id_for_edge_property() const { return _impl_.grin_trait_natural_id_for_edge_property_; } -inline bool EdgePropertyTrait::grin_trait_natural_id_for_edge_property() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyTrait.grin_trait_natural_id_for_edge_property) +inline bool EdgePropertyFeature::grin_trait_natural_id_for_edge_property() const { + // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_trait_natural_id_for_edge_property) return _internal_grin_trait_natural_id_for_edge_property(); } -inline void EdgePropertyTrait::_internal_set_grin_trait_natural_id_for_edge_property(bool value) { +inline void EdgePropertyFeature::_internal_set_grin_trait_natural_id_for_edge_property(bool value) { _impl_.grin_trait_natural_id_for_edge_property_ = value; } -inline void EdgePropertyTrait::set_grin_trait_natural_id_for_edge_property(bool value) { +inline void EdgePropertyFeature::set_grin_trait_natural_id_for_edge_property(bool value) { _internal_set_grin_trait_natural_id_for_edge_property(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyTrait.grin_trait_natural_id_for_edge_property) + // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_trait_natural_id_for_edge_property) } // ------------------------------------------------------------------- -// PropertyTrait +// PropertyFeature // bool grin_enable_row = 1; -inline void PropertyTrait::clear_grin_enable_row() { +inline void PropertyFeature::clear_grin_enable_row() { _impl_.grin_enable_row_ = false; } -inline bool PropertyTrait::_internal_grin_enable_row() const { +inline bool PropertyFeature::_internal_grin_enable_row() const { return _impl_.grin_enable_row_; } -inline bool PropertyTrait::grin_enable_row() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_enable_row) +inline bool PropertyFeature::grin_enable_row() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_enable_row) return _internal_grin_enable_row(); } -inline void PropertyTrait::_internal_set_grin_enable_row(bool value) { +inline void PropertyFeature::_internal_set_grin_enable_row(bool value) { _impl_.grin_enable_row_ = value; } -inline void PropertyTrait::set_grin_enable_row(bool value) { +inline void PropertyFeature::set_grin_enable_row(bool value) { _internal_set_grin_enable_row(value); - // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_enable_row) + // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_enable_row) } -// .grin.VertexPropertyTrait vertex_property_trait = 2; -inline bool PropertyTrait::_internal_has_vertex_property_trait() const { - return this != internal_default_instance() && _impl_.vertex_property_trait_ != nullptr; +// .grin.VertexPropertyFeature vertex_property_feature = 2; +inline bool PropertyFeature::_internal_has_vertex_property_feature() const { + return this != internal_default_instance() && _impl_.vertex_property_feature_ != nullptr; } -inline bool PropertyTrait::has_vertex_property_trait() const { - return _internal_has_vertex_property_trait(); +inline bool PropertyFeature::has_vertex_property_feature() const { + return _internal_has_vertex_property_feature(); } -inline void PropertyTrait::clear_vertex_property_trait() { - if (GetArenaForAllocation() == nullptr && _impl_.vertex_property_trait_ != nullptr) { - delete _impl_.vertex_property_trait_; +inline void PropertyFeature::clear_vertex_property_feature() { + if (GetArenaForAllocation() == nullptr && _impl_.vertex_property_feature_ != nullptr) { + delete _impl_.vertex_property_feature_; } - _impl_.vertex_property_trait_ = nullptr; + _impl_.vertex_property_feature_ = nullptr; } -inline const ::grin::VertexPropertyTrait& PropertyTrait::_internal_vertex_property_trait() const { - const ::grin::VertexPropertyTrait* p = _impl_.vertex_property_trait_; - return p != nullptr ? *p : reinterpret_cast( - ::grin::_VertexPropertyTrait_default_instance_); +inline const ::grin::VertexPropertyFeature& PropertyFeature::_internal_vertex_property_feature() const { + const ::grin::VertexPropertyFeature* p = _impl_.vertex_property_feature_; + return p != nullptr ? *p : reinterpret_cast( + ::grin::_VertexPropertyFeature_default_instance_); } -inline const ::grin::VertexPropertyTrait& PropertyTrait::vertex_property_trait() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.vertex_property_trait) - return _internal_vertex_property_trait(); +inline const ::grin::VertexPropertyFeature& PropertyFeature::vertex_property_feature() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.vertex_property_feature) + return _internal_vertex_property_feature(); } -inline void PropertyTrait::unsafe_arena_set_allocated_vertex_property_trait( - ::grin::VertexPropertyTrait* vertex_property_trait) { +inline void PropertyFeature::unsafe_arena_set_allocated_vertex_property_feature( + ::grin::VertexPropertyFeature* vertex_property_feature) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.vertex_property_trait_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.vertex_property_feature_); } - _impl_.vertex_property_trait_ = vertex_property_trait; - if (vertex_property_trait) { + _impl_.vertex_property_feature_ = vertex_property_feature; + if (vertex_property_feature) { } else { } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PropertyTrait.vertex_property_trait) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PropertyFeature.vertex_property_feature) } -inline ::grin::VertexPropertyTrait* PropertyTrait::release_vertex_property_trait() { +inline ::grin::VertexPropertyFeature* PropertyFeature::release_vertex_property_feature() { - ::grin::VertexPropertyTrait* temp = _impl_.vertex_property_trait_; - _impl_.vertex_property_trait_ = nullptr; + ::grin::VertexPropertyFeature* temp = _impl_.vertex_property_feature_; + _impl_.vertex_property_feature_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -3647,85 +3647,85 @@ inline ::grin::VertexPropertyTrait* PropertyTrait::release_vertex_property_trait #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::grin::VertexPropertyTrait* PropertyTrait::unsafe_arena_release_vertex_property_trait() { - // @@protoc_insertion_point(field_release:grin.PropertyTrait.vertex_property_trait) +inline ::grin::VertexPropertyFeature* PropertyFeature::unsafe_arena_release_vertex_property_feature() { + // @@protoc_insertion_point(field_release:grin.PropertyFeature.vertex_property_feature) - ::grin::VertexPropertyTrait* temp = _impl_.vertex_property_trait_; - _impl_.vertex_property_trait_ = nullptr; + ::grin::VertexPropertyFeature* temp = _impl_.vertex_property_feature_; + _impl_.vertex_property_feature_ = nullptr; return temp; } -inline ::grin::VertexPropertyTrait* PropertyTrait::_internal_mutable_vertex_property_trait() { +inline ::grin::VertexPropertyFeature* PropertyFeature::_internal_mutable_vertex_property_feature() { - if (_impl_.vertex_property_trait_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::VertexPropertyTrait>(GetArenaForAllocation()); - _impl_.vertex_property_trait_ = p; + if (_impl_.vertex_property_feature_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::VertexPropertyFeature>(GetArenaForAllocation()); + _impl_.vertex_property_feature_ = p; } - return _impl_.vertex_property_trait_; + return _impl_.vertex_property_feature_; } -inline ::grin::VertexPropertyTrait* PropertyTrait::mutable_vertex_property_trait() { - ::grin::VertexPropertyTrait* _msg = _internal_mutable_vertex_property_trait(); - // @@protoc_insertion_point(field_mutable:grin.PropertyTrait.vertex_property_trait) +inline ::grin::VertexPropertyFeature* PropertyFeature::mutable_vertex_property_feature() { + ::grin::VertexPropertyFeature* _msg = _internal_mutable_vertex_property_feature(); + // @@protoc_insertion_point(field_mutable:grin.PropertyFeature.vertex_property_feature) return _msg; } -inline void PropertyTrait::set_allocated_vertex_property_trait(::grin::VertexPropertyTrait* vertex_property_trait) { +inline void PropertyFeature::set_allocated_vertex_property_feature(::grin::VertexPropertyFeature* vertex_property_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.vertex_property_trait_; + delete _impl_.vertex_property_feature_; } - if (vertex_property_trait) { + if (vertex_property_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(vertex_property_trait); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(vertex_property_feature); if (message_arena != submessage_arena) { - vertex_property_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, vertex_property_trait, submessage_arena); + vertex_property_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, vertex_property_feature, submessage_arena); } } else { } - _impl_.vertex_property_trait_ = vertex_property_trait; - // @@protoc_insertion_point(field_set_allocated:grin.PropertyTrait.vertex_property_trait) + _impl_.vertex_property_feature_ = vertex_property_feature; + // @@protoc_insertion_point(field_set_allocated:grin.PropertyFeature.vertex_property_feature) } -// .grin.EdgePropertyTrait edge_property_trait = 3; -inline bool PropertyTrait::_internal_has_edge_property_trait() const { - return this != internal_default_instance() && _impl_.edge_property_trait_ != nullptr; +// .grin.EdgePropertyFeature edge_property_feature = 3; +inline bool PropertyFeature::_internal_has_edge_property_feature() const { + return this != internal_default_instance() && _impl_.edge_property_feature_ != nullptr; } -inline bool PropertyTrait::has_edge_property_trait() const { - return _internal_has_edge_property_trait(); +inline bool PropertyFeature::has_edge_property_feature() const { + return _internal_has_edge_property_feature(); } -inline void PropertyTrait::clear_edge_property_trait() { - if (GetArenaForAllocation() == nullptr && _impl_.edge_property_trait_ != nullptr) { - delete _impl_.edge_property_trait_; +inline void PropertyFeature::clear_edge_property_feature() { + if (GetArenaForAllocation() == nullptr && _impl_.edge_property_feature_ != nullptr) { + delete _impl_.edge_property_feature_; } - _impl_.edge_property_trait_ = nullptr; + _impl_.edge_property_feature_ = nullptr; } -inline const ::grin::EdgePropertyTrait& PropertyTrait::_internal_edge_property_trait() const { - const ::grin::EdgePropertyTrait* p = _impl_.edge_property_trait_; - return p != nullptr ? *p : reinterpret_cast( - ::grin::_EdgePropertyTrait_default_instance_); +inline const ::grin::EdgePropertyFeature& PropertyFeature::_internal_edge_property_feature() const { + const ::grin::EdgePropertyFeature* p = _impl_.edge_property_feature_; + return p != nullptr ? *p : reinterpret_cast( + ::grin::_EdgePropertyFeature_default_instance_); } -inline const ::grin::EdgePropertyTrait& PropertyTrait::edge_property_trait() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.edge_property_trait) - return _internal_edge_property_trait(); +inline const ::grin::EdgePropertyFeature& PropertyFeature::edge_property_feature() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.edge_property_feature) + return _internal_edge_property_feature(); } -inline void PropertyTrait::unsafe_arena_set_allocated_edge_property_trait( - ::grin::EdgePropertyTrait* edge_property_trait) { +inline void PropertyFeature::unsafe_arena_set_allocated_edge_property_feature( + ::grin::EdgePropertyFeature* edge_property_feature) { if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.edge_property_trait_); + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.edge_property_feature_); } - _impl_.edge_property_trait_ = edge_property_trait; - if (edge_property_trait) { + _impl_.edge_property_feature_ = edge_property_feature; + if (edge_property_feature) { } else { } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PropertyTrait.edge_property_trait) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PropertyFeature.edge_property_feature) } -inline ::grin::EdgePropertyTrait* PropertyTrait::release_edge_property_trait() { +inline ::grin::EdgePropertyFeature* PropertyFeature::release_edge_property_feature() { - ::grin::EdgePropertyTrait* temp = _impl_.edge_property_trait_; - _impl_.edge_property_trait_ = nullptr; + ::grin::EdgePropertyFeature* temp = _impl_.edge_property_feature_; + _impl_.edge_property_feature_ = nullptr; #ifdef PROTOBUF_FORCE_COPY_IN_RELEASE auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); @@ -3737,676 +3737,676 @@ inline ::grin::EdgePropertyTrait* PropertyTrait::release_edge_property_trait() { #endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } -inline ::grin::EdgePropertyTrait* PropertyTrait::unsafe_arena_release_edge_property_trait() { - // @@protoc_insertion_point(field_release:grin.PropertyTrait.edge_property_trait) +inline ::grin::EdgePropertyFeature* PropertyFeature::unsafe_arena_release_edge_property_feature() { + // @@protoc_insertion_point(field_release:grin.PropertyFeature.edge_property_feature) - ::grin::EdgePropertyTrait* temp = _impl_.edge_property_trait_; - _impl_.edge_property_trait_ = nullptr; + ::grin::EdgePropertyFeature* temp = _impl_.edge_property_feature_; + _impl_.edge_property_feature_ = nullptr; return temp; } -inline ::grin::EdgePropertyTrait* PropertyTrait::_internal_mutable_edge_property_trait() { +inline ::grin::EdgePropertyFeature* PropertyFeature::_internal_mutable_edge_property_feature() { - if (_impl_.edge_property_trait_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::EdgePropertyTrait>(GetArenaForAllocation()); - _impl_.edge_property_trait_ = p; + if (_impl_.edge_property_feature_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::EdgePropertyFeature>(GetArenaForAllocation()); + _impl_.edge_property_feature_ = p; } - return _impl_.edge_property_trait_; + return _impl_.edge_property_feature_; } -inline ::grin::EdgePropertyTrait* PropertyTrait::mutable_edge_property_trait() { - ::grin::EdgePropertyTrait* _msg = _internal_mutable_edge_property_trait(); - // @@protoc_insertion_point(field_mutable:grin.PropertyTrait.edge_property_trait) +inline ::grin::EdgePropertyFeature* PropertyFeature::mutable_edge_property_feature() { + ::grin::EdgePropertyFeature* _msg = _internal_mutable_edge_property_feature(); + // @@protoc_insertion_point(field_mutable:grin.PropertyFeature.edge_property_feature) return _msg; } -inline void PropertyTrait::set_allocated_edge_property_trait(::grin::EdgePropertyTrait* edge_property_trait) { +inline void PropertyFeature::set_allocated_edge_property_feature(::grin::EdgePropertyFeature* edge_property_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); if (message_arena == nullptr) { - delete _impl_.edge_property_trait_; + delete _impl_.edge_property_feature_; } - if (edge_property_trait) { + if (edge_property_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(edge_property_trait); + ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(edge_property_feature); if (message_arena != submessage_arena) { - edge_property_trait = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, edge_property_trait, submessage_arena); + edge_property_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, edge_property_feature, submessage_arena); } } else { } - _impl_.edge_property_trait_ = edge_property_trait; - // @@protoc_insertion_point(field_set_allocated:grin.PropertyTrait.edge_property_trait) + _impl_.edge_property_feature_ = edge_property_feature; + // @@protoc_insertion_point(field_set_allocated:grin.PropertyFeature.edge_property_feature) } // .grin.PropertyDataPartitionStrategy vertex_property = 4; -inline void PropertyTrait::clear_vertex_property() { +inline void PropertyFeature::clear_vertex_property() { _impl_.vertex_property_ = 0; } -inline ::grin::PropertyDataPartitionStrategy PropertyTrait::_internal_vertex_property() const { +inline ::grin::PropertyDataPartitionStrategy PropertyFeature::_internal_vertex_property() const { return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.vertex_property_); } -inline ::grin::PropertyDataPartitionStrategy PropertyTrait::vertex_property() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.vertex_property) +inline ::grin::PropertyDataPartitionStrategy PropertyFeature::vertex_property() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.vertex_property) return _internal_vertex_property(); } -inline void PropertyTrait::_internal_set_vertex_property(::grin::PropertyDataPartitionStrategy value) { +inline void PropertyFeature::_internal_set_vertex_property(::grin::PropertyDataPartitionStrategy value) { _impl_.vertex_property_ = value; } -inline void PropertyTrait::set_vertex_property(::grin::PropertyDataPartitionStrategy value) { +inline void PropertyFeature::set_vertex_property(::grin::PropertyDataPartitionStrategy value) { _internal_set_vertex_property(value); - // @@protoc_insertion_point(field_set:grin.PropertyTrait.vertex_property) + // @@protoc_insertion_point(field_set:grin.PropertyFeature.vertex_property) } // .grin.PropertyDataPartitionStrategy edge_property = 5; -inline void PropertyTrait::clear_edge_property() { +inline void PropertyFeature::clear_edge_property() { _impl_.edge_property_ = 0; } -inline ::grin::PropertyDataPartitionStrategy PropertyTrait::_internal_edge_property() const { +inline ::grin::PropertyDataPartitionStrategy PropertyFeature::_internal_edge_property() const { return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.edge_property_); } -inline ::grin::PropertyDataPartitionStrategy PropertyTrait::edge_property() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.edge_property) +inline ::grin::PropertyDataPartitionStrategy PropertyFeature::edge_property() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.edge_property) return _internal_edge_property(); } -inline void PropertyTrait::_internal_set_edge_property(::grin::PropertyDataPartitionStrategy value) { +inline void PropertyFeature::_internal_set_edge_property(::grin::PropertyDataPartitionStrategy value) { _impl_.edge_property_ = value; } -inline void PropertyTrait::set_edge_property(::grin::PropertyDataPartitionStrategy value) { +inline void PropertyFeature::set_edge_property(::grin::PropertyDataPartitionStrategy value) { _internal_set_edge_property(value); - // @@protoc_insertion_point(field_set:grin.PropertyTrait.edge_property) + // @@protoc_insertion_point(field_set:grin.PropertyFeature.edge_property) } // bool grin_assume_column_store_for_vertex_property = 6; -inline void PropertyTrait::clear_grin_assume_column_store_for_vertex_property() { +inline void PropertyFeature::clear_grin_assume_column_store_for_vertex_property() { _impl_.grin_assume_column_store_for_vertex_property_ = false; } -inline bool PropertyTrait::_internal_grin_assume_column_store_for_vertex_property() const { +inline bool PropertyFeature::_internal_grin_assume_column_store_for_vertex_property() const { return _impl_.grin_assume_column_store_for_vertex_property_; } -inline bool PropertyTrait::grin_assume_column_store_for_vertex_property() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_assume_column_store_for_vertex_property) +inline bool PropertyFeature::grin_assume_column_store_for_vertex_property() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_assume_column_store_for_vertex_property) return _internal_grin_assume_column_store_for_vertex_property(); } -inline void PropertyTrait::_internal_set_grin_assume_column_store_for_vertex_property(bool value) { +inline void PropertyFeature::_internal_set_grin_assume_column_store_for_vertex_property(bool value) { _impl_.grin_assume_column_store_for_vertex_property_ = value; } -inline void PropertyTrait::set_grin_assume_column_store_for_vertex_property(bool value) { +inline void PropertyFeature::set_grin_assume_column_store_for_vertex_property(bool value) { _internal_set_grin_assume_column_store_for_vertex_property(value); - // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_assume_column_store_for_vertex_property) + // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_assume_column_store_for_vertex_property) } // bool grin_assume_column_store_for_edge_property = 7; -inline void PropertyTrait::clear_grin_assume_column_store_for_edge_property() { +inline void PropertyFeature::clear_grin_assume_column_store_for_edge_property() { _impl_.grin_assume_column_store_for_edge_property_ = false; } -inline bool PropertyTrait::_internal_grin_assume_column_store_for_edge_property() const { +inline bool PropertyFeature::_internal_grin_assume_column_store_for_edge_property() const { return _impl_.grin_assume_column_store_for_edge_property_; } -inline bool PropertyTrait::grin_assume_column_store_for_edge_property() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_assume_column_store_for_edge_property) +inline bool PropertyFeature::grin_assume_column_store_for_edge_property() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_assume_column_store_for_edge_property) return _internal_grin_assume_column_store_for_edge_property(); } -inline void PropertyTrait::_internal_set_grin_assume_column_store_for_edge_property(bool value) { +inline void PropertyFeature::_internal_set_grin_assume_column_store_for_edge_property(bool value) { _impl_.grin_assume_column_store_for_edge_property_ = value; } -inline void PropertyTrait::set_grin_assume_column_store_for_edge_property(bool value) { +inline void PropertyFeature::set_grin_assume_column_store_for_edge_property(bool value) { _internal_set_grin_assume_column_store_for_edge_property(value); - // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_assume_column_store_for_edge_property) + // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_assume_column_store_for_edge_property) } // bool grin_trait_select_type_for_vertex_list = 8; -inline void PropertyTrait::clear_grin_trait_select_type_for_vertex_list() { +inline void PropertyFeature::clear_grin_trait_select_type_for_vertex_list() { _impl_.grin_trait_select_type_for_vertex_list_ = false; } -inline bool PropertyTrait::_internal_grin_trait_select_type_for_vertex_list() const { +inline bool PropertyFeature::_internal_grin_trait_select_type_for_vertex_list() const { return _impl_.grin_trait_select_type_for_vertex_list_; } -inline bool PropertyTrait::grin_trait_select_type_for_vertex_list() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_trait_select_type_for_vertex_list) +inline bool PropertyFeature::grin_trait_select_type_for_vertex_list() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_type_for_vertex_list) return _internal_grin_trait_select_type_for_vertex_list(); } -inline void PropertyTrait::_internal_set_grin_trait_select_type_for_vertex_list(bool value) { +inline void PropertyFeature::_internal_set_grin_trait_select_type_for_vertex_list(bool value) { _impl_.grin_trait_select_type_for_vertex_list_ = value; } -inline void PropertyTrait::set_grin_trait_select_type_for_vertex_list(bool value) { +inline void PropertyFeature::set_grin_trait_select_type_for_vertex_list(bool value) { _internal_set_grin_trait_select_type_for_vertex_list(value); - // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_trait_select_type_for_vertex_list) + // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_trait_select_type_for_vertex_list) } // bool grin_trait_select_type_for_edge_list = 9; -inline void PropertyTrait::clear_grin_trait_select_type_for_edge_list() { +inline void PropertyFeature::clear_grin_trait_select_type_for_edge_list() { _impl_.grin_trait_select_type_for_edge_list_ = false; } -inline bool PropertyTrait::_internal_grin_trait_select_type_for_edge_list() const { +inline bool PropertyFeature::_internal_grin_trait_select_type_for_edge_list() const { return _impl_.grin_trait_select_type_for_edge_list_; } -inline bool PropertyTrait::grin_trait_select_type_for_edge_list() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_trait_select_type_for_edge_list) +inline bool PropertyFeature::grin_trait_select_type_for_edge_list() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_type_for_edge_list) return _internal_grin_trait_select_type_for_edge_list(); } -inline void PropertyTrait::_internal_set_grin_trait_select_type_for_edge_list(bool value) { +inline void PropertyFeature::_internal_set_grin_trait_select_type_for_edge_list(bool value) { _impl_.grin_trait_select_type_for_edge_list_ = value; } -inline void PropertyTrait::set_grin_trait_select_type_for_edge_list(bool value) { +inline void PropertyFeature::set_grin_trait_select_type_for_edge_list(bool value) { _internal_set_grin_trait_select_type_for_edge_list(value); - // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_trait_select_type_for_edge_list) + // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_trait_select_type_for_edge_list) } // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; -inline void PropertyTrait::clear_grin_trait_select_neighbor_type_for_adjacent_list() { +inline void PropertyFeature::clear_grin_trait_select_neighbor_type_for_adjacent_list() { _impl_.grin_trait_select_neighbor_type_for_adjacent_list_ = false; } -inline bool PropertyTrait::_internal_grin_trait_select_neighbor_type_for_adjacent_list() const { +inline bool PropertyFeature::_internal_grin_trait_select_neighbor_type_for_adjacent_list() const { return _impl_.grin_trait_select_neighbor_type_for_adjacent_list_; } -inline bool PropertyTrait::grin_trait_select_neighbor_type_for_adjacent_list() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_trait_select_neighbor_type_for_adjacent_list) +inline bool PropertyFeature::grin_trait_select_neighbor_type_for_adjacent_list() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_neighbor_type_for_adjacent_list) return _internal_grin_trait_select_neighbor_type_for_adjacent_list(); } -inline void PropertyTrait::_internal_set_grin_trait_select_neighbor_type_for_adjacent_list(bool value) { +inline void PropertyFeature::_internal_set_grin_trait_select_neighbor_type_for_adjacent_list(bool value) { _impl_.grin_trait_select_neighbor_type_for_adjacent_list_ = value; } -inline void PropertyTrait::set_grin_trait_select_neighbor_type_for_adjacent_list(bool value) { +inline void PropertyFeature::set_grin_trait_select_neighbor_type_for_adjacent_list(bool value) { _internal_set_grin_trait_select_neighbor_type_for_adjacent_list(value); - // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_trait_select_neighbor_type_for_adjacent_list) + // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_trait_select_neighbor_type_for_adjacent_list) } // bool grin_trait_select_edge_type_for_adjacent_list = 11; -inline void PropertyTrait::clear_grin_trait_select_edge_type_for_adjacent_list() { +inline void PropertyFeature::clear_grin_trait_select_edge_type_for_adjacent_list() { _impl_.grin_trait_select_edge_type_for_adjacent_list_ = false; } -inline bool PropertyTrait::_internal_grin_trait_select_edge_type_for_adjacent_list() const { +inline bool PropertyFeature::_internal_grin_trait_select_edge_type_for_adjacent_list() const { return _impl_.grin_trait_select_edge_type_for_adjacent_list_; } -inline bool PropertyTrait::grin_trait_select_edge_type_for_adjacent_list() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_trait_select_edge_type_for_adjacent_list) +inline bool PropertyFeature::grin_trait_select_edge_type_for_adjacent_list() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_edge_type_for_adjacent_list) return _internal_grin_trait_select_edge_type_for_adjacent_list(); } -inline void PropertyTrait::_internal_set_grin_trait_select_edge_type_for_adjacent_list(bool value) { +inline void PropertyFeature::_internal_set_grin_trait_select_edge_type_for_adjacent_list(bool value) { _impl_.grin_trait_select_edge_type_for_adjacent_list_ = value; } -inline void PropertyTrait::set_grin_trait_select_edge_type_for_adjacent_list(bool value) { +inline void PropertyFeature::set_grin_trait_select_edge_type_for_adjacent_list(bool value) { _internal_set_grin_trait_select_edge_type_for_adjacent_list(value); - // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_trait_select_edge_type_for_adjacent_list) + // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_trait_select_edge_type_for_adjacent_list) } // bool grin_trait_specific_vev_relation = 12; -inline void PropertyTrait::clear_grin_trait_specific_vev_relation() { +inline void PropertyFeature::clear_grin_trait_specific_vev_relation() { _impl_.grin_trait_specific_vev_relation_ = false; } -inline bool PropertyTrait::_internal_grin_trait_specific_vev_relation() const { +inline bool PropertyFeature::_internal_grin_trait_specific_vev_relation() const { return _impl_.grin_trait_specific_vev_relation_; } -inline bool PropertyTrait::grin_trait_specific_vev_relation() const { - // @@protoc_insertion_point(field_get:grin.PropertyTrait.grin_trait_specific_vev_relation) +inline bool PropertyFeature::grin_trait_specific_vev_relation() const { + // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_specific_vev_relation) return _internal_grin_trait_specific_vev_relation(); } -inline void PropertyTrait::_internal_set_grin_trait_specific_vev_relation(bool value) { +inline void PropertyFeature::_internal_set_grin_trait_specific_vev_relation(bool value) { _impl_.grin_trait_specific_vev_relation_ = value; } -inline void PropertyTrait::set_grin_trait_specific_vev_relation(bool value) { +inline void PropertyFeature::set_grin_trait_specific_vev_relation(bool value) { _internal_set_grin_trait_specific_vev_relation(value); - // @@protoc_insertion_point(field_set:grin.PropertyTrait.grin_trait_specific_vev_relation) + // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_trait_specific_vev_relation) } // ------------------------------------------------------------------- -// IndexTrait +// IndexFeature // bool grin_with_vertex_label = 1; -inline void IndexTrait::clear_grin_with_vertex_label() { +inline void IndexFeature::clear_grin_with_vertex_label() { _impl_.grin_with_vertex_label_ = false; } -inline bool IndexTrait::_internal_grin_with_vertex_label() const { +inline bool IndexFeature::_internal_grin_with_vertex_label() const { return _impl_.grin_with_vertex_label_; } -inline bool IndexTrait::grin_with_vertex_label() const { - // @@protoc_insertion_point(field_get:grin.IndexTrait.grin_with_vertex_label) +inline bool IndexFeature::grin_with_vertex_label() const { + // @@protoc_insertion_point(field_get:grin.IndexFeature.grin_with_vertex_label) return _internal_grin_with_vertex_label(); } -inline void IndexTrait::_internal_set_grin_with_vertex_label(bool value) { +inline void IndexFeature::_internal_set_grin_with_vertex_label(bool value) { _impl_.grin_with_vertex_label_ = value; } -inline void IndexTrait::set_grin_with_vertex_label(bool value) { +inline void IndexFeature::set_grin_with_vertex_label(bool value) { _internal_set_grin_with_vertex_label(value); - // @@protoc_insertion_point(field_set:grin.IndexTrait.grin_with_vertex_label) + // @@protoc_insertion_point(field_set:grin.IndexFeature.grin_with_vertex_label) } // bool grin_with_edge_label = 2; -inline void IndexTrait::clear_grin_with_edge_label() { +inline void IndexFeature::clear_grin_with_edge_label() { _impl_.grin_with_edge_label_ = false; } -inline bool IndexTrait::_internal_grin_with_edge_label() const { +inline bool IndexFeature::_internal_grin_with_edge_label() const { return _impl_.grin_with_edge_label_; } -inline bool IndexTrait::grin_with_edge_label() const { - // @@protoc_insertion_point(field_get:grin.IndexTrait.grin_with_edge_label) +inline bool IndexFeature::grin_with_edge_label() const { + // @@protoc_insertion_point(field_get:grin.IndexFeature.grin_with_edge_label) return _internal_grin_with_edge_label(); } -inline void IndexTrait::_internal_set_grin_with_edge_label(bool value) { +inline void IndexFeature::_internal_set_grin_with_edge_label(bool value) { _impl_.grin_with_edge_label_ = value; } -inline void IndexTrait::set_grin_with_edge_label(bool value) { +inline void IndexFeature::set_grin_with_edge_label(bool value) { _internal_set_grin_with_edge_label(value); - // @@protoc_insertion_point(field_set:grin.IndexTrait.grin_with_edge_label) + // @@protoc_insertion_point(field_set:grin.IndexFeature.grin_with_edge_label) } // bool grin_assume_all_vertex_list_sorted = 3; -inline void IndexTrait::clear_grin_assume_all_vertex_list_sorted() { +inline void IndexFeature::clear_grin_assume_all_vertex_list_sorted() { _impl_.grin_assume_all_vertex_list_sorted_ = false; } -inline bool IndexTrait::_internal_grin_assume_all_vertex_list_sorted() const { +inline bool IndexFeature::_internal_grin_assume_all_vertex_list_sorted() const { return _impl_.grin_assume_all_vertex_list_sorted_; } -inline bool IndexTrait::grin_assume_all_vertex_list_sorted() const { - // @@protoc_insertion_point(field_get:grin.IndexTrait.grin_assume_all_vertex_list_sorted) +inline bool IndexFeature::grin_assume_all_vertex_list_sorted() const { + // @@protoc_insertion_point(field_get:grin.IndexFeature.grin_assume_all_vertex_list_sorted) return _internal_grin_assume_all_vertex_list_sorted(); } -inline void IndexTrait::_internal_set_grin_assume_all_vertex_list_sorted(bool value) { +inline void IndexFeature::_internal_set_grin_assume_all_vertex_list_sorted(bool value) { _impl_.grin_assume_all_vertex_list_sorted_ = value; } -inline void IndexTrait::set_grin_assume_all_vertex_list_sorted(bool value) { +inline void IndexFeature::set_grin_assume_all_vertex_list_sorted(bool value) { _internal_set_grin_assume_all_vertex_list_sorted(value); - // @@protoc_insertion_point(field_set:grin.IndexTrait.grin_assume_all_vertex_list_sorted) + // @@protoc_insertion_point(field_set:grin.IndexFeature.grin_assume_all_vertex_list_sorted) } // ------------------------------------------------------------------- -// PredicateTrait +// PredicateFeature // ------------------------------------------------------------------- -// StorageTrait +// StorageFeature -// .grin.TopologyTrait topology_trait = 1; -inline bool StorageTrait::_internal_has_topology_trait() const { - return specific_trait_case() == kTopologyTrait; +// .grin.TopologyFeature topology_feature = 1; +inline bool StorageFeature::_internal_has_topology_feature() const { + return specific_feature_case() == kTopologyFeature; } -inline bool StorageTrait::has_topology_trait() const { - return _internal_has_topology_trait(); +inline bool StorageFeature::has_topology_feature() const { + return _internal_has_topology_feature(); } -inline void StorageTrait::set_has_topology_trait() { - _impl_._oneof_case_[0] = kTopologyTrait; +inline void StorageFeature::set_has_topology_feature() { + _impl_._oneof_case_[0] = kTopologyFeature; } -inline void StorageTrait::clear_topology_trait() { - if (_internal_has_topology_trait()) { +inline void StorageFeature::clear_topology_feature() { + if (_internal_has_topology_feature()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_trait_.topology_trait_; + delete _impl_.specific_feature_.topology_feature_; } - clear_has_specific_trait(); + clear_has_specific_feature(); } } -inline ::grin::TopologyTrait* StorageTrait::release_topology_trait() { - // @@protoc_insertion_point(field_release:grin.StorageTrait.topology_trait) - if (_internal_has_topology_trait()) { - clear_has_specific_trait(); - ::grin::TopologyTrait* temp = _impl_.specific_trait_.topology_trait_; +inline ::grin::TopologyFeature* StorageFeature::release_topology_feature() { + // @@protoc_insertion_point(field_release:grin.StorageFeature.topology_feature) + if (_internal_has_topology_feature()) { + clear_has_specific_feature(); + ::grin::TopologyFeature* temp = _impl_.specific_feature_.topology_feature_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.specific_trait_.topology_trait_ = nullptr; + _impl_.specific_feature_.topology_feature_ = nullptr; return temp; } else { return nullptr; } } -inline const ::grin::TopologyTrait& StorageTrait::_internal_topology_trait() const { - return _internal_has_topology_trait() - ? *_impl_.specific_trait_.topology_trait_ - : reinterpret_cast< ::grin::TopologyTrait&>(::grin::_TopologyTrait_default_instance_); +inline const ::grin::TopologyFeature& StorageFeature::_internal_topology_feature() const { + return _internal_has_topology_feature() + ? *_impl_.specific_feature_.topology_feature_ + : reinterpret_cast< ::grin::TopologyFeature&>(::grin::_TopologyFeature_default_instance_); } -inline const ::grin::TopologyTrait& StorageTrait::topology_trait() const { - // @@protoc_insertion_point(field_get:grin.StorageTrait.topology_trait) - return _internal_topology_trait(); +inline const ::grin::TopologyFeature& StorageFeature::topology_feature() const { + // @@protoc_insertion_point(field_get:grin.StorageFeature.topology_feature) + return _internal_topology_feature(); } -inline ::grin::TopologyTrait* StorageTrait::unsafe_arena_release_topology_trait() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageTrait.topology_trait) - if (_internal_has_topology_trait()) { - clear_has_specific_trait(); - ::grin::TopologyTrait* temp = _impl_.specific_trait_.topology_trait_; - _impl_.specific_trait_.topology_trait_ = nullptr; +inline ::grin::TopologyFeature* StorageFeature::unsafe_arena_release_topology_feature() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.topology_feature) + if (_internal_has_topology_feature()) { + clear_has_specific_feature(); + ::grin::TopologyFeature* temp = _impl_.specific_feature_.topology_feature_; + _impl_.specific_feature_.topology_feature_ = nullptr; return temp; } else { return nullptr; } } -inline void StorageTrait::unsafe_arena_set_allocated_topology_trait(::grin::TopologyTrait* topology_trait) { - clear_specific_trait(); - if (topology_trait) { - set_has_topology_trait(); - _impl_.specific_trait_.topology_trait_ = topology_trait; +inline void StorageFeature::unsafe_arena_set_allocated_topology_feature(::grin::TopologyFeature* topology_feature) { + clear_specific_feature(); + if (topology_feature) { + set_has_topology_feature(); + _impl_.specific_feature_.topology_feature_ = topology_feature; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageTrait.topology_trait) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.topology_feature) } -inline ::grin::TopologyTrait* StorageTrait::_internal_mutable_topology_trait() { - if (!_internal_has_topology_trait()) { - clear_specific_trait(); - set_has_topology_trait(); - _impl_.specific_trait_.topology_trait_ = CreateMaybeMessage< ::grin::TopologyTrait >(GetArenaForAllocation()); +inline ::grin::TopologyFeature* StorageFeature::_internal_mutable_topology_feature() { + if (!_internal_has_topology_feature()) { + clear_specific_feature(); + set_has_topology_feature(); + _impl_.specific_feature_.topology_feature_ = CreateMaybeMessage< ::grin::TopologyFeature >(GetArenaForAllocation()); } - return _impl_.specific_trait_.topology_trait_; + return _impl_.specific_feature_.topology_feature_; } -inline ::grin::TopologyTrait* StorageTrait::mutable_topology_trait() { - ::grin::TopologyTrait* _msg = _internal_mutable_topology_trait(); - // @@protoc_insertion_point(field_mutable:grin.StorageTrait.topology_trait) +inline ::grin::TopologyFeature* StorageFeature::mutable_topology_feature() { + ::grin::TopologyFeature* _msg = _internal_mutable_topology_feature(); + // @@protoc_insertion_point(field_mutable:grin.StorageFeature.topology_feature) return _msg; } -// .grin.PartitionTrait partition_trait = 2; -inline bool StorageTrait::_internal_has_partition_trait() const { - return specific_trait_case() == kPartitionTrait; +// .grin.PartitionFeature partition_feature = 2; +inline bool StorageFeature::_internal_has_partition_feature() const { + return specific_feature_case() == kPartitionFeature; } -inline bool StorageTrait::has_partition_trait() const { - return _internal_has_partition_trait(); +inline bool StorageFeature::has_partition_feature() const { + return _internal_has_partition_feature(); } -inline void StorageTrait::set_has_partition_trait() { - _impl_._oneof_case_[0] = kPartitionTrait; +inline void StorageFeature::set_has_partition_feature() { + _impl_._oneof_case_[0] = kPartitionFeature; } -inline void StorageTrait::clear_partition_trait() { - if (_internal_has_partition_trait()) { +inline void StorageFeature::clear_partition_feature() { + if (_internal_has_partition_feature()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_trait_.partition_trait_; + delete _impl_.specific_feature_.partition_feature_; } - clear_has_specific_trait(); + clear_has_specific_feature(); } } -inline ::grin::PartitionTrait* StorageTrait::release_partition_trait() { - // @@protoc_insertion_point(field_release:grin.StorageTrait.partition_trait) - if (_internal_has_partition_trait()) { - clear_has_specific_trait(); - ::grin::PartitionTrait* temp = _impl_.specific_trait_.partition_trait_; +inline ::grin::PartitionFeature* StorageFeature::release_partition_feature() { + // @@protoc_insertion_point(field_release:grin.StorageFeature.partition_feature) + if (_internal_has_partition_feature()) { + clear_has_specific_feature(); + ::grin::PartitionFeature* temp = _impl_.specific_feature_.partition_feature_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.specific_trait_.partition_trait_ = nullptr; + _impl_.specific_feature_.partition_feature_ = nullptr; return temp; } else { return nullptr; } } -inline const ::grin::PartitionTrait& StorageTrait::_internal_partition_trait() const { - return _internal_has_partition_trait() - ? *_impl_.specific_trait_.partition_trait_ - : reinterpret_cast< ::grin::PartitionTrait&>(::grin::_PartitionTrait_default_instance_); +inline const ::grin::PartitionFeature& StorageFeature::_internal_partition_feature() const { + return _internal_has_partition_feature() + ? *_impl_.specific_feature_.partition_feature_ + : reinterpret_cast< ::grin::PartitionFeature&>(::grin::_PartitionFeature_default_instance_); } -inline const ::grin::PartitionTrait& StorageTrait::partition_trait() const { - // @@protoc_insertion_point(field_get:grin.StorageTrait.partition_trait) - return _internal_partition_trait(); +inline const ::grin::PartitionFeature& StorageFeature::partition_feature() const { + // @@protoc_insertion_point(field_get:grin.StorageFeature.partition_feature) + return _internal_partition_feature(); } -inline ::grin::PartitionTrait* StorageTrait::unsafe_arena_release_partition_trait() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageTrait.partition_trait) - if (_internal_has_partition_trait()) { - clear_has_specific_trait(); - ::grin::PartitionTrait* temp = _impl_.specific_trait_.partition_trait_; - _impl_.specific_trait_.partition_trait_ = nullptr; +inline ::grin::PartitionFeature* StorageFeature::unsafe_arena_release_partition_feature() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.partition_feature) + if (_internal_has_partition_feature()) { + clear_has_specific_feature(); + ::grin::PartitionFeature* temp = _impl_.specific_feature_.partition_feature_; + _impl_.specific_feature_.partition_feature_ = nullptr; return temp; } else { return nullptr; } } -inline void StorageTrait::unsafe_arena_set_allocated_partition_trait(::grin::PartitionTrait* partition_trait) { - clear_specific_trait(); - if (partition_trait) { - set_has_partition_trait(); - _impl_.specific_trait_.partition_trait_ = partition_trait; +inline void StorageFeature::unsafe_arena_set_allocated_partition_feature(::grin::PartitionFeature* partition_feature) { + clear_specific_feature(); + if (partition_feature) { + set_has_partition_feature(); + _impl_.specific_feature_.partition_feature_ = partition_feature; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageTrait.partition_trait) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.partition_feature) } -inline ::grin::PartitionTrait* StorageTrait::_internal_mutable_partition_trait() { - if (!_internal_has_partition_trait()) { - clear_specific_trait(); - set_has_partition_trait(); - _impl_.specific_trait_.partition_trait_ = CreateMaybeMessage< ::grin::PartitionTrait >(GetArenaForAllocation()); +inline ::grin::PartitionFeature* StorageFeature::_internal_mutable_partition_feature() { + if (!_internal_has_partition_feature()) { + clear_specific_feature(); + set_has_partition_feature(); + _impl_.specific_feature_.partition_feature_ = CreateMaybeMessage< ::grin::PartitionFeature >(GetArenaForAllocation()); } - return _impl_.specific_trait_.partition_trait_; + return _impl_.specific_feature_.partition_feature_; } -inline ::grin::PartitionTrait* StorageTrait::mutable_partition_trait() { - ::grin::PartitionTrait* _msg = _internal_mutable_partition_trait(); - // @@protoc_insertion_point(field_mutable:grin.StorageTrait.partition_trait) +inline ::grin::PartitionFeature* StorageFeature::mutable_partition_feature() { + ::grin::PartitionFeature* _msg = _internal_mutable_partition_feature(); + // @@protoc_insertion_point(field_mutable:grin.StorageFeature.partition_feature) return _msg; } -// .grin.PropertyTrait property_trait = 3; -inline bool StorageTrait::_internal_has_property_trait() const { - return specific_trait_case() == kPropertyTrait; +// .grin.PropertyFeature property_feature = 3; +inline bool StorageFeature::_internal_has_property_feature() const { + return specific_feature_case() == kPropertyFeature; } -inline bool StorageTrait::has_property_trait() const { - return _internal_has_property_trait(); +inline bool StorageFeature::has_property_feature() const { + return _internal_has_property_feature(); } -inline void StorageTrait::set_has_property_trait() { - _impl_._oneof_case_[0] = kPropertyTrait; +inline void StorageFeature::set_has_property_feature() { + _impl_._oneof_case_[0] = kPropertyFeature; } -inline void StorageTrait::clear_property_trait() { - if (_internal_has_property_trait()) { +inline void StorageFeature::clear_property_feature() { + if (_internal_has_property_feature()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_trait_.property_trait_; + delete _impl_.specific_feature_.property_feature_; } - clear_has_specific_trait(); + clear_has_specific_feature(); } } -inline ::grin::PropertyTrait* StorageTrait::release_property_trait() { - // @@protoc_insertion_point(field_release:grin.StorageTrait.property_trait) - if (_internal_has_property_trait()) { - clear_has_specific_trait(); - ::grin::PropertyTrait* temp = _impl_.specific_trait_.property_trait_; +inline ::grin::PropertyFeature* StorageFeature::release_property_feature() { + // @@protoc_insertion_point(field_release:grin.StorageFeature.property_feature) + if (_internal_has_property_feature()) { + clear_has_specific_feature(); + ::grin::PropertyFeature* temp = _impl_.specific_feature_.property_feature_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.specific_trait_.property_trait_ = nullptr; + _impl_.specific_feature_.property_feature_ = nullptr; return temp; } else { return nullptr; } } -inline const ::grin::PropertyTrait& StorageTrait::_internal_property_trait() const { - return _internal_has_property_trait() - ? *_impl_.specific_trait_.property_trait_ - : reinterpret_cast< ::grin::PropertyTrait&>(::grin::_PropertyTrait_default_instance_); +inline const ::grin::PropertyFeature& StorageFeature::_internal_property_feature() const { + return _internal_has_property_feature() + ? *_impl_.specific_feature_.property_feature_ + : reinterpret_cast< ::grin::PropertyFeature&>(::grin::_PropertyFeature_default_instance_); } -inline const ::grin::PropertyTrait& StorageTrait::property_trait() const { - // @@protoc_insertion_point(field_get:grin.StorageTrait.property_trait) - return _internal_property_trait(); +inline const ::grin::PropertyFeature& StorageFeature::property_feature() const { + // @@protoc_insertion_point(field_get:grin.StorageFeature.property_feature) + return _internal_property_feature(); } -inline ::grin::PropertyTrait* StorageTrait::unsafe_arena_release_property_trait() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageTrait.property_trait) - if (_internal_has_property_trait()) { - clear_has_specific_trait(); - ::grin::PropertyTrait* temp = _impl_.specific_trait_.property_trait_; - _impl_.specific_trait_.property_trait_ = nullptr; +inline ::grin::PropertyFeature* StorageFeature::unsafe_arena_release_property_feature() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.property_feature) + if (_internal_has_property_feature()) { + clear_has_specific_feature(); + ::grin::PropertyFeature* temp = _impl_.specific_feature_.property_feature_; + _impl_.specific_feature_.property_feature_ = nullptr; return temp; } else { return nullptr; } } -inline void StorageTrait::unsafe_arena_set_allocated_property_trait(::grin::PropertyTrait* property_trait) { - clear_specific_trait(); - if (property_trait) { - set_has_property_trait(); - _impl_.specific_trait_.property_trait_ = property_trait; +inline void StorageFeature::unsafe_arena_set_allocated_property_feature(::grin::PropertyFeature* property_feature) { + clear_specific_feature(); + if (property_feature) { + set_has_property_feature(); + _impl_.specific_feature_.property_feature_ = property_feature; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageTrait.property_trait) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.property_feature) } -inline ::grin::PropertyTrait* StorageTrait::_internal_mutable_property_trait() { - if (!_internal_has_property_trait()) { - clear_specific_trait(); - set_has_property_trait(); - _impl_.specific_trait_.property_trait_ = CreateMaybeMessage< ::grin::PropertyTrait >(GetArenaForAllocation()); +inline ::grin::PropertyFeature* StorageFeature::_internal_mutable_property_feature() { + if (!_internal_has_property_feature()) { + clear_specific_feature(); + set_has_property_feature(); + _impl_.specific_feature_.property_feature_ = CreateMaybeMessage< ::grin::PropertyFeature >(GetArenaForAllocation()); } - return _impl_.specific_trait_.property_trait_; + return _impl_.specific_feature_.property_feature_; } -inline ::grin::PropertyTrait* StorageTrait::mutable_property_trait() { - ::grin::PropertyTrait* _msg = _internal_mutable_property_trait(); - // @@protoc_insertion_point(field_mutable:grin.StorageTrait.property_trait) +inline ::grin::PropertyFeature* StorageFeature::mutable_property_feature() { + ::grin::PropertyFeature* _msg = _internal_mutable_property_feature(); + // @@protoc_insertion_point(field_mutable:grin.StorageFeature.property_feature) return _msg; } -// .grin.IndexTrait index_trait = 4; -inline bool StorageTrait::_internal_has_index_trait() const { - return specific_trait_case() == kIndexTrait; +// .grin.IndexFeature index_feature = 4; +inline bool StorageFeature::_internal_has_index_feature() const { + return specific_feature_case() == kIndexFeature; } -inline bool StorageTrait::has_index_trait() const { - return _internal_has_index_trait(); +inline bool StorageFeature::has_index_feature() const { + return _internal_has_index_feature(); } -inline void StorageTrait::set_has_index_trait() { - _impl_._oneof_case_[0] = kIndexTrait; +inline void StorageFeature::set_has_index_feature() { + _impl_._oneof_case_[0] = kIndexFeature; } -inline void StorageTrait::clear_index_trait() { - if (_internal_has_index_trait()) { +inline void StorageFeature::clear_index_feature() { + if (_internal_has_index_feature()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_trait_.index_trait_; + delete _impl_.specific_feature_.index_feature_; } - clear_has_specific_trait(); + clear_has_specific_feature(); } } -inline ::grin::IndexTrait* StorageTrait::release_index_trait() { - // @@protoc_insertion_point(field_release:grin.StorageTrait.index_trait) - if (_internal_has_index_trait()) { - clear_has_specific_trait(); - ::grin::IndexTrait* temp = _impl_.specific_trait_.index_trait_; +inline ::grin::IndexFeature* StorageFeature::release_index_feature() { + // @@protoc_insertion_point(field_release:grin.StorageFeature.index_feature) + if (_internal_has_index_feature()) { + clear_has_specific_feature(); + ::grin::IndexFeature* temp = _impl_.specific_feature_.index_feature_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.specific_trait_.index_trait_ = nullptr; + _impl_.specific_feature_.index_feature_ = nullptr; return temp; } else { return nullptr; } } -inline const ::grin::IndexTrait& StorageTrait::_internal_index_trait() const { - return _internal_has_index_trait() - ? *_impl_.specific_trait_.index_trait_ - : reinterpret_cast< ::grin::IndexTrait&>(::grin::_IndexTrait_default_instance_); +inline const ::grin::IndexFeature& StorageFeature::_internal_index_feature() const { + return _internal_has_index_feature() + ? *_impl_.specific_feature_.index_feature_ + : reinterpret_cast< ::grin::IndexFeature&>(::grin::_IndexFeature_default_instance_); } -inline const ::grin::IndexTrait& StorageTrait::index_trait() const { - // @@protoc_insertion_point(field_get:grin.StorageTrait.index_trait) - return _internal_index_trait(); +inline const ::grin::IndexFeature& StorageFeature::index_feature() const { + // @@protoc_insertion_point(field_get:grin.StorageFeature.index_feature) + return _internal_index_feature(); } -inline ::grin::IndexTrait* StorageTrait::unsafe_arena_release_index_trait() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageTrait.index_trait) - if (_internal_has_index_trait()) { - clear_has_specific_trait(); - ::grin::IndexTrait* temp = _impl_.specific_trait_.index_trait_; - _impl_.specific_trait_.index_trait_ = nullptr; +inline ::grin::IndexFeature* StorageFeature::unsafe_arena_release_index_feature() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.index_feature) + if (_internal_has_index_feature()) { + clear_has_specific_feature(); + ::grin::IndexFeature* temp = _impl_.specific_feature_.index_feature_; + _impl_.specific_feature_.index_feature_ = nullptr; return temp; } else { return nullptr; } } -inline void StorageTrait::unsafe_arena_set_allocated_index_trait(::grin::IndexTrait* index_trait) { - clear_specific_trait(); - if (index_trait) { - set_has_index_trait(); - _impl_.specific_trait_.index_trait_ = index_trait; +inline void StorageFeature::unsafe_arena_set_allocated_index_feature(::grin::IndexFeature* index_feature) { + clear_specific_feature(); + if (index_feature) { + set_has_index_feature(); + _impl_.specific_feature_.index_feature_ = index_feature; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageTrait.index_trait) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.index_feature) } -inline ::grin::IndexTrait* StorageTrait::_internal_mutable_index_trait() { - if (!_internal_has_index_trait()) { - clear_specific_trait(); - set_has_index_trait(); - _impl_.specific_trait_.index_trait_ = CreateMaybeMessage< ::grin::IndexTrait >(GetArenaForAllocation()); +inline ::grin::IndexFeature* StorageFeature::_internal_mutable_index_feature() { + if (!_internal_has_index_feature()) { + clear_specific_feature(); + set_has_index_feature(); + _impl_.specific_feature_.index_feature_ = CreateMaybeMessage< ::grin::IndexFeature >(GetArenaForAllocation()); } - return _impl_.specific_trait_.index_trait_; + return _impl_.specific_feature_.index_feature_; } -inline ::grin::IndexTrait* StorageTrait::mutable_index_trait() { - ::grin::IndexTrait* _msg = _internal_mutable_index_trait(); - // @@protoc_insertion_point(field_mutable:grin.StorageTrait.index_trait) +inline ::grin::IndexFeature* StorageFeature::mutable_index_feature() { + ::grin::IndexFeature* _msg = _internal_mutable_index_feature(); + // @@protoc_insertion_point(field_mutable:grin.StorageFeature.index_feature) return _msg; } -// .grin.PredicateTrait predicate_trait = 5; -inline bool StorageTrait::_internal_has_predicate_trait() const { - return specific_trait_case() == kPredicateTrait; +// .grin.PredicateFeature predicate_feature = 5; +inline bool StorageFeature::_internal_has_predicate_feature() const { + return specific_feature_case() == kPredicateFeature; } -inline bool StorageTrait::has_predicate_trait() const { - return _internal_has_predicate_trait(); +inline bool StorageFeature::has_predicate_feature() const { + return _internal_has_predicate_feature(); } -inline void StorageTrait::set_has_predicate_trait() { - _impl_._oneof_case_[0] = kPredicateTrait; +inline void StorageFeature::set_has_predicate_feature() { + _impl_._oneof_case_[0] = kPredicateFeature; } -inline void StorageTrait::clear_predicate_trait() { - if (_internal_has_predicate_trait()) { +inline void StorageFeature::clear_predicate_feature() { + if (_internal_has_predicate_feature()) { if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_trait_.predicate_trait_; + delete _impl_.specific_feature_.predicate_feature_; } - clear_has_specific_trait(); + clear_has_specific_feature(); } } -inline ::grin::PredicateTrait* StorageTrait::release_predicate_trait() { - // @@protoc_insertion_point(field_release:grin.StorageTrait.predicate_trait) - if (_internal_has_predicate_trait()) { - clear_has_specific_trait(); - ::grin::PredicateTrait* temp = _impl_.specific_trait_.predicate_trait_; +inline ::grin::PredicateFeature* StorageFeature::release_predicate_feature() { + // @@protoc_insertion_point(field_release:grin.StorageFeature.predicate_feature) + if (_internal_has_predicate_feature()) { + clear_has_specific_feature(); + ::grin::PredicateFeature* temp = _impl_.specific_feature_.predicate_feature_; if (GetArenaForAllocation() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.specific_trait_.predicate_trait_ = nullptr; + _impl_.specific_feature_.predicate_feature_ = nullptr; return temp; } else { return nullptr; } } -inline const ::grin::PredicateTrait& StorageTrait::_internal_predicate_trait() const { - return _internal_has_predicate_trait() - ? *_impl_.specific_trait_.predicate_trait_ - : reinterpret_cast< ::grin::PredicateTrait&>(::grin::_PredicateTrait_default_instance_); +inline const ::grin::PredicateFeature& StorageFeature::_internal_predicate_feature() const { + return _internal_has_predicate_feature() + ? *_impl_.specific_feature_.predicate_feature_ + : reinterpret_cast< ::grin::PredicateFeature&>(::grin::_PredicateFeature_default_instance_); } -inline const ::grin::PredicateTrait& StorageTrait::predicate_trait() const { - // @@protoc_insertion_point(field_get:grin.StorageTrait.predicate_trait) - return _internal_predicate_trait(); +inline const ::grin::PredicateFeature& StorageFeature::predicate_feature() const { + // @@protoc_insertion_point(field_get:grin.StorageFeature.predicate_feature) + return _internal_predicate_feature(); } -inline ::grin::PredicateTrait* StorageTrait::unsafe_arena_release_predicate_trait() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageTrait.predicate_trait) - if (_internal_has_predicate_trait()) { - clear_has_specific_trait(); - ::grin::PredicateTrait* temp = _impl_.specific_trait_.predicate_trait_; - _impl_.specific_trait_.predicate_trait_ = nullptr; +inline ::grin::PredicateFeature* StorageFeature::unsafe_arena_release_predicate_feature() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.predicate_feature) + if (_internal_has_predicate_feature()) { + clear_has_specific_feature(); + ::grin::PredicateFeature* temp = _impl_.specific_feature_.predicate_feature_; + _impl_.specific_feature_.predicate_feature_ = nullptr; return temp; } else { return nullptr; } } -inline void StorageTrait::unsafe_arena_set_allocated_predicate_trait(::grin::PredicateTrait* predicate_trait) { - clear_specific_trait(); - if (predicate_trait) { - set_has_predicate_trait(); - _impl_.specific_trait_.predicate_trait_ = predicate_trait; +inline void StorageFeature::unsafe_arena_set_allocated_predicate_feature(::grin::PredicateFeature* predicate_feature) { + clear_specific_feature(); + if (predicate_feature) { + set_has_predicate_feature(); + _impl_.specific_feature_.predicate_feature_ = predicate_feature; } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageTrait.predicate_trait) + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.predicate_feature) } -inline ::grin::PredicateTrait* StorageTrait::_internal_mutable_predicate_trait() { - if (!_internal_has_predicate_trait()) { - clear_specific_trait(); - set_has_predicate_trait(); - _impl_.specific_trait_.predicate_trait_ = CreateMaybeMessage< ::grin::PredicateTrait >(GetArenaForAllocation()); +inline ::grin::PredicateFeature* StorageFeature::_internal_mutable_predicate_feature() { + if (!_internal_has_predicate_feature()) { + clear_specific_feature(); + set_has_predicate_feature(); + _impl_.specific_feature_.predicate_feature_ = CreateMaybeMessage< ::grin::PredicateFeature >(GetArenaForAllocation()); } - return _impl_.specific_trait_.predicate_trait_; + return _impl_.specific_feature_.predicate_feature_; } -inline ::grin::PredicateTrait* StorageTrait::mutable_predicate_trait() { - ::grin::PredicateTrait* _msg = _internal_mutable_predicate_trait(); - // @@protoc_insertion_point(field_mutable:grin.StorageTrait.predicate_trait) +inline ::grin::PredicateFeature* StorageFeature::mutable_predicate_feature() { + ::grin::PredicateFeature* _msg = _internal_mutable_predicate_feature(); + // @@protoc_insertion_point(field_mutable:grin.StorageFeature.predicate_feature) return _msg; } -inline bool StorageTrait::has_specific_trait() const { - return specific_trait_case() != SPECIFIC_TRAIT_NOT_SET; +inline bool StorageFeature::has_specific_feature() const { + return specific_feature_case() != SPECIFIC_FEATURE_NOT_SET; } -inline void StorageTrait::clear_has_specific_trait() { - _impl_._oneof_case_[0] = SPECIFIC_TRAIT_NOT_SET; +inline void StorageFeature::clear_has_specific_feature() { + _impl_._oneof_case_[0] = SPECIFIC_FEATURE_NOT_SET; } -inline StorageTrait::SpecificTraitCase StorageTrait::specific_trait_case() const { - return StorageTrait::SpecificTraitCase(_impl_._oneof_case_[0]); +inline StorageFeature::SpecificFeatureCase StorageFeature::specific_feature_case() const { + return StorageFeature::SpecificFeatureCase(_impl_._oneof_case_[0]); } // ------------------------------------------------------------------- @@ -4616,44 +4616,44 @@ inline void Graph::set_allocated_grin_version(std::string* grin_version) { // @@protoc_insertion_point(field_set_allocated:grin.Graph.grin_version) } -// repeated .grin.StorageTrait traits = 3; -inline int Graph::_internal_traits_size() const { - return _impl_.traits_.size(); +// repeated .grin.StorageFeature features = 3; +inline int Graph::_internal_features_size() const { + return _impl_.features_.size(); } -inline int Graph::traits_size() const { - return _internal_traits_size(); +inline int Graph::features_size() const { + return _internal_features_size(); } -inline void Graph::clear_traits() { - _impl_.traits_.Clear(); +inline void Graph::clear_features() { + _impl_.features_.Clear(); } -inline ::grin::StorageTrait* Graph::mutable_traits(int index) { - // @@protoc_insertion_point(field_mutable:grin.Graph.traits) - return _impl_.traits_.Mutable(index); +inline ::grin::StorageFeature* Graph::mutable_features(int index) { + // @@protoc_insertion_point(field_mutable:grin.Graph.features) + return _impl_.features_.Mutable(index); } -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageTrait >* -Graph::mutable_traits() { - // @@protoc_insertion_point(field_mutable_list:grin.Graph.traits) - return &_impl_.traits_; +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature >* +Graph::mutable_features() { + // @@protoc_insertion_point(field_mutable_list:grin.Graph.features) + return &_impl_.features_; } -inline const ::grin::StorageTrait& Graph::_internal_traits(int index) const { - return _impl_.traits_.Get(index); +inline const ::grin::StorageFeature& Graph::_internal_features(int index) const { + return _impl_.features_.Get(index); } -inline const ::grin::StorageTrait& Graph::traits(int index) const { - // @@protoc_insertion_point(field_get:grin.Graph.traits) - return _internal_traits(index); +inline const ::grin::StorageFeature& Graph::features(int index) const { + // @@protoc_insertion_point(field_get:grin.Graph.features) + return _internal_features(index); } -inline ::grin::StorageTrait* Graph::_internal_add_traits() { - return _impl_.traits_.Add(); +inline ::grin::StorageFeature* Graph::_internal_add_features() { + return _impl_.features_.Add(); } -inline ::grin::StorageTrait* Graph::add_traits() { - ::grin::StorageTrait* _add = _internal_add_traits(); - // @@protoc_insertion_point(field_add:grin.Graph.traits) +inline ::grin::StorageFeature* Graph::add_features() { + ::grin::StorageFeature* _add = _internal_add_features(); + // @@protoc_insertion_point(field_add:grin.Graph.features) return _add; } -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageTrait >& -Graph::traits() const { - // @@protoc_insertion_point(field_list:grin.Graph.traits) - return _impl_.traits_; +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature >& +Graph::features() const { + // @@protoc_insertion_point(field_list:grin.Graph.features) + return _impl_.features_; } // .grin.Statistics statistics = 4; diff --git a/modules/graph/grin/src/proto/message.cc b/modules/graph/grin/src/proto/message.cc index 7ce5ca831..9e81faf46 100644 --- a/modules/graph/grin/src/proto/message.cc +++ b/modules/graph/grin/src/proto/message.cc @@ -23,96 +23,96 @@ const char* grin_get_static_storage_feature_msg() { g.set_grin_version("0.1.0"); { - auto storage_trait = g.add_traits(); + auto storage_feature = g.add_features(); // topology - auto trait = storage_trait->mutable_topology_trait(); + auto feature = storage_feature->mutable_topology_feature(); #ifdef GRIN_ASSUME_HAS_DIRECTED_GRAPH - trait->set_grin_assume_has_directed_graph(true); + feature->set_grin_assume_has_directed_graph(true); #endif #ifdef GRIN_ASSUME_HAS_UNDIRECTED_GRAPH - trait->set_grin_assume_has_undirected_graph(true); + feature->set_grin_assume_has_undirected_graph(true); #endif #ifdef GRIN_ASSUME_HAS_MULTI_EDGE_GRAPH - trait->set_grin_assume_has_multi_edge_graph(true); + feature->set_grin_assume_has_multi_edge_graph(true); #endif #ifdef GRIN_WITH_VERTEX_ORIGINAL_ID - trait->set_grin_with_vertex_original_id(true); + feature->set_grin_with_vertex_original_id(true); #endif #ifdef GRIN_WITH_VERTEX_DATA - trait->set_grin_with_vertex_data(true); + feature->set_grin_with_vertex_data(true); #endif #ifdef GRIN_WITH_EDGE_DATA - trait->set_grin_with_edge_data(true); + feature->set_grin_with_edge_data(true); #endif #ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY #ifndef GRIN_ENABLE_VERTEX_LIST LOG(ERROR) << "GRIN_ENABLE_VERTEX_LIST_ARRAY requires GRIN_ENABLE_VERTEX_LIST" #endif - trait->add_vertex_list_retrievals(grin::ListRetrieval::LR_ARRAY_LIKE); + feature->add_vertex_list_retrievals(grin::ListRetrieval::LR_ARRAY_LIKE); #endif #ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR #ifndef GRIN_ENABLE_VERTEX_LIST LOG(ERROR) << "GRIN_ENABLE_VERTEX_LIST_ITERATOR requires GRIN_ENABLE_VERTEX_LIST" #endif - trait->add_vertex_list_retrievals(grin::ListRetrieval::LR_ITERATOR); + feature->add_vertex_list_retrievals(grin::ListRetrieval::LR_ITERATOR); #endif #ifdef GRIN_ENABLE_EDGE_LIST_ARRAY #ifndef GRIN_ENABLE_EDGE_LIST LOG(ERROR) << "GRIN_ENABLE_EDGE_LIST_ARRAY requires GRIN_ENABLE_EDGE_LIST" #endif - trait->add_edge_list_retrievals(grin::ListRetrieval::LR_ARRAY_LIKE); + feature->add_edge_list_retrievals(grin::ListRetrieval::LR_ARRAY_LIKE); #endif #ifdef GRIN_ENABLE_EDGE_LIST_ITERATOR #ifndef GRIN_ENABLE_EDGE_LIST LOG(ERROR) << "GRIN_ENABLE_EDGE_LIST_ITERATOR requires GRIN_ENABLE_EDGE_LIST" #endif - trait->add_edge_list_retrievals(grin::ListRetrieval::LR_ITERATOR); + feature->add_edge_list_retrievals(grin::ListRetrieval::LR_ITERATOR); #endif #ifdef GRIN_ENABLE_ADJACENT_LIST_ARRAY #ifndef GRIN_ENABLE_ADJACENT_LIST LOG(ERROR) << "GRIN_ENABLE_ADJACENT_LIST_ARRAY requires GRIN_ENABLE_ADJACENT_LIST" #endif - trait->add_adjacent_list_retrievals(grin::ListRetrieval::LR_ARRAY_LIKE); + feature->add_adjacent_list_retrievals(grin::ListRetrieval::LR_ARRAY_LIKE); #endif #ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR #ifndef GRIN_ENABLE_ADJACENT_LIST LOG(ERROR) << "GRIN_ENABLE_ADJACENT_LIST_ITERATOR requires GRIN_ENABLE_ADJACENT_LIST" #endif - trait->add_adjacent_list_retrievals(grin::ListRetrieval::LR_ITERATOR); + feature->add_adjacent_list_retrievals(grin::ListRetrieval::LR_ITERATOR); #endif } { - auto storage_trait = g.add_traits(); - auto trait = storage_trait->mutable_partition_trait(); + auto storage_feature = g.add_features(); + auto feature = storage_feature->mutable_partition_feature(); auto cnt = 0; #ifndef GRIN_ENABLE_GRAPH_PARTITION - trait->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_NA); + feature->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_NA); #else #ifdef GRIN_ASSUME_ALL_REPLICATE_PARTITION - trait->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_ALL_REPLICATE); + feature->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_ALL_REPLICATE); cnt++; #endif #ifdef GRIN_ASSUME_EDGE_CUT_PARTITION - trait->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_EDGE_CUT); + feature->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_EDGE_CUT); cnt++; #endif #ifdef GRIN_ASSUME_VERTEX_CUT_PARTITION - trait->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_VERTEX_CUT); + feature->set_graph_partition_strategy(grin::GraphPartitionStrategy::GPS_VERTEX_CUT); cnt++; #endif if (cnt > 1) { @@ -120,203 +120,203 @@ const char* grin_get_static_storage_feature_msg() { } #endif -#ifdef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION - trait->set_grin_trait_natural_id_for_partition(true); +#ifdef GRIN_feature_NATURAL_ID_FOR_PARTITION + feature->set_grin_trait_natural_id_for_partition(true); #endif #ifdef GRIN_ENABLE_VERTEX_REF - trait->set_grin_enable_vertex_ref(true); + feature->set_grin_enable_vertex_ref(true); #endif #ifdef GRIN_ENABLE_EDGE_REF - trait->set_grin_enable_edge_ref(true); + feature->set_grin_enable_edge_ref(true); #endif #ifdef GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_VERTEX_DATA #ifdef GRIN_WITH_VERTEX_DATA - trait->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_MASTER_ONLY); + feature->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_MASTER_ONLY); #else - trait->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_NA); + feature->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_NA); #endif #endif #ifdef GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_VERTEX_DATA #ifdef GRIN_WITH_VERTEX_DATA - trait->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_REPLICATE_MASTER_MIRROR); + feature->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_REPLICATE_MASTER_MIRROR); #else - trait->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_NA); + feature->set_vertex_data(grin::PropertyDataPartitionStrategy::PDPS_NA); #endif #endif #ifdef GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_DATA #ifdef GRIN_WITH_EDGE_DATA - trait->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_MASTER_ONLY); + feature->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_MASTER_ONLY); #else - trait->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_NA); + feature->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_NA); #endif #endif #ifdef GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_DATA #ifdef GRIN_WITH_EDGE_DATA - trait->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_REPLICATE_MASTER_MIRROR); + feature->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_REPLICATE_MASTER_MIRROR); #else - trait->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_NA); + feature->set_edge_data(grin::PropertyDataPartitionStrategy::PDPS_NA); #endif #endif - auto mpl_trait = trait->mutable_mirror_partition_list_trait(); + auto mpl_feature = feature->mutable_mirror_partition_list_feature(); #ifdef GRIN_TRAIT_MASTER_VERTEX_MIRROR_PARTITION_LIST - mpl_trait->set_grin_trait_master_vertex_mirror_partition_list(true); + mpl_feature->set_grin_trait_master_vertex_mirror_partition_list(true); #endif #ifdef GRIN_TRAIT_MIRROR_VERTEX_MIRROR_PARTITION_LIST - mpl_trait->set_grin_trait_mirror_vertex_mirror_partition_list(true); + mpl_feature->set_grin_trait_mirror_vertex_mirror_partition_list(true); #endif #ifdef GRIN_TRAIT_MASTER_EDGE_MIRROR_PARTITION_LIST - mpl_trait->set_grin_trait_master_edge_mirror_partition_list(true); + mpl_feature->set_grin_trait_master_edge_mirror_partition_list(true); #endif #ifdef GRIN_TRAIT_MIRROR_EDGE_MIRROR_PARTITION_LIST - mpl_trait->set_grin_trait_mirror_edge_mirror_partition_list(true); + mpl_feature->set_grin_trait_mirror_edge_mirror_partition_list(true); #endif #ifdef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST - trait->set_grin_trait_select_master_for_vertex_list(true); + feature->set_grin_trait_select_master_for_vertex_list(true); #endif #ifdef GRIN_TRAIT_SELECT_PARTITION_FOR_VERTEX_LIST - trait->set_grin_trait_select_partition_for_vertex_list(true); + feature->set_grin_trait_select_partition_for_vertex_list(true); #endif #ifdef GRIN_TRAIT_SELECT_MASTER_FOR_EDGE_LIST - trait->set_grin_trait_select_master_for_edge_list(true); + feature->set_grin_trait_select_master_for_edge_list(true); #endif #ifdef GRIN_TRAIT_SELECT_PARTITION_FOR_EDGE_LIST - trait->set_grin_trait_select_partition_for_edge_list(true); + feature->set_grin_trait_select_partition_for_edge_list(true); #endif #ifdef GRIN_TRAIT_SELECT_MASTER_NEIGHBOR_FOR_ADJACENT_LIST - trait->set_grin_trait_select_master_neighbor_for_adjacent_list(true); + feature->set_grin_trait_select_master_neighbor_for_adjacent_list(true); #endif #ifdef GRIN_TRAIT_SELECT_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST - trait->set_grin_trait_select_partition_neighbor_for_adjacent_list(true); + feature->set_grin_trait_select_partition_neighbor_for_adjacent_list(true); #endif } { - auto storage_trait = g.add_traits(); - auto trait = storage_trait->mutable_property_trait(); + auto storage_feature = g.add_features(); + auto feature = storage_feature->mutable_property_feature(); #ifdef GRIN_ENABLE_ROW - trait->set_grin_enable_row(true); + feature->set_grin_enable_row(true); #endif - auto vtrait = trait->mutable_vertex_property_trait(); + auto vfeature = feature->mutable_vertex_property_feature(); #ifdef GRIN_WITH_VERTEX_PROPERTY - vtrait->set_grin_with_vertex_property(true); + vfeature->set_grin_with_vertex_property(true); #endif #ifdef GRIN_WITH_VERTEX_PROPERTY_NAME - vtrait->set_grin_with_vertex_property_name(true); + vfeature->set_grin_with_vertex_property_name(true); #endif #ifdef GRIN_WITH_VERTEX_TYPE_NAME - vtrait->set_grin_with_vertex_type_name(true); + vfeature->set_grin_with_vertex_type_name(true); #endif #ifdef GRIN_ENABLE_VERTEX_PROPERTY_TABLE - vtrait->set_grin_enable_vertex_property_table(true); + vfeature->set_grin_enable_vertex_property_table(true); #endif #ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS - vtrait->set_grin_enable_vertex_primary_keys(true); + vfeature->set_grin_enable_vertex_primary_keys(true); #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE - vtrait->set_grin_trait_natural_id_for_vertex_type(true); + vfeature->set_grin_trait_natural_id_for_vertex_type(true); #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY - vtrait->set_grin_trait_natural_id_for_vertex_property(true); + vfeature->set_grin_trait_natural_id_for_vertex_property(true); #endif #ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID - vtrait->set_grin_assume_by_type_vertex_original_id(true); + vfeature->set_grin_assume_by_type_vertex_original_id(true); #endif - auto etrait = trait->mutable_edge_property_trait(); + auto efeature = feature->mutable_edge_property_feature(); #ifdef GRIN_WITH_EDGE_PROPERTY - etrait->set_grin_with_edge_property(true); + efeature->set_grin_with_edge_property(true); #endif #ifdef GRIN_WITH_EDGE_PROPERTY_NAME - etrait->set_grin_with_edge_property_name(true); + efeature->set_grin_with_edge_property_name(true); #endif #ifdef GRIN_WITH_EDGE_TYPE_NAME - etrait->set_grin_with_edge_type_name(true); + efeature->set_grin_with_edge_type_name(true); #endif #ifdef GRIN_ENABLE_EDGE_PROPERTY_TABLE - etrait->set_grin_enable_edge_property_table(true); + efeature->set_grin_enable_edge_property_table(true); #endif #ifdef GRIN_ENABLE_EDGE_PRIMARY_KEYS - etrait->set_grin_enable_edge_primary_keys(true); + efeature->set_grin_enable_edge_primary_keys(true); #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE - etrait->set_grin_trait_natural_id_for_edge_type(true); + efeature->set_grin_trait_natural_id_for_edge_type(true); #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY - etrait->set_grin_trait_natural_id_for_edge_property(true); + efeature->set_grin_trait_natural_id_for_edge_property(true); #endif #ifdef GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY - trait->set_grin_assume_column_store_for_vertex_property(true); + feature->set_grin_assume_column_store_for_vertex_property(true); #endif #ifdef GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY - trait->set_grin_assume_column_store_for_edge_property(true); + feature->set_grin_assume_column_store_for_edge_property(true); #endif #ifdef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST - trait->set_grin_trait_select_type_for_vertex_list(true); + feature->set_grin_trait_select_type_for_vertex_list(true); #endif #ifdef GRIN_TRAIT_SELECT_TYPE_FOR_EDGE_LIST - trait->set_grin_trait_select_type_for_edge_list(true); + feature->set_grin_trait_select_type_for_edge_list(true); #endif #ifdef GRIN_TRAIT_SELECT_NEIGHBOR_TYPE_FOR_ADJACENT_LIST - trait->set_grin_trait_select_neighbor_type_for_adjacent_list(true); + feature->set_grin_trait_select_neighbor_type_for_adjacent_list(true); #endif #ifdef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST - trait->set_grin_trait_select_edge_type_for_adjacent_list(true); + feature->set_grin_trait_select_edge_type_for_adjacent_list(true); #endif #ifdef GRIN_TRAIT_SPECIFIC_VEV_RELATION - trait->set_grin_trait_specific_vev_relation(true); + feature->set_grin_trait_specific_vev_relation(true); #endif } { - auto storage_trait = g.add_traits(); - auto trait = storage_trait->mutable_index_trait(); + auto storage_feature = g.add_features(); + auto feature = storage_feature->mutable_index_feature(); #ifdef GRIN_WITH_VERTEX_LABEL - trait->set_grin_with_vertex_label(true); + feature->set_grin_with_vertex_label(true); #endif #ifdef GRIN_WITH_EDGE_LABEL - trait->set_grin_with_edge_label(true); + feature->set_grin_with_edge_label(true); #endif #ifdef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED - trait->set_grin_assume_all_vertex_list_sorted(true); + feature->set_grin_assume_all_vertex_list_sorted(true); #endif } From 11324ece3c58a1b3b3a2a0670c97dcee2c369d9c Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Fri, 21 Apr 2023 02:07:29 +0000 Subject: [PATCH 50/85] make sure grin.so has C interface --- modules/graph/grin/c/test.c | 7 + modules/graph/grin/src/index/order.cc | 2 + modules/graph/grin/src/partition/partition.cc | 2 + modules/graph/grin/src/partition/reference.cc | 3 +- modules/graph/grin/src/partition/topology.cc | 2 + modules/graph/grin/src/predefine.h | 3 + modules/graph/grin/src/property/primarykey.cc | 2 + modules/graph/grin/src/property/property.cc | 2 + .../graph/grin/src/property/propertylist.cc | 2 + .../graph/grin/src/property/propertytable.cc | 2 + modules/graph/grin/src/property/topology.cc | 3 +- modules/graph/grin/src/property/type.cc | 2 + modules/graph/grin/src/proto/gie_schema.pb.cc | 3188 +++++++------ modules/graph/grin/src/proto/gie_schema.pb.h | 2049 ++++---- modules/graph/grin/src/proto/graph.pb.cc | 4156 +++++++++-------- modules/graph/grin/src/proto/graph.pb.h | 2182 +++++---- modules/graph/grin/src/proto/message.cc | 2 + .../graph/grin/src/topology/adjacentlist.cc | 2 + modules/graph/grin/src/topology/structure.cc | 2 + modules/graph/grin/src/topology/vertexlist.cc | 2 + modules/graph/test/grin_test.cc | 2 + 21 files changed, 6043 insertions(+), 5574 deletions(-) create mode 100644 modules/graph/grin/c/test.c diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c new file mode 100644 index 000000000..e9234c581 --- /dev/null +++ b/modules/graph/grin/c/test.c @@ -0,0 +1,7 @@ +#include "include/partition/partition.h" + +int main(int argc, char** argv) { + const char *a[] = {"/home/graphscope/gie-grin/temp/vineyard.sock", "130724717286376948"}; + void* h = grin_get_partitioned_graph_from_storage(2, (char**)a); + return 0; +} \ No newline at end of file diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index 886e850f0..3d1f721ca 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -11,7 +11,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/index/order.h" +} #ifdef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED bool grin_smaller_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index 17a6dce93..71062ace5 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -14,7 +14,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/partition/partition.h" +} #include "graph/fragment/property_graph_types.h" diff --git a/modules/graph/grin/src/partition/reference.cc b/modules/graph/grin/src/partition/reference.cc index d4b85719b..7ed7ef335 100644 --- a/modules/graph/grin/src/partition/reference.cc +++ b/modules/graph/grin/src/partition/reference.cc @@ -14,8 +14,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/partition/reference.h" - +} #ifdef GRIN_ENABLE_VERTEX_REF GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc index 233c50d59..d00221c4f 100644 --- a/modules/graph/grin/src/partition/topology.cc +++ b/modules/graph/grin/src/partition/topology.cc @@ -14,7 +14,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/partition/topology.h" +} #ifdef GRIN_ENABLE_GRAPH_PARTITION size_t grin_get_total_vertex_num(GRIN_PARTITIONED_GRAPH pg) { diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index eb6e73412..80542f9d5 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -16,7 +16,10 @@ limitations under the License. #ifndef GRIN_SRC_PREDEFINE_H_ #define GRIN_SRC_PREDEFINE_H_ +extern "C" { #include "graph/grin/predefine.h" +} + #include "graph/fragment/arrow_fragment.h" #include "graph/fragment/arrow_fragment_group.h" #include "graph/fragment/arrow_fragment_impl.h" diff --git a/modules/graph/grin/src/property/primarykey.cc b/modules/graph/grin/src/property/primarykey.cc index da09bda76..c1ce06392 100644 --- a/modules/graph/grin/src/property/primarykey.cc +++ b/modules/graph/grin/src/property/primarykey.cc @@ -11,7 +11,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/property/primarykey.h" +} #ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS /** diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 27ab644b6..e846b3f0e 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -11,7 +11,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/property/property.h" +} #ifdef GRIN_WITH_VERTEX_PROPERTY_NAME const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index 25fc2c1f2..74af3fa1c 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -11,7 +11,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/property/propertylist.h" +} #ifdef GRIN_WITH_VERTEX_PROPERTY GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_property_list_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 525390c4d..6e166b754 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -11,7 +11,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/property/propertytable.h" +} #ifdef GRIN_ENABLE_ROW void grin_destroy_row(GRIN_GRAPH g, GRIN_ROW r) { diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index d45103331..5321777cb 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -11,8 +11,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/property/topology.h" - +} #ifdef GRIN_WITH_VERTEX_PROPERTY size_t grin_get_vertex_num_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 0856a7c98..6d86d5b69 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -11,7 +11,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/property/type.h" +} #ifdef GRIN_WITH_VERTEX_PROPERTY bool grin_equal_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt1, GRIN_VERTEX_TYPE vt2) { diff --git a/modules/graph/grin/src/proto/gie_schema.pb.cc b/modules/graph/grin/src/proto/gie_schema.pb.cc index 19965738d..5797270af 100644 --- a/modules/graph/grin/src/proto/gie_schema.pb.cc +++ b/modules/graph/grin/src/proto/gie_schema.pb.cc @@ -14,292 +14,324 @@ #include // @@protoc_insertion_point(includes) #include +extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_EdgeType_gie_5fschema_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_GraphPartitionStrategy_gie_5fschema_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Property_gie_5fschema_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SrcDstPair_gie_5fschema_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Statistics_gie_5fschema_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_VertexType_gie_5fschema_2eproto; +namespace gie { +class PropertyPartitionByEntityStrategyDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _PropertyPartitionByEntityStrategy_default_instance_; +class PropertyPartitionByTypeStrategyDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _PropertyPartitionByTypeStrategy_default_instance_; +class GraphPropertyPartitionStrategyDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; + const ::gie::PropertyPartitionByEntityStrategy* by_entity_; + const ::gie::PropertyPartitionByTypeStrategy* by_type_; +} _GraphPropertyPartitionStrategy_default_instance_; +class GraphPartitionStrategyDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _GraphPartitionStrategy_default_instance_; +class SrcDstPairDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _SrcDstPair_default_instance_; +class PropertyDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Property_default_instance_; +class VertexTypeDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _VertexType_default_instance_; +class EdgeTypeDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _EdgeType_default_instance_; +class StatisticsDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Statistics_default_instance_; +class SchemaDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Schema_default_instance_; +} // namespace gie +static void InitDefaultsscc_info_EdgeType_gie_5fschema_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; -PROTOBUF_PRAGMA_INIT_SEG + { + void* ptr = &::gie::_EdgeType_default_instance_; + new (ptr) ::gie::EdgeType(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::gie::EdgeType::InitAsDefaultInstance(); +} -namespace _pb = ::PROTOBUF_NAMESPACE_ID; -namespace _pbi = _pb::internal; +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_EdgeType_gie_5fschema_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_EdgeType_gie_5fschema_2eproto}, { + &scc_info_Property_gie_5fschema_2eproto.base, + &scc_info_SrcDstPair_gie_5fschema_2eproto.base,}}; -namespace gie { -PROTOBUF_CONSTEXPR PropertyPartitionByEntityStrategy::PropertyPartitionByEntityStrategy( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.vertex_property_partition_strategy_)*/0 - , /*decltype(_impl_.edge_property_partition_strategy_)*/0 - , /*decltype(_impl_._cached_size_)*/{}} {} -struct PropertyPartitionByEntityStrategyDefaultTypeInternal { - PROTOBUF_CONSTEXPR PropertyPartitionByEntityStrategyDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~PropertyPartitionByEntityStrategyDefaultTypeInternal() {} - union { - PropertyPartitionByEntityStrategy _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyPartitionByEntityStrategyDefaultTypeInternal _PropertyPartitionByEntityStrategy_default_instance_; -PROTOBUF_CONSTEXPR PropertyPartitionByTypeStrategy::PropertyPartitionByTypeStrategy( - ::_pbi::ConstantInitialized) {} -struct PropertyPartitionByTypeStrategyDefaultTypeInternal { - PROTOBUF_CONSTEXPR PropertyPartitionByTypeStrategyDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~PropertyPartitionByTypeStrategyDefaultTypeInternal() {} - union { - PropertyPartitionByTypeStrategy _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyPartitionByTypeStrategyDefaultTypeInternal _PropertyPartitionByTypeStrategy_default_instance_; -PROTOBUF_CONSTEXPR GraphPropertyPartitionStrategy::GraphPropertyPartitionStrategy( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.item_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{}} {} -struct GraphPropertyPartitionStrategyDefaultTypeInternal { - PROTOBUF_CONSTEXPR GraphPropertyPartitionStrategyDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~GraphPropertyPartitionStrategyDefaultTypeInternal() {} - union { - GraphPropertyPartitionStrategy _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GraphPropertyPartitionStrategyDefaultTypeInternal _GraphPropertyPartitionStrategy_default_instance_; -PROTOBUF_CONSTEXPR GraphPartitionStrategy::GraphPartitionStrategy( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.property_)*/nullptr - , /*decltype(_impl_.topology_)*/0 - , /*decltype(_impl_._cached_size_)*/{}} {} -struct GraphPartitionStrategyDefaultTypeInternal { - PROTOBUF_CONSTEXPR GraphPartitionStrategyDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~GraphPartitionStrategyDefaultTypeInternal() {} - union { - GraphPartitionStrategy _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GraphPartitionStrategyDefaultTypeInternal _GraphPartitionStrategy_default_instance_; -PROTOBUF_CONSTEXPR SrcDstPair::SrcDstPair( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.src_type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.dst_type_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.partition_strategy_)*/0 - , /*decltype(_impl_.property_partition_strategy_)*/0 - , /*decltype(_impl_.relation_)*/0 - , /*decltype(_impl_._cached_size_)*/{}} {} -struct SrcDstPairDefaultTypeInternal { - PROTOBUF_CONSTEXPR SrcDstPairDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~SrcDstPairDefaultTypeInternal() {} - union { - SrcDstPair _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SrcDstPairDefaultTypeInternal _SrcDstPair_default_instance_; -PROTOBUF_CONSTEXPR Property::Property( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.id_)*/0u - , /*decltype(_impl_.type_)*/0 - , /*decltype(_impl_._cached_size_)*/{}} {} -struct PropertyDefaultTypeInternal { - PROTOBUF_CONSTEXPR PropertyDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~PropertyDefaultTypeInternal() {} - union { - Property _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyDefaultTypeInternal _Property_default_instance_; -PROTOBUF_CONSTEXPR VertexType::VertexType( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.properties_)*/{} - , /*decltype(_impl_.primary_keys_)*/{} - , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.id_)*/0u - , /*decltype(_impl_.partition_strategy_)*/0 - , /*decltype(_impl_.total_num_)*/int64_t{0} - , /*decltype(_impl_.property_partition_strategy_)*/0 - , /*decltype(_impl_._cached_size_)*/{}} {} -struct VertexTypeDefaultTypeInternal { - PROTOBUF_CONSTEXPR VertexTypeDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~VertexTypeDefaultTypeInternal() {} - union { - VertexType _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VertexTypeDefaultTypeInternal _VertexType_default_instance_; -PROTOBUF_CONSTEXPR EdgeType::EdgeType( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.properties_)*/{} - , /*decltype(_impl_.primary_keys_)*/{} - , /*decltype(_impl_.src_dst_pairs_)*/{} - , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.total_num_)*/int64_t{0} - , /*decltype(_impl_.id_)*/0u - , /*decltype(_impl_._cached_size_)*/{}} {} -struct EdgeTypeDefaultTypeInternal { - PROTOBUF_CONSTEXPR EdgeTypeDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~EdgeTypeDefaultTypeInternal() {} - union { - EdgeType _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EdgeTypeDefaultTypeInternal _EdgeType_default_instance_; -PROTOBUF_CONSTEXPR Statistics::Statistics( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.num_vertices_)*/uint64_t{0u} - , /*decltype(_impl_.num_edges_)*/uint64_t{0u} - , /*decltype(_impl_.num_partitions_)*/0u - , /*decltype(_impl_._cached_size_)*/{}} {} -struct StatisticsDefaultTypeInternal { - PROTOBUF_CONSTEXPR StatisticsDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~StatisticsDefaultTypeInternal() {} - union { - Statistics _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StatisticsDefaultTypeInternal _Statistics_default_instance_; -PROTOBUF_CONSTEXPR Schema::Schema( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.vertex_types_)*/{} - , /*decltype(_impl_.edge_types_)*/{} - , /*decltype(_impl_.partition_strategy_)*/nullptr - , /*decltype(_impl_.statistics_)*/nullptr - , /*decltype(_impl_._cached_size_)*/{}} {} -struct SchemaDefaultTypeInternal { - PROTOBUF_CONSTEXPR SchemaDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~SchemaDefaultTypeInternal() {} - union { - Schema _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SchemaDefaultTypeInternal _Schema_default_instance_; -} // namespace gie -static ::_pb::Metadata file_level_metadata_gie_5fschema_2eproto[10]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_gie_5fschema_2eproto[6]; -static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_gie_5fschema_2eproto = nullptr; +static void InitDefaultsscc_info_GraphPartitionStrategy_gie_5fschema_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::gie::_GraphPartitionStrategy_default_instance_; + new (ptr) ::gie::GraphPartitionStrategy(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::gie::GraphPartitionStrategy::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_GraphPartitionStrategy_gie_5fschema_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_GraphPartitionStrategy_gie_5fschema_2eproto}, { + &scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto.base,}}; + +static void InitDefaultsscc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::gie::_GraphPropertyPartitionStrategy_default_instance_; + new (ptr) ::gie::GraphPropertyPartitionStrategy(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::gie::GraphPropertyPartitionStrategy::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto}, { + &scc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto.base, + &scc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto.base,}}; + +static void InitDefaultsscc_info_Property_gie_5fschema_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::gie::_Property_default_instance_; + new (ptr) ::gie::Property(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::gie::Property::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Property_gie_5fschema_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Property_gie_5fschema_2eproto}, {}}; + +static void InitDefaultsscc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::gie::_PropertyPartitionByEntityStrategy_default_instance_; + new (ptr) ::gie::PropertyPartitionByEntityStrategy(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::gie::PropertyPartitionByEntityStrategy::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto}, {}}; + +static void InitDefaultsscc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::gie::_PropertyPartitionByTypeStrategy_default_instance_; + new (ptr) ::gie::PropertyPartitionByTypeStrategy(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::gie::PropertyPartitionByTypeStrategy::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto}, {}}; + +static void InitDefaultsscc_info_Schema_gie_5fschema_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::gie::_Schema_default_instance_; + new (ptr) ::gie::Schema(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::gie::Schema::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<4> scc_info_Schema_gie_5fschema_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 4, 0, InitDefaultsscc_info_Schema_gie_5fschema_2eproto}, { + &scc_info_GraphPartitionStrategy_gie_5fschema_2eproto.base, + &scc_info_VertexType_gie_5fschema_2eproto.base, + &scc_info_EdgeType_gie_5fschema_2eproto.base, + &scc_info_Statistics_gie_5fschema_2eproto.base,}}; + +static void InitDefaultsscc_info_SrcDstPair_gie_5fschema_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::gie::_SrcDstPair_default_instance_; + new (ptr) ::gie::SrcDstPair(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::gie::SrcDstPair::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SrcDstPair_gie_5fschema_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_SrcDstPair_gie_5fschema_2eproto}, {}}; + +static void InitDefaultsscc_info_Statistics_gie_5fschema_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::gie::_Statistics_default_instance_; + new (ptr) ::gie::Statistics(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::gie::Statistics::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Statistics_gie_5fschema_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Statistics_gie_5fschema_2eproto}, {}}; + +static void InitDefaultsscc_info_VertexType_gie_5fschema_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::gie::_VertexType_default_instance_; + new (ptr) ::gie::VertexType(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::gie::VertexType::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_VertexType_gie_5fschema_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_VertexType_gie_5fschema_2eproto}, { + &scc_info_Property_gie_5fschema_2eproto.base,}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_gie_5fschema_2eproto[10]; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_gie_5fschema_2eproto[6]; +static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_gie_5fschema_2eproto = nullptr; -const uint32_t TableStruct_gie_5fschema_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_gie_5fschema_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, _impl_.vertex_property_partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, _impl_.edge_property_partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, vertex_property_partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, edge_property_partition_strategy_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByTypeStrategy, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, _impl_._oneof_case_[0]), + PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, _oneof_case_[0]), ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, _impl_.item_), + offsetof(::gie::GraphPropertyPartitionStrategyDefaultTypeInternal, by_entity_), + offsetof(::gie::GraphPropertyPartitionStrategyDefaultTypeInternal, by_type_), + PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, item_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, _impl_.topology_), - PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, _impl_.property_), + PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, topology_), + PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, property_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _impl_.src_type_), - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _impl_.dst_type_), - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _impl_.partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _impl_.property_partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _impl_.relation_), + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, src_type_), + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, dst_type_), + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, property_partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, relation_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::gie::Property, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::gie::Property, _impl_.id_), - PROTOBUF_FIELD_OFFSET(::gie::Property, _impl_.name_), - PROTOBUF_FIELD_OFFSET(::gie::Property, _impl_.type_), + PROTOBUF_FIELD_OFFSET(::gie::Property, id_), + PROTOBUF_FIELD_OFFSET(::gie::Property, name_), + PROTOBUF_FIELD_OFFSET(::gie::Property, type_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::gie::VertexType, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.id_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.name_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.properties_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.primary_keys_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.property_partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, _impl_.total_num_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, id_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, name_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, properties_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, primary_keys_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, property_partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::VertexType, total_num_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.id_), - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.name_), - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.properties_), - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.primary_keys_), - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.src_dst_pairs_), - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _impl_.total_num_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, id_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, name_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, properties_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, primary_keys_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, src_dst_pairs_), + PROTOBUF_FIELD_OFFSET(::gie::EdgeType, total_num_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::gie::Statistics, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::gie::Statistics, _impl_.num_partitions_), - PROTOBUF_FIELD_OFFSET(::gie::Statistics, _impl_.num_vertices_), - PROTOBUF_FIELD_OFFSET(::gie::Statistics, _impl_.num_edges_), + PROTOBUF_FIELD_OFFSET(::gie::Statistics, num_partitions_), + PROTOBUF_FIELD_OFFSET(::gie::Statistics, num_vertices_), + PROTOBUF_FIELD_OFFSET(::gie::Statistics, num_edges_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::gie::Schema, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::gie::Schema, _impl_.partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::Schema, _impl_.vertex_types_), - PROTOBUF_FIELD_OFFSET(::gie::Schema, _impl_.edge_types_), - PROTOBUF_FIELD_OFFSET(::gie::Schema, _impl_.statistics_), + PROTOBUF_FIELD_OFFSET(::gie::Schema, partition_strategy_), + PROTOBUF_FIELD_OFFSET(::gie::Schema, vertex_types_), + PROTOBUF_FIELD_OFFSET(::gie::Schema, edge_types_), + PROTOBUF_FIELD_OFFSET(::gie::Schema, statistics_), }; -static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::gie::PropertyPartitionByEntityStrategy)}, - { 8, -1, -1, sizeof(::gie::PropertyPartitionByTypeStrategy)}, - { 14, -1, -1, sizeof(::gie::GraphPropertyPartitionStrategy)}, - { 23, -1, -1, sizeof(::gie::GraphPartitionStrategy)}, - { 31, -1, -1, sizeof(::gie::SrcDstPair)}, - { 42, -1, -1, sizeof(::gie::Property)}, - { 51, -1, -1, sizeof(::gie::VertexType)}, - { 64, -1, -1, sizeof(::gie::EdgeType)}, - { 76, -1, -1, sizeof(::gie::Statistics)}, - { 85, -1, -1, sizeof(::gie::Schema)}, +static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::gie::PropertyPartitionByEntityStrategy)}, + { 7, -1, sizeof(::gie::PropertyPartitionByTypeStrategy)}, + { 12, -1, sizeof(::gie::GraphPropertyPartitionStrategy)}, + { 20, -1, sizeof(::gie::GraphPartitionStrategy)}, + { 27, -1, sizeof(::gie::SrcDstPair)}, + { 37, -1, sizeof(::gie::Property)}, + { 45, -1, sizeof(::gie::VertexType)}, + { 57, -1, sizeof(::gie::EdgeType)}, + { 68, -1, sizeof(::gie::Statistics)}, + { 76, -1, sizeof(::gie::Schema)}, }; -static const ::_pb::Message* const file_default_instances[] = { - &::gie::_PropertyPartitionByEntityStrategy_default_instance_._instance, - &::gie::_PropertyPartitionByTypeStrategy_default_instance_._instance, - &::gie::_GraphPropertyPartitionStrategy_default_instance_._instance, - &::gie::_GraphPartitionStrategy_default_instance_._instance, - &::gie::_SrcDstPair_default_instance_._instance, - &::gie::_Property_default_instance_._instance, - &::gie::_VertexType_default_instance_._instance, - &::gie::_EdgeType_default_instance_._instance, - &::gie::_Statistics_default_instance_._instance, - &::gie::_Schema_default_instance_._instance, +static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::gie::_PropertyPartitionByEntityStrategy_default_instance_), + reinterpret_cast(&::gie::_PropertyPartitionByTypeStrategy_default_instance_), + reinterpret_cast(&::gie::_GraphPropertyPartitionStrategy_default_instance_), + reinterpret_cast(&::gie::_GraphPartitionStrategy_default_instance_), + reinterpret_cast(&::gie::_SrcDstPair_default_instance_), + reinterpret_cast(&::gie::_Property_default_instance_), + reinterpret_cast(&::gie::_VertexType_default_instance_), + reinterpret_cast(&::gie::_EdgeType_default_instance_), + reinterpret_cast(&::gie::_Statistics_default_instance_), + reinterpret_cast(&::gie::_Schema_default_instance_), }; const char descriptor_table_protodef_gie_5fschema_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -363,21 +395,30 @@ const char descriptor_table_protodef_gie_5fschema_2eproto[] PROTOBUF_SECTION_VAR "DT_TIMESTAMP\020\nB%\n#com.alibaba.graphscope" ".proto.schemab\006proto3" ; -static ::_pbi::once_flag descriptor_table_gie_5fschema_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_gie_5fschema_2eproto = { - false, false, 2341, descriptor_table_protodef_gie_5fschema_2eproto, - "gie_schema.proto", - &descriptor_table_gie_5fschema_2eproto_once, nullptr, 0, 10, - schemas, file_default_instances, TableStruct_gie_5fschema_2eproto::offsets, - file_level_metadata_gie_5fschema_2eproto, file_level_enum_descriptors_gie_5fschema_2eproto, - file_level_service_descriptors_gie_5fschema_2eproto, +static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_gie_5fschema_2eproto_deps[1] = { +}; +static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_gie_5fschema_2eproto_sccs[10] = { + &scc_info_EdgeType_gie_5fschema_2eproto.base, + &scc_info_GraphPartitionStrategy_gie_5fschema_2eproto.base, + &scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto.base, + &scc_info_Property_gie_5fschema_2eproto.base, + &scc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto.base, + &scc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto.base, + &scc_info_Schema_gie_5fschema_2eproto.base, + &scc_info_SrcDstPair_gie_5fschema_2eproto.base, + &scc_info_Statistics_gie_5fschema_2eproto.base, + &scc_info_VertexType_gie_5fschema_2eproto.base, +}; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_gie_5fschema_2eproto_once; +const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_gie_5fschema_2eproto = { + false, false, descriptor_table_protodef_gie_5fschema_2eproto, "gie_schema.proto", 2341, + &descriptor_table_gie_5fschema_2eproto_once, descriptor_table_gie_5fschema_2eproto_sccs, descriptor_table_gie_5fschema_2eproto_deps, 10, 0, + schemas, file_default_instances, TableStruct_gie_5fschema_2eproto::offsets, + file_level_metadata_gie_5fschema_2eproto, 10, file_level_enum_descriptors_gie_5fschema_2eproto, file_level_service_descriptors_gie_5fschema_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_gie_5fschema_2eproto_getter() { - return &descriptor_table_gie_5fschema_2eproto; -} // Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_gie_5fschema_2eproto(&descriptor_table_gie_5fschema_2eproto); +static bool dynamic_init_dummy_gie_5fschema_2eproto = (static_cast(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_gie_5fschema_2eproto)), true); namespace gie { const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* VertexPartitionStrategy_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); @@ -490,140 +531,138 @@ bool DataType_IsValid(int value) { // =================================================================== +void PropertyPartitionByEntityStrategy::InitAsDefaultInstance() { +} class PropertyPartitionByEntityStrategy::_Internal { public: }; -PropertyPartitionByEntityStrategy::PropertyPartitionByEntityStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +PropertyPartitionByEntityStrategy::PropertyPartitionByEntityStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:gie.PropertyPartitionByEntityStrategy) } PropertyPartitionByEntityStrategy::PropertyPartitionByEntityStrategy(const PropertyPartitionByEntityStrategy& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - PropertyPartitionByEntityStrategy* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.vertex_property_partition_strategy_){} - , decltype(_impl_.edge_property_partition_strategy_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.vertex_property_partition_strategy_, &from._impl_.vertex_property_partition_strategy_, - static_cast(reinterpret_cast(&_impl_.edge_property_partition_strategy_) - - reinterpret_cast(&_impl_.vertex_property_partition_strategy_)) + sizeof(_impl_.edge_property_partition_strategy_)); + ::memcpy(&vertex_property_partition_strategy_, &from.vertex_property_partition_strategy_, + static_cast(reinterpret_cast(&edge_property_partition_strategy_) - + reinterpret_cast(&vertex_property_partition_strategy_)) + sizeof(edge_property_partition_strategy_)); // @@protoc_insertion_point(copy_constructor:gie.PropertyPartitionByEntityStrategy) } -inline void PropertyPartitionByEntityStrategy::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.vertex_property_partition_strategy_){0} - , decltype(_impl_.edge_property_partition_strategy_){0} - , /*decltype(_impl_._cached_size_)*/{} - }; +void PropertyPartitionByEntityStrategy::SharedCtor() { + ::memset(&vertex_property_partition_strategy_, 0, static_cast( + reinterpret_cast(&edge_property_partition_strategy_) - + reinterpret_cast(&vertex_property_partition_strategy_)) + sizeof(edge_property_partition_strategy_)); } PropertyPartitionByEntityStrategy::~PropertyPartitionByEntityStrategy() { // @@protoc_insertion_point(destructor:gie.PropertyPartitionByEntityStrategy) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void PropertyPartitionByEntityStrategy::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +void PropertyPartitionByEntityStrategy::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); } +void PropertyPartitionByEntityStrategy::ArenaDtor(void* object) { + PropertyPartitionByEntityStrategy* _this = reinterpret_cast< PropertyPartitionByEntityStrategy* >(object); + (void)_this; +} +void PropertyPartitionByEntityStrategy::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void PropertyPartitionByEntityStrategy::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const PropertyPartitionByEntityStrategy& PropertyPartitionByEntityStrategy::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto.base); + return *internal_default_instance(); } + void PropertyPartitionByEntityStrategy::Clear() { // @@protoc_insertion_point(message_clear_start:gie.PropertyPartitionByEntityStrategy) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - ::memset(&_impl_.vertex_property_partition_strategy_, 0, static_cast( - reinterpret_cast(&_impl_.edge_property_partition_strategy_) - - reinterpret_cast(&_impl_.vertex_property_partition_strategy_)) + sizeof(_impl_.edge_property_partition_strategy_)); + ::memset(&vertex_property_partition_strategy_, 0, static_cast( + reinterpret_cast(&edge_property_partition_strategy_) - + reinterpret_cast(&vertex_property_partition_strategy_)) + sizeof(edge_property_partition_strategy_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* PropertyPartitionByEntityStrategy::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* PropertyPartitionByEntityStrategy::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_vertex_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_edge_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* PropertyPartitionByEntityStrategy::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* PropertyPartitionByEntityStrategy::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:gie.PropertyPartitionByEntityStrategy) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; - if (this->_internal_vertex_property_partition_strategy() != 0) { + if (this->vertex_property_partition_strategy() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 1, this->_internal_vertex_property_partition_strategy(), target); } // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; - if (this->_internal_edge_property_partition_strategy() != 0) { + if (this->edge_property_partition_strategy() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 2, this->_internal_edge_property_partition_strategy(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:gie.PropertyPartitionByEntityStrategy) @@ -634,47 +673,66 @@ size_t PropertyPartitionByEntityStrategy::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:gie.PropertyPartitionByEntityStrategy) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; - if (this->_internal_vertex_property_partition_strategy() != 0) { + if (this->vertex_property_partition_strategy() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_vertex_property_partition_strategy()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_vertex_property_partition_strategy()); } // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; - if (this->_internal_edge_property_partition_strategy() != 0) { + if (this->edge_property_partition_strategy() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_edge_property_partition_strategy()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_edge_property_partition_strategy()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PropertyPartitionByEntityStrategy::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - PropertyPartitionByEntityStrategy::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PropertyPartitionByEntityStrategy::GetClassData() const { return &_class_data_; } - +void PropertyPartitionByEntityStrategy::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:gie.PropertyPartitionByEntityStrategy) + GOOGLE_DCHECK_NE(&from, this); + const PropertyPartitionByEntityStrategy* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.PropertyPartitionByEntityStrategy) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.PropertyPartitionByEntityStrategy) + MergeFrom(*source); + } +} -void PropertyPartitionByEntityStrategy::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:gie.PropertyPartitionByEntityStrategy) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void PropertyPartitionByEntityStrategy::MergeFrom(const PropertyPartitionByEntityStrategy& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:gie.PropertyPartitionByEntityStrategy) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_vertex_property_partition_strategy() != 0) { - _this->_internal_set_vertex_property_partition_strategy(from._internal_vertex_property_partition_strategy()); + if (from.vertex_property_partition_strategy() != 0) { + _internal_set_vertex_property_partition_strategy(from._internal_vertex_property_partition_strategy()); } - if (from._internal_edge_property_partition_strategy() != 0) { - _this->_internal_set_edge_property_partition_strategy(from._internal_edge_property_partition_strategy()); + if (from.edge_property_partition_strategy() != 0) { + _internal_set_edge_property_partition_strategy(from._internal_edge_property_partition_strategy()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PropertyPartitionByEntityStrategy::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:gie.PropertyPartitionByEntityStrategy) + if (&from == this) return; + Clear(); + MergeFrom(from); } void PropertyPartitionByEntityStrategy::CopyFrom(const PropertyPartitionByEntityStrategy& from) { @@ -690,63 +748,193 @@ bool PropertyPartitionByEntityStrategy::IsInitialized() const { void PropertyPartitionByEntityStrategy::InternalSwap(PropertyPartitionByEntityStrategy* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(PropertyPartitionByEntityStrategy, _impl_.edge_property_partition_strategy_) - + sizeof(PropertyPartitionByEntityStrategy::_impl_.edge_property_partition_strategy_) - - PROTOBUF_FIELD_OFFSET(PropertyPartitionByEntityStrategy, _impl_.vertex_property_partition_strategy_)>( - reinterpret_cast(&_impl_.vertex_property_partition_strategy_), - reinterpret_cast(&other->_impl_.vertex_property_partition_strategy_)); + PROTOBUF_FIELD_OFFSET(PropertyPartitionByEntityStrategy, edge_property_partition_strategy_) + + sizeof(PropertyPartitionByEntityStrategy::edge_property_partition_strategy_) + - PROTOBUF_FIELD_OFFSET(PropertyPartitionByEntityStrategy, vertex_property_partition_strategy_)>( + reinterpret_cast(&vertex_property_partition_strategy_), + reinterpret_cast(&other->vertex_property_partition_strategy_)); } ::PROTOBUF_NAMESPACE_ID::Metadata PropertyPartitionByEntityStrategy::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, - file_level_metadata_gie_5fschema_2eproto[0]); + return GetMetadataStatic(); } + // =================================================================== +void PropertyPartitionByTypeStrategy::InitAsDefaultInstance() { +} class PropertyPartitionByTypeStrategy::_Internal { public: }; -PropertyPartitionByTypeStrategy::PropertyPartitionByTypeStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { +PropertyPartitionByTypeStrategy::PropertyPartitionByTypeStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:gie.PropertyPartitionByTypeStrategy) } PropertyPartitionByTypeStrategy::PropertyPartitionByTypeStrategy(const PropertyPartitionByTypeStrategy& from) - : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { - PropertyPartitionByTypeStrategy* const _this = this; (void)_this; + : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:gie.PropertyPartitionByTypeStrategy) } +void PropertyPartitionByTypeStrategy::SharedCtor() { +} +PropertyPartitionByTypeStrategy::~PropertyPartitionByTypeStrategy() { + // @@protoc_insertion_point(destructor:gie.PropertyPartitionByTypeStrategy) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} +void PropertyPartitionByTypeStrategy::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} +void PropertyPartitionByTypeStrategy::ArenaDtor(void* object) { + PropertyPartitionByTypeStrategy* _this = reinterpret_cast< PropertyPartitionByTypeStrategy* >(object); + (void)_this; +} +void PropertyPartitionByTypeStrategy::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void PropertyPartitionByTypeStrategy::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const PropertyPartitionByTypeStrategy& PropertyPartitionByTypeStrategy::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto.base); + return *internal_default_instance(); +} -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PropertyPartitionByTypeStrategy::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PropertyPartitionByTypeStrategy::GetClassData() const { return &_class_data_; } +void PropertyPartitionByTypeStrategy::Clear() { +// @@protoc_insertion_point(message_clear_start:gie.PropertyPartitionByTypeStrategy) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} +const char* PropertyPartitionByTypeStrategy::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} +::PROTOBUF_NAMESPACE_ID::uint8* PropertyPartitionByTypeStrategy::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:gie.PropertyPartitionByTypeStrategy) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:gie.PropertyPartitionByTypeStrategy) + return target; +} +size_t PropertyPartitionByTypeStrategy::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:gie.PropertyPartitionByTypeStrategy) + size_t total_size = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void PropertyPartitionByTypeStrategy::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:gie.PropertyPartitionByTypeStrategy) + GOOGLE_DCHECK_NE(&from, this); + const PropertyPartitionByTypeStrategy* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.PropertyPartitionByTypeStrategy) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.PropertyPartitionByTypeStrategy) + MergeFrom(*source); + } +} + +void PropertyPartitionByTypeStrategy::MergeFrom(const PropertyPartitionByTypeStrategy& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:gie.PropertyPartitionByTypeStrategy) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + +} + +void PropertyPartitionByTypeStrategy::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:gie.PropertyPartitionByTypeStrategy) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void PropertyPartitionByTypeStrategy::CopyFrom(const PropertyPartitionByTypeStrategy& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:gie.PropertyPartitionByTypeStrategy) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool PropertyPartitionByTypeStrategy::IsInitialized() const { + return true; +} + +void PropertyPartitionByTypeStrategy::InternalSwap(PropertyPartitionByTypeStrategy* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); +} ::PROTOBUF_NAMESPACE_ID::Metadata PropertyPartitionByTypeStrategy::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, - file_level_metadata_gie_5fschema_2eproto[1]); + return GetMetadataStatic(); } + // =================================================================== +void GraphPropertyPartitionStrategy::InitAsDefaultInstance() { + ::gie::_GraphPropertyPartitionStrategy_default_instance_.by_entity_ = const_cast< ::gie::PropertyPartitionByEntityStrategy*>( + ::gie::PropertyPartitionByEntityStrategy::internal_default_instance()); + ::gie::_GraphPropertyPartitionStrategy_default_instance_.by_type_ = const_cast< ::gie::PropertyPartitionByTypeStrategy*>( + ::gie::PropertyPartitionByTypeStrategy::internal_default_instance()); +} class GraphPropertyPartitionStrategy::_Internal { public: static const ::gie::PropertyPartitionByEntityStrategy& by_entity(const GraphPropertyPartitionStrategy* msg); @@ -755,67 +943,59 @@ class GraphPropertyPartitionStrategy::_Internal { const ::gie::PropertyPartitionByEntityStrategy& GraphPropertyPartitionStrategy::_Internal::by_entity(const GraphPropertyPartitionStrategy* msg) { - return *msg->_impl_.item_.by_entity_; + return *msg->item_.by_entity_; } const ::gie::PropertyPartitionByTypeStrategy& GraphPropertyPartitionStrategy::_Internal::by_type(const GraphPropertyPartitionStrategy* msg) { - return *msg->_impl_.item_.by_type_; + return *msg->item_.by_type_; } void GraphPropertyPartitionStrategy::set_allocated_by_entity(::gie::PropertyPartitionByEntityStrategy* by_entity) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); clear_item(); if (by_entity) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(by_entity); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(by_entity); if (message_arena != submessage_arena) { by_entity = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, by_entity, submessage_arena); } set_has_by_entity(); - _impl_.item_.by_entity_ = by_entity; + item_.by_entity_ = by_entity; } // @@protoc_insertion_point(field_set_allocated:gie.GraphPropertyPartitionStrategy.by_entity) } void GraphPropertyPartitionStrategy::set_allocated_by_type(::gie::PropertyPartitionByTypeStrategy* by_type) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); clear_item(); if (by_type) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(by_type); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(by_type); if (message_arena != submessage_arena) { by_type = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, by_type, submessage_arena); } set_has_by_type(); - _impl_.item_.by_type_ = by_type; + item_.by_type_ = by_type; } // @@protoc_insertion_point(field_set_allocated:gie.GraphPropertyPartitionStrategy.by_type) } -GraphPropertyPartitionStrategy::GraphPropertyPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +GraphPropertyPartitionStrategy::GraphPropertyPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:gie.GraphPropertyPartitionStrategy) } GraphPropertyPartitionStrategy::GraphPropertyPartitionStrategy(const GraphPropertyPartitionStrategy& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - GraphPropertyPartitionStrategy* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.item_){} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); clear_has_item(); switch (from.item_case()) { case kByEntity: { - _this->_internal_mutable_by_entity()->::gie::PropertyPartitionByEntityStrategy::MergeFrom( - from._internal_by_entity()); + _internal_mutable_by_entity()->::gie::PropertyPartitionByEntityStrategy::MergeFrom(from._internal_by_entity()); break; } case kByType: { - _this->_internal_mutable_by_type()->::gie::PropertyPartitionByTypeStrategy::MergeFrom( - from._internal_by_type()); + _internal_mutable_by_type()->::gie::PropertyPartitionByTypeStrategy::MergeFrom(from._internal_by_type()); break; } case ITEM_NOT_SET: { @@ -825,50 +1005,51 @@ GraphPropertyPartitionStrategy::GraphPropertyPartitionStrategy(const GraphProper // @@protoc_insertion_point(copy_constructor:gie.GraphPropertyPartitionStrategy) } -inline void GraphPropertyPartitionStrategy::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.item_){} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{} - }; +void GraphPropertyPartitionStrategy::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto.base); clear_has_item(); } GraphPropertyPartitionStrategy::~GraphPropertyPartitionStrategy() { // @@protoc_insertion_point(destructor:gie.GraphPropertyPartitionStrategy) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void GraphPropertyPartitionStrategy::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +void GraphPropertyPartitionStrategy::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); if (has_item()) { clear_item(); } } +void GraphPropertyPartitionStrategy::ArenaDtor(void* object) { + GraphPropertyPartitionStrategy* _this = reinterpret_cast< GraphPropertyPartitionStrategy* >(object); + (void)_this; +} +void GraphPropertyPartitionStrategy::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void GraphPropertyPartitionStrategy::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const GraphPropertyPartitionStrategy& GraphPropertyPartitionStrategy::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto.base); + return *internal_default_instance(); } + void GraphPropertyPartitionStrategy::clear_item() { // @@protoc_insertion_point(one_of_clear_start:gie.GraphPropertyPartitionStrategy) switch (item_case()) { case kByEntity: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.item_.by_entity_; + if (GetArena() == nullptr) { + delete item_.by_entity_; } break; } case kByType: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.item_.by_type_; + if (GetArena() == nullptr) { + delete item_.by_type_; } break; } @@ -876,13 +1057,13 @@ void GraphPropertyPartitionStrategy::clear_item() { break; } } - _impl_._oneof_case_[0] = ITEM_NOT_SET; + _oneof_case_[0] = ITEM_NOT_SET; } void GraphPropertyPartitionStrategy::Clear() { // @@protoc_insertion_point(message_clear_start:gie.GraphPropertyPartitionStrategy) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -890,73 +1071,74 @@ void GraphPropertyPartitionStrategy::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* GraphPropertyPartitionStrategy::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* GraphPropertyPartitionStrategy::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // .gie.PropertyPartitionByEntityStrategy by_entity = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_by_entity(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .gie.PropertyPartitionByTypeStrategy by_type = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_by_type(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; - default: - goto handle_unusual; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* GraphPropertyPartitionStrategy::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* GraphPropertyPartitionStrategy::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:gie.GraphPropertyPartitionStrategy) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // .gie.PropertyPartitionByEntityStrategy by_entity = 1; if (_internal_has_by_entity()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::by_entity(this), - _Internal::by_entity(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 1, _Internal::by_entity(this), target, stream); } // .gie.PropertyPartitionByTypeStrategy by_type = 2; if (_internal_has_by_type()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::by_type(this), - _Internal::by_type(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 2, _Internal::by_type(this), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:gie.GraphPropertyPartitionStrategy) @@ -967,7 +1149,7 @@ size_t GraphPropertyPartitionStrategy::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:gie.GraphPropertyPartitionStrategy) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -976,54 +1158,71 @@ size_t GraphPropertyPartitionStrategy::ByteSizeLong() const { case kByEntity: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.item_.by_entity_); + *item_.by_entity_); break; } // .gie.PropertyPartitionByTypeStrategy by_type = 2; case kByType: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.item_.by_type_); + *item_.by_type_); break; } case ITEM_NOT_SET: { break; } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GraphPropertyPartitionStrategy::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - GraphPropertyPartitionStrategy::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GraphPropertyPartitionStrategy::GetClassData() const { return &_class_data_; } - +void GraphPropertyPartitionStrategy::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:gie.GraphPropertyPartitionStrategy) + GOOGLE_DCHECK_NE(&from, this); + const GraphPropertyPartitionStrategy* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.GraphPropertyPartitionStrategy) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.GraphPropertyPartitionStrategy) + MergeFrom(*source); + } +} -void GraphPropertyPartitionStrategy::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:gie.GraphPropertyPartitionStrategy) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void GraphPropertyPartitionStrategy::MergeFrom(const GraphPropertyPartitionStrategy& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:gie.GraphPropertyPartitionStrategy) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; switch (from.item_case()) { case kByEntity: { - _this->_internal_mutable_by_entity()->::gie::PropertyPartitionByEntityStrategy::MergeFrom( - from._internal_by_entity()); + _internal_mutable_by_entity()->::gie::PropertyPartitionByEntityStrategy::MergeFrom(from._internal_by_entity()); break; } case kByType: { - _this->_internal_mutable_by_type()->::gie::PropertyPartitionByTypeStrategy::MergeFrom( - from._internal_by_type()); + _internal_mutable_by_type()->::gie::PropertyPartitionByTypeStrategy::MergeFrom(from._internal_by_type()); break; } case ITEM_NOT_SET: { break; } } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void GraphPropertyPartitionStrategy::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:gie.GraphPropertyPartitionStrategy) + if (&from == this) return; + Clear(); + MergeFrom(from); } void GraphPropertyPartitionStrategy::CopyFrom(const GraphPropertyPartitionStrategy& from) { @@ -1039,19 +1238,22 @@ bool GraphPropertyPartitionStrategy::IsInitialized() const { void GraphPropertyPartitionStrategy::InternalSwap(GraphPropertyPartitionStrategy* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.item_, other->_impl_.item_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + swap(item_, other->item_); + swap(_oneof_case_[0], other->_oneof_case_[0]); } ::PROTOBUF_NAMESPACE_ID::Metadata GraphPropertyPartitionStrategy::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, - file_level_metadata_gie_5fschema_2eproto[2]); + return GetMetadataStatic(); } + // =================================================================== +void GraphPartitionStrategy::InitAsDefaultInstance() { + ::gie::_GraphPartitionStrategy_default_instance_._instance.get_mutable()->property_ = const_cast< ::gie::GraphPropertyPartitionStrategy*>( + ::gie::GraphPropertyPartitionStrategy::internal_default_instance()); +} class GraphPartitionStrategy::_Internal { public: static const ::gie::GraphPropertyPartitionStrategy& property(const GraphPartitionStrategy* msg); @@ -1059,141 +1261,141 @@ class GraphPartitionStrategy::_Internal { const ::gie::GraphPropertyPartitionStrategy& GraphPartitionStrategy::_Internal::property(const GraphPartitionStrategy* msg) { - return *msg->_impl_.property_; + return *msg->property_; } -GraphPartitionStrategy::GraphPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +GraphPartitionStrategy::GraphPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:gie.GraphPartitionStrategy) } GraphPartitionStrategy::GraphPartitionStrategy(const GraphPartitionStrategy& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - GraphPartitionStrategy* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.property_){nullptr} - , decltype(_impl_.topology_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); if (from._internal_has_property()) { - _this->_impl_.property_ = new ::gie::GraphPropertyPartitionStrategy(*from._impl_.property_); + property_ = new ::gie::GraphPropertyPartitionStrategy(*from.property_); + } else { + property_ = nullptr; } - _this->_impl_.topology_ = from._impl_.topology_; + topology_ = from.topology_; // @@protoc_insertion_point(copy_constructor:gie.GraphPartitionStrategy) } -inline void GraphPartitionStrategy::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.property_){nullptr} - , decltype(_impl_.topology_){0} - , /*decltype(_impl_._cached_size_)*/{} - }; +void GraphPartitionStrategy::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_GraphPartitionStrategy_gie_5fschema_2eproto.base); + ::memset(&property_, 0, static_cast( + reinterpret_cast(&topology_) - + reinterpret_cast(&property_)) + sizeof(topology_)); } GraphPartitionStrategy::~GraphPartitionStrategy() { // @@protoc_insertion_point(destructor:gie.GraphPartitionStrategy) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void GraphPartitionStrategy::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.property_; +void GraphPartitionStrategy::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + if (this != internal_default_instance()) delete property_; } +void GraphPartitionStrategy::ArenaDtor(void* object) { + GraphPartitionStrategy* _this = reinterpret_cast< GraphPartitionStrategy* >(object); + (void)_this; +} +void GraphPartitionStrategy::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void GraphPartitionStrategy::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); } +const GraphPartitionStrategy& GraphPartitionStrategy::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_GraphPartitionStrategy_gie_5fschema_2eproto.base); + return *internal_default_instance(); +} + void GraphPartitionStrategy::Clear() { // @@protoc_insertion_point(message_clear_start:gie.GraphPartitionStrategy) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (GetArenaForAllocation() == nullptr && _impl_.property_ != nullptr) { - delete _impl_.property_; + if (GetArena() == nullptr && property_ != nullptr) { + delete property_; } - _impl_.property_ = nullptr; - _impl_.topology_ = 0; + property_ = nullptr; + topology_ = 0; _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* GraphPartitionStrategy::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* GraphPartitionStrategy::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // .gie.GraphTopologyPartitionStrategy topology = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_topology(static_cast<::gie::GraphTopologyPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .gie.GraphPropertyPartitionStrategy property = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_property(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* GraphPartitionStrategy::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* GraphPartitionStrategy::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:gie.GraphPartitionStrategy) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // .gie.GraphTopologyPartitionStrategy topology = 1; - if (this->_internal_topology() != 0) { + if (this->topology() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 1, this->_internal_topology(), target); } // .gie.GraphPropertyPartitionStrategy property = 2; - if (this->_internal_has_property()) { + if (this->has_property()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::property(this), - _Internal::property(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 2, _Internal::property(this), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:gie.GraphPartitionStrategy) @@ -1204,49 +1406,67 @@ size_t GraphPartitionStrategy::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:gie.GraphPartitionStrategy) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // .gie.GraphPropertyPartitionStrategy property = 2; - if (this->_internal_has_property()) { + if (this->has_property()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.property_); + *property_); } // .gie.GraphTopologyPartitionStrategy topology = 1; - if (this->_internal_topology() != 0) { + if (this->topology() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_topology()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_topology()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData GraphPartitionStrategy::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - GraphPartitionStrategy::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GraphPartitionStrategy::GetClassData() const { return &_class_data_; } - +void GraphPartitionStrategy::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:gie.GraphPartitionStrategy) + GOOGLE_DCHECK_NE(&from, this); + const GraphPartitionStrategy* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.GraphPartitionStrategy) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.GraphPartitionStrategy) + MergeFrom(*source); + } +} -void GraphPartitionStrategy::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:gie.GraphPartitionStrategy) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void GraphPartitionStrategy::MergeFrom(const GraphPartitionStrategy& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:gie.GraphPartitionStrategy) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_has_property()) { - _this->_internal_mutable_property()->::gie::GraphPropertyPartitionStrategy::MergeFrom( - from._internal_property()); + if (from.has_property()) { + _internal_mutable_property()->::gie::GraphPropertyPartitionStrategy::MergeFrom(from._internal_property()); } - if (from._internal_topology() != 0) { - _this->_internal_set_topology(from._internal_topology()); + if (from.topology() != 0) { + _internal_set_topology(from._internal_topology()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void GraphPartitionStrategy::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:gie.GraphPartitionStrategy) + if (&from == this) return; + Clear(); + MergeFrom(from); } void GraphPartitionStrategy::CopyFrom(const GraphPartitionStrategy& from) { @@ -1262,206 +1482,183 @@ bool GraphPartitionStrategy::IsInitialized() const { void GraphPartitionStrategy::InternalSwap(GraphPartitionStrategy* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(GraphPartitionStrategy, _impl_.topology_) - + sizeof(GraphPartitionStrategy::_impl_.topology_) - - PROTOBUF_FIELD_OFFSET(GraphPartitionStrategy, _impl_.property_)>( - reinterpret_cast(&_impl_.property_), - reinterpret_cast(&other->_impl_.property_)); + PROTOBUF_FIELD_OFFSET(GraphPartitionStrategy, topology_) + + sizeof(GraphPartitionStrategy::topology_) + - PROTOBUF_FIELD_OFFSET(GraphPartitionStrategy, property_)>( + reinterpret_cast(&property_), + reinterpret_cast(&other->property_)); } ::PROTOBUF_NAMESPACE_ID::Metadata GraphPartitionStrategy::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, - file_level_metadata_gie_5fschema_2eproto[3]); + return GetMetadataStatic(); } + // =================================================================== +void SrcDstPair::InitAsDefaultInstance() { +} class SrcDstPair::_Internal { public: }; -SrcDstPair::SrcDstPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +SrcDstPair::SrcDstPair(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:gie.SrcDstPair) } SrcDstPair::SrcDstPair(const SrcDstPair& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - SrcDstPair* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.src_type_){} - , decltype(_impl_.dst_type_){} - , decltype(_impl_.partition_strategy_){} - , decltype(_impl_.property_partition_strategy_){} - , decltype(_impl_.relation_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.src_type_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.src_type_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + src_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (!from._internal_src_type().empty()) { - _this->_impl_.src_type_.Set(from._internal_src_type(), - _this->GetArenaForAllocation()); + src_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_src_type(), + GetArena()); } - _impl_.dst_type_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.dst_type_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + dst_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (!from._internal_dst_type().empty()) { - _this->_impl_.dst_type_.Set(from._internal_dst_type(), - _this->GetArenaForAllocation()); + dst_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_dst_type(), + GetArena()); } - ::memcpy(&_impl_.partition_strategy_, &from._impl_.partition_strategy_, - static_cast(reinterpret_cast(&_impl_.relation_) - - reinterpret_cast(&_impl_.partition_strategy_)) + sizeof(_impl_.relation_)); + ::memcpy(&partition_strategy_, &from.partition_strategy_, + static_cast(reinterpret_cast(&relation_) - + reinterpret_cast(&partition_strategy_)) + sizeof(relation_)); // @@protoc_insertion_point(copy_constructor:gie.SrcDstPair) } -inline void SrcDstPair::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.src_type_){} - , decltype(_impl_.dst_type_){} - , decltype(_impl_.partition_strategy_){0} - , decltype(_impl_.property_partition_strategy_){0} - , decltype(_impl_.relation_){0} - , /*decltype(_impl_._cached_size_)*/{} - }; - _impl_.src_type_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.src_type_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.dst_type_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.dst_type_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +void SrcDstPair::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SrcDstPair_gie_5fschema_2eproto.base); + src_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + dst_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&partition_strategy_, 0, static_cast( + reinterpret_cast(&relation_) - + reinterpret_cast(&partition_strategy_)) + sizeof(relation_)); } SrcDstPair::~SrcDstPair() { // @@protoc_insertion_point(destructor:gie.SrcDstPair) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void SrcDstPair::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.src_type_.Destroy(); - _impl_.dst_type_.Destroy(); +void SrcDstPair::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + src_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + dst_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } +void SrcDstPair::ArenaDtor(void* object) { + SrcDstPair* _this = reinterpret_cast< SrcDstPair* >(object); + (void)_this; +} +void SrcDstPair::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void SrcDstPair::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const SrcDstPair& SrcDstPair::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SrcDstPair_gie_5fschema_2eproto.base); + return *internal_default_instance(); } + void SrcDstPair::Clear() { // @@protoc_insertion_point(message_clear_start:gie.SrcDstPair) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.src_type_.ClearToEmpty(); - _impl_.dst_type_.ClearToEmpty(); - ::memset(&_impl_.partition_strategy_, 0, static_cast( - reinterpret_cast(&_impl_.relation_) - - reinterpret_cast(&_impl_.partition_strategy_)) + sizeof(_impl_.relation_)); + src_type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + dst_type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::memset(&partition_strategy_, 0, static_cast( + reinterpret_cast(&relation_) - + reinterpret_cast(&partition_strategy_)) + sizeof(relation_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* SrcDstPair::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* SrcDstPair::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // string src_type = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { auto str = _internal_mutable_src_type(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.SrcDstPair.src_type")); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "gie.SrcDstPair.src_type")); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // string dst_type = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { auto str = _internal_mutable_dst_type(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.SrcDstPair.dst_type")); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "gie.SrcDstPair.dst_type")); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .gie.EdgePartitionStrategy partition_strategy = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_partition_strategy(static_cast<::gie::EdgePartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .gie.PropertyPartitionStrategy property_partition_strategy = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .gie.Relation relation = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_relation(static_cast<::gie::Relation>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; - default: - goto handle_unusual; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* SrcDstPair::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* SrcDstPair::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:gie.SrcDstPair) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // string src_type = 1; - if (!this->_internal_src_type().empty()) { + if (this->src_type().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_src_type().data(), static_cast(this->_internal_src_type().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, @@ -1471,7 +1668,7 @@ uint8_t* SrcDstPair::_InternalSerialize( } // string dst_type = 2; - if (!this->_internal_dst_type().empty()) { + if (this->dst_type().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_dst_type().data(), static_cast(this->_internal_dst_type().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, @@ -1481,28 +1678,28 @@ uint8_t* SrcDstPair::_InternalSerialize( } // .gie.EdgePartitionStrategy partition_strategy = 3; - if (this->_internal_partition_strategy() != 0) { + if (this->partition_strategy() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 3, this->_internal_partition_strategy(), target); } // .gie.PropertyPartitionStrategy property_partition_strategy = 4; - if (this->_internal_property_partition_strategy() != 0) { + if (this->property_partition_strategy() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 4, this->_internal_property_partition_strategy(), target); } // .gie.Relation relation = 5; - if (this->_internal_relation() != 0) { + if (this->relation() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 5, this->_internal_relation(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:gie.SrcDstPair) @@ -1513,76 +1710,95 @@ size_t SrcDstPair::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:gie.SrcDstPair) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // string src_type = 1; - if (!this->_internal_src_type().empty()) { + if (this->src_type().size() > 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_src_type()); } // string dst_type = 2; - if (!this->_internal_dst_type().empty()) { + if (this->dst_type().size() > 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_dst_type()); } // .gie.EdgePartitionStrategy partition_strategy = 3; - if (this->_internal_partition_strategy() != 0) { + if (this->partition_strategy() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_partition_strategy()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_partition_strategy()); } // .gie.PropertyPartitionStrategy property_partition_strategy = 4; - if (this->_internal_property_partition_strategy() != 0) { + if (this->property_partition_strategy() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_property_partition_strategy()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_property_partition_strategy()); } // .gie.Relation relation = 5; - if (this->_internal_relation() != 0) { + if (this->relation() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_relation()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_relation()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData SrcDstPair::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - SrcDstPair::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*SrcDstPair::GetClassData() const { return &_class_data_; } - +void SrcDstPair::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:gie.SrcDstPair) + GOOGLE_DCHECK_NE(&from, this); + const SrcDstPair* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.SrcDstPair) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.SrcDstPair) + MergeFrom(*source); + } +} -void SrcDstPair::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:gie.SrcDstPair) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void SrcDstPair::MergeFrom(const SrcDstPair& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:gie.SrcDstPair) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_src_type().empty()) { - _this->_internal_set_src_type(from._internal_src_type()); + if (from.src_type().size() > 0) { + _internal_set_src_type(from._internal_src_type()); } - if (!from._internal_dst_type().empty()) { - _this->_internal_set_dst_type(from._internal_dst_type()); + if (from.dst_type().size() > 0) { + _internal_set_dst_type(from._internal_dst_type()); } - if (from._internal_partition_strategy() != 0) { - _this->_internal_set_partition_strategy(from._internal_partition_strategy()); + if (from.partition_strategy() != 0) { + _internal_set_partition_strategy(from._internal_partition_strategy()); } - if (from._internal_property_partition_strategy() != 0) { - _this->_internal_set_property_partition_strategy(from._internal_property_partition_strategy()); + if (from.property_partition_strategy() != 0) { + _internal_set_property_partition_strategy(from._internal_property_partition_strategy()); } - if (from._internal_relation() != 0) { - _this->_internal_set_relation(from._internal_relation()); + if (from.relation() != 0) { + _internal_set_relation(from._internal_relation()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void SrcDstPair::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:gie.SrcDstPair) + if (&from == this) return; + Clear(); + MergeFrom(from); } void SrcDstPair::CopyFrom(const SrcDstPair& from) { @@ -1598,184 +1814,165 @@ bool SrcDstPair::IsInitialized() const { void SrcDstPair::InternalSwap(SrcDstPair* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.src_type_, lhs_arena, - &other->_impl_.src_type_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.dst_type_, lhs_arena, - &other->_impl_.dst_type_, rhs_arena - ); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + src_type_.Swap(&other->src_type_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + dst_type_.Swap(&other->dst_type_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(SrcDstPair, _impl_.relation_) - + sizeof(SrcDstPair::_impl_.relation_) - - PROTOBUF_FIELD_OFFSET(SrcDstPair, _impl_.partition_strategy_)>( - reinterpret_cast(&_impl_.partition_strategy_), - reinterpret_cast(&other->_impl_.partition_strategy_)); + PROTOBUF_FIELD_OFFSET(SrcDstPair, relation_) + + sizeof(SrcDstPair::relation_) + - PROTOBUF_FIELD_OFFSET(SrcDstPair, partition_strategy_)>( + reinterpret_cast(&partition_strategy_), + reinterpret_cast(&other->partition_strategy_)); } ::PROTOBUF_NAMESPACE_ID::Metadata SrcDstPair::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, - file_level_metadata_gie_5fschema_2eproto[4]); + return GetMetadataStatic(); } + // =================================================================== +void Property::InitAsDefaultInstance() { +} class Property::_Internal { public: }; -Property::Property(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +Property::Property(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:gie.Property) } Property::Property(const Property& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - Property* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.name_){} - , decltype(_impl_.id_){} - , decltype(_impl_.type_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (!from._internal_name().empty()) { - _this->_impl_.name_.Set(from._internal_name(), - _this->GetArenaForAllocation()); + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(), + GetArena()); } - ::memcpy(&_impl_.id_, &from._impl_.id_, - static_cast(reinterpret_cast(&_impl_.type_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.type_)); + ::memcpy(&id_, &from.id_, + static_cast(reinterpret_cast(&type_) - + reinterpret_cast(&id_)) + sizeof(type_)); // @@protoc_insertion_point(copy_constructor:gie.Property) } -inline void Property::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.name_){} - , decltype(_impl_.id_){0u} - , decltype(_impl_.type_){0} - , /*decltype(_impl_._cached_size_)*/{} - }; - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +void Property::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Property_gie_5fschema_2eproto.base); + name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&id_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&id_)) + sizeof(type_)); } Property::~Property() { // @@protoc_insertion_point(destructor:gie.Property) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void Property::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.name_.Destroy(); +void Property::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } +void Property::ArenaDtor(void* object) { + Property* _this = reinterpret_cast< Property* >(object); + (void)_this; +} +void Property::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void Property::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); } +const Property& Property::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Property_gie_5fschema_2eproto.base); + return *internal_default_instance(); +} + void Property::Clear() { // @@protoc_insertion_point(message_clear_start:gie.Property) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.name_.ClearToEmpty(); - ::memset(&_impl_.id_, 0, static_cast( - reinterpret_cast(&_impl_.type_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.type_)); + name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::memset(&id_, 0, static_cast( + reinterpret_cast(&type_) - + reinterpret_cast(&id_)) + sizeof(type_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Property::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* Property::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // uint32 id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // string name = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { auto str = _internal_mutable_name(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.Property.name")); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "gie.Property.name")); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .gie.DataType type = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_type(static_cast<::gie::DataType>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* Property::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* Property::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:gie.Property) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // uint32 id = 1; - if (this->_internal_id() != 0) { + if (this->id() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); } // string name = 2; - if (!this->_internal_name().empty()) { + if (this->name().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_name().data(), static_cast(this->_internal_name().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, @@ -1785,14 +1982,14 @@ uint8_t* Property::_InternalSerialize( } // .gie.DataType type = 3; - if (this->_internal_type() != 0) { + if (this->type() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 3, this->_internal_type(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:gie.Property) @@ -1803,56 +2000,77 @@ size_t Property::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:gie.Property) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // string name = 2; - if (!this->_internal_name().empty()) { + if (this->name().size() > 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_name()); } // uint32 id = 1; - if (this->_internal_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_id()); + if (this->id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( + this->_internal_id()); } // .gie.DataType type = 3; - if (this->_internal_type() != 0) { + if (this->type() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_type()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Property::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Property::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Property::GetClassData() const { return &_class_data_; } - +void Property::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:gie.Property) + GOOGLE_DCHECK_NE(&from, this); + const Property* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.Property) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.Property) + MergeFrom(*source); + } +} -void Property::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:gie.Property) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void Property::MergeFrom(const Property& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:gie.Property) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (!from._internal_name().empty()) { - _this->_internal_set_name(from._internal_name()); + if (from.name().size() > 0) { + _internal_set_name(from._internal_name()); } - if (from._internal_id() != 0) { - _this->_internal_set_id(from._internal_id()); + if (from.id() != 0) { + _internal_set_id(from._internal_id()); } - if (from._internal_type() != 0) { - _this->_internal_set_type(from._internal_type()); + if (from.type() != 0) { + _internal_set_type(from._internal_type()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Property::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:gie.Property) + if (&from == this) return; + Clear(); + MergeFrom(from); } void Property::CopyFrom(const Property& from) { @@ -1868,149 +2086,129 @@ bool Property::IsInitialized() const { void Property::InternalSwap(Property* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena - ); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Property, _impl_.type_) - + sizeof(Property::_impl_.type_) - - PROTOBUF_FIELD_OFFSET(Property, _impl_.id_)>( - reinterpret_cast(&_impl_.id_), - reinterpret_cast(&other->_impl_.id_)); + PROTOBUF_FIELD_OFFSET(Property, type_) + + sizeof(Property::type_) + - PROTOBUF_FIELD_OFFSET(Property, id_)>( + reinterpret_cast(&id_), + reinterpret_cast(&other->id_)); } ::PROTOBUF_NAMESPACE_ID::Metadata Property::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, - file_level_metadata_gie_5fschema_2eproto[5]); + return GetMetadataStatic(); } + // =================================================================== +void VertexType::InitAsDefaultInstance() { +} class VertexType::_Internal { public: }; -VertexType::VertexType(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +VertexType::VertexType(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena), + properties_(arena), + primary_keys_(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:gie.VertexType) } VertexType::VertexType(const VertexType& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - VertexType* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.properties_){from._impl_.properties_} - , decltype(_impl_.primary_keys_){from._impl_.primary_keys_} - , decltype(_impl_.name_){} - , decltype(_impl_.id_){} - , decltype(_impl_.partition_strategy_){} - , decltype(_impl_.total_num_){} - , decltype(_impl_.property_partition_strategy_){} - , /*decltype(_impl_._cached_size_)*/{}}; - + : ::PROTOBUF_NAMESPACE_ID::Message(), + properties_(from.properties_), + primary_keys_(from.primary_keys_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (!from._internal_name().empty()) { - _this->_impl_.name_.Set(from._internal_name(), - _this->GetArenaForAllocation()); + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(), + GetArena()); } - ::memcpy(&_impl_.id_, &from._impl_.id_, - static_cast(reinterpret_cast(&_impl_.property_partition_strategy_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.property_partition_strategy_)); + ::memcpy(&id_, &from.id_, + static_cast(reinterpret_cast(&property_partition_strategy_) - + reinterpret_cast(&id_)) + sizeof(property_partition_strategy_)); // @@protoc_insertion_point(copy_constructor:gie.VertexType) } -inline void VertexType::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.properties_){arena} - , decltype(_impl_.primary_keys_){arena} - , decltype(_impl_.name_){} - , decltype(_impl_.id_){0u} - , decltype(_impl_.partition_strategy_){0} - , decltype(_impl_.total_num_){int64_t{0}} - , decltype(_impl_.property_partition_strategy_){0} - , /*decltype(_impl_._cached_size_)*/{} - }; - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +void VertexType::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_VertexType_gie_5fschema_2eproto.base); + name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&id_, 0, static_cast( + reinterpret_cast(&property_partition_strategy_) - + reinterpret_cast(&id_)) + sizeof(property_partition_strategy_)); } VertexType::~VertexType() { // @@protoc_insertion_point(destructor:gie.VertexType) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void VertexType::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.properties_.~RepeatedPtrField(); - _impl_.primary_keys_.~RepeatedPtrField(); - _impl_.name_.Destroy(); +void VertexType::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } +void VertexType::ArenaDtor(void* object) { + VertexType* _this = reinterpret_cast< VertexType* >(object); + (void)_this; +} +void VertexType::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void VertexType::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const VertexType& VertexType::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_VertexType_gie_5fschema_2eproto.base); + return *internal_default_instance(); } + void VertexType::Clear() { // @@protoc_insertion_point(message_clear_start:gie.VertexType) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.properties_.Clear(); - _impl_.primary_keys_.Clear(); - _impl_.name_.ClearToEmpty(); - ::memset(&_impl_.id_, 0, static_cast( - reinterpret_cast(&_impl_.property_partition_strategy_) - - reinterpret_cast(&_impl_.id_)) + sizeof(_impl_.property_partition_strategy_)); + properties_.Clear(); + primary_keys_.Clear(); + name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::memset(&id_, 0, static_cast( + reinterpret_cast(&property_partition_strategy_) - + reinterpret_cast(&id_)) + sizeof(property_partition_strategy_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* VertexType::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* VertexType::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // uint32 id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // string name = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { auto str = _internal_mutable_name(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.VertexType.name")); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "gie.VertexType.name")); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated .gie.Property properties = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -2018,87 +2216,81 @@ const char* VertexType::_InternalParse(const char* ptr, ::_pbi::ParseContext* ct CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated string primary_keys = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_primary_keys(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.VertexType.primary_keys")); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "gie.VertexType.primary_keys")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .gie.VertexPartitionStrategy partition_strategy = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_partition_strategy(static_cast<::gie::VertexPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .gie.PropertyPartitionStrategy property_partition_strategy = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // int64 total_num = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - _impl_.total_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + total_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* VertexType::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* VertexType::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:gie.VertexType) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // uint32 id = 1; - if (this->_internal_id() != 0) { + if (this->id() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); } // string name = 2; - if (!this->_internal_name().empty()) { + if (this->name().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_name().data(), static_cast(this->_internal_name().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, @@ -2108,11 +2300,11 @@ uint8_t* VertexType::_InternalSerialize( } // repeated .gie.Property properties = 3; - for (unsigned i = 0, - n = static_cast(this->_internal_properties_size()); i < n; i++) { - const auto& repfield = this->_internal_properties(i); + for (unsigned int i = 0, + n = static_cast(this->_internal_properties_size()); i < n; i++) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); + InternalWriteMessage(3, this->_internal_properties(i), target, stream); } // repeated string primary_keys = 4; @@ -2126,27 +2318,27 @@ uint8_t* VertexType::_InternalSerialize( } // .gie.VertexPartitionStrategy partition_strategy = 5; - if (this->_internal_partition_strategy() != 0) { + if (this->partition_strategy() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 5, this->_internal_partition_strategy(), target); } // .gie.PropertyPartitionStrategy property_partition_strategy = 6; - if (this->_internal_property_partition_strategy() != 0) { + if (this->property_partition_strategy() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 6, this->_internal_property_partition_strategy(), target); } // int64 total_num = 7; - if (this->_internal_total_num() != 0) { + if (this->total_num() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt64ToArray(7, this->_internal_total_num(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(7, this->_internal_total_num(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:gie.VertexType) @@ -2157,90 +2349,113 @@ size_t VertexType::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:gie.VertexType) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // repeated .gie.Property properties = 3; total_size += 1UL * this->_internal_properties_size(); - for (const auto& msg : this->_impl_.properties_) { + for (const auto& msg : this->properties_) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } // repeated string primary_keys = 4; total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.primary_keys_.size()); - for (int i = 0, n = _impl_.primary_keys_.size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(primary_keys_.size()); + for (int i = 0, n = primary_keys_.size(); i < n; i++) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - _impl_.primary_keys_.Get(i)); + primary_keys_.Get(i)); } // string name = 2; - if (!this->_internal_name().empty()) { + if (this->name().size() > 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_name()); } // uint32 id = 1; - if (this->_internal_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_id()); + if (this->id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( + this->_internal_id()); } // .gie.VertexPartitionStrategy partition_strategy = 5; - if (this->_internal_partition_strategy() != 0) { + if (this->partition_strategy() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_partition_strategy()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_partition_strategy()); } // int64 total_num = 7; - if (this->_internal_total_num() != 0) { - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_total_num()); + if (this->total_num() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_total_num()); } // .gie.PropertyPartitionStrategy property_partition_strategy = 6; - if (this->_internal_property_partition_strategy() != 0) { + if (this->property_partition_strategy() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_property_partition_strategy()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_property_partition_strategy()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData VertexType::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - VertexType::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*VertexType::GetClassData() const { return &_class_data_; } - +void VertexType::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:gie.VertexType) + GOOGLE_DCHECK_NE(&from, this); + const VertexType* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.VertexType) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.VertexType) + MergeFrom(*source); + } +} -void VertexType::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:gie.VertexType) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void VertexType::MergeFrom(const VertexType& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:gie.VertexType) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.properties_.MergeFrom(from._impl_.properties_); - _this->_impl_.primary_keys_.MergeFrom(from._impl_.primary_keys_); - if (!from._internal_name().empty()) { - _this->_internal_set_name(from._internal_name()); + properties_.MergeFrom(from.properties_); + primary_keys_.MergeFrom(from.primary_keys_); + if (from.name().size() > 0) { + _internal_set_name(from._internal_name()); } - if (from._internal_id() != 0) { - _this->_internal_set_id(from._internal_id()); + if (from.id() != 0) { + _internal_set_id(from._internal_id()); } - if (from._internal_partition_strategy() != 0) { - _this->_internal_set_partition_strategy(from._internal_partition_strategy()); + if (from.partition_strategy() != 0) { + _internal_set_partition_strategy(from._internal_partition_strategy()); } - if (from._internal_total_num() != 0) { - _this->_internal_set_total_num(from._internal_total_num()); + if (from.total_num() != 0) { + _internal_set_total_num(from._internal_total_num()); } - if (from._internal_property_partition_strategy() != 0) { - _this->_internal_set_property_partition_strategy(from._internal_property_partition_strategy()); + if (from.property_partition_strategy() != 0) { + _internal_set_property_partition_strategy(from._internal_property_partition_strategy()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void VertexType::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:gie.VertexType) + if (&from == this) return; + Clear(); + MergeFrom(from); } void VertexType::CopyFrom(const VertexType& from) { @@ -2256,151 +2471,134 @@ bool VertexType::IsInitialized() const { void VertexType::InternalSwap(VertexType* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.properties_.InternalSwap(&other->_impl_.properties_); - _impl_.primary_keys_.InternalSwap(&other->_impl_.primary_keys_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena - ); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + properties_.InternalSwap(&other->properties_); + primary_keys_.InternalSwap(&other->primary_keys_); + name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(VertexType, _impl_.property_partition_strategy_) - + sizeof(VertexType::_impl_.property_partition_strategy_) - - PROTOBUF_FIELD_OFFSET(VertexType, _impl_.id_)>( - reinterpret_cast(&_impl_.id_), - reinterpret_cast(&other->_impl_.id_)); + PROTOBUF_FIELD_OFFSET(VertexType, property_partition_strategy_) + + sizeof(VertexType::property_partition_strategy_) + - PROTOBUF_FIELD_OFFSET(VertexType, id_)>( + reinterpret_cast(&id_), + reinterpret_cast(&other->id_)); } ::PROTOBUF_NAMESPACE_ID::Metadata VertexType::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, - file_level_metadata_gie_5fschema_2eproto[6]); + return GetMetadataStatic(); } + // =================================================================== +void EdgeType::InitAsDefaultInstance() { +} class EdgeType::_Internal { public: }; -EdgeType::EdgeType(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +EdgeType::EdgeType(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena), + properties_(arena), + primary_keys_(arena), + src_dst_pairs_(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:gie.EdgeType) } EdgeType::EdgeType(const EdgeType& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - EdgeType* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.properties_){from._impl_.properties_} - , decltype(_impl_.primary_keys_){from._impl_.primary_keys_} - , decltype(_impl_.src_dst_pairs_){from._impl_.src_dst_pairs_} - , decltype(_impl_.name_){} - , decltype(_impl_.total_num_){} - , decltype(_impl_.id_){} - , /*decltype(_impl_._cached_size_)*/{}}; - + : ::PROTOBUF_NAMESPACE_ID::Message(), + properties_(from.properties_), + primary_keys_(from.primary_keys_), + src_dst_pairs_(from.src_dst_pairs_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (!from._internal_name().empty()) { - _this->_impl_.name_.Set(from._internal_name(), - _this->GetArenaForAllocation()); + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(), + GetArena()); } - ::memcpy(&_impl_.total_num_, &from._impl_.total_num_, - static_cast(reinterpret_cast(&_impl_.id_) - - reinterpret_cast(&_impl_.total_num_)) + sizeof(_impl_.id_)); + ::memcpy(&total_num_, &from.total_num_, + static_cast(reinterpret_cast(&id_) - + reinterpret_cast(&total_num_)) + sizeof(id_)); // @@protoc_insertion_point(copy_constructor:gie.EdgeType) } -inline void EdgeType::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.properties_){arena} - , decltype(_impl_.primary_keys_){arena} - , decltype(_impl_.src_dst_pairs_){arena} - , decltype(_impl_.name_){} - , decltype(_impl_.total_num_){int64_t{0}} - , decltype(_impl_.id_){0u} - , /*decltype(_impl_._cached_size_)*/{} - }; - _impl_.name_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.name_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +void EdgeType::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_EdgeType_gie_5fschema_2eproto.base); + name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&total_num_, 0, static_cast( + reinterpret_cast(&id_) - + reinterpret_cast(&total_num_)) + sizeof(id_)); } EdgeType::~EdgeType() { // @@protoc_insertion_point(destructor:gie.EdgeType) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void EdgeType::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.properties_.~RepeatedPtrField(); - _impl_.primary_keys_.~RepeatedPtrField(); - _impl_.src_dst_pairs_.~RepeatedPtrField(); - _impl_.name_.Destroy(); +void EdgeType::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } +void EdgeType::ArenaDtor(void* object) { + EdgeType* _this = reinterpret_cast< EdgeType* >(object); + (void)_this; +} +void EdgeType::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void EdgeType::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const EdgeType& EdgeType::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_EdgeType_gie_5fschema_2eproto.base); + return *internal_default_instance(); } + void EdgeType::Clear() { // @@protoc_insertion_point(message_clear_start:gie.EdgeType) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.properties_.Clear(); - _impl_.primary_keys_.Clear(); - _impl_.src_dst_pairs_.Clear(); - _impl_.name_.ClearToEmpty(); - ::memset(&_impl_.total_num_, 0, static_cast( - reinterpret_cast(&_impl_.id_) - - reinterpret_cast(&_impl_.total_num_)) + sizeof(_impl_.id_)); + properties_.Clear(); + primary_keys_.Clear(); + src_dst_pairs_.Clear(); + name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::memset(&total_num_, 0, static_cast( + reinterpret_cast(&id_) - + reinterpret_cast(&total_num_)) + sizeof(id_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* EdgeType::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* EdgeType::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // uint32 id = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // string name = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { auto str = _internal_mutable_name(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.EdgeType.name")); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "gie.EdgeType.name")); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated .gie.Property properties = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -2408,27 +2606,25 @@ const char* EdgeType::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated string primary_keys = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { ptr -= 1; do { ptr += 1; auto str = _internal_add_primary_keys(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.EdgeType.primary_keys")); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "gie.EdgeType.primary_keys")); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated .gie.SrcDstPair src_dst_pairs = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { ptr -= 1; do { ptr += 1; @@ -2436,54 +2632,51 @@ const char* EdgeType::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // int64 total_num = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - _impl_.total_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + total_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; - default: - goto handle_unusual; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* EdgeType::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* EdgeType::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:gie.EdgeType) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // uint32 id = 1; - if (this->_internal_id() != 0) { + if (this->id() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); } // string name = 2; - if (!this->_internal_name().empty()) { + if (this->name().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_name().data(), static_cast(this->_internal_name().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, @@ -2493,11 +2686,11 @@ uint8_t* EdgeType::_InternalSerialize( } // repeated .gie.Property properties = 3; - for (unsigned i = 0, - n = static_cast(this->_internal_properties_size()); i < n; i++) { - const auto& repfield = this->_internal_properties(i); + for (unsigned int i = 0, + n = static_cast(this->_internal_properties_size()); i < n; i++) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); + InternalWriteMessage(3, this->_internal_properties(i), target, stream); } // repeated string primary_keys = 4; @@ -2511,21 +2704,21 @@ uint8_t* EdgeType::_InternalSerialize( } // repeated .gie.SrcDstPair src_dst_pairs = 5; - for (unsigned i = 0, - n = static_cast(this->_internal_src_dst_pairs_size()); i < n; i++) { - const auto& repfield = this->_internal_src_dst_pairs(i); + for (unsigned int i = 0, + n = static_cast(this->_internal_src_dst_pairs_size()); i < n; i++) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, repfield, repfield.GetCachedSize(), target, stream); + InternalWriteMessage(5, this->_internal_src_dst_pairs(i), target, stream); } // int64 total_num = 6; - if (this->_internal_total_num() != 0) { + if (this->total_num() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt64ToArray(6, this->_internal_total_num(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->_internal_total_num(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:gie.EdgeType) @@ -2536,80 +2729,103 @@ size_t EdgeType::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:gie.EdgeType) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // repeated .gie.Property properties = 3; total_size += 1UL * this->_internal_properties_size(); - for (const auto& msg : this->_impl_.properties_) { + for (const auto& msg : this->properties_) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } // repeated string primary_keys = 4; total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.primary_keys_.size()); - for (int i = 0, n = _impl_.primary_keys_.size(); i < n; i++) { + ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(primary_keys_.size()); + for (int i = 0, n = primary_keys_.size(); i < n; i++) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - _impl_.primary_keys_.Get(i)); + primary_keys_.Get(i)); } // repeated .gie.SrcDstPair src_dst_pairs = 5; total_size += 1UL * this->_internal_src_dst_pairs_size(); - for (const auto& msg : this->_impl_.src_dst_pairs_) { + for (const auto& msg : this->src_dst_pairs_) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } // string name = 2; - if (!this->_internal_name().empty()) { + if (this->name().size() > 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_name()); } // int64 total_num = 6; - if (this->_internal_total_num() != 0) { - total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_total_num()); + if (this->total_num() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_total_num()); } // uint32 id = 1; - if (this->_internal_id() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_id()); + if (this->id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( + this->_internal_id()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EdgeType::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - EdgeType::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EdgeType::GetClassData() const { return &_class_data_; } - +void EdgeType::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:gie.EdgeType) + GOOGLE_DCHECK_NE(&from, this); + const EdgeType* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.EdgeType) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.EdgeType) + MergeFrom(*source); + } +} -void EdgeType::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:gie.EdgeType) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void EdgeType::MergeFrom(const EdgeType& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:gie.EdgeType) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.properties_.MergeFrom(from._impl_.properties_); - _this->_impl_.primary_keys_.MergeFrom(from._impl_.primary_keys_); - _this->_impl_.src_dst_pairs_.MergeFrom(from._impl_.src_dst_pairs_); - if (!from._internal_name().empty()) { - _this->_internal_set_name(from._internal_name()); + properties_.MergeFrom(from.properties_); + primary_keys_.MergeFrom(from.primary_keys_); + src_dst_pairs_.MergeFrom(from.src_dst_pairs_); + if (from.name().size() > 0) { + _internal_set_name(from._internal_name()); } - if (from._internal_total_num() != 0) { - _this->_internal_set_total_num(from._internal_total_num()); + if (from.total_num() != 0) { + _internal_set_total_num(from._internal_total_num()); } - if (from._internal_id() != 0) { - _this->_internal_set_id(from._internal_id()); + if (from.id() != 0) { + _internal_set_id(from._internal_id()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void EdgeType::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:gie.EdgeType) + if (&from == this) return; + Clear(); + MergeFrom(from); } void EdgeType::CopyFrom(const EdgeType& from) { @@ -2625,178 +2841,167 @@ bool EdgeType::IsInitialized() const { void EdgeType::InternalSwap(EdgeType* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.properties_.InternalSwap(&other->_impl_.properties_); - _impl_.primary_keys_.InternalSwap(&other->_impl_.primary_keys_); - _impl_.src_dst_pairs_.InternalSwap(&other->_impl_.src_dst_pairs_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.name_, lhs_arena, - &other->_impl_.name_, rhs_arena - ); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + properties_.InternalSwap(&other->properties_); + primary_keys_.InternalSwap(&other->primary_keys_); + src_dst_pairs_.InternalSwap(&other->src_dst_pairs_); + name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(EdgeType, _impl_.id_) - + sizeof(EdgeType::_impl_.id_) - - PROTOBUF_FIELD_OFFSET(EdgeType, _impl_.total_num_)>( - reinterpret_cast(&_impl_.total_num_), - reinterpret_cast(&other->_impl_.total_num_)); + PROTOBUF_FIELD_OFFSET(EdgeType, id_) + + sizeof(EdgeType::id_) + - PROTOBUF_FIELD_OFFSET(EdgeType, total_num_)>( + reinterpret_cast(&total_num_), + reinterpret_cast(&other->total_num_)); } ::PROTOBUF_NAMESPACE_ID::Metadata EdgeType::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, - file_level_metadata_gie_5fschema_2eproto[7]); + return GetMetadataStatic(); } + // =================================================================== +void Statistics::InitAsDefaultInstance() { +} class Statistics::_Internal { public: }; -Statistics::Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +Statistics::Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:gie.Statistics) } Statistics::Statistics(const Statistics& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - Statistics* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.num_vertices_){} - , decltype(_impl_.num_edges_){} - , decltype(_impl_.num_partitions_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.num_vertices_, &from._impl_.num_vertices_, - static_cast(reinterpret_cast(&_impl_.num_partitions_) - - reinterpret_cast(&_impl_.num_vertices_)) + sizeof(_impl_.num_partitions_)); + ::memcpy(&num_vertices_, &from.num_vertices_, + static_cast(reinterpret_cast(&num_partitions_) - + reinterpret_cast(&num_vertices_)) + sizeof(num_partitions_)); // @@protoc_insertion_point(copy_constructor:gie.Statistics) } -inline void Statistics::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.num_vertices_){uint64_t{0u}} - , decltype(_impl_.num_edges_){uint64_t{0u}} - , decltype(_impl_.num_partitions_){0u} - , /*decltype(_impl_._cached_size_)*/{} - }; +void Statistics::SharedCtor() { + ::memset(&num_vertices_, 0, static_cast( + reinterpret_cast(&num_partitions_) - + reinterpret_cast(&num_vertices_)) + sizeof(num_partitions_)); } Statistics::~Statistics() { // @@protoc_insertion_point(destructor:gie.Statistics) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void Statistics::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +void Statistics::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); } +void Statistics::ArenaDtor(void* object) { + Statistics* _this = reinterpret_cast< Statistics* >(object); + (void)_this; +} +void Statistics::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void Statistics::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const Statistics& Statistics::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Statistics_gie_5fschema_2eproto.base); + return *internal_default_instance(); } + void Statistics::Clear() { // @@protoc_insertion_point(message_clear_start:gie.Statistics) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - ::memset(&_impl_.num_vertices_, 0, static_cast( - reinterpret_cast(&_impl_.num_partitions_) - - reinterpret_cast(&_impl_.num_vertices_)) + sizeof(_impl_.num_partitions_)); + ::memset(&num_vertices_, 0, static_cast( + reinterpret_cast(&num_partitions_) - + reinterpret_cast(&num_vertices_)) + sizeof(num_partitions_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Statistics::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* Statistics::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // uint32 num_partitions = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.num_partitions_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + num_partitions_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // uint64 num_vertices = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _impl_.num_vertices_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + num_vertices_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // uint64 num_edges = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - _impl_.num_edges_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + num_edges_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* Statistics::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* Statistics::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:gie.Statistics) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // uint32 num_partitions = 1; - if (this->_internal_num_partitions() != 0) { + if (this->num_partitions() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_num_partitions(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_num_partitions(), target); } // uint64 num_vertices = 2; - if (this->_internal_num_vertices() != 0) { + if (this->num_vertices() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_num_vertices(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->_internal_num_vertices(), target); } // uint64 num_edges = 3; - if (this->_internal_num_edges() != 0) { + if (this->num_edges() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_num_edges(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(3, this->_internal_num_edges(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:gie.Statistics) @@ -2807,53 +3012,78 @@ size_t Statistics::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:gie.Statistics) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // uint64 num_vertices = 2; - if (this->_internal_num_vertices() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_num_vertices()); + if (this->num_vertices() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_num_vertices()); } // uint64 num_edges = 3; - if (this->_internal_num_edges() != 0) { - total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_num_edges()); + if (this->num_edges() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_num_edges()); } // uint32 num_partitions = 1; - if (this->_internal_num_partitions() != 0) { - total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_num_partitions()); + if (this->num_partitions() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( + this->_internal_num_partitions()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Statistics::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Statistics::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Statistics::GetClassData() const { return &_class_data_; } - +void Statistics::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:gie.Statistics) + GOOGLE_DCHECK_NE(&from, this); + const Statistics* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.Statistics) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.Statistics) + MergeFrom(*source); + } +} -void Statistics::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:gie.Statistics) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void Statistics::MergeFrom(const Statistics& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:gie.Statistics) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_num_vertices() != 0) { - _this->_internal_set_num_vertices(from._internal_num_vertices()); + if (from.num_vertices() != 0) { + _internal_set_num_vertices(from._internal_num_vertices()); } - if (from._internal_num_edges() != 0) { - _this->_internal_set_num_edges(from._internal_num_edges()); + if (from.num_edges() != 0) { + _internal_set_num_edges(from._internal_num_edges()); } - if (from._internal_num_partitions() != 0) { - _this->_internal_set_num_partitions(from._internal_num_partitions()); + if (from.num_partitions() != 0) { + _internal_set_num_partitions(from._internal_num_partitions()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Statistics::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:gie.Statistics) + if (&from == this) return; + Clear(); + MergeFrom(from); } void Statistics::CopyFrom(const Statistics& from) { @@ -2869,23 +3099,28 @@ bool Statistics::IsInitialized() const { void Statistics::InternalSwap(Statistics* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Statistics, _impl_.num_partitions_) - + sizeof(Statistics::_impl_.num_partitions_) - - PROTOBUF_FIELD_OFFSET(Statistics, _impl_.num_vertices_)>( - reinterpret_cast(&_impl_.num_vertices_), - reinterpret_cast(&other->_impl_.num_vertices_)); + PROTOBUF_FIELD_OFFSET(Statistics, num_partitions_) + + sizeof(Statistics::num_partitions_) + - PROTOBUF_FIELD_OFFSET(Statistics, num_vertices_)>( + reinterpret_cast(&num_vertices_), + reinterpret_cast(&other->num_vertices_)); } ::PROTOBUF_NAMESPACE_ID::Metadata Statistics::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, - file_level_metadata_gie_5fschema_2eproto[8]); + return GetMetadataStatic(); } + // =================================================================== +void Schema::InitAsDefaultInstance() { + ::gie::_Schema_default_instance_._instance.get_mutable()->partition_strategy_ = const_cast< ::gie::GraphPartitionStrategy*>( + ::gie::GraphPartitionStrategy::internal_default_instance()); + ::gie::_Schema_default_instance_._instance.get_mutable()->statistics_ = const_cast< ::gie::Statistics*>( + ::gie::Statistics::internal_default_instance()); +} class Schema::_Internal { public: static const ::gie::GraphPartitionStrategy& partition_strategy(const Schema* msg); @@ -2894,108 +3129,109 @@ class Schema::_Internal { const ::gie::GraphPartitionStrategy& Schema::_Internal::partition_strategy(const Schema* msg) { - return *msg->_impl_.partition_strategy_; + return *msg->partition_strategy_; } const ::gie::Statistics& Schema::_Internal::statistics(const Schema* msg) { - return *msg->_impl_.statistics_; -} -Schema::Schema(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); + return *msg->statistics_; +} +Schema::Schema(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena), + vertex_types_(arena), + edge_types_(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:gie.Schema) } Schema::Schema(const Schema& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - Schema* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.vertex_types_){from._impl_.vertex_types_} - , decltype(_impl_.edge_types_){from._impl_.edge_types_} - , decltype(_impl_.partition_strategy_){nullptr} - , decltype(_impl_.statistics_){nullptr} - , /*decltype(_impl_._cached_size_)*/{}}; - + : ::PROTOBUF_NAMESPACE_ID::Message(), + vertex_types_(from.vertex_types_), + edge_types_(from.edge_types_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); if (from._internal_has_partition_strategy()) { - _this->_impl_.partition_strategy_ = new ::gie::GraphPartitionStrategy(*from._impl_.partition_strategy_); + partition_strategy_ = new ::gie::GraphPartitionStrategy(*from.partition_strategy_); + } else { + partition_strategy_ = nullptr; } if (from._internal_has_statistics()) { - _this->_impl_.statistics_ = new ::gie::Statistics(*from._impl_.statistics_); + statistics_ = new ::gie::Statistics(*from.statistics_); + } else { + statistics_ = nullptr; } // @@protoc_insertion_point(copy_constructor:gie.Schema) } -inline void Schema::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.vertex_types_){arena} - , decltype(_impl_.edge_types_){arena} - , decltype(_impl_.partition_strategy_){nullptr} - , decltype(_impl_.statistics_){nullptr} - , /*decltype(_impl_._cached_size_)*/{} - }; +void Schema::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Schema_gie_5fschema_2eproto.base); + ::memset(&partition_strategy_, 0, static_cast( + reinterpret_cast(&statistics_) - + reinterpret_cast(&partition_strategy_)) + sizeof(statistics_)); } Schema::~Schema() { // @@protoc_insertion_point(destructor:gie.Schema) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void Schema::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.vertex_types_.~RepeatedPtrField(); - _impl_.edge_types_.~RepeatedPtrField(); - if (this != internal_default_instance()) delete _impl_.partition_strategy_; - if (this != internal_default_instance()) delete _impl_.statistics_; +void Schema::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + if (this != internal_default_instance()) delete partition_strategy_; + if (this != internal_default_instance()) delete statistics_; } +void Schema::ArenaDtor(void* object) { + Schema* _this = reinterpret_cast< Schema* >(object); + (void)_this; +} +void Schema::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void Schema::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const Schema& Schema::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Schema_gie_5fschema_2eproto.base); + return *internal_default_instance(); } + void Schema::Clear() { // @@protoc_insertion_point(message_clear_start:gie.Schema) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.vertex_types_.Clear(); - _impl_.edge_types_.Clear(); - if (GetArenaForAllocation() == nullptr && _impl_.partition_strategy_ != nullptr) { - delete _impl_.partition_strategy_; + vertex_types_.Clear(); + edge_types_.Clear(); + if (GetArena() == nullptr && partition_strategy_ != nullptr) { + delete partition_strategy_; } - _impl_.partition_strategy_ = nullptr; - if (GetArenaForAllocation() == nullptr && _impl_.statistics_ != nullptr) { - delete _impl_.statistics_; + partition_strategy_ = nullptr; + if (GetArena() == nullptr && statistics_ != nullptr) { + delete statistics_; } - _impl_.statistics_ = nullptr; + statistics_ = nullptr; _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Schema::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* Schema::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // .gie.GraphPartitionStrategy partition_strategy = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_partition_strategy(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated .gie.VertexType vertex_types = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { ptr -= 1; do { ptr += 1; @@ -3003,12 +3239,11 @@ const char* Schema::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated .gie.EdgeType edge_types = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -3016,78 +3251,77 @@ const char* Schema::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .gie.Statistics statistics = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_statistics(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* Schema::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* Schema::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:gie.Schema) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // .gie.GraphPartitionStrategy partition_strategy = 1; - if (this->_internal_has_partition_strategy()) { + if (this->has_partition_strategy()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::partition_strategy(this), - _Internal::partition_strategy(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 1, _Internal::partition_strategy(this), target, stream); } // repeated .gie.VertexType vertex_types = 2; - for (unsigned i = 0, - n = static_cast(this->_internal_vertex_types_size()); i < n; i++) { - const auto& repfield = this->_internal_vertex_types(i); + for (unsigned int i = 0, + n = static_cast(this->_internal_vertex_types_size()); i < n; i++) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream); + InternalWriteMessage(2, this->_internal_vertex_types(i), target, stream); } // repeated .gie.EdgeType edge_types = 3; - for (unsigned i = 0, - n = static_cast(this->_internal_edge_types_size()); i < n; i++) { - const auto& repfield = this->_internal_edge_types(i); + for (unsigned int i = 0, + n = static_cast(this->_internal_edge_types_size()); i < n; i++) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); + InternalWriteMessage(3, this->_internal_edge_types(i), target, stream); } // .gie.Statistics statistics = 4; - if (this->_internal_has_statistics()) { + if (this->has_statistics()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::statistics(this), - _Internal::statistics(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 4, _Internal::statistics(this), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:gie.Schema) @@ -3098,67 +3332,84 @@ size_t Schema::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:gie.Schema) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // repeated .gie.VertexType vertex_types = 2; total_size += 1UL * this->_internal_vertex_types_size(); - for (const auto& msg : this->_impl_.vertex_types_) { + for (const auto& msg : this->vertex_types_) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } // repeated .gie.EdgeType edge_types = 3; total_size += 1UL * this->_internal_edge_types_size(); - for (const auto& msg : this->_impl_.edge_types_) { + for (const auto& msg : this->edge_types_) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } // .gie.GraphPartitionStrategy partition_strategy = 1; - if (this->_internal_has_partition_strategy()) { + if (this->has_partition_strategy()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.partition_strategy_); + *partition_strategy_); } // .gie.Statistics statistics = 4; - if (this->_internal_has_statistics()) { + if (this->has_statistics()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.statistics_); + *statistics_); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Schema::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Schema::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Schema::GetClassData() const { return &_class_data_; } - +void Schema::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:gie.Schema) + GOOGLE_DCHECK_NE(&from, this); + const Schema* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.Schema) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.Schema) + MergeFrom(*source); + } +} -void Schema::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:gie.Schema) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void Schema::MergeFrom(const Schema& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:gie.Schema) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.vertex_types_.MergeFrom(from._impl_.vertex_types_); - _this->_impl_.edge_types_.MergeFrom(from._impl_.edge_types_); - if (from._internal_has_partition_strategy()) { - _this->_internal_mutable_partition_strategy()->::gie::GraphPartitionStrategy::MergeFrom( - from._internal_partition_strategy()); + vertex_types_.MergeFrom(from.vertex_types_); + edge_types_.MergeFrom(from.edge_types_); + if (from.has_partition_strategy()) { + _internal_mutable_partition_strategy()->::gie::GraphPartitionStrategy::MergeFrom(from._internal_partition_strategy()); } - if (from._internal_has_statistics()) { - _this->_internal_mutable_statistics()->::gie::Statistics::MergeFrom( - from._internal_statistics()); + if (from.has_statistics()) { + _internal_mutable_statistics()->::gie::Statistics::MergeFrom(from._internal_statistics()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Schema::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:gie.Schema) + if (&from == this) return; + Clear(); + MergeFrom(from); } void Schema::CopyFrom(const Schema& from) { @@ -3174,64 +3425,53 @@ bool Schema::IsInitialized() const { void Schema::InternalSwap(Schema* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.vertex_types_.InternalSwap(&other->_impl_.vertex_types_); - _impl_.edge_types_.InternalSwap(&other->_impl_.edge_types_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + vertex_types_.InternalSwap(&other->vertex_types_); + edge_types_.InternalSwap(&other->edge_types_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Schema, _impl_.statistics_) - + sizeof(Schema::_impl_.statistics_) - - PROTOBUF_FIELD_OFFSET(Schema, _impl_.partition_strategy_)>( - reinterpret_cast(&_impl_.partition_strategy_), - reinterpret_cast(&other->_impl_.partition_strategy_)); + PROTOBUF_FIELD_OFFSET(Schema, statistics_) + + sizeof(Schema::statistics_) + - PROTOBUF_FIELD_OFFSET(Schema, partition_strategy_)>( + reinterpret_cast(&partition_strategy_), + reinterpret_cast(&other->partition_strategy_)); } ::PROTOBUF_NAMESPACE_ID::Metadata Schema::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_gie_5fschema_2eproto_getter, &descriptor_table_gie_5fschema_2eproto_once, - file_level_metadata_gie_5fschema_2eproto[9]); + return GetMetadataStatic(); } + // @@protoc_insertion_point(namespace_scope) } // namespace gie PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::gie::PropertyPartitionByEntityStrategy* -Arena::CreateMaybeMessage< ::gie::PropertyPartitionByEntityStrategy >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::gie::PropertyPartitionByEntityStrategy* Arena::CreateMaybeMessage< ::gie::PropertyPartitionByEntityStrategy >(Arena* arena) { return Arena::CreateMessageInternal< ::gie::PropertyPartitionByEntityStrategy >(arena); } -template<> PROTOBUF_NOINLINE ::gie::PropertyPartitionByTypeStrategy* -Arena::CreateMaybeMessage< ::gie::PropertyPartitionByTypeStrategy >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::gie::PropertyPartitionByTypeStrategy* Arena::CreateMaybeMessage< ::gie::PropertyPartitionByTypeStrategy >(Arena* arena) { return Arena::CreateMessageInternal< ::gie::PropertyPartitionByTypeStrategy >(arena); } -template<> PROTOBUF_NOINLINE ::gie::GraphPropertyPartitionStrategy* -Arena::CreateMaybeMessage< ::gie::GraphPropertyPartitionStrategy >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::gie::GraphPropertyPartitionStrategy* Arena::CreateMaybeMessage< ::gie::GraphPropertyPartitionStrategy >(Arena* arena) { return Arena::CreateMessageInternal< ::gie::GraphPropertyPartitionStrategy >(arena); } -template<> PROTOBUF_NOINLINE ::gie::GraphPartitionStrategy* -Arena::CreateMaybeMessage< ::gie::GraphPartitionStrategy >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::gie::GraphPartitionStrategy* Arena::CreateMaybeMessage< ::gie::GraphPartitionStrategy >(Arena* arena) { return Arena::CreateMessageInternal< ::gie::GraphPartitionStrategy >(arena); } -template<> PROTOBUF_NOINLINE ::gie::SrcDstPair* -Arena::CreateMaybeMessage< ::gie::SrcDstPair >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::gie::SrcDstPair* Arena::CreateMaybeMessage< ::gie::SrcDstPair >(Arena* arena) { return Arena::CreateMessageInternal< ::gie::SrcDstPair >(arena); } -template<> PROTOBUF_NOINLINE ::gie::Property* -Arena::CreateMaybeMessage< ::gie::Property >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::gie::Property* Arena::CreateMaybeMessage< ::gie::Property >(Arena* arena) { return Arena::CreateMessageInternal< ::gie::Property >(arena); } -template<> PROTOBUF_NOINLINE ::gie::VertexType* -Arena::CreateMaybeMessage< ::gie::VertexType >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::gie::VertexType* Arena::CreateMaybeMessage< ::gie::VertexType >(Arena* arena) { return Arena::CreateMessageInternal< ::gie::VertexType >(arena); } -template<> PROTOBUF_NOINLINE ::gie::EdgeType* -Arena::CreateMaybeMessage< ::gie::EdgeType >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::gie::EdgeType* Arena::CreateMaybeMessage< ::gie::EdgeType >(Arena* arena) { return Arena::CreateMessageInternal< ::gie::EdgeType >(arena); } -template<> PROTOBUF_NOINLINE ::gie::Statistics* -Arena::CreateMaybeMessage< ::gie::Statistics >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::gie::Statistics* Arena::CreateMaybeMessage< ::gie::Statistics >(Arena* arena) { return Arena::CreateMessageInternal< ::gie::Statistics >(arena); } -template<> PROTOBUF_NOINLINE ::gie::Schema* -Arena::CreateMaybeMessage< ::gie::Schema >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::gie::Schema* Arena::CreateMaybeMessage< ::gie::Schema >(Arena* arena) { return Arena::CreateMessageInternal< ::gie::Schema >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/modules/graph/grin/src/proto/gie_schema.pb.h b/modules/graph/grin/src/proto/gie_schema.pb.h index befb7f6d2..ebf345753 100644 --- a/modules/graph/grin/src/proto/gie_schema.pb.h +++ b/modules/graph/grin/src/proto/gie_schema.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3021000 +#if PROTOBUF_VERSION < 3012000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#if 3012004 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,8 +23,9 @@ #include #include #include -#include +#include #include +#include #include #include #include @@ -43,39 +44,47 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_gie_5fschema_2eproto { - static const uint32_t offsets[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[10] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; + static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_gie_5fschema_2eproto; namespace gie { class EdgeType; -struct EdgeTypeDefaultTypeInternal; +class EdgeTypeDefaultTypeInternal; extern EdgeTypeDefaultTypeInternal _EdgeType_default_instance_; class GraphPartitionStrategy; -struct GraphPartitionStrategyDefaultTypeInternal; +class GraphPartitionStrategyDefaultTypeInternal; extern GraphPartitionStrategyDefaultTypeInternal _GraphPartitionStrategy_default_instance_; class GraphPropertyPartitionStrategy; -struct GraphPropertyPartitionStrategyDefaultTypeInternal; +class GraphPropertyPartitionStrategyDefaultTypeInternal; extern GraphPropertyPartitionStrategyDefaultTypeInternal _GraphPropertyPartitionStrategy_default_instance_; class Property; -struct PropertyDefaultTypeInternal; +class PropertyDefaultTypeInternal; extern PropertyDefaultTypeInternal _Property_default_instance_; class PropertyPartitionByEntityStrategy; -struct PropertyPartitionByEntityStrategyDefaultTypeInternal; +class PropertyPartitionByEntityStrategyDefaultTypeInternal; extern PropertyPartitionByEntityStrategyDefaultTypeInternal _PropertyPartitionByEntityStrategy_default_instance_; class PropertyPartitionByTypeStrategy; -struct PropertyPartitionByTypeStrategyDefaultTypeInternal; +class PropertyPartitionByTypeStrategyDefaultTypeInternal; extern PropertyPartitionByTypeStrategyDefaultTypeInternal _PropertyPartitionByTypeStrategy_default_instance_; class Schema; -struct SchemaDefaultTypeInternal; +class SchemaDefaultTypeInternal; extern SchemaDefaultTypeInternal _Schema_default_instance_; class SrcDstPair; -struct SrcDstPairDefaultTypeInternal; +class SrcDstPairDefaultTypeInternal; extern SrcDstPairDefaultTypeInternal _SrcDstPair_default_instance_; class Statistics; -struct StatisticsDefaultTypeInternal; +class StatisticsDefaultTypeInternal; extern StatisticsDefaultTypeInternal _Statistics_default_instance_; class VertexType; -struct VertexTypeDefaultTypeInternal; +class VertexTypeDefaultTypeInternal; extern VertexTypeDefaultTypeInternal _VertexType_default_instance_; } // namespace gie PROTOBUF_NAMESPACE_OPEN @@ -97,8 +106,8 @@ enum VertexPartitionStrategy : int { VPS_ALL = 1, VPS_ONE = 2, VPS_FOLLOW_EDGE = 3, - VertexPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - VertexPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + VertexPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + VertexPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() }; bool VertexPartitionStrategy_IsValid(int value); constexpr VertexPartitionStrategy VertexPartitionStrategy_MIN = VPS_UNDEFINED; @@ -115,7 +124,7 @@ inline const std::string& VertexPartitionStrategy_Name(T enum_t_value) { VertexPartitionStrategy_descriptor(), enum_t_value); } inline bool VertexPartitionStrategy_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, VertexPartitionStrategy* value) { + const std::string& name, VertexPartitionStrategy* value) { return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( VertexPartitionStrategy_descriptor(), name, value); } @@ -126,8 +135,8 @@ enum EdgePartitionStrategy : int { EPS_FOLLOW_SRC = 3, EPS_FOLLOW_DST = 4, EPS_FOLLOW_BOTH = 5, - EdgePartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - EdgePartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + EdgePartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + EdgePartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() }; bool EdgePartitionStrategy_IsValid(int value); constexpr EdgePartitionStrategy EdgePartitionStrategy_MIN = EPS_UNDEFINED; @@ -144,7 +153,7 @@ inline const std::string& EdgePartitionStrategy_Name(T enum_t_value) { EdgePartitionStrategy_descriptor(), enum_t_value); } inline bool EdgePartitionStrategy_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, EdgePartitionStrategy* value) { + const std::string& name, EdgePartitionStrategy* value) { return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( EdgePartitionStrategy_descriptor(), name, value); } @@ -152,8 +161,8 @@ enum PropertyPartitionStrategy : int { PPS_UNDEFINED = 0, PPS_MASTER = 1, PPS_MASTER_MIRROR = 2, - PropertyPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - PropertyPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + PropertyPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + PropertyPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() }; bool PropertyPartitionStrategy_IsValid(int value); constexpr PropertyPartitionStrategy PropertyPartitionStrategy_MIN = PPS_UNDEFINED; @@ -170,7 +179,7 @@ inline const std::string& PropertyPartitionStrategy_Name(T enum_t_value) { PropertyPartitionStrategy_descriptor(), enum_t_value); } inline bool PropertyPartitionStrategy_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PropertyPartitionStrategy* value) { + const std::string& name, PropertyPartitionStrategy* value) { return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( PropertyPartitionStrategy_descriptor(), name, value); } @@ -182,8 +191,8 @@ enum GraphTopologyPartitionStrategy : int { GPS_EDGE_CUT_FOLLOW_DST = 4, GPS_VERTEX_CUT = 5, GPS_HYBRID = 6, - GraphTopologyPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - GraphTopologyPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + GraphTopologyPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + GraphTopologyPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() }; bool GraphTopologyPartitionStrategy_IsValid(int value); constexpr GraphTopologyPartitionStrategy GraphTopologyPartitionStrategy_MIN = GPS_UNDEFINED; @@ -200,7 +209,7 @@ inline const std::string& GraphTopologyPartitionStrategy_Name(T enum_t_value) { GraphTopologyPartitionStrategy_descriptor(), enum_t_value); } inline bool GraphTopologyPartitionStrategy_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GraphTopologyPartitionStrategy* value) { + const std::string& name, GraphTopologyPartitionStrategy* value) { return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( GraphTopologyPartitionStrategy_descriptor(), name, value); } @@ -210,8 +219,8 @@ enum Relation : int { MANY_TO_ONE = 2, ONE_TO_MANY = 3, ONE_TO_ONE = 4, - Relation_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - Relation_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + Relation_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + Relation_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() }; bool Relation_IsValid(int value); constexpr Relation Relation_MIN = REL_UNDEFINED; @@ -228,7 +237,7 @@ inline const std::string& Relation_Name(T enum_t_value) { Relation_descriptor(), enum_t_value); } inline bool Relation_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, Relation* value) { + const std::string& name, Relation* value) { return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( Relation_descriptor(), name, value); } @@ -244,8 +253,8 @@ enum DataType : int { DT_DATE = 8, DT_TIME = 9, DT_TIMESTAMP = 10, - DataType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - DataType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + DataType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + DataType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() }; bool DataType_IsValid(int value); constexpr DataType DataType_MIN = DT_UNKNOWN; @@ -262,18 +271,17 @@ inline const std::string& DataType_Name(T enum_t_value) { DataType_descriptor(), enum_t_value); } inline bool DataType_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, DataType* value) { + const std::string& name, DataType* value) { return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( DataType_descriptor(), name, value); } // =================================================================== -class PropertyPartitionByEntityStrategy final : +class PropertyPartitionByEntityStrategy PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.PropertyPartitionByEntityStrategy) */ { public: - inline PropertyPartitionByEntityStrategy() : PropertyPartitionByEntityStrategy(nullptr) {} - ~PropertyPartitionByEntityStrategy() override; - explicit PROTOBUF_CONSTEXPR PropertyPartitionByEntityStrategy(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline PropertyPartitionByEntityStrategy() : PropertyPartitionByEntityStrategy(nullptr) {}; + virtual ~PropertyPartitionByEntityStrategy(); PropertyPartitionByEntityStrategy(const PropertyPartitionByEntityStrategy& from); PropertyPartitionByEntityStrategy(PropertyPartitionByEntityStrategy&& from) noexcept @@ -286,13 +294,8 @@ class PropertyPartitionByEntityStrategy final : return *this; } inline PropertyPartitionByEntityStrategy& operator=(PropertyPartitionByEntityStrategy&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -303,14 +306,14 @@ class PropertyPartitionByEntityStrategy final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const PropertyPartitionByEntityStrategy& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const PropertyPartitionByEntityStrategy& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const PropertyPartitionByEntityStrategy* internal_default_instance() { return reinterpret_cast( &_PropertyPartitionByEntityStrategy_default_instance_); @@ -323,12 +326,7 @@ class PropertyPartitionByEntityStrategy final : } inline void Swap(PropertyPartitionByEntityStrategy* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -336,53 +334,56 @@ class PropertyPartitionByEntityStrategy final : } void UnsafeArenaSwap(PropertyPartitionByEntityStrategy* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - PropertyPartitionByEntityStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline PropertyPartitionByEntityStrategy* New() const final { + return CreateMaybeMessage(nullptr); + } + + PropertyPartitionByEntityStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const PropertyPartitionByEntityStrategy& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const PropertyPartitionByEntityStrategy& from) { - PropertyPartitionByEntityStrategy::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const PropertyPartitionByEntityStrategy& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(PropertyPartitionByEntityStrategy* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "gie.PropertyPartitionByEntityStrategy"; } protected: - explicit PropertyPartitionByEntityStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit PropertyPartitionByEntityStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); + return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -417,21 +418,18 @@ class PropertyPartitionByEntityStrategy final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - int vertex_property_partition_strategy_; - int edge_property_partition_strategy_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + int vertex_property_partition_strategy_; + int edge_property_partition_strategy_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_gie_5fschema_2eproto; }; // ------------------------------------------------------------------- -class PropertyPartitionByTypeStrategy final : - public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:gie.PropertyPartitionByTypeStrategy) */ { +class PropertyPartitionByTypeStrategy PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.PropertyPartitionByTypeStrategy) */ { public: - inline PropertyPartitionByTypeStrategy() : PropertyPartitionByTypeStrategy(nullptr) {} - explicit PROTOBUF_CONSTEXPR PropertyPartitionByTypeStrategy(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline PropertyPartitionByTypeStrategy() : PropertyPartitionByTypeStrategy(nullptr) {}; + virtual ~PropertyPartitionByTypeStrategy(); PropertyPartitionByTypeStrategy(const PropertyPartitionByTypeStrategy& from); PropertyPartitionByTypeStrategy(PropertyPartitionByTypeStrategy&& from) noexcept @@ -444,13 +442,8 @@ class PropertyPartitionByTypeStrategy final : return *this; } inline PropertyPartitionByTypeStrategy& operator=(PropertyPartitionByTypeStrategy&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -461,14 +454,14 @@ class PropertyPartitionByTypeStrategy final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const PropertyPartitionByTypeStrategy& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const PropertyPartitionByTypeStrategy& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const PropertyPartitionByTypeStrategy* internal_default_instance() { return reinterpret_cast( &_PropertyPartitionByTypeStrategy_default_instance_); @@ -481,12 +474,7 @@ class PropertyPartitionByTypeStrategy final : } inline void Swap(PropertyPartitionByTypeStrategy* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -494,39 +482,56 @@ class PropertyPartitionByTypeStrategy final : } void UnsafeArenaSwap(PropertyPartitionByTypeStrategy* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - PropertyPartitionByTypeStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; - inline void CopyFrom(const PropertyPartitionByTypeStrategy& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); + inline PropertyPartitionByTypeStrategy* New() const final { + return CreateMaybeMessage(nullptr); } - using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; - void MergeFrom(const PropertyPartitionByTypeStrategy& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); + + PropertyPartitionByTypeStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); } - public: + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const PropertyPartitionByTypeStrategy& from); + void MergeFrom(const PropertyPartitionByTypeStrategy& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PropertyPartitionByTypeStrategy* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "gie.PropertyPartitionByTypeStrategy"; } protected: - explicit PropertyPartitionByTypeStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit PropertyPartitionByTypeStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); + return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -539,18 +544,16 @@ class PropertyPartitionByTypeStrategy final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - }; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_gie_5fschema_2eproto; }; // ------------------------------------------------------------------- -class GraphPropertyPartitionStrategy final : +class GraphPropertyPartitionStrategy PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.GraphPropertyPartitionStrategy) */ { public: - inline GraphPropertyPartitionStrategy() : GraphPropertyPartitionStrategy(nullptr) {} - ~GraphPropertyPartitionStrategy() override; - explicit PROTOBUF_CONSTEXPR GraphPropertyPartitionStrategy(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GraphPropertyPartitionStrategy() : GraphPropertyPartitionStrategy(nullptr) {}; + virtual ~GraphPropertyPartitionStrategy(); GraphPropertyPartitionStrategy(const GraphPropertyPartitionStrategy& from); GraphPropertyPartitionStrategy(GraphPropertyPartitionStrategy&& from) noexcept @@ -563,13 +566,8 @@ class GraphPropertyPartitionStrategy final : return *this; } inline GraphPropertyPartitionStrategy& operator=(GraphPropertyPartitionStrategy&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -580,20 +578,20 @@ class GraphPropertyPartitionStrategy final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const GraphPropertyPartitionStrategy& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const GraphPropertyPartitionStrategy& default_instance(); + enum ItemCase { kByEntity = 1, kByType = 2, ITEM_NOT_SET = 0, }; + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const GraphPropertyPartitionStrategy* internal_default_instance() { return reinterpret_cast( &_GraphPropertyPartitionStrategy_default_instance_); @@ -606,12 +604,7 @@ class GraphPropertyPartitionStrategy final : } inline void Swap(GraphPropertyPartitionStrategy* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -619,53 +612,56 @@ class GraphPropertyPartitionStrategy final : } void UnsafeArenaSwap(GraphPropertyPartitionStrategy* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - GraphPropertyPartitionStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline GraphPropertyPartitionStrategy* New() const final { + return CreateMaybeMessage(nullptr); + } + + GraphPropertyPartitionStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const GraphPropertyPartitionStrategy& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const GraphPropertyPartitionStrategy& from) { - GraphPropertyPartitionStrategy::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const GraphPropertyPartitionStrategy& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(GraphPropertyPartitionStrategy* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "gie.GraphPropertyPartitionStrategy"; } protected: - explicit GraphPropertyPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit GraphPropertyPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); + return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -682,7 +678,7 @@ class GraphPropertyPartitionStrategy final : public: void clear_by_entity(); const ::gie::PropertyPartitionByEntityStrategy& by_entity() const; - PROTOBUF_NODISCARD ::gie::PropertyPartitionByEntityStrategy* release_by_entity(); + ::gie::PropertyPartitionByEntityStrategy* release_by_entity(); ::gie::PropertyPartitionByEntityStrategy* mutable_by_entity(); void set_allocated_by_entity(::gie::PropertyPartitionByEntityStrategy* by_entity); private: @@ -700,7 +696,7 @@ class GraphPropertyPartitionStrategy final : public: void clear_by_type(); const ::gie::PropertyPartitionByTypeStrategy& by_type() const; - PROTOBUF_NODISCARD ::gie::PropertyPartitionByTypeStrategy* release_by_type(); + ::gie::PropertyPartitionByTypeStrategy* release_by_type(); ::gie::PropertyPartitionByTypeStrategy* mutable_by_type(); void set_allocated_by_type(::gie::PropertyPartitionByTypeStrategy* by_type); private: @@ -725,28 +721,23 @@ class GraphPropertyPartitionStrategy final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - union ItemUnion { - constexpr ItemUnion() : _constinit_{} {} - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; - ::gie::PropertyPartitionByEntityStrategy* by_entity_; - ::gie::PropertyPartitionByTypeStrategy* by_type_; - } item_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - uint32_t _oneof_case_[1]; + union ItemUnion { + ItemUnion() {} + ::gie::PropertyPartitionByEntityStrategy* by_entity_; + ::gie::PropertyPartitionByTypeStrategy* by_type_; + } item_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; - }; - union { Impl_ _impl_; }; friend struct ::TableStruct_gie_5fschema_2eproto; }; // ------------------------------------------------------------------- -class GraphPartitionStrategy final : +class GraphPartitionStrategy PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.GraphPartitionStrategy) */ { public: - inline GraphPartitionStrategy() : GraphPartitionStrategy(nullptr) {} - ~GraphPartitionStrategy() override; - explicit PROTOBUF_CONSTEXPR GraphPartitionStrategy(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline GraphPartitionStrategy() : GraphPartitionStrategy(nullptr) {}; + virtual ~GraphPartitionStrategy(); GraphPartitionStrategy(const GraphPartitionStrategy& from); GraphPartitionStrategy(GraphPartitionStrategy&& from) noexcept @@ -759,13 +750,8 @@ class GraphPartitionStrategy final : return *this; } inline GraphPartitionStrategy& operator=(GraphPartitionStrategy&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -776,14 +762,14 @@ class GraphPartitionStrategy final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const GraphPartitionStrategy& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const GraphPartitionStrategy& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const GraphPartitionStrategy* internal_default_instance() { return reinterpret_cast( &_GraphPartitionStrategy_default_instance_); @@ -796,12 +782,7 @@ class GraphPartitionStrategy final : } inline void Swap(GraphPartitionStrategy* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -809,53 +790,56 @@ class GraphPartitionStrategy final : } void UnsafeArenaSwap(GraphPartitionStrategy* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - GraphPartitionStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline GraphPartitionStrategy* New() const final { + return CreateMaybeMessage(nullptr); + } + + GraphPartitionStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const GraphPartitionStrategy& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const GraphPartitionStrategy& from) { - GraphPartitionStrategy::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const GraphPartitionStrategy& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(GraphPartitionStrategy* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "gie.GraphPartitionStrategy"; } protected: - explicit GraphPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit GraphPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); + return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -872,7 +856,7 @@ class GraphPartitionStrategy final : public: void clear_property(); const ::gie::GraphPropertyPartitionStrategy& property() const; - PROTOBUF_NODISCARD ::gie::GraphPropertyPartitionStrategy* release_property(); + ::gie::GraphPropertyPartitionStrategy* release_property(); ::gie::GraphPropertyPartitionStrategy* mutable_property(); void set_allocated_property(::gie::GraphPropertyPartitionStrategy* property); private: @@ -899,22 +883,18 @@ class GraphPartitionStrategy final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - ::gie::GraphPropertyPartitionStrategy* property_; - int topology_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::gie::GraphPropertyPartitionStrategy* property_; + int topology_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_gie_5fschema_2eproto; }; // ------------------------------------------------------------------- -class SrcDstPair final : +class SrcDstPair PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.SrcDstPair) */ { public: - inline SrcDstPair() : SrcDstPair(nullptr) {} - ~SrcDstPair() override; - explicit PROTOBUF_CONSTEXPR SrcDstPair(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline SrcDstPair() : SrcDstPair(nullptr) {}; + virtual ~SrcDstPair(); SrcDstPair(const SrcDstPair& from); SrcDstPair(SrcDstPair&& from) noexcept @@ -927,13 +907,8 @@ class SrcDstPair final : return *this; } inline SrcDstPair& operator=(SrcDstPair&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -944,14 +919,14 @@ class SrcDstPair final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const SrcDstPair& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const SrcDstPair& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const SrcDstPair* internal_default_instance() { return reinterpret_cast( &_SrcDstPair_default_instance_); @@ -964,12 +939,7 @@ class SrcDstPair final : } inline void Swap(SrcDstPair* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -977,53 +947,56 @@ class SrcDstPair final : } void UnsafeArenaSwap(SrcDstPair* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - SrcDstPair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline SrcDstPair* New() const final { + return CreateMaybeMessage(nullptr); + } + + SrcDstPair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const SrcDstPair& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const SrcDstPair& from) { - SrcDstPair::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const SrcDstPair& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(SrcDstPair* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "gie.SrcDstPair"; } protected: - explicit SrcDstPair(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit SrcDstPair(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); + return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -1039,28 +1012,50 @@ class SrcDstPair final : // string src_type = 1; void clear_src_type(); const std::string& src_type() const; - template - void set_src_type(ArgT0&& arg0, ArgT... args); + void set_src_type(const std::string& value); + void set_src_type(std::string&& value); + void set_src_type(const char* value); + void set_src_type(const char* value, size_t size); std::string* mutable_src_type(); - PROTOBUF_NODISCARD std::string* release_src_type(); + std::string* release_src_type(); void set_allocated_src_type(std::string* src_type); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_src_type(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_src_type( + std::string* src_type); private: const std::string& _internal_src_type() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_src_type(const std::string& value); + void _internal_set_src_type(const std::string& value); std::string* _internal_mutable_src_type(); public: // string dst_type = 2; void clear_dst_type(); const std::string& dst_type() const; - template - void set_dst_type(ArgT0&& arg0, ArgT... args); + void set_dst_type(const std::string& value); + void set_dst_type(std::string&& value); + void set_dst_type(const char* value); + void set_dst_type(const char* value, size_t size); std::string* mutable_dst_type(); - PROTOBUF_NODISCARD std::string* release_dst_type(); + std::string* release_dst_type(); void set_allocated_dst_type(std::string* dst_type); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_dst_type(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_dst_type( + std::string* dst_type); private: const std::string& _internal_dst_type() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_dst_type(const std::string& value); + void _internal_set_dst_type(const std::string& value); std::string* _internal_mutable_dst_type(); public: @@ -1098,25 +1093,21 @@ class SrcDstPair final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr src_type_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr dst_type_; - int partition_strategy_; - int property_partition_strategy_; - int relation_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr src_type_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr dst_type_; + int partition_strategy_; + int property_partition_strategy_; + int relation_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_gie_5fschema_2eproto; }; // ------------------------------------------------------------------- -class Property final : +class Property PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.Property) */ { public: - inline Property() : Property(nullptr) {} - ~Property() override; - explicit PROTOBUF_CONSTEXPR Property(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline Property() : Property(nullptr) {}; + virtual ~Property(); Property(const Property& from); Property(Property&& from) noexcept @@ -1129,13 +1120,8 @@ class Property final : return *this; } inline Property& operator=(Property&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1146,14 +1132,14 @@ class Property final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Property& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const Property& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Property* internal_default_instance() { return reinterpret_cast( &_Property_default_instance_); @@ -1166,12 +1152,7 @@ class Property final : } inline void Swap(Property* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1179,53 +1160,56 @@ class Property final : } void UnsafeArenaSwap(Property* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - Property* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline Property* New() const final { + return CreateMaybeMessage(nullptr); + } + + Property* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const Property& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Property& from) { - Property::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const Property& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Property* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "gie.Property"; } protected: - explicit Property(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit Property(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); + return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -1239,24 +1223,35 @@ class Property final : // string name = 2; void clear_name(); const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); + void set_name(const std::string& value); + void set_name(std::string&& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); + std::string* release_name(); void set_allocated_name(std::string* name); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_name(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + std::string* name); private: const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + void _internal_set_name(const std::string& value); std::string* _internal_mutable_name(); public: // uint32 id = 1; void clear_id(); - uint32_t id() const; - void set_id(uint32_t value); + ::PROTOBUF_NAMESPACE_ID::uint32 id() const; + void set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); private: - uint32_t _internal_id() const; - void _internal_set_id(uint32_t value); + ::PROTOBUF_NAMESPACE_ID::uint32 _internal_id() const; + void _internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); public: // .gie.DataType type = 3; @@ -1275,23 +1270,19 @@ class Property final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - uint32_t id_; - int type_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::uint32 id_; + int type_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_gie_5fschema_2eproto; }; // ------------------------------------------------------------------- -class VertexType final : +class VertexType PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.VertexType) */ { public: - inline VertexType() : VertexType(nullptr) {} - ~VertexType() override; - explicit PROTOBUF_CONSTEXPR VertexType(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline VertexType() : VertexType(nullptr) {}; + virtual ~VertexType(); VertexType(const VertexType& from); VertexType(VertexType&& from) noexcept @@ -1304,13 +1295,8 @@ class VertexType final : return *this; } inline VertexType& operator=(VertexType&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1321,14 +1307,14 @@ class VertexType final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const VertexType& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const VertexType& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const VertexType* internal_default_instance() { return reinterpret_cast( &_VertexType_default_instance_); @@ -1341,12 +1327,7 @@ class VertexType final : } inline void Swap(VertexType* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1354,53 +1335,56 @@ class VertexType final : } void UnsafeArenaSwap(VertexType* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - VertexType* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline VertexType* New() const final { + return CreateMaybeMessage(nullptr); + } + + VertexType* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const VertexType& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const VertexType& from) { - VertexType::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const VertexType& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(VertexType* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "gie.VertexType"; } protected: - explicit VertexType(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit VertexType(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); + return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -1460,24 +1444,35 @@ class VertexType final : // string name = 2; void clear_name(); const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); + void set_name(const std::string& value); + void set_name(std::string&& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); + std::string* release_name(); void set_allocated_name(std::string* name); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_name(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + std::string* name); private: const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + void _internal_set_name(const std::string& value); std::string* _internal_mutable_name(); public: // uint32 id = 1; void clear_id(); - uint32_t id() const; - void set_id(uint32_t value); + ::PROTOBUF_NAMESPACE_ID::uint32 id() const; + void set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); private: - uint32_t _internal_id() const; - void _internal_set_id(uint32_t value); + ::PROTOBUF_NAMESPACE_ID::uint32 _internal_id() const; + void _internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); public: // .gie.VertexPartitionStrategy partition_strategy = 5; @@ -1491,11 +1486,11 @@ class VertexType final : // int64 total_num = 7; void clear_total_num(); - int64_t total_num() const; - void set_total_num(int64_t value); + ::PROTOBUF_NAMESPACE_ID::int64 total_num() const; + void set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value); private: - int64_t _internal_total_num() const; - void _internal_set_total_num(int64_t value); + ::PROTOBUF_NAMESPACE_ID::int64 _internal_total_num() const; + void _internal_set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value); public: // .gie.PropertyPartitionStrategy property_partition_strategy = 6; @@ -1514,27 +1509,23 @@ class VertexType final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property > properties_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField primary_keys_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - uint32_t id_; - int partition_strategy_; - int64_t total_num_; - int property_partition_strategy_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property > properties_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField primary_keys_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::uint32 id_; + int partition_strategy_; + ::PROTOBUF_NAMESPACE_ID::int64 total_num_; + int property_partition_strategy_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_gie_5fschema_2eproto; }; // ------------------------------------------------------------------- -class EdgeType final : +class EdgeType PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.EdgeType) */ { public: - inline EdgeType() : EdgeType(nullptr) {} - ~EdgeType() override; - explicit PROTOBUF_CONSTEXPR EdgeType(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline EdgeType() : EdgeType(nullptr) {}; + virtual ~EdgeType(); EdgeType(const EdgeType& from); EdgeType(EdgeType&& from) noexcept @@ -1547,13 +1538,8 @@ class EdgeType final : return *this; } inline EdgeType& operator=(EdgeType&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1564,14 +1550,14 @@ class EdgeType final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const EdgeType& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const EdgeType& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const EdgeType* internal_default_instance() { return reinterpret_cast( &_EdgeType_default_instance_); @@ -1584,12 +1570,7 @@ class EdgeType final : } inline void Swap(EdgeType* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1597,53 +1578,56 @@ class EdgeType final : } void UnsafeArenaSwap(EdgeType* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - EdgeType* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline EdgeType* New() const final { + return CreateMaybeMessage(nullptr); + } + + EdgeType* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const EdgeType& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const EdgeType& from) { - EdgeType::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const EdgeType& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(EdgeType* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "gie.EdgeType"; } protected: - explicit EdgeType(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit EdgeType(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); + return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -1720,33 +1704,44 @@ class EdgeType final : // string name = 2; void clear_name(); const std::string& name() const; - template - void set_name(ArgT0&& arg0, ArgT... args); + void set_name(const std::string& value); + void set_name(std::string&& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); std::string* mutable_name(); - PROTOBUF_NODISCARD std::string* release_name(); + std::string* release_name(); void set_allocated_name(std::string* name); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_name(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + std::string* name); private: const std::string& _internal_name() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_name(const std::string& value); + void _internal_set_name(const std::string& value); std::string* _internal_mutable_name(); public: // int64 total_num = 6; void clear_total_num(); - int64_t total_num() const; - void set_total_num(int64_t value); + ::PROTOBUF_NAMESPACE_ID::int64 total_num() const; + void set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value); private: - int64_t _internal_total_num() const; - void _internal_set_total_num(int64_t value); + ::PROTOBUF_NAMESPACE_ID::int64 _internal_total_num() const; + void _internal_set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value); public: // uint32 id = 1; void clear_id(); - uint32_t id() const; - void set_id(uint32_t value); + ::PROTOBUF_NAMESPACE_ID::uint32 id() const; + void set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); private: - uint32_t _internal_id() const; - void _internal_set_id(uint32_t value); + ::PROTOBUF_NAMESPACE_ID::uint32 _internal_id() const; + void _internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); public: // @@protoc_insertion_point(class_scope:gie.EdgeType) @@ -1756,26 +1751,22 @@ class EdgeType final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property > properties_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField primary_keys_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair > src_dst_pairs_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - int64_t total_num_; - uint32_t id_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property > properties_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField primary_keys_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair > src_dst_pairs_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::int64 total_num_; + ::PROTOBUF_NAMESPACE_ID::uint32 id_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_gie_5fschema_2eproto; }; // ------------------------------------------------------------------- -class Statistics final : +class Statistics PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.Statistics) */ { public: - inline Statistics() : Statistics(nullptr) {} - ~Statistics() override; - explicit PROTOBUF_CONSTEXPR Statistics(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline Statistics() : Statistics(nullptr) {}; + virtual ~Statistics(); Statistics(const Statistics& from); Statistics(Statistics&& from) noexcept @@ -1788,13 +1779,8 @@ class Statistics final : return *this; } inline Statistics& operator=(Statistics&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1805,14 +1791,14 @@ class Statistics final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Statistics& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const Statistics& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Statistics* internal_default_instance() { return reinterpret_cast( &_Statistics_default_instance_); @@ -1825,12 +1811,7 @@ class Statistics final : } inline void Swap(Statistics* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1838,53 +1819,56 @@ class Statistics final : } void UnsafeArenaSwap(Statistics* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - Statistics* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline Statistics* New() const final { + return CreateMaybeMessage(nullptr); + } + + Statistics* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const Statistics& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Statistics& from) { - Statistics::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const Statistics& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Statistics* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "gie.Statistics"; } protected: - explicit Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); + return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -1897,29 +1881,29 @@ class Statistics final : }; // uint64 num_vertices = 2; void clear_num_vertices(); - uint64_t num_vertices() const; - void set_num_vertices(uint64_t value); + ::PROTOBUF_NAMESPACE_ID::uint64 num_vertices() const; + void set_num_vertices(::PROTOBUF_NAMESPACE_ID::uint64 value); private: - uint64_t _internal_num_vertices() const; - void _internal_set_num_vertices(uint64_t value); + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_num_vertices() const; + void _internal_set_num_vertices(::PROTOBUF_NAMESPACE_ID::uint64 value); public: // uint64 num_edges = 3; void clear_num_edges(); - uint64_t num_edges() const; - void set_num_edges(uint64_t value); + ::PROTOBUF_NAMESPACE_ID::uint64 num_edges() const; + void set_num_edges(::PROTOBUF_NAMESPACE_ID::uint64 value); private: - uint64_t _internal_num_edges() const; - void _internal_set_num_edges(uint64_t value); + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_num_edges() const; + void _internal_set_num_edges(::PROTOBUF_NAMESPACE_ID::uint64 value); public: // uint32 num_partitions = 1; void clear_num_partitions(); - uint32_t num_partitions() const; - void set_num_partitions(uint32_t value); + ::PROTOBUF_NAMESPACE_ID::uint32 num_partitions() const; + void set_num_partitions(::PROTOBUF_NAMESPACE_ID::uint32 value); private: - uint32_t _internal_num_partitions() const; - void _internal_set_num_partitions(uint32_t value); + ::PROTOBUF_NAMESPACE_ID::uint32 _internal_num_partitions() const; + void _internal_set_num_partitions(::PROTOBUF_NAMESPACE_ID::uint32 value); public: // @@protoc_insertion_point(class_scope:gie.Statistics) @@ -1929,23 +1913,19 @@ class Statistics final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - uint64_t num_vertices_; - uint64_t num_edges_; - uint32_t num_partitions_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::PROTOBUF_NAMESPACE_ID::uint64 num_vertices_; + ::PROTOBUF_NAMESPACE_ID::uint64 num_edges_; + ::PROTOBUF_NAMESPACE_ID::uint32 num_partitions_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_gie_5fschema_2eproto; }; // ------------------------------------------------------------------- -class Schema final : +class Schema PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.Schema) */ { public: - inline Schema() : Schema(nullptr) {} - ~Schema() override; - explicit PROTOBUF_CONSTEXPR Schema(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline Schema() : Schema(nullptr) {}; + virtual ~Schema(); Schema(const Schema& from); Schema(Schema&& from) noexcept @@ -1958,13 +1938,8 @@ class Schema final : return *this; } inline Schema& operator=(Schema&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1975,14 +1950,14 @@ class Schema final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Schema& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const Schema& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Schema* internal_default_instance() { return reinterpret_cast( &_Schema_default_instance_); @@ -1995,12 +1970,7 @@ class Schema final : } inline void Swap(Schema* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2008,53 +1978,56 @@ class Schema final : } void UnsafeArenaSwap(Schema* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - Schema* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline Schema* New() const final { + return CreateMaybeMessage(nullptr); + } + + Schema* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const Schema& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Schema& from) { - Schema::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const Schema& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Schema* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "gie.Schema"; } protected: - explicit Schema(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit Schema(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); + return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -2109,7 +2082,7 @@ class Schema final : public: void clear_partition_strategy(); const ::gie::GraphPartitionStrategy& partition_strategy() const; - PROTOBUF_NODISCARD ::gie::GraphPartitionStrategy* release_partition_strategy(); + ::gie::GraphPartitionStrategy* release_partition_strategy(); ::gie::GraphPartitionStrategy* mutable_partition_strategy(); void set_allocated_partition_strategy(::gie::GraphPartitionStrategy* partition_strategy); private: @@ -2127,7 +2100,7 @@ class Schema final : public: void clear_statistics(); const ::gie::Statistics& statistics() const; - PROTOBUF_NODISCARD ::gie::Statistics* release_statistics(); + ::gie::Statistics* release_statistics(); ::gie::Statistics* mutable_statistics(); void set_allocated_statistics(::gie::Statistics* statistics); private: @@ -2145,14 +2118,11 @@ class Schema final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType > vertex_types_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType > edge_types_; - ::gie::GraphPartitionStrategy* partition_strategy_; - ::gie::Statistics* statistics_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType > vertex_types_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType > edge_types_; + ::gie::GraphPartitionStrategy* partition_strategy_; + ::gie::Statistics* statistics_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_gie_5fschema_2eproto; }; // =================================================================== @@ -2168,10 +2138,10 @@ class Schema final : // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; inline void PropertyPartitionByEntityStrategy::clear_vertex_property_partition_strategy() { - _impl_.vertex_property_partition_strategy_ = 0; + vertex_property_partition_strategy_ = 0; } inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::_internal_vertex_property_partition_strategy() const { - return static_cast< ::gie::PropertyPartitionStrategy >(_impl_.vertex_property_partition_strategy_); + return static_cast< ::gie::PropertyPartitionStrategy >(vertex_property_partition_strategy_); } inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::vertex_property_partition_strategy() const { // @@protoc_insertion_point(field_get:gie.PropertyPartitionByEntityStrategy.vertex_property_partition_strategy) @@ -2179,7 +2149,7 @@ inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::verte } inline void PropertyPartitionByEntityStrategy::_internal_set_vertex_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - _impl_.vertex_property_partition_strategy_ = value; + vertex_property_partition_strategy_ = value; } inline void PropertyPartitionByEntityStrategy::set_vertex_property_partition_strategy(::gie::PropertyPartitionStrategy value) { _internal_set_vertex_property_partition_strategy(value); @@ -2188,10 +2158,10 @@ inline void PropertyPartitionByEntityStrategy::set_vertex_property_partition_str // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; inline void PropertyPartitionByEntityStrategy::clear_edge_property_partition_strategy() { - _impl_.edge_property_partition_strategy_ = 0; + edge_property_partition_strategy_ = 0; } inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::_internal_edge_property_partition_strategy() const { - return static_cast< ::gie::PropertyPartitionStrategy >(_impl_.edge_property_partition_strategy_); + return static_cast< ::gie::PropertyPartitionStrategy >(edge_property_partition_strategy_); } inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::edge_property_partition_strategy() const { // @@protoc_insertion_point(field_get:gie.PropertyPartitionByEntityStrategy.edge_property_partition_strategy) @@ -2199,7 +2169,7 @@ inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::edge_ } inline void PropertyPartitionByEntityStrategy::_internal_set_edge_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - _impl_.edge_property_partition_strategy_ = value; + edge_property_partition_strategy_ = value; } inline void PropertyPartitionByEntityStrategy::set_edge_property_partition_strategy(::gie::PropertyPartitionStrategy value) { _internal_set_edge_property_partition_strategy(value); @@ -2222,12 +2192,12 @@ inline bool GraphPropertyPartitionStrategy::has_by_entity() const { return _internal_has_by_entity(); } inline void GraphPropertyPartitionStrategy::set_has_by_entity() { - _impl_._oneof_case_[0] = kByEntity; + _oneof_case_[0] = kByEntity; } inline void GraphPropertyPartitionStrategy::clear_by_entity() { if (_internal_has_by_entity()) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.item_.by_entity_; + if (GetArena() == nullptr) { + delete item_.by_entity_; } clear_has_item(); } @@ -2236,11 +2206,11 @@ inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy: // @@protoc_insertion_point(field_release:gie.GraphPropertyPartitionStrategy.by_entity) if (_internal_has_by_entity()) { clear_has_item(); - ::gie::PropertyPartitionByEntityStrategy* temp = _impl_.item_.by_entity_; - if (GetArenaForAllocation() != nullptr) { + ::gie::PropertyPartitionByEntityStrategy* temp = item_.by_entity_; + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.item_.by_entity_ = nullptr; + item_.by_entity_ = nullptr; return temp; } else { return nullptr; @@ -2248,8 +2218,8 @@ inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy: } inline const ::gie::PropertyPartitionByEntityStrategy& GraphPropertyPartitionStrategy::_internal_by_entity() const { return _internal_has_by_entity() - ? *_impl_.item_.by_entity_ - : reinterpret_cast< ::gie::PropertyPartitionByEntityStrategy&>(::gie::_PropertyPartitionByEntityStrategy_default_instance_); + ? *item_.by_entity_ + : *reinterpret_cast< ::gie::PropertyPartitionByEntityStrategy*>(&::gie::_PropertyPartitionByEntityStrategy_default_instance_); } inline const ::gie::PropertyPartitionByEntityStrategy& GraphPropertyPartitionStrategy::by_entity() const { // @@protoc_insertion_point(field_get:gie.GraphPropertyPartitionStrategy.by_entity) @@ -2259,8 +2229,8 @@ inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy: // @@protoc_insertion_point(field_unsafe_arena_release:gie.GraphPropertyPartitionStrategy.by_entity) if (_internal_has_by_entity()) { clear_has_item(); - ::gie::PropertyPartitionByEntityStrategy* temp = _impl_.item_.by_entity_; - _impl_.item_.by_entity_ = nullptr; + ::gie::PropertyPartitionByEntityStrategy* temp = item_.by_entity_; + item_.by_entity_ = nullptr; return temp; } else { return nullptr; @@ -2270,7 +2240,7 @@ inline void GraphPropertyPartitionStrategy::unsafe_arena_set_allocated_by_entity clear_item(); if (by_entity) { set_has_by_entity(); - _impl_.item_.by_entity_ = by_entity; + item_.by_entity_ = by_entity; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.GraphPropertyPartitionStrategy.by_entity) } @@ -2278,14 +2248,13 @@ inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy: if (!_internal_has_by_entity()) { clear_item(); set_has_by_entity(); - _impl_.item_.by_entity_ = CreateMaybeMessage< ::gie::PropertyPartitionByEntityStrategy >(GetArenaForAllocation()); + item_.by_entity_ = CreateMaybeMessage< ::gie::PropertyPartitionByEntityStrategy >(GetArena()); } - return _impl_.item_.by_entity_; + return item_.by_entity_; } inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy::mutable_by_entity() { - ::gie::PropertyPartitionByEntityStrategy* _msg = _internal_mutable_by_entity(); // @@protoc_insertion_point(field_mutable:gie.GraphPropertyPartitionStrategy.by_entity) - return _msg; + return _internal_mutable_by_entity(); } // .gie.PropertyPartitionByTypeStrategy by_type = 2; @@ -2296,12 +2265,12 @@ inline bool GraphPropertyPartitionStrategy::has_by_type() const { return _internal_has_by_type(); } inline void GraphPropertyPartitionStrategy::set_has_by_type() { - _impl_._oneof_case_[0] = kByType; + _oneof_case_[0] = kByType; } inline void GraphPropertyPartitionStrategy::clear_by_type() { if (_internal_has_by_type()) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.item_.by_type_; + if (GetArena() == nullptr) { + delete item_.by_type_; } clear_has_item(); } @@ -2310,11 +2279,11 @@ inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::r // @@protoc_insertion_point(field_release:gie.GraphPropertyPartitionStrategy.by_type) if (_internal_has_by_type()) { clear_has_item(); - ::gie::PropertyPartitionByTypeStrategy* temp = _impl_.item_.by_type_; - if (GetArenaForAllocation() != nullptr) { + ::gie::PropertyPartitionByTypeStrategy* temp = item_.by_type_; + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.item_.by_type_ = nullptr; + item_.by_type_ = nullptr; return temp; } else { return nullptr; @@ -2322,8 +2291,8 @@ inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::r } inline const ::gie::PropertyPartitionByTypeStrategy& GraphPropertyPartitionStrategy::_internal_by_type() const { return _internal_has_by_type() - ? *_impl_.item_.by_type_ - : reinterpret_cast< ::gie::PropertyPartitionByTypeStrategy&>(::gie::_PropertyPartitionByTypeStrategy_default_instance_); + ? *item_.by_type_ + : *reinterpret_cast< ::gie::PropertyPartitionByTypeStrategy*>(&::gie::_PropertyPartitionByTypeStrategy_default_instance_); } inline const ::gie::PropertyPartitionByTypeStrategy& GraphPropertyPartitionStrategy::by_type() const { // @@protoc_insertion_point(field_get:gie.GraphPropertyPartitionStrategy.by_type) @@ -2333,8 +2302,8 @@ inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::u // @@protoc_insertion_point(field_unsafe_arena_release:gie.GraphPropertyPartitionStrategy.by_type) if (_internal_has_by_type()) { clear_has_item(); - ::gie::PropertyPartitionByTypeStrategy* temp = _impl_.item_.by_type_; - _impl_.item_.by_type_ = nullptr; + ::gie::PropertyPartitionByTypeStrategy* temp = item_.by_type_; + item_.by_type_ = nullptr; return temp; } else { return nullptr; @@ -2344,7 +2313,7 @@ inline void GraphPropertyPartitionStrategy::unsafe_arena_set_allocated_by_type(: clear_item(); if (by_type) { set_has_by_type(); - _impl_.item_.by_type_ = by_type; + item_.by_type_ = by_type; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.GraphPropertyPartitionStrategy.by_type) } @@ -2352,24 +2321,23 @@ inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::_ if (!_internal_has_by_type()) { clear_item(); set_has_by_type(); - _impl_.item_.by_type_ = CreateMaybeMessage< ::gie::PropertyPartitionByTypeStrategy >(GetArenaForAllocation()); + item_.by_type_ = CreateMaybeMessage< ::gie::PropertyPartitionByTypeStrategy >(GetArena()); } - return _impl_.item_.by_type_; + return item_.by_type_; } inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::mutable_by_type() { - ::gie::PropertyPartitionByTypeStrategy* _msg = _internal_mutable_by_type(); // @@protoc_insertion_point(field_mutable:gie.GraphPropertyPartitionStrategy.by_type) - return _msg; + return _internal_mutable_by_type(); } inline bool GraphPropertyPartitionStrategy::has_item() const { return item_case() != ITEM_NOT_SET; } inline void GraphPropertyPartitionStrategy::clear_has_item() { - _impl_._oneof_case_[0] = ITEM_NOT_SET; + _oneof_case_[0] = ITEM_NOT_SET; } inline GraphPropertyPartitionStrategy::ItemCase GraphPropertyPartitionStrategy::item_case() const { - return GraphPropertyPartitionStrategy::ItemCase(_impl_._oneof_case_[0]); + return GraphPropertyPartitionStrategy::ItemCase(_oneof_case_[0]); } // ------------------------------------------------------------------- @@ -2377,10 +2345,10 @@ inline GraphPropertyPartitionStrategy::ItemCase GraphPropertyPartitionStrategy:: // .gie.GraphTopologyPartitionStrategy topology = 1; inline void GraphPartitionStrategy::clear_topology() { - _impl_.topology_ = 0; + topology_ = 0; } inline ::gie::GraphTopologyPartitionStrategy GraphPartitionStrategy::_internal_topology() const { - return static_cast< ::gie::GraphTopologyPartitionStrategy >(_impl_.topology_); + return static_cast< ::gie::GraphTopologyPartitionStrategy >(topology_); } inline ::gie::GraphTopologyPartitionStrategy GraphPartitionStrategy::topology() const { // @@protoc_insertion_point(field_get:gie.GraphPartitionStrategy.topology) @@ -2388,7 +2356,7 @@ inline ::gie::GraphTopologyPartitionStrategy GraphPartitionStrategy::topology() } inline void GraphPartitionStrategy::_internal_set_topology(::gie::GraphTopologyPartitionStrategy value) { - _impl_.topology_ = value; + topology_ = value; } inline void GraphPartitionStrategy::set_topology(::gie::GraphTopologyPartitionStrategy value) { _internal_set_topology(value); @@ -2397,21 +2365,21 @@ inline void GraphPartitionStrategy::set_topology(::gie::GraphTopologyPartitionSt // .gie.GraphPropertyPartitionStrategy property = 2; inline bool GraphPartitionStrategy::_internal_has_property() const { - return this != internal_default_instance() && _impl_.property_ != nullptr; + return this != internal_default_instance() && property_ != nullptr; } inline bool GraphPartitionStrategy::has_property() const { return _internal_has_property(); } inline void GraphPartitionStrategy::clear_property() { - if (GetArenaForAllocation() == nullptr && _impl_.property_ != nullptr) { - delete _impl_.property_; + if (GetArena() == nullptr && property_ != nullptr) { + delete property_; } - _impl_.property_ = nullptr; + property_ = nullptr; } inline const ::gie::GraphPropertyPartitionStrategy& GraphPartitionStrategy::_internal_property() const { - const ::gie::GraphPropertyPartitionStrategy* p = _impl_.property_; - return p != nullptr ? *p : reinterpret_cast( - ::gie::_GraphPropertyPartitionStrategy_default_instance_); + const ::gie::GraphPropertyPartitionStrategy* p = property_; + return p != nullptr ? *p : *reinterpret_cast( + &::gie::_GraphPropertyPartitionStrategy_default_instance_); } inline const ::gie::GraphPropertyPartitionStrategy& GraphPartitionStrategy::property() const { // @@protoc_insertion_point(field_get:gie.GraphPartitionStrategy.property) @@ -2419,10 +2387,10 @@ inline const ::gie::GraphPropertyPartitionStrategy& GraphPartitionStrategy::prop } inline void GraphPartitionStrategy::unsafe_arena_set_allocated_property( ::gie::GraphPropertyPartitionStrategy* property) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.property_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(property_); } - _impl_.property_ = property; + property_ = property; if (property) { } else { @@ -2431,48 +2399,39 @@ inline void GraphPartitionStrategy::unsafe_arena_set_allocated_property( // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.GraphPartitionStrategy.property) } inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::release_property() { - - ::gie::GraphPropertyPartitionStrategy* temp = _impl_.property_; - _impl_.property_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { + auto temp = unsafe_arena_release_property(); + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::unsafe_arena_release_property() { // @@protoc_insertion_point(field_release:gie.GraphPartitionStrategy.property) - ::gie::GraphPropertyPartitionStrategy* temp = _impl_.property_; - _impl_.property_ = nullptr; + ::gie::GraphPropertyPartitionStrategy* temp = property_; + property_ = nullptr; return temp; } inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::_internal_mutable_property() { - if (_impl_.property_ == nullptr) { - auto* p = CreateMaybeMessage<::gie::GraphPropertyPartitionStrategy>(GetArenaForAllocation()); - _impl_.property_ = p; + if (property_ == nullptr) { + auto* p = CreateMaybeMessage<::gie::GraphPropertyPartitionStrategy>(GetArena()); + property_ = p; } - return _impl_.property_; + return property_; } inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::mutable_property() { - ::gie::GraphPropertyPartitionStrategy* _msg = _internal_mutable_property(); // @@protoc_insertion_point(field_mutable:gie.GraphPartitionStrategy.property) - return _msg; + return _internal_mutable_property(); } inline void GraphPartitionStrategy::set_allocated_property(::gie::GraphPropertyPartitionStrategy* property) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); if (message_arena == nullptr) { - delete _impl_.property_; + delete property_; } if (property) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(property); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(property); if (message_arena != submessage_arena) { property = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, property, submessage_arena); @@ -2481,7 +2440,7 @@ inline void GraphPartitionStrategy::set_allocated_property(::gie::GraphPropertyP } else { } - _impl_.property_ = property; + property_ = property; // @@protoc_insertion_point(field_set_allocated:gie.GraphPartitionStrategy.property) } @@ -2491,38 +2450,54 @@ inline void GraphPartitionStrategy::set_allocated_property(::gie::GraphPropertyP // string src_type = 1; inline void SrcDstPair::clear_src_type() { - _impl_.src_type_.ClearToEmpty(); + src_type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline const std::string& SrcDstPair::src_type() const { // @@protoc_insertion_point(field_get:gie.SrcDstPair.src_type) return _internal_src_type(); } -template -inline PROTOBUF_ALWAYS_INLINE -void SrcDstPair::set_src_type(ArgT0&& arg0, ArgT... args) { - - _impl_.src_type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); +inline void SrcDstPair::set_src_type(const std::string& value) { + _internal_set_src_type(value); // @@protoc_insertion_point(field_set:gie.SrcDstPair.src_type) } inline std::string* SrcDstPair::mutable_src_type() { - std::string* _s = _internal_mutable_src_type(); // @@protoc_insertion_point(field_mutable:gie.SrcDstPair.src_type) - return _s; + return _internal_mutable_src_type(); } inline const std::string& SrcDstPair::_internal_src_type() const { - return _impl_.src_type_.Get(); + return src_type_.Get(); } inline void SrcDstPair::_internal_set_src_type(const std::string& value) { - _impl_.src_type_.Set(value, GetArenaForAllocation()); + src_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void SrcDstPair::set_src_type(std::string&& value) { + + src_type_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:gie.SrcDstPair.src_type) +} +inline void SrcDstPair::set_src_type(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + src_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:gie.SrcDstPair.src_type) +} +inline void SrcDstPair::set_src_type(const char* value, + size_t size) { + + src_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:gie.SrcDstPair.src_type) } inline std::string* SrcDstPair::_internal_mutable_src_type() { - return _impl_.src_type_.Mutable(GetArenaForAllocation()); + return src_type_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* SrcDstPair::release_src_type() { // @@protoc_insertion_point(field_release:gie.SrcDstPair.src_type) - return _impl_.src_type_.Release(); + return src_type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void SrcDstPair::set_allocated_src_type(std::string* src_type) { if (src_type != nullptr) { @@ -2530,49 +2505,80 @@ inline void SrcDstPair::set_allocated_src_type(std::string* src_type) { } else { } - _impl_.src_type_.SetAllocated(src_type, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.src_type_.IsDefault()) { - _impl_.src_type_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + src_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), src_type, + GetArena()); // @@protoc_insertion_point(field_set_allocated:gie.SrcDstPair.src_type) } +inline std::string* SrcDstPair::unsafe_arena_release_src_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:gie.SrcDstPair.src_type) + GOOGLE_DCHECK(GetArena() != nullptr); + + return src_type_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void SrcDstPair::unsafe_arena_set_allocated_src_type( + std::string* src_type) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (src_type != nullptr) { + + } else { + + } + src_type_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + src_type, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.SrcDstPair.src_type) +} // string dst_type = 2; inline void SrcDstPair::clear_dst_type() { - _impl_.dst_type_.ClearToEmpty(); + dst_type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline const std::string& SrcDstPair::dst_type() const { // @@protoc_insertion_point(field_get:gie.SrcDstPair.dst_type) return _internal_dst_type(); } -template -inline PROTOBUF_ALWAYS_INLINE -void SrcDstPair::set_dst_type(ArgT0&& arg0, ArgT... args) { - - _impl_.dst_type_.Set(static_cast(arg0), args..., GetArenaForAllocation()); +inline void SrcDstPair::set_dst_type(const std::string& value) { + _internal_set_dst_type(value); // @@protoc_insertion_point(field_set:gie.SrcDstPair.dst_type) } inline std::string* SrcDstPair::mutable_dst_type() { - std::string* _s = _internal_mutable_dst_type(); // @@protoc_insertion_point(field_mutable:gie.SrcDstPair.dst_type) - return _s; + return _internal_mutable_dst_type(); } inline const std::string& SrcDstPair::_internal_dst_type() const { - return _impl_.dst_type_.Get(); + return dst_type_.Get(); } inline void SrcDstPair::_internal_set_dst_type(const std::string& value) { - _impl_.dst_type_.Set(value, GetArenaForAllocation()); + dst_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void SrcDstPair::set_dst_type(std::string&& value) { + + dst_type_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:gie.SrcDstPair.dst_type) +} +inline void SrcDstPair::set_dst_type(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + dst_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:gie.SrcDstPair.dst_type) +} +inline void SrcDstPair::set_dst_type(const char* value, + size_t size) { + + dst_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:gie.SrcDstPair.dst_type) } inline std::string* SrcDstPair::_internal_mutable_dst_type() { - return _impl_.dst_type_.Mutable(GetArenaForAllocation()); + return dst_type_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* SrcDstPair::release_dst_type() { // @@protoc_insertion_point(field_release:gie.SrcDstPair.dst_type) - return _impl_.dst_type_.Release(); + return dst_type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void SrcDstPair::set_allocated_dst_type(std::string* dst_type) { if (dst_type != nullptr) { @@ -2580,21 +2586,36 @@ inline void SrcDstPair::set_allocated_dst_type(std::string* dst_type) { } else { } - _impl_.dst_type_.SetAllocated(dst_type, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.dst_type_.IsDefault()) { - _impl_.dst_type_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + dst_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), dst_type, + GetArena()); // @@protoc_insertion_point(field_set_allocated:gie.SrcDstPair.dst_type) } +inline std::string* SrcDstPair::unsafe_arena_release_dst_type() { + // @@protoc_insertion_point(field_unsafe_arena_release:gie.SrcDstPair.dst_type) + GOOGLE_DCHECK(GetArena() != nullptr); + + return dst_type_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void SrcDstPair::unsafe_arena_set_allocated_dst_type( + std::string* dst_type) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (dst_type != nullptr) { + + } else { + + } + dst_type_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + dst_type, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.SrcDstPair.dst_type) +} // .gie.EdgePartitionStrategy partition_strategy = 3; inline void SrcDstPair::clear_partition_strategy() { - _impl_.partition_strategy_ = 0; + partition_strategy_ = 0; } inline ::gie::EdgePartitionStrategy SrcDstPair::_internal_partition_strategy() const { - return static_cast< ::gie::EdgePartitionStrategy >(_impl_.partition_strategy_); + return static_cast< ::gie::EdgePartitionStrategy >(partition_strategy_); } inline ::gie::EdgePartitionStrategy SrcDstPair::partition_strategy() const { // @@protoc_insertion_point(field_get:gie.SrcDstPair.partition_strategy) @@ -2602,7 +2623,7 @@ inline ::gie::EdgePartitionStrategy SrcDstPair::partition_strategy() const { } inline void SrcDstPair::_internal_set_partition_strategy(::gie::EdgePartitionStrategy value) { - _impl_.partition_strategy_ = value; + partition_strategy_ = value; } inline void SrcDstPair::set_partition_strategy(::gie::EdgePartitionStrategy value) { _internal_set_partition_strategy(value); @@ -2611,10 +2632,10 @@ inline void SrcDstPair::set_partition_strategy(::gie::EdgePartitionStrategy valu // .gie.PropertyPartitionStrategy property_partition_strategy = 4; inline void SrcDstPair::clear_property_partition_strategy() { - _impl_.property_partition_strategy_ = 0; + property_partition_strategy_ = 0; } inline ::gie::PropertyPartitionStrategy SrcDstPair::_internal_property_partition_strategy() const { - return static_cast< ::gie::PropertyPartitionStrategy >(_impl_.property_partition_strategy_); + return static_cast< ::gie::PropertyPartitionStrategy >(property_partition_strategy_); } inline ::gie::PropertyPartitionStrategy SrcDstPair::property_partition_strategy() const { // @@protoc_insertion_point(field_get:gie.SrcDstPair.property_partition_strategy) @@ -2622,7 +2643,7 @@ inline ::gie::PropertyPartitionStrategy SrcDstPair::property_partition_strategy( } inline void SrcDstPair::_internal_set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - _impl_.property_partition_strategy_ = value; + property_partition_strategy_ = value; } inline void SrcDstPair::set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { _internal_set_property_partition_strategy(value); @@ -2631,10 +2652,10 @@ inline void SrcDstPair::set_property_partition_strategy(::gie::PropertyPartition // .gie.Relation relation = 5; inline void SrcDstPair::clear_relation() { - _impl_.relation_ = 0; + relation_ = 0; } inline ::gie::Relation SrcDstPair::_internal_relation() const { - return static_cast< ::gie::Relation >(_impl_.relation_); + return static_cast< ::gie::Relation >(relation_); } inline ::gie::Relation SrcDstPair::relation() const { // @@protoc_insertion_point(field_get:gie.SrcDstPair.relation) @@ -2642,7 +2663,7 @@ inline ::gie::Relation SrcDstPair::relation() const { } inline void SrcDstPair::_internal_set_relation(::gie::Relation value) { - _impl_.relation_ = value; + relation_ = value; } inline void SrcDstPair::set_relation(::gie::Relation value) { _internal_set_relation(value); @@ -2655,58 +2676,74 @@ inline void SrcDstPair::set_relation(::gie::Relation value) { // uint32 id = 1; inline void Property::clear_id() { - _impl_.id_ = 0u; + id_ = 0u; } -inline uint32_t Property::_internal_id() const { - return _impl_.id_; +inline ::PROTOBUF_NAMESPACE_ID::uint32 Property::_internal_id() const { + return id_; } -inline uint32_t Property::id() const { +inline ::PROTOBUF_NAMESPACE_ID::uint32 Property::id() const { // @@protoc_insertion_point(field_get:gie.Property.id) return _internal_id(); } -inline void Property::_internal_set_id(uint32_t value) { +inline void Property::_internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { - _impl_.id_ = value; + id_ = value; } -inline void Property::set_id(uint32_t value) { +inline void Property::set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { _internal_set_id(value); // @@protoc_insertion_point(field_set:gie.Property.id) } // string name = 2; inline void Property::clear_name() { - _impl_.name_.ClearToEmpty(); + name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline const std::string& Property::name() const { // @@protoc_insertion_point(field_get:gie.Property.name) return _internal_name(); } -template -inline PROTOBUF_ALWAYS_INLINE -void Property::set_name(ArgT0&& arg0, ArgT... args) { - - _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); +inline void Property::set_name(const std::string& value) { + _internal_set_name(value); // @@protoc_insertion_point(field_set:gie.Property.name) } inline std::string* Property::mutable_name() { - std::string* _s = _internal_mutable_name(); // @@protoc_insertion_point(field_mutable:gie.Property.name) - return _s; + return _internal_mutable_name(); } inline const std::string& Property::_internal_name() const { - return _impl_.name_.Get(); + return name_.Get(); } inline void Property::_internal_set_name(const std::string& value) { - _impl_.name_.Set(value, GetArenaForAllocation()); + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void Property::set_name(std::string&& value) { + + name_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:gie.Property.name) +} +inline void Property::set_name(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:gie.Property.name) +} +inline void Property::set_name(const char* value, + size_t size) { + + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:gie.Property.name) } inline std::string* Property::_internal_mutable_name() { - return _impl_.name_.Mutable(GetArenaForAllocation()); + return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* Property::release_name() { // @@protoc_insertion_point(field_release:gie.Property.name) - return _impl_.name_.Release(); + return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void Property::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -2714,21 +2751,36 @@ inline void Property::set_allocated_name(std::string* name) { } else { } - _impl_.name_.SetAllocated(name, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, + GetArena()); // @@protoc_insertion_point(field_set_allocated:gie.Property.name) } +inline std::string* Property::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:gie.Property.name) + GOOGLE_DCHECK(GetArena() != nullptr); + + return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void Property::unsafe_arena_set_allocated_name( + std::string* name) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (name != nullptr) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + name, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.Property.name) +} // .gie.DataType type = 3; inline void Property::clear_type() { - _impl_.type_ = 0; + type_ = 0; } inline ::gie::DataType Property::_internal_type() const { - return static_cast< ::gie::DataType >(_impl_.type_); + return static_cast< ::gie::DataType >(type_); } inline ::gie::DataType Property::type() const { // @@protoc_insertion_point(field_get:gie.Property.type) @@ -2736,7 +2788,7 @@ inline ::gie::DataType Property::type() const { } inline void Property::_internal_set_type(::gie::DataType value) { - _impl_.type_ = value; + type_ = value; } inline void Property::set_type(::gie::DataType value) { _internal_set_type(value); @@ -2749,58 +2801,74 @@ inline void Property::set_type(::gie::DataType value) { // uint32 id = 1; inline void VertexType::clear_id() { - _impl_.id_ = 0u; + id_ = 0u; } -inline uint32_t VertexType::_internal_id() const { - return _impl_.id_; +inline ::PROTOBUF_NAMESPACE_ID::uint32 VertexType::_internal_id() const { + return id_; } -inline uint32_t VertexType::id() const { +inline ::PROTOBUF_NAMESPACE_ID::uint32 VertexType::id() const { // @@protoc_insertion_point(field_get:gie.VertexType.id) return _internal_id(); } -inline void VertexType::_internal_set_id(uint32_t value) { +inline void VertexType::_internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { - _impl_.id_ = value; + id_ = value; } -inline void VertexType::set_id(uint32_t value) { +inline void VertexType::set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { _internal_set_id(value); // @@protoc_insertion_point(field_set:gie.VertexType.id) } // string name = 2; inline void VertexType::clear_name() { - _impl_.name_.ClearToEmpty(); + name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline const std::string& VertexType::name() const { // @@protoc_insertion_point(field_get:gie.VertexType.name) return _internal_name(); } -template -inline PROTOBUF_ALWAYS_INLINE -void VertexType::set_name(ArgT0&& arg0, ArgT... args) { - - _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); +inline void VertexType::set_name(const std::string& value) { + _internal_set_name(value); // @@protoc_insertion_point(field_set:gie.VertexType.name) } inline std::string* VertexType::mutable_name() { - std::string* _s = _internal_mutable_name(); // @@protoc_insertion_point(field_mutable:gie.VertexType.name) - return _s; + return _internal_mutable_name(); } inline const std::string& VertexType::_internal_name() const { - return _impl_.name_.Get(); + return name_.Get(); } inline void VertexType::_internal_set_name(const std::string& value) { - _impl_.name_.Set(value, GetArenaForAllocation()); + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void VertexType::set_name(std::string&& value) { + + name_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:gie.VertexType.name) +} +inline void VertexType::set_name(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:gie.VertexType.name) +} +inline void VertexType::set_name(const char* value, + size_t size) { + + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:gie.VertexType.name) } inline std::string* VertexType::_internal_mutable_name() { - return _impl_.name_.Mutable(GetArenaForAllocation()); + return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* VertexType::release_name() { // @@protoc_insertion_point(field_release:gie.VertexType.name) - return _impl_.name_.Release(); + return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void VertexType::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -2808,72 +2876,85 @@ inline void VertexType::set_allocated_name(std::string* name) { } else { } - _impl_.name_.SetAllocated(name, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, + GetArena()); // @@protoc_insertion_point(field_set_allocated:gie.VertexType.name) } +inline std::string* VertexType::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:gie.VertexType.name) + GOOGLE_DCHECK(GetArena() != nullptr); + + return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void VertexType::unsafe_arena_set_allocated_name( + std::string* name) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (name != nullptr) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + name, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.VertexType.name) +} // repeated .gie.Property properties = 3; inline int VertexType::_internal_properties_size() const { - return _impl_.properties_.size(); + return properties_.size(); } inline int VertexType::properties_size() const { return _internal_properties_size(); } inline void VertexType::clear_properties() { - _impl_.properties_.Clear(); + properties_.Clear(); } inline ::gie::Property* VertexType::mutable_properties(int index) { // @@protoc_insertion_point(field_mutable:gie.VertexType.properties) - return _impl_.properties_.Mutable(index); + return properties_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >* VertexType::mutable_properties() { // @@protoc_insertion_point(field_mutable_list:gie.VertexType.properties) - return &_impl_.properties_; + return &properties_; } inline const ::gie::Property& VertexType::_internal_properties(int index) const { - return _impl_.properties_.Get(index); + return properties_.Get(index); } inline const ::gie::Property& VertexType::properties(int index) const { // @@protoc_insertion_point(field_get:gie.VertexType.properties) return _internal_properties(index); } inline ::gie::Property* VertexType::_internal_add_properties() { - return _impl_.properties_.Add(); + return properties_.Add(); } inline ::gie::Property* VertexType::add_properties() { - ::gie::Property* _add = _internal_add_properties(); // @@protoc_insertion_point(field_add:gie.VertexType.properties) - return _add; + return _internal_add_properties(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >& VertexType::properties() const { // @@protoc_insertion_point(field_list:gie.VertexType.properties) - return _impl_.properties_; + return properties_; } // repeated string primary_keys = 4; inline int VertexType::_internal_primary_keys_size() const { - return _impl_.primary_keys_.size(); + return primary_keys_.size(); } inline int VertexType::primary_keys_size() const { return _internal_primary_keys_size(); } inline void VertexType::clear_primary_keys() { - _impl_.primary_keys_.Clear(); + primary_keys_.Clear(); } inline std::string* VertexType::add_primary_keys() { - std::string* _s = _internal_add_primary_keys(); // @@protoc_insertion_point(field_add_mutable:gie.VertexType.primary_keys) - return _s; + return _internal_add_primary_keys(); } inline const std::string& VertexType::_internal_primary_keys(int index) const { - return _impl_.primary_keys_.Get(index); + return primary_keys_.Get(index); } inline const std::string& VertexType::primary_keys(int index) const { // @@protoc_insertion_point(field_get:gie.VertexType.primary_keys) @@ -2881,63 +2962,63 @@ inline const std::string& VertexType::primary_keys(int index) const { } inline std::string* VertexType::mutable_primary_keys(int index) { // @@protoc_insertion_point(field_mutable:gie.VertexType.primary_keys) - return _impl_.primary_keys_.Mutable(index); + return primary_keys_.Mutable(index); } inline void VertexType::set_primary_keys(int index, const std::string& value) { - _impl_.primary_keys_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set:gie.VertexType.primary_keys) + primary_keys_.Mutable(index)->assign(value); } inline void VertexType::set_primary_keys(int index, std::string&& value) { - _impl_.primary_keys_.Mutable(index)->assign(std::move(value)); // @@protoc_insertion_point(field_set:gie.VertexType.primary_keys) + primary_keys_.Mutable(index)->assign(std::move(value)); } inline void VertexType::set_primary_keys(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); - _impl_.primary_keys_.Mutable(index)->assign(value); + primary_keys_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:gie.VertexType.primary_keys) } inline void VertexType::set_primary_keys(int index, const char* value, size_t size) { - _impl_.primary_keys_.Mutable(index)->assign( + primary_keys_.Mutable(index)->assign( reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:gie.VertexType.primary_keys) } inline std::string* VertexType::_internal_add_primary_keys() { - return _impl_.primary_keys_.Add(); + return primary_keys_.Add(); } inline void VertexType::add_primary_keys(const std::string& value) { - _impl_.primary_keys_.Add()->assign(value); + primary_keys_.Add()->assign(value); // @@protoc_insertion_point(field_add:gie.VertexType.primary_keys) } inline void VertexType::add_primary_keys(std::string&& value) { - _impl_.primary_keys_.Add(std::move(value)); + primary_keys_.Add(std::move(value)); // @@protoc_insertion_point(field_add:gie.VertexType.primary_keys) } inline void VertexType::add_primary_keys(const char* value) { GOOGLE_DCHECK(value != nullptr); - _impl_.primary_keys_.Add()->assign(value); + primary_keys_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:gie.VertexType.primary_keys) } inline void VertexType::add_primary_keys(const char* value, size_t size) { - _impl_.primary_keys_.Add()->assign(reinterpret_cast(value), size); + primary_keys_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:gie.VertexType.primary_keys) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& VertexType::primary_keys() const { // @@protoc_insertion_point(field_list:gie.VertexType.primary_keys) - return _impl_.primary_keys_; + return primary_keys_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* VertexType::mutable_primary_keys() { // @@protoc_insertion_point(field_mutable_list:gie.VertexType.primary_keys) - return &_impl_.primary_keys_; + return &primary_keys_; } // .gie.VertexPartitionStrategy partition_strategy = 5; inline void VertexType::clear_partition_strategy() { - _impl_.partition_strategy_ = 0; + partition_strategy_ = 0; } inline ::gie::VertexPartitionStrategy VertexType::_internal_partition_strategy() const { - return static_cast< ::gie::VertexPartitionStrategy >(_impl_.partition_strategy_); + return static_cast< ::gie::VertexPartitionStrategy >(partition_strategy_); } inline ::gie::VertexPartitionStrategy VertexType::partition_strategy() const { // @@protoc_insertion_point(field_get:gie.VertexType.partition_strategy) @@ -2945,7 +3026,7 @@ inline ::gie::VertexPartitionStrategy VertexType::partition_strategy() const { } inline void VertexType::_internal_set_partition_strategy(::gie::VertexPartitionStrategy value) { - _impl_.partition_strategy_ = value; + partition_strategy_ = value; } inline void VertexType::set_partition_strategy(::gie::VertexPartitionStrategy value) { _internal_set_partition_strategy(value); @@ -2954,10 +3035,10 @@ inline void VertexType::set_partition_strategy(::gie::VertexPartitionStrategy va // .gie.PropertyPartitionStrategy property_partition_strategy = 6; inline void VertexType::clear_property_partition_strategy() { - _impl_.property_partition_strategy_ = 0; + property_partition_strategy_ = 0; } inline ::gie::PropertyPartitionStrategy VertexType::_internal_property_partition_strategy() const { - return static_cast< ::gie::PropertyPartitionStrategy >(_impl_.property_partition_strategy_); + return static_cast< ::gie::PropertyPartitionStrategy >(property_partition_strategy_); } inline ::gie::PropertyPartitionStrategy VertexType::property_partition_strategy() const { // @@protoc_insertion_point(field_get:gie.VertexType.property_partition_strategy) @@ -2965,7 +3046,7 @@ inline ::gie::PropertyPartitionStrategy VertexType::property_partition_strategy( } inline void VertexType::_internal_set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - _impl_.property_partition_strategy_ = value; + property_partition_strategy_ = value; } inline void VertexType::set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { _internal_set_property_partition_strategy(value); @@ -2974,20 +3055,20 @@ inline void VertexType::set_property_partition_strategy(::gie::PropertyPartition // int64 total_num = 7; inline void VertexType::clear_total_num() { - _impl_.total_num_ = int64_t{0}; + total_num_ = PROTOBUF_LONGLONG(0); } -inline int64_t VertexType::_internal_total_num() const { - return _impl_.total_num_; +inline ::PROTOBUF_NAMESPACE_ID::int64 VertexType::_internal_total_num() const { + return total_num_; } -inline int64_t VertexType::total_num() const { +inline ::PROTOBUF_NAMESPACE_ID::int64 VertexType::total_num() const { // @@protoc_insertion_point(field_get:gie.VertexType.total_num) return _internal_total_num(); } -inline void VertexType::_internal_set_total_num(int64_t value) { +inline void VertexType::_internal_set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value) { - _impl_.total_num_ = value; + total_num_ = value; } -inline void VertexType::set_total_num(int64_t value) { +inline void VertexType::set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value) { _internal_set_total_num(value); // @@protoc_insertion_point(field_set:gie.VertexType.total_num) } @@ -2998,58 +3079,74 @@ inline void VertexType::set_total_num(int64_t value) { // uint32 id = 1; inline void EdgeType::clear_id() { - _impl_.id_ = 0u; + id_ = 0u; } -inline uint32_t EdgeType::_internal_id() const { - return _impl_.id_; +inline ::PROTOBUF_NAMESPACE_ID::uint32 EdgeType::_internal_id() const { + return id_; } -inline uint32_t EdgeType::id() const { +inline ::PROTOBUF_NAMESPACE_ID::uint32 EdgeType::id() const { // @@protoc_insertion_point(field_get:gie.EdgeType.id) return _internal_id(); } -inline void EdgeType::_internal_set_id(uint32_t value) { +inline void EdgeType::_internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { - _impl_.id_ = value; + id_ = value; } -inline void EdgeType::set_id(uint32_t value) { +inline void EdgeType::set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { _internal_set_id(value); // @@protoc_insertion_point(field_set:gie.EdgeType.id) } // string name = 2; inline void EdgeType::clear_name() { - _impl_.name_.ClearToEmpty(); + name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline const std::string& EdgeType::name() const { // @@protoc_insertion_point(field_get:gie.EdgeType.name) return _internal_name(); } -template -inline PROTOBUF_ALWAYS_INLINE -void EdgeType::set_name(ArgT0&& arg0, ArgT... args) { - - _impl_.name_.Set(static_cast(arg0), args..., GetArenaForAllocation()); +inline void EdgeType::set_name(const std::string& value) { + _internal_set_name(value); // @@protoc_insertion_point(field_set:gie.EdgeType.name) } inline std::string* EdgeType::mutable_name() { - std::string* _s = _internal_mutable_name(); // @@protoc_insertion_point(field_mutable:gie.EdgeType.name) - return _s; + return _internal_mutable_name(); } inline const std::string& EdgeType::_internal_name() const { - return _impl_.name_.Get(); + return name_.Get(); } inline void EdgeType::_internal_set_name(const std::string& value) { - _impl_.name_.Set(value, GetArenaForAllocation()); + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void EdgeType::set_name(std::string&& value) { + + name_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:gie.EdgeType.name) +} +inline void EdgeType::set_name(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:gie.EdgeType.name) +} +inline void EdgeType::set_name(const char* value, + size_t size) { + + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:gie.EdgeType.name) } inline std::string* EdgeType::_internal_mutable_name() { - return _impl_.name_.Mutable(GetArenaForAllocation()); + return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* EdgeType::release_name() { // @@protoc_insertion_point(field_release:gie.EdgeType.name) - return _impl_.name_.Release(); + return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void EdgeType::set_allocated_name(std::string* name) { if (name != nullptr) { @@ -3057,72 +3154,85 @@ inline void EdgeType::set_allocated_name(std::string* name) { } else { } - _impl_.name_.SetAllocated(name, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.name_.IsDefault()) { - _impl_.name_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, + GetArena()); // @@protoc_insertion_point(field_set_allocated:gie.EdgeType.name) } +inline std::string* EdgeType::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:gie.EdgeType.name) + GOOGLE_DCHECK(GetArena() != nullptr); + + return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void EdgeType::unsafe_arena_set_allocated_name( + std::string* name) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (name != nullptr) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + name, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.EdgeType.name) +} // repeated .gie.Property properties = 3; inline int EdgeType::_internal_properties_size() const { - return _impl_.properties_.size(); + return properties_.size(); } inline int EdgeType::properties_size() const { return _internal_properties_size(); } inline void EdgeType::clear_properties() { - _impl_.properties_.Clear(); + properties_.Clear(); } inline ::gie::Property* EdgeType::mutable_properties(int index) { // @@protoc_insertion_point(field_mutable:gie.EdgeType.properties) - return _impl_.properties_.Mutable(index); + return properties_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >* EdgeType::mutable_properties() { // @@protoc_insertion_point(field_mutable_list:gie.EdgeType.properties) - return &_impl_.properties_; + return &properties_; } inline const ::gie::Property& EdgeType::_internal_properties(int index) const { - return _impl_.properties_.Get(index); + return properties_.Get(index); } inline const ::gie::Property& EdgeType::properties(int index) const { // @@protoc_insertion_point(field_get:gie.EdgeType.properties) return _internal_properties(index); } inline ::gie::Property* EdgeType::_internal_add_properties() { - return _impl_.properties_.Add(); + return properties_.Add(); } inline ::gie::Property* EdgeType::add_properties() { - ::gie::Property* _add = _internal_add_properties(); // @@protoc_insertion_point(field_add:gie.EdgeType.properties) - return _add; + return _internal_add_properties(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >& EdgeType::properties() const { // @@protoc_insertion_point(field_list:gie.EdgeType.properties) - return _impl_.properties_; + return properties_; } // repeated string primary_keys = 4; inline int EdgeType::_internal_primary_keys_size() const { - return _impl_.primary_keys_.size(); + return primary_keys_.size(); } inline int EdgeType::primary_keys_size() const { return _internal_primary_keys_size(); } inline void EdgeType::clear_primary_keys() { - _impl_.primary_keys_.Clear(); + primary_keys_.Clear(); } inline std::string* EdgeType::add_primary_keys() { - std::string* _s = _internal_add_primary_keys(); // @@protoc_insertion_point(field_add_mutable:gie.EdgeType.primary_keys) - return _s; + return _internal_add_primary_keys(); } inline const std::string& EdgeType::_internal_primary_keys(int index) const { - return _impl_.primary_keys_.Get(index); + return primary_keys_.Get(index); } inline const std::string& EdgeType::primary_keys(int index) const { // @@protoc_insertion_point(field_get:gie.EdgeType.primary_keys) @@ -3130,113 +3240,112 @@ inline const std::string& EdgeType::primary_keys(int index) const { } inline std::string* EdgeType::mutable_primary_keys(int index) { // @@protoc_insertion_point(field_mutable:gie.EdgeType.primary_keys) - return _impl_.primary_keys_.Mutable(index); + return primary_keys_.Mutable(index); } inline void EdgeType::set_primary_keys(int index, const std::string& value) { - _impl_.primary_keys_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set:gie.EdgeType.primary_keys) + primary_keys_.Mutable(index)->assign(value); } inline void EdgeType::set_primary_keys(int index, std::string&& value) { - _impl_.primary_keys_.Mutable(index)->assign(std::move(value)); // @@protoc_insertion_point(field_set:gie.EdgeType.primary_keys) + primary_keys_.Mutable(index)->assign(std::move(value)); } inline void EdgeType::set_primary_keys(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); - _impl_.primary_keys_.Mutable(index)->assign(value); + primary_keys_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:gie.EdgeType.primary_keys) } inline void EdgeType::set_primary_keys(int index, const char* value, size_t size) { - _impl_.primary_keys_.Mutable(index)->assign( + primary_keys_.Mutable(index)->assign( reinterpret_cast(value), size); // @@protoc_insertion_point(field_set_pointer:gie.EdgeType.primary_keys) } inline std::string* EdgeType::_internal_add_primary_keys() { - return _impl_.primary_keys_.Add(); + return primary_keys_.Add(); } inline void EdgeType::add_primary_keys(const std::string& value) { - _impl_.primary_keys_.Add()->assign(value); + primary_keys_.Add()->assign(value); // @@protoc_insertion_point(field_add:gie.EdgeType.primary_keys) } inline void EdgeType::add_primary_keys(std::string&& value) { - _impl_.primary_keys_.Add(std::move(value)); + primary_keys_.Add(std::move(value)); // @@protoc_insertion_point(field_add:gie.EdgeType.primary_keys) } inline void EdgeType::add_primary_keys(const char* value) { GOOGLE_DCHECK(value != nullptr); - _impl_.primary_keys_.Add()->assign(value); + primary_keys_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:gie.EdgeType.primary_keys) } inline void EdgeType::add_primary_keys(const char* value, size_t size) { - _impl_.primary_keys_.Add()->assign(reinterpret_cast(value), size); + primary_keys_.Add()->assign(reinterpret_cast(value), size); // @@protoc_insertion_point(field_add_pointer:gie.EdgeType.primary_keys) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& EdgeType::primary_keys() const { // @@protoc_insertion_point(field_list:gie.EdgeType.primary_keys) - return _impl_.primary_keys_; + return primary_keys_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* EdgeType::mutable_primary_keys() { // @@protoc_insertion_point(field_mutable_list:gie.EdgeType.primary_keys) - return &_impl_.primary_keys_; + return &primary_keys_; } // repeated .gie.SrcDstPair src_dst_pairs = 5; inline int EdgeType::_internal_src_dst_pairs_size() const { - return _impl_.src_dst_pairs_.size(); + return src_dst_pairs_.size(); } inline int EdgeType::src_dst_pairs_size() const { return _internal_src_dst_pairs_size(); } inline void EdgeType::clear_src_dst_pairs() { - _impl_.src_dst_pairs_.Clear(); + src_dst_pairs_.Clear(); } inline ::gie::SrcDstPair* EdgeType::mutable_src_dst_pairs(int index) { // @@protoc_insertion_point(field_mutable:gie.EdgeType.src_dst_pairs) - return _impl_.src_dst_pairs_.Mutable(index); + return src_dst_pairs_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair >* EdgeType::mutable_src_dst_pairs() { // @@protoc_insertion_point(field_mutable_list:gie.EdgeType.src_dst_pairs) - return &_impl_.src_dst_pairs_; + return &src_dst_pairs_; } inline const ::gie::SrcDstPair& EdgeType::_internal_src_dst_pairs(int index) const { - return _impl_.src_dst_pairs_.Get(index); + return src_dst_pairs_.Get(index); } inline const ::gie::SrcDstPair& EdgeType::src_dst_pairs(int index) const { // @@protoc_insertion_point(field_get:gie.EdgeType.src_dst_pairs) return _internal_src_dst_pairs(index); } inline ::gie::SrcDstPair* EdgeType::_internal_add_src_dst_pairs() { - return _impl_.src_dst_pairs_.Add(); + return src_dst_pairs_.Add(); } inline ::gie::SrcDstPair* EdgeType::add_src_dst_pairs() { - ::gie::SrcDstPair* _add = _internal_add_src_dst_pairs(); // @@protoc_insertion_point(field_add:gie.EdgeType.src_dst_pairs) - return _add; + return _internal_add_src_dst_pairs(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair >& EdgeType::src_dst_pairs() const { // @@protoc_insertion_point(field_list:gie.EdgeType.src_dst_pairs) - return _impl_.src_dst_pairs_; + return src_dst_pairs_; } // int64 total_num = 6; inline void EdgeType::clear_total_num() { - _impl_.total_num_ = int64_t{0}; + total_num_ = PROTOBUF_LONGLONG(0); } -inline int64_t EdgeType::_internal_total_num() const { - return _impl_.total_num_; +inline ::PROTOBUF_NAMESPACE_ID::int64 EdgeType::_internal_total_num() const { + return total_num_; } -inline int64_t EdgeType::total_num() const { +inline ::PROTOBUF_NAMESPACE_ID::int64 EdgeType::total_num() const { // @@protoc_insertion_point(field_get:gie.EdgeType.total_num) return _internal_total_num(); } -inline void EdgeType::_internal_set_total_num(int64_t value) { +inline void EdgeType::_internal_set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value) { - _impl_.total_num_ = value; + total_num_ = value; } -inline void EdgeType::set_total_num(int64_t value) { +inline void EdgeType::set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value) { _internal_set_total_num(value); // @@protoc_insertion_point(field_set:gie.EdgeType.total_num) } @@ -3247,60 +3356,60 @@ inline void EdgeType::set_total_num(int64_t value) { // uint32 num_partitions = 1; inline void Statistics::clear_num_partitions() { - _impl_.num_partitions_ = 0u; + num_partitions_ = 0u; } -inline uint32_t Statistics::_internal_num_partitions() const { - return _impl_.num_partitions_; +inline ::PROTOBUF_NAMESPACE_ID::uint32 Statistics::_internal_num_partitions() const { + return num_partitions_; } -inline uint32_t Statistics::num_partitions() const { +inline ::PROTOBUF_NAMESPACE_ID::uint32 Statistics::num_partitions() const { // @@protoc_insertion_point(field_get:gie.Statistics.num_partitions) return _internal_num_partitions(); } -inline void Statistics::_internal_set_num_partitions(uint32_t value) { +inline void Statistics::_internal_set_num_partitions(::PROTOBUF_NAMESPACE_ID::uint32 value) { - _impl_.num_partitions_ = value; + num_partitions_ = value; } -inline void Statistics::set_num_partitions(uint32_t value) { +inline void Statistics::set_num_partitions(::PROTOBUF_NAMESPACE_ID::uint32 value) { _internal_set_num_partitions(value); // @@protoc_insertion_point(field_set:gie.Statistics.num_partitions) } // uint64 num_vertices = 2; inline void Statistics::clear_num_vertices() { - _impl_.num_vertices_ = uint64_t{0u}; + num_vertices_ = PROTOBUF_ULONGLONG(0); } -inline uint64_t Statistics::_internal_num_vertices() const { - return _impl_.num_vertices_; +inline ::PROTOBUF_NAMESPACE_ID::uint64 Statistics::_internal_num_vertices() const { + return num_vertices_; } -inline uint64_t Statistics::num_vertices() const { +inline ::PROTOBUF_NAMESPACE_ID::uint64 Statistics::num_vertices() const { // @@protoc_insertion_point(field_get:gie.Statistics.num_vertices) return _internal_num_vertices(); } -inline void Statistics::_internal_set_num_vertices(uint64_t value) { +inline void Statistics::_internal_set_num_vertices(::PROTOBUF_NAMESPACE_ID::uint64 value) { - _impl_.num_vertices_ = value; + num_vertices_ = value; } -inline void Statistics::set_num_vertices(uint64_t value) { +inline void Statistics::set_num_vertices(::PROTOBUF_NAMESPACE_ID::uint64 value) { _internal_set_num_vertices(value); // @@protoc_insertion_point(field_set:gie.Statistics.num_vertices) } // uint64 num_edges = 3; inline void Statistics::clear_num_edges() { - _impl_.num_edges_ = uint64_t{0u}; + num_edges_ = PROTOBUF_ULONGLONG(0); } -inline uint64_t Statistics::_internal_num_edges() const { - return _impl_.num_edges_; +inline ::PROTOBUF_NAMESPACE_ID::uint64 Statistics::_internal_num_edges() const { + return num_edges_; } -inline uint64_t Statistics::num_edges() const { +inline ::PROTOBUF_NAMESPACE_ID::uint64 Statistics::num_edges() const { // @@protoc_insertion_point(field_get:gie.Statistics.num_edges) return _internal_num_edges(); } -inline void Statistics::_internal_set_num_edges(uint64_t value) { +inline void Statistics::_internal_set_num_edges(::PROTOBUF_NAMESPACE_ID::uint64 value) { - _impl_.num_edges_ = value; + num_edges_ = value; } -inline void Statistics::set_num_edges(uint64_t value) { +inline void Statistics::set_num_edges(::PROTOBUF_NAMESPACE_ID::uint64 value) { _internal_set_num_edges(value); // @@protoc_insertion_point(field_set:gie.Statistics.num_edges) } @@ -3311,21 +3420,21 @@ inline void Statistics::set_num_edges(uint64_t value) { // .gie.GraphPartitionStrategy partition_strategy = 1; inline bool Schema::_internal_has_partition_strategy() const { - return this != internal_default_instance() && _impl_.partition_strategy_ != nullptr; + return this != internal_default_instance() && partition_strategy_ != nullptr; } inline bool Schema::has_partition_strategy() const { return _internal_has_partition_strategy(); } inline void Schema::clear_partition_strategy() { - if (GetArenaForAllocation() == nullptr && _impl_.partition_strategy_ != nullptr) { - delete _impl_.partition_strategy_; + if (GetArena() == nullptr && partition_strategy_ != nullptr) { + delete partition_strategy_; } - _impl_.partition_strategy_ = nullptr; + partition_strategy_ = nullptr; } inline const ::gie::GraphPartitionStrategy& Schema::_internal_partition_strategy() const { - const ::gie::GraphPartitionStrategy* p = _impl_.partition_strategy_; - return p != nullptr ? *p : reinterpret_cast( - ::gie::_GraphPartitionStrategy_default_instance_); + const ::gie::GraphPartitionStrategy* p = partition_strategy_; + return p != nullptr ? *p : *reinterpret_cast( + &::gie::_GraphPartitionStrategy_default_instance_); } inline const ::gie::GraphPartitionStrategy& Schema::partition_strategy() const { // @@protoc_insertion_point(field_get:gie.Schema.partition_strategy) @@ -3333,10 +3442,10 @@ inline const ::gie::GraphPartitionStrategy& Schema::partition_strategy() const { } inline void Schema::unsafe_arena_set_allocated_partition_strategy( ::gie::GraphPartitionStrategy* partition_strategy) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.partition_strategy_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(partition_strategy_); } - _impl_.partition_strategy_ = partition_strategy; + partition_strategy_ = partition_strategy; if (partition_strategy) { } else { @@ -3345,48 +3454,39 @@ inline void Schema::unsafe_arena_set_allocated_partition_strategy( // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.Schema.partition_strategy) } inline ::gie::GraphPartitionStrategy* Schema::release_partition_strategy() { - - ::gie::GraphPartitionStrategy* temp = _impl_.partition_strategy_; - _impl_.partition_strategy_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { + auto temp = unsafe_arena_release_partition_strategy(); + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } inline ::gie::GraphPartitionStrategy* Schema::unsafe_arena_release_partition_strategy() { // @@protoc_insertion_point(field_release:gie.Schema.partition_strategy) - ::gie::GraphPartitionStrategy* temp = _impl_.partition_strategy_; - _impl_.partition_strategy_ = nullptr; + ::gie::GraphPartitionStrategy* temp = partition_strategy_; + partition_strategy_ = nullptr; return temp; } inline ::gie::GraphPartitionStrategy* Schema::_internal_mutable_partition_strategy() { - if (_impl_.partition_strategy_ == nullptr) { - auto* p = CreateMaybeMessage<::gie::GraphPartitionStrategy>(GetArenaForAllocation()); - _impl_.partition_strategy_ = p; + if (partition_strategy_ == nullptr) { + auto* p = CreateMaybeMessage<::gie::GraphPartitionStrategy>(GetArena()); + partition_strategy_ = p; } - return _impl_.partition_strategy_; + return partition_strategy_; } inline ::gie::GraphPartitionStrategy* Schema::mutable_partition_strategy() { - ::gie::GraphPartitionStrategy* _msg = _internal_mutable_partition_strategy(); // @@protoc_insertion_point(field_mutable:gie.Schema.partition_strategy) - return _msg; + return _internal_mutable_partition_strategy(); } inline void Schema::set_allocated_partition_strategy(::gie::GraphPartitionStrategy* partition_strategy) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); if (message_arena == nullptr) { - delete _impl_.partition_strategy_; + delete partition_strategy_; } if (partition_strategy) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(partition_strategy); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(partition_strategy); if (message_arena != submessage_arena) { partition_strategy = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, partition_strategy, submessage_arena); @@ -3395,107 +3495,105 @@ inline void Schema::set_allocated_partition_strategy(::gie::GraphPartitionStrate } else { } - _impl_.partition_strategy_ = partition_strategy; + partition_strategy_ = partition_strategy; // @@protoc_insertion_point(field_set_allocated:gie.Schema.partition_strategy) } // repeated .gie.VertexType vertex_types = 2; inline int Schema::_internal_vertex_types_size() const { - return _impl_.vertex_types_.size(); + return vertex_types_.size(); } inline int Schema::vertex_types_size() const { return _internal_vertex_types_size(); } inline void Schema::clear_vertex_types() { - _impl_.vertex_types_.Clear(); + vertex_types_.Clear(); } inline ::gie::VertexType* Schema::mutable_vertex_types(int index) { // @@protoc_insertion_point(field_mutable:gie.Schema.vertex_types) - return _impl_.vertex_types_.Mutable(index); + return vertex_types_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType >* Schema::mutable_vertex_types() { // @@protoc_insertion_point(field_mutable_list:gie.Schema.vertex_types) - return &_impl_.vertex_types_; + return &vertex_types_; } inline const ::gie::VertexType& Schema::_internal_vertex_types(int index) const { - return _impl_.vertex_types_.Get(index); + return vertex_types_.Get(index); } inline const ::gie::VertexType& Schema::vertex_types(int index) const { // @@protoc_insertion_point(field_get:gie.Schema.vertex_types) return _internal_vertex_types(index); } inline ::gie::VertexType* Schema::_internal_add_vertex_types() { - return _impl_.vertex_types_.Add(); + return vertex_types_.Add(); } inline ::gie::VertexType* Schema::add_vertex_types() { - ::gie::VertexType* _add = _internal_add_vertex_types(); // @@protoc_insertion_point(field_add:gie.Schema.vertex_types) - return _add; + return _internal_add_vertex_types(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType >& Schema::vertex_types() const { // @@protoc_insertion_point(field_list:gie.Schema.vertex_types) - return _impl_.vertex_types_; + return vertex_types_; } // repeated .gie.EdgeType edge_types = 3; inline int Schema::_internal_edge_types_size() const { - return _impl_.edge_types_.size(); + return edge_types_.size(); } inline int Schema::edge_types_size() const { return _internal_edge_types_size(); } inline void Schema::clear_edge_types() { - _impl_.edge_types_.Clear(); + edge_types_.Clear(); } inline ::gie::EdgeType* Schema::mutable_edge_types(int index) { // @@protoc_insertion_point(field_mutable:gie.Schema.edge_types) - return _impl_.edge_types_.Mutable(index); + return edge_types_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType >* Schema::mutable_edge_types() { // @@protoc_insertion_point(field_mutable_list:gie.Schema.edge_types) - return &_impl_.edge_types_; + return &edge_types_; } inline const ::gie::EdgeType& Schema::_internal_edge_types(int index) const { - return _impl_.edge_types_.Get(index); + return edge_types_.Get(index); } inline const ::gie::EdgeType& Schema::edge_types(int index) const { // @@protoc_insertion_point(field_get:gie.Schema.edge_types) return _internal_edge_types(index); } inline ::gie::EdgeType* Schema::_internal_add_edge_types() { - return _impl_.edge_types_.Add(); + return edge_types_.Add(); } inline ::gie::EdgeType* Schema::add_edge_types() { - ::gie::EdgeType* _add = _internal_add_edge_types(); // @@protoc_insertion_point(field_add:gie.Schema.edge_types) - return _add; + return _internal_add_edge_types(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType >& Schema::edge_types() const { // @@protoc_insertion_point(field_list:gie.Schema.edge_types) - return _impl_.edge_types_; + return edge_types_; } // .gie.Statistics statistics = 4; inline bool Schema::_internal_has_statistics() const { - return this != internal_default_instance() && _impl_.statistics_ != nullptr; + return this != internal_default_instance() && statistics_ != nullptr; } inline bool Schema::has_statistics() const { return _internal_has_statistics(); } inline void Schema::clear_statistics() { - if (GetArenaForAllocation() == nullptr && _impl_.statistics_ != nullptr) { - delete _impl_.statistics_; + if (GetArena() == nullptr && statistics_ != nullptr) { + delete statistics_; } - _impl_.statistics_ = nullptr; + statistics_ = nullptr; } inline const ::gie::Statistics& Schema::_internal_statistics() const { - const ::gie::Statistics* p = _impl_.statistics_; - return p != nullptr ? *p : reinterpret_cast( - ::gie::_Statistics_default_instance_); + const ::gie::Statistics* p = statistics_; + return p != nullptr ? *p : *reinterpret_cast( + &::gie::_Statistics_default_instance_); } inline const ::gie::Statistics& Schema::statistics() const { // @@protoc_insertion_point(field_get:gie.Schema.statistics) @@ -3503,10 +3601,10 @@ inline const ::gie::Statistics& Schema::statistics() const { } inline void Schema::unsafe_arena_set_allocated_statistics( ::gie::Statistics* statistics) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.statistics_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(statistics_); } - _impl_.statistics_ = statistics; + statistics_ = statistics; if (statistics) { } else { @@ -3515,48 +3613,39 @@ inline void Schema::unsafe_arena_set_allocated_statistics( // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.Schema.statistics) } inline ::gie::Statistics* Schema::release_statistics() { - - ::gie::Statistics* temp = _impl_.statistics_; - _impl_.statistics_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { + auto temp = unsafe_arena_release_statistics(); + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } inline ::gie::Statistics* Schema::unsafe_arena_release_statistics() { // @@protoc_insertion_point(field_release:gie.Schema.statistics) - ::gie::Statistics* temp = _impl_.statistics_; - _impl_.statistics_ = nullptr; + ::gie::Statistics* temp = statistics_; + statistics_ = nullptr; return temp; } inline ::gie::Statistics* Schema::_internal_mutable_statistics() { - if (_impl_.statistics_ == nullptr) { - auto* p = CreateMaybeMessage<::gie::Statistics>(GetArenaForAllocation()); - _impl_.statistics_ = p; + if (statistics_ == nullptr) { + auto* p = CreateMaybeMessage<::gie::Statistics>(GetArena()); + statistics_ = p; } - return _impl_.statistics_; + return statistics_; } inline ::gie::Statistics* Schema::mutable_statistics() { - ::gie::Statistics* _msg = _internal_mutable_statistics(); // @@protoc_insertion_point(field_mutable:gie.Schema.statistics) - return _msg; + return _internal_mutable_statistics(); } inline void Schema::set_allocated_statistics(::gie::Statistics* statistics) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); if (message_arena == nullptr) { - delete _impl_.statistics_; + delete statistics_; } if (statistics) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(statistics); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(statistics); if (message_arena != submessage_arena) { statistics = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, statistics, submessage_arena); @@ -3565,7 +3654,7 @@ inline void Schema::set_allocated_statistics(::gie::Statistics* statistics) { } else { } - _impl_.statistics_ = statistics; + statistics_ = statistics; // @@protoc_insertion_point(field_set_allocated:gie.Schema.statistics) } diff --git a/modules/graph/grin/src/proto/graph.pb.cc b/modules/graph/grin/src/proto/graph.pb.cc index 56cc7ed80..e73759c2d 100644 --- a/modules/graph/grin/src/proto/graph.pb.cc +++ b/modules/graph/grin/src/proto/graph.pb.cc @@ -14,384 +14,389 @@ #include // @@protoc_insertion_point(includes) #include +extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_EdgePropertyFeature_graph_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_IndexFeature_graph_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MirrorPartitionListFeature_graph_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PartitionFeature_graph_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PredicateFeature_graph_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_PropertyFeature_graph_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Statistics_graph_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<5> scc_info_StorageFeature_graph_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TopologyFeature_graph_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_VertexPropertyFeature_graph_2eproto; +namespace grin { +class TopologyFeatureDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _TopologyFeature_default_instance_; +class MirrorPartitionListFeatureDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _MirrorPartitionListFeature_default_instance_; +class PartitionFeatureDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _PartitionFeature_default_instance_; +class VertexPropertyFeatureDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _VertexPropertyFeature_default_instance_; +class EdgePropertyFeatureDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _EdgePropertyFeature_default_instance_; +class PropertyFeatureDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _PropertyFeature_default_instance_; +class IndexFeatureDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _IndexFeature_default_instance_; +class PredicateFeatureDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _PredicateFeature_default_instance_; +class StorageFeatureDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; + const ::grin::TopologyFeature* topology_feature_; + const ::grin::PartitionFeature* partition_feature_; + const ::grin::PropertyFeature* property_feature_; + const ::grin::IndexFeature* index_feature_; + const ::grin::PredicateFeature* predicate_feature_; +} _StorageFeature_default_instance_; +class StatisticsDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Statistics_default_instance_; +class GraphDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _Graph_default_instance_; +} // namespace grin +static void InitDefaultsscc_info_EdgePropertyFeature_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; -PROTOBUF_PRAGMA_INIT_SEG + { + void* ptr = &::grin::_EdgePropertyFeature_default_instance_; + new (ptr) ::grin::EdgePropertyFeature(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::EdgePropertyFeature::InitAsDefaultInstance(); +} -namespace _pb = ::PROTOBUF_NAMESPACE_ID; -namespace _pbi = _pb::internal; +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_EdgePropertyFeature_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_EdgePropertyFeature_graph_2eproto}, {}}; -namespace grin { -PROTOBUF_CONSTEXPR TopologyFeature::TopologyFeature( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.vertex_list_retrievals_)*/{} - , /*decltype(_impl_._vertex_list_retrievals_cached_byte_size_)*/{0} - , /*decltype(_impl_.edge_list_retrievals_)*/{} - , /*decltype(_impl_._edge_list_retrievals_cached_byte_size_)*/{0} - , /*decltype(_impl_.adjacent_list_retrievals_)*/{} - , /*decltype(_impl_._adjacent_list_retrievals_cached_byte_size_)*/{0} - , /*decltype(_impl_.grin_assume_has_directed_graph_)*/false - , /*decltype(_impl_.grin_assume_has_undirected_graph_)*/false - , /*decltype(_impl_.grin_assume_has_multi_edge_graph_)*/false - , /*decltype(_impl_.grin_with_vertex_original_id_)*/false - , /*decltype(_impl_.grin_with_vertex_data_)*/false - , /*decltype(_impl_.grin_with_edge_data_)*/false - , /*decltype(_impl_._cached_size_)*/{}} {} -struct TopologyFeatureDefaultTypeInternal { - PROTOBUF_CONSTEXPR TopologyFeatureDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~TopologyFeatureDefaultTypeInternal() {} - union { - TopologyFeature _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TopologyFeatureDefaultTypeInternal _TopologyFeature_default_instance_; -PROTOBUF_CONSTEXPR MirrorPartitionListFeature::MirrorPartitionListFeature( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.grin_trait_master_vertex_mirror_partition_list_)*/false - , /*decltype(_impl_.grin_trait_mirror_vertex_mirror_partition_list_)*/false - , /*decltype(_impl_.grin_trait_master_edge_mirror_partition_list_)*/false - , /*decltype(_impl_.grin_trait_mirror_edge_mirror_partition_list_)*/false - , /*decltype(_impl_._cached_size_)*/{}} {} -struct MirrorPartitionListFeatureDefaultTypeInternal { - PROTOBUF_CONSTEXPR MirrorPartitionListFeatureDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~MirrorPartitionListFeatureDefaultTypeInternal() {} - union { - MirrorPartitionListFeature _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MirrorPartitionListFeatureDefaultTypeInternal _MirrorPartitionListFeature_default_instance_; -PROTOBUF_CONSTEXPR PartitionFeature::PartitionFeature( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.mirror_partition_list_feature_)*/nullptr - , /*decltype(_impl_.graph_partition_strategy_)*/0 - , /*decltype(_impl_.grin_trait_natural_id_for_partition_)*/false - , /*decltype(_impl_.grin_enable_vertex_ref_)*/false - , /*decltype(_impl_.grin_enable_edge_ref_)*/false - , /*decltype(_impl_.grin_trait_select_master_for_vertex_list_)*/false - , /*decltype(_impl_.vertex_data_)*/0 - , /*decltype(_impl_.edge_data_)*/0 - , /*decltype(_impl_.grin_trait_select_partition_for_vertex_list_)*/false - , /*decltype(_impl_.grin_trait_select_master_for_edge_list_)*/false - , /*decltype(_impl_.grin_trait_select_partition_for_edge_list_)*/false - , /*decltype(_impl_.grin_trait_select_master_neighbor_for_adjacent_list_)*/false - , /*decltype(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_)*/false - , /*decltype(_impl_._cached_size_)*/{}} {} -struct PartitionFeatureDefaultTypeInternal { - PROTOBUF_CONSTEXPR PartitionFeatureDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~PartitionFeatureDefaultTypeInternal() {} - union { - PartitionFeature _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PartitionFeatureDefaultTypeInternal _PartitionFeature_default_instance_; -PROTOBUF_CONSTEXPR VertexPropertyFeature::VertexPropertyFeature( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.grin_with_vertex_property_)*/false - , /*decltype(_impl_.grin_with_vertex_property_name_)*/false - , /*decltype(_impl_.grin_with_vertex_type_name_)*/false - , /*decltype(_impl_.grin_enable_vertex_property_table_)*/false - , /*decltype(_impl_.grin_enable_vertex_primary_keys_)*/false - , /*decltype(_impl_.grin_trait_natural_id_for_vertex_type_)*/false - , /*decltype(_impl_.grin_trait_natural_id_for_vertex_property_)*/false - , /*decltype(_impl_.grin_assume_by_type_vertex_original_id_)*/false - , /*decltype(_impl_._cached_size_)*/{}} {} -struct VertexPropertyFeatureDefaultTypeInternal { - PROTOBUF_CONSTEXPR VertexPropertyFeatureDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~VertexPropertyFeatureDefaultTypeInternal() {} - union { - VertexPropertyFeature _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 VertexPropertyFeatureDefaultTypeInternal _VertexPropertyFeature_default_instance_; -PROTOBUF_CONSTEXPR EdgePropertyFeature::EdgePropertyFeature( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.grin_with_edge_property_)*/false - , /*decltype(_impl_.grin_with_edge_property_name_)*/false - , /*decltype(_impl_.grin_with_edge_type_name_)*/false - , /*decltype(_impl_.grin_enable_edge_property_table_)*/false - , /*decltype(_impl_.grin_enable_edge_primary_keys_)*/false - , /*decltype(_impl_.grin_trait_natural_id_for_edge_type_)*/false - , /*decltype(_impl_.grin_trait_natural_id_for_edge_property_)*/false - , /*decltype(_impl_._cached_size_)*/{}} {} -struct EdgePropertyFeatureDefaultTypeInternal { - PROTOBUF_CONSTEXPR EdgePropertyFeatureDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~EdgePropertyFeatureDefaultTypeInternal() {} - union { - EdgePropertyFeature _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EdgePropertyFeatureDefaultTypeInternal _EdgePropertyFeature_default_instance_; -PROTOBUF_CONSTEXPR PropertyFeature::PropertyFeature( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.vertex_property_feature_)*/nullptr - , /*decltype(_impl_.edge_property_feature_)*/nullptr - , /*decltype(_impl_.vertex_property_)*/0 - , /*decltype(_impl_.edge_property_)*/0 - , /*decltype(_impl_.grin_enable_row_)*/false - , /*decltype(_impl_.grin_assume_column_store_for_vertex_property_)*/false - , /*decltype(_impl_.grin_assume_column_store_for_edge_property_)*/false - , /*decltype(_impl_.grin_trait_select_type_for_vertex_list_)*/false - , /*decltype(_impl_.grin_trait_select_type_for_edge_list_)*/false - , /*decltype(_impl_.grin_trait_select_neighbor_type_for_adjacent_list_)*/false - , /*decltype(_impl_.grin_trait_select_edge_type_for_adjacent_list_)*/false - , /*decltype(_impl_.grin_trait_specific_vev_relation_)*/false - , /*decltype(_impl_._cached_size_)*/{}} {} -struct PropertyFeatureDefaultTypeInternal { - PROTOBUF_CONSTEXPR PropertyFeatureDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~PropertyFeatureDefaultTypeInternal() {} - union { - PropertyFeature _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PropertyFeatureDefaultTypeInternal _PropertyFeature_default_instance_; -PROTOBUF_CONSTEXPR IndexFeature::IndexFeature( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.grin_with_vertex_label_)*/false - , /*decltype(_impl_.grin_with_edge_label_)*/false - , /*decltype(_impl_.grin_assume_all_vertex_list_sorted_)*/false - , /*decltype(_impl_._cached_size_)*/{}} {} -struct IndexFeatureDefaultTypeInternal { - PROTOBUF_CONSTEXPR IndexFeatureDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~IndexFeatureDefaultTypeInternal() {} - union { - IndexFeature _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 IndexFeatureDefaultTypeInternal _IndexFeature_default_instance_; -PROTOBUF_CONSTEXPR PredicateFeature::PredicateFeature( - ::_pbi::ConstantInitialized) {} -struct PredicateFeatureDefaultTypeInternal { - PROTOBUF_CONSTEXPR PredicateFeatureDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~PredicateFeatureDefaultTypeInternal() {} - union { - PredicateFeature _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PredicateFeatureDefaultTypeInternal _PredicateFeature_default_instance_; -PROTOBUF_CONSTEXPR StorageFeature::StorageFeature( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.specific_feature_)*/{} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{}} {} -struct StorageFeatureDefaultTypeInternal { - PROTOBUF_CONSTEXPR StorageFeatureDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~StorageFeatureDefaultTypeInternal() {} - union { - StorageFeature _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StorageFeatureDefaultTypeInternal _StorageFeature_default_instance_; -PROTOBUF_CONSTEXPR Statistics::Statistics( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.vertex_count_)*/0 - , /*decltype(_impl_.edge_count_)*/0 - , /*decltype(_impl_.partition_count_)*/0 - , /*decltype(_impl_.vertex_type_count_)*/0 - , /*decltype(_impl_.edge_type_count_)*/0 - , /*decltype(_impl_._cached_size_)*/{}} {} -struct StatisticsDefaultTypeInternal { - PROTOBUF_CONSTEXPR StatisticsDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~StatisticsDefaultTypeInternal() {} - union { - Statistics _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 StatisticsDefaultTypeInternal _Statistics_default_instance_; -PROTOBUF_CONSTEXPR Graph::Graph( - ::_pbi::ConstantInitialized): _impl_{ - /*decltype(_impl_.features_)*/{} - , /*decltype(_impl_.uri_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.grin_version_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}} - , /*decltype(_impl_.statistics_)*/nullptr - , /*decltype(_impl_._cached_size_)*/{}} {} -struct GraphDefaultTypeInternal { - PROTOBUF_CONSTEXPR GraphDefaultTypeInternal() - : _instance(::_pbi::ConstantInitialized{}) {} - ~GraphDefaultTypeInternal() {} - union { - Graph _instance; - }; -}; -PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GraphDefaultTypeInternal _Graph_default_instance_; -} // namespace grin -static ::_pb::Metadata file_level_metadata_graph_2eproto[11]; -static const ::_pb::EnumDescriptor* file_level_enum_descriptors_graph_2eproto[3]; -static constexpr ::_pb::ServiceDescriptor const** file_level_service_descriptors_graph_2eproto = nullptr; +static void InitDefaultsscc_info_Graph_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::grin::_Graph_default_instance_; + new (ptr) ::grin::Graph(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::Graph::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Graph_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_Graph_graph_2eproto}, { + &scc_info_StorageFeature_graph_2eproto.base, + &scc_info_Statistics_graph_2eproto.base,}}; + +static void InitDefaultsscc_info_IndexFeature_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::grin::_IndexFeature_default_instance_; + new (ptr) ::grin::IndexFeature(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::IndexFeature::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_IndexFeature_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_IndexFeature_graph_2eproto}, {}}; + +static void InitDefaultsscc_info_MirrorPartitionListFeature_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::grin::_MirrorPartitionListFeature_default_instance_; + new (ptr) ::grin::MirrorPartitionListFeature(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::MirrorPartitionListFeature::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MirrorPartitionListFeature_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MirrorPartitionListFeature_graph_2eproto}, {}}; + +static void InitDefaultsscc_info_PartitionFeature_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::grin::_PartitionFeature_default_instance_; + new (ptr) ::grin::PartitionFeature(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::PartitionFeature::InitAsDefaultInstance(); +} -const uint32_t TableStruct_graph_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PartitionFeature_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_PartitionFeature_graph_2eproto}, { + &scc_info_MirrorPartitionListFeature_graph_2eproto.base,}}; + +static void InitDefaultsscc_info_PredicateFeature_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::grin::_PredicateFeature_default_instance_; + new (ptr) ::grin::PredicateFeature(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::PredicateFeature::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PredicateFeature_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_PredicateFeature_graph_2eproto}, {}}; + +static void InitDefaultsscc_info_PropertyFeature_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::grin::_PropertyFeature_default_instance_; + new (ptr) ::grin::PropertyFeature(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::PropertyFeature::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_PropertyFeature_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_PropertyFeature_graph_2eproto}, { + &scc_info_VertexPropertyFeature_graph_2eproto.base, + &scc_info_EdgePropertyFeature_graph_2eproto.base,}}; + +static void InitDefaultsscc_info_Statistics_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::grin::_Statistics_default_instance_; + new (ptr) ::grin::Statistics(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::Statistics::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Statistics_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Statistics_graph_2eproto}, {}}; + +static void InitDefaultsscc_info_StorageFeature_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::grin::_StorageFeature_default_instance_; + new (ptr) ::grin::StorageFeature(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::StorageFeature::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<5> scc_info_StorageFeature_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 5, 0, InitDefaultsscc_info_StorageFeature_graph_2eproto}, { + &scc_info_TopologyFeature_graph_2eproto.base, + &scc_info_PartitionFeature_graph_2eproto.base, + &scc_info_PropertyFeature_graph_2eproto.base, + &scc_info_IndexFeature_graph_2eproto.base, + &scc_info_PredicateFeature_graph_2eproto.base,}}; + +static void InitDefaultsscc_info_TopologyFeature_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::grin::_TopologyFeature_default_instance_; + new (ptr) ::grin::TopologyFeature(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::TopologyFeature::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TopologyFeature_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_TopologyFeature_graph_2eproto}, {}}; + +static void InitDefaultsscc_info_VertexPropertyFeature_graph_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::grin::_VertexPropertyFeature_default_instance_; + new (ptr) ::grin::VertexPropertyFeature(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::grin::VertexPropertyFeature::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_VertexPropertyFeature_graph_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_VertexPropertyFeature_graph_2eproto}, {}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_graph_2eproto[11]; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_graph_2eproto[3]; +static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_graph_2eproto = nullptr; + +const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_graph_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_assume_has_directed_graph_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_assume_has_undirected_graph_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_assume_has_multi_edge_graph_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_with_vertex_original_id_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_with_vertex_data_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.grin_with_edge_data_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.vertex_list_retrievals_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.edge_list_retrievals_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _impl_.adjacent_list_retrievals_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_assume_has_directed_graph_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_assume_has_undirected_graph_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_assume_has_multi_edge_graph_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_with_vertex_original_id_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_with_vertex_data_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_with_edge_data_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, vertex_list_retrievals_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, edge_list_retrievals_), + PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, adjacent_list_retrievals_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _impl_.grin_trait_master_vertex_mirror_partition_list_), - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _impl_.grin_trait_mirror_vertex_mirror_partition_list_), - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _impl_.grin_trait_master_edge_mirror_partition_list_), - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _impl_.grin_trait_mirror_edge_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, grin_trait_master_vertex_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, grin_trait_mirror_vertex_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, grin_trait_master_edge_mirror_partition_list_), + PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, grin_trait_mirror_edge_mirror_partition_list_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.graph_partition_strategy_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_natural_id_for_partition_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_enable_vertex_ref_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_enable_edge_ref_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.vertex_data_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.edge_data_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.mirror_partition_list_feature_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_master_for_vertex_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_partition_for_vertex_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_master_for_edge_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_partition_for_edge_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_master_neighbor_for_adjacent_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, graph_partition_strategy_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_natural_id_for_partition_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_enable_vertex_ref_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_enable_edge_ref_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, vertex_data_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, edge_data_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, mirror_partition_list_feature_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_master_for_vertex_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_partition_for_vertex_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_master_for_edge_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_partition_for_edge_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_master_neighbor_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_neighbor_partition_for_adjacent_list_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_with_vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_with_vertex_property_name_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_with_vertex_type_name_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_enable_vertex_property_table_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_enable_vertex_primary_keys_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_trait_natural_id_for_vertex_type_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_trait_natural_id_for_vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _impl_.grin_assume_by_type_vertex_original_id_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_with_vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_with_vertex_property_name_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_with_vertex_type_name_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_enable_vertex_property_table_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_enable_vertex_primary_keys_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_trait_natural_id_for_vertex_type_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_trait_natural_id_for_vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_assume_by_type_vertex_original_id_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_with_edge_property_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_with_edge_property_name_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_with_edge_type_name_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_enable_edge_property_table_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_enable_edge_primary_keys_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_trait_natural_id_for_edge_type_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _impl_.grin_trait_natural_id_for_edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_with_edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_with_edge_property_name_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_with_edge_type_name_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_enable_edge_property_table_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_enable_edge_primary_keys_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_trait_natural_id_for_edge_type_), + PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_trait_natural_id_for_edge_property_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_enable_row_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.vertex_property_feature_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.edge_property_feature_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.edge_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_assume_column_store_for_vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_assume_column_store_for_edge_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_trait_select_type_for_vertex_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_trait_select_type_for_edge_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_trait_select_neighbor_type_for_adjacent_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_trait_select_edge_type_for_adjacent_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _impl_.grin_trait_specific_vev_relation_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_enable_row_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, vertex_property_feature_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, edge_property_feature_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_assume_column_store_for_vertex_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_assume_column_store_for_edge_property_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_trait_select_type_for_vertex_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_trait_select_type_for_edge_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_trait_select_neighbor_type_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_trait_select_edge_type_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_trait_specific_vev_relation_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, _impl_.grin_with_vertex_label_), - PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, _impl_.grin_with_edge_label_), - PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, _impl_.grin_assume_all_vertex_list_sorted_), + PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, grin_with_vertex_label_), + PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, grin_with_edge_label_), + PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, grin_assume_all_vertex_list_sorted_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::PredicateFeature, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, _internal_metadata_), ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, _impl_._oneof_case_[0]), + PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, _oneof_case_[0]), ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - ::_pbi::kInvalidFieldOffsetTag, - PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, _impl_.specific_feature_), + offsetof(::grin::StorageFeatureDefaultTypeInternal, topology_feature_), + offsetof(::grin::StorageFeatureDefaultTypeInternal, partition_feature_), + offsetof(::grin::StorageFeatureDefaultTypeInternal, property_feature_), + offsetof(::grin::StorageFeatureDefaultTypeInternal, index_feature_), + offsetof(::grin::StorageFeatureDefaultTypeInternal, predicate_feature_), + PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, specific_feature_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::Statistics, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::Statistics, _impl_.vertex_count_), - PROTOBUF_FIELD_OFFSET(::grin::Statistics, _impl_.edge_count_), - PROTOBUF_FIELD_OFFSET(::grin::Statistics, _impl_.partition_count_), - PROTOBUF_FIELD_OFFSET(::grin::Statistics, _impl_.vertex_type_count_), - PROTOBUF_FIELD_OFFSET(::grin::Statistics, _impl_.edge_type_count_), + PROTOBUF_FIELD_OFFSET(::grin::Statistics, vertex_count_), + PROTOBUF_FIELD_OFFSET(::grin::Statistics, edge_count_), + PROTOBUF_FIELD_OFFSET(::grin::Statistics, partition_count_), + PROTOBUF_FIELD_OFFSET(::grin::Statistics, vertex_type_count_), + PROTOBUF_FIELD_OFFSET(::grin::Statistics, edge_type_count_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::Graph, _internal_metadata_), ~0u, // no _extensions_ ~0u, // no _oneof_case_ ~0u, // no _weak_field_map_ - ~0u, // no _inlined_string_donated_ - PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.uri_), - PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.grin_version_), - PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.features_), - PROTOBUF_FIELD_OFFSET(::grin::Graph, _impl_.statistics_), + PROTOBUF_FIELD_OFFSET(::grin::Graph, uri_), + PROTOBUF_FIELD_OFFSET(::grin::Graph, grin_version_), + PROTOBUF_FIELD_OFFSET(::grin::Graph, features_), + PROTOBUF_FIELD_OFFSET(::grin::Graph, statistics_), }; -static const ::_pbi::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, -1, sizeof(::grin::TopologyFeature)}, - { 15, -1, -1, sizeof(::grin::MirrorPartitionListFeature)}, - { 25, -1, -1, sizeof(::grin::PartitionFeature)}, - { 44, -1, -1, sizeof(::grin::VertexPropertyFeature)}, - { 58, -1, -1, sizeof(::grin::EdgePropertyFeature)}, - { 71, -1, -1, sizeof(::grin::PropertyFeature)}, - { 89, -1, -1, sizeof(::grin::IndexFeature)}, - { 98, -1, -1, sizeof(::grin::PredicateFeature)}, - { 104, -1, -1, sizeof(::grin::StorageFeature)}, - { 116, -1, -1, sizeof(::grin::Statistics)}, - { 127, -1, -1, sizeof(::grin::Graph)}, +static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::grin::TopologyFeature)}, + { 14, -1, sizeof(::grin::MirrorPartitionListFeature)}, + { 23, -1, sizeof(::grin::PartitionFeature)}, + { 41, -1, sizeof(::grin::VertexPropertyFeature)}, + { 54, -1, sizeof(::grin::EdgePropertyFeature)}, + { 66, -1, sizeof(::grin::PropertyFeature)}, + { 83, -1, sizeof(::grin::IndexFeature)}, + { 91, -1, sizeof(::grin::PredicateFeature)}, + { 96, -1, sizeof(::grin::StorageFeature)}, + { 107, -1, sizeof(::grin::Statistics)}, + { 117, -1, sizeof(::grin::Graph)}, }; -static const ::_pb::Message* const file_default_instances[] = { - &::grin::_TopologyFeature_default_instance_._instance, - &::grin::_MirrorPartitionListFeature_default_instance_._instance, - &::grin::_PartitionFeature_default_instance_._instance, - &::grin::_VertexPropertyFeature_default_instance_._instance, - &::grin::_EdgePropertyFeature_default_instance_._instance, - &::grin::_PropertyFeature_default_instance_._instance, - &::grin::_IndexFeature_default_instance_._instance, - &::grin::_PredicateFeature_default_instance_._instance, - &::grin::_StorageFeature_default_instance_._instance, - &::grin::_Statistics_default_instance_._instance, - &::grin::_Graph_default_instance_._instance, +static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::grin::_TopologyFeature_default_instance_), + reinterpret_cast(&::grin::_MirrorPartitionListFeature_default_instance_), + reinterpret_cast(&::grin::_PartitionFeature_default_instance_), + reinterpret_cast(&::grin::_VertexPropertyFeature_default_instance_), + reinterpret_cast(&::grin::_EdgePropertyFeature_default_instance_), + reinterpret_cast(&::grin::_PropertyFeature_default_instance_), + reinterpret_cast(&::grin::_IndexFeature_default_instance_), + reinterpret_cast(&::grin::_PredicateFeature_default_instance_), + reinterpret_cast(&::grin::_StorageFeature_default_instance_), + reinterpret_cast(&::grin::_Statistics_default_instance_), + reinterpret_cast(&::grin::_Graph_default_instance_), }; const char descriptor_table_protodef_graph_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = @@ -489,21 +494,31 @@ const char descriptor_table_protodef_graph_2eproto[] PROTOBUF_SECTION_VARIABLE(p "_REPLICATE_MASTER_MIRROR\020\002\022\034\n\030PDPS_SPLIT" "_MASTER_MIRROR\020\003b\006proto3" ; -static ::_pbi::once_flag descriptor_table_graph_2eproto_once; -const ::_pbi::DescriptorTable descriptor_table_graph_2eproto = { - false, false, 3704, descriptor_table_protodef_graph_2eproto, - "graph.proto", - &descriptor_table_graph_2eproto_once, nullptr, 0, 11, - schemas, file_default_instances, TableStruct_graph_2eproto::offsets, - file_level_metadata_graph_2eproto, file_level_enum_descriptors_graph_2eproto, - file_level_service_descriptors_graph_2eproto, +static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_graph_2eproto_deps[1] = { +}; +static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_graph_2eproto_sccs[11] = { + &scc_info_EdgePropertyFeature_graph_2eproto.base, + &scc_info_Graph_graph_2eproto.base, + &scc_info_IndexFeature_graph_2eproto.base, + &scc_info_MirrorPartitionListFeature_graph_2eproto.base, + &scc_info_PartitionFeature_graph_2eproto.base, + &scc_info_PredicateFeature_graph_2eproto.base, + &scc_info_PropertyFeature_graph_2eproto.base, + &scc_info_Statistics_graph_2eproto.base, + &scc_info_StorageFeature_graph_2eproto.base, + &scc_info_TopologyFeature_graph_2eproto.base, + &scc_info_VertexPropertyFeature_graph_2eproto.base, +}; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_graph_2eproto_once; +const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_graph_2eproto = { + false, false, descriptor_table_protodef_graph_2eproto, "graph.proto", 3704, + &descriptor_table_graph_2eproto_once, descriptor_table_graph_2eproto_sccs, descriptor_table_graph_2eproto_deps, 11, 0, + schemas, file_default_instances, TableStruct_graph_2eproto::offsets, + file_level_metadata_graph_2eproto, 11, file_level_enum_descriptors_graph_2eproto, file_level_service_descriptors_graph_2eproto, }; -PROTOBUF_ATTRIBUTE_WEAK const ::_pbi::DescriptorTable* descriptor_table_graph_2eproto_getter() { - return &descriptor_table_graph_2eproto; -} // Force running AddDescriptors() at dynamic initialization time. -PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::_pbi::AddDescriptorsRunner dynamic_init_dummy_graph_2eproto(&descriptor_table_graph_2eproto); +static bool dynamic_init_dummy_graph_2eproto = (static_cast(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_graph_2eproto)), true); namespace grin { const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ListRetrieval_descriptor() { ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_graph_2eproto); @@ -556,281 +571,255 @@ bool PropertyDataPartitionStrategy_IsValid(int value) { // =================================================================== +void TopologyFeature::InitAsDefaultInstance() { +} class TopologyFeature::_Internal { public: }; -TopologyFeature::TopologyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +TopologyFeature::TopologyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena), + vertex_list_retrievals_(arena), + edge_list_retrievals_(arena), + adjacent_list_retrievals_(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.TopologyFeature) } TopologyFeature::TopologyFeature(const TopologyFeature& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - TopologyFeature* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.vertex_list_retrievals_){from._impl_.vertex_list_retrievals_} - , /*decltype(_impl_._vertex_list_retrievals_cached_byte_size_)*/{0} - , decltype(_impl_.edge_list_retrievals_){from._impl_.edge_list_retrievals_} - , /*decltype(_impl_._edge_list_retrievals_cached_byte_size_)*/{0} - , decltype(_impl_.adjacent_list_retrievals_){from._impl_.adjacent_list_retrievals_} - , /*decltype(_impl_._adjacent_list_retrievals_cached_byte_size_)*/{0} - , decltype(_impl_.grin_assume_has_directed_graph_){} - , decltype(_impl_.grin_assume_has_undirected_graph_){} - , decltype(_impl_.grin_assume_has_multi_edge_graph_){} - , decltype(_impl_.grin_with_vertex_original_id_){} - , decltype(_impl_.grin_with_vertex_data_){} - , decltype(_impl_.grin_with_edge_data_){} - , /*decltype(_impl_._cached_size_)*/{}}; - + : ::PROTOBUF_NAMESPACE_ID::Message(), + vertex_list_retrievals_(from.vertex_list_retrievals_), + edge_list_retrievals_(from.edge_list_retrievals_), + adjacent_list_retrievals_(from.adjacent_list_retrievals_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.grin_assume_has_directed_graph_, &from._impl_.grin_assume_has_directed_graph_, - static_cast(reinterpret_cast(&_impl_.grin_with_edge_data_) - - reinterpret_cast(&_impl_.grin_assume_has_directed_graph_)) + sizeof(_impl_.grin_with_edge_data_)); + ::memcpy(&grin_assume_has_directed_graph_, &from.grin_assume_has_directed_graph_, + static_cast(reinterpret_cast(&grin_with_edge_data_) - + reinterpret_cast(&grin_assume_has_directed_graph_)) + sizeof(grin_with_edge_data_)); // @@protoc_insertion_point(copy_constructor:grin.TopologyFeature) } -inline void TopologyFeature::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.vertex_list_retrievals_){arena} - , /*decltype(_impl_._vertex_list_retrievals_cached_byte_size_)*/{0} - , decltype(_impl_.edge_list_retrievals_){arena} - , /*decltype(_impl_._edge_list_retrievals_cached_byte_size_)*/{0} - , decltype(_impl_.adjacent_list_retrievals_){arena} - , /*decltype(_impl_._adjacent_list_retrievals_cached_byte_size_)*/{0} - , decltype(_impl_.grin_assume_has_directed_graph_){false} - , decltype(_impl_.grin_assume_has_undirected_graph_){false} - , decltype(_impl_.grin_assume_has_multi_edge_graph_){false} - , decltype(_impl_.grin_with_vertex_original_id_){false} - , decltype(_impl_.grin_with_vertex_data_){false} - , decltype(_impl_.grin_with_edge_data_){false} - , /*decltype(_impl_._cached_size_)*/{} - }; +void TopologyFeature::SharedCtor() { + ::memset(&grin_assume_has_directed_graph_, 0, static_cast( + reinterpret_cast(&grin_with_edge_data_) - + reinterpret_cast(&grin_assume_has_directed_graph_)) + sizeof(grin_with_edge_data_)); } TopologyFeature::~TopologyFeature() { // @@protoc_insertion_point(destructor:grin.TopologyFeature) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void TopologyFeature::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.vertex_list_retrievals_.~RepeatedField(); - _impl_.edge_list_retrievals_.~RepeatedField(); - _impl_.adjacent_list_retrievals_.~RepeatedField(); +void TopologyFeature::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); } +void TopologyFeature::ArenaDtor(void* object) { + TopologyFeature* _this = reinterpret_cast< TopologyFeature* >(object); + (void)_this; +} +void TopologyFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void TopologyFeature::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const TopologyFeature& TopologyFeature::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TopologyFeature_graph_2eproto.base); + return *internal_default_instance(); } + void TopologyFeature::Clear() { // @@protoc_insertion_point(message_clear_start:grin.TopologyFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.vertex_list_retrievals_.Clear(); - _impl_.edge_list_retrievals_.Clear(); - _impl_.adjacent_list_retrievals_.Clear(); - ::memset(&_impl_.grin_assume_has_directed_graph_, 0, static_cast( - reinterpret_cast(&_impl_.grin_with_edge_data_) - - reinterpret_cast(&_impl_.grin_assume_has_directed_graph_)) + sizeof(_impl_.grin_with_edge_data_)); + vertex_list_retrievals_.Clear(); + edge_list_retrievals_.Clear(); + adjacent_list_retrievals_.Clear(); + ::memset(&grin_assume_has_directed_graph_, 0, static_cast( + reinterpret_cast(&grin_with_edge_data_) - + reinterpret_cast(&grin_assume_has_directed_graph_)) + sizeof(grin_with_edge_data_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* TopologyFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* TopologyFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // bool grin_assume_has_directed_graph = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.grin_assume_has_directed_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + grin_assume_has_directed_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_assume_has_undirected_graph = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _impl_.grin_assume_has_undirected_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + grin_assume_has_undirected_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_assume_has_multi_edge_graph = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - _impl_.grin_assume_has_multi_edge_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + grin_assume_has_multi_edge_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_with_vertex_original_id = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _impl_.grin_with_vertex_original_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + grin_with_vertex_original_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_with_vertex_data = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _impl_.grin_with_vertex_data_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + grin_with_vertex_data_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_with_edge_data = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - _impl_.grin_with_edge_data_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + grin_with_edge_data_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated .grin.ListRetrieval vertex_list_retrievals = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_vertex_list_retrievals(), ptr, ctx); CHK_(ptr); - } else if (static_cast(tag) == 56) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_add_vertex_list_retrievals(static_cast<::grin::ListRetrieval>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated .grin.ListRetrieval edge_list_retrievals = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 66)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_edge_list_retrievals(), ptr, ctx); CHK_(ptr); - } else if (static_cast(tag) == 64) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_add_edge_list_retrievals(static_cast<::grin::ListRetrieval>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 74)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_adjacent_list_retrievals(), ptr, ctx); CHK_(ptr); - } else if (static_cast(tag) == 72) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_add_adjacent_list_retrievals(static_cast<::grin::ListRetrieval>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* TopologyFeature::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* TopologyFeature::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:grin.TopologyFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // bool grin_assume_has_directed_graph = 1; - if (this->_internal_grin_assume_has_directed_graph() != 0) { + if (this->grin_assume_has_directed_graph() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_assume_has_directed_graph(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_assume_has_directed_graph(), target); } // bool grin_assume_has_undirected_graph = 2; - if (this->_internal_grin_assume_has_undirected_graph() != 0) { + if (this->grin_assume_has_undirected_graph() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_assume_has_undirected_graph(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_assume_has_undirected_graph(), target); } // bool grin_assume_has_multi_edge_graph = 3; - if (this->_internal_grin_assume_has_multi_edge_graph() != 0) { + if (this->grin_assume_has_multi_edge_graph() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_assume_has_multi_edge_graph(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_assume_has_multi_edge_graph(), target); } // bool grin_with_vertex_original_id = 4; - if (this->_internal_grin_with_vertex_original_id() != 0) { + if (this->grin_with_vertex_original_id() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_with_vertex_original_id(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_with_vertex_original_id(), target); } // bool grin_with_vertex_data = 5; - if (this->_internal_grin_with_vertex_data() != 0) { + if (this->grin_with_vertex_data() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_with_vertex_data(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_with_vertex_data(), target); } // bool grin_with_edge_data = 6; - if (this->_internal_grin_with_edge_data() != 0) { + if (this->grin_with_edge_data() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_with_edge_data(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_with_edge_data(), target); } // repeated .grin.ListRetrieval vertex_list_retrievals = 7; { - int byte_size = _impl_._vertex_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); + int byte_size = _vertex_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); if (byte_size > 0) { target = stream->WriteEnumPacked( - 7, _impl_.vertex_list_retrievals_, byte_size, target); + 7, vertex_list_retrievals_, byte_size, target); } } // repeated .grin.ListRetrieval edge_list_retrievals = 8; { - int byte_size = _impl_._edge_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); + int byte_size = _edge_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); if (byte_size > 0) { target = stream->WriteEnumPacked( - 8, _impl_.edge_list_retrievals_, byte_size, target); + 8, edge_list_retrievals_, byte_size, target); } } // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; { - int byte_size = _impl_._adjacent_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); + int byte_size = _adjacent_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); if (byte_size > 0) { target = stream->WriteEnumPacked( - 9, _impl_.adjacent_list_retrievals_, byte_size, target); + 9, adjacent_list_retrievals_, byte_size, target); } } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:grin.TopologyFeature) @@ -841,7 +830,7 @@ size_t TopologyFeature::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:grin.TopologyFeature) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -849,15 +838,16 @@ size_t TopologyFeature::ByteSizeLong() const { { size_t data_size = 0; unsigned int count = static_cast(this->_internal_vertex_list_retrievals_size());for (unsigned int i = 0; i < count; i++) { - data_size += ::_pbi::WireFormatLite::EnumSize( + data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize( this->_internal_vertex_list_retrievals(static_cast(i))); } if (data_size > 0) { total_size += 1 + - ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); } - int cached_size = ::_pbi::ToCachedSize(data_size); - _impl_._vertex_list_retrievals_cached_byte_size_.store(cached_size, + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); + _vertex_list_retrievals_cached_byte_size_.store(cached_size, std::memory_order_relaxed); total_size += data_size; } @@ -866,15 +856,16 @@ size_t TopologyFeature::ByteSizeLong() const { { size_t data_size = 0; unsigned int count = static_cast(this->_internal_edge_list_retrievals_size());for (unsigned int i = 0; i < count; i++) { - data_size += ::_pbi::WireFormatLite::EnumSize( + data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize( this->_internal_edge_list_retrievals(static_cast(i))); } if (data_size > 0) { total_size += 1 + - ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); } - int cached_size = ::_pbi::ToCachedSize(data_size); - _impl_._edge_list_retrievals_cached_byte_size_.store(cached_size, + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); + _edge_list_retrievals_cached_byte_size_.store(cached_size, std::memory_order_relaxed); total_size += data_size; } @@ -883,89 +874,109 @@ size_t TopologyFeature::ByteSizeLong() const { { size_t data_size = 0; unsigned int count = static_cast(this->_internal_adjacent_list_retrievals_size());for (unsigned int i = 0; i < count; i++) { - data_size += ::_pbi::WireFormatLite::EnumSize( + data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize( this->_internal_adjacent_list_retrievals(static_cast(i))); } if (data_size > 0) { total_size += 1 + - ::_pbi::WireFormatLite::Int32Size(static_cast(data_size)); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); } - int cached_size = ::_pbi::ToCachedSize(data_size); - _impl_._adjacent_list_retrievals_cached_byte_size_.store(cached_size, + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); + _adjacent_list_retrievals_cached_byte_size_.store(cached_size, std::memory_order_relaxed); total_size += data_size; } // bool grin_assume_has_directed_graph = 1; - if (this->_internal_grin_assume_has_directed_graph() != 0) { + if (this->grin_assume_has_directed_graph() != 0) { total_size += 1 + 1; } // bool grin_assume_has_undirected_graph = 2; - if (this->_internal_grin_assume_has_undirected_graph() != 0) { + if (this->grin_assume_has_undirected_graph() != 0) { total_size += 1 + 1; } // bool grin_assume_has_multi_edge_graph = 3; - if (this->_internal_grin_assume_has_multi_edge_graph() != 0) { + if (this->grin_assume_has_multi_edge_graph() != 0) { total_size += 1 + 1; } // bool grin_with_vertex_original_id = 4; - if (this->_internal_grin_with_vertex_original_id() != 0) { + if (this->grin_with_vertex_original_id() != 0) { total_size += 1 + 1; } // bool grin_with_vertex_data = 5; - if (this->_internal_grin_with_vertex_data() != 0) { + if (this->grin_with_vertex_data() != 0) { total_size += 1 + 1; } // bool grin_with_edge_data = 6; - if (this->_internal_grin_with_edge_data() != 0) { + if (this->grin_with_edge_data() != 0) { total_size += 1 + 1; } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData TopologyFeature::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - TopologyFeature::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*TopologyFeature::GetClassData() const { return &_class_data_; } - +void TopologyFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.TopologyFeature) + GOOGLE_DCHECK_NE(&from, this); + const TopologyFeature* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.TopologyFeature) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.TopologyFeature) + MergeFrom(*source); + } +} -void TopologyFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.TopologyFeature) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void TopologyFeature::MergeFrom(const TopologyFeature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.TopologyFeature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.vertex_list_retrievals_.MergeFrom(from._impl_.vertex_list_retrievals_); - _this->_impl_.edge_list_retrievals_.MergeFrom(from._impl_.edge_list_retrievals_); - _this->_impl_.adjacent_list_retrievals_.MergeFrom(from._impl_.adjacent_list_retrievals_); - if (from._internal_grin_assume_has_directed_graph() != 0) { - _this->_internal_set_grin_assume_has_directed_graph(from._internal_grin_assume_has_directed_graph()); + vertex_list_retrievals_.MergeFrom(from.vertex_list_retrievals_); + edge_list_retrievals_.MergeFrom(from.edge_list_retrievals_); + adjacent_list_retrievals_.MergeFrom(from.adjacent_list_retrievals_); + if (from.grin_assume_has_directed_graph() != 0) { + _internal_set_grin_assume_has_directed_graph(from._internal_grin_assume_has_directed_graph()); } - if (from._internal_grin_assume_has_undirected_graph() != 0) { - _this->_internal_set_grin_assume_has_undirected_graph(from._internal_grin_assume_has_undirected_graph()); + if (from.grin_assume_has_undirected_graph() != 0) { + _internal_set_grin_assume_has_undirected_graph(from._internal_grin_assume_has_undirected_graph()); } - if (from._internal_grin_assume_has_multi_edge_graph() != 0) { - _this->_internal_set_grin_assume_has_multi_edge_graph(from._internal_grin_assume_has_multi_edge_graph()); + if (from.grin_assume_has_multi_edge_graph() != 0) { + _internal_set_grin_assume_has_multi_edge_graph(from._internal_grin_assume_has_multi_edge_graph()); } - if (from._internal_grin_with_vertex_original_id() != 0) { - _this->_internal_set_grin_with_vertex_original_id(from._internal_grin_with_vertex_original_id()); + if (from.grin_with_vertex_original_id() != 0) { + _internal_set_grin_with_vertex_original_id(from._internal_grin_with_vertex_original_id()); } - if (from._internal_grin_with_vertex_data() != 0) { - _this->_internal_set_grin_with_vertex_data(from._internal_grin_with_vertex_data()); + if (from.grin_with_vertex_data() != 0) { + _internal_set_grin_with_vertex_data(from._internal_grin_with_vertex_data()); } - if (from._internal_grin_with_edge_data() != 0) { - _this->_internal_set_grin_with_edge_data(from._internal_grin_with_edge_data()); + if (from.grin_with_edge_data() != 0) { + _internal_set_grin_with_edge_data(from._internal_grin_with_edge_data()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void TopologyFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.TopologyFeature) + if (&from == this) return; + Clear(); + MergeFrom(from); } void TopologyFeature::CopyFrom(const TopologyFeature& from) { @@ -981,188 +992,179 @@ bool TopologyFeature::IsInitialized() const { void TopologyFeature::InternalSwap(TopologyFeature* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.vertex_list_retrievals_.InternalSwap(&other->_impl_.vertex_list_retrievals_); - _impl_.edge_list_retrievals_.InternalSwap(&other->_impl_.edge_list_retrievals_); - _impl_.adjacent_list_retrievals_.InternalSwap(&other->_impl_.adjacent_list_retrievals_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + vertex_list_retrievals_.InternalSwap(&other->vertex_list_retrievals_); + edge_list_retrievals_.InternalSwap(&other->edge_list_retrievals_); + adjacent_list_retrievals_.InternalSwap(&other->adjacent_list_retrievals_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(TopologyFeature, _impl_.grin_with_edge_data_) - + sizeof(TopologyFeature::_impl_.grin_with_edge_data_) - - PROTOBUF_FIELD_OFFSET(TopologyFeature, _impl_.grin_assume_has_directed_graph_)>( - reinterpret_cast(&_impl_.grin_assume_has_directed_graph_), - reinterpret_cast(&other->_impl_.grin_assume_has_directed_graph_)); + PROTOBUF_FIELD_OFFSET(TopologyFeature, grin_with_edge_data_) + + sizeof(TopologyFeature::grin_with_edge_data_) + - PROTOBUF_FIELD_OFFSET(TopologyFeature, grin_assume_has_directed_graph_)>( + reinterpret_cast(&grin_assume_has_directed_graph_), + reinterpret_cast(&other->grin_assume_has_directed_graph_)); } ::PROTOBUF_NAMESPACE_ID::Metadata TopologyFeature::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[0]); + return GetMetadataStatic(); } + // =================================================================== +void MirrorPartitionListFeature::InitAsDefaultInstance() { +} class MirrorPartitionListFeature::_Internal { public: }; -MirrorPartitionListFeature::MirrorPartitionListFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +MirrorPartitionListFeature::MirrorPartitionListFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.MirrorPartitionListFeature) } MirrorPartitionListFeature::MirrorPartitionListFeature(const MirrorPartitionListFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - MirrorPartitionListFeature* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.grin_trait_master_vertex_mirror_partition_list_){} - , decltype(_impl_.grin_trait_mirror_vertex_mirror_partition_list_){} - , decltype(_impl_.grin_trait_master_edge_mirror_partition_list_){} - , decltype(_impl_.grin_trait_mirror_edge_mirror_partition_list_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.grin_trait_master_vertex_mirror_partition_list_, &from._impl_.grin_trait_master_vertex_mirror_partition_list_, - static_cast(reinterpret_cast(&_impl_.grin_trait_mirror_edge_mirror_partition_list_) - - reinterpret_cast(&_impl_.grin_trait_master_vertex_mirror_partition_list_)) + sizeof(_impl_.grin_trait_mirror_edge_mirror_partition_list_)); + ::memcpy(&grin_trait_master_vertex_mirror_partition_list_, &from.grin_trait_master_vertex_mirror_partition_list_, + static_cast(reinterpret_cast(&grin_trait_mirror_edge_mirror_partition_list_) - + reinterpret_cast(&grin_trait_master_vertex_mirror_partition_list_)) + sizeof(grin_trait_mirror_edge_mirror_partition_list_)); // @@protoc_insertion_point(copy_constructor:grin.MirrorPartitionListFeature) } -inline void MirrorPartitionListFeature::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.grin_trait_master_vertex_mirror_partition_list_){false} - , decltype(_impl_.grin_trait_mirror_vertex_mirror_partition_list_){false} - , decltype(_impl_.grin_trait_master_edge_mirror_partition_list_){false} - , decltype(_impl_.grin_trait_mirror_edge_mirror_partition_list_){false} - , /*decltype(_impl_._cached_size_)*/{} - }; +void MirrorPartitionListFeature::SharedCtor() { + ::memset(&grin_trait_master_vertex_mirror_partition_list_, 0, static_cast( + reinterpret_cast(&grin_trait_mirror_edge_mirror_partition_list_) - + reinterpret_cast(&grin_trait_master_vertex_mirror_partition_list_)) + sizeof(grin_trait_mirror_edge_mirror_partition_list_)); } MirrorPartitionListFeature::~MirrorPartitionListFeature() { // @@protoc_insertion_point(destructor:grin.MirrorPartitionListFeature) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void MirrorPartitionListFeature::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +void MirrorPartitionListFeature::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); } +void MirrorPartitionListFeature::ArenaDtor(void* object) { + MirrorPartitionListFeature* _this = reinterpret_cast< MirrorPartitionListFeature* >(object); + (void)_this; +} +void MirrorPartitionListFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void MirrorPartitionListFeature::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const MirrorPartitionListFeature& MirrorPartitionListFeature::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MirrorPartitionListFeature_graph_2eproto.base); + return *internal_default_instance(); } + void MirrorPartitionListFeature::Clear() { // @@protoc_insertion_point(message_clear_start:grin.MirrorPartitionListFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - ::memset(&_impl_.grin_trait_master_vertex_mirror_partition_list_, 0, static_cast( - reinterpret_cast(&_impl_.grin_trait_mirror_edge_mirror_partition_list_) - - reinterpret_cast(&_impl_.grin_trait_master_vertex_mirror_partition_list_)) + sizeof(_impl_.grin_trait_mirror_edge_mirror_partition_list_)); + ::memset(&grin_trait_master_vertex_mirror_partition_list_, 0, static_cast( + reinterpret_cast(&grin_trait_mirror_edge_mirror_partition_list_) - + reinterpret_cast(&grin_trait_master_vertex_mirror_partition_list_)) + sizeof(grin_trait_mirror_edge_mirror_partition_list_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* MirrorPartitionListFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* MirrorPartitionListFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // bool grin_trait_master_vertex_mirror_partition_list = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.grin_trait_master_vertex_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + grin_trait_master_vertex_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_mirror_vertex_mirror_partition_list = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _impl_.grin_trait_mirror_vertex_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + grin_trait_mirror_vertex_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_master_edge_mirror_partition_list = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - _impl_.grin_trait_master_edge_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + grin_trait_master_edge_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_mirror_edge_mirror_partition_list = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _impl_.grin_trait_mirror_edge_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + grin_trait_mirror_edge_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* MirrorPartitionListFeature::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* MirrorPartitionListFeature::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:grin.MirrorPartitionListFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // bool grin_trait_master_vertex_mirror_partition_list = 1; - if (this->_internal_grin_trait_master_vertex_mirror_partition_list() != 0) { + if (this->grin_trait_master_vertex_mirror_partition_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_trait_master_vertex_mirror_partition_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_trait_master_vertex_mirror_partition_list(), target); } // bool grin_trait_mirror_vertex_mirror_partition_list = 2; - if (this->_internal_grin_trait_mirror_vertex_mirror_partition_list() != 0) { + if (this->grin_trait_mirror_vertex_mirror_partition_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_trait_mirror_vertex_mirror_partition_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_trait_mirror_vertex_mirror_partition_list(), target); } // bool grin_trait_master_edge_mirror_partition_list = 3; - if (this->_internal_grin_trait_master_edge_mirror_partition_list() != 0) { + if (this->grin_trait_master_edge_mirror_partition_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_trait_master_edge_mirror_partition_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_trait_master_edge_mirror_partition_list(), target); } // bool grin_trait_mirror_edge_mirror_partition_list = 4; - if (this->_internal_grin_trait_mirror_edge_mirror_partition_list() != 0) { + if (this->grin_trait_mirror_edge_mirror_partition_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_trait_mirror_edge_mirror_partition_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_trait_mirror_edge_mirror_partition_list(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:grin.MirrorPartitionListFeature) @@ -1173,61 +1175,80 @@ size_t MirrorPartitionListFeature::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:grin.MirrorPartitionListFeature) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // bool grin_trait_master_vertex_mirror_partition_list = 1; - if (this->_internal_grin_trait_master_vertex_mirror_partition_list() != 0) { + if (this->grin_trait_master_vertex_mirror_partition_list() != 0) { total_size += 1 + 1; } // bool grin_trait_mirror_vertex_mirror_partition_list = 2; - if (this->_internal_grin_trait_mirror_vertex_mirror_partition_list() != 0) { + if (this->grin_trait_mirror_vertex_mirror_partition_list() != 0) { total_size += 1 + 1; } // bool grin_trait_master_edge_mirror_partition_list = 3; - if (this->_internal_grin_trait_master_edge_mirror_partition_list() != 0) { + if (this->grin_trait_master_edge_mirror_partition_list() != 0) { total_size += 1 + 1; } // bool grin_trait_mirror_edge_mirror_partition_list = 4; - if (this->_internal_grin_trait_mirror_edge_mirror_partition_list() != 0) { + if (this->grin_trait_mirror_edge_mirror_partition_list() != 0) { total_size += 1 + 1; } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData MirrorPartitionListFeature::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - MirrorPartitionListFeature::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*MirrorPartitionListFeature::GetClassData() const { return &_class_data_; } - +void MirrorPartitionListFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.MirrorPartitionListFeature) + GOOGLE_DCHECK_NE(&from, this); + const MirrorPartitionListFeature* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.MirrorPartitionListFeature) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.MirrorPartitionListFeature) + MergeFrom(*source); + } +} -void MirrorPartitionListFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.MirrorPartitionListFeature) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void MirrorPartitionListFeature::MergeFrom(const MirrorPartitionListFeature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.MirrorPartitionListFeature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_grin_trait_master_vertex_mirror_partition_list() != 0) { - _this->_internal_set_grin_trait_master_vertex_mirror_partition_list(from._internal_grin_trait_master_vertex_mirror_partition_list()); + if (from.grin_trait_master_vertex_mirror_partition_list() != 0) { + _internal_set_grin_trait_master_vertex_mirror_partition_list(from._internal_grin_trait_master_vertex_mirror_partition_list()); } - if (from._internal_grin_trait_mirror_vertex_mirror_partition_list() != 0) { - _this->_internal_set_grin_trait_mirror_vertex_mirror_partition_list(from._internal_grin_trait_mirror_vertex_mirror_partition_list()); + if (from.grin_trait_mirror_vertex_mirror_partition_list() != 0) { + _internal_set_grin_trait_mirror_vertex_mirror_partition_list(from._internal_grin_trait_mirror_vertex_mirror_partition_list()); } - if (from._internal_grin_trait_master_edge_mirror_partition_list() != 0) { - _this->_internal_set_grin_trait_master_edge_mirror_partition_list(from._internal_grin_trait_master_edge_mirror_partition_list()); + if (from.grin_trait_master_edge_mirror_partition_list() != 0) { + _internal_set_grin_trait_master_edge_mirror_partition_list(from._internal_grin_trait_master_edge_mirror_partition_list()); } - if (from._internal_grin_trait_mirror_edge_mirror_partition_list() != 0) { - _this->_internal_set_grin_trait_mirror_edge_mirror_partition_list(from._internal_grin_trait_mirror_edge_mirror_partition_list()); + if (from.grin_trait_mirror_edge_mirror_partition_list() != 0) { + _internal_set_grin_trait_mirror_edge_mirror_partition_list(from._internal_grin_trait_mirror_edge_mirror_partition_list()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void MirrorPartitionListFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.MirrorPartitionListFeature) + if (&from == this) return; + Clear(); + MergeFrom(from); } void MirrorPartitionListFeature::CopyFrom(const MirrorPartitionListFeature& from) { @@ -1243,23 +1264,26 @@ bool MirrorPartitionListFeature::IsInitialized() const { void MirrorPartitionListFeature::InternalSwap(MirrorPartitionListFeature* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MirrorPartitionListFeature, _impl_.grin_trait_mirror_edge_mirror_partition_list_) - + sizeof(MirrorPartitionListFeature::_impl_.grin_trait_mirror_edge_mirror_partition_list_) - - PROTOBUF_FIELD_OFFSET(MirrorPartitionListFeature, _impl_.grin_trait_master_vertex_mirror_partition_list_)>( - reinterpret_cast(&_impl_.grin_trait_master_vertex_mirror_partition_list_), - reinterpret_cast(&other->_impl_.grin_trait_master_vertex_mirror_partition_list_)); + PROTOBUF_FIELD_OFFSET(MirrorPartitionListFeature, grin_trait_mirror_edge_mirror_partition_list_) + + sizeof(MirrorPartitionListFeature::grin_trait_mirror_edge_mirror_partition_list_) + - PROTOBUF_FIELD_OFFSET(MirrorPartitionListFeature, grin_trait_master_vertex_mirror_partition_list_)>( + reinterpret_cast(&grin_trait_master_vertex_mirror_partition_list_), + reinterpret_cast(&other->grin_trait_master_vertex_mirror_partition_list_)); } ::PROTOBUF_NAMESPACE_ID::Metadata MirrorPartitionListFeature::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[1]); + return GetMetadataStatic(); } + // =================================================================== +void PartitionFeature::InitAsDefaultInstance() { + ::grin::_PartitionFeature_default_instance_._instance.get_mutable()->mirror_partition_list_feature_ = const_cast< ::grin::MirrorPartitionListFeature*>( + ::grin::MirrorPartitionListFeature::internal_default_instance()); +} class PartitionFeature::_Internal { public: static const ::grin::MirrorPartitionListFeature& mirror_partition_list_feature(const PartitionFeature* msg); @@ -1267,325 +1291,292 @@ class PartitionFeature::_Internal { const ::grin::MirrorPartitionListFeature& PartitionFeature::_Internal::mirror_partition_list_feature(const PartitionFeature* msg) { - return *msg->_impl_.mirror_partition_list_feature_; + return *msg->mirror_partition_list_feature_; } -PartitionFeature::PartitionFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +PartitionFeature::PartitionFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.PartitionFeature) } PartitionFeature::PartitionFeature(const PartitionFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - PartitionFeature* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.mirror_partition_list_feature_){nullptr} - , decltype(_impl_.graph_partition_strategy_){} - , decltype(_impl_.grin_trait_natural_id_for_partition_){} - , decltype(_impl_.grin_enable_vertex_ref_){} - , decltype(_impl_.grin_enable_edge_ref_){} - , decltype(_impl_.grin_trait_select_master_for_vertex_list_){} - , decltype(_impl_.vertex_data_){} - , decltype(_impl_.edge_data_){} - , decltype(_impl_.grin_trait_select_partition_for_vertex_list_){} - , decltype(_impl_.grin_trait_select_master_for_edge_list_){} - , decltype(_impl_.grin_trait_select_partition_for_edge_list_){} - , decltype(_impl_.grin_trait_select_master_neighbor_for_adjacent_list_){} - , decltype(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); if (from._internal_has_mirror_partition_list_feature()) { - _this->_impl_.mirror_partition_list_feature_ = new ::grin::MirrorPartitionListFeature(*from._impl_.mirror_partition_list_feature_); + mirror_partition_list_feature_ = new ::grin::MirrorPartitionListFeature(*from.mirror_partition_list_feature_); + } else { + mirror_partition_list_feature_ = nullptr; } - ::memcpy(&_impl_.graph_partition_strategy_, &from._impl_.graph_partition_strategy_, - static_cast(reinterpret_cast(&_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) - - reinterpret_cast(&_impl_.graph_partition_strategy_)) + sizeof(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_)); + ::memcpy(&graph_partition_strategy_, &from.graph_partition_strategy_, + static_cast(reinterpret_cast(&grin_trait_select_neighbor_partition_for_adjacent_list_) - + reinterpret_cast(&graph_partition_strategy_)) + sizeof(grin_trait_select_neighbor_partition_for_adjacent_list_)); // @@protoc_insertion_point(copy_constructor:grin.PartitionFeature) } -inline void PartitionFeature::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.mirror_partition_list_feature_){nullptr} - , decltype(_impl_.graph_partition_strategy_){0} - , decltype(_impl_.grin_trait_natural_id_for_partition_){false} - , decltype(_impl_.grin_enable_vertex_ref_){false} - , decltype(_impl_.grin_enable_edge_ref_){false} - , decltype(_impl_.grin_trait_select_master_for_vertex_list_){false} - , decltype(_impl_.vertex_data_){0} - , decltype(_impl_.edge_data_){0} - , decltype(_impl_.grin_trait_select_partition_for_vertex_list_){false} - , decltype(_impl_.grin_trait_select_master_for_edge_list_){false} - , decltype(_impl_.grin_trait_select_partition_for_edge_list_){false} - , decltype(_impl_.grin_trait_select_master_neighbor_for_adjacent_list_){false} - , decltype(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_){false} - , /*decltype(_impl_._cached_size_)*/{} - }; +void PartitionFeature::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PartitionFeature_graph_2eproto.base); + ::memset(&mirror_partition_list_feature_, 0, static_cast( + reinterpret_cast(&grin_trait_select_neighbor_partition_for_adjacent_list_) - + reinterpret_cast(&mirror_partition_list_feature_)) + sizeof(grin_trait_select_neighbor_partition_for_adjacent_list_)); } PartitionFeature::~PartitionFeature() { // @@protoc_insertion_point(destructor:grin.PartitionFeature) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void PartitionFeature::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.mirror_partition_list_feature_; +void PartitionFeature::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + if (this != internal_default_instance()) delete mirror_partition_list_feature_; } +void PartitionFeature::ArenaDtor(void* object) { + PartitionFeature* _this = reinterpret_cast< PartitionFeature* >(object); + (void)_this; +} +void PartitionFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void PartitionFeature::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); } +const PartitionFeature& PartitionFeature::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PartitionFeature_graph_2eproto.base); + return *internal_default_instance(); +} + void PartitionFeature::Clear() { // @@protoc_insertion_point(message_clear_start:grin.PartitionFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (GetArenaForAllocation() == nullptr && _impl_.mirror_partition_list_feature_ != nullptr) { - delete _impl_.mirror_partition_list_feature_; + if (GetArena() == nullptr && mirror_partition_list_feature_ != nullptr) { + delete mirror_partition_list_feature_; } - _impl_.mirror_partition_list_feature_ = nullptr; - ::memset(&_impl_.graph_partition_strategy_, 0, static_cast( - reinterpret_cast(&_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) - - reinterpret_cast(&_impl_.graph_partition_strategy_)) + sizeof(_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_)); + mirror_partition_list_feature_ = nullptr; + ::memset(&graph_partition_strategy_, 0, static_cast( + reinterpret_cast(&grin_trait_select_neighbor_partition_for_adjacent_list_) - + reinterpret_cast(&graph_partition_strategy_)) + sizeof(grin_trait_select_neighbor_partition_for_adjacent_list_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* PartitionFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* PartitionFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // .grin.GraphPartitionStrategy graph_partition_strategy = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_graph_partition_strategy(static_cast<::grin::GraphPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_natural_id_for_partition = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _impl_.grin_trait_natural_id_for_partition_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + grin_trait_natural_id_for_partition_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_enable_vertex_ref = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - _impl_.grin_enable_vertex_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + grin_enable_vertex_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_enable_edge_ref = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _impl_.grin_enable_edge_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + grin_enable_edge_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.PropertyDataPartitionStrategy vertex_data = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_vertex_data(static_cast<::grin::PropertyDataPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.PropertyDataPartitionStrategy edge_data = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_edge_data(static_cast<::grin::PropertyDataPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 58)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { ptr = ctx->ParseMessage(_internal_mutable_mirror_partition_list_feature(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_select_master_for_vertex_list = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { - _impl_.grin_trait_select_master_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { + grin_trait_select_master_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_select_partition_for_vertex_list = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 72)) { - _impl_.grin_trait_select_partition_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { + grin_trait_select_partition_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_select_master_for_edge_list = 10; case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { - _impl_.grin_trait_select_master_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { + grin_trait_select_master_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_select_partition_for_edge_list = 11; case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 88)) { - _impl_.grin_trait_select_partition_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) { + grin_trait_select_partition_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 96)) { - _impl_.grin_trait_select_master_neighbor_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) { + grin_trait_select_master_neighbor_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 104)) { - _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) { + grin_trait_select_neighbor_partition_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* PartitionFeature::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* PartitionFeature::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:grin.PartitionFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // .grin.GraphPartitionStrategy graph_partition_strategy = 1; - if (this->_internal_graph_partition_strategy() != 0) { + if (this->graph_partition_strategy() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 1, this->_internal_graph_partition_strategy(), target); } // bool grin_trait_natural_id_for_partition = 2; - if (this->_internal_grin_trait_natural_id_for_partition() != 0) { + if (this->grin_trait_natural_id_for_partition() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_trait_natural_id_for_partition(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_trait_natural_id_for_partition(), target); } // bool grin_enable_vertex_ref = 3; - if (this->_internal_grin_enable_vertex_ref() != 0) { + if (this->grin_enable_vertex_ref() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_enable_vertex_ref(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_enable_vertex_ref(), target); } // bool grin_enable_edge_ref = 4; - if (this->_internal_grin_enable_edge_ref() != 0) { + if (this->grin_enable_edge_ref() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_edge_ref(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_edge_ref(), target); } // .grin.PropertyDataPartitionStrategy vertex_data = 5; - if (this->_internal_vertex_data() != 0) { + if (this->vertex_data() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 5, this->_internal_vertex_data(), target); } // .grin.PropertyDataPartitionStrategy edge_data = 6; - if (this->_internal_edge_data() != 0) { + if (this->edge_data() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 6, this->_internal_edge_data(), target); } // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; - if (this->_internal_has_mirror_partition_list_feature()) { + if (this->has_mirror_partition_list_feature()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(7, _Internal::mirror_partition_list_feature(this), - _Internal::mirror_partition_list_feature(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 7, _Internal::mirror_partition_list_feature(this), target, stream); } // bool grin_trait_select_master_for_vertex_list = 8; - if (this->_internal_grin_trait_select_master_for_vertex_list() != 0) { + if (this->grin_trait_select_master_for_vertex_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_trait_select_master_for_vertex_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_trait_select_master_for_vertex_list(), target); } // bool grin_trait_select_partition_for_vertex_list = 9; - if (this->_internal_grin_trait_select_partition_for_vertex_list() != 0) { + if (this->grin_trait_select_partition_for_vertex_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_grin_trait_select_partition_for_vertex_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(9, this->_internal_grin_trait_select_partition_for_vertex_list(), target); } // bool grin_trait_select_master_for_edge_list = 10; - if (this->_internal_grin_trait_select_master_for_edge_list() != 0) { + if (this->grin_trait_select_master_for_edge_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(10, this->_internal_grin_trait_select_master_for_edge_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(10, this->_internal_grin_trait_select_master_for_edge_list(), target); } // bool grin_trait_select_partition_for_edge_list = 11; - if (this->_internal_grin_trait_select_partition_for_edge_list() != 0) { + if (this->grin_trait_select_partition_for_edge_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(11, this->_internal_grin_trait_select_partition_for_edge_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(11, this->_internal_grin_trait_select_partition_for_edge_list(), target); } // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; - if (this->_internal_grin_trait_select_master_neighbor_for_adjacent_list() != 0) { + if (this->grin_trait_select_master_neighbor_for_adjacent_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_grin_trait_select_master_neighbor_for_adjacent_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(12, this->_internal_grin_trait_select_master_neighbor_for_adjacent_list(), target); } // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; - if (this->_internal_grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { + if (this->grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(13, this->_internal_grin_trait_select_neighbor_partition_for_adjacent_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(13, this->_internal_grin_trait_select_neighbor_partition_for_adjacent_list(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:grin.PartitionFeature) @@ -1596,139 +1587,157 @@ size_t PartitionFeature::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:grin.PartitionFeature) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; - if (this->_internal_has_mirror_partition_list_feature()) { + if (this->has_mirror_partition_list_feature()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.mirror_partition_list_feature_); + *mirror_partition_list_feature_); } // .grin.GraphPartitionStrategy graph_partition_strategy = 1; - if (this->_internal_graph_partition_strategy() != 0) { + if (this->graph_partition_strategy() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_graph_partition_strategy()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_graph_partition_strategy()); } // bool grin_trait_natural_id_for_partition = 2; - if (this->_internal_grin_trait_natural_id_for_partition() != 0) { + if (this->grin_trait_natural_id_for_partition() != 0) { total_size += 1 + 1; } // bool grin_enable_vertex_ref = 3; - if (this->_internal_grin_enable_vertex_ref() != 0) { + if (this->grin_enable_vertex_ref() != 0) { total_size += 1 + 1; } // bool grin_enable_edge_ref = 4; - if (this->_internal_grin_enable_edge_ref() != 0) { + if (this->grin_enable_edge_ref() != 0) { total_size += 1 + 1; } // bool grin_trait_select_master_for_vertex_list = 8; - if (this->_internal_grin_trait_select_master_for_vertex_list() != 0) { + if (this->grin_trait_select_master_for_vertex_list() != 0) { total_size += 1 + 1; } // .grin.PropertyDataPartitionStrategy vertex_data = 5; - if (this->_internal_vertex_data() != 0) { + if (this->vertex_data() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_vertex_data()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_vertex_data()); } // .grin.PropertyDataPartitionStrategy edge_data = 6; - if (this->_internal_edge_data() != 0) { + if (this->edge_data() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_edge_data()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_edge_data()); } // bool grin_trait_select_partition_for_vertex_list = 9; - if (this->_internal_grin_trait_select_partition_for_vertex_list() != 0) { + if (this->grin_trait_select_partition_for_vertex_list() != 0) { total_size += 1 + 1; } // bool grin_trait_select_master_for_edge_list = 10; - if (this->_internal_grin_trait_select_master_for_edge_list() != 0) { + if (this->grin_trait_select_master_for_edge_list() != 0) { total_size += 1 + 1; } // bool grin_trait_select_partition_for_edge_list = 11; - if (this->_internal_grin_trait_select_partition_for_edge_list() != 0) { + if (this->grin_trait_select_partition_for_edge_list() != 0) { total_size += 1 + 1; } // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; - if (this->_internal_grin_trait_select_master_neighbor_for_adjacent_list() != 0) { + if (this->grin_trait_select_master_neighbor_for_adjacent_list() != 0) { total_size += 1 + 1; } // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; - if (this->_internal_grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { + if (this->grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { total_size += 1 + 1; } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PartitionFeature::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - PartitionFeature::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PartitionFeature::GetClassData() const { return &_class_data_; } - +void PartitionFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.PartitionFeature) + GOOGLE_DCHECK_NE(&from, this); + const PartitionFeature* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.PartitionFeature) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.PartitionFeature) + MergeFrom(*source); + } +} -void PartitionFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.PartitionFeature) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void PartitionFeature::MergeFrom(const PartitionFeature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.PartitionFeature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_has_mirror_partition_list_feature()) { - _this->_internal_mutable_mirror_partition_list_feature()->::grin::MirrorPartitionListFeature::MergeFrom( - from._internal_mirror_partition_list_feature()); + if (from.has_mirror_partition_list_feature()) { + _internal_mutable_mirror_partition_list_feature()->::grin::MirrorPartitionListFeature::MergeFrom(from._internal_mirror_partition_list_feature()); } - if (from._internal_graph_partition_strategy() != 0) { - _this->_internal_set_graph_partition_strategy(from._internal_graph_partition_strategy()); + if (from.graph_partition_strategy() != 0) { + _internal_set_graph_partition_strategy(from._internal_graph_partition_strategy()); } - if (from._internal_grin_trait_natural_id_for_partition() != 0) { - _this->_internal_set_grin_trait_natural_id_for_partition(from._internal_grin_trait_natural_id_for_partition()); + if (from.grin_trait_natural_id_for_partition() != 0) { + _internal_set_grin_trait_natural_id_for_partition(from._internal_grin_trait_natural_id_for_partition()); } - if (from._internal_grin_enable_vertex_ref() != 0) { - _this->_internal_set_grin_enable_vertex_ref(from._internal_grin_enable_vertex_ref()); + if (from.grin_enable_vertex_ref() != 0) { + _internal_set_grin_enable_vertex_ref(from._internal_grin_enable_vertex_ref()); } - if (from._internal_grin_enable_edge_ref() != 0) { - _this->_internal_set_grin_enable_edge_ref(from._internal_grin_enable_edge_ref()); + if (from.grin_enable_edge_ref() != 0) { + _internal_set_grin_enable_edge_ref(from._internal_grin_enable_edge_ref()); } - if (from._internal_grin_trait_select_master_for_vertex_list() != 0) { - _this->_internal_set_grin_trait_select_master_for_vertex_list(from._internal_grin_trait_select_master_for_vertex_list()); + if (from.grin_trait_select_master_for_vertex_list() != 0) { + _internal_set_grin_trait_select_master_for_vertex_list(from._internal_grin_trait_select_master_for_vertex_list()); } - if (from._internal_vertex_data() != 0) { - _this->_internal_set_vertex_data(from._internal_vertex_data()); + if (from.vertex_data() != 0) { + _internal_set_vertex_data(from._internal_vertex_data()); } - if (from._internal_edge_data() != 0) { - _this->_internal_set_edge_data(from._internal_edge_data()); + if (from.edge_data() != 0) { + _internal_set_edge_data(from._internal_edge_data()); } - if (from._internal_grin_trait_select_partition_for_vertex_list() != 0) { - _this->_internal_set_grin_trait_select_partition_for_vertex_list(from._internal_grin_trait_select_partition_for_vertex_list()); + if (from.grin_trait_select_partition_for_vertex_list() != 0) { + _internal_set_grin_trait_select_partition_for_vertex_list(from._internal_grin_trait_select_partition_for_vertex_list()); } - if (from._internal_grin_trait_select_master_for_edge_list() != 0) { - _this->_internal_set_grin_trait_select_master_for_edge_list(from._internal_grin_trait_select_master_for_edge_list()); + if (from.grin_trait_select_master_for_edge_list() != 0) { + _internal_set_grin_trait_select_master_for_edge_list(from._internal_grin_trait_select_master_for_edge_list()); } - if (from._internal_grin_trait_select_partition_for_edge_list() != 0) { - _this->_internal_set_grin_trait_select_partition_for_edge_list(from._internal_grin_trait_select_partition_for_edge_list()); + if (from.grin_trait_select_partition_for_edge_list() != 0) { + _internal_set_grin_trait_select_partition_for_edge_list(from._internal_grin_trait_select_partition_for_edge_list()); } - if (from._internal_grin_trait_select_master_neighbor_for_adjacent_list() != 0) { - _this->_internal_set_grin_trait_select_master_neighbor_for_adjacent_list(from._internal_grin_trait_select_master_neighbor_for_adjacent_list()); + if (from.grin_trait_select_master_neighbor_for_adjacent_list() != 0) { + _internal_set_grin_trait_select_master_neighbor_for_adjacent_list(from._internal_grin_trait_select_master_neighbor_for_adjacent_list()); } - if (from._internal_grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { - _this->_internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(from._internal_grin_trait_select_neighbor_partition_for_adjacent_list()); + if (from.grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { + _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(from._internal_grin_trait_select_neighbor_partition_for_adjacent_list()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PartitionFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.PartitionFeature) + if (&from == this) return; + Clear(); + MergeFrom(from); } void PartitionFeature::CopyFrom(const PartitionFeature& from) { @@ -1744,249 +1753,228 @@ bool PartitionFeature::IsInitialized() const { void PartitionFeature::InternalSwap(PartitionFeature* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(PartitionFeature, _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) - + sizeof(PartitionFeature::_impl_.grin_trait_select_neighbor_partition_for_adjacent_list_) - - PROTOBUF_FIELD_OFFSET(PartitionFeature, _impl_.mirror_partition_list_feature_)>( - reinterpret_cast(&_impl_.mirror_partition_list_feature_), - reinterpret_cast(&other->_impl_.mirror_partition_list_feature_)); + PROTOBUF_FIELD_OFFSET(PartitionFeature, grin_trait_select_neighbor_partition_for_adjacent_list_) + + sizeof(PartitionFeature::grin_trait_select_neighbor_partition_for_adjacent_list_) + - PROTOBUF_FIELD_OFFSET(PartitionFeature, mirror_partition_list_feature_)>( + reinterpret_cast(&mirror_partition_list_feature_), + reinterpret_cast(&other->mirror_partition_list_feature_)); } ::PROTOBUF_NAMESPACE_ID::Metadata PartitionFeature::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[2]); + return GetMetadataStatic(); } + // =================================================================== +void VertexPropertyFeature::InitAsDefaultInstance() { +} class VertexPropertyFeature::_Internal { public: }; -VertexPropertyFeature::VertexPropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +VertexPropertyFeature::VertexPropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.VertexPropertyFeature) } VertexPropertyFeature::VertexPropertyFeature(const VertexPropertyFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - VertexPropertyFeature* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.grin_with_vertex_property_){} - , decltype(_impl_.grin_with_vertex_property_name_){} - , decltype(_impl_.grin_with_vertex_type_name_){} - , decltype(_impl_.grin_enable_vertex_property_table_){} - , decltype(_impl_.grin_enable_vertex_primary_keys_){} - , decltype(_impl_.grin_trait_natural_id_for_vertex_type_){} - , decltype(_impl_.grin_trait_natural_id_for_vertex_property_){} - , decltype(_impl_.grin_assume_by_type_vertex_original_id_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.grin_with_vertex_property_, &from._impl_.grin_with_vertex_property_, - static_cast(reinterpret_cast(&_impl_.grin_assume_by_type_vertex_original_id_) - - reinterpret_cast(&_impl_.grin_with_vertex_property_)) + sizeof(_impl_.grin_assume_by_type_vertex_original_id_)); + ::memcpy(&grin_with_vertex_property_, &from.grin_with_vertex_property_, + static_cast(reinterpret_cast(&grin_assume_by_type_vertex_original_id_) - + reinterpret_cast(&grin_with_vertex_property_)) + sizeof(grin_assume_by_type_vertex_original_id_)); // @@protoc_insertion_point(copy_constructor:grin.VertexPropertyFeature) } -inline void VertexPropertyFeature::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.grin_with_vertex_property_){false} - , decltype(_impl_.grin_with_vertex_property_name_){false} - , decltype(_impl_.grin_with_vertex_type_name_){false} - , decltype(_impl_.grin_enable_vertex_property_table_){false} - , decltype(_impl_.grin_enable_vertex_primary_keys_){false} - , decltype(_impl_.grin_trait_natural_id_for_vertex_type_){false} - , decltype(_impl_.grin_trait_natural_id_for_vertex_property_){false} - , decltype(_impl_.grin_assume_by_type_vertex_original_id_){false} - , /*decltype(_impl_._cached_size_)*/{} - }; +void VertexPropertyFeature::SharedCtor() { + ::memset(&grin_with_vertex_property_, 0, static_cast( + reinterpret_cast(&grin_assume_by_type_vertex_original_id_) - + reinterpret_cast(&grin_with_vertex_property_)) + sizeof(grin_assume_by_type_vertex_original_id_)); } VertexPropertyFeature::~VertexPropertyFeature() { // @@protoc_insertion_point(destructor:grin.VertexPropertyFeature) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void VertexPropertyFeature::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +void VertexPropertyFeature::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); } +void VertexPropertyFeature::ArenaDtor(void* object) { + VertexPropertyFeature* _this = reinterpret_cast< VertexPropertyFeature* >(object); + (void)_this; +} +void VertexPropertyFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void VertexPropertyFeature::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const VertexPropertyFeature& VertexPropertyFeature::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_VertexPropertyFeature_graph_2eproto.base); + return *internal_default_instance(); } + void VertexPropertyFeature::Clear() { // @@protoc_insertion_point(message_clear_start:grin.VertexPropertyFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - ::memset(&_impl_.grin_with_vertex_property_, 0, static_cast( - reinterpret_cast(&_impl_.grin_assume_by_type_vertex_original_id_) - - reinterpret_cast(&_impl_.grin_with_vertex_property_)) + sizeof(_impl_.grin_assume_by_type_vertex_original_id_)); + ::memset(&grin_with_vertex_property_, 0, static_cast( + reinterpret_cast(&grin_assume_by_type_vertex_original_id_) - + reinterpret_cast(&grin_with_vertex_property_)) + sizeof(grin_assume_by_type_vertex_original_id_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* VertexPropertyFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* VertexPropertyFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // bool grin_with_vertex_property = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.grin_with_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + grin_with_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_with_vertex_property_name = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _impl_.grin_with_vertex_property_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + grin_with_vertex_property_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_with_vertex_type_name = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - _impl_.grin_with_vertex_type_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + grin_with_vertex_type_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_enable_vertex_property_table = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _impl_.grin_enable_vertex_property_table_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + grin_enable_vertex_property_table_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_enable_vertex_primary_keys = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _impl_.grin_enable_vertex_primary_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + grin_enable_vertex_primary_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_natural_id_for_vertex_type = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - _impl_.grin_trait_natural_id_for_vertex_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + grin_trait_natural_id_for_vertex_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_natural_id_for_vertex_property = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - _impl_.grin_trait_natural_id_for_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + grin_trait_natural_id_for_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_assume_by_type_vertex_original_id = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { - _impl_.grin_assume_by_type_vertex_original_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { + grin_assume_by_type_vertex_original_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* VertexPropertyFeature::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* VertexPropertyFeature::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:grin.VertexPropertyFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // bool grin_with_vertex_property = 1; - if (this->_internal_grin_with_vertex_property() != 0) { + if (this->grin_with_vertex_property() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_vertex_property(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_vertex_property(), target); } // bool grin_with_vertex_property_name = 2; - if (this->_internal_grin_with_vertex_property_name() != 0) { + if (this->grin_with_vertex_property_name() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_vertex_property_name(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_vertex_property_name(), target); } // bool grin_with_vertex_type_name = 3; - if (this->_internal_grin_with_vertex_type_name() != 0) { + if (this->grin_with_vertex_type_name() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_with_vertex_type_name(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_with_vertex_type_name(), target); } // bool grin_enable_vertex_property_table = 4; - if (this->_internal_grin_enable_vertex_property_table() != 0) { + if (this->grin_enable_vertex_property_table() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_vertex_property_table(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_vertex_property_table(), target); } // bool grin_enable_vertex_primary_keys = 5; - if (this->_internal_grin_enable_vertex_primary_keys() != 0) { + if (this->grin_enable_vertex_primary_keys() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_enable_vertex_primary_keys(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_enable_vertex_primary_keys(), target); } // bool grin_trait_natural_id_for_vertex_type = 6; - if (this->_internal_grin_trait_natural_id_for_vertex_type() != 0) { + if (this->grin_trait_natural_id_for_vertex_type() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_trait_natural_id_for_vertex_type(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_trait_natural_id_for_vertex_type(), target); } // bool grin_trait_natural_id_for_vertex_property = 7; - if (this->_internal_grin_trait_natural_id_for_vertex_property() != 0) { + if (this->grin_trait_natural_id_for_vertex_property() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_trait_natural_id_for_vertex_property(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_trait_natural_id_for_vertex_property(), target); } // bool grin_assume_by_type_vertex_original_id = 8; - if (this->_internal_grin_assume_by_type_vertex_original_id() != 0) { + if (this->grin_assume_by_type_vertex_original_id() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_assume_by_type_vertex_original_id(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_assume_by_type_vertex_original_id(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:grin.VertexPropertyFeature) @@ -1997,93 +1985,112 @@ size_t VertexPropertyFeature::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:grin.VertexPropertyFeature) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // bool grin_with_vertex_property = 1; - if (this->_internal_grin_with_vertex_property() != 0) { + if (this->grin_with_vertex_property() != 0) { total_size += 1 + 1; } // bool grin_with_vertex_property_name = 2; - if (this->_internal_grin_with_vertex_property_name() != 0) { + if (this->grin_with_vertex_property_name() != 0) { total_size += 1 + 1; } // bool grin_with_vertex_type_name = 3; - if (this->_internal_grin_with_vertex_type_name() != 0) { + if (this->grin_with_vertex_type_name() != 0) { total_size += 1 + 1; } // bool grin_enable_vertex_property_table = 4; - if (this->_internal_grin_enable_vertex_property_table() != 0) { + if (this->grin_enable_vertex_property_table() != 0) { total_size += 1 + 1; } // bool grin_enable_vertex_primary_keys = 5; - if (this->_internal_grin_enable_vertex_primary_keys() != 0) { + if (this->grin_enable_vertex_primary_keys() != 0) { total_size += 1 + 1; } // bool grin_trait_natural_id_for_vertex_type = 6; - if (this->_internal_grin_trait_natural_id_for_vertex_type() != 0) { + if (this->grin_trait_natural_id_for_vertex_type() != 0) { total_size += 1 + 1; } // bool grin_trait_natural_id_for_vertex_property = 7; - if (this->_internal_grin_trait_natural_id_for_vertex_property() != 0) { + if (this->grin_trait_natural_id_for_vertex_property() != 0) { total_size += 1 + 1; } // bool grin_assume_by_type_vertex_original_id = 8; - if (this->_internal_grin_assume_by_type_vertex_original_id() != 0) { + if (this->grin_assume_by_type_vertex_original_id() != 0) { total_size += 1 + 1; } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData VertexPropertyFeature::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - VertexPropertyFeature::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*VertexPropertyFeature::GetClassData() const { return &_class_data_; } - +void VertexPropertyFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.VertexPropertyFeature) + GOOGLE_DCHECK_NE(&from, this); + const VertexPropertyFeature* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.VertexPropertyFeature) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.VertexPropertyFeature) + MergeFrom(*source); + } +} -void VertexPropertyFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.VertexPropertyFeature) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void VertexPropertyFeature::MergeFrom(const VertexPropertyFeature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.VertexPropertyFeature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_grin_with_vertex_property() != 0) { - _this->_internal_set_grin_with_vertex_property(from._internal_grin_with_vertex_property()); + if (from.grin_with_vertex_property() != 0) { + _internal_set_grin_with_vertex_property(from._internal_grin_with_vertex_property()); } - if (from._internal_grin_with_vertex_property_name() != 0) { - _this->_internal_set_grin_with_vertex_property_name(from._internal_grin_with_vertex_property_name()); + if (from.grin_with_vertex_property_name() != 0) { + _internal_set_grin_with_vertex_property_name(from._internal_grin_with_vertex_property_name()); } - if (from._internal_grin_with_vertex_type_name() != 0) { - _this->_internal_set_grin_with_vertex_type_name(from._internal_grin_with_vertex_type_name()); + if (from.grin_with_vertex_type_name() != 0) { + _internal_set_grin_with_vertex_type_name(from._internal_grin_with_vertex_type_name()); } - if (from._internal_grin_enable_vertex_property_table() != 0) { - _this->_internal_set_grin_enable_vertex_property_table(from._internal_grin_enable_vertex_property_table()); + if (from.grin_enable_vertex_property_table() != 0) { + _internal_set_grin_enable_vertex_property_table(from._internal_grin_enable_vertex_property_table()); } - if (from._internal_grin_enable_vertex_primary_keys() != 0) { - _this->_internal_set_grin_enable_vertex_primary_keys(from._internal_grin_enable_vertex_primary_keys()); + if (from.grin_enable_vertex_primary_keys() != 0) { + _internal_set_grin_enable_vertex_primary_keys(from._internal_grin_enable_vertex_primary_keys()); } - if (from._internal_grin_trait_natural_id_for_vertex_type() != 0) { - _this->_internal_set_grin_trait_natural_id_for_vertex_type(from._internal_grin_trait_natural_id_for_vertex_type()); + if (from.grin_trait_natural_id_for_vertex_type() != 0) { + _internal_set_grin_trait_natural_id_for_vertex_type(from._internal_grin_trait_natural_id_for_vertex_type()); } - if (from._internal_grin_trait_natural_id_for_vertex_property() != 0) { - _this->_internal_set_grin_trait_natural_id_for_vertex_property(from._internal_grin_trait_natural_id_for_vertex_property()); + if (from.grin_trait_natural_id_for_vertex_property() != 0) { + _internal_set_grin_trait_natural_id_for_vertex_property(from._internal_grin_trait_natural_id_for_vertex_property()); } - if (from._internal_grin_assume_by_type_vertex_original_id() != 0) { - _this->_internal_set_grin_assume_by_type_vertex_original_id(from._internal_grin_assume_by_type_vertex_original_id()); + if (from.grin_assume_by_type_vertex_original_id() != 0) { + _internal_set_grin_assume_by_type_vertex_original_id(from._internal_grin_assume_by_type_vertex_original_id()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void VertexPropertyFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.VertexPropertyFeature) + if (&from == this) return; + Clear(); + MergeFrom(from); } void VertexPropertyFeature::CopyFrom(const VertexPropertyFeature& from) { @@ -2099,233 +2106,215 @@ bool VertexPropertyFeature::IsInitialized() const { void VertexPropertyFeature::InternalSwap(VertexPropertyFeature* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(VertexPropertyFeature, _impl_.grin_assume_by_type_vertex_original_id_) - + sizeof(VertexPropertyFeature::_impl_.grin_assume_by_type_vertex_original_id_) - - PROTOBUF_FIELD_OFFSET(VertexPropertyFeature, _impl_.grin_with_vertex_property_)>( - reinterpret_cast(&_impl_.grin_with_vertex_property_), - reinterpret_cast(&other->_impl_.grin_with_vertex_property_)); + PROTOBUF_FIELD_OFFSET(VertexPropertyFeature, grin_assume_by_type_vertex_original_id_) + + sizeof(VertexPropertyFeature::grin_assume_by_type_vertex_original_id_) + - PROTOBUF_FIELD_OFFSET(VertexPropertyFeature, grin_with_vertex_property_)>( + reinterpret_cast(&grin_with_vertex_property_), + reinterpret_cast(&other->grin_with_vertex_property_)); } ::PROTOBUF_NAMESPACE_ID::Metadata VertexPropertyFeature::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[3]); + return GetMetadataStatic(); } + // =================================================================== +void EdgePropertyFeature::InitAsDefaultInstance() { +} class EdgePropertyFeature::_Internal { public: }; -EdgePropertyFeature::EdgePropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +EdgePropertyFeature::EdgePropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.EdgePropertyFeature) } EdgePropertyFeature::EdgePropertyFeature(const EdgePropertyFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - EdgePropertyFeature* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.grin_with_edge_property_){} - , decltype(_impl_.grin_with_edge_property_name_){} - , decltype(_impl_.grin_with_edge_type_name_){} - , decltype(_impl_.grin_enable_edge_property_table_){} - , decltype(_impl_.grin_enable_edge_primary_keys_){} - , decltype(_impl_.grin_trait_natural_id_for_edge_type_){} - , decltype(_impl_.grin_trait_natural_id_for_edge_property_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.grin_with_edge_property_, &from._impl_.grin_with_edge_property_, - static_cast(reinterpret_cast(&_impl_.grin_trait_natural_id_for_edge_property_) - - reinterpret_cast(&_impl_.grin_with_edge_property_)) + sizeof(_impl_.grin_trait_natural_id_for_edge_property_)); + ::memcpy(&grin_with_edge_property_, &from.grin_with_edge_property_, + static_cast(reinterpret_cast(&grin_trait_natural_id_for_edge_property_) - + reinterpret_cast(&grin_with_edge_property_)) + sizeof(grin_trait_natural_id_for_edge_property_)); // @@protoc_insertion_point(copy_constructor:grin.EdgePropertyFeature) } -inline void EdgePropertyFeature::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.grin_with_edge_property_){false} - , decltype(_impl_.grin_with_edge_property_name_){false} - , decltype(_impl_.grin_with_edge_type_name_){false} - , decltype(_impl_.grin_enable_edge_property_table_){false} - , decltype(_impl_.grin_enable_edge_primary_keys_){false} - , decltype(_impl_.grin_trait_natural_id_for_edge_type_){false} - , decltype(_impl_.grin_trait_natural_id_for_edge_property_){false} - , /*decltype(_impl_._cached_size_)*/{} - }; +void EdgePropertyFeature::SharedCtor() { + ::memset(&grin_with_edge_property_, 0, static_cast( + reinterpret_cast(&grin_trait_natural_id_for_edge_property_) - + reinterpret_cast(&grin_with_edge_property_)) + sizeof(grin_trait_natural_id_for_edge_property_)); } EdgePropertyFeature::~EdgePropertyFeature() { // @@protoc_insertion_point(destructor:grin.EdgePropertyFeature) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void EdgePropertyFeature::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +void EdgePropertyFeature::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); } +void EdgePropertyFeature::ArenaDtor(void* object) { + EdgePropertyFeature* _this = reinterpret_cast< EdgePropertyFeature* >(object); + (void)_this; +} +void EdgePropertyFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void EdgePropertyFeature::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); } +const EdgePropertyFeature& EdgePropertyFeature::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_EdgePropertyFeature_graph_2eproto.base); + return *internal_default_instance(); +} + void EdgePropertyFeature::Clear() { // @@protoc_insertion_point(message_clear_start:grin.EdgePropertyFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - ::memset(&_impl_.grin_with_edge_property_, 0, static_cast( - reinterpret_cast(&_impl_.grin_trait_natural_id_for_edge_property_) - - reinterpret_cast(&_impl_.grin_with_edge_property_)) + sizeof(_impl_.grin_trait_natural_id_for_edge_property_)); + ::memset(&grin_with_edge_property_, 0, static_cast( + reinterpret_cast(&grin_trait_natural_id_for_edge_property_) - + reinterpret_cast(&grin_with_edge_property_)) + sizeof(grin_trait_natural_id_for_edge_property_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* EdgePropertyFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* EdgePropertyFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // bool grin_with_edge_property = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.grin_with_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + grin_with_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_with_edge_property_name = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _impl_.grin_with_edge_property_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + grin_with_edge_property_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_with_edge_type_name = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - _impl_.grin_with_edge_type_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + grin_with_edge_type_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_enable_edge_property_table = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _impl_.grin_enable_edge_property_table_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + grin_enable_edge_property_table_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_enable_edge_primary_keys = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _impl_.grin_enable_edge_primary_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + grin_enable_edge_primary_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_natural_id_for_edge_type = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - _impl_.grin_trait_natural_id_for_edge_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + grin_trait_natural_id_for_edge_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_natural_id_for_edge_property = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - _impl_.grin_trait_natural_id_for_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + grin_trait_natural_id_for_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* EdgePropertyFeature::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* EdgePropertyFeature::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:grin.EdgePropertyFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // bool grin_with_edge_property = 1; - if (this->_internal_grin_with_edge_property() != 0) { + if (this->grin_with_edge_property() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_edge_property(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_edge_property(), target); } // bool grin_with_edge_property_name = 2; - if (this->_internal_grin_with_edge_property_name() != 0) { + if (this->grin_with_edge_property_name() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_edge_property_name(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_edge_property_name(), target); } // bool grin_with_edge_type_name = 3; - if (this->_internal_grin_with_edge_type_name() != 0) { + if (this->grin_with_edge_type_name() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_with_edge_type_name(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_with_edge_type_name(), target); } // bool grin_enable_edge_property_table = 4; - if (this->_internal_grin_enable_edge_property_table() != 0) { + if (this->grin_enable_edge_property_table() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_edge_property_table(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_edge_property_table(), target); } // bool grin_enable_edge_primary_keys = 5; - if (this->_internal_grin_enable_edge_primary_keys() != 0) { + if (this->grin_enable_edge_primary_keys() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_enable_edge_primary_keys(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_enable_edge_primary_keys(), target); } // bool grin_trait_natural_id_for_edge_type = 6; - if (this->_internal_grin_trait_natural_id_for_edge_type() != 0) { + if (this->grin_trait_natural_id_for_edge_type() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_trait_natural_id_for_edge_type(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_trait_natural_id_for_edge_type(), target); } // bool grin_trait_natural_id_for_edge_property = 7; - if (this->_internal_grin_trait_natural_id_for_edge_property() != 0) { + if (this->grin_trait_natural_id_for_edge_property() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_trait_natural_id_for_edge_property(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_trait_natural_id_for_edge_property(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:grin.EdgePropertyFeature) @@ -2336,85 +2325,104 @@ size_t EdgePropertyFeature::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:grin.EdgePropertyFeature) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // bool grin_with_edge_property = 1; - if (this->_internal_grin_with_edge_property() != 0) { + if (this->grin_with_edge_property() != 0) { total_size += 1 + 1; } // bool grin_with_edge_property_name = 2; - if (this->_internal_grin_with_edge_property_name() != 0) { + if (this->grin_with_edge_property_name() != 0) { total_size += 1 + 1; } // bool grin_with_edge_type_name = 3; - if (this->_internal_grin_with_edge_type_name() != 0) { + if (this->grin_with_edge_type_name() != 0) { total_size += 1 + 1; } // bool grin_enable_edge_property_table = 4; - if (this->_internal_grin_enable_edge_property_table() != 0) { + if (this->grin_enable_edge_property_table() != 0) { total_size += 1 + 1; } // bool grin_enable_edge_primary_keys = 5; - if (this->_internal_grin_enable_edge_primary_keys() != 0) { + if (this->grin_enable_edge_primary_keys() != 0) { total_size += 1 + 1; } // bool grin_trait_natural_id_for_edge_type = 6; - if (this->_internal_grin_trait_natural_id_for_edge_type() != 0) { + if (this->grin_trait_natural_id_for_edge_type() != 0) { total_size += 1 + 1; } // bool grin_trait_natural_id_for_edge_property = 7; - if (this->_internal_grin_trait_natural_id_for_edge_property() != 0) { + if (this->grin_trait_natural_id_for_edge_property() != 0) { total_size += 1 + 1; } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData EdgePropertyFeature::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - EdgePropertyFeature::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*EdgePropertyFeature::GetClassData() const { return &_class_data_; } - +void EdgePropertyFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.EdgePropertyFeature) + GOOGLE_DCHECK_NE(&from, this); + const EdgePropertyFeature* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.EdgePropertyFeature) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.EdgePropertyFeature) + MergeFrom(*source); + } +} -void EdgePropertyFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.EdgePropertyFeature) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void EdgePropertyFeature::MergeFrom(const EdgePropertyFeature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.EdgePropertyFeature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_grin_with_edge_property() != 0) { - _this->_internal_set_grin_with_edge_property(from._internal_grin_with_edge_property()); + if (from.grin_with_edge_property() != 0) { + _internal_set_grin_with_edge_property(from._internal_grin_with_edge_property()); } - if (from._internal_grin_with_edge_property_name() != 0) { - _this->_internal_set_grin_with_edge_property_name(from._internal_grin_with_edge_property_name()); + if (from.grin_with_edge_property_name() != 0) { + _internal_set_grin_with_edge_property_name(from._internal_grin_with_edge_property_name()); } - if (from._internal_grin_with_edge_type_name() != 0) { - _this->_internal_set_grin_with_edge_type_name(from._internal_grin_with_edge_type_name()); + if (from.grin_with_edge_type_name() != 0) { + _internal_set_grin_with_edge_type_name(from._internal_grin_with_edge_type_name()); } - if (from._internal_grin_enable_edge_property_table() != 0) { - _this->_internal_set_grin_enable_edge_property_table(from._internal_grin_enable_edge_property_table()); + if (from.grin_enable_edge_property_table() != 0) { + _internal_set_grin_enable_edge_property_table(from._internal_grin_enable_edge_property_table()); } - if (from._internal_grin_enable_edge_primary_keys() != 0) { - _this->_internal_set_grin_enable_edge_primary_keys(from._internal_grin_enable_edge_primary_keys()); + if (from.grin_enable_edge_primary_keys() != 0) { + _internal_set_grin_enable_edge_primary_keys(from._internal_grin_enable_edge_primary_keys()); } - if (from._internal_grin_trait_natural_id_for_edge_type() != 0) { - _this->_internal_set_grin_trait_natural_id_for_edge_type(from._internal_grin_trait_natural_id_for_edge_type()); + if (from.grin_trait_natural_id_for_edge_type() != 0) { + _internal_set_grin_trait_natural_id_for_edge_type(from._internal_grin_trait_natural_id_for_edge_type()); } - if (from._internal_grin_trait_natural_id_for_edge_property() != 0) { - _this->_internal_set_grin_trait_natural_id_for_edge_property(from._internal_grin_trait_natural_id_for_edge_property()); + if (from.grin_trait_natural_id_for_edge_property() != 0) { + _internal_set_grin_trait_natural_id_for_edge_property(from._internal_grin_trait_natural_id_for_edge_property()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void EdgePropertyFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.EdgePropertyFeature) + if (&from == this) return; + Clear(); + MergeFrom(from); } void EdgePropertyFeature::CopyFrom(const EdgePropertyFeature& from) { @@ -2430,23 +2438,28 @@ bool EdgePropertyFeature::IsInitialized() const { void EdgePropertyFeature::InternalSwap(EdgePropertyFeature* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(EdgePropertyFeature, _impl_.grin_trait_natural_id_for_edge_property_) - + sizeof(EdgePropertyFeature::_impl_.grin_trait_natural_id_for_edge_property_) - - PROTOBUF_FIELD_OFFSET(EdgePropertyFeature, _impl_.grin_with_edge_property_)>( - reinterpret_cast(&_impl_.grin_with_edge_property_), - reinterpret_cast(&other->_impl_.grin_with_edge_property_)); + PROTOBUF_FIELD_OFFSET(EdgePropertyFeature, grin_trait_natural_id_for_edge_property_) + + sizeof(EdgePropertyFeature::grin_trait_natural_id_for_edge_property_) + - PROTOBUF_FIELD_OFFSET(EdgePropertyFeature, grin_with_edge_property_)>( + reinterpret_cast(&grin_with_edge_property_), + reinterpret_cast(&other->grin_with_edge_property_)); } ::PROTOBUF_NAMESPACE_ID::Metadata EdgePropertyFeature::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[4]); + return GetMetadataStatic(); } + // =================================================================== +void PropertyFeature::InitAsDefaultInstance() { + ::grin::_PropertyFeature_default_instance_._instance.get_mutable()->vertex_property_feature_ = const_cast< ::grin::VertexPropertyFeature*>( + ::grin::VertexPropertyFeature::internal_default_instance()); + ::grin::_PropertyFeature_default_instance_._instance.get_mutable()->edge_property_feature_ = const_cast< ::grin::EdgePropertyFeature*>( + ::grin::EdgePropertyFeature::internal_default_instance()); +} class PropertyFeature::_Internal { public: static const ::grin::VertexPropertyFeature& vertex_property_feature(const PropertyFeature* msg); @@ -2455,320 +2468,293 @@ class PropertyFeature::_Internal { const ::grin::VertexPropertyFeature& PropertyFeature::_Internal::vertex_property_feature(const PropertyFeature* msg) { - return *msg->_impl_.vertex_property_feature_; + return *msg->vertex_property_feature_; } const ::grin::EdgePropertyFeature& PropertyFeature::_Internal::edge_property_feature(const PropertyFeature* msg) { - return *msg->_impl_.edge_property_feature_; + return *msg->edge_property_feature_; } -PropertyFeature::PropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +PropertyFeature::PropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.PropertyFeature) } PropertyFeature::PropertyFeature(const PropertyFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - PropertyFeature* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.vertex_property_feature_){nullptr} - , decltype(_impl_.edge_property_feature_){nullptr} - , decltype(_impl_.vertex_property_){} - , decltype(_impl_.edge_property_){} - , decltype(_impl_.grin_enable_row_){} - , decltype(_impl_.grin_assume_column_store_for_vertex_property_){} - , decltype(_impl_.grin_assume_column_store_for_edge_property_){} - , decltype(_impl_.grin_trait_select_type_for_vertex_list_){} - , decltype(_impl_.grin_trait_select_type_for_edge_list_){} - , decltype(_impl_.grin_trait_select_neighbor_type_for_adjacent_list_){} - , decltype(_impl_.grin_trait_select_edge_type_for_adjacent_list_){} - , decltype(_impl_.grin_trait_specific_vev_relation_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); if (from._internal_has_vertex_property_feature()) { - _this->_impl_.vertex_property_feature_ = new ::grin::VertexPropertyFeature(*from._impl_.vertex_property_feature_); + vertex_property_feature_ = new ::grin::VertexPropertyFeature(*from.vertex_property_feature_); + } else { + vertex_property_feature_ = nullptr; } if (from._internal_has_edge_property_feature()) { - _this->_impl_.edge_property_feature_ = new ::grin::EdgePropertyFeature(*from._impl_.edge_property_feature_); + edge_property_feature_ = new ::grin::EdgePropertyFeature(*from.edge_property_feature_); + } else { + edge_property_feature_ = nullptr; } - ::memcpy(&_impl_.vertex_property_, &from._impl_.vertex_property_, - static_cast(reinterpret_cast(&_impl_.grin_trait_specific_vev_relation_) - - reinterpret_cast(&_impl_.vertex_property_)) + sizeof(_impl_.grin_trait_specific_vev_relation_)); + ::memcpy(&vertex_property_, &from.vertex_property_, + static_cast(reinterpret_cast(&grin_trait_specific_vev_relation_) - + reinterpret_cast(&vertex_property_)) + sizeof(grin_trait_specific_vev_relation_)); // @@protoc_insertion_point(copy_constructor:grin.PropertyFeature) } -inline void PropertyFeature::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.vertex_property_feature_){nullptr} - , decltype(_impl_.edge_property_feature_){nullptr} - , decltype(_impl_.vertex_property_){0} - , decltype(_impl_.edge_property_){0} - , decltype(_impl_.grin_enable_row_){false} - , decltype(_impl_.grin_assume_column_store_for_vertex_property_){false} - , decltype(_impl_.grin_assume_column_store_for_edge_property_){false} - , decltype(_impl_.grin_trait_select_type_for_vertex_list_){false} - , decltype(_impl_.grin_trait_select_type_for_edge_list_){false} - , decltype(_impl_.grin_trait_select_neighbor_type_for_adjacent_list_){false} - , decltype(_impl_.grin_trait_select_edge_type_for_adjacent_list_){false} - , decltype(_impl_.grin_trait_specific_vev_relation_){false} - , /*decltype(_impl_._cached_size_)*/{} - }; +void PropertyFeature::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PropertyFeature_graph_2eproto.base); + ::memset(&vertex_property_feature_, 0, static_cast( + reinterpret_cast(&grin_trait_specific_vev_relation_) - + reinterpret_cast(&vertex_property_feature_)) + sizeof(grin_trait_specific_vev_relation_)); } PropertyFeature::~PropertyFeature() { // @@protoc_insertion_point(destructor:grin.PropertyFeature) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void PropertyFeature::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - if (this != internal_default_instance()) delete _impl_.vertex_property_feature_; - if (this != internal_default_instance()) delete _impl_.edge_property_feature_; +void PropertyFeature::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + if (this != internal_default_instance()) delete vertex_property_feature_; + if (this != internal_default_instance()) delete edge_property_feature_; } +void PropertyFeature::ArenaDtor(void* object) { + PropertyFeature* _this = reinterpret_cast< PropertyFeature* >(object); + (void)_this; +} +void PropertyFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void PropertyFeature::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const PropertyFeature& PropertyFeature::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PropertyFeature_graph_2eproto.base); + return *internal_default_instance(); } + void PropertyFeature::Clear() { // @@protoc_insertion_point(message_clear_start:grin.PropertyFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - if (GetArenaForAllocation() == nullptr && _impl_.vertex_property_feature_ != nullptr) { - delete _impl_.vertex_property_feature_; + if (GetArena() == nullptr && vertex_property_feature_ != nullptr) { + delete vertex_property_feature_; } - _impl_.vertex_property_feature_ = nullptr; - if (GetArenaForAllocation() == nullptr && _impl_.edge_property_feature_ != nullptr) { - delete _impl_.edge_property_feature_; + vertex_property_feature_ = nullptr; + if (GetArena() == nullptr && edge_property_feature_ != nullptr) { + delete edge_property_feature_; } - _impl_.edge_property_feature_ = nullptr; - ::memset(&_impl_.vertex_property_, 0, static_cast( - reinterpret_cast(&_impl_.grin_trait_specific_vev_relation_) - - reinterpret_cast(&_impl_.vertex_property_)) + sizeof(_impl_.grin_trait_specific_vev_relation_)); + edge_property_feature_ = nullptr; + ::memset(&vertex_property_, 0, static_cast( + reinterpret_cast(&grin_trait_specific_vev_relation_) - + reinterpret_cast(&vertex_property_)) + sizeof(grin_trait_specific_vev_relation_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* PropertyFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* PropertyFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // bool grin_enable_row = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.grin_enable_row_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + grin_enable_row_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.VertexPropertyFeature vertex_property_feature = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_vertex_property_feature(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.EdgePropertyFeature edge_property_feature = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_edge_property_feature(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.PropertyDataPartitionStrategy vertex_property = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_vertex_property(static_cast<::grin::PropertyDataPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.PropertyDataPartitionStrategy edge_property = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); _internal_set_edge_property(static_cast<::grin::PropertyDataPartitionStrategy>(val)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_assume_column_store_for_vertex_property = 6; case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 48)) { - _impl_.grin_assume_column_store_for_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + grin_assume_column_store_for_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_assume_column_store_for_edge_property = 7; case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 56)) { - _impl_.grin_assume_column_store_for_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + grin_assume_column_store_for_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_select_type_for_vertex_list = 8; case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 64)) { - _impl_.grin_trait_select_type_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { + grin_trait_select_type_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_select_type_for_edge_list = 9; case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 72)) { - _impl_.grin_trait_select_type_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { + grin_trait_select_type_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 80)) { - _impl_.grin_trait_select_neighbor_type_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { + grin_trait_select_neighbor_type_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_select_edge_type_for_adjacent_list = 11; case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 88)) { - _impl_.grin_trait_select_edge_type_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) { + grin_trait_select_edge_type_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_trait_specific_vev_relation = 12; case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 96)) { - _impl_.grin_trait_specific_vev_relation_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) { + grin_trait_specific_vev_relation_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; - default: - goto handle_unusual; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* PropertyFeature::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* PropertyFeature::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:grin.PropertyFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // bool grin_enable_row = 1; - if (this->_internal_grin_enable_row() != 0) { + if (this->grin_enable_row() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_enable_row(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_enable_row(), target); } // .grin.VertexPropertyFeature vertex_property_feature = 2; - if (this->_internal_has_vertex_property_feature()) { + if (this->has_vertex_property_feature()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::vertex_property_feature(this), - _Internal::vertex_property_feature(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 2, _Internal::vertex_property_feature(this), target, stream); } // .grin.EdgePropertyFeature edge_property_feature = 3; - if (this->_internal_has_edge_property_feature()) { + if (this->has_edge_property_feature()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::edge_property_feature(this), - _Internal::edge_property_feature(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 3, _Internal::edge_property_feature(this), target, stream); } // .grin.PropertyDataPartitionStrategy vertex_property = 4; - if (this->_internal_vertex_property() != 0) { + if (this->vertex_property() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 4, this->_internal_vertex_property(), target); } // .grin.PropertyDataPartitionStrategy edge_property = 5; - if (this->_internal_edge_property() != 0) { + if (this->edge_property() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteEnumToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( 5, this->_internal_edge_property(), target); } // bool grin_assume_column_store_for_vertex_property = 6; - if (this->_internal_grin_assume_column_store_for_vertex_property() != 0) { + if (this->grin_assume_column_store_for_vertex_property() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_assume_column_store_for_vertex_property(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_assume_column_store_for_vertex_property(), target); } // bool grin_assume_column_store_for_edge_property = 7; - if (this->_internal_grin_assume_column_store_for_edge_property() != 0) { + if (this->grin_assume_column_store_for_edge_property() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_assume_column_store_for_edge_property(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_assume_column_store_for_edge_property(), target); } // bool grin_trait_select_type_for_vertex_list = 8; - if (this->_internal_grin_trait_select_type_for_vertex_list() != 0) { + if (this->grin_trait_select_type_for_vertex_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_trait_select_type_for_vertex_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_trait_select_type_for_vertex_list(), target); } // bool grin_trait_select_type_for_edge_list = 9; - if (this->_internal_grin_trait_select_type_for_edge_list() != 0) { + if (this->grin_trait_select_type_for_edge_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_grin_trait_select_type_for_edge_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(9, this->_internal_grin_trait_select_type_for_edge_list(), target); } // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; - if (this->_internal_grin_trait_select_neighbor_type_for_adjacent_list() != 0) { + if (this->grin_trait_select_neighbor_type_for_adjacent_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(10, this->_internal_grin_trait_select_neighbor_type_for_adjacent_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(10, this->_internal_grin_trait_select_neighbor_type_for_adjacent_list(), target); } // bool grin_trait_select_edge_type_for_adjacent_list = 11; - if (this->_internal_grin_trait_select_edge_type_for_adjacent_list() != 0) { + if (this->grin_trait_select_edge_type_for_adjacent_list() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(11, this->_internal_grin_trait_select_edge_type_for_adjacent_list(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(11, this->_internal_grin_trait_select_edge_type_for_adjacent_list(), target); } // bool grin_trait_specific_vev_relation = 12; - if (this->_internal_grin_trait_specific_vev_relation() != 0) { + if (this->grin_trait_specific_vev_relation() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_grin_trait_specific_vev_relation(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(12, this->_internal_grin_trait_specific_vev_relation(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:grin.PropertyFeature) @@ -2779,133 +2765,150 @@ size_t PropertyFeature::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:grin.PropertyFeature) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // .grin.VertexPropertyFeature vertex_property_feature = 2; - if (this->_internal_has_vertex_property_feature()) { + if (this->has_vertex_property_feature()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.vertex_property_feature_); + *vertex_property_feature_); } // .grin.EdgePropertyFeature edge_property_feature = 3; - if (this->_internal_has_edge_property_feature()) { + if (this->has_edge_property_feature()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.edge_property_feature_); + *edge_property_feature_); } // .grin.PropertyDataPartitionStrategy vertex_property = 4; - if (this->_internal_vertex_property() != 0) { + if (this->vertex_property() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_vertex_property()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_vertex_property()); } // .grin.PropertyDataPartitionStrategy edge_property = 5; - if (this->_internal_edge_property() != 0) { + if (this->edge_property() != 0) { total_size += 1 + - ::_pbi::WireFormatLite::EnumSize(this->_internal_edge_property()); + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_edge_property()); } // bool grin_enable_row = 1; - if (this->_internal_grin_enable_row() != 0) { + if (this->grin_enable_row() != 0) { total_size += 1 + 1; } // bool grin_assume_column_store_for_vertex_property = 6; - if (this->_internal_grin_assume_column_store_for_vertex_property() != 0) { + if (this->grin_assume_column_store_for_vertex_property() != 0) { total_size += 1 + 1; } // bool grin_assume_column_store_for_edge_property = 7; - if (this->_internal_grin_assume_column_store_for_edge_property() != 0) { + if (this->grin_assume_column_store_for_edge_property() != 0) { total_size += 1 + 1; } // bool grin_trait_select_type_for_vertex_list = 8; - if (this->_internal_grin_trait_select_type_for_vertex_list() != 0) { + if (this->grin_trait_select_type_for_vertex_list() != 0) { total_size += 1 + 1; } // bool grin_trait_select_type_for_edge_list = 9; - if (this->_internal_grin_trait_select_type_for_edge_list() != 0) { + if (this->grin_trait_select_type_for_edge_list() != 0) { total_size += 1 + 1; } // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; - if (this->_internal_grin_trait_select_neighbor_type_for_adjacent_list() != 0) { + if (this->grin_trait_select_neighbor_type_for_adjacent_list() != 0) { total_size += 1 + 1; } // bool grin_trait_select_edge_type_for_adjacent_list = 11; - if (this->_internal_grin_trait_select_edge_type_for_adjacent_list() != 0) { + if (this->grin_trait_select_edge_type_for_adjacent_list() != 0) { total_size += 1 + 1; } // bool grin_trait_specific_vev_relation = 12; - if (this->_internal_grin_trait_specific_vev_relation() != 0) { + if (this->grin_trait_specific_vev_relation() != 0) { total_size += 1 + 1; } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PropertyFeature::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - PropertyFeature::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PropertyFeature::GetClassData() const { return &_class_data_; } - +void PropertyFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.PropertyFeature) + GOOGLE_DCHECK_NE(&from, this); + const PropertyFeature* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.PropertyFeature) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.PropertyFeature) + MergeFrom(*source); + } +} -void PropertyFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.PropertyFeature) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void PropertyFeature::MergeFrom(const PropertyFeature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.PropertyFeature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_has_vertex_property_feature()) { - _this->_internal_mutable_vertex_property_feature()->::grin::VertexPropertyFeature::MergeFrom( - from._internal_vertex_property_feature()); + if (from.has_vertex_property_feature()) { + _internal_mutable_vertex_property_feature()->::grin::VertexPropertyFeature::MergeFrom(from._internal_vertex_property_feature()); } - if (from._internal_has_edge_property_feature()) { - _this->_internal_mutable_edge_property_feature()->::grin::EdgePropertyFeature::MergeFrom( - from._internal_edge_property_feature()); + if (from.has_edge_property_feature()) { + _internal_mutable_edge_property_feature()->::grin::EdgePropertyFeature::MergeFrom(from._internal_edge_property_feature()); } - if (from._internal_vertex_property() != 0) { - _this->_internal_set_vertex_property(from._internal_vertex_property()); + if (from.vertex_property() != 0) { + _internal_set_vertex_property(from._internal_vertex_property()); } - if (from._internal_edge_property() != 0) { - _this->_internal_set_edge_property(from._internal_edge_property()); + if (from.edge_property() != 0) { + _internal_set_edge_property(from._internal_edge_property()); } - if (from._internal_grin_enable_row() != 0) { - _this->_internal_set_grin_enable_row(from._internal_grin_enable_row()); + if (from.grin_enable_row() != 0) { + _internal_set_grin_enable_row(from._internal_grin_enable_row()); } - if (from._internal_grin_assume_column_store_for_vertex_property() != 0) { - _this->_internal_set_grin_assume_column_store_for_vertex_property(from._internal_grin_assume_column_store_for_vertex_property()); + if (from.grin_assume_column_store_for_vertex_property() != 0) { + _internal_set_grin_assume_column_store_for_vertex_property(from._internal_grin_assume_column_store_for_vertex_property()); } - if (from._internal_grin_assume_column_store_for_edge_property() != 0) { - _this->_internal_set_grin_assume_column_store_for_edge_property(from._internal_grin_assume_column_store_for_edge_property()); + if (from.grin_assume_column_store_for_edge_property() != 0) { + _internal_set_grin_assume_column_store_for_edge_property(from._internal_grin_assume_column_store_for_edge_property()); } - if (from._internal_grin_trait_select_type_for_vertex_list() != 0) { - _this->_internal_set_grin_trait_select_type_for_vertex_list(from._internal_grin_trait_select_type_for_vertex_list()); + if (from.grin_trait_select_type_for_vertex_list() != 0) { + _internal_set_grin_trait_select_type_for_vertex_list(from._internal_grin_trait_select_type_for_vertex_list()); } - if (from._internal_grin_trait_select_type_for_edge_list() != 0) { - _this->_internal_set_grin_trait_select_type_for_edge_list(from._internal_grin_trait_select_type_for_edge_list()); + if (from.grin_trait_select_type_for_edge_list() != 0) { + _internal_set_grin_trait_select_type_for_edge_list(from._internal_grin_trait_select_type_for_edge_list()); } - if (from._internal_grin_trait_select_neighbor_type_for_adjacent_list() != 0) { - _this->_internal_set_grin_trait_select_neighbor_type_for_adjacent_list(from._internal_grin_trait_select_neighbor_type_for_adjacent_list()); + if (from.grin_trait_select_neighbor_type_for_adjacent_list() != 0) { + _internal_set_grin_trait_select_neighbor_type_for_adjacent_list(from._internal_grin_trait_select_neighbor_type_for_adjacent_list()); } - if (from._internal_grin_trait_select_edge_type_for_adjacent_list() != 0) { - _this->_internal_set_grin_trait_select_edge_type_for_adjacent_list(from._internal_grin_trait_select_edge_type_for_adjacent_list()); + if (from.grin_trait_select_edge_type_for_adjacent_list() != 0) { + _internal_set_grin_trait_select_edge_type_for_adjacent_list(from._internal_grin_trait_select_edge_type_for_adjacent_list()); } - if (from._internal_grin_trait_specific_vev_relation() != 0) { - _this->_internal_set_grin_trait_specific_vev_relation(from._internal_grin_trait_specific_vev_relation()); + if (from.grin_trait_specific_vev_relation() != 0) { + _internal_set_grin_trait_specific_vev_relation(from._internal_grin_trait_specific_vev_relation()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void PropertyFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.PropertyFeature) + if (&from == this) return; + Clear(); + MergeFrom(from); } void PropertyFeature::CopyFrom(const PropertyFeature& from) { @@ -2921,169 +2924,163 @@ bool PropertyFeature::IsInitialized() const { void PropertyFeature::InternalSwap(PropertyFeature* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(PropertyFeature, _impl_.grin_trait_specific_vev_relation_) - + sizeof(PropertyFeature::_impl_.grin_trait_specific_vev_relation_) - - PROTOBUF_FIELD_OFFSET(PropertyFeature, _impl_.vertex_property_feature_)>( - reinterpret_cast(&_impl_.vertex_property_feature_), - reinterpret_cast(&other->_impl_.vertex_property_feature_)); + PROTOBUF_FIELD_OFFSET(PropertyFeature, grin_trait_specific_vev_relation_) + + sizeof(PropertyFeature::grin_trait_specific_vev_relation_) + - PROTOBUF_FIELD_OFFSET(PropertyFeature, vertex_property_feature_)>( + reinterpret_cast(&vertex_property_feature_), + reinterpret_cast(&other->vertex_property_feature_)); } ::PROTOBUF_NAMESPACE_ID::Metadata PropertyFeature::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[5]); + return GetMetadataStatic(); } + // =================================================================== +void IndexFeature::InitAsDefaultInstance() { +} class IndexFeature::_Internal { public: }; -IndexFeature::IndexFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +IndexFeature::IndexFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.IndexFeature) } IndexFeature::IndexFeature(const IndexFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - IndexFeature* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.grin_with_vertex_label_){} - , decltype(_impl_.grin_with_edge_label_){} - , decltype(_impl_.grin_assume_all_vertex_list_sorted_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.grin_with_vertex_label_, &from._impl_.grin_with_vertex_label_, - static_cast(reinterpret_cast(&_impl_.grin_assume_all_vertex_list_sorted_) - - reinterpret_cast(&_impl_.grin_with_vertex_label_)) + sizeof(_impl_.grin_assume_all_vertex_list_sorted_)); + ::memcpy(&grin_with_vertex_label_, &from.grin_with_vertex_label_, + static_cast(reinterpret_cast(&grin_assume_all_vertex_list_sorted_) - + reinterpret_cast(&grin_with_vertex_label_)) + sizeof(grin_assume_all_vertex_list_sorted_)); // @@protoc_insertion_point(copy_constructor:grin.IndexFeature) } -inline void IndexFeature::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.grin_with_vertex_label_){false} - , decltype(_impl_.grin_with_edge_label_){false} - , decltype(_impl_.grin_assume_all_vertex_list_sorted_){false} - , /*decltype(_impl_._cached_size_)*/{} - }; +void IndexFeature::SharedCtor() { + ::memset(&grin_with_vertex_label_, 0, static_cast( + reinterpret_cast(&grin_assume_all_vertex_list_sorted_) - + reinterpret_cast(&grin_with_vertex_label_)) + sizeof(grin_assume_all_vertex_list_sorted_)); } IndexFeature::~IndexFeature() { // @@protoc_insertion_point(destructor:grin.IndexFeature) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void IndexFeature::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +void IndexFeature::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); } +void IndexFeature::ArenaDtor(void* object) { + IndexFeature* _this = reinterpret_cast< IndexFeature* >(object); + (void)_this; +} +void IndexFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void IndexFeature::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const IndexFeature& IndexFeature::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_IndexFeature_graph_2eproto.base); + return *internal_default_instance(); } + void IndexFeature::Clear() { // @@protoc_insertion_point(message_clear_start:grin.IndexFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - ::memset(&_impl_.grin_with_vertex_label_, 0, static_cast( - reinterpret_cast(&_impl_.grin_assume_all_vertex_list_sorted_) - - reinterpret_cast(&_impl_.grin_with_vertex_label_)) + sizeof(_impl_.grin_assume_all_vertex_list_sorted_)); + ::memset(&grin_with_vertex_label_, 0, static_cast( + reinterpret_cast(&grin_assume_all_vertex_list_sorted_) - + reinterpret_cast(&grin_with_vertex_label_)) + sizeof(grin_assume_all_vertex_list_sorted_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* IndexFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* IndexFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // bool grin_with_vertex_label = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.grin_with_vertex_label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + grin_with_vertex_label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_with_edge_label = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _impl_.grin_with_edge_label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + grin_with_edge_label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // bool grin_assume_all_vertex_list_sorted = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - _impl_.grin_assume_all_vertex_list_sorted_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + grin_assume_all_vertex_list_sorted_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* IndexFeature::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* IndexFeature::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:grin.IndexFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // bool grin_with_vertex_label = 1; - if (this->_internal_grin_with_vertex_label() != 0) { + if (this->grin_with_vertex_label() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_vertex_label(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_vertex_label(), target); } // bool grin_with_edge_label = 2; - if (this->_internal_grin_with_edge_label() != 0) { + if (this->grin_with_edge_label() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_edge_label(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_edge_label(), target); } // bool grin_assume_all_vertex_list_sorted = 3; - if (this->_internal_grin_assume_all_vertex_list_sorted() != 0) { + if (this->grin_assume_all_vertex_list_sorted() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_assume_all_vertex_list_sorted(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_assume_all_vertex_list_sorted(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:grin.IndexFeature) @@ -3094,53 +3091,72 @@ size_t IndexFeature::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:grin.IndexFeature) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // bool grin_with_vertex_label = 1; - if (this->_internal_grin_with_vertex_label() != 0) { + if (this->grin_with_vertex_label() != 0) { total_size += 1 + 1; } // bool grin_with_edge_label = 2; - if (this->_internal_grin_with_edge_label() != 0) { + if (this->grin_with_edge_label() != 0) { total_size += 1 + 1; } // bool grin_assume_all_vertex_list_sorted = 3; - if (this->_internal_grin_assume_all_vertex_list_sorted() != 0) { + if (this->grin_assume_all_vertex_list_sorted() != 0) { total_size += 1 + 1; } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData IndexFeature::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - IndexFeature::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*IndexFeature::GetClassData() const { return &_class_data_; } - +void IndexFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.IndexFeature) + GOOGLE_DCHECK_NE(&from, this); + const IndexFeature* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.IndexFeature) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.IndexFeature) + MergeFrom(*source); + } +} -void IndexFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.IndexFeature) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void IndexFeature::MergeFrom(const IndexFeature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.IndexFeature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_grin_with_vertex_label() != 0) { - _this->_internal_set_grin_with_vertex_label(from._internal_grin_with_vertex_label()); + if (from.grin_with_vertex_label() != 0) { + _internal_set_grin_with_vertex_label(from._internal_grin_with_vertex_label()); } - if (from._internal_grin_with_edge_label() != 0) { - _this->_internal_set_grin_with_edge_label(from._internal_grin_with_edge_label()); + if (from.grin_with_edge_label() != 0) { + _internal_set_grin_with_edge_label(from._internal_grin_with_edge_label()); } - if (from._internal_grin_assume_all_vertex_list_sorted() != 0) { - _this->_internal_set_grin_assume_all_vertex_list_sorted(from._internal_grin_assume_all_vertex_list_sorted()); + if (from.grin_assume_all_vertex_list_sorted() != 0) { + _internal_set_grin_assume_all_vertex_list_sorted(from._internal_grin_assume_all_vertex_list_sorted()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void IndexFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.IndexFeature) + if (&from == this) return; + Clear(); + MergeFrom(from); } void IndexFeature::CopyFrom(const IndexFeature& from) { @@ -3156,63 +3172,199 @@ bool IndexFeature::IsInitialized() const { void IndexFeature::InternalSwap(IndexFeature* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(IndexFeature, _impl_.grin_assume_all_vertex_list_sorted_) - + sizeof(IndexFeature::_impl_.grin_assume_all_vertex_list_sorted_) - - PROTOBUF_FIELD_OFFSET(IndexFeature, _impl_.grin_with_vertex_label_)>( - reinterpret_cast(&_impl_.grin_with_vertex_label_), - reinterpret_cast(&other->_impl_.grin_with_vertex_label_)); + PROTOBUF_FIELD_OFFSET(IndexFeature, grin_assume_all_vertex_list_sorted_) + + sizeof(IndexFeature::grin_assume_all_vertex_list_sorted_) + - PROTOBUF_FIELD_OFFSET(IndexFeature, grin_with_vertex_label_)>( + reinterpret_cast(&grin_with_vertex_label_), + reinterpret_cast(&other->grin_with_vertex_label_)); } ::PROTOBUF_NAMESPACE_ID::Metadata IndexFeature::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[6]); + return GetMetadataStatic(); } + // =================================================================== +void PredicateFeature::InitAsDefaultInstance() { +} class PredicateFeature::_Internal { public: }; -PredicateFeature::PredicateFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase(arena, is_message_owned) { +PredicateFeature::PredicateFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.PredicateFeature) } PredicateFeature::PredicateFeature(const PredicateFeature& from) - : ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase() { - PredicateFeature* const _this = this; (void)_this; + : ::PROTOBUF_NAMESPACE_ID::Message() { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:grin.PredicateFeature) } +void PredicateFeature::SharedCtor() { +} + +PredicateFeature::~PredicateFeature() { + // @@protoc_insertion_point(destructor:grin.PredicateFeature) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void PredicateFeature::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} + +void PredicateFeature::ArenaDtor(void* object) { + PredicateFeature* _this = reinterpret_cast< PredicateFeature* >(object); + (void)_this; +} +void PredicateFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void PredicateFeature::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const PredicateFeature& PredicateFeature::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PredicateFeature_graph_2eproto.base); + return *internal_default_instance(); +} +void PredicateFeature::Clear() { +// @@protoc_insertion_point(message_clear_start:grin.PredicateFeature) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData PredicateFeature::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl, - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl, -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*PredicateFeature::GetClassData() const { return &_class_data_; } +const char* PredicateFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* PredicateFeature::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:grin.PredicateFeature) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:grin.PredicateFeature) + return target; +} + +size_t PredicateFeature::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:grin.PredicateFeature) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void PredicateFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.PredicateFeature) + GOOGLE_DCHECK_NE(&from, this); + const PredicateFeature* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.PredicateFeature) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.PredicateFeature) + MergeFrom(*source); + } +} +void PredicateFeature::MergeFrom(const PredicateFeature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.PredicateFeature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; +} +void PredicateFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.PredicateFeature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} +void PredicateFeature::CopyFrom(const PredicateFeature& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:grin.PredicateFeature) + if (&from == this) return; + Clear(); + MergeFrom(from); +} +bool PredicateFeature::IsInitialized() const { + return true; +} +void PredicateFeature::InternalSwap(PredicateFeature* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); +} ::PROTOBUF_NAMESPACE_ID::Metadata PredicateFeature::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[7]); + return GetMetadataStatic(); } + // =================================================================== +void StorageFeature::InitAsDefaultInstance() { + ::grin::_StorageFeature_default_instance_.topology_feature_ = const_cast< ::grin::TopologyFeature*>( + ::grin::TopologyFeature::internal_default_instance()); + ::grin::_StorageFeature_default_instance_.partition_feature_ = const_cast< ::grin::PartitionFeature*>( + ::grin::PartitionFeature::internal_default_instance()); + ::grin::_StorageFeature_default_instance_.property_feature_ = const_cast< ::grin::PropertyFeature*>( + ::grin::PropertyFeature::internal_default_instance()); + ::grin::_StorageFeature_default_instance_.index_feature_ = const_cast< ::grin::IndexFeature*>( + ::grin::IndexFeature::internal_default_instance()); + ::grin::_StorageFeature_default_instance_.predicate_feature_ = const_cast< ::grin::PredicateFeature*>( + ::grin::PredicateFeature::internal_default_instance()); +} class StorageFeature::_Internal { public: static const ::grin::TopologyFeature& topology_feature(const StorageFeature* msg); @@ -3224,139 +3376,128 @@ class StorageFeature::_Internal { const ::grin::TopologyFeature& StorageFeature::_Internal::topology_feature(const StorageFeature* msg) { - return *msg->_impl_.specific_feature_.topology_feature_; + return *msg->specific_feature_.topology_feature_; } const ::grin::PartitionFeature& StorageFeature::_Internal::partition_feature(const StorageFeature* msg) { - return *msg->_impl_.specific_feature_.partition_feature_; + return *msg->specific_feature_.partition_feature_; } const ::grin::PropertyFeature& StorageFeature::_Internal::property_feature(const StorageFeature* msg) { - return *msg->_impl_.specific_feature_.property_feature_; + return *msg->specific_feature_.property_feature_; } const ::grin::IndexFeature& StorageFeature::_Internal::index_feature(const StorageFeature* msg) { - return *msg->_impl_.specific_feature_.index_feature_; + return *msg->specific_feature_.index_feature_; } const ::grin::PredicateFeature& StorageFeature::_Internal::predicate_feature(const StorageFeature* msg) { - return *msg->_impl_.specific_feature_.predicate_feature_; + return *msg->specific_feature_.predicate_feature_; } void StorageFeature::set_allocated_topology_feature(::grin::TopologyFeature* topology_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); clear_specific_feature(); if (topology_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(topology_feature); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(topology_feature); if (message_arena != submessage_arena) { topology_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, topology_feature, submessage_arena); } set_has_topology_feature(); - _impl_.specific_feature_.topology_feature_ = topology_feature; + specific_feature_.topology_feature_ = topology_feature; } // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.topology_feature) } void StorageFeature::set_allocated_partition_feature(::grin::PartitionFeature* partition_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); clear_specific_feature(); if (partition_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(partition_feature); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(partition_feature); if (message_arena != submessage_arena) { partition_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, partition_feature, submessage_arena); } set_has_partition_feature(); - _impl_.specific_feature_.partition_feature_ = partition_feature; + specific_feature_.partition_feature_ = partition_feature; } // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.partition_feature) } void StorageFeature::set_allocated_property_feature(::grin::PropertyFeature* property_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); clear_specific_feature(); if (property_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(property_feature); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(property_feature); if (message_arena != submessage_arena) { property_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, property_feature, submessage_arena); } set_has_property_feature(); - _impl_.specific_feature_.property_feature_ = property_feature; + specific_feature_.property_feature_ = property_feature; } // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.property_feature) } void StorageFeature::set_allocated_index_feature(::grin::IndexFeature* index_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); clear_specific_feature(); if (index_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(index_feature); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(index_feature); if (message_arena != submessage_arena) { index_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, index_feature, submessage_arena); } set_has_index_feature(); - _impl_.specific_feature_.index_feature_ = index_feature; + specific_feature_.index_feature_ = index_feature; } // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.index_feature) } void StorageFeature::set_allocated_predicate_feature(::grin::PredicateFeature* predicate_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); clear_specific_feature(); if (predicate_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(predicate_feature); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(predicate_feature); if (message_arena != submessage_arena) { predicate_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, predicate_feature, submessage_arena); } set_has_predicate_feature(); - _impl_.specific_feature_.predicate_feature_ = predicate_feature; + specific_feature_.predicate_feature_ = predicate_feature; } // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.predicate_feature) } -StorageFeature::StorageFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +StorageFeature::StorageFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.StorageFeature) } StorageFeature::StorageFeature(const StorageFeature& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - StorageFeature* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.specific_feature_){} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); clear_has_specific_feature(); switch (from.specific_feature_case()) { case kTopologyFeature: { - _this->_internal_mutable_topology_feature()->::grin::TopologyFeature::MergeFrom( - from._internal_topology_feature()); + _internal_mutable_topology_feature()->::grin::TopologyFeature::MergeFrom(from._internal_topology_feature()); break; } case kPartitionFeature: { - _this->_internal_mutable_partition_feature()->::grin::PartitionFeature::MergeFrom( - from._internal_partition_feature()); + _internal_mutable_partition_feature()->::grin::PartitionFeature::MergeFrom(from._internal_partition_feature()); break; } case kPropertyFeature: { - _this->_internal_mutable_property_feature()->::grin::PropertyFeature::MergeFrom( - from._internal_property_feature()); + _internal_mutable_property_feature()->::grin::PropertyFeature::MergeFrom(from._internal_property_feature()); break; } case kIndexFeature: { - _this->_internal_mutable_index_feature()->::grin::IndexFeature::MergeFrom( - from._internal_index_feature()); + _internal_mutable_index_feature()->::grin::IndexFeature::MergeFrom(from._internal_index_feature()); break; } case kPredicateFeature: { - _this->_internal_mutable_predicate_feature()->::grin::PredicateFeature::MergeFrom( - from._internal_predicate_feature()); + _internal_mutable_predicate_feature()->::grin::PredicateFeature::MergeFrom(from._internal_predicate_feature()); break; } case SPECIFIC_FEATURE_NOT_SET: { @@ -3366,68 +3507,69 @@ StorageFeature::StorageFeature(const StorageFeature& from) // @@protoc_insertion_point(copy_constructor:grin.StorageFeature) } -inline void StorageFeature::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.specific_feature_){} - , /*decltype(_impl_._cached_size_)*/{} - , /*decltype(_impl_._oneof_case_)*/{} - }; +void StorageFeature::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StorageFeature_graph_2eproto.base); clear_has_specific_feature(); } StorageFeature::~StorageFeature() { // @@protoc_insertion_point(destructor:grin.StorageFeature) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void StorageFeature::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +void StorageFeature::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); if (has_specific_feature()) { clear_specific_feature(); } } +void StorageFeature::ArenaDtor(void* object) { + StorageFeature* _this = reinterpret_cast< StorageFeature* >(object); + (void)_this; +} +void StorageFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void StorageFeature::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const StorageFeature& StorageFeature::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StorageFeature_graph_2eproto.base); + return *internal_default_instance(); } + void StorageFeature::clear_specific_feature() { // @@protoc_insertion_point(one_of_clear_start:grin.StorageFeature) switch (specific_feature_case()) { case kTopologyFeature: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_feature_.topology_feature_; + if (GetArena() == nullptr) { + delete specific_feature_.topology_feature_; } break; } case kPartitionFeature: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_feature_.partition_feature_; + if (GetArena() == nullptr) { + delete specific_feature_.partition_feature_; } break; } case kPropertyFeature: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_feature_.property_feature_; + if (GetArena() == nullptr) { + delete specific_feature_.property_feature_; } break; } case kIndexFeature: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_feature_.index_feature_; + if (GetArena() == nullptr) { + delete specific_feature_.index_feature_; } break; } case kPredicateFeature: { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_feature_.predicate_feature_; + if (GetArena() == nullptr) { + delete specific_feature_.predicate_feature_; } break; } @@ -3435,13 +3577,13 @@ void StorageFeature::clear_specific_feature() { break; } } - _impl_._oneof_case_[0] = SPECIFIC_FEATURE_NOT_SET; + _oneof_case_[0] = SPECIFIC_FEATURE_NOT_SET; } void StorageFeature::Clear() { // @@protoc_insertion_point(message_clear_start:grin.StorageFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3449,118 +3591,119 @@ void StorageFeature::Clear() { _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* StorageFeature::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* StorageFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // .grin.TopologyFeature topology_feature = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { ptr = ctx->ParseMessage(_internal_mutable_topology_feature(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.PartitionFeature partition_feature = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { ptr = ctx->ParseMessage(_internal_mutable_partition_feature(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.PropertyFeature property_feature = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { ptr = ctx->ParseMessage(_internal_mutable_property_feature(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.IndexFeature index_feature = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_index_feature(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.PredicateFeature predicate_feature = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 42)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { ptr = ctx->ParseMessage(_internal_mutable_predicate_feature(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* StorageFeature::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* StorageFeature::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:grin.StorageFeature) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // .grin.TopologyFeature topology_feature = 1; if (_internal_has_topology_feature()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(1, _Internal::topology_feature(this), - _Internal::topology_feature(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 1, _Internal::topology_feature(this), target, stream); } // .grin.PartitionFeature partition_feature = 2; if (_internal_has_partition_feature()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, _Internal::partition_feature(this), - _Internal::partition_feature(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 2, _Internal::partition_feature(this), target, stream); } // .grin.PropertyFeature property_feature = 3; if (_internal_has_property_feature()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, _Internal::property_feature(this), - _Internal::property_feature(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 3, _Internal::property_feature(this), target, stream); } // .grin.IndexFeature index_feature = 4; if (_internal_has_index_feature()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::index_feature(this), - _Internal::index_feature(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 4, _Internal::index_feature(this), target, stream); } // .grin.PredicateFeature predicate_feature = 5; if (_internal_has_predicate_feature()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, _Internal::predicate_feature(this), - _Internal::predicate_feature(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 5, _Internal::predicate_feature(this), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:grin.StorageFeature) @@ -3571,7 +3714,7 @@ size_t StorageFeature::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:grin.StorageFeature) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; @@ -3580,90 +3723,104 @@ size_t StorageFeature::ByteSizeLong() const { case kTopologyFeature: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.specific_feature_.topology_feature_); + *specific_feature_.topology_feature_); break; } // .grin.PartitionFeature partition_feature = 2; case kPartitionFeature: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.specific_feature_.partition_feature_); + *specific_feature_.partition_feature_); break; } // .grin.PropertyFeature property_feature = 3; case kPropertyFeature: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.specific_feature_.property_feature_); + *specific_feature_.property_feature_); break; } // .grin.IndexFeature index_feature = 4; case kIndexFeature: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.specific_feature_.index_feature_); + *specific_feature_.index_feature_); break; } // .grin.PredicateFeature predicate_feature = 5; case kPredicateFeature: { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.specific_feature_.predicate_feature_); + *specific_feature_.predicate_feature_); break; } case SPECIFIC_FEATURE_NOT_SET: { break; } } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData StorageFeature::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - StorageFeature::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*StorageFeature::GetClassData() const { return &_class_data_; } - +void StorageFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.StorageFeature) + GOOGLE_DCHECK_NE(&from, this); + const StorageFeature* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.StorageFeature) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.StorageFeature) + MergeFrom(*source); + } +} -void StorageFeature::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.StorageFeature) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void StorageFeature::MergeFrom(const StorageFeature& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.StorageFeature) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; switch (from.specific_feature_case()) { case kTopologyFeature: { - _this->_internal_mutable_topology_feature()->::grin::TopologyFeature::MergeFrom( - from._internal_topology_feature()); + _internal_mutable_topology_feature()->::grin::TopologyFeature::MergeFrom(from._internal_topology_feature()); break; } case kPartitionFeature: { - _this->_internal_mutable_partition_feature()->::grin::PartitionFeature::MergeFrom( - from._internal_partition_feature()); + _internal_mutable_partition_feature()->::grin::PartitionFeature::MergeFrom(from._internal_partition_feature()); break; } case kPropertyFeature: { - _this->_internal_mutable_property_feature()->::grin::PropertyFeature::MergeFrom( - from._internal_property_feature()); + _internal_mutable_property_feature()->::grin::PropertyFeature::MergeFrom(from._internal_property_feature()); break; } case kIndexFeature: { - _this->_internal_mutable_index_feature()->::grin::IndexFeature::MergeFrom( - from._internal_index_feature()); + _internal_mutable_index_feature()->::grin::IndexFeature::MergeFrom(from._internal_index_feature()); break; } case kPredicateFeature: { - _this->_internal_mutable_predicate_feature()->::grin::PredicateFeature::MergeFrom( - from._internal_predicate_feature()); + _internal_mutable_predicate_feature()->::grin::PredicateFeature::MergeFrom(from._internal_predicate_feature()); break; } case SPECIFIC_FEATURE_NOT_SET: { break; } } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void StorageFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.StorageFeature) + if (&from == this) return; + Clear(); + MergeFrom(from); } void StorageFeature::CopyFrom(const StorageFeature& from) { @@ -3679,197 +3836,185 @@ bool StorageFeature::IsInitialized() const { void StorageFeature::InternalSwap(StorageFeature* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - swap(_impl_.specific_feature_, other->_impl_.specific_feature_); - swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + swap(specific_feature_, other->specific_feature_); + swap(_oneof_case_[0], other->_oneof_case_[0]); } ::PROTOBUF_NAMESPACE_ID::Metadata StorageFeature::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[8]); + return GetMetadataStatic(); } + // =================================================================== +void Statistics::InitAsDefaultInstance() { +} class Statistics::_Internal { public: }; -Statistics::Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +Statistics::Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.Statistics) } Statistics::Statistics(const Statistics& from) : ::PROTOBUF_NAMESPACE_ID::Message() { - Statistics* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.vertex_count_){} - , decltype(_impl_.edge_count_){} - , decltype(_impl_.partition_count_){} - , decltype(_impl_.vertex_type_count_){} - , decltype(_impl_.edge_type_count_){} - , /*decltype(_impl_._cached_size_)*/{}}; - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&_impl_.vertex_count_, &from._impl_.vertex_count_, - static_cast(reinterpret_cast(&_impl_.edge_type_count_) - - reinterpret_cast(&_impl_.vertex_count_)) + sizeof(_impl_.edge_type_count_)); + ::memcpy(&vertex_count_, &from.vertex_count_, + static_cast(reinterpret_cast(&edge_type_count_) - + reinterpret_cast(&vertex_count_)) + sizeof(edge_type_count_)); // @@protoc_insertion_point(copy_constructor:grin.Statistics) } -inline void Statistics::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.vertex_count_){0} - , decltype(_impl_.edge_count_){0} - , decltype(_impl_.partition_count_){0} - , decltype(_impl_.vertex_type_count_){0} - , decltype(_impl_.edge_type_count_){0} - , /*decltype(_impl_._cached_size_)*/{} - }; +void Statistics::SharedCtor() { + ::memset(&vertex_count_, 0, static_cast( + reinterpret_cast(&edge_type_count_) - + reinterpret_cast(&vertex_count_)) + sizeof(edge_type_count_)); } Statistics::~Statistics() { // @@protoc_insertion_point(destructor:grin.Statistics) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void Statistics::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); +void Statistics::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); } +void Statistics::ArenaDtor(void* object) { + Statistics* _this = reinterpret_cast< Statistics* >(object); + (void)_this; +} +void Statistics::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void Statistics::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); +} +const Statistics& Statistics::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Statistics_graph_2eproto.base); + return *internal_default_instance(); } + void Statistics::Clear() { // @@protoc_insertion_point(message_clear_start:grin.Statistics) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - ::memset(&_impl_.vertex_count_, 0, static_cast( - reinterpret_cast(&_impl_.edge_type_count_) - - reinterpret_cast(&_impl_.vertex_count_)) + sizeof(_impl_.edge_type_count_)); + ::memset(&vertex_count_, 0, static_cast( + reinterpret_cast(&edge_type_count_) - + reinterpret_cast(&vertex_count_)) + sizeof(edge_type_count_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Statistics::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* Statistics::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // int32 vertex_count = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 8)) { - _impl_.vertex_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + vertex_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // int32 edge_count = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 16)) { - _impl_.edge_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + edge_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // int32 partition_count = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 24)) { - _impl_.partition_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + partition_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // int32 vertex_type_count = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 32)) { - _impl_.vertex_type_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + vertex_type_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // int32 edge_type_count = 5; case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 40)) { - _impl_.edge_type_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + edge_type_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); continue; - default: - goto handle_unusual; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* Statistics::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* Statistics::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:grin.Statistics) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // int32 vertex_count = 1; - if (this->_internal_vertex_count() != 0) { + if (this->vertex_count() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_vertex_count(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_vertex_count(), target); } // int32 edge_count = 2; - if (this->_internal_edge_count() != 0) { + if (this->edge_count() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_edge_count(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_edge_count(), target); } // int32 partition_count = 3; - if (this->_internal_partition_count() != 0) { + if (this->partition_count() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_partition_count(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_partition_count(), target); } // int32 vertex_type_count = 4; - if (this->_internal_vertex_type_count() != 0) { + if (this->vertex_type_count() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_vertex_type_count(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_vertex_type_count(), target); } // int32 edge_type_count = 5; - if (this->_internal_edge_type_count() != 0) { + if (this->edge_type_count() != 0) { target = stream->EnsureSpace(target); - target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_edge_type_count(), target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_edge_type_count(), target); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:grin.Statistics) @@ -3880,69 +4025,98 @@ size_t Statistics::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:grin.Statistics) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // int32 vertex_count = 1; - if (this->_internal_vertex_count() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_vertex_count()); + if (this->vertex_count() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_vertex_count()); } // int32 edge_count = 2; - if (this->_internal_edge_count() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_edge_count()); + if (this->edge_count() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_edge_count()); } // int32 partition_count = 3; - if (this->_internal_partition_count() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_partition_count()); + if (this->partition_count() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_partition_count()); } // int32 vertex_type_count = 4; - if (this->_internal_vertex_type_count() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_vertex_type_count()); + if (this->vertex_type_count() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_vertex_type_count()); } // int32 edge_type_count = 5; - if (this->_internal_edge_type_count() != 0) { - total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_edge_type_count()); + if (this->edge_type_count() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_edge_type_count()); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Statistics::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Statistics::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Statistics::GetClassData() const { return &_class_data_; } - +void Statistics::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.Statistics) + GOOGLE_DCHECK_NE(&from, this); + const Statistics* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.Statistics) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.Statistics) + MergeFrom(*source); + } +} -void Statistics::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.Statistics) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void Statistics::MergeFrom(const Statistics& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.Statistics) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - if (from._internal_vertex_count() != 0) { - _this->_internal_set_vertex_count(from._internal_vertex_count()); + if (from.vertex_count() != 0) { + _internal_set_vertex_count(from._internal_vertex_count()); } - if (from._internal_edge_count() != 0) { - _this->_internal_set_edge_count(from._internal_edge_count()); + if (from.edge_count() != 0) { + _internal_set_edge_count(from._internal_edge_count()); } - if (from._internal_partition_count() != 0) { - _this->_internal_set_partition_count(from._internal_partition_count()); + if (from.partition_count() != 0) { + _internal_set_partition_count(from._internal_partition_count()); } - if (from._internal_vertex_type_count() != 0) { - _this->_internal_set_vertex_type_count(from._internal_vertex_type_count()); + if (from.vertex_type_count() != 0) { + _internal_set_vertex_type_count(from._internal_vertex_type_count()); } - if (from._internal_edge_type_count() != 0) { - _this->_internal_set_edge_type_count(from._internal_edge_type_count()); + if (from.edge_type_count() != 0) { + _internal_set_edge_type_count(from._internal_edge_type_count()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Statistics::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.Statistics) + if (&from == this) return; + Clear(); + MergeFrom(from); } void Statistics::CopyFrom(const Statistics& from) { @@ -3958,23 +4132,26 @@ bool Statistics::IsInitialized() const { void Statistics::InternalSwap(Statistics* other) { using std::swap; - _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Statistics, _impl_.edge_type_count_) - + sizeof(Statistics::_impl_.edge_type_count_) - - PROTOBUF_FIELD_OFFSET(Statistics, _impl_.vertex_count_)>( - reinterpret_cast(&_impl_.vertex_count_), - reinterpret_cast(&other->_impl_.vertex_count_)); + PROTOBUF_FIELD_OFFSET(Statistics, edge_type_count_) + + sizeof(Statistics::edge_type_count_) + - PROTOBUF_FIELD_OFFSET(Statistics, vertex_count_)>( + reinterpret_cast(&vertex_count_), + reinterpret_cast(&other->vertex_count_)); } ::PROTOBUF_NAMESPACE_ID::Metadata Statistics::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[9]); + return GetMetadataStatic(); } + // =================================================================== +void Graph::InitAsDefaultInstance() { + ::grin::_Graph_default_instance_._instance.get_mutable()->statistics_ = const_cast< ::grin::Statistics*>( + ::grin::Statistics::internal_default_instance()); +} class Graph::_Internal { public: static const ::grin::Statistics& statistics(const Graph* msg); @@ -3982,134 +4159,117 @@ class Graph::_Internal { const ::grin::Statistics& Graph::_Internal::statistics(const Graph* msg) { - return *msg->_impl_.statistics_; + return *msg->statistics_; } -Graph::Graph(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned) - : ::PROTOBUF_NAMESPACE_ID::Message(arena, is_message_owned) { - SharedCtor(arena, is_message_owned); +Graph::Graph(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena), + features_(arena) { + SharedCtor(); + RegisterArenaDtor(arena); // @@protoc_insertion_point(arena_constructor:grin.Graph) } Graph::Graph(const Graph& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - Graph* const _this = this; (void)_this; - new (&_impl_) Impl_{ - decltype(_impl_.features_){from._impl_.features_} - , decltype(_impl_.uri_){} - , decltype(_impl_.grin_version_){} - , decltype(_impl_.statistics_){nullptr} - , /*decltype(_impl_._cached_size_)*/{}}; - + : ::PROTOBUF_NAMESPACE_ID::Message(), + features_(from.features_) { _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - _impl_.uri_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.uri_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (!from._internal_uri().empty()) { - _this->_impl_.uri_.Set(from._internal_uri(), - _this->GetArenaForAllocation()); + uri_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_uri(), + GetArena()); } - _impl_.grin_version_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.grin_version_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + grin_version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); if (!from._internal_grin_version().empty()) { - _this->_impl_.grin_version_.Set(from._internal_grin_version(), - _this->GetArenaForAllocation()); + grin_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_grin_version(), + GetArena()); } if (from._internal_has_statistics()) { - _this->_impl_.statistics_ = new ::grin::Statistics(*from._impl_.statistics_); + statistics_ = new ::grin::Statistics(*from.statistics_); + } else { + statistics_ = nullptr; } // @@protoc_insertion_point(copy_constructor:grin.Graph) } -inline void Graph::SharedCtor( - ::_pb::Arena* arena, bool is_message_owned) { - (void)arena; - (void)is_message_owned; - new (&_impl_) Impl_{ - decltype(_impl_.features_){arena} - , decltype(_impl_.uri_){} - , decltype(_impl_.grin_version_){} - , decltype(_impl_.statistics_){nullptr} - , /*decltype(_impl_._cached_size_)*/{} - }; - _impl_.uri_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.uri_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.grin_version_.InitDefault(); - #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - _impl_.grin_version_.Set("", GetArenaForAllocation()); - #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING +void Graph::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Graph_graph_2eproto.base); + uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + grin_version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + statistics_ = nullptr; } Graph::~Graph() { // @@protoc_insertion_point(destructor:grin.Graph) - if (auto *arena = _internal_metadata_.DeleteReturnArena<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>()) { - (void)arena; - return; - } SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -inline void Graph::SharedDtor() { - GOOGLE_DCHECK(GetArenaForAllocation() == nullptr); - _impl_.features_.~RepeatedPtrField(); - _impl_.uri_.Destroy(); - _impl_.grin_version_.Destroy(); - if (this != internal_default_instance()) delete _impl_.statistics_; +void Graph::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + uri_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + grin_version_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete statistics_; } +void Graph::ArenaDtor(void* object) { + Graph* _this = reinterpret_cast< Graph* >(object); + (void)_this; +} +void Graph::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} void Graph::SetCachedSize(int size) const { - _impl_._cached_size_.Set(size); + _cached_size_.Set(size); } +const Graph& Graph::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Graph_graph_2eproto.base); + return *internal_default_instance(); +} + void Graph::Clear() { // @@protoc_insertion_point(message_clear_start:grin.Graph) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; - _impl_.features_.Clear(); - _impl_.uri_.ClearToEmpty(); - _impl_.grin_version_.ClearToEmpty(); - if (GetArenaForAllocation() == nullptr && _impl_.statistics_ != nullptr) { - delete _impl_.statistics_; + features_.Clear(); + uri_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + grin_version_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + if (GetArena() == nullptr && statistics_ != nullptr) { + delete statistics_; } - _impl_.statistics_ = nullptr; + statistics_ = nullptr; _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } -const char* Graph::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { +const char* Graph::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; while (!ctx->Done(&ptr)) { - uint32_t tag; - ptr = ::_pbi::ReadTag(ptr, &tag); + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); switch (tag >> 3) { // string uri = 1; case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 10)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { auto str = _internal_mutable_uri(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "grin.Graph.uri")); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "grin.Graph.uri")); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // string grin_version = 2; case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 18)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { auto str = _internal_mutable_grin_version(); - ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "grin.Graph.grin_version")); CHK_(ptr); - CHK_(::_pbi::VerifyUTF8(str, "grin.Graph.grin_version")); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // repeated .grin.StorageFeature features = 3; case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 26)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { ptr -= 1; do { ptr += 1; @@ -4117,48 +4277,45 @@ const char* Graph::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) { CHK_(ptr); if (!ctx->DataAvailable(ptr)) break; } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); - } else - goto handle_unusual; + } else goto handle_unusual; continue; // .grin.Statistics statistics = 4; case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast(tag) == 34)) { + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { ptr = ctx->ParseMessage(_internal_mutable_statistics(), ptr); CHK_(ptr); - } else - goto handle_unusual; + } else goto handle_unusual; continue; - default: - goto handle_unusual; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } } // switch - handle_unusual: - if ((tag == 0) || ((tag & 7) == 4)) { - CHK_(ptr); - ctx->SetLastTag(tag); - goto message_done; - } - ptr = UnknownFieldParse( - tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); } // while -message_done: +success: return ptr; failure: ptr = nullptr; - goto message_done; + goto success; #undef CHK_ } -uint8_t* Graph::_InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { +::PROTOBUF_NAMESPACE_ID::uint8* Graph::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { // @@protoc_insertion_point(serialize_to_array_start:grin.Graph) - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; // string uri = 1; - if (!this->_internal_uri().empty()) { + if (this->uri().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_uri().data(), static_cast(this->_internal_uri().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, @@ -4168,7 +4325,7 @@ uint8_t* Graph::_InternalSerialize( } // string grin_version = 2; - if (!this->_internal_grin_version().empty()) { + if (this->grin_version().size() > 0) { ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( this->_internal_grin_version().data(), static_cast(this->_internal_grin_version().length()), ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, @@ -4178,22 +4335,23 @@ uint8_t* Graph::_InternalSerialize( } // repeated .grin.StorageFeature features = 3; - for (unsigned i = 0, - n = static_cast(this->_internal_features_size()); i < n; i++) { - const auto& repfield = this->_internal_features(i); + for (unsigned int i = 0, + n = static_cast(this->_internal_features_size()); i < n; i++) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, repfield, repfield.GetCachedSize(), target, stream); + InternalWriteMessage(3, this->_internal_features(i), target, stream); } // .grin.Statistics statistics = 4; - if (this->_internal_has_statistics()) { + if (this->has_statistics()) { + target = stream->EnsureSpace(target); target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(4, _Internal::statistics(this), - _Internal::statistics(this).GetCachedSize(), target, stream); + InternalWriteMessage( + 4, _Internal::statistics(this), target, stream); } if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); } // @@protoc_insertion_point(serialize_to_array_end:grin.Graph) @@ -4204,68 +4362,86 @@ size_t Graph::ByteSizeLong() const { // @@protoc_insertion_point(message_byte_size_start:grin.Graph) size_t total_size = 0; - uint32_t cached_has_bits = 0; + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; // Prevent compiler warnings about cached_has_bits being unused (void) cached_has_bits; // repeated .grin.StorageFeature features = 3; total_size += 1UL * this->_internal_features_size(); - for (const auto& msg : this->_impl_.features_) { + for (const auto& msg : this->features_) { total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); } // string uri = 1; - if (!this->_internal_uri().empty()) { + if (this->uri().size() > 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_uri()); } // string grin_version = 2; - if (!this->_internal_grin_version().empty()) { + if (this->grin_version().size() > 0) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( this->_internal_grin_version()); } // .grin.Statistics statistics = 4; - if (this->_internal_has_statistics()) { + if (this->has_statistics()) { total_size += 1 + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *_impl_.statistics_); + *statistics_); } - return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; } -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData Graph::_class_data_ = { - ::PROTOBUF_NAMESPACE_ID::Message::CopyWithSourceCheck, - Graph::MergeImpl -}; -const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*Graph::GetClassData() const { return &_class_data_; } - +void Graph::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:grin.Graph) + GOOGLE_DCHECK_NE(&from, this); + const Graph* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.Graph) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.Graph) + MergeFrom(*source); + } +} -void Graph::MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg) { - auto* const _this = static_cast(&to_msg); - auto& from = static_cast(from_msg); - // @@protoc_insertion_point(class_specific_merge_from_start:grin.Graph) - GOOGLE_DCHECK_NE(&from, _this); - uint32_t cached_has_bits = 0; +void Graph::MergeFrom(const Graph& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:grin.Graph) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; (void) cached_has_bits; - _this->_impl_.features_.MergeFrom(from._impl_.features_); - if (!from._internal_uri().empty()) { - _this->_internal_set_uri(from._internal_uri()); + features_.MergeFrom(from.features_); + if (from.uri().size() > 0) { + _internal_set_uri(from._internal_uri()); } - if (!from._internal_grin_version().empty()) { - _this->_internal_set_grin_version(from._internal_grin_version()); + if (from.grin_version().size() > 0) { + _internal_set_grin_version(from._internal_grin_version()); } - if (from._internal_has_statistics()) { - _this->_internal_mutable_statistics()->::grin::Statistics::MergeFrom( - from._internal_statistics()); + if (from.has_statistics()) { + _internal_mutable_statistics()->::grin::Statistics::MergeFrom(from._internal_statistics()); } - _this->_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); +} + +void Graph::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:grin.Graph) + if (&from == this) return; + Clear(); + MergeFrom(from); } void Graph::CopyFrom(const Graph& from) { @@ -4281,72 +4457,52 @@ bool Graph::IsInitialized() const { void Graph::InternalSwap(Graph* other) { using std::swap; - auto* lhs_arena = GetArenaForAllocation(); - auto* rhs_arena = other->GetArenaForAllocation(); - _internal_metadata_.InternalSwap(&other->_internal_metadata_); - _impl_.features_.InternalSwap(&other->_impl_.features_); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.uri_, lhs_arena, - &other->_impl_.uri_, rhs_arena - ); - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap( - &_impl_.grin_version_, lhs_arena, - &other->_impl_.grin_version_, rhs_arena - ); - swap(_impl_.statistics_, other->_impl_.statistics_); + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + features_.InternalSwap(&other->features_); + uri_.Swap(&other->uri_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + grin_version_.Swap(&other->grin_version_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + swap(statistics_, other->statistics_); } ::PROTOBUF_NAMESPACE_ID::Metadata Graph::GetMetadata() const { - return ::_pbi::AssignDescriptors( - &descriptor_table_graph_2eproto_getter, &descriptor_table_graph_2eproto_once, - file_level_metadata_graph_2eproto[10]); + return GetMetadataStatic(); } + // @@protoc_insertion_point(namespace_scope) } // namespace grin PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::grin::TopologyFeature* -Arena::CreateMaybeMessage< ::grin::TopologyFeature >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::TopologyFeature* Arena::CreateMaybeMessage< ::grin::TopologyFeature >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::TopologyFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::MirrorPartitionListFeature* -Arena::CreateMaybeMessage< ::grin::MirrorPartitionListFeature >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::MirrorPartitionListFeature* Arena::CreateMaybeMessage< ::grin::MirrorPartitionListFeature >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::MirrorPartitionListFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::PartitionFeature* -Arena::CreateMaybeMessage< ::grin::PartitionFeature >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::PartitionFeature* Arena::CreateMaybeMessage< ::grin::PartitionFeature >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::PartitionFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::VertexPropertyFeature* -Arena::CreateMaybeMessage< ::grin::VertexPropertyFeature >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::VertexPropertyFeature* Arena::CreateMaybeMessage< ::grin::VertexPropertyFeature >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::VertexPropertyFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::EdgePropertyFeature* -Arena::CreateMaybeMessage< ::grin::EdgePropertyFeature >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::EdgePropertyFeature* Arena::CreateMaybeMessage< ::grin::EdgePropertyFeature >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::EdgePropertyFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::PropertyFeature* -Arena::CreateMaybeMessage< ::grin::PropertyFeature >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::PropertyFeature* Arena::CreateMaybeMessage< ::grin::PropertyFeature >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::PropertyFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::IndexFeature* -Arena::CreateMaybeMessage< ::grin::IndexFeature >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::IndexFeature* Arena::CreateMaybeMessage< ::grin::IndexFeature >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::IndexFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::PredicateFeature* -Arena::CreateMaybeMessage< ::grin::PredicateFeature >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::PredicateFeature* Arena::CreateMaybeMessage< ::grin::PredicateFeature >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::PredicateFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::StorageFeature* -Arena::CreateMaybeMessage< ::grin::StorageFeature >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::StorageFeature* Arena::CreateMaybeMessage< ::grin::StorageFeature >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::StorageFeature >(arena); } -template<> PROTOBUF_NOINLINE ::grin::Statistics* -Arena::CreateMaybeMessage< ::grin::Statistics >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::Statistics* Arena::CreateMaybeMessage< ::grin::Statistics >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::Statistics >(arena); } -template<> PROTOBUF_NOINLINE ::grin::Graph* -Arena::CreateMaybeMessage< ::grin::Graph >(Arena* arena) { +template<> PROTOBUF_NOINLINE ::grin::Graph* Arena::CreateMaybeMessage< ::grin::Graph >(Arena* arena) { return Arena::CreateMessageInternal< ::grin::Graph >(arena); } PROTOBUF_NAMESPACE_CLOSE diff --git a/modules/graph/grin/src/proto/graph.pb.h b/modules/graph/grin/src/proto/graph.pb.h index ad70762c8..c8f4c27c5 100644 --- a/modules/graph/grin/src/proto/graph.pb.h +++ b/modules/graph/grin/src/proto/graph.pb.h @@ -8,12 +8,12 @@ #include #include -#if PROTOBUF_VERSION < 3021000 +#if PROTOBUF_VERSION < 3012000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif -#if 3021012 < PROTOBUF_MIN_PROTOC_VERSION +#if 3012004 < PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. @@ -23,8 +23,9 @@ #include #include #include -#include +#include #include +#include #include #include #include @@ -43,42 +44,50 @@ PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_graph_2eproto { - static const uint32_t offsets[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[11] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; + static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; }; extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_graph_2eproto; namespace grin { class EdgePropertyFeature; -struct EdgePropertyFeatureDefaultTypeInternal; +class EdgePropertyFeatureDefaultTypeInternal; extern EdgePropertyFeatureDefaultTypeInternal _EdgePropertyFeature_default_instance_; class Graph; -struct GraphDefaultTypeInternal; +class GraphDefaultTypeInternal; extern GraphDefaultTypeInternal _Graph_default_instance_; class IndexFeature; -struct IndexFeatureDefaultTypeInternal; +class IndexFeatureDefaultTypeInternal; extern IndexFeatureDefaultTypeInternal _IndexFeature_default_instance_; class MirrorPartitionListFeature; -struct MirrorPartitionListFeatureDefaultTypeInternal; +class MirrorPartitionListFeatureDefaultTypeInternal; extern MirrorPartitionListFeatureDefaultTypeInternal _MirrorPartitionListFeature_default_instance_; class PartitionFeature; -struct PartitionFeatureDefaultTypeInternal; +class PartitionFeatureDefaultTypeInternal; extern PartitionFeatureDefaultTypeInternal _PartitionFeature_default_instance_; class PredicateFeature; -struct PredicateFeatureDefaultTypeInternal; +class PredicateFeatureDefaultTypeInternal; extern PredicateFeatureDefaultTypeInternal _PredicateFeature_default_instance_; class PropertyFeature; -struct PropertyFeatureDefaultTypeInternal; +class PropertyFeatureDefaultTypeInternal; extern PropertyFeatureDefaultTypeInternal _PropertyFeature_default_instance_; class Statistics; -struct StatisticsDefaultTypeInternal; +class StatisticsDefaultTypeInternal; extern StatisticsDefaultTypeInternal _Statistics_default_instance_; class StorageFeature; -struct StorageFeatureDefaultTypeInternal; +class StorageFeatureDefaultTypeInternal; extern StorageFeatureDefaultTypeInternal _StorageFeature_default_instance_; class TopologyFeature; -struct TopologyFeatureDefaultTypeInternal; +class TopologyFeatureDefaultTypeInternal; extern TopologyFeatureDefaultTypeInternal _TopologyFeature_default_instance_; class VertexPropertyFeature; -struct VertexPropertyFeatureDefaultTypeInternal; +class VertexPropertyFeatureDefaultTypeInternal; extern VertexPropertyFeatureDefaultTypeInternal _VertexPropertyFeature_default_instance_; } // namespace grin PROTOBUF_NAMESPACE_OPEN @@ -100,8 +109,8 @@ enum ListRetrieval : int { LR_NA = 0, LR_ARRAY_LIKE = 1, LR_ITERATOR = 2, - ListRetrieval_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - ListRetrieval_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + ListRetrieval_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + ListRetrieval_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() }; bool ListRetrieval_IsValid(int value); constexpr ListRetrieval ListRetrieval_MIN = LR_NA; @@ -118,7 +127,7 @@ inline const std::string& ListRetrieval_Name(T enum_t_value) { ListRetrieval_descriptor(), enum_t_value); } inline bool ListRetrieval_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ListRetrieval* value) { + const std::string& name, ListRetrieval* value) { return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( ListRetrieval_descriptor(), name, value); } @@ -128,8 +137,8 @@ enum GraphPartitionStrategy : int { GPS_EDGE_CUT = 2, GPS_VERTEX_CUT = 3, GPS_HYBRID_CUT = 4, - GraphPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - GraphPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + GraphPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + GraphPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() }; bool GraphPartitionStrategy_IsValid(int value); constexpr GraphPartitionStrategy GraphPartitionStrategy_MIN = GPS_NA; @@ -146,7 +155,7 @@ inline const std::string& GraphPartitionStrategy_Name(T enum_t_value) { GraphPartitionStrategy_descriptor(), enum_t_value); } inline bool GraphPartitionStrategy_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GraphPartitionStrategy* value) { + const std::string& name, GraphPartitionStrategy* value) { return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( GraphPartitionStrategy_descriptor(), name, value); } @@ -155,8 +164,8 @@ enum PropertyDataPartitionStrategy : int { PDPS_MASTER_ONLY = 1, PDPS_REPLICATE_MASTER_MIRROR = 2, PDPS_SPLIT_MASTER_MIRROR = 3, - PropertyDataPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits::min(), - PropertyDataPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits::max() + PropertyDataPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + PropertyDataPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() }; bool PropertyDataPartitionStrategy_IsValid(int value); constexpr PropertyDataPartitionStrategy PropertyDataPartitionStrategy_MIN = PDPS_NA; @@ -173,18 +182,17 @@ inline const std::string& PropertyDataPartitionStrategy_Name(T enum_t_value) { PropertyDataPartitionStrategy_descriptor(), enum_t_value); } inline bool PropertyDataPartitionStrategy_Parse( - ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PropertyDataPartitionStrategy* value) { + const std::string& name, PropertyDataPartitionStrategy* value) { return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( PropertyDataPartitionStrategy_descriptor(), name, value); } // =================================================================== -class TopologyFeature final : +class TopologyFeature PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.TopologyFeature) */ { public: - inline TopologyFeature() : TopologyFeature(nullptr) {} - ~TopologyFeature() override; - explicit PROTOBUF_CONSTEXPR TopologyFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline TopologyFeature() : TopologyFeature(nullptr) {}; + virtual ~TopologyFeature(); TopologyFeature(const TopologyFeature& from); TopologyFeature(TopologyFeature&& from) noexcept @@ -197,13 +205,8 @@ class TopologyFeature final : return *this; } inline TopologyFeature& operator=(TopologyFeature&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -214,14 +217,14 @@ class TopologyFeature final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const TopologyFeature& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const TopologyFeature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TopologyFeature* internal_default_instance() { return reinterpret_cast( &_TopologyFeature_default_instance_); @@ -234,12 +237,7 @@ class TopologyFeature final : } inline void Swap(TopologyFeature* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -247,53 +245,56 @@ class TopologyFeature final : } void UnsafeArenaSwap(TopologyFeature* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - TopologyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline TopologyFeature* New() const final { + return CreateMaybeMessage(nullptr); + } + + TopologyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const TopologyFeature& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const TopologyFeature& from) { - TopologyFeature::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const TopologyFeature& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(TopologyFeature* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.TopologyFeature"; } protected: - explicit TopologyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit TopologyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -422,32 +423,28 @@ class TopologyFeature final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedField vertex_list_retrievals_; - mutable std::atomic _vertex_list_retrievals_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField edge_list_retrievals_; - mutable std::atomic _edge_list_retrievals_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField adjacent_list_retrievals_; - mutable std::atomic _adjacent_list_retrievals_cached_byte_size_; - bool grin_assume_has_directed_graph_; - bool grin_assume_has_undirected_graph_; - bool grin_assume_has_multi_edge_graph_; - bool grin_with_vertex_original_id_; - bool grin_with_vertex_data_; - bool grin_with_edge_data_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::PROTOBUF_NAMESPACE_ID::RepeatedField vertex_list_retrievals_; + mutable std::atomic _vertex_list_retrievals_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField edge_list_retrievals_; + mutable std::atomic _edge_list_retrievals_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField adjacent_list_retrievals_; + mutable std::atomic _adjacent_list_retrievals_cached_byte_size_; + bool grin_assume_has_directed_graph_; + bool grin_assume_has_undirected_graph_; + bool grin_assume_has_multi_edge_graph_; + bool grin_with_vertex_original_id_; + bool grin_with_vertex_data_; + bool grin_with_edge_data_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; // ------------------------------------------------------------------- -class MirrorPartitionListFeature final : +class MirrorPartitionListFeature PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.MirrorPartitionListFeature) */ { public: - inline MirrorPartitionListFeature() : MirrorPartitionListFeature(nullptr) {} - ~MirrorPartitionListFeature() override; - explicit PROTOBUF_CONSTEXPR MirrorPartitionListFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline MirrorPartitionListFeature() : MirrorPartitionListFeature(nullptr) {}; + virtual ~MirrorPartitionListFeature(); MirrorPartitionListFeature(const MirrorPartitionListFeature& from); MirrorPartitionListFeature(MirrorPartitionListFeature&& from) noexcept @@ -460,13 +457,8 @@ class MirrorPartitionListFeature final : return *this; } inline MirrorPartitionListFeature& operator=(MirrorPartitionListFeature&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -477,14 +469,14 @@ class MirrorPartitionListFeature final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const MirrorPartitionListFeature& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const MirrorPartitionListFeature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const MirrorPartitionListFeature* internal_default_instance() { return reinterpret_cast( &_MirrorPartitionListFeature_default_instance_); @@ -497,12 +489,7 @@ class MirrorPartitionListFeature final : } inline void Swap(MirrorPartitionListFeature* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -510,53 +497,56 @@ class MirrorPartitionListFeature final : } void UnsafeArenaSwap(MirrorPartitionListFeature* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - MirrorPartitionListFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline MirrorPartitionListFeature* New() const final { + return CreateMaybeMessage(nullptr); + } + + MirrorPartitionListFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const MirrorPartitionListFeature& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const MirrorPartitionListFeature& from) { - MirrorPartitionListFeature::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const MirrorPartitionListFeature& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(MirrorPartitionListFeature* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.MirrorPartitionListFeature"; } protected: - explicit MirrorPartitionListFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit MirrorPartitionListFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -611,24 +601,20 @@ class MirrorPartitionListFeature final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - bool grin_trait_master_vertex_mirror_partition_list_; - bool grin_trait_mirror_vertex_mirror_partition_list_; - bool grin_trait_master_edge_mirror_partition_list_; - bool grin_trait_mirror_edge_mirror_partition_list_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + bool grin_trait_master_vertex_mirror_partition_list_; + bool grin_trait_mirror_vertex_mirror_partition_list_; + bool grin_trait_master_edge_mirror_partition_list_; + bool grin_trait_mirror_edge_mirror_partition_list_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; // ------------------------------------------------------------------- -class PartitionFeature final : +class PartitionFeature PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PartitionFeature) */ { public: - inline PartitionFeature() : PartitionFeature(nullptr) {} - ~PartitionFeature() override; - explicit PROTOBUF_CONSTEXPR PartitionFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline PartitionFeature() : PartitionFeature(nullptr) {}; + virtual ~PartitionFeature(); PartitionFeature(const PartitionFeature& from); PartitionFeature(PartitionFeature&& from) noexcept @@ -641,13 +627,8 @@ class PartitionFeature final : return *this; } inline PartitionFeature& operator=(PartitionFeature&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -658,14 +639,14 @@ class PartitionFeature final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const PartitionFeature& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const PartitionFeature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const PartitionFeature* internal_default_instance() { return reinterpret_cast( &_PartitionFeature_default_instance_); @@ -678,12 +659,7 @@ class PartitionFeature final : } inline void Swap(PartitionFeature* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -691,53 +667,56 @@ class PartitionFeature final : } void UnsafeArenaSwap(PartitionFeature* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - PartitionFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline PartitionFeature* New() const final { + return CreateMaybeMessage(nullptr); + } + + PartitionFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const PartitionFeature& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const PartitionFeature& from) { - PartitionFeature::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const PartitionFeature& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(PartitionFeature* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.PartitionFeature"; } protected: - explicit PartitionFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit PartitionFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -765,7 +744,7 @@ class PartitionFeature final : public: void clear_mirror_partition_list_feature(); const ::grin::MirrorPartitionListFeature& mirror_partition_list_feature() const; - PROTOBUF_NODISCARD ::grin::MirrorPartitionListFeature* release_mirror_partition_list_feature(); + ::grin::MirrorPartitionListFeature* release_mirror_partition_list_feature(); ::grin::MirrorPartitionListFeature* mutable_mirror_partition_list_feature(); void set_allocated_mirror_partition_list_feature(::grin::MirrorPartitionListFeature* mirror_partition_list_feature); private: @@ -891,33 +870,29 @@ class PartitionFeature final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - ::grin::MirrorPartitionListFeature* mirror_partition_list_feature_; - int graph_partition_strategy_; - bool grin_trait_natural_id_for_partition_; - bool grin_enable_vertex_ref_; - bool grin_enable_edge_ref_; - bool grin_trait_select_master_for_vertex_list_; - int vertex_data_; - int edge_data_; - bool grin_trait_select_partition_for_vertex_list_; - bool grin_trait_select_master_for_edge_list_; - bool grin_trait_select_partition_for_edge_list_; - bool grin_trait_select_master_neighbor_for_adjacent_list_; - bool grin_trait_select_neighbor_partition_for_adjacent_list_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::grin::MirrorPartitionListFeature* mirror_partition_list_feature_; + int graph_partition_strategy_; + bool grin_trait_natural_id_for_partition_; + bool grin_enable_vertex_ref_; + bool grin_enable_edge_ref_; + bool grin_trait_select_master_for_vertex_list_; + int vertex_data_; + int edge_data_; + bool grin_trait_select_partition_for_vertex_list_; + bool grin_trait_select_master_for_edge_list_; + bool grin_trait_select_partition_for_edge_list_; + bool grin_trait_select_master_neighbor_for_adjacent_list_; + bool grin_trait_select_neighbor_partition_for_adjacent_list_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; // ------------------------------------------------------------------- -class VertexPropertyFeature final : +class VertexPropertyFeature PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.VertexPropertyFeature) */ { public: - inline VertexPropertyFeature() : VertexPropertyFeature(nullptr) {} - ~VertexPropertyFeature() override; - explicit PROTOBUF_CONSTEXPR VertexPropertyFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline VertexPropertyFeature() : VertexPropertyFeature(nullptr) {}; + virtual ~VertexPropertyFeature(); VertexPropertyFeature(const VertexPropertyFeature& from); VertexPropertyFeature(VertexPropertyFeature&& from) noexcept @@ -930,13 +905,8 @@ class VertexPropertyFeature final : return *this; } inline VertexPropertyFeature& operator=(VertexPropertyFeature&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -947,14 +917,14 @@ class VertexPropertyFeature final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const VertexPropertyFeature& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const VertexPropertyFeature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const VertexPropertyFeature* internal_default_instance() { return reinterpret_cast( &_VertexPropertyFeature_default_instance_); @@ -967,12 +937,7 @@ class VertexPropertyFeature final : } inline void Swap(VertexPropertyFeature* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -980,53 +945,56 @@ class VertexPropertyFeature final : } void UnsafeArenaSwap(VertexPropertyFeature* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - VertexPropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline VertexPropertyFeature* New() const final { + return CreateMaybeMessage(nullptr); + } + + VertexPropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const VertexPropertyFeature& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const VertexPropertyFeature& from) { - VertexPropertyFeature::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const VertexPropertyFeature& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(VertexPropertyFeature* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.VertexPropertyFeature"; } protected: - explicit VertexPropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit VertexPropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -1121,28 +1089,24 @@ class VertexPropertyFeature final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - bool grin_with_vertex_property_; - bool grin_with_vertex_property_name_; - bool grin_with_vertex_type_name_; - bool grin_enable_vertex_property_table_; - bool grin_enable_vertex_primary_keys_; - bool grin_trait_natural_id_for_vertex_type_; - bool grin_trait_natural_id_for_vertex_property_; - bool grin_assume_by_type_vertex_original_id_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + bool grin_with_vertex_property_; + bool grin_with_vertex_property_name_; + bool grin_with_vertex_type_name_; + bool grin_enable_vertex_property_table_; + bool grin_enable_vertex_primary_keys_; + bool grin_trait_natural_id_for_vertex_type_; + bool grin_trait_natural_id_for_vertex_property_; + bool grin_assume_by_type_vertex_original_id_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; // ------------------------------------------------------------------- -class EdgePropertyFeature final : +class EdgePropertyFeature PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.EdgePropertyFeature) */ { public: - inline EdgePropertyFeature() : EdgePropertyFeature(nullptr) {} - ~EdgePropertyFeature() override; - explicit PROTOBUF_CONSTEXPR EdgePropertyFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline EdgePropertyFeature() : EdgePropertyFeature(nullptr) {}; + virtual ~EdgePropertyFeature(); EdgePropertyFeature(const EdgePropertyFeature& from); EdgePropertyFeature(EdgePropertyFeature&& from) noexcept @@ -1155,13 +1119,8 @@ class EdgePropertyFeature final : return *this; } inline EdgePropertyFeature& operator=(EdgePropertyFeature&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1172,14 +1131,14 @@ class EdgePropertyFeature final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const EdgePropertyFeature& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const EdgePropertyFeature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const EdgePropertyFeature* internal_default_instance() { return reinterpret_cast( &_EdgePropertyFeature_default_instance_); @@ -1192,12 +1151,7 @@ class EdgePropertyFeature final : } inline void Swap(EdgePropertyFeature* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1205,53 +1159,56 @@ class EdgePropertyFeature final : } void UnsafeArenaSwap(EdgePropertyFeature* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - EdgePropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline EdgePropertyFeature* New() const final { + return CreateMaybeMessage(nullptr); + } + + EdgePropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const EdgePropertyFeature& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const EdgePropertyFeature& from) { - EdgePropertyFeature::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const EdgePropertyFeature& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(EdgePropertyFeature* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.EdgePropertyFeature"; } protected: - explicit EdgePropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit EdgePropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -1336,27 +1293,23 @@ class EdgePropertyFeature final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - bool grin_with_edge_property_; - bool grin_with_edge_property_name_; - bool grin_with_edge_type_name_; - bool grin_enable_edge_property_table_; - bool grin_enable_edge_primary_keys_; - bool grin_trait_natural_id_for_edge_type_; - bool grin_trait_natural_id_for_edge_property_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + bool grin_with_edge_property_; + bool grin_with_edge_property_name_; + bool grin_with_edge_type_name_; + bool grin_enable_edge_property_table_; + bool grin_enable_edge_primary_keys_; + bool grin_trait_natural_id_for_edge_type_; + bool grin_trait_natural_id_for_edge_property_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; // ------------------------------------------------------------------- -class PropertyFeature final : +class PropertyFeature PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PropertyFeature) */ { public: - inline PropertyFeature() : PropertyFeature(nullptr) {} - ~PropertyFeature() override; - explicit PROTOBUF_CONSTEXPR PropertyFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline PropertyFeature() : PropertyFeature(nullptr) {}; + virtual ~PropertyFeature(); PropertyFeature(const PropertyFeature& from); PropertyFeature(PropertyFeature&& from) noexcept @@ -1369,13 +1322,8 @@ class PropertyFeature final : return *this; } inline PropertyFeature& operator=(PropertyFeature&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1386,14 +1334,14 @@ class PropertyFeature final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const PropertyFeature& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const PropertyFeature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const PropertyFeature* internal_default_instance() { return reinterpret_cast( &_PropertyFeature_default_instance_); @@ -1406,12 +1354,7 @@ class PropertyFeature final : } inline void Swap(PropertyFeature* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1419,53 +1362,56 @@ class PropertyFeature final : } void UnsafeArenaSwap(PropertyFeature* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - PropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline PropertyFeature* New() const final { + return CreateMaybeMessage(nullptr); + } + + PropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const PropertyFeature& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const PropertyFeature& from) { - PropertyFeature::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const PropertyFeature& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(PropertyFeature* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.PropertyFeature"; } protected: - explicit PropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit PropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -1492,7 +1438,7 @@ class PropertyFeature final : public: void clear_vertex_property_feature(); const ::grin::VertexPropertyFeature& vertex_property_feature() const; - PROTOBUF_NODISCARD ::grin::VertexPropertyFeature* release_vertex_property_feature(); + ::grin::VertexPropertyFeature* release_vertex_property_feature(); ::grin::VertexPropertyFeature* mutable_vertex_property_feature(); void set_allocated_vertex_property_feature(::grin::VertexPropertyFeature* vertex_property_feature); private: @@ -1510,7 +1456,7 @@ class PropertyFeature final : public: void clear_edge_property_feature(); const ::grin::EdgePropertyFeature& edge_property_feature() const; - PROTOBUF_NODISCARD ::grin::EdgePropertyFeature* release_edge_property_feature(); + ::grin::EdgePropertyFeature* release_edge_property_feature(); ::grin::EdgePropertyFeature* mutable_edge_property_feature(); void set_allocated_edge_property_feature(::grin::EdgePropertyFeature* edge_property_feature); private: @@ -1618,32 +1564,28 @@ class PropertyFeature final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - ::grin::VertexPropertyFeature* vertex_property_feature_; - ::grin::EdgePropertyFeature* edge_property_feature_; - int vertex_property_; - int edge_property_; - bool grin_enable_row_; - bool grin_assume_column_store_for_vertex_property_; - bool grin_assume_column_store_for_edge_property_; - bool grin_trait_select_type_for_vertex_list_; - bool grin_trait_select_type_for_edge_list_; - bool grin_trait_select_neighbor_type_for_adjacent_list_; - bool grin_trait_select_edge_type_for_adjacent_list_; - bool grin_trait_specific_vev_relation_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::grin::VertexPropertyFeature* vertex_property_feature_; + ::grin::EdgePropertyFeature* edge_property_feature_; + int vertex_property_; + int edge_property_; + bool grin_enable_row_; + bool grin_assume_column_store_for_vertex_property_; + bool grin_assume_column_store_for_edge_property_; + bool grin_trait_select_type_for_vertex_list_; + bool grin_trait_select_type_for_edge_list_; + bool grin_trait_select_neighbor_type_for_adjacent_list_; + bool grin_trait_select_edge_type_for_adjacent_list_; + bool grin_trait_specific_vev_relation_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; // ------------------------------------------------------------------- -class IndexFeature final : +class IndexFeature PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.IndexFeature) */ { public: - inline IndexFeature() : IndexFeature(nullptr) {} - ~IndexFeature() override; - explicit PROTOBUF_CONSTEXPR IndexFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline IndexFeature() : IndexFeature(nullptr) {}; + virtual ~IndexFeature(); IndexFeature(const IndexFeature& from); IndexFeature(IndexFeature&& from) noexcept @@ -1656,13 +1598,8 @@ class IndexFeature final : return *this; } inline IndexFeature& operator=(IndexFeature&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1673,14 +1610,14 @@ class IndexFeature final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const IndexFeature& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const IndexFeature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const IndexFeature* internal_default_instance() { return reinterpret_cast( &_IndexFeature_default_instance_); @@ -1693,12 +1630,7 @@ class IndexFeature final : } inline void Swap(IndexFeature* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1706,53 +1638,56 @@ class IndexFeature final : } void UnsafeArenaSwap(IndexFeature* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - IndexFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline IndexFeature* New() const final { + return CreateMaybeMessage(nullptr); + } + + IndexFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const IndexFeature& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const IndexFeature& from) { - IndexFeature::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const IndexFeature& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(IndexFeature* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.IndexFeature"; } protected: - explicit IndexFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit IndexFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -1797,22 +1732,19 @@ class IndexFeature final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - bool grin_with_vertex_label_; - bool grin_with_edge_label_; - bool grin_assume_all_vertex_list_sorted_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + bool grin_with_vertex_label_; + bool grin_with_edge_label_; + bool grin_assume_all_vertex_list_sorted_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; // ------------------------------------------------------------------- -class PredicateFeature final : - public ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase /* @@protoc_insertion_point(class_definition:grin.PredicateFeature) */ { +class PredicateFeature PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PredicateFeature) */ { public: - inline PredicateFeature() : PredicateFeature(nullptr) {} - explicit PROTOBUF_CONSTEXPR PredicateFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline PredicateFeature() : PredicateFeature(nullptr) {}; + virtual ~PredicateFeature(); PredicateFeature(const PredicateFeature& from); PredicateFeature(PredicateFeature&& from) noexcept @@ -1825,13 +1757,8 @@ class PredicateFeature final : return *this; } inline PredicateFeature& operator=(PredicateFeature&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1842,14 +1769,14 @@ class PredicateFeature final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const PredicateFeature& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const PredicateFeature& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const PredicateFeature* internal_default_instance() { return reinterpret_cast( &_PredicateFeature_default_instance_); @@ -1862,12 +1789,7 @@ class PredicateFeature final : } inline void Swap(PredicateFeature* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -1875,39 +1797,56 @@ class PredicateFeature final : } void UnsafeArenaSwap(PredicateFeature* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - PredicateFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { - return CreateMaybeMessage(arena); - } - using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyFrom; - inline void CopyFrom(const PredicateFeature& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::CopyImpl(*this, from); + inline PredicateFeature* New() const final { + return CreateMaybeMessage(nullptr); } - using ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeFrom; - void MergeFrom(const PredicateFeature& from) { - ::PROTOBUF_NAMESPACE_ID::internal::ZeroFieldsBase::MergeImpl(*this, from); + + PredicateFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); } - public: + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const PredicateFeature& from); + void MergeFrom(const PredicateFeature& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(PredicateFeature* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.PredicateFeature"; } protected: - explicit PredicateFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit PredicateFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -1920,18 +1859,16 @@ class PredicateFeature final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - }; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; // ------------------------------------------------------------------- -class StorageFeature final : +class StorageFeature PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.StorageFeature) */ { public: - inline StorageFeature() : StorageFeature(nullptr) {} - ~StorageFeature() override; - explicit PROTOBUF_CONSTEXPR StorageFeature(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline StorageFeature() : StorageFeature(nullptr) {}; + virtual ~StorageFeature(); StorageFeature(const StorageFeature& from); StorageFeature(StorageFeature&& from) noexcept @@ -1944,13 +1881,8 @@ class StorageFeature final : return *this; } inline StorageFeature& operator=(StorageFeature&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -1961,14 +1893,13 @@ class StorageFeature final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const StorageFeature& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const StorageFeature& default_instance(); + enum SpecificFeatureCase { kTopologyFeature = 1, kPartitionFeature = 2, @@ -1978,6 +1909,7 @@ class StorageFeature final : SPECIFIC_FEATURE_NOT_SET = 0, }; + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const StorageFeature* internal_default_instance() { return reinterpret_cast( &_StorageFeature_default_instance_); @@ -1990,12 +1922,7 @@ class StorageFeature final : } inline void Swap(StorageFeature* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2003,53 +1930,56 @@ class StorageFeature final : } void UnsafeArenaSwap(StorageFeature* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - StorageFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline StorageFeature* New() const final { + return CreateMaybeMessage(nullptr); + } + + StorageFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const StorageFeature& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const StorageFeature& from) { - StorageFeature::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const StorageFeature& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(StorageFeature* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.StorageFeature"; } protected: - explicit StorageFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit StorageFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -2069,7 +1999,7 @@ class StorageFeature final : public: void clear_topology_feature(); const ::grin::TopologyFeature& topology_feature() const; - PROTOBUF_NODISCARD ::grin::TopologyFeature* release_topology_feature(); + ::grin::TopologyFeature* release_topology_feature(); ::grin::TopologyFeature* mutable_topology_feature(); void set_allocated_topology_feature(::grin::TopologyFeature* topology_feature); private: @@ -2087,7 +2017,7 @@ class StorageFeature final : public: void clear_partition_feature(); const ::grin::PartitionFeature& partition_feature() const; - PROTOBUF_NODISCARD ::grin::PartitionFeature* release_partition_feature(); + ::grin::PartitionFeature* release_partition_feature(); ::grin::PartitionFeature* mutable_partition_feature(); void set_allocated_partition_feature(::grin::PartitionFeature* partition_feature); private: @@ -2105,7 +2035,7 @@ class StorageFeature final : public: void clear_property_feature(); const ::grin::PropertyFeature& property_feature() const; - PROTOBUF_NODISCARD ::grin::PropertyFeature* release_property_feature(); + ::grin::PropertyFeature* release_property_feature(); ::grin::PropertyFeature* mutable_property_feature(); void set_allocated_property_feature(::grin::PropertyFeature* property_feature); private: @@ -2123,7 +2053,7 @@ class StorageFeature final : public: void clear_index_feature(); const ::grin::IndexFeature& index_feature() const; - PROTOBUF_NODISCARD ::grin::IndexFeature* release_index_feature(); + ::grin::IndexFeature* release_index_feature(); ::grin::IndexFeature* mutable_index_feature(); void set_allocated_index_feature(::grin::IndexFeature* index_feature); private: @@ -2141,7 +2071,7 @@ class StorageFeature final : public: void clear_predicate_feature(); const ::grin::PredicateFeature& predicate_feature() const; - PROTOBUF_NODISCARD ::grin::PredicateFeature* release_predicate_feature(); + ::grin::PredicateFeature* release_predicate_feature(); ::grin::PredicateFeature* mutable_predicate_feature(); void set_allocated_predicate_feature(::grin::PredicateFeature* predicate_feature); private: @@ -2169,31 +2099,26 @@ class StorageFeature final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - union SpecificFeatureUnion { - constexpr SpecificFeatureUnion() : _constinit_{} {} - ::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized _constinit_; - ::grin::TopologyFeature* topology_feature_; - ::grin::PartitionFeature* partition_feature_; - ::grin::PropertyFeature* property_feature_; - ::grin::IndexFeature* index_feature_; - ::grin::PredicateFeature* predicate_feature_; - } specific_feature_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - uint32_t _oneof_case_[1]; + union SpecificFeatureUnion { + SpecificFeatureUnion() {} + ::grin::TopologyFeature* topology_feature_; + ::grin::PartitionFeature* partition_feature_; + ::grin::PropertyFeature* property_feature_; + ::grin::IndexFeature* index_feature_; + ::grin::PredicateFeature* predicate_feature_; + } specific_feature_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; - }; - union { Impl_ _impl_; }; friend struct ::TableStruct_graph_2eproto; }; // ------------------------------------------------------------------- -class Statistics final : +class Statistics PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.Statistics) */ { public: - inline Statistics() : Statistics(nullptr) {} - ~Statistics() override; - explicit PROTOBUF_CONSTEXPR Statistics(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline Statistics() : Statistics(nullptr) {}; + virtual ~Statistics(); Statistics(const Statistics& from); Statistics(Statistics&& from) noexcept @@ -2206,13 +2131,8 @@ class Statistics final : return *this; } inline Statistics& operator=(Statistics&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -2223,14 +2143,14 @@ class Statistics final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Statistics& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const Statistics& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Statistics* internal_default_instance() { return reinterpret_cast( &_Statistics_default_instance_); @@ -2243,12 +2163,7 @@ class Statistics final : } inline void Swap(Statistics* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2256,53 +2171,56 @@ class Statistics final : } void UnsafeArenaSwap(Statistics* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - Statistics* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline Statistics* New() const final { + return CreateMaybeMessage(nullptr); + } + + Statistics* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const Statistics& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Statistics& from) { - Statistics::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const Statistics& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Statistics* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.Statistics"; } protected: - explicit Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -2317,47 +2235,47 @@ class Statistics final : }; // int32 vertex_count = 1; void clear_vertex_count(); - int32_t vertex_count() const; - void set_vertex_count(int32_t value); + ::PROTOBUF_NAMESPACE_ID::int32 vertex_count() const; + void set_vertex_count(::PROTOBUF_NAMESPACE_ID::int32 value); private: - int32_t _internal_vertex_count() const; - void _internal_set_vertex_count(int32_t value); + ::PROTOBUF_NAMESPACE_ID::int32 _internal_vertex_count() const; + void _internal_set_vertex_count(::PROTOBUF_NAMESPACE_ID::int32 value); public: // int32 edge_count = 2; void clear_edge_count(); - int32_t edge_count() const; - void set_edge_count(int32_t value); + ::PROTOBUF_NAMESPACE_ID::int32 edge_count() const; + void set_edge_count(::PROTOBUF_NAMESPACE_ID::int32 value); private: - int32_t _internal_edge_count() const; - void _internal_set_edge_count(int32_t value); + ::PROTOBUF_NAMESPACE_ID::int32 _internal_edge_count() const; + void _internal_set_edge_count(::PROTOBUF_NAMESPACE_ID::int32 value); public: // int32 partition_count = 3; void clear_partition_count(); - int32_t partition_count() const; - void set_partition_count(int32_t value); + ::PROTOBUF_NAMESPACE_ID::int32 partition_count() const; + void set_partition_count(::PROTOBUF_NAMESPACE_ID::int32 value); private: - int32_t _internal_partition_count() const; - void _internal_set_partition_count(int32_t value); + ::PROTOBUF_NAMESPACE_ID::int32 _internal_partition_count() const; + void _internal_set_partition_count(::PROTOBUF_NAMESPACE_ID::int32 value); public: // int32 vertex_type_count = 4; void clear_vertex_type_count(); - int32_t vertex_type_count() const; - void set_vertex_type_count(int32_t value); + ::PROTOBUF_NAMESPACE_ID::int32 vertex_type_count() const; + void set_vertex_type_count(::PROTOBUF_NAMESPACE_ID::int32 value); private: - int32_t _internal_vertex_type_count() const; - void _internal_set_vertex_type_count(int32_t value); + ::PROTOBUF_NAMESPACE_ID::int32 _internal_vertex_type_count() const; + void _internal_set_vertex_type_count(::PROTOBUF_NAMESPACE_ID::int32 value); public: // int32 edge_type_count = 5; void clear_edge_type_count(); - int32_t edge_type_count() const; - void set_edge_type_count(int32_t value); + ::PROTOBUF_NAMESPACE_ID::int32 edge_type_count() const; + void set_edge_type_count(::PROTOBUF_NAMESPACE_ID::int32 value); private: - int32_t _internal_edge_type_count() const; - void _internal_set_edge_type_count(int32_t value); + ::PROTOBUF_NAMESPACE_ID::int32 _internal_edge_type_count() const; + void _internal_set_edge_type_count(::PROTOBUF_NAMESPACE_ID::int32 value); public: // @@protoc_insertion_point(class_scope:grin.Statistics) @@ -2367,25 +2285,21 @@ class Statistics final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - int32_t vertex_count_; - int32_t edge_count_; - int32_t partition_count_; - int32_t vertex_type_count_; - int32_t edge_type_count_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::PROTOBUF_NAMESPACE_ID::int32 vertex_count_; + ::PROTOBUF_NAMESPACE_ID::int32 edge_count_; + ::PROTOBUF_NAMESPACE_ID::int32 partition_count_; + ::PROTOBUF_NAMESPACE_ID::int32 vertex_type_count_; + ::PROTOBUF_NAMESPACE_ID::int32 edge_type_count_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; // ------------------------------------------------------------------- -class Graph final : +class Graph PROTOBUF_FINAL : public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.Graph) */ { public: - inline Graph() : Graph(nullptr) {} - ~Graph() override; - explicit PROTOBUF_CONSTEXPR Graph(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized); + inline Graph() : Graph(nullptr) {}; + virtual ~Graph(); Graph(const Graph& from); Graph(Graph&& from) noexcept @@ -2398,13 +2312,8 @@ class Graph final : return *this; } inline Graph& operator=(Graph&& from) noexcept { - if (this == &from) return *this; - if (GetOwningArena() == from.GetOwningArena() - #ifdef PROTOBUF_FORCE_COPY_IN_MOVE - && GetOwningArena() != nullptr - #endif // !PROTOBUF_FORCE_COPY_IN_MOVE - ) { - InternalSwap(&from); + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } @@ -2415,14 +2324,14 @@ class Graph final : return GetDescriptor(); } static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return default_instance().GetMetadata().descriptor; + return GetMetadataStatic().descriptor; } static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return default_instance().GetMetadata().reflection; - } - static const Graph& default_instance() { - return *internal_default_instance(); + return GetMetadataStatic().reflection; } + static const Graph& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const Graph* internal_default_instance() { return reinterpret_cast( &_Graph_default_instance_); @@ -2435,12 +2344,7 @@ class Graph final : } inline void Swap(Graph* other) { if (other == this) return; - #ifdef PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() != nullptr && - GetOwningArena() == other->GetOwningArena()) { - #else // PROTOBUF_FORCE_COPY_IN_SWAP - if (GetOwningArena() == other->GetOwningArena()) { - #endif // !PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { InternalSwap(other); } else { ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); @@ -2448,53 +2352,56 @@ class Graph final : } void UnsafeArenaSwap(Graph* other) { if (other == this) return; - GOOGLE_DCHECK(GetOwningArena() == other->GetOwningArena()); + GOOGLE_DCHECK(GetArena() == other->GetArena()); InternalSwap(other); } // implements Message ---------------------------------------------- - Graph* New(::PROTOBUF_NAMESPACE_ID::Arena* arena = nullptr) const final { + inline Graph* New() const final { + return CreateMaybeMessage(nullptr); + } + + Graph* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage(arena); } - using ::PROTOBUF_NAMESPACE_ID::Message::CopyFrom; + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; void CopyFrom(const Graph& from); - using ::PROTOBUF_NAMESPACE_ID::Message::MergeFrom; - void MergeFrom( const Graph& from) { - Graph::MergeImpl(*this, from); - } - private: - static void MergeImpl(::PROTOBUF_NAMESPACE_ID::Message& to_msg, const ::PROTOBUF_NAMESPACE_ID::Message& from_msg); - public: + void MergeFrom(const Graph& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - uint8_t* _InternalSerialize( - uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _impl_._cached_size_.Get(); } + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } private: - void SharedCtor(::PROTOBUF_NAMESPACE_ID::Arena* arena, bool is_message_owned); - void SharedDtor(); + inline void SharedCtor(); + inline void SharedDtor(); void SetCachedSize(int size) const final; void InternalSwap(Graph* other); - - private: friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "grin.Graph"; } protected: - explicit Graph(::PROTOBUF_NAMESPACE_ID::Arena* arena, - bool is_message_owned = false); + explicit Graph(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); public: - static const ClassData _class_data_; - const ::PROTOBUF_NAMESPACE_ID::Message::ClassData*GetClassData() const final; - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); + return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: // nested types ---------------------------------------------------- @@ -2527,28 +2434,50 @@ class Graph final : // string uri = 1; void clear_uri(); const std::string& uri() const; - template - void set_uri(ArgT0&& arg0, ArgT... args); + void set_uri(const std::string& value); + void set_uri(std::string&& value); + void set_uri(const char* value); + void set_uri(const char* value, size_t size); std::string* mutable_uri(); - PROTOBUF_NODISCARD std::string* release_uri(); + std::string* release_uri(); void set_allocated_uri(std::string* uri); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_uri(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_uri( + std::string* uri); private: const std::string& _internal_uri() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_uri(const std::string& value); + void _internal_set_uri(const std::string& value); std::string* _internal_mutable_uri(); public: // string grin_version = 2; void clear_grin_version(); const std::string& grin_version() const; - template - void set_grin_version(ArgT0&& arg0, ArgT... args); + void set_grin_version(const std::string& value); + void set_grin_version(std::string&& value); + void set_grin_version(const char* value); + void set_grin_version(const char* value, size_t size); std::string* mutable_grin_version(); - PROTOBUF_NODISCARD std::string* release_grin_version(); + std::string* release_grin_version(); void set_allocated_grin_version(std::string* grin_version); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_grin_version(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_grin_version( + std::string* grin_version); private: const std::string& _internal_grin_version() const; - inline PROTOBUF_ALWAYS_INLINE void _internal_set_grin_version(const std::string& value); + void _internal_set_grin_version(const std::string& value); std::string* _internal_mutable_grin_version(); public: @@ -2559,7 +2488,7 @@ class Graph final : public: void clear_statistics(); const ::grin::Statistics& statistics() const; - PROTOBUF_NODISCARD ::grin::Statistics* release_statistics(); + ::grin::Statistics* release_statistics(); ::grin::Statistics* mutable_statistics(); void set_allocated_statistics(::grin::Statistics* statistics); private: @@ -2577,14 +2506,11 @@ class Graph final : template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; - struct Impl_ { - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature > features_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uri_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr grin_version_; - ::grin::Statistics* statistics_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - }; - union { Impl_ _impl_; }; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature > features_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uri_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr grin_version_; + ::grin::Statistics* statistics_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; // =================================================================== @@ -2600,10 +2526,10 @@ class Graph final : // bool grin_assume_has_directed_graph = 1; inline void TopologyFeature::clear_grin_assume_has_directed_graph() { - _impl_.grin_assume_has_directed_graph_ = false; + grin_assume_has_directed_graph_ = false; } inline bool TopologyFeature::_internal_grin_assume_has_directed_graph() const { - return _impl_.grin_assume_has_directed_graph_; + return grin_assume_has_directed_graph_; } inline bool TopologyFeature::grin_assume_has_directed_graph() const { // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_assume_has_directed_graph) @@ -2611,7 +2537,7 @@ inline bool TopologyFeature::grin_assume_has_directed_graph() const { } inline void TopologyFeature::_internal_set_grin_assume_has_directed_graph(bool value) { - _impl_.grin_assume_has_directed_graph_ = value; + grin_assume_has_directed_graph_ = value; } inline void TopologyFeature::set_grin_assume_has_directed_graph(bool value) { _internal_set_grin_assume_has_directed_graph(value); @@ -2620,10 +2546,10 @@ inline void TopologyFeature::set_grin_assume_has_directed_graph(bool value) { // bool grin_assume_has_undirected_graph = 2; inline void TopologyFeature::clear_grin_assume_has_undirected_graph() { - _impl_.grin_assume_has_undirected_graph_ = false; + grin_assume_has_undirected_graph_ = false; } inline bool TopologyFeature::_internal_grin_assume_has_undirected_graph() const { - return _impl_.grin_assume_has_undirected_graph_; + return grin_assume_has_undirected_graph_; } inline bool TopologyFeature::grin_assume_has_undirected_graph() const { // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_assume_has_undirected_graph) @@ -2631,7 +2557,7 @@ inline bool TopologyFeature::grin_assume_has_undirected_graph() const { } inline void TopologyFeature::_internal_set_grin_assume_has_undirected_graph(bool value) { - _impl_.grin_assume_has_undirected_graph_ = value; + grin_assume_has_undirected_graph_ = value; } inline void TopologyFeature::set_grin_assume_has_undirected_graph(bool value) { _internal_set_grin_assume_has_undirected_graph(value); @@ -2640,10 +2566,10 @@ inline void TopologyFeature::set_grin_assume_has_undirected_graph(bool value) { // bool grin_assume_has_multi_edge_graph = 3; inline void TopologyFeature::clear_grin_assume_has_multi_edge_graph() { - _impl_.grin_assume_has_multi_edge_graph_ = false; + grin_assume_has_multi_edge_graph_ = false; } inline bool TopologyFeature::_internal_grin_assume_has_multi_edge_graph() const { - return _impl_.grin_assume_has_multi_edge_graph_; + return grin_assume_has_multi_edge_graph_; } inline bool TopologyFeature::grin_assume_has_multi_edge_graph() const { // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_assume_has_multi_edge_graph) @@ -2651,7 +2577,7 @@ inline bool TopologyFeature::grin_assume_has_multi_edge_graph() const { } inline void TopologyFeature::_internal_set_grin_assume_has_multi_edge_graph(bool value) { - _impl_.grin_assume_has_multi_edge_graph_ = value; + grin_assume_has_multi_edge_graph_ = value; } inline void TopologyFeature::set_grin_assume_has_multi_edge_graph(bool value) { _internal_set_grin_assume_has_multi_edge_graph(value); @@ -2660,10 +2586,10 @@ inline void TopologyFeature::set_grin_assume_has_multi_edge_graph(bool value) { // bool grin_with_vertex_original_id = 4; inline void TopologyFeature::clear_grin_with_vertex_original_id() { - _impl_.grin_with_vertex_original_id_ = false; + grin_with_vertex_original_id_ = false; } inline bool TopologyFeature::_internal_grin_with_vertex_original_id() const { - return _impl_.grin_with_vertex_original_id_; + return grin_with_vertex_original_id_; } inline bool TopologyFeature::grin_with_vertex_original_id() const { // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_with_vertex_original_id) @@ -2671,7 +2597,7 @@ inline bool TopologyFeature::grin_with_vertex_original_id() const { } inline void TopologyFeature::_internal_set_grin_with_vertex_original_id(bool value) { - _impl_.grin_with_vertex_original_id_ = value; + grin_with_vertex_original_id_ = value; } inline void TopologyFeature::set_grin_with_vertex_original_id(bool value) { _internal_set_grin_with_vertex_original_id(value); @@ -2680,10 +2606,10 @@ inline void TopologyFeature::set_grin_with_vertex_original_id(bool value) { // bool grin_with_vertex_data = 5; inline void TopologyFeature::clear_grin_with_vertex_data() { - _impl_.grin_with_vertex_data_ = false; + grin_with_vertex_data_ = false; } inline bool TopologyFeature::_internal_grin_with_vertex_data() const { - return _impl_.grin_with_vertex_data_; + return grin_with_vertex_data_; } inline bool TopologyFeature::grin_with_vertex_data() const { // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_with_vertex_data) @@ -2691,7 +2617,7 @@ inline bool TopologyFeature::grin_with_vertex_data() const { } inline void TopologyFeature::_internal_set_grin_with_vertex_data(bool value) { - _impl_.grin_with_vertex_data_ = value; + grin_with_vertex_data_ = value; } inline void TopologyFeature::set_grin_with_vertex_data(bool value) { _internal_set_grin_with_vertex_data(value); @@ -2700,10 +2626,10 @@ inline void TopologyFeature::set_grin_with_vertex_data(bool value) { // bool grin_with_edge_data = 6; inline void TopologyFeature::clear_grin_with_edge_data() { - _impl_.grin_with_edge_data_ = false; + grin_with_edge_data_ = false; } inline bool TopologyFeature::_internal_grin_with_edge_data() const { - return _impl_.grin_with_edge_data_; + return grin_with_edge_data_; } inline bool TopologyFeature::grin_with_edge_data() const { // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_with_edge_data) @@ -2711,7 +2637,7 @@ inline bool TopologyFeature::grin_with_edge_data() const { } inline void TopologyFeature::_internal_set_grin_with_edge_data(bool value) { - _impl_.grin_with_edge_data_ = value; + grin_with_edge_data_ = value; } inline void TopologyFeature::set_grin_with_edge_data(bool value) { _internal_set_grin_with_edge_data(value); @@ -2720,40 +2646,40 @@ inline void TopologyFeature::set_grin_with_edge_data(bool value) { // repeated .grin.ListRetrieval vertex_list_retrievals = 7; inline int TopologyFeature::_internal_vertex_list_retrievals_size() const { - return _impl_.vertex_list_retrievals_.size(); + return vertex_list_retrievals_.size(); } inline int TopologyFeature::vertex_list_retrievals_size() const { return _internal_vertex_list_retrievals_size(); } inline void TopologyFeature::clear_vertex_list_retrievals() { - _impl_.vertex_list_retrievals_.Clear(); + vertex_list_retrievals_.Clear(); } inline ::grin::ListRetrieval TopologyFeature::_internal_vertex_list_retrievals(int index) const { - return static_cast< ::grin::ListRetrieval >(_impl_.vertex_list_retrievals_.Get(index)); + return static_cast< ::grin::ListRetrieval >(vertex_list_retrievals_.Get(index)); } inline ::grin::ListRetrieval TopologyFeature::vertex_list_retrievals(int index) const { // @@protoc_insertion_point(field_get:grin.TopologyFeature.vertex_list_retrievals) return _internal_vertex_list_retrievals(index); } inline void TopologyFeature::set_vertex_list_retrievals(int index, ::grin::ListRetrieval value) { - _impl_.vertex_list_retrievals_.Set(index, value); + vertex_list_retrievals_.Set(index, value); // @@protoc_insertion_point(field_set:grin.TopologyFeature.vertex_list_retrievals) } inline void TopologyFeature::_internal_add_vertex_list_retrievals(::grin::ListRetrieval value) { - _impl_.vertex_list_retrievals_.Add(value); + vertex_list_retrievals_.Add(value); } inline void TopologyFeature::add_vertex_list_retrievals(::grin::ListRetrieval value) { - _internal_add_vertex_list_retrievals(value); // @@protoc_insertion_point(field_add:grin.TopologyFeature.vertex_list_retrievals) + _internal_add_vertex_list_retrievals(value); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& TopologyFeature::vertex_list_retrievals() const { // @@protoc_insertion_point(field_list:grin.TopologyFeature.vertex_list_retrievals) - return _impl_.vertex_list_retrievals_; + return vertex_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* TopologyFeature::_internal_mutable_vertex_list_retrievals() { - return &_impl_.vertex_list_retrievals_; + return &vertex_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* TopologyFeature::mutable_vertex_list_retrievals() { @@ -2763,40 +2689,40 @@ TopologyFeature::mutable_vertex_list_retrievals() { // repeated .grin.ListRetrieval edge_list_retrievals = 8; inline int TopologyFeature::_internal_edge_list_retrievals_size() const { - return _impl_.edge_list_retrievals_.size(); + return edge_list_retrievals_.size(); } inline int TopologyFeature::edge_list_retrievals_size() const { return _internal_edge_list_retrievals_size(); } inline void TopologyFeature::clear_edge_list_retrievals() { - _impl_.edge_list_retrievals_.Clear(); + edge_list_retrievals_.Clear(); } inline ::grin::ListRetrieval TopologyFeature::_internal_edge_list_retrievals(int index) const { - return static_cast< ::grin::ListRetrieval >(_impl_.edge_list_retrievals_.Get(index)); + return static_cast< ::grin::ListRetrieval >(edge_list_retrievals_.Get(index)); } inline ::grin::ListRetrieval TopologyFeature::edge_list_retrievals(int index) const { // @@protoc_insertion_point(field_get:grin.TopologyFeature.edge_list_retrievals) return _internal_edge_list_retrievals(index); } inline void TopologyFeature::set_edge_list_retrievals(int index, ::grin::ListRetrieval value) { - _impl_.edge_list_retrievals_.Set(index, value); + edge_list_retrievals_.Set(index, value); // @@protoc_insertion_point(field_set:grin.TopologyFeature.edge_list_retrievals) } inline void TopologyFeature::_internal_add_edge_list_retrievals(::grin::ListRetrieval value) { - _impl_.edge_list_retrievals_.Add(value); + edge_list_retrievals_.Add(value); } inline void TopologyFeature::add_edge_list_retrievals(::grin::ListRetrieval value) { - _internal_add_edge_list_retrievals(value); // @@protoc_insertion_point(field_add:grin.TopologyFeature.edge_list_retrievals) + _internal_add_edge_list_retrievals(value); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& TopologyFeature::edge_list_retrievals() const { // @@protoc_insertion_point(field_list:grin.TopologyFeature.edge_list_retrievals) - return _impl_.edge_list_retrievals_; + return edge_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* TopologyFeature::_internal_mutable_edge_list_retrievals() { - return &_impl_.edge_list_retrievals_; + return &edge_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* TopologyFeature::mutable_edge_list_retrievals() { @@ -2806,40 +2732,40 @@ TopologyFeature::mutable_edge_list_retrievals() { // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; inline int TopologyFeature::_internal_adjacent_list_retrievals_size() const { - return _impl_.adjacent_list_retrievals_.size(); + return adjacent_list_retrievals_.size(); } inline int TopologyFeature::adjacent_list_retrievals_size() const { return _internal_adjacent_list_retrievals_size(); } inline void TopologyFeature::clear_adjacent_list_retrievals() { - _impl_.adjacent_list_retrievals_.Clear(); + adjacent_list_retrievals_.Clear(); } inline ::grin::ListRetrieval TopologyFeature::_internal_adjacent_list_retrievals(int index) const { - return static_cast< ::grin::ListRetrieval >(_impl_.adjacent_list_retrievals_.Get(index)); + return static_cast< ::grin::ListRetrieval >(adjacent_list_retrievals_.Get(index)); } inline ::grin::ListRetrieval TopologyFeature::adjacent_list_retrievals(int index) const { // @@protoc_insertion_point(field_get:grin.TopologyFeature.adjacent_list_retrievals) return _internal_adjacent_list_retrievals(index); } inline void TopologyFeature::set_adjacent_list_retrievals(int index, ::grin::ListRetrieval value) { - _impl_.adjacent_list_retrievals_.Set(index, value); + adjacent_list_retrievals_.Set(index, value); // @@protoc_insertion_point(field_set:grin.TopologyFeature.adjacent_list_retrievals) } inline void TopologyFeature::_internal_add_adjacent_list_retrievals(::grin::ListRetrieval value) { - _impl_.adjacent_list_retrievals_.Add(value); + adjacent_list_retrievals_.Add(value); } inline void TopologyFeature::add_adjacent_list_retrievals(::grin::ListRetrieval value) { - _internal_add_adjacent_list_retrievals(value); // @@protoc_insertion_point(field_add:grin.TopologyFeature.adjacent_list_retrievals) + _internal_add_adjacent_list_retrievals(value); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& TopologyFeature::adjacent_list_retrievals() const { // @@protoc_insertion_point(field_list:grin.TopologyFeature.adjacent_list_retrievals) - return _impl_.adjacent_list_retrievals_; + return adjacent_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* TopologyFeature::_internal_mutable_adjacent_list_retrievals() { - return &_impl_.adjacent_list_retrievals_; + return &adjacent_list_retrievals_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* TopologyFeature::mutable_adjacent_list_retrievals() { @@ -2853,10 +2779,10 @@ TopologyFeature::mutable_adjacent_list_retrievals() { // bool grin_trait_master_vertex_mirror_partition_list = 1; inline void MirrorPartitionListFeature::clear_grin_trait_master_vertex_mirror_partition_list() { - _impl_.grin_trait_master_vertex_mirror_partition_list_ = false; + grin_trait_master_vertex_mirror_partition_list_ = false; } inline bool MirrorPartitionListFeature::_internal_grin_trait_master_vertex_mirror_partition_list() const { - return _impl_.grin_trait_master_vertex_mirror_partition_list_; + return grin_trait_master_vertex_mirror_partition_list_; } inline bool MirrorPartitionListFeature::grin_trait_master_vertex_mirror_partition_list() const { // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_master_vertex_mirror_partition_list) @@ -2864,7 +2790,7 @@ inline bool MirrorPartitionListFeature::grin_trait_master_vertex_mirror_partitio } inline void MirrorPartitionListFeature::_internal_set_grin_trait_master_vertex_mirror_partition_list(bool value) { - _impl_.grin_trait_master_vertex_mirror_partition_list_ = value; + grin_trait_master_vertex_mirror_partition_list_ = value; } inline void MirrorPartitionListFeature::set_grin_trait_master_vertex_mirror_partition_list(bool value) { _internal_set_grin_trait_master_vertex_mirror_partition_list(value); @@ -2873,10 +2799,10 @@ inline void MirrorPartitionListFeature::set_grin_trait_master_vertex_mirror_part // bool grin_trait_mirror_vertex_mirror_partition_list = 2; inline void MirrorPartitionListFeature::clear_grin_trait_mirror_vertex_mirror_partition_list() { - _impl_.grin_trait_mirror_vertex_mirror_partition_list_ = false; + grin_trait_mirror_vertex_mirror_partition_list_ = false; } inline bool MirrorPartitionListFeature::_internal_grin_trait_mirror_vertex_mirror_partition_list() const { - return _impl_.grin_trait_mirror_vertex_mirror_partition_list_; + return grin_trait_mirror_vertex_mirror_partition_list_; } inline bool MirrorPartitionListFeature::grin_trait_mirror_vertex_mirror_partition_list() const { // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_mirror_vertex_mirror_partition_list) @@ -2884,7 +2810,7 @@ inline bool MirrorPartitionListFeature::grin_trait_mirror_vertex_mirror_partitio } inline void MirrorPartitionListFeature::_internal_set_grin_trait_mirror_vertex_mirror_partition_list(bool value) { - _impl_.grin_trait_mirror_vertex_mirror_partition_list_ = value; + grin_trait_mirror_vertex_mirror_partition_list_ = value; } inline void MirrorPartitionListFeature::set_grin_trait_mirror_vertex_mirror_partition_list(bool value) { _internal_set_grin_trait_mirror_vertex_mirror_partition_list(value); @@ -2893,10 +2819,10 @@ inline void MirrorPartitionListFeature::set_grin_trait_mirror_vertex_mirror_part // bool grin_trait_master_edge_mirror_partition_list = 3; inline void MirrorPartitionListFeature::clear_grin_trait_master_edge_mirror_partition_list() { - _impl_.grin_trait_master_edge_mirror_partition_list_ = false; + grin_trait_master_edge_mirror_partition_list_ = false; } inline bool MirrorPartitionListFeature::_internal_grin_trait_master_edge_mirror_partition_list() const { - return _impl_.grin_trait_master_edge_mirror_partition_list_; + return grin_trait_master_edge_mirror_partition_list_; } inline bool MirrorPartitionListFeature::grin_trait_master_edge_mirror_partition_list() const { // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_master_edge_mirror_partition_list) @@ -2904,7 +2830,7 @@ inline bool MirrorPartitionListFeature::grin_trait_master_edge_mirror_partition_ } inline void MirrorPartitionListFeature::_internal_set_grin_trait_master_edge_mirror_partition_list(bool value) { - _impl_.grin_trait_master_edge_mirror_partition_list_ = value; + grin_trait_master_edge_mirror_partition_list_ = value; } inline void MirrorPartitionListFeature::set_grin_trait_master_edge_mirror_partition_list(bool value) { _internal_set_grin_trait_master_edge_mirror_partition_list(value); @@ -2913,10 +2839,10 @@ inline void MirrorPartitionListFeature::set_grin_trait_master_edge_mirror_partit // bool grin_trait_mirror_edge_mirror_partition_list = 4; inline void MirrorPartitionListFeature::clear_grin_trait_mirror_edge_mirror_partition_list() { - _impl_.grin_trait_mirror_edge_mirror_partition_list_ = false; + grin_trait_mirror_edge_mirror_partition_list_ = false; } inline bool MirrorPartitionListFeature::_internal_grin_trait_mirror_edge_mirror_partition_list() const { - return _impl_.grin_trait_mirror_edge_mirror_partition_list_; + return grin_trait_mirror_edge_mirror_partition_list_; } inline bool MirrorPartitionListFeature::grin_trait_mirror_edge_mirror_partition_list() const { // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_mirror_edge_mirror_partition_list) @@ -2924,7 +2850,7 @@ inline bool MirrorPartitionListFeature::grin_trait_mirror_edge_mirror_partition_ } inline void MirrorPartitionListFeature::_internal_set_grin_trait_mirror_edge_mirror_partition_list(bool value) { - _impl_.grin_trait_mirror_edge_mirror_partition_list_ = value; + grin_trait_mirror_edge_mirror_partition_list_ = value; } inline void MirrorPartitionListFeature::set_grin_trait_mirror_edge_mirror_partition_list(bool value) { _internal_set_grin_trait_mirror_edge_mirror_partition_list(value); @@ -2937,10 +2863,10 @@ inline void MirrorPartitionListFeature::set_grin_trait_mirror_edge_mirror_partit // .grin.GraphPartitionStrategy graph_partition_strategy = 1; inline void PartitionFeature::clear_graph_partition_strategy() { - _impl_.graph_partition_strategy_ = 0; + graph_partition_strategy_ = 0; } inline ::grin::GraphPartitionStrategy PartitionFeature::_internal_graph_partition_strategy() const { - return static_cast< ::grin::GraphPartitionStrategy >(_impl_.graph_partition_strategy_); + return static_cast< ::grin::GraphPartitionStrategy >(graph_partition_strategy_); } inline ::grin::GraphPartitionStrategy PartitionFeature::graph_partition_strategy() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.graph_partition_strategy) @@ -2948,7 +2874,7 @@ inline ::grin::GraphPartitionStrategy PartitionFeature::graph_partition_strategy } inline void PartitionFeature::_internal_set_graph_partition_strategy(::grin::GraphPartitionStrategy value) { - _impl_.graph_partition_strategy_ = value; + graph_partition_strategy_ = value; } inline void PartitionFeature::set_graph_partition_strategy(::grin::GraphPartitionStrategy value) { _internal_set_graph_partition_strategy(value); @@ -2957,10 +2883,10 @@ inline void PartitionFeature::set_graph_partition_strategy(::grin::GraphPartitio // bool grin_trait_natural_id_for_partition = 2; inline void PartitionFeature::clear_grin_trait_natural_id_for_partition() { - _impl_.grin_trait_natural_id_for_partition_ = false; + grin_trait_natural_id_for_partition_ = false; } inline bool PartitionFeature::_internal_grin_trait_natural_id_for_partition() const { - return _impl_.grin_trait_natural_id_for_partition_; + return grin_trait_natural_id_for_partition_; } inline bool PartitionFeature::grin_trait_natural_id_for_partition() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_natural_id_for_partition) @@ -2968,7 +2894,7 @@ inline bool PartitionFeature::grin_trait_natural_id_for_partition() const { } inline void PartitionFeature::_internal_set_grin_trait_natural_id_for_partition(bool value) { - _impl_.grin_trait_natural_id_for_partition_ = value; + grin_trait_natural_id_for_partition_ = value; } inline void PartitionFeature::set_grin_trait_natural_id_for_partition(bool value) { _internal_set_grin_trait_natural_id_for_partition(value); @@ -2977,10 +2903,10 @@ inline void PartitionFeature::set_grin_trait_natural_id_for_partition(bool value // bool grin_enable_vertex_ref = 3; inline void PartitionFeature::clear_grin_enable_vertex_ref() { - _impl_.grin_enable_vertex_ref_ = false; + grin_enable_vertex_ref_ = false; } inline bool PartitionFeature::_internal_grin_enable_vertex_ref() const { - return _impl_.grin_enable_vertex_ref_; + return grin_enable_vertex_ref_; } inline bool PartitionFeature::grin_enable_vertex_ref() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_enable_vertex_ref) @@ -2988,7 +2914,7 @@ inline bool PartitionFeature::grin_enable_vertex_ref() const { } inline void PartitionFeature::_internal_set_grin_enable_vertex_ref(bool value) { - _impl_.grin_enable_vertex_ref_ = value; + grin_enable_vertex_ref_ = value; } inline void PartitionFeature::set_grin_enable_vertex_ref(bool value) { _internal_set_grin_enable_vertex_ref(value); @@ -2997,10 +2923,10 @@ inline void PartitionFeature::set_grin_enable_vertex_ref(bool value) { // bool grin_enable_edge_ref = 4; inline void PartitionFeature::clear_grin_enable_edge_ref() { - _impl_.grin_enable_edge_ref_ = false; + grin_enable_edge_ref_ = false; } inline bool PartitionFeature::_internal_grin_enable_edge_ref() const { - return _impl_.grin_enable_edge_ref_; + return grin_enable_edge_ref_; } inline bool PartitionFeature::grin_enable_edge_ref() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_enable_edge_ref) @@ -3008,7 +2934,7 @@ inline bool PartitionFeature::grin_enable_edge_ref() const { } inline void PartitionFeature::_internal_set_grin_enable_edge_ref(bool value) { - _impl_.grin_enable_edge_ref_ = value; + grin_enable_edge_ref_ = value; } inline void PartitionFeature::set_grin_enable_edge_ref(bool value) { _internal_set_grin_enable_edge_ref(value); @@ -3017,10 +2943,10 @@ inline void PartitionFeature::set_grin_enable_edge_ref(bool value) { // .grin.PropertyDataPartitionStrategy vertex_data = 5; inline void PartitionFeature::clear_vertex_data() { - _impl_.vertex_data_ = 0; + vertex_data_ = 0; } inline ::grin::PropertyDataPartitionStrategy PartitionFeature::_internal_vertex_data() const { - return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.vertex_data_); + return static_cast< ::grin::PropertyDataPartitionStrategy >(vertex_data_); } inline ::grin::PropertyDataPartitionStrategy PartitionFeature::vertex_data() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.vertex_data) @@ -3028,7 +2954,7 @@ inline ::grin::PropertyDataPartitionStrategy PartitionFeature::vertex_data() con } inline void PartitionFeature::_internal_set_vertex_data(::grin::PropertyDataPartitionStrategy value) { - _impl_.vertex_data_ = value; + vertex_data_ = value; } inline void PartitionFeature::set_vertex_data(::grin::PropertyDataPartitionStrategy value) { _internal_set_vertex_data(value); @@ -3037,10 +2963,10 @@ inline void PartitionFeature::set_vertex_data(::grin::PropertyDataPartitionStrat // .grin.PropertyDataPartitionStrategy edge_data = 6; inline void PartitionFeature::clear_edge_data() { - _impl_.edge_data_ = 0; + edge_data_ = 0; } inline ::grin::PropertyDataPartitionStrategy PartitionFeature::_internal_edge_data() const { - return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.edge_data_); + return static_cast< ::grin::PropertyDataPartitionStrategy >(edge_data_); } inline ::grin::PropertyDataPartitionStrategy PartitionFeature::edge_data() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.edge_data) @@ -3048,7 +2974,7 @@ inline ::grin::PropertyDataPartitionStrategy PartitionFeature::edge_data() const } inline void PartitionFeature::_internal_set_edge_data(::grin::PropertyDataPartitionStrategy value) { - _impl_.edge_data_ = value; + edge_data_ = value; } inline void PartitionFeature::set_edge_data(::grin::PropertyDataPartitionStrategy value) { _internal_set_edge_data(value); @@ -3057,21 +2983,21 @@ inline void PartitionFeature::set_edge_data(::grin::PropertyDataPartitionStrateg // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; inline bool PartitionFeature::_internal_has_mirror_partition_list_feature() const { - return this != internal_default_instance() && _impl_.mirror_partition_list_feature_ != nullptr; + return this != internal_default_instance() && mirror_partition_list_feature_ != nullptr; } inline bool PartitionFeature::has_mirror_partition_list_feature() const { return _internal_has_mirror_partition_list_feature(); } inline void PartitionFeature::clear_mirror_partition_list_feature() { - if (GetArenaForAllocation() == nullptr && _impl_.mirror_partition_list_feature_ != nullptr) { - delete _impl_.mirror_partition_list_feature_; + if (GetArena() == nullptr && mirror_partition_list_feature_ != nullptr) { + delete mirror_partition_list_feature_; } - _impl_.mirror_partition_list_feature_ = nullptr; + mirror_partition_list_feature_ = nullptr; } inline const ::grin::MirrorPartitionListFeature& PartitionFeature::_internal_mirror_partition_list_feature() const { - const ::grin::MirrorPartitionListFeature* p = _impl_.mirror_partition_list_feature_; - return p != nullptr ? *p : reinterpret_cast( - ::grin::_MirrorPartitionListFeature_default_instance_); + const ::grin::MirrorPartitionListFeature* p = mirror_partition_list_feature_; + return p != nullptr ? *p : *reinterpret_cast( + &::grin::_MirrorPartitionListFeature_default_instance_); } inline const ::grin::MirrorPartitionListFeature& PartitionFeature::mirror_partition_list_feature() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.mirror_partition_list_feature) @@ -3079,10 +3005,10 @@ inline const ::grin::MirrorPartitionListFeature& PartitionFeature::mirror_partit } inline void PartitionFeature::unsafe_arena_set_allocated_mirror_partition_list_feature( ::grin::MirrorPartitionListFeature* mirror_partition_list_feature) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.mirror_partition_list_feature_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(mirror_partition_list_feature_); } - _impl_.mirror_partition_list_feature_ = mirror_partition_list_feature; + mirror_partition_list_feature_ = mirror_partition_list_feature; if (mirror_partition_list_feature) { } else { @@ -3091,48 +3017,39 @@ inline void PartitionFeature::unsafe_arena_set_allocated_mirror_partition_list_f // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PartitionFeature.mirror_partition_list_feature) } inline ::grin::MirrorPartitionListFeature* PartitionFeature::release_mirror_partition_list_feature() { - - ::grin::MirrorPartitionListFeature* temp = _impl_.mirror_partition_list_feature_; - _impl_.mirror_partition_list_feature_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { + auto temp = unsafe_arena_release_mirror_partition_list_feature(); + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } inline ::grin::MirrorPartitionListFeature* PartitionFeature::unsafe_arena_release_mirror_partition_list_feature() { // @@protoc_insertion_point(field_release:grin.PartitionFeature.mirror_partition_list_feature) - ::grin::MirrorPartitionListFeature* temp = _impl_.mirror_partition_list_feature_; - _impl_.mirror_partition_list_feature_ = nullptr; + ::grin::MirrorPartitionListFeature* temp = mirror_partition_list_feature_; + mirror_partition_list_feature_ = nullptr; return temp; } inline ::grin::MirrorPartitionListFeature* PartitionFeature::_internal_mutable_mirror_partition_list_feature() { - if (_impl_.mirror_partition_list_feature_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::MirrorPartitionListFeature>(GetArenaForAllocation()); - _impl_.mirror_partition_list_feature_ = p; + if (mirror_partition_list_feature_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::MirrorPartitionListFeature>(GetArena()); + mirror_partition_list_feature_ = p; } - return _impl_.mirror_partition_list_feature_; + return mirror_partition_list_feature_; } inline ::grin::MirrorPartitionListFeature* PartitionFeature::mutable_mirror_partition_list_feature() { - ::grin::MirrorPartitionListFeature* _msg = _internal_mutable_mirror_partition_list_feature(); // @@protoc_insertion_point(field_mutable:grin.PartitionFeature.mirror_partition_list_feature) - return _msg; + return _internal_mutable_mirror_partition_list_feature(); } inline void PartitionFeature::set_allocated_mirror_partition_list_feature(::grin::MirrorPartitionListFeature* mirror_partition_list_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); if (message_arena == nullptr) { - delete _impl_.mirror_partition_list_feature_; + delete mirror_partition_list_feature_; } if (mirror_partition_list_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(mirror_partition_list_feature); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(mirror_partition_list_feature); if (message_arena != submessage_arena) { mirror_partition_list_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, mirror_partition_list_feature, submessage_arena); @@ -3141,16 +3058,16 @@ inline void PartitionFeature::set_allocated_mirror_partition_list_feature(::grin } else { } - _impl_.mirror_partition_list_feature_ = mirror_partition_list_feature; + mirror_partition_list_feature_ = mirror_partition_list_feature; // @@protoc_insertion_point(field_set_allocated:grin.PartitionFeature.mirror_partition_list_feature) } // bool grin_trait_select_master_for_vertex_list = 8; inline void PartitionFeature::clear_grin_trait_select_master_for_vertex_list() { - _impl_.grin_trait_select_master_for_vertex_list_ = false; + grin_trait_select_master_for_vertex_list_ = false; } inline bool PartitionFeature::_internal_grin_trait_select_master_for_vertex_list() const { - return _impl_.grin_trait_select_master_for_vertex_list_; + return grin_trait_select_master_for_vertex_list_; } inline bool PartitionFeature::grin_trait_select_master_for_vertex_list() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_master_for_vertex_list) @@ -3158,7 +3075,7 @@ inline bool PartitionFeature::grin_trait_select_master_for_vertex_list() const { } inline void PartitionFeature::_internal_set_grin_trait_select_master_for_vertex_list(bool value) { - _impl_.grin_trait_select_master_for_vertex_list_ = value; + grin_trait_select_master_for_vertex_list_ = value; } inline void PartitionFeature::set_grin_trait_select_master_for_vertex_list(bool value) { _internal_set_grin_trait_select_master_for_vertex_list(value); @@ -3167,10 +3084,10 @@ inline void PartitionFeature::set_grin_trait_select_master_for_vertex_list(bool // bool grin_trait_select_partition_for_vertex_list = 9; inline void PartitionFeature::clear_grin_trait_select_partition_for_vertex_list() { - _impl_.grin_trait_select_partition_for_vertex_list_ = false; + grin_trait_select_partition_for_vertex_list_ = false; } inline bool PartitionFeature::_internal_grin_trait_select_partition_for_vertex_list() const { - return _impl_.grin_trait_select_partition_for_vertex_list_; + return grin_trait_select_partition_for_vertex_list_; } inline bool PartitionFeature::grin_trait_select_partition_for_vertex_list() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_partition_for_vertex_list) @@ -3178,7 +3095,7 @@ inline bool PartitionFeature::grin_trait_select_partition_for_vertex_list() cons } inline void PartitionFeature::_internal_set_grin_trait_select_partition_for_vertex_list(bool value) { - _impl_.grin_trait_select_partition_for_vertex_list_ = value; + grin_trait_select_partition_for_vertex_list_ = value; } inline void PartitionFeature::set_grin_trait_select_partition_for_vertex_list(bool value) { _internal_set_grin_trait_select_partition_for_vertex_list(value); @@ -3187,10 +3104,10 @@ inline void PartitionFeature::set_grin_trait_select_partition_for_vertex_list(bo // bool grin_trait_select_master_for_edge_list = 10; inline void PartitionFeature::clear_grin_trait_select_master_for_edge_list() { - _impl_.grin_trait_select_master_for_edge_list_ = false; + grin_trait_select_master_for_edge_list_ = false; } inline bool PartitionFeature::_internal_grin_trait_select_master_for_edge_list() const { - return _impl_.grin_trait_select_master_for_edge_list_; + return grin_trait_select_master_for_edge_list_; } inline bool PartitionFeature::grin_trait_select_master_for_edge_list() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_master_for_edge_list) @@ -3198,7 +3115,7 @@ inline bool PartitionFeature::grin_trait_select_master_for_edge_list() const { } inline void PartitionFeature::_internal_set_grin_trait_select_master_for_edge_list(bool value) { - _impl_.grin_trait_select_master_for_edge_list_ = value; + grin_trait_select_master_for_edge_list_ = value; } inline void PartitionFeature::set_grin_trait_select_master_for_edge_list(bool value) { _internal_set_grin_trait_select_master_for_edge_list(value); @@ -3207,10 +3124,10 @@ inline void PartitionFeature::set_grin_trait_select_master_for_edge_list(bool va // bool grin_trait_select_partition_for_edge_list = 11; inline void PartitionFeature::clear_grin_trait_select_partition_for_edge_list() { - _impl_.grin_trait_select_partition_for_edge_list_ = false; + grin_trait_select_partition_for_edge_list_ = false; } inline bool PartitionFeature::_internal_grin_trait_select_partition_for_edge_list() const { - return _impl_.grin_trait_select_partition_for_edge_list_; + return grin_trait_select_partition_for_edge_list_; } inline bool PartitionFeature::grin_trait_select_partition_for_edge_list() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_partition_for_edge_list) @@ -3218,7 +3135,7 @@ inline bool PartitionFeature::grin_trait_select_partition_for_edge_list() const } inline void PartitionFeature::_internal_set_grin_trait_select_partition_for_edge_list(bool value) { - _impl_.grin_trait_select_partition_for_edge_list_ = value; + grin_trait_select_partition_for_edge_list_ = value; } inline void PartitionFeature::set_grin_trait_select_partition_for_edge_list(bool value) { _internal_set_grin_trait_select_partition_for_edge_list(value); @@ -3227,10 +3144,10 @@ inline void PartitionFeature::set_grin_trait_select_partition_for_edge_list(bool // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; inline void PartitionFeature::clear_grin_trait_select_master_neighbor_for_adjacent_list() { - _impl_.grin_trait_select_master_neighbor_for_adjacent_list_ = false; + grin_trait_select_master_neighbor_for_adjacent_list_ = false; } inline bool PartitionFeature::_internal_grin_trait_select_master_neighbor_for_adjacent_list() const { - return _impl_.grin_trait_select_master_neighbor_for_adjacent_list_; + return grin_trait_select_master_neighbor_for_adjacent_list_; } inline bool PartitionFeature::grin_trait_select_master_neighbor_for_adjacent_list() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_master_neighbor_for_adjacent_list) @@ -3238,7 +3155,7 @@ inline bool PartitionFeature::grin_trait_select_master_neighbor_for_adjacent_lis } inline void PartitionFeature::_internal_set_grin_trait_select_master_neighbor_for_adjacent_list(bool value) { - _impl_.grin_trait_select_master_neighbor_for_adjacent_list_ = value; + grin_trait_select_master_neighbor_for_adjacent_list_ = value; } inline void PartitionFeature::set_grin_trait_select_master_neighbor_for_adjacent_list(bool value) { _internal_set_grin_trait_select_master_neighbor_for_adjacent_list(value); @@ -3247,10 +3164,10 @@ inline void PartitionFeature::set_grin_trait_select_master_neighbor_for_adjacent // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; inline void PartitionFeature::clear_grin_trait_select_neighbor_partition_for_adjacent_list() { - _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_ = false; + grin_trait_select_neighbor_partition_for_adjacent_list_ = false; } inline bool PartitionFeature::_internal_grin_trait_select_neighbor_partition_for_adjacent_list() const { - return _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_; + return grin_trait_select_neighbor_partition_for_adjacent_list_; } inline bool PartitionFeature::grin_trait_select_neighbor_partition_for_adjacent_list() const { // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_neighbor_partition_for_adjacent_list) @@ -3258,7 +3175,7 @@ inline bool PartitionFeature::grin_trait_select_neighbor_partition_for_adjacent_ } inline void PartitionFeature::_internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value) { - _impl_.grin_trait_select_neighbor_partition_for_adjacent_list_ = value; + grin_trait_select_neighbor_partition_for_adjacent_list_ = value; } inline void PartitionFeature::set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value) { _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(value); @@ -3271,10 +3188,10 @@ inline void PartitionFeature::set_grin_trait_select_neighbor_partition_for_adjac // bool grin_with_vertex_property = 1; inline void VertexPropertyFeature::clear_grin_with_vertex_property() { - _impl_.grin_with_vertex_property_ = false; + grin_with_vertex_property_ = false; } inline bool VertexPropertyFeature::_internal_grin_with_vertex_property() const { - return _impl_.grin_with_vertex_property_; + return grin_with_vertex_property_; } inline bool VertexPropertyFeature::grin_with_vertex_property() const { // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_with_vertex_property) @@ -3282,7 +3199,7 @@ inline bool VertexPropertyFeature::grin_with_vertex_property() const { } inline void VertexPropertyFeature::_internal_set_grin_with_vertex_property(bool value) { - _impl_.grin_with_vertex_property_ = value; + grin_with_vertex_property_ = value; } inline void VertexPropertyFeature::set_grin_with_vertex_property(bool value) { _internal_set_grin_with_vertex_property(value); @@ -3291,10 +3208,10 @@ inline void VertexPropertyFeature::set_grin_with_vertex_property(bool value) { // bool grin_with_vertex_property_name = 2; inline void VertexPropertyFeature::clear_grin_with_vertex_property_name() { - _impl_.grin_with_vertex_property_name_ = false; + grin_with_vertex_property_name_ = false; } inline bool VertexPropertyFeature::_internal_grin_with_vertex_property_name() const { - return _impl_.grin_with_vertex_property_name_; + return grin_with_vertex_property_name_; } inline bool VertexPropertyFeature::grin_with_vertex_property_name() const { // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_with_vertex_property_name) @@ -3302,7 +3219,7 @@ inline bool VertexPropertyFeature::grin_with_vertex_property_name() const { } inline void VertexPropertyFeature::_internal_set_grin_with_vertex_property_name(bool value) { - _impl_.grin_with_vertex_property_name_ = value; + grin_with_vertex_property_name_ = value; } inline void VertexPropertyFeature::set_grin_with_vertex_property_name(bool value) { _internal_set_grin_with_vertex_property_name(value); @@ -3311,10 +3228,10 @@ inline void VertexPropertyFeature::set_grin_with_vertex_property_name(bool value // bool grin_with_vertex_type_name = 3; inline void VertexPropertyFeature::clear_grin_with_vertex_type_name() { - _impl_.grin_with_vertex_type_name_ = false; + grin_with_vertex_type_name_ = false; } inline bool VertexPropertyFeature::_internal_grin_with_vertex_type_name() const { - return _impl_.grin_with_vertex_type_name_; + return grin_with_vertex_type_name_; } inline bool VertexPropertyFeature::grin_with_vertex_type_name() const { // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_with_vertex_type_name) @@ -3322,7 +3239,7 @@ inline bool VertexPropertyFeature::grin_with_vertex_type_name() const { } inline void VertexPropertyFeature::_internal_set_grin_with_vertex_type_name(bool value) { - _impl_.grin_with_vertex_type_name_ = value; + grin_with_vertex_type_name_ = value; } inline void VertexPropertyFeature::set_grin_with_vertex_type_name(bool value) { _internal_set_grin_with_vertex_type_name(value); @@ -3331,10 +3248,10 @@ inline void VertexPropertyFeature::set_grin_with_vertex_type_name(bool value) { // bool grin_enable_vertex_property_table = 4; inline void VertexPropertyFeature::clear_grin_enable_vertex_property_table() { - _impl_.grin_enable_vertex_property_table_ = false; + grin_enable_vertex_property_table_ = false; } inline bool VertexPropertyFeature::_internal_grin_enable_vertex_property_table() const { - return _impl_.grin_enable_vertex_property_table_; + return grin_enable_vertex_property_table_; } inline bool VertexPropertyFeature::grin_enable_vertex_property_table() const { // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_enable_vertex_property_table) @@ -3342,7 +3259,7 @@ inline bool VertexPropertyFeature::grin_enable_vertex_property_table() const { } inline void VertexPropertyFeature::_internal_set_grin_enable_vertex_property_table(bool value) { - _impl_.grin_enable_vertex_property_table_ = value; + grin_enable_vertex_property_table_ = value; } inline void VertexPropertyFeature::set_grin_enable_vertex_property_table(bool value) { _internal_set_grin_enable_vertex_property_table(value); @@ -3351,10 +3268,10 @@ inline void VertexPropertyFeature::set_grin_enable_vertex_property_table(bool va // bool grin_enable_vertex_primary_keys = 5; inline void VertexPropertyFeature::clear_grin_enable_vertex_primary_keys() { - _impl_.grin_enable_vertex_primary_keys_ = false; + grin_enable_vertex_primary_keys_ = false; } inline bool VertexPropertyFeature::_internal_grin_enable_vertex_primary_keys() const { - return _impl_.grin_enable_vertex_primary_keys_; + return grin_enable_vertex_primary_keys_; } inline bool VertexPropertyFeature::grin_enable_vertex_primary_keys() const { // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_enable_vertex_primary_keys) @@ -3362,7 +3279,7 @@ inline bool VertexPropertyFeature::grin_enable_vertex_primary_keys() const { } inline void VertexPropertyFeature::_internal_set_grin_enable_vertex_primary_keys(bool value) { - _impl_.grin_enable_vertex_primary_keys_ = value; + grin_enable_vertex_primary_keys_ = value; } inline void VertexPropertyFeature::set_grin_enable_vertex_primary_keys(bool value) { _internal_set_grin_enable_vertex_primary_keys(value); @@ -3371,10 +3288,10 @@ inline void VertexPropertyFeature::set_grin_enable_vertex_primary_keys(bool valu // bool grin_trait_natural_id_for_vertex_type = 6; inline void VertexPropertyFeature::clear_grin_trait_natural_id_for_vertex_type() { - _impl_.grin_trait_natural_id_for_vertex_type_ = false; + grin_trait_natural_id_for_vertex_type_ = false; } inline bool VertexPropertyFeature::_internal_grin_trait_natural_id_for_vertex_type() const { - return _impl_.grin_trait_natural_id_for_vertex_type_; + return grin_trait_natural_id_for_vertex_type_; } inline bool VertexPropertyFeature::grin_trait_natural_id_for_vertex_type() const { // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_trait_natural_id_for_vertex_type) @@ -3382,7 +3299,7 @@ inline bool VertexPropertyFeature::grin_trait_natural_id_for_vertex_type() const } inline void VertexPropertyFeature::_internal_set_grin_trait_natural_id_for_vertex_type(bool value) { - _impl_.grin_trait_natural_id_for_vertex_type_ = value; + grin_trait_natural_id_for_vertex_type_ = value; } inline void VertexPropertyFeature::set_grin_trait_natural_id_for_vertex_type(bool value) { _internal_set_grin_trait_natural_id_for_vertex_type(value); @@ -3391,10 +3308,10 @@ inline void VertexPropertyFeature::set_grin_trait_natural_id_for_vertex_type(boo // bool grin_trait_natural_id_for_vertex_property = 7; inline void VertexPropertyFeature::clear_grin_trait_natural_id_for_vertex_property() { - _impl_.grin_trait_natural_id_for_vertex_property_ = false; + grin_trait_natural_id_for_vertex_property_ = false; } inline bool VertexPropertyFeature::_internal_grin_trait_natural_id_for_vertex_property() const { - return _impl_.grin_trait_natural_id_for_vertex_property_; + return grin_trait_natural_id_for_vertex_property_; } inline bool VertexPropertyFeature::grin_trait_natural_id_for_vertex_property() const { // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_trait_natural_id_for_vertex_property) @@ -3402,7 +3319,7 @@ inline bool VertexPropertyFeature::grin_trait_natural_id_for_vertex_property() c } inline void VertexPropertyFeature::_internal_set_grin_trait_natural_id_for_vertex_property(bool value) { - _impl_.grin_trait_natural_id_for_vertex_property_ = value; + grin_trait_natural_id_for_vertex_property_ = value; } inline void VertexPropertyFeature::set_grin_trait_natural_id_for_vertex_property(bool value) { _internal_set_grin_trait_natural_id_for_vertex_property(value); @@ -3411,10 +3328,10 @@ inline void VertexPropertyFeature::set_grin_trait_natural_id_for_vertex_property // bool grin_assume_by_type_vertex_original_id = 8; inline void VertexPropertyFeature::clear_grin_assume_by_type_vertex_original_id() { - _impl_.grin_assume_by_type_vertex_original_id_ = false; + grin_assume_by_type_vertex_original_id_ = false; } inline bool VertexPropertyFeature::_internal_grin_assume_by_type_vertex_original_id() const { - return _impl_.grin_assume_by_type_vertex_original_id_; + return grin_assume_by_type_vertex_original_id_; } inline bool VertexPropertyFeature::grin_assume_by_type_vertex_original_id() const { // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_assume_by_type_vertex_original_id) @@ -3422,7 +3339,7 @@ inline bool VertexPropertyFeature::grin_assume_by_type_vertex_original_id() cons } inline void VertexPropertyFeature::_internal_set_grin_assume_by_type_vertex_original_id(bool value) { - _impl_.grin_assume_by_type_vertex_original_id_ = value; + grin_assume_by_type_vertex_original_id_ = value; } inline void VertexPropertyFeature::set_grin_assume_by_type_vertex_original_id(bool value) { _internal_set_grin_assume_by_type_vertex_original_id(value); @@ -3435,10 +3352,10 @@ inline void VertexPropertyFeature::set_grin_assume_by_type_vertex_original_id(bo // bool grin_with_edge_property = 1; inline void EdgePropertyFeature::clear_grin_with_edge_property() { - _impl_.grin_with_edge_property_ = false; + grin_with_edge_property_ = false; } inline bool EdgePropertyFeature::_internal_grin_with_edge_property() const { - return _impl_.grin_with_edge_property_; + return grin_with_edge_property_; } inline bool EdgePropertyFeature::grin_with_edge_property() const { // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_with_edge_property) @@ -3446,7 +3363,7 @@ inline bool EdgePropertyFeature::grin_with_edge_property() const { } inline void EdgePropertyFeature::_internal_set_grin_with_edge_property(bool value) { - _impl_.grin_with_edge_property_ = value; + grin_with_edge_property_ = value; } inline void EdgePropertyFeature::set_grin_with_edge_property(bool value) { _internal_set_grin_with_edge_property(value); @@ -3455,10 +3372,10 @@ inline void EdgePropertyFeature::set_grin_with_edge_property(bool value) { // bool grin_with_edge_property_name = 2; inline void EdgePropertyFeature::clear_grin_with_edge_property_name() { - _impl_.grin_with_edge_property_name_ = false; + grin_with_edge_property_name_ = false; } inline bool EdgePropertyFeature::_internal_grin_with_edge_property_name() const { - return _impl_.grin_with_edge_property_name_; + return grin_with_edge_property_name_; } inline bool EdgePropertyFeature::grin_with_edge_property_name() const { // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_with_edge_property_name) @@ -3466,7 +3383,7 @@ inline bool EdgePropertyFeature::grin_with_edge_property_name() const { } inline void EdgePropertyFeature::_internal_set_grin_with_edge_property_name(bool value) { - _impl_.grin_with_edge_property_name_ = value; + grin_with_edge_property_name_ = value; } inline void EdgePropertyFeature::set_grin_with_edge_property_name(bool value) { _internal_set_grin_with_edge_property_name(value); @@ -3475,10 +3392,10 @@ inline void EdgePropertyFeature::set_grin_with_edge_property_name(bool value) { // bool grin_with_edge_type_name = 3; inline void EdgePropertyFeature::clear_grin_with_edge_type_name() { - _impl_.grin_with_edge_type_name_ = false; + grin_with_edge_type_name_ = false; } inline bool EdgePropertyFeature::_internal_grin_with_edge_type_name() const { - return _impl_.grin_with_edge_type_name_; + return grin_with_edge_type_name_; } inline bool EdgePropertyFeature::grin_with_edge_type_name() const { // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_with_edge_type_name) @@ -3486,7 +3403,7 @@ inline bool EdgePropertyFeature::grin_with_edge_type_name() const { } inline void EdgePropertyFeature::_internal_set_grin_with_edge_type_name(bool value) { - _impl_.grin_with_edge_type_name_ = value; + grin_with_edge_type_name_ = value; } inline void EdgePropertyFeature::set_grin_with_edge_type_name(bool value) { _internal_set_grin_with_edge_type_name(value); @@ -3495,10 +3412,10 @@ inline void EdgePropertyFeature::set_grin_with_edge_type_name(bool value) { // bool grin_enable_edge_property_table = 4; inline void EdgePropertyFeature::clear_grin_enable_edge_property_table() { - _impl_.grin_enable_edge_property_table_ = false; + grin_enable_edge_property_table_ = false; } inline bool EdgePropertyFeature::_internal_grin_enable_edge_property_table() const { - return _impl_.grin_enable_edge_property_table_; + return grin_enable_edge_property_table_; } inline bool EdgePropertyFeature::grin_enable_edge_property_table() const { // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_enable_edge_property_table) @@ -3506,7 +3423,7 @@ inline bool EdgePropertyFeature::grin_enable_edge_property_table() const { } inline void EdgePropertyFeature::_internal_set_grin_enable_edge_property_table(bool value) { - _impl_.grin_enable_edge_property_table_ = value; + grin_enable_edge_property_table_ = value; } inline void EdgePropertyFeature::set_grin_enable_edge_property_table(bool value) { _internal_set_grin_enable_edge_property_table(value); @@ -3515,10 +3432,10 @@ inline void EdgePropertyFeature::set_grin_enable_edge_property_table(bool value) // bool grin_enable_edge_primary_keys = 5; inline void EdgePropertyFeature::clear_grin_enable_edge_primary_keys() { - _impl_.grin_enable_edge_primary_keys_ = false; + grin_enable_edge_primary_keys_ = false; } inline bool EdgePropertyFeature::_internal_grin_enable_edge_primary_keys() const { - return _impl_.grin_enable_edge_primary_keys_; + return grin_enable_edge_primary_keys_; } inline bool EdgePropertyFeature::grin_enable_edge_primary_keys() const { // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_enable_edge_primary_keys) @@ -3526,7 +3443,7 @@ inline bool EdgePropertyFeature::grin_enable_edge_primary_keys() const { } inline void EdgePropertyFeature::_internal_set_grin_enable_edge_primary_keys(bool value) { - _impl_.grin_enable_edge_primary_keys_ = value; + grin_enable_edge_primary_keys_ = value; } inline void EdgePropertyFeature::set_grin_enable_edge_primary_keys(bool value) { _internal_set_grin_enable_edge_primary_keys(value); @@ -3535,10 +3452,10 @@ inline void EdgePropertyFeature::set_grin_enable_edge_primary_keys(bool value) { // bool grin_trait_natural_id_for_edge_type = 6; inline void EdgePropertyFeature::clear_grin_trait_natural_id_for_edge_type() { - _impl_.grin_trait_natural_id_for_edge_type_ = false; + grin_trait_natural_id_for_edge_type_ = false; } inline bool EdgePropertyFeature::_internal_grin_trait_natural_id_for_edge_type() const { - return _impl_.grin_trait_natural_id_for_edge_type_; + return grin_trait_natural_id_for_edge_type_; } inline bool EdgePropertyFeature::grin_trait_natural_id_for_edge_type() const { // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_trait_natural_id_for_edge_type) @@ -3546,7 +3463,7 @@ inline bool EdgePropertyFeature::grin_trait_natural_id_for_edge_type() const { } inline void EdgePropertyFeature::_internal_set_grin_trait_natural_id_for_edge_type(bool value) { - _impl_.grin_trait_natural_id_for_edge_type_ = value; + grin_trait_natural_id_for_edge_type_ = value; } inline void EdgePropertyFeature::set_grin_trait_natural_id_for_edge_type(bool value) { _internal_set_grin_trait_natural_id_for_edge_type(value); @@ -3555,10 +3472,10 @@ inline void EdgePropertyFeature::set_grin_trait_natural_id_for_edge_type(bool va // bool grin_trait_natural_id_for_edge_property = 7; inline void EdgePropertyFeature::clear_grin_trait_natural_id_for_edge_property() { - _impl_.grin_trait_natural_id_for_edge_property_ = false; + grin_trait_natural_id_for_edge_property_ = false; } inline bool EdgePropertyFeature::_internal_grin_trait_natural_id_for_edge_property() const { - return _impl_.grin_trait_natural_id_for_edge_property_; + return grin_trait_natural_id_for_edge_property_; } inline bool EdgePropertyFeature::grin_trait_natural_id_for_edge_property() const { // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_trait_natural_id_for_edge_property) @@ -3566,7 +3483,7 @@ inline bool EdgePropertyFeature::grin_trait_natural_id_for_edge_property() const } inline void EdgePropertyFeature::_internal_set_grin_trait_natural_id_for_edge_property(bool value) { - _impl_.grin_trait_natural_id_for_edge_property_ = value; + grin_trait_natural_id_for_edge_property_ = value; } inline void EdgePropertyFeature::set_grin_trait_natural_id_for_edge_property(bool value) { _internal_set_grin_trait_natural_id_for_edge_property(value); @@ -3579,10 +3496,10 @@ inline void EdgePropertyFeature::set_grin_trait_natural_id_for_edge_property(boo // bool grin_enable_row = 1; inline void PropertyFeature::clear_grin_enable_row() { - _impl_.grin_enable_row_ = false; + grin_enable_row_ = false; } inline bool PropertyFeature::_internal_grin_enable_row() const { - return _impl_.grin_enable_row_; + return grin_enable_row_; } inline bool PropertyFeature::grin_enable_row() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_enable_row) @@ -3590,7 +3507,7 @@ inline bool PropertyFeature::grin_enable_row() const { } inline void PropertyFeature::_internal_set_grin_enable_row(bool value) { - _impl_.grin_enable_row_ = value; + grin_enable_row_ = value; } inline void PropertyFeature::set_grin_enable_row(bool value) { _internal_set_grin_enable_row(value); @@ -3599,21 +3516,21 @@ inline void PropertyFeature::set_grin_enable_row(bool value) { // .grin.VertexPropertyFeature vertex_property_feature = 2; inline bool PropertyFeature::_internal_has_vertex_property_feature() const { - return this != internal_default_instance() && _impl_.vertex_property_feature_ != nullptr; + return this != internal_default_instance() && vertex_property_feature_ != nullptr; } inline bool PropertyFeature::has_vertex_property_feature() const { return _internal_has_vertex_property_feature(); } inline void PropertyFeature::clear_vertex_property_feature() { - if (GetArenaForAllocation() == nullptr && _impl_.vertex_property_feature_ != nullptr) { - delete _impl_.vertex_property_feature_; + if (GetArena() == nullptr && vertex_property_feature_ != nullptr) { + delete vertex_property_feature_; } - _impl_.vertex_property_feature_ = nullptr; + vertex_property_feature_ = nullptr; } inline const ::grin::VertexPropertyFeature& PropertyFeature::_internal_vertex_property_feature() const { - const ::grin::VertexPropertyFeature* p = _impl_.vertex_property_feature_; - return p != nullptr ? *p : reinterpret_cast( - ::grin::_VertexPropertyFeature_default_instance_); + const ::grin::VertexPropertyFeature* p = vertex_property_feature_; + return p != nullptr ? *p : *reinterpret_cast( + &::grin::_VertexPropertyFeature_default_instance_); } inline const ::grin::VertexPropertyFeature& PropertyFeature::vertex_property_feature() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.vertex_property_feature) @@ -3621,10 +3538,10 @@ inline const ::grin::VertexPropertyFeature& PropertyFeature::vertex_property_fea } inline void PropertyFeature::unsafe_arena_set_allocated_vertex_property_feature( ::grin::VertexPropertyFeature* vertex_property_feature) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.vertex_property_feature_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(vertex_property_feature_); } - _impl_.vertex_property_feature_ = vertex_property_feature; + vertex_property_feature_ = vertex_property_feature; if (vertex_property_feature) { } else { @@ -3633,48 +3550,39 @@ inline void PropertyFeature::unsafe_arena_set_allocated_vertex_property_feature( // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PropertyFeature.vertex_property_feature) } inline ::grin::VertexPropertyFeature* PropertyFeature::release_vertex_property_feature() { - - ::grin::VertexPropertyFeature* temp = _impl_.vertex_property_feature_; - _impl_.vertex_property_feature_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { + auto temp = unsafe_arena_release_vertex_property_feature(); + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } inline ::grin::VertexPropertyFeature* PropertyFeature::unsafe_arena_release_vertex_property_feature() { // @@protoc_insertion_point(field_release:grin.PropertyFeature.vertex_property_feature) - ::grin::VertexPropertyFeature* temp = _impl_.vertex_property_feature_; - _impl_.vertex_property_feature_ = nullptr; + ::grin::VertexPropertyFeature* temp = vertex_property_feature_; + vertex_property_feature_ = nullptr; return temp; } inline ::grin::VertexPropertyFeature* PropertyFeature::_internal_mutable_vertex_property_feature() { - if (_impl_.vertex_property_feature_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::VertexPropertyFeature>(GetArenaForAllocation()); - _impl_.vertex_property_feature_ = p; + if (vertex_property_feature_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::VertexPropertyFeature>(GetArena()); + vertex_property_feature_ = p; } - return _impl_.vertex_property_feature_; + return vertex_property_feature_; } inline ::grin::VertexPropertyFeature* PropertyFeature::mutable_vertex_property_feature() { - ::grin::VertexPropertyFeature* _msg = _internal_mutable_vertex_property_feature(); // @@protoc_insertion_point(field_mutable:grin.PropertyFeature.vertex_property_feature) - return _msg; + return _internal_mutable_vertex_property_feature(); } inline void PropertyFeature::set_allocated_vertex_property_feature(::grin::VertexPropertyFeature* vertex_property_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); if (message_arena == nullptr) { - delete _impl_.vertex_property_feature_; + delete vertex_property_feature_; } if (vertex_property_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(vertex_property_feature); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(vertex_property_feature); if (message_arena != submessage_arena) { vertex_property_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, vertex_property_feature, submessage_arena); @@ -3683,27 +3591,27 @@ inline void PropertyFeature::set_allocated_vertex_property_feature(::grin::Verte } else { } - _impl_.vertex_property_feature_ = vertex_property_feature; + vertex_property_feature_ = vertex_property_feature; // @@protoc_insertion_point(field_set_allocated:grin.PropertyFeature.vertex_property_feature) } // .grin.EdgePropertyFeature edge_property_feature = 3; inline bool PropertyFeature::_internal_has_edge_property_feature() const { - return this != internal_default_instance() && _impl_.edge_property_feature_ != nullptr; + return this != internal_default_instance() && edge_property_feature_ != nullptr; } inline bool PropertyFeature::has_edge_property_feature() const { return _internal_has_edge_property_feature(); } inline void PropertyFeature::clear_edge_property_feature() { - if (GetArenaForAllocation() == nullptr && _impl_.edge_property_feature_ != nullptr) { - delete _impl_.edge_property_feature_; + if (GetArena() == nullptr && edge_property_feature_ != nullptr) { + delete edge_property_feature_; } - _impl_.edge_property_feature_ = nullptr; + edge_property_feature_ = nullptr; } inline const ::grin::EdgePropertyFeature& PropertyFeature::_internal_edge_property_feature() const { - const ::grin::EdgePropertyFeature* p = _impl_.edge_property_feature_; - return p != nullptr ? *p : reinterpret_cast( - ::grin::_EdgePropertyFeature_default_instance_); + const ::grin::EdgePropertyFeature* p = edge_property_feature_; + return p != nullptr ? *p : *reinterpret_cast( + &::grin::_EdgePropertyFeature_default_instance_); } inline const ::grin::EdgePropertyFeature& PropertyFeature::edge_property_feature() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.edge_property_feature) @@ -3711,10 +3619,10 @@ inline const ::grin::EdgePropertyFeature& PropertyFeature::edge_property_feature } inline void PropertyFeature::unsafe_arena_set_allocated_edge_property_feature( ::grin::EdgePropertyFeature* edge_property_feature) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.edge_property_feature_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(edge_property_feature_); } - _impl_.edge_property_feature_ = edge_property_feature; + edge_property_feature_ = edge_property_feature; if (edge_property_feature) { } else { @@ -3723,48 +3631,39 @@ inline void PropertyFeature::unsafe_arena_set_allocated_edge_property_feature( // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PropertyFeature.edge_property_feature) } inline ::grin::EdgePropertyFeature* PropertyFeature::release_edge_property_feature() { - - ::grin::EdgePropertyFeature* temp = _impl_.edge_property_feature_; - _impl_.edge_property_feature_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { + auto temp = unsafe_arena_release_edge_property_feature(); + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } inline ::grin::EdgePropertyFeature* PropertyFeature::unsafe_arena_release_edge_property_feature() { // @@protoc_insertion_point(field_release:grin.PropertyFeature.edge_property_feature) - ::grin::EdgePropertyFeature* temp = _impl_.edge_property_feature_; - _impl_.edge_property_feature_ = nullptr; + ::grin::EdgePropertyFeature* temp = edge_property_feature_; + edge_property_feature_ = nullptr; return temp; } inline ::grin::EdgePropertyFeature* PropertyFeature::_internal_mutable_edge_property_feature() { - if (_impl_.edge_property_feature_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::EdgePropertyFeature>(GetArenaForAllocation()); - _impl_.edge_property_feature_ = p; + if (edge_property_feature_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::EdgePropertyFeature>(GetArena()); + edge_property_feature_ = p; } - return _impl_.edge_property_feature_; + return edge_property_feature_; } inline ::grin::EdgePropertyFeature* PropertyFeature::mutable_edge_property_feature() { - ::grin::EdgePropertyFeature* _msg = _internal_mutable_edge_property_feature(); // @@protoc_insertion_point(field_mutable:grin.PropertyFeature.edge_property_feature) - return _msg; + return _internal_mutable_edge_property_feature(); } inline void PropertyFeature::set_allocated_edge_property_feature(::grin::EdgePropertyFeature* edge_property_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); if (message_arena == nullptr) { - delete _impl_.edge_property_feature_; + delete edge_property_feature_; } if (edge_property_feature) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(edge_property_feature); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(edge_property_feature); if (message_arena != submessage_arena) { edge_property_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, edge_property_feature, submessage_arena); @@ -3773,16 +3672,16 @@ inline void PropertyFeature::set_allocated_edge_property_feature(::grin::EdgePro } else { } - _impl_.edge_property_feature_ = edge_property_feature; + edge_property_feature_ = edge_property_feature; // @@protoc_insertion_point(field_set_allocated:grin.PropertyFeature.edge_property_feature) } // .grin.PropertyDataPartitionStrategy vertex_property = 4; inline void PropertyFeature::clear_vertex_property() { - _impl_.vertex_property_ = 0; + vertex_property_ = 0; } inline ::grin::PropertyDataPartitionStrategy PropertyFeature::_internal_vertex_property() const { - return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.vertex_property_); + return static_cast< ::grin::PropertyDataPartitionStrategy >(vertex_property_); } inline ::grin::PropertyDataPartitionStrategy PropertyFeature::vertex_property() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.vertex_property) @@ -3790,7 +3689,7 @@ inline ::grin::PropertyDataPartitionStrategy PropertyFeature::vertex_property() } inline void PropertyFeature::_internal_set_vertex_property(::grin::PropertyDataPartitionStrategy value) { - _impl_.vertex_property_ = value; + vertex_property_ = value; } inline void PropertyFeature::set_vertex_property(::grin::PropertyDataPartitionStrategy value) { _internal_set_vertex_property(value); @@ -3799,10 +3698,10 @@ inline void PropertyFeature::set_vertex_property(::grin::PropertyDataPartitionSt // .grin.PropertyDataPartitionStrategy edge_property = 5; inline void PropertyFeature::clear_edge_property() { - _impl_.edge_property_ = 0; + edge_property_ = 0; } inline ::grin::PropertyDataPartitionStrategy PropertyFeature::_internal_edge_property() const { - return static_cast< ::grin::PropertyDataPartitionStrategy >(_impl_.edge_property_); + return static_cast< ::grin::PropertyDataPartitionStrategy >(edge_property_); } inline ::grin::PropertyDataPartitionStrategy PropertyFeature::edge_property() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.edge_property) @@ -3810,7 +3709,7 @@ inline ::grin::PropertyDataPartitionStrategy PropertyFeature::edge_property() co } inline void PropertyFeature::_internal_set_edge_property(::grin::PropertyDataPartitionStrategy value) { - _impl_.edge_property_ = value; + edge_property_ = value; } inline void PropertyFeature::set_edge_property(::grin::PropertyDataPartitionStrategy value) { _internal_set_edge_property(value); @@ -3819,10 +3718,10 @@ inline void PropertyFeature::set_edge_property(::grin::PropertyDataPartitionStra // bool grin_assume_column_store_for_vertex_property = 6; inline void PropertyFeature::clear_grin_assume_column_store_for_vertex_property() { - _impl_.grin_assume_column_store_for_vertex_property_ = false; + grin_assume_column_store_for_vertex_property_ = false; } inline bool PropertyFeature::_internal_grin_assume_column_store_for_vertex_property() const { - return _impl_.grin_assume_column_store_for_vertex_property_; + return grin_assume_column_store_for_vertex_property_; } inline bool PropertyFeature::grin_assume_column_store_for_vertex_property() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_assume_column_store_for_vertex_property) @@ -3830,7 +3729,7 @@ inline bool PropertyFeature::grin_assume_column_store_for_vertex_property() cons } inline void PropertyFeature::_internal_set_grin_assume_column_store_for_vertex_property(bool value) { - _impl_.grin_assume_column_store_for_vertex_property_ = value; + grin_assume_column_store_for_vertex_property_ = value; } inline void PropertyFeature::set_grin_assume_column_store_for_vertex_property(bool value) { _internal_set_grin_assume_column_store_for_vertex_property(value); @@ -3839,10 +3738,10 @@ inline void PropertyFeature::set_grin_assume_column_store_for_vertex_property(bo // bool grin_assume_column_store_for_edge_property = 7; inline void PropertyFeature::clear_grin_assume_column_store_for_edge_property() { - _impl_.grin_assume_column_store_for_edge_property_ = false; + grin_assume_column_store_for_edge_property_ = false; } inline bool PropertyFeature::_internal_grin_assume_column_store_for_edge_property() const { - return _impl_.grin_assume_column_store_for_edge_property_; + return grin_assume_column_store_for_edge_property_; } inline bool PropertyFeature::grin_assume_column_store_for_edge_property() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_assume_column_store_for_edge_property) @@ -3850,7 +3749,7 @@ inline bool PropertyFeature::grin_assume_column_store_for_edge_property() const } inline void PropertyFeature::_internal_set_grin_assume_column_store_for_edge_property(bool value) { - _impl_.grin_assume_column_store_for_edge_property_ = value; + grin_assume_column_store_for_edge_property_ = value; } inline void PropertyFeature::set_grin_assume_column_store_for_edge_property(bool value) { _internal_set_grin_assume_column_store_for_edge_property(value); @@ -3859,10 +3758,10 @@ inline void PropertyFeature::set_grin_assume_column_store_for_edge_property(bool // bool grin_trait_select_type_for_vertex_list = 8; inline void PropertyFeature::clear_grin_trait_select_type_for_vertex_list() { - _impl_.grin_trait_select_type_for_vertex_list_ = false; + grin_trait_select_type_for_vertex_list_ = false; } inline bool PropertyFeature::_internal_grin_trait_select_type_for_vertex_list() const { - return _impl_.grin_trait_select_type_for_vertex_list_; + return grin_trait_select_type_for_vertex_list_; } inline bool PropertyFeature::grin_trait_select_type_for_vertex_list() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_type_for_vertex_list) @@ -3870,7 +3769,7 @@ inline bool PropertyFeature::grin_trait_select_type_for_vertex_list() const { } inline void PropertyFeature::_internal_set_grin_trait_select_type_for_vertex_list(bool value) { - _impl_.grin_trait_select_type_for_vertex_list_ = value; + grin_trait_select_type_for_vertex_list_ = value; } inline void PropertyFeature::set_grin_trait_select_type_for_vertex_list(bool value) { _internal_set_grin_trait_select_type_for_vertex_list(value); @@ -3879,10 +3778,10 @@ inline void PropertyFeature::set_grin_trait_select_type_for_vertex_list(bool val // bool grin_trait_select_type_for_edge_list = 9; inline void PropertyFeature::clear_grin_trait_select_type_for_edge_list() { - _impl_.grin_trait_select_type_for_edge_list_ = false; + grin_trait_select_type_for_edge_list_ = false; } inline bool PropertyFeature::_internal_grin_trait_select_type_for_edge_list() const { - return _impl_.grin_trait_select_type_for_edge_list_; + return grin_trait_select_type_for_edge_list_; } inline bool PropertyFeature::grin_trait_select_type_for_edge_list() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_type_for_edge_list) @@ -3890,7 +3789,7 @@ inline bool PropertyFeature::grin_trait_select_type_for_edge_list() const { } inline void PropertyFeature::_internal_set_grin_trait_select_type_for_edge_list(bool value) { - _impl_.grin_trait_select_type_for_edge_list_ = value; + grin_trait_select_type_for_edge_list_ = value; } inline void PropertyFeature::set_grin_trait_select_type_for_edge_list(bool value) { _internal_set_grin_trait_select_type_for_edge_list(value); @@ -3899,10 +3798,10 @@ inline void PropertyFeature::set_grin_trait_select_type_for_edge_list(bool value // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; inline void PropertyFeature::clear_grin_trait_select_neighbor_type_for_adjacent_list() { - _impl_.grin_trait_select_neighbor_type_for_adjacent_list_ = false; + grin_trait_select_neighbor_type_for_adjacent_list_ = false; } inline bool PropertyFeature::_internal_grin_trait_select_neighbor_type_for_adjacent_list() const { - return _impl_.grin_trait_select_neighbor_type_for_adjacent_list_; + return grin_trait_select_neighbor_type_for_adjacent_list_; } inline bool PropertyFeature::grin_trait_select_neighbor_type_for_adjacent_list() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_neighbor_type_for_adjacent_list) @@ -3910,7 +3809,7 @@ inline bool PropertyFeature::grin_trait_select_neighbor_type_for_adjacent_list() } inline void PropertyFeature::_internal_set_grin_trait_select_neighbor_type_for_adjacent_list(bool value) { - _impl_.grin_trait_select_neighbor_type_for_adjacent_list_ = value; + grin_trait_select_neighbor_type_for_adjacent_list_ = value; } inline void PropertyFeature::set_grin_trait_select_neighbor_type_for_adjacent_list(bool value) { _internal_set_grin_trait_select_neighbor_type_for_adjacent_list(value); @@ -3919,10 +3818,10 @@ inline void PropertyFeature::set_grin_trait_select_neighbor_type_for_adjacent_li // bool grin_trait_select_edge_type_for_adjacent_list = 11; inline void PropertyFeature::clear_grin_trait_select_edge_type_for_adjacent_list() { - _impl_.grin_trait_select_edge_type_for_adjacent_list_ = false; + grin_trait_select_edge_type_for_adjacent_list_ = false; } inline bool PropertyFeature::_internal_grin_trait_select_edge_type_for_adjacent_list() const { - return _impl_.grin_trait_select_edge_type_for_adjacent_list_; + return grin_trait_select_edge_type_for_adjacent_list_; } inline bool PropertyFeature::grin_trait_select_edge_type_for_adjacent_list() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_edge_type_for_adjacent_list) @@ -3930,7 +3829,7 @@ inline bool PropertyFeature::grin_trait_select_edge_type_for_adjacent_list() con } inline void PropertyFeature::_internal_set_grin_trait_select_edge_type_for_adjacent_list(bool value) { - _impl_.grin_trait_select_edge_type_for_adjacent_list_ = value; + grin_trait_select_edge_type_for_adjacent_list_ = value; } inline void PropertyFeature::set_grin_trait_select_edge_type_for_adjacent_list(bool value) { _internal_set_grin_trait_select_edge_type_for_adjacent_list(value); @@ -3939,10 +3838,10 @@ inline void PropertyFeature::set_grin_trait_select_edge_type_for_adjacent_list(b // bool grin_trait_specific_vev_relation = 12; inline void PropertyFeature::clear_grin_trait_specific_vev_relation() { - _impl_.grin_trait_specific_vev_relation_ = false; + grin_trait_specific_vev_relation_ = false; } inline bool PropertyFeature::_internal_grin_trait_specific_vev_relation() const { - return _impl_.grin_trait_specific_vev_relation_; + return grin_trait_specific_vev_relation_; } inline bool PropertyFeature::grin_trait_specific_vev_relation() const { // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_specific_vev_relation) @@ -3950,7 +3849,7 @@ inline bool PropertyFeature::grin_trait_specific_vev_relation() const { } inline void PropertyFeature::_internal_set_grin_trait_specific_vev_relation(bool value) { - _impl_.grin_trait_specific_vev_relation_ = value; + grin_trait_specific_vev_relation_ = value; } inline void PropertyFeature::set_grin_trait_specific_vev_relation(bool value) { _internal_set_grin_trait_specific_vev_relation(value); @@ -3963,10 +3862,10 @@ inline void PropertyFeature::set_grin_trait_specific_vev_relation(bool value) { // bool grin_with_vertex_label = 1; inline void IndexFeature::clear_grin_with_vertex_label() { - _impl_.grin_with_vertex_label_ = false; + grin_with_vertex_label_ = false; } inline bool IndexFeature::_internal_grin_with_vertex_label() const { - return _impl_.grin_with_vertex_label_; + return grin_with_vertex_label_; } inline bool IndexFeature::grin_with_vertex_label() const { // @@protoc_insertion_point(field_get:grin.IndexFeature.grin_with_vertex_label) @@ -3974,7 +3873,7 @@ inline bool IndexFeature::grin_with_vertex_label() const { } inline void IndexFeature::_internal_set_grin_with_vertex_label(bool value) { - _impl_.grin_with_vertex_label_ = value; + grin_with_vertex_label_ = value; } inline void IndexFeature::set_grin_with_vertex_label(bool value) { _internal_set_grin_with_vertex_label(value); @@ -3983,10 +3882,10 @@ inline void IndexFeature::set_grin_with_vertex_label(bool value) { // bool grin_with_edge_label = 2; inline void IndexFeature::clear_grin_with_edge_label() { - _impl_.grin_with_edge_label_ = false; + grin_with_edge_label_ = false; } inline bool IndexFeature::_internal_grin_with_edge_label() const { - return _impl_.grin_with_edge_label_; + return grin_with_edge_label_; } inline bool IndexFeature::grin_with_edge_label() const { // @@protoc_insertion_point(field_get:grin.IndexFeature.grin_with_edge_label) @@ -3994,7 +3893,7 @@ inline bool IndexFeature::grin_with_edge_label() const { } inline void IndexFeature::_internal_set_grin_with_edge_label(bool value) { - _impl_.grin_with_edge_label_ = value; + grin_with_edge_label_ = value; } inline void IndexFeature::set_grin_with_edge_label(bool value) { _internal_set_grin_with_edge_label(value); @@ -4003,10 +3902,10 @@ inline void IndexFeature::set_grin_with_edge_label(bool value) { // bool grin_assume_all_vertex_list_sorted = 3; inline void IndexFeature::clear_grin_assume_all_vertex_list_sorted() { - _impl_.grin_assume_all_vertex_list_sorted_ = false; + grin_assume_all_vertex_list_sorted_ = false; } inline bool IndexFeature::_internal_grin_assume_all_vertex_list_sorted() const { - return _impl_.grin_assume_all_vertex_list_sorted_; + return grin_assume_all_vertex_list_sorted_; } inline bool IndexFeature::grin_assume_all_vertex_list_sorted() const { // @@protoc_insertion_point(field_get:grin.IndexFeature.grin_assume_all_vertex_list_sorted) @@ -4014,7 +3913,7 @@ inline bool IndexFeature::grin_assume_all_vertex_list_sorted() const { } inline void IndexFeature::_internal_set_grin_assume_all_vertex_list_sorted(bool value) { - _impl_.grin_assume_all_vertex_list_sorted_ = value; + grin_assume_all_vertex_list_sorted_ = value; } inline void IndexFeature::set_grin_assume_all_vertex_list_sorted(bool value) { _internal_set_grin_assume_all_vertex_list_sorted(value); @@ -4037,12 +3936,12 @@ inline bool StorageFeature::has_topology_feature() const { return _internal_has_topology_feature(); } inline void StorageFeature::set_has_topology_feature() { - _impl_._oneof_case_[0] = kTopologyFeature; + _oneof_case_[0] = kTopologyFeature; } inline void StorageFeature::clear_topology_feature() { if (_internal_has_topology_feature()) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_feature_.topology_feature_; + if (GetArena() == nullptr) { + delete specific_feature_.topology_feature_; } clear_has_specific_feature(); } @@ -4051,11 +3950,11 @@ inline ::grin::TopologyFeature* StorageFeature::release_topology_feature() { // @@protoc_insertion_point(field_release:grin.StorageFeature.topology_feature) if (_internal_has_topology_feature()) { clear_has_specific_feature(); - ::grin::TopologyFeature* temp = _impl_.specific_feature_.topology_feature_; - if (GetArenaForAllocation() != nullptr) { + ::grin::TopologyFeature* temp = specific_feature_.topology_feature_; + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.specific_feature_.topology_feature_ = nullptr; + specific_feature_.topology_feature_ = nullptr; return temp; } else { return nullptr; @@ -4063,8 +3962,8 @@ inline ::grin::TopologyFeature* StorageFeature::release_topology_feature() { } inline const ::grin::TopologyFeature& StorageFeature::_internal_topology_feature() const { return _internal_has_topology_feature() - ? *_impl_.specific_feature_.topology_feature_ - : reinterpret_cast< ::grin::TopologyFeature&>(::grin::_TopologyFeature_default_instance_); + ? *specific_feature_.topology_feature_ + : *reinterpret_cast< ::grin::TopologyFeature*>(&::grin::_TopologyFeature_default_instance_); } inline const ::grin::TopologyFeature& StorageFeature::topology_feature() const { // @@protoc_insertion_point(field_get:grin.StorageFeature.topology_feature) @@ -4074,8 +3973,8 @@ inline ::grin::TopologyFeature* StorageFeature::unsafe_arena_release_topology_fe // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.topology_feature) if (_internal_has_topology_feature()) { clear_has_specific_feature(); - ::grin::TopologyFeature* temp = _impl_.specific_feature_.topology_feature_; - _impl_.specific_feature_.topology_feature_ = nullptr; + ::grin::TopologyFeature* temp = specific_feature_.topology_feature_; + specific_feature_.topology_feature_ = nullptr; return temp; } else { return nullptr; @@ -4085,7 +3984,7 @@ inline void StorageFeature::unsafe_arena_set_allocated_topology_feature(::grin:: clear_specific_feature(); if (topology_feature) { set_has_topology_feature(); - _impl_.specific_feature_.topology_feature_ = topology_feature; + specific_feature_.topology_feature_ = topology_feature; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.topology_feature) } @@ -4093,14 +3992,13 @@ inline ::grin::TopologyFeature* StorageFeature::_internal_mutable_topology_featu if (!_internal_has_topology_feature()) { clear_specific_feature(); set_has_topology_feature(); - _impl_.specific_feature_.topology_feature_ = CreateMaybeMessage< ::grin::TopologyFeature >(GetArenaForAllocation()); + specific_feature_.topology_feature_ = CreateMaybeMessage< ::grin::TopologyFeature >(GetArena()); } - return _impl_.specific_feature_.topology_feature_; + return specific_feature_.topology_feature_; } inline ::grin::TopologyFeature* StorageFeature::mutable_topology_feature() { - ::grin::TopologyFeature* _msg = _internal_mutable_topology_feature(); // @@protoc_insertion_point(field_mutable:grin.StorageFeature.topology_feature) - return _msg; + return _internal_mutable_topology_feature(); } // .grin.PartitionFeature partition_feature = 2; @@ -4111,12 +4009,12 @@ inline bool StorageFeature::has_partition_feature() const { return _internal_has_partition_feature(); } inline void StorageFeature::set_has_partition_feature() { - _impl_._oneof_case_[0] = kPartitionFeature; + _oneof_case_[0] = kPartitionFeature; } inline void StorageFeature::clear_partition_feature() { if (_internal_has_partition_feature()) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_feature_.partition_feature_; + if (GetArena() == nullptr) { + delete specific_feature_.partition_feature_; } clear_has_specific_feature(); } @@ -4125,11 +4023,11 @@ inline ::grin::PartitionFeature* StorageFeature::release_partition_feature() { // @@protoc_insertion_point(field_release:grin.StorageFeature.partition_feature) if (_internal_has_partition_feature()) { clear_has_specific_feature(); - ::grin::PartitionFeature* temp = _impl_.specific_feature_.partition_feature_; - if (GetArenaForAllocation() != nullptr) { + ::grin::PartitionFeature* temp = specific_feature_.partition_feature_; + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.specific_feature_.partition_feature_ = nullptr; + specific_feature_.partition_feature_ = nullptr; return temp; } else { return nullptr; @@ -4137,8 +4035,8 @@ inline ::grin::PartitionFeature* StorageFeature::release_partition_feature() { } inline const ::grin::PartitionFeature& StorageFeature::_internal_partition_feature() const { return _internal_has_partition_feature() - ? *_impl_.specific_feature_.partition_feature_ - : reinterpret_cast< ::grin::PartitionFeature&>(::grin::_PartitionFeature_default_instance_); + ? *specific_feature_.partition_feature_ + : *reinterpret_cast< ::grin::PartitionFeature*>(&::grin::_PartitionFeature_default_instance_); } inline const ::grin::PartitionFeature& StorageFeature::partition_feature() const { // @@protoc_insertion_point(field_get:grin.StorageFeature.partition_feature) @@ -4148,8 +4046,8 @@ inline ::grin::PartitionFeature* StorageFeature::unsafe_arena_release_partition_ // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.partition_feature) if (_internal_has_partition_feature()) { clear_has_specific_feature(); - ::grin::PartitionFeature* temp = _impl_.specific_feature_.partition_feature_; - _impl_.specific_feature_.partition_feature_ = nullptr; + ::grin::PartitionFeature* temp = specific_feature_.partition_feature_; + specific_feature_.partition_feature_ = nullptr; return temp; } else { return nullptr; @@ -4159,7 +4057,7 @@ inline void StorageFeature::unsafe_arena_set_allocated_partition_feature(::grin: clear_specific_feature(); if (partition_feature) { set_has_partition_feature(); - _impl_.specific_feature_.partition_feature_ = partition_feature; + specific_feature_.partition_feature_ = partition_feature; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.partition_feature) } @@ -4167,14 +4065,13 @@ inline ::grin::PartitionFeature* StorageFeature::_internal_mutable_partition_fea if (!_internal_has_partition_feature()) { clear_specific_feature(); set_has_partition_feature(); - _impl_.specific_feature_.partition_feature_ = CreateMaybeMessage< ::grin::PartitionFeature >(GetArenaForAllocation()); + specific_feature_.partition_feature_ = CreateMaybeMessage< ::grin::PartitionFeature >(GetArena()); } - return _impl_.specific_feature_.partition_feature_; + return specific_feature_.partition_feature_; } inline ::grin::PartitionFeature* StorageFeature::mutable_partition_feature() { - ::grin::PartitionFeature* _msg = _internal_mutable_partition_feature(); // @@protoc_insertion_point(field_mutable:grin.StorageFeature.partition_feature) - return _msg; + return _internal_mutable_partition_feature(); } // .grin.PropertyFeature property_feature = 3; @@ -4185,12 +4082,12 @@ inline bool StorageFeature::has_property_feature() const { return _internal_has_property_feature(); } inline void StorageFeature::set_has_property_feature() { - _impl_._oneof_case_[0] = kPropertyFeature; + _oneof_case_[0] = kPropertyFeature; } inline void StorageFeature::clear_property_feature() { if (_internal_has_property_feature()) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_feature_.property_feature_; + if (GetArena() == nullptr) { + delete specific_feature_.property_feature_; } clear_has_specific_feature(); } @@ -4199,11 +4096,11 @@ inline ::grin::PropertyFeature* StorageFeature::release_property_feature() { // @@protoc_insertion_point(field_release:grin.StorageFeature.property_feature) if (_internal_has_property_feature()) { clear_has_specific_feature(); - ::grin::PropertyFeature* temp = _impl_.specific_feature_.property_feature_; - if (GetArenaForAllocation() != nullptr) { + ::grin::PropertyFeature* temp = specific_feature_.property_feature_; + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.specific_feature_.property_feature_ = nullptr; + specific_feature_.property_feature_ = nullptr; return temp; } else { return nullptr; @@ -4211,8 +4108,8 @@ inline ::grin::PropertyFeature* StorageFeature::release_property_feature() { } inline const ::grin::PropertyFeature& StorageFeature::_internal_property_feature() const { return _internal_has_property_feature() - ? *_impl_.specific_feature_.property_feature_ - : reinterpret_cast< ::grin::PropertyFeature&>(::grin::_PropertyFeature_default_instance_); + ? *specific_feature_.property_feature_ + : *reinterpret_cast< ::grin::PropertyFeature*>(&::grin::_PropertyFeature_default_instance_); } inline const ::grin::PropertyFeature& StorageFeature::property_feature() const { // @@protoc_insertion_point(field_get:grin.StorageFeature.property_feature) @@ -4222,8 +4119,8 @@ inline ::grin::PropertyFeature* StorageFeature::unsafe_arena_release_property_fe // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.property_feature) if (_internal_has_property_feature()) { clear_has_specific_feature(); - ::grin::PropertyFeature* temp = _impl_.specific_feature_.property_feature_; - _impl_.specific_feature_.property_feature_ = nullptr; + ::grin::PropertyFeature* temp = specific_feature_.property_feature_; + specific_feature_.property_feature_ = nullptr; return temp; } else { return nullptr; @@ -4233,7 +4130,7 @@ inline void StorageFeature::unsafe_arena_set_allocated_property_feature(::grin:: clear_specific_feature(); if (property_feature) { set_has_property_feature(); - _impl_.specific_feature_.property_feature_ = property_feature; + specific_feature_.property_feature_ = property_feature; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.property_feature) } @@ -4241,14 +4138,13 @@ inline ::grin::PropertyFeature* StorageFeature::_internal_mutable_property_featu if (!_internal_has_property_feature()) { clear_specific_feature(); set_has_property_feature(); - _impl_.specific_feature_.property_feature_ = CreateMaybeMessage< ::grin::PropertyFeature >(GetArenaForAllocation()); + specific_feature_.property_feature_ = CreateMaybeMessage< ::grin::PropertyFeature >(GetArena()); } - return _impl_.specific_feature_.property_feature_; + return specific_feature_.property_feature_; } inline ::grin::PropertyFeature* StorageFeature::mutable_property_feature() { - ::grin::PropertyFeature* _msg = _internal_mutable_property_feature(); // @@protoc_insertion_point(field_mutable:grin.StorageFeature.property_feature) - return _msg; + return _internal_mutable_property_feature(); } // .grin.IndexFeature index_feature = 4; @@ -4259,12 +4155,12 @@ inline bool StorageFeature::has_index_feature() const { return _internal_has_index_feature(); } inline void StorageFeature::set_has_index_feature() { - _impl_._oneof_case_[0] = kIndexFeature; + _oneof_case_[0] = kIndexFeature; } inline void StorageFeature::clear_index_feature() { if (_internal_has_index_feature()) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_feature_.index_feature_; + if (GetArena() == nullptr) { + delete specific_feature_.index_feature_; } clear_has_specific_feature(); } @@ -4273,11 +4169,11 @@ inline ::grin::IndexFeature* StorageFeature::release_index_feature() { // @@protoc_insertion_point(field_release:grin.StorageFeature.index_feature) if (_internal_has_index_feature()) { clear_has_specific_feature(); - ::grin::IndexFeature* temp = _impl_.specific_feature_.index_feature_; - if (GetArenaForAllocation() != nullptr) { + ::grin::IndexFeature* temp = specific_feature_.index_feature_; + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.specific_feature_.index_feature_ = nullptr; + specific_feature_.index_feature_ = nullptr; return temp; } else { return nullptr; @@ -4285,8 +4181,8 @@ inline ::grin::IndexFeature* StorageFeature::release_index_feature() { } inline const ::grin::IndexFeature& StorageFeature::_internal_index_feature() const { return _internal_has_index_feature() - ? *_impl_.specific_feature_.index_feature_ - : reinterpret_cast< ::grin::IndexFeature&>(::grin::_IndexFeature_default_instance_); + ? *specific_feature_.index_feature_ + : *reinterpret_cast< ::grin::IndexFeature*>(&::grin::_IndexFeature_default_instance_); } inline const ::grin::IndexFeature& StorageFeature::index_feature() const { // @@protoc_insertion_point(field_get:grin.StorageFeature.index_feature) @@ -4296,8 +4192,8 @@ inline ::grin::IndexFeature* StorageFeature::unsafe_arena_release_index_feature( // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.index_feature) if (_internal_has_index_feature()) { clear_has_specific_feature(); - ::grin::IndexFeature* temp = _impl_.specific_feature_.index_feature_; - _impl_.specific_feature_.index_feature_ = nullptr; + ::grin::IndexFeature* temp = specific_feature_.index_feature_; + specific_feature_.index_feature_ = nullptr; return temp; } else { return nullptr; @@ -4307,7 +4203,7 @@ inline void StorageFeature::unsafe_arena_set_allocated_index_feature(::grin::Ind clear_specific_feature(); if (index_feature) { set_has_index_feature(); - _impl_.specific_feature_.index_feature_ = index_feature; + specific_feature_.index_feature_ = index_feature; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.index_feature) } @@ -4315,14 +4211,13 @@ inline ::grin::IndexFeature* StorageFeature::_internal_mutable_index_feature() { if (!_internal_has_index_feature()) { clear_specific_feature(); set_has_index_feature(); - _impl_.specific_feature_.index_feature_ = CreateMaybeMessage< ::grin::IndexFeature >(GetArenaForAllocation()); + specific_feature_.index_feature_ = CreateMaybeMessage< ::grin::IndexFeature >(GetArena()); } - return _impl_.specific_feature_.index_feature_; + return specific_feature_.index_feature_; } inline ::grin::IndexFeature* StorageFeature::mutable_index_feature() { - ::grin::IndexFeature* _msg = _internal_mutable_index_feature(); // @@protoc_insertion_point(field_mutable:grin.StorageFeature.index_feature) - return _msg; + return _internal_mutable_index_feature(); } // .grin.PredicateFeature predicate_feature = 5; @@ -4333,12 +4228,12 @@ inline bool StorageFeature::has_predicate_feature() const { return _internal_has_predicate_feature(); } inline void StorageFeature::set_has_predicate_feature() { - _impl_._oneof_case_[0] = kPredicateFeature; + _oneof_case_[0] = kPredicateFeature; } inline void StorageFeature::clear_predicate_feature() { if (_internal_has_predicate_feature()) { - if (GetArenaForAllocation() == nullptr) { - delete _impl_.specific_feature_.predicate_feature_; + if (GetArena() == nullptr) { + delete specific_feature_.predicate_feature_; } clear_has_specific_feature(); } @@ -4347,11 +4242,11 @@ inline ::grin::PredicateFeature* StorageFeature::release_predicate_feature() { // @@protoc_insertion_point(field_release:grin.StorageFeature.predicate_feature) if (_internal_has_predicate_feature()) { clear_has_specific_feature(); - ::grin::PredicateFeature* temp = _impl_.specific_feature_.predicate_feature_; - if (GetArenaForAllocation() != nullptr) { + ::grin::PredicateFeature* temp = specific_feature_.predicate_feature_; + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } - _impl_.specific_feature_.predicate_feature_ = nullptr; + specific_feature_.predicate_feature_ = nullptr; return temp; } else { return nullptr; @@ -4359,8 +4254,8 @@ inline ::grin::PredicateFeature* StorageFeature::release_predicate_feature() { } inline const ::grin::PredicateFeature& StorageFeature::_internal_predicate_feature() const { return _internal_has_predicate_feature() - ? *_impl_.specific_feature_.predicate_feature_ - : reinterpret_cast< ::grin::PredicateFeature&>(::grin::_PredicateFeature_default_instance_); + ? *specific_feature_.predicate_feature_ + : *reinterpret_cast< ::grin::PredicateFeature*>(&::grin::_PredicateFeature_default_instance_); } inline const ::grin::PredicateFeature& StorageFeature::predicate_feature() const { // @@protoc_insertion_point(field_get:grin.StorageFeature.predicate_feature) @@ -4370,8 +4265,8 @@ inline ::grin::PredicateFeature* StorageFeature::unsafe_arena_release_predicate_ // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.predicate_feature) if (_internal_has_predicate_feature()) { clear_has_specific_feature(); - ::grin::PredicateFeature* temp = _impl_.specific_feature_.predicate_feature_; - _impl_.specific_feature_.predicate_feature_ = nullptr; + ::grin::PredicateFeature* temp = specific_feature_.predicate_feature_; + specific_feature_.predicate_feature_ = nullptr; return temp; } else { return nullptr; @@ -4381,7 +4276,7 @@ inline void StorageFeature::unsafe_arena_set_allocated_predicate_feature(::grin: clear_specific_feature(); if (predicate_feature) { set_has_predicate_feature(); - _impl_.specific_feature_.predicate_feature_ = predicate_feature; + specific_feature_.predicate_feature_ = predicate_feature; } // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.predicate_feature) } @@ -4389,24 +4284,23 @@ inline ::grin::PredicateFeature* StorageFeature::_internal_mutable_predicate_fea if (!_internal_has_predicate_feature()) { clear_specific_feature(); set_has_predicate_feature(); - _impl_.specific_feature_.predicate_feature_ = CreateMaybeMessage< ::grin::PredicateFeature >(GetArenaForAllocation()); + specific_feature_.predicate_feature_ = CreateMaybeMessage< ::grin::PredicateFeature >(GetArena()); } - return _impl_.specific_feature_.predicate_feature_; + return specific_feature_.predicate_feature_; } inline ::grin::PredicateFeature* StorageFeature::mutable_predicate_feature() { - ::grin::PredicateFeature* _msg = _internal_mutable_predicate_feature(); // @@protoc_insertion_point(field_mutable:grin.StorageFeature.predicate_feature) - return _msg; + return _internal_mutable_predicate_feature(); } inline bool StorageFeature::has_specific_feature() const { return specific_feature_case() != SPECIFIC_FEATURE_NOT_SET; } inline void StorageFeature::clear_has_specific_feature() { - _impl_._oneof_case_[0] = SPECIFIC_FEATURE_NOT_SET; + _oneof_case_[0] = SPECIFIC_FEATURE_NOT_SET; } inline StorageFeature::SpecificFeatureCase StorageFeature::specific_feature_case() const { - return StorageFeature::SpecificFeatureCase(_impl_._oneof_case_[0]); + return StorageFeature::SpecificFeatureCase(_oneof_case_[0]); } // ------------------------------------------------------------------- @@ -4414,100 +4308,100 @@ inline StorageFeature::SpecificFeatureCase StorageFeature::specific_feature_case // int32 vertex_count = 1; inline void Statistics::clear_vertex_count() { - _impl_.vertex_count_ = 0; + vertex_count_ = 0; } -inline int32_t Statistics::_internal_vertex_count() const { - return _impl_.vertex_count_; +inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::_internal_vertex_count() const { + return vertex_count_; } -inline int32_t Statistics::vertex_count() const { +inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::vertex_count() const { // @@protoc_insertion_point(field_get:grin.Statistics.vertex_count) return _internal_vertex_count(); } -inline void Statistics::_internal_set_vertex_count(int32_t value) { +inline void Statistics::_internal_set_vertex_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - _impl_.vertex_count_ = value; + vertex_count_ = value; } -inline void Statistics::set_vertex_count(int32_t value) { +inline void Statistics::set_vertex_count(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_vertex_count(value); // @@protoc_insertion_point(field_set:grin.Statistics.vertex_count) } // int32 edge_count = 2; inline void Statistics::clear_edge_count() { - _impl_.edge_count_ = 0; + edge_count_ = 0; } -inline int32_t Statistics::_internal_edge_count() const { - return _impl_.edge_count_; +inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::_internal_edge_count() const { + return edge_count_; } -inline int32_t Statistics::edge_count() const { +inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::edge_count() const { // @@protoc_insertion_point(field_get:grin.Statistics.edge_count) return _internal_edge_count(); } -inline void Statistics::_internal_set_edge_count(int32_t value) { +inline void Statistics::_internal_set_edge_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - _impl_.edge_count_ = value; + edge_count_ = value; } -inline void Statistics::set_edge_count(int32_t value) { +inline void Statistics::set_edge_count(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_edge_count(value); // @@protoc_insertion_point(field_set:grin.Statistics.edge_count) } // int32 partition_count = 3; inline void Statistics::clear_partition_count() { - _impl_.partition_count_ = 0; + partition_count_ = 0; } -inline int32_t Statistics::_internal_partition_count() const { - return _impl_.partition_count_; +inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::_internal_partition_count() const { + return partition_count_; } -inline int32_t Statistics::partition_count() const { +inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::partition_count() const { // @@protoc_insertion_point(field_get:grin.Statistics.partition_count) return _internal_partition_count(); } -inline void Statistics::_internal_set_partition_count(int32_t value) { +inline void Statistics::_internal_set_partition_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - _impl_.partition_count_ = value; + partition_count_ = value; } -inline void Statistics::set_partition_count(int32_t value) { +inline void Statistics::set_partition_count(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_partition_count(value); // @@protoc_insertion_point(field_set:grin.Statistics.partition_count) } // int32 vertex_type_count = 4; inline void Statistics::clear_vertex_type_count() { - _impl_.vertex_type_count_ = 0; + vertex_type_count_ = 0; } -inline int32_t Statistics::_internal_vertex_type_count() const { - return _impl_.vertex_type_count_; +inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::_internal_vertex_type_count() const { + return vertex_type_count_; } -inline int32_t Statistics::vertex_type_count() const { +inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::vertex_type_count() const { // @@protoc_insertion_point(field_get:grin.Statistics.vertex_type_count) return _internal_vertex_type_count(); } -inline void Statistics::_internal_set_vertex_type_count(int32_t value) { +inline void Statistics::_internal_set_vertex_type_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - _impl_.vertex_type_count_ = value; + vertex_type_count_ = value; } -inline void Statistics::set_vertex_type_count(int32_t value) { +inline void Statistics::set_vertex_type_count(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_vertex_type_count(value); // @@protoc_insertion_point(field_set:grin.Statistics.vertex_type_count) } // int32 edge_type_count = 5; inline void Statistics::clear_edge_type_count() { - _impl_.edge_type_count_ = 0; + edge_type_count_ = 0; } -inline int32_t Statistics::_internal_edge_type_count() const { - return _impl_.edge_type_count_; +inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::_internal_edge_type_count() const { + return edge_type_count_; } -inline int32_t Statistics::edge_type_count() const { +inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::edge_type_count() const { // @@protoc_insertion_point(field_get:grin.Statistics.edge_type_count) return _internal_edge_type_count(); } -inline void Statistics::_internal_set_edge_type_count(int32_t value) { +inline void Statistics::_internal_set_edge_type_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - _impl_.edge_type_count_ = value; + edge_type_count_ = value; } -inline void Statistics::set_edge_type_count(int32_t value) { +inline void Statistics::set_edge_type_count(::PROTOBUF_NAMESPACE_ID::int32 value) { _internal_set_edge_type_count(value); // @@protoc_insertion_point(field_set:grin.Statistics.edge_type_count) } @@ -4518,38 +4412,54 @@ inline void Statistics::set_edge_type_count(int32_t value) { // string uri = 1; inline void Graph::clear_uri() { - _impl_.uri_.ClearToEmpty(); + uri_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline const std::string& Graph::uri() const { // @@protoc_insertion_point(field_get:grin.Graph.uri) return _internal_uri(); } -template -inline PROTOBUF_ALWAYS_INLINE -void Graph::set_uri(ArgT0&& arg0, ArgT... args) { - - _impl_.uri_.Set(static_cast(arg0), args..., GetArenaForAllocation()); +inline void Graph::set_uri(const std::string& value) { + _internal_set_uri(value); // @@protoc_insertion_point(field_set:grin.Graph.uri) } inline std::string* Graph::mutable_uri() { - std::string* _s = _internal_mutable_uri(); // @@protoc_insertion_point(field_mutable:grin.Graph.uri) - return _s; + return _internal_mutable_uri(); } inline const std::string& Graph::_internal_uri() const { - return _impl_.uri_.Get(); + return uri_.Get(); } inline void Graph::_internal_set_uri(const std::string& value) { - _impl_.uri_.Set(value, GetArenaForAllocation()); + uri_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void Graph::set_uri(std::string&& value) { + + uri_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:grin.Graph.uri) +} +inline void Graph::set_uri(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + uri_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:grin.Graph.uri) +} +inline void Graph::set_uri(const char* value, + size_t size) { + + uri_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:grin.Graph.uri) } inline std::string* Graph::_internal_mutable_uri() { - return _impl_.uri_.Mutable(GetArenaForAllocation()); + return uri_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* Graph::release_uri() { // @@protoc_insertion_point(field_release:grin.Graph.uri) - return _impl_.uri_.Release(); + return uri_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void Graph::set_allocated_uri(std::string* uri) { if (uri != nullptr) { @@ -4557,49 +4467,80 @@ inline void Graph::set_allocated_uri(std::string* uri) { } else { } - _impl_.uri_.SetAllocated(uri, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.uri_.IsDefault()) { - _impl_.uri_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + uri_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), uri, + GetArena()); // @@protoc_insertion_point(field_set_allocated:grin.Graph.uri) } +inline std::string* Graph::unsafe_arena_release_uri() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.Graph.uri) + GOOGLE_DCHECK(GetArena() != nullptr); + + return uri_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void Graph::unsafe_arena_set_allocated_uri( + std::string* uri) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (uri != nullptr) { + + } else { + + } + uri_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + uri, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.Graph.uri) +} // string grin_version = 2; inline void Graph::clear_grin_version() { - _impl_.grin_version_.ClearToEmpty(); + grin_version_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline const std::string& Graph::grin_version() const { // @@protoc_insertion_point(field_get:grin.Graph.grin_version) return _internal_grin_version(); } -template -inline PROTOBUF_ALWAYS_INLINE -void Graph::set_grin_version(ArgT0&& arg0, ArgT... args) { - - _impl_.grin_version_.Set(static_cast(arg0), args..., GetArenaForAllocation()); +inline void Graph::set_grin_version(const std::string& value) { + _internal_set_grin_version(value); // @@protoc_insertion_point(field_set:grin.Graph.grin_version) } inline std::string* Graph::mutable_grin_version() { - std::string* _s = _internal_mutable_grin_version(); // @@protoc_insertion_point(field_mutable:grin.Graph.grin_version) - return _s; + return _internal_mutable_grin_version(); } inline const std::string& Graph::_internal_grin_version() const { - return _impl_.grin_version_.Get(); + return grin_version_.Get(); } inline void Graph::_internal_set_grin_version(const std::string& value) { - _impl_.grin_version_.Set(value, GetArenaForAllocation()); + grin_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void Graph::set_grin_version(std::string&& value) { + + grin_version_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:grin.Graph.grin_version) +} +inline void Graph::set_grin_version(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + grin_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:grin.Graph.grin_version) +} +inline void Graph::set_grin_version(const char* value, + size_t size) { + + grin_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:grin.Graph.grin_version) } inline std::string* Graph::_internal_mutable_grin_version() { - return _impl_.grin_version_.Mutable(GetArenaForAllocation()); + return grin_version_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline std::string* Graph::release_grin_version() { // @@protoc_insertion_point(field_release:grin.Graph.grin_version) - return _impl_.grin_version_.Release(); + return grin_version_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); } inline void Graph::set_allocated_grin_version(std::string* grin_version) { if (grin_version != nullptr) { @@ -4607,72 +4548,86 @@ inline void Graph::set_allocated_grin_version(std::string* grin_version) { } else { } - _impl_.grin_version_.SetAllocated(grin_version, GetArenaForAllocation()); -#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING - if (_impl_.grin_version_.IsDefault()) { - _impl_.grin_version_.Set("", GetArenaForAllocation()); - } -#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING + grin_version_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), grin_version, + GetArena()); // @@protoc_insertion_point(field_set_allocated:grin.Graph.grin_version) } +inline std::string* Graph::unsafe_arena_release_grin_version() { + // @@protoc_insertion_point(field_unsafe_arena_release:grin.Graph.grin_version) + GOOGLE_DCHECK(GetArena() != nullptr); + + return grin_version_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void Graph::unsafe_arena_set_allocated_grin_version( + std::string* grin_version) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (grin_version != nullptr) { + + } else { + + } + grin_version_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + grin_version, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.Graph.grin_version) +} // repeated .grin.StorageFeature features = 3; inline int Graph::_internal_features_size() const { - return _impl_.features_.size(); + return features_.size(); } inline int Graph::features_size() const { return _internal_features_size(); } inline void Graph::clear_features() { - _impl_.features_.Clear(); + features_.Clear(); } inline ::grin::StorageFeature* Graph::mutable_features(int index) { // @@protoc_insertion_point(field_mutable:grin.Graph.features) - return _impl_.features_.Mutable(index); + return features_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature >* Graph::mutable_features() { // @@protoc_insertion_point(field_mutable_list:grin.Graph.features) - return &_impl_.features_; + return &features_; } inline const ::grin::StorageFeature& Graph::_internal_features(int index) const { - return _impl_.features_.Get(index); + return features_.Get(index); } inline const ::grin::StorageFeature& Graph::features(int index) const { // @@protoc_insertion_point(field_get:grin.Graph.features) return _internal_features(index); } inline ::grin::StorageFeature* Graph::_internal_add_features() { - return _impl_.features_.Add(); + return features_.Add(); } inline ::grin::StorageFeature* Graph::add_features() { - ::grin::StorageFeature* _add = _internal_add_features(); // @@protoc_insertion_point(field_add:grin.Graph.features) - return _add; + return _internal_add_features(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature >& Graph::features() const { // @@protoc_insertion_point(field_list:grin.Graph.features) - return _impl_.features_; + return features_; } // .grin.Statistics statistics = 4; inline bool Graph::_internal_has_statistics() const { - return this != internal_default_instance() && _impl_.statistics_ != nullptr; + return this != internal_default_instance() && statistics_ != nullptr; } inline bool Graph::has_statistics() const { return _internal_has_statistics(); } inline void Graph::clear_statistics() { - if (GetArenaForAllocation() == nullptr && _impl_.statistics_ != nullptr) { - delete _impl_.statistics_; + if (GetArena() == nullptr && statistics_ != nullptr) { + delete statistics_; } - _impl_.statistics_ = nullptr; + statistics_ = nullptr; } inline const ::grin::Statistics& Graph::_internal_statistics() const { - const ::grin::Statistics* p = _impl_.statistics_; - return p != nullptr ? *p : reinterpret_cast( - ::grin::_Statistics_default_instance_); + const ::grin::Statistics* p = statistics_; + return p != nullptr ? *p : *reinterpret_cast( + &::grin::_Statistics_default_instance_); } inline const ::grin::Statistics& Graph::statistics() const { // @@protoc_insertion_point(field_get:grin.Graph.statistics) @@ -4680,10 +4635,10 @@ inline const ::grin::Statistics& Graph::statistics() const { } inline void Graph::unsafe_arena_set_allocated_statistics( ::grin::Statistics* statistics) { - if (GetArenaForAllocation() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(_impl_.statistics_); + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(statistics_); } - _impl_.statistics_ = statistics; + statistics_ = statistics; if (statistics) { } else { @@ -4692,48 +4647,39 @@ inline void Graph::unsafe_arena_set_allocated_statistics( // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.Graph.statistics) } inline ::grin::Statistics* Graph::release_statistics() { - - ::grin::Statistics* temp = _impl_.statistics_; - _impl_.statistics_ = nullptr; -#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE - auto* old = reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(temp); - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - if (GetArenaForAllocation() == nullptr) { delete old; } -#else // PROTOBUF_FORCE_COPY_IN_RELEASE - if (GetArenaForAllocation() != nullptr) { + auto temp = unsafe_arena_release_statistics(); + if (GetArena() != nullptr) { temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); } -#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE return temp; } inline ::grin::Statistics* Graph::unsafe_arena_release_statistics() { // @@protoc_insertion_point(field_release:grin.Graph.statistics) - ::grin::Statistics* temp = _impl_.statistics_; - _impl_.statistics_ = nullptr; + ::grin::Statistics* temp = statistics_; + statistics_ = nullptr; return temp; } inline ::grin::Statistics* Graph::_internal_mutable_statistics() { - if (_impl_.statistics_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::Statistics>(GetArenaForAllocation()); - _impl_.statistics_ = p; + if (statistics_ == nullptr) { + auto* p = CreateMaybeMessage<::grin::Statistics>(GetArena()); + statistics_ = p; } - return _impl_.statistics_; + return statistics_; } inline ::grin::Statistics* Graph::mutable_statistics() { - ::grin::Statistics* _msg = _internal_mutable_statistics(); // @@protoc_insertion_point(field_mutable:grin.Graph.statistics) - return _msg; + return _internal_mutable_statistics(); } inline void Graph::set_allocated_statistics(::grin::Statistics* statistics) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation(); + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); if (message_arena == nullptr) { - delete _impl_.statistics_; + delete statistics_; } if (statistics) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(statistics); + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(statistics); if (message_arena != submessage_arena) { statistics = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, statistics, submessage_arena); @@ -4742,7 +4688,7 @@ inline void Graph::set_allocated_statistics(::grin::Statistics* statistics) { } else { } - _impl_.statistics_ = statistics; + statistics_ = statistics; // @@protoc_insertion_point(field_set_allocated:grin.Graph.statistics) } diff --git a/modules/graph/grin/src/proto/message.cc b/modules/graph/grin/src/proto/message.cc index 9e81faf46..86e316288 100644 --- a/modules/graph/grin/src/proto/message.cc +++ b/modules/graph/grin/src/proto/message.cc @@ -13,7 +13,9 @@ limitations under the License. #include #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/proto/message.h" +} #include "graph.pb.h" diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index f17cd8a1b..9d3ba610d 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -14,7 +14,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/topology/adjacentlist.h" +} #ifdef GRIN_ENABLE_ADJACENT_LIST GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_VERTEX v) { diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 2e79429ee..d7478865a 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -14,7 +14,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/topology/structure.h" +} GRIN_GRAPH grin_get_graph_from_storage(int argc, char** argv) { if (argc < 2) { diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index dfbb627ba..acd0aad7c 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -14,7 +14,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { #include "graph/grin/include/topology/vertexlist.h" +} #ifdef GRIN_ENABLE_VERTEX_LIST GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g) { diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index fc96edf51..5680d8594 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -21,6 +21,7 @@ limitations under the License. #include "client/client.h" #include "common/util/logging.h" +extern "C" { #include "graph/grin/predefine.h" #include "graph/grin/include/topology/structure.h" #include "graph/grin/include/topology/vertexlist.h" @@ -35,6 +36,7 @@ limitations under the License. #include "graph/grin/include/property/property.h" #include "graph/grin/include/property/propertytable.h" #include "graph/grin/include/proto/message.h" +} #include "graph/fragment/graph_schema.h" #include "graph/loader/arrow_fragment_loader.h" From 080d66212f55b75407eb048a3a60f2410a0090f9 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 24 Apr 2023 03:56:32 +0000 Subject: [PATCH 51/85] fix for c tests --- modules/basic/ds/arrow_utils.cc | 8 +- modules/graph/CMakeLists.txt | 2 + modules/graph/grin/.gitignore | 3 +- modules/graph/grin/c/test.c | 342 +++++++++++++++++- modules/graph/grin/c/test.sh | 2 + modules/graph/grin/include | 2 +- modules/graph/grin/rust/Cargo.toml | 4 +- modules/graph/grin/rust/grin_v6d.rs | 62 +++- modules/graph/grin/rust/parse.py | 19 +- modules/graph/grin/rust/v6d_all.h | 2 +- modules/graph/grin/src/partition/partition.cc | 1 + modules/graph/grin/src/property/property.cc | 4 +- .../graph/grin/src/property/propertytable.cc | 17 +- modules/graph/grin/src/property/topology.cc | 1 - modules/graph/grin/src/property/type.cc | 8 +- modules/graph/grin/src/topology/datatype.cc | 47 +++ modules/graph/grin/src/topology/structure.cc | 2 +- 17 files changed, 484 insertions(+), 42 deletions(-) create mode 100755 modules/graph/grin/c/test.sh create mode 100644 modules/graph/grin/src/topology/datatype.cc diff --git a/modules/basic/ds/arrow_utils.cc b/modules/basic/ds/arrow_utils.cc index 2a0dc865f..279a4651f 100644 --- a/modules/basic/ds/arrow_utils.cc +++ b/modules/basic/ds/arrow_utils.cc @@ -775,11 +775,11 @@ const void* get_arrow_array_data_element(std::shared_ptr const& ar return reinterpret_cast( std::dynamic_pointer_cast(array)->raw_values() + offset); } else if (array->type()->Equals(arrow::utf8())) { - return reinterpret_cast( - std::dynamic_pointer_cast(array).get() + offset); + return reinterpret_cast(new std::string( + std::dynamic_pointer_cast(array).get()->GetView(offset))); } else if (array->type()->Equals(arrow::large_utf8())) { - return reinterpret_cast( - std::dynamic_pointer_cast(array).get() + offset); + return reinterpret_cast(new std::string( + std::dynamic_pointer_cast(array).get()->GetView(offset))); } else if (array->type()->id() == arrow::Type::LIST) { return reinterpret_cast( std::dynamic_pointer_cast(array).get() + offset); diff --git a/modules/graph/CMakeLists.txt b/modules/graph/CMakeLists.txt index 528348ac6..6269c3226 100644 --- a/modules/graph/CMakeLists.txt +++ b/modules/graph/CMakeLists.txt @@ -181,6 +181,8 @@ endif() file(GLOB_RECURSE GRIN_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}" "grin/*.cc") add_library(vineyard_grin ${GRIN_SRC_FILES}) target_link_libraries(vineyard_grin PRIVATE vineyard_graph ${Protobuf_LIBRARIES}) +install_vineyard_target(vineyard_grin) + # grin test if(BUILD_VINEYARD_TESTS) diff --git a/modules/graph/grin/.gitignore b/modules/graph/grin/.gitignore index c116ba07d..3653286e7 100644 --- a/modules/graph/grin/.gitignore +++ b/modules/graph/grin/.gitignore @@ -1,2 +1,3 @@ /docs/_build/ -/docs/Doxyfile.bak \ No newline at end of file +/docs/Doxyfile.bak +/c/test \ No newline at end of file diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index e9234c581..1e2912381 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -1,7 +1,343 @@ -#include "include/partition/partition.h" +#include +#include "../include/topology/adjacentlist.h" +#include "../include/topology/datatype.h" +#include "../include/topology/edgelist.h" +#include "../include/topology/structure.h" +#include "../include/topology/vertexlist.h" +#include "../include/partition/partition.h" +#include "../include/partition/reference.h" +#include "../include/partition/topology.h" +#include "../include/property/partition.h" +#include "../include/property/primarykey.h" +#include "../include/property/property.h" +#include "../include/property/propertylist.h" +#include "../include/property/propertytable.h" +#include "../include/property/topology.h" +#include "../include/property/type.h" +#include "../include/index/label.h" +#include "../include/index/order.h" + +GRIN_GRAPH get_graph(int argc, char** argv) { +#ifdef GRIN_ENABLE_GRAPH_PARTITION + GRIN_PARTITIONED_GRAPH pg = grin_get_partitioned_graph_from_storage(argc-1, &(argv[1])); + GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); + GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); + GRIN_GRAPH g = grin_get_local_graph_from_partition(pg, partition); +#else + GRIN_GRAPH g = grin_get_graph_from_storage(argc-1, &(argv[1])); +#endif + return g; +} + +#ifdef GRIN_ENABLE_GRAPH_PARTITION +GRIN_PARTITIONED_GRAPH get_partitioend_graph(int argc, char** argv) { + GRIN_PARTITIONED_GRAPH pg = grin_get_partitioned_graph_from_storage(argc-1, &(argv[1])); + return pg; +} +#endif + +GRIN_VERTEX_TYPE get_one_vertex_type(GRIN_GRAPH g) { + GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); + GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, 0); + grin_destroy_vertex_type_list(g, vtl); + return vt; +} + +GRIN_EDGE_TYPE get_one_edge_type(GRIN_GRAPH g) { + GRIN_EDGE_TYPE_LIST etl = grin_get_edge_type_list(g); + GRIN_EDGE_TYPE et = grin_get_edge_type_from_list(g, etl, 0); + grin_destroy_edge_type_list(g, etl); + return et; +} + +void test_property_type(int argc, char** argv) { + printf("+++++++++++++++++++++ Test property/type +++++++++++++++++++++\n"); + + GRIN_GRAPH g = get_graph(argc, argv); + + printf("------------ Vertex Type ------------\n"); + GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); + size_t vtl_size = grin_get_vertex_type_list_size(g, vtl); + printf("vertex type list size: %zu\n", vtl_size); + + for (size_t i = 0; i < vtl_size; ++i) { + printf("------------ Iterate the %zu-th vertex type ------------\n", i); + GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, i); +#ifdef GRIN_WITH_VERTEX_TYPE_NAME + const char* vt_name = grin_get_vertex_type_name(g, vt); + printf("vertex type name: %s\n", vt_name); + GRIN_VERTEX_TYPE vt0 = grin_get_vertex_type_by_name(g, vt_name); + grin_destroy_name(g, vt_name); + if (!grin_equal_vertex_type(g, vt, vt0)) { + printf("vertex type name not match\n"); + } + grin_destroy_vertex_type(g, vt0); +#endif +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE + printf("vertex type id: %u\n", grin_get_vertex_type_id(g, vt)); + GRIN_VERTEX_TYPE vt1 = grin_get_vertex_type_from_id(g, grin_get_vertex_type_id(g, vt)); + if (!grin_equal_vertex_type(g, vt, vt1)) { + printf("vertex type id not match\n"); + } + grin_destroy_vertex_type(g, vt1); +#endif + } + grin_destroy_vertex_type_list(g, vtl); + + printf("------------ Create a vertex type list of one type \"person\" ------------\n"); + GRIN_VERTEX_TYPE_LIST vtl2 = grin_create_vertex_type_list(g); +#ifdef GRIN_WITH_VERTEX_TYPE_NAME + GRIN_VERTEX_TYPE vt2_w = grin_get_vertex_type_by_name(g, "knows"); + if (vt2_w == GRIN_NULL_VERTEX_TYPE) { + printf("(Correct) vertex type of knows does not exists\n"); + } + GRIN_VERTEX_TYPE vt2 = grin_get_vertex_type_by_name(g, "person"); + if (vt2 == GRIN_NULL_VERTEX_TYPE) { + printf("(Wrong) vertex type of person can not be found\n"); + } else { + const char* vt2_name = grin_get_vertex_type_name(g, vt2); + printf("vertex type name: %s\n", vt2_name); + grin_destroy_name(g, vt2_name); + } +#else + GRIN_VERTEX_TYPE vt2 = get_one_vertex_type(g); +#endif + grin_insert_vertex_type_to_list(g, vtl2, vt2); + size_t vtl2_size = grin_get_vertex_type_list_size(g, vtl2); + printf("created vertex type list size: %zu\n", vtl2_size); + GRIN_VERTEX_TYPE vt3 = grin_get_vertex_type_from_list(g, vtl2, 0); + if (!grin_equal_vertex_type(g, vt2, vt3)) { + printf("vertex type not match\n"); + } + grin_destroy_vertex_type(g, vt2); + grin_destroy_vertex_type(g, vt3); + grin_destroy_vertex_type_list(g, vtl2); + + // edge + printf("------------ Edge Type ------------\n"); + GRIN_EDGE_TYPE_LIST etl = grin_get_edge_type_list(g); + size_t etl_size = grin_get_edge_type_list_size(g, etl); + printf("edge type list size: %zu\n", etl_size); + + for (size_t i = 0; i < etl_size; ++i) { + printf("------------ Iterate the %zu-th edge type ------------\n", i); + GRIN_EDGE_TYPE et = grin_get_edge_type_from_list(g, etl, i); +#ifdef GRIN_WITH_EDGE_TYPE_NAME + const char* et_name = grin_get_edge_type_name(g, et); + printf("edge type name: %s\n", et_name); + GRIN_EDGE_TYPE et0 = grin_get_edge_type_by_name(g, et_name); + grin_destroy_name(g, et_name); + if (!grin_equal_edge_type(g, et, et0)) { + printf("edge type name not match\n"); + } + grin_destroy_edge_type(g, et0); +#endif +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE + printf("edge type id: %u\n", grin_get_edge_type_id(g, et)); + GRIN_EDGE_TYPE et1 = grin_get_edge_type_from_id(g, grin_get_edge_type_id(g, et)); + if (!grin_equal_edge_type(g, et, et1)) { + printf("edge type id not match\n"); + } + grin_destroy_edge_type(g, et1); +#endif + // relation + GRIN_VERTEX_TYPE_LIST src_vtl = grin_get_src_types_from_edge_type(g, et); + size_t src_vtl_size = grin_get_vertex_type_list_size(g, src_vtl); + printf("source vertex type list size: %zu\n", src_vtl_size); + + GRIN_VERTEX_TYPE_LIST dst_vtl = grin_get_dst_types_from_edge_type(g, et); + size_t dst_vtl_size = grin_get_vertex_type_list_size(g, dst_vtl); + printf("destination vertex type list size: %zu\n", dst_vtl_size); + + if (src_vtl_size != dst_vtl_size) { + printf("source and destination vertex type list size not match\n"); + } + for (size_t j = 0; j < src_vtl_size; ++j) { + GRIN_VERTEX_TYPE src_vt = grin_get_vertex_type_from_list(g, src_vtl, j); + GRIN_VERTEX_TYPE dst_vt = grin_get_vertex_type_from_list(g, dst_vtl, j); + const char* src_vt_name = grin_get_vertex_type_name(g, src_vt); + const char* dst_vt_name = grin_get_vertex_type_name(g, dst_vt); + const char* et_name = grin_get_edge_type_name(g, et); + printf("edge type name: %s-%s-%s\n", src_vt_name, et_name, dst_vt_name); + grin_destroy_name(g, src_vt_name); + grin_destroy_name(g, dst_vt_name); + grin_destroy_name(g, et_name); + grin_destroy_vertex_type(g, src_vt); + grin_destroy_vertex_type(g, dst_vt); + } + grin_destroy_vertex_type_list(g, src_vtl); + grin_destroy_vertex_type_list(g, dst_vtl); + } + grin_destroy_edge_type_list(g, etl); + + printf("------------ Create an edge type list of one type \"created\" ------------\n"); + GRIN_EDGE_TYPE_LIST etl2 = grin_create_edge_type_list(g); +#ifdef GRIN_WITH_EDGE_TYPE_NAME + GRIN_EDGE_TYPE et2_w = grin_get_edge_type_by_name(g, "person"); + if (et2_w == GRIN_NULL_EDGE_TYPE) { + printf("(Correct) edge type of person does not exists\n"); + } + GRIN_EDGE_TYPE et2 = grin_get_edge_type_by_name(g, "created"); + if (et2 == GRIN_NULL_EDGE_TYPE) { + printf("(Wrong) edge type of created can not be found\n"); + } else { + const char* et2_name = grin_get_edge_type_name(g, et2); + printf("edge type name: %s\n", et2_name); + grin_destroy_name(g, et2_name); + } +#else + GRIN_EDGE_TYPE et2 = get_one_edge_type(g); +#endif + grin_insert_edge_type_to_list(g, etl2, et2); + size_t etl2_size = grin_get_edge_type_list_size(g, etl2); + printf("created edge type list size: %zu\n", etl2_size); + GRIN_EDGE_TYPE et3 = grin_get_edge_type_from_list(g, etl2, 0); + if (!grin_equal_edge_type(g, et2, et3)) { + printf("edge type not match\n"); + } + grin_destroy_edge_type(g, et2); + grin_destroy_edge_type(g, et3); + grin_destroy_edge_type_list(g, etl2); + + grin_destroy_graph(g); +} + + +void test_property_topology(int argc, char** argv) { + printf("+++++++++++++++++++++ Test property/topology +++++++++++++++++++++\n"); + GRIN_GRAPH g = get_graph(argc, argv); + GRIN_VERTEX_TYPE vt = get_one_vertex_type(g); + GRIN_EDGE_TYPE et = get_one_edge_type(g); + const char* vt_name = grin_get_vertex_type_name(g, vt); + const char* et_name = grin_get_edge_type_name(g, et); + +#ifdef GRIN_ENABLE_GRAPH_PARTITION + GRIN_PARTITIONED_GRAPH pg = get_partitioend_graph(argc, argv); + size_t tvnum = grin_get_total_vertex_num_by_type(pg, vt); + printf("total vertex num of %s: %zu\n", vt_name, tvnum); + size_t tenum = grin_get_total_edge_num_by_type(pg, et); + printf("total edge num of %s: %zu\n", et_name, tenum); + grin_destroy_partitioned_graph(pg); +#endif + +#ifdef GRIN_ENABLE_VERTEX_LIST + GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); + size_t vl_size = grin_get_vertex_list_size(g, vl); + printf("vertex list size: %zu\n", vl_size); + + GRIN_VERTEX_LIST typed_vl = grin_select_type_for_vertex_list(g, vt, vl); + size_t typed_vl_size = grin_get_vertex_list_size(g, typed_vl); + size_t typed_vnum = grin_get_vertex_num_by_type(g, vt); + printf("vertex number under type: %zu %zu\n", typed_vl_size, typed_vnum); + + for (size_t j = 0; j < typed_vl_size; ++j) { + GRIN_VERTEX v = grin_get_vertex_from_list(g, typed_vl, j); + GRIN_VERTEX_TYPE v_type = grin_get_vertex_type(g, v); + if (!grin_equal_vertex_type(g, v_type, vt)) { + printf("vertex type not match\n"); + } + grin_destroy_vertex_type(g, v_type); + grin_destroy_vertex(g, v); + } + grin_destroy_vertex_list(g, typed_vl); + grin_destroy_vertex_list(g, vl); +#endif + +#ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID + GRIN_DATATYPE dt = grin_get_vertex_original_id_type(g); + if (dt == Int64) { + long int v0id = 4; + GRIN_VERTEX v0 = grin_get_vertex_from_original_id_by_type(g, vt, &v0id); + if (v0 == GRIN_NULL_VERTEX) { + printf("(Wrong) vertex of id %ld can not be found\n", v0id); + } else { + printf("vertex of original id %ld found\n", v0id); + GRIN_VERTEX_ORIGINAL_ID oid0 = grin_get_vertex_original_id(g, v0); + printf("get vertex original id: %ld\n", *((long int*)oid0)); + grin_destroy_vertex_original_id(g, oid0); + } + grin_destroy_vertex(g, v0); + } +#endif + +#ifdef GRIN_ENABLE_EDGE_LIST + GRIN_EDGE_LIST el = grin_get_edge_list(g); + size_t el_size = grin_get_edge_list_size(g, el); + printf("edge list size: %zu\n", el_size); + + GRIN_EDGE_LIST typed_el = grin_select_type_for_edge_list(g, et, el); + size_t typed_el_size = grin_get_edge_list_size(g, typed_el); + size_t typed_enum = grin_get_edge_num_by_type(g, et); + printf("edge number under type: %zu %zu\n", typed_el_size, typed_enum); + + for (size_t j = 0; j < typed_el_size; ++j) { + GRIN_EDGE e = grin_get_edge_from_list(g, typed_el, j); + GRIN_EDGE_TYPE e_type = grin_get_edge_type(g, e); + if (!grin_equal_edge_type(g, e_type, et)) { + printf("edge type not match\n"); + } + grin_destroy_edge_type(g, e_type); + grin_destroy_edge(g, e); + } + grin_destroy_edge_list(g, typed_el); + grin_destroy_edge_list(g, el); +#endif + + grin_destroy_name(g, vt_name); + grin_destroy_name(g, et_name); + grin_destroy_vertex_type(g, vt); + grin_destroy_edge_type(g, et); + grin_destroy_graph(g); +} + +void test_property_table(int argc, char** argv) { + printf("+++++++++++++++++++++ Test property/table +++++++++++++++++++++\n"); + GRIN_GRAPH g = get_graph(argc, argv); + GRIN_VERTEX_TYPE vt = get_one_vertex_type(g); + GRIN_EDGE_TYPE et = get_one_edge_type(g); + + printf("------------ Vertex property table ------------\n"); + GRIN_VERTEX_PROPERTY_LIST vpl = grin_get_vertex_property_list_by_type(g, vt); + GRIN_VERTEX_PROPERTY_TABLE vpt = grin_get_vertex_property_table_by_type(g, vt); + + GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); + GRIN_VERTEX_LIST typed_vl = grin_select_type_for_vertex_list(g, vt, vl); + size_t typed_vl_size = grin_get_vertex_list_size(g, typed_vl); + size_t vpl_size = grin_get_vertex_property_list_size(g, vpl); + printf("vertex list size: %zu vertex property list size: %zu\n", typed_vl_size, vpl_size); + + for (size_t i = 0; i < typed_vl_size; ++i) { + GRIN_VERTEX v = grin_get_vertex_from_list(g, typed_vl, i); + GRIN_ROW row = grin_get_row_from_vertex_property_table(g, vpt, v, vpl); + for (size_t j = 0; j < vpl_size; ++j) { + GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, j); + GRIN_DATATYPE dt = grin_get_vertex_property_data_type(g, vp); + const void* pv = grin_get_value_from_vertex_property_table(g, vpt, v, vp); + const void* rv = grin_get_value_from_row(g, row, dt, j); + if (dt == Int64) { + printf("v%zu p%zu value: %ld %ld\n", i, j, *((long int*)pv), *((long int*)rv)); + } else if (dt == String) { + printf("v%zu p%zu value: %s %s\n", i, j, (char*)pv, (char*)rv); + } + grin_destroy_value(g, dt, pv); + grin_destroy_value(g, dt, rv); + grin_destroy_vertex_property(g, vp); + } + grin_destroy_row(g, row); + grin_destroy_vertex(g, v); + } + + grin_destroy_vertex_list(g, typed_vl); + grin_destroy_vertex_list(g, vl); + grin_destroy_vertex_property_list(g, vpl); + grin_destroy_vertex_property_table(g, vpt); +} + + int main(int argc, char** argv) { - const char *a[] = {"/home/graphscope/gie-grin/temp/vineyard.sock", "130724717286376948"}; - void* h = grin_get_partitioned_graph_from_storage(2, (char**)a); + test_property_type(argc, argv); + test_property_topology(argc, argv); + test_property_table(argc, argv); return 0; } \ No newline at end of file diff --git a/modules/graph/grin/c/test.sh b/modules/graph/grin/c/test.sh new file mode 100755 index 000000000..0a0b5c9b6 --- /dev/null +++ b/modules/graph/grin/c/test.sh @@ -0,0 +1,2 @@ +gcc test.c -I. -L/home/graphscope/gie-grin/v6d/build/shared-lib/ -lvineyard_grin -lvineyard_graph -lvineyard_basic -o test +./test /home/graphscope/gie-grin/temp/vineyard.sock 130878194502466848 \ No newline at end of file diff --git a/modules/graph/grin/include b/modules/graph/grin/include index c400929fe..d8cda7ff9 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit c400929febf48914f07da2cae1105d551cfa7a46 +Subproject commit d8cda7ff97cf1ed4dfb172699833800879091d1d diff --git a/modules/graph/grin/rust/Cargo.toml b/modules/graph/grin/rust/Cargo.toml index 7d8d32f5a..8f0b55a71 100644 --- a/modules/graph/grin/rust/Cargo.toml +++ b/modules/graph/grin/rust/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["dijie"] [features] -default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_with_vertex_original_id", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_property_table", "grin_trait_natural_id_for_vertex_property", "grin_assume_by_type_vertex_original_id", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_enable_edge_property_table", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_column_store_for_vertex_property", "grin_assume_column_store_for_edge_property", "grin_assume_all_vertex_list_sorted"] +default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_with_vertex_original_id", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_property_table", "grin_enable_vertex_primary_keys", "grin_trait_natural_id_for_vertex_property", "grin_assume_by_type_vertex_original_id", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_enable_edge_property_table", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_column_store_for_vertex_property", "grin_assume_column_store_for_edge_property", "grin_assume_all_vertex_list_sorted"] grin_assume_has_directed_graph = [] grin_assume_has_undirected_graph = [] grin_assume_has_multi_edge_graph = [] @@ -26,6 +26,8 @@ grin_enable_vertex_ref = [] grin_enable_edge_ref = [] grin_assume_all_replicate_partition = ["grin_assume_replicate_master_mirror_partition_for_vertex_data", "grin_assume_replicate_master_mirror_partition_for_edge_data", "grin_assume_replicate_master_mirror_partition_for_vertex_property", "grin_assume_replicate_master_mirror_partition_for_edge_property"] grin_assume_edge_cut_partition = ["grin_assume_master_only_partition_for_vertex_data", "grin_assume_replicate_master_mirror_partition_for_edge_data", "grin_assume_master_only_partition_for_vertex_property", "grin_assume_replicate_master_mirror_partition_for_edge_property"] +grin_assume_edge_cut_follow_src_partition = ["grin_assume_master_only_partition_for_vertex_data", "grin_assume_master_only_partition_for_edge_data", "grin_assume_master_only_partition_for_vertex_property", "grin_assume_master_only_partition_for_edge_property"] +grin_assume_edge_cut_follow_dst_partition = ["grin_assume_master_only_partition_for_vertex_data", "grin_assume_master_only_partition_for_edge_data", "grin_assume_master_only_partition_for_vertex_property", "grin_assume_master_only_partition_for_edge_property"] grin_assume_vertex_cut_partition = ["grin_assume_replicate_master_mirror_partition_for_vertex_data", "grin_assume_replicate_master_mirror_partition_for_edge_data", "grin_trait_master_vertex_mirror_partition_list", "grin_assume_replicate_master_mirror_partition_for_vertex_property", "grin_assume_replicate_master_mirror_partition_for_edge_property"] grin_assume_master_only_partition_for_vertex_data = [] grin_assume_replicate_master_mirror_partition_for_vertex_data = [] diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index eeeb3bbd5..f71aec001 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -5,7 +5,7 @@ pub const GRIN_DIRECTION_OUT: GrinDirection = 1; #[doc = "< incoming & outgoing"] pub const GRIN_DIRECTION_BOTH: GrinDirection = 2; #[doc = " Enumerates the directions of edges with respect to a certain vertex"] -pub type GrinDirection = ::std::os::raw::c_uint; +pub type GrinDirection = u32; #[doc = "< other unknown types"] pub const GRIN_DATATYPE_UNDEFINED: GrinDatatype = 0; #[doc = "< int"] @@ -27,7 +27,7 @@ pub const GRIN_DATATYPE_DATE32: GrinDatatype = 8; #[doc = "< long date"] pub const GRIN_DATATYPE_DATE64: GrinDatatype = 9; #[doc = " Enumerates the datatype supported in the storage"] -pub type GrinDatatype = ::std::os::raw::c_uint; +pub type GrinDatatype = u32; #[doc = "@}"] pub type GrinGraph = *mut ::std::os::raw::c_void; pub type GrinVertex = *mut ::std::os::raw::c_void; @@ -40,15 +40,15 @@ pub type GrinAdjacentListIterator = *mut ::std::os::raw::c_void; pub type GrinPartitionedGraph = *mut ::std::os::raw::c_void; pub type GrinPartition = *mut ::std::os::raw::c_void; pub type GrinPartitionList = *mut ::std::os::raw::c_void; -pub type GrinPartitionId = ::std::os::raw::c_uint; +pub type GrinPartitionId = u32; pub type GrinVertexRef = *mut ::std::os::raw::c_void; pub type GrinVertexType = *mut ::std::os::raw::c_void; pub type GrinVertexTypeList = *mut ::std::os::raw::c_void; pub type GrinVertexProperty = *mut ::std::os::raw::c_void; pub type GrinVertexPropertyList = *mut ::std::os::raw::c_void; pub type GrinVertexPropertyTable = *mut ::std::os::raw::c_void; -pub type GrinVertexTypeId = ::std::os::raw::c_uint; -pub type GrinVertexPropertyId = ::std::os::raw::c_uint; +pub type GrinVertexTypeId = u32; +pub type GrinVertexPropertyId = u32; pub type GrinEdgeType = *mut ::std::os::raw::c_void; pub type GrinEdgeTypeList = *mut ::std::os::raw::c_void; pub type GrinVevType = *mut ::std::os::raw::c_void; @@ -56,8 +56,8 @@ pub type GrinVevTypeList = *mut ::std::os::raw::c_void; pub type GrinEdgeProperty = *mut ::std::os::raw::c_void; pub type GrinEdgePropertyList = *mut ::std::os::raw::c_void; pub type GrinEdgePropertyTable = *mut ::std::os::raw::c_void; -pub type GrinEdgeTypeId = ::std::os::raw::c_uint; -pub type GrinEdgePropertyId = ::std::os::raw::c_uint; +pub type GrinEdgeTypeId = u32; +pub type GrinEdgePropertyId = u32; pub type GrinRow = *mut ::std::os::raw::c_void; extern "C" { #[cfg(feature = "grin_enable_adjacent_list")] @@ -114,13 +114,25 @@ extern "C" { arg2: GrinAdjacentListIterator, ) -> GrinEdge; - #[cfg(all(feature = "grin_assume_has_directed_graph", feature = "grin_assume_has_undirected_graph"))] + pub fn grin_get_int32(arg1: *mut ::std::os::raw::c_void) -> i32; + + pub fn grin_get_uint32(arg1: *mut ::std::os::raw::c_void) -> u32; + + pub fn grin_get_int64(arg1: *mut ::std::os::raw::c_void) -> i64; + + pub fn grin_get_uint64(arg1: *mut ::std::os::raw::c_void) -> u64; + + pub fn grin_get_float(arg1: *mut ::std::os::raw::c_void) -> f32; + + pub fn grin_get_double(arg1: *mut ::std::os::raw::c_void) -> f64; + + pub fn grin_get_string(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char; + pub fn grin_get_graph_from_storage( - arg1: ::std::os::raw::c_int, + arg1: i32, arg2: *mut *mut ::std::os::raw::c_char, ) -> GrinGraph; - #[cfg(all(feature = "grin_assume_has_directed_graph", feature = "grin_assume_has_undirected_graph"))] pub fn grin_destroy_graph(arg1: GrinGraph); #[cfg(all(feature = "grin_assume_has_directed_graph", feature = "grin_assume_has_undirected_graph"))] @@ -129,16 +141,12 @@ extern "C" { #[cfg(feature = "grin_assume_has_multi_edge_graph")] pub fn grin_is_multigraph(arg1: GrinGraph) -> bool; - #[cfg(feature = "grin_with_vertex_original_id")] pub fn grin_get_vertex_num(arg1: GrinGraph) -> usize; - #[cfg(feature = "grin_with_vertex_original_id")] pub fn grin_get_edge_num(arg1: GrinGraph) -> usize; - #[cfg(feature = "grin_with_vertex_original_id")] pub fn grin_destroy_vertex(arg1: GrinGraph, arg2: GrinVertex); - #[cfg(feature = "grin_with_vertex_original_id")] pub fn grin_equal_vertex(arg1: GrinGraph, arg2: GrinVertex, arg3: GrinVertex) -> bool; #[cfg(feature = "grin_with_vertex_original_id")] @@ -153,23 +161,18 @@ extern "C" { arg2: GrinVertex, ) -> GrinVertexOriginalId; - #[cfg(feature = "grin_with_vertex_data")] pub fn grin_destroy_value( arg1: GrinGraph, arg2: GrinDatatype, arg3: *const ::std::os::raw::c_void, ); - #[cfg(feature = "grin_with_vertex_data")] pub fn grin_destroy_name(arg1: GrinGraph, arg2: *const ::std::os::raw::c_char); - #[cfg(feature = "grin_with_edge_data")] pub fn grin_destroy_edge(arg1: GrinGraph, arg2: GrinEdge); - #[cfg(feature = "grin_with_edge_data")] pub fn grin_get_edge_src(arg1: GrinGraph, arg2: GrinEdge) -> GrinVertex; - #[cfg(feature = "grin_with_edge_data")] pub fn grin_get_edge_dst(arg1: GrinGraph, arg2: GrinEdge) -> GrinVertex; #[cfg(feature = "grin_enable_vertex_list")] @@ -211,7 +214,7 @@ extern "C" { #[cfg(feature = "grin_enable_graph_partition")] pub fn grin_get_partitioned_graph_from_storage( - arg1: ::std::os::raw::c_int, + arg1: i32, arg2: *mut *mut ::std::os::raw::c_char, ) -> GrinPartitionedGraph; @@ -343,6 +346,25 @@ extern "C" { arg2: GrinVertexList, ) -> GrinVertexList; + #[doc = " @brief get the vertex types with primary keys\n @param GrinGraph the graph"] + #[cfg(feature = "grin_enable_vertex_primary_keys")] + pub fn grin_get_vertex_types_with_primary_keys(arg1: GrinGraph) -> GrinVertexTypeList; + + #[doc = " @brief get the primary keys (property list) of a specific vertex type\n @param GrinGraph the graph\n @param GrinVertexType the vertex type"] + #[cfg(feature = "grin_enable_vertex_primary_keys")] + pub fn grin_get_primary_keys_by_vertex_type( + arg1: GrinGraph, + arg2: GrinVertexType, + ) -> GrinVertexPropertyList; + + #[doc = " @brief get the vertex with the given primary keys\n @param GrinGraph the graph\n @param GrinVertexType the vertex type which determines the property list for primary keys\n @param GrinRow the values of primary keys"] + #[cfg(feature = "grin_enable_vertex_primary_keys")] + pub fn grin_get_vertex_by_primary_keys( + arg1: GrinGraph, + arg2: GrinVertexType, + arg3: GrinRow, + ) -> GrinVertex; + #[doc = " @brief get the vertex property name\n @param GrinGraph the graph\n @param GrinVertexProperty the vertex property"] #[cfg(feature = "grin_with_vertex_property_name")] pub fn grin_get_vertex_property_name( diff --git a/modules/graph/grin/rust/parse.py b/modules/graph/grin/rust/parse.py index 4316eed68..13c7fa4ad 100644 --- a/modules/graph/grin/rust/parse.py +++ b/modules/graph/grin/rust/parse.py @@ -44,7 +44,7 @@ def parse(path): prefix = '' if line.startswith(('GRIN_', 'void', 'bool', 'size_t', 'const')): func_name = get_func_name(line) - res[func_name] = macros + res[func_name] = macros.copy() elif line.startswith('#ifdef'): assert(len(macros) == 0) macro_name = get_macro_name(line) @@ -60,6 +60,8 @@ def parse(path): return res def to_rust(deps): + if len(deps) == 0: + return '' assert(len(deps) == 1) one_foramt = '#[cfg(feature = \"{}\")]' yes_format = 'feature = \"{}\"' @@ -90,8 +92,18 @@ def snake_to_camel_line(line): segs = line.split(' ') return ' '.join([snake_to_camel(s) if s.startswith('GRIN_') else s for s in segs]) +def static_replace(line): + replaces = { + '::std::os::raw::c_uint': 'u32', + '::std::os::raw::c_int': 'i32', + '::std::os::raw::c_ulong': 'u64', + '::std::os::raw::c_long': 'i64', + } + for k in replaces: + line = line.replace(k, replaces[k]) + return line -def rewrite(file, r, strip=7): +def rewrite(file, r, strip=49): with open(file) as f: lines = f.readlines() externc_flag = True @@ -100,6 +112,7 @@ def rewrite(file, r, strip=7): if i < strip: continue line = snake_to_camel_line(line) + line = static_replace(line) if line.startswith('extern '): if externc_flag: f.write('extern "C" {\n') @@ -115,7 +128,7 @@ def rewrite(file, r, strip=7): func_name = line func_name = func_name[func_name.find('pub fn')+7:] func_name = func_name.split('(')[0] - if func_name in r: + if func_name in r and r[func_name]: f.write(f' {r[func_name]}\n') f.write(line) diff --git a/modules/graph/grin/rust/v6d_all.h b/modules/graph/grin/rust/v6d_all.h index 45abd6244..2161c5e85 100644 --- a/modules/graph/grin/rust/v6d_all.h +++ b/modules/graph/grin/rust/v6d_all.h @@ -1,5 +1,5 @@ -# #include "../include/topology/adjacentlist.h" +#include "../include/topology/datatype.h" #include "../include/topology/edgelist.h" #include "../include/topology/structure.h" #include "../include/topology/vertexlist.h" diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index 71062ace5..c530f7105 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -35,6 +35,7 @@ GRIN_PARTITIONED_GRAPH grin_get_partitioned_graph_from_storage(int argc, char** for (auto & [fid, location] : pg->pg->FragmentLocations()) { if (location == pg->client.instance_id()) { auto obj_id = pg->pg->Fragments().at(fid); +// std::cout << fid << ": " << obj_id << std::endl; auto frag = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(pg->client.GetObject(obj_id)); pg->lgs[fid] = frag; } diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index e846b3f0e..2bb163bde 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -31,7 +31,9 @@ GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_ auto _g = static_cast(g)->g; auto _vtype = static_cast(vtype); auto s = std::string(name); - auto vp = new GRIN_VERTEX_PROPERTY_T(*_vtype, _g->schema().GetVertexPropertyId(*_vtype, s)); + auto _id = _g->schema().GetVertexPropertyId(*_vtype, s); + if (_id < 0) return GRIN_NULL_VERTEX_PROPERTY; + auto vp = new GRIN_VERTEX_PROPERTY_T(*_vtype, _id); return vp; } diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 6e166b754..54de52ae8 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -36,8 +36,13 @@ const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, return new float(*static_cast((*_r)[idx])); case GRIN_DATATYPE::Double: return new double(*static_cast((*_r)[idx])); - case GRIN_DATATYPE::String: - return new std::string(*static_cast((*_r)[idx])); + case GRIN_DATATYPE::String: { + auto s = static_cast((*_r)[idx]); + int len = s->length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s->c_str()); + return out; + } case GRIN_DATATYPE::Date32: return new int32_t(*static_cast((*_r)[idx])); case GRIN_DATATYPE::Date64: @@ -134,7 +139,13 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ case GRIN_DATATYPE::Double: return new double(*static_cast(result)); case GRIN_DATATYPE::String: - return new std::string(*static_cast(result)); + { + auto s = static_cast(result); + int len = s->length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s->c_str()); + return out; + } case GRIN_DATATYPE::Date32: return new int32_t(*static_cast(result)); case GRIN_DATATYPE::Date64: diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index 5321777cb..0559d2511 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -70,7 +70,6 @@ GRIN_VERTEX_LIST grin_select_type_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE auto _g = static_cast(g)->g; auto _vtype = static_cast(vtype); auto _vl = static_cast(vl); - if (_vl->type_begin > *_vtype || _vl->type_end <= *_vtype) return GRIN_NULL_LIST; auto fvl = new GRIN_VERTEX_LIST_T(); diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 6d86d5b69..7f0623cad 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -86,7 +86,9 @@ const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { auto _g = static_cast(g)->g; auto s = std::string(name); - auto vt = new GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(s)); + auto _id = _g->schema().GetVertexLabelId(s); + if (_id == -1 ) return GRIN_NULL_VERTEX_TYPE; + auto vt = new GRIN_VERTEX_TYPE_T(_id); return vt; } #endif @@ -174,7 +176,9 @@ const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { auto _g = static_cast(g)->g; auto s = std::string(name); - auto et = new GRIN_EDGE_TYPE_T(_g->schema().GetEdgeLabelId(s)); + auto _id = _g->schema().GetEdgeLabelId(s); + if (_id == -1) return GRIN_NULL_EDGE_TYPE; + auto et = new GRIN_EDGE_TYPE_T(_id); return et; } #endif diff --git a/modules/graph/grin/src/topology/datatype.cc b/modules/graph/grin/src/topology/datatype.cc new file mode 100644 index 000000000..95c55e122 --- /dev/null +++ b/modules/graph/grin/src/topology/datatype.cc @@ -0,0 +1,47 @@ +/** Copyright 2020 Alibaba Group Holding Limited. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "graph/grin/src/predefine.h" +extern "C" { +#include "graph/grin/include/topology/datatype.h" +} + +int grin_get_int32(void* value) { + return *(static_cast(value)); +} + +unsigned int grin_get_uint32(void* value) { + return *(static_cast(value)); +} + +long int grin_get_int64(void* value) { + return *(static_cast(value)); +} + +unsigned long int grin_get_uint64(void* value) { + return *(static_cast(value)); +} + +float grin_get_float(void* value) { + return *(static_cast(value)); +} + +double grin_get_double(void* value) { + return *(static_cast(value)); +} + +char* grin_get_string(void* value) { + return static_cast(value); +} \ No newline at end of file diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index d7478865a..3a3e6eb79 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -124,7 +124,7 @@ void grin_destroy_value(GRIN_GRAPH g, GRIN_DATATYPE dt, const void* value) { delete static_cast(value); break; case GRIN_DATATYPE::String: - delete static_cast(value); + delete static_cast(value); break; case GRIN_DATATYPE::Date32: delete static_cast(value); From e1b21be3debaae4eac7a63aa864391d67089f1b0 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 24 Apr 2023 06:43:58 +0000 Subject: [PATCH 52/85] revert submodule reorg --- modules/graph/grin/include | 1 - 1 file changed, 1 deletion(-) delete mode 160000 modules/graph/grin/include diff --git a/modules/graph/grin/include b/modules/graph/grin/include deleted file mode 160000 index d8cda7ff9..000000000 --- a/modules/graph/grin/include +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d8cda7ff97cf1ed4dfb172699833800879091d1d From 43068ed6756cfe10b64f3e4ecb8cc4d3686834f1 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Thu, 4 May 2023 12:01:16 +0000 Subject: [PATCH 53/85] fix for test --- modules/graph/grin/c/test.c | 960 +++++++++++++----- modules/graph/grin/c/test.sh | 1 + modules/graph/grin/include | 1 + modules/graph/grin/rust/grin_v6d.rs | 14 +- modules/graph/grin/rust/parse.py | 4 +- modules/graph/grin/src/property/primarykey.cc | 8 +- modules/graph/grin/src/property/property.cc | 12 +- .../graph/grin/src/property/propertylist.cc | 10 +- .../graph/grin/src/property/propertytable.cc | 11 +- modules/graph/grin/src/topology/datatype.cc | 28 +- 10 files changed, 761 insertions(+), 288 deletions(-) create mode 160000 modules/graph/grin/include diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index 1e2912381..594a7ac19 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -1,9 +1,6 @@ #include -#include "../include/topology/adjacentlist.h" -#include "../include/topology/datatype.h" -#include "../include/topology/edgelist.h" -#include "../include/topology/structure.h" -#include "../include/topology/vertexlist.h" +#include "../include/index/label.h" +#include "../include/index/order.h" #include "../include/partition/partition.h" #include "../include/partition/reference.h" #include "../include/partition/topology.h" @@ -14,330 +11,785 @@ #include "../include/property/propertytable.h" #include "../include/property/topology.h" #include "../include/property/type.h" -#include "../include/index/label.h" -#include "../include/index/order.h" +#include "../include/topology/adjacentlist.h" +#include "../include/topology/datatype.h" +#include "../include/topology/edgelist.h" +#include "../include/topology/structure.h" +#include "../include/topology/vertexlist.h" GRIN_GRAPH get_graph(int argc, char** argv) { #ifdef GRIN_ENABLE_GRAPH_PARTITION - GRIN_PARTITIONED_GRAPH pg = grin_get_partitioned_graph_from_storage(argc-1, &(argv[1])); - GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); - GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); - GRIN_GRAPH g = grin_get_local_graph_from_partition(pg, partition); + GRIN_PARTITIONED_GRAPH pg = + grin_get_partitioned_graph_from_storage(argc - 1, &(argv[1])); + GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); + GRIN_PARTITION partition = + grin_get_partition_from_list(pg, local_partitions, 0); + GRIN_GRAPH g = grin_get_local_graph_from_partition(pg, partition); #else - GRIN_GRAPH g = grin_get_graph_from_storage(argc-1, &(argv[1])); + GRIN_GRAPH g = grin_get_graph_from_storage(argc - 1, &(argv[1])); #endif - return g; + return g; } #ifdef GRIN_ENABLE_GRAPH_PARTITION GRIN_PARTITIONED_GRAPH get_partitioend_graph(int argc, char** argv) { - GRIN_PARTITIONED_GRAPH pg = grin_get_partitioned_graph_from_storage(argc-1, &(argv[1])); - return pg; + GRIN_PARTITIONED_GRAPH pg = + grin_get_partitioned_graph_from_storage(argc - 1, &(argv[1])); + return pg; } #endif GRIN_VERTEX_TYPE get_one_vertex_type(GRIN_GRAPH g) { - GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); - GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, 0); - grin_destroy_vertex_type_list(g, vtl); - return vt; + GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); + GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, 0); + grin_destroy_vertex_type_list(g, vtl); + return vt; } GRIN_EDGE_TYPE get_one_edge_type(GRIN_GRAPH g) { - GRIN_EDGE_TYPE_LIST etl = grin_get_edge_type_list(g); - GRIN_EDGE_TYPE et = grin_get_edge_type_from_list(g, etl, 0); - grin_destroy_edge_type_list(g, etl); - return et; + GRIN_EDGE_TYPE_LIST etl = grin_get_edge_type_list(g); + GRIN_EDGE_TYPE et = grin_get_edge_type_from_list(g, etl, 0); + grin_destroy_edge_type_list(g, etl); + return et; +} + +GRIN_VERTEX get_one_vertex(GRIN_GRAPH g) { + GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY + GRIN_VERTEX v = grin_get_vertex_from_list(g, vl, 0); +#else + GRIN_VERTEX_LIST_ITERATOR vli = grin_get_vertex_list_begin(g, vl); + GRIN_VERTEX v = grin_get_vertex_from_iter(g, vli); + grin_destroy_vertex_list_iter(g, vli); +#endif + grin_destroy_vertex_list(g, vl); + return v; +} + +GRIN_VERTEX get_vertex_marco(GRIN_GRAPH g) { + GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY + GRIN_VERTEX v = grin_get_vertex_from_list(g, vl, 3); +#else + GRIN_VERTEX_LIST_ITERATOR vli = grin_get_vertex_list_begin(g, vl); + for (int i = 0; i < 3; ++i) { + grin_get_next_vertex_list_iter(g, vli); + } + GRIN_VERTEX v = grin_get_vertex_from_iter(g, vli); + grin_destroy_vertex_list_iter(g, vli); +#endif + grin_destroy_vertex_list(g, vl); + return v; } void test_property_type(int argc, char** argv) { - printf("+++++++++++++++++++++ Test property/type +++++++++++++++++++++\n"); + printf("+++++++++++++++++++++ Test property/type +++++++++++++++++++++\n"); - GRIN_GRAPH g = get_graph(argc, argv); + GRIN_GRAPH g = get_graph(argc, argv); - printf("------------ Vertex Type ------------\n"); - GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); - size_t vtl_size = grin_get_vertex_type_list_size(g, vtl); - printf("vertex type list size: %zu\n", vtl_size); + printf("------------ Vertex Type ------------\n"); + GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); + size_t vtl_size = grin_get_vertex_type_list_size(g, vtl); + printf("vertex type list size: %zu\n", vtl_size); - for (size_t i = 0; i < vtl_size; ++i) { - printf("------------ Iterate the %zu-th vertex type ------------\n", i); - GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, i); + for (size_t i = 0; i < vtl_size; ++i) { + printf("------------ Iterate the %zu-th vertex type ------------\n", i); + GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, i); #ifdef GRIN_WITH_VERTEX_TYPE_NAME - const char* vt_name = grin_get_vertex_type_name(g, vt); - printf("vertex type name: %s\n", vt_name); - GRIN_VERTEX_TYPE vt0 = grin_get_vertex_type_by_name(g, vt_name); - grin_destroy_name(g, vt_name); - if (!grin_equal_vertex_type(g, vt, vt0)) { - printf("vertex type name not match\n"); - } - grin_destroy_vertex_type(g, vt0); + const char* vt_name = grin_get_vertex_type_name(g, vt); + printf("vertex type name: %s\n", vt_name); + GRIN_VERTEX_TYPE vt0 = grin_get_vertex_type_by_name(g, vt_name); + grin_destroy_name(g, vt_name); + if (!grin_equal_vertex_type(g, vt, vt0)) { + printf("vertex type name not match\n"); + } + grin_destroy_vertex_type(g, vt0); #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE - printf("vertex type id: %u\n", grin_get_vertex_type_id(g, vt)); - GRIN_VERTEX_TYPE vt1 = grin_get_vertex_type_from_id(g, grin_get_vertex_type_id(g, vt)); - if (!grin_equal_vertex_type(g, vt, vt1)) { - printf("vertex type id not match\n"); - } - grin_destroy_vertex_type(g, vt1); -#endif + printf("vertex type id: %u\n", grin_get_vertex_type_id(g, vt)); + GRIN_VERTEX_TYPE vt1 = + grin_get_vertex_type_from_id(g, grin_get_vertex_type_id(g, vt)); + if (!grin_equal_vertex_type(g, vt, vt1)) { + printf("vertex type id not match\n"); } - grin_destroy_vertex_type_list(g, vtl); + grin_destroy_vertex_type(g, vt1); +#endif + } + grin_destroy_vertex_type_list(g, vtl); - printf("------------ Create a vertex type list of one type \"person\" ------------\n"); - GRIN_VERTEX_TYPE_LIST vtl2 = grin_create_vertex_type_list(g); + printf( + "------------ Create a vertex type list of one type \"person\" " + "------------\n"); + GRIN_VERTEX_TYPE_LIST vtl2 = grin_create_vertex_type_list(g); #ifdef GRIN_WITH_VERTEX_TYPE_NAME - GRIN_VERTEX_TYPE vt2_w = grin_get_vertex_type_by_name(g, "knows"); - if (vt2_w == GRIN_NULL_VERTEX_TYPE) { - printf("(Correct) vertex type of knows does not exists\n"); - } - GRIN_VERTEX_TYPE vt2 = grin_get_vertex_type_by_name(g, "person"); - if (vt2 == GRIN_NULL_VERTEX_TYPE) { - printf("(Wrong) vertex type of person can not be found\n"); - } else { - const char* vt2_name = grin_get_vertex_type_name(g, vt2); - printf("vertex type name: %s\n", vt2_name); - grin_destroy_name(g, vt2_name); - } + GRIN_VERTEX_TYPE vt2_w = grin_get_vertex_type_by_name(g, "knows"); + if (vt2_w == GRIN_NULL_VERTEX_TYPE) { + printf("(Correct) vertex type of knows does not exists\n"); + } + GRIN_VERTEX_TYPE vt2 = grin_get_vertex_type_by_name(g, "person"); + if (vt2 == GRIN_NULL_VERTEX_TYPE) { + printf("(Wrong) vertex type of person can not be found\n"); + } else { + const char* vt2_name = grin_get_vertex_type_name(g, vt2); + printf("vertex type name: %s\n", vt2_name); + grin_destroy_name(g, vt2_name); + } #else - GRIN_VERTEX_TYPE vt2 = get_one_vertex_type(g); -#endif - grin_insert_vertex_type_to_list(g, vtl2, vt2); - size_t vtl2_size = grin_get_vertex_type_list_size(g, vtl2); - printf("created vertex type list size: %zu\n", vtl2_size); - GRIN_VERTEX_TYPE vt3 = grin_get_vertex_type_from_list(g, vtl2, 0); - if (!grin_equal_vertex_type(g, vt2, vt3)) { - printf("vertex type not match\n"); - } - grin_destroy_vertex_type(g, vt2); - grin_destroy_vertex_type(g, vt3); - grin_destroy_vertex_type_list(g, vtl2); - - // edge - printf("------------ Edge Type ------------\n"); - GRIN_EDGE_TYPE_LIST etl = grin_get_edge_type_list(g); - size_t etl_size = grin_get_edge_type_list_size(g, etl); - printf("edge type list size: %zu\n", etl_size); - - for (size_t i = 0; i < etl_size; ++i) { - printf("------------ Iterate the %zu-th edge type ------------\n", i); - GRIN_EDGE_TYPE et = grin_get_edge_type_from_list(g, etl, i); + GRIN_VERTEX_TYPE vt2 = get_one_vertex_type(g); +#endif + grin_insert_vertex_type_to_list(g, vtl2, vt2); + size_t vtl2_size = grin_get_vertex_type_list_size(g, vtl2); + printf("created vertex type list size: %zu\n", vtl2_size); + GRIN_VERTEX_TYPE vt3 = grin_get_vertex_type_from_list(g, vtl2, 0); + if (!grin_equal_vertex_type(g, vt2, vt3)) { + printf("vertex type not match\n"); + } + grin_destroy_vertex_type(g, vt2); + grin_destroy_vertex_type(g, vt3); + grin_destroy_vertex_type_list(g, vtl2); + + // edge + printf("------------ Edge Type ------------\n"); + GRIN_EDGE_TYPE_LIST etl = grin_get_edge_type_list(g); + size_t etl_size = grin_get_edge_type_list_size(g, etl); + printf("edge type list size: %zu\n", etl_size); + + for (size_t i = 0; i < etl_size; ++i) { + printf("------------ Iterate the %zu-th edge type ------------\n", i); + GRIN_EDGE_TYPE et = grin_get_edge_type_from_list(g, etl, i); #ifdef GRIN_WITH_EDGE_TYPE_NAME - const char* et_name = grin_get_edge_type_name(g, et); - printf("edge type name: %s\n", et_name); - GRIN_EDGE_TYPE et0 = grin_get_edge_type_by_name(g, et_name); - grin_destroy_name(g, et_name); - if (!grin_equal_edge_type(g, et, et0)) { - printf("edge type name not match\n"); - } - grin_destroy_edge_type(g, et0); + const char* et_name = grin_get_edge_type_name(g, et); + printf("edge type name: %s\n", et_name); + GRIN_EDGE_TYPE et0 = grin_get_edge_type_by_name(g, et_name); + grin_destroy_name(g, et_name); + if (!grin_equal_edge_type(g, et, et0)) { + printf("edge type name not match\n"); + } + grin_destroy_edge_type(g, et0); #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE - printf("edge type id: %u\n", grin_get_edge_type_id(g, et)); - GRIN_EDGE_TYPE et1 = grin_get_edge_type_from_id(g, grin_get_edge_type_id(g, et)); - if (!grin_equal_edge_type(g, et, et1)) { - printf("edge type id not match\n"); - } - grin_destroy_edge_type(g, et1); + printf("edge type id: %u\n", grin_get_edge_type_id(g, et)); + GRIN_EDGE_TYPE et1 = + grin_get_edge_type_from_id(g, grin_get_edge_type_id(g, et)); + if (!grin_equal_edge_type(g, et, et1)) { + printf("edge type id not match\n"); + } + grin_destroy_edge_type(g, et1); #endif - // relation - GRIN_VERTEX_TYPE_LIST src_vtl = grin_get_src_types_from_edge_type(g, et); - size_t src_vtl_size = grin_get_vertex_type_list_size(g, src_vtl); - printf("source vertex type list size: %zu\n", src_vtl_size); + // relation + GRIN_VERTEX_TYPE_LIST src_vtl = grin_get_src_types_from_edge_type(g, et); + size_t src_vtl_size = grin_get_vertex_type_list_size(g, src_vtl); + printf("source vertex type list size: %zu\n", src_vtl_size); - GRIN_VERTEX_TYPE_LIST dst_vtl = grin_get_dst_types_from_edge_type(g, et); - size_t dst_vtl_size = grin_get_vertex_type_list_size(g, dst_vtl); - printf("destination vertex type list size: %zu\n", dst_vtl_size); + GRIN_VERTEX_TYPE_LIST dst_vtl = grin_get_dst_types_from_edge_type(g, et); + size_t dst_vtl_size = grin_get_vertex_type_list_size(g, dst_vtl); + printf("destination vertex type list size: %zu\n", dst_vtl_size); - if (src_vtl_size != dst_vtl_size) { - printf("source and destination vertex type list size not match\n"); - } - for (size_t j = 0; j < src_vtl_size; ++j) { - GRIN_VERTEX_TYPE src_vt = grin_get_vertex_type_from_list(g, src_vtl, j); - GRIN_VERTEX_TYPE dst_vt = grin_get_vertex_type_from_list(g, dst_vtl, j); - const char* src_vt_name = grin_get_vertex_type_name(g, src_vt); - const char* dst_vt_name = grin_get_vertex_type_name(g, dst_vt); - const char* et_name = grin_get_edge_type_name(g, et); - printf("edge type name: %s-%s-%s\n", src_vt_name, et_name, dst_vt_name); - grin_destroy_name(g, src_vt_name); - grin_destroy_name(g, dst_vt_name); - grin_destroy_name(g, et_name); - grin_destroy_vertex_type(g, src_vt); - grin_destroy_vertex_type(g, dst_vt); - } - grin_destroy_vertex_type_list(g, src_vtl); - grin_destroy_vertex_type_list(g, dst_vtl); + if (src_vtl_size != dst_vtl_size) { + printf("source and destination vertex type list size not match\n"); } - grin_destroy_edge_type_list(g, etl); - - printf("------------ Create an edge type list of one type \"created\" ------------\n"); - GRIN_EDGE_TYPE_LIST etl2 = grin_create_edge_type_list(g); -#ifdef GRIN_WITH_EDGE_TYPE_NAME - GRIN_EDGE_TYPE et2_w = grin_get_edge_type_by_name(g, "person"); - if (et2_w == GRIN_NULL_EDGE_TYPE) { - printf("(Correct) edge type of person does not exists\n"); - } - GRIN_EDGE_TYPE et2 = grin_get_edge_type_by_name(g, "created"); - if (et2 == GRIN_NULL_EDGE_TYPE) { - printf("(Wrong) edge type of created can not be found\n"); - } else { - const char* et2_name = grin_get_edge_type_name(g, et2); - printf("edge type name: %s\n", et2_name); - grin_destroy_name(g, et2_name); + for (size_t j = 0; j < src_vtl_size; ++j) { + GRIN_VERTEX_TYPE src_vt = grin_get_vertex_type_from_list(g, src_vtl, j); + GRIN_VERTEX_TYPE dst_vt = grin_get_vertex_type_from_list(g, dst_vtl, j); + const char* src_vt_name = grin_get_vertex_type_name(g, src_vt); + const char* dst_vt_name = grin_get_vertex_type_name(g, dst_vt); + const char* et_name = grin_get_edge_type_name(g, et); + printf("edge type name: %s-%s-%s\n", src_vt_name, et_name, dst_vt_name); + grin_destroy_name(g, src_vt_name); + grin_destroy_name(g, dst_vt_name); + grin_destroy_name(g, et_name); + grin_destroy_vertex_type(g, src_vt); + grin_destroy_vertex_type(g, dst_vt); } + grin_destroy_vertex_type_list(g, src_vtl); + grin_destroy_vertex_type_list(g, dst_vtl); + } + grin_destroy_edge_type_list(g, etl); + + printf( + "------------ Create an edge type list of one type \"created\" " + "------------\n"); + GRIN_EDGE_TYPE_LIST etl2 = grin_create_edge_type_list(g); +#ifdef GRIN_WITH_EDGE_TYPE_NAME + GRIN_EDGE_TYPE et2_w = grin_get_edge_type_by_name(g, "person"); + if (et2_w == GRIN_NULL_EDGE_TYPE) { + printf("(Correct) edge type of person does not exists\n"); + } + GRIN_EDGE_TYPE et2 = grin_get_edge_type_by_name(g, "created"); + if (et2 == GRIN_NULL_EDGE_TYPE) { + printf("(Wrong) edge type of created can not be found\n"); + } else { + const char* et2_name = grin_get_edge_type_name(g, et2); + printf("edge type name: %s\n", et2_name); + grin_destroy_name(g, et2_name); + } #else - GRIN_EDGE_TYPE et2 = get_one_edge_type(g); -#endif - grin_insert_edge_type_to_list(g, etl2, et2); - size_t etl2_size = grin_get_edge_type_list_size(g, etl2); - printf("created edge type list size: %zu\n", etl2_size); - GRIN_EDGE_TYPE et3 = grin_get_edge_type_from_list(g, etl2, 0); - if (!grin_equal_edge_type(g, et2, et3)) { - printf("edge type not match\n"); - } - grin_destroy_edge_type(g, et2); - grin_destroy_edge_type(g, et3); - grin_destroy_edge_type_list(g, etl2); - - grin_destroy_graph(g); + GRIN_EDGE_TYPE et2 = get_one_edge_type(g); +#endif + grin_insert_edge_type_to_list(g, etl2, et2); + size_t etl2_size = grin_get_edge_type_list_size(g, etl2); + printf("created edge type list size: %zu\n", etl2_size); + GRIN_EDGE_TYPE et3 = grin_get_edge_type_from_list(g, etl2, 0); + if (!grin_equal_edge_type(g, et2, et3)) { + printf("edge type not match\n"); + } + grin_destroy_edge_type(g, et2); + grin_destroy_edge_type(g, et3); + grin_destroy_edge_type_list(g, etl2); + + grin_destroy_graph(g); } - void test_property_topology(int argc, char** argv) { - printf("+++++++++++++++++++++ Test property/topology +++++++++++++++++++++\n"); - GRIN_GRAPH g = get_graph(argc, argv); - GRIN_VERTEX_TYPE vt = get_one_vertex_type(g); - GRIN_EDGE_TYPE et = get_one_edge_type(g); - const char* vt_name = grin_get_vertex_type_name(g, vt); - const char* et_name = grin_get_edge_type_name(g, et); + printf( + "+++++++++++++++++++++ Test property/topology +++++++++++++++++++++\n"); + GRIN_GRAPH g = get_graph(argc, argv); + GRIN_VERTEX_TYPE vt = get_one_vertex_type(g); + GRIN_EDGE_TYPE et = get_one_edge_type(g); + const char* vt_name = grin_get_vertex_type_name(g, vt); + const char* et_name = grin_get_edge_type_name(g, et); #ifdef GRIN_ENABLE_GRAPH_PARTITION - GRIN_PARTITIONED_GRAPH pg = get_partitioend_graph(argc, argv); - size_t tvnum = grin_get_total_vertex_num_by_type(pg, vt); - printf("total vertex num of %s: %zu\n", vt_name, tvnum); - size_t tenum = grin_get_total_edge_num_by_type(pg, et); - printf("total edge num of %s: %zu\n", et_name, tenum); - grin_destroy_partitioned_graph(pg); + GRIN_PARTITIONED_GRAPH pg = get_partitioend_graph(argc, argv); + size_t tvnum = grin_get_total_vertex_num_by_type(pg, vt); + printf("total vertex num of %s: %zu\n", vt_name, tvnum); + size_t tenum = grin_get_total_edge_num_by_type(pg, et); + printf("total edge num of %s: %zu\n", et_name, tenum); + grin_destroy_partitioned_graph(pg); #endif #ifdef GRIN_ENABLE_VERTEX_LIST - GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); - size_t vl_size = grin_get_vertex_list_size(g, vl); - printf("vertex list size: %zu\n", vl_size); + GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); - GRIN_VERTEX_LIST typed_vl = grin_select_type_for_vertex_list(g, vt, vl); - size_t typed_vl_size = grin_get_vertex_list_size(g, typed_vl); - size_t typed_vnum = grin_get_vertex_num_by_type(g, vt); - printf("vertex number under type: %zu %zu\n", typed_vl_size, typed_vnum); - - for (size_t j = 0; j < typed_vl_size; ++j) { - GRIN_VERTEX v = grin_get_vertex_from_list(g, typed_vl, j); - GRIN_VERTEX_TYPE v_type = grin_get_vertex_type(g, v); - if (!grin_equal_vertex_type(g, v_type, vt)) { - printf("vertex type not match\n"); - } - grin_destroy_vertex_type(g, v_type); - grin_destroy_vertex(g, v); +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY + size_t vl_size = grin_get_vertex_list_size(g, vl); + printf("vertex list size: %zu\n", vl_size); +#endif + +#ifdef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST + GRIN_VERTEX_LIST typed_vl = grin_select_type_for_vertex_list(g, vt, vl); + size_t typed_vnum = grin_get_vertex_num_by_type(g, vt); + +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY + size_t typed_vl_size = grin_get_vertex_list_size(g, typed_vl); + printf("vertex number under type: %zu %zu\n", typed_vl_size, typed_vnum); + + for (size_t j = 0; j < typed_vl_size; ++j) { + GRIN_VERTEX v = grin_get_vertex_from_list(g, typed_vl, j); + GRIN_VERTEX_TYPE v_type = grin_get_vertex_type(g, v); + if (!grin_equal_vertex_type(g, v_type, vt)) { + printf("vertex type not match\n"); } - grin_destroy_vertex_list(g, typed_vl); - grin_destroy_vertex_list(g, vl); + grin_destroy_vertex_type(g, v_type); + grin_destroy_vertex(g, v); + } +#else + GRIN_VERTEX_LIST_ITERATOR vli = grin_get_vertex_list_begin(g, typed_vl); + size_t typed_vl_size = 0; + while (grin_is_vertex_list_end(g, vli) == false) { + ++typed_vl_size; + GRIN_VERTEX v = grin_get_vertex_from_iter(g, vli); + GRIN_VERTEX_TYPE v_type = grin_get_vertex_type(g, v); + if (!grin_equal_vertex_type(g, v_type, vt)) { + printf("vertex type not match\n"); + } + grin_destroy_vertex_type(g, v_type); + grin_destroy_vertex(g, v); + grin_get_next_vertex_list_iter(g, vli); + } + printf("vertex number under type: %zu %zu\n", typed_vl_size, typed_vnum); + grin_destroy_vertex_list_iter(g, vli); +#endif + + grin_destroy_vertex_list(g, typed_vl); +#endif + grin_destroy_vertex_list(g, vl); #endif #ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID - GRIN_DATATYPE dt = grin_get_vertex_original_id_type(g); - if (dt == Int64) { - long int v0id = 4; - GRIN_VERTEX v0 = grin_get_vertex_from_original_id_by_type(g, vt, &v0id); - if (v0 == GRIN_NULL_VERTEX) { - printf("(Wrong) vertex of id %ld can not be found\n", v0id); - } else { - printf("vertex of original id %ld found\n", v0id); - GRIN_VERTEX_ORIGINAL_ID oid0 = grin_get_vertex_original_id(g, v0); - printf("get vertex original id: %ld\n", *((long int*)oid0)); - grin_destroy_vertex_original_id(g, oid0); - } - grin_destroy_vertex(g, v0); + GRIN_DATATYPE dt = grin_get_vertex_original_id_type(g); + if (dt == Int64) { + long int v0id = 4; + GRIN_VERTEX v0 = grin_get_vertex_from_original_id_by_type(g, vt, &v0id); + if (v0 == GRIN_NULL_VERTEX) { + printf("(Wrong) vertex of id %ld can not be found\n", v0id); + } else { + printf("vertex of original id %ld found\n", v0id); + GRIN_VERTEX_ORIGINAL_ID oid0 = grin_get_vertex_original_id(g, v0); + printf("get vertex original id: %ld\n", *((long int*) oid0)); + grin_destroy_vertex_original_id(g, oid0); } + grin_destroy_vertex(g, v0); + } #endif #ifdef GRIN_ENABLE_EDGE_LIST - GRIN_EDGE_LIST el = grin_get_edge_list(g); - size_t el_size = grin_get_edge_list_size(g, el); - printf("edge list size: %zu\n", el_size); - - GRIN_EDGE_LIST typed_el = grin_select_type_for_edge_list(g, et, el); - size_t typed_el_size = grin_get_edge_list_size(g, typed_el); - size_t typed_enum = grin_get_edge_num_by_type(g, et); - printf("edge number under type: %zu %zu\n", typed_el_size, typed_enum); - - for (size_t j = 0; j < typed_el_size; ++j) { - GRIN_EDGE e = grin_get_edge_from_list(g, typed_el, j); - GRIN_EDGE_TYPE e_type = grin_get_edge_type(g, e); - if (!grin_equal_edge_type(g, e_type, et)) { - printf("edge type not match\n"); - } - grin_destroy_edge_type(g, e_type); - grin_destroy_edge(g, e); + GRIN_EDGE_LIST el = grin_get_edge_list(g); +#ifdef GRIN_ENABLE_EDGE_LIST_ARRAY + size_t el_size = grin_get_edge_list_size(g, el); + printf("edge list size: %zu\n", el_size); +#endif + +#ifdef GRIN_TRAIT_SELECT_TYPE_FOR_EDGE_LIST + GRIN_EDGE_LIST typed_el = grin_select_type_for_edge_list(g, et, el); + size_t typed_enum = grin_get_edge_num_by_type(g, et); + +#ifdef GRIN_ENABLE_EDGE_LIST_ARRAY + size_t typed_el_size = grin_get_edge_list_size(g, typed_el); + printf("edge number under type: %zu %zu\n", typed_el_size, typed_enum); + + for (size_t j = 0; j < typed_el_size; ++j) { + GRIN_EDGE e = grin_get_edge_from_list(g, typed_el, j); + GRIN_EDGE_TYPE e_type = grin_get_edge_type(g, e); + if (!grin_equal_edge_type(g, e_type, et)) { + printf("edge type not match\n"); + } + grin_destroy_edge_type(g, e_type); + grin_destroy_edge(g, e); + } +#else + GRIN_EDGE_LIST_ITERATOR eli = grin_get_edge_list_begin(g, typed_el); + size_t typed_el_size = 0; + while (grin_is_edge_list_end(g, eli) == false) { + ++typed_el_size; + GRIN_EDGE e = grin_get_edge_from_iter(g, eli); + GRIN_EDGE_TYPE e_type = grin_get_edge_type(g, e); + if (!grin_equal_edge_type(g, e_type, et)) { + printf("edge type not match\n"); } - grin_destroy_edge_list(g, typed_el); - grin_destroy_edge_list(g, el); + grin_destroy_edge_type(g, e_type); + grin_destroy_edge(g, e); + grin_get_next_edge_list_iter(g, eli); + } + printf("edge number under type: %zu %zu\n", typed_el_size, typed_enum); + grin_destroy_edge_list_iter(g, eli); #endif - grin_destroy_name(g, vt_name); - grin_destroy_name(g, et_name); - grin_destroy_vertex_type(g, vt); - grin_destroy_edge_type(g, et); - grin_destroy_graph(g); + grin_destroy_edge_list(g, typed_el); +#endif + grin_destroy_edge_list(g, el); +#endif + + grin_destroy_name(g, vt_name); + grin_destroy_name(g, et_name); + grin_destroy_vertex_type(g, vt); + grin_destroy_edge_type(g, et); + grin_destroy_graph(g); } -void test_property_table(int argc, char** argv) { - printf("+++++++++++++++++++++ Test property/table +++++++++++++++++++++\n"); - GRIN_GRAPH g = get_graph(argc, argv); - GRIN_VERTEX_TYPE vt = get_one_vertex_type(g); - GRIN_EDGE_TYPE et = get_one_edge_type(g); - - printf("------------ Vertex property table ------------\n"); - GRIN_VERTEX_PROPERTY_LIST vpl = grin_get_vertex_property_list_by_type(g, vt); - GRIN_VERTEX_PROPERTY_TABLE vpt = grin_get_vertex_property_table_by_type(g, vt); +void test_property_vertex_table(int argc, char** argv) { + printf("+++++++++++++++++++++ Test property/table +++++++++++++++++++++\n"); + GRIN_GRAPH g = get_graph(argc, argv); + + printf("------------ Vertex property table ------------\n"); + GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); + size_t vtl_size = grin_get_vertex_type_list_size(g, vtl); + for (size_t i = 0; i < vtl_size; ++i) { + GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, i); + + GRIN_VERTEX_PROPERTY_LIST vpl = + grin_get_vertex_property_list_by_type(g, vt); + GRIN_VERTEX_PROPERTY_TABLE vpt = + grin_get_vertex_property_table_by_type(g, vt); GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); GRIN_VERTEX_LIST typed_vl = grin_select_type_for_vertex_list(g, vt, vl); +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY size_t typed_vl_size = grin_get_vertex_list_size(g, typed_vl); +#else + size_t typed_vl_size = grin_get_vertex_num_by_type(g, vt); +#endif size_t vpl_size = grin_get_vertex_property_list_size(g, vpl); - printf("vertex list size: %zu vertex property list size: %zu\n", typed_vl_size, vpl_size); + printf("vertex list size: %zu vertex property list size: %zu\n", + typed_vl_size, vpl_size); +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY for (size_t i = 0; i < typed_vl_size; ++i) { - GRIN_VERTEX v = grin_get_vertex_from_list(g, typed_vl, i); - GRIN_ROW row = grin_get_row_from_vertex_property_table(g, vpt, v, vpl); - for (size_t j = 0; j < vpl_size; ++j) { - GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, j); - GRIN_DATATYPE dt = grin_get_vertex_property_data_type(g, vp); - const void* pv = grin_get_value_from_vertex_property_table(g, vpt, v, vp); - const void* rv = grin_get_value_from_row(g, row, dt, j); - if (dt == Int64) { - printf("v%zu p%zu value: %ld %ld\n", i, j, *((long int*)pv), *((long int*)rv)); - } else if (dt == String) { - printf("v%zu p%zu value: %s %s\n", i, j, (char*)pv, (char*)rv); - } - grin_destroy_value(g, dt, pv); - grin_destroy_value(g, dt, rv); - grin_destroy_vertex_property(g, vp); + GRIN_VERTEX v = grin_get_vertex_from_list(g, typed_vl, i); +#else + GRIN_VERTEX_LIST_ITERATOR vli = grin_get_vertex_list_begin(g, typed_vl); + size_t i = 0; + while (grin_is_vertex_list_end(g, vli) == 0) { + GRIN_VERTEX v = grin_get_vertex_from_iter(g, vli); +#endif + GRIN_ROW row = grin_get_row_from_vertex_property_table(g, vpt, v, vpl); + for (size_t j = 0; j < vpl_size; ++j) { + GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, j); + GRIN_VERTEX_PROPERTY vt1 = grin_get_vertex_property_vertex_type(g, vp); + if (!grin_equal_vertex_type(g, vt, vt1)) { + printf("vertex type not match by property\n"); + } + grin_destroy_vertex_type(g, vt1); +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY + unsigned int id = grin_get_vertex_property_id(g, vt, vp); + GRIN_VERTEX_PROPERTY vp1 = grin_get_vertex_property_from_id(g, vt, id); + if (!grin_equal_vertex_property(g, vp, vp1)) { + printf("vertex property not match by id\n"); + } + grin_destroy_vertex_property(g, vp1); +#else + unsigned int id = ~0; +#endif + +#ifdef GRIN_WITH_VERTEX_PROPERTY_NAME + const char* vp_name = grin_get_vertex_property_name(g, vp); + GRIN_VERTEX_PROPERTY vp2 = + grin_get_vertex_property_by_name(g, vt, vp_name); + if (!grin_equal_vertex_property(g, vp, vp2)) { + printf("vertex property not match by name\n"); + } +#else + const char* vp_name = "unknown"; +#endif + GRIN_DATATYPE dt = grin_get_vertex_property_data_type(g, vp); + const void* pv = + grin_get_value_from_vertex_property_table(g, vpt, v, vp); + const void* rv = grin_get_value_from_row(g, row, dt, j); + if (dt == Int64) { + printf("vp_id %u v%zu %s value: %ld %ld\n", id, i, vp_name, + *((long int*) pv), *((long int*) rv)); + } else if (dt == String) { + printf("vp_id %u v%zu %s value: %s %s\n", id, i, vp_name, (char*) pv, + (char*) rv); } - grin_destroy_row(g, row); - grin_destroy_vertex(g, v); + grin_destroy_value(g, dt, pv); + grin_destroy_value(g, dt, rv); + grin_destroy_vertex_property(g, vp); + } + grin_destroy_row(g, row); + grin_destroy_vertex(g, v); +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY + } +#else + grin_get_next_vertex_list_iter(g, vli); + ++i; + } + grin_destroy_vertex_list_iter(g, vli); +#endif + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY + GRIN_VERTEX_PROPERTY vp3 = + grin_get_vertex_property_from_id(g, vt, vpl_size); + if (vp3 == GRIN_NULL_VERTEX_PROPERTY) { + printf("(Correct) vertex property of id %zu does not exist\n", vpl_size); + } else { + printf("(Wrong) vertex property of id %zu exists\n", vpl_size); + grin_destroy_vertex_property(g, vp3); + } +#endif + +#ifdef GRIN_WITH_VERTEX_PROPERTY_NAME + GRIN_VERTEX_PROPERTY vp4 = + grin_get_vertex_property_by_name(g, vt, "unknown"); + if (vp4 == GRIN_NULL_VERTEX_PROPERTY) { + printf("(Correct) vertex property of name \"unknown\" does not exist\n"); + } else { + printf("(Wrong) vertex property of name \"unknown\" exists\n"); + grin_destroy_vertex_property(g, vp4); + } + + GRIN_VERTEX_PROPERTY_LIST vpl1 = + grin_get_vertex_properties_by_name(g, "unknown"); + if (vpl1 == GRIN_NULL_LIST) { + printf( + "(Correct) vertex properties of name \"unknown\" does not exist\n"); + } else { + printf("(Wrong) vertex properties of name \"unknown\" exists\n"); + grin_destroy_vertex_property_list(g, vpl1); } + GRIN_VERTEX_PROPERTY_LIST vpl2 = + grin_get_vertex_properties_by_name(g, "name"); + if (vpl2 == GRIN_NULL_LIST) { + printf("(Wrong) vertex properties of name \"name\" does not exist\n"); + } else { + printf("(Correct) vertex properties of name \"name\" exists\n"); + size_t vpl2_size = grin_get_vertex_property_list_size(g, vpl2); + for (size_t i = 0; i < vpl2_size; ++i) { + GRIN_VERTEX_PROPERTY vp5 = + grin_get_vertex_property_from_list(g, vpl2, i); + GRIN_VERTEX_TYPE vt5 = grin_get_vertex_property_vertex_type(g, vp5); + const char* vp5_name = grin_get_vertex_property_name(g, vp5); + const char* vt5_name = grin_get_vertex_type_name(g, vt5); + printf("vertex type name: %s, vertex property name: %s\n", vt5_name, + vp5_name); + grin_destroy_vertex_property(g, vp5); + grin_destroy_vertex_type(g, vt5); + grin_destroy_name(g, vt5_name); + grin_destroy_name(g, vp5_name); + } + grin_destroy_vertex_property_list(g, vpl2); + } +#endif + grin_destroy_vertex_list(g, typed_vl); grin_destroy_vertex_list(g, vl); grin_destroy_vertex_property_list(g, vpl); grin_destroy_vertex_property_table(g, vpt); -} + } + grin_destroy_vertex_type_list(g, vtl); + grin_destroy_graph(g); +} + +void test_property_edge_table(int argc, char** argv) { + printf("------------ Edge property table ------------\n"); + GRIN_GRAPH g = get_graph(argc, argv); + // edge + GRIN_VERTEX v = get_vertex_marco(g); + GRIN_VERTEX_TYPE vt = grin_get_vertex_type(g, v); + GRIN_ADJACENT_LIST al = grin_get_adjacent_list(g, OUT, v); +#ifdef GRIN_ENABLE_ADJACENT_LIST_ARRAY + printf("adjacent list size: %zu\n", grin_get_adjacent_list_size(g, al)); +#endif + GRIN_EDGE_TYPE_LIST etl = grin_get_edge_type_list(g); + size_t etl_size = grin_get_edge_type_list_size(g, etl); + printf("edge type list size: %zu\n", etl_size); + for (size_t i = 0; i < etl_size; ++i) { + GRIN_EDGE_TYPE et = grin_get_edge_type_from_list(g, etl, i); + GRIN_EDGE_PROPERTY_TABLE ept = grin_get_edge_property_table_by_type(g, et); + GRIN_EDGE_PROPERTY_LIST epl = grin_get_edge_property_list_by_type(g, et); + size_t epl_size = grin_get_edge_property_list_size(g, epl); + printf("edge property list size: %zu\n", epl_size); + +#ifdef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST + GRIN_ADJACENT_LIST al1 = grin_select_edge_type_for_adjacent_list(g, et, al); + +#ifdef GRIN_ENABLE_ADJACENT_LIST_ARRAY + size_t al1_size = grin_get_adjacent_list_size(g, al1); + printf("selected adjacent list size: %zu\n", al1_size); +#endif + +#ifdef GRIN_ENABLE_ADJACENT_LIST_ARRAY + for (size_t j = 0; j < al1_size; ++j) { + GRIN_EDGE e = grin_get_edge_from_adjacent_list(g, al1, j); +#else + GRIN_ADJACENT_LIST_ITERATOR ali = grin_get_adjacent_list_begin(g, al1); + size_t j = 0; + while (grin_is_adjacent_list_end(g, ali) == false) { + GRIN_EDGE e = grin_get_edge_from_adjacent_list_iter(g, ali); +#endif + GRIN_EDGE_TYPE et1 = grin_get_edge_type(g, e); + if (!grin_equal_edge_type(g, et, et1)) { + printf("edge type does not match\n"); + } + + GRIN_ROW row = grin_get_row_from_edge_property_table(g, ept, e, epl); + for (size_t k = 0; k < epl_size; ++k) { + GRIN_EDGE_PROPERTY ep = grin_get_edge_property_from_list(g, epl, k); + GRIN_EDGE_TYPE et2 = grin_get_edge_property_edge_type(g, ep); + if (!grin_equal_edge_type(g, et, et2)) { + printf("edge type does not match\n"); + } + grin_destroy_edge_type(g, et2); + + const char* ep_name = grin_get_edge_property_name(g, ep); + printf("edge property name: %s\n", ep_name); + +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY + unsigned int id = grin_get_edge_property_id(g, et, ep); + GRIN_EDGE_PROPERTY ep1 = grin_get_edge_property_from_id(g, et, id); + if (!grin_equal_edge_property(g, ep, ep1)) { + printf("edge property not match by id\n"); + } + grin_destroy_edge_property(g, ep1); +#else + unsigned int id = ~0; +#endif + GRIN_DATATYPE dt = grin_get_edge_property_data_type(g, ep); + const void* pv = grin_get_value_from_edge_property_table(g, ept, e, ep); + const void* rv = grin_get_value_from_row(g, row, dt, k); + if (dt == Int64) { + printf("ep_id %u e%zu %s value: %ld %ld\n", id, j, ep_name, + *((long int*) pv), *((long int*) rv)); + } else if (dt == String) { + printf("ep_id %u e%zu %s value: %s %s\n", id, j, ep_name, (char*) pv, + (char*) rv); + } else if (dt == Double) { + printf("ep_id %u e%zu %s value: %f %f\n", id, j, ep_name, + *((double*) pv), *((double*) rv)); + } + grin_destroy_edge_property(g, ep); + grin_destroy_name(g, ep_name); + grin_destroy_value(g, dt, pv); + grin_destroy_value(g, dt, rv); + } + + grin_destroy_row(g, row); + grin_destroy_edge_type(g, et1); + grin_destroy_edge(g, e); + +#ifdef GRIN_ENABLE_ADJACENT_LIST_ARRAY + } +#else + grin_get_next_adjacent_list_iter(g, ali); + ++j; + } + grin_destroy_adjacent_list_iter(g, ali); +#endif + + grin_destroy_adjacent_list(g, al1); +#endif + + for (size_t j = 0; j < epl_size; ++j) { + GRIN_EDGE_PROPERTY ep = grin_get_edge_property_from_list(g, epl, j); + GRIN_EDGE_TYPE et1 = grin_get_edge_property_edge_type(g, ep); + if (!grin_equal_edge_type(g, et, et1)) { + printf("edge type does not match\n"); + } + const char* ep_name1 = grin_get_edge_property_name(g, ep); + const char* et_name = grin_get_edge_type_name(g, et); + printf("edge property name: %s, edge property type name: %s\n", ep_name1, + et_name); + + grin_destroy_edge_type(g, et1); + grin_destroy_name(g, ep_name1); + grin_destroy_name(g, et_name); + +#ifdef GRIN_WITH_EDGE_PROPERTY_NAME + const char* ep_name = grin_get_edge_property_name(g, ep); + GRIN_EDGE_PROPERTY ep2 = grin_get_edge_property_by_name(g, et, ep_name); + if (!grin_equal_edge_property(g, ep, ep2)) { + printf("edge property not match by name\n"); + } +#else + const char* ep_name = "unknown"; +#endif + grin_destroy_edge_property(g, ep); + } +#ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY + GRIN_EDGE_PROPERTY ep3 = grin_get_edge_property_from_id(g, et, epl_size); + if (ep3 == GRIN_NULL_EDGE_PROPERTY) { + printf("(Correct) edge property of id %zu does not exist\n", epl_size); + } else { + printf("(Wrong) edge property of id %zu exists\n", epl_size); + grin_destroy_edge_property(g, ep3); + } +#endif + +#ifdef GRIN_WITH_EDGE_PROPERTY_NAME + GRIN_EDGE_PROPERTY ep4 = grin_get_edge_property_by_name(g, et, "unknown"); + if (ep4 == GRIN_NULL_EDGE_PROPERTY) { + printf("(Correct) edge property of name \"unknown\" does not exist\n"); + } else { + printf("(Wrong) edge property of name \"unknown\" exists\n"); + grin_destroy_edge_property(g, ep4); + } + + GRIN_EDGE_PROPERTY_LIST epl1 = + grin_get_edge_properties_by_name(g, "unknown"); + if (epl1 == GRIN_NULL_LIST) { + printf("(Correct) edge properties of name \"unknown\" does not exist\n"); + } else { + printf("(Wrong) edge properties of name \"unknown\" exists\n"); + grin_destroy_edge_property_list(g, epl1); + } + + GRIN_EDGE_PROPERTY_LIST epl2 = + grin_get_edge_properties_by_name(g, "weight"); + if (epl2 == GRIN_NULL_LIST) { + printf("(Wrong) edge properties of name \"weight\" does not exist\n"); + } else { + printf("(Correct) edge properties of name \"weight\" exists\n"); + size_t epl2_size = grin_get_edge_property_list_size(g, epl2); + for (size_t i = 0; i < epl2_size; ++i) { + GRIN_EDGE_PROPERTY ep5 = grin_get_edge_property_from_list(g, epl2, i); + GRIN_EDGE_TYPE et5 = grin_get_edge_property_edge_type(g, ep5); + const char* ep5_name = grin_get_edge_property_name(g, ep5); + const char* et5_name = grin_get_edge_type_name(g, et5); + printf("edge type name: %s, edge property name: %s\n", et5_name, + ep5_name); + grin_destroy_edge_property(g, ep5); + grin_destroy_edge_type(g, et5); + grin_destroy_name(g, et5_name); + grin_destroy_name(g, ep5_name); + } + grin_destroy_edge_property_list(g, epl2); + } +#endif + grin_destroy_edge_type(g, et); + } + + grin_destroy_vertex(g, v); + grin_destroy_vertex_type(g, vt); + grin_destroy_adjacent_list(g, al); + grin_destroy_edge_type_list(g, etl); + grin_destroy_graph(g); +} + +void test_property_primary_key(int argc, char** argv) { + printf( + "+++++++++++++++++++++ Test property/primary key " + "+++++++++++++++++++++\n"); + GRIN_GRAPH g = get_graph(argc, argv); + GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_types_with_primary_keys(g); + size_t vtl_size = grin_get_vertex_type_list_size(g, vtl); + printf("vertex type list size: %zu\n", vtl_size); + + unsigned id_type[7] = {~0, 0, 0, 1, 0, 1, 0}; + + for (size_t i = 0; i < vtl_size; ++i) { + GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, i); + const char* vt_name = grin_get_vertex_type_name(g, vt); + printf("vertex type name: %s\n", vt_name); + grin_destroy_name(g, vt_name); + + GRIN_VERTEX_PROPERTY_LIST vpl = grin_get_primary_keys_by_vertex_type(g, vt); + size_t vpl_size = grin_get_vertex_property_list_size(g, vpl); + printf("primary key list size: %zu\n", vpl_size); + + for (size_t j = 0; j < vpl_size; ++j) { + GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, j); + const char* vp_name = grin_get_vertex_property_name(g, vp); + printf("primary key name: %s\n", vp_name); + grin_destroy_name(g, vp_name); + grin_destroy_vertex_property(g, vp); + } + + GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, 0); + GRIN_DATATYPE dt = grin_get_vertex_property_data_type(g, vp); + + for (size_t j = 1; j <= 6; ++j) { + GRIN_ROW r = grin_create_row(g); + grin_insert_value_to_row(g, r, dt, (void*) (&j)); + GRIN_VERTEX v = grin_get_vertex_by_primary_keys(g, vt, r); + if (id_type[j] == i) { + if (v == GRIN_NULL_VERTEX) { + printf("(Wrong) vertex of primary keys %zu does not exist\n", j); + } else { + GRIN_VERTEX_ORIGINAL_ID oid0 = grin_get_vertex_original_id(g, v); + printf("(Correct) vertex of primary keys %zu exists %ld\n", j, + *((long int*) oid0)); + grin_destroy_vertex_original_id(g, oid0); + grin_destroy_vertex(g, v); + } + } else { + if (v == GRIN_NULL_VERTEX) { + printf("(Correct) vertex of primary keys %zu does not exist\n", j); + } else { + printf("(Wrong) vertex of primary keys %zu exists\n", j); + grin_destroy_vertex(g, v); + } + } + grin_destroy_row(g, r); + } + + grin_destroy_vertex_property(g, vp); + grin_destroy_vertex_property_list(g, vpl); + grin_destroy_vertex_type(g, vt); + } +} + +void test_property(int argc, char** argv) { + test_property_type(argc, argv); + test_property_topology(argc, argv); + test_property_vertex_table(argc, argv); + test_property_edge_table(argc, argv); + test_property_primary_key(argc, argv); +} int main(int argc, char** argv) { - test_property_type(argc, argv); - test_property_topology(argc, argv); - test_property_table(argc, argv); - return 0; -} \ No newline at end of file + test_property(argc, argv); + return 0; +} diff --git a/modules/graph/grin/c/test.sh b/modules/graph/grin/c/test.sh index 0a0b5c9b6..23b4d306b 100755 --- a/modules/graph/grin/c/test.sh +++ b/modules/graph/grin/c/test.sh @@ -1,2 +1,3 @@ +rm -rf ./test gcc test.c -I. -L/home/graphscope/gie-grin/v6d/build/shared-lib/ -lvineyard_grin -lvineyard_graph -lvineyard_basic -o test ./test /home/graphscope/gie-grin/temp/vineyard.sock 130878194502466848 \ No newline at end of file diff --git a/modules/graph/grin/include b/modules/graph/grin/include new file mode 160000 index 000000000..860baec5c --- /dev/null +++ b/modules/graph/grin/include @@ -0,0 +1 @@ +Subproject commit 860baec5c5c9d1bf2bf82b161278038223ce3302 diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index f71aec001..c01347b5a 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -114,19 +114,19 @@ extern "C" { arg2: GrinAdjacentListIterator, ) -> GrinEdge; - pub fn grin_get_int32(arg1: *mut ::std::os::raw::c_void) -> i32; + pub fn grin_get_int32(arg1: *const ::std::os::raw::c_void) -> i32; - pub fn grin_get_uint32(arg1: *mut ::std::os::raw::c_void) -> u32; + pub fn grin_get_uint32(arg1: *const ::std::os::raw::c_void) -> u32; - pub fn grin_get_int64(arg1: *mut ::std::os::raw::c_void) -> i64; + pub fn grin_get_int64(arg1: *const ::std::os::raw::c_void) -> i64; - pub fn grin_get_uint64(arg1: *mut ::std::os::raw::c_void) -> u64; + pub fn grin_get_uint64(arg1: *const ::std::os::raw::c_void) -> u64; - pub fn grin_get_float(arg1: *mut ::std::os::raw::c_void) -> f32; + pub fn grin_get_float(arg1: *const ::std::os::raw::c_void) -> f32; - pub fn grin_get_double(arg1: *mut ::std::os::raw::c_void) -> f64; + pub fn grin_get_double(arg1: *const ::std::os::raw::c_void) -> f64; - pub fn grin_get_string(arg1: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char; + pub fn grin_get_string(arg1: *const ::std::os::raw::c_void) -> *const ::std::os::raw::c_char; pub fn grin_get_graph_from_storage( arg1: i32, diff --git a/modules/graph/grin/rust/parse.py b/modules/graph/grin/rust/parse.py index 13c7fa4ad..54463e21d 100644 --- a/modules/graph/grin/rust/parse.py +++ b/modules/graph/grin/rust/parse.py @@ -96,8 +96,8 @@ def static_replace(line): replaces = { '::std::os::raw::c_uint': 'u32', '::std::os::raw::c_int': 'i32', - '::std::os::raw::c_ulong': 'u64', - '::std::os::raw::c_long': 'i64', + '::std::os::raw::c_ulonglong': 'u64', + '::std::os::raw::c_longlong': 'i64', } for k in replaces: line = line.replace(k, replaces[k]) diff --git a/modules/graph/grin/src/property/primarykey.cc b/modules/graph/grin/src/property/primarykey.cc index c1ce06392..d75515359 100644 --- a/modules/graph/grin/src/property/primarykey.cc +++ b/modules/graph/grin/src/property/primarykey.cc @@ -66,22 +66,22 @@ GRIN_VERTEX grin_get_vertex_by_primary_keys(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype if (dt == GRIN_DATATYPE::Int32) { auto vid = static_cast(value); auto _v = new GRIN_VERTEX_T(); - _g->GetVertex(*_vtype, *vid, *_v); + if (!_g->GetVertex(*_vtype, *vid, *_v)) return GRIN_NULL_VERTEX; return _v; } else if (dt == GRIN_DATATYPE::UInt32) { auto vid = static_cast(value); auto _v = new GRIN_VERTEX_T(); - _g->GetVertex(*_vtype, *vid, *_v); + if (!_g->GetVertex(*_vtype, *vid, *_v)) return GRIN_NULL_VERTEX; return _v; } else if (dt == GRIN_DATATYPE::Int64) { auto vid = static_cast(value); auto _v = new GRIN_VERTEX_T(); - _g->GetVertex(*_vtype, *vid, *_v); + if (!_g->GetVertex(*_vtype, *vid, *_v)) return GRIN_NULL_VERTEX; return _v; } else if (dt == GRIN_DATATYPE::UInt64) { auto vid = static_cast(value); auto _v = new GRIN_VERTEX_T(); - _g->GetVertex(*_vtype, *vid, *_v); + if (!_g->GetVertex(*_vtype, *vid, *_v)) return GRIN_NULL_VERTEX; return _v; } } diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 2bb163bde..8afb284af 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -47,6 +47,10 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const vpl->push_back(GRIN_VERTEX_PROPERTY_T(vtype, pid)); } } + if (vpl->empty()) { + delete vpl; + return GRIN_NULL_LIST; + } return vpl; } #endif @@ -67,7 +71,9 @@ GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH g, GRIN_EDGE_TYPE e auto _g = static_cast(g)->g; auto _etype = static_cast(etype); auto s = std::string(name); - auto ep = new GRIN_EDGE_PROPERTY_T(*_etype, _g->schema().GetEdgePropertyId(*_etype, s)); + auto _id = _g->schema().GetEdgePropertyId(*_etype, s); + if (_id < 0) return GRIN_NULL_EDGE_PROPERTY; + auto ep = new GRIN_VERTEX_PROPERTY_T(*_etype, _id); return ep; } @@ -81,6 +87,10 @@ GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH g, const cha epl->push_back(GRIN_EDGE_PROPERTY_T(etype, pid)); } } + if (epl->empty()) { + delete epl; + return GRIN_NULL_LIST; + } return epl; } #endif diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index 74af3fa1c..7f8f1afd7 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -59,6 +59,8 @@ bool grin_insert_vertex_property_to_list(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY_ID vpi) { auto _vtype = static_cast(vtype); + auto _g = static_cast(g)->g; + if (vpi >= _g->vertex_property_num(*_vtype)) return GRIN_NULL_VERTEX_PROPERTY; auto vp = new GRIN_VERTEX_PROPERTY_T(*_vtype, vpi); return vp; } @@ -77,7 +79,7 @@ GRIN_EDGE_PROPERTY_LIST grin_get_edge_property_list_by_type(GRIN_GRAPH g, GRIN_E auto _g = static_cast(g)->g; auto _etype = static_cast(etype); auto epl = new GRIN_EDGE_PROPERTY_LIST_T(); - for (auto p = 0; p < _g->edge_property_num(*_etype); ++p) { + for (auto p = 1; p < _g->edge_property_num(*_etype); ++p) { epl->push_back(GRIN_EDGE_PROPERTY_T(*_etype, p)); } return epl; @@ -116,7 +118,9 @@ bool grin_insert_edge_property_to_list(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY_ID epi) { auto _etype = static_cast(etype); - auto ep = new GRIN_EDGE_PROPERTY_T(*_etype, epi); + auto _g = static_cast(g)->g; + if (epi >= _g->edge_property_num(*_etype) - 1) return GRIN_NULL_EDGE_PROPERTY; + auto ep = new GRIN_EDGE_PROPERTY_T(*_etype, epi + 1); return ep; } @@ -124,7 +128,7 @@ GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH g, GRIN_EDGE_TYPE ety auto _etype = static_cast(etype); auto _ep = static_cast(ep); if (*_etype != _ep->first) return GRIN_NULL_NATURAL_ID; - return _ep->second; + return _ep->second - 1; } #endif diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 54de52ae8..5d6aed2b0 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -212,7 +212,7 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP auto offset = _e->eid; auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); - auto _dt = _g->schema().GetVertexPropertyType(_ep->first, _ep->second); + auto _dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); auto dt = ArrowToDataType(_dt); switch (dt) { case GRIN_DATATYPE::Int32: @@ -228,7 +228,13 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP case GRIN_DATATYPE::Double: return new double(*static_cast(result)); case GRIN_DATATYPE::String: - return new std::string(*static_cast(result)); + { + auto s = static_cast(result); + int len = s->length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s->c_str()); + return out; + } case GRIN_DATATYPE::Date32: return new int32_t(*static_cast(result)); case GRIN_DATATYPE::Date64: @@ -248,7 +254,6 @@ GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_ auto _epl = static_cast(epl); if (_e->eid >= _ept->num) return NULL; auto offset = _e->eid; - auto r = new GRIN_ROW_T(); for (auto ep: *_epl) { if (ep.first != _ept->etype) return NULL; diff --git a/modules/graph/grin/src/topology/datatype.cc b/modules/graph/grin/src/topology/datatype.cc index 95c55e122..fb4ac48c3 100644 --- a/modules/graph/grin/src/topology/datatype.cc +++ b/modules/graph/grin/src/topology/datatype.cc @@ -18,30 +18,30 @@ extern "C" { #include "graph/grin/include/topology/datatype.h" } -int grin_get_int32(void* value) { - return *(static_cast(value)); +int grin_get_int32(const void* value) { + return *(static_cast(value)); } -unsigned int grin_get_uint32(void* value) { - return *(static_cast(value)); +unsigned int grin_get_uint32(const void* value) { + return *(static_cast(value)); } -long int grin_get_int64(void* value) { - return *(static_cast(value)); +long long int grin_get_int64(const void* value) { + return *(static_cast(value)); } -unsigned long int grin_get_uint64(void* value) { - return *(static_cast(value)); +unsigned long long int grin_get_uint64(const void* value) { + return *(static_cast(value)); } -float grin_get_float(void* value) { - return *(static_cast(value)); +float grin_get_float(const void* value) { + return *(static_cast(value)); } -double grin_get_double(void* value) { - return *(static_cast(value)); +double grin_get_double(const void* value) { + return *(static_cast(value)); } -char* grin_get_string(void* value) { - return static_cast(value); +const char* grin_get_string(const void* value) { + return static_cast(value); } \ No newline at end of file From ddc9e0da570dfd31e05e4bfae48a2af9ce35cc47 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Sun, 7 May 2023 13:17:08 +0000 Subject: [PATCH 54/85] expand value APIs and remove datatype.h impls --- .devcontainer/devcontainer.json | 67 ++++ modules/graph/grin/.gitignore | 2 +- modules/graph/grin/c/test.c | 7 +- modules/graph/grin/c/test.sh | 2 +- modules/graph/grin/include | 2 +- modules/graph/grin/rust/grin_v6d.rs | 271 +++++++++++++- modules/graph/grin/rust/v6d_all.h | 1 - .../graph/grin/src/property/propertytable.cc | 330 ++++++++++++++++++ modules/graph/grin/src/topology/datatype.cc | 47 --- 9 files changed, 660 insertions(+), 69 deletions(-) create mode 100644 .devcontainer/devcontainer.json delete mode 100644 modules/graph/grin/src/topology/datatype.cc diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..cea539388 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,67 @@ + +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node +{ + "name": "Vineyard", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "registry.cn-hongkong.aliyuncs.com/graphscope/graphscope-dev:latest", + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/common-utils:2":{ + "installZsh": "true", + "configureZshAsDefaultShell": "true", + "installOhMyZsh": true, + "upgradePackages": "false" + } + }, + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + "settings": {}, + "extensions": [ + "streetsidesoftware.code-spell-checker", + "eamodio.gitlens" + ] + } + }, + + // Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "root" + + // Uncomment this to enable C++ and Rust debugging in containers + // "capAdd": ["SYS_PTRACE"], + // "securityOpt": ["seccomp=unconfined"], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [3000], + + // Use 'portsAttributes' to set default properties for specific forwarded ports. + // More info: https://containers.dev/implementors/json_reference/#port-attributes + // "portsAttributes": { + // "9000": { + // "label": "Hello Remote World", + // "onAutoForward": "notify" + // } + // }, + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "yarn install" + + // Improve performance + + // Uncomment these to mount a folder to a volume + // https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-a-targeted-named-volume + // "mounts": [ + // "source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume" + // ], + // "postCreateCommand": "sudo chown graphscope node_modules" + + + // Uncomment these to use a named volume for your entire source tree + // https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-a-named-volume-for-your-entire-source-tree + // "workspaceMount": "source=gs,target=/workspace,type=volume", + // "workspaceFolder": "/workspace" + // "postCreateCommand": "sudo chown -R graphscope:graphscope /workspace" +} diff --git a/modules/graph/grin/.gitignore b/modules/graph/grin/.gitignore index 3653286e7..7fde7df1f 100644 --- a/modules/graph/grin/.gitignore +++ b/modules/graph/grin/.gitignore @@ -1,3 +1,3 @@ /docs/_build/ /docs/Doxyfile.bak -/c/test \ No newline at end of file +/c/ \ No newline at end of file diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index 594a7ac19..dd3bf8e04 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -12,7 +12,6 @@ #include "../include/property/topology.h" #include "../include/property/type.h" #include "../include/topology/adjacentlist.h" -#include "../include/topology/datatype.h" #include "../include/topology/edgelist.h" #include "../include/topology/structure.h" #include "../include/topology/vertexlist.h" @@ -384,8 +383,8 @@ void test_property_vertex_table(int argc, char** argv) { printf("------------ Vertex property table ------------\n"); GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); size_t vtl_size = grin_get_vertex_type_list_size(g, vtl); - for (size_t i = 0; i < vtl_size; ++i) { - GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, i); + for (size_t vt_index = 0; vt_index < vtl_size; ++vt_index) { + GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, vt_index); GRIN_VERTEX_PROPERTY_LIST vpl = grin_get_vertex_property_list_by_type(g, vt); @@ -415,7 +414,7 @@ void test_property_vertex_table(int argc, char** argv) { GRIN_ROW row = grin_get_row_from_vertex_property_table(g, vpt, v, vpl); for (size_t j = 0; j < vpl_size; ++j) { GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, j); - GRIN_VERTEX_PROPERTY vt1 = grin_get_vertex_property_vertex_type(g, vp); + GRIN_VERTEX_TYPE vt1 = grin_get_vertex_property_vertex_type(g, vp); if (!grin_equal_vertex_type(g, vt, vt1)) { printf("vertex type not match by property\n"); } diff --git a/modules/graph/grin/c/test.sh b/modules/graph/grin/c/test.sh index 23b4d306b..ed32de390 100755 --- a/modules/graph/grin/c/test.sh +++ b/modules/graph/grin/c/test.sh @@ -1,3 +1,3 @@ rm -rf ./test gcc test.c -I. -L/home/graphscope/gie-grin/v6d/build/shared-lib/ -lvineyard_grin -lvineyard_graph -lvineyard_basic -o test -./test /home/graphscope/gie-grin/temp/vineyard.sock 130878194502466848 \ No newline at end of file +./test /workspaces/v6d/build/tmp.sock 3493598830228844 \ No newline at end of file diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 860baec5c..8165c6465 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 860baec5c5c9d1bf2bf82b161278038223ce3302 +Subproject commit 8165c6465665c3711dec0d6766aa62750aa5d3c1 diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index c01347b5a..eafc00319 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -114,20 +114,6 @@ extern "C" { arg2: GrinAdjacentListIterator, ) -> GrinEdge; - pub fn grin_get_int32(arg1: *const ::std::os::raw::c_void) -> i32; - - pub fn grin_get_uint32(arg1: *const ::std::os::raw::c_void) -> u32; - - pub fn grin_get_int64(arg1: *const ::std::os::raw::c_void) -> i64; - - pub fn grin_get_uint64(arg1: *const ::std::os::raw::c_void) -> u64; - - pub fn grin_get_float(arg1: *const ::std::os::raw::c_void) -> f32; - - pub fn grin_get_double(arg1: *const ::std::os::raw::c_void) -> f64; - - pub fn grin_get_string(arg1: *const ::std::os::raw::c_void) -> *const ::std::os::raw::c_char; - pub fn grin_get_graph_from_storage( arg1: i32, arg2: *mut *mut ::std::os::raw::c_char, @@ -563,6 +549,59 @@ extern "C" { arg4: usize, ) -> *const ::std::os::raw::c_void; + pub fn grin_get_int32_from_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: usize, + ) -> i32; + + pub fn grin_get_uint32_from_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: usize, + ) -> u32; + + pub fn grin_get_int64_from_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: usize, + ) -> i64; + + pub fn grin_get_uint64_from_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: usize, + ) -> u64; + + pub fn grin_get_float_from_row(arg1: GrinGraph, arg2: GrinRow, arg3: usize) -> f32; + + pub fn grin_get_double_from_row(arg1: GrinGraph, arg2: GrinRow, arg3: usize) -> f64; + + #[cfg(feature = "grin_enable_row")] + pub fn grin_get_string_from_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: usize, + ) -> *const ::std::os::raw::c_char; + + pub fn grin_get_date32_from_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: usize, + ) -> i32; + + pub fn grin_get_time32_from_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: usize, + ) -> i32; + + pub fn grin_get_timestamp64_from_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: usize, + ) -> i64; + #[doc = " @brief create a row, usually to get vertex/edge by primary keys"] #[cfg(feature = "grin_enable_row")] pub fn grin_create_row(arg1: GrinGraph) -> GrinRow; @@ -576,6 +615,68 @@ extern "C" { arg4: *const ::std::os::raw::c_void, ) -> bool; + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_int32_to_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: i32, + ) -> bool; + + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_uint32_to_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: u32, + ) -> bool; + + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_int64_to_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: i64, + ) -> bool; + + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_uint64_to_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: u64, + ) -> bool; + + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_float_to_row(arg1: GrinGraph, arg2: GrinRow, arg3: f32) -> bool; + + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_double_to_row(arg1: GrinGraph, arg2: GrinRow, arg3: f64) -> bool; + + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_string_to_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: *const ::std::os::raw::c_char, + ) -> bool; + + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_date32_to_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: i32, + ) -> bool; + + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_time32_to_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: i32, + ) -> bool; + + #[cfg(feature = "grin_enable_row")] + pub fn grin_insert_timestamp64_to_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: i64, + ) -> bool; + #[doc = " @brief destroy vertex property table\n @param GrinVertexPropertyTable vertex property table"] #[cfg(feature = "grin_enable_vertex_property_table")] pub fn grin_destroy_vertex_property_table(arg1: GrinGraph, arg2: GrinVertexPropertyTable); @@ -596,6 +697,77 @@ extern "C" { arg4: GrinVertexProperty, ) -> *const ::std::os::raw::c_void; + pub fn grin_get_int32_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> i32; + + pub fn grin_get_uint32_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> u32; + + pub fn grin_get_int64_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> i64; + + pub fn grin_get_uint64_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> u64; + + pub fn grin_get_float_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> f32; + + pub fn grin_get_double_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> f64; + + #[cfg(feature = "grin_enable_vertex_property_table")] + pub fn grin_get_string_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> *const ::std::os::raw::c_char; + + pub fn grin_get_date32_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> i32; + + pub fn grin_get_time32_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> i32; + + pub fn grin_get_timestamp64_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> i64; + #[doc = " @brief get vertex row from table\n @param GrinVertexPropertyTable vertex property table\n @param GrinVertex the vertex which is the row index\n @param GrinVertexPropertyList the vertex property list as columns"] #[cfg(all(feature = "grin_enable_vertex_property_table", feature = "grin_enable_row"))] pub fn grin_get_row_from_vertex_property_table( @@ -625,6 +797,77 @@ extern "C" { arg4: GrinEdgeProperty, ) -> *const ::std::os::raw::c_void; + pub fn grin_get_int32_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> i32; + + pub fn grin_get_uint32_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> u32; + + pub fn grin_get_int64_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> i64; + + pub fn grin_get_uint64_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> u64; + + pub fn grin_get_float_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> f32; + + pub fn grin_get_double_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> f64; + + #[cfg(feature = "grin_enable_edge_property_table")] + pub fn grin_get_string_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> *const ::std::os::raw::c_char; + + pub fn grin_get_date32_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> i32; + + pub fn grin_get_time32_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> i32; + + pub fn grin_get_timestamp64_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> i64; + #[doc = " @brief get edge row from table\n @param GrinEdgePropertyTable edge property table\n @param GrinEdge the edge which is the row index\n @param GrinEdgePropertyList the edge property list as columns"] #[cfg(all(feature = "grin_enable_edge_property_table", feature = "grin_enable_row"))] pub fn grin_get_row_from_edge_property_table( diff --git a/modules/graph/grin/rust/v6d_all.h b/modules/graph/grin/rust/v6d_all.h index 2161c5e85..dacf565c0 100644 --- a/modules/graph/grin/rust/v6d_all.h +++ b/modules/graph/grin/rust/v6d_all.h @@ -1,5 +1,4 @@ #include "../include/topology/adjacentlist.h" -#include "../include/topology/datatype.h" #include "../include/topology/edgelist.h" #include "../include/topology/structure.h" #include "../include/topology/vertexlist.h" diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 5d6aed2b0..a24b706a3 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -53,6 +53,60 @@ const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, return NULL; } +int grin_get_int32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +unsigned int grin_get_uint32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +long long int grin_get_int64_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +unsigned long long int grin_get_uint64_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +float grin_get_float_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +double grin_get_double_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +const char* grin_get_string_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + auto s = static_cast((*_r)[idx]); + int len = s->length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s->c_str()); + return out; +} + +int grin_get_date32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +int grin_get_time32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +long long int grin_get_timestamp64_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + GRIN_ROW grin_create_row(GRIN_GRAPH g) { auto r = new GRIN_ROW_T(); return r; @@ -97,6 +151,65 @@ bool grin_insert_value_to_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, const } #endif +bool grin_insert_int32_to_row(GRIN_GRAPH g, GRIN_ROW r, int value) { + auto _r = static_cast(r); + _r->push_back(new int32_t(value)); + return true; +} + +bool grin_insert_uint32_to_row(GRIN_GRAPH g, GRIN_ROW r, unsigned int value) { + auto _r = static_cast(r); + _r->push_back(new uint32_t(value)); + return true; +} + +bool grin_insert_int64_to_row(GRIN_GRAPH g, GRIN_ROW r, long long int value) { + auto _r = static_cast(r); + _r->push_back(new int64_t(value)); + return true; +} + +bool grin_insert_uint64_to_row(GRIN_GRAPH g, GRIN_ROW r, unsigned long long int value) { + auto _r = static_cast(r); + _r->push_back(new uint64_t(value)); + return true; +} + +bool grin_insert_float_to_row(GRIN_GRAPH g, GRIN_ROW r, float value) { + auto _r = static_cast(r); + _r->push_back(new float(value)); + return true; +} + +bool grin_insert_double_to_row(GRIN_GRAPH g, GRIN_ROW r, double value) { + auto _r = static_cast(r); + _r->push_back(new double(value)); + return true;} + +bool grin_insert_string_to_row(GRIN_GRAPH g, GRIN_ROW r, const char* value) { + auto _r = static_cast(r); + char* out = new char[strlen(value) + 1]; + snprintf(out, strlen(value) + 1, "%s", value); + _r->push_back(out); + return true; +} + +bool grin_insert_date32_to_row(GRIN_GRAPH g, GRIN_ROW r, int value) { + auto _r = static_cast(r); + _r->push_back(new int32_t(value)); + return true;} + +bool grin_insert_time32_to_row(GRIN_GRAPH g, GRIN_ROW r, int value) { + auto _r = static_cast(r); + _r->push_back(new int32_t(value)); + return true; +} + +bool grin_insert_timestamp64_to_row(GRIN_GRAPH g, GRIN_ROW r, long long int value) { + auto _r = static_cast(r); + _r->push_back(new int64_t(value)); + return true; +} #ifdef GRIN_ENABLE_VERTEX_PROPERTY_TABLE void grin_destroy_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt) { @@ -154,6 +267,119 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ return NULL; } } + +int grin_get_int32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +unsigned int grin_get_uint32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +long long int grin_get_int64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +unsigned long long int grin_get_uint64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +float grin_get_float_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +double grin_get_double_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result);} + +const char* grin_get_string_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + auto s = static_cast(result); + int len = s->length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s->c_str()); + return out; +} + +int grin_get_date32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +int grin_get_time32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +long long int grin_get_timestamp64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + auto _vp = static_cast(vp); + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} #endif #if defined(GRIN_ENABLE_VERTEX_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) @@ -243,6 +469,110 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP return NULL; } } + +int grin_get_int32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g)->g; + auto _e = static_cast(e); + auto _ep = static_cast(ep); + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +unsigned int grin_get_uint32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g)->g; + auto _e = static_cast(e); + auto _ep = static_cast(ep); + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +long long int grin_get_int64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g)->g; + auto _e = static_cast(e); + auto _ep = static_cast(ep); + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +unsigned long long int grin_get_uint64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g)->g; + auto _e = static_cast(e); + auto _ep = static_cast(ep); + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +float grin_get_float_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g)->g; + auto _e = static_cast(e); + auto _ep = static_cast(ep); + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +double grin_get_double_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g)->g; + auto _e = static_cast(e); + auto _ep = static_cast(ep); + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +const char* grin_get_string_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g)->g; + auto _e = static_cast(e); + auto _ep = static_cast(ep); + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + auto s = static_cast(result); + int len = s->length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s->c_str()); + return out; +} + +int grin_get_date32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g)->g; + auto _e = static_cast(e); + auto _ep = static_cast(ep); + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +int grin_get_time32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g)->g; + auto _e = static_cast(e); + auto _ep = static_cast(ep); + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} + +long long int grin_get_timestamp64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + auto _g = static_cast(g)->g; + auto _e = static_cast(e); + auto _ep = static_cast(ep); + auto offset = _e->eid; + auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + return *static_cast(result); +} #endif #if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) diff --git a/modules/graph/grin/src/topology/datatype.cc b/modules/graph/grin/src/topology/datatype.cc deleted file mode 100644 index fb4ac48c3..000000000 --- a/modules/graph/grin/src/topology/datatype.cc +++ /dev/null @@ -1,47 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "graph/grin/src/predefine.h" -extern "C" { -#include "graph/grin/include/topology/datatype.h" -} - -int grin_get_int32(const void* value) { - return *(static_cast(value)); -} - -unsigned int grin_get_uint32(const void* value) { - return *(static_cast(value)); -} - -long long int grin_get_int64(const void* value) { - return *(static_cast(value)); -} - -unsigned long long int grin_get_uint64(const void* value) { - return *(static_cast(value)); -} - -float grin_get_float(const void* value) { - return *(static_cast(value)); -} - -double grin_get_double(const void* value) { - return *(static_cast(value)); -} - -const char* grin_get_string(const void* value) { - return static_cast(value); -} \ No newline at end of file From 6088c02f3bea915fc9daa160fbf1299ef164a619 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 8 May 2023 06:30:19 +0000 Subject: [PATCH 55/85] impl fast_vertex_ref trait --- modules/graph/grin/c/test.sh | 6 ++++++ modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 13 +++++++++++-- modules/graph/grin/src/partition/reference.cc | 7 +++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/modules/graph/grin/c/test.sh b/modules/graph/grin/c/test.sh index ed32de390..f3ab588b7 100755 --- a/modules/graph/grin/c/test.sh +++ b/modules/graph/grin/c/test.sh @@ -1,3 +1,9 @@ +# launch vineyardd & load modern graph +# 1. copy modern_graph folder from GraphScope/charts/gie-standalone/data to build +# 2. copy v6d_modern_loader to modern_graph folder +# 3. in build folder, run: bin/vineyardd --socket=tmp.sock +# 4. in build folder, run: bin/vineyard-graph-loader --socket=tmp.sock --config modern_graph/config.json + rm -rf ./test gcc test.c -I. -L/home/graphscope/gie-grin/v6d/build/shared-lib/ -lvineyard_grin -lvineyard_graph -lvineyard_basic -o test ./test /workspaces/v6d/build/tmp.sock 3493598830228844 \ No newline at end of file diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 8165c6465..e60778ebd 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 8165c6465665c3711dec0d6766aa62750aa5d3c1 +Subproject commit e60778ebdb62d7bb498fff47958a7314f2f6f7f2 diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 5d3c8e673..43f3c6a1e 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -48,8 +48,9 @@ typedef enum { Float = 5, ///< float Double = 6, ///< double String = 7, ///< string - Date32 = 8, ///< short date - Date64 = 9, ///< long date + Date32 = 8, ///< date + Time32 = 9, ///< Time32 + Timestamp64 = 10, ///< Timestamp } GRIN_DATATYPE; /* Section 1: Toplogy */ @@ -211,6 +212,12 @@ typedef enum { */ #define GRIN_ENABLE_VERTEX_REF +/** @ingroup PartitionMacros + * @brief The storage provides fast reference of vertex, which means + * the vertex ref can be serialized into a int64 using grin_serialize_vertex_ref_as_int64 +*/ +#define GRIN_TRAIT_FAST_VERTEX_REF + /** @ingroup PartitionMacros * @brief The storage provides reference of edge that can be * recognized in other partitions where the edge also appears. @@ -374,6 +381,7 @@ typedef enum { #undef GRIN_ENABLE_GRAPH_PARTITION #undef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION #undef GRIN_ENABLE_VERTEX_REF +#undef GRIN_TRAIT_FAST_VERTEX_REF #undef GRIN_ENABLE_EDGE_REF #undef GRIN_ASSUME_ALL_REPLICATE_PARTITION #undef GRIN_ASSUME_EDGE_CUT_PARTITION @@ -400,6 +408,7 @@ typedef enum { #define GRIN_ENABLE_GRAPH_PARTITION #define GRIN_TRAIT_NATURAL_ID_FOR_PARTITION #define GRIN_ENABLE_VERTEX_REF +#define GRIN_TRAIT_FAST_VERTEX_REF #define GRIN_ASSUME_EDGE_CUT_PARTITION #define GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST // GRIN_END diff --git a/modules/graph/grin/src/partition/reference.cc b/modules/graph/grin/src/partition/reference.cc index 7ed7ef335..e9283afe9 100644 --- a/modules/graph/grin/src/partition/reference.cc +++ b/modules/graph/grin/src/partition/reference.cc @@ -61,6 +61,13 @@ const char* grin_serialize_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { return out; } +#ifdef GRIN_TRAIT_FAST_VERTEX_REF +long long int grin_serialize_vertex_ref_as_int64(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { + auto _vr = static_cast(vr); + return *_vr; +} +#endif + void grin_destroy_serialized_vertex_ref(GRIN_GRAPH g, const char* msg) { delete[] msg; } From b8c41d7c1af13ab2c82290a5eccfa3f27ae137c9 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 8 May 2023 06:47:51 +0000 Subject: [PATCH 56/85] imsync datatype with schema --- modules/graph/grin/src/predefine.cc | 6 ++++-- modules/graph/grin/src/predefine.h | 2 +- .../graph/grin/src/property/propertytable.cc | 17 +++++++++++++---- modules/graph/grin/src/topology/structure.cc | 5 ++++- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 3e1f069b4..303ceb853 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -33,8 +33,10 @@ std::string GetDataTypeName(GRIN_DATATYPE type) { return "string"; case GRIN_DATATYPE::Date32: return "date32"; - case GRIN_DATATYPE::Date64: - return "date64"; + case GRIN_DATATYPE::Time32: + return "time32"; + case GRIN_DATATYPE::Timestamp64: + return "timestamp64"; default: return "undefined"; } diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 80542f9d5..1fe6e439c 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -74,7 +74,7 @@ struct GRIN_DATATYPE_ENUM { template <> struct GRIN_DATATYPE_ENUM { - static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Date64; + static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Timestamp64; }; std::string GetDataTypeName(GRIN_DATATYPE); diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index a24b706a3..6d4889151 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -45,7 +45,9 @@ const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, } case GRIN_DATATYPE::Date32: return new int32_t(*static_cast((*_r)[idx])); - case GRIN_DATATYPE::Date64: + case GRIN_DATATYPE::Time32: + return new int32_t(*static_cast((*_r)[idx])); + case GRIN_DATATYPE::Timestamp64: return new int64_t(*static_cast((*_r)[idx])); default: return NULL; @@ -140,7 +142,10 @@ bool grin_insert_value_to_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, const case GRIN_DATATYPE::Date32: _value = new int32_t(*static_cast(value)); break; - case GRIN_DATATYPE::Date64: + case GRIN_DATATYPE::Time32: + _value = new int32_t(*static_cast(value)); + break; + case GRIN_DATATYPE::Timestamp64: _value = new int64_t(*static_cast(value)); break; default: @@ -261,7 +266,9 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ } case GRIN_DATATYPE::Date32: return new int32_t(*static_cast(result)); - case GRIN_DATATYPE::Date64: + case GRIN_DATATYPE::Time32: + return new int32_t(*static_cast(result)); + case GRIN_DATATYPE::Timestamp64: return new int64_t(*static_cast(result)); default: return NULL; @@ -463,7 +470,9 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP } case GRIN_DATATYPE::Date32: return new int32_t(*static_cast(result)); - case GRIN_DATATYPE::Date64: + case GRIN_DATATYPE::Time32: + return new int32_t(*static_cast(result)); + case GRIN_DATATYPE::Timestamp64: return new int64_t(*static_cast(result)); default: return NULL; diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 3a3e6eb79..9aa9ea067 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -129,7 +129,10 @@ void grin_destroy_value(GRIN_GRAPH g, GRIN_DATATYPE dt, const void* value) { case GRIN_DATATYPE::Date32: delete static_cast(value); break; - case GRIN_DATATYPE::Date64: + case GRIN_DATATYPE::Time32: + delete static_cast(value); + break; + case GRIN_DATATYPE::Timestamp64: delete static_cast(value); break; default: From 05c270f8620fa6eed58f7de5924e54b174e8b8c7 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 8 May 2023 09:24:25 +0000 Subject: [PATCH 57/85] change some handlers into integers for better performance --- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 24 ++--- modules/graph/grin/src/index/order.cc | 2 +- modules/graph/grin/src/partition/partition.cc | 26 ++--- modules/graph/grin/src/partition/reference.cc | 29 +++--- modules/graph/grin/src/predefine.cc | 14 ++- modules/graph/grin/src/predefine.h | 11 ++- modules/graph/grin/src/property/primarykey.cc | 22 ++--- modules/graph/grin/src/property/property.cc | 54 +++------- .../graph/grin/src/property/propertylist.cc | 46 +++------ .../graph/grin/src/property/propertytable.cc | 98 ++++++++----------- modules/graph/grin/src/property/topology.cc | 29 +++--- modules/graph/grin/src/property/type.cc | 86 ++++++---------- .../graph/grin/src/topology/adjacentlist.cc | 4 +- modules/graph/grin/src/topology/vertexlist.cc | 2 +- 15 files changed, 180 insertions(+), 269 deletions(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index e60778ebd..7fd2f4bbf 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit e60778ebdb62d7bb498fff47958a7314f2f6f7f2 +Subproject commit 7fd2f4bbfe459e599afec75a678d8fe3131e623c diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 43f3c6a1e..f72c934d2 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -816,19 +816,19 @@ typedef enum { /** @brief Null list iterator of any kind (invalid return value) */ #define GRIN_NULL_LIST_ITERATOR NULL /** @brief Non-existing partition (invalid return value) */ -#define GRIN_NULL_PARTITION NULL +#define GRIN_NULL_PARTITION (unsigned)~0 /** @brief Null vertex reference (invalid return value) */ -#define GRIN_NULL_VERTEX_REF NULL +#define GRIN_NULL_VERTEX_REF -1 /** @brief Null edge reference (invalid return value) */ #define GRIN_NULL_EDGE_REF NULL /** @brief Non-existing vertex type (invalid return value) */ -#define GRIN_NULL_VERTEX_TYPE NULL +#define GRIN_NULL_VERTEX_TYPE (unsigned)~0 /** @brief Non-existing edge type (invalid return value) */ -#define GRIN_NULL_EDGE_TYPE NULL +#define GRIN_NULL_EDGE_TYPE (unsigned)~0 /** @brief Non-existing vertex property (invalid return value) */ -#define GRIN_NULL_VERTEX_PROPERTY NULL +#define GRIN_NULL_VERTEX_PROPERTY (unsigned long long int)~0 /** @brief Non-existing vertex property (invalid return value) */ -#define GRIN_NULL_EDGE_PROPERTY NULL +#define GRIN_NULL_EDGE_PROPERTY (unsigned long long int)~0 /** @brief Null row (invalid return value) */ #define GRIN_NULL_ROW NULL /** @brief Null natural id of any kind (invalid return value) */ @@ -881,7 +881,7 @@ typedef void* GRIN_EDGE_LIST_ITERATOR; #ifdef GRIN_ENABLE_GRAPH_PARTITION typedef void* GRIN_PARTITIONED_GRAPH; -typedef void* GRIN_PARTITION; +typedef unsigned GRIN_PARTITION; typedef void* GRIN_PARTITION_LIST; #endif @@ -890,7 +890,7 @@ typedef unsigned GRIN_PARTITION_ID; #endif #ifdef GRIN_ENABLE_VERTEX_REF -typedef void* GRIN_VERTEX_REF; +typedef long long int GRIN_VERTEX_REF; #endif #ifdef GRIN_ENABLE_EDGE_REF @@ -899,9 +899,9 @@ typedef void* GRIN_EDGE_REF; #ifdef GRIN_WITH_VERTEX_PROPERTY -typedef void* GRIN_VERTEX_TYPE; +typedef unsigned GRIN_VERTEX_TYPE; typedef void* GRIN_VERTEX_TYPE_LIST; -typedef void* GRIN_VERTEX_PROPERTY; +typedef unsigned long long int GRIN_VERTEX_PROPERTY; typedef void* GRIN_VERTEX_PROPERTY_LIST; typedef void* GRIN_VERTEX_PROPERTY_TABLE; #endif @@ -915,11 +915,11 @@ typedef unsigned GRIN_VERTEX_PROPERTY_ID; #endif #ifdef GRIN_WITH_EDGE_PROPERTY -typedef void* GRIN_EDGE_TYPE; +typedef unsigned GRIN_EDGE_TYPE; typedef void* GRIN_EDGE_TYPE_LIST; typedef void* GRIN_VEV_TYPE; typedef void* GRIN_VEV_TYPE_LIST; -typedef void* GRIN_EDGE_PROPERTY; +typedef unsigned long long int GRIN_EDGE_PROPERTY; typedef void* GRIN_EDGE_PROPERTY_LIST; typedef void* GRIN_EDGE_PROPERTY_TABLE; #endif diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index 3d1f721ca..d81c17d2f 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -29,7 +29,7 @@ size_t grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LI auto _g = static_cast(g)->g; auto _v = static_cast(v); auto _vl = static_cast(vl); - auto vtype = _g->vertex_label(*_v); + auto vtype = (unsigned)_g->vertex_label(*_v); if (vtype < _vl->type_begin || vtype >= _vl->type_end) return GRIN_NULL_SIZE; auto offset = _v->GetValue() - _vl->vrs[vtype - _vl->type_begin].begin_value(); if (offset < _vl->vrs[vtype - _vl->type_begin].size()) { diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index c530f7105..86a6f20db 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -56,7 +56,7 @@ size_t grin_get_total_partitions_number(GRIN_PARTITIONED_GRAPH pg) { GRIN_PARTITION_LIST grin_get_local_partition_list(GRIN_PARTITIONED_GRAPH pg) { auto _pg = static_cast(pg); auto pl = new GRIN_PARTITION_LIST_T(); - for (auto fid = 0; fid < _pg->pg->total_frag_num(); ++fid) { + for (unsigned fid = 0; fid < _pg->pg->total_frag_num(); ++fid) { if (_pg->lgs[fid] != 0) { pl->push_back(fid); } @@ -76,8 +76,7 @@ GRIN_PARTITION_LIST grin_create_partition_list(GRIN_PARTITIONED_GRAPH pg) { bool grin_insert_partition_to_list(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_LIST pl, GRIN_PARTITION p) { auto _pl = static_cast(pl); - auto _p = static_cast(p); - _pl->push_back(*_p); + _pl->push_back(p); return true; } @@ -88,20 +87,14 @@ size_t grin_get_partition_list_size(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_LI GRIN_PARTITION grin_get_partition_from_list(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_LIST pl, size_t idx) { auto _pl = static_cast(pl); - auto p = new GRIN_PARTITION_T((*_pl)[idx]); - return p; + return (*_pl)[idx]; } bool grin_equal_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p1, GRIN_PARTITION p2) { - auto _p1 = static_cast(p1); - auto _p2 = static_cast(p2); - return (*_p1 == *_p2); + return (p1 == p2); } -void grin_destroy_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { - auto _p = static_cast(p); - delete _p; -} +void grin_destroy_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) {} const void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { return NULL; @@ -109,22 +102,19 @@ const void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { auto _pg = static_cast(pg); - auto _p = static_cast(p); auto g = new GRIN_GRAPH_T(); - g->g = _pg->lgs[*_p]; + g->g = _pg->lgs[p]; return g; } #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION GRIN_PARTITION grin_get_partition_from_id(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_ID pid) { - auto p = new GRIN_PARTITION_T(pid); - return p; + return pid; } GRIN_PARTITION_ID grin_get_partition_id(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { - auto _p = static_cast(p); - return *_p; + return p; } #endif diff --git a/modules/graph/grin/src/partition/reference.cc b/modules/graph/grin/src/partition/reference.cc index e9283afe9..44b848472 100644 --- a/modules/graph/grin/src/partition/reference.cc +++ b/modules/graph/grin/src/partition/reference.cc @@ -22,21 +22,15 @@ extern "C" { GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; auto _v = static_cast(v); - auto gid = _g->Vertex2Gid(*_v); - auto vr = new GRIN_VERTEX_REF_T(gid); - return vr; + return _g->Vertex2Gid(*_v); } -void grin_destroy_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { - auto _vr = static_cast(vr); - delete _vr; -} +void grin_destroy_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) {} GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { auto _g = static_cast(g)->g; - auto _vr = static_cast(vr); auto v = new GRIN_VERTEX_T(); - if (_g->Gid2Vertex(*_vr, *v)) { + if (_g->Gid2Vertex(vr, *v)) { return v; } return GRIN_NULL_VERTEX; @@ -44,17 +38,14 @@ GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { auto _g = static_cast(g)->g; - auto _vr = static_cast(vr); auto id_parser = vineyard::IdParser(); id_parser.Init(_g->fnum(), _g->vertex_label_num()); - auto p = new GRIN_PARTITION_T(id_parser.GetFid(*_vr)); - return p; + return id_parser.GetFid(vr); } const char* grin_serialize_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { - auto _vr = static_cast(vr); std::stringstream ss; - ss << *_vr; + ss << vr; int len = ss.str().length() + 1; char* out = new char[len]; snprintf(out, len, "%s", ss.str().c_str()); @@ -63,8 +54,11 @@ const char* grin_serialize_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { #ifdef GRIN_TRAIT_FAST_VERTEX_REF long long int grin_serialize_vertex_ref_as_int64(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { - auto _vr = static_cast(vr); - return *_vr; + return vr; +} + +GRIN_VERTEX_REF grin_deserialize_vertex_ref_from_int64(GRIN_GRAPH g, long long int svr) { + return svr; } #endif @@ -76,8 +70,7 @@ GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH g, const char* msg) { std::stringstream ss(msg); GRIN_VERTEX_REF_T gid; ss >> gid; - auto vr = new GRIN_VERTEX_REF_T(gid); - return vr; + return gid; } bool grin_is_master_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 303ceb853..0a814d3b5 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -105,4 +105,16 @@ void __grin_init_adjacent_list(std::shared_ptr<_GRIN_GRAPH_T> g, GRIN_ADJACENT_L al->data.push_back(ral); } } -#endif \ No newline at end of file +#endif + +unsigned long long int _grin_create_property(unsigned type, unsigned prop) { + return ((unsigned long long int)type << 32) | prop; +} + +unsigned _grin_get_type_from_property(unsigned long long int prop) { + return (unsigned)(prop >> 32); +} + +unsigned _grin_get_prop_from_property(unsigned long long int prop) { + return (unsigned)(prop & 0xffffffff); +} \ No newline at end of file diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 1fe6e439c..84592c21e 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -80,6 +80,13 @@ struct GRIN_DATATYPE_ENUM { std::string GetDataTypeName(GRIN_DATATYPE); GRIN_DATATYPE ArrowToDataType(std::shared_ptr); +unsigned long long int _grin_create_property(unsigned, unsigned); + +unsigned _grin_get_type_from_property(unsigned long long int); + +unsigned _grin_get_prop_from_property(unsigned long long int); + + #define GRIN_OID_T int64_t #define GRIN_VID_T uint64_t @@ -165,7 +172,7 @@ typedef _GRIN_GRAPH_T::vid_t GRIN_VERTEX_REF_T; #ifdef GRIN_WITH_VERTEX_PROPERTY typedef unsigned GRIN_VERTEX_TYPE_T; typedef std::vector GRIN_VERTEX_TYPE_LIST_T; -typedef std::pair GRIN_VERTEX_PROPERTY_T; +typedef unsigned long long int GRIN_VERTEX_PROPERTY_T; typedef std::vector GRIN_VERTEX_PROPERTY_LIST_T; struct GRIN_VERTEX_PROPERTY_TABLE_T { unsigned vtype; @@ -176,7 +183,7 @@ struct GRIN_VERTEX_PROPERTY_TABLE_T { #ifdef GRIN_WITH_EDGE_PROPERTY typedef unsigned GRIN_EDGE_TYPE_T; typedef std::vector GRIN_EDGE_TYPE_LIST_T; -typedef std::pair GRIN_EDGE_PROPERTY_T; +typedef unsigned long long int GRIN_EDGE_PROPERTY_T; typedef std::vector GRIN_EDGE_PROPERTY_LIST_T; struct GRIN_EDGE_PROPERTY_TABLE_T { unsigned etype; diff --git a/modules/graph/grin/src/property/primarykey.cc b/modules/graph/grin/src/property/primarykey.cc index d75515359..7151a952e 100644 --- a/modules/graph/grin/src/property/primarykey.cc +++ b/modules/graph/grin/src/property/primarykey.cc @@ -36,11 +36,10 @@ GRIN_VERTEX_TYPE_LIST grin_get_vertex_types_with_primary_keys(GRIN_GRAPH g) { */ GRIN_VERTEX_PROPERTY_LIST grin_get_primary_keys_by_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { auto _g = static_cast(g)->g; - auto _vtype = static_cast(vtype); auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); - for (auto p = 0; p < _g->vertex_property_num(*_vtype); ++p) { - if (_g->schema().GetVertexPropertyName(*_vtype, p) == "id") { - vpl->push_back(GRIN_VERTEX_PROPERTY_T(*_vtype, p)); + for (auto p = 0; p < _g->vertex_property_num(vtype); ++p) { + if (_g->schema().GetVertexPropertyName(vtype, p) == "id") { + vpl->push_back(_grin_create_property(vtype, p)); break; } } @@ -55,33 +54,32 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_primary_keys_by_vertex_type(GRIN_GRAPH g, GRI */ GRIN_VERTEX grin_get_vertex_by_primary_keys(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_ROW r) { auto _g = static_cast(g)->g; - auto _vtype = static_cast(vtype); auto _r = static_cast(r); auto value = (*_r)[0]; - for (auto p = 0; p < _g->vertex_property_num(*_vtype); ++p) { - if (_g->schema().GetVertexPropertyName(*_vtype, p) == "id") { - auto arrow_dt = _g->schema().GetVertexPropertyType(*_vtype, p); + for (auto p = 0; p < _g->vertex_property_num(vtype); ++p) { + if (_g->schema().GetVertexPropertyName(vtype, p) == "id") { + auto arrow_dt = _g->schema().GetVertexPropertyType(vtype, p); auto dt = ArrowToDataType(arrow_dt); if (dt == GRIN_DATATYPE::Int32) { auto vid = static_cast(value); auto _v = new GRIN_VERTEX_T(); - if (!_g->GetVertex(*_vtype, *vid, *_v)) return GRIN_NULL_VERTEX; + if (!_g->GetVertex(vtype, *vid, *_v)) return GRIN_NULL_VERTEX; return _v; } else if (dt == GRIN_DATATYPE::UInt32) { auto vid = static_cast(value); auto _v = new GRIN_VERTEX_T(); - if (!_g->GetVertex(*_vtype, *vid, *_v)) return GRIN_NULL_VERTEX; + if (!_g->GetVertex(vtype, *vid, *_v)) return GRIN_NULL_VERTEX; return _v; } else if (dt == GRIN_DATATYPE::Int64) { auto vid = static_cast(value); auto _v = new GRIN_VERTEX_T(); - if (!_g->GetVertex(*_vtype, *vid, *_v)) return GRIN_NULL_VERTEX; + if (!_g->GetVertex(vtype, *vid, *_v)) return GRIN_NULL_VERTEX; return _v; } else if (dt == GRIN_DATATYPE::UInt64) { auto vid = static_cast(value); auto _v = new GRIN_VERTEX_T(); - if (!_g->GetVertex(*_vtype, *vid, *_v)) return GRIN_NULL_VERTEX; + if (!_g->GetVertex(vtype, *vid, *_v)) return GRIN_NULL_VERTEX; return _v; } } diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 8afb284af..a6601322f 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -18,8 +18,7 @@ extern "C" { #ifdef GRIN_WITH_VERTEX_PROPERTY_NAME const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { auto _g = static_cast(g)->g; - auto _vp = static_cast(vp); - auto s = _g->schema().GetVertexPropertyName(_vp->first, _vp->second); + auto s = _g->schema().GetVertexPropertyName(_grin_get_type_from_property(vp), _grin_get_prop_from_property(vp)); int len = s.length() + 1; char* out = new char[len]; snprintf(out, len, "%s", s.c_str()); @@ -29,12 +28,10 @@ const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, const char* name) { auto _g = static_cast(g)->g; - auto _vtype = static_cast(vtype); auto s = std::string(name); - auto _id = _g->schema().GetVertexPropertyId(*_vtype, s); + auto _id = _g->schema().GetVertexPropertyId(vtype, s); if (_id < 0) return GRIN_NULL_VERTEX_PROPERTY; - auto vp = new GRIN_VERTEX_PROPERTY_T(*_vtype, _id); - return vp; + return _grin_create_property(vtype, _id); } GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const char* name) { @@ -44,7 +41,7 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const for (auto vtype = 0; vtype < _g->vertex_label_num(); ++vtype) { auto pid = _g->schema().GetVertexPropertyId(vtype, s); if (pid >= 0) { - vpl->push_back(GRIN_VERTEX_PROPERTY_T(vtype, pid)); + vpl->push_back(_grin_create_property(vtype, pid)); } } if (vpl->empty()) { @@ -58,8 +55,7 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const #ifdef GRIN_WITH_EDGE_PROPERTY_NAME const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; - auto _ep = static_cast(ep); - auto s = _g->schema().GetEdgePropertyName(_ep->first, _ep->second); + auto s = _g->schema().GetEdgePropertyName(_grin_get_type_from_property(ep), _grin_get_prop_from_property(ep)); int len = s.length() + 1; char* out = new char[len]; snprintf(out, len, "%s", s.c_str()); @@ -69,12 +65,10 @@ const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, const char* name) { auto _g = static_cast(g)->g; - auto _etype = static_cast(etype); auto s = std::string(name); - auto _id = _g->schema().GetEdgePropertyId(*_etype, s); + auto _id = _g->schema().GetEdgePropertyId(etype, s); if (_id < 0) return GRIN_NULL_EDGE_PROPERTY; - auto ep = new GRIN_VERTEX_PROPERTY_T(*_etype, _id); - return ep; + return _grin_create_property(etype, _id); } GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH g, const char* name) { @@ -84,7 +78,7 @@ GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH g, const cha for (auto etype = 0; etype < _g->edge_label_num(); ++etype) { auto pid = _g->schema().GetEdgePropertyId(etype, s); if (pid >= 0) { - epl->push_back(GRIN_EDGE_PROPERTY_T(etype, pid)); + epl->push_back(_grin_create_property(etype, pid)); } } if (epl->empty()) { @@ -98,53 +92,37 @@ GRIN_EDGE_PROPERTY_LIST grin_get_edge_properties_by_name(GRIN_GRAPH g, const cha #ifdef GRIN_WITH_VERTEX_PROPERTY bool grin_equal_vertex_property(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp1, GRIN_VERTEX_PROPERTY vp2) { - auto _vp1 = static_cast(vp1); - auto _vp2 = static_cast(vp2); - return (*_vp1 == *_vp2); + return (vp1 == vp2); } -void grin_destroy_vertex_property(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { - auto _vp = static_cast(vp); - delete _vp; -} +void grin_destroy_vertex_property(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) {} GRIN_DATATYPE grin_get_vertex_property_data_type(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { auto _g = static_cast(g)->g; - auto _vp = static_cast(vp); - auto dt = _g->schema().GetVertexPropertyType(_vp->first, _vp->second); + auto dt = _g->schema().GetVertexPropertyType(_grin_get_type_from_property(vp), _grin_get_prop_from_property(vp)); return ArrowToDataType(dt); } GRIN_VERTEX_TYPE grin_get_vertex_property_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { - auto _vp = static_cast(vp); - auto vt = new GRIN_VERTEX_TYPE_T(_vp->first); - return vt; + return _grin_get_type_from_property(vp); } #endif #ifdef GRIN_WITH_EDGE_PROPERTY bool grin_equal_edge_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep1, GRIN_EDGE_PROPERTY ep2) { - auto _ep1 = static_cast(ep1); - auto _ep2 = static_cast(ep2); - return (*_ep1 == *_ep2); + return (ep1 == ep2); } -void grin_destroy_edge_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { - auto _ep = static_cast(ep); - delete _ep; -} +void grin_destroy_edge_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) {} GRIN_DATATYPE grin_get_edge_property_data_type(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; - auto _ep = static_cast(ep); - auto dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); + auto dt = _g->schema().GetEdgePropertyType(_grin_get_type_from_property(ep), _grin_get_prop_from_property(ep)); return ArrowToDataType(dt); } GRIN_EDGE_TYPE grin_get_edge_property_edge_type(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { - auto _ep = static_cast(ep); - auto et = new GRIN_EDGE_TYPE_T(_ep->first); - return et; + return _grin_get_type_from_property(ep); } #endif diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index 7f8f1afd7..a4cf2a8f0 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -18,10 +18,9 @@ extern "C" { #ifdef GRIN_WITH_VERTEX_PROPERTY GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_property_list_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { auto _g = static_cast(g)->g; - auto _vtype = static_cast(vtype); auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); - for (auto p = 0; p < _g->vertex_property_num(*_vtype); ++p) { - vpl->push_back(GRIN_VERTEX_PROPERTY_T(*_vtype, p)); + for (auto p = 0; p < _g->vertex_property_num(vtype); ++p) { + vpl->push_back(_grin_create_property(vtype, p)); } return vpl; } @@ -33,8 +32,7 @@ size_t grin_get_vertex_property_list_size(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIS GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_list(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl, size_t idx) { auto _vpl = static_cast(vpl); - auto vp = new GRIN_VERTEX_PROPERTY_T((*_vpl)[idx]); - return vp; + return (*_vpl)[idx]; } GRIN_VERTEX_PROPERTY_LIST grin_create_vertex_property_list(GRIN_GRAPH g) { @@ -49,8 +47,7 @@ void grin_destroy_vertex_property_list(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST v bool grin_insert_vertex_property_to_list(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl, GRIN_VERTEX_PROPERTY vp) { auto _vpl = static_cast(vpl); - auto _vp = static_cast(vp); - _vpl->push_back(*_vp); + _vpl->push_back(vp); return true; } #endif @@ -58,18 +55,14 @@ bool grin_insert_vertex_property_to_list(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY_ID vpi) { - auto _vtype = static_cast(vtype); auto _g = static_cast(g)->g; - if (vpi >= _g->vertex_property_num(*_vtype)) return GRIN_NULL_VERTEX_PROPERTY; - auto vp = new GRIN_VERTEX_PROPERTY_T(*_vtype, vpi); - return vp; + if (vpi >= _g->vertex_property_num(vtype)) return GRIN_NULL_VERTEX_PROPERTY; + return _grin_create_property(vtype, vpi); } GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY vp) { - auto _vtype = static_cast(vtype); - auto _vp = static_cast(vp); - if (*_vtype != _vp->first) return GRIN_NULL_NATURAL_ID; - return _vp->second; + if (vtype != _grin_get_type_from_property(vp)) return GRIN_NULL_NATURAL_ID; + return _grin_get_prop_from_property(vp); } #endif @@ -77,10 +70,9 @@ GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_GRAPH g, GRIN_VERTEX_TY #ifdef GRIN_WITH_EDGE_PROPERTY GRIN_EDGE_PROPERTY_LIST grin_get_edge_property_list_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g)->g; - auto _etype = static_cast(etype); auto epl = new GRIN_EDGE_PROPERTY_LIST_T(); - for (auto p = 1; p < _g->edge_property_num(*_etype); ++p) { - epl->push_back(GRIN_EDGE_PROPERTY_T(*_etype, p)); + for (auto p = 1; p < _g->edge_property_num(etype); ++p) { + epl->push_back(_grin_create_property(etype, p)); } return epl; } @@ -92,8 +84,7 @@ size_t grin_get_edge_property_list_size(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST ep GRIN_EDGE_PROPERTY grin_get_edge_property_from_list(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl, size_t idx) { auto _epl = static_cast(epl); - auto ep = new GRIN_EDGE_PROPERTY_T((*_epl)[idx]); - return ep; + return (*_epl)[idx]; } GRIN_EDGE_PROPERTY_LIST grin_create_edge_property_list(GRIN_GRAPH g) { @@ -108,8 +99,7 @@ void grin_destroy_edge_property_list(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl) bool grin_insert_edge_property_to_list(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl, GRIN_EDGE_PROPERTY ep) { auto _epl = static_cast(epl); - auto _ep = static_cast(ep); - _epl->push_back(*_ep); + _epl->push_back(ep); return true; } #endif @@ -117,18 +107,14 @@ bool grin_insert_edge_property_to_list(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY_ID epi) { - auto _etype = static_cast(etype); auto _g = static_cast(g)->g; - if (epi >= _g->edge_property_num(*_etype) - 1) return GRIN_NULL_EDGE_PROPERTY; - auto ep = new GRIN_EDGE_PROPERTY_T(*_etype, epi + 1); - return ep; + if (epi >= _g->edge_property_num(etype) - 1) return GRIN_NULL_EDGE_PROPERTY; + return _grin_create_property(etype, epi + 1); } GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY ep) { - auto _etype = static_cast(etype); - auto _ep = static_cast(ep); - if (*_etype != _ep->first) return GRIN_NULL_NATURAL_ID; - return _ep->second - 1; + if (etype != _grin_get_type_from_property(ep)) return GRIN_NULL_NATURAL_ID; + return _grin_get_prop_from_property(ep) - 1; } #endif diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 6d4889151..e0baec234 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -224,10 +224,9 @@ void grin_destroy_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { auto _g = static_cast(g)->g; - auto _vtype = static_cast(vtype); auto vpt = new GRIN_VERTEX_PROPERTY_TABLE_T(); - vpt->vtype = *_vtype; - vpt->vertices = _g->InnerVertices(*_vtype); + vpt->vtype = vtype; + vpt->vertices = _g->InnerVertices(vtype); return vpt; } @@ -236,12 +235,13 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); - if (_vp->first != _vpt->vtype || !_vpt->vertices.Contain(*_v)) return NULL; + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) return NULL; auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); - auto _dt = _g->schema().GetVertexPropertyType(_vp->first, _vp->second); + auto _dt = _g->schema().GetVertexPropertyType(vtype, vprop); auto dt = ArrowToDataType(_dt); switch (dt) { case GRIN_DATATYPE::Int32: @@ -279,9 +279,8 @@ int grin_get_int32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -290,9 +289,8 @@ unsigned int grin_get_uint32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTE auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -301,9 +299,8 @@ long long int grin_get_int64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTE auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -312,9 +309,8 @@ unsigned long long int grin_get_uint64_from_vertex_property_table(GRIN_GRAPH g, auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -323,9 +319,8 @@ float grin_get_float_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPER auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -334,9 +329,8 @@ double grin_get_double_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROP auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result);} @@ -344,9 +338,8 @@ const char* grin_get_string_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); auto s = static_cast(result); int len = s->length() + 1; @@ -359,9 +352,8 @@ int grin_get_date32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERT auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -370,9 +362,8 @@ int grin_get_time32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERT auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -381,9 +372,8 @@ long long int grin_get_timestamp64_from_vertex_property_table(GRIN_GRAPH g, GRIN auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); - auto _vp = static_cast(vp); auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_vp->first)->column(_vp->second)->chunk(0); + auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -401,8 +391,9 @@ GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPE auto r = new GRIN_ROW_T(); for (auto vp: *_vpl) { - if (vp.first != _vpt->vtype) return NULL; - auto array = _g->vertex_data_table(vp.first)->column(vp.second)->chunk(0); + unsigned vtype = _grin_get_type_from_property(vp); + if (vtype != _vpt->vtype) return NULL; + auto array = _g->vertex_data_table(vtype)->column(_grin_get_prop_from_property(vp))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); r->push_back(result); } @@ -428,10 +419,9 @@ void grin_destroy_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g)->g; - auto _etype = static_cast(etype); auto ept = new GRIN_EDGE_PROPERTY_TABLE_T(); - ept->etype = *_etype; - ept->num = _g->edge_data_table(*_etype)->num_rows(); + ept->etype = etype; + ept->num = _g->edge_data_table(etype)->num_rows(); return ept; } @@ -440,12 +430,13 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); - auto _ep = static_cast(ep); - if (_ep->first != _ept->etype || _e->eid >= _ept->num) return NULL; + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) return NULL; auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); - auto _dt = _g->schema().GetEdgePropertyType(_ep->first, _ep->second); + auto _dt = _g->schema().GetEdgePropertyType(etype, eprop); auto dt = ArrowToDataType(_dt); switch (dt) { case GRIN_DATATYPE::Int32: @@ -482,9 +473,8 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP int grin_get_int32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto _e = static_cast(e); - auto _ep = static_cast(ep); auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -492,9 +482,8 @@ int grin_get_int32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TAB unsigned int grin_get_uint32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto _e = static_cast(e); - auto _ep = static_cast(ep); auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -502,9 +491,8 @@ unsigned int grin_get_uint32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PR long long int grin_get_int64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto _e = static_cast(e); - auto _ep = static_cast(ep); auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -512,9 +500,8 @@ long long int grin_get_int64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PR unsigned long long int grin_get_uint64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto _e = static_cast(e); - auto _ep = static_cast(ep); auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -522,9 +509,8 @@ unsigned long long int grin_get_uint64_from_edge_property_table(GRIN_GRAPH g, GR float grin_get_float_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto _e = static_cast(e); - auto _ep = static_cast(ep); auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -532,9 +518,8 @@ float grin_get_float_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_T double grin_get_double_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto _e = static_cast(e); - auto _ep = static_cast(ep); auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -542,9 +527,8 @@ double grin_get_double_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY const char* grin_get_string_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto _e = static_cast(e); - auto _ep = static_cast(ep); auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); auto s = static_cast(result); int len = s->length() + 1; @@ -556,9 +540,8 @@ const char* grin_get_string_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PRO int grin_get_date32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto _e = static_cast(e); - auto _ep = static_cast(ep); auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -566,9 +549,8 @@ int grin_get_date32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TA int grin_get_time32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto _e = static_cast(e); - auto _ep = static_cast(ep); auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -576,9 +558,8 @@ int grin_get_time32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TA long long int grin_get_timestamp64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto _e = static_cast(e); - auto _ep = static_cast(ep); auto offset = _e->eid; - auto array = _g->edge_data_table(_ep->first)->column(_ep->second)->chunk(0); + auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -595,8 +576,9 @@ GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_ auto offset = _e->eid; auto r = new GRIN_ROW_T(); for (auto ep: *_epl) { - if (ep.first != _ept->etype) return NULL; - auto array = _g->edge_data_table(ep.first)->column(ep.second)->chunk(0); + unsigned etype = _grin_get_type_from_property(ep); + if (etype != _ept->etype) return NULL; + auto array = _g->edge_data_table(etype)->column(_grin_get_prop_from_property(ep))->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); r->push_back(result); } diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index 0559d2511..ca9d055a1 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -18,33 +18,29 @@ extern "C" { #ifdef GRIN_WITH_VERTEX_PROPERTY size_t grin_get_vertex_num_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { auto _g = static_cast(g)->g; - auto _vtype = static_cast(vtype); - return _g->GetVerticesNum(*_vtype); + return _g->GetVerticesNum(vtype); } #endif #ifdef GRIN_WITH_EDGE_PROPERTY size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g)->g; - auto _etype = static_cast(etype); - return _g->edge_data_table(*_etype)->num_rows(); + return _g->edge_data_table(etype)->num_rows(); } #endif #if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_WITH_VERTEX_PROPERTY) size_t grin_get_total_vertex_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_VERTEX_TYPE vtype) { auto _pg = static_cast(pg); - auto _vtype = static_cast(vtype); if (_pg->lgs.size() == 0) return 0; - return _pg->lgs[0]->GetTotalVerticesNum(*_vtype); + return _pg->lgs[0]->GetTotalVerticesNum(vtype); } #endif #if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_WITH_EDGE_PROPERTY) size_t grin_get_total_edge_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_EDGE_TYPE etype) { auto _pg = static_cast(pg); - auto _etype = static_cast(etype); - return _pg->pg->total_edge_num_by_type(*_etype); + return _pg->pg->total_edge_num_by_type(etype); } #endif @@ -52,11 +48,10 @@ size_t grin_get_total_edge_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_EDGE_TYPE #ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_ORIGINAL_ID oid) { auto _g = static_cast(g)->g; - auto _vtype = static_cast(vtype); auto _oid = static_cast(oid); _GRIN_GRAPH_T::vid_t gid; auto v = new GRIN_VERTEX_T(); - if (_g->Oid2Gid(*_vtype, *_oid, gid)) { + if (_g->Oid2Gid(vtype, *_oid, gid)) { if (_g->Gid2Vertex(gid, *v)) { return v; } @@ -68,14 +63,13 @@ GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_T #ifdef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST GRIN_VERTEX_LIST grin_select_type_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_LIST vl) { auto _g = static_cast(g)->g; - auto _vtype = static_cast(vtype); auto _vl = static_cast(vl); - if (_vl->type_begin > *_vtype || _vl->type_end <= *_vtype) return GRIN_NULL_LIST; + if (_vl->type_begin > vtype || _vl->type_end <= vtype) return GRIN_NULL_LIST; auto fvl = new GRIN_VERTEX_LIST_T(); fvl->all_master_mirror = _vl->all_master_mirror; - fvl->type_begin = *_vtype; - fvl->type_end = *_vtype + 1; + fvl->type_begin = vtype; + fvl->type_end = vtype + 1; __grin_init_vertex_list(_g, fvl); return fvl; } @@ -92,16 +86,15 @@ GRIN_ADJACENT_LIST grin_select_neighbor_type_for_adjacent_list(GRIN_GRAPH, GRIN_ #ifdef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST GRIN_ADJACENT_LIST grin_select_edge_type_for_adjacent_list(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_ADJACENT_LIST al) { auto _g = static_cast(g)->g; - auto _etype = static_cast(etype); auto _al = static_cast(al); - if (_al->etype_begin > *_etype || _al->etype_end <= *_etype) return GRIN_NULL_LIST; + if (_al->etype_begin > etype || _al->etype_end <= etype) return GRIN_NULL_LIST; auto fal = new GRIN_ADJACENT_LIST_T(); fal->vid = _al->vid; fal->dir = _al->dir; - fal->etype_begin = *_etype; - fal->etype_end = *_etype + 1; + fal->etype_begin = etype; + fal->etype_end = etype + 1; __grin_init_adjacent_list(_g, fal); return fal; } diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 7f0623cad..9a7139f77 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -17,22 +17,16 @@ extern "C" { #ifdef GRIN_WITH_VERTEX_PROPERTY bool grin_equal_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt1, GRIN_VERTEX_TYPE vt2) { - auto _vt1 = static_cast(vt1); - auto _vt2 = static_cast(vt2); - return (*_vt1 == *_vt2); + return (vt1 == vt2); } GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; auto _v = static_cast(v); - auto vt = new GRIN_VERTEX_TYPE_T(_g->vertex_label(*_v)); - return vt; + return _g->vertex_label(*_v); } -void grin_destroy_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { - auto _vt = static_cast(vt); - delete _vt; -} +void grin_destroy_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) {} GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH g) { auto _g = static_cast(g)->g; @@ -53,10 +47,9 @@ GRIN_VERTEX_TYPE_LIST grin_create_vertex_type_list(GRIN_GRAPH g) { return vtl; } -bool grin_insert_vertex_type_to_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE_LIST vtl, GRIN_VERTEX_TYPE vt) { +bool grin_insert_vertex_type_to_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE_LIST vtl, GRIN_VERTEX_TYPE vtype) { auto _vtl = static_cast(vtl); - auto _vt = static_cast(vt); - _vtl->push_back(*_vt); + _vtl->push_back(vtype); return true; } @@ -67,16 +60,14 @@ size_t grin_get_vertex_type_list_size(GRIN_GRAPH g, GRIN_VERTEX_TYPE_LIST vtl) { GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE_LIST vtl, size_t idx) { auto _vtl = static_cast(vtl); - auto vt = new GRIN_VERTEX_TYPE_T((*_vtl)[idx]); - return vt; + return (*_vtl)[idx]; } #endif #ifdef GRIN_WITH_VERTEX_TYPE_NAME -const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { +const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { auto _g = static_cast(g)->g; - auto _vt = static_cast(vt); - auto s = _g->schema().GetVertexLabelName(*_vt); + auto s = _g->schema().GetVertexLabelName(vtype); int len = s.length() + 1; char* out = new char[len]; snprintf(out, len, "%s", s.c_str()); @@ -88,41 +79,32 @@ GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { auto s = std::string(name); auto _id = _g->schema().GetVertexLabelId(s); if (_id == -1 ) return GRIN_NULL_VERTEX_TYPE; - auto vt = new GRIN_VERTEX_TYPE_T(_id); - return vt; + return _id; } #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE -GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) { - auto _vt = static_cast(vt); - return *_vt; +GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { + return vtype; } GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE_ID vti) { - auto vt = new GRIN_VERTEX_TYPE_T(vti); - return vt; + return vti; } #endif #ifdef GRIN_WITH_EDGE_PROPERTY bool grin_equal_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE et1, GRIN_EDGE_TYPE et2) { - auto _et1 = static_cast(et1); - auto _et2 = static_cast(et2); - return (*_et1 == *_et2); + return (et1 == et2); } GRIN_EDGE_TYPE grin_get_edge_type(GRIN_GRAPH g, GRIN_EDGE e) { auto _e = static_cast(e); - auto et = new GRIN_EDGE_TYPE_T(_e->etype); - return et; + return _e->etype; } -void grin_destroy_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { - auto _et = static_cast(et); - delete _et; -} +void grin_destroy_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) {} GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH g) { auto _g = static_cast(g)->g; @@ -143,10 +125,9 @@ GRIN_EDGE_TYPE_LIST grin_create_edge_type_list(GRIN_GRAPH g) { return etl; } -bool grin_insert_edge_type_to_list(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST etl, GRIN_EDGE_TYPE et) { +bool grin_insert_edge_type_to_list(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST etl, GRIN_EDGE_TYPE etype) { auto _etl = static_cast(etl); - auto _et = static_cast(et); - _etl->push_back(*_et); + _etl->push_back(etype); return true; } @@ -157,16 +138,14 @@ size_t grin_get_edge_type_list_size(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST etl) { GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST etl, size_t idx) { auto _etl = static_cast(etl); - auto et = new GRIN_VERTEX_TYPE_T((*_etl)[idx]); - return et; + return (*_etl)[idx]; } #endif #ifdef GRIN_WITH_EDGE_TYPE_NAME -const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { +const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g)->g; - auto _et = static_cast(et); - auto s = _g->schema().GetEdgeLabelName(*_et); + auto s = _g->schema().GetEdgeLabelName(etype); int len = s.length() + 1; char* out = new char[len]; snprintf(out, len, "%s", s.c_str()); @@ -178,21 +157,18 @@ GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { auto s = std::string(name); auto _id = _g->schema().GetEdgeLabelId(s); if (_id == -1) return GRIN_NULL_EDGE_TYPE; - auto et = new GRIN_EDGE_TYPE_T(_id); - return et; + return _id; } #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE -GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_GRAPH g, GRIN_EDGE_TYPE et) { - auto _et = static_cast(et); - return *_et; +GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { + return etype; } GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_GRAPH g, GRIN_EDGE_TYPE_ID eti) { - auto et = new GRIN_EDGE_TYPE_T(eti); - return et; + return eti; } #endif @@ -200,8 +176,7 @@ GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_GRAPH g, GRIN_EDGE_TYPE_ID eti) { #if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_WITH_EDGE_PROPERTY) GRIN_VERTEX_TYPE_LIST grin_get_src_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g)->g; - auto _etype = static_cast(etype); - auto entry = _g->schema().GetEntry(*_etype, "EDGE"); + auto entry = _g->schema().GetEntry(etype, "EDGE"); auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); for (auto& pair : entry.relations) { vtl->push_back(GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(pair.first))); @@ -211,8 +186,7 @@ GRIN_VERTEX_TYPE_LIST grin_get_src_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_ GRIN_VERTEX_TYPE_LIST grin_get_dst_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g)->g; - auto _etype = static_cast(etype); - auto entry = _g->schema().GetEntry(*_etype, "EDGE"); + auto entry = _g->schema().GetEntry(etype, "EDGE"); auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); for (auto& pair : entry.relations) { vtl->push_back(GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(pair.second))); @@ -223,17 +197,15 @@ GRIN_VERTEX_TYPE_LIST grin_get_dst_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_ GRIN_EDGE_TYPE_LIST grin_get_edge_types_from_vertex_type_pair(GRIN_GRAPH g, GRIN_VERTEX_TYPE src_vt, GRIN_VERTEX_TYPE dst_vt) { auto _g = static_cast(g)->g; - auto _v1 = static_cast(src_vt); - auto _v2 = static_cast(dst_vt); - auto str_v1 = _g->schema().GetVertexLabelName(*_v1); - auto str_v2 = _g->schema().GetVertexLabelName(*_v2); + auto str_v1 = _g->schema().GetVertexLabelName(src_vt); + auto str_v2 = _g->schema().GetVertexLabelName(dst_vt); auto etl = new GRIN_EDGE_TYPE_LIST_T(); for (auto etype = 0; etype < _g->edge_label_num(); ++etype) { auto entry = _g->schema().GetEntry(etype, "EDGE"); for (auto& pair : entry.relations) { if (pair.first == str_v1 && pair.second == str_v2) { - etl->push_back(GRIN_EDGE_TYPE_T(etype)); + etl->push_back((unsigned)etype); } } } diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 9d3ba610d..08dace76a 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -44,7 +44,7 @@ size_t grin_get_adjacent_list_size(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { auto _al = static_cast(al); - for (auto i = 0; i < _al->etype_end - _al->etype_begin; ++i) { + for (unsigned i = 0; i < _al->etype_end - _al->etype_begin; ++i) { if (idx < _al->offsets[i+1]) { auto _idx = idx - _al->offsets[i]; auto _nbr = _al->data[i].begin() + _idx; @@ -57,7 +57,7 @@ GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIS GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { auto _al = static_cast(al); - for (auto i = 0; i < _al->etype_end - _al->etype_begin; ++i) { + for (unsigned i = 0; i < _al->etype_end - _al->etype_begin; ++i) { if (idx < _al->offsets[i+1]) { auto _idx = idx - _al->offsets[i]; auto _nbr = _al->data[i].begin() + _idx; diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index acd0aad7c..552cde391 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -40,7 +40,7 @@ size_t grin_get_vertex_list_size(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t idx) { auto _vl = static_cast(vl); - for (auto i = 0; i < _vl->type_end - _vl->type_begin; ++i) { + for (unsigned i = 0; i < _vl->type_end - _vl->type_begin; ++i) { if (idx < _vl->offsets[i+1]) { auto _idx = idx - _vl->offsets[i]; auto v = new GRIN_VERTEX_T(_vl->vrs[i].begin_value() + _idx); From 6dfe5b9b27a45690d37ace2339b974f9ed03c5bc Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 8 May 2023 09:33:07 +0000 Subject: [PATCH 58/85] add fast vertex ref to message --- modules/graph/grin/include | 2 +- modules/graph/grin/src/proto/graph.pb.cc | 177 +++++++++++++---------- modules/graph/grin/src/proto/graph.pb.h | 31 ++++ modules/graph/grin/src/proto/message.cc | 4 + 4 files changed, 136 insertions(+), 78 deletions(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 7fd2f4bbf..e6d05fc59 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 7fd2f4bbfe459e599afec75a678d8fe3131e623c +Subproject commit e6d05fc5974edf34bc6591c8f0ea48420ee6f9b7 diff --git a/modules/graph/grin/src/proto/graph.pb.cc b/modules/graph/grin/src/proto/graph.pb.cc index e73759c2d..7525c81eb 100644 --- a/modules/graph/grin/src/proto/graph.pb.cc +++ b/modules/graph/grin/src/proto/graph.pb.cc @@ -285,6 +285,7 @@ const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_graph_2eproto::offsets[] PROTO PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_partition_for_edge_list_), PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_master_neighbor_for_adjacent_list_), PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_neighbor_partition_for_adjacent_list_), + PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_fast_vertex_ref_), ~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _internal_metadata_), ~0u, // no _extensions_ @@ -375,14 +376,14 @@ static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOB { 0, -1, sizeof(::grin::TopologyFeature)}, { 14, -1, sizeof(::grin::MirrorPartitionListFeature)}, { 23, -1, sizeof(::grin::PartitionFeature)}, - { 41, -1, sizeof(::grin::VertexPropertyFeature)}, - { 54, -1, sizeof(::grin::EdgePropertyFeature)}, - { 66, -1, sizeof(::grin::PropertyFeature)}, - { 83, -1, sizeof(::grin::IndexFeature)}, - { 91, -1, sizeof(::grin::PredicateFeature)}, - { 96, -1, sizeof(::grin::StorageFeature)}, - { 107, -1, sizeof(::grin::Statistics)}, - { 117, -1, sizeof(::grin::Graph)}, + { 42, -1, sizeof(::grin::VertexPropertyFeature)}, + { 55, -1, sizeof(::grin::EdgePropertyFeature)}, + { 67, -1, sizeof(::grin::PropertyFeature)}, + { 84, -1, sizeof(::grin::IndexFeature)}, + { 92, -1, sizeof(::grin::PredicateFeature)}, + { 97, -1, sizeof(::grin::StorageFeature)}, + { 108, -1, sizeof(::grin::Statistics)}, + { 118, -1, sizeof(::grin::Graph)}, }; static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { @@ -416,7 +417,7 @@ const char descriptor_table_protodef_graph_2eproto[] PROTOBUF_SECTION_VARIABLE(p "t_mirror_vertex_mirror_partition_list\030\002 " "\001(\010\0224\n,grin_trait_master_edge_mirror_par" "tition_list\030\003 \001(\010\0224\n,grin_trait_mirror_e" - "dge_mirror_partition_list\030\004 \001(\010\"\277\005\n\020Part" + "dge_mirror_partition_list\030\004 \001(\010\"\343\005\n\020Part" "itionFeature\022>\n\030graph_partition_strategy" "\030\001 \001(\0162\034.grin.GraphPartitionStrategy\022+\n#" "grin_trait_natural_id_for_partition\030\002 \001(" @@ -434,65 +435,66 @@ const char descriptor_table_protodef_graph_2eproto[] PROTOBUF_SECTION_VARIABLE(p "e_list\030\013 \001(\010\022;\n3grin_trait_select_master" "_neighbor_for_adjacent_list\030\014 \001(\010\022>\n6gri" "n_trait_select_neighbor_partition_for_ad" - "jacent_list\030\r \001(\010\"\354\002\n\025VertexPropertyFeat" - "ure\022!\n\031grin_with_vertex_property\030\001 \001(\010\022&" - "\n\036grin_with_vertex_property_name\030\002 \001(\010\022\"" - "\n\032grin_with_vertex_type_name\030\003 \001(\010\022)\n!gr" - "in_enable_vertex_property_table\030\004 \001(\010\022\'\n" - "\037grin_enable_vertex_primary_keys\030\005 \001(\010\022-" - "\n%grin_trait_natural_id_for_vertex_type\030" - "\006 \001(\010\0221\n)grin_trait_natural_id_for_verte" - "x_property\030\007 \001(\010\022.\n&grin_assume_by_type_" - "vertex_original_id\030\010 \001(\010\"\254\002\n\023EdgePropert" - "yFeature\022\037\n\027grin_with_edge_property\030\001 \001(" - "\010\022$\n\034grin_with_edge_property_name\030\002 \001(\010\022" - " \n\030grin_with_edge_type_name\030\003 \001(\010\022\'\n\037gri" - "n_enable_edge_property_table\030\004 \001(\010\022%\n\035gr" - "in_enable_edge_primary_keys\030\005 \001(\010\022+\n#gri" - "n_trait_natural_id_for_edge_type\030\006 \001(\010\022/" - "\n\'grin_trait_natural_id_for_edge_propert" - "y\030\007 \001(\010\"\200\005\n\017PropertyFeature\022\027\n\017grin_enab" - "le_row\030\001 \001(\010\022<\n\027vertex_property_feature\030" - "\002 \001(\0132\033.grin.VertexPropertyFeature\0228\n\025ed" - "ge_property_feature\030\003 \001(\0132\031.grin.EdgePro" - "pertyFeature\022<\n\017vertex_property\030\004 \001(\0162#." - "grin.PropertyDataPartitionStrategy\022:\n\red" - "ge_property\030\005 \001(\0162#.grin.PropertyDataPar" - "titionStrategy\0224\n,grin_assume_column_sto" - "re_for_vertex_property\030\006 \001(\010\0222\n*grin_ass" - "ume_column_store_for_edge_property\030\007 \001(\010" - "\022.\n&grin_trait_select_type_for_vertex_li" - "st\030\010 \001(\010\022,\n$grin_trait_select_type_for_e" - "dge_list\030\t \001(\010\0229\n1grin_trait_select_neig" - "hbor_type_for_adjacent_list\030\n \001(\010\0225\n-gri" - "n_trait_select_edge_type_for_adjacent_li" - "st\030\013 \001(\010\022(\n grin_trait_specific_vev_rela" - "tion\030\014 \001(\010\"x\n\014IndexFeature\022\036\n\026grin_with_" - "vertex_label\030\001 \001(\010\022\034\n\024grin_with_edge_lab" - "el\030\002 \001(\010\022*\n\"grin_assume_all_vertex_list_" - "sorted\030\003 \001(\010\"\022\n\020PredicateFeature\"\241\002\n\016Sto" - "rageFeature\0221\n\020topology_feature\030\001 \001(\0132\025." - "grin.TopologyFeatureH\000\0223\n\021partition_feat" - "ure\030\002 \001(\0132\026.grin.PartitionFeatureH\000\0221\n\020p" - "roperty_feature\030\003 \001(\0132\025.grin.PropertyFea" - "tureH\000\022+\n\rindex_feature\030\004 \001(\0132\022.grin.Ind" - "exFeatureH\000\0223\n\021predicate_feature\030\005 \001(\0132\026" - ".grin.PredicateFeatureH\000B\022\n\020specific_fea" - "ture\"\203\001\n\nStatistics\022\024\n\014vertex_count\030\001 \001(" - "\005\022\022\n\nedge_count\030\002 \001(\005\022\027\n\017partition_count" - "\030\003 \001(\005\022\031\n\021vertex_type_count\030\004 \001(\005\022\027\n\017edg" - "e_type_count\030\005 \001(\005\"x\n\005Graph\022\013\n\003uri\030\001 \001(\t" - "\022\024\n\014grin_version\030\002 \001(\t\022&\n\010features\030\003 \003(\013" - "2\024.grin.StorageFeature\022$\n\nstatistics\030\004 \001" - "(\0132\020.grin.Statistics*>\n\rListRetrieval\022\t\n" - "\005LR_NA\020\000\022\021\n\rLR_ARRAY_LIKE\020\001\022\017\n\013LR_ITERAT" - "OR\020\002*u\n\026GraphPartitionStrategy\022\n\n\006GPS_NA" - "\020\000\022\025\n\021GPS_ALL_REPLICATE\020\001\022\020\n\014GPS_EDGE_CU" - "T\020\002\022\022\n\016GPS_VERTEX_CUT\020\003\022\022\n\016GPS_HYBRID_CU" - "T\020\004*\202\001\n\035PropertyDataPartitionStrategy\022\013\n" - "\007PDPS_NA\020\000\022\024\n\020PDPS_MASTER_ONLY\020\001\022 \n\034PDPS" - "_REPLICATE_MASTER_MIRROR\020\002\022\034\n\030PDPS_SPLIT" - "_MASTER_MIRROR\020\003b\006proto3" + "jacent_list\030\r \001(\010\022\"\n\032grin_trait_fast_ver" + "tex_ref\030\016 \001(\010\"\354\002\n\025VertexPropertyFeature\022" + "!\n\031grin_with_vertex_property\030\001 \001(\010\022&\n\036gr" + "in_with_vertex_property_name\030\002 \001(\010\022\"\n\032gr" + "in_with_vertex_type_name\030\003 \001(\010\022)\n!grin_e" + "nable_vertex_property_table\030\004 \001(\010\022\'\n\037gri" + "n_enable_vertex_primary_keys\030\005 \001(\010\022-\n%gr" + "in_trait_natural_id_for_vertex_type\030\006 \001(" + "\010\0221\n)grin_trait_natural_id_for_vertex_pr" + "operty\030\007 \001(\010\022.\n&grin_assume_by_type_vert" + "ex_original_id\030\010 \001(\010\"\254\002\n\023EdgePropertyFea" + "ture\022\037\n\027grin_with_edge_property\030\001 \001(\010\022$\n" + "\034grin_with_edge_property_name\030\002 \001(\010\022 \n\030g" + "rin_with_edge_type_name\030\003 \001(\010\022\'\n\037grin_en" + "able_edge_property_table\030\004 \001(\010\022%\n\035grin_e" + "nable_edge_primary_keys\030\005 \001(\010\022+\n#grin_tr" + "ait_natural_id_for_edge_type\030\006 \001(\010\022/\n\'gr" + "in_trait_natural_id_for_edge_property\030\007 " + "\001(\010\"\200\005\n\017PropertyFeature\022\027\n\017grin_enable_r" + "ow\030\001 \001(\010\022<\n\027vertex_property_feature\030\002 \001(" + "\0132\033.grin.VertexPropertyFeature\0228\n\025edge_p" + "roperty_feature\030\003 \001(\0132\031.grin.EdgePropert" + "yFeature\022<\n\017vertex_property\030\004 \001(\0162#.grin" + ".PropertyDataPartitionStrategy\022:\n\redge_p" + "roperty\030\005 \001(\0162#.grin.PropertyDataPartiti" + "onStrategy\0224\n,grin_assume_column_store_f" + "or_vertex_property\030\006 \001(\010\0222\n*grin_assume_" + "column_store_for_edge_property\030\007 \001(\010\022.\n&" + "grin_trait_select_type_for_vertex_list\030\010" + " \001(\010\022,\n$grin_trait_select_type_for_edge_" + "list\030\t \001(\010\0229\n1grin_trait_select_neighbor" + "_type_for_adjacent_list\030\n \001(\010\0225\n-grin_tr" + "ait_select_edge_type_for_adjacent_list\030\013" + " \001(\010\022(\n grin_trait_specific_vev_relation" + "\030\014 \001(\010\"x\n\014IndexFeature\022\036\n\026grin_with_vert" + "ex_label\030\001 \001(\010\022\034\n\024grin_with_edge_label\030\002" + " \001(\010\022*\n\"grin_assume_all_vertex_list_sort" + "ed\030\003 \001(\010\"\022\n\020PredicateFeature\"\241\002\n\016Storage" + "Feature\0221\n\020topology_feature\030\001 \001(\0132\025.grin" + ".TopologyFeatureH\000\0223\n\021partition_feature\030" + "\002 \001(\0132\026.grin.PartitionFeatureH\000\0221\n\020prope" + "rty_feature\030\003 \001(\0132\025.grin.PropertyFeature" + "H\000\022+\n\rindex_feature\030\004 \001(\0132\022.grin.IndexFe" + "atureH\000\0223\n\021predicate_feature\030\005 \001(\0132\026.gri" + "n.PredicateFeatureH\000B\022\n\020specific_feature" + "\"\203\001\n\nStatistics\022\024\n\014vertex_count\030\001 \001(\005\022\022\n" + "\nedge_count\030\002 \001(\005\022\027\n\017partition_count\030\003 \001" + "(\005\022\031\n\021vertex_type_count\030\004 \001(\005\022\027\n\017edge_ty" + "pe_count\030\005 \001(\005\"x\n\005Graph\022\013\n\003uri\030\001 \001(\t\022\024\n\014" + "grin_version\030\002 \001(\t\022&\n\010features\030\003 \003(\0132\024.g" + "rin.StorageFeature\022$\n\nstatistics\030\004 \001(\0132\020" + ".grin.Statistics*>\n\rListRetrieval\022\t\n\005LR_" + "NA\020\000\022\021\n\rLR_ARRAY_LIKE\020\001\022\017\n\013LR_ITERATOR\020\002" + "*u\n\026GraphPartitionStrategy\022\n\n\006GPS_NA\020\000\022\025" + "\n\021GPS_ALL_REPLICATE\020\001\022\020\n\014GPS_EDGE_CUT\020\002\022" + "\022\n\016GPS_VERTEX_CUT\020\003\022\022\n\016GPS_HYBRID_CUT\020\004*" + "\202\001\n\035PropertyDataPartitionStrategy\022\013\n\007PDP" + "S_NA\020\000\022\024\n\020PDPS_MASTER_ONLY\020\001\022 \n\034PDPS_REP" + "LICATE_MASTER_MIRROR\020\002\022\034\n\030PDPS_SPLIT_MAS" + "TER_MIRROR\020\003b\006proto3" ; static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_graph_2eproto_deps[1] = { }; @@ -511,7 +513,7 @@ static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_gra }; static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_graph_2eproto_once; const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_graph_2eproto = { - false, false, descriptor_table_protodef_graph_2eproto, "graph.proto", 3704, + false, false, descriptor_table_protodef_graph_2eproto, "graph.proto", 3740, &descriptor_table_graph_2eproto_once, descriptor_table_graph_2eproto_sccs, descriptor_table_graph_2eproto_deps, 11, 0, schemas, file_default_instances, TableStruct_graph_2eproto::offsets, file_level_metadata_graph_2eproto, 11, file_level_enum_descriptors_graph_2eproto, file_level_service_descriptors_graph_2eproto, @@ -1308,16 +1310,16 @@ PartitionFeature::PartitionFeature(const PartitionFeature& from) mirror_partition_list_feature_ = nullptr; } ::memcpy(&graph_partition_strategy_, &from.graph_partition_strategy_, - static_cast(reinterpret_cast(&grin_trait_select_neighbor_partition_for_adjacent_list_) - - reinterpret_cast(&graph_partition_strategy_)) + sizeof(grin_trait_select_neighbor_partition_for_adjacent_list_)); + static_cast(reinterpret_cast(&grin_trait_fast_vertex_ref_) - + reinterpret_cast(&graph_partition_strategy_)) + sizeof(grin_trait_fast_vertex_ref_)); // @@protoc_insertion_point(copy_constructor:grin.PartitionFeature) } void PartitionFeature::SharedCtor() { ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PartitionFeature_graph_2eproto.base); ::memset(&mirror_partition_list_feature_, 0, static_cast( - reinterpret_cast(&grin_trait_select_neighbor_partition_for_adjacent_list_) - - reinterpret_cast(&mirror_partition_list_feature_)) + sizeof(grin_trait_select_neighbor_partition_for_adjacent_list_)); + reinterpret_cast(&grin_trait_fast_vertex_ref_) - + reinterpret_cast(&mirror_partition_list_feature_)) + sizeof(grin_trait_fast_vertex_ref_)); } PartitionFeature::~PartitionFeature() { @@ -1357,8 +1359,8 @@ void PartitionFeature::Clear() { } mirror_partition_list_feature_ = nullptr; ::memset(&graph_partition_strategy_, 0, static_cast( - reinterpret_cast(&grin_trait_select_neighbor_partition_for_adjacent_list_) - - reinterpret_cast(&graph_partition_strategy_)) + sizeof(grin_trait_select_neighbor_partition_for_adjacent_list_)); + reinterpret_cast(&grin_trait_fast_vertex_ref_) - + reinterpret_cast(&graph_partition_strategy_)) + sizeof(grin_trait_fast_vertex_ref_)); _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); } @@ -1464,6 +1466,13 @@ const char* PartitionFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPA CHK_(ptr); } else goto handle_unusual; continue; + // bool grin_trait_fast_vertex_ref = 14; + case 14: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) { + grin_trait_fast_vertex_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; default: { handle_unusual: if ((tag & 7) == 4 || tag == 0) { @@ -1575,6 +1584,12 @@ ::PROTOBUF_NAMESPACE_ID::uint8* PartitionFeature::_InternalSerialize( target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(13, this->_internal_grin_trait_select_neighbor_partition_for_adjacent_list(), target); } + // bool grin_trait_fast_vertex_ref = 14; + if (this->grin_trait_fast_vertex_ref() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(14, this->_internal_grin_trait_fast_vertex_ref(), target); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); @@ -1661,6 +1676,11 @@ size_t PartitionFeature::ByteSizeLong() const { total_size += 1 + 1; } + // bool grin_trait_fast_vertex_ref = 14; + if (this->grin_trait_fast_vertex_ref() != 0) { + total_size += 1 + 1; + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( _internal_metadata_, total_size, &_cached_size_); @@ -1731,6 +1751,9 @@ void PartitionFeature::MergeFrom(const PartitionFeature& from) { if (from.grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(from._internal_grin_trait_select_neighbor_partition_for_adjacent_list()); } + if (from.grin_trait_fast_vertex_ref() != 0) { + _internal_set_grin_trait_fast_vertex_ref(from._internal_grin_trait_fast_vertex_ref()); + } } void PartitionFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { @@ -1755,8 +1778,8 @@ void PartitionFeature::InternalSwap(PartitionFeature* other) { using std::swap; _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(PartitionFeature, grin_trait_select_neighbor_partition_for_adjacent_list_) - + sizeof(PartitionFeature::grin_trait_select_neighbor_partition_for_adjacent_list_) + PROTOBUF_FIELD_OFFSET(PartitionFeature, grin_trait_fast_vertex_ref_) + + sizeof(PartitionFeature::grin_trait_fast_vertex_ref_) - PROTOBUF_FIELD_OFFSET(PartitionFeature, mirror_partition_list_feature_)>( reinterpret_cast(&mirror_partition_list_feature_), reinterpret_cast(&other->mirror_partition_list_feature_)); diff --git a/modules/graph/grin/src/proto/graph.pb.h b/modules/graph/grin/src/proto/graph.pb.h index c8f4c27c5..6a6e4fb79 100644 --- a/modules/graph/grin/src/proto/graph.pb.h +++ b/modules/graph/grin/src/proto/graph.pb.h @@ -736,6 +736,7 @@ class PartitionFeature PROTOBUF_FINAL : kGrinTraitSelectPartitionForEdgeListFieldNumber = 11, kGrinTraitSelectMasterNeighborForAdjacentListFieldNumber = 12, kGrinTraitSelectNeighborPartitionForAdjacentListFieldNumber = 13, + kGrinTraitFastVertexRefFieldNumber = 14, }; // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; bool has_mirror_partition_list_feature() const; @@ -863,6 +864,15 @@ class PartitionFeature PROTOBUF_FINAL : void _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value); public: + // bool grin_trait_fast_vertex_ref = 14; + void clear_grin_trait_fast_vertex_ref(); + bool grin_trait_fast_vertex_ref() const; + void set_grin_trait_fast_vertex_ref(bool value); + private: + bool _internal_grin_trait_fast_vertex_ref() const; + void _internal_set_grin_trait_fast_vertex_ref(bool value); + public: + // @@protoc_insertion_point(class_scope:grin.PartitionFeature) private: class _Internal; @@ -883,6 +893,7 @@ class PartitionFeature PROTOBUF_FINAL : bool grin_trait_select_partition_for_edge_list_; bool grin_trait_select_master_neighbor_for_adjacent_list_; bool grin_trait_select_neighbor_partition_for_adjacent_list_; + bool grin_trait_fast_vertex_ref_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; friend struct ::TableStruct_graph_2eproto; }; @@ -3182,6 +3193,26 @@ inline void PartitionFeature::set_grin_trait_select_neighbor_partition_for_adjac // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_neighbor_partition_for_adjacent_list) } +// bool grin_trait_fast_vertex_ref = 14; +inline void PartitionFeature::clear_grin_trait_fast_vertex_ref() { + grin_trait_fast_vertex_ref_ = false; +} +inline bool PartitionFeature::_internal_grin_trait_fast_vertex_ref() const { + return grin_trait_fast_vertex_ref_; +} +inline bool PartitionFeature::grin_trait_fast_vertex_ref() const { + // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_fast_vertex_ref) + return _internal_grin_trait_fast_vertex_ref(); +} +inline void PartitionFeature::_internal_set_grin_trait_fast_vertex_ref(bool value) { + + grin_trait_fast_vertex_ref_ = value; +} +inline void PartitionFeature::set_grin_trait_fast_vertex_ref(bool value) { + _internal_set_grin_trait_fast_vertex_ref(value); + // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_fast_vertex_ref) +} + // ------------------------------------------------------------------- // VertexPropertyFeature diff --git a/modules/graph/grin/src/proto/message.cc b/modules/graph/grin/src/proto/message.cc index 86e316288..344c10619 100644 --- a/modules/graph/grin/src/proto/message.cc +++ b/modules/graph/grin/src/proto/message.cc @@ -130,6 +130,10 @@ const char* grin_get_static_storage_feature_msg() { feature->set_grin_enable_vertex_ref(true); #endif +#ifdef GRIN_TRAIT_FAST_VERTEX_REF + feature->set_grin_trait_fast_vertex_ref(true); +#endif + #ifdef GRIN_ENABLE_EDGE_REF feature->set_grin_enable_edge_ref(true); #endif From ac480ce900403adfd847f72de51088249c96c1e9 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 8 May 2023 12:34:11 +0000 Subject: [PATCH 59/85] impl error code --- modules/graph/grin/c/test.c | 31 +++ modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 8 + modules/graph/grin/src/index/order.cc | 1 + modules/graph/grin/src/partition/partition.cc | 1 - modules/graph/grin/src/predefine.cc | 2 +- modules/graph/grin/src/predefine.h | 2 +- .../graph/grin/src/property/propertytable.cc | 209 ++++++++++++++++-- 8 files changed, 229 insertions(+), 27 deletions(-) diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index dd3bf8e04..0f0c8b040 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -16,6 +16,8 @@ #include "../include/topology/structure.h" #include "../include/topology/vertexlist.h" +extern __thread GRIN_ERROR_CODE grin_error_code; + GRIN_GRAPH get_graph(int argc, char** argv) { #ifdef GRIN_ENABLE_GRAPH_PARTITION GRIN_PARTITIONED_GRAPH pg = @@ -391,7 +393,12 @@ void test_property_vertex_table(int argc, char** argv) { GRIN_VERTEX_PROPERTY_TABLE vpt = grin_get_vertex_property_table_by_type(g, vt); +#ifdef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST + GRIN_VERTEX_LIST all_vl = grin_get_vertex_list(g); + GRIN_VERTEX_LIST vl = grin_select_master_for_vertex_list(g, all_vl); +#else GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); +#endif GRIN_VERTEX_LIST typed_vl = grin_select_type_for_vertex_list(g, vt, vl); #ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY size_t typed_vl_size = grin_get_vertex_list_size(g, typed_vl); @@ -443,6 +450,11 @@ void test_property_vertex_table(int argc, char** argv) { GRIN_DATATYPE dt = grin_get_vertex_property_data_type(g, vp); const void* pv = grin_get_value_from_vertex_property_table(g, vpt, v, vp); + if (grin_error_code == GRIN_NO_ERROR) { + printf("(Correct) no error\n"); + } else { + printf("(Wrong) error code: %d\n", grin_error_code); + } const void* rv = grin_get_value_from_row(g, row, dt, j); if (dt == Int64) { printf("vp_id %u v%zu %s value: %ld %ld\n", id, i, vp_name, @@ -780,12 +792,31 @@ void test_property_primary_key(int argc, char** argv) { } } +void test_error_code(int argc, char** argv) { + printf("+++++++++++++++++++++ Test error code +++++++++++++++++++++\n"); + GRIN_GRAPH g = get_graph(argc, argv); + + GRIN_VERTEX_TYPE vt1 = grin_get_vertex_type_by_name(g, "person"); + GRIN_VERTEX_TYPE vt2 = grin_get_vertex_type_by_name(g, "software"); + GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_by_name(g, vt2, "lang"); + GRIN_VERTEX_PROPERTY_TABLE vpt = grin_get_vertex_property_table_by_type(g, vt1); + GRIN_VERTEX v = get_one_vertex(g); + + const void* value = grin_get_value_from_vertex_property_table(g, vpt, v, vp); + if (grin_error_code == GRIN_INVALID_VALUE) { + printf("(Correct) invalid value\n"); + } else { + printf("(Wrong) error code: %d\n", grin_error_code); + } +} + void test_property(int argc, char** argv) { test_property_type(argc, argv); test_property_topology(argc, argv); test_property_vertex_table(argc, argv); test_property_edge_table(argc, argv); test_property_primary_key(argc, argv); + test_error_code(argc, argv); } int main(int argc, char** argv) { diff --git a/modules/graph/grin/include b/modules/graph/grin/include index e6d05fc59..21ed714b9 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit e6d05fc5974edf34bc6591c8f0ea48420ee6f9b7 +Subproject commit 21ed714b9dcfd5bd81d02ecee04b5e7e226d1614 diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index f72c934d2..8c0c65388 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -53,6 +53,14 @@ typedef enum { Timestamp64 = 10, ///< Timestamp } GRIN_DATATYPE; +/// Enumerates the error codes of grin +typedef enum { + GRIN_NO_ERROR = 0, ///< success + GRIN_UNKNOWN_ERROR = 1, ///< unknown error + GRIN_INVALID_VALUE = 2, ///< invalid value + GRIN_UNKNOWN_DATATYPE = 3, ///< unknown datatype +} GRIN_ERROR_CODE; + /* Section 1: Toplogy */ /** @name TopologyMacros diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index d81c17d2f..8f00f0b16 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -11,6 +11,7 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" + extern "C" { #include "graph/grin/include/index/order.h" } diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index 86a6f20db..9df24cbef 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -19,7 +19,6 @@ extern "C" { } #include "graph/fragment/property_graph_types.h" - #ifdef GRIN_ENABLE_GRAPH_PARTITION GRIN_PARTITIONED_GRAPH grin_get_partitioned_graph_from_storage(int argc, char** argv) { if (argc < 2) { diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 0a814d3b5..f6477d112 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -117,4 +117,4 @@ unsigned _grin_get_type_from_property(unsigned long long int prop) { unsigned _grin_get_prop_from_property(unsigned long long int prop) { return (unsigned)(prop & 0xffffffff); -} \ No newline at end of file +} diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 84592c21e..8b8ec3562 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -25,7 +25,7 @@ extern "C" { #include "graph/fragment/arrow_fragment_impl.h" #include "client/client.h" -#include "arrow/api.h" +#include "arrow/api.h" template struct GRIN_DATATYPE_ENUM { diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index e0baec234..f3028f522 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -15,6 +15,8 @@ extern "C" { #include "graph/grin/include/property/propertytable.h" } +__thread GRIN_ERROR_CODE grin_error_code; + #ifdef GRIN_ENABLE_ROW void grin_destroy_row(GRIN_GRAPH g, GRIN_ROW r) { auto _r = static_cast(r); @@ -232,12 +234,16 @@ GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) return NULL; + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return NULL; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); @@ -271,75 +277,126 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ case GRIN_DATATYPE::Timestamp64: return new int64_t(*static_cast(result)); default: + grin_error_code = GRIN_UNKNOWN_DATATYPE; return NULL; } } int grin_get_int32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } unsigned int grin_get_uint32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } long long int grin_get_int64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } unsigned long long int grin_get_uint64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } float grin_get_float_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } double grin_get_double_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); - return *static_cast(result);} + return *static_cast(result); +} const char* grin_get_string_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return NULL; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); auto s = static_cast(result); int len = s->length() + 1; @@ -349,31 +406,52 @@ const char* grin_get_string_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX } int grin_get_date32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } int grin_get_time32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } long long int grin_get_timestamp64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(_grin_get_type_from_property(vp))->column(_grin_get_prop_from_property(vp))->chunk(0); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } @@ -427,12 +505,16 @@ GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH g, GRIN const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) return NULL; + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return NULL; + } auto offset = _e->eid; auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); @@ -466,69 +548,126 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP case GRIN_DATATYPE::Timestamp64: return new int64_t(*static_cast(result)); default: + grin_error_code = GRIN_UNKNOWN_DATATYPE; return NULL; } } int grin_get_int32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _e->eid; - auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } unsigned int grin_get_uint32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _e->eid; - auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } long long int grin_get_int64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _e->eid; - auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } unsigned long long int grin_get_uint64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _e->eid; - auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } float grin_get_float_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _e->eid; - auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } double grin_get_double_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _e->eid; - auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } const char* grin_get_string_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return NULL; + } auto offset = _e->eid; - auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); auto s = static_cast(result); int len = s->length() + 1; @@ -538,28 +677,52 @@ const char* grin_get_string_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PRO } int grin_get_date32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _e->eid; - auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } int grin_get_time32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _e->eid; - auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } long long int grin_get_timestamp64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_NO_ERROR; auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_INVALID_VALUE; + return 0; + } auto offset = _e->eid; - auto array = _g->edge_data_table(_grin_get_type_from_property(ep))->column(_grin_get_prop_from_property(ep))->chunk(0); + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); return *static_cast(result); } From 29b6e7f9a6641c2cb932280bf975c56477f7f94f Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Tue, 9 May 2023 04:17:11 +0000 Subject: [PATCH 60/85] quick fix insert string to row --- modules/graph/grin/src/property/propertytable.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index f3028f522..76b72b4af 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -191,13 +191,12 @@ bool grin_insert_float_to_row(GRIN_GRAPH g, GRIN_ROW r, float value) { bool grin_insert_double_to_row(GRIN_GRAPH g, GRIN_ROW r, double value) { auto _r = static_cast(r); _r->push_back(new double(value)); - return true;} + return true; +} bool grin_insert_string_to_row(GRIN_GRAPH g, GRIN_ROW r, const char* value) { auto _r = static_cast(r); - char* out = new char[strlen(value) + 1]; - snprintf(out, strlen(value) + 1, "%s", value); - _r->push_back(out); + _r->push_back(new std::string(value)); return true; } From d964311218d66114631c7e09b720cc92204211d9 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Tue, 9 May 2023 04:22:33 +0000 Subject: [PATCH 61/85] add error_code to rust codegen --- modules/graph/grin/rust/Cargo.toml | 3 +- modules/graph/grin/rust/grin_v6d.rs | 44 +++++++++++++++++++++++------ modules/graph/grin/rust/v6d_all.h | 4 ++- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/modules/graph/grin/rust/Cargo.toml b/modules/graph/grin/rust/Cargo.toml index 8f0b55a71..04cf09129 100644 --- a/modules/graph/grin/rust/Cargo.toml +++ b/modules/graph/grin/rust/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["dijie"] [features] -default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_with_vertex_original_id", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_property_table", "grin_enable_vertex_primary_keys", "grin_trait_natural_id_for_vertex_property", "grin_assume_by_type_vertex_original_id", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_enable_edge_property_table", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_column_store_for_vertex_property", "grin_assume_column_store_for_edge_property", "grin_assume_all_vertex_list_sorted"] +default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_with_vertex_original_id", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_trait_fast_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_property_table", "grin_enable_vertex_primary_keys", "grin_trait_natural_id_for_vertex_property", "grin_assume_by_type_vertex_original_id", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_enable_edge_property_table", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_column_store_for_vertex_property", "grin_assume_column_store_for_edge_property", "grin_assume_all_vertex_list_sorted"] grin_assume_has_directed_graph = [] grin_assume_has_undirected_graph = [] grin_assume_has_multi_edge_graph = [] @@ -23,6 +23,7 @@ grin_enable_adjacent_list_iterator = [] grin_enable_graph_partition = [] grin_trait_natural_id_for_partition = [] grin_enable_vertex_ref = [] +grin_trait_fast_vertex_ref = [] grin_enable_edge_ref = [] grin_assume_all_replicate_partition = ["grin_assume_replicate_master_mirror_partition_for_vertex_data", "grin_assume_replicate_master_mirror_partition_for_edge_data", "grin_assume_replicate_master_mirror_partition_for_vertex_property", "grin_assume_replicate_master_mirror_partition_for_edge_property"] grin_assume_edge_cut_partition = ["grin_assume_master_only_partition_for_vertex_data", "grin_assume_replicate_master_mirror_partition_for_edge_data", "grin_assume_master_only_partition_for_vertex_property", "grin_assume_replicate_master_mirror_partition_for_edge_property"] diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index eafc00319..f856e5991 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -1,3 +1,4 @@ + #[doc = "< incoming"] pub const GRIN_DIRECTION_IN: GrinDirection = 0; #[doc = "< outgoing"] @@ -22,12 +23,24 @@ pub const GRIN_DATATYPE_FLOAT: GrinDatatype = 5; pub const GRIN_DATATYPE_DOUBLE: GrinDatatype = 6; #[doc = "< string"] pub const GRIN_DATATYPE_STRING: GrinDatatype = 7; -#[doc = "< short date"] +#[doc = "< date"] pub const GRIN_DATATYPE_DATE32: GrinDatatype = 8; -#[doc = "< long date"] -pub const GRIN_DATATYPE_DATE64: GrinDatatype = 9; +#[doc = "< Time32"] +pub const GRIN_DATATYPE_TIME32: GrinDatatype = 9; +#[doc = "< Timestamp"] +pub const GRIN_DATATYPE_TIMESTAMP64: GrinDatatype = 10; #[doc = " Enumerates the datatype supported in the storage"] pub type GrinDatatype = u32; +#[doc = "< success"] +pub const GrinErrorCodeGrinNoError: GrinErrorCode = 0; +#[doc = "< unknown error"] +pub const GrinErrorCodeGrinUnknownError: GrinErrorCode = 1; +#[doc = "< invalid value"] +pub const GrinErrorCodeGrinInvalidValue: GrinErrorCode = 2; +#[doc = "< unknown datatype"] +pub const GrinErrorCodeGrinUnknownDatatype: GrinErrorCode = 3; +#[doc = " Enumerates the error codes of grin"] +pub type GrinErrorCode = u32; #[doc = "@}"] pub type GrinGraph = *mut ::std::os::raw::c_void; pub type GrinVertex = *mut ::std::os::raw::c_void; @@ -38,22 +51,22 @@ pub type GrinVertexListIterator = *mut ::std::os::raw::c_void; pub type GrinAdjacentList = *mut ::std::os::raw::c_void; pub type GrinAdjacentListIterator = *mut ::std::os::raw::c_void; pub type GrinPartitionedGraph = *mut ::std::os::raw::c_void; -pub type GrinPartition = *mut ::std::os::raw::c_void; +pub type GrinPartition = u32; pub type GrinPartitionList = *mut ::std::os::raw::c_void; pub type GrinPartitionId = u32; -pub type GrinVertexRef = *mut ::std::os::raw::c_void; -pub type GrinVertexType = *mut ::std::os::raw::c_void; +pub type GrinVertexRef = i64; +pub type GrinVertexType = u32; pub type GrinVertexTypeList = *mut ::std::os::raw::c_void; -pub type GrinVertexProperty = *mut ::std::os::raw::c_void; +pub type GrinVertexProperty = u64; pub type GrinVertexPropertyList = *mut ::std::os::raw::c_void; pub type GrinVertexPropertyTable = *mut ::std::os::raw::c_void; pub type GrinVertexTypeId = u32; pub type GrinVertexPropertyId = u32; -pub type GrinEdgeType = *mut ::std::os::raw::c_void; +pub type GrinEdgeType = u32; pub type GrinEdgeTypeList = *mut ::std::os::raw::c_void; pub type GrinVevType = *mut ::std::os::raw::c_void; pub type GrinVevTypeList = *mut ::std::os::raw::c_void; -pub type GrinEdgeProperty = *mut ::std::os::raw::c_void; +pub type GrinEdgeProperty = u64; pub type GrinEdgePropertyList = *mut ::std::os::raw::c_void; pub type GrinEdgePropertyTable = *mut ::std::os::raw::c_void; pub type GrinEdgeTypeId = u32; @@ -314,6 +327,17 @@ extern "C" { #[cfg(feature = "grin_enable_vertex_ref")] pub fn grin_is_mirror_vertex(arg1: GrinGraph, arg2: GrinVertex) -> bool; + pub fn grin_serialize_vertex_ref_as_int64( + arg1: GrinGraph, + arg2: GrinVertexRef, + ) -> i64; + + #[cfg(feature = "grin_trait_fast_vertex_ref")] + pub fn grin_deserialize_vertex_ref_from_int64( + arg1: GrinGraph, + arg2: i64, + ) -> GrinVertexRef; + #[cfg(feature = "grin_enable_graph_partition")] pub fn grin_get_total_vertex_num(arg1: GrinPartitionedGraph) -> usize; @@ -1066,4 +1090,6 @@ extern "C" { arg2: GrinVertexList, arg3: GrinVertex, ) -> usize; + + pub static mut grin_error_code: GrinErrorCode; } diff --git a/modules/graph/grin/rust/v6d_all.h b/modules/graph/grin/rust/v6d_all.h index dacf565c0..d293a9763 100644 --- a/modules/graph/grin/rust/v6d_all.h +++ b/modules/graph/grin/rust/v6d_all.h @@ -13,4 +13,6 @@ #include "../include/property/topology.h" #include "../include/property/type.h" #include "../include/index/label.h" -#include "../include/index/order.h" \ No newline at end of file +#include "../include/index/order.h" + +__thread GRIN_ERROR_CODE grin_error_code; From 6f80b2d8c3fd4e9a9acf303394b3760de237646f Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Tue, 9 May 2023 13:22:49 +0000 Subject: [PATCH 62/85] null value in rust codegen and errorcode update --- modules/graph/grin/c/test.c | 11 +- modules/graph/grin/c/test.sh | 6 +- modules/graph/grin/include | 2 +- modules/graph/grin/rust/grin_v6d.rs | 225 +++++++++++++++++- modules/graph/grin/rust/parse.py | 19 +- modules/graph/grin/rust/v6d_all.h | 19 +- modules/graph/grin/src/common/error.cc | 28 +++ .../graph/grin/src/property/propertytable.cc | 3 +- 8 files changed, 298 insertions(+), 15 deletions(-) create mode 100644 modules/graph/grin/src/common/error.cc diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index 0f0c8b040..75b57deab 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -1,4 +1,5 @@ #include +#include "../include/common/error.h" #include "../include/index/label.h" #include "../include/index/order.h" #include "../include/partition/partition.h" @@ -16,8 +17,6 @@ #include "../include/topology/structure.h" #include "../include/topology/vertexlist.h" -extern __thread GRIN_ERROR_CODE grin_error_code; - GRIN_GRAPH get_graph(int argc, char** argv) { #ifdef GRIN_ENABLE_GRAPH_PARTITION GRIN_PARTITIONED_GRAPH pg = @@ -450,10 +449,10 @@ void test_property_vertex_table(int argc, char** argv) { GRIN_DATATYPE dt = grin_get_vertex_property_data_type(g, vp); const void* pv = grin_get_value_from_vertex_property_table(g, vpt, v, vp); - if (grin_error_code == GRIN_NO_ERROR) { + if (grin_get_last_error_code() == GRIN_NO_ERROR) { printf("(Correct) no error\n"); } else { - printf("(Wrong) error code: %d\n", grin_error_code); + printf("(Wrong) error code: %d\n", grin_get_last_error_code()); } const void* rv = grin_get_value_from_row(g, row, dt, j); if (dt == Int64) { @@ -803,10 +802,10 @@ void test_error_code(int argc, char** argv) { GRIN_VERTEX v = get_one_vertex(g); const void* value = grin_get_value_from_vertex_property_table(g, vpt, v, vp); - if (grin_error_code == GRIN_INVALID_VALUE) { + if (grin_get_last_error_code() == GRIN_INVALID_VALUE) { printf("(Correct) invalid value\n"); } else { - printf("(Wrong) error code: %d\n", grin_error_code); + printf("(Wrong) error code: %d\n", grin_get_last_error_code()); } } diff --git a/modules/graph/grin/c/test.sh b/modules/graph/grin/c/test.sh index f3ab588b7..07af1b8ad 100755 --- a/modules/graph/grin/c/test.sh +++ b/modules/graph/grin/c/test.sh @@ -1,9 +1,9 @@ # launch vineyardd & load modern graph # 1. copy modern_graph folder from GraphScope/charts/gie-standalone/data to build # 2. copy v6d_modern_loader to modern_graph folder -# 3. in build folder, run: bin/vineyardd --socket=tmp.sock -# 4. in build folder, run: bin/vineyard-graph-loader --socket=tmp.sock --config modern_graph/config.json +# 3. in build folder, run: bin/vineyardd --socket tmp.sock +# 4. in build folder, run: bin/vineyard-graph-loader --socket tmp.sock --config modern_graph/config.json rm -rf ./test gcc test.c -I. -L/home/graphscope/gie-grin/v6d/build/shared-lib/ -lvineyard_grin -lvineyard_graph -lvineyard_basic -o test -./test /workspaces/v6d/build/tmp.sock 3493598830228844 \ No newline at end of file +./test /home/graphscope/gie-grin/v6d/build/tmp.sock 134785075056209698 \ No newline at end of file diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 21ed714b9..07b5f23b1 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 21ed714b9dcfd5bd81d02ecee04b5e7e226d1614 +Subproject commit 07b5f23b1232bedcc76310e13af4a86418cc0e2e diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index f856e5991..1f25b7bb1 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -74,6 +74,7 @@ pub type GrinEdgePropertyId = u32; pub type GrinRow = *mut ::std::os::raw::c_void; extern "C" { #[cfg(feature = "grin_enable_adjacent_list")] + #[allow(unused)] pub fn grin_get_adjacent_list( arg1: GrinGraph, arg2: GrinDirection, @@ -81,12 +82,15 @@ extern "C" { ) -> GrinAdjacentList; #[cfg(feature = "grin_enable_adjacent_list")] + #[allow(unused)] pub fn grin_destroy_adjacent_list(arg1: GrinGraph, arg2: GrinAdjacentList); #[cfg(feature = "grin_enable_adjacent_list_array")] + #[allow(unused)] pub fn grin_get_adjacent_list_size(arg1: GrinGraph, arg2: GrinAdjacentList) -> usize; #[cfg(feature = "grin_enable_adjacent_list_array")] + #[allow(unused)] pub fn grin_get_neighbor_from_adjacent_list( arg1: GrinGraph, arg2: GrinAdjacentList, @@ -94,6 +98,7 @@ extern "C" { ) -> GrinVertex; #[cfg(feature = "grin_enable_adjacent_list_array")] + #[allow(unused)] pub fn grin_get_edge_from_adjacent_list( arg1: GrinGraph, arg2: GrinAdjacentList, @@ -101,89 +106,115 @@ extern "C" { ) -> GrinEdge; #[cfg(feature = "grin_enable_adjacent_list_iterator")] + #[allow(unused)] pub fn grin_get_adjacent_list_begin( arg1: GrinGraph, arg2: GrinAdjacentList, ) -> GrinAdjacentListIterator; #[cfg(feature = "grin_enable_adjacent_list_iterator")] + #[allow(unused)] pub fn grin_destroy_adjacent_list_iter(arg1: GrinGraph, arg2: GrinAdjacentListIterator); #[cfg(feature = "grin_enable_adjacent_list_iterator")] + #[allow(unused)] pub fn grin_get_next_adjacent_list_iter(arg1: GrinGraph, arg2: GrinAdjacentListIterator); #[cfg(feature = "grin_enable_adjacent_list_iterator")] + #[allow(unused)] pub fn grin_is_adjacent_list_end(arg1: GrinGraph, arg2: GrinAdjacentListIterator) -> bool; #[cfg(feature = "grin_enable_adjacent_list_iterator")] + #[allow(unused)] pub fn grin_get_neighbor_from_adjacent_list_iter( arg1: GrinGraph, arg2: GrinAdjacentListIterator, ) -> GrinVertex; #[cfg(feature = "grin_enable_adjacent_list_iterator")] + #[allow(unused)] pub fn grin_get_edge_from_adjacent_list_iter( arg1: GrinGraph, arg2: GrinAdjacentListIterator, ) -> GrinEdge; + #[allow(unused)] pub fn grin_get_graph_from_storage( arg1: i32, arg2: *mut *mut ::std::os::raw::c_char, ) -> GrinGraph; + #[allow(unused)] pub fn grin_destroy_graph(arg1: GrinGraph); #[cfg(all(feature = "grin_assume_has_directed_graph", feature = "grin_assume_has_undirected_graph"))] + #[allow(unused)] pub fn grin_is_directed(arg1: GrinGraph) -> bool; #[cfg(feature = "grin_assume_has_multi_edge_graph")] + #[allow(unused)] pub fn grin_is_multigraph(arg1: GrinGraph) -> bool; + #[allow(unused)] pub fn grin_get_vertex_num(arg1: GrinGraph) -> usize; + #[allow(unused)] pub fn grin_get_edge_num(arg1: GrinGraph) -> usize; + #[allow(unused)] pub fn grin_destroy_vertex(arg1: GrinGraph, arg2: GrinVertex); + #[allow(unused)] pub fn grin_equal_vertex(arg1: GrinGraph, arg2: GrinVertex, arg3: GrinVertex) -> bool; #[cfg(feature = "grin_with_vertex_original_id")] + #[allow(unused)] pub fn grin_destroy_vertex_original_id(arg1: GrinGraph, arg2: GrinVertexOriginalId); #[cfg(feature = "grin_with_vertex_original_id")] + #[allow(unused)] pub fn grin_get_vertex_original_id_type(arg1: GrinGraph) -> GrinDatatype; #[cfg(feature = "grin_with_vertex_original_id")] + #[allow(unused)] pub fn grin_get_vertex_original_id( arg1: GrinGraph, arg2: GrinVertex, ) -> GrinVertexOriginalId; + #[allow(unused)] pub fn grin_destroy_value( arg1: GrinGraph, arg2: GrinDatatype, arg3: *const ::std::os::raw::c_void, ); + #[allow(unused)] pub fn grin_destroy_name(arg1: GrinGraph, arg2: *const ::std::os::raw::c_char); + #[allow(unused)] pub fn grin_destroy_edge(arg1: GrinGraph, arg2: GrinEdge); + #[allow(unused)] pub fn grin_get_edge_src(arg1: GrinGraph, arg2: GrinEdge) -> GrinVertex; + #[allow(unused)] pub fn grin_get_edge_dst(arg1: GrinGraph, arg2: GrinEdge) -> GrinVertex; #[cfg(feature = "grin_enable_vertex_list")] + #[allow(unused)] pub fn grin_get_vertex_list(arg1: GrinGraph) -> GrinVertexList; #[cfg(feature = "grin_enable_vertex_list")] + #[allow(unused)] pub fn grin_destroy_vertex_list(arg1: GrinGraph, arg2: GrinVertexList); #[cfg(feature = "grin_enable_vertex_list_array")] + #[allow(unused)] pub fn grin_get_vertex_list_size(arg1: GrinGraph, arg2: GrinVertexList) -> usize; #[cfg(feature = "grin_enable_vertex_list_array")] + #[allow(unused)] pub fn grin_get_vertex_from_list( arg1: GrinGraph, arg2: GrinVertexList, @@ -191,48 +222,60 @@ extern "C" { ) -> GrinVertex; #[cfg(feature = "grin_enable_vertex_list_iterator")] + #[allow(unused)] pub fn grin_get_vertex_list_begin( arg1: GrinGraph, arg2: GrinVertexList, ) -> GrinVertexListIterator; #[cfg(feature = "grin_enable_vertex_list_iterator")] + #[allow(unused)] pub fn grin_destroy_vertex_list_iter(arg1: GrinGraph, arg2: GrinVertexListIterator); #[cfg(feature = "grin_enable_vertex_list_iterator")] + #[allow(unused)] pub fn grin_get_next_vertex_list_iter(arg1: GrinGraph, arg2: GrinVertexListIterator); #[cfg(feature = "grin_enable_vertex_list_iterator")] + #[allow(unused)] pub fn grin_is_vertex_list_end(arg1: GrinGraph, arg2: GrinVertexListIterator) -> bool; #[cfg(feature = "grin_enable_vertex_list_iterator")] + #[allow(unused)] pub fn grin_get_vertex_from_iter( arg1: GrinGraph, arg2: GrinVertexListIterator, ) -> GrinVertex; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_get_partitioned_graph_from_storage( arg1: i32, arg2: *mut *mut ::std::os::raw::c_char, ) -> GrinPartitionedGraph; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_destroy_partitioned_graph(arg1: GrinPartitionedGraph); #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_get_total_partitions_number(arg1: GrinPartitionedGraph) -> usize; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_get_local_partition_list(arg1: GrinPartitionedGraph) -> GrinPartitionList; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_destroy_partition_list(arg1: GrinPartitionedGraph, arg2: GrinPartitionList); #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_create_partition_list(arg1: GrinPartitionedGraph) -> GrinPartitionList; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_insert_partition_to_list( arg1: GrinPartitionedGraph, arg2: GrinPartitionList, @@ -240,12 +283,14 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_get_partition_list_size( arg1: GrinPartitionedGraph, arg2: GrinPartitionList, ) -> usize; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_get_partition_from_list( arg1: GrinPartitionedGraph, arg2: GrinPartitionList, @@ -253,6 +298,7 @@ extern "C" { ) -> GrinPartition; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_equal_partition( arg1: GrinPartitionedGraph, arg2: GrinPartition, @@ -260,97 +306,117 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_destroy_partition(arg1: GrinPartitionedGraph, arg2: GrinPartition); #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_get_partition_info( arg1: GrinPartitionedGraph, arg2: GrinPartition, ) -> *const ::std::os::raw::c_void; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_get_local_graph_from_partition( arg1: GrinPartitionedGraph, arg2: GrinPartition, ) -> GrinGraph; #[cfg(feature = "grin_trait_natural_id_for_partition")] + #[allow(unused)] pub fn grin_get_partition_from_id( arg1: GrinPartitionedGraph, arg2: GrinPartitionId, ) -> GrinPartition; #[cfg(feature = "grin_trait_natural_id_for_partition")] + #[allow(unused)] pub fn grin_get_partition_id( arg1: GrinPartitionedGraph, arg2: GrinPartition, ) -> GrinPartitionId; #[cfg(feature = "grin_enable_vertex_ref")] + #[allow(unused)] pub fn grin_get_vertex_ref_for_vertex(arg1: GrinGraph, arg2: GrinVertex) -> GrinVertexRef; #[cfg(feature = "grin_enable_vertex_ref")] + #[allow(unused)] pub fn grin_destroy_vertex_ref(arg1: GrinGraph, arg2: GrinVertexRef); #[doc = " @brief get the local vertex from the vertex ref\n if the vertex ref is not regconized, a null vertex is returned\n @param GrinGraph the graph\n @param GrinVertexRef the vertex ref"] #[cfg(feature = "grin_enable_vertex_ref")] + #[allow(unused)] pub fn grin_get_vertex_from_vertex_ref(arg1: GrinGraph, arg2: GrinVertexRef) -> GrinVertex; #[doc = " @brief get the master partition of a vertex ref.\n Some storage can still provide the master partition of the vertex ref,\n even if the vertex ref can NOT be recognized locally.\n @param GrinGraph the graph\n @param GrinVertexRef the vertex ref"] #[cfg(feature = "grin_enable_vertex_ref")] + #[allow(unused)] pub fn grin_get_master_partition_from_vertex_ref( arg1: GrinGraph, arg2: GrinVertexRef, ) -> GrinPartition; #[cfg(feature = "grin_enable_vertex_ref")] + #[allow(unused)] pub fn grin_serialize_vertex_ref( arg1: GrinGraph, arg2: GrinVertexRef, ) -> *const ::std::os::raw::c_char; #[cfg(feature = "grin_enable_vertex_ref")] + #[allow(unused)] pub fn grin_destroy_serialized_vertex_ref( arg1: GrinGraph, arg2: *const ::std::os::raw::c_char, ); #[cfg(feature = "grin_enable_vertex_ref")] + #[allow(unused)] pub fn grin_deserialize_to_vertex_ref( arg1: GrinGraph, arg2: *const ::std::os::raw::c_char, ) -> GrinVertexRef; #[cfg(feature = "grin_enable_vertex_ref")] + #[allow(unused)] pub fn grin_is_master_vertex(arg1: GrinGraph, arg2: GrinVertex) -> bool; #[cfg(feature = "grin_enable_vertex_ref")] + #[allow(unused)] pub fn grin_is_mirror_vertex(arg1: GrinGraph, arg2: GrinVertex) -> bool; + #[allow(unused)] pub fn grin_serialize_vertex_ref_as_int64( arg1: GrinGraph, arg2: GrinVertexRef, ) -> i64; #[cfg(feature = "grin_trait_fast_vertex_ref")] + #[allow(unused)] pub fn grin_deserialize_vertex_ref_from_int64( arg1: GrinGraph, arg2: i64, ) -> GrinVertexRef; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_get_total_vertex_num(arg1: GrinPartitionedGraph) -> usize; #[cfg(feature = "grin_enable_graph_partition")] + #[allow(unused)] pub fn grin_get_total_edge_num(arg1: GrinPartitionedGraph) -> usize; #[cfg(feature = "grin_trait_select_master_for_vertex_list")] + #[allow(unused)] pub fn grin_select_master_for_vertex_list( arg1: GrinGraph, arg2: GrinVertexList, ) -> GrinVertexList; #[cfg(feature = "grin_trait_select_master_for_vertex_list")] + #[allow(unused)] pub fn grin_select_mirror_for_vertex_list( arg1: GrinGraph, arg2: GrinVertexList, @@ -358,10 +424,12 @@ extern "C" { #[doc = " @brief get the vertex types with primary keys\n @param GrinGraph the graph"] #[cfg(feature = "grin_enable_vertex_primary_keys")] + #[allow(unused)] pub fn grin_get_vertex_types_with_primary_keys(arg1: GrinGraph) -> GrinVertexTypeList; #[doc = " @brief get the primary keys (property list) of a specific vertex type\n @param GrinGraph the graph\n @param GrinVertexType the vertex type"] #[cfg(feature = "grin_enable_vertex_primary_keys")] + #[allow(unused)] pub fn grin_get_primary_keys_by_vertex_type( arg1: GrinGraph, arg2: GrinVertexType, @@ -369,6 +437,7 @@ extern "C" { #[doc = " @brief get the vertex with the given primary keys\n @param GrinGraph the graph\n @param GrinVertexType the vertex type which determines the property list for primary keys\n @param GrinRow the values of primary keys"] #[cfg(feature = "grin_enable_vertex_primary_keys")] + #[allow(unused)] pub fn grin_get_vertex_by_primary_keys( arg1: GrinGraph, arg2: GrinVertexType, @@ -377,6 +446,7 @@ extern "C" { #[doc = " @brief get the vertex property name\n @param GrinGraph the graph\n @param GrinVertexProperty the vertex property"] #[cfg(feature = "grin_with_vertex_property_name")] + #[allow(unused)] pub fn grin_get_vertex_property_name( arg1: GrinGraph, arg2: GrinVertexProperty, @@ -384,6 +454,7 @@ extern "C" { #[doc = " @brief get the vertex property with a given name under a specific vertex type\n @param GrinGraph the graph\n @param GrinVertexType the specific vertex type\n @param name the name"] #[cfg(feature = "grin_with_vertex_property_name")] + #[allow(unused)] pub fn grin_get_vertex_property_by_name( arg1: GrinGraph, arg2: GrinVertexType, @@ -392,6 +463,7 @@ extern "C" { #[doc = " @brief get all the vertex properties with a given name\n @param GrinGraph the graph\n @param name the name"] #[cfg(feature = "grin_with_vertex_property_name")] + #[allow(unused)] pub fn grin_get_vertex_properties_by_name( arg1: GrinGraph, name: *const ::std::os::raw::c_char, @@ -399,6 +471,7 @@ extern "C" { #[doc = " @brief get the edge property name\n @param GrinGraph the graph\n @param GrinEdgeProperty the edge property"] #[cfg(feature = "grin_with_edge_property_name")] + #[allow(unused)] pub fn grin_get_edge_property_name( arg1: GrinGraph, arg2: GrinEdgeProperty, @@ -406,6 +479,7 @@ extern "C" { #[doc = " @brief get the edge property with a given name under a specific edge type\n @param GrinGraph the graph\n @param GrinEdgeType the specific edge type\n @param name the name"] #[cfg(feature = "grin_with_edge_property_name")] + #[allow(unused)] pub fn grin_get_edge_property_by_name( arg1: GrinGraph, arg2: GrinEdgeType, @@ -414,12 +488,14 @@ extern "C" { #[doc = " @brief get all the edge properties with a given name\n @param GrinGraph the graph\n @param name the name"] #[cfg(feature = "grin_with_edge_property_name")] + #[allow(unused)] pub fn grin_get_edge_properties_by_name( arg1: GrinGraph, name: *const ::std::os::raw::c_char, ) -> GrinEdgePropertyList; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_equal_vertex_property( arg1: GrinGraph, arg2: GrinVertexProperty, @@ -428,10 +504,12 @@ extern "C" { #[doc = " @brief destroy vertex property\n @param GrinVertexProperty vertex property"] #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_destroy_vertex_property(arg1: GrinGraph, arg2: GrinVertexProperty); #[doc = " @brief get property data type\n @param GrinVertexProperty vertex property"] #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_property_data_type( arg1: GrinGraph, arg2: GrinVertexProperty, @@ -439,12 +517,14 @@ extern "C" { #[doc = " @brief get the vertex type that the property is bound to\n @param GrinVertexProperty vertex property"] #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_property_vertex_type( arg1: GrinGraph, arg2: GrinVertexProperty, ) -> GrinVertexType; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_equal_edge_property( arg1: GrinGraph, arg2: GrinEdgeProperty, @@ -453,10 +533,12 @@ extern "C" { #[doc = " @brief destroy edge property\n @param GrinEdgeProperty edge property"] #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_destroy_edge_property(arg1: GrinGraph, arg2: GrinEdgeProperty); #[doc = " @brief get property data type\n @param GrinEdgeProperty edge property"] #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_get_edge_property_data_type( arg1: GrinGraph, arg2: GrinEdgeProperty, @@ -464,24 +546,28 @@ extern "C" { #[doc = " @brief get the edge type that the property is bound to\n @param GrinEdgeProperty edge property"] #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_get_edge_property_edge_type( arg1: GrinGraph, arg2: GrinEdgeProperty, ) -> GrinEdgeType; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_property_list_by_type( arg1: GrinGraph, arg2: GrinVertexType, ) -> GrinVertexPropertyList; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_property_list_size( arg1: GrinGraph, arg2: GrinVertexPropertyList, ) -> usize; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_property_from_list( arg1: GrinGraph, arg2: GrinVertexPropertyList, @@ -489,12 +575,15 @@ extern "C" { ) -> GrinVertexProperty; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_create_vertex_property_list(arg1: GrinGraph) -> GrinVertexPropertyList; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_destroy_vertex_property_list(arg1: GrinGraph, arg2: GrinVertexPropertyList); #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_insert_vertex_property_to_list( arg1: GrinGraph, arg2: GrinVertexPropertyList, @@ -502,6 +591,7 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_trait_natural_id_for_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_property_from_id( arg1: GrinGraph, arg2: GrinVertexType, @@ -509,6 +599,7 @@ extern "C" { ) -> GrinVertexProperty; #[cfg(feature = "grin_trait_natural_id_for_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_property_id( arg1: GrinGraph, arg2: GrinVertexType, @@ -516,18 +607,21 @@ extern "C" { ) -> GrinVertexPropertyId; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_get_edge_property_list_by_type( arg1: GrinGraph, arg2: GrinEdgeType, ) -> GrinEdgePropertyList; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_get_edge_property_list_size( arg1: GrinGraph, arg2: GrinEdgePropertyList, ) -> usize; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_get_edge_property_from_list( arg1: GrinGraph, arg2: GrinEdgePropertyList, @@ -535,12 +629,15 @@ extern "C" { ) -> GrinEdgeProperty; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_create_edge_property_list(arg1: GrinGraph) -> GrinEdgePropertyList; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_destroy_edge_property_list(arg1: GrinGraph, arg2: GrinEdgePropertyList); #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_insert_edge_property_to_list( arg1: GrinGraph, arg2: GrinEdgePropertyList, @@ -548,6 +645,7 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_trait_natural_id_for_edge_property")] + #[allow(unused)] pub fn grin_get_edge_property_from_id( arg1: GrinGraph, arg2: GrinEdgeType, @@ -555,6 +653,7 @@ extern "C" { ) -> GrinEdgeProperty; #[cfg(feature = "grin_trait_natural_id_for_edge_property")] + #[allow(unused)] pub fn grin_get_edge_property_id( arg1: GrinGraph, arg2: GrinEdgeType, @@ -562,10 +661,12 @@ extern "C" { ) -> GrinEdgePropertyId; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_destroy_row(arg1: GrinGraph, arg2: GrinRow); #[doc = " @brief the value of a property from row by its position in row"] #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_get_value_from_row( arg1: GrinGraph, arg2: GrinRow, @@ -573,53 +674,63 @@ extern "C" { arg4: usize, ) -> *const ::std::os::raw::c_void; + #[allow(unused)] pub fn grin_get_int32_from_row( arg1: GrinGraph, arg2: GrinRow, arg3: usize, ) -> i32; + #[allow(unused)] pub fn grin_get_uint32_from_row( arg1: GrinGraph, arg2: GrinRow, arg3: usize, ) -> u32; + #[allow(unused)] pub fn grin_get_int64_from_row( arg1: GrinGraph, arg2: GrinRow, arg3: usize, ) -> i64; + #[allow(unused)] pub fn grin_get_uint64_from_row( arg1: GrinGraph, arg2: GrinRow, arg3: usize, ) -> u64; + #[allow(unused)] pub fn grin_get_float_from_row(arg1: GrinGraph, arg2: GrinRow, arg3: usize) -> f32; + #[allow(unused)] pub fn grin_get_double_from_row(arg1: GrinGraph, arg2: GrinRow, arg3: usize) -> f64; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_get_string_from_row( arg1: GrinGraph, arg2: GrinRow, arg3: usize, ) -> *const ::std::os::raw::c_char; + #[allow(unused)] pub fn grin_get_date32_from_row( arg1: GrinGraph, arg2: GrinRow, arg3: usize, ) -> i32; + #[allow(unused)] pub fn grin_get_time32_from_row( arg1: GrinGraph, arg2: GrinRow, arg3: usize, ) -> i32; + #[allow(unused)] pub fn grin_get_timestamp64_from_row( arg1: GrinGraph, arg2: GrinRow, @@ -628,10 +739,12 @@ extern "C" { #[doc = " @brief create a row, usually to get vertex/edge by primary keys"] #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_create_row(arg1: GrinGraph) -> GrinRow; #[doc = " @brief insert a value to the end of the row"] #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_value_to_row( arg1: GrinGraph, arg2: GrinRow, @@ -640,6 +753,7 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_int32_to_row( arg1: GrinGraph, arg2: GrinRow, @@ -647,6 +761,7 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_uint32_to_row( arg1: GrinGraph, arg2: GrinRow, @@ -654,6 +769,7 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_int64_to_row( arg1: GrinGraph, arg2: GrinRow, @@ -661,6 +777,7 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_uint64_to_row( arg1: GrinGraph, arg2: GrinRow, @@ -668,12 +785,15 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_float_to_row(arg1: GrinGraph, arg2: GrinRow, arg3: f32) -> bool; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_double_to_row(arg1: GrinGraph, arg2: GrinRow, arg3: f64) -> bool; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_string_to_row( arg1: GrinGraph, arg2: GrinRow, @@ -681,6 +801,7 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_date32_to_row( arg1: GrinGraph, arg2: GrinRow, @@ -688,6 +809,7 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_time32_to_row( arg1: GrinGraph, arg2: GrinRow, @@ -695,6 +817,7 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_enable_row")] + #[allow(unused)] pub fn grin_insert_timestamp64_to_row( arg1: GrinGraph, arg2: GrinRow, @@ -703,10 +826,12 @@ extern "C" { #[doc = " @brief destroy vertex property table\n @param GrinVertexPropertyTable vertex property table"] #[cfg(feature = "grin_enable_vertex_property_table")] + #[allow(unused)] pub fn grin_destroy_vertex_property_table(arg1: GrinGraph, arg2: GrinVertexPropertyTable); #[doc = " @brief get the vertex property table of a certain vertex type\n No matter column or row store strategy is used in the storage,\n GRIN recommends to first get the property table of the vertex type,\n and then fetch values(rows) by vertex and property(list). However,\n GRIN does provide direct row fetching API when GrinAssumeColumnStoreForVertexProperty\n is NOT set.\n @param GrinGraph the graph\n @param GrinVertexType the vertex type"] #[cfg(feature = "grin_enable_vertex_property_table")] + #[allow(unused)] pub fn grin_get_vertex_property_table_by_type( arg1: GrinGraph, arg2: GrinVertexType, @@ -714,6 +839,7 @@ extern "C" { #[doc = " @brief get vertex property value from table\n @param GrinVertexPropertyTable vertex property table\n @param GrinVertex the vertex which is the row index\n @param GrinVertexProperty the vertex property which is the column index\n @return can be casted to the property data type by the caller"] #[cfg(feature = "grin_enable_vertex_property_table")] + #[allow(unused)] pub fn grin_get_value_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -721,6 +847,7 @@ extern "C" { arg4: GrinVertexProperty, ) -> *const ::std::os::raw::c_void; + #[allow(unused)] pub fn grin_get_int32_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -728,6 +855,7 @@ extern "C" { arg4: GrinVertexProperty, ) -> i32; + #[allow(unused)] pub fn grin_get_uint32_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -735,6 +863,7 @@ extern "C" { arg4: GrinVertexProperty, ) -> u32; + #[allow(unused)] pub fn grin_get_int64_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -742,6 +871,7 @@ extern "C" { arg4: GrinVertexProperty, ) -> i64; + #[allow(unused)] pub fn grin_get_uint64_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -749,6 +879,7 @@ extern "C" { arg4: GrinVertexProperty, ) -> u64; + #[allow(unused)] pub fn grin_get_float_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -756,6 +887,7 @@ extern "C" { arg4: GrinVertexProperty, ) -> f32; + #[allow(unused)] pub fn grin_get_double_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -764,6 +896,7 @@ extern "C" { ) -> f64; #[cfg(feature = "grin_enable_vertex_property_table")] + #[allow(unused)] pub fn grin_get_string_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -771,6 +904,7 @@ extern "C" { arg4: GrinVertexProperty, ) -> *const ::std::os::raw::c_char; + #[allow(unused)] pub fn grin_get_date32_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -778,6 +912,7 @@ extern "C" { arg4: GrinVertexProperty, ) -> i32; + #[allow(unused)] pub fn grin_get_time32_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -785,6 +920,7 @@ extern "C" { arg4: GrinVertexProperty, ) -> i32; + #[allow(unused)] pub fn grin_get_timestamp64_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -794,6 +930,7 @@ extern "C" { #[doc = " @brief get vertex row from table\n @param GrinVertexPropertyTable vertex property table\n @param GrinVertex the vertex which is the row index\n @param GrinVertexPropertyList the vertex property list as columns"] #[cfg(all(feature = "grin_enable_vertex_property_table", feature = "grin_enable_row"))] + #[allow(unused)] pub fn grin_get_row_from_vertex_property_table( arg1: GrinGraph, arg2: GrinVertexPropertyTable, @@ -803,10 +940,12 @@ extern "C" { #[doc = " @brief destroy edge property table\n @param GrinEdgePropertyTable edge property table"] #[cfg(feature = "grin_enable_edge_property_table")] + #[allow(unused)] pub fn grin_destroy_edge_property_table(arg1: GrinGraph, arg2: GrinEdgePropertyTable); #[doc = " @brief get the edge property table of a certain edge type\n No matter column or row store strategy is used in the storage,\n GRIN recommends to first get the property table of the edge type,\n and then fetch values(rows) by edge and property(list). However,\n GRIN does provide direct row fetching API when GrinAssumeColumnStoreForEdgeProperty\n is NOT set.\n @param GrinGraph the graph\n @param GrinEdgeType the edge type"] #[cfg(feature = "grin_enable_edge_property_table")] + #[allow(unused)] pub fn grin_get_edge_property_table_by_type( arg1: GrinGraph, arg2: GrinEdgeType, @@ -814,6 +953,7 @@ extern "C" { #[doc = " @brief get edge property value from table\n @param GrinEdgePropertyTable edge property table\n @param GrinEdge the edge which is the row index\n @param GrinEdgeProperty the edge property which is the column index\n @return can be casted to the property data type by the caller"] #[cfg(feature = "grin_enable_edge_property_table")] + #[allow(unused)] pub fn grin_get_value_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -821,6 +961,7 @@ extern "C" { arg4: GrinEdgeProperty, ) -> *const ::std::os::raw::c_void; + #[allow(unused)] pub fn grin_get_int32_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -828,6 +969,7 @@ extern "C" { arg4: GrinEdgeProperty, ) -> i32; + #[allow(unused)] pub fn grin_get_uint32_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -835,6 +977,7 @@ extern "C" { arg4: GrinEdgeProperty, ) -> u32; + #[allow(unused)] pub fn grin_get_int64_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -842,6 +985,7 @@ extern "C" { arg4: GrinEdgeProperty, ) -> i64; + #[allow(unused)] pub fn grin_get_uint64_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -849,6 +993,7 @@ extern "C" { arg4: GrinEdgeProperty, ) -> u64; + #[allow(unused)] pub fn grin_get_float_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -856,6 +1001,7 @@ extern "C" { arg4: GrinEdgeProperty, ) -> f32; + #[allow(unused)] pub fn grin_get_double_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -864,6 +1010,7 @@ extern "C" { ) -> f64; #[cfg(feature = "grin_enable_edge_property_table")] + #[allow(unused)] pub fn grin_get_string_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -871,6 +1018,7 @@ extern "C" { arg4: GrinEdgeProperty, ) -> *const ::std::os::raw::c_char; + #[allow(unused)] pub fn grin_get_date32_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -878,6 +1026,7 @@ extern "C" { arg4: GrinEdgeProperty, ) -> i32; + #[allow(unused)] pub fn grin_get_time32_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -885,6 +1034,7 @@ extern "C" { arg4: GrinEdgeProperty, ) -> i32; + #[allow(unused)] pub fn grin_get_timestamp64_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -894,6 +1044,7 @@ extern "C" { #[doc = " @brief get edge row from table\n @param GrinEdgePropertyTable edge property table\n @param GrinEdge the edge which is the row index\n @param GrinEdgePropertyList the edge property list as columns"] #[cfg(all(feature = "grin_enable_edge_property_table", feature = "grin_enable_row"))] + #[allow(unused)] pub fn grin_get_row_from_edge_property_table( arg1: GrinGraph, arg2: GrinEdgePropertyTable, @@ -902,24 +1053,29 @@ extern "C" { ) -> GrinRow; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_num_by_type(arg1: GrinGraph, arg2: GrinVertexType) -> usize; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_get_edge_num_by_type(arg1: GrinGraph, arg2: GrinEdgeType) -> usize; #[cfg(all(feature = "grin_enable_graph_partition", feature = "grin_with_vertex_property"))] + #[allow(unused)] pub fn grin_get_total_vertex_num_by_type( arg1: GrinPartitionedGraph, arg2: GrinVertexType, ) -> usize; #[cfg(all(feature = "grin_enable_graph_partition", feature = "grin_with_edge_property"))] + #[allow(unused)] pub fn grin_get_total_edge_num_by_type( arg1: GrinPartitionedGraph, arg2: GrinEdgeType, ) -> usize; #[cfg(feature = "grin_assume_by_type_vertex_original_id")] + #[allow(unused)] pub fn grin_get_vertex_from_original_id_by_type( arg1: GrinGraph, arg2: GrinVertexType, @@ -927,6 +1083,7 @@ extern "C" { ) -> GrinVertex; #[cfg(feature = "grin_trait_select_type_for_vertex_list")] + #[allow(unused)] pub fn grin_select_type_for_vertex_list( arg1: GrinGraph, arg2: GrinVertexType, @@ -934,6 +1091,7 @@ extern "C" { ) -> GrinVertexList; #[cfg(feature = "grin_trait_select_edge_type_for_adjacent_list")] + #[allow(unused)] pub fn grin_select_edge_type_for_adjacent_list( arg1: GrinGraph, arg2: GrinEdgeType, @@ -941,6 +1099,7 @@ extern "C" { ) -> GrinAdjacentList; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_equal_vertex_type( arg1: GrinGraph, arg2: GrinVertexType, @@ -948,21 +1107,27 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_type(arg1: GrinGraph, arg2: GrinVertex) -> GrinVertexType; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_destroy_vertex_type(arg1: GrinGraph, arg2: GrinVertexType); #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_type_list(arg1: GrinGraph) -> GrinVertexTypeList; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_destroy_vertex_type_list(arg1: GrinGraph, arg2: GrinVertexTypeList); #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_create_vertex_type_list(arg1: GrinGraph) -> GrinVertexTypeList; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_insert_vertex_type_to_list( arg1: GrinGraph, arg2: GrinVertexTypeList, @@ -970,9 +1135,11 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_type_list_size(arg1: GrinGraph, arg2: GrinVertexTypeList) -> usize; #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] pub fn grin_get_vertex_type_from_list( arg1: GrinGraph, arg2: GrinVertexTypeList, @@ -980,28 +1147,33 @@ extern "C" { ) -> GrinVertexType; #[cfg(feature = "grin_with_vertex_type_name")] + #[allow(unused)] pub fn grin_get_vertex_type_name( arg1: GrinGraph, arg2: GrinVertexType, ) -> *const ::std::os::raw::c_char; #[cfg(feature = "grin_with_vertex_type_name")] + #[allow(unused)] pub fn grin_get_vertex_type_by_name( arg1: GrinGraph, arg2: *const ::std::os::raw::c_char, ) -> GrinVertexType; #[cfg(feature = "grin_trait_natural_id_for_vertex_type")] + #[allow(unused)] pub fn grin_get_vertex_type_id(arg1: GrinGraph, arg2: GrinVertexType) -> GrinVertexTypeId; #[cfg(feature = "grin_trait_natural_id_for_vertex_type")] + #[allow(unused)] pub fn grin_get_vertex_type_from_id( arg1: GrinGraph, arg2: GrinVertexTypeId, ) -> GrinVertexType; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_equal_edge_type( arg1: GrinGraph, arg2: GrinEdgeType, @@ -1009,21 +1181,27 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_get_edge_type(arg1: GrinGraph, arg2: GrinEdge) -> GrinEdgeType; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_destroy_edge_type(arg1: GrinGraph, arg2: GrinEdgeType); #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_get_edge_type_list(arg1: GrinGraph) -> GrinEdgeTypeList; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_destroy_edge_type_list(arg1: GrinGraph, arg2: GrinEdgeTypeList); #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_create_edge_type_list(arg1: GrinGraph) -> GrinEdgeTypeList; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_insert_edge_type_to_list( arg1: GrinGraph, arg2: GrinEdgeTypeList, @@ -1031,9 +1209,11 @@ extern "C" { ) -> bool; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_get_edge_type_list_size(arg1: GrinGraph, arg2: GrinEdgeTypeList) -> usize; #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] pub fn grin_get_edge_type_from_list( arg1: GrinGraph, arg2: GrinEdgeTypeList, @@ -1041,25 +1221,30 @@ extern "C" { ) -> GrinEdgeType; #[cfg(feature = "grin_with_edge_type_name")] + #[allow(unused)] pub fn grin_get_edge_type_name( arg1: GrinGraph, arg2: GrinEdgeType, ) -> *const ::std::os::raw::c_char; #[cfg(feature = "grin_with_edge_type_name")] + #[allow(unused)] pub fn grin_get_edge_type_by_name( arg1: GrinGraph, arg2: *const ::std::os::raw::c_char, ) -> GrinEdgeType; #[cfg(feature = "grin_trait_natural_id_for_edge_type")] + #[allow(unused)] pub fn grin_get_edge_type_id(arg1: GrinGraph, arg2: GrinEdgeType) -> GrinEdgeTypeId; #[cfg(feature = "grin_trait_natural_id_for_edge_type")] + #[allow(unused)] pub fn grin_get_edge_type_from_id(arg1: GrinGraph, arg2: GrinEdgeTypeId) -> GrinEdgeType; #[doc = " @brief the src vertex type list"] #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] + #[allow(unused)] pub fn grin_get_src_types_from_edge_type( arg1: GrinGraph, arg2: GrinEdgeType, @@ -1067,6 +1252,7 @@ extern "C" { #[doc = " @brief get the dst vertex type list"] #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] + #[allow(unused)] pub fn grin_get_dst_types_from_edge_type( arg1: GrinGraph, arg2: GrinEdgeType, @@ -1074,6 +1260,7 @@ extern "C" { #[doc = " @brief get the edge type list related to a given pair of vertex types"] #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] + #[allow(unused)] pub fn grin_get_edge_types_from_vertex_type_pair( arg1: GrinGraph, arg2: GrinVertexType, @@ -1081,15 +1268,51 @@ extern "C" { ) -> GrinEdgeTypeList; #[cfg(feature = "grin_assume_all_vertex_list_sorted")] + #[allow(unused)] pub fn grin_smaller_vertex(arg1: GrinGraph, arg2: GrinVertex, arg3: GrinVertex) -> bool; #[doc = " @brief get the position of a vertex in a sorted list\n caller must guarantee the input vertex list is sorted to get the correct result\n @param GrinGraph the graph\n @param GrinVertexList the sorted vertex list\n @param VERTEX the vertex to find\n @param pos the returned position of the vertex\n @return false if the vertex is not found"] #[cfg(all(feature = "grin_assume_all_vertex_list_sorted", feature = "grin_enable_vertex_list_array"))] + #[allow(unused)] pub fn grin_get_position_of_vertex_from_sorted_list( arg1: GrinGraph, arg2: GrinVertexList, arg3: GrinVertex, ) -> usize; - pub static mut grin_error_code: GrinErrorCode; + + #[allow(unused)] + pub fn grin_get_last_error_code() -> GrinErrorCode; + } + + pub const GRIN_NULL_DATATYPE: GrinDataType = GRIN_DATATYPE_UNDEFINED; + + pub const GRIN_NULL_GRAPH: GrinGraph = std::ptr::null_mut(); + + pub const GRIN_NULL_VERTEX: GrinVertex = std::ptr::null_mut(); + + pub const GRIN_NULL_EDGE: GrinEdge = std::ptr::null_mut(); + + pub const GRIN_NULL_LIST: *const ::std::os::raw::c_void = std::ptr::null_mut(); + + pub const GRIN_NULL_LIST_ITERATOR: *const ::std::os::raw::c_void = std::ptr::null_mut(); + + pub const GRIN_NULL_PARTITION: GrinPartition = u32::MAX; + + pub const GRIN_NULL_VERTEX_REF: GrinVertexRef = -1; + + pub const GRIN_NULL_VERTEX_TYPE: GrinVertexType = u32::MAX; + + pub const GRIN_NULL_EDGE_TYPE: GrinEdgeType = u32::MAX; + + pub const GRIN_NULL_VERTEX_PROPERTY: GrinVertexProperty = u64::MAX; + + pub const GRIN_NULL_EDGE_PROPERTY: GrinEdgeProperty = u64::MAX; + + pub const GRIN_NULL_ROW: GrinRow = std::ptr::null_mut(); + + pub const GRIN_NULL_NATURAL_ID: u32 = u32::MAX; + + pub const GRIN_NULL_SIZE: u32 = u32::MAX; + diff --git a/modules/graph/grin/rust/parse.py b/modules/graph/grin/rust/parse.py index 54463e21d..c452603fa 100644 --- a/modules/graph/grin/rust/parse.py +++ b/modules/graph/grin/rust/parse.py @@ -90,7 +90,7 @@ def snake_to_camel(s): def snake_to_camel_line(line): segs = line.split(' ') - return ' '.join([snake_to_camel(s) if s.startswith('GRIN_') else s for s in segs]) + return ' '.join([snake_to_camel(s) if s.startswith('GRIN_') and s.find('NULL') == -1 else s for s in segs]) def static_replace(line): replaces = { @@ -103,10 +103,13 @@ def static_replace(line): line = line.replace(k, replaces[k]) return line + def rewrite(file, r, strip=49): with open(file) as f: lines = f.readlines() externc_flag = True + need_ending_line = True + meet_error_code = False with open(file, 'w') as f: for i, line in enumerate(lines): if i < strip: @@ -122,6 +125,7 @@ def rewrite(file, r, strip=49): if i < len(lines) - 1: f.write('\n') else: + need_ending_line = False f.write('}\n') continue if line.find('pub fn') != -1: @@ -130,7 +134,20 @@ def rewrite(file, r, strip=49): func_name = func_name.split('(')[0] if func_name in r and r[func_name]: f.write(f' {r[func_name]}\n') + f.write(' #[allow(unused)]\n') + + if line.find('RUST_KEEP') != -1: + if need_ending_line: + f.write('}\n\n') + segs = line.split('RUST_KEEP') + for s in segs[1:]: + f.write(s[:s.find(';')+1]) + f.write('\n\n') + break + if line.find('pub static mut grin_error_code: GrinErrorCode') != -1: + continue f.write(line) + def parse_to_rs(path, dst): r = {} diff --git a/modules/graph/grin/rust/v6d_all.h b/modules/graph/grin/rust/v6d_all.h index d293a9763..d03df31c4 100644 --- a/modules/graph/grin/rust/v6d_all.h +++ b/modules/graph/grin/rust/v6d_all.h @@ -14,5 +14,22 @@ #include "../include/property/type.h" #include "../include/index/label.h" #include "../include/index/order.h" +#include "../include/common/error.h" -__thread GRIN_ERROR_CODE grin_error_code; + +/// RUST_KEEP pub const GRIN_NULL_DATATYPE: GrinDataType = GRIN_DATATYPE_UNDEFINED; +/// RUST_KEEP pub const GRIN_NULL_GRAPH: GrinGraph = std::ptr::null_mut(); +/// RUST_KEEP pub const GRIN_NULL_VERTEX: GrinVertex = std::ptr::null_mut(); +/// RUST_KEEP pub const GRIN_NULL_EDGE: GrinEdge = std::ptr::null_mut(); +/// RUST_KEEP pub const GRIN_NULL_LIST: *const ::std::os::raw::c_void = std::ptr::null_mut(); +/// RUST_KEEP pub const GRIN_NULL_LIST_ITERATOR: *const ::std::os::raw::c_void = std::ptr::null_mut(); +/// RUST_KEEP pub const GRIN_NULL_PARTITION: GrinPartition = u32::MAX; +/// RUST_KEEP pub const GRIN_NULL_VERTEX_REF: GrinVertexRef = -1; +/// RUST_KEEP pub const GRIN_NULL_VERTEX_TYPE: GrinVertexType = u32::MAX; +/// RUST_KEEP pub const GRIN_NULL_EDGE_TYPE: GrinEdgeType = u32::MAX; +/// RUST_KEEP pub const GRIN_NULL_VERTEX_PROPERTY: GrinVertexProperty = u64::MAX; +/// RUST_KEEP pub const GRIN_NULL_EDGE_PROPERTY: GrinEdgeProperty = u64::MAX; +/// RUST_KEEP pub const GRIN_NULL_ROW: GrinRow = std::ptr::null_mut(); +/// RUST_KEEP pub const GRIN_NULL_NATURAL_ID: u32 = u32::MAX; +/// RUST_KEEP pub const GRIN_NULL_SIZE: u32 = u32::MAX; +int ending; diff --git a/modules/graph/grin/src/common/error.cc b/modules/graph/grin/src/common/error.cc new file mode 100644 index 000000000..79fe6d021 --- /dev/null +++ b/modules/graph/grin/src/common/error.cc @@ -0,0 +1,28 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/** + @file error.h + @brief Define the error code related APIs +*/ + +#include "graph/grin/src/predefine.h" + +extern "C" { +#include "graph/grin/include/common/error.h" +} + +__thread GRIN_ERROR_CODE grin_error_code = GRIN_NO_ERROR; + +GRIN_ERROR_CODE grin_get_last_error_code() { + return grin_error_code; +} diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 76b72b4af..5361e0a43 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -13,10 +13,9 @@ limitations under the License. #include "graph/grin/src/predefine.h" extern "C" { #include "graph/grin/include/property/propertytable.h" +#include "graph/grin/include/common/error.h" } -__thread GRIN_ERROR_CODE grin_error_code; - #ifdef GRIN_ENABLE_ROW void grin_destroy_row(GRIN_GRAPH g, GRIN_ROW r) { auto _r = static_cast(r); From bdee5bd2f282e3ff69a5d19cd21f6be6cbc893e8 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Wed, 10 May 2023 08:01:31 +0000 Subject: [PATCH 63/85] grin api rename --- modules/graph/fragment/arrow_fragment.grin.h | 10 +- modules/graph/grin/c/test.c | 48 +- modules/graph/grin/docs/README.md | 12 +- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 8 +- modules/graph/grin/rust/grin_v6d.rs | 54 +- modules/graph/grin/rust/parse.py | 2 +- modules/graph/grin/rust/v6d_all.h | 6 +- modules/graph/grin/src/common/error.cc | 2 +- modules/graph/grin/src/partition/partition.cc | 4 +- modules/graph/grin/src/partition/reference.cc | 6 +- modules/graph/grin/src/partition/topology.cc | 2 +- modules/graph/grin/src/property/property.cc | 8 +- .../graph/grin/src/property/propertylist.cc | 4 +- .../graph/grin/src/property/propertytable.cc | 92 +- modules/graph/grin/src/property/topology.cc | 2 +- modules/graph/grin/src/property/type.cc | 10 +- modules/graph/grin/src/proto/gie_schema.pb.cc | 3480 --------------- modules/graph/grin/src/proto/gie_schema.pb.h | 3725 ----------------- modules/graph/grin/src/topology/structure.cc | 6 +- modules/graph/test/grin_test.cc | 14 +- 21 files changed, 148 insertions(+), 7349 deletions(-) delete mode 100644 modules/graph/grin/src/proto/gie_schema.pb.cc delete mode 100644 modules/graph/grin/src/proto/gie_schema.pb.h diff --git a/modules/graph/fragment/arrow_fragment.grin.h b/modules/graph/fragment/arrow_fragment.grin.h index c93a5b16c..605d8dbe3 100644 --- a/modules/graph/fragment/arrow_fragment.grin.h +++ b/modules/graph/fragment/arrow_fragment.grin.h @@ -318,7 +318,7 @@ class GRIN_ArrowFragment { void init(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION partition) { pg_ = partitioned_graph; partition_ = partition; - g_ = grin_get_local_graph_from_partition(pg_, partition_); + g_ = grin_get_local_graph_by_partition(pg_, partition_); } bool directed() const { @@ -414,7 +414,7 @@ class GRIN_ArrowFragment { template bool GetVertex(GRIN_VERTEX_TYPE label, T& oid, GRIN_VERTEX v) { if (GRIN_DATATYPE_ENUM::value != grin_get_vertex_original_id_type(g_)) return false; - v = grin_get_vertex_from_original_id_by_type(g_, label, (GRIN_VERTEX_ORIGINAL_ID)(&oid)); + v = grin_get_vertex_by_original_id_by_type(g_, label, (GRIN_VERTEX_ORIGINAL_ID)(&oid)); return v != NULL; } @@ -430,7 +430,7 @@ class GRIN_ArrowFragment { #ifdef GRIN_NATURAL_PARTITION_ID_TRAIT GRIN_PARTITION_ID GetPartition(GRIN_VERTEX u) const { - auto vref = grin_get_vertex_ref_for_vertex(g_, u); + auto vref = grin_get_vertex_ref_by_vertex(g_, u); auto partition = grin_get_master_partition_from_vertex_ref(g_, vref); return grin_get_partition_id(pg_, partition); } @@ -612,7 +612,7 @@ class GRIN_ArrowFragment { if (in_edge) { auto es = GetIncomingAdjList(*v, etype); for (auto& e : es) { - auto vref = grin_get_vertex_ref_for_vertex(g_, e.neighbor()); + auto vref = grin_get_vertex_ref_by_vertex(g_, e.neighbor()); auto p = grin_get_master_partition_from_vertex_ref(g_, vref); if (!grin_equal_partition(g_, p, partition_)) { @@ -628,7 +628,7 @@ class GRIN_ArrowFragment { if (out_edge) { auto es = GetOutgoingAdjList(*v, etype); for (auto& e : es) { - auto vref = grin_get_vertex_ref_for_vertex(g_, e.neighbor()); + auto vref = grin_get_vertex_ref_by_vertex(g_, e.neighbor()); auto p = grin_get_master_partition_from_vertex_ref(g_, vref); if (!grin_equal_partition(g_, p, partition_)) { diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index 75b57deab..bd17412ab 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -24,7 +24,7 @@ GRIN_GRAPH get_graph(int argc, char** argv) { GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); - GRIN_GRAPH g = grin_get_local_graph_from_partition(pg, partition); + GRIN_GRAPH g = grin_get_local_graph_by_partition(pg, partition); #else GRIN_GRAPH g = grin_get_graph_from_storage(argc - 1, &(argv[1])); #endif @@ -108,7 +108,7 @@ void test_property_type(int argc, char** argv) { #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE printf("vertex type id: %u\n", grin_get_vertex_type_id(g, vt)); GRIN_VERTEX_TYPE vt1 = - grin_get_vertex_type_from_id(g, grin_get_vertex_type_id(g, vt)); + grin_get_vertex_type_by_id(g, grin_get_vertex_type_id(g, vt)); if (!grin_equal_vertex_type(g, vt, vt1)) { printf("vertex type id not match\n"); } @@ -170,18 +170,18 @@ void test_property_type(int argc, char** argv) { #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE printf("edge type id: %u\n", grin_get_edge_type_id(g, et)); GRIN_EDGE_TYPE et1 = - grin_get_edge_type_from_id(g, grin_get_edge_type_id(g, et)); + grin_get_edge_type_by_id(g, grin_get_edge_type_id(g, et)); if (!grin_equal_edge_type(g, et, et1)) { printf("edge type id not match\n"); } grin_destroy_edge_type(g, et1); #endif // relation - GRIN_VERTEX_TYPE_LIST src_vtl = grin_get_src_types_from_edge_type(g, et); + GRIN_VERTEX_TYPE_LIST src_vtl = grin_get_src_types_by_edge_type(g, et); size_t src_vtl_size = grin_get_vertex_type_list_size(g, src_vtl); printf("source vertex type list size: %zu\n", src_vtl_size); - GRIN_VERTEX_TYPE_LIST dst_vtl = grin_get_dst_types_from_edge_type(g, et); + GRIN_VERTEX_TYPE_LIST dst_vtl = grin_get_dst_types_by_edge_type(g, et); size_t dst_vtl_size = grin_get_vertex_type_list_size(g, dst_vtl); printf("destination vertex type list size: %zu\n", dst_vtl_size); @@ -310,7 +310,7 @@ void test_property_topology(int argc, char** argv) { GRIN_DATATYPE dt = grin_get_vertex_original_id_type(g); if (dt == Int64) { long int v0id = 4; - GRIN_VERTEX v0 = grin_get_vertex_from_original_id_by_type(g, vt, &v0id); + GRIN_VERTEX v0 = grin_get_vertex_by_original_id_by_type(g, vt, &v0id); if (v0 == GRIN_NULL_VERTEX) { printf("(Wrong) vertex of id %ld can not be found\n", v0id); } else { @@ -420,14 +420,14 @@ void test_property_vertex_table(int argc, char** argv) { GRIN_ROW row = grin_get_row_from_vertex_property_table(g, vpt, v, vpl); for (size_t j = 0; j < vpl_size; ++j) { GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, j); - GRIN_VERTEX_TYPE vt1 = grin_get_vertex_property_vertex_type(g, vp); + GRIN_VERTEX_TYPE vt1 = grin_get_vertex_type_from_property(g, vp); if (!grin_equal_vertex_type(g, vt, vt1)) { printf("vertex type not match by property\n"); } grin_destroy_vertex_type(g, vt1); #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY unsigned int id = grin_get_vertex_property_id(g, vt, vp); - GRIN_VERTEX_PROPERTY vp1 = grin_get_vertex_property_from_id(g, vt, id); + GRIN_VERTEX_PROPERTY vp1 = grin_get_vertex_property_by_id(g, vt, id); if (!grin_equal_vertex_property(g, vp, vp1)) { printf("vertex property not match by id\n"); } @@ -437,7 +437,7 @@ void test_property_vertex_table(int argc, char** argv) { #endif #ifdef GRIN_WITH_VERTEX_PROPERTY_NAME - const char* vp_name = grin_get_vertex_property_name(g, vp); + const char* vp_name = grin_get_vertex_property_name(g, vt, vp); GRIN_VERTEX_PROPERTY vp2 = grin_get_vertex_property_by_name(g, vt, vp_name); if (!grin_equal_vertex_property(g, vp, vp2)) { @@ -449,7 +449,7 @@ void test_property_vertex_table(int argc, char** argv) { GRIN_DATATYPE dt = grin_get_vertex_property_data_type(g, vp); const void* pv = grin_get_value_from_vertex_property_table(g, vpt, v, vp); - if (grin_get_last_error_code() == GRIN_NO_ERROR) { + if (grin_get_last_error_code() == NO_ERROR) { printf("(Correct) no error\n"); } else { printf("(Wrong) error code: %d\n", grin_get_last_error_code()); @@ -479,7 +479,7 @@ void test_property_vertex_table(int argc, char** argv) { #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY GRIN_VERTEX_PROPERTY vp3 = - grin_get_vertex_property_from_id(g, vt, vpl_size); + grin_get_vertex_property_by_id(g, vt, vpl_size); if (vp3 == GRIN_NULL_VERTEX_PROPERTY) { printf("(Correct) vertex property of id %zu does not exist\n", vpl_size); } else { @@ -518,8 +518,8 @@ void test_property_vertex_table(int argc, char** argv) { for (size_t i = 0; i < vpl2_size; ++i) { GRIN_VERTEX_PROPERTY vp5 = grin_get_vertex_property_from_list(g, vpl2, i); - GRIN_VERTEX_TYPE vt5 = grin_get_vertex_property_vertex_type(g, vp5); - const char* vp5_name = grin_get_vertex_property_name(g, vp5); + GRIN_VERTEX_TYPE vt5 = grin_get_vertex_type_from_property(g, vp5); + const char* vp5_name = grin_get_vertex_property_name(g, vt5, vp5); const char* vt5_name = grin_get_vertex_type_name(g, vt5); printf("vertex type name: %s, vertex property name: %s\n", vt5_name, vp5_name); @@ -588,18 +588,18 @@ void test_property_edge_table(int argc, char** argv) { GRIN_ROW row = grin_get_row_from_edge_property_table(g, ept, e, epl); for (size_t k = 0; k < epl_size; ++k) { GRIN_EDGE_PROPERTY ep = grin_get_edge_property_from_list(g, epl, k); - GRIN_EDGE_TYPE et2 = grin_get_edge_property_edge_type(g, ep); + GRIN_EDGE_TYPE et2 = grin_get_edge_type_from_property(g, ep); if (!grin_equal_edge_type(g, et, et2)) { printf("edge type does not match\n"); } grin_destroy_edge_type(g, et2); - const char* ep_name = grin_get_edge_property_name(g, ep); + const char* ep_name = grin_get_edge_property_name(g, et, ep); printf("edge property name: %s\n", ep_name); #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY unsigned int id = grin_get_edge_property_id(g, et, ep); - GRIN_EDGE_PROPERTY ep1 = grin_get_edge_property_from_id(g, et, id); + GRIN_EDGE_PROPERTY ep1 = grin_get_edge_property_by_id(g, et, id); if (!grin_equal_edge_property(g, ep, ep1)) { printf("edge property not match by id\n"); } @@ -644,11 +644,11 @@ void test_property_edge_table(int argc, char** argv) { for (size_t j = 0; j < epl_size; ++j) { GRIN_EDGE_PROPERTY ep = grin_get_edge_property_from_list(g, epl, j); - GRIN_EDGE_TYPE et1 = grin_get_edge_property_edge_type(g, ep); + GRIN_EDGE_TYPE et1 = grin_get_edge_type_from_property(g, ep); if (!grin_equal_edge_type(g, et, et1)) { printf("edge type does not match\n"); } - const char* ep_name1 = grin_get_edge_property_name(g, ep); + const char* ep_name1 = grin_get_edge_property_name(g, et, ep); const char* et_name = grin_get_edge_type_name(g, et); printf("edge property name: %s, edge property type name: %s\n", ep_name1, et_name); @@ -658,7 +658,7 @@ void test_property_edge_table(int argc, char** argv) { grin_destroy_name(g, et_name); #ifdef GRIN_WITH_EDGE_PROPERTY_NAME - const char* ep_name = grin_get_edge_property_name(g, ep); + const char* ep_name = grin_get_edge_property_name(g, et, ep); GRIN_EDGE_PROPERTY ep2 = grin_get_edge_property_by_name(g, et, ep_name); if (!grin_equal_edge_property(g, ep, ep2)) { printf("edge property not match by name\n"); @@ -669,7 +669,7 @@ void test_property_edge_table(int argc, char** argv) { grin_destroy_edge_property(g, ep); } #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY - GRIN_EDGE_PROPERTY ep3 = grin_get_edge_property_from_id(g, et, epl_size); + GRIN_EDGE_PROPERTY ep3 = grin_get_edge_property_by_id(g, et, epl_size); if (ep3 == GRIN_NULL_EDGE_PROPERTY) { printf("(Correct) edge property of id %zu does not exist\n", epl_size); } else { @@ -705,8 +705,8 @@ void test_property_edge_table(int argc, char** argv) { size_t epl2_size = grin_get_edge_property_list_size(g, epl2); for (size_t i = 0; i < epl2_size; ++i) { GRIN_EDGE_PROPERTY ep5 = grin_get_edge_property_from_list(g, epl2, i); - GRIN_EDGE_TYPE et5 = grin_get_edge_property_edge_type(g, ep5); - const char* ep5_name = grin_get_edge_property_name(g, ep5); + GRIN_EDGE_TYPE et5 = grin_get_edge_type_from_property(g, ep5); + const char* ep5_name = grin_get_edge_property_name(g, et5, ep5); const char* et5_name = grin_get_edge_type_name(g, et5); printf("edge type name: %s, edge property name: %s\n", et5_name, ep5_name); @@ -751,7 +751,7 @@ void test_property_primary_key(int argc, char** argv) { for (size_t j = 0; j < vpl_size; ++j) { GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, j); - const char* vp_name = grin_get_vertex_property_name(g, vp); + const char* vp_name = grin_get_vertex_property_name(g, vt, vp); printf("primary key name: %s\n", vp_name); grin_destroy_name(g, vp_name); grin_destroy_vertex_property(g, vp); @@ -802,7 +802,7 @@ void test_error_code(int argc, char** argv) { GRIN_VERTEX v = get_one_vertex(g); const void* value = grin_get_value_from_vertex_property_table(g, vpt, v, vp); - if (grin_get_last_error_code() == GRIN_INVALID_VALUE) { + if (grin_get_last_error_code() == INVALID_VALUE) { printf("(Correct) invalid value\n"); } else { printf("(Wrong) error code: %d\n", grin_get_last_error_code()); diff --git a/modules/graph/grin/docs/README.md b/modules/graph/grin/docs/README.md index f3d515b77..5ceae433a 100644 --- a/modules/graph/grin/docs/README.md +++ b/modules/graph/grin/docs/README.md @@ -31,11 +31,11 @@ The example demonstrates how to synchronize property values of vertices associat ```CPP void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION partition, const char* edge_type_name, const char* vertex_property_name) { - GRIN_GRAPH g = grin_get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition + GRIN_GRAPH g = grin_get_local_graph_by_partition(partitioned_graph, partition); // get local graph of partition GRIN_EDGE_TYPE etype = grin_get_edge_type_by_name(g, edge_type_name); // get edge type from name - GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_from_edge_type(g, etype); // get related source vertex type list - GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_from_edge_type(g, etype); // get related destination vertex type list + GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_by_edge_type(g, etype); // get related source vertex type list + GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_by_edge_type(g, etype); // get related destination vertex type list size_t src_vtypes_num = grin_get_vertex_type_list_size(g, src_vtypes); size_t dst_vtypes_num = grin_get_vertex_type_list_size(g, dst_vtypes); @@ -76,7 +76,7 @@ The example demonstrates how to synchronize property values of vertices associat GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list(g, adj_list, k); // get the dst vertex u const void* value = grin_get_value_from_vertex_property_table(g, dst_vpt, u, dst_vp); // get the property value of "features" of u - GRIN_VERTEX_REF uref = grin_get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions + GRIN_VERTEX_REF uref = grin_get_vertex_ref_by_vertex(g, u); // get the reference of u that can be recoginized by other partitions GRIN_PARTITION u_master_partition = grin_get_master_partition_from_vertex_ref(g, uref); // get the master partition for u send_value(u_master_partition, uref, dst_vp_dt, value); // the value must be casted to the correct type based on dst_vp_dt before sending @@ -297,7 +297,7 @@ be recognized in partitions other than the current partition where the instance ```CPP /* grin/partition/partition.h */ - GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH, GRIN_VERTEX); + GRIN_VERTEX_REF grin_get_vertex_ref_by_vertex(GRIN_GRAPH, GRIN_VERTEX); const char* grin_serialize_vertex_ref(GRIN_GRAPH, GRIN_VERTEX_REF); @@ -308,7 +308,7 @@ be recognized in partitions other than the current partition where the instance /* run.cc in machine 1 */ { - auto vref = grin_get_vertex_ref_for_vertex(g, v); // get v's vertex ref which can be recgonized in machine 2 + auto vref = grin_get_vertex_ref_by_vertex(g, v); // get v's vertex ref which can be recgonized in machine 2 const char* msg = grin_serialize_vertex_ref(g, vref); // serialize into a message diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 07b5f23b1..a8306fb96 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 07b5f23b1232bedcc76310e13af4a86418cc0e2e +Subproject commit a8306fb9691a189e7927650d7285b601df315ccb diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 8c0c65388..b1e954bfa 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -55,10 +55,10 @@ typedef enum { /// Enumerates the error codes of grin typedef enum { - GRIN_NO_ERROR = 0, ///< success - GRIN_UNKNOWN_ERROR = 1, ///< unknown error - GRIN_INVALID_VALUE = 2, ///< invalid value - GRIN_UNKNOWN_DATATYPE = 3, ///< unknown datatype + NO_ERROR = 0, ///< success + UNKNOWN_ERROR = 1, ///< unknown error + INVALID_VALUE = 2, ///< invalid value + UNKNOWN_DATATYPE = 3, ///< unknown datatype } GRIN_ERROR_CODE; /* Section 1: Toplogy */ diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index 1f25b7bb1..1203bb90e 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -32,13 +32,13 @@ pub const GRIN_DATATYPE_TIMESTAMP64: GrinDatatype = 10; #[doc = " Enumerates the datatype supported in the storage"] pub type GrinDatatype = u32; #[doc = "< success"] -pub const GrinErrorCodeGrinNoError: GrinErrorCode = 0; +pub const GRIN_ERROR_CODE_NO_ERROR: GrinErrorCode = 0; #[doc = "< unknown error"] -pub const GrinErrorCodeGrinUnknownError: GrinErrorCode = 1; +pub const GRIN_ERROR_CODE_UNKNOWN_ERROR: GrinErrorCode = 1; #[doc = "< invalid value"] -pub const GrinErrorCodeGrinInvalidValue: GrinErrorCode = 2; +pub const GRIN_ERROR_CODE_INVALID_VALUE: GrinErrorCode = 2; #[doc = "< unknown datatype"] -pub const GrinErrorCodeGrinUnknownDatatype: GrinErrorCode = 3; +pub const GRIN_ERROR_CODE_UNKNOWN_DATATYPE: GrinErrorCode = 3; #[doc = " Enumerates the error codes of grin"] pub type GrinErrorCode = u32; #[doc = "@}"] @@ -196,10 +196,10 @@ extern "C" { pub fn grin_destroy_edge(arg1: GrinGraph, arg2: GrinEdge); #[allow(unused)] - pub fn grin_get_edge_src(arg1: GrinGraph, arg2: GrinEdge) -> GrinVertex; + pub fn grin_get_src_vertex_from_edge(arg1: GrinGraph, arg2: GrinEdge) -> GrinVertex; #[allow(unused)] - pub fn grin_get_edge_dst(arg1: GrinGraph, arg2: GrinEdge) -> GrinVertex; + pub fn grin_get_dst_vertex_from_edge(arg1: GrinGraph, arg2: GrinEdge) -> GrinVertex; #[cfg(feature = "grin_enable_vertex_list")] #[allow(unused)] @@ -318,14 +318,14 @@ extern "C" { #[cfg(feature = "grin_enable_graph_partition")] #[allow(unused)] - pub fn grin_get_local_graph_from_partition( + pub fn grin_get_local_graph_by_partition( arg1: GrinPartitionedGraph, arg2: GrinPartition, ) -> GrinGraph; #[cfg(feature = "grin_trait_natural_id_for_partition")] #[allow(unused)] - pub fn grin_get_partition_from_id( + pub fn grin_get_partition_by_id( arg1: GrinPartitionedGraph, arg2: GrinPartitionId, ) -> GrinPartition; @@ -339,7 +339,7 @@ extern "C" { #[cfg(feature = "grin_enable_vertex_ref")] #[allow(unused)] - pub fn grin_get_vertex_ref_for_vertex(arg1: GrinGraph, arg2: GrinVertex) -> GrinVertexRef; + pub fn grin_get_vertex_ref_by_vertex(arg1: GrinGraph, arg2: GrinVertex) -> GrinVertexRef; #[cfg(feature = "grin_enable_vertex_ref")] #[allow(unused)] @@ -395,7 +395,7 @@ extern "C" { #[cfg(feature = "grin_trait_fast_vertex_ref")] #[allow(unused)] - pub fn grin_deserialize_vertex_ref_from_int64( + pub fn grin_deserialize_int64_to_vertex_ref( arg1: GrinGraph, arg2: i64, ) -> GrinVertexRef; @@ -449,7 +449,8 @@ extern "C" { #[allow(unused)] pub fn grin_get_vertex_property_name( arg1: GrinGraph, - arg2: GrinVertexProperty, + arg2: GrinVertexType, + arg3: GrinVertexProperty, ) -> *const ::std::os::raw::c_char; #[doc = " @brief get the vertex property with a given name under a specific vertex type\n @param GrinGraph the graph\n @param GrinVertexType the specific vertex type\n @param name the name"] @@ -474,7 +475,8 @@ extern "C" { #[allow(unused)] pub fn grin_get_edge_property_name( arg1: GrinGraph, - arg2: GrinEdgeProperty, + arg2: GrinEdgeType, + arg3: GrinEdgeProperty, ) -> *const ::std::os::raw::c_char; #[doc = " @brief get the edge property with a given name under a specific edge type\n @param GrinGraph the graph\n @param GrinEdgeType the specific edge type\n @param name the name"] @@ -518,7 +520,7 @@ extern "C" { #[doc = " @brief get the vertex type that the property is bound to\n @param GrinVertexProperty vertex property"] #[cfg(feature = "grin_with_vertex_property")] #[allow(unused)] - pub fn grin_get_vertex_property_vertex_type( + pub fn grin_get_vertex_type_from_property( arg1: GrinGraph, arg2: GrinVertexProperty, ) -> GrinVertexType; @@ -547,7 +549,7 @@ extern "C" { #[doc = " @brief get the edge type that the property is bound to\n @param GrinEdgeProperty edge property"] #[cfg(feature = "grin_with_edge_property")] #[allow(unused)] - pub fn grin_get_edge_property_edge_type( + pub fn grin_get_edge_type_from_property( arg1: GrinGraph, arg2: GrinEdgeProperty, ) -> GrinEdgeType; @@ -592,12 +594,13 @@ extern "C" { #[cfg(feature = "grin_trait_natural_id_for_vertex_property")] #[allow(unused)] - pub fn grin_get_vertex_property_from_id( + pub fn grin_get_vertex_property_by_id( arg1: GrinGraph, arg2: GrinVertexType, arg3: GrinVertexPropertyId, ) -> GrinVertexProperty; + #[doc = " We must specify the vertex type here, because the vertex property id is unique only under a specific vertex type"] #[cfg(feature = "grin_trait_natural_id_for_vertex_property")] #[allow(unused)] pub fn grin_get_vertex_property_id( @@ -646,12 +649,13 @@ extern "C" { #[cfg(feature = "grin_trait_natural_id_for_edge_property")] #[allow(unused)] - pub fn grin_get_edge_property_from_id( + pub fn grin_get_edge_property_by_id( arg1: GrinGraph, arg2: GrinEdgeType, arg3: GrinEdgePropertyId, ) -> GrinEdgeProperty; + #[doc = " We must specify the edge type here, because the edge property id is unique only under a specific edge type"] #[cfg(feature = "grin_trait_natural_id_for_edge_property")] #[allow(unused)] pub fn grin_get_edge_property_id( @@ -1076,7 +1080,7 @@ extern "C" { #[cfg(feature = "grin_assume_by_type_vertex_original_id")] #[allow(unused)] - pub fn grin_get_vertex_from_original_id_by_type( + pub fn grin_get_vertex_by_original_id_by_type( arg1: GrinGraph, arg2: GrinVertexType, arg3: GrinVertexOriginalId, @@ -1167,7 +1171,7 @@ extern "C" { #[cfg(feature = "grin_trait_natural_id_for_vertex_type")] #[allow(unused)] - pub fn grin_get_vertex_type_from_id( + pub fn grin_get_vertex_type_by_id( arg1: GrinGraph, arg2: GrinVertexTypeId, ) -> GrinVertexType; @@ -1240,12 +1244,12 @@ extern "C" { #[cfg(feature = "grin_trait_natural_id_for_edge_type")] #[allow(unused)] - pub fn grin_get_edge_type_from_id(arg1: GrinGraph, arg2: GrinEdgeTypeId) -> GrinEdgeType; + pub fn grin_get_edge_type_by_id(arg1: GrinGraph, arg2: GrinEdgeTypeId) -> GrinEdgeType; #[doc = " @brief the src vertex type list"] #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] #[allow(unused)] - pub fn grin_get_src_types_from_edge_type( + pub fn grin_get_src_types_by_edge_type( arg1: GrinGraph, arg2: GrinEdgeType, ) -> GrinVertexTypeList; @@ -1253,7 +1257,7 @@ extern "C" { #[doc = " @brief get the dst vertex type list"] #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] #[allow(unused)] - pub fn grin_get_dst_types_from_edge_type( + pub fn grin_get_dst_types_by_edge_type( arg1: GrinGraph, arg2: GrinEdgeType, ) -> GrinVertexTypeList; @@ -1261,7 +1265,7 @@ extern "C" { #[doc = " @brief get the edge type list related to a given pair of vertex types"] #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_with_edge_property"))] #[allow(unused)] - pub fn grin_get_edge_types_from_vertex_type_pair( + pub fn grin_get_edge_types_by_vertex_type_pair( arg1: GrinGraph, arg2: GrinVertexType, arg3: GrinVertexType, @@ -1286,7 +1290,7 @@ extern "C" { } - pub const GRIN_NULL_DATATYPE: GrinDataType = GRIN_DATATYPE_UNDEFINED; + pub const GRIN_NULL_DATATYPE: GrinDatatype = GRIN_DATATYPE_UNDEFINED; pub const GRIN_NULL_GRAPH: GrinGraph = std::ptr::null_mut(); @@ -1294,9 +1298,9 @@ extern "C" { pub const GRIN_NULL_EDGE: GrinEdge = std::ptr::null_mut(); - pub const GRIN_NULL_LIST: *const ::std::os::raw::c_void = std::ptr::null_mut(); + pub const GRIN_NULL_LIST: *mut ::std::os::raw::c_void = std::ptr::null_mut(); - pub const GRIN_NULL_LIST_ITERATOR: *const ::std::os::raw::c_void = std::ptr::null_mut(); + pub const GRIN_NULL_LIST_ITERATOR: *mut ::std::os::raw::c_void = std::ptr::null_mut(); pub const GRIN_NULL_PARTITION: GrinPartition = u32::MAX; diff --git a/modules/graph/grin/rust/parse.py b/modules/graph/grin/rust/parse.py index c452603fa..448bcaf44 100644 --- a/modules/graph/grin/rust/parse.py +++ b/modules/graph/grin/rust/parse.py @@ -84,7 +84,7 @@ def to_rust(deps): assert False, f'unknown: {deps}' def snake_to_camel(s): - if s.startswith(('GRIN_DATATYPE_', 'GRIN_DIRECTION_')): + if s.startswith(('GRIN_DATATYPE_', 'GRIN_DIRECTION_', 'GRIN_ERROR_CODE_')): return s.upper() return ''.join([w.capitalize() for w in s.split('_')]) diff --git a/modules/graph/grin/rust/v6d_all.h b/modules/graph/grin/rust/v6d_all.h index d03df31c4..5ba492fd1 100644 --- a/modules/graph/grin/rust/v6d_all.h +++ b/modules/graph/grin/rust/v6d_all.h @@ -17,12 +17,12 @@ #include "../include/common/error.h" -/// RUST_KEEP pub const GRIN_NULL_DATATYPE: GrinDataType = GRIN_DATATYPE_UNDEFINED; +/// RUST_KEEP pub const GRIN_NULL_DATATYPE: GrinDatatype = GRIN_DATATYPE_UNDEFINED; /// RUST_KEEP pub const GRIN_NULL_GRAPH: GrinGraph = std::ptr::null_mut(); /// RUST_KEEP pub const GRIN_NULL_VERTEX: GrinVertex = std::ptr::null_mut(); /// RUST_KEEP pub const GRIN_NULL_EDGE: GrinEdge = std::ptr::null_mut(); -/// RUST_KEEP pub const GRIN_NULL_LIST: *const ::std::os::raw::c_void = std::ptr::null_mut(); -/// RUST_KEEP pub const GRIN_NULL_LIST_ITERATOR: *const ::std::os::raw::c_void = std::ptr::null_mut(); +/// RUST_KEEP pub const GRIN_NULL_LIST: *mut ::std::os::raw::c_void = std::ptr::null_mut(); +/// RUST_KEEP pub const GRIN_NULL_LIST_ITERATOR: *mut ::std::os::raw::c_void = std::ptr::null_mut(); /// RUST_KEEP pub const GRIN_NULL_PARTITION: GrinPartition = u32::MAX; /// RUST_KEEP pub const GRIN_NULL_VERTEX_REF: GrinVertexRef = -1; /// RUST_KEEP pub const GRIN_NULL_VERTEX_TYPE: GrinVertexType = u32::MAX; diff --git a/modules/graph/grin/src/common/error.cc b/modules/graph/grin/src/common/error.cc index 79fe6d021..ef806a179 100644 --- a/modules/graph/grin/src/common/error.cc +++ b/modules/graph/grin/src/common/error.cc @@ -21,7 +21,7 @@ extern "C" { #include "graph/grin/include/common/error.h" } -__thread GRIN_ERROR_CODE grin_error_code = GRIN_NO_ERROR; +__thread GRIN_ERROR_CODE grin_error_code = GRIN_ERROR_CODE::NO_ERROR; GRIN_ERROR_CODE grin_get_last_error_code() { return grin_error_code; diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index 9df24cbef..f17fc7a87 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -99,7 +99,7 @@ const void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) return NULL; } -GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { +GRIN_GRAPH grin_get_local_graph_by_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { auto _pg = static_cast(pg); auto g = new GRIN_GRAPH_T(); g->g = _pg->lgs[p]; @@ -108,7 +108,7 @@ GRIN_GRAPH grin_get_local_graph_from_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_P #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_PARTITION -GRIN_PARTITION grin_get_partition_from_id(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_ID pid) { +GRIN_PARTITION grin_get_partition_by_id(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION_ID pid) { return pid; } diff --git a/modules/graph/grin/src/partition/reference.cc b/modules/graph/grin/src/partition/reference.cc index 44b848472..f3060e15f 100644 --- a/modules/graph/grin/src/partition/reference.cc +++ b/modules/graph/grin/src/partition/reference.cc @@ -19,7 +19,7 @@ extern "C" { } #ifdef GRIN_ENABLE_VERTEX_REF -GRIN_VERTEX_REF grin_get_vertex_ref_for_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { +GRIN_VERTEX_REF grin_get_vertex_ref_by_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; auto _v = static_cast(v); return _g->Vertex2Gid(*_v); @@ -57,7 +57,7 @@ long long int grin_serialize_vertex_ref_as_int64(GRIN_GRAPH g, GRIN_VERTEX_REF v return vr; } -GRIN_VERTEX_REF grin_deserialize_vertex_ref_from_int64(GRIN_GRAPH g, long long int svr) { +GRIN_VERTEX_REF grin_deserialize_int64_to_vertex_ref(GRIN_GRAPH g, long long int svr) { return svr; } #endif @@ -95,7 +95,7 @@ GRIN_PARTITION_LIST grin_get_mirror_vertex_mirror_partition_list(GRIN_GRAPH, GRI #endif #ifdef GRIN_ENABLE_EDGE_REF -GRIN_EDGE_REF grin_get_edge_ref_for_edge(GRIN_GRAPH, GRIN_EDGE); +GRIN_EDGE_REF grin_get_edge_ref_by_edge(GRIN_GRAPH, GRIN_EDGE); void grin_destroy_edge_ref(GRIN_GRAPH, GRIN_EDGE_REF); diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc index d00221c4f..36c70008d 100644 --- a/modules/graph/grin/src/partition/topology.cc +++ b/modules/graph/grin/src/partition/topology.cc @@ -84,5 +84,5 @@ GRIN_ADJACENT_LIST grin_select_mirror_neighbor_for_adjacent_list(GRIN_GRAPH, GRI #endif #ifdef GRIN_TRAIT_SELECT_NEIGHBOR_PARTITION_FOR_ADJACENT_LIST -GRIN_ADJACENT_LIST grin_select_neighbor_partition_for_adjacent_list(GRIN_GRAPH, GRIN_ADJACENT_LIST); +GRIN_ADJACENT_LIST grin_select_neighbor_partition_for_adjacent_list(GRIN_GRAPH, GRIN_PARTITION, GRIN_ADJACENT_LIST); #endif diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index a6601322f..e0ef351bf 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -16,7 +16,7 @@ extern "C" { } #ifdef GRIN_WITH_VERTEX_PROPERTY_NAME -const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { +const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY vp) { auto _g = static_cast(g)->g; auto s = _g->schema().GetVertexPropertyName(_grin_get_type_from_property(vp), _grin_get_prop_from_property(vp)); int len = s.length() + 1; @@ -53,7 +53,7 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const #endif #ifdef GRIN_WITH_EDGE_PROPERTY_NAME -const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { +const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto s = _g->schema().GetEdgePropertyName(_grin_get_type_from_property(ep), _grin_get_prop_from_property(ep)); int len = s.length() + 1; @@ -103,7 +103,7 @@ GRIN_DATATYPE grin_get_vertex_property_data_type(GRIN_GRAPH g, GRIN_VERTEX_PROPE return ArrowToDataType(dt); } -GRIN_VERTEX_TYPE grin_get_vertex_property_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { +GRIN_VERTEX_TYPE grin_get_vertex_type_from_property(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { return _grin_get_type_from_property(vp); } #endif @@ -122,7 +122,7 @@ GRIN_DATATYPE grin_get_edge_property_data_type(GRIN_GRAPH g, GRIN_EDGE_PROPERTY return ArrowToDataType(dt); } -GRIN_EDGE_TYPE grin_get_edge_property_edge_type(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { +GRIN_EDGE_TYPE grin_get_edge_type_from_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { return _grin_get_type_from_property(ep); } #endif diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index a4cf2a8f0..eaa6f6c8c 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -54,7 +54,7 @@ bool grin_insert_vertex_property_to_list(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY -GRIN_VERTEX_PROPERTY grin_get_vertex_property_from_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY_ID vpi) { +GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY_ID vpi) { auto _g = static_cast(g)->g; if (vpi >= _g->vertex_property_num(vtype)) return GRIN_NULL_VERTEX_PROPERTY; return _grin_create_property(vtype, vpi); @@ -106,7 +106,7 @@ bool grin_insert_edge_property_to_list(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY -GRIN_EDGE_PROPERTY grin_get_edge_property_from_id(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY_ID epi) { +GRIN_EDGE_PROPERTY grin_get_edge_property_by_id(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY_ID epi) { auto _g = static_cast(g)->g; if (epi >= _g->edge_property_num(etype) - 1) return GRIN_NULL_EDGE_PROPERTY; return _grin_create_property(etype, epi + 1); diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index 5361e0a43..db6bd0482 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -232,14 +232,14 @@ GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return NULL; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -275,20 +275,20 @@ const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_ case GRIN_DATATYPE::Timestamp64: return new int64_t(*static_cast(result)); default: - grin_error_code = GRIN_UNKNOWN_DATATYPE; + grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; return NULL; } } int grin_get_int32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -298,14 +298,14 @@ int grin_get_int32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY } unsigned int grin_get_uint32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -315,14 +315,14 @@ unsigned int grin_get_uint32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTE } long long int grin_get_int64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -332,14 +332,14 @@ long long int grin_get_int64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTE } unsigned long long int grin_get_uint64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -349,14 +349,14 @@ unsigned long long int grin_get_uint64_from_vertex_property_table(GRIN_GRAPH g, } float grin_get_float_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -366,14 +366,14 @@ float grin_get_float_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPER } double grin_get_double_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -383,14 +383,14 @@ double grin_get_double_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROP } const char* grin_get_string_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return NULL; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -404,14 +404,14 @@ const char* grin_get_string_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX } int grin_get_date32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -421,14 +421,14 @@ int grin_get_date32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERT } int grin_get_time32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -438,14 +438,14 @@ int grin_get_time32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERT } long long int grin_get_timestamp64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _v->GetValue() - _vpt->vertices.begin_value(); @@ -503,14 +503,14 @@ GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH g, GRIN const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return NULL; } auto offset = _e->eid; @@ -546,20 +546,20 @@ const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROP case GRIN_DATATYPE::Timestamp64: return new int64_t(*static_cast(result)); default: - grin_error_code = GRIN_UNKNOWN_DATATYPE; + grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; return NULL; } } int grin_get_int32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _e->eid; @@ -569,14 +569,14 @@ int grin_get_int32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TAB } unsigned int grin_get_uint32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _e->eid; @@ -586,14 +586,14 @@ unsigned int grin_get_uint32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PR } long long int grin_get_int64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _e->eid; @@ -603,14 +603,14 @@ long long int grin_get_int64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PR } unsigned long long int grin_get_uint64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _e->eid; @@ -620,14 +620,14 @@ unsigned long long int grin_get_uint64_from_edge_property_table(GRIN_GRAPH g, GR } float grin_get_float_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _e->eid; @@ -637,14 +637,14 @@ float grin_get_float_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_T } double grin_get_double_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _e->eid; @@ -654,14 +654,14 @@ double grin_get_double_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY } const char* grin_get_string_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return NULL; } auto offset = _e->eid; @@ -675,14 +675,14 @@ const char* grin_get_string_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PRO } int grin_get_date32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _e->eid; @@ -692,14 +692,14 @@ int grin_get_date32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TA } int grin_get_time32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _e->eid; @@ -709,14 +709,14 @@ int grin_get_time32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TA } long long int grin_get_timestamp64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_NO_ERROR; + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _ept = static_cast(ept); auto _e = static_cast(e); unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_INVALID_VALUE; + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return 0; } auto offset = _e->eid; diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index ca9d055a1..1a082ee3d 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -46,7 +46,7 @@ size_t grin_get_total_edge_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_EDGE_TYPE #ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID -GRIN_VERTEX grin_get_vertex_from_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_ORIGINAL_ID oid) { +GRIN_VERTEX grin_get_vertex_by_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_ORIGINAL_ID oid) { auto _g = static_cast(g)->g; auto _oid = static_cast(oid); _GRIN_GRAPH_T::vid_t gid; diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 9a7139f77..f67a55e6c 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -88,7 +88,7 @@ GRIN_VERTEX_TYPE_ID grin_get_vertex_type_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype return vtype; } -GRIN_VERTEX_TYPE grin_get_vertex_type_from_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE_ID vti) { +GRIN_VERTEX_TYPE grin_get_vertex_type_by_id(GRIN_GRAPH g, GRIN_VERTEX_TYPE_ID vti) { return vti; } #endif @@ -167,14 +167,14 @@ GRIN_EDGE_TYPE_ID grin_get_edge_type_id(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { return etype; } -GRIN_EDGE_TYPE grin_get_edge_type_from_id(GRIN_GRAPH g, GRIN_EDGE_TYPE_ID eti) { +GRIN_EDGE_TYPE grin_get_edge_type_by_id(GRIN_GRAPH g, GRIN_EDGE_TYPE_ID eti) { return eti; } #endif #if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_WITH_EDGE_PROPERTY) -GRIN_VERTEX_TYPE_LIST grin_get_src_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { +GRIN_VERTEX_TYPE_LIST grin_get_src_types_by_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g)->g; auto entry = _g->schema().GetEntry(etype, "EDGE"); auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); @@ -184,7 +184,7 @@ GRIN_VERTEX_TYPE_LIST grin_get_src_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_ return vtl; } -GRIN_VERTEX_TYPE_LIST grin_get_dst_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { +GRIN_VERTEX_TYPE_LIST grin_get_dst_types_by_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g)->g; auto entry = _g->schema().GetEntry(etype, "EDGE"); auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); @@ -194,7 +194,7 @@ GRIN_VERTEX_TYPE_LIST grin_get_dst_types_from_edge_type(GRIN_GRAPH g, GRIN_EDGE_ return vtl; } -GRIN_EDGE_TYPE_LIST grin_get_edge_types_from_vertex_type_pair(GRIN_GRAPH g, GRIN_VERTEX_TYPE src_vt, +GRIN_EDGE_TYPE_LIST grin_get_edge_types_by_vertex_type_pair(GRIN_GRAPH g, GRIN_VERTEX_TYPE src_vt, GRIN_VERTEX_TYPE dst_vt) { auto _g = static_cast(g)->g; auto str_v1 = _g->schema().GetVertexLabelName(src_vt); diff --git a/modules/graph/grin/src/proto/gie_schema.pb.cc b/modules/graph/grin/src/proto/gie_schema.pb.cc deleted file mode 100644 index 5797270af..000000000 --- a/modules/graph/grin/src/proto/gie_schema.pb.cc +++ /dev/null @@ -1,3480 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: gie_schema.proto - -#include "gie_schema.pb.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) -#include -extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_EdgeType_gie_5fschema_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_GraphPartitionStrategy_gie_5fschema_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Property_gie_5fschema_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SrcDstPair_gie_5fschema_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Statistics_gie_5fschema_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_VertexType_gie_5fschema_2eproto; -namespace gie { -class PropertyPartitionByEntityStrategyDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _PropertyPartitionByEntityStrategy_default_instance_; -class PropertyPartitionByTypeStrategyDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _PropertyPartitionByTypeStrategy_default_instance_; -class GraphPropertyPartitionStrategyDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; - const ::gie::PropertyPartitionByEntityStrategy* by_entity_; - const ::gie::PropertyPartitionByTypeStrategy* by_type_; -} _GraphPropertyPartitionStrategy_default_instance_; -class GraphPartitionStrategyDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _GraphPartitionStrategy_default_instance_; -class SrcDstPairDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _SrcDstPair_default_instance_; -class PropertyDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Property_default_instance_; -class VertexTypeDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _VertexType_default_instance_; -class EdgeTypeDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _EdgeType_default_instance_; -class StatisticsDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Statistics_default_instance_; -class SchemaDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Schema_default_instance_; -} // namespace gie -static void InitDefaultsscc_info_EdgeType_gie_5fschema_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::gie::_EdgeType_default_instance_; - new (ptr) ::gie::EdgeType(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::gie::EdgeType::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_EdgeType_gie_5fschema_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_EdgeType_gie_5fschema_2eproto}, { - &scc_info_Property_gie_5fschema_2eproto.base, - &scc_info_SrcDstPair_gie_5fschema_2eproto.base,}}; - -static void InitDefaultsscc_info_GraphPartitionStrategy_gie_5fschema_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::gie::_GraphPartitionStrategy_default_instance_; - new (ptr) ::gie::GraphPartitionStrategy(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::gie::GraphPartitionStrategy::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_GraphPartitionStrategy_gie_5fschema_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_GraphPartitionStrategy_gie_5fschema_2eproto}, { - &scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto.base,}}; - -static void InitDefaultsscc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::gie::_GraphPropertyPartitionStrategy_default_instance_; - new (ptr) ::gie::GraphPropertyPartitionStrategy(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::gie::GraphPropertyPartitionStrategy::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto}, { - &scc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto.base, - &scc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto.base,}}; - -static void InitDefaultsscc_info_Property_gie_5fschema_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::gie::_Property_default_instance_; - new (ptr) ::gie::Property(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::gie::Property::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Property_gie_5fschema_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Property_gie_5fschema_2eproto}, {}}; - -static void InitDefaultsscc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::gie::_PropertyPartitionByEntityStrategy_default_instance_; - new (ptr) ::gie::PropertyPartitionByEntityStrategy(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::gie::PropertyPartitionByEntityStrategy::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto}, {}}; - -static void InitDefaultsscc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::gie::_PropertyPartitionByTypeStrategy_default_instance_; - new (ptr) ::gie::PropertyPartitionByTypeStrategy(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::gie::PropertyPartitionByTypeStrategy::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto}, {}}; - -static void InitDefaultsscc_info_Schema_gie_5fschema_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::gie::_Schema_default_instance_; - new (ptr) ::gie::Schema(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::gie::Schema::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<4> scc_info_Schema_gie_5fschema_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 4, 0, InitDefaultsscc_info_Schema_gie_5fschema_2eproto}, { - &scc_info_GraphPartitionStrategy_gie_5fschema_2eproto.base, - &scc_info_VertexType_gie_5fschema_2eproto.base, - &scc_info_EdgeType_gie_5fschema_2eproto.base, - &scc_info_Statistics_gie_5fschema_2eproto.base,}}; - -static void InitDefaultsscc_info_SrcDstPair_gie_5fschema_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::gie::_SrcDstPair_default_instance_; - new (ptr) ::gie::SrcDstPair(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::gie::SrcDstPair::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SrcDstPair_gie_5fschema_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_SrcDstPair_gie_5fschema_2eproto}, {}}; - -static void InitDefaultsscc_info_Statistics_gie_5fschema_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::gie::_Statistics_default_instance_; - new (ptr) ::gie::Statistics(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::gie::Statistics::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Statistics_gie_5fschema_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Statistics_gie_5fschema_2eproto}, {}}; - -static void InitDefaultsscc_info_VertexType_gie_5fschema_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::gie::_VertexType_default_instance_; - new (ptr) ::gie::VertexType(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::gie::VertexType::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_VertexType_gie_5fschema_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_VertexType_gie_5fschema_2eproto}, { - &scc_info_Property_gie_5fschema_2eproto.base,}}; - -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_gie_5fschema_2eproto[10]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_gie_5fschema_2eproto[6]; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_gie_5fschema_2eproto = nullptr; - -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_gie_5fschema_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, vertex_property_partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByEntityStrategy, edge_property_partition_strategy_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::gie::PropertyPartitionByTypeStrategy, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, _internal_metadata_), - ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, _oneof_case_[0]), - ~0u, // no _weak_field_map_ - offsetof(::gie::GraphPropertyPartitionStrategyDefaultTypeInternal, by_entity_), - offsetof(::gie::GraphPropertyPartitionStrategyDefaultTypeInternal, by_type_), - PROTOBUF_FIELD_OFFSET(::gie::GraphPropertyPartitionStrategy, item_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, topology_), - PROTOBUF_FIELD_OFFSET(::gie::GraphPartitionStrategy, property_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, src_type_), - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, dst_type_), - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, property_partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::SrcDstPair, relation_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::gie::Property, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::gie::Property, id_), - PROTOBUF_FIELD_OFFSET(::gie::Property, name_), - PROTOBUF_FIELD_OFFSET(::gie::Property, type_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::gie::VertexType, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::gie::VertexType, id_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, name_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, properties_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, primary_keys_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, property_partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::VertexType, total_num_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, id_), - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, name_), - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, properties_), - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, primary_keys_), - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, src_dst_pairs_), - PROTOBUF_FIELD_OFFSET(::gie::EdgeType, total_num_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::gie::Statistics, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::gie::Statistics, num_partitions_), - PROTOBUF_FIELD_OFFSET(::gie::Statistics, num_vertices_), - PROTOBUF_FIELD_OFFSET(::gie::Statistics, num_edges_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::gie::Schema, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::gie::Schema, partition_strategy_), - PROTOBUF_FIELD_OFFSET(::gie::Schema, vertex_types_), - PROTOBUF_FIELD_OFFSET(::gie::Schema, edge_types_), - PROTOBUF_FIELD_OFFSET(::gie::Schema, statistics_), -}; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(::gie::PropertyPartitionByEntityStrategy)}, - { 7, -1, sizeof(::gie::PropertyPartitionByTypeStrategy)}, - { 12, -1, sizeof(::gie::GraphPropertyPartitionStrategy)}, - { 20, -1, sizeof(::gie::GraphPartitionStrategy)}, - { 27, -1, sizeof(::gie::SrcDstPair)}, - { 37, -1, sizeof(::gie::Property)}, - { 45, -1, sizeof(::gie::VertexType)}, - { 57, -1, sizeof(::gie::EdgeType)}, - { 68, -1, sizeof(::gie::Statistics)}, - { 76, -1, sizeof(::gie::Schema)}, -}; - -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::gie::_PropertyPartitionByEntityStrategy_default_instance_), - reinterpret_cast(&::gie::_PropertyPartitionByTypeStrategy_default_instance_), - reinterpret_cast(&::gie::_GraphPropertyPartitionStrategy_default_instance_), - reinterpret_cast(&::gie::_GraphPartitionStrategy_default_instance_), - reinterpret_cast(&::gie::_SrcDstPair_default_instance_), - reinterpret_cast(&::gie::_Property_default_instance_), - reinterpret_cast(&::gie::_VertexType_default_instance_), - reinterpret_cast(&::gie::_EdgeType_default_instance_), - reinterpret_cast(&::gie::_Statistics_default_instance_), - reinterpret_cast(&::gie::_Schema_default_instance_), -}; - -const char descriptor_table_protodef_gie_5fschema_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\020gie_schema.proto\022\003gie\"\271\001\n!PropertyPart" - "itionByEntityStrategy\022J\n\"vertex_property" - "_partition_strategy\030\001 \001(\0162\036.gie.Property" - "PartitionStrategy\022H\n edge_property_parti" - "tion_strategy\030\002 \001(\0162\036.gie.PropertyPartit" - "ionStrategy\"!\n\037PropertyPartitionByTypeSt" - "rategy\"\236\001\n\036GraphPropertyPartitionStrateg" - "y\022;\n\tby_entity\030\001 \001(\0132&.gie.PropertyParti" - "tionByEntityStrategyH\000\0227\n\007by_type\030\002 \001(\0132" - "$.gie.PropertyPartitionByTypeStrategyH\000B" - "\006\n\004item\"\206\001\n\026GraphPartitionStrategy\0225\n\010to" - "pology\030\001 \001(\0162#.gie.GraphTopologyPartitio" - "nStrategy\0225\n\010property\030\002 \001(\0132#.gie.GraphP" - "ropertyPartitionStrategy\"\316\001\n\nSrcDstPair\022" - "\020\n\010src_type\030\001 \001(\t\022\020\n\010dst_type\030\002 \001(\t\0226\n\022p" - "artition_strategy\030\003 \001(\0162\032.gie.EdgePartit" - "ionStrategy\022C\n\033property_partition_strate" - "gy\030\004 \001(\0162\036.gie.PropertyPartitionStrategy" - "\022\037\n\010relation\030\005 \001(\0162\r.gie.Relation\"A\n\010Pro" - "perty\022\n\n\002id\030\001 \001(\r\022\014\n\004name\030\002 \001(\t\022\033\n\004type\030" - "\003 \001(\0162\r.gie.DataType\"\361\001\n\nVertexType\022\n\n\002i" - "d\030\001 \001(\r\022\014\n\004name\030\002 \001(\t\022!\n\nproperties\030\003 \003(" - "\0132\r.gie.Property\022\024\n\014primary_keys\030\004 \003(\t\0228" - "\n\022partition_strategy\030\005 \001(\0162\034.gie.VertexP" - "artitionStrategy\022C\n\033property_partition_s" - "trategy\030\006 \001(\0162\036.gie.PropertyPartitionStr" - "ategy\022\021\n\ttotal_num\030\007 \001(\003\"\230\001\n\010EdgeType\022\n\n" - "\002id\030\001 \001(\r\022\014\n\004name\030\002 \001(\t\022!\n\nproperties\030\003 " - "\003(\0132\r.gie.Property\022\024\n\014primary_keys\030\004 \003(\t" - "\022&\n\rsrc_dst_pairs\030\005 \003(\0132\017.gie.SrcDstPair" - "\022\021\n\ttotal_num\030\006 \001(\003\"M\n\nStatistics\022\026\n\016num" - "_partitions\030\001 \001(\r\022\024\n\014num_vertices\030\002 \001(\004\022" - "\021\n\tnum_edges\030\003 \001(\004\"\260\001\n\006Schema\0227\n\022partiti" - "on_strategy\030\001 \001(\0132\033.gie.GraphPartitionSt" - "rategy\022%\n\014vertex_types\030\002 \003(\0132\017.gie.Verte" - "xType\022!\n\nedge_types\030\003 \003(\0132\r.gie.EdgeType" - "\022#\n\nstatistics\030\004 \001(\0132\017.gie.Statistics*[\n" - "\027VertexPartitionStrategy\022\021\n\rVPS_UNDEFINE" - "D\020\000\022\013\n\007VPS_ALL\020\001\022\013\n\007VPS_ONE\020\002\022\023\n\017VPS_FOL" - "LOW_EDGE\020\003*\201\001\n\025EdgePartitionStrategy\022\021\n\r" - "EPS_UNDEFINED\020\000\022\013\n\007EPS_ALL\020\001\022\013\n\007EPS_ONE\020" - "\002\022\022\n\016EPS_FOLLOW_SRC\020\003\022\022\n\016EPS_FOLLOW_DST\020" - "\004\022\023\n\017EPS_FOLLOW_BOTH\020\005*U\n\031PropertyPartit" - "ionStrategy\022\021\n\rPPS_UNDEFINED\020\000\022\016\n\nPPS_MA" - "STER\020\001\022\025\n\021PPS_MASTER_MIRROR\020\002*\306\001\n\036GraphT" - "opologyPartitionStrategy\022\021\n\rGPS_UNDEFINE" - "D\020\000\022\025\n\021GPS_ALL_REPLICATE\020\001\022\034\n\030GPS_EDGE_C" - "UT_FOLLOW_BOTH\020\002\022\033\n\027GPS_EDGE_CUT_FOLLOW_" - "SRC\020\003\022\033\n\027GPS_EDGE_CUT_FOLLOW_DST\020\004\022\022\n\016GP" - "S_VERTEX_CUT\020\005\022\016\n\nGPS_HYBRID\020\006*a\n\010Relati" - "on\022\021\n\rREL_UNDEFINED\020\000\022\020\n\014MANY_TO_MANY\020\001\022" - "\017\n\013MANY_TO_ONE\020\002\022\017\n\013ONE_TO_MANY\020\003\022\016\n\nONE" - "_TO_ONE\020\004*\312\001\n\010DataType\022\016\n\nDT_UNKNOWN\020\000\022\023" - "\n\017DT_SIGNED_INT32\020\001\022\025\n\021DT_UNSIGNED_INT32" - "\020\002\022\023\n\017DT_SIGNED_INT64\020\003\022\025\n\021DT_UNSIGNED_I" - "NT64\020\004\022\014\n\010DT_FLOAT\020\005\022\r\n\tDT_DOUBLE\020\006\022\r\n\tD" - "T_STRING\020\007\022\013\n\007DT_DATE\020\010\022\013\n\007DT_TIME\020\t\022\020\n\014" - "DT_TIMESTAMP\020\nB%\n#com.alibaba.graphscope" - ".proto.schemab\006proto3" - ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_gie_5fschema_2eproto_deps[1] = { -}; -static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_gie_5fschema_2eproto_sccs[10] = { - &scc_info_EdgeType_gie_5fschema_2eproto.base, - &scc_info_GraphPartitionStrategy_gie_5fschema_2eproto.base, - &scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto.base, - &scc_info_Property_gie_5fschema_2eproto.base, - &scc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto.base, - &scc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto.base, - &scc_info_Schema_gie_5fschema_2eproto.base, - &scc_info_SrcDstPair_gie_5fschema_2eproto.base, - &scc_info_Statistics_gie_5fschema_2eproto.base, - &scc_info_VertexType_gie_5fschema_2eproto.base, -}; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_gie_5fschema_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_gie_5fschema_2eproto = { - false, false, descriptor_table_protodef_gie_5fschema_2eproto, "gie_schema.proto", 2341, - &descriptor_table_gie_5fschema_2eproto_once, descriptor_table_gie_5fschema_2eproto_sccs, descriptor_table_gie_5fschema_2eproto_deps, 10, 0, - schemas, file_default_instances, TableStruct_gie_5fschema_2eproto::offsets, - file_level_metadata_gie_5fschema_2eproto, 10, file_level_enum_descriptors_gie_5fschema_2eproto, file_level_service_descriptors_gie_5fschema_2eproto, -}; - -// Force running AddDescriptors() at dynamic initialization time. -static bool dynamic_init_dummy_gie_5fschema_2eproto = (static_cast(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_gie_5fschema_2eproto)), true); -namespace gie { -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* VertexPartitionStrategy_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); - return file_level_enum_descriptors_gie_5fschema_2eproto[0]; -} -bool VertexPartitionStrategy_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdgePartitionStrategy_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); - return file_level_enum_descriptors_gie_5fschema_2eproto[1]; -} -bool EdgePartitionStrategy_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PropertyPartitionStrategy_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); - return file_level_enum_descriptors_gie_5fschema_2eproto[2]; -} -bool PropertyPartitionStrategy_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GraphTopologyPartitionStrategy_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); - return file_level_enum_descriptors_gie_5fschema_2eproto[3]; -} -bool GraphTopologyPartitionStrategy_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Relation_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); - return file_level_enum_descriptors_gie_5fschema_2eproto[4]; -} -bool Relation_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataType_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_gie_5fschema_2eproto); - return file_level_enum_descriptors_gie_5fschema_2eproto[5]; -} -bool DataType_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - return true; - default: - return false; - } -} - - -// =================================================================== - -void PropertyPartitionByEntityStrategy::InitAsDefaultInstance() { -} -class PropertyPartitionByEntityStrategy::_Internal { - public: -}; - -PropertyPartitionByEntityStrategy::PropertyPartitionByEntityStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:gie.PropertyPartitionByEntityStrategy) -} -PropertyPartitionByEntityStrategy::PropertyPartitionByEntityStrategy(const PropertyPartitionByEntityStrategy& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&vertex_property_partition_strategy_, &from.vertex_property_partition_strategy_, - static_cast(reinterpret_cast(&edge_property_partition_strategy_) - - reinterpret_cast(&vertex_property_partition_strategy_)) + sizeof(edge_property_partition_strategy_)); - // @@protoc_insertion_point(copy_constructor:gie.PropertyPartitionByEntityStrategy) -} - -void PropertyPartitionByEntityStrategy::SharedCtor() { - ::memset(&vertex_property_partition_strategy_, 0, static_cast( - reinterpret_cast(&edge_property_partition_strategy_) - - reinterpret_cast(&vertex_property_partition_strategy_)) + sizeof(edge_property_partition_strategy_)); -} - -PropertyPartitionByEntityStrategy::~PropertyPartitionByEntityStrategy() { - // @@protoc_insertion_point(destructor:gie.PropertyPartitionByEntityStrategy) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void PropertyPartitionByEntityStrategy::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); -} - -void PropertyPartitionByEntityStrategy::ArenaDtor(void* object) { - PropertyPartitionByEntityStrategy* _this = reinterpret_cast< PropertyPartitionByEntityStrategy* >(object); - (void)_this; -} -void PropertyPartitionByEntityStrategy::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void PropertyPartitionByEntityStrategy::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const PropertyPartitionByEntityStrategy& PropertyPartitionByEntityStrategy::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PropertyPartitionByEntityStrategy_gie_5fschema_2eproto.base); - return *internal_default_instance(); -} - - -void PropertyPartitionByEntityStrategy::Clear() { -// @@protoc_insertion_point(message_clear_start:gie.PropertyPartitionByEntityStrategy) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&vertex_property_partition_strategy_, 0, static_cast( - reinterpret_cast(&edge_property_partition_strategy_) - - reinterpret_cast(&vertex_property_partition_strategy_)) + sizeof(edge_property_partition_strategy_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* PropertyPartitionByEntityStrategy::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_vertex_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_edge_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* PropertyPartitionByEntityStrategy::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:gie.PropertyPartitionByEntityStrategy) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; - if (this->vertex_property_partition_strategy() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 1, this->_internal_vertex_property_partition_strategy(), target); - } - - // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; - if (this->edge_property_partition_strategy() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 2, this->_internal_edge_property_partition_strategy(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:gie.PropertyPartitionByEntityStrategy) - return target; -} - -size_t PropertyPartitionByEntityStrategy::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:gie.PropertyPartitionByEntityStrategy) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; - if (this->vertex_property_partition_strategy() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_vertex_property_partition_strategy()); - } - - // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; - if (this->edge_property_partition_strategy() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_edge_property_partition_strategy()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void PropertyPartitionByEntityStrategy::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:gie.PropertyPartitionByEntityStrategy) - GOOGLE_DCHECK_NE(&from, this); - const PropertyPartitionByEntityStrategy* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.PropertyPartitionByEntityStrategy) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.PropertyPartitionByEntityStrategy) - MergeFrom(*source); - } -} - -void PropertyPartitionByEntityStrategy::MergeFrom(const PropertyPartitionByEntityStrategy& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:gie.PropertyPartitionByEntityStrategy) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.vertex_property_partition_strategy() != 0) { - _internal_set_vertex_property_partition_strategy(from._internal_vertex_property_partition_strategy()); - } - if (from.edge_property_partition_strategy() != 0) { - _internal_set_edge_property_partition_strategy(from._internal_edge_property_partition_strategy()); - } -} - -void PropertyPartitionByEntityStrategy::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:gie.PropertyPartitionByEntityStrategy) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void PropertyPartitionByEntityStrategy::CopyFrom(const PropertyPartitionByEntityStrategy& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:gie.PropertyPartitionByEntityStrategy) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool PropertyPartitionByEntityStrategy::IsInitialized() const { - return true; -} - -void PropertyPartitionByEntityStrategy::InternalSwap(PropertyPartitionByEntityStrategy* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(PropertyPartitionByEntityStrategy, edge_property_partition_strategy_) - + sizeof(PropertyPartitionByEntityStrategy::edge_property_partition_strategy_) - - PROTOBUF_FIELD_OFFSET(PropertyPartitionByEntityStrategy, vertex_property_partition_strategy_)>( - reinterpret_cast(&vertex_property_partition_strategy_), - reinterpret_cast(&other->vertex_property_partition_strategy_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata PropertyPartitionByEntityStrategy::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void PropertyPartitionByTypeStrategy::InitAsDefaultInstance() { -} -class PropertyPartitionByTypeStrategy::_Internal { - public: -}; - -PropertyPartitionByTypeStrategy::PropertyPartitionByTypeStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:gie.PropertyPartitionByTypeStrategy) -} -PropertyPartitionByTypeStrategy::PropertyPartitionByTypeStrategy(const PropertyPartitionByTypeStrategy& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:gie.PropertyPartitionByTypeStrategy) -} - -void PropertyPartitionByTypeStrategy::SharedCtor() { -} - -PropertyPartitionByTypeStrategy::~PropertyPartitionByTypeStrategy() { - // @@protoc_insertion_point(destructor:gie.PropertyPartitionByTypeStrategy) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void PropertyPartitionByTypeStrategy::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); -} - -void PropertyPartitionByTypeStrategy::ArenaDtor(void* object) { - PropertyPartitionByTypeStrategy* _this = reinterpret_cast< PropertyPartitionByTypeStrategy* >(object); - (void)_this; -} -void PropertyPartitionByTypeStrategy::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void PropertyPartitionByTypeStrategy::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const PropertyPartitionByTypeStrategy& PropertyPartitionByTypeStrategy::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PropertyPartitionByTypeStrategy_gie_5fschema_2eproto.base); - return *internal_default_instance(); -} - - -void PropertyPartitionByTypeStrategy::Clear() { -// @@protoc_insertion_point(message_clear_start:gie.PropertyPartitionByTypeStrategy) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* PropertyPartitionByTypeStrategy::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* PropertyPartitionByTypeStrategy::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:gie.PropertyPartitionByTypeStrategy) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:gie.PropertyPartitionByTypeStrategy) - return target; -} - -size_t PropertyPartitionByTypeStrategy::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:gie.PropertyPartitionByTypeStrategy) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void PropertyPartitionByTypeStrategy::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:gie.PropertyPartitionByTypeStrategy) - GOOGLE_DCHECK_NE(&from, this); - const PropertyPartitionByTypeStrategy* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.PropertyPartitionByTypeStrategy) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.PropertyPartitionByTypeStrategy) - MergeFrom(*source); - } -} - -void PropertyPartitionByTypeStrategy::MergeFrom(const PropertyPartitionByTypeStrategy& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:gie.PropertyPartitionByTypeStrategy) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - -} - -void PropertyPartitionByTypeStrategy::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:gie.PropertyPartitionByTypeStrategy) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void PropertyPartitionByTypeStrategy::CopyFrom(const PropertyPartitionByTypeStrategy& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:gie.PropertyPartitionByTypeStrategy) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool PropertyPartitionByTypeStrategy::IsInitialized() const { - return true; -} - -void PropertyPartitionByTypeStrategy::InternalSwap(PropertyPartitionByTypeStrategy* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata PropertyPartitionByTypeStrategy::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void GraphPropertyPartitionStrategy::InitAsDefaultInstance() { - ::gie::_GraphPropertyPartitionStrategy_default_instance_.by_entity_ = const_cast< ::gie::PropertyPartitionByEntityStrategy*>( - ::gie::PropertyPartitionByEntityStrategy::internal_default_instance()); - ::gie::_GraphPropertyPartitionStrategy_default_instance_.by_type_ = const_cast< ::gie::PropertyPartitionByTypeStrategy*>( - ::gie::PropertyPartitionByTypeStrategy::internal_default_instance()); -} -class GraphPropertyPartitionStrategy::_Internal { - public: - static const ::gie::PropertyPartitionByEntityStrategy& by_entity(const GraphPropertyPartitionStrategy* msg); - static const ::gie::PropertyPartitionByTypeStrategy& by_type(const GraphPropertyPartitionStrategy* msg); -}; - -const ::gie::PropertyPartitionByEntityStrategy& -GraphPropertyPartitionStrategy::_Internal::by_entity(const GraphPropertyPartitionStrategy* msg) { - return *msg->item_.by_entity_; -} -const ::gie::PropertyPartitionByTypeStrategy& -GraphPropertyPartitionStrategy::_Internal::by_type(const GraphPropertyPartitionStrategy* msg) { - return *msg->item_.by_type_; -} -void GraphPropertyPartitionStrategy::set_allocated_by_entity(::gie::PropertyPartitionByEntityStrategy* by_entity) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - clear_item(); - if (by_entity) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(by_entity); - if (message_arena != submessage_arena) { - by_entity = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, by_entity, submessage_arena); - } - set_has_by_entity(); - item_.by_entity_ = by_entity; - } - // @@protoc_insertion_point(field_set_allocated:gie.GraphPropertyPartitionStrategy.by_entity) -} -void GraphPropertyPartitionStrategy::set_allocated_by_type(::gie::PropertyPartitionByTypeStrategy* by_type) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - clear_item(); - if (by_type) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(by_type); - if (message_arena != submessage_arena) { - by_type = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, by_type, submessage_arena); - } - set_has_by_type(); - item_.by_type_ = by_type; - } - // @@protoc_insertion_point(field_set_allocated:gie.GraphPropertyPartitionStrategy.by_type) -} -GraphPropertyPartitionStrategy::GraphPropertyPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:gie.GraphPropertyPartitionStrategy) -} -GraphPropertyPartitionStrategy::GraphPropertyPartitionStrategy(const GraphPropertyPartitionStrategy& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - clear_has_item(); - switch (from.item_case()) { - case kByEntity: { - _internal_mutable_by_entity()->::gie::PropertyPartitionByEntityStrategy::MergeFrom(from._internal_by_entity()); - break; - } - case kByType: { - _internal_mutable_by_type()->::gie::PropertyPartitionByTypeStrategy::MergeFrom(from._internal_by_type()); - break; - } - case ITEM_NOT_SET: { - break; - } - } - // @@protoc_insertion_point(copy_constructor:gie.GraphPropertyPartitionStrategy) -} - -void GraphPropertyPartitionStrategy::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto.base); - clear_has_item(); -} - -GraphPropertyPartitionStrategy::~GraphPropertyPartitionStrategy() { - // @@protoc_insertion_point(destructor:gie.GraphPropertyPartitionStrategy) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void GraphPropertyPartitionStrategy::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - if (has_item()) { - clear_item(); - } -} - -void GraphPropertyPartitionStrategy::ArenaDtor(void* object) { - GraphPropertyPartitionStrategy* _this = reinterpret_cast< GraphPropertyPartitionStrategy* >(object); - (void)_this; -} -void GraphPropertyPartitionStrategy::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void GraphPropertyPartitionStrategy::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const GraphPropertyPartitionStrategy& GraphPropertyPartitionStrategy::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_GraphPropertyPartitionStrategy_gie_5fschema_2eproto.base); - return *internal_default_instance(); -} - - -void GraphPropertyPartitionStrategy::clear_item() { -// @@protoc_insertion_point(one_of_clear_start:gie.GraphPropertyPartitionStrategy) - switch (item_case()) { - case kByEntity: { - if (GetArena() == nullptr) { - delete item_.by_entity_; - } - break; - } - case kByType: { - if (GetArena() == nullptr) { - delete item_.by_type_; - } - break; - } - case ITEM_NOT_SET: { - break; - } - } - _oneof_case_[0] = ITEM_NOT_SET; -} - - -void GraphPropertyPartitionStrategy::Clear() { -// @@protoc_insertion_point(message_clear_start:gie.GraphPropertyPartitionStrategy) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - clear_item(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* GraphPropertyPartitionStrategy::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .gie.PropertyPartitionByEntityStrategy by_entity = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_by_entity(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .gie.PropertyPartitionByTypeStrategy by_type = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_by_type(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* GraphPropertyPartitionStrategy::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:gie.GraphPropertyPartitionStrategy) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .gie.PropertyPartitionByEntityStrategy by_entity = 1; - if (_internal_has_by_entity()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::by_entity(this), target, stream); - } - - // .gie.PropertyPartitionByTypeStrategy by_type = 2; - if (_internal_has_by_type()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::by_type(this), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:gie.GraphPropertyPartitionStrategy) - return target; -} - -size_t GraphPropertyPartitionStrategy::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:gie.GraphPropertyPartitionStrategy) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - switch (item_case()) { - // .gie.PropertyPartitionByEntityStrategy by_entity = 1; - case kByEntity: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *item_.by_entity_); - break; - } - // .gie.PropertyPartitionByTypeStrategy by_type = 2; - case kByType: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *item_.by_type_); - break; - } - case ITEM_NOT_SET: { - break; - } - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void GraphPropertyPartitionStrategy::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:gie.GraphPropertyPartitionStrategy) - GOOGLE_DCHECK_NE(&from, this); - const GraphPropertyPartitionStrategy* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.GraphPropertyPartitionStrategy) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.GraphPropertyPartitionStrategy) - MergeFrom(*source); - } -} - -void GraphPropertyPartitionStrategy::MergeFrom(const GraphPropertyPartitionStrategy& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:gie.GraphPropertyPartitionStrategy) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - switch (from.item_case()) { - case kByEntity: { - _internal_mutable_by_entity()->::gie::PropertyPartitionByEntityStrategy::MergeFrom(from._internal_by_entity()); - break; - } - case kByType: { - _internal_mutable_by_type()->::gie::PropertyPartitionByTypeStrategy::MergeFrom(from._internal_by_type()); - break; - } - case ITEM_NOT_SET: { - break; - } - } -} - -void GraphPropertyPartitionStrategy::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:gie.GraphPropertyPartitionStrategy) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void GraphPropertyPartitionStrategy::CopyFrom(const GraphPropertyPartitionStrategy& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:gie.GraphPropertyPartitionStrategy) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool GraphPropertyPartitionStrategy::IsInitialized() const { - return true; -} - -void GraphPropertyPartitionStrategy::InternalSwap(GraphPropertyPartitionStrategy* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - swap(item_, other->item_); - swap(_oneof_case_[0], other->_oneof_case_[0]); -} - -::PROTOBUF_NAMESPACE_ID::Metadata GraphPropertyPartitionStrategy::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void GraphPartitionStrategy::InitAsDefaultInstance() { - ::gie::_GraphPartitionStrategy_default_instance_._instance.get_mutable()->property_ = const_cast< ::gie::GraphPropertyPartitionStrategy*>( - ::gie::GraphPropertyPartitionStrategy::internal_default_instance()); -} -class GraphPartitionStrategy::_Internal { - public: - static const ::gie::GraphPropertyPartitionStrategy& property(const GraphPartitionStrategy* msg); -}; - -const ::gie::GraphPropertyPartitionStrategy& -GraphPartitionStrategy::_Internal::property(const GraphPartitionStrategy* msg) { - return *msg->property_; -} -GraphPartitionStrategy::GraphPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:gie.GraphPartitionStrategy) -} -GraphPartitionStrategy::GraphPartitionStrategy(const GraphPartitionStrategy& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - if (from._internal_has_property()) { - property_ = new ::gie::GraphPropertyPartitionStrategy(*from.property_); - } else { - property_ = nullptr; - } - topology_ = from.topology_; - // @@protoc_insertion_point(copy_constructor:gie.GraphPartitionStrategy) -} - -void GraphPartitionStrategy::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_GraphPartitionStrategy_gie_5fschema_2eproto.base); - ::memset(&property_, 0, static_cast( - reinterpret_cast(&topology_) - - reinterpret_cast(&property_)) + sizeof(topology_)); -} - -GraphPartitionStrategy::~GraphPartitionStrategy() { - // @@protoc_insertion_point(destructor:gie.GraphPartitionStrategy) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void GraphPartitionStrategy::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - if (this != internal_default_instance()) delete property_; -} - -void GraphPartitionStrategy::ArenaDtor(void* object) { - GraphPartitionStrategy* _this = reinterpret_cast< GraphPartitionStrategy* >(object); - (void)_this; -} -void GraphPartitionStrategy::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void GraphPartitionStrategy::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const GraphPartitionStrategy& GraphPartitionStrategy::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_GraphPartitionStrategy_gie_5fschema_2eproto.base); - return *internal_default_instance(); -} - - -void GraphPartitionStrategy::Clear() { -// @@protoc_insertion_point(message_clear_start:gie.GraphPartitionStrategy) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (GetArena() == nullptr && property_ != nullptr) { - delete property_; - } - property_ = nullptr; - topology_ = 0; - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* GraphPartitionStrategy::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .gie.GraphTopologyPartitionStrategy topology = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_topology(static_cast<::gie::GraphTopologyPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // .gie.GraphPropertyPartitionStrategy property = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_property(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* GraphPartitionStrategy::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:gie.GraphPartitionStrategy) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .gie.GraphTopologyPartitionStrategy topology = 1; - if (this->topology() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 1, this->_internal_topology(), target); - } - - // .gie.GraphPropertyPartitionStrategy property = 2; - if (this->has_property()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::property(this), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:gie.GraphPartitionStrategy) - return target; -} - -size_t GraphPartitionStrategy::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:gie.GraphPartitionStrategy) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .gie.GraphPropertyPartitionStrategy property = 2; - if (this->has_property()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *property_); - } - - // .gie.GraphTopologyPartitionStrategy topology = 1; - if (this->topology() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_topology()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void GraphPartitionStrategy::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:gie.GraphPartitionStrategy) - GOOGLE_DCHECK_NE(&from, this); - const GraphPartitionStrategy* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.GraphPartitionStrategy) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.GraphPartitionStrategy) - MergeFrom(*source); - } -} - -void GraphPartitionStrategy::MergeFrom(const GraphPartitionStrategy& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:gie.GraphPartitionStrategy) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.has_property()) { - _internal_mutable_property()->::gie::GraphPropertyPartitionStrategy::MergeFrom(from._internal_property()); - } - if (from.topology() != 0) { - _internal_set_topology(from._internal_topology()); - } -} - -void GraphPartitionStrategy::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:gie.GraphPartitionStrategy) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void GraphPartitionStrategy::CopyFrom(const GraphPartitionStrategy& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:gie.GraphPartitionStrategy) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool GraphPartitionStrategy::IsInitialized() const { - return true; -} - -void GraphPartitionStrategy::InternalSwap(GraphPartitionStrategy* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(GraphPartitionStrategy, topology_) - + sizeof(GraphPartitionStrategy::topology_) - - PROTOBUF_FIELD_OFFSET(GraphPartitionStrategy, property_)>( - reinterpret_cast(&property_), - reinterpret_cast(&other->property_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata GraphPartitionStrategy::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void SrcDstPair::InitAsDefaultInstance() { -} -class SrcDstPair::_Internal { - public: -}; - -SrcDstPair::SrcDstPair(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:gie.SrcDstPair) -} -SrcDstPair::SrcDstPair(const SrcDstPair& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - src_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_src_type().empty()) { - src_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_src_type(), - GetArena()); - } - dst_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_dst_type().empty()) { - dst_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_dst_type(), - GetArena()); - } - ::memcpy(&partition_strategy_, &from.partition_strategy_, - static_cast(reinterpret_cast(&relation_) - - reinterpret_cast(&partition_strategy_)) + sizeof(relation_)); - // @@protoc_insertion_point(copy_constructor:gie.SrcDstPair) -} - -void SrcDstPair::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SrcDstPair_gie_5fschema_2eproto.base); - src_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dst_type_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&partition_strategy_, 0, static_cast( - reinterpret_cast(&relation_) - - reinterpret_cast(&partition_strategy_)) + sizeof(relation_)); -} - -SrcDstPair::~SrcDstPair() { - // @@protoc_insertion_point(destructor:gie.SrcDstPair) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void SrcDstPair::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - src_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - dst_type_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void SrcDstPair::ArenaDtor(void* object) { - SrcDstPair* _this = reinterpret_cast< SrcDstPair* >(object); - (void)_this; -} -void SrcDstPair::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void SrcDstPair::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const SrcDstPair& SrcDstPair::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SrcDstPair_gie_5fschema_2eproto.base); - return *internal_default_instance(); -} - - -void SrcDstPair::Clear() { -// @@protoc_insertion_point(message_clear_start:gie.SrcDstPair) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - src_type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - dst_type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - ::memset(&partition_strategy_, 0, static_cast( - reinterpret_cast(&relation_) - - reinterpret_cast(&partition_strategy_)) + sizeof(relation_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* SrcDstPair::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string src_type = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - auto str = _internal_mutable_src_type(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.SrcDstPair.src_type")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string dst_type = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - auto str = _internal_mutable_dst_type(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.SrcDstPair.dst_type")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .gie.EdgePartitionStrategy partition_strategy = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_partition_strategy(static_cast<::gie::EdgePartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // .gie.PropertyPartitionStrategy property_partition_strategy = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // .gie.Relation relation = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_relation(static_cast<::gie::Relation>(val)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* SrcDstPair::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:gie.SrcDstPair) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string src_type = 1; - if (this->src_type().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_src_type().data(), static_cast(this->_internal_src_type().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "gie.SrcDstPair.src_type"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_src_type(), target); - } - - // string dst_type = 2; - if (this->dst_type().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_dst_type().data(), static_cast(this->_internal_dst_type().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "gie.SrcDstPair.dst_type"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_dst_type(), target); - } - - // .gie.EdgePartitionStrategy partition_strategy = 3; - if (this->partition_strategy() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 3, this->_internal_partition_strategy(), target); - } - - // .gie.PropertyPartitionStrategy property_partition_strategy = 4; - if (this->property_partition_strategy() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 4, this->_internal_property_partition_strategy(), target); - } - - // .gie.Relation relation = 5; - if (this->relation() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 5, this->_internal_relation(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:gie.SrcDstPair) - return target; -} - -size_t SrcDstPair::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:gie.SrcDstPair) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string src_type = 1; - if (this->src_type().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_src_type()); - } - - // string dst_type = 2; - if (this->dst_type().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_dst_type()); - } - - // .gie.EdgePartitionStrategy partition_strategy = 3; - if (this->partition_strategy() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_partition_strategy()); - } - - // .gie.PropertyPartitionStrategy property_partition_strategy = 4; - if (this->property_partition_strategy() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_property_partition_strategy()); - } - - // .gie.Relation relation = 5; - if (this->relation() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_relation()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void SrcDstPair::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:gie.SrcDstPair) - GOOGLE_DCHECK_NE(&from, this); - const SrcDstPair* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.SrcDstPair) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.SrcDstPair) - MergeFrom(*source); - } -} - -void SrcDstPair::MergeFrom(const SrcDstPair& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:gie.SrcDstPair) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.src_type().size() > 0) { - _internal_set_src_type(from._internal_src_type()); - } - if (from.dst_type().size() > 0) { - _internal_set_dst_type(from._internal_dst_type()); - } - if (from.partition_strategy() != 0) { - _internal_set_partition_strategy(from._internal_partition_strategy()); - } - if (from.property_partition_strategy() != 0) { - _internal_set_property_partition_strategy(from._internal_property_partition_strategy()); - } - if (from.relation() != 0) { - _internal_set_relation(from._internal_relation()); - } -} - -void SrcDstPair::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:gie.SrcDstPair) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void SrcDstPair::CopyFrom(const SrcDstPair& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:gie.SrcDstPair) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool SrcDstPair::IsInitialized() const { - return true; -} - -void SrcDstPair::InternalSwap(SrcDstPair* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - src_type_.Swap(&other->src_type_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - dst_type_.Swap(&other->dst_type_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(SrcDstPair, relation_) - + sizeof(SrcDstPair::relation_) - - PROTOBUF_FIELD_OFFSET(SrcDstPair, partition_strategy_)>( - reinterpret_cast(&partition_strategy_), - reinterpret_cast(&other->partition_strategy_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata SrcDstPair::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Property::InitAsDefaultInstance() { -} -class Property::_Internal { - public: -}; - -Property::Property(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:gie.Property) -} -Property::Property(const Property& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_name().empty()) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(), - GetArena()); - } - ::memcpy(&id_, &from.id_, - static_cast(reinterpret_cast(&type_) - - reinterpret_cast(&id_)) + sizeof(type_)); - // @@protoc_insertion_point(copy_constructor:gie.Property) -} - -void Property::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Property_gie_5fschema_2eproto.base); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&id_, 0, static_cast( - reinterpret_cast(&type_) - - reinterpret_cast(&id_)) + sizeof(type_)); -} - -Property::~Property() { - // @@protoc_insertion_point(destructor:gie.Property) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void Property::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void Property::ArenaDtor(void* object) { - Property* _this = reinterpret_cast< Property* >(object); - (void)_this; -} -void Property::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void Property::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Property& Property::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Property_gie_5fschema_2eproto.base); - return *internal_default_instance(); -} - - -void Property::Clear() { -// @@protoc_insertion_point(message_clear_start:gie.Property) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - ::memset(&id_, 0, static_cast( - reinterpret_cast(&type_) - - reinterpret_cast(&id_)) + sizeof(type_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Property::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // uint32 id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - auto str = _internal_mutable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.Property.name")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .gie.DataType type = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_type(static_cast<::gie::DataType>(val)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* Property::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:gie.Property) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint32 id = 1; - if (this->id() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); - } - - // string name = 2; - if (this->name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "gie.Property.name"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_name(), target); - } - - // .gie.DataType type = 3; - if (this->type() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 3, this->_internal_type(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:gie.Property) - return target; -} - -size_t Property::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:gie.Property) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // string name = 2; - if (this->name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // uint32 id = 1; - if (this->id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( - this->_internal_id()); - } - - // .gie.DataType type = 3; - if (this->type() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Property::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:gie.Property) - GOOGLE_DCHECK_NE(&from, this); - const Property* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.Property) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.Property) - MergeFrom(*source); - } -} - -void Property::MergeFrom(const Property& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:gie.Property) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.name().size() > 0) { - _internal_set_name(from._internal_name()); - } - if (from.id() != 0) { - _internal_set_id(from._internal_id()); - } - if (from.type() != 0) { - _internal_set_type(from._internal_type()); - } -} - -void Property::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:gie.Property) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Property::CopyFrom(const Property& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:gie.Property) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Property::IsInitialized() const { - return true; -} - -void Property::InternalSwap(Property* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Property, type_) - + sizeof(Property::type_) - - PROTOBUF_FIELD_OFFSET(Property, id_)>( - reinterpret_cast(&id_), - reinterpret_cast(&other->id_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Property::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void VertexType::InitAsDefaultInstance() { -} -class VertexType::_Internal { - public: -}; - -VertexType::VertexType(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena), - properties_(arena), - primary_keys_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:gie.VertexType) -} -VertexType::VertexType(const VertexType& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - properties_(from.properties_), - primary_keys_(from.primary_keys_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_name().empty()) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(), - GetArena()); - } - ::memcpy(&id_, &from.id_, - static_cast(reinterpret_cast(&property_partition_strategy_) - - reinterpret_cast(&id_)) + sizeof(property_partition_strategy_)); - // @@protoc_insertion_point(copy_constructor:gie.VertexType) -} - -void VertexType::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_VertexType_gie_5fschema_2eproto.base); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&id_, 0, static_cast( - reinterpret_cast(&property_partition_strategy_) - - reinterpret_cast(&id_)) + sizeof(property_partition_strategy_)); -} - -VertexType::~VertexType() { - // @@protoc_insertion_point(destructor:gie.VertexType) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void VertexType::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void VertexType::ArenaDtor(void* object) { - VertexType* _this = reinterpret_cast< VertexType* >(object); - (void)_this; -} -void VertexType::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void VertexType::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const VertexType& VertexType::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_VertexType_gie_5fschema_2eproto.base); - return *internal_default_instance(); -} - - -void VertexType::Clear() { -// @@protoc_insertion_point(message_clear_start:gie.VertexType) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - properties_.Clear(); - primary_keys_.Clear(); - name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - ::memset(&id_, 0, static_cast( - reinterpret_cast(&property_partition_strategy_) - - reinterpret_cast(&id_)) + sizeof(property_partition_strategy_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* VertexType::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // uint32 id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - auto str = _internal_mutable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.VertexType.name")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .gie.Property properties = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_properties(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); - } else goto handle_unusual; - continue; - // repeated string primary_keys = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_primary_keys(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.VertexType.primary_keys")); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); - } else goto handle_unusual; - continue; - // .gie.VertexPartitionStrategy partition_strategy = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_partition_strategy(static_cast<::gie::VertexPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // .gie.PropertyPartitionStrategy property_partition_strategy = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_property_partition_strategy(static_cast<::gie::PropertyPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // int64 total_num = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - total_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* VertexType::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:gie.VertexType) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint32 id = 1; - if (this->id() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); - } - - // string name = 2; - if (this->name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "gie.VertexType.name"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_name(), target); - } - - // repeated .gie.Property properties = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_properties_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_properties(i), target, stream); - } - - // repeated string primary_keys = 4; - for (int i = 0, n = this->_internal_primary_keys_size(); i < n; i++) { - const auto& s = this->_internal_primary_keys(i); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - s.data(), static_cast(s.length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "gie.VertexType.primary_keys"); - target = stream->WriteString(4, s, target); - } - - // .gie.VertexPartitionStrategy partition_strategy = 5; - if (this->partition_strategy() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 5, this->_internal_partition_strategy(), target); - } - - // .gie.PropertyPartitionStrategy property_partition_strategy = 6; - if (this->property_partition_strategy() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 6, this->_internal_property_partition_strategy(), target); - } - - // int64 total_num = 7; - if (this->total_num() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(7, this->_internal_total_num(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:gie.VertexType) - return target; -} - -size_t VertexType::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:gie.VertexType) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .gie.Property properties = 3; - total_size += 1UL * this->_internal_properties_size(); - for (const auto& msg : this->properties_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated string primary_keys = 4; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(primary_keys_.size()); - for (int i = 0, n = primary_keys_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - primary_keys_.Get(i)); - } - - // string name = 2; - if (this->name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // uint32 id = 1; - if (this->id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( - this->_internal_id()); - } - - // .gie.VertexPartitionStrategy partition_strategy = 5; - if (this->partition_strategy() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_partition_strategy()); - } - - // int64 total_num = 7; - if (this->total_num() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->_internal_total_num()); - } - - // .gie.PropertyPartitionStrategy property_partition_strategy = 6; - if (this->property_partition_strategy() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_property_partition_strategy()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void VertexType::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:gie.VertexType) - GOOGLE_DCHECK_NE(&from, this); - const VertexType* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.VertexType) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.VertexType) - MergeFrom(*source); - } -} - -void VertexType::MergeFrom(const VertexType& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:gie.VertexType) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - properties_.MergeFrom(from.properties_); - primary_keys_.MergeFrom(from.primary_keys_); - if (from.name().size() > 0) { - _internal_set_name(from._internal_name()); - } - if (from.id() != 0) { - _internal_set_id(from._internal_id()); - } - if (from.partition_strategy() != 0) { - _internal_set_partition_strategy(from._internal_partition_strategy()); - } - if (from.total_num() != 0) { - _internal_set_total_num(from._internal_total_num()); - } - if (from.property_partition_strategy() != 0) { - _internal_set_property_partition_strategy(from._internal_property_partition_strategy()); - } -} - -void VertexType::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:gie.VertexType) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void VertexType::CopyFrom(const VertexType& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:gie.VertexType) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool VertexType::IsInitialized() const { - return true; -} - -void VertexType::InternalSwap(VertexType* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - properties_.InternalSwap(&other->properties_); - primary_keys_.InternalSwap(&other->primary_keys_); - name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(VertexType, property_partition_strategy_) - + sizeof(VertexType::property_partition_strategy_) - - PROTOBUF_FIELD_OFFSET(VertexType, id_)>( - reinterpret_cast(&id_), - reinterpret_cast(&other->id_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata VertexType::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void EdgeType::InitAsDefaultInstance() { -} -class EdgeType::_Internal { - public: -}; - -EdgeType::EdgeType(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena), - properties_(arena), - primary_keys_(arena), - src_dst_pairs_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:gie.EdgeType) -} -EdgeType::EdgeType(const EdgeType& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - properties_(from.properties_), - primary_keys_(from.primary_keys_), - src_dst_pairs_(from.src_dst_pairs_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_name().empty()) { - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(), - GetArena()); - } - ::memcpy(&total_num_, &from.total_num_, - static_cast(reinterpret_cast(&id_) - - reinterpret_cast(&total_num_)) + sizeof(id_)); - // @@protoc_insertion_point(copy_constructor:gie.EdgeType) -} - -void EdgeType::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_EdgeType_gie_5fschema_2eproto.base); - name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - ::memset(&total_num_, 0, static_cast( - reinterpret_cast(&id_) - - reinterpret_cast(&total_num_)) + sizeof(id_)); -} - -EdgeType::~EdgeType() { - // @@protoc_insertion_point(destructor:gie.EdgeType) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void EdgeType::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); -} - -void EdgeType::ArenaDtor(void* object) { - EdgeType* _this = reinterpret_cast< EdgeType* >(object); - (void)_this; -} -void EdgeType::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void EdgeType::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const EdgeType& EdgeType::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_EdgeType_gie_5fschema_2eproto.base); - return *internal_default_instance(); -} - - -void EdgeType::Clear() { -// @@protoc_insertion_point(message_clear_start:gie.EdgeType) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - properties_.Clear(); - primary_keys_.Clear(); - src_dst_pairs_.Clear(); - name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - ::memset(&total_num_, 0, static_cast( - reinterpret_cast(&id_) - - reinterpret_cast(&total_num_)) + sizeof(id_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* EdgeType::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // uint32 id = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - auto str = _internal_mutable_name(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.EdgeType.name")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .gie.Property properties = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_properties(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); - } else goto handle_unusual; - continue; - // repeated string primary_keys = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr -= 1; - do { - ptr += 1; - auto str = _internal_add_primary_keys(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "gie.EdgeType.primary_keys")); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr)); - } else goto handle_unusual; - continue; - // repeated .gie.SrcDstPair src_dst_pairs = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_src_dst_pairs(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr)); - } else goto handle_unusual; - continue; - // int64 total_num = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - total_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* EdgeType::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:gie.EdgeType) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint32 id = 1; - if (this->id() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_id(), target); - } - - // string name = 2; - if (this->name().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_name().data(), static_cast(this->_internal_name().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "gie.EdgeType.name"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_name(), target); - } - - // repeated .gie.Property properties = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_properties_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_properties(i), target, stream); - } - - // repeated string primary_keys = 4; - for (int i = 0, n = this->_internal_primary_keys_size(); i < n; i++) { - const auto& s = this->_internal_primary_keys(i); - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - s.data(), static_cast(s.length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "gie.EdgeType.primary_keys"); - target = stream->WriteString(4, s, target); - } - - // repeated .gie.SrcDstPair src_dst_pairs = 5; - for (unsigned int i = 0, - n = static_cast(this->_internal_src_dst_pairs_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(5, this->_internal_src_dst_pairs(i), target, stream); - } - - // int64 total_num = 6; - if (this->total_num() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(6, this->_internal_total_num(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:gie.EdgeType) - return target; -} - -size_t EdgeType::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:gie.EdgeType) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .gie.Property properties = 3; - total_size += 1UL * this->_internal_properties_size(); - for (const auto& msg : this->properties_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated string primary_keys = 4; - total_size += 1 * - ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(primary_keys_.size()); - for (int i = 0, n = primary_keys_.size(); i < n; i++) { - total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - primary_keys_.Get(i)); - } - - // repeated .gie.SrcDstPair src_dst_pairs = 5; - total_size += 1UL * this->_internal_src_dst_pairs_size(); - for (const auto& msg : this->src_dst_pairs_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // string name = 2; - if (this->name().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_name()); - } - - // int64 total_num = 6; - if (this->total_num() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( - this->_internal_total_num()); - } - - // uint32 id = 1; - if (this->id() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( - this->_internal_id()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void EdgeType::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:gie.EdgeType) - GOOGLE_DCHECK_NE(&from, this); - const EdgeType* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.EdgeType) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.EdgeType) - MergeFrom(*source); - } -} - -void EdgeType::MergeFrom(const EdgeType& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:gie.EdgeType) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - properties_.MergeFrom(from.properties_); - primary_keys_.MergeFrom(from.primary_keys_); - src_dst_pairs_.MergeFrom(from.src_dst_pairs_); - if (from.name().size() > 0) { - _internal_set_name(from._internal_name()); - } - if (from.total_num() != 0) { - _internal_set_total_num(from._internal_total_num()); - } - if (from.id() != 0) { - _internal_set_id(from._internal_id()); - } -} - -void EdgeType::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:gie.EdgeType) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void EdgeType::CopyFrom(const EdgeType& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:gie.EdgeType) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool EdgeType::IsInitialized() const { - return true; -} - -void EdgeType::InternalSwap(EdgeType* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - properties_.InternalSwap(&other->properties_); - primary_keys_.InternalSwap(&other->primary_keys_); - src_dst_pairs_.InternalSwap(&other->src_dst_pairs_); - name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(EdgeType, id_) - + sizeof(EdgeType::id_) - - PROTOBUF_FIELD_OFFSET(EdgeType, total_num_)>( - reinterpret_cast(&total_num_), - reinterpret_cast(&other->total_num_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata EdgeType::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Statistics::InitAsDefaultInstance() { -} -class Statistics::_Internal { - public: -}; - -Statistics::Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:gie.Statistics) -} -Statistics::Statistics(const Statistics& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&num_vertices_, &from.num_vertices_, - static_cast(reinterpret_cast(&num_partitions_) - - reinterpret_cast(&num_vertices_)) + sizeof(num_partitions_)); - // @@protoc_insertion_point(copy_constructor:gie.Statistics) -} - -void Statistics::SharedCtor() { - ::memset(&num_vertices_, 0, static_cast( - reinterpret_cast(&num_partitions_) - - reinterpret_cast(&num_vertices_)) + sizeof(num_partitions_)); -} - -Statistics::~Statistics() { - // @@protoc_insertion_point(destructor:gie.Statistics) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void Statistics::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); -} - -void Statistics::ArenaDtor(void* object) { - Statistics* _this = reinterpret_cast< Statistics* >(object); - (void)_this; -} -void Statistics::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void Statistics::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Statistics& Statistics::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Statistics_gie_5fschema_2eproto.base); - return *internal_default_instance(); -} - - -void Statistics::Clear() { -// @@protoc_insertion_point(message_clear_start:gie.Statistics) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&num_vertices_, 0, static_cast( - reinterpret_cast(&num_partitions_) - - reinterpret_cast(&num_vertices_)) + sizeof(num_partitions_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Statistics::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // uint32 num_partitions = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - num_partitions_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 num_vertices = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - num_vertices_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // uint64 num_edges = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - num_edges_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* Statistics::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:gie.Statistics) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // uint32 num_partitions = 1; - if (this->num_partitions() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_num_partitions(), target); - } - - // uint64 num_vertices = 2; - if (this->num_vertices() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->_internal_num_vertices(), target); - } - - // uint64 num_edges = 3; - if (this->num_edges() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(3, this->_internal_num_edges(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:gie.Statistics) - return target; -} - -size_t Statistics::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:gie.Statistics) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // uint64 num_vertices = 2; - if (this->num_vertices() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->_internal_num_vertices()); - } - - // uint64 num_edges = 3; - if (this->num_edges() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( - this->_internal_num_edges()); - } - - // uint32 num_partitions = 1; - if (this->num_partitions() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( - this->_internal_num_partitions()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Statistics::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:gie.Statistics) - GOOGLE_DCHECK_NE(&from, this); - const Statistics* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.Statistics) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.Statistics) - MergeFrom(*source); - } -} - -void Statistics::MergeFrom(const Statistics& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:gie.Statistics) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.num_vertices() != 0) { - _internal_set_num_vertices(from._internal_num_vertices()); - } - if (from.num_edges() != 0) { - _internal_set_num_edges(from._internal_num_edges()); - } - if (from.num_partitions() != 0) { - _internal_set_num_partitions(from._internal_num_partitions()); - } -} - -void Statistics::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:gie.Statistics) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Statistics::CopyFrom(const Statistics& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:gie.Statistics) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Statistics::IsInitialized() const { - return true; -} - -void Statistics::InternalSwap(Statistics* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Statistics, num_partitions_) - + sizeof(Statistics::num_partitions_) - - PROTOBUF_FIELD_OFFSET(Statistics, num_vertices_)>( - reinterpret_cast(&num_vertices_), - reinterpret_cast(&other->num_vertices_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Statistics::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Schema::InitAsDefaultInstance() { - ::gie::_Schema_default_instance_._instance.get_mutable()->partition_strategy_ = const_cast< ::gie::GraphPartitionStrategy*>( - ::gie::GraphPartitionStrategy::internal_default_instance()); - ::gie::_Schema_default_instance_._instance.get_mutable()->statistics_ = const_cast< ::gie::Statistics*>( - ::gie::Statistics::internal_default_instance()); -} -class Schema::_Internal { - public: - static const ::gie::GraphPartitionStrategy& partition_strategy(const Schema* msg); - static const ::gie::Statistics& statistics(const Schema* msg); -}; - -const ::gie::GraphPartitionStrategy& -Schema::_Internal::partition_strategy(const Schema* msg) { - return *msg->partition_strategy_; -} -const ::gie::Statistics& -Schema::_Internal::statistics(const Schema* msg) { - return *msg->statistics_; -} -Schema::Schema(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena), - vertex_types_(arena), - edge_types_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:gie.Schema) -} -Schema::Schema(const Schema& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - vertex_types_(from.vertex_types_), - edge_types_(from.edge_types_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - if (from._internal_has_partition_strategy()) { - partition_strategy_ = new ::gie::GraphPartitionStrategy(*from.partition_strategy_); - } else { - partition_strategy_ = nullptr; - } - if (from._internal_has_statistics()) { - statistics_ = new ::gie::Statistics(*from.statistics_); - } else { - statistics_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:gie.Schema) -} - -void Schema::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Schema_gie_5fschema_2eproto.base); - ::memset(&partition_strategy_, 0, static_cast( - reinterpret_cast(&statistics_) - - reinterpret_cast(&partition_strategy_)) + sizeof(statistics_)); -} - -Schema::~Schema() { - // @@protoc_insertion_point(destructor:gie.Schema) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void Schema::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - if (this != internal_default_instance()) delete partition_strategy_; - if (this != internal_default_instance()) delete statistics_; -} - -void Schema::ArenaDtor(void* object) { - Schema* _this = reinterpret_cast< Schema* >(object); - (void)_this; -} -void Schema::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void Schema::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Schema& Schema::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Schema_gie_5fschema_2eproto.base); - return *internal_default_instance(); -} - - -void Schema::Clear() { -// @@protoc_insertion_point(message_clear_start:gie.Schema) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - vertex_types_.Clear(); - edge_types_.Clear(); - if (GetArena() == nullptr && partition_strategy_ != nullptr) { - delete partition_strategy_; - } - partition_strategy_ = nullptr; - if (GetArena() == nullptr && statistics_ != nullptr) { - delete statistics_; - } - statistics_ = nullptr; - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Schema::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .gie.GraphPartitionStrategy partition_strategy = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_partition_strategy(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .gie.VertexType vertex_types = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_vertex_types(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr)); - } else goto handle_unusual; - continue; - // repeated .gie.EdgeType edge_types = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_edge_types(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); - } else goto handle_unusual; - continue; - // .gie.Statistics statistics = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr = ctx->ParseMessage(_internal_mutable_statistics(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* Schema::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:gie.Schema) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .gie.GraphPartitionStrategy partition_strategy = 1; - if (this->has_partition_strategy()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::partition_strategy(this), target, stream); - } - - // repeated .gie.VertexType vertex_types = 2; - for (unsigned int i = 0, - n = static_cast(this->_internal_vertex_types_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(2, this->_internal_vertex_types(i), target, stream); - } - - // repeated .gie.EdgeType edge_types = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_edge_types_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_edge_types(i), target, stream); - } - - // .gie.Statistics statistics = 4; - if (this->has_statistics()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::statistics(this), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:gie.Schema) - return target; -} - -size_t Schema::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:gie.Schema) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .gie.VertexType vertex_types = 2; - total_size += 1UL * this->_internal_vertex_types_size(); - for (const auto& msg : this->vertex_types_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // repeated .gie.EdgeType edge_types = 3; - total_size += 1UL * this->_internal_edge_types_size(); - for (const auto& msg : this->edge_types_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // .gie.GraphPartitionStrategy partition_strategy = 1; - if (this->has_partition_strategy()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *partition_strategy_); - } - - // .gie.Statistics statistics = 4; - if (this->has_statistics()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *statistics_); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Schema::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:gie.Schema) - GOOGLE_DCHECK_NE(&from, this); - const Schema* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:gie.Schema) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:gie.Schema) - MergeFrom(*source); - } -} - -void Schema::MergeFrom(const Schema& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:gie.Schema) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - vertex_types_.MergeFrom(from.vertex_types_); - edge_types_.MergeFrom(from.edge_types_); - if (from.has_partition_strategy()) { - _internal_mutable_partition_strategy()->::gie::GraphPartitionStrategy::MergeFrom(from._internal_partition_strategy()); - } - if (from.has_statistics()) { - _internal_mutable_statistics()->::gie::Statistics::MergeFrom(from._internal_statistics()); - } -} - -void Schema::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:gie.Schema) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Schema::CopyFrom(const Schema& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:gie.Schema) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Schema::IsInitialized() const { - return true; -} - -void Schema::InternalSwap(Schema* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - vertex_types_.InternalSwap(&other->vertex_types_); - edge_types_.InternalSwap(&other->edge_types_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Schema, statistics_) - + sizeof(Schema::statistics_) - - PROTOBUF_FIELD_OFFSET(Schema, partition_strategy_)>( - reinterpret_cast(&partition_strategy_), - reinterpret_cast(&other->partition_strategy_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Schema::GetMetadata() const { - return GetMetadataStatic(); -} - - -// @@protoc_insertion_point(namespace_scope) -} // namespace gie -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::gie::PropertyPartitionByEntityStrategy* Arena::CreateMaybeMessage< ::gie::PropertyPartitionByEntityStrategy >(Arena* arena) { - return Arena::CreateMessageInternal< ::gie::PropertyPartitionByEntityStrategy >(arena); -} -template<> PROTOBUF_NOINLINE ::gie::PropertyPartitionByTypeStrategy* Arena::CreateMaybeMessage< ::gie::PropertyPartitionByTypeStrategy >(Arena* arena) { - return Arena::CreateMessageInternal< ::gie::PropertyPartitionByTypeStrategy >(arena); -} -template<> PROTOBUF_NOINLINE ::gie::GraphPropertyPartitionStrategy* Arena::CreateMaybeMessage< ::gie::GraphPropertyPartitionStrategy >(Arena* arena) { - return Arena::CreateMessageInternal< ::gie::GraphPropertyPartitionStrategy >(arena); -} -template<> PROTOBUF_NOINLINE ::gie::GraphPartitionStrategy* Arena::CreateMaybeMessage< ::gie::GraphPartitionStrategy >(Arena* arena) { - return Arena::CreateMessageInternal< ::gie::GraphPartitionStrategy >(arena); -} -template<> PROTOBUF_NOINLINE ::gie::SrcDstPair* Arena::CreateMaybeMessage< ::gie::SrcDstPair >(Arena* arena) { - return Arena::CreateMessageInternal< ::gie::SrcDstPair >(arena); -} -template<> PROTOBUF_NOINLINE ::gie::Property* Arena::CreateMaybeMessage< ::gie::Property >(Arena* arena) { - return Arena::CreateMessageInternal< ::gie::Property >(arena); -} -template<> PROTOBUF_NOINLINE ::gie::VertexType* Arena::CreateMaybeMessage< ::gie::VertexType >(Arena* arena) { - return Arena::CreateMessageInternal< ::gie::VertexType >(arena); -} -template<> PROTOBUF_NOINLINE ::gie::EdgeType* Arena::CreateMaybeMessage< ::gie::EdgeType >(Arena* arena) { - return Arena::CreateMessageInternal< ::gie::EdgeType >(arena); -} -template<> PROTOBUF_NOINLINE ::gie::Statistics* Arena::CreateMaybeMessage< ::gie::Statistics >(Arena* arena) { - return Arena::CreateMessageInternal< ::gie::Statistics >(arena); -} -template<> PROTOBUF_NOINLINE ::gie::Schema* Arena::CreateMaybeMessage< ::gie::Schema >(Arena* arena) { - return Arena::CreateMessageInternal< ::gie::Schema >(arena); -} -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) -#include diff --git a/modules/graph/grin/src/proto/gie_schema.pb.h b/modules/graph/grin/src/proto/gie_schema.pb.h deleted file mode 100644 index ebf345753..000000000 --- a/modules/graph/grin/src/proto/gie_schema.pb.h +++ /dev/null @@ -1,3725 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: gie_schema.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_gie_5fschema_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_gie_5fschema_2eproto - -#include -#include - -#include -#if PROTOBUF_VERSION < 3012000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 3012004 < PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -#include -// @@protoc_insertion_point(includes) -#include -#define PROTOBUF_INTERNAL_EXPORT_gie_5fschema_2eproto -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct TableStruct_gie_5fschema_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[10] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; -}; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_gie_5fschema_2eproto; -namespace gie { -class EdgeType; -class EdgeTypeDefaultTypeInternal; -extern EdgeTypeDefaultTypeInternal _EdgeType_default_instance_; -class GraphPartitionStrategy; -class GraphPartitionStrategyDefaultTypeInternal; -extern GraphPartitionStrategyDefaultTypeInternal _GraphPartitionStrategy_default_instance_; -class GraphPropertyPartitionStrategy; -class GraphPropertyPartitionStrategyDefaultTypeInternal; -extern GraphPropertyPartitionStrategyDefaultTypeInternal _GraphPropertyPartitionStrategy_default_instance_; -class Property; -class PropertyDefaultTypeInternal; -extern PropertyDefaultTypeInternal _Property_default_instance_; -class PropertyPartitionByEntityStrategy; -class PropertyPartitionByEntityStrategyDefaultTypeInternal; -extern PropertyPartitionByEntityStrategyDefaultTypeInternal _PropertyPartitionByEntityStrategy_default_instance_; -class PropertyPartitionByTypeStrategy; -class PropertyPartitionByTypeStrategyDefaultTypeInternal; -extern PropertyPartitionByTypeStrategyDefaultTypeInternal _PropertyPartitionByTypeStrategy_default_instance_; -class Schema; -class SchemaDefaultTypeInternal; -extern SchemaDefaultTypeInternal _Schema_default_instance_; -class SrcDstPair; -class SrcDstPairDefaultTypeInternal; -extern SrcDstPairDefaultTypeInternal _SrcDstPair_default_instance_; -class Statistics; -class StatisticsDefaultTypeInternal; -extern StatisticsDefaultTypeInternal _Statistics_default_instance_; -class VertexType; -class VertexTypeDefaultTypeInternal; -extern VertexTypeDefaultTypeInternal _VertexType_default_instance_; -} // namespace gie -PROTOBUF_NAMESPACE_OPEN -template<> ::gie::EdgeType* Arena::CreateMaybeMessage<::gie::EdgeType>(Arena*); -template<> ::gie::GraphPartitionStrategy* Arena::CreateMaybeMessage<::gie::GraphPartitionStrategy>(Arena*); -template<> ::gie::GraphPropertyPartitionStrategy* Arena::CreateMaybeMessage<::gie::GraphPropertyPartitionStrategy>(Arena*); -template<> ::gie::Property* Arena::CreateMaybeMessage<::gie::Property>(Arena*); -template<> ::gie::PropertyPartitionByEntityStrategy* Arena::CreateMaybeMessage<::gie::PropertyPartitionByEntityStrategy>(Arena*); -template<> ::gie::PropertyPartitionByTypeStrategy* Arena::CreateMaybeMessage<::gie::PropertyPartitionByTypeStrategy>(Arena*); -template<> ::gie::Schema* Arena::CreateMaybeMessage<::gie::Schema>(Arena*); -template<> ::gie::SrcDstPair* Arena::CreateMaybeMessage<::gie::SrcDstPair>(Arena*); -template<> ::gie::Statistics* Arena::CreateMaybeMessage<::gie::Statistics>(Arena*); -template<> ::gie::VertexType* Arena::CreateMaybeMessage<::gie::VertexType>(Arena*); -PROTOBUF_NAMESPACE_CLOSE -namespace gie { - -enum VertexPartitionStrategy : int { - VPS_UNDEFINED = 0, - VPS_ALL = 1, - VPS_ONE = 2, - VPS_FOLLOW_EDGE = 3, - VertexPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - VertexPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool VertexPartitionStrategy_IsValid(int value); -constexpr VertexPartitionStrategy VertexPartitionStrategy_MIN = VPS_UNDEFINED; -constexpr VertexPartitionStrategy VertexPartitionStrategy_MAX = VPS_FOLLOW_EDGE; -constexpr int VertexPartitionStrategy_ARRAYSIZE = VertexPartitionStrategy_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* VertexPartitionStrategy_descriptor(); -template -inline const std::string& VertexPartitionStrategy_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function VertexPartitionStrategy_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - VertexPartitionStrategy_descriptor(), enum_t_value); -} -inline bool VertexPartitionStrategy_Parse( - const std::string& name, VertexPartitionStrategy* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - VertexPartitionStrategy_descriptor(), name, value); -} -enum EdgePartitionStrategy : int { - EPS_UNDEFINED = 0, - EPS_ALL = 1, - EPS_ONE = 2, - EPS_FOLLOW_SRC = 3, - EPS_FOLLOW_DST = 4, - EPS_FOLLOW_BOTH = 5, - EdgePartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - EdgePartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool EdgePartitionStrategy_IsValid(int value); -constexpr EdgePartitionStrategy EdgePartitionStrategy_MIN = EPS_UNDEFINED; -constexpr EdgePartitionStrategy EdgePartitionStrategy_MAX = EPS_FOLLOW_BOTH; -constexpr int EdgePartitionStrategy_ARRAYSIZE = EdgePartitionStrategy_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* EdgePartitionStrategy_descriptor(); -template -inline const std::string& EdgePartitionStrategy_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function EdgePartitionStrategy_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - EdgePartitionStrategy_descriptor(), enum_t_value); -} -inline bool EdgePartitionStrategy_Parse( - const std::string& name, EdgePartitionStrategy* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - EdgePartitionStrategy_descriptor(), name, value); -} -enum PropertyPartitionStrategy : int { - PPS_UNDEFINED = 0, - PPS_MASTER = 1, - PPS_MASTER_MIRROR = 2, - PropertyPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - PropertyPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool PropertyPartitionStrategy_IsValid(int value); -constexpr PropertyPartitionStrategy PropertyPartitionStrategy_MIN = PPS_UNDEFINED; -constexpr PropertyPartitionStrategy PropertyPartitionStrategy_MAX = PPS_MASTER_MIRROR; -constexpr int PropertyPartitionStrategy_ARRAYSIZE = PropertyPartitionStrategy_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PropertyPartitionStrategy_descriptor(); -template -inline const std::string& PropertyPartitionStrategy_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function PropertyPartitionStrategy_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - PropertyPartitionStrategy_descriptor(), enum_t_value); -} -inline bool PropertyPartitionStrategy_Parse( - const std::string& name, PropertyPartitionStrategy* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - PropertyPartitionStrategy_descriptor(), name, value); -} -enum GraphTopologyPartitionStrategy : int { - GPS_UNDEFINED = 0, - GPS_ALL_REPLICATE = 1, - GPS_EDGE_CUT_FOLLOW_BOTH = 2, - GPS_EDGE_CUT_FOLLOW_SRC = 3, - GPS_EDGE_CUT_FOLLOW_DST = 4, - GPS_VERTEX_CUT = 5, - GPS_HYBRID = 6, - GraphTopologyPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - GraphTopologyPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool GraphTopologyPartitionStrategy_IsValid(int value); -constexpr GraphTopologyPartitionStrategy GraphTopologyPartitionStrategy_MIN = GPS_UNDEFINED; -constexpr GraphTopologyPartitionStrategy GraphTopologyPartitionStrategy_MAX = GPS_HYBRID; -constexpr int GraphTopologyPartitionStrategy_ARRAYSIZE = GraphTopologyPartitionStrategy_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GraphTopologyPartitionStrategy_descriptor(); -template -inline const std::string& GraphTopologyPartitionStrategy_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function GraphTopologyPartitionStrategy_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - GraphTopologyPartitionStrategy_descriptor(), enum_t_value); -} -inline bool GraphTopologyPartitionStrategy_Parse( - const std::string& name, GraphTopologyPartitionStrategy* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - GraphTopologyPartitionStrategy_descriptor(), name, value); -} -enum Relation : int { - REL_UNDEFINED = 0, - MANY_TO_MANY = 1, - MANY_TO_ONE = 2, - ONE_TO_MANY = 3, - ONE_TO_ONE = 4, - Relation_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - Relation_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool Relation_IsValid(int value); -constexpr Relation Relation_MIN = REL_UNDEFINED; -constexpr Relation Relation_MAX = ONE_TO_ONE; -constexpr int Relation_ARRAYSIZE = Relation_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* Relation_descriptor(); -template -inline const std::string& Relation_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function Relation_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - Relation_descriptor(), enum_t_value); -} -inline bool Relation_Parse( - const std::string& name, Relation* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - Relation_descriptor(), name, value); -} -enum DataType : int { - DT_UNKNOWN = 0, - DT_SIGNED_INT32 = 1, - DT_UNSIGNED_INT32 = 2, - DT_SIGNED_INT64 = 3, - DT_UNSIGNED_INT64 = 4, - DT_FLOAT = 5, - DT_DOUBLE = 6, - DT_STRING = 7, - DT_DATE = 8, - DT_TIME = 9, - DT_TIMESTAMP = 10, - DataType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - DataType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool DataType_IsValid(int value); -constexpr DataType DataType_MIN = DT_UNKNOWN; -constexpr DataType DataType_MAX = DT_TIMESTAMP; -constexpr int DataType_ARRAYSIZE = DataType_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* DataType_descriptor(); -template -inline const std::string& DataType_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function DataType_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - DataType_descriptor(), enum_t_value); -} -inline bool DataType_Parse( - const std::string& name, DataType* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - DataType_descriptor(), name, value); -} -// =================================================================== - -class PropertyPartitionByEntityStrategy PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.PropertyPartitionByEntityStrategy) */ { - public: - inline PropertyPartitionByEntityStrategy() : PropertyPartitionByEntityStrategy(nullptr) {}; - virtual ~PropertyPartitionByEntityStrategy(); - - PropertyPartitionByEntityStrategy(const PropertyPartitionByEntityStrategy& from); - PropertyPartitionByEntityStrategy(PropertyPartitionByEntityStrategy&& from) noexcept - : PropertyPartitionByEntityStrategy() { - *this = ::std::move(from); - } - - inline PropertyPartitionByEntityStrategy& operator=(const PropertyPartitionByEntityStrategy& from) { - CopyFrom(from); - return *this; - } - inline PropertyPartitionByEntityStrategy& operator=(PropertyPartitionByEntityStrategy&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const PropertyPartitionByEntityStrategy& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const PropertyPartitionByEntityStrategy* internal_default_instance() { - return reinterpret_cast( - &_PropertyPartitionByEntityStrategy_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(PropertyPartitionByEntityStrategy& a, PropertyPartitionByEntityStrategy& b) { - a.Swap(&b); - } - inline void Swap(PropertyPartitionByEntityStrategy* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(PropertyPartitionByEntityStrategy* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline PropertyPartitionByEntityStrategy* New() const final { - return CreateMaybeMessage(nullptr); - } - - PropertyPartitionByEntityStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const PropertyPartitionByEntityStrategy& from); - void MergeFrom(const PropertyPartitionByEntityStrategy& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(PropertyPartitionByEntityStrategy* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "gie.PropertyPartitionByEntityStrategy"; - } - protected: - explicit PropertyPartitionByEntityStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); - return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kVertexPropertyPartitionStrategyFieldNumber = 1, - kEdgePropertyPartitionStrategyFieldNumber = 2, - }; - // .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; - void clear_vertex_property_partition_strategy(); - ::gie::PropertyPartitionStrategy vertex_property_partition_strategy() const; - void set_vertex_property_partition_strategy(::gie::PropertyPartitionStrategy value); - private: - ::gie::PropertyPartitionStrategy _internal_vertex_property_partition_strategy() const; - void _internal_set_vertex_property_partition_strategy(::gie::PropertyPartitionStrategy value); - public: - - // .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; - void clear_edge_property_partition_strategy(); - ::gie::PropertyPartitionStrategy edge_property_partition_strategy() const; - void set_edge_property_partition_strategy(::gie::PropertyPartitionStrategy value); - private: - ::gie::PropertyPartitionStrategy _internal_edge_property_partition_strategy() const; - void _internal_set_edge_property_partition_strategy(::gie::PropertyPartitionStrategy value); - public: - - // @@protoc_insertion_point(class_scope:gie.PropertyPartitionByEntityStrategy) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - int vertex_property_partition_strategy_; - int edge_property_partition_strategy_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_gie_5fschema_2eproto; -}; -// ------------------------------------------------------------------- - -class PropertyPartitionByTypeStrategy PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.PropertyPartitionByTypeStrategy) */ { - public: - inline PropertyPartitionByTypeStrategy() : PropertyPartitionByTypeStrategy(nullptr) {}; - virtual ~PropertyPartitionByTypeStrategy(); - - PropertyPartitionByTypeStrategy(const PropertyPartitionByTypeStrategy& from); - PropertyPartitionByTypeStrategy(PropertyPartitionByTypeStrategy&& from) noexcept - : PropertyPartitionByTypeStrategy() { - *this = ::std::move(from); - } - - inline PropertyPartitionByTypeStrategy& operator=(const PropertyPartitionByTypeStrategy& from) { - CopyFrom(from); - return *this; - } - inline PropertyPartitionByTypeStrategy& operator=(PropertyPartitionByTypeStrategy&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const PropertyPartitionByTypeStrategy& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const PropertyPartitionByTypeStrategy* internal_default_instance() { - return reinterpret_cast( - &_PropertyPartitionByTypeStrategy_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(PropertyPartitionByTypeStrategy& a, PropertyPartitionByTypeStrategy& b) { - a.Swap(&b); - } - inline void Swap(PropertyPartitionByTypeStrategy* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(PropertyPartitionByTypeStrategy* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline PropertyPartitionByTypeStrategy* New() const final { - return CreateMaybeMessage(nullptr); - } - - PropertyPartitionByTypeStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const PropertyPartitionByTypeStrategy& from); - void MergeFrom(const PropertyPartitionByTypeStrategy& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(PropertyPartitionByTypeStrategy* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "gie.PropertyPartitionByTypeStrategy"; - } - protected: - explicit PropertyPartitionByTypeStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); - return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // @@protoc_insertion_point(class_scope:gie.PropertyPartitionByTypeStrategy) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_gie_5fschema_2eproto; -}; -// ------------------------------------------------------------------- - -class GraphPropertyPartitionStrategy PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.GraphPropertyPartitionStrategy) */ { - public: - inline GraphPropertyPartitionStrategy() : GraphPropertyPartitionStrategy(nullptr) {}; - virtual ~GraphPropertyPartitionStrategy(); - - GraphPropertyPartitionStrategy(const GraphPropertyPartitionStrategy& from); - GraphPropertyPartitionStrategy(GraphPropertyPartitionStrategy&& from) noexcept - : GraphPropertyPartitionStrategy() { - *this = ::std::move(from); - } - - inline GraphPropertyPartitionStrategy& operator=(const GraphPropertyPartitionStrategy& from) { - CopyFrom(from); - return *this; - } - inline GraphPropertyPartitionStrategy& operator=(GraphPropertyPartitionStrategy&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const GraphPropertyPartitionStrategy& default_instance(); - - enum ItemCase { - kByEntity = 1, - kByType = 2, - ITEM_NOT_SET = 0, - }; - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const GraphPropertyPartitionStrategy* internal_default_instance() { - return reinterpret_cast( - &_GraphPropertyPartitionStrategy_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(GraphPropertyPartitionStrategy& a, GraphPropertyPartitionStrategy& b) { - a.Swap(&b); - } - inline void Swap(GraphPropertyPartitionStrategy* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(GraphPropertyPartitionStrategy* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline GraphPropertyPartitionStrategy* New() const final { - return CreateMaybeMessage(nullptr); - } - - GraphPropertyPartitionStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const GraphPropertyPartitionStrategy& from); - void MergeFrom(const GraphPropertyPartitionStrategy& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(GraphPropertyPartitionStrategy* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "gie.GraphPropertyPartitionStrategy"; - } - protected: - explicit GraphPropertyPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); - return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kByEntityFieldNumber = 1, - kByTypeFieldNumber = 2, - }; - // .gie.PropertyPartitionByEntityStrategy by_entity = 1; - bool has_by_entity() const; - private: - bool _internal_has_by_entity() const; - public: - void clear_by_entity(); - const ::gie::PropertyPartitionByEntityStrategy& by_entity() const; - ::gie::PropertyPartitionByEntityStrategy* release_by_entity(); - ::gie::PropertyPartitionByEntityStrategy* mutable_by_entity(); - void set_allocated_by_entity(::gie::PropertyPartitionByEntityStrategy* by_entity); - private: - const ::gie::PropertyPartitionByEntityStrategy& _internal_by_entity() const; - ::gie::PropertyPartitionByEntityStrategy* _internal_mutable_by_entity(); - public: - void unsafe_arena_set_allocated_by_entity( - ::gie::PropertyPartitionByEntityStrategy* by_entity); - ::gie::PropertyPartitionByEntityStrategy* unsafe_arena_release_by_entity(); - - // .gie.PropertyPartitionByTypeStrategy by_type = 2; - bool has_by_type() const; - private: - bool _internal_has_by_type() const; - public: - void clear_by_type(); - const ::gie::PropertyPartitionByTypeStrategy& by_type() const; - ::gie::PropertyPartitionByTypeStrategy* release_by_type(); - ::gie::PropertyPartitionByTypeStrategy* mutable_by_type(); - void set_allocated_by_type(::gie::PropertyPartitionByTypeStrategy* by_type); - private: - const ::gie::PropertyPartitionByTypeStrategy& _internal_by_type() const; - ::gie::PropertyPartitionByTypeStrategy* _internal_mutable_by_type(); - public: - void unsafe_arena_set_allocated_by_type( - ::gie::PropertyPartitionByTypeStrategy* by_type); - ::gie::PropertyPartitionByTypeStrategy* unsafe_arena_release_by_type(); - - void clear_item(); - ItemCase item_case() const; - // @@protoc_insertion_point(class_scope:gie.GraphPropertyPartitionStrategy) - private: - class _Internal; - void set_has_by_entity(); - void set_has_by_type(); - - inline bool has_item() const; - inline void clear_has_item(); - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - union ItemUnion { - ItemUnion() {} - ::gie::PropertyPartitionByEntityStrategy* by_entity_; - ::gie::PropertyPartitionByTypeStrategy* by_type_; - } item_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; - - friend struct ::TableStruct_gie_5fschema_2eproto; -}; -// ------------------------------------------------------------------- - -class GraphPartitionStrategy PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.GraphPartitionStrategy) */ { - public: - inline GraphPartitionStrategy() : GraphPartitionStrategy(nullptr) {}; - virtual ~GraphPartitionStrategy(); - - GraphPartitionStrategy(const GraphPartitionStrategy& from); - GraphPartitionStrategy(GraphPartitionStrategy&& from) noexcept - : GraphPartitionStrategy() { - *this = ::std::move(from); - } - - inline GraphPartitionStrategy& operator=(const GraphPartitionStrategy& from) { - CopyFrom(from); - return *this; - } - inline GraphPartitionStrategy& operator=(GraphPartitionStrategy&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const GraphPartitionStrategy& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const GraphPartitionStrategy* internal_default_instance() { - return reinterpret_cast( - &_GraphPartitionStrategy_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(GraphPartitionStrategy& a, GraphPartitionStrategy& b) { - a.Swap(&b); - } - inline void Swap(GraphPartitionStrategy* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(GraphPartitionStrategy* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline GraphPartitionStrategy* New() const final { - return CreateMaybeMessage(nullptr); - } - - GraphPartitionStrategy* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const GraphPartitionStrategy& from); - void MergeFrom(const GraphPartitionStrategy& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(GraphPartitionStrategy* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "gie.GraphPartitionStrategy"; - } - protected: - explicit GraphPartitionStrategy(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); - return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPropertyFieldNumber = 2, - kTopologyFieldNumber = 1, - }; - // .gie.GraphPropertyPartitionStrategy property = 2; - bool has_property() const; - private: - bool _internal_has_property() const; - public: - void clear_property(); - const ::gie::GraphPropertyPartitionStrategy& property() const; - ::gie::GraphPropertyPartitionStrategy* release_property(); - ::gie::GraphPropertyPartitionStrategy* mutable_property(); - void set_allocated_property(::gie::GraphPropertyPartitionStrategy* property); - private: - const ::gie::GraphPropertyPartitionStrategy& _internal_property() const; - ::gie::GraphPropertyPartitionStrategy* _internal_mutable_property(); - public: - void unsafe_arena_set_allocated_property( - ::gie::GraphPropertyPartitionStrategy* property); - ::gie::GraphPropertyPartitionStrategy* unsafe_arena_release_property(); - - // .gie.GraphTopologyPartitionStrategy topology = 1; - void clear_topology(); - ::gie::GraphTopologyPartitionStrategy topology() const; - void set_topology(::gie::GraphTopologyPartitionStrategy value); - private: - ::gie::GraphTopologyPartitionStrategy _internal_topology() const; - void _internal_set_topology(::gie::GraphTopologyPartitionStrategy value); - public: - - // @@protoc_insertion_point(class_scope:gie.GraphPartitionStrategy) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::gie::GraphPropertyPartitionStrategy* property_; - int topology_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_gie_5fschema_2eproto; -}; -// ------------------------------------------------------------------- - -class SrcDstPair PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.SrcDstPair) */ { - public: - inline SrcDstPair() : SrcDstPair(nullptr) {}; - virtual ~SrcDstPair(); - - SrcDstPair(const SrcDstPair& from); - SrcDstPair(SrcDstPair&& from) noexcept - : SrcDstPair() { - *this = ::std::move(from); - } - - inline SrcDstPair& operator=(const SrcDstPair& from) { - CopyFrom(from); - return *this; - } - inline SrcDstPair& operator=(SrcDstPair&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const SrcDstPair& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const SrcDstPair* internal_default_instance() { - return reinterpret_cast( - &_SrcDstPair_default_instance_); - } - static constexpr int kIndexInFileMessages = - 4; - - friend void swap(SrcDstPair& a, SrcDstPair& b) { - a.Swap(&b); - } - inline void Swap(SrcDstPair* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(SrcDstPair* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline SrcDstPair* New() const final { - return CreateMaybeMessage(nullptr); - } - - SrcDstPair* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const SrcDstPair& from); - void MergeFrom(const SrcDstPair& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(SrcDstPair* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "gie.SrcDstPair"; - } - protected: - explicit SrcDstPair(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); - return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kSrcTypeFieldNumber = 1, - kDstTypeFieldNumber = 2, - kPartitionStrategyFieldNumber = 3, - kPropertyPartitionStrategyFieldNumber = 4, - kRelationFieldNumber = 5, - }; - // string src_type = 1; - void clear_src_type(); - const std::string& src_type() const; - void set_src_type(const std::string& value); - void set_src_type(std::string&& value); - void set_src_type(const char* value); - void set_src_type(const char* value, size_t size); - std::string* mutable_src_type(); - std::string* release_src_type(); - void set_allocated_src_type(std::string* src_type); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_src_type(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_src_type( - std::string* src_type); - private: - const std::string& _internal_src_type() const; - void _internal_set_src_type(const std::string& value); - std::string* _internal_mutable_src_type(); - public: - - // string dst_type = 2; - void clear_dst_type(); - const std::string& dst_type() const; - void set_dst_type(const std::string& value); - void set_dst_type(std::string&& value); - void set_dst_type(const char* value); - void set_dst_type(const char* value, size_t size); - std::string* mutable_dst_type(); - std::string* release_dst_type(); - void set_allocated_dst_type(std::string* dst_type); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_dst_type(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_dst_type( - std::string* dst_type); - private: - const std::string& _internal_dst_type() const; - void _internal_set_dst_type(const std::string& value); - std::string* _internal_mutable_dst_type(); - public: - - // .gie.EdgePartitionStrategy partition_strategy = 3; - void clear_partition_strategy(); - ::gie::EdgePartitionStrategy partition_strategy() const; - void set_partition_strategy(::gie::EdgePartitionStrategy value); - private: - ::gie::EdgePartitionStrategy _internal_partition_strategy() const; - void _internal_set_partition_strategy(::gie::EdgePartitionStrategy value); - public: - - // .gie.PropertyPartitionStrategy property_partition_strategy = 4; - void clear_property_partition_strategy(); - ::gie::PropertyPartitionStrategy property_partition_strategy() const; - void set_property_partition_strategy(::gie::PropertyPartitionStrategy value); - private: - ::gie::PropertyPartitionStrategy _internal_property_partition_strategy() const; - void _internal_set_property_partition_strategy(::gie::PropertyPartitionStrategy value); - public: - - // .gie.Relation relation = 5; - void clear_relation(); - ::gie::Relation relation() const; - void set_relation(::gie::Relation value); - private: - ::gie::Relation _internal_relation() const; - void _internal_set_relation(::gie::Relation value); - public: - - // @@protoc_insertion_point(class_scope:gie.SrcDstPair) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr src_type_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr dst_type_; - int partition_strategy_; - int property_partition_strategy_; - int relation_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_gie_5fschema_2eproto; -}; -// ------------------------------------------------------------------- - -class Property PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.Property) */ { - public: - inline Property() : Property(nullptr) {}; - virtual ~Property(); - - Property(const Property& from); - Property(Property&& from) noexcept - : Property() { - *this = ::std::move(from); - } - - inline Property& operator=(const Property& from) { - CopyFrom(from); - return *this; - } - inline Property& operator=(Property&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Property& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Property* internal_default_instance() { - return reinterpret_cast( - &_Property_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(Property& a, Property& b) { - a.Swap(&b); - } - inline void Swap(Property* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Property* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Property* New() const final { - return CreateMaybeMessage(nullptr); - } - - Property* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Property& from); - void MergeFrom(const Property& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Property* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "gie.Property"; - } - protected: - explicit Property(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); - return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kNameFieldNumber = 2, - kIdFieldNumber = 1, - kTypeFieldNumber = 3, - }; - // string name = 2; - void clear_name(); - const std::string& name() const; - void set_name(const std::string& value); - void set_name(std::string&& value); - void set_name(const char* value); - void set_name(const char* value, size_t size); - std::string* mutable_name(); - std::string* release_name(); - void set_allocated_name(std::string* name); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_name(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_name( - std::string* name); - private: - const std::string& _internal_name() const; - void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // uint32 id = 1; - void clear_id(); - ::PROTOBUF_NAMESPACE_ID::uint32 id() const; - void set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); - private: - ::PROTOBUF_NAMESPACE_ID::uint32 _internal_id() const; - void _internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); - public: - - // .gie.DataType type = 3; - void clear_type(); - ::gie::DataType type() const; - void set_type(::gie::DataType value); - private: - ::gie::DataType _internal_type() const; - void _internal_set_type(::gie::DataType value); - public: - - // @@protoc_insertion_point(class_scope:gie.Property) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::uint32 id_; - int type_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_gie_5fschema_2eproto; -}; -// ------------------------------------------------------------------- - -class VertexType PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.VertexType) */ { - public: - inline VertexType() : VertexType(nullptr) {}; - virtual ~VertexType(); - - VertexType(const VertexType& from); - VertexType(VertexType&& from) noexcept - : VertexType() { - *this = ::std::move(from); - } - - inline VertexType& operator=(const VertexType& from) { - CopyFrom(from); - return *this; - } - inline VertexType& operator=(VertexType&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const VertexType& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const VertexType* internal_default_instance() { - return reinterpret_cast( - &_VertexType_default_instance_); - } - static constexpr int kIndexInFileMessages = - 6; - - friend void swap(VertexType& a, VertexType& b) { - a.Swap(&b); - } - inline void Swap(VertexType* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(VertexType* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline VertexType* New() const final { - return CreateMaybeMessage(nullptr); - } - - VertexType* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const VertexType& from); - void MergeFrom(const VertexType& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(VertexType* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "gie.VertexType"; - } - protected: - explicit VertexType(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); - return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPropertiesFieldNumber = 3, - kPrimaryKeysFieldNumber = 4, - kNameFieldNumber = 2, - kIdFieldNumber = 1, - kPartitionStrategyFieldNumber = 5, - kTotalNumFieldNumber = 7, - kPropertyPartitionStrategyFieldNumber = 6, - }; - // repeated .gie.Property properties = 3; - int properties_size() const; - private: - int _internal_properties_size() const; - public: - void clear_properties(); - ::gie::Property* mutable_properties(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >* - mutable_properties(); - private: - const ::gie::Property& _internal_properties(int index) const; - ::gie::Property* _internal_add_properties(); - public: - const ::gie::Property& properties(int index) const; - ::gie::Property* add_properties(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >& - properties() const; - - // repeated string primary_keys = 4; - int primary_keys_size() const; - private: - int _internal_primary_keys_size() const; - public: - void clear_primary_keys(); - const std::string& primary_keys(int index) const; - std::string* mutable_primary_keys(int index); - void set_primary_keys(int index, const std::string& value); - void set_primary_keys(int index, std::string&& value); - void set_primary_keys(int index, const char* value); - void set_primary_keys(int index, const char* value, size_t size); - std::string* add_primary_keys(); - void add_primary_keys(const std::string& value); - void add_primary_keys(std::string&& value); - void add_primary_keys(const char* value); - void add_primary_keys(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& primary_keys() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_primary_keys(); - private: - const std::string& _internal_primary_keys(int index) const; - std::string* _internal_add_primary_keys(); - public: - - // string name = 2; - void clear_name(); - const std::string& name() const; - void set_name(const std::string& value); - void set_name(std::string&& value); - void set_name(const char* value); - void set_name(const char* value, size_t size); - std::string* mutable_name(); - std::string* release_name(); - void set_allocated_name(std::string* name); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_name(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_name( - std::string* name); - private: - const std::string& _internal_name() const; - void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // uint32 id = 1; - void clear_id(); - ::PROTOBUF_NAMESPACE_ID::uint32 id() const; - void set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); - private: - ::PROTOBUF_NAMESPACE_ID::uint32 _internal_id() const; - void _internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); - public: - - // .gie.VertexPartitionStrategy partition_strategy = 5; - void clear_partition_strategy(); - ::gie::VertexPartitionStrategy partition_strategy() const; - void set_partition_strategy(::gie::VertexPartitionStrategy value); - private: - ::gie::VertexPartitionStrategy _internal_partition_strategy() const; - void _internal_set_partition_strategy(::gie::VertexPartitionStrategy value); - public: - - // int64 total_num = 7; - void clear_total_num(); - ::PROTOBUF_NAMESPACE_ID::int64 total_num() const; - void set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value); - private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_total_num() const; - void _internal_set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value); - public: - - // .gie.PropertyPartitionStrategy property_partition_strategy = 6; - void clear_property_partition_strategy(); - ::gie::PropertyPartitionStrategy property_partition_strategy() const; - void set_property_partition_strategy(::gie::PropertyPartitionStrategy value); - private: - ::gie::PropertyPartitionStrategy _internal_property_partition_strategy() const; - void _internal_set_property_partition_strategy(::gie::PropertyPartitionStrategy value); - public: - - // @@protoc_insertion_point(class_scope:gie.VertexType) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property > properties_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField primary_keys_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::uint32 id_; - int partition_strategy_; - ::PROTOBUF_NAMESPACE_ID::int64 total_num_; - int property_partition_strategy_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_gie_5fschema_2eproto; -}; -// ------------------------------------------------------------------- - -class EdgeType PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.EdgeType) */ { - public: - inline EdgeType() : EdgeType(nullptr) {}; - virtual ~EdgeType(); - - EdgeType(const EdgeType& from); - EdgeType(EdgeType&& from) noexcept - : EdgeType() { - *this = ::std::move(from); - } - - inline EdgeType& operator=(const EdgeType& from) { - CopyFrom(from); - return *this; - } - inline EdgeType& operator=(EdgeType&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const EdgeType& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const EdgeType* internal_default_instance() { - return reinterpret_cast( - &_EdgeType_default_instance_); - } - static constexpr int kIndexInFileMessages = - 7; - - friend void swap(EdgeType& a, EdgeType& b) { - a.Swap(&b); - } - inline void Swap(EdgeType* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(EdgeType* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline EdgeType* New() const final { - return CreateMaybeMessage(nullptr); - } - - EdgeType* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const EdgeType& from); - void MergeFrom(const EdgeType& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(EdgeType* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "gie.EdgeType"; - } - protected: - explicit EdgeType(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); - return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kPropertiesFieldNumber = 3, - kPrimaryKeysFieldNumber = 4, - kSrcDstPairsFieldNumber = 5, - kNameFieldNumber = 2, - kTotalNumFieldNumber = 6, - kIdFieldNumber = 1, - }; - // repeated .gie.Property properties = 3; - int properties_size() const; - private: - int _internal_properties_size() const; - public: - void clear_properties(); - ::gie::Property* mutable_properties(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >* - mutable_properties(); - private: - const ::gie::Property& _internal_properties(int index) const; - ::gie::Property* _internal_add_properties(); - public: - const ::gie::Property& properties(int index) const; - ::gie::Property* add_properties(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >& - properties() const; - - // repeated string primary_keys = 4; - int primary_keys_size() const; - private: - int _internal_primary_keys_size() const; - public: - void clear_primary_keys(); - const std::string& primary_keys(int index) const; - std::string* mutable_primary_keys(int index); - void set_primary_keys(int index, const std::string& value); - void set_primary_keys(int index, std::string&& value); - void set_primary_keys(int index, const char* value); - void set_primary_keys(int index, const char* value, size_t size); - std::string* add_primary_keys(); - void add_primary_keys(const std::string& value); - void add_primary_keys(std::string&& value); - void add_primary_keys(const char* value); - void add_primary_keys(const char* value, size_t size); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& primary_keys() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* mutable_primary_keys(); - private: - const std::string& _internal_primary_keys(int index) const; - std::string* _internal_add_primary_keys(); - public: - - // repeated .gie.SrcDstPair src_dst_pairs = 5; - int src_dst_pairs_size() const; - private: - int _internal_src_dst_pairs_size() const; - public: - void clear_src_dst_pairs(); - ::gie::SrcDstPair* mutable_src_dst_pairs(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair >* - mutable_src_dst_pairs(); - private: - const ::gie::SrcDstPair& _internal_src_dst_pairs(int index) const; - ::gie::SrcDstPair* _internal_add_src_dst_pairs(); - public: - const ::gie::SrcDstPair& src_dst_pairs(int index) const; - ::gie::SrcDstPair* add_src_dst_pairs(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair >& - src_dst_pairs() const; - - // string name = 2; - void clear_name(); - const std::string& name() const; - void set_name(const std::string& value); - void set_name(std::string&& value); - void set_name(const char* value); - void set_name(const char* value, size_t size); - std::string* mutable_name(); - std::string* release_name(); - void set_allocated_name(std::string* name); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_name(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_name( - std::string* name); - private: - const std::string& _internal_name() const; - void _internal_set_name(const std::string& value); - std::string* _internal_mutable_name(); - public: - - // int64 total_num = 6; - void clear_total_num(); - ::PROTOBUF_NAMESPACE_ID::int64 total_num() const; - void set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value); - private: - ::PROTOBUF_NAMESPACE_ID::int64 _internal_total_num() const; - void _internal_set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value); - public: - - // uint32 id = 1; - void clear_id(); - ::PROTOBUF_NAMESPACE_ID::uint32 id() const; - void set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); - private: - ::PROTOBUF_NAMESPACE_ID::uint32 _internal_id() const; - void _internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value); - public: - - // @@protoc_insertion_point(class_scope:gie.EdgeType) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property > properties_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField primary_keys_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair > src_dst_pairs_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; - ::PROTOBUF_NAMESPACE_ID::int64 total_num_; - ::PROTOBUF_NAMESPACE_ID::uint32 id_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_gie_5fschema_2eproto; -}; -// ------------------------------------------------------------------- - -class Statistics PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.Statistics) */ { - public: - inline Statistics() : Statistics(nullptr) {}; - virtual ~Statistics(); - - Statistics(const Statistics& from); - Statistics(Statistics&& from) noexcept - : Statistics() { - *this = ::std::move(from); - } - - inline Statistics& operator=(const Statistics& from) { - CopyFrom(from); - return *this; - } - inline Statistics& operator=(Statistics&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Statistics& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Statistics* internal_default_instance() { - return reinterpret_cast( - &_Statistics_default_instance_); - } - static constexpr int kIndexInFileMessages = - 8; - - friend void swap(Statistics& a, Statistics& b) { - a.Swap(&b); - } - inline void Swap(Statistics* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Statistics* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Statistics* New() const final { - return CreateMaybeMessage(nullptr); - } - - Statistics* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Statistics& from); - void MergeFrom(const Statistics& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Statistics* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "gie.Statistics"; - } - protected: - explicit Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); - return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kNumVerticesFieldNumber = 2, - kNumEdgesFieldNumber = 3, - kNumPartitionsFieldNumber = 1, - }; - // uint64 num_vertices = 2; - void clear_num_vertices(); - ::PROTOBUF_NAMESPACE_ID::uint64 num_vertices() const; - void set_num_vertices(::PROTOBUF_NAMESPACE_ID::uint64 value); - private: - ::PROTOBUF_NAMESPACE_ID::uint64 _internal_num_vertices() const; - void _internal_set_num_vertices(::PROTOBUF_NAMESPACE_ID::uint64 value); - public: - - // uint64 num_edges = 3; - void clear_num_edges(); - ::PROTOBUF_NAMESPACE_ID::uint64 num_edges() const; - void set_num_edges(::PROTOBUF_NAMESPACE_ID::uint64 value); - private: - ::PROTOBUF_NAMESPACE_ID::uint64 _internal_num_edges() const; - void _internal_set_num_edges(::PROTOBUF_NAMESPACE_ID::uint64 value); - public: - - // uint32 num_partitions = 1; - void clear_num_partitions(); - ::PROTOBUF_NAMESPACE_ID::uint32 num_partitions() const; - void set_num_partitions(::PROTOBUF_NAMESPACE_ID::uint32 value); - private: - ::PROTOBUF_NAMESPACE_ID::uint32 _internal_num_partitions() const; - void _internal_set_num_partitions(::PROTOBUF_NAMESPACE_ID::uint32 value); - public: - - // @@protoc_insertion_point(class_scope:gie.Statistics) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::uint64 num_vertices_; - ::PROTOBUF_NAMESPACE_ID::uint64 num_edges_; - ::PROTOBUF_NAMESPACE_ID::uint32 num_partitions_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_gie_5fschema_2eproto; -}; -// ------------------------------------------------------------------- - -class Schema PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:gie.Schema) */ { - public: - inline Schema() : Schema(nullptr) {}; - virtual ~Schema(); - - Schema(const Schema& from); - Schema(Schema&& from) noexcept - : Schema() { - *this = ::std::move(from); - } - - inline Schema& operator=(const Schema& from) { - CopyFrom(from); - return *this; - } - inline Schema& operator=(Schema&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Schema& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Schema* internal_default_instance() { - return reinterpret_cast( - &_Schema_default_instance_); - } - static constexpr int kIndexInFileMessages = - 9; - - friend void swap(Schema& a, Schema& b) { - a.Swap(&b); - } - inline void Swap(Schema* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Schema* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Schema* New() const final { - return CreateMaybeMessage(nullptr); - } - - Schema* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Schema& from); - void MergeFrom(const Schema& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Schema* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "gie.Schema"; - } - protected: - explicit Schema(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_gie_5fschema_2eproto); - return ::descriptor_table_gie_5fschema_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kVertexTypesFieldNumber = 2, - kEdgeTypesFieldNumber = 3, - kPartitionStrategyFieldNumber = 1, - kStatisticsFieldNumber = 4, - }; - // repeated .gie.VertexType vertex_types = 2; - int vertex_types_size() const; - private: - int _internal_vertex_types_size() const; - public: - void clear_vertex_types(); - ::gie::VertexType* mutable_vertex_types(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType >* - mutable_vertex_types(); - private: - const ::gie::VertexType& _internal_vertex_types(int index) const; - ::gie::VertexType* _internal_add_vertex_types(); - public: - const ::gie::VertexType& vertex_types(int index) const; - ::gie::VertexType* add_vertex_types(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType >& - vertex_types() const; - - // repeated .gie.EdgeType edge_types = 3; - int edge_types_size() const; - private: - int _internal_edge_types_size() const; - public: - void clear_edge_types(); - ::gie::EdgeType* mutable_edge_types(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType >* - mutable_edge_types(); - private: - const ::gie::EdgeType& _internal_edge_types(int index) const; - ::gie::EdgeType* _internal_add_edge_types(); - public: - const ::gie::EdgeType& edge_types(int index) const; - ::gie::EdgeType* add_edge_types(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType >& - edge_types() const; - - // .gie.GraphPartitionStrategy partition_strategy = 1; - bool has_partition_strategy() const; - private: - bool _internal_has_partition_strategy() const; - public: - void clear_partition_strategy(); - const ::gie::GraphPartitionStrategy& partition_strategy() const; - ::gie::GraphPartitionStrategy* release_partition_strategy(); - ::gie::GraphPartitionStrategy* mutable_partition_strategy(); - void set_allocated_partition_strategy(::gie::GraphPartitionStrategy* partition_strategy); - private: - const ::gie::GraphPartitionStrategy& _internal_partition_strategy() const; - ::gie::GraphPartitionStrategy* _internal_mutable_partition_strategy(); - public: - void unsafe_arena_set_allocated_partition_strategy( - ::gie::GraphPartitionStrategy* partition_strategy); - ::gie::GraphPartitionStrategy* unsafe_arena_release_partition_strategy(); - - // .gie.Statistics statistics = 4; - bool has_statistics() const; - private: - bool _internal_has_statistics() const; - public: - void clear_statistics(); - const ::gie::Statistics& statistics() const; - ::gie::Statistics* release_statistics(); - ::gie::Statistics* mutable_statistics(); - void set_allocated_statistics(::gie::Statistics* statistics); - private: - const ::gie::Statistics& _internal_statistics() const; - ::gie::Statistics* _internal_mutable_statistics(); - public: - void unsafe_arena_set_allocated_statistics( - ::gie::Statistics* statistics); - ::gie::Statistics* unsafe_arena_release_statistics(); - - // @@protoc_insertion_point(class_scope:gie.Schema) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType > vertex_types_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType > edge_types_; - ::gie::GraphPartitionStrategy* partition_strategy_; - ::gie::Statistics* statistics_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_gie_5fschema_2eproto; -}; -// =================================================================== - - -// =================================================================== - -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// PropertyPartitionByEntityStrategy - -// .gie.PropertyPartitionStrategy vertex_property_partition_strategy = 1; -inline void PropertyPartitionByEntityStrategy::clear_vertex_property_partition_strategy() { - vertex_property_partition_strategy_ = 0; -} -inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::_internal_vertex_property_partition_strategy() const { - return static_cast< ::gie::PropertyPartitionStrategy >(vertex_property_partition_strategy_); -} -inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::vertex_property_partition_strategy() const { - // @@protoc_insertion_point(field_get:gie.PropertyPartitionByEntityStrategy.vertex_property_partition_strategy) - return _internal_vertex_property_partition_strategy(); -} -inline void PropertyPartitionByEntityStrategy::_internal_set_vertex_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - - vertex_property_partition_strategy_ = value; -} -inline void PropertyPartitionByEntityStrategy::set_vertex_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - _internal_set_vertex_property_partition_strategy(value); - // @@protoc_insertion_point(field_set:gie.PropertyPartitionByEntityStrategy.vertex_property_partition_strategy) -} - -// .gie.PropertyPartitionStrategy edge_property_partition_strategy = 2; -inline void PropertyPartitionByEntityStrategy::clear_edge_property_partition_strategy() { - edge_property_partition_strategy_ = 0; -} -inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::_internal_edge_property_partition_strategy() const { - return static_cast< ::gie::PropertyPartitionStrategy >(edge_property_partition_strategy_); -} -inline ::gie::PropertyPartitionStrategy PropertyPartitionByEntityStrategy::edge_property_partition_strategy() const { - // @@protoc_insertion_point(field_get:gie.PropertyPartitionByEntityStrategy.edge_property_partition_strategy) - return _internal_edge_property_partition_strategy(); -} -inline void PropertyPartitionByEntityStrategy::_internal_set_edge_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - - edge_property_partition_strategy_ = value; -} -inline void PropertyPartitionByEntityStrategy::set_edge_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - _internal_set_edge_property_partition_strategy(value); - // @@protoc_insertion_point(field_set:gie.PropertyPartitionByEntityStrategy.edge_property_partition_strategy) -} - -// ------------------------------------------------------------------- - -// PropertyPartitionByTypeStrategy - -// ------------------------------------------------------------------- - -// GraphPropertyPartitionStrategy - -// .gie.PropertyPartitionByEntityStrategy by_entity = 1; -inline bool GraphPropertyPartitionStrategy::_internal_has_by_entity() const { - return item_case() == kByEntity; -} -inline bool GraphPropertyPartitionStrategy::has_by_entity() const { - return _internal_has_by_entity(); -} -inline void GraphPropertyPartitionStrategy::set_has_by_entity() { - _oneof_case_[0] = kByEntity; -} -inline void GraphPropertyPartitionStrategy::clear_by_entity() { - if (_internal_has_by_entity()) { - if (GetArena() == nullptr) { - delete item_.by_entity_; - } - clear_has_item(); - } -} -inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy::release_by_entity() { - // @@protoc_insertion_point(field_release:gie.GraphPropertyPartitionStrategy.by_entity) - if (_internal_has_by_entity()) { - clear_has_item(); - ::gie::PropertyPartitionByEntityStrategy* temp = item_.by_entity_; - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - item_.by_entity_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::gie::PropertyPartitionByEntityStrategy& GraphPropertyPartitionStrategy::_internal_by_entity() const { - return _internal_has_by_entity() - ? *item_.by_entity_ - : *reinterpret_cast< ::gie::PropertyPartitionByEntityStrategy*>(&::gie::_PropertyPartitionByEntityStrategy_default_instance_); -} -inline const ::gie::PropertyPartitionByEntityStrategy& GraphPropertyPartitionStrategy::by_entity() const { - // @@protoc_insertion_point(field_get:gie.GraphPropertyPartitionStrategy.by_entity) - return _internal_by_entity(); -} -inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy::unsafe_arena_release_by_entity() { - // @@protoc_insertion_point(field_unsafe_arena_release:gie.GraphPropertyPartitionStrategy.by_entity) - if (_internal_has_by_entity()) { - clear_has_item(); - ::gie::PropertyPartitionByEntityStrategy* temp = item_.by_entity_; - item_.by_entity_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void GraphPropertyPartitionStrategy::unsafe_arena_set_allocated_by_entity(::gie::PropertyPartitionByEntityStrategy* by_entity) { - clear_item(); - if (by_entity) { - set_has_by_entity(); - item_.by_entity_ = by_entity; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.GraphPropertyPartitionStrategy.by_entity) -} -inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy::_internal_mutable_by_entity() { - if (!_internal_has_by_entity()) { - clear_item(); - set_has_by_entity(); - item_.by_entity_ = CreateMaybeMessage< ::gie::PropertyPartitionByEntityStrategy >(GetArena()); - } - return item_.by_entity_; -} -inline ::gie::PropertyPartitionByEntityStrategy* GraphPropertyPartitionStrategy::mutable_by_entity() { - // @@protoc_insertion_point(field_mutable:gie.GraphPropertyPartitionStrategy.by_entity) - return _internal_mutable_by_entity(); -} - -// .gie.PropertyPartitionByTypeStrategy by_type = 2; -inline bool GraphPropertyPartitionStrategy::_internal_has_by_type() const { - return item_case() == kByType; -} -inline bool GraphPropertyPartitionStrategy::has_by_type() const { - return _internal_has_by_type(); -} -inline void GraphPropertyPartitionStrategy::set_has_by_type() { - _oneof_case_[0] = kByType; -} -inline void GraphPropertyPartitionStrategy::clear_by_type() { - if (_internal_has_by_type()) { - if (GetArena() == nullptr) { - delete item_.by_type_; - } - clear_has_item(); - } -} -inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::release_by_type() { - // @@protoc_insertion_point(field_release:gie.GraphPropertyPartitionStrategy.by_type) - if (_internal_has_by_type()) { - clear_has_item(); - ::gie::PropertyPartitionByTypeStrategy* temp = item_.by_type_; - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - item_.by_type_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::gie::PropertyPartitionByTypeStrategy& GraphPropertyPartitionStrategy::_internal_by_type() const { - return _internal_has_by_type() - ? *item_.by_type_ - : *reinterpret_cast< ::gie::PropertyPartitionByTypeStrategy*>(&::gie::_PropertyPartitionByTypeStrategy_default_instance_); -} -inline const ::gie::PropertyPartitionByTypeStrategy& GraphPropertyPartitionStrategy::by_type() const { - // @@protoc_insertion_point(field_get:gie.GraphPropertyPartitionStrategy.by_type) - return _internal_by_type(); -} -inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::unsafe_arena_release_by_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:gie.GraphPropertyPartitionStrategy.by_type) - if (_internal_has_by_type()) { - clear_has_item(); - ::gie::PropertyPartitionByTypeStrategy* temp = item_.by_type_; - item_.by_type_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void GraphPropertyPartitionStrategy::unsafe_arena_set_allocated_by_type(::gie::PropertyPartitionByTypeStrategy* by_type) { - clear_item(); - if (by_type) { - set_has_by_type(); - item_.by_type_ = by_type; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.GraphPropertyPartitionStrategy.by_type) -} -inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::_internal_mutable_by_type() { - if (!_internal_has_by_type()) { - clear_item(); - set_has_by_type(); - item_.by_type_ = CreateMaybeMessage< ::gie::PropertyPartitionByTypeStrategy >(GetArena()); - } - return item_.by_type_; -} -inline ::gie::PropertyPartitionByTypeStrategy* GraphPropertyPartitionStrategy::mutable_by_type() { - // @@protoc_insertion_point(field_mutable:gie.GraphPropertyPartitionStrategy.by_type) - return _internal_mutable_by_type(); -} - -inline bool GraphPropertyPartitionStrategy::has_item() const { - return item_case() != ITEM_NOT_SET; -} -inline void GraphPropertyPartitionStrategy::clear_has_item() { - _oneof_case_[0] = ITEM_NOT_SET; -} -inline GraphPropertyPartitionStrategy::ItemCase GraphPropertyPartitionStrategy::item_case() const { - return GraphPropertyPartitionStrategy::ItemCase(_oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// GraphPartitionStrategy - -// .gie.GraphTopologyPartitionStrategy topology = 1; -inline void GraphPartitionStrategy::clear_topology() { - topology_ = 0; -} -inline ::gie::GraphTopologyPartitionStrategy GraphPartitionStrategy::_internal_topology() const { - return static_cast< ::gie::GraphTopologyPartitionStrategy >(topology_); -} -inline ::gie::GraphTopologyPartitionStrategy GraphPartitionStrategy::topology() const { - // @@protoc_insertion_point(field_get:gie.GraphPartitionStrategy.topology) - return _internal_topology(); -} -inline void GraphPartitionStrategy::_internal_set_topology(::gie::GraphTopologyPartitionStrategy value) { - - topology_ = value; -} -inline void GraphPartitionStrategy::set_topology(::gie::GraphTopologyPartitionStrategy value) { - _internal_set_topology(value); - // @@protoc_insertion_point(field_set:gie.GraphPartitionStrategy.topology) -} - -// .gie.GraphPropertyPartitionStrategy property = 2; -inline bool GraphPartitionStrategy::_internal_has_property() const { - return this != internal_default_instance() && property_ != nullptr; -} -inline bool GraphPartitionStrategy::has_property() const { - return _internal_has_property(); -} -inline void GraphPartitionStrategy::clear_property() { - if (GetArena() == nullptr && property_ != nullptr) { - delete property_; - } - property_ = nullptr; -} -inline const ::gie::GraphPropertyPartitionStrategy& GraphPartitionStrategy::_internal_property() const { - const ::gie::GraphPropertyPartitionStrategy* p = property_; - return p != nullptr ? *p : *reinterpret_cast( - &::gie::_GraphPropertyPartitionStrategy_default_instance_); -} -inline const ::gie::GraphPropertyPartitionStrategy& GraphPartitionStrategy::property() const { - // @@protoc_insertion_point(field_get:gie.GraphPartitionStrategy.property) - return _internal_property(); -} -inline void GraphPartitionStrategy::unsafe_arena_set_allocated_property( - ::gie::GraphPropertyPartitionStrategy* property) { - if (GetArena() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(property_); - } - property_ = property; - if (property) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.GraphPartitionStrategy.property) -} -inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::release_property() { - auto temp = unsafe_arena_release_property(); - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::unsafe_arena_release_property() { - // @@protoc_insertion_point(field_release:gie.GraphPartitionStrategy.property) - - ::gie::GraphPropertyPartitionStrategy* temp = property_; - property_ = nullptr; - return temp; -} -inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::_internal_mutable_property() { - - if (property_ == nullptr) { - auto* p = CreateMaybeMessage<::gie::GraphPropertyPartitionStrategy>(GetArena()); - property_ = p; - } - return property_; -} -inline ::gie::GraphPropertyPartitionStrategy* GraphPartitionStrategy::mutable_property() { - // @@protoc_insertion_point(field_mutable:gie.GraphPartitionStrategy.property) - return _internal_mutable_property(); -} -inline void GraphPartitionStrategy::set_allocated_property(::gie::GraphPropertyPartitionStrategy* property) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - if (message_arena == nullptr) { - delete property_; - } - if (property) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(property); - if (message_arena != submessage_arena) { - property = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, property, submessage_arena); - } - - } else { - - } - property_ = property; - // @@protoc_insertion_point(field_set_allocated:gie.GraphPartitionStrategy.property) -} - -// ------------------------------------------------------------------- - -// SrcDstPair - -// string src_type = 1; -inline void SrcDstPair::clear_src_type() { - src_type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline const std::string& SrcDstPair::src_type() const { - // @@protoc_insertion_point(field_get:gie.SrcDstPair.src_type) - return _internal_src_type(); -} -inline void SrcDstPair::set_src_type(const std::string& value) { - _internal_set_src_type(value); - // @@protoc_insertion_point(field_set:gie.SrcDstPair.src_type) -} -inline std::string* SrcDstPair::mutable_src_type() { - // @@protoc_insertion_point(field_mutable:gie.SrcDstPair.src_type) - return _internal_mutable_src_type(); -} -inline const std::string& SrcDstPair::_internal_src_type() const { - return src_type_.Get(); -} -inline void SrcDstPair::_internal_set_src_type(const std::string& value) { - - src_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); -} -inline void SrcDstPair::set_src_type(std::string&& value) { - - src_type_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:gie.SrcDstPair.src_type) -} -inline void SrcDstPair::set_src_type(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - src_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArena()); - // @@protoc_insertion_point(field_set_char:gie.SrcDstPair.src_type) -} -inline void SrcDstPair::set_src_type(const char* value, - size_t size) { - - src_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:gie.SrcDstPair.src_type) -} -inline std::string* SrcDstPair::_internal_mutable_src_type() { - - return src_type_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline std::string* SrcDstPair::release_src_type() { - // @@protoc_insertion_point(field_release:gie.SrcDstPair.src_type) - return src_type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline void SrcDstPair::set_allocated_src_type(std::string* src_type) { - if (src_type != nullptr) { - - } else { - - } - src_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), src_type, - GetArena()); - // @@protoc_insertion_point(field_set_allocated:gie.SrcDstPair.src_type) -} -inline std::string* SrcDstPair::unsafe_arena_release_src_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:gie.SrcDstPair.src_type) - GOOGLE_DCHECK(GetArena() != nullptr); - - return src_type_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArena()); -} -inline void SrcDstPair::unsafe_arena_set_allocated_src_type( - std::string* src_type) { - GOOGLE_DCHECK(GetArena() != nullptr); - if (src_type != nullptr) { - - } else { - - } - src_type_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - src_type, GetArena()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.SrcDstPair.src_type) -} - -// string dst_type = 2; -inline void SrcDstPair::clear_dst_type() { - dst_type_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline const std::string& SrcDstPair::dst_type() const { - // @@protoc_insertion_point(field_get:gie.SrcDstPair.dst_type) - return _internal_dst_type(); -} -inline void SrcDstPair::set_dst_type(const std::string& value) { - _internal_set_dst_type(value); - // @@protoc_insertion_point(field_set:gie.SrcDstPair.dst_type) -} -inline std::string* SrcDstPair::mutable_dst_type() { - // @@protoc_insertion_point(field_mutable:gie.SrcDstPair.dst_type) - return _internal_mutable_dst_type(); -} -inline const std::string& SrcDstPair::_internal_dst_type() const { - return dst_type_.Get(); -} -inline void SrcDstPair::_internal_set_dst_type(const std::string& value) { - - dst_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); -} -inline void SrcDstPair::set_dst_type(std::string&& value) { - - dst_type_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:gie.SrcDstPair.dst_type) -} -inline void SrcDstPair::set_dst_type(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - dst_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArena()); - // @@protoc_insertion_point(field_set_char:gie.SrcDstPair.dst_type) -} -inline void SrcDstPair::set_dst_type(const char* value, - size_t size) { - - dst_type_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:gie.SrcDstPair.dst_type) -} -inline std::string* SrcDstPair::_internal_mutable_dst_type() { - - return dst_type_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline std::string* SrcDstPair::release_dst_type() { - // @@protoc_insertion_point(field_release:gie.SrcDstPair.dst_type) - return dst_type_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline void SrcDstPair::set_allocated_dst_type(std::string* dst_type) { - if (dst_type != nullptr) { - - } else { - - } - dst_type_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), dst_type, - GetArena()); - // @@protoc_insertion_point(field_set_allocated:gie.SrcDstPair.dst_type) -} -inline std::string* SrcDstPair::unsafe_arena_release_dst_type() { - // @@protoc_insertion_point(field_unsafe_arena_release:gie.SrcDstPair.dst_type) - GOOGLE_DCHECK(GetArena() != nullptr); - - return dst_type_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArena()); -} -inline void SrcDstPair::unsafe_arena_set_allocated_dst_type( - std::string* dst_type) { - GOOGLE_DCHECK(GetArena() != nullptr); - if (dst_type != nullptr) { - - } else { - - } - dst_type_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - dst_type, GetArena()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.SrcDstPair.dst_type) -} - -// .gie.EdgePartitionStrategy partition_strategy = 3; -inline void SrcDstPair::clear_partition_strategy() { - partition_strategy_ = 0; -} -inline ::gie::EdgePartitionStrategy SrcDstPair::_internal_partition_strategy() const { - return static_cast< ::gie::EdgePartitionStrategy >(partition_strategy_); -} -inline ::gie::EdgePartitionStrategy SrcDstPair::partition_strategy() const { - // @@protoc_insertion_point(field_get:gie.SrcDstPair.partition_strategy) - return _internal_partition_strategy(); -} -inline void SrcDstPair::_internal_set_partition_strategy(::gie::EdgePartitionStrategy value) { - - partition_strategy_ = value; -} -inline void SrcDstPair::set_partition_strategy(::gie::EdgePartitionStrategy value) { - _internal_set_partition_strategy(value); - // @@protoc_insertion_point(field_set:gie.SrcDstPair.partition_strategy) -} - -// .gie.PropertyPartitionStrategy property_partition_strategy = 4; -inline void SrcDstPair::clear_property_partition_strategy() { - property_partition_strategy_ = 0; -} -inline ::gie::PropertyPartitionStrategy SrcDstPair::_internal_property_partition_strategy() const { - return static_cast< ::gie::PropertyPartitionStrategy >(property_partition_strategy_); -} -inline ::gie::PropertyPartitionStrategy SrcDstPair::property_partition_strategy() const { - // @@protoc_insertion_point(field_get:gie.SrcDstPair.property_partition_strategy) - return _internal_property_partition_strategy(); -} -inline void SrcDstPair::_internal_set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - - property_partition_strategy_ = value; -} -inline void SrcDstPair::set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - _internal_set_property_partition_strategy(value); - // @@protoc_insertion_point(field_set:gie.SrcDstPair.property_partition_strategy) -} - -// .gie.Relation relation = 5; -inline void SrcDstPair::clear_relation() { - relation_ = 0; -} -inline ::gie::Relation SrcDstPair::_internal_relation() const { - return static_cast< ::gie::Relation >(relation_); -} -inline ::gie::Relation SrcDstPair::relation() const { - // @@protoc_insertion_point(field_get:gie.SrcDstPair.relation) - return _internal_relation(); -} -inline void SrcDstPair::_internal_set_relation(::gie::Relation value) { - - relation_ = value; -} -inline void SrcDstPair::set_relation(::gie::Relation value) { - _internal_set_relation(value); - // @@protoc_insertion_point(field_set:gie.SrcDstPair.relation) -} - -// ------------------------------------------------------------------- - -// Property - -// uint32 id = 1; -inline void Property::clear_id() { - id_ = 0u; -} -inline ::PROTOBUF_NAMESPACE_ID::uint32 Property::_internal_id() const { - return id_; -} -inline ::PROTOBUF_NAMESPACE_ID::uint32 Property::id() const { - // @@protoc_insertion_point(field_get:gie.Property.id) - return _internal_id(); -} -inline void Property::_internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { - - id_ = value; -} -inline void Property::set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { - _internal_set_id(value); - // @@protoc_insertion_point(field_set:gie.Property.id) -} - -// string name = 2; -inline void Property::clear_name() { - name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline const std::string& Property::name() const { - // @@protoc_insertion_point(field_get:gie.Property.name) - return _internal_name(); -} -inline void Property::set_name(const std::string& value) { - _internal_set_name(value); - // @@protoc_insertion_point(field_set:gie.Property.name) -} -inline std::string* Property::mutable_name() { - // @@protoc_insertion_point(field_mutable:gie.Property.name) - return _internal_mutable_name(); -} -inline const std::string& Property::_internal_name() const { - return name_.Get(); -} -inline void Property::_internal_set_name(const std::string& value) { - - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); -} -inline void Property::set_name(std::string&& value) { - - name_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:gie.Property.name) -} -inline void Property::set_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArena()); - // @@protoc_insertion_point(field_set_char:gie.Property.name) -} -inline void Property::set_name(const char* value, - size_t size) { - - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:gie.Property.name) -} -inline std::string* Property::_internal_mutable_name() { - - return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline std::string* Property::release_name() { - // @@protoc_insertion_point(field_release:gie.Property.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline void Property::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArena()); - // @@protoc_insertion_point(field_set_allocated:gie.Property.name) -} -inline std::string* Property::unsafe_arena_release_name() { - // @@protoc_insertion_point(field_unsafe_arena_release:gie.Property.name) - GOOGLE_DCHECK(GetArena() != nullptr); - - return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArena()); -} -inline void Property::unsafe_arena_set_allocated_name( - std::string* name) { - GOOGLE_DCHECK(GetArena() != nullptr); - if (name != nullptr) { - - } else { - - } - name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - name, GetArena()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.Property.name) -} - -// .gie.DataType type = 3; -inline void Property::clear_type() { - type_ = 0; -} -inline ::gie::DataType Property::_internal_type() const { - return static_cast< ::gie::DataType >(type_); -} -inline ::gie::DataType Property::type() const { - // @@protoc_insertion_point(field_get:gie.Property.type) - return _internal_type(); -} -inline void Property::_internal_set_type(::gie::DataType value) { - - type_ = value; -} -inline void Property::set_type(::gie::DataType value) { - _internal_set_type(value); - // @@protoc_insertion_point(field_set:gie.Property.type) -} - -// ------------------------------------------------------------------- - -// VertexType - -// uint32 id = 1; -inline void VertexType::clear_id() { - id_ = 0u; -} -inline ::PROTOBUF_NAMESPACE_ID::uint32 VertexType::_internal_id() const { - return id_; -} -inline ::PROTOBUF_NAMESPACE_ID::uint32 VertexType::id() const { - // @@protoc_insertion_point(field_get:gie.VertexType.id) - return _internal_id(); -} -inline void VertexType::_internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { - - id_ = value; -} -inline void VertexType::set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { - _internal_set_id(value); - // @@protoc_insertion_point(field_set:gie.VertexType.id) -} - -// string name = 2; -inline void VertexType::clear_name() { - name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline const std::string& VertexType::name() const { - // @@protoc_insertion_point(field_get:gie.VertexType.name) - return _internal_name(); -} -inline void VertexType::set_name(const std::string& value) { - _internal_set_name(value); - // @@protoc_insertion_point(field_set:gie.VertexType.name) -} -inline std::string* VertexType::mutable_name() { - // @@protoc_insertion_point(field_mutable:gie.VertexType.name) - return _internal_mutable_name(); -} -inline const std::string& VertexType::_internal_name() const { - return name_.Get(); -} -inline void VertexType::_internal_set_name(const std::string& value) { - - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); -} -inline void VertexType::set_name(std::string&& value) { - - name_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:gie.VertexType.name) -} -inline void VertexType::set_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArena()); - // @@protoc_insertion_point(field_set_char:gie.VertexType.name) -} -inline void VertexType::set_name(const char* value, - size_t size) { - - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:gie.VertexType.name) -} -inline std::string* VertexType::_internal_mutable_name() { - - return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline std::string* VertexType::release_name() { - // @@protoc_insertion_point(field_release:gie.VertexType.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline void VertexType::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArena()); - // @@protoc_insertion_point(field_set_allocated:gie.VertexType.name) -} -inline std::string* VertexType::unsafe_arena_release_name() { - // @@protoc_insertion_point(field_unsafe_arena_release:gie.VertexType.name) - GOOGLE_DCHECK(GetArena() != nullptr); - - return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArena()); -} -inline void VertexType::unsafe_arena_set_allocated_name( - std::string* name) { - GOOGLE_DCHECK(GetArena() != nullptr); - if (name != nullptr) { - - } else { - - } - name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - name, GetArena()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.VertexType.name) -} - -// repeated .gie.Property properties = 3; -inline int VertexType::_internal_properties_size() const { - return properties_.size(); -} -inline int VertexType::properties_size() const { - return _internal_properties_size(); -} -inline void VertexType::clear_properties() { - properties_.Clear(); -} -inline ::gie::Property* VertexType::mutable_properties(int index) { - // @@protoc_insertion_point(field_mutable:gie.VertexType.properties) - return properties_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >* -VertexType::mutable_properties() { - // @@protoc_insertion_point(field_mutable_list:gie.VertexType.properties) - return &properties_; -} -inline const ::gie::Property& VertexType::_internal_properties(int index) const { - return properties_.Get(index); -} -inline const ::gie::Property& VertexType::properties(int index) const { - // @@protoc_insertion_point(field_get:gie.VertexType.properties) - return _internal_properties(index); -} -inline ::gie::Property* VertexType::_internal_add_properties() { - return properties_.Add(); -} -inline ::gie::Property* VertexType::add_properties() { - // @@protoc_insertion_point(field_add:gie.VertexType.properties) - return _internal_add_properties(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >& -VertexType::properties() const { - // @@protoc_insertion_point(field_list:gie.VertexType.properties) - return properties_; -} - -// repeated string primary_keys = 4; -inline int VertexType::_internal_primary_keys_size() const { - return primary_keys_.size(); -} -inline int VertexType::primary_keys_size() const { - return _internal_primary_keys_size(); -} -inline void VertexType::clear_primary_keys() { - primary_keys_.Clear(); -} -inline std::string* VertexType::add_primary_keys() { - // @@protoc_insertion_point(field_add_mutable:gie.VertexType.primary_keys) - return _internal_add_primary_keys(); -} -inline const std::string& VertexType::_internal_primary_keys(int index) const { - return primary_keys_.Get(index); -} -inline const std::string& VertexType::primary_keys(int index) const { - // @@protoc_insertion_point(field_get:gie.VertexType.primary_keys) - return _internal_primary_keys(index); -} -inline std::string* VertexType::mutable_primary_keys(int index) { - // @@protoc_insertion_point(field_mutable:gie.VertexType.primary_keys) - return primary_keys_.Mutable(index); -} -inline void VertexType::set_primary_keys(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:gie.VertexType.primary_keys) - primary_keys_.Mutable(index)->assign(value); -} -inline void VertexType::set_primary_keys(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:gie.VertexType.primary_keys) - primary_keys_.Mutable(index)->assign(std::move(value)); -} -inline void VertexType::set_primary_keys(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - primary_keys_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:gie.VertexType.primary_keys) -} -inline void VertexType::set_primary_keys(int index, const char* value, size_t size) { - primary_keys_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:gie.VertexType.primary_keys) -} -inline std::string* VertexType::_internal_add_primary_keys() { - return primary_keys_.Add(); -} -inline void VertexType::add_primary_keys(const std::string& value) { - primary_keys_.Add()->assign(value); - // @@protoc_insertion_point(field_add:gie.VertexType.primary_keys) -} -inline void VertexType::add_primary_keys(std::string&& value) { - primary_keys_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:gie.VertexType.primary_keys) -} -inline void VertexType::add_primary_keys(const char* value) { - GOOGLE_DCHECK(value != nullptr); - primary_keys_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:gie.VertexType.primary_keys) -} -inline void VertexType::add_primary_keys(const char* value, size_t size) { - primary_keys_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:gie.VertexType.primary_keys) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -VertexType::primary_keys() const { - // @@protoc_insertion_point(field_list:gie.VertexType.primary_keys) - return primary_keys_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -VertexType::mutable_primary_keys() { - // @@protoc_insertion_point(field_mutable_list:gie.VertexType.primary_keys) - return &primary_keys_; -} - -// .gie.VertexPartitionStrategy partition_strategy = 5; -inline void VertexType::clear_partition_strategy() { - partition_strategy_ = 0; -} -inline ::gie::VertexPartitionStrategy VertexType::_internal_partition_strategy() const { - return static_cast< ::gie::VertexPartitionStrategy >(partition_strategy_); -} -inline ::gie::VertexPartitionStrategy VertexType::partition_strategy() const { - // @@protoc_insertion_point(field_get:gie.VertexType.partition_strategy) - return _internal_partition_strategy(); -} -inline void VertexType::_internal_set_partition_strategy(::gie::VertexPartitionStrategy value) { - - partition_strategy_ = value; -} -inline void VertexType::set_partition_strategy(::gie::VertexPartitionStrategy value) { - _internal_set_partition_strategy(value); - // @@protoc_insertion_point(field_set:gie.VertexType.partition_strategy) -} - -// .gie.PropertyPartitionStrategy property_partition_strategy = 6; -inline void VertexType::clear_property_partition_strategy() { - property_partition_strategy_ = 0; -} -inline ::gie::PropertyPartitionStrategy VertexType::_internal_property_partition_strategy() const { - return static_cast< ::gie::PropertyPartitionStrategy >(property_partition_strategy_); -} -inline ::gie::PropertyPartitionStrategy VertexType::property_partition_strategy() const { - // @@protoc_insertion_point(field_get:gie.VertexType.property_partition_strategy) - return _internal_property_partition_strategy(); -} -inline void VertexType::_internal_set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - - property_partition_strategy_ = value; -} -inline void VertexType::set_property_partition_strategy(::gie::PropertyPartitionStrategy value) { - _internal_set_property_partition_strategy(value); - // @@protoc_insertion_point(field_set:gie.VertexType.property_partition_strategy) -} - -// int64 total_num = 7; -inline void VertexType::clear_total_num() { - total_num_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 VertexType::_internal_total_num() const { - return total_num_; -} -inline ::PROTOBUF_NAMESPACE_ID::int64 VertexType::total_num() const { - // @@protoc_insertion_point(field_get:gie.VertexType.total_num) - return _internal_total_num(); -} -inline void VertexType::_internal_set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value) { - - total_num_ = value; -} -inline void VertexType::set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value) { - _internal_set_total_num(value); - // @@protoc_insertion_point(field_set:gie.VertexType.total_num) -} - -// ------------------------------------------------------------------- - -// EdgeType - -// uint32 id = 1; -inline void EdgeType::clear_id() { - id_ = 0u; -} -inline ::PROTOBUF_NAMESPACE_ID::uint32 EdgeType::_internal_id() const { - return id_; -} -inline ::PROTOBUF_NAMESPACE_ID::uint32 EdgeType::id() const { - // @@protoc_insertion_point(field_get:gie.EdgeType.id) - return _internal_id(); -} -inline void EdgeType::_internal_set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { - - id_ = value; -} -inline void EdgeType::set_id(::PROTOBUF_NAMESPACE_ID::uint32 value) { - _internal_set_id(value); - // @@protoc_insertion_point(field_set:gie.EdgeType.id) -} - -// string name = 2; -inline void EdgeType::clear_name() { - name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline const std::string& EdgeType::name() const { - // @@protoc_insertion_point(field_get:gie.EdgeType.name) - return _internal_name(); -} -inline void EdgeType::set_name(const std::string& value) { - _internal_set_name(value); - // @@protoc_insertion_point(field_set:gie.EdgeType.name) -} -inline std::string* EdgeType::mutable_name() { - // @@protoc_insertion_point(field_mutable:gie.EdgeType.name) - return _internal_mutable_name(); -} -inline const std::string& EdgeType::_internal_name() const { - return name_.Get(); -} -inline void EdgeType::_internal_set_name(const std::string& value) { - - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); -} -inline void EdgeType::set_name(std::string&& value) { - - name_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:gie.EdgeType.name) -} -inline void EdgeType::set_name(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArena()); - // @@protoc_insertion_point(field_set_char:gie.EdgeType.name) -} -inline void EdgeType::set_name(const char* value, - size_t size) { - - name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:gie.EdgeType.name) -} -inline std::string* EdgeType::_internal_mutable_name() { - - return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline std::string* EdgeType::release_name() { - // @@protoc_insertion_point(field_release:gie.EdgeType.name) - return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline void EdgeType::set_allocated_name(std::string* name) { - if (name != nullptr) { - - } else { - - } - name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, - GetArena()); - // @@protoc_insertion_point(field_set_allocated:gie.EdgeType.name) -} -inline std::string* EdgeType::unsafe_arena_release_name() { - // @@protoc_insertion_point(field_unsafe_arena_release:gie.EdgeType.name) - GOOGLE_DCHECK(GetArena() != nullptr); - - return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArena()); -} -inline void EdgeType::unsafe_arena_set_allocated_name( - std::string* name) { - GOOGLE_DCHECK(GetArena() != nullptr); - if (name != nullptr) { - - } else { - - } - name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - name, GetArena()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.EdgeType.name) -} - -// repeated .gie.Property properties = 3; -inline int EdgeType::_internal_properties_size() const { - return properties_.size(); -} -inline int EdgeType::properties_size() const { - return _internal_properties_size(); -} -inline void EdgeType::clear_properties() { - properties_.Clear(); -} -inline ::gie::Property* EdgeType::mutable_properties(int index) { - // @@protoc_insertion_point(field_mutable:gie.EdgeType.properties) - return properties_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >* -EdgeType::mutable_properties() { - // @@protoc_insertion_point(field_mutable_list:gie.EdgeType.properties) - return &properties_; -} -inline const ::gie::Property& EdgeType::_internal_properties(int index) const { - return properties_.Get(index); -} -inline const ::gie::Property& EdgeType::properties(int index) const { - // @@protoc_insertion_point(field_get:gie.EdgeType.properties) - return _internal_properties(index); -} -inline ::gie::Property* EdgeType::_internal_add_properties() { - return properties_.Add(); -} -inline ::gie::Property* EdgeType::add_properties() { - // @@protoc_insertion_point(field_add:gie.EdgeType.properties) - return _internal_add_properties(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::Property >& -EdgeType::properties() const { - // @@protoc_insertion_point(field_list:gie.EdgeType.properties) - return properties_; -} - -// repeated string primary_keys = 4; -inline int EdgeType::_internal_primary_keys_size() const { - return primary_keys_.size(); -} -inline int EdgeType::primary_keys_size() const { - return _internal_primary_keys_size(); -} -inline void EdgeType::clear_primary_keys() { - primary_keys_.Clear(); -} -inline std::string* EdgeType::add_primary_keys() { - // @@protoc_insertion_point(field_add_mutable:gie.EdgeType.primary_keys) - return _internal_add_primary_keys(); -} -inline const std::string& EdgeType::_internal_primary_keys(int index) const { - return primary_keys_.Get(index); -} -inline const std::string& EdgeType::primary_keys(int index) const { - // @@protoc_insertion_point(field_get:gie.EdgeType.primary_keys) - return _internal_primary_keys(index); -} -inline std::string* EdgeType::mutable_primary_keys(int index) { - // @@protoc_insertion_point(field_mutable:gie.EdgeType.primary_keys) - return primary_keys_.Mutable(index); -} -inline void EdgeType::set_primary_keys(int index, const std::string& value) { - // @@protoc_insertion_point(field_set:gie.EdgeType.primary_keys) - primary_keys_.Mutable(index)->assign(value); -} -inline void EdgeType::set_primary_keys(int index, std::string&& value) { - // @@protoc_insertion_point(field_set:gie.EdgeType.primary_keys) - primary_keys_.Mutable(index)->assign(std::move(value)); -} -inline void EdgeType::set_primary_keys(int index, const char* value) { - GOOGLE_DCHECK(value != nullptr); - primary_keys_.Mutable(index)->assign(value); - // @@protoc_insertion_point(field_set_char:gie.EdgeType.primary_keys) -} -inline void EdgeType::set_primary_keys(int index, const char* value, size_t size) { - primary_keys_.Mutable(index)->assign( - reinterpret_cast(value), size); - // @@protoc_insertion_point(field_set_pointer:gie.EdgeType.primary_keys) -} -inline std::string* EdgeType::_internal_add_primary_keys() { - return primary_keys_.Add(); -} -inline void EdgeType::add_primary_keys(const std::string& value) { - primary_keys_.Add()->assign(value); - // @@protoc_insertion_point(field_add:gie.EdgeType.primary_keys) -} -inline void EdgeType::add_primary_keys(std::string&& value) { - primary_keys_.Add(std::move(value)); - // @@protoc_insertion_point(field_add:gie.EdgeType.primary_keys) -} -inline void EdgeType::add_primary_keys(const char* value) { - GOOGLE_DCHECK(value != nullptr); - primary_keys_.Add()->assign(value); - // @@protoc_insertion_point(field_add_char:gie.EdgeType.primary_keys) -} -inline void EdgeType::add_primary_keys(const char* value, size_t size) { - primary_keys_.Add()->assign(reinterpret_cast(value), size); - // @@protoc_insertion_point(field_add_pointer:gie.EdgeType.primary_keys) -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField& -EdgeType::primary_keys() const { - // @@protoc_insertion_point(field_list:gie.EdgeType.primary_keys) - return primary_keys_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField* -EdgeType::mutable_primary_keys() { - // @@protoc_insertion_point(field_mutable_list:gie.EdgeType.primary_keys) - return &primary_keys_; -} - -// repeated .gie.SrcDstPair src_dst_pairs = 5; -inline int EdgeType::_internal_src_dst_pairs_size() const { - return src_dst_pairs_.size(); -} -inline int EdgeType::src_dst_pairs_size() const { - return _internal_src_dst_pairs_size(); -} -inline void EdgeType::clear_src_dst_pairs() { - src_dst_pairs_.Clear(); -} -inline ::gie::SrcDstPair* EdgeType::mutable_src_dst_pairs(int index) { - // @@protoc_insertion_point(field_mutable:gie.EdgeType.src_dst_pairs) - return src_dst_pairs_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair >* -EdgeType::mutable_src_dst_pairs() { - // @@protoc_insertion_point(field_mutable_list:gie.EdgeType.src_dst_pairs) - return &src_dst_pairs_; -} -inline const ::gie::SrcDstPair& EdgeType::_internal_src_dst_pairs(int index) const { - return src_dst_pairs_.Get(index); -} -inline const ::gie::SrcDstPair& EdgeType::src_dst_pairs(int index) const { - // @@protoc_insertion_point(field_get:gie.EdgeType.src_dst_pairs) - return _internal_src_dst_pairs(index); -} -inline ::gie::SrcDstPair* EdgeType::_internal_add_src_dst_pairs() { - return src_dst_pairs_.Add(); -} -inline ::gie::SrcDstPair* EdgeType::add_src_dst_pairs() { - // @@protoc_insertion_point(field_add:gie.EdgeType.src_dst_pairs) - return _internal_add_src_dst_pairs(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::SrcDstPair >& -EdgeType::src_dst_pairs() const { - // @@protoc_insertion_point(field_list:gie.EdgeType.src_dst_pairs) - return src_dst_pairs_; -} - -// int64 total_num = 6; -inline void EdgeType::clear_total_num() { - total_num_ = PROTOBUF_LONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::int64 EdgeType::_internal_total_num() const { - return total_num_; -} -inline ::PROTOBUF_NAMESPACE_ID::int64 EdgeType::total_num() const { - // @@protoc_insertion_point(field_get:gie.EdgeType.total_num) - return _internal_total_num(); -} -inline void EdgeType::_internal_set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value) { - - total_num_ = value; -} -inline void EdgeType::set_total_num(::PROTOBUF_NAMESPACE_ID::int64 value) { - _internal_set_total_num(value); - // @@protoc_insertion_point(field_set:gie.EdgeType.total_num) -} - -// ------------------------------------------------------------------- - -// Statistics - -// uint32 num_partitions = 1; -inline void Statistics::clear_num_partitions() { - num_partitions_ = 0u; -} -inline ::PROTOBUF_NAMESPACE_ID::uint32 Statistics::_internal_num_partitions() const { - return num_partitions_; -} -inline ::PROTOBUF_NAMESPACE_ID::uint32 Statistics::num_partitions() const { - // @@protoc_insertion_point(field_get:gie.Statistics.num_partitions) - return _internal_num_partitions(); -} -inline void Statistics::_internal_set_num_partitions(::PROTOBUF_NAMESPACE_ID::uint32 value) { - - num_partitions_ = value; -} -inline void Statistics::set_num_partitions(::PROTOBUF_NAMESPACE_ID::uint32 value) { - _internal_set_num_partitions(value); - // @@protoc_insertion_point(field_set:gie.Statistics.num_partitions) -} - -// uint64 num_vertices = 2; -inline void Statistics::clear_num_vertices() { - num_vertices_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Statistics::_internal_num_vertices() const { - return num_vertices_; -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Statistics::num_vertices() const { - // @@protoc_insertion_point(field_get:gie.Statistics.num_vertices) - return _internal_num_vertices(); -} -inline void Statistics::_internal_set_num_vertices(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - num_vertices_ = value; -} -inline void Statistics::set_num_vertices(::PROTOBUF_NAMESPACE_ID::uint64 value) { - _internal_set_num_vertices(value); - // @@protoc_insertion_point(field_set:gie.Statistics.num_vertices) -} - -// uint64 num_edges = 3; -inline void Statistics::clear_num_edges() { - num_edges_ = PROTOBUF_ULONGLONG(0); -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Statistics::_internal_num_edges() const { - return num_edges_; -} -inline ::PROTOBUF_NAMESPACE_ID::uint64 Statistics::num_edges() const { - // @@protoc_insertion_point(field_get:gie.Statistics.num_edges) - return _internal_num_edges(); -} -inline void Statistics::_internal_set_num_edges(::PROTOBUF_NAMESPACE_ID::uint64 value) { - - num_edges_ = value; -} -inline void Statistics::set_num_edges(::PROTOBUF_NAMESPACE_ID::uint64 value) { - _internal_set_num_edges(value); - // @@protoc_insertion_point(field_set:gie.Statistics.num_edges) -} - -// ------------------------------------------------------------------- - -// Schema - -// .gie.GraphPartitionStrategy partition_strategy = 1; -inline bool Schema::_internal_has_partition_strategy() const { - return this != internal_default_instance() && partition_strategy_ != nullptr; -} -inline bool Schema::has_partition_strategy() const { - return _internal_has_partition_strategy(); -} -inline void Schema::clear_partition_strategy() { - if (GetArena() == nullptr && partition_strategy_ != nullptr) { - delete partition_strategy_; - } - partition_strategy_ = nullptr; -} -inline const ::gie::GraphPartitionStrategy& Schema::_internal_partition_strategy() const { - const ::gie::GraphPartitionStrategy* p = partition_strategy_; - return p != nullptr ? *p : *reinterpret_cast( - &::gie::_GraphPartitionStrategy_default_instance_); -} -inline const ::gie::GraphPartitionStrategy& Schema::partition_strategy() const { - // @@protoc_insertion_point(field_get:gie.Schema.partition_strategy) - return _internal_partition_strategy(); -} -inline void Schema::unsafe_arena_set_allocated_partition_strategy( - ::gie::GraphPartitionStrategy* partition_strategy) { - if (GetArena() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(partition_strategy_); - } - partition_strategy_ = partition_strategy; - if (partition_strategy) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.Schema.partition_strategy) -} -inline ::gie::GraphPartitionStrategy* Schema::release_partition_strategy() { - auto temp = unsafe_arena_release_partition_strategy(); - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::gie::GraphPartitionStrategy* Schema::unsafe_arena_release_partition_strategy() { - // @@protoc_insertion_point(field_release:gie.Schema.partition_strategy) - - ::gie::GraphPartitionStrategy* temp = partition_strategy_; - partition_strategy_ = nullptr; - return temp; -} -inline ::gie::GraphPartitionStrategy* Schema::_internal_mutable_partition_strategy() { - - if (partition_strategy_ == nullptr) { - auto* p = CreateMaybeMessage<::gie::GraphPartitionStrategy>(GetArena()); - partition_strategy_ = p; - } - return partition_strategy_; -} -inline ::gie::GraphPartitionStrategy* Schema::mutable_partition_strategy() { - // @@protoc_insertion_point(field_mutable:gie.Schema.partition_strategy) - return _internal_mutable_partition_strategy(); -} -inline void Schema::set_allocated_partition_strategy(::gie::GraphPartitionStrategy* partition_strategy) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - if (message_arena == nullptr) { - delete partition_strategy_; - } - if (partition_strategy) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(partition_strategy); - if (message_arena != submessage_arena) { - partition_strategy = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, partition_strategy, submessage_arena); - } - - } else { - - } - partition_strategy_ = partition_strategy; - // @@protoc_insertion_point(field_set_allocated:gie.Schema.partition_strategy) -} - -// repeated .gie.VertexType vertex_types = 2; -inline int Schema::_internal_vertex_types_size() const { - return vertex_types_.size(); -} -inline int Schema::vertex_types_size() const { - return _internal_vertex_types_size(); -} -inline void Schema::clear_vertex_types() { - vertex_types_.Clear(); -} -inline ::gie::VertexType* Schema::mutable_vertex_types(int index) { - // @@protoc_insertion_point(field_mutable:gie.Schema.vertex_types) - return vertex_types_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType >* -Schema::mutable_vertex_types() { - // @@protoc_insertion_point(field_mutable_list:gie.Schema.vertex_types) - return &vertex_types_; -} -inline const ::gie::VertexType& Schema::_internal_vertex_types(int index) const { - return vertex_types_.Get(index); -} -inline const ::gie::VertexType& Schema::vertex_types(int index) const { - // @@protoc_insertion_point(field_get:gie.Schema.vertex_types) - return _internal_vertex_types(index); -} -inline ::gie::VertexType* Schema::_internal_add_vertex_types() { - return vertex_types_.Add(); -} -inline ::gie::VertexType* Schema::add_vertex_types() { - // @@protoc_insertion_point(field_add:gie.Schema.vertex_types) - return _internal_add_vertex_types(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::VertexType >& -Schema::vertex_types() const { - // @@protoc_insertion_point(field_list:gie.Schema.vertex_types) - return vertex_types_; -} - -// repeated .gie.EdgeType edge_types = 3; -inline int Schema::_internal_edge_types_size() const { - return edge_types_.size(); -} -inline int Schema::edge_types_size() const { - return _internal_edge_types_size(); -} -inline void Schema::clear_edge_types() { - edge_types_.Clear(); -} -inline ::gie::EdgeType* Schema::mutable_edge_types(int index) { - // @@protoc_insertion_point(field_mutable:gie.Schema.edge_types) - return edge_types_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType >* -Schema::mutable_edge_types() { - // @@protoc_insertion_point(field_mutable_list:gie.Schema.edge_types) - return &edge_types_; -} -inline const ::gie::EdgeType& Schema::_internal_edge_types(int index) const { - return edge_types_.Get(index); -} -inline const ::gie::EdgeType& Schema::edge_types(int index) const { - // @@protoc_insertion_point(field_get:gie.Schema.edge_types) - return _internal_edge_types(index); -} -inline ::gie::EdgeType* Schema::_internal_add_edge_types() { - return edge_types_.Add(); -} -inline ::gie::EdgeType* Schema::add_edge_types() { - // @@protoc_insertion_point(field_add:gie.Schema.edge_types) - return _internal_add_edge_types(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::gie::EdgeType >& -Schema::edge_types() const { - // @@protoc_insertion_point(field_list:gie.Schema.edge_types) - return edge_types_; -} - -// .gie.Statistics statistics = 4; -inline bool Schema::_internal_has_statistics() const { - return this != internal_default_instance() && statistics_ != nullptr; -} -inline bool Schema::has_statistics() const { - return _internal_has_statistics(); -} -inline void Schema::clear_statistics() { - if (GetArena() == nullptr && statistics_ != nullptr) { - delete statistics_; - } - statistics_ = nullptr; -} -inline const ::gie::Statistics& Schema::_internal_statistics() const { - const ::gie::Statistics* p = statistics_; - return p != nullptr ? *p : *reinterpret_cast( - &::gie::_Statistics_default_instance_); -} -inline const ::gie::Statistics& Schema::statistics() const { - // @@protoc_insertion_point(field_get:gie.Schema.statistics) - return _internal_statistics(); -} -inline void Schema::unsafe_arena_set_allocated_statistics( - ::gie::Statistics* statistics) { - if (GetArena() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(statistics_); - } - statistics_ = statistics; - if (statistics) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:gie.Schema.statistics) -} -inline ::gie::Statistics* Schema::release_statistics() { - auto temp = unsafe_arena_release_statistics(); - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::gie::Statistics* Schema::unsafe_arena_release_statistics() { - // @@protoc_insertion_point(field_release:gie.Schema.statistics) - - ::gie::Statistics* temp = statistics_; - statistics_ = nullptr; - return temp; -} -inline ::gie::Statistics* Schema::_internal_mutable_statistics() { - - if (statistics_ == nullptr) { - auto* p = CreateMaybeMessage<::gie::Statistics>(GetArena()); - statistics_ = p; - } - return statistics_; -} -inline ::gie::Statistics* Schema::mutable_statistics() { - // @@protoc_insertion_point(field_mutable:gie.Schema.statistics) - return _internal_mutable_statistics(); -} -inline void Schema::set_allocated_statistics(::gie::Statistics* statistics) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - if (message_arena == nullptr) { - delete statistics_; - } - if (statistics) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(statistics); - if (message_arena != submessage_arena) { - statistics = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, statistics, submessage_arena); - } - - } else { - - } - statistics_ = statistics; - // @@protoc_insertion_point(field_set_allocated:gie.Schema.statistics) -} - -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace gie - -PROTOBUF_NAMESPACE_OPEN - -template <> struct is_proto_enum< ::gie::VertexPartitionStrategy> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::gie::VertexPartitionStrategy>() { - return ::gie::VertexPartitionStrategy_descriptor(); -} -template <> struct is_proto_enum< ::gie::EdgePartitionStrategy> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::gie::EdgePartitionStrategy>() { - return ::gie::EdgePartitionStrategy_descriptor(); -} -template <> struct is_proto_enum< ::gie::PropertyPartitionStrategy> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::gie::PropertyPartitionStrategy>() { - return ::gie::PropertyPartitionStrategy_descriptor(); -} -template <> struct is_proto_enum< ::gie::GraphTopologyPartitionStrategy> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::gie::GraphTopologyPartitionStrategy>() { - return ::gie::GraphTopologyPartitionStrategy_descriptor(); -} -template <> struct is_proto_enum< ::gie::Relation> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::gie::Relation>() { - return ::gie::Relation_descriptor(); -} -template <> struct is_proto_enum< ::gie::DataType> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::gie::DataType>() { - return ::gie::DataType_descriptor(); -} - -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_gie_5fschema_2eproto diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 9aa9ea067..ab53230dc 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -99,7 +99,7 @@ GRIN_VERTEX_ORIGINAL_ID grin_get_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX v) #endif #if defined(GRIN_WITH_VERTEX_ORIGINAL_ID) && !defined(GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID) -GRIN_VERTEX grin_get_vertex_from_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); +GRIN_VERTEX grin_get_vertex_by_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); #endif // Data @@ -156,13 +156,13 @@ void grin_destroy_edge(GRIN_GRAPH g, GRIN_EDGE e) { delete _e; } -GRIN_VERTEX grin_get_edge_src(GRIN_GRAPH g, GRIN_EDGE e) { +GRIN_VERTEX grin_get_src_vertex_from_edge(GRIN_GRAPH g, GRIN_EDGE e) { auto _e = static_cast(e); auto v = new GRIN_VERTEX_T(_e->src); return v; } -GRIN_VERTEX grin_get_edge_dst(GRIN_GRAPH g, GRIN_EDGE e) { +GRIN_VERTEX grin_get_dst_vertex_from_edge(GRIN_GRAPH g, GRIN_EDGE e) { auto _e = static_cast(e); auto v = new GRIN_VERTEX_T(_e->dst); return v; diff --git a/modules/graph/test/grin_test.cc b/modules/graph/test/grin_test.cc index 5680d8594..9ec942577 100644 --- a/modules/graph/test/grin_test.cc +++ b/modules/graph/test/grin_test.cc @@ -65,12 +65,12 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part the destination is a mirror vertex, given the context of "edge-cut" partition strategy that the underlying storage uses. Then for each of these vertices, we send the value of the "features" property to its master partition. */ - GRIN_GRAPH g = grin_get_local_graph_from_partition(partitioned_graph, partition); // get local graph of partition + GRIN_GRAPH g = grin_get_local_graph_by_partition(partitioned_graph, partition); // get local graph of partition GRIN_EDGE_TYPE etype = grin_get_edge_type_by_name(g, edge_type_name); // get edge type from name - GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_from_edge_type(g, etype); // get related source vertex type list - GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_from_edge_type(g, etype); // get related destination vertex type list + GRIN_VERTEX_TYPE_LIST src_vtypes = grin_get_src_types_by_edge_type(g, etype); // get related source vertex type list + GRIN_VERTEX_TYPE_LIST dst_vtypes = grin_get_dst_types_by_edge_type(g, etype); // get related destination vertex type list size_t src_vtypes_num = grin_get_vertex_type_list_size(g, src_vtypes); size_t dst_vtypes_num = grin_get_vertex_type_list_size(g, dst_vtypes); @@ -111,7 +111,7 @@ void sync_property(GRIN_PARTITIONED_GRAPH partitioned_graph, GRIN_PARTITION part GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list(g, adj_list, k); // get the dst vertex u const void* value = grin_get_value_from_vertex_property_table(g, dst_vpt, u, dst_vp); // get the property value of "features" of u - GRIN_VERTEX_REF uref = grin_get_vertex_ref_for_vertex(g, u); // get the reference of u that can be recoginized by other partitions + GRIN_VERTEX_REF uref = grin_get_vertex_ref_by_vertex(g, u); // get the reference of u that can be recoginized by other partitions GRIN_PARTITION u_master_partition = grin_get_master_partition_from_vertex_ref(g, uref); // get the master partition for u const char* uref_ser = grin_serialize_vertex_ref(g, uref); @@ -184,7 +184,7 @@ std::string Convert(GRIN_PARTITIONED_GRAPH pg) { stats->set_num_edges(grin_get_total_edge_num(pg)); GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); - GRIN_GRAPH g = grin_get_local_graph_from_partition(pg, partition); + GRIN_GRAPH g = grin_get_local_graph_by_partition(pg, partition); // vertex type GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); @@ -260,8 +260,8 @@ std::string Convert(GRIN_PARTITIONED_GRAPH pg) { #endif #ifdef GRIN_WITH_VERTEX_PROPERTY - auto src_vtypes = grin_get_src_types_from_edge_type(g, et); - auto dst_vtypes = grin_get_dst_types_from_edge_type(g, et); + auto src_vtypes = grin_get_src_types_by_edge_type(g, et); + auto dst_vtypes = grin_get_dst_types_by_edge_type(g, et); auto pair_sz = grin_get_vertex_type_list_size(g, src_vtypes); for (size_t j = 0; j < pair_sz; ++j) { auto src_vt = grin_get_vertex_type_from_list(g, src_vtypes, j); From 823689c9d416895ed0d5eba0b3ccaee062ce6508 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Wed, 10 May 2023 08:24:37 +0000 Subject: [PATCH 64/85] add protoc to cmake --- modules/graph/CMakeLists.txt | 4 +- modules/graph/grin/src/proto/graph.pb.cc | 4534 -------------------- modules/graph/grin/src/proto/graph.pb.h | 4777 ---------------------- modules/graph/grin/src/proto/message.cc | 1 - 4 files changed, 3 insertions(+), 9313 deletions(-) delete mode 100644 modules/graph/grin/src/proto/graph.pb.cc delete mode 100644 modules/graph/grin/src/proto/graph.pb.h diff --git a/modules/graph/CMakeLists.txt b/modules/graph/CMakeLists.txt index 6269c3226..29c1bf1ad 100644 --- a/modules/graph/CMakeLists.txt +++ b/modules/graph/CMakeLists.txt @@ -9,9 +9,11 @@ file(GLOB_RECURSE VINEYARD_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}" find_package(MPI REQUIRED) find_package(libgrapelite REQUIRED) + find_package(Protobuf REQUIRED) include_directories(${Protobuf_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) +protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${CMAKE_CURRENT_SOURCE_DIR}/grin/include/proto/graph.proto) if(VINEYARD_MOD_SRCS) @@ -179,7 +181,7 @@ endif() # grin lib file(GLOB_RECURSE GRIN_SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}" "grin/*.cc") -add_library(vineyard_grin ${GRIN_SRC_FILES}) +add_library(vineyard_grin ${GRIN_SRC_FILES} ${PROTO_SRCS} ${PROTO_HDRS}) target_link_libraries(vineyard_grin PRIVATE vineyard_graph ${Protobuf_LIBRARIES}) install_vineyard_target(vineyard_grin) diff --git a/modules/graph/grin/src/proto/graph.pb.cc b/modules/graph/grin/src/proto/graph.pb.cc deleted file mode 100644 index 7525c81eb..000000000 --- a/modules/graph/grin/src/proto/graph.pb.cc +++ /dev/null @@ -1,4534 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: graph.proto - -#include "graph.pb.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -// @@protoc_insertion_point(includes) -#include -extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_EdgePropertyFeature_graph_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_IndexFeature_graph_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MirrorPartitionListFeature_graph_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PartitionFeature_graph_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PredicateFeature_graph_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_PropertyFeature_graph_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Statistics_graph_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<5> scc_info_StorageFeature_graph_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TopologyFeature_graph_2eproto; -extern PROTOBUF_INTERNAL_EXPORT_graph_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_VertexPropertyFeature_graph_2eproto; -namespace grin { -class TopologyFeatureDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _TopologyFeature_default_instance_; -class MirrorPartitionListFeatureDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _MirrorPartitionListFeature_default_instance_; -class PartitionFeatureDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _PartitionFeature_default_instance_; -class VertexPropertyFeatureDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _VertexPropertyFeature_default_instance_; -class EdgePropertyFeatureDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _EdgePropertyFeature_default_instance_; -class PropertyFeatureDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _PropertyFeature_default_instance_; -class IndexFeatureDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _IndexFeature_default_instance_; -class PredicateFeatureDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _PredicateFeature_default_instance_; -class StorageFeatureDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; - const ::grin::TopologyFeature* topology_feature_; - const ::grin::PartitionFeature* partition_feature_; - const ::grin::PropertyFeature* property_feature_; - const ::grin::IndexFeature* index_feature_; - const ::grin::PredicateFeature* predicate_feature_; -} _StorageFeature_default_instance_; -class StatisticsDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Statistics_default_instance_; -class GraphDefaultTypeInternal { - public: - ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; -} _Graph_default_instance_; -} // namespace grin -static void InitDefaultsscc_info_EdgePropertyFeature_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_EdgePropertyFeature_default_instance_; - new (ptr) ::grin::EdgePropertyFeature(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::EdgePropertyFeature::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_EdgePropertyFeature_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_EdgePropertyFeature_graph_2eproto}, {}}; - -static void InitDefaultsscc_info_Graph_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_Graph_default_instance_; - new (ptr) ::grin::Graph(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::Graph::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_Graph_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_Graph_graph_2eproto}, { - &scc_info_StorageFeature_graph_2eproto.base, - &scc_info_Statistics_graph_2eproto.base,}}; - -static void InitDefaultsscc_info_IndexFeature_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_IndexFeature_default_instance_; - new (ptr) ::grin::IndexFeature(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::IndexFeature::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_IndexFeature_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_IndexFeature_graph_2eproto}, {}}; - -static void InitDefaultsscc_info_MirrorPartitionListFeature_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_MirrorPartitionListFeature_default_instance_; - new (ptr) ::grin::MirrorPartitionListFeature(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::MirrorPartitionListFeature::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MirrorPartitionListFeature_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MirrorPartitionListFeature_graph_2eproto}, {}}; - -static void InitDefaultsscc_info_PartitionFeature_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_PartitionFeature_default_instance_; - new (ptr) ::grin::PartitionFeature(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::PartitionFeature::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<1> scc_info_PartitionFeature_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 1, 0, InitDefaultsscc_info_PartitionFeature_graph_2eproto}, { - &scc_info_MirrorPartitionListFeature_graph_2eproto.base,}}; - -static void InitDefaultsscc_info_PredicateFeature_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_PredicateFeature_default_instance_; - new (ptr) ::grin::PredicateFeature(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::PredicateFeature::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_PredicateFeature_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_PredicateFeature_graph_2eproto}, {}}; - -static void InitDefaultsscc_info_PropertyFeature_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_PropertyFeature_default_instance_; - new (ptr) ::grin::PropertyFeature(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::PropertyFeature::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_PropertyFeature_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_PropertyFeature_graph_2eproto}, { - &scc_info_VertexPropertyFeature_graph_2eproto.base, - &scc_info_EdgePropertyFeature_graph_2eproto.base,}}; - -static void InitDefaultsscc_info_Statistics_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_Statistics_default_instance_; - new (ptr) ::grin::Statistics(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::Statistics::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Statistics_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_Statistics_graph_2eproto}, {}}; - -static void InitDefaultsscc_info_StorageFeature_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_StorageFeature_default_instance_; - new (ptr) ::grin::StorageFeature(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::StorageFeature::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<5> scc_info_StorageFeature_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 5, 0, InitDefaultsscc_info_StorageFeature_graph_2eproto}, { - &scc_info_TopologyFeature_graph_2eproto.base, - &scc_info_PartitionFeature_graph_2eproto.base, - &scc_info_PropertyFeature_graph_2eproto.base, - &scc_info_IndexFeature_graph_2eproto.base, - &scc_info_PredicateFeature_graph_2eproto.base,}}; - -static void InitDefaultsscc_info_TopologyFeature_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_TopologyFeature_default_instance_; - new (ptr) ::grin::TopologyFeature(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::TopologyFeature::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_TopologyFeature_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_TopologyFeature_graph_2eproto}, {}}; - -static void InitDefaultsscc_info_VertexPropertyFeature_graph_2eproto() { - GOOGLE_PROTOBUF_VERIFY_VERSION; - - { - void* ptr = &::grin::_VertexPropertyFeature_default_instance_; - new (ptr) ::grin::VertexPropertyFeature(); - ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); - } - ::grin::VertexPropertyFeature::InitAsDefaultInstance(); -} - -::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_VertexPropertyFeature_graph_2eproto = - {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_VertexPropertyFeature_graph_2eproto}, {}}; - -static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_graph_2eproto[11]; -static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_graph_2eproto[3]; -static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_graph_2eproto = nullptr; - -const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_graph_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_assume_has_directed_graph_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_assume_has_undirected_graph_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_assume_has_multi_edge_graph_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_with_vertex_original_id_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_with_vertex_data_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, grin_with_edge_data_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, vertex_list_retrievals_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, edge_list_retrievals_), - PROTOBUF_FIELD_OFFSET(::grin::TopologyFeature, adjacent_list_retrievals_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, grin_trait_master_vertex_mirror_partition_list_), - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, grin_trait_mirror_vertex_mirror_partition_list_), - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, grin_trait_master_edge_mirror_partition_list_), - PROTOBUF_FIELD_OFFSET(::grin::MirrorPartitionListFeature, grin_trait_mirror_edge_mirror_partition_list_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, graph_partition_strategy_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_natural_id_for_partition_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_enable_vertex_ref_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_enable_edge_ref_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, vertex_data_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, edge_data_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, mirror_partition_list_feature_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_master_for_vertex_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_partition_for_vertex_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_master_for_edge_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_partition_for_edge_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_master_neighbor_for_adjacent_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_select_neighbor_partition_for_adjacent_list_), - PROTOBUF_FIELD_OFFSET(::grin::PartitionFeature, grin_trait_fast_vertex_ref_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_with_vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_with_vertex_property_name_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_with_vertex_type_name_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_enable_vertex_property_table_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_enable_vertex_primary_keys_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_trait_natural_id_for_vertex_type_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_trait_natural_id_for_vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::VertexPropertyFeature, grin_assume_by_type_vertex_original_id_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_with_edge_property_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_with_edge_property_name_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_with_edge_type_name_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_enable_edge_property_table_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_enable_edge_primary_keys_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_trait_natural_id_for_edge_type_), - PROTOBUF_FIELD_OFFSET(::grin::EdgePropertyFeature, grin_trait_natural_id_for_edge_property_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_enable_row_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, vertex_property_feature_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, edge_property_feature_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, edge_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_assume_column_store_for_vertex_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_assume_column_store_for_edge_property_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_trait_select_type_for_vertex_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_trait_select_type_for_edge_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_trait_select_neighbor_type_for_adjacent_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_trait_select_edge_type_for_adjacent_list_), - PROTOBUF_FIELD_OFFSET(::grin::PropertyFeature, grin_trait_specific_vev_relation_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, grin_with_vertex_label_), - PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, grin_with_edge_label_), - PROTOBUF_FIELD_OFFSET(::grin::IndexFeature, grin_assume_all_vertex_list_sorted_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::PredicateFeature, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, _internal_metadata_), - ~0u, // no _extensions_ - PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, _oneof_case_[0]), - ~0u, // no _weak_field_map_ - offsetof(::grin::StorageFeatureDefaultTypeInternal, topology_feature_), - offsetof(::grin::StorageFeatureDefaultTypeInternal, partition_feature_), - offsetof(::grin::StorageFeatureDefaultTypeInternal, property_feature_), - offsetof(::grin::StorageFeatureDefaultTypeInternal, index_feature_), - offsetof(::grin::StorageFeatureDefaultTypeInternal, predicate_feature_), - PROTOBUF_FIELD_OFFSET(::grin::StorageFeature, specific_feature_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::Statistics, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::grin::Statistics, vertex_count_), - PROTOBUF_FIELD_OFFSET(::grin::Statistics, edge_count_), - PROTOBUF_FIELD_OFFSET(::grin::Statistics, partition_count_), - PROTOBUF_FIELD_OFFSET(::grin::Statistics, vertex_type_count_), - PROTOBUF_FIELD_OFFSET(::grin::Statistics, edge_type_count_), - ~0u, // no _has_bits_ - PROTOBUF_FIELD_OFFSET(::grin::Graph, _internal_metadata_), - ~0u, // no _extensions_ - ~0u, // no _oneof_case_ - ~0u, // no _weak_field_map_ - PROTOBUF_FIELD_OFFSET(::grin::Graph, uri_), - PROTOBUF_FIELD_OFFSET(::grin::Graph, grin_version_), - PROTOBUF_FIELD_OFFSET(::grin::Graph, features_), - PROTOBUF_FIELD_OFFSET(::grin::Graph, statistics_), -}; -static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { - { 0, -1, sizeof(::grin::TopologyFeature)}, - { 14, -1, sizeof(::grin::MirrorPartitionListFeature)}, - { 23, -1, sizeof(::grin::PartitionFeature)}, - { 42, -1, sizeof(::grin::VertexPropertyFeature)}, - { 55, -1, sizeof(::grin::EdgePropertyFeature)}, - { 67, -1, sizeof(::grin::PropertyFeature)}, - { 84, -1, sizeof(::grin::IndexFeature)}, - { 92, -1, sizeof(::grin::PredicateFeature)}, - { 97, -1, sizeof(::grin::StorageFeature)}, - { 108, -1, sizeof(::grin::Statistics)}, - { 118, -1, sizeof(::grin::Graph)}, -}; - -static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { - reinterpret_cast(&::grin::_TopologyFeature_default_instance_), - reinterpret_cast(&::grin::_MirrorPartitionListFeature_default_instance_), - reinterpret_cast(&::grin::_PartitionFeature_default_instance_), - reinterpret_cast(&::grin::_VertexPropertyFeature_default_instance_), - reinterpret_cast(&::grin::_EdgePropertyFeature_default_instance_), - reinterpret_cast(&::grin::_PropertyFeature_default_instance_), - reinterpret_cast(&::grin::_IndexFeature_default_instance_), - reinterpret_cast(&::grin::_PredicateFeature_default_instance_), - reinterpret_cast(&::grin::_StorageFeature_default_instance_), - reinterpret_cast(&::grin::_Statistics_default_instance_), - reinterpret_cast(&::grin::_Graph_default_instance_), -}; - -const char descriptor_table_protodef_graph_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = - "\n\013graph.proto\022\004grin\"\216\003\n\017TopologyFeature\022" - "&\n\036grin_assume_has_directed_graph\030\001 \001(\010\022" - "(\n grin_assume_has_undirected_graph\030\002 \001(" - "\010\022(\n grin_assume_has_multi_edge_graph\030\003 " - "\001(\010\022$\n\034grin_with_vertex_original_id\030\004 \001(" - "\010\022\035\n\025grin_with_vertex_data\030\005 \001(\010\022\033\n\023grin" - "_with_edge_data\030\006 \001(\010\0223\n\026vertex_list_ret" - "rievals\030\007 \003(\0162\023.grin.ListRetrieval\0221\n\024ed" - "ge_list_retrievals\030\010 \003(\0162\023.grin.ListRetr" - "ieval\0225\n\030adjacent_list_retrievals\030\t \003(\0162" - "\023.grin.ListRetrieval\"\370\001\n\032MirrorPartition" - "ListFeature\0226\n.grin_trait_master_vertex_" - "mirror_partition_list\030\001 \001(\010\0226\n.grin_trai" - "t_mirror_vertex_mirror_partition_list\030\002 " - "\001(\010\0224\n,grin_trait_master_edge_mirror_par" - "tition_list\030\003 \001(\010\0224\n,grin_trait_mirror_e" - "dge_mirror_partition_list\030\004 \001(\010\"\343\005\n\020Part" - "itionFeature\022>\n\030graph_partition_strategy" - "\030\001 \001(\0162\034.grin.GraphPartitionStrategy\022+\n#" - "grin_trait_natural_id_for_partition\030\002 \001(" - "\010\022\036\n\026grin_enable_vertex_ref\030\003 \001(\010\022\034\n\024gri" - "n_enable_edge_ref\030\004 \001(\010\0228\n\013vertex_data\030\005" - " \001(\0162#.grin.PropertyDataPartitionStrateg" - "y\0226\n\tedge_data\030\006 \001(\0162#.grin.PropertyData" - "PartitionStrategy\022G\n\035mirror_partition_li" - "st_feature\030\007 \001(\0132 .grin.MirrorPartitionL" - "istFeature\0220\n(grin_trait_select_master_f" - "or_vertex_list\030\010 \001(\010\0223\n+grin_trait_selec" - "t_partition_for_vertex_list\030\t \001(\010\022.\n&gri" - "n_trait_select_master_for_edge_list\030\n \001(" - "\010\0221\n)grin_trait_select_partition_for_edg" - "e_list\030\013 \001(\010\022;\n3grin_trait_select_master" - "_neighbor_for_adjacent_list\030\014 \001(\010\022>\n6gri" - "n_trait_select_neighbor_partition_for_ad" - "jacent_list\030\r \001(\010\022\"\n\032grin_trait_fast_ver" - "tex_ref\030\016 \001(\010\"\354\002\n\025VertexPropertyFeature\022" - "!\n\031grin_with_vertex_property\030\001 \001(\010\022&\n\036gr" - "in_with_vertex_property_name\030\002 \001(\010\022\"\n\032gr" - "in_with_vertex_type_name\030\003 \001(\010\022)\n!grin_e" - "nable_vertex_property_table\030\004 \001(\010\022\'\n\037gri" - "n_enable_vertex_primary_keys\030\005 \001(\010\022-\n%gr" - "in_trait_natural_id_for_vertex_type\030\006 \001(" - "\010\0221\n)grin_trait_natural_id_for_vertex_pr" - "operty\030\007 \001(\010\022.\n&grin_assume_by_type_vert" - "ex_original_id\030\010 \001(\010\"\254\002\n\023EdgePropertyFea" - "ture\022\037\n\027grin_with_edge_property\030\001 \001(\010\022$\n" - "\034grin_with_edge_property_name\030\002 \001(\010\022 \n\030g" - "rin_with_edge_type_name\030\003 \001(\010\022\'\n\037grin_en" - "able_edge_property_table\030\004 \001(\010\022%\n\035grin_e" - "nable_edge_primary_keys\030\005 \001(\010\022+\n#grin_tr" - "ait_natural_id_for_edge_type\030\006 \001(\010\022/\n\'gr" - "in_trait_natural_id_for_edge_property\030\007 " - "\001(\010\"\200\005\n\017PropertyFeature\022\027\n\017grin_enable_r" - "ow\030\001 \001(\010\022<\n\027vertex_property_feature\030\002 \001(" - "\0132\033.grin.VertexPropertyFeature\0228\n\025edge_p" - "roperty_feature\030\003 \001(\0132\031.grin.EdgePropert" - "yFeature\022<\n\017vertex_property\030\004 \001(\0162#.grin" - ".PropertyDataPartitionStrategy\022:\n\redge_p" - "roperty\030\005 \001(\0162#.grin.PropertyDataPartiti" - "onStrategy\0224\n,grin_assume_column_store_f" - "or_vertex_property\030\006 \001(\010\0222\n*grin_assume_" - "column_store_for_edge_property\030\007 \001(\010\022.\n&" - "grin_trait_select_type_for_vertex_list\030\010" - " \001(\010\022,\n$grin_trait_select_type_for_edge_" - "list\030\t \001(\010\0229\n1grin_trait_select_neighbor" - "_type_for_adjacent_list\030\n \001(\010\0225\n-grin_tr" - "ait_select_edge_type_for_adjacent_list\030\013" - " \001(\010\022(\n grin_trait_specific_vev_relation" - "\030\014 \001(\010\"x\n\014IndexFeature\022\036\n\026grin_with_vert" - "ex_label\030\001 \001(\010\022\034\n\024grin_with_edge_label\030\002" - " \001(\010\022*\n\"grin_assume_all_vertex_list_sort" - "ed\030\003 \001(\010\"\022\n\020PredicateFeature\"\241\002\n\016Storage" - "Feature\0221\n\020topology_feature\030\001 \001(\0132\025.grin" - ".TopologyFeatureH\000\0223\n\021partition_feature\030" - "\002 \001(\0132\026.grin.PartitionFeatureH\000\0221\n\020prope" - "rty_feature\030\003 \001(\0132\025.grin.PropertyFeature" - "H\000\022+\n\rindex_feature\030\004 \001(\0132\022.grin.IndexFe" - "atureH\000\0223\n\021predicate_feature\030\005 \001(\0132\026.gri" - "n.PredicateFeatureH\000B\022\n\020specific_feature" - "\"\203\001\n\nStatistics\022\024\n\014vertex_count\030\001 \001(\005\022\022\n" - "\nedge_count\030\002 \001(\005\022\027\n\017partition_count\030\003 \001" - "(\005\022\031\n\021vertex_type_count\030\004 \001(\005\022\027\n\017edge_ty" - "pe_count\030\005 \001(\005\"x\n\005Graph\022\013\n\003uri\030\001 \001(\t\022\024\n\014" - "grin_version\030\002 \001(\t\022&\n\010features\030\003 \003(\0132\024.g" - "rin.StorageFeature\022$\n\nstatistics\030\004 \001(\0132\020" - ".grin.Statistics*>\n\rListRetrieval\022\t\n\005LR_" - "NA\020\000\022\021\n\rLR_ARRAY_LIKE\020\001\022\017\n\013LR_ITERATOR\020\002" - "*u\n\026GraphPartitionStrategy\022\n\n\006GPS_NA\020\000\022\025" - "\n\021GPS_ALL_REPLICATE\020\001\022\020\n\014GPS_EDGE_CUT\020\002\022" - "\022\n\016GPS_VERTEX_CUT\020\003\022\022\n\016GPS_HYBRID_CUT\020\004*" - "\202\001\n\035PropertyDataPartitionStrategy\022\013\n\007PDP" - "S_NA\020\000\022\024\n\020PDPS_MASTER_ONLY\020\001\022 \n\034PDPS_REP" - "LICATE_MASTER_MIRROR\020\002\022\034\n\030PDPS_SPLIT_MAS" - "TER_MIRROR\020\003b\006proto3" - ; -static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_graph_2eproto_deps[1] = { -}; -static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_graph_2eproto_sccs[11] = { - &scc_info_EdgePropertyFeature_graph_2eproto.base, - &scc_info_Graph_graph_2eproto.base, - &scc_info_IndexFeature_graph_2eproto.base, - &scc_info_MirrorPartitionListFeature_graph_2eproto.base, - &scc_info_PartitionFeature_graph_2eproto.base, - &scc_info_PredicateFeature_graph_2eproto.base, - &scc_info_PropertyFeature_graph_2eproto.base, - &scc_info_Statistics_graph_2eproto.base, - &scc_info_StorageFeature_graph_2eproto.base, - &scc_info_TopologyFeature_graph_2eproto.base, - &scc_info_VertexPropertyFeature_graph_2eproto.base, -}; -static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_graph_2eproto_once; -const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_graph_2eproto = { - false, false, descriptor_table_protodef_graph_2eproto, "graph.proto", 3740, - &descriptor_table_graph_2eproto_once, descriptor_table_graph_2eproto_sccs, descriptor_table_graph_2eproto_deps, 11, 0, - schemas, file_default_instances, TableStruct_graph_2eproto::offsets, - file_level_metadata_graph_2eproto, 11, file_level_enum_descriptors_graph_2eproto, file_level_service_descriptors_graph_2eproto, -}; - -// Force running AddDescriptors() at dynamic initialization time. -static bool dynamic_init_dummy_graph_2eproto = (static_cast(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_graph_2eproto)), true); -namespace grin { -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ListRetrieval_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_graph_2eproto); - return file_level_enum_descriptors_graph_2eproto[0]; -} -bool ListRetrieval_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GraphPartitionStrategy_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_graph_2eproto); - return file_level_enum_descriptors_graph_2eproto[1]; -} -bool GraphPartitionStrategy_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - case 4: - return true; - default: - return false; - } -} - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PropertyDataPartitionStrategy_descriptor() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_graph_2eproto); - return file_level_enum_descriptors_graph_2eproto[2]; -} -bool PropertyDataPartitionStrategy_IsValid(int value) { - switch (value) { - case 0: - case 1: - case 2: - case 3: - return true; - default: - return false; - } -} - - -// =================================================================== - -void TopologyFeature::InitAsDefaultInstance() { -} -class TopologyFeature::_Internal { - public: -}; - -TopologyFeature::TopologyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena), - vertex_list_retrievals_(arena), - edge_list_retrievals_(arena), - adjacent_list_retrievals_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.TopologyFeature) -} -TopologyFeature::TopologyFeature(const TopologyFeature& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - vertex_list_retrievals_(from.vertex_list_retrievals_), - edge_list_retrievals_(from.edge_list_retrievals_), - adjacent_list_retrievals_(from.adjacent_list_retrievals_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&grin_assume_has_directed_graph_, &from.grin_assume_has_directed_graph_, - static_cast(reinterpret_cast(&grin_with_edge_data_) - - reinterpret_cast(&grin_assume_has_directed_graph_)) + sizeof(grin_with_edge_data_)); - // @@protoc_insertion_point(copy_constructor:grin.TopologyFeature) -} - -void TopologyFeature::SharedCtor() { - ::memset(&grin_assume_has_directed_graph_, 0, static_cast( - reinterpret_cast(&grin_with_edge_data_) - - reinterpret_cast(&grin_assume_has_directed_graph_)) + sizeof(grin_with_edge_data_)); -} - -TopologyFeature::~TopologyFeature() { - // @@protoc_insertion_point(destructor:grin.TopologyFeature) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void TopologyFeature::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); -} - -void TopologyFeature::ArenaDtor(void* object) { - TopologyFeature* _this = reinterpret_cast< TopologyFeature* >(object); - (void)_this; -} -void TopologyFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void TopologyFeature::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const TopologyFeature& TopologyFeature::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_TopologyFeature_graph_2eproto.base); - return *internal_default_instance(); -} - - -void TopologyFeature::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.TopologyFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - vertex_list_retrievals_.Clear(); - edge_list_retrievals_.Clear(); - adjacent_list_retrievals_.Clear(); - ::memset(&grin_assume_has_directed_graph_, 0, static_cast( - reinterpret_cast(&grin_with_edge_data_) - - reinterpret_cast(&grin_assume_has_directed_graph_)) + sizeof(grin_with_edge_data_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* TopologyFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bool grin_assume_has_directed_graph = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - grin_assume_has_directed_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_assume_has_undirected_graph = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - grin_assume_has_undirected_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_assume_has_multi_edge_graph = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - grin_assume_has_multi_edge_graph_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_with_vertex_original_id = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - grin_with_vertex_original_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_with_vertex_data = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - grin_with_vertex_data_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_with_edge_data = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - grin_with_edge_data_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .grin.ListRetrieval vertex_list_retrievals = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_vertex_list_retrievals(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_add_vertex_list_retrievals(static_cast<::grin::ListRetrieval>(val)); - } else goto handle_unusual; - continue; - // repeated .grin.ListRetrieval edge_list_retrievals = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_edge_list_retrievals(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_add_edge_list_retrievals(static_cast<::grin::ListRetrieval>(val)); - } else goto handle_unusual; - continue; - // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { - ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser(_internal_mutable_adjacent_list_retrievals(), ptr, ctx); - CHK_(ptr); - } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_add_adjacent_list_retrievals(static_cast<::grin::ListRetrieval>(val)); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* TopologyFeature::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.TopologyFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bool grin_assume_has_directed_graph = 1; - if (this->grin_assume_has_directed_graph() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_assume_has_directed_graph(), target); - } - - // bool grin_assume_has_undirected_graph = 2; - if (this->grin_assume_has_undirected_graph() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_assume_has_undirected_graph(), target); - } - - // bool grin_assume_has_multi_edge_graph = 3; - if (this->grin_assume_has_multi_edge_graph() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_assume_has_multi_edge_graph(), target); - } - - // bool grin_with_vertex_original_id = 4; - if (this->grin_with_vertex_original_id() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_with_vertex_original_id(), target); - } - - // bool grin_with_vertex_data = 5; - if (this->grin_with_vertex_data() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_with_vertex_data(), target); - } - - // bool grin_with_edge_data = 6; - if (this->grin_with_edge_data() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_with_edge_data(), target); - } - - // repeated .grin.ListRetrieval vertex_list_retrievals = 7; - { - int byte_size = _vertex_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); - if (byte_size > 0) { - target = stream->WriteEnumPacked( - 7, vertex_list_retrievals_, byte_size, target); - } - } - - // repeated .grin.ListRetrieval edge_list_retrievals = 8; - { - int byte_size = _edge_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); - if (byte_size > 0) { - target = stream->WriteEnumPacked( - 8, edge_list_retrievals_, byte_size, target); - } - } - - // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; - { - int byte_size = _adjacent_list_retrievals_cached_byte_size_.load(std::memory_order_relaxed); - if (byte_size > 0) { - target = stream->WriteEnumPacked( - 9, adjacent_list_retrievals_, byte_size, target); - } - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.TopologyFeature) - return target; -} - -size_t TopologyFeature::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.TopologyFeature) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .grin.ListRetrieval vertex_list_retrievals = 7; - { - size_t data_size = 0; - unsigned int count = static_cast(this->_internal_vertex_list_retrievals_size());for (unsigned int i = 0; i < count; i++) { - data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize( - this->_internal_vertex_list_retrievals(static_cast(i))); - } - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _vertex_list_retrievals_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated .grin.ListRetrieval edge_list_retrievals = 8; - { - size_t data_size = 0; - unsigned int count = static_cast(this->_internal_edge_list_retrievals_size());for (unsigned int i = 0; i < count; i++) { - data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize( - this->_internal_edge_list_retrievals(static_cast(i))); - } - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _edge_list_retrievals_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; - { - size_t data_size = 0; - unsigned int count = static_cast(this->_internal_adjacent_list_retrievals_size());for (unsigned int i = 0; i < count; i++) { - data_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize( - this->_internal_adjacent_list_retrievals(static_cast(i))); - } - if (data_size > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); - _adjacent_list_retrievals_cached_byte_size_.store(cached_size, - std::memory_order_relaxed); - total_size += data_size; - } - - // bool grin_assume_has_directed_graph = 1; - if (this->grin_assume_has_directed_graph() != 0) { - total_size += 1 + 1; - } - - // bool grin_assume_has_undirected_graph = 2; - if (this->grin_assume_has_undirected_graph() != 0) { - total_size += 1 + 1; - } - - // bool grin_assume_has_multi_edge_graph = 3; - if (this->grin_assume_has_multi_edge_graph() != 0) { - total_size += 1 + 1; - } - - // bool grin_with_vertex_original_id = 4; - if (this->grin_with_vertex_original_id() != 0) { - total_size += 1 + 1; - } - - // bool grin_with_vertex_data = 5; - if (this->grin_with_vertex_data() != 0) { - total_size += 1 + 1; - } - - // bool grin_with_edge_data = 6; - if (this->grin_with_edge_data() != 0) { - total_size += 1 + 1; - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void TopologyFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.TopologyFeature) - GOOGLE_DCHECK_NE(&from, this); - const TopologyFeature* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.TopologyFeature) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.TopologyFeature) - MergeFrom(*source); - } -} - -void TopologyFeature::MergeFrom(const TopologyFeature& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.TopologyFeature) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - vertex_list_retrievals_.MergeFrom(from.vertex_list_retrievals_); - edge_list_retrievals_.MergeFrom(from.edge_list_retrievals_); - adjacent_list_retrievals_.MergeFrom(from.adjacent_list_retrievals_); - if (from.grin_assume_has_directed_graph() != 0) { - _internal_set_grin_assume_has_directed_graph(from._internal_grin_assume_has_directed_graph()); - } - if (from.grin_assume_has_undirected_graph() != 0) { - _internal_set_grin_assume_has_undirected_graph(from._internal_grin_assume_has_undirected_graph()); - } - if (from.grin_assume_has_multi_edge_graph() != 0) { - _internal_set_grin_assume_has_multi_edge_graph(from._internal_grin_assume_has_multi_edge_graph()); - } - if (from.grin_with_vertex_original_id() != 0) { - _internal_set_grin_with_vertex_original_id(from._internal_grin_with_vertex_original_id()); - } - if (from.grin_with_vertex_data() != 0) { - _internal_set_grin_with_vertex_data(from._internal_grin_with_vertex_data()); - } - if (from.grin_with_edge_data() != 0) { - _internal_set_grin_with_edge_data(from._internal_grin_with_edge_data()); - } -} - -void TopologyFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.TopologyFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void TopologyFeature::CopyFrom(const TopologyFeature& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.TopologyFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool TopologyFeature::IsInitialized() const { - return true; -} - -void TopologyFeature::InternalSwap(TopologyFeature* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - vertex_list_retrievals_.InternalSwap(&other->vertex_list_retrievals_); - edge_list_retrievals_.InternalSwap(&other->edge_list_retrievals_); - adjacent_list_retrievals_.InternalSwap(&other->adjacent_list_retrievals_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(TopologyFeature, grin_with_edge_data_) - + sizeof(TopologyFeature::grin_with_edge_data_) - - PROTOBUF_FIELD_OFFSET(TopologyFeature, grin_assume_has_directed_graph_)>( - reinterpret_cast(&grin_assume_has_directed_graph_), - reinterpret_cast(&other->grin_assume_has_directed_graph_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata TopologyFeature::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void MirrorPartitionListFeature::InitAsDefaultInstance() { -} -class MirrorPartitionListFeature::_Internal { - public: -}; - -MirrorPartitionListFeature::MirrorPartitionListFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.MirrorPartitionListFeature) -} -MirrorPartitionListFeature::MirrorPartitionListFeature(const MirrorPartitionListFeature& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&grin_trait_master_vertex_mirror_partition_list_, &from.grin_trait_master_vertex_mirror_partition_list_, - static_cast(reinterpret_cast(&grin_trait_mirror_edge_mirror_partition_list_) - - reinterpret_cast(&grin_trait_master_vertex_mirror_partition_list_)) + sizeof(grin_trait_mirror_edge_mirror_partition_list_)); - // @@protoc_insertion_point(copy_constructor:grin.MirrorPartitionListFeature) -} - -void MirrorPartitionListFeature::SharedCtor() { - ::memset(&grin_trait_master_vertex_mirror_partition_list_, 0, static_cast( - reinterpret_cast(&grin_trait_mirror_edge_mirror_partition_list_) - - reinterpret_cast(&grin_trait_master_vertex_mirror_partition_list_)) + sizeof(grin_trait_mirror_edge_mirror_partition_list_)); -} - -MirrorPartitionListFeature::~MirrorPartitionListFeature() { - // @@protoc_insertion_point(destructor:grin.MirrorPartitionListFeature) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void MirrorPartitionListFeature::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); -} - -void MirrorPartitionListFeature::ArenaDtor(void* object) { - MirrorPartitionListFeature* _this = reinterpret_cast< MirrorPartitionListFeature* >(object); - (void)_this; -} -void MirrorPartitionListFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void MirrorPartitionListFeature::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const MirrorPartitionListFeature& MirrorPartitionListFeature::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MirrorPartitionListFeature_graph_2eproto.base); - return *internal_default_instance(); -} - - -void MirrorPartitionListFeature::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.MirrorPartitionListFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&grin_trait_master_vertex_mirror_partition_list_, 0, static_cast( - reinterpret_cast(&grin_trait_mirror_edge_mirror_partition_list_) - - reinterpret_cast(&grin_trait_master_vertex_mirror_partition_list_)) + sizeof(grin_trait_mirror_edge_mirror_partition_list_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* MirrorPartitionListFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bool grin_trait_master_vertex_mirror_partition_list = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - grin_trait_master_vertex_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_mirror_vertex_mirror_partition_list = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - grin_trait_mirror_vertex_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_master_edge_mirror_partition_list = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - grin_trait_master_edge_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_mirror_edge_mirror_partition_list = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - grin_trait_mirror_edge_mirror_partition_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* MirrorPartitionListFeature::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.MirrorPartitionListFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bool grin_trait_master_vertex_mirror_partition_list = 1; - if (this->grin_trait_master_vertex_mirror_partition_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_trait_master_vertex_mirror_partition_list(), target); - } - - // bool grin_trait_mirror_vertex_mirror_partition_list = 2; - if (this->grin_trait_mirror_vertex_mirror_partition_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_trait_mirror_vertex_mirror_partition_list(), target); - } - - // bool grin_trait_master_edge_mirror_partition_list = 3; - if (this->grin_trait_master_edge_mirror_partition_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_trait_master_edge_mirror_partition_list(), target); - } - - // bool grin_trait_mirror_edge_mirror_partition_list = 4; - if (this->grin_trait_mirror_edge_mirror_partition_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_trait_mirror_edge_mirror_partition_list(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.MirrorPartitionListFeature) - return target; -} - -size_t MirrorPartitionListFeature::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.MirrorPartitionListFeature) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bool grin_trait_master_vertex_mirror_partition_list = 1; - if (this->grin_trait_master_vertex_mirror_partition_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_mirror_vertex_mirror_partition_list = 2; - if (this->grin_trait_mirror_vertex_mirror_partition_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_master_edge_mirror_partition_list = 3; - if (this->grin_trait_master_edge_mirror_partition_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_mirror_edge_mirror_partition_list = 4; - if (this->grin_trait_mirror_edge_mirror_partition_list() != 0) { - total_size += 1 + 1; - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void MirrorPartitionListFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.MirrorPartitionListFeature) - GOOGLE_DCHECK_NE(&from, this); - const MirrorPartitionListFeature* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.MirrorPartitionListFeature) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.MirrorPartitionListFeature) - MergeFrom(*source); - } -} - -void MirrorPartitionListFeature::MergeFrom(const MirrorPartitionListFeature& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.MirrorPartitionListFeature) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.grin_trait_master_vertex_mirror_partition_list() != 0) { - _internal_set_grin_trait_master_vertex_mirror_partition_list(from._internal_grin_trait_master_vertex_mirror_partition_list()); - } - if (from.grin_trait_mirror_vertex_mirror_partition_list() != 0) { - _internal_set_grin_trait_mirror_vertex_mirror_partition_list(from._internal_grin_trait_mirror_vertex_mirror_partition_list()); - } - if (from.grin_trait_master_edge_mirror_partition_list() != 0) { - _internal_set_grin_trait_master_edge_mirror_partition_list(from._internal_grin_trait_master_edge_mirror_partition_list()); - } - if (from.grin_trait_mirror_edge_mirror_partition_list() != 0) { - _internal_set_grin_trait_mirror_edge_mirror_partition_list(from._internal_grin_trait_mirror_edge_mirror_partition_list()); - } -} - -void MirrorPartitionListFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.MirrorPartitionListFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void MirrorPartitionListFeature::CopyFrom(const MirrorPartitionListFeature& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.MirrorPartitionListFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool MirrorPartitionListFeature::IsInitialized() const { - return true; -} - -void MirrorPartitionListFeature::InternalSwap(MirrorPartitionListFeature* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(MirrorPartitionListFeature, grin_trait_mirror_edge_mirror_partition_list_) - + sizeof(MirrorPartitionListFeature::grin_trait_mirror_edge_mirror_partition_list_) - - PROTOBUF_FIELD_OFFSET(MirrorPartitionListFeature, grin_trait_master_vertex_mirror_partition_list_)>( - reinterpret_cast(&grin_trait_master_vertex_mirror_partition_list_), - reinterpret_cast(&other->grin_trait_master_vertex_mirror_partition_list_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata MirrorPartitionListFeature::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void PartitionFeature::InitAsDefaultInstance() { - ::grin::_PartitionFeature_default_instance_._instance.get_mutable()->mirror_partition_list_feature_ = const_cast< ::grin::MirrorPartitionListFeature*>( - ::grin::MirrorPartitionListFeature::internal_default_instance()); -} -class PartitionFeature::_Internal { - public: - static const ::grin::MirrorPartitionListFeature& mirror_partition_list_feature(const PartitionFeature* msg); -}; - -const ::grin::MirrorPartitionListFeature& -PartitionFeature::_Internal::mirror_partition_list_feature(const PartitionFeature* msg) { - return *msg->mirror_partition_list_feature_; -} -PartitionFeature::PartitionFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.PartitionFeature) -} -PartitionFeature::PartitionFeature(const PartitionFeature& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - if (from._internal_has_mirror_partition_list_feature()) { - mirror_partition_list_feature_ = new ::grin::MirrorPartitionListFeature(*from.mirror_partition_list_feature_); - } else { - mirror_partition_list_feature_ = nullptr; - } - ::memcpy(&graph_partition_strategy_, &from.graph_partition_strategy_, - static_cast(reinterpret_cast(&grin_trait_fast_vertex_ref_) - - reinterpret_cast(&graph_partition_strategy_)) + sizeof(grin_trait_fast_vertex_ref_)); - // @@protoc_insertion_point(copy_constructor:grin.PartitionFeature) -} - -void PartitionFeature::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PartitionFeature_graph_2eproto.base); - ::memset(&mirror_partition_list_feature_, 0, static_cast( - reinterpret_cast(&grin_trait_fast_vertex_ref_) - - reinterpret_cast(&mirror_partition_list_feature_)) + sizeof(grin_trait_fast_vertex_ref_)); -} - -PartitionFeature::~PartitionFeature() { - // @@protoc_insertion_point(destructor:grin.PartitionFeature) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void PartitionFeature::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - if (this != internal_default_instance()) delete mirror_partition_list_feature_; -} - -void PartitionFeature::ArenaDtor(void* object) { - PartitionFeature* _this = reinterpret_cast< PartitionFeature* >(object); - (void)_this; -} -void PartitionFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void PartitionFeature::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const PartitionFeature& PartitionFeature::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PartitionFeature_graph_2eproto.base); - return *internal_default_instance(); -} - - -void PartitionFeature::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.PartitionFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (GetArena() == nullptr && mirror_partition_list_feature_ != nullptr) { - delete mirror_partition_list_feature_; - } - mirror_partition_list_feature_ = nullptr; - ::memset(&graph_partition_strategy_, 0, static_cast( - reinterpret_cast(&grin_trait_fast_vertex_ref_) - - reinterpret_cast(&graph_partition_strategy_)) + sizeof(grin_trait_fast_vertex_ref_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* PartitionFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .grin.GraphPartitionStrategy graph_partition_strategy = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_graph_partition_strategy(static_cast<::grin::GraphPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // bool grin_trait_natural_id_for_partition = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - grin_trait_natural_id_for_partition_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_enable_vertex_ref = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - grin_enable_vertex_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_enable_edge_ref = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - grin_enable_edge_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .grin.PropertyDataPartitionStrategy vertex_data = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_vertex_data(static_cast<::grin::PropertyDataPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // .grin.PropertyDataPartitionStrategy edge_data = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_edge_data(static_cast<::grin::PropertyDataPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { - ptr = ctx->ParseMessage(_internal_mutable_mirror_partition_list_feature(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_select_master_for_vertex_list = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { - grin_trait_select_master_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_select_partition_for_vertex_list = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { - grin_trait_select_partition_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_select_master_for_edge_list = 10; - case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { - grin_trait_select_master_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_select_partition_for_edge_list = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) { - grin_trait_select_partition_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; - case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) { - grin_trait_select_master_neighbor_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; - case 13: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) { - grin_trait_select_neighbor_partition_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_fast_vertex_ref = 14; - case 14: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) { - grin_trait_fast_vertex_ref_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* PartitionFeature::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.PartitionFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .grin.GraphPartitionStrategy graph_partition_strategy = 1; - if (this->graph_partition_strategy() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 1, this->_internal_graph_partition_strategy(), target); - } - - // bool grin_trait_natural_id_for_partition = 2; - if (this->grin_trait_natural_id_for_partition() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_trait_natural_id_for_partition(), target); - } - - // bool grin_enable_vertex_ref = 3; - if (this->grin_enable_vertex_ref() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_enable_vertex_ref(), target); - } - - // bool grin_enable_edge_ref = 4; - if (this->grin_enable_edge_ref() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_edge_ref(), target); - } - - // .grin.PropertyDataPartitionStrategy vertex_data = 5; - if (this->vertex_data() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 5, this->_internal_vertex_data(), target); - } - - // .grin.PropertyDataPartitionStrategy edge_data = 6; - if (this->edge_data() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 6, this->_internal_edge_data(), target); - } - - // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; - if (this->has_mirror_partition_list_feature()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 7, _Internal::mirror_partition_list_feature(this), target, stream); - } - - // bool grin_trait_select_master_for_vertex_list = 8; - if (this->grin_trait_select_master_for_vertex_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_trait_select_master_for_vertex_list(), target); - } - - // bool grin_trait_select_partition_for_vertex_list = 9; - if (this->grin_trait_select_partition_for_vertex_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(9, this->_internal_grin_trait_select_partition_for_vertex_list(), target); - } - - // bool grin_trait_select_master_for_edge_list = 10; - if (this->grin_trait_select_master_for_edge_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(10, this->_internal_grin_trait_select_master_for_edge_list(), target); - } - - // bool grin_trait_select_partition_for_edge_list = 11; - if (this->grin_trait_select_partition_for_edge_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(11, this->_internal_grin_trait_select_partition_for_edge_list(), target); - } - - // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; - if (this->grin_trait_select_master_neighbor_for_adjacent_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(12, this->_internal_grin_trait_select_master_neighbor_for_adjacent_list(), target); - } - - // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; - if (this->grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(13, this->_internal_grin_trait_select_neighbor_partition_for_adjacent_list(), target); - } - - // bool grin_trait_fast_vertex_ref = 14; - if (this->grin_trait_fast_vertex_ref() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(14, this->_internal_grin_trait_fast_vertex_ref(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.PartitionFeature) - return target; -} - -size_t PartitionFeature::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.PartitionFeature) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; - if (this->has_mirror_partition_list_feature()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *mirror_partition_list_feature_); - } - - // .grin.GraphPartitionStrategy graph_partition_strategy = 1; - if (this->graph_partition_strategy() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_graph_partition_strategy()); - } - - // bool grin_trait_natural_id_for_partition = 2; - if (this->grin_trait_natural_id_for_partition() != 0) { - total_size += 1 + 1; - } - - // bool grin_enable_vertex_ref = 3; - if (this->grin_enable_vertex_ref() != 0) { - total_size += 1 + 1; - } - - // bool grin_enable_edge_ref = 4; - if (this->grin_enable_edge_ref() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_select_master_for_vertex_list = 8; - if (this->grin_trait_select_master_for_vertex_list() != 0) { - total_size += 1 + 1; - } - - // .grin.PropertyDataPartitionStrategy vertex_data = 5; - if (this->vertex_data() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_vertex_data()); - } - - // .grin.PropertyDataPartitionStrategy edge_data = 6; - if (this->edge_data() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_edge_data()); - } - - // bool grin_trait_select_partition_for_vertex_list = 9; - if (this->grin_trait_select_partition_for_vertex_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_select_master_for_edge_list = 10; - if (this->grin_trait_select_master_for_edge_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_select_partition_for_edge_list = 11; - if (this->grin_trait_select_partition_for_edge_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; - if (this->grin_trait_select_master_neighbor_for_adjacent_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; - if (this->grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_fast_vertex_ref = 14; - if (this->grin_trait_fast_vertex_ref() != 0) { - total_size += 1 + 1; - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void PartitionFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.PartitionFeature) - GOOGLE_DCHECK_NE(&from, this); - const PartitionFeature* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.PartitionFeature) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.PartitionFeature) - MergeFrom(*source); - } -} - -void PartitionFeature::MergeFrom(const PartitionFeature& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.PartitionFeature) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.has_mirror_partition_list_feature()) { - _internal_mutable_mirror_partition_list_feature()->::grin::MirrorPartitionListFeature::MergeFrom(from._internal_mirror_partition_list_feature()); - } - if (from.graph_partition_strategy() != 0) { - _internal_set_graph_partition_strategy(from._internal_graph_partition_strategy()); - } - if (from.grin_trait_natural_id_for_partition() != 0) { - _internal_set_grin_trait_natural_id_for_partition(from._internal_grin_trait_natural_id_for_partition()); - } - if (from.grin_enable_vertex_ref() != 0) { - _internal_set_grin_enable_vertex_ref(from._internal_grin_enable_vertex_ref()); - } - if (from.grin_enable_edge_ref() != 0) { - _internal_set_grin_enable_edge_ref(from._internal_grin_enable_edge_ref()); - } - if (from.grin_trait_select_master_for_vertex_list() != 0) { - _internal_set_grin_trait_select_master_for_vertex_list(from._internal_grin_trait_select_master_for_vertex_list()); - } - if (from.vertex_data() != 0) { - _internal_set_vertex_data(from._internal_vertex_data()); - } - if (from.edge_data() != 0) { - _internal_set_edge_data(from._internal_edge_data()); - } - if (from.grin_trait_select_partition_for_vertex_list() != 0) { - _internal_set_grin_trait_select_partition_for_vertex_list(from._internal_grin_trait_select_partition_for_vertex_list()); - } - if (from.grin_trait_select_master_for_edge_list() != 0) { - _internal_set_grin_trait_select_master_for_edge_list(from._internal_grin_trait_select_master_for_edge_list()); - } - if (from.grin_trait_select_partition_for_edge_list() != 0) { - _internal_set_grin_trait_select_partition_for_edge_list(from._internal_grin_trait_select_partition_for_edge_list()); - } - if (from.grin_trait_select_master_neighbor_for_adjacent_list() != 0) { - _internal_set_grin_trait_select_master_neighbor_for_adjacent_list(from._internal_grin_trait_select_master_neighbor_for_adjacent_list()); - } - if (from.grin_trait_select_neighbor_partition_for_adjacent_list() != 0) { - _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(from._internal_grin_trait_select_neighbor_partition_for_adjacent_list()); - } - if (from.grin_trait_fast_vertex_ref() != 0) { - _internal_set_grin_trait_fast_vertex_ref(from._internal_grin_trait_fast_vertex_ref()); - } -} - -void PartitionFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.PartitionFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void PartitionFeature::CopyFrom(const PartitionFeature& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.PartitionFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool PartitionFeature::IsInitialized() const { - return true; -} - -void PartitionFeature::InternalSwap(PartitionFeature* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(PartitionFeature, grin_trait_fast_vertex_ref_) - + sizeof(PartitionFeature::grin_trait_fast_vertex_ref_) - - PROTOBUF_FIELD_OFFSET(PartitionFeature, mirror_partition_list_feature_)>( - reinterpret_cast(&mirror_partition_list_feature_), - reinterpret_cast(&other->mirror_partition_list_feature_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata PartitionFeature::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void VertexPropertyFeature::InitAsDefaultInstance() { -} -class VertexPropertyFeature::_Internal { - public: -}; - -VertexPropertyFeature::VertexPropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.VertexPropertyFeature) -} -VertexPropertyFeature::VertexPropertyFeature(const VertexPropertyFeature& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&grin_with_vertex_property_, &from.grin_with_vertex_property_, - static_cast(reinterpret_cast(&grin_assume_by_type_vertex_original_id_) - - reinterpret_cast(&grin_with_vertex_property_)) + sizeof(grin_assume_by_type_vertex_original_id_)); - // @@protoc_insertion_point(copy_constructor:grin.VertexPropertyFeature) -} - -void VertexPropertyFeature::SharedCtor() { - ::memset(&grin_with_vertex_property_, 0, static_cast( - reinterpret_cast(&grin_assume_by_type_vertex_original_id_) - - reinterpret_cast(&grin_with_vertex_property_)) + sizeof(grin_assume_by_type_vertex_original_id_)); -} - -VertexPropertyFeature::~VertexPropertyFeature() { - // @@protoc_insertion_point(destructor:grin.VertexPropertyFeature) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void VertexPropertyFeature::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); -} - -void VertexPropertyFeature::ArenaDtor(void* object) { - VertexPropertyFeature* _this = reinterpret_cast< VertexPropertyFeature* >(object); - (void)_this; -} -void VertexPropertyFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void VertexPropertyFeature::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const VertexPropertyFeature& VertexPropertyFeature::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_VertexPropertyFeature_graph_2eproto.base); - return *internal_default_instance(); -} - - -void VertexPropertyFeature::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.VertexPropertyFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&grin_with_vertex_property_, 0, static_cast( - reinterpret_cast(&grin_assume_by_type_vertex_original_id_) - - reinterpret_cast(&grin_with_vertex_property_)) + sizeof(grin_assume_by_type_vertex_original_id_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* VertexPropertyFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bool grin_with_vertex_property = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - grin_with_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_with_vertex_property_name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - grin_with_vertex_property_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_with_vertex_type_name = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - grin_with_vertex_type_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_enable_vertex_property_table = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - grin_enable_vertex_property_table_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_enable_vertex_primary_keys = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - grin_enable_vertex_primary_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_natural_id_for_vertex_type = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - grin_trait_natural_id_for_vertex_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_natural_id_for_vertex_property = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - grin_trait_natural_id_for_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_assume_by_type_vertex_original_id = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { - grin_assume_by_type_vertex_original_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* VertexPropertyFeature::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.VertexPropertyFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bool grin_with_vertex_property = 1; - if (this->grin_with_vertex_property() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_vertex_property(), target); - } - - // bool grin_with_vertex_property_name = 2; - if (this->grin_with_vertex_property_name() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_vertex_property_name(), target); - } - - // bool grin_with_vertex_type_name = 3; - if (this->grin_with_vertex_type_name() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_with_vertex_type_name(), target); - } - - // bool grin_enable_vertex_property_table = 4; - if (this->grin_enable_vertex_property_table() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_vertex_property_table(), target); - } - - // bool grin_enable_vertex_primary_keys = 5; - if (this->grin_enable_vertex_primary_keys() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_enable_vertex_primary_keys(), target); - } - - // bool grin_trait_natural_id_for_vertex_type = 6; - if (this->grin_trait_natural_id_for_vertex_type() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_trait_natural_id_for_vertex_type(), target); - } - - // bool grin_trait_natural_id_for_vertex_property = 7; - if (this->grin_trait_natural_id_for_vertex_property() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_trait_natural_id_for_vertex_property(), target); - } - - // bool grin_assume_by_type_vertex_original_id = 8; - if (this->grin_assume_by_type_vertex_original_id() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_assume_by_type_vertex_original_id(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.VertexPropertyFeature) - return target; -} - -size_t VertexPropertyFeature::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.VertexPropertyFeature) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bool grin_with_vertex_property = 1; - if (this->grin_with_vertex_property() != 0) { - total_size += 1 + 1; - } - - // bool grin_with_vertex_property_name = 2; - if (this->grin_with_vertex_property_name() != 0) { - total_size += 1 + 1; - } - - // bool grin_with_vertex_type_name = 3; - if (this->grin_with_vertex_type_name() != 0) { - total_size += 1 + 1; - } - - // bool grin_enable_vertex_property_table = 4; - if (this->grin_enable_vertex_property_table() != 0) { - total_size += 1 + 1; - } - - // bool grin_enable_vertex_primary_keys = 5; - if (this->grin_enable_vertex_primary_keys() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_natural_id_for_vertex_type = 6; - if (this->grin_trait_natural_id_for_vertex_type() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_natural_id_for_vertex_property = 7; - if (this->grin_trait_natural_id_for_vertex_property() != 0) { - total_size += 1 + 1; - } - - // bool grin_assume_by_type_vertex_original_id = 8; - if (this->grin_assume_by_type_vertex_original_id() != 0) { - total_size += 1 + 1; - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void VertexPropertyFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.VertexPropertyFeature) - GOOGLE_DCHECK_NE(&from, this); - const VertexPropertyFeature* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.VertexPropertyFeature) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.VertexPropertyFeature) - MergeFrom(*source); - } -} - -void VertexPropertyFeature::MergeFrom(const VertexPropertyFeature& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.VertexPropertyFeature) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.grin_with_vertex_property() != 0) { - _internal_set_grin_with_vertex_property(from._internal_grin_with_vertex_property()); - } - if (from.grin_with_vertex_property_name() != 0) { - _internal_set_grin_with_vertex_property_name(from._internal_grin_with_vertex_property_name()); - } - if (from.grin_with_vertex_type_name() != 0) { - _internal_set_grin_with_vertex_type_name(from._internal_grin_with_vertex_type_name()); - } - if (from.grin_enable_vertex_property_table() != 0) { - _internal_set_grin_enable_vertex_property_table(from._internal_grin_enable_vertex_property_table()); - } - if (from.grin_enable_vertex_primary_keys() != 0) { - _internal_set_grin_enable_vertex_primary_keys(from._internal_grin_enable_vertex_primary_keys()); - } - if (from.grin_trait_natural_id_for_vertex_type() != 0) { - _internal_set_grin_trait_natural_id_for_vertex_type(from._internal_grin_trait_natural_id_for_vertex_type()); - } - if (from.grin_trait_natural_id_for_vertex_property() != 0) { - _internal_set_grin_trait_natural_id_for_vertex_property(from._internal_grin_trait_natural_id_for_vertex_property()); - } - if (from.grin_assume_by_type_vertex_original_id() != 0) { - _internal_set_grin_assume_by_type_vertex_original_id(from._internal_grin_assume_by_type_vertex_original_id()); - } -} - -void VertexPropertyFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.VertexPropertyFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void VertexPropertyFeature::CopyFrom(const VertexPropertyFeature& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.VertexPropertyFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool VertexPropertyFeature::IsInitialized() const { - return true; -} - -void VertexPropertyFeature::InternalSwap(VertexPropertyFeature* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(VertexPropertyFeature, grin_assume_by_type_vertex_original_id_) - + sizeof(VertexPropertyFeature::grin_assume_by_type_vertex_original_id_) - - PROTOBUF_FIELD_OFFSET(VertexPropertyFeature, grin_with_vertex_property_)>( - reinterpret_cast(&grin_with_vertex_property_), - reinterpret_cast(&other->grin_with_vertex_property_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata VertexPropertyFeature::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void EdgePropertyFeature::InitAsDefaultInstance() { -} -class EdgePropertyFeature::_Internal { - public: -}; - -EdgePropertyFeature::EdgePropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.EdgePropertyFeature) -} -EdgePropertyFeature::EdgePropertyFeature(const EdgePropertyFeature& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&grin_with_edge_property_, &from.grin_with_edge_property_, - static_cast(reinterpret_cast(&grin_trait_natural_id_for_edge_property_) - - reinterpret_cast(&grin_with_edge_property_)) + sizeof(grin_trait_natural_id_for_edge_property_)); - // @@protoc_insertion_point(copy_constructor:grin.EdgePropertyFeature) -} - -void EdgePropertyFeature::SharedCtor() { - ::memset(&grin_with_edge_property_, 0, static_cast( - reinterpret_cast(&grin_trait_natural_id_for_edge_property_) - - reinterpret_cast(&grin_with_edge_property_)) + sizeof(grin_trait_natural_id_for_edge_property_)); -} - -EdgePropertyFeature::~EdgePropertyFeature() { - // @@protoc_insertion_point(destructor:grin.EdgePropertyFeature) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void EdgePropertyFeature::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); -} - -void EdgePropertyFeature::ArenaDtor(void* object) { - EdgePropertyFeature* _this = reinterpret_cast< EdgePropertyFeature* >(object); - (void)_this; -} -void EdgePropertyFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void EdgePropertyFeature::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const EdgePropertyFeature& EdgePropertyFeature::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_EdgePropertyFeature_graph_2eproto.base); - return *internal_default_instance(); -} - - -void EdgePropertyFeature::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.EdgePropertyFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&grin_with_edge_property_, 0, static_cast( - reinterpret_cast(&grin_trait_natural_id_for_edge_property_) - - reinterpret_cast(&grin_with_edge_property_)) + sizeof(grin_trait_natural_id_for_edge_property_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* EdgePropertyFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bool grin_with_edge_property = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - grin_with_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_with_edge_property_name = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - grin_with_edge_property_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_with_edge_type_name = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - grin_with_edge_type_name_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_enable_edge_property_table = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - grin_enable_edge_property_table_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_enable_edge_primary_keys = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - grin_enable_edge_primary_keys_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_natural_id_for_edge_type = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - grin_trait_natural_id_for_edge_type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_natural_id_for_edge_property = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - grin_trait_natural_id_for_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* EdgePropertyFeature::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.EdgePropertyFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bool grin_with_edge_property = 1; - if (this->grin_with_edge_property() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_edge_property(), target); - } - - // bool grin_with_edge_property_name = 2; - if (this->grin_with_edge_property_name() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_edge_property_name(), target); - } - - // bool grin_with_edge_type_name = 3; - if (this->grin_with_edge_type_name() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_with_edge_type_name(), target); - } - - // bool grin_enable_edge_property_table = 4; - if (this->grin_enable_edge_property_table() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(4, this->_internal_grin_enable_edge_property_table(), target); - } - - // bool grin_enable_edge_primary_keys = 5; - if (this->grin_enable_edge_primary_keys() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(5, this->_internal_grin_enable_edge_primary_keys(), target); - } - - // bool grin_trait_natural_id_for_edge_type = 6; - if (this->grin_trait_natural_id_for_edge_type() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_trait_natural_id_for_edge_type(), target); - } - - // bool grin_trait_natural_id_for_edge_property = 7; - if (this->grin_trait_natural_id_for_edge_property() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_trait_natural_id_for_edge_property(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.EdgePropertyFeature) - return target; -} - -size_t EdgePropertyFeature::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.EdgePropertyFeature) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bool grin_with_edge_property = 1; - if (this->grin_with_edge_property() != 0) { - total_size += 1 + 1; - } - - // bool grin_with_edge_property_name = 2; - if (this->grin_with_edge_property_name() != 0) { - total_size += 1 + 1; - } - - // bool grin_with_edge_type_name = 3; - if (this->grin_with_edge_type_name() != 0) { - total_size += 1 + 1; - } - - // bool grin_enable_edge_property_table = 4; - if (this->grin_enable_edge_property_table() != 0) { - total_size += 1 + 1; - } - - // bool grin_enable_edge_primary_keys = 5; - if (this->grin_enable_edge_primary_keys() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_natural_id_for_edge_type = 6; - if (this->grin_trait_natural_id_for_edge_type() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_natural_id_for_edge_property = 7; - if (this->grin_trait_natural_id_for_edge_property() != 0) { - total_size += 1 + 1; - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void EdgePropertyFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.EdgePropertyFeature) - GOOGLE_DCHECK_NE(&from, this); - const EdgePropertyFeature* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.EdgePropertyFeature) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.EdgePropertyFeature) - MergeFrom(*source); - } -} - -void EdgePropertyFeature::MergeFrom(const EdgePropertyFeature& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.EdgePropertyFeature) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.grin_with_edge_property() != 0) { - _internal_set_grin_with_edge_property(from._internal_grin_with_edge_property()); - } - if (from.grin_with_edge_property_name() != 0) { - _internal_set_grin_with_edge_property_name(from._internal_grin_with_edge_property_name()); - } - if (from.grin_with_edge_type_name() != 0) { - _internal_set_grin_with_edge_type_name(from._internal_grin_with_edge_type_name()); - } - if (from.grin_enable_edge_property_table() != 0) { - _internal_set_grin_enable_edge_property_table(from._internal_grin_enable_edge_property_table()); - } - if (from.grin_enable_edge_primary_keys() != 0) { - _internal_set_grin_enable_edge_primary_keys(from._internal_grin_enable_edge_primary_keys()); - } - if (from.grin_trait_natural_id_for_edge_type() != 0) { - _internal_set_grin_trait_natural_id_for_edge_type(from._internal_grin_trait_natural_id_for_edge_type()); - } - if (from.grin_trait_natural_id_for_edge_property() != 0) { - _internal_set_grin_trait_natural_id_for_edge_property(from._internal_grin_trait_natural_id_for_edge_property()); - } -} - -void EdgePropertyFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.EdgePropertyFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void EdgePropertyFeature::CopyFrom(const EdgePropertyFeature& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.EdgePropertyFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool EdgePropertyFeature::IsInitialized() const { - return true; -} - -void EdgePropertyFeature::InternalSwap(EdgePropertyFeature* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(EdgePropertyFeature, grin_trait_natural_id_for_edge_property_) - + sizeof(EdgePropertyFeature::grin_trait_natural_id_for_edge_property_) - - PROTOBUF_FIELD_OFFSET(EdgePropertyFeature, grin_with_edge_property_)>( - reinterpret_cast(&grin_with_edge_property_), - reinterpret_cast(&other->grin_with_edge_property_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata EdgePropertyFeature::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void PropertyFeature::InitAsDefaultInstance() { - ::grin::_PropertyFeature_default_instance_._instance.get_mutable()->vertex_property_feature_ = const_cast< ::grin::VertexPropertyFeature*>( - ::grin::VertexPropertyFeature::internal_default_instance()); - ::grin::_PropertyFeature_default_instance_._instance.get_mutable()->edge_property_feature_ = const_cast< ::grin::EdgePropertyFeature*>( - ::grin::EdgePropertyFeature::internal_default_instance()); -} -class PropertyFeature::_Internal { - public: - static const ::grin::VertexPropertyFeature& vertex_property_feature(const PropertyFeature* msg); - static const ::grin::EdgePropertyFeature& edge_property_feature(const PropertyFeature* msg); -}; - -const ::grin::VertexPropertyFeature& -PropertyFeature::_Internal::vertex_property_feature(const PropertyFeature* msg) { - return *msg->vertex_property_feature_; -} -const ::grin::EdgePropertyFeature& -PropertyFeature::_Internal::edge_property_feature(const PropertyFeature* msg) { - return *msg->edge_property_feature_; -} -PropertyFeature::PropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.PropertyFeature) -} -PropertyFeature::PropertyFeature(const PropertyFeature& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - if (from._internal_has_vertex_property_feature()) { - vertex_property_feature_ = new ::grin::VertexPropertyFeature(*from.vertex_property_feature_); - } else { - vertex_property_feature_ = nullptr; - } - if (from._internal_has_edge_property_feature()) { - edge_property_feature_ = new ::grin::EdgePropertyFeature(*from.edge_property_feature_); - } else { - edge_property_feature_ = nullptr; - } - ::memcpy(&vertex_property_, &from.vertex_property_, - static_cast(reinterpret_cast(&grin_trait_specific_vev_relation_) - - reinterpret_cast(&vertex_property_)) + sizeof(grin_trait_specific_vev_relation_)); - // @@protoc_insertion_point(copy_constructor:grin.PropertyFeature) -} - -void PropertyFeature::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_PropertyFeature_graph_2eproto.base); - ::memset(&vertex_property_feature_, 0, static_cast( - reinterpret_cast(&grin_trait_specific_vev_relation_) - - reinterpret_cast(&vertex_property_feature_)) + sizeof(grin_trait_specific_vev_relation_)); -} - -PropertyFeature::~PropertyFeature() { - // @@protoc_insertion_point(destructor:grin.PropertyFeature) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void PropertyFeature::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - if (this != internal_default_instance()) delete vertex_property_feature_; - if (this != internal_default_instance()) delete edge_property_feature_; -} - -void PropertyFeature::ArenaDtor(void* object) { - PropertyFeature* _this = reinterpret_cast< PropertyFeature* >(object); - (void)_this; -} -void PropertyFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void PropertyFeature::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const PropertyFeature& PropertyFeature::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PropertyFeature_graph_2eproto.base); - return *internal_default_instance(); -} - - -void PropertyFeature::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.PropertyFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (GetArena() == nullptr && vertex_property_feature_ != nullptr) { - delete vertex_property_feature_; - } - vertex_property_feature_ = nullptr; - if (GetArena() == nullptr && edge_property_feature_ != nullptr) { - delete edge_property_feature_; - } - edge_property_feature_ = nullptr; - ::memset(&vertex_property_, 0, static_cast( - reinterpret_cast(&grin_trait_specific_vev_relation_) - - reinterpret_cast(&vertex_property_)) + sizeof(grin_trait_specific_vev_relation_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* PropertyFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bool grin_enable_row = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - grin_enable_row_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .grin.VertexPropertyFeature vertex_property_feature = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_vertex_property_feature(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .grin.EdgePropertyFeature edge_property_feature = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_edge_property_feature(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .grin.PropertyDataPartitionStrategy vertex_property = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_vertex_property(static_cast<::grin::PropertyDataPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // .grin.PropertyDataPartitionStrategy edge_property = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - _internal_set_edge_property(static_cast<::grin::PropertyDataPartitionStrategy>(val)); - } else goto handle_unusual; - continue; - // bool grin_assume_column_store_for_vertex_property = 6; - case 6: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { - grin_assume_column_store_for_vertex_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_assume_column_store_for_edge_property = 7; - case 7: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { - grin_assume_column_store_for_edge_property_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_select_type_for_vertex_list = 8; - case 8: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { - grin_trait_select_type_for_vertex_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_select_type_for_edge_list = 9; - case 9: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { - grin_trait_select_type_for_edge_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; - case 10: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { - grin_trait_select_neighbor_type_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_select_edge_type_for_adjacent_list = 11; - case 11: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) { - grin_trait_select_edge_type_for_adjacent_list_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_trait_specific_vev_relation = 12; - case 12: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) { - grin_trait_specific_vev_relation_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* PropertyFeature::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.PropertyFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bool grin_enable_row = 1; - if (this->grin_enable_row() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_enable_row(), target); - } - - // .grin.VertexPropertyFeature vertex_property_feature = 2; - if (this->has_vertex_property_feature()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::vertex_property_feature(this), target, stream); - } - - // .grin.EdgePropertyFeature edge_property_feature = 3; - if (this->has_edge_property_feature()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::edge_property_feature(this), target, stream); - } - - // .grin.PropertyDataPartitionStrategy vertex_property = 4; - if (this->vertex_property() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 4, this->_internal_vertex_property(), target); - } - - // .grin.PropertyDataPartitionStrategy edge_property = 5; - if (this->edge_property() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( - 5, this->_internal_edge_property(), target); - } - - // bool grin_assume_column_store_for_vertex_property = 6; - if (this->grin_assume_column_store_for_vertex_property() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(6, this->_internal_grin_assume_column_store_for_vertex_property(), target); - } - - // bool grin_assume_column_store_for_edge_property = 7; - if (this->grin_assume_column_store_for_edge_property() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(7, this->_internal_grin_assume_column_store_for_edge_property(), target); - } - - // bool grin_trait_select_type_for_vertex_list = 8; - if (this->grin_trait_select_type_for_vertex_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(8, this->_internal_grin_trait_select_type_for_vertex_list(), target); - } - - // bool grin_trait_select_type_for_edge_list = 9; - if (this->grin_trait_select_type_for_edge_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(9, this->_internal_grin_trait_select_type_for_edge_list(), target); - } - - // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; - if (this->grin_trait_select_neighbor_type_for_adjacent_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(10, this->_internal_grin_trait_select_neighbor_type_for_adjacent_list(), target); - } - - // bool grin_trait_select_edge_type_for_adjacent_list = 11; - if (this->grin_trait_select_edge_type_for_adjacent_list() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(11, this->_internal_grin_trait_select_edge_type_for_adjacent_list(), target); - } - - // bool grin_trait_specific_vev_relation = 12; - if (this->grin_trait_specific_vev_relation() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(12, this->_internal_grin_trait_specific_vev_relation(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.PropertyFeature) - return target; -} - -size_t PropertyFeature::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.PropertyFeature) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // .grin.VertexPropertyFeature vertex_property_feature = 2; - if (this->has_vertex_property_feature()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *vertex_property_feature_); - } - - // .grin.EdgePropertyFeature edge_property_feature = 3; - if (this->has_edge_property_feature()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *edge_property_feature_); - } - - // .grin.PropertyDataPartitionStrategy vertex_property = 4; - if (this->vertex_property() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_vertex_property()); - } - - // .grin.PropertyDataPartitionStrategy edge_property = 5; - if (this->edge_property() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_edge_property()); - } - - // bool grin_enable_row = 1; - if (this->grin_enable_row() != 0) { - total_size += 1 + 1; - } - - // bool grin_assume_column_store_for_vertex_property = 6; - if (this->grin_assume_column_store_for_vertex_property() != 0) { - total_size += 1 + 1; - } - - // bool grin_assume_column_store_for_edge_property = 7; - if (this->grin_assume_column_store_for_edge_property() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_select_type_for_vertex_list = 8; - if (this->grin_trait_select_type_for_vertex_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_select_type_for_edge_list = 9; - if (this->grin_trait_select_type_for_edge_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; - if (this->grin_trait_select_neighbor_type_for_adjacent_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_select_edge_type_for_adjacent_list = 11; - if (this->grin_trait_select_edge_type_for_adjacent_list() != 0) { - total_size += 1 + 1; - } - - // bool grin_trait_specific_vev_relation = 12; - if (this->grin_trait_specific_vev_relation() != 0) { - total_size += 1 + 1; - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void PropertyFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.PropertyFeature) - GOOGLE_DCHECK_NE(&from, this); - const PropertyFeature* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.PropertyFeature) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.PropertyFeature) - MergeFrom(*source); - } -} - -void PropertyFeature::MergeFrom(const PropertyFeature& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.PropertyFeature) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.has_vertex_property_feature()) { - _internal_mutable_vertex_property_feature()->::grin::VertexPropertyFeature::MergeFrom(from._internal_vertex_property_feature()); - } - if (from.has_edge_property_feature()) { - _internal_mutable_edge_property_feature()->::grin::EdgePropertyFeature::MergeFrom(from._internal_edge_property_feature()); - } - if (from.vertex_property() != 0) { - _internal_set_vertex_property(from._internal_vertex_property()); - } - if (from.edge_property() != 0) { - _internal_set_edge_property(from._internal_edge_property()); - } - if (from.grin_enable_row() != 0) { - _internal_set_grin_enable_row(from._internal_grin_enable_row()); - } - if (from.grin_assume_column_store_for_vertex_property() != 0) { - _internal_set_grin_assume_column_store_for_vertex_property(from._internal_grin_assume_column_store_for_vertex_property()); - } - if (from.grin_assume_column_store_for_edge_property() != 0) { - _internal_set_grin_assume_column_store_for_edge_property(from._internal_grin_assume_column_store_for_edge_property()); - } - if (from.grin_trait_select_type_for_vertex_list() != 0) { - _internal_set_grin_trait_select_type_for_vertex_list(from._internal_grin_trait_select_type_for_vertex_list()); - } - if (from.grin_trait_select_type_for_edge_list() != 0) { - _internal_set_grin_trait_select_type_for_edge_list(from._internal_grin_trait_select_type_for_edge_list()); - } - if (from.grin_trait_select_neighbor_type_for_adjacent_list() != 0) { - _internal_set_grin_trait_select_neighbor_type_for_adjacent_list(from._internal_grin_trait_select_neighbor_type_for_adjacent_list()); - } - if (from.grin_trait_select_edge_type_for_adjacent_list() != 0) { - _internal_set_grin_trait_select_edge_type_for_adjacent_list(from._internal_grin_trait_select_edge_type_for_adjacent_list()); - } - if (from.grin_trait_specific_vev_relation() != 0) { - _internal_set_grin_trait_specific_vev_relation(from._internal_grin_trait_specific_vev_relation()); - } -} - -void PropertyFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.PropertyFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void PropertyFeature::CopyFrom(const PropertyFeature& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.PropertyFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool PropertyFeature::IsInitialized() const { - return true; -} - -void PropertyFeature::InternalSwap(PropertyFeature* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(PropertyFeature, grin_trait_specific_vev_relation_) - + sizeof(PropertyFeature::grin_trait_specific_vev_relation_) - - PROTOBUF_FIELD_OFFSET(PropertyFeature, vertex_property_feature_)>( - reinterpret_cast(&vertex_property_feature_), - reinterpret_cast(&other->vertex_property_feature_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata PropertyFeature::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void IndexFeature::InitAsDefaultInstance() { -} -class IndexFeature::_Internal { - public: -}; - -IndexFeature::IndexFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.IndexFeature) -} -IndexFeature::IndexFeature(const IndexFeature& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&grin_with_vertex_label_, &from.grin_with_vertex_label_, - static_cast(reinterpret_cast(&grin_assume_all_vertex_list_sorted_) - - reinterpret_cast(&grin_with_vertex_label_)) + sizeof(grin_assume_all_vertex_list_sorted_)); - // @@protoc_insertion_point(copy_constructor:grin.IndexFeature) -} - -void IndexFeature::SharedCtor() { - ::memset(&grin_with_vertex_label_, 0, static_cast( - reinterpret_cast(&grin_assume_all_vertex_list_sorted_) - - reinterpret_cast(&grin_with_vertex_label_)) + sizeof(grin_assume_all_vertex_list_sorted_)); -} - -IndexFeature::~IndexFeature() { - // @@protoc_insertion_point(destructor:grin.IndexFeature) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void IndexFeature::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); -} - -void IndexFeature::ArenaDtor(void* object) { - IndexFeature* _this = reinterpret_cast< IndexFeature* >(object); - (void)_this; -} -void IndexFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void IndexFeature::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const IndexFeature& IndexFeature::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_IndexFeature_graph_2eproto.base); - return *internal_default_instance(); -} - - -void IndexFeature::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.IndexFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&grin_with_vertex_label_, 0, static_cast( - reinterpret_cast(&grin_assume_all_vertex_list_sorted_) - - reinterpret_cast(&grin_with_vertex_label_)) + sizeof(grin_assume_all_vertex_list_sorted_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* IndexFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // bool grin_with_vertex_label = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - grin_with_vertex_label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_with_edge_label = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - grin_with_edge_label_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // bool grin_assume_all_vertex_list_sorted = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - grin_assume_all_vertex_list_sorted_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* IndexFeature::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.IndexFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // bool grin_with_vertex_label = 1; - if (this->grin_with_vertex_label() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(1, this->_internal_grin_with_vertex_label(), target); - } - - // bool grin_with_edge_label = 2; - if (this->grin_with_edge_label() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_grin_with_edge_label(), target); - } - - // bool grin_assume_all_vertex_list_sorted = 3; - if (this->grin_assume_all_vertex_list_sorted() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(3, this->_internal_grin_assume_all_vertex_list_sorted(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.IndexFeature) - return target; -} - -size_t IndexFeature::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.IndexFeature) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // bool grin_with_vertex_label = 1; - if (this->grin_with_vertex_label() != 0) { - total_size += 1 + 1; - } - - // bool grin_with_edge_label = 2; - if (this->grin_with_edge_label() != 0) { - total_size += 1 + 1; - } - - // bool grin_assume_all_vertex_list_sorted = 3; - if (this->grin_assume_all_vertex_list_sorted() != 0) { - total_size += 1 + 1; - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void IndexFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.IndexFeature) - GOOGLE_DCHECK_NE(&from, this); - const IndexFeature* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.IndexFeature) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.IndexFeature) - MergeFrom(*source); - } -} - -void IndexFeature::MergeFrom(const IndexFeature& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.IndexFeature) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.grin_with_vertex_label() != 0) { - _internal_set_grin_with_vertex_label(from._internal_grin_with_vertex_label()); - } - if (from.grin_with_edge_label() != 0) { - _internal_set_grin_with_edge_label(from._internal_grin_with_edge_label()); - } - if (from.grin_assume_all_vertex_list_sorted() != 0) { - _internal_set_grin_assume_all_vertex_list_sorted(from._internal_grin_assume_all_vertex_list_sorted()); - } -} - -void IndexFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.IndexFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void IndexFeature::CopyFrom(const IndexFeature& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.IndexFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool IndexFeature::IsInitialized() const { - return true; -} - -void IndexFeature::InternalSwap(IndexFeature* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(IndexFeature, grin_assume_all_vertex_list_sorted_) - + sizeof(IndexFeature::grin_assume_all_vertex_list_sorted_) - - PROTOBUF_FIELD_OFFSET(IndexFeature, grin_with_vertex_label_)>( - reinterpret_cast(&grin_with_vertex_label_), - reinterpret_cast(&other->grin_with_vertex_label_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata IndexFeature::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void PredicateFeature::InitAsDefaultInstance() { -} -class PredicateFeature::_Internal { - public: -}; - -PredicateFeature::PredicateFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.PredicateFeature) -} -PredicateFeature::PredicateFeature(const PredicateFeature& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - // @@protoc_insertion_point(copy_constructor:grin.PredicateFeature) -} - -void PredicateFeature::SharedCtor() { -} - -PredicateFeature::~PredicateFeature() { - // @@protoc_insertion_point(destructor:grin.PredicateFeature) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void PredicateFeature::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); -} - -void PredicateFeature::ArenaDtor(void* object) { - PredicateFeature* _this = reinterpret_cast< PredicateFeature* >(object); - (void)_this; -} -void PredicateFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void PredicateFeature::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const PredicateFeature& PredicateFeature::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_PredicateFeature_graph_2eproto.base); - return *internal_default_instance(); -} - - -void PredicateFeature::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.PredicateFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* PredicateFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* PredicateFeature::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.PredicateFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.PredicateFeature) - return target; -} - -size_t PredicateFeature::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.PredicateFeature) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void PredicateFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.PredicateFeature) - GOOGLE_DCHECK_NE(&from, this); - const PredicateFeature* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.PredicateFeature) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.PredicateFeature) - MergeFrom(*source); - } -} - -void PredicateFeature::MergeFrom(const PredicateFeature& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.PredicateFeature) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - -} - -void PredicateFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.PredicateFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void PredicateFeature::CopyFrom(const PredicateFeature& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.PredicateFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool PredicateFeature::IsInitialized() const { - return true; -} - -void PredicateFeature::InternalSwap(PredicateFeature* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata PredicateFeature::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void StorageFeature::InitAsDefaultInstance() { - ::grin::_StorageFeature_default_instance_.topology_feature_ = const_cast< ::grin::TopologyFeature*>( - ::grin::TopologyFeature::internal_default_instance()); - ::grin::_StorageFeature_default_instance_.partition_feature_ = const_cast< ::grin::PartitionFeature*>( - ::grin::PartitionFeature::internal_default_instance()); - ::grin::_StorageFeature_default_instance_.property_feature_ = const_cast< ::grin::PropertyFeature*>( - ::grin::PropertyFeature::internal_default_instance()); - ::grin::_StorageFeature_default_instance_.index_feature_ = const_cast< ::grin::IndexFeature*>( - ::grin::IndexFeature::internal_default_instance()); - ::grin::_StorageFeature_default_instance_.predicate_feature_ = const_cast< ::grin::PredicateFeature*>( - ::grin::PredicateFeature::internal_default_instance()); -} -class StorageFeature::_Internal { - public: - static const ::grin::TopologyFeature& topology_feature(const StorageFeature* msg); - static const ::grin::PartitionFeature& partition_feature(const StorageFeature* msg); - static const ::grin::PropertyFeature& property_feature(const StorageFeature* msg); - static const ::grin::IndexFeature& index_feature(const StorageFeature* msg); - static const ::grin::PredicateFeature& predicate_feature(const StorageFeature* msg); -}; - -const ::grin::TopologyFeature& -StorageFeature::_Internal::topology_feature(const StorageFeature* msg) { - return *msg->specific_feature_.topology_feature_; -} -const ::grin::PartitionFeature& -StorageFeature::_Internal::partition_feature(const StorageFeature* msg) { - return *msg->specific_feature_.partition_feature_; -} -const ::grin::PropertyFeature& -StorageFeature::_Internal::property_feature(const StorageFeature* msg) { - return *msg->specific_feature_.property_feature_; -} -const ::grin::IndexFeature& -StorageFeature::_Internal::index_feature(const StorageFeature* msg) { - return *msg->specific_feature_.index_feature_; -} -const ::grin::PredicateFeature& -StorageFeature::_Internal::predicate_feature(const StorageFeature* msg) { - return *msg->specific_feature_.predicate_feature_; -} -void StorageFeature::set_allocated_topology_feature(::grin::TopologyFeature* topology_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - clear_specific_feature(); - if (topology_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(topology_feature); - if (message_arena != submessage_arena) { - topology_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, topology_feature, submessage_arena); - } - set_has_topology_feature(); - specific_feature_.topology_feature_ = topology_feature; - } - // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.topology_feature) -} -void StorageFeature::set_allocated_partition_feature(::grin::PartitionFeature* partition_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - clear_specific_feature(); - if (partition_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(partition_feature); - if (message_arena != submessage_arena) { - partition_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, partition_feature, submessage_arena); - } - set_has_partition_feature(); - specific_feature_.partition_feature_ = partition_feature; - } - // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.partition_feature) -} -void StorageFeature::set_allocated_property_feature(::grin::PropertyFeature* property_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - clear_specific_feature(); - if (property_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(property_feature); - if (message_arena != submessage_arena) { - property_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, property_feature, submessage_arena); - } - set_has_property_feature(); - specific_feature_.property_feature_ = property_feature; - } - // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.property_feature) -} -void StorageFeature::set_allocated_index_feature(::grin::IndexFeature* index_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - clear_specific_feature(); - if (index_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(index_feature); - if (message_arena != submessage_arena) { - index_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, index_feature, submessage_arena); - } - set_has_index_feature(); - specific_feature_.index_feature_ = index_feature; - } - // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.index_feature) -} -void StorageFeature::set_allocated_predicate_feature(::grin::PredicateFeature* predicate_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - clear_specific_feature(); - if (predicate_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(predicate_feature); - if (message_arena != submessage_arena) { - predicate_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, predicate_feature, submessage_arena); - } - set_has_predicate_feature(); - specific_feature_.predicate_feature_ = predicate_feature; - } - // @@protoc_insertion_point(field_set_allocated:grin.StorageFeature.predicate_feature) -} -StorageFeature::StorageFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.StorageFeature) -} -StorageFeature::StorageFeature(const StorageFeature& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - clear_has_specific_feature(); - switch (from.specific_feature_case()) { - case kTopologyFeature: { - _internal_mutable_topology_feature()->::grin::TopologyFeature::MergeFrom(from._internal_topology_feature()); - break; - } - case kPartitionFeature: { - _internal_mutable_partition_feature()->::grin::PartitionFeature::MergeFrom(from._internal_partition_feature()); - break; - } - case kPropertyFeature: { - _internal_mutable_property_feature()->::grin::PropertyFeature::MergeFrom(from._internal_property_feature()); - break; - } - case kIndexFeature: { - _internal_mutable_index_feature()->::grin::IndexFeature::MergeFrom(from._internal_index_feature()); - break; - } - case kPredicateFeature: { - _internal_mutable_predicate_feature()->::grin::PredicateFeature::MergeFrom(from._internal_predicate_feature()); - break; - } - case SPECIFIC_FEATURE_NOT_SET: { - break; - } - } - // @@protoc_insertion_point(copy_constructor:grin.StorageFeature) -} - -void StorageFeature::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_StorageFeature_graph_2eproto.base); - clear_has_specific_feature(); -} - -StorageFeature::~StorageFeature() { - // @@protoc_insertion_point(destructor:grin.StorageFeature) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void StorageFeature::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - if (has_specific_feature()) { - clear_specific_feature(); - } -} - -void StorageFeature::ArenaDtor(void* object) { - StorageFeature* _this = reinterpret_cast< StorageFeature* >(object); - (void)_this; -} -void StorageFeature::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void StorageFeature::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const StorageFeature& StorageFeature::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_StorageFeature_graph_2eproto.base); - return *internal_default_instance(); -} - - -void StorageFeature::clear_specific_feature() { -// @@protoc_insertion_point(one_of_clear_start:grin.StorageFeature) - switch (specific_feature_case()) { - case kTopologyFeature: { - if (GetArena() == nullptr) { - delete specific_feature_.topology_feature_; - } - break; - } - case kPartitionFeature: { - if (GetArena() == nullptr) { - delete specific_feature_.partition_feature_; - } - break; - } - case kPropertyFeature: { - if (GetArena() == nullptr) { - delete specific_feature_.property_feature_; - } - break; - } - case kIndexFeature: { - if (GetArena() == nullptr) { - delete specific_feature_.index_feature_; - } - break; - } - case kPredicateFeature: { - if (GetArena() == nullptr) { - delete specific_feature_.predicate_feature_; - } - break; - } - case SPECIFIC_FEATURE_NOT_SET: { - break; - } - } - _oneof_case_[0] = SPECIFIC_FEATURE_NOT_SET; -} - - -void StorageFeature::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.StorageFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - clear_specific_feature(); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* StorageFeature::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // .grin.TopologyFeature topology_feature = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - ptr = ctx->ParseMessage(_internal_mutable_topology_feature(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .grin.PartitionFeature partition_feature = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - ptr = ctx->ParseMessage(_internal_mutable_partition_feature(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .grin.PropertyFeature property_feature = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr = ctx->ParseMessage(_internal_mutable_property_feature(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .grin.IndexFeature index_feature = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr = ctx->ParseMessage(_internal_mutable_index_feature(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // .grin.PredicateFeature predicate_feature = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { - ptr = ctx->ParseMessage(_internal_mutable_predicate_feature(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* StorageFeature::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.StorageFeature) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // .grin.TopologyFeature topology_feature = 1; - if (_internal_has_topology_feature()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 1, _Internal::topology_feature(this), target, stream); - } - - // .grin.PartitionFeature partition_feature = 2; - if (_internal_has_partition_feature()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 2, _Internal::partition_feature(this), target, stream); - } - - // .grin.PropertyFeature property_feature = 3; - if (_internal_has_property_feature()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 3, _Internal::property_feature(this), target, stream); - } - - // .grin.IndexFeature index_feature = 4; - if (_internal_has_index_feature()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::index_feature(this), target, stream); - } - - // .grin.PredicateFeature predicate_feature = 5; - if (_internal_has_predicate_feature()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 5, _Internal::predicate_feature(this), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.StorageFeature) - return target; -} - -size_t StorageFeature::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.StorageFeature) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - switch (specific_feature_case()) { - // .grin.TopologyFeature topology_feature = 1; - case kTopologyFeature: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *specific_feature_.topology_feature_); - break; - } - // .grin.PartitionFeature partition_feature = 2; - case kPartitionFeature: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *specific_feature_.partition_feature_); - break; - } - // .grin.PropertyFeature property_feature = 3; - case kPropertyFeature: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *specific_feature_.property_feature_); - break; - } - // .grin.IndexFeature index_feature = 4; - case kIndexFeature: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *specific_feature_.index_feature_); - break; - } - // .grin.PredicateFeature predicate_feature = 5; - case kPredicateFeature: { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *specific_feature_.predicate_feature_); - break; - } - case SPECIFIC_FEATURE_NOT_SET: { - break; - } - } - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void StorageFeature::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.StorageFeature) - GOOGLE_DCHECK_NE(&from, this); - const StorageFeature* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.StorageFeature) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.StorageFeature) - MergeFrom(*source); - } -} - -void StorageFeature::MergeFrom(const StorageFeature& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.StorageFeature) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - switch (from.specific_feature_case()) { - case kTopologyFeature: { - _internal_mutable_topology_feature()->::grin::TopologyFeature::MergeFrom(from._internal_topology_feature()); - break; - } - case kPartitionFeature: { - _internal_mutable_partition_feature()->::grin::PartitionFeature::MergeFrom(from._internal_partition_feature()); - break; - } - case kPropertyFeature: { - _internal_mutable_property_feature()->::grin::PropertyFeature::MergeFrom(from._internal_property_feature()); - break; - } - case kIndexFeature: { - _internal_mutable_index_feature()->::grin::IndexFeature::MergeFrom(from._internal_index_feature()); - break; - } - case kPredicateFeature: { - _internal_mutable_predicate_feature()->::grin::PredicateFeature::MergeFrom(from._internal_predicate_feature()); - break; - } - case SPECIFIC_FEATURE_NOT_SET: { - break; - } - } -} - -void StorageFeature::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.StorageFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void StorageFeature::CopyFrom(const StorageFeature& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.StorageFeature) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool StorageFeature::IsInitialized() const { - return true; -} - -void StorageFeature::InternalSwap(StorageFeature* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - swap(specific_feature_, other->specific_feature_); - swap(_oneof_case_[0], other->_oneof_case_[0]); -} - -::PROTOBUF_NAMESPACE_ID::Metadata StorageFeature::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Statistics::InitAsDefaultInstance() { -} -class Statistics::_Internal { - public: -}; - -Statistics::Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.Statistics) -} -Statistics::Statistics(const Statistics& from) - : ::PROTOBUF_NAMESPACE_ID::Message() { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::memcpy(&vertex_count_, &from.vertex_count_, - static_cast(reinterpret_cast(&edge_type_count_) - - reinterpret_cast(&vertex_count_)) + sizeof(edge_type_count_)); - // @@protoc_insertion_point(copy_constructor:grin.Statistics) -} - -void Statistics::SharedCtor() { - ::memset(&vertex_count_, 0, static_cast( - reinterpret_cast(&edge_type_count_) - - reinterpret_cast(&vertex_count_)) + sizeof(edge_type_count_)); -} - -Statistics::~Statistics() { - // @@protoc_insertion_point(destructor:grin.Statistics) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void Statistics::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); -} - -void Statistics::ArenaDtor(void* object) { - Statistics* _this = reinterpret_cast< Statistics* >(object); - (void)_this; -} -void Statistics::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void Statistics::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Statistics& Statistics::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Statistics_graph_2eproto.base); - return *internal_default_instance(); -} - - -void Statistics::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.Statistics) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - ::memset(&vertex_count_, 0, static_cast( - reinterpret_cast(&edge_type_count_) - - reinterpret_cast(&vertex_count_)) + sizeof(edge_type_count_)); - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Statistics::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // int32 vertex_count = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { - vertex_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int32 edge_count = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { - edge_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int32 partition_count = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { - partition_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int32 vertex_type_count = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { - vertex_type_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - // int32 edge_type_count = 5; - case 5: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { - edge_type_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* Statistics::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.Statistics) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // int32 vertex_count = 1; - if (this->vertex_count() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_vertex_count(), target); - } - - // int32 edge_count = 2; - if (this->edge_count() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_edge_count(), target); - } - - // int32 partition_count = 3; - if (this->partition_count() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_partition_count(), target); - } - - // int32 vertex_type_count = 4; - if (this->vertex_type_count() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_vertex_type_count(), target); - } - - // int32 edge_type_count = 5; - if (this->edge_type_count() != 0) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_edge_type_count(), target); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.Statistics) - return target; -} - -size_t Statistics::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.Statistics) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // int32 vertex_count = 1; - if (this->vertex_count() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->_internal_vertex_count()); - } - - // int32 edge_count = 2; - if (this->edge_count() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->_internal_edge_count()); - } - - // int32 partition_count = 3; - if (this->partition_count() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->_internal_partition_count()); - } - - // int32 vertex_type_count = 4; - if (this->vertex_type_count() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->_internal_vertex_type_count()); - } - - // int32 edge_type_count = 5; - if (this->edge_type_count() != 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( - this->_internal_edge_type_count()); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Statistics::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.Statistics) - GOOGLE_DCHECK_NE(&from, this); - const Statistics* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.Statistics) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.Statistics) - MergeFrom(*source); - } -} - -void Statistics::MergeFrom(const Statistics& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.Statistics) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - if (from.vertex_count() != 0) { - _internal_set_vertex_count(from._internal_vertex_count()); - } - if (from.edge_count() != 0) { - _internal_set_edge_count(from._internal_edge_count()); - } - if (from.partition_count() != 0) { - _internal_set_partition_count(from._internal_partition_count()); - } - if (from.vertex_type_count() != 0) { - _internal_set_vertex_type_count(from._internal_vertex_type_count()); - } - if (from.edge_type_count() != 0) { - _internal_set_edge_type_count(from._internal_edge_type_count()); - } -} - -void Statistics::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.Statistics) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Statistics::CopyFrom(const Statistics& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.Statistics) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Statistics::IsInitialized() const { - return true; -} - -void Statistics::InternalSwap(Statistics* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::internal::memswap< - PROTOBUF_FIELD_OFFSET(Statistics, edge_type_count_) - + sizeof(Statistics::edge_type_count_) - - PROTOBUF_FIELD_OFFSET(Statistics, vertex_count_)>( - reinterpret_cast(&vertex_count_), - reinterpret_cast(&other->vertex_count_)); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Statistics::GetMetadata() const { - return GetMetadataStatic(); -} - - -// =================================================================== - -void Graph::InitAsDefaultInstance() { - ::grin::_Graph_default_instance_._instance.get_mutable()->statistics_ = const_cast< ::grin::Statistics*>( - ::grin::Statistics::internal_default_instance()); -} -class Graph::_Internal { - public: - static const ::grin::Statistics& statistics(const Graph* msg); -}; - -const ::grin::Statistics& -Graph::_Internal::statistics(const Graph* msg) { - return *msg->statistics_; -} -Graph::Graph(::PROTOBUF_NAMESPACE_ID::Arena* arena) - : ::PROTOBUF_NAMESPACE_ID::Message(arena), - features_(arena) { - SharedCtor(); - RegisterArenaDtor(arena); - // @@protoc_insertion_point(arena_constructor:grin.Graph) -} -Graph::Graph(const Graph& from) - : ::PROTOBUF_NAMESPACE_ID::Message(), - features_(from.features_) { - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_uri().empty()) { - uri_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_uri(), - GetArena()); - } - grin_version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (!from._internal_grin_version().empty()) { - grin_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_grin_version(), - GetArena()); - } - if (from._internal_has_statistics()) { - statistics_ = new ::grin::Statistics(*from.statistics_); - } else { - statistics_ = nullptr; - } - // @@protoc_insertion_point(copy_constructor:grin.Graph) -} - -void Graph::SharedCtor() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_Graph_graph_2eproto.base); - uri_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - grin_version_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - statistics_ = nullptr; -} - -Graph::~Graph() { - // @@protoc_insertion_point(destructor:grin.Graph) - SharedDtor(); - _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -void Graph::SharedDtor() { - GOOGLE_DCHECK(GetArena() == nullptr); - uri_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - grin_version_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); - if (this != internal_default_instance()) delete statistics_; -} - -void Graph::ArenaDtor(void* object) { - Graph* _this = reinterpret_cast< Graph* >(object); - (void)_this; -} -void Graph::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { -} -void Graph::SetCachedSize(int size) const { - _cached_size_.Set(size); -} -const Graph& Graph::default_instance() { - ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_Graph_graph_2eproto.base); - return *internal_default_instance(); -} - - -void Graph::Clear() { -// @@protoc_insertion_point(message_clear_start:grin.Graph) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - features_.Clear(); - uri_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - grin_version_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - if (GetArena() == nullptr && statistics_ != nullptr) { - delete statistics_; - } - statistics_ = nullptr; - _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); -} - -const char* Graph::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { -#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure - ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; - while (!ctx->Done(&ptr)) { - ::PROTOBUF_NAMESPACE_ID::uint32 tag; - ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); - CHK_(ptr); - switch (tag >> 3) { - // string uri = 1; - case 1: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { - auto str = _internal_mutable_uri(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "grin.Graph.uri")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // string grin_version = 2; - case 2: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { - auto str = _internal_mutable_grin_version(); - ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); - CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "grin.Graph.grin_version")); - CHK_(ptr); - } else goto handle_unusual; - continue; - // repeated .grin.StorageFeature features = 3; - case 3: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { - ptr -= 1; - do { - ptr += 1; - ptr = ctx->ParseMessage(_internal_add_features(), ptr); - CHK_(ptr); - if (!ctx->DataAvailable(ptr)) break; - } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<26>(ptr)); - } else goto handle_unusual; - continue; - // .grin.Statistics statistics = 4; - case 4: - if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { - ptr = ctx->ParseMessage(_internal_mutable_statistics(), ptr); - CHK_(ptr); - } else goto handle_unusual; - continue; - default: { - handle_unusual: - if ((tag & 7) == 4 || tag == 0) { - ctx->SetLastTag(tag); - goto success; - } - ptr = UnknownFieldParse(tag, - _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), - ptr, ctx); - CHK_(ptr != nullptr); - continue; - } - } // switch - } // while -success: - return ptr; -failure: - ptr = nullptr; - goto success; -#undef CHK_ -} - -::PROTOBUF_NAMESPACE_ID::uint8* Graph::_InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { - // @@protoc_insertion_point(serialize_to_array_start:grin.Graph) - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - // string uri = 1; - if (this->uri().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_uri().data(), static_cast(this->_internal_uri().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "grin.Graph.uri"); - target = stream->WriteStringMaybeAliased( - 1, this->_internal_uri(), target); - } - - // string grin_version = 2; - if (this->grin_version().size() > 0) { - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( - this->_internal_grin_version().data(), static_cast(this->_internal_grin_version().length()), - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, - "grin.Graph.grin_version"); - target = stream->WriteStringMaybeAliased( - 2, this->_internal_grin_version(), target); - } - - // repeated .grin.StorageFeature features = 3; - for (unsigned int i = 0, - n = static_cast(this->_internal_features_size()); i < n; i++) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage(3, this->_internal_features(i), target, stream); - } - - // .grin.Statistics statistics = 4; - if (this->has_statistics()) { - target = stream->EnsureSpace(target); - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: - InternalWriteMessage( - 4, _Internal::statistics(this), target, stream); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( - _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); - } - // @@protoc_insertion_point(serialize_to_array_end:grin.Graph) - return target; -} - -size_t Graph::ByteSizeLong() const { -// @@protoc_insertion_point(message_byte_size_start:grin.Graph) - size_t total_size = 0; - - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - // Prevent compiler warnings about cached_has_bits being unused - (void) cached_has_bits; - - // repeated .grin.StorageFeature features = 3; - total_size += 1UL * this->_internal_features_size(); - for (const auto& msg : this->features_) { - total_size += - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); - } - - // string uri = 1; - if (this->uri().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_uri()); - } - - // string grin_version = 2; - if (this->grin_version().size() > 0) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( - this->_internal_grin_version()); - } - - // .grin.Statistics statistics = 4; - if (this->has_statistics()) { - total_size += 1 + - ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( - *statistics_); - } - - if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { - return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( - _internal_metadata_, total_size, &_cached_size_); - } - int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); - SetCachedSize(cached_size); - return total_size; -} - -void Graph::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_merge_from_start:grin.Graph) - GOOGLE_DCHECK_NE(&from, this); - const Graph* source = - ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( - &from); - if (source == nullptr) { - // @@protoc_insertion_point(generalized_merge_from_cast_fail:grin.Graph) - ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); - } else { - // @@protoc_insertion_point(generalized_merge_from_cast_success:grin.Graph) - MergeFrom(*source); - } -} - -void Graph::MergeFrom(const Graph& from) { -// @@protoc_insertion_point(class_specific_merge_from_start:grin.Graph) - GOOGLE_DCHECK_NE(&from, this); - _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); - ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; - (void) cached_has_bits; - - features_.MergeFrom(from.features_); - if (from.uri().size() > 0) { - _internal_set_uri(from._internal_uri()); - } - if (from.grin_version().size() > 0) { - _internal_set_grin_version(from._internal_grin_version()); - } - if (from.has_statistics()) { - _internal_mutable_statistics()->::grin::Statistics::MergeFrom(from._internal_statistics()); - } -} - -void Graph::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { -// @@protoc_insertion_point(generalized_copy_from_start:grin.Graph) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -void Graph::CopyFrom(const Graph& from) { -// @@protoc_insertion_point(class_specific_copy_from_start:grin.Graph) - if (&from == this) return; - Clear(); - MergeFrom(from); -} - -bool Graph::IsInitialized() const { - return true; -} - -void Graph::InternalSwap(Graph* other) { - using std::swap; - _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); - features_.InternalSwap(&other->features_); - uri_.Swap(&other->uri_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - grin_version_.Swap(&other->grin_version_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); - swap(statistics_, other->statistics_); -} - -::PROTOBUF_NAMESPACE_ID::Metadata Graph::GetMetadata() const { - return GetMetadataStatic(); -} - - -// @@protoc_insertion_point(namespace_scope) -} // namespace grin -PROTOBUF_NAMESPACE_OPEN -template<> PROTOBUF_NOINLINE ::grin::TopologyFeature* Arena::CreateMaybeMessage< ::grin::TopologyFeature >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::TopologyFeature >(arena); -} -template<> PROTOBUF_NOINLINE ::grin::MirrorPartitionListFeature* Arena::CreateMaybeMessage< ::grin::MirrorPartitionListFeature >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::MirrorPartitionListFeature >(arena); -} -template<> PROTOBUF_NOINLINE ::grin::PartitionFeature* Arena::CreateMaybeMessage< ::grin::PartitionFeature >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::PartitionFeature >(arena); -} -template<> PROTOBUF_NOINLINE ::grin::VertexPropertyFeature* Arena::CreateMaybeMessage< ::grin::VertexPropertyFeature >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::VertexPropertyFeature >(arena); -} -template<> PROTOBUF_NOINLINE ::grin::EdgePropertyFeature* Arena::CreateMaybeMessage< ::grin::EdgePropertyFeature >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::EdgePropertyFeature >(arena); -} -template<> PROTOBUF_NOINLINE ::grin::PropertyFeature* Arena::CreateMaybeMessage< ::grin::PropertyFeature >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::PropertyFeature >(arena); -} -template<> PROTOBUF_NOINLINE ::grin::IndexFeature* Arena::CreateMaybeMessage< ::grin::IndexFeature >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::IndexFeature >(arena); -} -template<> PROTOBUF_NOINLINE ::grin::PredicateFeature* Arena::CreateMaybeMessage< ::grin::PredicateFeature >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::PredicateFeature >(arena); -} -template<> PROTOBUF_NOINLINE ::grin::StorageFeature* Arena::CreateMaybeMessage< ::grin::StorageFeature >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::StorageFeature >(arena); -} -template<> PROTOBUF_NOINLINE ::grin::Statistics* Arena::CreateMaybeMessage< ::grin::Statistics >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::Statistics >(arena); -} -template<> PROTOBUF_NOINLINE ::grin::Graph* Arena::CreateMaybeMessage< ::grin::Graph >(Arena* arena) { - return Arena::CreateMessageInternal< ::grin::Graph >(arena); -} -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) -#include diff --git a/modules/graph/grin/src/proto/graph.pb.h b/modules/graph/grin/src/proto/graph.pb.h deleted file mode 100644 index 6a6e4fb79..000000000 --- a/modules/graph/grin/src/proto/graph.pb.h +++ /dev/null @@ -1,4777 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: graph.proto - -#ifndef GOOGLE_PROTOBUF_INCLUDED_graph_2eproto -#define GOOGLE_PROTOBUF_INCLUDED_graph_2eproto - -#include -#include - -#include -#if PROTOBUF_VERSION < 3012000 -#error This file was generated by a newer version of protoc which is -#error incompatible with your Protocol Buffer headers. Please update -#error your headers. -#endif -#if 3012004 < PROTOBUF_MIN_PROTOC_VERSION -#error This file was generated by an older version of protoc which is -#error incompatible with your Protocol Buffer headers. Please -#error regenerate this file with a newer version of protoc. -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: export -#include // IWYU pragma: export -#include -#include -// @@protoc_insertion_point(includes) -#include -#define PROTOBUF_INTERNAL_EXPORT_graph_2eproto -PROTOBUF_NAMESPACE_OPEN -namespace internal { -class AnyMetadata; -} // namespace internal -PROTOBUF_NAMESPACE_CLOSE - -// Internal implementation detail -- do not use these members. -struct TableStruct_graph_2eproto { - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[11] - PROTOBUF_SECTION_VARIABLE(protodesc_cold); - static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; - static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; - static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; -}; -extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_graph_2eproto; -namespace grin { -class EdgePropertyFeature; -class EdgePropertyFeatureDefaultTypeInternal; -extern EdgePropertyFeatureDefaultTypeInternal _EdgePropertyFeature_default_instance_; -class Graph; -class GraphDefaultTypeInternal; -extern GraphDefaultTypeInternal _Graph_default_instance_; -class IndexFeature; -class IndexFeatureDefaultTypeInternal; -extern IndexFeatureDefaultTypeInternal _IndexFeature_default_instance_; -class MirrorPartitionListFeature; -class MirrorPartitionListFeatureDefaultTypeInternal; -extern MirrorPartitionListFeatureDefaultTypeInternal _MirrorPartitionListFeature_default_instance_; -class PartitionFeature; -class PartitionFeatureDefaultTypeInternal; -extern PartitionFeatureDefaultTypeInternal _PartitionFeature_default_instance_; -class PredicateFeature; -class PredicateFeatureDefaultTypeInternal; -extern PredicateFeatureDefaultTypeInternal _PredicateFeature_default_instance_; -class PropertyFeature; -class PropertyFeatureDefaultTypeInternal; -extern PropertyFeatureDefaultTypeInternal _PropertyFeature_default_instance_; -class Statistics; -class StatisticsDefaultTypeInternal; -extern StatisticsDefaultTypeInternal _Statistics_default_instance_; -class StorageFeature; -class StorageFeatureDefaultTypeInternal; -extern StorageFeatureDefaultTypeInternal _StorageFeature_default_instance_; -class TopologyFeature; -class TopologyFeatureDefaultTypeInternal; -extern TopologyFeatureDefaultTypeInternal _TopologyFeature_default_instance_; -class VertexPropertyFeature; -class VertexPropertyFeatureDefaultTypeInternal; -extern VertexPropertyFeatureDefaultTypeInternal _VertexPropertyFeature_default_instance_; -} // namespace grin -PROTOBUF_NAMESPACE_OPEN -template<> ::grin::EdgePropertyFeature* Arena::CreateMaybeMessage<::grin::EdgePropertyFeature>(Arena*); -template<> ::grin::Graph* Arena::CreateMaybeMessage<::grin::Graph>(Arena*); -template<> ::grin::IndexFeature* Arena::CreateMaybeMessage<::grin::IndexFeature>(Arena*); -template<> ::grin::MirrorPartitionListFeature* Arena::CreateMaybeMessage<::grin::MirrorPartitionListFeature>(Arena*); -template<> ::grin::PartitionFeature* Arena::CreateMaybeMessage<::grin::PartitionFeature>(Arena*); -template<> ::grin::PredicateFeature* Arena::CreateMaybeMessage<::grin::PredicateFeature>(Arena*); -template<> ::grin::PropertyFeature* Arena::CreateMaybeMessage<::grin::PropertyFeature>(Arena*); -template<> ::grin::Statistics* Arena::CreateMaybeMessage<::grin::Statistics>(Arena*); -template<> ::grin::StorageFeature* Arena::CreateMaybeMessage<::grin::StorageFeature>(Arena*); -template<> ::grin::TopologyFeature* Arena::CreateMaybeMessage<::grin::TopologyFeature>(Arena*); -template<> ::grin::VertexPropertyFeature* Arena::CreateMaybeMessage<::grin::VertexPropertyFeature>(Arena*); -PROTOBUF_NAMESPACE_CLOSE -namespace grin { - -enum ListRetrieval : int { - LR_NA = 0, - LR_ARRAY_LIKE = 1, - LR_ITERATOR = 2, - ListRetrieval_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - ListRetrieval_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool ListRetrieval_IsValid(int value); -constexpr ListRetrieval ListRetrieval_MIN = LR_NA; -constexpr ListRetrieval ListRetrieval_MAX = LR_ITERATOR; -constexpr int ListRetrieval_ARRAYSIZE = ListRetrieval_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ListRetrieval_descriptor(); -template -inline const std::string& ListRetrieval_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function ListRetrieval_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - ListRetrieval_descriptor(), enum_t_value); -} -inline bool ListRetrieval_Parse( - const std::string& name, ListRetrieval* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - ListRetrieval_descriptor(), name, value); -} -enum GraphPartitionStrategy : int { - GPS_NA = 0, - GPS_ALL_REPLICATE = 1, - GPS_EDGE_CUT = 2, - GPS_VERTEX_CUT = 3, - GPS_HYBRID_CUT = 4, - GraphPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - GraphPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool GraphPartitionStrategy_IsValid(int value); -constexpr GraphPartitionStrategy GraphPartitionStrategy_MIN = GPS_NA; -constexpr GraphPartitionStrategy GraphPartitionStrategy_MAX = GPS_HYBRID_CUT; -constexpr int GraphPartitionStrategy_ARRAYSIZE = GraphPartitionStrategy_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GraphPartitionStrategy_descriptor(); -template -inline const std::string& GraphPartitionStrategy_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function GraphPartitionStrategy_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - GraphPartitionStrategy_descriptor(), enum_t_value); -} -inline bool GraphPartitionStrategy_Parse( - const std::string& name, GraphPartitionStrategy* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - GraphPartitionStrategy_descriptor(), name, value); -} -enum PropertyDataPartitionStrategy : int { - PDPS_NA = 0, - PDPS_MASTER_ONLY = 1, - PDPS_REPLICATE_MASTER_MIRROR = 2, - PDPS_SPLIT_MASTER_MIRROR = 3, - PropertyDataPartitionStrategy_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), - PropertyDataPartitionStrategy_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() -}; -bool PropertyDataPartitionStrategy_IsValid(int value); -constexpr PropertyDataPartitionStrategy PropertyDataPartitionStrategy_MIN = PDPS_NA; -constexpr PropertyDataPartitionStrategy PropertyDataPartitionStrategy_MAX = PDPS_SPLIT_MASTER_MIRROR; -constexpr int PropertyDataPartitionStrategy_ARRAYSIZE = PropertyDataPartitionStrategy_MAX + 1; - -const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PropertyDataPartitionStrategy_descriptor(); -template -inline const std::string& PropertyDataPartitionStrategy_Name(T enum_t_value) { - static_assert(::std::is_same::value || - ::std::is_integral::value, - "Incorrect type passed to function PropertyDataPartitionStrategy_Name."); - return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( - PropertyDataPartitionStrategy_descriptor(), enum_t_value); -} -inline bool PropertyDataPartitionStrategy_Parse( - const std::string& name, PropertyDataPartitionStrategy* value) { - return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( - PropertyDataPartitionStrategy_descriptor(), name, value); -} -// =================================================================== - -class TopologyFeature PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.TopologyFeature) */ { - public: - inline TopologyFeature() : TopologyFeature(nullptr) {}; - virtual ~TopologyFeature(); - - TopologyFeature(const TopologyFeature& from); - TopologyFeature(TopologyFeature&& from) noexcept - : TopologyFeature() { - *this = ::std::move(from); - } - - inline TopologyFeature& operator=(const TopologyFeature& from) { - CopyFrom(from); - return *this; - } - inline TopologyFeature& operator=(TopologyFeature&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const TopologyFeature& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const TopologyFeature* internal_default_instance() { - return reinterpret_cast( - &_TopologyFeature_default_instance_); - } - static constexpr int kIndexInFileMessages = - 0; - - friend void swap(TopologyFeature& a, TopologyFeature& b) { - a.Swap(&b); - } - inline void Swap(TopologyFeature* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(TopologyFeature* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline TopologyFeature* New() const final { - return CreateMaybeMessage(nullptr); - } - - TopologyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const TopologyFeature& from); - void MergeFrom(const TopologyFeature& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(TopologyFeature* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.TopologyFeature"; - } - protected: - explicit TopologyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kVertexListRetrievalsFieldNumber = 7, - kEdgeListRetrievalsFieldNumber = 8, - kAdjacentListRetrievalsFieldNumber = 9, - kGrinAssumeHasDirectedGraphFieldNumber = 1, - kGrinAssumeHasUndirectedGraphFieldNumber = 2, - kGrinAssumeHasMultiEdgeGraphFieldNumber = 3, - kGrinWithVertexOriginalIdFieldNumber = 4, - kGrinWithVertexDataFieldNumber = 5, - kGrinWithEdgeDataFieldNumber = 6, - }; - // repeated .grin.ListRetrieval vertex_list_retrievals = 7; - int vertex_list_retrievals_size() const; - private: - int _internal_vertex_list_retrievals_size() const; - public: - void clear_vertex_list_retrievals(); - private: - ::grin::ListRetrieval _internal_vertex_list_retrievals(int index) const; - void _internal_add_vertex_list_retrievals(::grin::ListRetrieval value); - ::PROTOBUF_NAMESPACE_ID::RepeatedField* _internal_mutable_vertex_list_retrievals(); - public: - ::grin::ListRetrieval vertex_list_retrievals(int index) const; - void set_vertex_list_retrievals(int index, ::grin::ListRetrieval value); - void add_vertex_list_retrievals(::grin::ListRetrieval value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField& vertex_list_retrievals() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField* mutable_vertex_list_retrievals(); - - // repeated .grin.ListRetrieval edge_list_retrievals = 8; - int edge_list_retrievals_size() const; - private: - int _internal_edge_list_retrievals_size() const; - public: - void clear_edge_list_retrievals(); - private: - ::grin::ListRetrieval _internal_edge_list_retrievals(int index) const; - void _internal_add_edge_list_retrievals(::grin::ListRetrieval value); - ::PROTOBUF_NAMESPACE_ID::RepeatedField* _internal_mutable_edge_list_retrievals(); - public: - ::grin::ListRetrieval edge_list_retrievals(int index) const; - void set_edge_list_retrievals(int index, ::grin::ListRetrieval value); - void add_edge_list_retrievals(::grin::ListRetrieval value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField& edge_list_retrievals() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField* mutable_edge_list_retrievals(); - - // repeated .grin.ListRetrieval adjacent_list_retrievals = 9; - int adjacent_list_retrievals_size() const; - private: - int _internal_adjacent_list_retrievals_size() const; - public: - void clear_adjacent_list_retrievals(); - private: - ::grin::ListRetrieval _internal_adjacent_list_retrievals(int index) const; - void _internal_add_adjacent_list_retrievals(::grin::ListRetrieval value); - ::PROTOBUF_NAMESPACE_ID::RepeatedField* _internal_mutable_adjacent_list_retrievals(); - public: - ::grin::ListRetrieval adjacent_list_retrievals(int index) const; - void set_adjacent_list_retrievals(int index, ::grin::ListRetrieval value); - void add_adjacent_list_retrievals(::grin::ListRetrieval value); - const ::PROTOBUF_NAMESPACE_ID::RepeatedField& adjacent_list_retrievals() const; - ::PROTOBUF_NAMESPACE_ID::RepeatedField* mutable_adjacent_list_retrievals(); - - // bool grin_assume_has_directed_graph = 1; - void clear_grin_assume_has_directed_graph(); - bool grin_assume_has_directed_graph() const; - void set_grin_assume_has_directed_graph(bool value); - private: - bool _internal_grin_assume_has_directed_graph() const; - void _internal_set_grin_assume_has_directed_graph(bool value); - public: - - // bool grin_assume_has_undirected_graph = 2; - void clear_grin_assume_has_undirected_graph(); - bool grin_assume_has_undirected_graph() const; - void set_grin_assume_has_undirected_graph(bool value); - private: - bool _internal_grin_assume_has_undirected_graph() const; - void _internal_set_grin_assume_has_undirected_graph(bool value); - public: - - // bool grin_assume_has_multi_edge_graph = 3; - void clear_grin_assume_has_multi_edge_graph(); - bool grin_assume_has_multi_edge_graph() const; - void set_grin_assume_has_multi_edge_graph(bool value); - private: - bool _internal_grin_assume_has_multi_edge_graph() const; - void _internal_set_grin_assume_has_multi_edge_graph(bool value); - public: - - // bool grin_with_vertex_original_id = 4; - void clear_grin_with_vertex_original_id(); - bool grin_with_vertex_original_id() const; - void set_grin_with_vertex_original_id(bool value); - private: - bool _internal_grin_with_vertex_original_id() const; - void _internal_set_grin_with_vertex_original_id(bool value); - public: - - // bool grin_with_vertex_data = 5; - void clear_grin_with_vertex_data(); - bool grin_with_vertex_data() const; - void set_grin_with_vertex_data(bool value); - private: - bool _internal_grin_with_vertex_data() const; - void _internal_set_grin_with_vertex_data(bool value); - public: - - // bool grin_with_edge_data = 6; - void clear_grin_with_edge_data(); - bool grin_with_edge_data() const; - void set_grin_with_edge_data(bool value); - private: - bool _internal_grin_with_edge_data() const; - void _internal_set_grin_with_edge_data(bool value); - public: - - // @@protoc_insertion_point(class_scope:grin.TopologyFeature) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField vertex_list_retrievals_; - mutable std::atomic _vertex_list_retrievals_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField edge_list_retrievals_; - mutable std::atomic _edge_list_retrievals_cached_byte_size_; - ::PROTOBUF_NAMESPACE_ID::RepeatedField adjacent_list_retrievals_; - mutable std::atomic _adjacent_list_retrievals_cached_byte_size_; - bool grin_assume_has_directed_graph_; - bool grin_assume_has_undirected_graph_; - bool grin_assume_has_multi_edge_graph_; - bool grin_with_vertex_original_id_; - bool grin_with_vertex_data_; - bool grin_with_edge_data_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_graph_2eproto; -}; -// ------------------------------------------------------------------- - -class MirrorPartitionListFeature PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.MirrorPartitionListFeature) */ { - public: - inline MirrorPartitionListFeature() : MirrorPartitionListFeature(nullptr) {}; - virtual ~MirrorPartitionListFeature(); - - MirrorPartitionListFeature(const MirrorPartitionListFeature& from); - MirrorPartitionListFeature(MirrorPartitionListFeature&& from) noexcept - : MirrorPartitionListFeature() { - *this = ::std::move(from); - } - - inline MirrorPartitionListFeature& operator=(const MirrorPartitionListFeature& from) { - CopyFrom(from); - return *this; - } - inline MirrorPartitionListFeature& operator=(MirrorPartitionListFeature&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const MirrorPartitionListFeature& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const MirrorPartitionListFeature* internal_default_instance() { - return reinterpret_cast( - &_MirrorPartitionListFeature_default_instance_); - } - static constexpr int kIndexInFileMessages = - 1; - - friend void swap(MirrorPartitionListFeature& a, MirrorPartitionListFeature& b) { - a.Swap(&b); - } - inline void Swap(MirrorPartitionListFeature* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(MirrorPartitionListFeature* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline MirrorPartitionListFeature* New() const final { - return CreateMaybeMessage(nullptr); - } - - MirrorPartitionListFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const MirrorPartitionListFeature& from); - void MergeFrom(const MirrorPartitionListFeature& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(MirrorPartitionListFeature* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.MirrorPartitionListFeature"; - } - protected: - explicit MirrorPartitionListFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kGrinTraitMasterVertexMirrorPartitionListFieldNumber = 1, - kGrinTraitMirrorVertexMirrorPartitionListFieldNumber = 2, - kGrinTraitMasterEdgeMirrorPartitionListFieldNumber = 3, - kGrinTraitMirrorEdgeMirrorPartitionListFieldNumber = 4, - }; - // bool grin_trait_master_vertex_mirror_partition_list = 1; - void clear_grin_trait_master_vertex_mirror_partition_list(); - bool grin_trait_master_vertex_mirror_partition_list() const; - void set_grin_trait_master_vertex_mirror_partition_list(bool value); - private: - bool _internal_grin_trait_master_vertex_mirror_partition_list() const; - void _internal_set_grin_trait_master_vertex_mirror_partition_list(bool value); - public: - - // bool grin_trait_mirror_vertex_mirror_partition_list = 2; - void clear_grin_trait_mirror_vertex_mirror_partition_list(); - bool grin_trait_mirror_vertex_mirror_partition_list() const; - void set_grin_trait_mirror_vertex_mirror_partition_list(bool value); - private: - bool _internal_grin_trait_mirror_vertex_mirror_partition_list() const; - void _internal_set_grin_trait_mirror_vertex_mirror_partition_list(bool value); - public: - - // bool grin_trait_master_edge_mirror_partition_list = 3; - void clear_grin_trait_master_edge_mirror_partition_list(); - bool grin_trait_master_edge_mirror_partition_list() const; - void set_grin_trait_master_edge_mirror_partition_list(bool value); - private: - bool _internal_grin_trait_master_edge_mirror_partition_list() const; - void _internal_set_grin_trait_master_edge_mirror_partition_list(bool value); - public: - - // bool grin_trait_mirror_edge_mirror_partition_list = 4; - void clear_grin_trait_mirror_edge_mirror_partition_list(); - bool grin_trait_mirror_edge_mirror_partition_list() const; - void set_grin_trait_mirror_edge_mirror_partition_list(bool value); - private: - bool _internal_grin_trait_mirror_edge_mirror_partition_list() const; - void _internal_set_grin_trait_mirror_edge_mirror_partition_list(bool value); - public: - - // @@protoc_insertion_point(class_scope:grin.MirrorPartitionListFeature) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - bool grin_trait_master_vertex_mirror_partition_list_; - bool grin_trait_mirror_vertex_mirror_partition_list_; - bool grin_trait_master_edge_mirror_partition_list_; - bool grin_trait_mirror_edge_mirror_partition_list_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_graph_2eproto; -}; -// ------------------------------------------------------------------- - -class PartitionFeature PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PartitionFeature) */ { - public: - inline PartitionFeature() : PartitionFeature(nullptr) {}; - virtual ~PartitionFeature(); - - PartitionFeature(const PartitionFeature& from); - PartitionFeature(PartitionFeature&& from) noexcept - : PartitionFeature() { - *this = ::std::move(from); - } - - inline PartitionFeature& operator=(const PartitionFeature& from) { - CopyFrom(from); - return *this; - } - inline PartitionFeature& operator=(PartitionFeature&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const PartitionFeature& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const PartitionFeature* internal_default_instance() { - return reinterpret_cast( - &_PartitionFeature_default_instance_); - } - static constexpr int kIndexInFileMessages = - 2; - - friend void swap(PartitionFeature& a, PartitionFeature& b) { - a.Swap(&b); - } - inline void Swap(PartitionFeature* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(PartitionFeature* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline PartitionFeature* New() const final { - return CreateMaybeMessage(nullptr); - } - - PartitionFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const PartitionFeature& from); - void MergeFrom(const PartitionFeature& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(PartitionFeature* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.PartitionFeature"; - } - protected: - explicit PartitionFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kMirrorPartitionListFeatureFieldNumber = 7, - kGraphPartitionStrategyFieldNumber = 1, - kGrinTraitNaturalIdForPartitionFieldNumber = 2, - kGrinEnableVertexRefFieldNumber = 3, - kGrinEnableEdgeRefFieldNumber = 4, - kGrinTraitSelectMasterForVertexListFieldNumber = 8, - kVertexDataFieldNumber = 5, - kEdgeDataFieldNumber = 6, - kGrinTraitSelectPartitionForVertexListFieldNumber = 9, - kGrinTraitSelectMasterForEdgeListFieldNumber = 10, - kGrinTraitSelectPartitionForEdgeListFieldNumber = 11, - kGrinTraitSelectMasterNeighborForAdjacentListFieldNumber = 12, - kGrinTraitSelectNeighborPartitionForAdjacentListFieldNumber = 13, - kGrinTraitFastVertexRefFieldNumber = 14, - }; - // .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; - bool has_mirror_partition_list_feature() const; - private: - bool _internal_has_mirror_partition_list_feature() const; - public: - void clear_mirror_partition_list_feature(); - const ::grin::MirrorPartitionListFeature& mirror_partition_list_feature() const; - ::grin::MirrorPartitionListFeature* release_mirror_partition_list_feature(); - ::grin::MirrorPartitionListFeature* mutable_mirror_partition_list_feature(); - void set_allocated_mirror_partition_list_feature(::grin::MirrorPartitionListFeature* mirror_partition_list_feature); - private: - const ::grin::MirrorPartitionListFeature& _internal_mirror_partition_list_feature() const; - ::grin::MirrorPartitionListFeature* _internal_mutable_mirror_partition_list_feature(); - public: - void unsafe_arena_set_allocated_mirror_partition_list_feature( - ::grin::MirrorPartitionListFeature* mirror_partition_list_feature); - ::grin::MirrorPartitionListFeature* unsafe_arena_release_mirror_partition_list_feature(); - - // .grin.GraphPartitionStrategy graph_partition_strategy = 1; - void clear_graph_partition_strategy(); - ::grin::GraphPartitionStrategy graph_partition_strategy() const; - void set_graph_partition_strategy(::grin::GraphPartitionStrategy value); - private: - ::grin::GraphPartitionStrategy _internal_graph_partition_strategy() const; - void _internal_set_graph_partition_strategy(::grin::GraphPartitionStrategy value); - public: - - // bool grin_trait_natural_id_for_partition = 2; - void clear_grin_trait_natural_id_for_partition(); - bool grin_trait_natural_id_for_partition() const; - void set_grin_trait_natural_id_for_partition(bool value); - private: - bool _internal_grin_trait_natural_id_for_partition() const; - void _internal_set_grin_trait_natural_id_for_partition(bool value); - public: - - // bool grin_enable_vertex_ref = 3; - void clear_grin_enable_vertex_ref(); - bool grin_enable_vertex_ref() const; - void set_grin_enable_vertex_ref(bool value); - private: - bool _internal_grin_enable_vertex_ref() const; - void _internal_set_grin_enable_vertex_ref(bool value); - public: - - // bool grin_enable_edge_ref = 4; - void clear_grin_enable_edge_ref(); - bool grin_enable_edge_ref() const; - void set_grin_enable_edge_ref(bool value); - private: - bool _internal_grin_enable_edge_ref() const; - void _internal_set_grin_enable_edge_ref(bool value); - public: - - // bool grin_trait_select_master_for_vertex_list = 8; - void clear_grin_trait_select_master_for_vertex_list(); - bool grin_trait_select_master_for_vertex_list() const; - void set_grin_trait_select_master_for_vertex_list(bool value); - private: - bool _internal_grin_trait_select_master_for_vertex_list() const; - void _internal_set_grin_trait_select_master_for_vertex_list(bool value); - public: - - // .grin.PropertyDataPartitionStrategy vertex_data = 5; - void clear_vertex_data(); - ::grin::PropertyDataPartitionStrategy vertex_data() const; - void set_vertex_data(::grin::PropertyDataPartitionStrategy value); - private: - ::grin::PropertyDataPartitionStrategy _internal_vertex_data() const; - void _internal_set_vertex_data(::grin::PropertyDataPartitionStrategy value); - public: - - // .grin.PropertyDataPartitionStrategy edge_data = 6; - void clear_edge_data(); - ::grin::PropertyDataPartitionStrategy edge_data() const; - void set_edge_data(::grin::PropertyDataPartitionStrategy value); - private: - ::grin::PropertyDataPartitionStrategy _internal_edge_data() const; - void _internal_set_edge_data(::grin::PropertyDataPartitionStrategy value); - public: - - // bool grin_trait_select_partition_for_vertex_list = 9; - void clear_grin_trait_select_partition_for_vertex_list(); - bool grin_trait_select_partition_for_vertex_list() const; - void set_grin_trait_select_partition_for_vertex_list(bool value); - private: - bool _internal_grin_trait_select_partition_for_vertex_list() const; - void _internal_set_grin_trait_select_partition_for_vertex_list(bool value); - public: - - // bool grin_trait_select_master_for_edge_list = 10; - void clear_grin_trait_select_master_for_edge_list(); - bool grin_trait_select_master_for_edge_list() const; - void set_grin_trait_select_master_for_edge_list(bool value); - private: - bool _internal_grin_trait_select_master_for_edge_list() const; - void _internal_set_grin_trait_select_master_for_edge_list(bool value); - public: - - // bool grin_trait_select_partition_for_edge_list = 11; - void clear_grin_trait_select_partition_for_edge_list(); - bool grin_trait_select_partition_for_edge_list() const; - void set_grin_trait_select_partition_for_edge_list(bool value); - private: - bool _internal_grin_trait_select_partition_for_edge_list() const; - void _internal_set_grin_trait_select_partition_for_edge_list(bool value); - public: - - // bool grin_trait_select_master_neighbor_for_adjacent_list = 12; - void clear_grin_trait_select_master_neighbor_for_adjacent_list(); - bool grin_trait_select_master_neighbor_for_adjacent_list() const; - void set_grin_trait_select_master_neighbor_for_adjacent_list(bool value); - private: - bool _internal_grin_trait_select_master_neighbor_for_adjacent_list() const; - void _internal_set_grin_trait_select_master_neighbor_for_adjacent_list(bool value); - public: - - // bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; - void clear_grin_trait_select_neighbor_partition_for_adjacent_list(); - bool grin_trait_select_neighbor_partition_for_adjacent_list() const; - void set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value); - private: - bool _internal_grin_trait_select_neighbor_partition_for_adjacent_list() const; - void _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value); - public: - - // bool grin_trait_fast_vertex_ref = 14; - void clear_grin_trait_fast_vertex_ref(); - bool grin_trait_fast_vertex_ref() const; - void set_grin_trait_fast_vertex_ref(bool value); - private: - bool _internal_grin_trait_fast_vertex_ref() const; - void _internal_set_grin_trait_fast_vertex_ref(bool value); - public: - - // @@protoc_insertion_point(class_scope:grin.PartitionFeature) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::grin::MirrorPartitionListFeature* mirror_partition_list_feature_; - int graph_partition_strategy_; - bool grin_trait_natural_id_for_partition_; - bool grin_enable_vertex_ref_; - bool grin_enable_edge_ref_; - bool grin_trait_select_master_for_vertex_list_; - int vertex_data_; - int edge_data_; - bool grin_trait_select_partition_for_vertex_list_; - bool grin_trait_select_master_for_edge_list_; - bool grin_trait_select_partition_for_edge_list_; - bool grin_trait_select_master_neighbor_for_adjacent_list_; - bool grin_trait_select_neighbor_partition_for_adjacent_list_; - bool grin_trait_fast_vertex_ref_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_graph_2eproto; -}; -// ------------------------------------------------------------------- - -class VertexPropertyFeature PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.VertexPropertyFeature) */ { - public: - inline VertexPropertyFeature() : VertexPropertyFeature(nullptr) {}; - virtual ~VertexPropertyFeature(); - - VertexPropertyFeature(const VertexPropertyFeature& from); - VertexPropertyFeature(VertexPropertyFeature&& from) noexcept - : VertexPropertyFeature() { - *this = ::std::move(from); - } - - inline VertexPropertyFeature& operator=(const VertexPropertyFeature& from) { - CopyFrom(from); - return *this; - } - inline VertexPropertyFeature& operator=(VertexPropertyFeature&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const VertexPropertyFeature& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const VertexPropertyFeature* internal_default_instance() { - return reinterpret_cast( - &_VertexPropertyFeature_default_instance_); - } - static constexpr int kIndexInFileMessages = - 3; - - friend void swap(VertexPropertyFeature& a, VertexPropertyFeature& b) { - a.Swap(&b); - } - inline void Swap(VertexPropertyFeature* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(VertexPropertyFeature* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline VertexPropertyFeature* New() const final { - return CreateMaybeMessage(nullptr); - } - - VertexPropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const VertexPropertyFeature& from); - void MergeFrom(const VertexPropertyFeature& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(VertexPropertyFeature* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.VertexPropertyFeature"; - } - protected: - explicit VertexPropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kGrinWithVertexPropertyFieldNumber = 1, - kGrinWithVertexPropertyNameFieldNumber = 2, - kGrinWithVertexTypeNameFieldNumber = 3, - kGrinEnableVertexPropertyTableFieldNumber = 4, - kGrinEnableVertexPrimaryKeysFieldNumber = 5, - kGrinTraitNaturalIdForVertexTypeFieldNumber = 6, - kGrinTraitNaturalIdForVertexPropertyFieldNumber = 7, - kGrinAssumeByTypeVertexOriginalIdFieldNumber = 8, - }; - // bool grin_with_vertex_property = 1; - void clear_grin_with_vertex_property(); - bool grin_with_vertex_property() const; - void set_grin_with_vertex_property(bool value); - private: - bool _internal_grin_with_vertex_property() const; - void _internal_set_grin_with_vertex_property(bool value); - public: - - // bool grin_with_vertex_property_name = 2; - void clear_grin_with_vertex_property_name(); - bool grin_with_vertex_property_name() const; - void set_grin_with_vertex_property_name(bool value); - private: - bool _internal_grin_with_vertex_property_name() const; - void _internal_set_grin_with_vertex_property_name(bool value); - public: - - // bool grin_with_vertex_type_name = 3; - void clear_grin_with_vertex_type_name(); - bool grin_with_vertex_type_name() const; - void set_grin_with_vertex_type_name(bool value); - private: - bool _internal_grin_with_vertex_type_name() const; - void _internal_set_grin_with_vertex_type_name(bool value); - public: - - // bool grin_enable_vertex_property_table = 4; - void clear_grin_enable_vertex_property_table(); - bool grin_enable_vertex_property_table() const; - void set_grin_enable_vertex_property_table(bool value); - private: - bool _internal_grin_enable_vertex_property_table() const; - void _internal_set_grin_enable_vertex_property_table(bool value); - public: - - // bool grin_enable_vertex_primary_keys = 5; - void clear_grin_enable_vertex_primary_keys(); - bool grin_enable_vertex_primary_keys() const; - void set_grin_enable_vertex_primary_keys(bool value); - private: - bool _internal_grin_enable_vertex_primary_keys() const; - void _internal_set_grin_enable_vertex_primary_keys(bool value); - public: - - // bool grin_trait_natural_id_for_vertex_type = 6; - void clear_grin_trait_natural_id_for_vertex_type(); - bool grin_trait_natural_id_for_vertex_type() const; - void set_grin_trait_natural_id_for_vertex_type(bool value); - private: - bool _internal_grin_trait_natural_id_for_vertex_type() const; - void _internal_set_grin_trait_natural_id_for_vertex_type(bool value); - public: - - // bool grin_trait_natural_id_for_vertex_property = 7; - void clear_grin_trait_natural_id_for_vertex_property(); - bool grin_trait_natural_id_for_vertex_property() const; - void set_grin_trait_natural_id_for_vertex_property(bool value); - private: - bool _internal_grin_trait_natural_id_for_vertex_property() const; - void _internal_set_grin_trait_natural_id_for_vertex_property(bool value); - public: - - // bool grin_assume_by_type_vertex_original_id = 8; - void clear_grin_assume_by_type_vertex_original_id(); - bool grin_assume_by_type_vertex_original_id() const; - void set_grin_assume_by_type_vertex_original_id(bool value); - private: - bool _internal_grin_assume_by_type_vertex_original_id() const; - void _internal_set_grin_assume_by_type_vertex_original_id(bool value); - public: - - // @@protoc_insertion_point(class_scope:grin.VertexPropertyFeature) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - bool grin_with_vertex_property_; - bool grin_with_vertex_property_name_; - bool grin_with_vertex_type_name_; - bool grin_enable_vertex_property_table_; - bool grin_enable_vertex_primary_keys_; - bool grin_trait_natural_id_for_vertex_type_; - bool grin_trait_natural_id_for_vertex_property_; - bool grin_assume_by_type_vertex_original_id_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_graph_2eproto; -}; -// ------------------------------------------------------------------- - -class EdgePropertyFeature PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.EdgePropertyFeature) */ { - public: - inline EdgePropertyFeature() : EdgePropertyFeature(nullptr) {}; - virtual ~EdgePropertyFeature(); - - EdgePropertyFeature(const EdgePropertyFeature& from); - EdgePropertyFeature(EdgePropertyFeature&& from) noexcept - : EdgePropertyFeature() { - *this = ::std::move(from); - } - - inline EdgePropertyFeature& operator=(const EdgePropertyFeature& from) { - CopyFrom(from); - return *this; - } - inline EdgePropertyFeature& operator=(EdgePropertyFeature&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const EdgePropertyFeature& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const EdgePropertyFeature* internal_default_instance() { - return reinterpret_cast( - &_EdgePropertyFeature_default_instance_); - } - static constexpr int kIndexInFileMessages = - 4; - - friend void swap(EdgePropertyFeature& a, EdgePropertyFeature& b) { - a.Swap(&b); - } - inline void Swap(EdgePropertyFeature* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(EdgePropertyFeature* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline EdgePropertyFeature* New() const final { - return CreateMaybeMessage(nullptr); - } - - EdgePropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const EdgePropertyFeature& from); - void MergeFrom(const EdgePropertyFeature& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(EdgePropertyFeature* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.EdgePropertyFeature"; - } - protected: - explicit EdgePropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kGrinWithEdgePropertyFieldNumber = 1, - kGrinWithEdgePropertyNameFieldNumber = 2, - kGrinWithEdgeTypeNameFieldNumber = 3, - kGrinEnableEdgePropertyTableFieldNumber = 4, - kGrinEnableEdgePrimaryKeysFieldNumber = 5, - kGrinTraitNaturalIdForEdgeTypeFieldNumber = 6, - kGrinTraitNaturalIdForEdgePropertyFieldNumber = 7, - }; - // bool grin_with_edge_property = 1; - void clear_grin_with_edge_property(); - bool grin_with_edge_property() const; - void set_grin_with_edge_property(bool value); - private: - bool _internal_grin_with_edge_property() const; - void _internal_set_grin_with_edge_property(bool value); - public: - - // bool grin_with_edge_property_name = 2; - void clear_grin_with_edge_property_name(); - bool grin_with_edge_property_name() const; - void set_grin_with_edge_property_name(bool value); - private: - bool _internal_grin_with_edge_property_name() const; - void _internal_set_grin_with_edge_property_name(bool value); - public: - - // bool grin_with_edge_type_name = 3; - void clear_grin_with_edge_type_name(); - bool grin_with_edge_type_name() const; - void set_grin_with_edge_type_name(bool value); - private: - bool _internal_grin_with_edge_type_name() const; - void _internal_set_grin_with_edge_type_name(bool value); - public: - - // bool grin_enable_edge_property_table = 4; - void clear_grin_enable_edge_property_table(); - bool grin_enable_edge_property_table() const; - void set_grin_enable_edge_property_table(bool value); - private: - bool _internal_grin_enable_edge_property_table() const; - void _internal_set_grin_enable_edge_property_table(bool value); - public: - - // bool grin_enable_edge_primary_keys = 5; - void clear_grin_enable_edge_primary_keys(); - bool grin_enable_edge_primary_keys() const; - void set_grin_enable_edge_primary_keys(bool value); - private: - bool _internal_grin_enable_edge_primary_keys() const; - void _internal_set_grin_enable_edge_primary_keys(bool value); - public: - - // bool grin_trait_natural_id_for_edge_type = 6; - void clear_grin_trait_natural_id_for_edge_type(); - bool grin_trait_natural_id_for_edge_type() const; - void set_grin_trait_natural_id_for_edge_type(bool value); - private: - bool _internal_grin_trait_natural_id_for_edge_type() const; - void _internal_set_grin_trait_natural_id_for_edge_type(bool value); - public: - - // bool grin_trait_natural_id_for_edge_property = 7; - void clear_grin_trait_natural_id_for_edge_property(); - bool grin_trait_natural_id_for_edge_property() const; - void set_grin_trait_natural_id_for_edge_property(bool value); - private: - bool _internal_grin_trait_natural_id_for_edge_property() const; - void _internal_set_grin_trait_natural_id_for_edge_property(bool value); - public: - - // @@protoc_insertion_point(class_scope:grin.EdgePropertyFeature) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - bool grin_with_edge_property_; - bool grin_with_edge_property_name_; - bool grin_with_edge_type_name_; - bool grin_enable_edge_property_table_; - bool grin_enable_edge_primary_keys_; - bool grin_trait_natural_id_for_edge_type_; - bool grin_trait_natural_id_for_edge_property_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_graph_2eproto; -}; -// ------------------------------------------------------------------- - -class PropertyFeature PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PropertyFeature) */ { - public: - inline PropertyFeature() : PropertyFeature(nullptr) {}; - virtual ~PropertyFeature(); - - PropertyFeature(const PropertyFeature& from); - PropertyFeature(PropertyFeature&& from) noexcept - : PropertyFeature() { - *this = ::std::move(from); - } - - inline PropertyFeature& operator=(const PropertyFeature& from) { - CopyFrom(from); - return *this; - } - inline PropertyFeature& operator=(PropertyFeature&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const PropertyFeature& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const PropertyFeature* internal_default_instance() { - return reinterpret_cast( - &_PropertyFeature_default_instance_); - } - static constexpr int kIndexInFileMessages = - 5; - - friend void swap(PropertyFeature& a, PropertyFeature& b) { - a.Swap(&b); - } - inline void Swap(PropertyFeature* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(PropertyFeature* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline PropertyFeature* New() const final { - return CreateMaybeMessage(nullptr); - } - - PropertyFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const PropertyFeature& from); - void MergeFrom(const PropertyFeature& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(PropertyFeature* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.PropertyFeature"; - } - protected: - explicit PropertyFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kVertexPropertyFeatureFieldNumber = 2, - kEdgePropertyFeatureFieldNumber = 3, - kVertexPropertyFieldNumber = 4, - kEdgePropertyFieldNumber = 5, - kGrinEnableRowFieldNumber = 1, - kGrinAssumeColumnStoreForVertexPropertyFieldNumber = 6, - kGrinAssumeColumnStoreForEdgePropertyFieldNumber = 7, - kGrinTraitSelectTypeForVertexListFieldNumber = 8, - kGrinTraitSelectTypeForEdgeListFieldNumber = 9, - kGrinTraitSelectNeighborTypeForAdjacentListFieldNumber = 10, - kGrinTraitSelectEdgeTypeForAdjacentListFieldNumber = 11, - kGrinTraitSpecificVevRelationFieldNumber = 12, - }; - // .grin.VertexPropertyFeature vertex_property_feature = 2; - bool has_vertex_property_feature() const; - private: - bool _internal_has_vertex_property_feature() const; - public: - void clear_vertex_property_feature(); - const ::grin::VertexPropertyFeature& vertex_property_feature() const; - ::grin::VertexPropertyFeature* release_vertex_property_feature(); - ::grin::VertexPropertyFeature* mutable_vertex_property_feature(); - void set_allocated_vertex_property_feature(::grin::VertexPropertyFeature* vertex_property_feature); - private: - const ::grin::VertexPropertyFeature& _internal_vertex_property_feature() const; - ::grin::VertexPropertyFeature* _internal_mutable_vertex_property_feature(); - public: - void unsafe_arena_set_allocated_vertex_property_feature( - ::grin::VertexPropertyFeature* vertex_property_feature); - ::grin::VertexPropertyFeature* unsafe_arena_release_vertex_property_feature(); - - // .grin.EdgePropertyFeature edge_property_feature = 3; - bool has_edge_property_feature() const; - private: - bool _internal_has_edge_property_feature() const; - public: - void clear_edge_property_feature(); - const ::grin::EdgePropertyFeature& edge_property_feature() const; - ::grin::EdgePropertyFeature* release_edge_property_feature(); - ::grin::EdgePropertyFeature* mutable_edge_property_feature(); - void set_allocated_edge_property_feature(::grin::EdgePropertyFeature* edge_property_feature); - private: - const ::grin::EdgePropertyFeature& _internal_edge_property_feature() const; - ::grin::EdgePropertyFeature* _internal_mutable_edge_property_feature(); - public: - void unsafe_arena_set_allocated_edge_property_feature( - ::grin::EdgePropertyFeature* edge_property_feature); - ::grin::EdgePropertyFeature* unsafe_arena_release_edge_property_feature(); - - // .grin.PropertyDataPartitionStrategy vertex_property = 4; - void clear_vertex_property(); - ::grin::PropertyDataPartitionStrategy vertex_property() const; - void set_vertex_property(::grin::PropertyDataPartitionStrategy value); - private: - ::grin::PropertyDataPartitionStrategy _internal_vertex_property() const; - void _internal_set_vertex_property(::grin::PropertyDataPartitionStrategy value); - public: - - // .grin.PropertyDataPartitionStrategy edge_property = 5; - void clear_edge_property(); - ::grin::PropertyDataPartitionStrategy edge_property() const; - void set_edge_property(::grin::PropertyDataPartitionStrategy value); - private: - ::grin::PropertyDataPartitionStrategy _internal_edge_property() const; - void _internal_set_edge_property(::grin::PropertyDataPartitionStrategy value); - public: - - // bool grin_enable_row = 1; - void clear_grin_enable_row(); - bool grin_enable_row() const; - void set_grin_enable_row(bool value); - private: - bool _internal_grin_enable_row() const; - void _internal_set_grin_enable_row(bool value); - public: - - // bool grin_assume_column_store_for_vertex_property = 6; - void clear_grin_assume_column_store_for_vertex_property(); - bool grin_assume_column_store_for_vertex_property() const; - void set_grin_assume_column_store_for_vertex_property(bool value); - private: - bool _internal_grin_assume_column_store_for_vertex_property() const; - void _internal_set_grin_assume_column_store_for_vertex_property(bool value); - public: - - // bool grin_assume_column_store_for_edge_property = 7; - void clear_grin_assume_column_store_for_edge_property(); - bool grin_assume_column_store_for_edge_property() const; - void set_grin_assume_column_store_for_edge_property(bool value); - private: - bool _internal_grin_assume_column_store_for_edge_property() const; - void _internal_set_grin_assume_column_store_for_edge_property(bool value); - public: - - // bool grin_trait_select_type_for_vertex_list = 8; - void clear_grin_trait_select_type_for_vertex_list(); - bool grin_trait_select_type_for_vertex_list() const; - void set_grin_trait_select_type_for_vertex_list(bool value); - private: - bool _internal_grin_trait_select_type_for_vertex_list() const; - void _internal_set_grin_trait_select_type_for_vertex_list(bool value); - public: - - // bool grin_trait_select_type_for_edge_list = 9; - void clear_grin_trait_select_type_for_edge_list(); - bool grin_trait_select_type_for_edge_list() const; - void set_grin_trait_select_type_for_edge_list(bool value); - private: - bool _internal_grin_trait_select_type_for_edge_list() const; - void _internal_set_grin_trait_select_type_for_edge_list(bool value); - public: - - // bool grin_trait_select_neighbor_type_for_adjacent_list = 10; - void clear_grin_trait_select_neighbor_type_for_adjacent_list(); - bool grin_trait_select_neighbor_type_for_adjacent_list() const; - void set_grin_trait_select_neighbor_type_for_adjacent_list(bool value); - private: - bool _internal_grin_trait_select_neighbor_type_for_adjacent_list() const; - void _internal_set_grin_trait_select_neighbor_type_for_adjacent_list(bool value); - public: - - // bool grin_trait_select_edge_type_for_adjacent_list = 11; - void clear_grin_trait_select_edge_type_for_adjacent_list(); - bool grin_trait_select_edge_type_for_adjacent_list() const; - void set_grin_trait_select_edge_type_for_adjacent_list(bool value); - private: - bool _internal_grin_trait_select_edge_type_for_adjacent_list() const; - void _internal_set_grin_trait_select_edge_type_for_adjacent_list(bool value); - public: - - // bool grin_trait_specific_vev_relation = 12; - void clear_grin_trait_specific_vev_relation(); - bool grin_trait_specific_vev_relation() const; - void set_grin_trait_specific_vev_relation(bool value); - private: - bool _internal_grin_trait_specific_vev_relation() const; - void _internal_set_grin_trait_specific_vev_relation(bool value); - public: - - // @@protoc_insertion_point(class_scope:grin.PropertyFeature) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::grin::VertexPropertyFeature* vertex_property_feature_; - ::grin::EdgePropertyFeature* edge_property_feature_; - int vertex_property_; - int edge_property_; - bool grin_enable_row_; - bool grin_assume_column_store_for_vertex_property_; - bool grin_assume_column_store_for_edge_property_; - bool grin_trait_select_type_for_vertex_list_; - bool grin_trait_select_type_for_edge_list_; - bool grin_trait_select_neighbor_type_for_adjacent_list_; - bool grin_trait_select_edge_type_for_adjacent_list_; - bool grin_trait_specific_vev_relation_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_graph_2eproto; -}; -// ------------------------------------------------------------------- - -class IndexFeature PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.IndexFeature) */ { - public: - inline IndexFeature() : IndexFeature(nullptr) {}; - virtual ~IndexFeature(); - - IndexFeature(const IndexFeature& from); - IndexFeature(IndexFeature&& from) noexcept - : IndexFeature() { - *this = ::std::move(from); - } - - inline IndexFeature& operator=(const IndexFeature& from) { - CopyFrom(from); - return *this; - } - inline IndexFeature& operator=(IndexFeature&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const IndexFeature& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const IndexFeature* internal_default_instance() { - return reinterpret_cast( - &_IndexFeature_default_instance_); - } - static constexpr int kIndexInFileMessages = - 6; - - friend void swap(IndexFeature& a, IndexFeature& b) { - a.Swap(&b); - } - inline void Swap(IndexFeature* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(IndexFeature* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline IndexFeature* New() const final { - return CreateMaybeMessage(nullptr); - } - - IndexFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const IndexFeature& from); - void MergeFrom(const IndexFeature& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(IndexFeature* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.IndexFeature"; - } - protected: - explicit IndexFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kGrinWithVertexLabelFieldNumber = 1, - kGrinWithEdgeLabelFieldNumber = 2, - kGrinAssumeAllVertexListSortedFieldNumber = 3, - }; - // bool grin_with_vertex_label = 1; - void clear_grin_with_vertex_label(); - bool grin_with_vertex_label() const; - void set_grin_with_vertex_label(bool value); - private: - bool _internal_grin_with_vertex_label() const; - void _internal_set_grin_with_vertex_label(bool value); - public: - - // bool grin_with_edge_label = 2; - void clear_grin_with_edge_label(); - bool grin_with_edge_label() const; - void set_grin_with_edge_label(bool value); - private: - bool _internal_grin_with_edge_label() const; - void _internal_set_grin_with_edge_label(bool value); - public: - - // bool grin_assume_all_vertex_list_sorted = 3; - void clear_grin_assume_all_vertex_list_sorted(); - bool grin_assume_all_vertex_list_sorted() const; - void set_grin_assume_all_vertex_list_sorted(bool value); - private: - bool _internal_grin_assume_all_vertex_list_sorted() const; - void _internal_set_grin_assume_all_vertex_list_sorted(bool value); - public: - - // @@protoc_insertion_point(class_scope:grin.IndexFeature) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - bool grin_with_vertex_label_; - bool grin_with_edge_label_; - bool grin_assume_all_vertex_list_sorted_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_graph_2eproto; -}; -// ------------------------------------------------------------------- - -class PredicateFeature PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.PredicateFeature) */ { - public: - inline PredicateFeature() : PredicateFeature(nullptr) {}; - virtual ~PredicateFeature(); - - PredicateFeature(const PredicateFeature& from); - PredicateFeature(PredicateFeature&& from) noexcept - : PredicateFeature() { - *this = ::std::move(from); - } - - inline PredicateFeature& operator=(const PredicateFeature& from) { - CopyFrom(from); - return *this; - } - inline PredicateFeature& operator=(PredicateFeature&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const PredicateFeature& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const PredicateFeature* internal_default_instance() { - return reinterpret_cast( - &_PredicateFeature_default_instance_); - } - static constexpr int kIndexInFileMessages = - 7; - - friend void swap(PredicateFeature& a, PredicateFeature& b) { - a.Swap(&b); - } - inline void Swap(PredicateFeature* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(PredicateFeature* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline PredicateFeature* New() const final { - return CreateMaybeMessage(nullptr); - } - - PredicateFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const PredicateFeature& from); - void MergeFrom(const PredicateFeature& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(PredicateFeature* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.PredicateFeature"; - } - protected: - explicit PredicateFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - // @@protoc_insertion_point(class_scope:grin.PredicateFeature) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_graph_2eproto; -}; -// ------------------------------------------------------------------- - -class StorageFeature PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.StorageFeature) */ { - public: - inline StorageFeature() : StorageFeature(nullptr) {}; - virtual ~StorageFeature(); - - StorageFeature(const StorageFeature& from); - StorageFeature(StorageFeature&& from) noexcept - : StorageFeature() { - *this = ::std::move(from); - } - - inline StorageFeature& operator=(const StorageFeature& from) { - CopyFrom(from); - return *this; - } - inline StorageFeature& operator=(StorageFeature&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const StorageFeature& default_instance(); - - enum SpecificFeatureCase { - kTopologyFeature = 1, - kPartitionFeature = 2, - kPropertyFeature = 3, - kIndexFeature = 4, - kPredicateFeature = 5, - SPECIFIC_FEATURE_NOT_SET = 0, - }; - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const StorageFeature* internal_default_instance() { - return reinterpret_cast( - &_StorageFeature_default_instance_); - } - static constexpr int kIndexInFileMessages = - 8; - - friend void swap(StorageFeature& a, StorageFeature& b) { - a.Swap(&b); - } - inline void Swap(StorageFeature* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(StorageFeature* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline StorageFeature* New() const final { - return CreateMaybeMessage(nullptr); - } - - StorageFeature* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const StorageFeature& from); - void MergeFrom(const StorageFeature& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(StorageFeature* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.StorageFeature"; - } - protected: - explicit StorageFeature(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kTopologyFeatureFieldNumber = 1, - kPartitionFeatureFieldNumber = 2, - kPropertyFeatureFieldNumber = 3, - kIndexFeatureFieldNumber = 4, - kPredicateFeatureFieldNumber = 5, - }; - // .grin.TopologyFeature topology_feature = 1; - bool has_topology_feature() const; - private: - bool _internal_has_topology_feature() const; - public: - void clear_topology_feature(); - const ::grin::TopologyFeature& topology_feature() const; - ::grin::TopologyFeature* release_topology_feature(); - ::grin::TopologyFeature* mutable_topology_feature(); - void set_allocated_topology_feature(::grin::TopologyFeature* topology_feature); - private: - const ::grin::TopologyFeature& _internal_topology_feature() const; - ::grin::TopologyFeature* _internal_mutable_topology_feature(); - public: - void unsafe_arena_set_allocated_topology_feature( - ::grin::TopologyFeature* topology_feature); - ::grin::TopologyFeature* unsafe_arena_release_topology_feature(); - - // .grin.PartitionFeature partition_feature = 2; - bool has_partition_feature() const; - private: - bool _internal_has_partition_feature() const; - public: - void clear_partition_feature(); - const ::grin::PartitionFeature& partition_feature() const; - ::grin::PartitionFeature* release_partition_feature(); - ::grin::PartitionFeature* mutable_partition_feature(); - void set_allocated_partition_feature(::grin::PartitionFeature* partition_feature); - private: - const ::grin::PartitionFeature& _internal_partition_feature() const; - ::grin::PartitionFeature* _internal_mutable_partition_feature(); - public: - void unsafe_arena_set_allocated_partition_feature( - ::grin::PartitionFeature* partition_feature); - ::grin::PartitionFeature* unsafe_arena_release_partition_feature(); - - // .grin.PropertyFeature property_feature = 3; - bool has_property_feature() const; - private: - bool _internal_has_property_feature() const; - public: - void clear_property_feature(); - const ::grin::PropertyFeature& property_feature() const; - ::grin::PropertyFeature* release_property_feature(); - ::grin::PropertyFeature* mutable_property_feature(); - void set_allocated_property_feature(::grin::PropertyFeature* property_feature); - private: - const ::grin::PropertyFeature& _internal_property_feature() const; - ::grin::PropertyFeature* _internal_mutable_property_feature(); - public: - void unsafe_arena_set_allocated_property_feature( - ::grin::PropertyFeature* property_feature); - ::grin::PropertyFeature* unsafe_arena_release_property_feature(); - - // .grin.IndexFeature index_feature = 4; - bool has_index_feature() const; - private: - bool _internal_has_index_feature() const; - public: - void clear_index_feature(); - const ::grin::IndexFeature& index_feature() const; - ::grin::IndexFeature* release_index_feature(); - ::grin::IndexFeature* mutable_index_feature(); - void set_allocated_index_feature(::grin::IndexFeature* index_feature); - private: - const ::grin::IndexFeature& _internal_index_feature() const; - ::grin::IndexFeature* _internal_mutable_index_feature(); - public: - void unsafe_arena_set_allocated_index_feature( - ::grin::IndexFeature* index_feature); - ::grin::IndexFeature* unsafe_arena_release_index_feature(); - - // .grin.PredicateFeature predicate_feature = 5; - bool has_predicate_feature() const; - private: - bool _internal_has_predicate_feature() const; - public: - void clear_predicate_feature(); - const ::grin::PredicateFeature& predicate_feature() const; - ::grin::PredicateFeature* release_predicate_feature(); - ::grin::PredicateFeature* mutable_predicate_feature(); - void set_allocated_predicate_feature(::grin::PredicateFeature* predicate_feature); - private: - const ::grin::PredicateFeature& _internal_predicate_feature() const; - ::grin::PredicateFeature* _internal_mutable_predicate_feature(); - public: - void unsafe_arena_set_allocated_predicate_feature( - ::grin::PredicateFeature* predicate_feature); - ::grin::PredicateFeature* unsafe_arena_release_predicate_feature(); - - void clear_specific_feature(); - SpecificFeatureCase specific_feature_case() const; - // @@protoc_insertion_point(class_scope:grin.StorageFeature) - private: - class _Internal; - void set_has_topology_feature(); - void set_has_partition_feature(); - void set_has_property_feature(); - void set_has_index_feature(); - void set_has_predicate_feature(); - - inline bool has_specific_feature() const; - inline void clear_has_specific_feature(); - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - union SpecificFeatureUnion { - SpecificFeatureUnion() {} - ::grin::TopologyFeature* topology_feature_; - ::grin::PartitionFeature* partition_feature_; - ::grin::PropertyFeature* property_feature_; - ::grin::IndexFeature* index_feature_; - ::grin::PredicateFeature* predicate_feature_; - } specific_feature_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - ::PROTOBUF_NAMESPACE_ID::uint32 _oneof_case_[1]; - - friend struct ::TableStruct_graph_2eproto; -}; -// ------------------------------------------------------------------- - -class Statistics PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.Statistics) */ { - public: - inline Statistics() : Statistics(nullptr) {}; - virtual ~Statistics(); - - Statistics(const Statistics& from); - Statistics(Statistics&& from) noexcept - : Statistics() { - *this = ::std::move(from); - } - - inline Statistics& operator=(const Statistics& from) { - CopyFrom(from); - return *this; - } - inline Statistics& operator=(Statistics&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Statistics& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Statistics* internal_default_instance() { - return reinterpret_cast( - &_Statistics_default_instance_); - } - static constexpr int kIndexInFileMessages = - 9; - - friend void swap(Statistics& a, Statistics& b) { - a.Swap(&b); - } - inline void Swap(Statistics* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Statistics* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Statistics* New() const final { - return CreateMaybeMessage(nullptr); - } - - Statistics* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Statistics& from); - void MergeFrom(const Statistics& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Statistics* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.Statistics"; - } - protected: - explicit Statistics(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kVertexCountFieldNumber = 1, - kEdgeCountFieldNumber = 2, - kPartitionCountFieldNumber = 3, - kVertexTypeCountFieldNumber = 4, - kEdgeTypeCountFieldNumber = 5, - }; - // int32 vertex_count = 1; - void clear_vertex_count(); - ::PROTOBUF_NAMESPACE_ID::int32 vertex_count() const; - void set_vertex_count(::PROTOBUF_NAMESPACE_ID::int32 value); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_vertex_count() const; - void _internal_set_vertex_count(::PROTOBUF_NAMESPACE_ID::int32 value); - public: - - // int32 edge_count = 2; - void clear_edge_count(); - ::PROTOBUF_NAMESPACE_ID::int32 edge_count() const; - void set_edge_count(::PROTOBUF_NAMESPACE_ID::int32 value); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_edge_count() const; - void _internal_set_edge_count(::PROTOBUF_NAMESPACE_ID::int32 value); - public: - - // int32 partition_count = 3; - void clear_partition_count(); - ::PROTOBUF_NAMESPACE_ID::int32 partition_count() const; - void set_partition_count(::PROTOBUF_NAMESPACE_ID::int32 value); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_partition_count() const; - void _internal_set_partition_count(::PROTOBUF_NAMESPACE_ID::int32 value); - public: - - // int32 vertex_type_count = 4; - void clear_vertex_type_count(); - ::PROTOBUF_NAMESPACE_ID::int32 vertex_type_count() const; - void set_vertex_type_count(::PROTOBUF_NAMESPACE_ID::int32 value); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_vertex_type_count() const; - void _internal_set_vertex_type_count(::PROTOBUF_NAMESPACE_ID::int32 value); - public: - - // int32 edge_type_count = 5; - void clear_edge_type_count(); - ::PROTOBUF_NAMESPACE_ID::int32 edge_type_count() const; - void set_edge_type_count(::PROTOBUF_NAMESPACE_ID::int32 value); - private: - ::PROTOBUF_NAMESPACE_ID::int32 _internal_edge_type_count() const; - void _internal_set_edge_type_count(::PROTOBUF_NAMESPACE_ID::int32 value); - public: - - // @@protoc_insertion_point(class_scope:grin.Statistics) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::int32 vertex_count_; - ::PROTOBUF_NAMESPACE_ID::int32 edge_count_; - ::PROTOBUF_NAMESPACE_ID::int32 partition_count_; - ::PROTOBUF_NAMESPACE_ID::int32 vertex_type_count_; - ::PROTOBUF_NAMESPACE_ID::int32 edge_type_count_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_graph_2eproto; -}; -// ------------------------------------------------------------------- - -class Graph PROTOBUF_FINAL : - public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:grin.Graph) */ { - public: - inline Graph() : Graph(nullptr) {}; - virtual ~Graph(); - - Graph(const Graph& from); - Graph(Graph&& from) noexcept - : Graph() { - *this = ::std::move(from); - } - - inline Graph& operator=(const Graph& from) { - CopyFrom(from); - return *this; - } - inline Graph& operator=(Graph&& from) noexcept { - if (GetArena() == from.GetArena()) { - if (this != &from) InternalSwap(&from); - } else { - CopyFrom(from); - } - return *this; - } - - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { - return GetDescriptor(); - } - static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { - return GetMetadataStatic().descriptor; - } - static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { - return GetMetadataStatic().reflection; - } - static const Graph& default_instance(); - - static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY - static inline const Graph* internal_default_instance() { - return reinterpret_cast( - &_Graph_default_instance_); - } - static constexpr int kIndexInFileMessages = - 10; - - friend void swap(Graph& a, Graph& b) { - a.Swap(&b); - } - inline void Swap(Graph* other) { - if (other == this) return; - if (GetArena() == other->GetArena()) { - InternalSwap(other); - } else { - ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); - } - } - void UnsafeArenaSwap(Graph* other) { - if (other == this) return; - GOOGLE_DCHECK(GetArena() == other->GetArena()); - InternalSwap(other); - } - - // implements Message ---------------------------------------------- - - inline Graph* New() const final { - return CreateMaybeMessage(nullptr); - } - - Graph* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { - return CreateMaybeMessage(arena); - } - void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; - void CopyFrom(const Graph& from); - void MergeFrom(const Graph& from); - PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; - bool IsInitialized() const final; - - size_t ByteSizeLong() const final; - const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; - ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( - ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; - int GetCachedSize() const final { return _cached_size_.Get(); } - - private: - inline void SharedCtor(); - inline void SharedDtor(); - void SetCachedSize(int size) const final; - void InternalSwap(Graph* other); - friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; - static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { - return "grin.Graph"; - } - protected: - explicit Graph(::PROTOBUF_NAMESPACE_ID::Arena* arena); - private: - static void ArenaDtor(void* object); - inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); - public: - - ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; - private: - static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { - ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_graph_2eproto); - return ::descriptor_table_graph_2eproto.file_level_metadata[kIndexInFileMessages]; - } - - public: - - // nested types ---------------------------------------------------- - - // accessors ------------------------------------------------------- - - enum : int { - kFeaturesFieldNumber = 3, - kUriFieldNumber = 1, - kGrinVersionFieldNumber = 2, - kStatisticsFieldNumber = 4, - }; - // repeated .grin.StorageFeature features = 3; - int features_size() const; - private: - int _internal_features_size() const; - public: - void clear_features(); - ::grin::StorageFeature* mutable_features(int index); - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature >* - mutable_features(); - private: - const ::grin::StorageFeature& _internal_features(int index) const; - ::grin::StorageFeature* _internal_add_features(); - public: - const ::grin::StorageFeature& features(int index) const; - ::grin::StorageFeature* add_features(); - const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature >& - features() const; - - // string uri = 1; - void clear_uri(); - const std::string& uri() const; - void set_uri(const std::string& value); - void set_uri(std::string&& value); - void set_uri(const char* value); - void set_uri(const char* value, size_t size); - std::string* mutable_uri(); - std::string* release_uri(); - void set_allocated_uri(std::string* uri); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_uri(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_uri( - std::string* uri); - private: - const std::string& _internal_uri() const; - void _internal_set_uri(const std::string& value); - std::string* _internal_mutable_uri(); - public: - - // string grin_version = 2; - void clear_grin_version(); - const std::string& grin_version() const; - void set_grin_version(const std::string& value); - void set_grin_version(std::string&& value); - void set_grin_version(const char* value); - void set_grin_version(const char* value, size_t size); - std::string* mutable_grin_version(); - std::string* release_grin_version(); - void set_allocated_grin_version(std::string* grin_version); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - std::string* unsafe_arena_release_grin_version(); - GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" - " string fields are deprecated and will be removed in a" - " future release.") - void unsafe_arena_set_allocated_grin_version( - std::string* grin_version); - private: - const std::string& _internal_grin_version() const; - void _internal_set_grin_version(const std::string& value); - std::string* _internal_mutable_grin_version(); - public: - - // .grin.Statistics statistics = 4; - bool has_statistics() const; - private: - bool _internal_has_statistics() const; - public: - void clear_statistics(); - const ::grin::Statistics& statistics() const; - ::grin::Statistics* release_statistics(); - ::grin::Statistics* mutable_statistics(); - void set_allocated_statistics(::grin::Statistics* statistics); - private: - const ::grin::Statistics& _internal_statistics() const; - ::grin::Statistics* _internal_mutable_statistics(); - public: - void unsafe_arena_set_allocated_statistics( - ::grin::Statistics* statistics); - ::grin::Statistics* unsafe_arena_release_statistics(); - - // @@protoc_insertion_point(class_scope:grin.Graph) - private: - class _Internal; - - template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; - typedef void InternalArenaConstructable_; - typedef void DestructorSkippable_; - ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature > features_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr uri_; - ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr grin_version_; - ::grin::Statistics* statistics_; - mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; - friend struct ::TableStruct_graph_2eproto; -}; -// =================================================================== - - -// =================================================================== - -#ifdef __GNUC__ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wstrict-aliasing" -#endif // __GNUC__ -// TopologyFeature - -// bool grin_assume_has_directed_graph = 1; -inline void TopologyFeature::clear_grin_assume_has_directed_graph() { - grin_assume_has_directed_graph_ = false; -} -inline bool TopologyFeature::_internal_grin_assume_has_directed_graph() const { - return grin_assume_has_directed_graph_; -} -inline bool TopologyFeature::grin_assume_has_directed_graph() const { - // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_assume_has_directed_graph) - return _internal_grin_assume_has_directed_graph(); -} -inline void TopologyFeature::_internal_set_grin_assume_has_directed_graph(bool value) { - - grin_assume_has_directed_graph_ = value; -} -inline void TopologyFeature::set_grin_assume_has_directed_graph(bool value) { - _internal_set_grin_assume_has_directed_graph(value); - // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_assume_has_directed_graph) -} - -// bool grin_assume_has_undirected_graph = 2; -inline void TopologyFeature::clear_grin_assume_has_undirected_graph() { - grin_assume_has_undirected_graph_ = false; -} -inline bool TopologyFeature::_internal_grin_assume_has_undirected_graph() const { - return grin_assume_has_undirected_graph_; -} -inline bool TopologyFeature::grin_assume_has_undirected_graph() const { - // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_assume_has_undirected_graph) - return _internal_grin_assume_has_undirected_graph(); -} -inline void TopologyFeature::_internal_set_grin_assume_has_undirected_graph(bool value) { - - grin_assume_has_undirected_graph_ = value; -} -inline void TopologyFeature::set_grin_assume_has_undirected_graph(bool value) { - _internal_set_grin_assume_has_undirected_graph(value); - // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_assume_has_undirected_graph) -} - -// bool grin_assume_has_multi_edge_graph = 3; -inline void TopologyFeature::clear_grin_assume_has_multi_edge_graph() { - grin_assume_has_multi_edge_graph_ = false; -} -inline bool TopologyFeature::_internal_grin_assume_has_multi_edge_graph() const { - return grin_assume_has_multi_edge_graph_; -} -inline bool TopologyFeature::grin_assume_has_multi_edge_graph() const { - // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_assume_has_multi_edge_graph) - return _internal_grin_assume_has_multi_edge_graph(); -} -inline void TopologyFeature::_internal_set_grin_assume_has_multi_edge_graph(bool value) { - - grin_assume_has_multi_edge_graph_ = value; -} -inline void TopologyFeature::set_grin_assume_has_multi_edge_graph(bool value) { - _internal_set_grin_assume_has_multi_edge_graph(value); - // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_assume_has_multi_edge_graph) -} - -// bool grin_with_vertex_original_id = 4; -inline void TopologyFeature::clear_grin_with_vertex_original_id() { - grin_with_vertex_original_id_ = false; -} -inline bool TopologyFeature::_internal_grin_with_vertex_original_id() const { - return grin_with_vertex_original_id_; -} -inline bool TopologyFeature::grin_with_vertex_original_id() const { - // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_with_vertex_original_id) - return _internal_grin_with_vertex_original_id(); -} -inline void TopologyFeature::_internal_set_grin_with_vertex_original_id(bool value) { - - grin_with_vertex_original_id_ = value; -} -inline void TopologyFeature::set_grin_with_vertex_original_id(bool value) { - _internal_set_grin_with_vertex_original_id(value); - // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_with_vertex_original_id) -} - -// bool grin_with_vertex_data = 5; -inline void TopologyFeature::clear_grin_with_vertex_data() { - grin_with_vertex_data_ = false; -} -inline bool TopologyFeature::_internal_grin_with_vertex_data() const { - return grin_with_vertex_data_; -} -inline bool TopologyFeature::grin_with_vertex_data() const { - // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_with_vertex_data) - return _internal_grin_with_vertex_data(); -} -inline void TopologyFeature::_internal_set_grin_with_vertex_data(bool value) { - - grin_with_vertex_data_ = value; -} -inline void TopologyFeature::set_grin_with_vertex_data(bool value) { - _internal_set_grin_with_vertex_data(value); - // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_with_vertex_data) -} - -// bool grin_with_edge_data = 6; -inline void TopologyFeature::clear_grin_with_edge_data() { - grin_with_edge_data_ = false; -} -inline bool TopologyFeature::_internal_grin_with_edge_data() const { - return grin_with_edge_data_; -} -inline bool TopologyFeature::grin_with_edge_data() const { - // @@protoc_insertion_point(field_get:grin.TopologyFeature.grin_with_edge_data) - return _internal_grin_with_edge_data(); -} -inline void TopologyFeature::_internal_set_grin_with_edge_data(bool value) { - - grin_with_edge_data_ = value; -} -inline void TopologyFeature::set_grin_with_edge_data(bool value) { - _internal_set_grin_with_edge_data(value); - // @@protoc_insertion_point(field_set:grin.TopologyFeature.grin_with_edge_data) -} - -// repeated .grin.ListRetrieval vertex_list_retrievals = 7; -inline int TopologyFeature::_internal_vertex_list_retrievals_size() const { - return vertex_list_retrievals_.size(); -} -inline int TopologyFeature::vertex_list_retrievals_size() const { - return _internal_vertex_list_retrievals_size(); -} -inline void TopologyFeature::clear_vertex_list_retrievals() { - vertex_list_retrievals_.Clear(); -} -inline ::grin::ListRetrieval TopologyFeature::_internal_vertex_list_retrievals(int index) const { - return static_cast< ::grin::ListRetrieval >(vertex_list_retrievals_.Get(index)); -} -inline ::grin::ListRetrieval TopologyFeature::vertex_list_retrievals(int index) const { - // @@protoc_insertion_point(field_get:grin.TopologyFeature.vertex_list_retrievals) - return _internal_vertex_list_retrievals(index); -} -inline void TopologyFeature::set_vertex_list_retrievals(int index, ::grin::ListRetrieval value) { - vertex_list_retrievals_.Set(index, value); - // @@protoc_insertion_point(field_set:grin.TopologyFeature.vertex_list_retrievals) -} -inline void TopologyFeature::_internal_add_vertex_list_retrievals(::grin::ListRetrieval value) { - vertex_list_retrievals_.Add(value); -} -inline void TopologyFeature::add_vertex_list_retrievals(::grin::ListRetrieval value) { - // @@protoc_insertion_point(field_add:grin.TopologyFeature.vertex_list_retrievals) - _internal_add_vertex_list_retrievals(value); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& -TopologyFeature::vertex_list_retrievals() const { - // @@protoc_insertion_point(field_list:grin.TopologyFeature.vertex_list_retrievals) - return vertex_list_retrievals_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyFeature::_internal_mutable_vertex_list_retrievals() { - return &vertex_list_retrievals_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyFeature::mutable_vertex_list_retrievals() { - // @@protoc_insertion_point(field_mutable_list:grin.TopologyFeature.vertex_list_retrievals) - return _internal_mutable_vertex_list_retrievals(); -} - -// repeated .grin.ListRetrieval edge_list_retrievals = 8; -inline int TopologyFeature::_internal_edge_list_retrievals_size() const { - return edge_list_retrievals_.size(); -} -inline int TopologyFeature::edge_list_retrievals_size() const { - return _internal_edge_list_retrievals_size(); -} -inline void TopologyFeature::clear_edge_list_retrievals() { - edge_list_retrievals_.Clear(); -} -inline ::grin::ListRetrieval TopologyFeature::_internal_edge_list_retrievals(int index) const { - return static_cast< ::grin::ListRetrieval >(edge_list_retrievals_.Get(index)); -} -inline ::grin::ListRetrieval TopologyFeature::edge_list_retrievals(int index) const { - // @@protoc_insertion_point(field_get:grin.TopologyFeature.edge_list_retrievals) - return _internal_edge_list_retrievals(index); -} -inline void TopologyFeature::set_edge_list_retrievals(int index, ::grin::ListRetrieval value) { - edge_list_retrievals_.Set(index, value); - // @@protoc_insertion_point(field_set:grin.TopologyFeature.edge_list_retrievals) -} -inline void TopologyFeature::_internal_add_edge_list_retrievals(::grin::ListRetrieval value) { - edge_list_retrievals_.Add(value); -} -inline void TopologyFeature::add_edge_list_retrievals(::grin::ListRetrieval value) { - // @@protoc_insertion_point(field_add:grin.TopologyFeature.edge_list_retrievals) - _internal_add_edge_list_retrievals(value); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& -TopologyFeature::edge_list_retrievals() const { - // @@protoc_insertion_point(field_list:grin.TopologyFeature.edge_list_retrievals) - return edge_list_retrievals_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyFeature::_internal_mutable_edge_list_retrievals() { - return &edge_list_retrievals_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyFeature::mutable_edge_list_retrievals() { - // @@protoc_insertion_point(field_mutable_list:grin.TopologyFeature.edge_list_retrievals) - return _internal_mutable_edge_list_retrievals(); -} - -// repeated .grin.ListRetrieval adjacent_list_retrievals = 9; -inline int TopologyFeature::_internal_adjacent_list_retrievals_size() const { - return adjacent_list_retrievals_.size(); -} -inline int TopologyFeature::adjacent_list_retrievals_size() const { - return _internal_adjacent_list_retrievals_size(); -} -inline void TopologyFeature::clear_adjacent_list_retrievals() { - adjacent_list_retrievals_.Clear(); -} -inline ::grin::ListRetrieval TopologyFeature::_internal_adjacent_list_retrievals(int index) const { - return static_cast< ::grin::ListRetrieval >(adjacent_list_retrievals_.Get(index)); -} -inline ::grin::ListRetrieval TopologyFeature::adjacent_list_retrievals(int index) const { - // @@protoc_insertion_point(field_get:grin.TopologyFeature.adjacent_list_retrievals) - return _internal_adjacent_list_retrievals(index); -} -inline void TopologyFeature::set_adjacent_list_retrievals(int index, ::grin::ListRetrieval value) { - adjacent_list_retrievals_.Set(index, value); - // @@protoc_insertion_point(field_set:grin.TopologyFeature.adjacent_list_retrievals) -} -inline void TopologyFeature::_internal_add_adjacent_list_retrievals(::grin::ListRetrieval value) { - adjacent_list_retrievals_.Add(value); -} -inline void TopologyFeature::add_adjacent_list_retrievals(::grin::ListRetrieval value) { - // @@protoc_insertion_point(field_add:grin.TopologyFeature.adjacent_list_retrievals) - _internal_add_adjacent_list_retrievals(value); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField& -TopologyFeature::adjacent_list_retrievals() const { - // @@protoc_insertion_point(field_list:grin.TopologyFeature.adjacent_list_retrievals) - return adjacent_list_retrievals_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyFeature::_internal_mutable_adjacent_list_retrievals() { - return &adjacent_list_retrievals_; -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedField* -TopologyFeature::mutable_adjacent_list_retrievals() { - // @@protoc_insertion_point(field_mutable_list:grin.TopologyFeature.adjacent_list_retrievals) - return _internal_mutable_adjacent_list_retrievals(); -} - -// ------------------------------------------------------------------- - -// MirrorPartitionListFeature - -// bool grin_trait_master_vertex_mirror_partition_list = 1; -inline void MirrorPartitionListFeature::clear_grin_trait_master_vertex_mirror_partition_list() { - grin_trait_master_vertex_mirror_partition_list_ = false; -} -inline bool MirrorPartitionListFeature::_internal_grin_trait_master_vertex_mirror_partition_list() const { - return grin_trait_master_vertex_mirror_partition_list_; -} -inline bool MirrorPartitionListFeature::grin_trait_master_vertex_mirror_partition_list() const { - // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_master_vertex_mirror_partition_list) - return _internal_grin_trait_master_vertex_mirror_partition_list(); -} -inline void MirrorPartitionListFeature::_internal_set_grin_trait_master_vertex_mirror_partition_list(bool value) { - - grin_trait_master_vertex_mirror_partition_list_ = value; -} -inline void MirrorPartitionListFeature::set_grin_trait_master_vertex_mirror_partition_list(bool value) { - _internal_set_grin_trait_master_vertex_mirror_partition_list(value); - // @@protoc_insertion_point(field_set:grin.MirrorPartitionListFeature.grin_trait_master_vertex_mirror_partition_list) -} - -// bool grin_trait_mirror_vertex_mirror_partition_list = 2; -inline void MirrorPartitionListFeature::clear_grin_trait_mirror_vertex_mirror_partition_list() { - grin_trait_mirror_vertex_mirror_partition_list_ = false; -} -inline bool MirrorPartitionListFeature::_internal_grin_trait_mirror_vertex_mirror_partition_list() const { - return grin_trait_mirror_vertex_mirror_partition_list_; -} -inline bool MirrorPartitionListFeature::grin_trait_mirror_vertex_mirror_partition_list() const { - // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_mirror_vertex_mirror_partition_list) - return _internal_grin_trait_mirror_vertex_mirror_partition_list(); -} -inline void MirrorPartitionListFeature::_internal_set_grin_trait_mirror_vertex_mirror_partition_list(bool value) { - - grin_trait_mirror_vertex_mirror_partition_list_ = value; -} -inline void MirrorPartitionListFeature::set_grin_trait_mirror_vertex_mirror_partition_list(bool value) { - _internal_set_grin_trait_mirror_vertex_mirror_partition_list(value); - // @@protoc_insertion_point(field_set:grin.MirrorPartitionListFeature.grin_trait_mirror_vertex_mirror_partition_list) -} - -// bool grin_trait_master_edge_mirror_partition_list = 3; -inline void MirrorPartitionListFeature::clear_grin_trait_master_edge_mirror_partition_list() { - grin_trait_master_edge_mirror_partition_list_ = false; -} -inline bool MirrorPartitionListFeature::_internal_grin_trait_master_edge_mirror_partition_list() const { - return grin_trait_master_edge_mirror_partition_list_; -} -inline bool MirrorPartitionListFeature::grin_trait_master_edge_mirror_partition_list() const { - // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_master_edge_mirror_partition_list) - return _internal_grin_trait_master_edge_mirror_partition_list(); -} -inline void MirrorPartitionListFeature::_internal_set_grin_trait_master_edge_mirror_partition_list(bool value) { - - grin_trait_master_edge_mirror_partition_list_ = value; -} -inline void MirrorPartitionListFeature::set_grin_trait_master_edge_mirror_partition_list(bool value) { - _internal_set_grin_trait_master_edge_mirror_partition_list(value); - // @@protoc_insertion_point(field_set:grin.MirrorPartitionListFeature.grin_trait_master_edge_mirror_partition_list) -} - -// bool grin_trait_mirror_edge_mirror_partition_list = 4; -inline void MirrorPartitionListFeature::clear_grin_trait_mirror_edge_mirror_partition_list() { - grin_trait_mirror_edge_mirror_partition_list_ = false; -} -inline bool MirrorPartitionListFeature::_internal_grin_trait_mirror_edge_mirror_partition_list() const { - return grin_trait_mirror_edge_mirror_partition_list_; -} -inline bool MirrorPartitionListFeature::grin_trait_mirror_edge_mirror_partition_list() const { - // @@protoc_insertion_point(field_get:grin.MirrorPartitionListFeature.grin_trait_mirror_edge_mirror_partition_list) - return _internal_grin_trait_mirror_edge_mirror_partition_list(); -} -inline void MirrorPartitionListFeature::_internal_set_grin_trait_mirror_edge_mirror_partition_list(bool value) { - - grin_trait_mirror_edge_mirror_partition_list_ = value; -} -inline void MirrorPartitionListFeature::set_grin_trait_mirror_edge_mirror_partition_list(bool value) { - _internal_set_grin_trait_mirror_edge_mirror_partition_list(value); - // @@protoc_insertion_point(field_set:grin.MirrorPartitionListFeature.grin_trait_mirror_edge_mirror_partition_list) -} - -// ------------------------------------------------------------------- - -// PartitionFeature - -// .grin.GraphPartitionStrategy graph_partition_strategy = 1; -inline void PartitionFeature::clear_graph_partition_strategy() { - graph_partition_strategy_ = 0; -} -inline ::grin::GraphPartitionStrategy PartitionFeature::_internal_graph_partition_strategy() const { - return static_cast< ::grin::GraphPartitionStrategy >(graph_partition_strategy_); -} -inline ::grin::GraphPartitionStrategy PartitionFeature::graph_partition_strategy() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.graph_partition_strategy) - return _internal_graph_partition_strategy(); -} -inline void PartitionFeature::_internal_set_graph_partition_strategy(::grin::GraphPartitionStrategy value) { - - graph_partition_strategy_ = value; -} -inline void PartitionFeature::set_graph_partition_strategy(::grin::GraphPartitionStrategy value) { - _internal_set_graph_partition_strategy(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.graph_partition_strategy) -} - -// bool grin_trait_natural_id_for_partition = 2; -inline void PartitionFeature::clear_grin_trait_natural_id_for_partition() { - grin_trait_natural_id_for_partition_ = false; -} -inline bool PartitionFeature::_internal_grin_trait_natural_id_for_partition() const { - return grin_trait_natural_id_for_partition_; -} -inline bool PartitionFeature::grin_trait_natural_id_for_partition() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_natural_id_for_partition) - return _internal_grin_trait_natural_id_for_partition(); -} -inline void PartitionFeature::_internal_set_grin_trait_natural_id_for_partition(bool value) { - - grin_trait_natural_id_for_partition_ = value; -} -inline void PartitionFeature::set_grin_trait_natural_id_for_partition(bool value) { - _internal_set_grin_trait_natural_id_for_partition(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_natural_id_for_partition) -} - -// bool grin_enable_vertex_ref = 3; -inline void PartitionFeature::clear_grin_enable_vertex_ref() { - grin_enable_vertex_ref_ = false; -} -inline bool PartitionFeature::_internal_grin_enable_vertex_ref() const { - return grin_enable_vertex_ref_; -} -inline bool PartitionFeature::grin_enable_vertex_ref() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_enable_vertex_ref) - return _internal_grin_enable_vertex_ref(); -} -inline void PartitionFeature::_internal_set_grin_enable_vertex_ref(bool value) { - - grin_enable_vertex_ref_ = value; -} -inline void PartitionFeature::set_grin_enable_vertex_ref(bool value) { - _internal_set_grin_enable_vertex_ref(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_enable_vertex_ref) -} - -// bool grin_enable_edge_ref = 4; -inline void PartitionFeature::clear_grin_enable_edge_ref() { - grin_enable_edge_ref_ = false; -} -inline bool PartitionFeature::_internal_grin_enable_edge_ref() const { - return grin_enable_edge_ref_; -} -inline bool PartitionFeature::grin_enable_edge_ref() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_enable_edge_ref) - return _internal_grin_enable_edge_ref(); -} -inline void PartitionFeature::_internal_set_grin_enable_edge_ref(bool value) { - - grin_enable_edge_ref_ = value; -} -inline void PartitionFeature::set_grin_enable_edge_ref(bool value) { - _internal_set_grin_enable_edge_ref(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_enable_edge_ref) -} - -// .grin.PropertyDataPartitionStrategy vertex_data = 5; -inline void PartitionFeature::clear_vertex_data() { - vertex_data_ = 0; -} -inline ::grin::PropertyDataPartitionStrategy PartitionFeature::_internal_vertex_data() const { - return static_cast< ::grin::PropertyDataPartitionStrategy >(vertex_data_); -} -inline ::grin::PropertyDataPartitionStrategy PartitionFeature::vertex_data() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.vertex_data) - return _internal_vertex_data(); -} -inline void PartitionFeature::_internal_set_vertex_data(::grin::PropertyDataPartitionStrategy value) { - - vertex_data_ = value; -} -inline void PartitionFeature::set_vertex_data(::grin::PropertyDataPartitionStrategy value) { - _internal_set_vertex_data(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.vertex_data) -} - -// .grin.PropertyDataPartitionStrategy edge_data = 6; -inline void PartitionFeature::clear_edge_data() { - edge_data_ = 0; -} -inline ::grin::PropertyDataPartitionStrategy PartitionFeature::_internal_edge_data() const { - return static_cast< ::grin::PropertyDataPartitionStrategy >(edge_data_); -} -inline ::grin::PropertyDataPartitionStrategy PartitionFeature::edge_data() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.edge_data) - return _internal_edge_data(); -} -inline void PartitionFeature::_internal_set_edge_data(::grin::PropertyDataPartitionStrategy value) { - - edge_data_ = value; -} -inline void PartitionFeature::set_edge_data(::grin::PropertyDataPartitionStrategy value) { - _internal_set_edge_data(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.edge_data) -} - -// .grin.MirrorPartitionListFeature mirror_partition_list_feature = 7; -inline bool PartitionFeature::_internal_has_mirror_partition_list_feature() const { - return this != internal_default_instance() && mirror_partition_list_feature_ != nullptr; -} -inline bool PartitionFeature::has_mirror_partition_list_feature() const { - return _internal_has_mirror_partition_list_feature(); -} -inline void PartitionFeature::clear_mirror_partition_list_feature() { - if (GetArena() == nullptr && mirror_partition_list_feature_ != nullptr) { - delete mirror_partition_list_feature_; - } - mirror_partition_list_feature_ = nullptr; -} -inline const ::grin::MirrorPartitionListFeature& PartitionFeature::_internal_mirror_partition_list_feature() const { - const ::grin::MirrorPartitionListFeature* p = mirror_partition_list_feature_; - return p != nullptr ? *p : *reinterpret_cast( - &::grin::_MirrorPartitionListFeature_default_instance_); -} -inline const ::grin::MirrorPartitionListFeature& PartitionFeature::mirror_partition_list_feature() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.mirror_partition_list_feature) - return _internal_mirror_partition_list_feature(); -} -inline void PartitionFeature::unsafe_arena_set_allocated_mirror_partition_list_feature( - ::grin::MirrorPartitionListFeature* mirror_partition_list_feature) { - if (GetArena() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(mirror_partition_list_feature_); - } - mirror_partition_list_feature_ = mirror_partition_list_feature; - if (mirror_partition_list_feature) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PartitionFeature.mirror_partition_list_feature) -} -inline ::grin::MirrorPartitionListFeature* PartitionFeature::release_mirror_partition_list_feature() { - auto temp = unsafe_arena_release_mirror_partition_list_feature(); - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::grin::MirrorPartitionListFeature* PartitionFeature::unsafe_arena_release_mirror_partition_list_feature() { - // @@protoc_insertion_point(field_release:grin.PartitionFeature.mirror_partition_list_feature) - - ::grin::MirrorPartitionListFeature* temp = mirror_partition_list_feature_; - mirror_partition_list_feature_ = nullptr; - return temp; -} -inline ::grin::MirrorPartitionListFeature* PartitionFeature::_internal_mutable_mirror_partition_list_feature() { - - if (mirror_partition_list_feature_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::MirrorPartitionListFeature>(GetArena()); - mirror_partition_list_feature_ = p; - } - return mirror_partition_list_feature_; -} -inline ::grin::MirrorPartitionListFeature* PartitionFeature::mutable_mirror_partition_list_feature() { - // @@protoc_insertion_point(field_mutable:grin.PartitionFeature.mirror_partition_list_feature) - return _internal_mutable_mirror_partition_list_feature(); -} -inline void PartitionFeature::set_allocated_mirror_partition_list_feature(::grin::MirrorPartitionListFeature* mirror_partition_list_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - if (message_arena == nullptr) { - delete mirror_partition_list_feature_; - } - if (mirror_partition_list_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(mirror_partition_list_feature); - if (message_arena != submessage_arena) { - mirror_partition_list_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, mirror_partition_list_feature, submessage_arena); - } - - } else { - - } - mirror_partition_list_feature_ = mirror_partition_list_feature; - // @@protoc_insertion_point(field_set_allocated:grin.PartitionFeature.mirror_partition_list_feature) -} - -// bool grin_trait_select_master_for_vertex_list = 8; -inline void PartitionFeature::clear_grin_trait_select_master_for_vertex_list() { - grin_trait_select_master_for_vertex_list_ = false; -} -inline bool PartitionFeature::_internal_grin_trait_select_master_for_vertex_list() const { - return grin_trait_select_master_for_vertex_list_; -} -inline bool PartitionFeature::grin_trait_select_master_for_vertex_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_master_for_vertex_list) - return _internal_grin_trait_select_master_for_vertex_list(); -} -inline void PartitionFeature::_internal_set_grin_trait_select_master_for_vertex_list(bool value) { - - grin_trait_select_master_for_vertex_list_ = value; -} -inline void PartitionFeature::set_grin_trait_select_master_for_vertex_list(bool value) { - _internal_set_grin_trait_select_master_for_vertex_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_master_for_vertex_list) -} - -// bool grin_trait_select_partition_for_vertex_list = 9; -inline void PartitionFeature::clear_grin_trait_select_partition_for_vertex_list() { - grin_trait_select_partition_for_vertex_list_ = false; -} -inline bool PartitionFeature::_internal_grin_trait_select_partition_for_vertex_list() const { - return grin_trait_select_partition_for_vertex_list_; -} -inline bool PartitionFeature::grin_trait_select_partition_for_vertex_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_partition_for_vertex_list) - return _internal_grin_trait_select_partition_for_vertex_list(); -} -inline void PartitionFeature::_internal_set_grin_trait_select_partition_for_vertex_list(bool value) { - - grin_trait_select_partition_for_vertex_list_ = value; -} -inline void PartitionFeature::set_grin_trait_select_partition_for_vertex_list(bool value) { - _internal_set_grin_trait_select_partition_for_vertex_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_partition_for_vertex_list) -} - -// bool grin_trait_select_master_for_edge_list = 10; -inline void PartitionFeature::clear_grin_trait_select_master_for_edge_list() { - grin_trait_select_master_for_edge_list_ = false; -} -inline bool PartitionFeature::_internal_grin_trait_select_master_for_edge_list() const { - return grin_trait_select_master_for_edge_list_; -} -inline bool PartitionFeature::grin_trait_select_master_for_edge_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_master_for_edge_list) - return _internal_grin_trait_select_master_for_edge_list(); -} -inline void PartitionFeature::_internal_set_grin_trait_select_master_for_edge_list(bool value) { - - grin_trait_select_master_for_edge_list_ = value; -} -inline void PartitionFeature::set_grin_trait_select_master_for_edge_list(bool value) { - _internal_set_grin_trait_select_master_for_edge_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_master_for_edge_list) -} - -// bool grin_trait_select_partition_for_edge_list = 11; -inline void PartitionFeature::clear_grin_trait_select_partition_for_edge_list() { - grin_trait_select_partition_for_edge_list_ = false; -} -inline bool PartitionFeature::_internal_grin_trait_select_partition_for_edge_list() const { - return grin_trait_select_partition_for_edge_list_; -} -inline bool PartitionFeature::grin_trait_select_partition_for_edge_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_partition_for_edge_list) - return _internal_grin_trait_select_partition_for_edge_list(); -} -inline void PartitionFeature::_internal_set_grin_trait_select_partition_for_edge_list(bool value) { - - grin_trait_select_partition_for_edge_list_ = value; -} -inline void PartitionFeature::set_grin_trait_select_partition_for_edge_list(bool value) { - _internal_set_grin_trait_select_partition_for_edge_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_partition_for_edge_list) -} - -// bool grin_trait_select_master_neighbor_for_adjacent_list = 12; -inline void PartitionFeature::clear_grin_trait_select_master_neighbor_for_adjacent_list() { - grin_trait_select_master_neighbor_for_adjacent_list_ = false; -} -inline bool PartitionFeature::_internal_grin_trait_select_master_neighbor_for_adjacent_list() const { - return grin_trait_select_master_neighbor_for_adjacent_list_; -} -inline bool PartitionFeature::grin_trait_select_master_neighbor_for_adjacent_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_master_neighbor_for_adjacent_list) - return _internal_grin_trait_select_master_neighbor_for_adjacent_list(); -} -inline void PartitionFeature::_internal_set_grin_trait_select_master_neighbor_for_adjacent_list(bool value) { - - grin_trait_select_master_neighbor_for_adjacent_list_ = value; -} -inline void PartitionFeature::set_grin_trait_select_master_neighbor_for_adjacent_list(bool value) { - _internal_set_grin_trait_select_master_neighbor_for_adjacent_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_master_neighbor_for_adjacent_list) -} - -// bool grin_trait_select_neighbor_partition_for_adjacent_list = 13; -inline void PartitionFeature::clear_grin_trait_select_neighbor_partition_for_adjacent_list() { - grin_trait_select_neighbor_partition_for_adjacent_list_ = false; -} -inline bool PartitionFeature::_internal_grin_trait_select_neighbor_partition_for_adjacent_list() const { - return grin_trait_select_neighbor_partition_for_adjacent_list_; -} -inline bool PartitionFeature::grin_trait_select_neighbor_partition_for_adjacent_list() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_select_neighbor_partition_for_adjacent_list) - return _internal_grin_trait_select_neighbor_partition_for_adjacent_list(); -} -inline void PartitionFeature::_internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value) { - - grin_trait_select_neighbor_partition_for_adjacent_list_ = value; -} -inline void PartitionFeature::set_grin_trait_select_neighbor_partition_for_adjacent_list(bool value) { - _internal_set_grin_trait_select_neighbor_partition_for_adjacent_list(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_select_neighbor_partition_for_adjacent_list) -} - -// bool grin_trait_fast_vertex_ref = 14; -inline void PartitionFeature::clear_grin_trait_fast_vertex_ref() { - grin_trait_fast_vertex_ref_ = false; -} -inline bool PartitionFeature::_internal_grin_trait_fast_vertex_ref() const { - return grin_trait_fast_vertex_ref_; -} -inline bool PartitionFeature::grin_trait_fast_vertex_ref() const { - // @@protoc_insertion_point(field_get:grin.PartitionFeature.grin_trait_fast_vertex_ref) - return _internal_grin_trait_fast_vertex_ref(); -} -inline void PartitionFeature::_internal_set_grin_trait_fast_vertex_ref(bool value) { - - grin_trait_fast_vertex_ref_ = value; -} -inline void PartitionFeature::set_grin_trait_fast_vertex_ref(bool value) { - _internal_set_grin_trait_fast_vertex_ref(value); - // @@protoc_insertion_point(field_set:grin.PartitionFeature.grin_trait_fast_vertex_ref) -} - -// ------------------------------------------------------------------- - -// VertexPropertyFeature - -// bool grin_with_vertex_property = 1; -inline void VertexPropertyFeature::clear_grin_with_vertex_property() { - grin_with_vertex_property_ = false; -} -inline bool VertexPropertyFeature::_internal_grin_with_vertex_property() const { - return grin_with_vertex_property_; -} -inline bool VertexPropertyFeature::grin_with_vertex_property() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_with_vertex_property) - return _internal_grin_with_vertex_property(); -} -inline void VertexPropertyFeature::_internal_set_grin_with_vertex_property(bool value) { - - grin_with_vertex_property_ = value; -} -inline void VertexPropertyFeature::set_grin_with_vertex_property(bool value) { - _internal_set_grin_with_vertex_property(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_with_vertex_property) -} - -// bool grin_with_vertex_property_name = 2; -inline void VertexPropertyFeature::clear_grin_with_vertex_property_name() { - grin_with_vertex_property_name_ = false; -} -inline bool VertexPropertyFeature::_internal_grin_with_vertex_property_name() const { - return grin_with_vertex_property_name_; -} -inline bool VertexPropertyFeature::grin_with_vertex_property_name() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_with_vertex_property_name) - return _internal_grin_with_vertex_property_name(); -} -inline void VertexPropertyFeature::_internal_set_grin_with_vertex_property_name(bool value) { - - grin_with_vertex_property_name_ = value; -} -inline void VertexPropertyFeature::set_grin_with_vertex_property_name(bool value) { - _internal_set_grin_with_vertex_property_name(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_with_vertex_property_name) -} - -// bool grin_with_vertex_type_name = 3; -inline void VertexPropertyFeature::clear_grin_with_vertex_type_name() { - grin_with_vertex_type_name_ = false; -} -inline bool VertexPropertyFeature::_internal_grin_with_vertex_type_name() const { - return grin_with_vertex_type_name_; -} -inline bool VertexPropertyFeature::grin_with_vertex_type_name() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_with_vertex_type_name) - return _internal_grin_with_vertex_type_name(); -} -inline void VertexPropertyFeature::_internal_set_grin_with_vertex_type_name(bool value) { - - grin_with_vertex_type_name_ = value; -} -inline void VertexPropertyFeature::set_grin_with_vertex_type_name(bool value) { - _internal_set_grin_with_vertex_type_name(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_with_vertex_type_name) -} - -// bool grin_enable_vertex_property_table = 4; -inline void VertexPropertyFeature::clear_grin_enable_vertex_property_table() { - grin_enable_vertex_property_table_ = false; -} -inline bool VertexPropertyFeature::_internal_grin_enable_vertex_property_table() const { - return grin_enable_vertex_property_table_; -} -inline bool VertexPropertyFeature::grin_enable_vertex_property_table() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_enable_vertex_property_table) - return _internal_grin_enable_vertex_property_table(); -} -inline void VertexPropertyFeature::_internal_set_grin_enable_vertex_property_table(bool value) { - - grin_enable_vertex_property_table_ = value; -} -inline void VertexPropertyFeature::set_grin_enable_vertex_property_table(bool value) { - _internal_set_grin_enable_vertex_property_table(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_enable_vertex_property_table) -} - -// bool grin_enable_vertex_primary_keys = 5; -inline void VertexPropertyFeature::clear_grin_enable_vertex_primary_keys() { - grin_enable_vertex_primary_keys_ = false; -} -inline bool VertexPropertyFeature::_internal_grin_enable_vertex_primary_keys() const { - return grin_enable_vertex_primary_keys_; -} -inline bool VertexPropertyFeature::grin_enable_vertex_primary_keys() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_enable_vertex_primary_keys) - return _internal_grin_enable_vertex_primary_keys(); -} -inline void VertexPropertyFeature::_internal_set_grin_enable_vertex_primary_keys(bool value) { - - grin_enable_vertex_primary_keys_ = value; -} -inline void VertexPropertyFeature::set_grin_enable_vertex_primary_keys(bool value) { - _internal_set_grin_enable_vertex_primary_keys(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_enable_vertex_primary_keys) -} - -// bool grin_trait_natural_id_for_vertex_type = 6; -inline void VertexPropertyFeature::clear_grin_trait_natural_id_for_vertex_type() { - grin_trait_natural_id_for_vertex_type_ = false; -} -inline bool VertexPropertyFeature::_internal_grin_trait_natural_id_for_vertex_type() const { - return grin_trait_natural_id_for_vertex_type_; -} -inline bool VertexPropertyFeature::grin_trait_natural_id_for_vertex_type() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_trait_natural_id_for_vertex_type) - return _internal_grin_trait_natural_id_for_vertex_type(); -} -inline void VertexPropertyFeature::_internal_set_grin_trait_natural_id_for_vertex_type(bool value) { - - grin_trait_natural_id_for_vertex_type_ = value; -} -inline void VertexPropertyFeature::set_grin_trait_natural_id_for_vertex_type(bool value) { - _internal_set_grin_trait_natural_id_for_vertex_type(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_trait_natural_id_for_vertex_type) -} - -// bool grin_trait_natural_id_for_vertex_property = 7; -inline void VertexPropertyFeature::clear_grin_trait_natural_id_for_vertex_property() { - grin_trait_natural_id_for_vertex_property_ = false; -} -inline bool VertexPropertyFeature::_internal_grin_trait_natural_id_for_vertex_property() const { - return grin_trait_natural_id_for_vertex_property_; -} -inline bool VertexPropertyFeature::grin_trait_natural_id_for_vertex_property() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_trait_natural_id_for_vertex_property) - return _internal_grin_trait_natural_id_for_vertex_property(); -} -inline void VertexPropertyFeature::_internal_set_grin_trait_natural_id_for_vertex_property(bool value) { - - grin_trait_natural_id_for_vertex_property_ = value; -} -inline void VertexPropertyFeature::set_grin_trait_natural_id_for_vertex_property(bool value) { - _internal_set_grin_trait_natural_id_for_vertex_property(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_trait_natural_id_for_vertex_property) -} - -// bool grin_assume_by_type_vertex_original_id = 8; -inline void VertexPropertyFeature::clear_grin_assume_by_type_vertex_original_id() { - grin_assume_by_type_vertex_original_id_ = false; -} -inline bool VertexPropertyFeature::_internal_grin_assume_by_type_vertex_original_id() const { - return grin_assume_by_type_vertex_original_id_; -} -inline bool VertexPropertyFeature::grin_assume_by_type_vertex_original_id() const { - // @@protoc_insertion_point(field_get:grin.VertexPropertyFeature.grin_assume_by_type_vertex_original_id) - return _internal_grin_assume_by_type_vertex_original_id(); -} -inline void VertexPropertyFeature::_internal_set_grin_assume_by_type_vertex_original_id(bool value) { - - grin_assume_by_type_vertex_original_id_ = value; -} -inline void VertexPropertyFeature::set_grin_assume_by_type_vertex_original_id(bool value) { - _internal_set_grin_assume_by_type_vertex_original_id(value); - // @@protoc_insertion_point(field_set:grin.VertexPropertyFeature.grin_assume_by_type_vertex_original_id) -} - -// ------------------------------------------------------------------- - -// EdgePropertyFeature - -// bool grin_with_edge_property = 1; -inline void EdgePropertyFeature::clear_grin_with_edge_property() { - grin_with_edge_property_ = false; -} -inline bool EdgePropertyFeature::_internal_grin_with_edge_property() const { - return grin_with_edge_property_; -} -inline bool EdgePropertyFeature::grin_with_edge_property() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_with_edge_property) - return _internal_grin_with_edge_property(); -} -inline void EdgePropertyFeature::_internal_set_grin_with_edge_property(bool value) { - - grin_with_edge_property_ = value; -} -inline void EdgePropertyFeature::set_grin_with_edge_property(bool value) { - _internal_set_grin_with_edge_property(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_with_edge_property) -} - -// bool grin_with_edge_property_name = 2; -inline void EdgePropertyFeature::clear_grin_with_edge_property_name() { - grin_with_edge_property_name_ = false; -} -inline bool EdgePropertyFeature::_internal_grin_with_edge_property_name() const { - return grin_with_edge_property_name_; -} -inline bool EdgePropertyFeature::grin_with_edge_property_name() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_with_edge_property_name) - return _internal_grin_with_edge_property_name(); -} -inline void EdgePropertyFeature::_internal_set_grin_with_edge_property_name(bool value) { - - grin_with_edge_property_name_ = value; -} -inline void EdgePropertyFeature::set_grin_with_edge_property_name(bool value) { - _internal_set_grin_with_edge_property_name(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_with_edge_property_name) -} - -// bool grin_with_edge_type_name = 3; -inline void EdgePropertyFeature::clear_grin_with_edge_type_name() { - grin_with_edge_type_name_ = false; -} -inline bool EdgePropertyFeature::_internal_grin_with_edge_type_name() const { - return grin_with_edge_type_name_; -} -inline bool EdgePropertyFeature::grin_with_edge_type_name() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_with_edge_type_name) - return _internal_grin_with_edge_type_name(); -} -inline void EdgePropertyFeature::_internal_set_grin_with_edge_type_name(bool value) { - - grin_with_edge_type_name_ = value; -} -inline void EdgePropertyFeature::set_grin_with_edge_type_name(bool value) { - _internal_set_grin_with_edge_type_name(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_with_edge_type_name) -} - -// bool grin_enable_edge_property_table = 4; -inline void EdgePropertyFeature::clear_grin_enable_edge_property_table() { - grin_enable_edge_property_table_ = false; -} -inline bool EdgePropertyFeature::_internal_grin_enable_edge_property_table() const { - return grin_enable_edge_property_table_; -} -inline bool EdgePropertyFeature::grin_enable_edge_property_table() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_enable_edge_property_table) - return _internal_grin_enable_edge_property_table(); -} -inline void EdgePropertyFeature::_internal_set_grin_enable_edge_property_table(bool value) { - - grin_enable_edge_property_table_ = value; -} -inline void EdgePropertyFeature::set_grin_enable_edge_property_table(bool value) { - _internal_set_grin_enable_edge_property_table(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_enable_edge_property_table) -} - -// bool grin_enable_edge_primary_keys = 5; -inline void EdgePropertyFeature::clear_grin_enable_edge_primary_keys() { - grin_enable_edge_primary_keys_ = false; -} -inline bool EdgePropertyFeature::_internal_grin_enable_edge_primary_keys() const { - return grin_enable_edge_primary_keys_; -} -inline bool EdgePropertyFeature::grin_enable_edge_primary_keys() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_enable_edge_primary_keys) - return _internal_grin_enable_edge_primary_keys(); -} -inline void EdgePropertyFeature::_internal_set_grin_enable_edge_primary_keys(bool value) { - - grin_enable_edge_primary_keys_ = value; -} -inline void EdgePropertyFeature::set_grin_enable_edge_primary_keys(bool value) { - _internal_set_grin_enable_edge_primary_keys(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_enable_edge_primary_keys) -} - -// bool grin_trait_natural_id_for_edge_type = 6; -inline void EdgePropertyFeature::clear_grin_trait_natural_id_for_edge_type() { - grin_trait_natural_id_for_edge_type_ = false; -} -inline bool EdgePropertyFeature::_internal_grin_trait_natural_id_for_edge_type() const { - return grin_trait_natural_id_for_edge_type_; -} -inline bool EdgePropertyFeature::grin_trait_natural_id_for_edge_type() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_trait_natural_id_for_edge_type) - return _internal_grin_trait_natural_id_for_edge_type(); -} -inline void EdgePropertyFeature::_internal_set_grin_trait_natural_id_for_edge_type(bool value) { - - grin_trait_natural_id_for_edge_type_ = value; -} -inline void EdgePropertyFeature::set_grin_trait_natural_id_for_edge_type(bool value) { - _internal_set_grin_trait_natural_id_for_edge_type(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_trait_natural_id_for_edge_type) -} - -// bool grin_trait_natural_id_for_edge_property = 7; -inline void EdgePropertyFeature::clear_grin_trait_natural_id_for_edge_property() { - grin_trait_natural_id_for_edge_property_ = false; -} -inline bool EdgePropertyFeature::_internal_grin_trait_natural_id_for_edge_property() const { - return grin_trait_natural_id_for_edge_property_; -} -inline bool EdgePropertyFeature::grin_trait_natural_id_for_edge_property() const { - // @@protoc_insertion_point(field_get:grin.EdgePropertyFeature.grin_trait_natural_id_for_edge_property) - return _internal_grin_trait_natural_id_for_edge_property(); -} -inline void EdgePropertyFeature::_internal_set_grin_trait_natural_id_for_edge_property(bool value) { - - grin_trait_natural_id_for_edge_property_ = value; -} -inline void EdgePropertyFeature::set_grin_trait_natural_id_for_edge_property(bool value) { - _internal_set_grin_trait_natural_id_for_edge_property(value); - // @@protoc_insertion_point(field_set:grin.EdgePropertyFeature.grin_trait_natural_id_for_edge_property) -} - -// ------------------------------------------------------------------- - -// PropertyFeature - -// bool grin_enable_row = 1; -inline void PropertyFeature::clear_grin_enable_row() { - grin_enable_row_ = false; -} -inline bool PropertyFeature::_internal_grin_enable_row() const { - return grin_enable_row_; -} -inline bool PropertyFeature::grin_enable_row() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_enable_row) - return _internal_grin_enable_row(); -} -inline void PropertyFeature::_internal_set_grin_enable_row(bool value) { - - grin_enable_row_ = value; -} -inline void PropertyFeature::set_grin_enable_row(bool value) { - _internal_set_grin_enable_row(value); - // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_enable_row) -} - -// .grin.VertexPropertyFeature vertex_property_feature = 2; -inline bool PropertyFeature::_internal_has_vertex_property_feature() const { - return this != internal_default_instance() && vertex_property_feature_ != nullptr; -} -inline bool PropertyFeature::has_vertex_property_feature() const { - return _internal_has_vertex_property_feature(); -} -inline void PropertyFeature::clear_vertex_property_feature() { - if (GetArena() == nullptr && vertex_property_feature_ != nullptr) { - delete vertex_property_feature_; - } - vertex_property_feature_ = nullptr; -} -inline const ::grin::VertexPropertyFeature& PropertyFeature::_internal_vertex_property_feature() const { - const ::grin::VertexPropertyFeature* p = vertex_property_feature_; - return p != nullptr ? *p : *reinterpret_cast( - &::grin::_VertexPropertyFeature_default_instance_); -} -inline const ::grin::VertexPropertyFeature& PropertyFeature::vertex_property_feature() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.vertex_property_feature) - return _internal_vertex_property_feature(); -} -inline void PropertyFeature::unsafe_arena_set_allocated_vertex_property_feature( - ::grin::VertexPropertyFeature* vertex_property_feature) { - if (GetArena() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(vertex_property_feature_); - } - vertex_property_feature_ = vertex_property_feature; - if (vertex_property_feature) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PropertyFeature.vertex_property_feature) -} -inline ::grin::VertexPropertyFeature* PropertyFeature::release_vertex_property_feature() { - auto temp = unsafe_arena_release_vertex_property_feature(); - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::grin::VertexPropertyFeature* PropertyFeature::unsafe_arena_release_vertex_property_feature() { - // @@protoc_insertion_point(field_release:grin.PropertyFeature.vertex_property_feature) - - ::grin::VertexPropertyFeature* temp = vertex_property_feature_; - vertex_property_feature_ = nullptr; - return temp; -} -inline ::grin::VertexPropertyFeature* PropertyFeature::_internal_mutable_vertex_property_feature() { - - if (vertex_property_feature_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::VertexPropertyFeature>(GetArena()); - vertex_property_feature_ = p; - } - return vertex_property_feature_; -} -inline ::grin::VertexPropertyFeature* PropertyFeature::mutable_vertex_property_feature() { - // @@protoc_insertion_point(field_mutable:grin.PropertyFeature.vertex_property_feature) - return _internal_mutable_vertex_property_feature(); -} -inline void PropertyFeature::set_allocated_vertex_property_feature(::grin::VertexPropertyFeature* vertex_property_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - if (message_arena == nullptr) { - delete vertex_property_feature_; - } - if (vertex_property_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(vertex_property_feature); - if (message_arena != submessage_arena) { - vertex_property_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, vertex_property_feature, submessage_arena); - } - - } else { - - } - vertex_property_feature_ = vertex_property_feature; - // @@protoc_insertion_point(field_set_allocated:grin.PropertyFeature.vertex_property_feature) -} - -// .grin.EdgePropertyFeature edge_property_feature = 3; -inline bool PropertyFeature::_internal_has_edge_property_feature() const { - return this != internal_default_instance() && edge_property_feature_ != nullptr; -} -inline bool PropertyFeature::has_edge_property_feature() const { - return _internal_has_edge_property_feature(); -} -inline void PropertyFeature::clear_edge_property_feature() { - if (GetArena() == nullptr && edge_property_feature_ != nullptr) { - delete edge_property_feature_; - } - edge_property_feature_ = nullptr; -} -inline const ::grin::EdgePropertyFeature& PropertyFeature::_internal_edge_property_feature() const { - const ::grin::EdgePropertyFeature* p = edge_property_feature_; - return p != nullptr ? *p : *reinterpret_cast( - &::grin::_EdgePropertyFeature_default_instance_); -} -inline const ::grin::EdgePropertyFeature& PropertyFeature::edge_property_feature() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.edge_property_feature) - return _internal_edge_property_feature(); -} -inline void PropertyFeature::unsafe_arena_set_allocated_edge_property_feature( - ::grin::EdgePropertyFeature* edge_property_feature) { - if (GetArena() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(edge_property_feature_); - } - edge_property_feature_ = edge_property_feature; - if (edge_property_feature) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.PropertyFeature.edge_property_feature) -} -inline ::grin::EdgePropertyFeature* PropertyFeature::release_edge_property_feature() { - auto temp = unsafe_arena_release_edge_property_feature(); - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::grin::EdgePropertyFeature* PropertyFeature::unsafe_arena_release_edge_property_feature() { - // @@protoc_insertion_point(field_release:grin.PropertyFeature.edge_property_feature) - - ::grin::EdgePropertyFeature* temp = edge_property_feature_; - edge_property_feature_ = nullptr; - return temp; -} -inline ::grin::EdgePropertyFeature* PropertyFeature::_internal_mutable_edge_property_feature() { - - if (edge_property_feature_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::EdgePropertyFeature>(GetArena()); - edge_property_feature_ = p; - } - return edge_property_feature_; -} -inline ::grin::EdgePropertyFeature* PropertyFeature::mutable_edge_property_feature() { - // @@protoc_insertion_point(field_mutable:grin.PropertyFeature.edge_property_feature) - return _internal_mutable_edge_property_feature(); -} -inline void PropertyFeature::set_allocated_edge_property_feature(::grin::EdgePropertyFeature* edge_property_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - if (message_arena == nullptr) { - delete edge_property_feature_; - } - if (edge_property_feature) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(edge_property_feature); - if (message_arena != submessage_arena) { - edge_property_feature = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, edge_property_feature, submessage_arena); - } - - } else { - - } - edge_property_feature_ = edge_property_feature; - // @@protoc_insertion_point(field_set_allocated:grin.PropertyFeature.edge_property_feature) -} - -// .grin.PropertyDataPartitionStrategy vertex_property = 4; -inline void PropertyFeature::clear_vertex_property() { - vertex_property_ = 0; -} -inline ::grin::PropertyDataPartitionStrategy PropertyFeature::_internal_vertex_property() const { - return static_cast< ::grin::PropertyDataPartitionStrategy >(vertex_property_); -} -inline ::grin::PropertyDataPartitionStrategy PropertyFeature::vertex_property() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.vertex_property) - return _internal_vertex_property(); -} -inline void PropertyFeature::_internal_set_vertex_property(::grin::PropertyDataPartitionStrategy value) { - - vertex_property_ = value; -} -inline void PropertyFeature::set_vertex_property(::grin::PropertyDataPartitionStrategy value) { - _internal_set_vertex_property(value); - // @@protoc_insertion_point(field_set:grin.PropertyFeature.vertex_property) -} - -// .grin.PropertyDataPartitionStrategy edge_property = 5; -inline void PropertyFeature::clear_edge_property() { - edge_property_ = 0; -} -inline ::grin::PropertyDataPartitionStrategy PropertyFeature::_internal_edge_property() const { - return static_cast< ::grin::PropertyDataPartitionStrategy >(edge_property_); -} -inline ::grin::PropertyDataPartitionStrategy PropertyFeature::edge_property() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.edge_property) - return _internal_edge_property(); -} -inline void PropertyFeature::_internal_set_edge_property(::grin::PropertyDataPartitionStrategy value) { - - edge_property_ = value; -} -inline void PropertyFeature::set_edge_property(::grin::PropertyDataPartitionStrategy value) { - _internal_set_edge_property(value); - // @@protoc_insertion_point(field_set:grin.PropertyFeature.edge_property) -} - -// bool grin_assume_column_store_for_vertex_property = 6; -inline void PropertyFeature::clear_grin_assume_column_store_for_vertex_property() { - grin_assume_column_store_for_vertex_property_ = false; -} -inline bool PropertyFeature::_internal_grin_assume_column_store_for_vertex_property() const { - return grin_assume_column_store_for_vertex_property_; -} -inline bool PropertyFeature::grin_assume_column_store_for_vertex_property() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_assume_column_store_for_vertex_property) - return _internal_grin_assume_column_store_for_vertex_property(); -} -inline void PropertyFeature::_internal_set_grin_assume_column_store_for_vertex_property(bool value) { - - grin_assume_column_store_for_vertex_property_ = value; -} -inline void PropertyFeature::set_grin_assume_column_store_for_vertex_property(bool value) { - _internal_set_grin_assume_column_store_for_vertex_property(value); - // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_assume_column_store_for_vertex_property) -} - -// bool grin_assume_column_store_for_edge_property = 7; -inline void PropertyFeature::clear_grin_assume_column_store_for_edge_property() { - grin_assume_column_store_for_edge_property_ = false; -} -inline bool PropertyFeature::_internal_grin_assume_column_store_for_edge_property() const { - return grin_assume_column_store_for_edge_property_; -} -inline bool PropertyFeature::grin_assume_column_store_for_edge_property() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_assume_column_store_for_edge_property) - return _internal_grin_assume_column_store_for_edge_property(); -} -inline void PropertyFeature::_internal_set_grin_assume_column_store_for_edge_property(bool value) { - - grin_assume_column_store_for_edge_property_ = value; -} -inline void PropertyFeature::set_grin_assume_column_store_for_edge_property(bool value) { - _internal_set_grin_assume_column_store_for_edge_property(value); - // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_assume_column_store_for_edge_property) -} - -// bool grin_trait_select_type_for_vertex_list = 8; -inline void PropertyFeature::clear_grin_trait_select_type_for_vertex_list() { - grin_trait_select_type_for_vertex_list_ = false; -} -inline bool PropertyFeature::_internal_grin_trait_select_type_for_vertex_list() const { - return grin_trait_select_type_for_vertex_list_; -} -inline bool PropertyFeature::grin_trait_select_type_for_vertex_list() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_type_for_vertex_list) - return _internal_grin_trait_select_type_for_vertex_list(); -} -inline void PropertyFeature::_internal_set_grin_trait_select_type_for_vertex_list(bool value) { - - grin_trait_select_type_for_vertex_list_ = value; -} -inline void PropertyFeature::set_grin_trait_select_type_for_vertex_list(bool value) { - _internal_set_grin_trait_select_type_for_vertex_list(value); - // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_trait_select_type_for_vertex_list) -} - -// bool grin_trait_select_type_for_edge_list = 9; -inline void PropertyFeature::clear_grin_trait_select_type_for_edge_list() { - grin_trait_select_type_for_edge_list_ = false; -} -inline bool PropertyFeature::_internal_grin_trait_select_type_for_edge_list() const { - return grin_trait_select_type_for_edge_list_; -} -inline bool PropertyFeature::grin_trait_select_type_for_edge_list() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_type_for_edge_list) - return _internal_grin_trait_select_type_for_edge_list(); -} -inline void PropertyFeature::_internal_set_grin_trait_select_type_for_edge_list(bool value) { - - grin_trait_select_type_for_edge_list_ = value; -} -inline void PropertyFeature::set_grin_trait_select_type_for_edge_list(bool value) { - _internal_set_grin_trait_select_type_for_edge_list(value); - // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_trait_select_type_for_edge_list) -} - -// bool grin_trait_select_neighbor_type_for_adjacent_list = 10; -inline void PropertyFeature::clear_grin_trait_select_neighbor_type_for_adjacent_list() { - grin_trait_select_neighbor_type_for_adjacent_list_ = false; -} -inline bool PropertyFeature::_internal_grin_trait_select_neighbor_type_for_adjacent_list() const { - return grin_trait_select_neighbor_type_for_adjacent_list_; -} -inline bool PropertyFeature::grin_trait_select_neighbor_type_for_adjacent_list() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_neighbor_type_for_adjacent_list) - return _internal_grin_trait_select_neighbor_type_for_adjacent_list(); -} -inline void PropertyFeature::_internal_set_grin_trait_select_neighbor_type_for_adjacent_list(bool value) { - - grin_trait_select_neighbor_type_for_adjacent_list_ = value; -} -inline void PropertyFeature::set_grin_trait_select_neighbor_type_for_adjacent_list(bool value) { - _internal_set_grin_trait_select_neighbor_type_for_adjacent_list(value); - // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_trait_select_neighbor_type_for_adjacent_list) -} - -// bool grin_trait_select_edge_type_for_adjacent_list = 11; -inline void PropertyFeature::clear_grin_trait_select_edge_type_for_adjacent_list() { - grin_trait_select_edge_type_for_adjacent_list_ = false; -} -inline bool PropertyFeature::_internal_grin_trait_select_edge_type_for_adjacent_list() const { - return grin_trait_select_edge_type_for_adjacent_list_; -} -inline bool PropertyFeature::grin_trait_select_edge_type_for_adjacent_list() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_select_edge_type_for_adjacent_list) - return _internal_grin_trait_select_edge_type_for_adjacent_list(); -} -inline void PropertyFeature::_internal_set_grin_trait_select_edge_type_for_adjacent_list(bool value) { - - grin_trait_select_edge_type_for_adjacent_list_ = value; -} -inline void PropertyFeature::set_grin_trait_select_edge_type_for_adjacent_list(bool value) { - _internal_set_grin_trait_select_edge_type_for_adjacent_list(value); - // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_trait_select_edge_type_for_adjacent_list) -} - -// bool grin_trait_specific_vev_relation = 12; -inline void PropertyFeature::clear_grin_trait_specific_vev_relation() { - grin_trait_specific_vev_relation_ = false; -} -inline bool PropertyFeature::_internal_grin_trait_specific_vev_relation() const { - return grin_trait_specific_vev_relation_; -} -inline bool PropertyFeature::grin_trait_specific_vev_relation() const { - // @@protoc_insertion_point(field_get:grin.PropertyFeature.grin_trait_specific_vev_relation) - return _internal_grin_trait_specific_vev_relation(); -} -inline void PropertyFeature::_internal_set_grin_trait_specific_vev_relation(bool value) { - - grin_trait_specific_vev_relation_ = value; -} -inline void PropertyFeature::set_grin_trait_specific_vev_relation(bool value) { - _internal_set_grin_trait_specific_vev_relation(value); - // @@protoc_insertion_point(field_set:grin.PropertyFeature.grin_trait_specific_vev_relation) -} - -// ------------------------------------------------------------------- - -// IndexFeature - -// bool grin_with_vertex_label = 1; -inline void IndexFeature::clear_grin_with_vertex_label() { - grin_with_vertex_label_ = false; -} -inline bool IndexFeature::_internal_grin_with_vertex_label() const { - return grin_with_vertex_label_; -} -inline bool IndexFeature::grin_with_vertex_label() const { - // @@protoc_insertion_point(field_get:grin.IndexFeature.grin_with_vertex_label) - return _internal_grin_with_vertex_label(); -} -inline void IndexFeature::_internal_set_grin_with_vertex_label(bool value) { - - grin_with_vertex_label_ = value; -} -inline void IndexFeature::set_grin_with_vertex_label(bool value) { - _internal_set_grin_with_vertex_label(value); - // @@protoc_insertion_point(field_set:grin.IndexFeature.grin_with_vertex_label) -} - -// bool grin_with_edge_label = 2; -inline void IndexFeature::clear_grin_with_edge_label() { - grin_with_edge_label_ = false; -} -inline bool IndexFeature::_internal_grin_with_edge_label() const { - return grin_with_edge_label_; -} -inline bool IndexFeature::grin_with_edge_label() const { - // @@protoc_insertion_point(field_get:grin.IndexFeature.grin_with_edge_label) - return _internal_grin_with_edge_label(); -} -inline void IndexFeature::_internal_set_grin_with_edge_label(bool value) { - - grin_with_edge_label_ = value; -} -inline void IndexFeature::set_grin_with_edge_label(bool value) { - _internal_set_grin_with_edge_label(value); - // @@protoc_insertion_point(field_set:grin.IndexFeature.grin_with_edge_label) -} - -// bool grin_assume_all_vertex_list_sorted = 3; -inline void IndexFeature::clear_grin_assume_all_vertex_list_sorted() { - grin_assume_all_vertex_list_sorted_ = false; -} -inline bool IndexFeature::_internal_grin_assume_all_vertex_list_sorted() const { - return grin_assume_all_vertex_list_sorted_; -} -inline bool IndexFeature::grin_assume_all_vertex_list_sorted() const { - // @@protoc_insertion_point(field_get:grin.IndexFeature.grin_assume_all_vertex_list_sorted) - return _internal_grin_assume_all_vertex_list_sorted(); -} -inline void IndexFeature::_internal_set_grin_assume_all_vertex_list_sorted(bool value) { - - grin_assume_all_vertex_list_sorted_ = value; -} -inline void IndexFeature::set_grin_assume_all_vertex_list_sorted(bool value) { - _internal_set_grin_assume_all_vertex_list_sorted(value); - // @@protoc_insertion_point(field_set:grin.IndexFeature.grin_assume_all_vertex_list_sorted) -} - -// ------------------------------------------------------------------- - -// PredicateFeature - -// ------------------------------------------------------------------- - -// StorageFeature - -// .grin.TopologyFeature topology_feature = 1; -inline bool StorageFeature::_internal_has_topology_feature() const { - return specific_feature_case() == kTopologyFeature; -} -inline bool StorageFeature::has_topology_feature() const { - return _internal_has_topology_feature(); -} -inline void StorageFeature::set_has_topology_feature() { - _oneof_case_[0] = kTopologyFeature; -} -inline void StorageFeature::clear_topology_feature() { - if (_internal_has_topology_feature()) { - if (GetArena() == nullptr) { - delete specific_feature_.topology_feature_; - } - clear_has_specific_feature(); - } -} -inline ::grin::TopologyFeature* StorageFeature::release_topology_feature() { - // @@protoc_insertion_point(field_release:grin.StorageFeature.topology_feature) - if (_internal_has_topology_feature()) { - clear_has_specific_feature(); - ::grin::TopologyFeature* temp = specific_feature_.topology_feature_; - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - specific_feature_.topology_feature_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::grin::TopologyFeature& StorageFeature::_internal_topology_feature() const { - return _internal_has_topology_feature() - ? *specific_feature_.topology_feature_ - : *reinterpret_cast< ::grin::TopologyFeature*>(&::grin::_TopologyFeature_default_instance_); -} -inline const ::grin::TopologyFeature& StorageFeature::topology_feature() const { - // @@protoc_insertion_point(field_get:grin.StorageFeature.topology_feature) - return _internal_topology_feature(); -} -inline ::grin::TopologyFeature* StorageFeature::unsafe_arena_release_topology_feature() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.topology_feature) - if (_internal_has_topology_feature()) { - clear_has_specific_feature(); - ::grin::TopologyFeature* temp = specific_feature_.topology_feature_; - specific_feature_.topology_feature_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void StorageFeature::unsafe_arena_set_allocated_topology_feature(::grin::TopologyFeature* topology_feature) { - clear_specific_feature(); - if (topology_feature) { - set_has_topology_feature(); - specific_feature_.topology_feature_ = topology_feature; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.topology_feature) -} -inline ::grin::TopologyFeature* StorageFeature::_internal_mutable_topology_feature() { - if (!_internal_has_topology_feature()) { - clear_specific_feature(); - set_has_topology_feature(); - specific_feature_.topology_feature_ = CreateMaybeMessage< ::grin::TopologyFeature >(GetArena()); - } - return specific_feature_.topology_feature_; -} -inline ::grin::TopologyFeature* StorageFeature::mutable_topology_feature() { - // @@protoc_insertion_point(field_mutable:grin.StorageFeature.topology_feature) - return _internal_mutable_topology_feature(); -} - -// .grin.PartitionFeature partition_feature = 2; -inline bool StorageFeature::_internal_has_partition_feature() const { - return specific_feature_case() == kPartitionFeature; -} -inline bool StorageFeature::has_partition_feature() const { - return _internal_has_partition_feature(); -} -inline void StorageFeature::set_has_partition_feature() { - _oneof_case_[0] = kPartitionFeature; -} -inline void StorageFeature::clear_partition_feature() { - if (_internal_has_partition_feature()) { - if (GetArena() == nullptr) { - delete specific_feature_.partition_feature_; - } - clear_has_specific_feature(); - } -} -inline ::grin::PartitionFeature* StorageFeature::release_partition_feature() { - // @@protoc_insertion_point(field_release:grin.StorageFeature.partition_feature) - if (_internal_has_partition_feature()) { - clear_has_specific_feature(); - ::grin::PartitionFeature* temp = specific_feature_.partition_feature_; - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - specific_feature_.partition_feature_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::grin::PartitionFeature& StorageFeature::_internal_partition_feature() const { - return _internal_has_partition_feature() - ? *specific_feature_.partition_feature_ - : *reinterpret_cast< ::grin::PartitionFeature*>(&::grin::_PartitionFeature_default_instance_); -} -inline const ::grin::PartitionFeature& StorageFeature::partition_feature() const { - // @@protoc_insertion_point(field_get:grin.StorageFeature.partition_feature) - return _internal_partition_feature(); -} -inline ::grin::PartitionFeature* StorageFeature::unsafe_arena_release_partition_feature() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.partition_feature) - if (_internal_has_partition_feature()) { - clear_has_specific_feature(); - ::grin::PartitionFeature* temp = specific_feature_.partition_feature_; - specific_feature_.partition_feature_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void StorageFeature::unsafe_arena_set_allocated_partition_feature(::grin::PartitionFeature* partition_feature) { - clear_specific_feature(); - if (partition_feature) { - set_has_partition_feature(); - specific_feature_.partition_feature_ = partition_feature; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.partition_feature) -} -inline ::grin::PartitionFeature* StorageFeature::_internal_mutable_partition_feature() { - if (!_internal_has_partition_feature()) { - clear_specific_feature(); - set_has_partition_feature(); - specific_feature_.partition_feature_ = CreateMaybeMessage< ::grin::PartitionFeature >(GetArena()); - } - return specific_feature_.partition_feature_; -} -inline ::grin::PartitionFeature* StorageFeature::mutable_partition_feature() { - // @@protoc_insertion_point(field_mutable:grin.StorageFeature.partition_feature) - return _internal_mutable_partition_feature(); -} - -// .grin.PropertyFeature property_feature = 3; -inline bool StorageFeature::_internal_has_property_feature() const { - return specific_feature_case() == kPropertyFeature; -} -inline bool StorageFeature::has_property_feature() const { - return _internal_has_property_feature(); -} -inline void StorageFeature::set_has_property_feature() { - _oneof_case_[0] = kPropertyFeature; -} -inline void StorageFeature::clear_property_feature() { - if (_internal_has_property_feature()) { - if (GetArena() == nullptr) { - delete specific_feature_.property_feature_; - } - clear_has_specific_feature(); - } -} -inline ::grin::PropertyFeature* StorageFeature::release_property_feature() { - // @@protoc_insertion_point(field_release:grin.StorageFeature.property_feature) - if (_internal_has_property_feature()) { - clear_has_specific_feature(); - ::grin::PropertyFeature* temp = specific_feature_.property_feature_; - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - specific_feature_.property_feature_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::grin::PropertyFeature& StorageFeature::_internal_property_feature() const { - return _internal_has_property_feature() - ? *specific_feature_.property_feature_ - : *reinterpret_cast< ::grin::PropertyFeature*>(&::grin::_PropertyFeature_default_instance_); -} -inline const ::grin::PropertyFeature& StorageFeature::property_feature() const { - // @@protoc_insertion_point(field_get:grin.StorageFeature.property_feature) - return _internal_property_feature(); -} -inline ::grin::PropertyFeature* StorageFeature::unsafe_arena_release_property_feature() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.property_feature) - if (_internal_has_property_feature()) { - clear_has_specific_feature(); - ::grin::PropertyFeature* temp = specific_feature_.property_feature_; - specific_feature_.property_feature_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void StorageFeature::unsafe_arena_set_allocated_property_feature(::grin::PropertyFeature* property_feature) { - clear_specific_feature(); - if (property_feature) { - set_has_property_feature(); - specific_feature_.property_feature_ = property_feature; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.property_feature) -} -inline ::grin::PropertyFeature* StorageFeature::_internal_mutable_property_feature() { - if (!_internal_has_property_feature()) { - clear_specific_feature(); - set_has_property_feature(); - specific_feature_.property_feature_ = CreateMaybeMessage< ::grin::PropertyFeature >(GetArena()); - } - return specific_feature_.property_feature_; -} -inline ::grin::PropertyFeature* StorageFeature::mutable_property_feature() { - // @@protoc_insertion_point(field_mutable:grin.StorageFeature.property_feature) - return _internal_mutable_property_feature(); -} - -// .grin.IndexFeature index_feature = 4; -inline bool StorageFeature::_internal_has_index_feature() const { - return specific_feature_case() == kIndexFeature; -} -inline bool StorageFeature::has_index_feature() const { - return _internal_has_index_feature(); -} -inline void StorageFeature::set_has_index_feature() { - _oneof_case_[0] = kIndexFeature; -} -inline void StorageFeature::clear_index_feature() { - if (_internal_has_index_feature()) { - if (GetArena() == nullptr) { - delete specific_feature_.index_feature_; - } - clear_has_specific_feature(); - } -} -inline ::grin::IndexFeature* StorageFeature::release_index_feature() { - // @@protoc_insertion_point(field_release:grin.StorageFeature.index_feature) - if (_internal_has_index_feature()) { - clear_has_specific_feature(); - ::grin::IndexFeature* temp = specific_feature_.index_feature_; - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - specific_feature_.index_feature_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::grin::IndexFeature& StorageFeature::_internal_index_feature() const { - return _internal_has_index_feature() - ? *specific_feature_.index_feature_ - : *reinterpret_cast< ::grin::IndexFeature*>(&::grin::_IndexFeature_default_instance_); -} -inline const ::grin::IndexFeature& StorageFeature::index_feature() const { - // @@protoc_insertion_point(field_get:grin.StorageFeature.index_feature) - return _internal_index_feature(); -} -inline ::grin::IndexFeature* StorageFeature::unsafe_arena_release_index_feature() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.index_feature) - if (_internal_has_index_feature()) { - clear_has_specific_feature(); - ::grin::IndexFeature* temp = specific_feature_.index_feature_; - specific_feature_.index_feature_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void StorageFeature::unsafe_arena_set_allocated_index_feature(::grin::IndexFeature* index_feature) { - clear_specific_feature(); - if (index_feature) { - set_has_index_feature(); - specific_feature_.index_feature_ = index_feature; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.index_feature) -} -inline ::grin::IndexFeature* StorageFeature::_internal_mutable_index_feature() { - if (!_internal_has_index_feature()) { - clear_specific_feature(); - set_has_index_feature(); - specific_feature_.index_feature_ = CreateMaybeMessage< ::grin::IndexFeature >(GetArena()); - } - return specific_feature_.index_feature_; -} -inline ::grin::IndexFeature* StorageFeature::mutable_index_feature() { - // @@protoc_insertion_point(field_mutable:grin.StorageFeature.index_feature) - return _internal_mutable_index_feature(); -} - -// .grin.PredicateFeature predicate_feature = 5; -inline bool StorageFeature::_internal_has_predicate_feature() const { - return specific_feature_case() == kPredicateFeature; -} -inline bool StorageFeature::has_predicate_feature() const { - return _internal_has_predicate_feature(); -} -inline void StorageFeature::set_has_predicate_feature() { - _oneof_case_[0] = kPredicateFeature; -} -inline void StorageFeature::clear_predicate_feature() { - if (_internal_has_predicate_feature()) { - if (GetArena() == nullptr) { - delete specific_feature_.predicate_feature_; - } - clear_has_specific_feature(); - } -} -inline ::grin::PredicateFeature* StorageFeature::release_predicate_feature() { - // @@protoc_insertion_point(field_release:grin.StorageFeature.predicate_feature) - if (_internal_has_predicate_feature()) { - clear_has_specific_feature(); - ::grin::PredicateFeature* temp = specific_feature_.predicate_feature_; - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - specific_feature_.predicate_feature_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline const ::grin::PredicateFeature& StorageFeature::_internal_predicate_feature() const { - return _internal_has_predicate_feature() - ? *specific_feature_.predicate_feature_ - : *reinterpret_cast< ::grin::PredicateFeature*>(&::grin::_PredicateFeature_default_instance_); -} -inline const ::grin::PredicateFeature& StorageFeature::predicate_feature() const { - // @@protoc_insertion_point(field_get:grin.StorageFeature.predicate_feature) - return _internal_predicate_feature(); -} -inline ::grin::PredicateFeature* StorageFeature::unsafe_arena_release_predicate_feature() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.StorageFeature.predicate_feature) - if (_internal_has_predicate_feature()) { - clear_has_specific_feature(); - ::grin::PredicateFeature* temp = specific_feature_.predicate_feature_; - specific_feature_.predicate_feature_ = nullptr; - return temp; - } else { - return nullptr; - } -} -inline void StorageFeature::unsafe_arena_set_allocated_predicate_feature(::grin::PredicateFeature* predicate_feature) { - clear_specific_feature(); - if (predicate_feature) { - set_has_predicate_feature(); - specific_feature_.predicate_feature_ = predicate_feature; - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.StorageFeature.predicate_feature) -} -inline ::grin::PredicateFeature* StorageFeature::_internal_mutable_predicate_feature() { - if (!_internal_has_predicate_feature()) { - clear_specific_feature(); - set_has_predicate_feature(); - specific_feature_.predicate_feature_ = CreateMaybeMessage< ::grin::PredicateFeature >(GetArena()); - } - return specific_feature_.predicate_feature_; -} -inline ::grin::PredicateFeature* StorageFeature::mutable_predicate_feature() { - // @@protoc_insertion_point(field_mutable:grin.StorageFeature.predicate_feature) - return _internal_mutable_predicate_feature(); -} - -inline bool StorageFeature::has_specific_feature() const { - return specific_feature_case() != SPECIFIC_FEATURE_NOT_SET; -} -inline void StorageFeature::clear_has_specific_feature() { - _oneof_case_[0] = SPECIFIC_FEATURE_NOT_SET; -} -inline StorageFeature::SpecificFeatureCase StorageFeature::specific_feature_case() const { - return StorageFeature::SpecificFeatureCase(_oneof_case_[0]); -} -// ------------------------------------------------------------------- - -// Statistics - -// int32 vertex_count = 1; -inline void Statistics::clear_vertex_count() { - vertex_count_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::_internal_vertex_count() const { - return vertex_count_; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::vertex_count() const { - // @@protoc_insertion_point(field_get:grin.Statistics.vertex_count) - return _internal_vertex_count(); -} -inline void Statistics::_internal_set_vertex_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - - vertex_count_ = value; -} -inline void Statistics::set_vertex_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_vertex_count(value); - // @@protoc_insertion_point(field_set:grin.Statistics.vertex_count) -} - -// int32 edge_count = 2; -inline void Statistics::clear_edge_count() { - edge_count_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::_internal_edge_count() const { - return edge_count_; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::edge_count() const { - // @@protoc_insertion_point(field_get:grin.Statistics.edge_count) - return _internal_edge_count(); -} -inline void Statistics::_internal_set_edge_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - - edge_count_ = value; -} -inline void Statistics::set_edge_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_edge_count(value); - // @@protoc_insertion_point(field_set:grin.Statistics.edge_count) -} - -// int32 partition_count = 3; -inline void Statistics::clear_partition_count() { - partition_count_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::_internal_partition_count() const { - return partition_count_; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::partition_count() const { - // @@protoc_insertion_point(field_get:grin.Statistics.partition_count) - return _internal_partition_count(); -} -inline void Statistics::_internal_set_partition_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - - partition_count_ = value; -} -inline void Statistics::set_partition_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_partition_count(value); - // @@protoc_insertion_point(field_set:grin.Statistics.partition_count) -} - -// int32 vertex_type_count = 4; -inline void Statistics::clear_vertex_type_count() { - vertex_type_count_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::_internal_vertex_type_count() const { - return vertex_type_count_; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::vertex_type_count() const { - // @@protoc_insertion_point(field_get:grin.Statistics.vertex_type_count) - return _internal_vertex_type_count(); -} -inline void Statistics::_internal_set_vertex_type_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - - vertex_type_count_ = value; -} -inline void Statistics::set_vertex_type_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_vertex_type_count(value); - // @@protoc_insertion_point(field_set:grin.Statistics.vertex_type_count) -} - -// int32 edge_type_count = 5; -inline void Statistics::clear_edge_type_count() { - edge_type_count_ = 0; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::_internal_edge_type_count() const { - return edge_type_count_; -} -inline ::PROTOBUF_NAMESPACE_ID::int32 Statistics::edge_type_count() const { - // @@protoc_insertion_point(field_get:grin.Statistics.edge_type_count) - return _internal_edge_type_count(); -} -inline void Statistics::_internal_set_edge_type_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - - edge_type_count_ = value; -} -inline void Statistics::set_edge_type_count(::PROTOBUF_NAMESPACE_ID::int32 value) { - _internal_set_edge_type_count(value); - // @@protoc_insertion_point(field_set:grin.Statistics.edge_type_count) -} - -// ------------------------------------------------------------------- - -// Graph - -// string uri = 1; -inline void Graph::clear_uri() { - uri_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline const std::string& Graph::uri() const { - // @@protoc_insertion_point(field_get:grin.Graph.uri) - return _internal_uri(); -} -inline void Graph::set_uri(const std::string& value) { - _internal_set_uri(value); - // @@protoc_insertion_point(field_set:grin.Graph.uri) -} -inline std::string* Graph::mutable_uri() { - // @@protoc_insertion_point(field_mutable:grin.Graph.uri) - return _internal_mutable_uri(); -} -inline const std::string& Graph::_internal_uri() const { - return uri_.Get(); -} -inline void Graph::_internal_set_uri(const std::string& value) { - - uri_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); -} -inline void Graph::set_uri(std::string&& value) { - - uri_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:grin.Graph.uri) -} -inline void Graph::set_uri(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - uri_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArena()); - // @@protoc_insertion_point(field_set_char:grin.Graph.uri) -} -inline void Graph::set_uri(const char* value, - size_t size) { - - uri_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:grin.Graph.uri) -} -inline std::string* Graph::_internal_mutable_uri() { - - return uri_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline std::string* Graph::release_uri() { - // @@protoc_insertion_point(field_release:grin.Graph.uri) - return uri_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline void Graph::set_allocated_uri(std::string* uri) { - if (uri != nullptr) { - - } else { - - } - uri_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), uri, - GetArena()); - // @@protoc_insertion_point(field_set_allocated:grin.Graph.uri) -} -inline std::string* Graph::unsafe_arena_release_uri() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.Graph.uri) - GOOGLE_DCHECK(GetArena() != nullptr); - - return uri_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArena()); -} -inline void Graph::unsafe_arena_set_allocated_uri( - std::string* uri) { - GOOGLE_DCHECK(GetArena() != nullptr); - if (uri != nullptr) { - - } else { - - } - uri_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - uri, GetArena()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.Graph.uri) -} - -// string grin_version = 2; -inline void Graph::clear_grin_version() { - grin_version_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline const std::string& Graph::grin_version() const { - // @@protoc_insertion_point(field_get:grin.Graph.grin_version) - return _internal_grin_version(); -} -inline void Graph::set_grin_version(const std::string& value) { - _internal_set_grin_version(value); - // @@protoc_insertion_point(field_set:grin.Graph.grin_version) -} -inline std::string* Graph::mutable_grin_version() { - // @@protoc_insertion_point(field_mutable:grin.Graph.grin_version) - return _internal_mutable_grin_version(); -} -inline const std::string& Graph::_internal_grin_version() const { - return grin_version_.Get(); -} -inline void Graph::_internal_set_grin_version(const std::string& value) { - - grin_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); -} -inline void Graph::set_grin_version(std::string&& value) { - - grin_version_.Set( - &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); - // @@protoc_insertion_point(field_set_rvalue:grin.Graph.grin_version) -} -inline void Graph::set_grin_version(const char* value) { - GOOGLE_DCHECK(value != nullptr); - - grin_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), - GetArena()); - // @@protoc_insertion_point(field_set_char:grin.Graph.grin_version) -} -inline void Graph::set_grin_version(const char* value, - size_t size) { - - grin_version_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( - reinterpret_cast(value), size), GetArena()); - // @@protoc_insertion_point(field_set_pointer:grin.Graph.grin_version) -} -inline std::string* Graph::_internal_mutable_grin_version() { - - return grin_version_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline std::string* Graph::release_grin_version() { - // @@protoc_insertion_point(field_release:grin.Graph.grin_version) - return grin_version_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); -} -inline void Graph::set_allocated_grin_version(std::string* grin_version) { - if (grin_version != nullptr) { - - } else { - - } - grin_version_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), grin_version, - GetArena()); - // @@protoc_insertion_point(field_set_allocated:grin.Graph.grin_version) -} -inline std::string* Graph::unsafe_arena_release_grin_version() { - // @@protoc_insertion_point(field_unsafe_arena_release:grin.Graph.grin_version) - GOOGLE_DCHECK(GetArena() != nullptr); - - return grin_version_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - GetArena()); -} -inline void Graph::unsafe_arena_set_allocated_grin_version( - std::string* grin_version) { - GOOGLE_DCHECK(GetArena() != nullptr); - if (grin_version != nullptr) { - - } else { - - } - grin_version_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), - grin_version, GetArena()); - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.Graph.grin_version) -} - -// repeated .grin.StorageFeature features = 3; -inline int Graph::_internal_features_size() const { - return features_.size(); -} -inline int Graph::features_size() const { - return _internal_features_size(); -} -inline void Graph::clear_features() { - features_.Clear(); -} -inline ::grin::StorageFeature* Graph::mutable_features(int index) { - // @@protoc_insertion_point(field_mutable:grin.Graph.features) - return features_.Mutable(index); -} -inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature >* -Graph::mutable_features() { - // @@protoc_insertion_point(field_mutable_list:grin.Graph.features) - return &features_; -} -inline const ::grin::StorageFeature& Graph::_internal_features(int index) const { - return features_.Get(index); -} -inline const ::grin::StorageFeature& Graph::features(int index) const { - // @@protoc_insertion_point(field_get:grin.Graph.features) - return _internal_features(index); -} -inline ::grin::StorageFeature* Graph::_internal_add_features() { - return features_.Add(); -} -inline ::grin::StorageFeature* Graph::add_features() { - // @@protoc_insertion_point(field_add:grin.Graph.features) - return _internal_add_features(); -} -inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::grin::StorageFeature >& -Graph::features() const { - // @@protoc_insertion_point(field_list:grin.Graph.features) - return features_; -} - -// .grin.Statistics statistics = 4; -inline bool Graph::_internal_has_statistics() const { - return this != internal_default_instance() && statistics_ != nullptr; -} -inline bool Graph::has_statistics() const { - return _internal_has_statistics(); -} -inline void Graph::clear_statistics() { - if (GetArena() == nullptr && statistics_ != nullptr) { - delete statistics_; - } - statistics_ = nullptr; -} -inline const ::grin::Statistics& Graph::_internal_statistics() const { - const ::grin::Statistics* p = statistics_; - return p != nullptr ? *p : *reinterpret_cast( - &::grin::_Statistics_default_instance_); -} -inline const ::grin::Statistics& Graph::statistics() const { - // @@protoc_insertion_point(field_get:grin.Graph.statistics) - return _internal_statistics(); -} -inline void Graph::unsafe_arena_set_allocated_statistics( - ::grin::Statistics* statistics) { - if (GetArena() == nullptr) { - delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(statistics_); - } - statistics_ = statistics; - if (statistics) { - - } else { - - } - // @@protoc_insertion_point(field_unsafe_arena_set_allocated:grin.Graph.statistics) -} -inline ::grin::Statistics* Graph::release_statistics() { - auto temp = unsafe_arena_release_statistics(); - if (GetArena() != nullptr) { - temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); - } - return temp; -} -inline ::grin::Statistics* Graph::unsafe_arena_release_statistics() { - // @@protoc_insertion_point(field_release:grin.Graph.statistics) - - ::grin::Statistics* temp = statistics_; - statistics_ = nullptr; - return temp; -} -inline ::grin::Statistics* Graph::_internal_mutable_statistics() { - - if (statistics_ == nullptr) { - auto* p = CreateMaybeMessage<::grin::Statistics>(GetArena()); - statistics_ = p; - } - return statistics_; -} -inline ::grin::Statistics* Graph::mutable_statistics() { - // @@protoc_insertion_point(field_mutable:grin.Graph.statistics) - return _internal_mutable_statistics(); -} -inline void Graph::set_allocated_statistics(::grin::Statistics* statistics) { - ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); - if (message_arena == nullptr) { - delete statistics_; - } - if (statistics) { - ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = - ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(statistics); - if (message_arena != submessage_arena) { - statistics = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( - message_arena, statistics, submessage_arena); - } - - } else { - - } - statistics_ = statistics; - // @@protoc_insertion_point(field_set_allocated:grin.Graph.statistics) -} - -#ifdef __GNUC__ - #pragma GCC diagnostic pop -#endif // __GNUC__ -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - -// ------------------------------------------------------------------- - - -// @@protoc_insertion_point(namespace_scope) - -} // namespace grin - -PROTOBUF_NAMESPACE_OPEN - -template <> struct is_proto_enum< ::grin::ListRetrieval> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::grin::ListRetrieval>() { - return ::grin::ListRetrieval_descriptor(); -} -template <> struct is_proto_enum< ::grin::GraphPartitionStrategy> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::grin::GraphPartitionStrategy>() { - return ::grin::GraphPartitionStrategy_descriptor(); -} -template <> struct is_proto_enum< ::grin::PropertyDataPartitionStrategy> : ::std::true_type {}; -template <> -inline const EnumDescriptor* GetEnumDescriptor< ::grin::PropertyDataPartitionStrategy>() { - return ::grin::PropertyDataPartitionStrategy_descriptor(); -} - -PROTOBUF_NAMESPACE_CLOSE - -// @@protoc_insertion_point(global_scope) - -#include -#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_graph_2eproto diff --git a/modules/graph/grin/src/proto/message.cc b/modules/graph/grin/src/proto/message.cc index 344c10619..b0aedee94 100644 --- a/modules/graph/grin/src/proto/message.cc +++ b/modules/graph/grin/src/proto/message.cc @@ -18,7 +18,6 @@ extern "C" { } #include "graph.pb.h" - const char* grin_get_static_storage_feature_msg() { grin::Graph g; g.set_uri("v6d://"); From d46d4d7f9b229ee3c1daa83265d8a166b89510ae Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Wed, 10 May 2023 09:43:51 +0000 Subject: [PATCH 65/85] remove total num impls --- modules/graph/grin/c/test.c | 9 -------- modules/graph/grin/include | 2 +- modules/graph/grin/rust/grin_v6d.rs | 22 -------------------- modules/graph/grin/src/partition/topology.cc | 13 ------------ modules/graph/grin/src/property/topology.cc | 16 -------------- 5 files changed, 1 insertion(+), 61 deletions(-) diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index bd17412ab..40ad2d7eb 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -249,15 +249,6 @@ void test_property_topology(int argc, char** argv) { const char* vt_name = grin_get_vertex_type_name(g, vt); const char* et_name = grin_get_edge_type_name(g, et); -#ifdef GRIN_ENABLE_GRAPH_PARTITION - GRIN_PARTITIONED_GRAPH pg = get_partitioend_graph(argc, argv); - size_t tvnum = grin_get_total_vertex_num_by_type(pg, vt); - printf("total vertex num of %s: %zu\n", vt_name, tvnum); - size_t tenum = grin_get_total_edge_num_by_type(pg, et); - printf("total edge num of %s: %zu\n", et_name, tenum); - grin_destroy_partitioned_graph(pg); -#endif - #ifdef GRIN_ENABLE_VERTEX_LIST GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); diff --git a/modules/graph/grin/include b/modules/graph/grin/include index a8306fb96..4134b862f 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit a8306fb9691a189e7927650d7285b601df315ccb +Subproject commit 4134b862ffe200a2013d7a2383cfa5ff3a0b41e7 diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index 1203bb90e..b189b3e95 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -400,14 +400,6 @@ extern "C" { arg2: i64, ) -> GrinVertexRef; - #[cfg(feature = "grin_enable_graph_partition")] - #[allow(unused)] - pub fn grin_get_total_vertex_num(arg1: GrinPartitionedGraph) -> usize; - - #[cfg(feature = "grin_enable_graph_partition")] - #[allow(unused)] - pub fn grin_get_total_edge_num(arg1: GrinPartitionedGraph) -> usize; - #[cfg(feature = "grin_trait_select_master_for_vertex_list")] #[allow(unused)] pub fn grin_select_master_for_vertex_list( @@ -1064,20 +1056,6 @@ extern "C" { #[allow(unused)] pub fn grin_get_edge_num_by_type(arg1: GrinGraph, arg2: GrinEdgeType) -> usize; - #[cfg(all(feature = "grin_enable_graph_partition", feature = "grin_with_vertex_property"))] - #[allow(unused)] - pub fn grin_get_total_vertex_num_by_type( - arg1: GrinPartitionedGraph, - arg2: GrinVertexType, - ) -> usize; - - #[cfg(all(feature = "grin_enable_graph_partition", feature = "grin_with_edge_property"))] - #[allow(unused)] - pub fn grin_get_total_edge_num_by_type( - arg1: GrinPartitionedGraph, - arg2: GrinEdgeType, - ) -> usize; - #[cfg(feature = "grin_assume_by_type_vertex_original_id")] #[allow(unused)] pub fn grin_get_vertex_by_original_id_by_type( diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc index 36c70008d..7d964f8b3 100644 --- a/modules/graph/grin/src/partition/topology.cc +++ b/modules/graph/grin/src/partition/topology.cc @@ -18,19 +18,6 @@ extern "C" { #include "graph/grin/include/partition/topology.h" } -#ifdef GRIN_ENABLE_GRAPH_PARTITION -size_t grin_get_total_vertex_num(GRIN_PARTITIONED_GRAPH pg) { - auto _pg = static_cast(pg); - if (_pg->lgs.size() == 0) return 0; - return _pg->lgs[0]->GetTotalVerticesNum(); -} - -size_t grin_get_total_edge_num(GRIN_PARTITIONED_GRAPH pg) { - auto _pg = static_cast(pg); - return _pg->pg->total_edge_num(); -} -#endif - #ifdef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST GRIN_VERTEX_LIST grin_select_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _g = static_cast(g)->g; diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index 1a082ee3d..dc9518985 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -29,22 +29,6 @@ size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { } #endif -#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_WITH_VERTEX_PROPERTY) -size_t grin_get_total_vertex_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_VERTEX_TYPE vtype) { - auto _pg = static_cast(pg); - if (_pg->lgs.size() == 0) return 0; - return _pg->lgs[0]->GetTotalVerticesNum(vtype); -} -#endif - -#if defined(GRIN_ENABLE_GRAPH_PARTITION) && defined(GRIN_WITH_EDGE_PROPERTY) -size_t grin_get_total_edge_num_by_type(GRIN_PARTITIONED_GRAPH pg, GRIN_EDGE_TYPE etype) { - auto _pg = static_cast(pg); - return _pg->pg->total_edge_num_by_type(etype); -} -#endif - - #ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID GRIN_VERTEX grin_get_vertex_by_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_ORIGINAL_ID oid) { auto _g = static_cast(g)->g; From c58e8c757f4b61016520028a307637a86da762ec Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Fri, 12 May 2023 05:20:00 +0000 Subject: [PATCH 66/85] fix original id impl --- modules/graph/grin/c/test.c | 29 ++++++++++++-------- modules/graph/grin/include | 2 +- modules/graph/grin/rust/grin_v6d.rs | 13 ++++----- modules/graph/grin/src/index/order.cc | 15 +++++----- modules/graph/grin/src/property/topology.cc | 4 +-- modules/graph/grin/src/topology/structure.cc | 11 ++------ 6 files changed, 36 insertions(+), 38 deletions(-) diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index 40ad2d7eb..d6468d6db 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -298,19 +298,20 @@ void test_property_topology(int argc, char** argv) { #endif #ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID - GRIN_DATATYPE dt = grin_get_vertex_original_id_type(g); + GRIN_DATATYPE dt = grin_get_vertex_original_id_data_type(g); if (dt == Int64) { - long int v0id = 4; - GRIN_VERTEX v0 = grin_get_vertex_by_original_id_by_type(g, vt, &v0id); + long long int v0id = 4; + GRIN_VERTEX v0 = grin_get_vertex_by_original_id_by_type(g, vt, dt, &v0id); if (v0 == GRIN_NULL_VERTEX) { - printf("(Wrong) vertex of id %ld can not be found\n", v0id); + printf("(Wrong) vertex of id %lld can not be found\n", v0id); } else { - printf("vertex of original id %ld found\n", v0id); - GRIN_VERTEX_ORIGINAL_ID oid0 = grin_get_vertex_original_id(g, v0); - printf("get vertex original id: %ld\n", *((long int*) oid0)); - grin_destroy_vertex_original_id(g, oid0); + printf("vertex of original id %lld found\n", v0id); + const void* oid0 = grin_get_vertex_original_id_value(g, v0); + printf("get vertex original id: %lld\n", *((long long int*) oid0)); } grin_destroy_vertex(g, v0); + } else { + printf("(Wrong) vertex original id type not int64\n"); } #endif @@ -759,10 +760,14 @@ void test_property_primary_key(int argc, char** argv) { if (v == GRIN_NULL_VERTEX) { printf("(Wrong) vertex of primary keys %zu does not exist\n", j); } else { - GRIN_VERTEX_ORIGINAL_ID oid0 = grin_get_vertex_original_id(g, v); - printf("(Correct) vertex of primary keys %zu exists %ld\n", j, - *((long int*) oid0)); - grin_destroy_vertex_original_id(g, oid0); + GRIN_DATATYPE dt0 = grin_get_vertex_original_id_data_type(g); + const void* oid0 = grin_get_vertex_original_id_value(g, v); + if (dt0 == Int64) { + printf("(Correct) vertex of primary keys %zu exists %lld\n", j, + *((long long int*) oid0)); + } else { + printf("(Wrong) unmatch original id type\n"); + } grin_destroy_vertex(g, v); } } else { diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 4134b862f..4a8d50196 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 4134b862ffe200a2013d7a2383cfa5ff3a0b41e7 +Subproject commit 4a8d50196dc82ef9355185a62a5dddfba664b7b6 diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index b189b3e95..508938492 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -169,18 +169,14 @@ extern "C" { #[cfg(feature = "grin_with_vertex_original_id")] #[allow(unused)] - pub fn grin_destroy_vertex_original_id(arg1: GrinGraph, arg2: GrinVertexOriginalId); + pub fn grin_get_vertex_original_id_data_type(arg1: GrinGraph) -> GrinDatatype; #[cfg(feature = "grin_with_vertex_original_id")] #[allow(unused)] - pub fn grin_get_vertex_original_id_type(arg1: GrinGraph) -> GrinDatatype; - - #[cfg(feature = "grin_with_vertex_original_id")] - #[allow(unused)] - pub fn grin_get_vertex_original_id( + pub fn grin_get_vertex_original_id_value( arg1: GrinGraph, arg2: GrinVertex, - ) -> GrinVertexOriginalId; + ) -> *const ::std::os::raw::c_void; #[allow(unused)] pub fn grin_destroy_value( @@ -1061,7 +1057,8 @@ extern "C" { pub fn grin_get_vertex_by_original_id_by_type( arg1: GrinGraph, arg2: GrinVertexType, - arg3: GrinVertexOriginalId, + arg3: GrinDatatype, + arg4: *const ::std::os::raw::c_void, ) -> GrinVertex; #[cfg(feature = "grin_trait_select_type_for_vertex_list")] diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index 8f00f0b16..3c5e923fd 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -30,12 +30,13 @@ size_t grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LI auto _g = static_cast(g)->g; auto _v = static_cast(v); auto _vl = static_cast(vl); - auto vtype = (unsigned)_g->vertex_label(*_v); - if (vtype < _vl->type_begin || vtype >= _vl->type_end) return GRIN_NULL_SIZE; - auto offset = _v->GetValue() - _vl->vrs[vtype - _vl->type_begin].begin_value(); - if (offset < _vl->vrs[vtype - _vl->type_begin].size()) { - return _vl->offsets[vtype - _vl->type_begin] + offset; - } - return GRIN_NULL_SIZE; + return _v->GetValue() - _vl->vrs[0].begin_value(); + // auto vtype = (unsigned)_g->vertex_label(*_v); + // if (vtype < _vl->type_begin || vtype >= _vl->type_end) return GRIN_NULL_SIZE; + // auto offset = _v->GetValue() - _vl->vrs[vtype - _vl->type_begin].begin_value(); + // if (offset < _vl->vrs[vtype - _vl->type_begin].size()) { + // return _vl->offsets[vtype - _vl->type_begin] + offset; + // } + // return GRIN_NULL_SIZE; } #endif diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index dc9518985..7abd71bf8 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -30,9 +30,9 @@ size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { #endif #ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID -GRIN_VERTEX grin_get_vertex_by_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_ORIGINAL_ID oid) { +GRIN_VERTEX grin_get_vertex_by_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_DATATYPE dt, const void* oid) { auto _g = static_cast(g)->g; - auto _oid = static_cast(oid); + auto _oid = static_cast(oid); _GRIN_GRAPH_T::vid_t gid; auto v = new GRIN_VERTEX_T(); if (_g->Oid2Gid(vtype, *_oid, gid)) { diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index ab53230dc..a0b06535a 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -79,17 +79,12 @@ bool grin_equal_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { #ifdef GRIN_WITH_VERTEX_ORIGINAL_ID -void grin_destroy_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX_ORIGINAL_ID oid) { - auto _oid = static_cast(oid); - delete _oid; -} -GRIN_DATATYPE grin_get_vertex_original_id_type(GRIN_GRAPH g) { +GRIN_DATATYPE grin_get_vertex_original_id_data_type(GRIN_GRAPH g) { return GRIN_DATATYPE_ENUM::value; } - -GRIN_VERTEX_ORIGINAL_ID grin_get_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX v) { +const void* grin_get_vertex_original_id_value(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; auto _v = static_cast(v); auto gid = _g->Vertex2Gid(*_v); @@ -99,7 +94,7 @@ GRIN_VERTEX_ORIGINAL_ID grin_get_vertex_original_id(GRIN_GRAPH g, GRIN_VERTEX v) #endif #if defined(GRIN_WITH_VERTEX_ORIGINAL_ID) && !defined(GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID) -GRIN_VERTEX grin_get_vertex_by_original_id(GRIN_GRAPH, GRIN_VERTEX_ORIGINAL_ID); +GRIN_VERTEX grin_get_vertex_by_original_id(GRIN_GRAPH, GRIN_DATATYPE, const void*); #endif // Data From 86cba7c2238c51963903a0b8fe687dd22f44ae27 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Fri, 12 May 2023 10:13:39 +0000 Subject: [PATCH 67/85] fix shared ptr copy problem in Graph_T --- modules/graph/grin/src/partition/partition.cc | 12 ++++++++---- modules/graph/grin/src/predefine.cc | 4 ++-- modules/graph/grin/src/predefine.h | 10 ++++++---- modules/graph/grin/src/topology/structure.cc | 7 ++++++- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index f17fc7a87..caebbece6 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -25,18 +25,19 @@ GRIN_PARTITIONED_GRAPH grin_get_partitioned_graph_from_storage(int argc, char** return nullptr; } auto pg = new GRIN_PARTITIONED_GRAPH_T(); + pg->socket = std::string(argv[0]); pg->client.Connect(argv[0]); vineyard::ObjectID obj_id; std::stringstream ss(argv[1]); ss >> obj_id; pg->pg = std::dynamic_pointer_cast(pg->client.GetObject(obj_id)); - pg->lgs.resize(pg->pg->total_frag_num(), nullptr); + pg->lgs.resize(pg->pg->total_frag_num(), 0); for (auto & [fid, location] : pg->pg->FragmentLocations()) { if (location == pg->client.instance_id()) { auto obj_id = pg->pg->Fragments().at(fid); // std::cout << fid << ": " << obj_id << std::endl; - auto frag = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(pg->client.GetObject(obj_id)); - pg->lgs[fid] = frag; +// auto frag = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(pg->client.GetObject(obj_id)); + pg->lgs[fid] = obj_id; } } return pg; @@ -102,7 +103,10 @@ const void* grin_get_partition_info(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) GRIN_GRAPH grin_get_local_graph_by_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PARTITION p) { auto _pg = static_cast(pg); auto g = new GRIN_GRAPH_T(); - g->g = _pg->lgs[p]; + + g->client.Connect(_pg->socket); + g->_g = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(g->client.GetObject(_pg->lgs[p])); + g->g = g->_g.get(); return g; } #endif diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index f6477d112..4649b85a3 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -66,7 +66,7 @@ GRIN_DATATYPE ArrowToDataType(std::shared_ptr type) { } #ifdef GRIN_ENABLE_VERTEX_LIST -void __grin_init_vertex_list(std::shared_ptr<_GRIN_GRAPH_T> g, GRIN_VERTEX_LIST_T* vl) { +void __grin_init_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { vl->offsets.clear(); vl->vrs.clear(); _GRIN_GRAPH_T::vertices_t vr; @@ -88,7 +88,7 @@ void __grin_init_vertex_list(std::shared_ptr<_GRIN_GRAPH_T> g, GRIN_VERTEX_LIST_ #endif #ifdef GRIN_ENABLE_ADJACENT_LIST -void __grin_init_adjacent_list(std::shared_ptr<_GRIN_GRAPH_T> g, GRIN_ADJACENT_LIST_T* al) { +void __grin_init_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { al->offsets.clear(); al->data.clear(); _GRIN_GRAPH_T::raw_adj_list_t ral; diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 8b8ec3562..16e0f4c31 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -94,7 +94,8 @@ unsigned _grin_get_prop_from_property(unsigned long long int); typedef vineyard::ArrowFragment _GRIN_GRAPH_T; struct GRIN_GRAPH_T { vineyard::Client client; - std::shared_ptr<_GRIN_GRAPH_T> g; + std::shared_ptr<_GRIN_GRAPH_T> _g; + _GRIN_GRAPH_T* g; }; typedef _GRIN_GRAPH_T::vertex_t GRIN_VERTEX_T; struct GRIN_EDGE_T { @@ -117,7 +118,7 @@ struct GRIN_VERTEX_LIST_T { std::vector offsets; std::vector<_GRIN_GRAPH_T::vertices_t> vrs; }; -void __grin_init_vertex_list(std::shared_ptr<_GRIN_GRAPH_T> g, GRIN_VERTEX_LIST_T* vl); +void __grin_init_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl); #endif #ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR @@ -140,7 +141,7 @@ struct GRIN_ADJACENT_LIST_T { std::vector offsets; std::vector<_GRIN_GRAPH_T::raw_adj_list_t> data; }; -void __grin_init_adjacent_list(std::shared_ptr<_GRIN_GRAPH_T> g, GRIN_ADJACENT_LIST_T* al); +void __grin_init_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al); #endif #ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR @@ -157,9 +158,10 @@ struct GRIN_ADJACENT_LIST_ITERATOR_T { #ifdef GRIN_ENABLE_GRAPH_PARTITION struct GRIN_PARTITIONED_GRAPH_T { + std::string socket; vineyard::Client client; std::shared_ptr pg; - std::vector> lgs; + std::vector lgs; }; typedef unsigned GRIN_PARTITION_T; typedef std::vector GRIN_PARTITION_LIST_T; diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index a0b06535a..89e8c74aa 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -17,17 +17,22 @@ limitations under the License. extern "C" { #include "graph/grin/include/topology/structure.h" } +#include "client/client.h" GRIN_GRAPH grin_get_graph_from_storage(int argc, char** argv) { if (argc < 2) { return nullptr; } + auto g = new GRIN_GRAPH_T(); g->client.Connect(argv[0]); + vineyard::ObjectID obj_id; std::stringstream ss(argv[1]); ss >> obj_id; - g->g = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(g->client.GetObject(obj_id)); + + g->_g = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(g->client.GetObject(obj_id)); + g->g = g->_g.get(); return g; } From 18b4abdb0d075cb916de53ea23c655788db0dd22 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Sun, 14 May 2023 16:16:25 +0000 Subject: [PATCH 68/85] impl for value/original_id update --- modules/graph/grin/c/test.c | 78 +-- modules/graph/grin/c/test.sh | 4 +- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 55 +- modules/graph/grin/src/index/original_id.cc | 48 ++ modules/graph/grin/src/predefine.cc | 36 ++ modules/graph/grin/src/predefine.h | 9 +- modules/graph/grin/src/property/property.cc | 4 +- .../graph/grin/src/property/propertytable.cc | 588 +++++------------- modules/graph/grin/src/property/topology.cc | 15 - modules/graph/grin/src/proto/message.cc | 20 +- modules/graph/grin/src/topology/structure.cc | 65 +- 12 files changed, 327 insertions(+), 597 deletions(-) create mode 100644 modules/graph/grin/src/index/original_id.cc diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index d6468d6db..e0de71076 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -2,6 +2,7 @@ #include "../include/common/error.h" #include "../include/index/label.h" #include "../include/index/order.h" +#include "../include/index/original_id.h" #include "../include/partition/partition.h" #include "../include/partition/reference.h" #include "../include/partition/topology.h" @@ -25,6 +26,9 @@ GRIN_GRAPH get_graph(int argc, char** argv) { GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); GRIN_GRAPH g = grin_get_local_graph_by_partition(pg, partition); + grin_destroy_partition(pg, partition); + grin_destroy_partition_list(pg, local_partitions); + grin_destroy_partitioned_graph(pg); #else GRIN_GRAPH g = grin_get_graph_from_storage(argc - 1, &(argv[1])); #endif @@ -99,7 +103,7 @@ void test_property_type(int argc, char** argv) { const char* vt_name = grin_get_vertex_type_name(g, vt); printf("vertex type name: %s\n", vt_name); GRIN_VERTEX_TYPE vt0 = grin_get_vertex_type_by_name(g, vt_name); - grin_destroy_name(g, vt_name); + //grin_destroy_name(g, vt_name); if (!grin_equal_vertex_type(g, vt, vt0)) { printf("vertex type name not match\n"); } @@ -132,7 +136,7 @@ void test_property_type(int argc, char** argv) { } else { const char* vt2_name = grin_get_vertex_type_name(g, vt2); printf("vertex type name: %s\n", vt2_name); - grin_destroy_name(g, vt2_name); + //grin_destroy_name(g, vt2_name); } #else GRIN_VERTEX_TYPE vt2 = get_one_vertex_type(g); @@ -161,7 +165,7 @@ void test_property_type(int argc, char** argv) { const char* et_name = grin_get_edge_type_name(g, et); printf("edge type name: %s\n", et_name); GRIN_EDGE_TYPE et0 = grin_get_edge_type_by_name(g, et_name); - grin_destroy_name(g, et_name); + //grin_destroy_name(g, et_name); if (!grin_equal_edge_type(g, et, et0)) { printf("edge type name not match\n"); } @@ -195,9 +199,9 @@ void test_property_type(int argc, char** argv) { const char* dst_vt_name = grin_get_vertex_type_name(g, dst_vt); const char* et_name = grin_get_edge_type_name(g, et); printf("edge type name: %s-%s-%s\n", src_vt_name, et_name, dst_vt_name); - grin_destroy_name(g, src_vt_name); - grin_destroy_name(g, dst_vt_name); - grin_destroy_name(g, et_name); + //grin_destroy_name(g, src_vt_name); + //grin_destroy_name(g, dst_vt_name); + //grin_destroy_name(g, et_name); grin_destroy_vertex_type(g, src_vt); grin_destroy_vertex_type(g, dst_vt); } @@ -221,7 +225,7 @@ void test_property_type(int argc, char** argv) { } else { const char* et2_name = grin_get_edge_type_name(g, et2); printf("edge type name: %s\n", et2_name); - grin_destroy_name(g, et2_name); + //grin_destroy_name(g, et2_name); } #else GRIN_EDGE_TYPE et2 = get_one_edge_type(g); @@ -297,17 +301,17 @@ void test_property_topology(int argc, char** argv) { grin_destroy_vertex_list(g, vl); #endif -#ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID - GRIN_DATATYPE dt = grin_get_vertex_original_id_data_type(g); +#ifdef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_INT64 + GRIN_DATATYPE dt = grin_get_vertex_original_id_datatype(g); if (dt == Int64) { long long int v0id = 4; - GRIN_VERTEX v0 = grin_get_vertex_by_original_id_by_type(g, vt, dt, &v0id); + GRIN_VERTEX v0 = grin_get_vertex_by_original_id_of_int64(g, v0id); if (v0 == GRIN_NULL_VERTEX) { printf("(Wrong) vertex of id %lld can not be found\n", v0id); } else { printf("vertex of original id %lld found\n", v0id); - const void* oid0 = grin_get_vertex_original_id_value(g, v0); - printf("get vertex original id: %lld\n", *((long long int*) oid0)); + long long int oid0 = grin_get_vertex_original_id_of_int64(g, v0); + printf("get vertex original id: %lld\n", oid0); } grin_destroy_vertex(g, v0); } else { @@ -362,8 +366,8 @@ void test_property_topology(int argc, char** argv) { grin_destroy_edge_list(g, el); #endif - grin_destroy_name(g, vt_name); - grin_destroy_name(g, et_name); + //grin_destroy_name(g, vt_name); + //grin_destroy_name(g, et_name); grin_destroy_vertex_type(g, vt); grin_destroy_edge_type(g, et); grin_destroy_graph(g); @@ -438,7 +442,7 @@ void test_property_vertex_table(int argc, char** argv) { #else const char* vp_name = "unknown"; #endif - GRIN_DATATYPE dt = grin_get_vertex_property_data_type(g, vp); + GRIN_DATATYPE dt = grin_get_vertex_property_datatype(g, vp); const void* pv = grin_get_value_from_vertex_property_table(g, vpt, v, vp); if (grin_get_last_error_code() == NO_ERROR) { @@ -454,8 +458,8 @@ void test_property_vertex_table(int argc, char** argv) { printf("vp_id %u v%zu %s value: %s %s\n", id, i, vp_name, (char*) pv, (char*) rv); } - grin_destroy_value(g, dt, pv); - grin_destroy_value(g, dt, rv); + //grin_destroy_value(g, dt, pv); + //grin_destroy_value(g, dt, rv); grin_destroy_vertex_property(g, vp); } grin_destroy_row(g, row); @@ -517,8 +521,8 @@ void test_property_vertex_table(int argc, char** argv) { vp5_name); grin_destroy_vertex_property(g, vp5); grin_destroy_vertex_type(g, vt5); - grin_destroy_name(g, vt5_name); - grin_destroy_name(g, vp5_name); + //grin_destroy_name(g, vt5_name); + //grin_destroy_name(g, vp5_name); } grin_destroy_vertex_property_list(g, vpl2); } @@ -599,7 +603,7 @@ void test_property_edge_table(int argc, char** argv) { #else unsigned int id = ~0; #endif - GRIN_DATATYPE dt = grin_get_edge_property_data_type(g, ep); + GRIN_DATATYPE dt = grin_get_edge_property_datatype(g, ep); const void* pv = grin_get_value_from_edge_property_table(g, ept, e, ep); const void* rv = grin_get_value_from_row(g, row, dt, k); if (dt == Int64) { @@ -613,9 +617,9 @@ void test_property_edge_table(int argc, char** argv) { *((double*) pv), *((double*) rv)); } grin_destroy_edge_property(g, ep); - grin_destroy_name(g, ep_name); - grin_destroy_value(g, dt, pv); - grin_destroy_value(g, dt, rv); + //grin_destroy_name(g, ep_name); + //grin_destroy_value(g, dt, pv); + //grin_destroy_value(g, dt, rv); } grin_destroy_row(g, row); @@ -646,8 +650,8 @@ void test_property_edge_table(int argc, char** argv) { et_name); grin_destroy_edge_type(g, et1); - grin_destroy_name(g, ep_name1); - grin_destroy_name(g, et_name); + //grin_destroy_name(g, ep_name1); + //grin_destroy_name(g, et_name); #ifdef GRIN_WITH_EDGE_PROPERTY_NAME const char* ep_name = grin_get_edge_property_name(g, et, ep); @@ -704,8 +708,8 @@ void test_property_edge_table(int argc, char** argv) { ep5_name); grin_destroy_edge_property(g, ep5); grin_destroy_edge_type(g, et5); - grin_destroy_name(g, et5_name); - grin_destroy_name(g, ep5_name); + //grin_destroy_name(g, et5_name); + //grin_destroy_name(g, ep5_name); } grin_destroy_edge_property_list(g, epl2); } @@ -735,7 +739,7 @@ void test_property_primary_key(int argc, char** argv) { GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, i); const char* vt_name = grin_get_vertex_type_name(g, vt); printf("vertex type name: %s\n", vt_name); - grin_destroy_name(g, vt_name); + //grin_destroy_name(g, vt_name); GRIN_VERTEX_PROPERTY_LIST vpl = grin_get_primary_keys_by_vertex_type(g, vt); size_t vpl_size = grin_get_vertex_property_list_size(g, vpl); @@ -745,29 +749,25 @@ void test_property_primary_key(int argc, char** argv) { GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, j); const char* vp_name = grin_get_vertex_property_name(g, vt, vp); printf("primary key name: %s\n", vp_name); - grin_destroy_name(g, vp_name); + //grin_destroy_name(g, vp_name); grin_destroy_vertex_property(g, vp); } GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, 0); - GRIN_DATATYPE dt = grin_get_vertex_property_data_type(g, vp); + GRIN_DATATYPE dt = grin_get_vertex_property_datatype(g, vp); for (size_t j = 1; j <= 6; ++j) { GRIN_ROW r = grin_create_row(g); - grin_insert_value_to_row(g, r, dt, (void*) (&j)); + if (dt == Int64) { + grin_insert_int64_to_row(g, r, j); + } else { + printf("(Wrong) the primary key type is not int64"); + } GRIN_VERTEX v = grin_get_vertex_by_primary_keys(g, vt, r); if (id_type[j] == i) { if (v == GRIN_NULL_VERTEX) { printf("(Wrong) vertex of primary keys %zu does not exist\n", j); } else { - GRIN_DATATYPE dt0 = grin_get_vertex_original_id_data_type(g); - const void* oid0 = grin_get_vertex_original_id_value(g, v); - if (dt0 == Int64) { - printf("(Correct) vertex of primary keys %zu exists %lld\n", j, - *((long long int*) oid0)); - } else { - printf("(Wrong) unmatch original id type\n"); - } grin_destroy_vertex(g, v); } } else { diff --git a/modules/graph/grin/c/test.sh b/modules/graph/grin/c/test.sh index 07af1b8ad..49642233a 100755 --- a/modules/graph/grin/c/test.sh +++ b/modules/graph/grin/c/test.sh @@ -5,5 +5,5 @@ # 4. in build folder, run: bin/vineyard-graph-loader --socket tmp.sock --config modern_graph/config.json rm -rf ./test -gcc test.c -I. -L/home/graphscope/gie-grin/v6d/build/shared-lib/ -lvineyard_grin -lvineyard_graph -lvineyard_basic -o test -./test /home/graphscope/gie-grin/v6d/build/tmp.sock 134785075056209698 \ No newline at end of file +gcc test.c -I. -L/workspaces/v6d/build/shared-lib/ -lvineyard_grin -lvineyard_graph -lvineyard_basic -o test +./test /workspaces/v6d/build/tmp.sock 4510456268948890 \ No newline at end of file diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 4a8d50196..9c7cf029d 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 4a8d50196dc82ef9355185a62a5dddfba664b7b6 +Subproject commit 9c7cf029de4e6936d5a8ca1254f066eec00b7ab5 diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index b1e954bfa..66e228146 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -83,13 +83,6 @@ typedef enum { */ #define GRIN_ASSUME_HAS_MULTI_EDGE_GRAPH -/** @ingroup TopologyMacros - * @brief There is original ID for a vertex. - * This facilitates queries starting from a specific vertex, - * since one can get the vertex handler directly using its original ID. - */ -#define GRIN_WITH_VERTEX_ORIGINAL_ID - /** @ingroup TopologyMacros * @brief There is data on vertex. E.g., the PageRank value of a vertex. */ @@ -161,7 +154,6 @@ typedef enum { #undef GRIN_ASSUME_HAS_DIRECTED_GRAPH #undef GRIN_ASSUME_HAS_UNDIRECTED_GRAPH #undef GRIN_ASSUME_HAS_MULTI_EDGE_GRAPH -#undef GRIN_WITH_VERTEX_ORIGINAL_ID #undef GRIN_WITH_VERTEX_DATA #undef GRIN_WITH_EDGE_DATA #undef GRIN_ENABLE_VERTEX_LIST @@ -179,7 +171,6 @@ typedef enum { #define GRIN_ASSUME_HAS_DIRECTED_GRAPH #define GRIN_ASSUME_HAS_UNDIRECTED_GRAPH #define GRIN_ASSUME_HAS_MULTI_EDGE_GRAPH -#define GRIN_WITH_VERTEX_ORIGINAL_ID #define GRIN_ENABLE_VERTEX_LIST #define GRIN_ENABLE_VERTEX_LIST_ARRAY #define GRIN_ENABLE_VERTEX_LIST_ITERATOR @@ -463,6 +454,11 @@ typedef enum { */ #define GRIN_ENABLE_ROW +/** @ingroup PropertyMacros + * @brief Enable the pure data structure Row, which is used in primary keys and tables. +*/ +#define GRIN_TRAIT_CONST_VALUE_PTR + /** @ingroup PropertyMacros * @brief There are properties bound to vertices. When vertices are typed, vertex * properties are bound to vertex types, according to the definition of vertex type. @@ -502,7 +498,7 @@ typedef enum { * * With primary keys, one can get the vertex from the graph or a certain type * by providing the values of the primary keys. The macro is unset if GRIN_WITH_VERTEX_PROPERTY - * is NOT defined, in which case, one can use GRIN_WITH_VERTEX_ORIGINAL_ID when vertices have + * is NOT defined, in which case, one can use ORIGINAL_ID when vertices have * no properties. */ #define GRIN_ENABLE_VERTEX_PRIMARY_KEYS @@ -514,12 +510,6 @@ typedef enum { */ #define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY -/** @ingroup PropertyMacros - * @brief Assume the original id is ONLY unique under each vertex type. This means - * to get a vertex from the original id, the caller must also provide the vertex type. -*/ -#define GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID - /** @ingroup PropertyMacros * @brief There are properties bound to edges. When edges are typed, edge @@ -560,8 +550,7 @@ typedef enum { * * With primary keys, one can get the edge from the graph or a certain type * by providing the values of the primary keys. The macro is unset if GRIN_WITH_EDGE_PROPERTY - * is NOT defined, in which case, one can use GRIN_WITH_EDGE_ORIGINAL_ID when edges have - * no properties. + * is NOT defined. */ #define GRIN_ENABLE_EDGE_PRIMARY_KEYS @@ -671,6 +660,7 @@ typedef enum { #ifndef GRIN_DOXYGEN_SKIP // GRIN_DEFAULT_DISABLE #undef GRIN_ENABLE_ROW +#undef GRIN_TRAIT_CONST_VALUE_PTR #undef GRIN_WITH_VERTEX_PROPERTY #undef GRIN_WITH_VERTEX_PROPERTY_NAME #undef GRIN_WITH_VERTEX_TYPE_NAME @@ -678,7 +668,6 @@ typedef enum { #undef GRIN_ENABLE_VERTEX_PROPERTY_TABLE #undef GRIN_ENABLE_VERTEX_PRIMARY_KEYS #undef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY -#undef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID #undef GRIN_WITH_EDGE_PROPERTY #undef GRIN_WITH_EDGE_PROPERTY_NAME #undef GRIN_WITH_EDGE_TYPE_NAME @@ -703,6 +692,7 @@ typedef enum { // GRIN_STORAGE_ENABLE #define GRIN_ENABLE_ROW +#define GRIN_TRAIT_CONST_VALUE_PTR #define GRIN_WITH_VERTEX_PROPERTY #define GRIN_WITH_VERTEX_PROPERTY_NAME #define GRIN_WITH_VERTEX_TYPE_NAME @@ -710,7 +700,6 @@ typedef enum { #define GRIN_ENABLE_VERTEX_PROPERTY_TABLE #define GRIN_ENABLE_VERTEX_PRIMARY_KEYS #define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY -#define GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID #define GRIN_WITH_EDGE_PROPERTY #define GRIN_WITH_EDGE_PROPERTY_NAME #define GRIN_WITH_EDGE_TYPE_NAME @@ -790,15 +779,37 @@ typedef enum { #define GRIN_ASSUME_ALL_VERTEX_LIST_SORTED ///@} +/** @name IndexOIDMacros + * @brief Macros for label features + */ +///@{ +/** @ingroup IndexOIDMacros + * @brief There is original ID of type int64 for each vertex + * This facilitates queries starting from a specific vertex, + * since one can get the vertex handler directly using its original ID. + */ +#define GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_INT64 + +/** @ingroup IndexOIDMacros + * @brief There is original ID of type string for each vertex + * This facilitates queries starting from a specific vertex, + * since one can get the vertex handler directly using its original ID. + */ +#define GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_STRING +///@} + #ifndef GRIN_DOXYGEN_SKIP // GRIN_DEFAULT_DISABLE #undef GRIN_WITH_VERTEX_LABEL #undef GRIN_WITH_EDGE_LABEL #undef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED +#undef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_INT64 +#undef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_STRING // GRIN_END // GRIN_STORAGE_ENABLE #define GRIN_ASSUME_ALL_VERTEX_LIST_SORTED +#define GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_INT64 // GRIN_END // GRIN_FEATURE_DEPENDENCY @@ -851,10 +862,6 @@ typedef void* GRIN_GRAPH; typedef void* GRIN_VERTEX; typedef void* GRIN_EDGE; -#ifdef GRIN_WITH_VERTEX_ORIGINAL_ID -typedef void* GRIN_VERTEX_ORIGINAL_ID; -#endif - #ifdef GRIN_WITH_VERTEX_DATA typedef void* GRIN_VERTEX_DATA; #endif diff --git a/modules/graph/grin/src/index/original_id.cc b/modules/graph/grin/src/index/original_id.cc new file mode 100644 index 000000000..6f867ecd5 --- /dev/null +++ b/modules/graph/grin/src/index/original_id.cc @@ -0,0 +1,48 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "graph/grin/src/predefine.h" + +extern "C" { +#include "graph/grin/include/index/original_id.h" +} + +GRIN_DATATYPE grin_get_vertex_original_id_datatype(GRIN_GRAPH g) { + return GRIN_DATATYPE_ENUM<_GRIN_GRAPH_T::oid_t>::value; +} + +#ifdef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_INT64 +long long int grin_get_vertex_original_id_of_int64(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g)->g; + auto _v = static_cast(v); + auto gid = _g->Vertex2Gid(*_v); + return _g->Gid2Oid(gid); +} + +GRIN_VERTEX grin_get_vertex_by_original_id_of_int64(GRIN_GRAPH g, long long int oid) { + auto _g = static_cast(g)->g; + _GRIN_GRAPH_T::vid_t gid; + auto v = new GRIN_VERTEX_T(); + if (_g->Oid2Gid(0, oid, gid)) { + if (_g->Gid2Vertex(gid, *v)) { + return v; + } + } + return GRIN_NULL_VERTEX; +} +#endif + +#ifdef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_STRING +const char* grin_get_vertex_original_id_of_string(GRIN_GRAPH, GRIN_VERTEX); + +GRIN_VERTEX grin_get_vertex_by_original_id_of_string(GRIN_GRAPH, const char*); +#endif diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 4649b85a3..3a60dc618 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -14,6 +14,9 @@ limitations under the License. */ #include "graph/grin/src/predefine.h" +extern "C" { +#include "graph/grin/include/common/error.h" +} std::string GetDataTypeName(GRIN_DATATYPE type) { switch (type) { @@ -65,6 +68,39 @@ GRIN_DATATYPE ArrowToDataType(std::shared_ptr type) { return GRIN_DATATYPE::Undefined; } +const void* _get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + auto _v = static_cast(v); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; + return NULL; + } + auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); + return vineyard::get_arrow_array_data_element(array, offset); +} + +const void* _get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; + auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); + auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; + return NULL; + } + auto offset = _e->eid; + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); + return vineyard::get_arrow_array_data_element(array, offset); +} + + #ifdef GRIN_ENABLE_VERTEX_LIST void __grin_init_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { vl->offsets.clear(); diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 16e0f4c31..fb126f24d 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -78,8 +78,13 @@ struct GRIN_DATATYPE_ENUM { }; std::string GetDataTypeName(GRIN_DATATYPE); + GRIN_DATATYPE ArrowToDataType(std::shared_ptr); +const void* _get_value_from_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY); + +const void* _get_value_from_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY); + unsigned long long int _grin_create_property(unsigned, unsigned); unsigned _grin_get_type_from_property(unsigned long long int); @@ -106,10 +111,6 @@ struct GRIN_EDGE_T { _GRIN_GRAPH_T::eid_t eid; }; -#ifdef GRIN_WITH_VERTEX_ORIGINAL_ID -typedef _GRIN_GRAPH_T::oid_t VERTEX_ORIGINAL_ID_T; -#endif - #ifdef GRIN_ENABLE_VERTEX_LIST struct GRIN_VERTEX_LIST_T { unsigned type_begin; diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index e0ef351bf..a895aafcc 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -97,7 +97,7 @@ bool grin_equal_vertex_property(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp1, GRIN_VER void grin_destroy_vertex_property(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) {} -GRIN_DATATYPE grin_get_vertex_property_data_type(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { +GRIN_DATATYPE grin_get_vertex_property_datatype(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { auto _g = static_cast(g)->g; auto dt = _g->schema().GetVertexPropertyType(_grin_get_type_from_property(vp), _grin_get_prop_from_property(vp)); return ArrowToDataType(dt); @@ -116,7 +116,7 @@ bool grin_equal_edge_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep1, GRIN_EDGE_PR void grin_destroy_edge_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) {} -GRIN_DATATYPE grin_get_edge_property_data_type(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { +GRIN_DATATYPE grin_get_edge_property_datatype(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { auto _g = static_cast(g)->g; auto dt = _g->schema().GetEdgePropertyType(_grin_get_type_from_property(ep), _grin_get_prop_from_property(ep)); return ArrowToDataType(dt); diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index db6bd0482..e484fe9c1 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -16,46 +16,14 @@ extern "C" { #include "graph/grin/include/common/error.h" } +void grin_destroy_string_value(GRIN_GRAPH g, const char* value) {} + #ifdef GRIN_ENABLE_ROW void grin_destroy_row(GRIN_GRAPH g, GRIN_ROW r) { auto _r = static_cast(r); delete _r; } -const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, size_t idx) { - auto _r = static_cast(r); - switch (dt) { - case GRIN_DATATYPE::Int32: - return new int32_t(*static_cast((*_r)[idx])); - case GRIN_DATATYPE::UInt32: - return new uint32_t(*static_cast((*_r)[idx])); - case GRIN_DATATYPE::Int64: - return new int64_t(*static_cast((*_r)[idx])); - case GRIN_DATATYPE::UInt64: - return new uint64_t(*static_cast((*_r)[idx])); - case GRIN_DATATYPE::Float: - return new float(*static_cast((*_r)[idx])); - case GRIN_DATATYPE::Double: - return new double(*static_cast((*_r)[idx])); - case GRIN_DATATYPE::String: { - auto s = static_cast((*_r)[idx]); - int len = s->length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s->c_str()); - return out; - } - case GRIN_DATATYPE::Date32: - return new int32_t(*static_cast((*_r)[idx])); - case GRIN_DATATYPE::Time32: - return new int32_t(*static_cast((*_r)[idx])); - case GRIN_DATATYPE::Timestamp64: - return new int64_t(*static_cast((*_r)[idx])); - default: - return NULL; - } - return NULL; -} - int grin_get_int32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { auto _r = static_cast(r); return *static_cast((*_r)[idx]); @@ -115,48 +83,6 @@ GRIN_ROW grin_create_row(GRIN_GRAPH g) { return r; } -bool grin_insert_value_to_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, const void* value) { - auto _r = static_cast(r); - void* _value = NULL; - switch (dt) { - case GRIN_DATATYPE::Int32: - _value = new int32_t(*static_cast(value)); - break; - case GRIN_DATATYPE::UInt32: - _value = new uint32_t(*static_cast(value)); - break; - case GRIN_DATATYPE::Int64: - _value = new int64_t(*static_cast(value)); - break; - case GRIN_DATATYPE::UInt64: - _value = new uint64_t(*static_cast(value)); - break; - case GRIN_DATATYPE::Float: - _value = new float(*static_cast(value)); - break; - case GRIN_DATATYPE::Double: - _value = new double(*static_cast(value)); - break; - case GRIN_DATATYPE::String: - _value = new std::string(*static_cast(value)); - break; - case GRIN_DATATYPE::Date32: - _value = new int32_t(*static_cast(value)); - break; - case GRIN_DATATYPE::Time32: - _value = new int32_t(*static_cast(value)); - break; - case GRIN_DATATYPE::Timestamp64: - _value = new int64_t(*static_cast(value)); - break; - default: - _value = NULL; - } - _r->push_back(_value); - return true; -} -#endif - bool grin_insert_int32_to_row(GRIN_GRAPH g, GRIN_ROW r, int value) { auto _r = static_cast(r); _r->push_back(new int32_t(value)); @@ -215,243 +141,152 @@ bool grin_insert_timestamp64_to_row(GRIN_GRAPH g, GRIN_ROW r, long long int valu _r->push_back(new int64_t(value)); return true; } +#endif -#ifdef GRIN_ENABLE_VERTEX_PROPERTY_TABLE -void grin_destroy_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt) { - auto _vpt = static_cast(vpt); - delete _vpt; -} - -GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { - auto _g = static_cast(g)->g; - auto vpt = new GRIN_VERTEX_PROPERTY_TABLE_T(); - vpt->vtype = vtype; - vpt->vertices = _g->InnerVertices(vtype); - return vpt; -} - -const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, - GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return NULL; - } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - auto _dt = _g->schema().GetVertexPropertyType(vtype, vprop); - auto dt = ArrowToDataType(_dt); +#if defined(GRIN_ENABLE_ROW) && defined(GRIN_TRAIT_CONST_VALUE_PTR) +const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, size_t idx) { + auto _r = static_cast(r); switch (dt) { case GRIN_DATATYPE::Int32: - return new int32_t(*static_cast(result)); + return static_cast((*_r)[idx]); case GRIN_DATATYPE::UInt32: - return new uint32_t(*static_cast(result)); + return static_cast((*_r)[idx]); case GRIN_DATATYPE::Int64: - return new int64_t(*static_cast(result)); + return static_cast((*_r)[idx]); case GRIN_DATATYPE::UInt64: - return new uint64_t(*static_cast(result)); + return static_cast((*_r)[idx]); case GRIN_DATATYPE::Float: - return new float(*static_cast(result)); + return static_cast((*_r)[idx]); case GRIN_DATATYPE::Double: - return new double(*static_cast(result)); - case GRIN_DATATYPE::String: - { - auto s = static_cast(result); - int len = s->length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s->c_str()); - return out; + return static_cast((*_r)[idx]); + case GRIN_DATATYPE::String: { + auto s = static_cast((*_r)[idx]); + return s->c_str(); } case GRIN_DATATYPE::Date32: - return new int32_t(*static_cast(result)); + return static_cast((*_r)[idx]); case GRIN_DATATYPE::Time32: - return new int32_t(*static_cast(result)); + return static_cast((*_r)[idx]); case GRIN_DATATYPE::Timestamp64: - return new int64_t(*static_cast(result)); + return static_cast((*_r)[idx]); default: - grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; return NULL; } + return NULL; } +#endif -int grin_get_int32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; +#ifdef GRIN_ENABLE_VERTEX_PROPERTY_TABLE +void grin_destroy_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt) { auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + delete _vpt; +} + +GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { + auto _g = static_cast(g)->g; + auto vpt = new GRIN_VERTEX_PROPERTY_TABLE_T(); + vpt->vtype = vtype; + vpt->vertices = _g->InnerVertices(vtype); + return vpt; +} + +int grin_get_int32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return 0; return *static_cast(result); } unsigned int grin_get_uint32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return 0; return *static_cast(result); } long long int grin_get_int64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return 0; return *static_cast(result); } unsigned long long int grin_get_uint64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return 0; return *static_cast(result); } float grin_get_float_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return 0; return *static_cast(result); } double grin_get_double_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return 0; return *static_cast(result); } const char* grin_get_string_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return NULL; - } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - auto s = static_cast(result); - int len = s->length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s->c_str()); - return out; + const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return NULL; + return static_cast(result)->c_str(); } int grin_get_date32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return 0; return *static_cast(result); } int grin_get_time32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return 0; return *static_cast(result); } long long int grin_get_timestamp64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; + const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return 0; + return *static_cast(result); +} +#endif + +#if defined(GRIN_ENABLE_VERTEX_PROPERTY_TABLE) && defined(GRIN_TRAIT_CONST_VALUE_PTR) +const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, + GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + + auto result = _get_value_from_vertex_property_table(g, vpt, v, vp); + if (result == NULL) return NULL; auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _v = static_cast(v); unsigned vtype = _grin_get_type_from_property(vp); unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; + auto _dt = _g->schema().GetVertexPropertyType(vtype, vprop); + auto dt = ArrowToDataType(_dt); + switch (dt) { + case GRIN_DATATYPE::Int32: + return static_cast(result); + case GRIN_DATATYPE::UInt32: + return static_cast(result); + case GRIN_DATATYPE::Int64: + return static_cast(result); + case GRIN_DATATYPE::UInt64: + return static_cast(result); + case GRIN_DATATYPE::Float: + return static_cast(result); + case GRIN_DATATYPE::Double: + return static_cast(result); + case GRIN_DATATYPE::String: + return static_cast(result)->c_str(); + case GRIN_DATATYPE::Date32: + return new int32_t(*static_cast(result)); + case GRIN_DATATYPE::Time32: + return new int32_t(*static_cast(result)); + case GRIN_DATATYPE::Timestamp64: + return new int64_t(*static_cast(result)); + default: + grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; + return NULL; } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - return *static_cast(result); } #endif @@ -501,231 +336,106 @@ GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH g, GRIN return ept; } -const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, - GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return NULL; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - auto _dt = _g->schema().GetEdgePropertyType(etype, eprop); - auto dt = ArrowToDataType(_dt); - switch (dt) { - case GRIN_DATATYPE::Int32: - return new int32_t(*static_cast(result)); - case GRIN_DATATYPE::UInt32: - return new uint32_t(*static_cast(result)); - case GRIN_DATATYPE::Int64: - return new int64_t(*static_cast(result)); - case GRIN_DATATYPE::UInt64: - return new uint64_t(*static_cast(result)); - case GRIN_DATATYPE::Float: - return new float(*static_cast(result)); - case GRIN_DATATYPE::Double: - return new double(*static_cast(result)); - case GRIN_DATATYPE::String: - { - auto s = static_cast(result); - int len = s->length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s->c_str()); - return out; - } - case GRIN_DATATYPE::Date32: - return new int32_t(*static_cast(result)); - case GRIN_DATATYPE::Time32: - return new int32_t(*static_cast(result)); - case GRIN_DATATYPE::Timestamp64: - return new int64_t(*static_cast(result)); - default: - grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; - return NULL; - } -} - int grin_get_int32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return 0; return *static_cast(result); } unsigned int grin_get_uint32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return 0; return *static_cast(result); } long long int grin_get_int64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return 0; return *static_cast(result); } unsigned long long int grin_get_uint64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return 0; return *static_cast(result); } float grin_get_float_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return 0; return *static_cast(result); } double grin_get_double_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return 0; return *static_cast(result); } const char* grin_get_string_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return NULL; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - auto s = static_cast(result); - int len = s->length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s->c_str()); - return out; + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return NULL; + return static_cast(result)->c_str(); } int grin_get_date32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return 0; return *static_cast(result); } int grin_get_time32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return 0; return *static_cast(result); } long long int grin_get_timestamp64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return 0; + return *static_cast(result); +} +#endif + +#if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_TRAIT_CONST_VALUE_PTR) +const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, + GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, ept, e, ep); + if (result == NULL) return NULL; auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); + unsigned etype = _grin_get_type_from_property(ep); unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return 0; + auto _dt = _g->schema().GetEdgePropertyType(etype, eprop); + auto dt = ArrowToDataType(_dt); + switch (dt) { + case GRIN_DATATYPE::Int32: + return static_cast(result); + case GRIN_DATATYPE::UInt32: + return static_cast(result); + case GRIN_DATATYPE::Int64: + return static_cast(result); + case GRIN_DATATYPE::UInt64: + return static_cast(result); + case GRIN_DATATYPE::Float: + return static_cast(result); + case GRIN_DATATYPE::Double: + return static_cast(result); + case GRIN_DATATYPE::String: + return static_cast(result)->c_str(); + case GRIN_DATATYPE::Date32: + return static_cast(result); + case GRIN_DATATYPE::Time32: + return static_cast(result); + case GRIN_DATATYPE::Timestamp64: + return static_cast(result); + default: + grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; + return NULL; } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - return *static_cast(result); } #endif + #if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY_LIST epl) { diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index 7abd71bf8..3ea5737d8 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -29,21 +29,6 @@ size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { } #endif -#ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID -GRIN_VERTEX grin_get_vertex_by_original_id_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_DATATYPE dt, const void* oid) { - auto _g = static_cast(g)->g; - auto _oid = static_cast(oid); - _GRIN_GRAPH_T::vid_t gid; - auto v = new GRIN_VERTEX_T(); - if (_g->Oid2Gid(vtype, *_oid, gid)) { - if (_g->Gid2Vertex(gid, *v)) { - return v; - } - } - return GRIN_NULL_VERTEX; -} -#endif - #ifdef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST GRIN_VERTEX_LIST grin_select_type_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_LIST vl) { auto _g = static_cast(g)->g; diff --git a/modules/graph/grin/src/proto/message.cc b/modules/graph/grin/src/proto/message.cc index b0aedee94..03e446f39 100644 --- a/modules/graph/grin/src/proto/message.cc +++ b/modules/graph/grin/src/proto/message.cc @@ -40,10 +40,6 @@ const char* grin_get_static_storage_feature_msg() { feature->set_grin_assume_has_multi_edge_graph(true); #endif -#ifdef GRIN_WITH_VERTEX_ORIGINAL_ID - feature->set_grin_with_vertex_original_id(true); -#endif - #ifdef GRIN_WITH_VERTEX_DATA feature->set_grin_with_vertex_data(true); #endif @@ -247,10 +243,6 @@ const char* grin_get_static_storage_feature_msg() { vfeature->set_grin_trait_natural_id_for_vertex_property(true); #endif -#ifdef GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID - vfeature->set_grin_assume_by_type_vertex_original_id(true); -#endif - auto efeature = feature->mutable_edge_property_feature(); #ifdef GRIN_WITH_EDGE_PROPERTY efeature->set_grin_with_edge_property(true); @@ -307,6 +299,10 @@ const char* grin_get_static_storage_feature_msg() { #ifdef GRIN_TRAIT_SPECIFIC_VEV_RELATION feature->set_grin_trait_specific_vev_relation(true); #endif + +#ifdef GRIN_TRAIT_CONST_VALUE_PTR + feature->set_grin_trait_const_value_ptr(true); +#endif } { @@ -323,6 +319,14 @@ const char* grin_get_static_storage_feature_msg() { #ifdef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED feature->set_grin_assume_all_vertex_list_sorted(true); #endif + +#ifdef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_INT64 + feature->set_grin_enable_vertex_original_id_of_int64(true); +#endif + +#ifdef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_STRING + feature->set_grin_enable_vertex_original_id_of_string(true); +#endif } std::string graph_def; diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 89e8c74aa..1bf954059 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -82,70 +82,9 @@ bool grin_equal_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { return _g->Vertex2Gid(*_v1) == _g->Vertex2Gid(*_v2); } - -#ifdef GRIN_WITH_VERTEX_ORIGINAL_ID - -GRIN_DATATYPE grin_get_vertex_original_id_data_type(GRIN_GRAPH g) { - return GRIN_DATATYPE_ENUM::value; -} - -const void* grin_get_vertex_original_id_value(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g)->g; - auto _v = static_cast(v); - auto gid = _g->Vertex2Gid(*_v); - auto oid = new VERTEX_ORIGINAL_ID_T(_g->Gid2Oid(gid)); - return oid; -} -#endif - -#if defined(GRIN_WITH_VERTEX_ORIGINAL_ID) && !defined(GRIN_ASSUME_BY_TYPE_VERTEX_ORIGINAL_ID) -GRIN_VERTEX grin_get_vertex_by_original_id(GRIN_GRAPH, GRIN_DATATYPE, const void*); -#endif - // Data -void grin_destroy_value(GRIN_GRAPH g, GRIN_DATATYPE dt, const void* value) { - switch (dt) { - case GRIN_DATATYPE::Int32: - delete static_cast(value); - break; - case GRIN_DATATYPE::UInt32: - delete static_cast(value); - break; - case GRIN_DATATYPE::Int64: - delete static_cast(value); - break; - case GRIN_DATATYPE::UInt64: - delete static_cast(value); - break; - case GRIN_DATATYPE::Float: - delete static_cast(value); - break; - case GRIN_DATATYPE::Double: - delete static_cast(value); - break; - case GRIN_DATATYPE::String: - delete static_cast(value); - break; - case GRIN_DATATYPE::Date32: - delete static_cast(value); - break; - case GRIN_DATATYPE::Time32: - delete static_cast(value); - break; - case GRIN_DATATYPE::Timestamp64: - delete static_cast(value); - break; - default: - break; - } -} - -void grin_destroy_name(GRIN_GRAPH g, const char* name) { - delete[] name; -} - #ifdef GRIN_WITH_VERTEX_DATA -GRIN_DATATYPE grin_get_vertex_data_type(GRIN_GRAPH, GRIN_VERTEX); +GRIN_DATATYPE grin_get_vertex_data_datatype(GRIN_GRAPH, GRIN_VERTEX); const void* grin_get_vertex_data_value(GRIN_GRAPH, GRIN_VERTEX); #endif @@ -169,7 +108,7 @@ GRIN_VERTEX grin_get_dst_vertex_from_edge(GRIN_GRAPH g, GRIN_EDGE e) { } #ifdef GRIN_WITH_EDGE_DATA -GRIN_DATATYPE grin_get_edge_data_type(GRIN_GRAPH, GRIN_EDGE); +GRIN_DATATYPE grin_get_edge_data_datatype(GRIN_GRAPH, GRIN_EDGE); const void* grin_get_edge_data_value(GRIN_GRAPH, GRIN_EDGE); #endif \ No newline at end of file From 958146144713cf1f268f6b69714b070b1d21f7a5 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 15 May 2023 08:42:01 +0000 Subject: [PATCH 69/85] fix grin include --- modules/graph/grin/include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 9c7cf029d..44ee2e923 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 9c7cf029de4e6936d5a8ca1254f066eec00b7ab5 +Subproject commit 44ee2e923bb9d31d2a8a3eb1a2075f9f970b9a17 From 97d743535e634f1b6c65d7ba7621c3763c9f485c Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 15 May 2023 12:53:59 +0000 Subject: [PATCH 70/85] small fixes --- modules/graph/grin/c/test.c | 100 ++++++++++++----- modules/graph/grin/c/test.sh | 9 -- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 4 +- modules/graph/grin/rust/Cargo.toml | 7 +- modules/graph/grin/rust/grin_v6d.rs | 106 ++++++------------ .../graph/grin/src/topology/adjacentlist.cc | 2 +- 7 files changed, 117 insertions(+), 113 deletions(-) delete mode 100755 modules/graph/grin/c/test.sh diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index e0de71076..e0163bfa1 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -103,7 +103,7 @@ void test_property_type(int argc, char** argv) { const char* vt_name = grin_get_vertex_type_name(g, vt); printf("vertex type name: %s\n", vt_name); GRIN_VERTEX_TYPE vt0 = grin_get_vertex_type_by_name(g, vt_name); - //grin_destroy_name(g, vt_name); + // grin_destroy_name(g, vt_name); if (!grin_equal_vertex_type(g, vt, vt0)) { printf("vertex type name not match\n"); } @@ -136,7 +136,7 @@ void test_property_type(int argc, char** argv) { } else { const char* vt2_name = grin_get_vertex_type_name(g, vt2); printf("vertex type name: %s\n", vt2_name); - //grin_destroy_name(g, vt2_name); + // grin_destroy_name(g, vt2_name); } #else GRIN_VERTEX_TYPE vt2 = get_one_vertex_type(g); @@ -165,7 +165,7 @@ void test_property_type(int argc, char** argv) { const char* et_name = grin_get_edge_type_name(g, et); printf("edge type name: %s\n", et_name); GRIN_EDGE_TYPE et0 = grin_get_edge_type_by_name(g, et_name); - //grin_destroy_name(g, et_name); + // grin_destroy_name(g, et_name); if (!grin_equal_edge_type(g, et, et0)) { printf("edge type name not match\n"); } @@ -199,9 +199,9 @@ void test_property_type(int argc, char** argv) { const char* dst_vt_name = grin_get_vertex_type_name(g, dst_vt); const char* et_name = grin_get_edge_type_name(g, et); printf("edge type name: %s-%s-%s\n", src_vt_name, et_name, dst_vt_name); - //grin_destroy_name(g, src_vt_name); - //grin_destroy_name(g, dst_vt_name); - //grin_destroy_name(g, et_name); + // grin_destroy_name(g, src_vt_name); + // grin_destroy_name(g, dst_vt_name); + // grin_destroy_name(g, et_name); grin_destroy_vertex_type(g, src_vt); grin_destroy_vertex_type(g, dst_vt); } @@ -225,7 +225,7 @@ void test_property_type(int argc, char** argv) { } else { const char* et2_name = grin_get_edge_type_name(g, et2); printf("edge type name: %s\n", et2_name); - //grin_destroy_name(g, et2_name); + // grin_destroy_name(g, et2_name); } #else GRIN_EDGE_TYPE et2 = get_one_edge_type(g); @@ -366,8 +366,8 @@ void test_property_topology(int argc, char** argv) { grin_destroy_edge_list(g, el); #endif - //grin_destroy_name(g, vt_name); - //grin_destroy_name(g, et_name); + // grin_destroy_name(g, vt_name); + // grin_destroy_name(g, et_name); grin_destroy_vertex_type(g, vt); grin_destroy_edge_type(g, et); grin_destroy_graph(g); @@ -443,6 +443,7 @@ void test_property_vertex_table(int argc, char** argv) { const char* vp_name = "unknown"; #endif GRIN_DATATYPE dt = grin_get_vertex_property_datatype(g, vp); +#ifdef GRIN_TRAIT_CONST_VALUE_PTR const void* pv = grin_get_value_from_vertex_property_table(g, vpt, v, vp); if (grin_get_last_error_code() == NO_ERROR) { @@ -458,8 +459,33 @@ void test_property_vertex_table(int argc, char** argv) { printf("vp_id %u v%zu %s value: %s %s\n", id, i, vp_name, (char*) pv, (char*) rv); } - //grin_destroy_value(g, dt, pv); - //grin_destroy_value(g, dt, rv); + // grin_destroy_value(g, dt, pv); + // grin_destroy_value(g, dt, rv); +#else + if (dt == Int64) { + long long int pv = + grin_get_int64_from_vertex_property_table(g, vpt, v, vp); + if (grin_get_last_error_code() == NO_ERROR) { + printf("(Correct) no error\n"); + } else { + printf("(Wrong) error code: %d\n", grin_get_last_error_code()); + } + long long int rv = grin_get_int64_from_row(g, row, j); + printf("vp_id %u v%zu %s value: %lld %lld\n", id, i, vp_name, pv, rv); + } else if (dt == String) { + const char* pv = + grin_get_string_from_vertex_property_table(g, vpt, v, vp); + if (grin_get_last_error_code() == NO_ERROR) { + printf("(Correct) no error\n"); + } else { + printf("(Wrong) error code: %d\n", grin_get_last_error_code()); + } + const char* rv = grin_get_string_from_row(g, row, j); + printf("vp_id %u v%zu %s value: %s %s\n", id, i, vp_name, pv, rv); + grin_destroy_string_value(g, pv); + grin_destroy_string_value(g, rv); + } +#endif grin_destroy_vertex_property(g, vp); } grin_destroy_row(g, row); @@ -474,8 +500,7 @@ void test_property_vertex_table(int argc, char** argv) { #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY - GRIN_VERTEX_PROPERTY vp3 = - grin_get_vertex_property_by_id(g, vt, vpl_size); + GRIN_VERTEX_PROPERTY vp3 = grin_get_vertex_property_by_id(g, vt, vpl_size); if (vp3 == GRIN_NULL_VERTEX_PROPERTY) { printf("(Correct) vertex property of id %zu does not exist\n", vpl_size); } else { @@ -521,8 +546,8 @@ void test_property_vertex_table(int argc, char** argv) { vp5_name); grin_destroy_vertex_property(g, vp5); grin_destroy_vertex_type(g, vt5); - //grin_destroy_name(g, vt5_name); - //grin_destroy_name(g, vp5_name); + // grin_destroy_name(g, vt5_name); + // grin_destroy_name(g, vp5_name); } grin_destroy_vertex_property_list(g, vpl2); } @@ -604,6 +629,7 @@ void test_property_edge_table(int argc, char** argv) { unsigned int id = ~0; #endif GRIN_DATATYPE dt = grin_get_edge_property_datatype(g, ep); +#ifdef GRIN_TRAIT_CONST_VALUE_PTR const void* pv = grin_get_value_from_edge_property_table(g, ept, e, ep); const void* rv = grin_get_value_from_row(g, row, dt, k); if (dt == Int64) { @@ -617,9 +643,28 @@ void test_property_edge_table(int argc, char** argv) { *((double*) pv), *((double*) rv)); } grin_destroy_edge_property(g, ep); - //grin_destroy_name(g, ep_name); - //grin_destroy_value(g, dt, pv); - //grin_destroy_value(g, dt, rv); + // grin_destroy_name(g, ep_name); + // grin_destroy_value(g, dt, pv); + // grin_destroy_value(g, dt, rv); +#else + if (dt == Int64) { + long long int pv = + grin_get_int64_from_edge_property_table(g, ept, e, ep); + long long int rv = grin_get_int64_from_row(g, row, k); + printf("ep_id %u e%zu %s value: %lld %lld\n", id, j, ep_name, pv, rv); + } else if (dt == String) { + const char* pv = + grin_get_string_from_edge_property_table(g, ept, e, ep); + const char* rv = grin_get_string_from_row(g, row, k); + printf("ep_id %u e%zu %s value: %s %s\n", id, j, ep_name, pv, rv); + grin_destroy_string_value(g, pv); + grin_destroy_string_value(g, rv); + } else if (dt == Double) { + double pv = grin_get_double_from_edge_property_table(g, ept, e, ep); + double rv = grin_get_double_from_row(g, row, k); + printf("ep_id %u e%zu %s value: %f %f\n", id, j, ep_name, pv, rv); + } +#endif } grin_destroy_row(g, row); @@ -650,8 +695,8 @@ void test_property_edge_table(int argc, char** argv) { et_name); grin_destroy_edge_type(g, et1); - //grin_destroy_name(g, ep_name1); - //grin_destroy_name(g, et_name); + // grin_destroy_name(g, ep_name1); + // grin_destroy_name(g, et_name); #ifdef GRIN_WITH_EDGE_PROPERTY_NAME const char* ep_name = grin_get_edge_property_name(g, et, ep); @@ -708,8 +753,8 @@ void test_property_edge_table(int argc, char** argv) { ep5_name); grin_destroy_edge_property(g, ep5); grin_destroy_edge_type(g, et5); - //grin_destroy_name(g, et5_name); - //grin_destroy_name(g, ep5_name); + // grin_destroy_name(g, et5_name); + // grin_destroy_name(g, ep5_name); } grin_destroy_edge_property_list(g, epl2); } @@ -739,7 +784,7 @@ void test_property_primary_key(int argc, char** argv) { GRIN_VERTEX_TYPE vt = grin_get_vertex_type_from_list(g, vtl, i); const char* vt_name = grin_get_vertex_type_name(g, vt); printf("vertex type name: %s\n", vt_name); - //grin_destroy_name(g, vt_name); + // grin_destroy_name(g, vt_name); GRIN_VERTEX_PROPERTY_LIST vpl = grin_get_primary_keys_by_vertex_type(g, vt); size_t vpl_size = grin_get_vertex_property_list_size(g, vpl); @@ -749,7 +794,7 @@ void test_property_primary_key(int argc, char** argv) { GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, j); const char* vp_name = grin_get_vertex_property_name(g, vt, vp); printf("primary key name: %s\n", vp_name); - //grin_destroy_name(g, vp_name); + // grin_destroy_name(g, vp_name); grin_destroy_vertex_property(g, vp); } @@ -794,10 +839,15 @@ void test_error_code(int argc, char** argv) { GRIN_VERTEX_TYPE vt1 = grin_get_vertex_type_by_name(g, "person"); GRIN_VERTEX_TYPE vt2 = grin_get_vertex_type_by_name(g, "software"); GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_by_name(g, vt2, "lang"); - GRIN_VERTEX_PROPERTY_TABLE vpt = grin_get_vertex_property_table_by_type(g, vt1); + GRIN_VERTEX_PROPERTY_TABLE vpt = + grin_get_vertex_property_table_by_type(g, vt1); GRIN_VERTEX v = get_one_vertex(g); +#ifdef GRIN_TRAIT_CONST_VALUE_PTR const void* value = grin_get_value_from_vertex_property_table(g, vpt, v, vp); +#else + const char* value = grin_get_string_from_vertex_property_table(g, vpt, v, vp); +#endif if (grin_get_last_error_code() == INVALID_VALUE) { printf("(Correct) invalid value\n"); } else { diff --git a/modules/graph/grin/c/test.sh b/modules/graph/grin/c/test.sh deleted file mode 100755 index 49642233a..000000000 --- a/modules/graph/grin/c/test.sh +++ /dev/null @@ -1,9 +0,0 @@ -# launch vineyardd & load modern graph -# 1. copy modern_graph folder from GraphScope/charts/gie-standalone/data to build -# 2. copy v6d_modern_loader to modern_graph folder -# 3. in build folder, run: bin/vineyardd --socket tmp.sock -# 4. in build folder, run: bin/vineyard-graph-loader --socket tmp.sock --config modern_graph/config.json - -rm -rf ./test -gcc test.c -I. -L/workspaces/v6d/build/shared-lib/ -lvineyard_grin -lvineyard_graph -lvineyard_basic -o test -./test /workspaces/v6d/build/tmp.sock 4510456268948890 \ No newline at end of file diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 44ee2e923..0d452226a 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 44ee2e923bb9d31d2a8a3eb1a2075f9f970b9a17 +Subproject commit 0d452226a9225669985d303722b0947837c77705 diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 66e228146..e28901564 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -822,8 +822,6 @@ typedef enum { * Macros for Null(invalid) values */ ///@{ -/** @brief Null data type (undefined data type) */ -#define GRIN_NULL_DATATYPE Undefined /** @brief Null graph (invalid return value) */ #define GRIN_NULL_GRAPH NULL /** @brief Non-existing vertex (invalid return value) */ @@ -854,6 +852,8 @@ typedef enum { #define GRIN_NULL_NATURAL_ID (unsigned)~0 /** @brief Null size (invalid return value) */ #define GRIN_NULL_SIZE (unsigned)~0 +/** @breif Null name (invalid return value) */ +#define GRIN_NULL_NAME NULL ///@} diff --git a/modules/graph/grin/rust/Cargo.toml b/modules/graph/grin/rust/Cargo.toml index 04cf09129..cec24144c 100644 --- a/modules/graph/grin/rust/Cargo.toml +++ b/modules/graph/grin/rust/Cargo.toml @@ -4,11 +4,10 @@ version = "0.1.0" authors = ["dijie"] [features] -default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_with_vertex_original_id", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_trait_fast_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_property_table", "grin_enable_vertex_primary_keys", "grin_trait_natural_id_for_vertex_property", "grin_assume_by_type_vertex_original_id", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_enable_edge_property_table", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_column_store_for_vertex_property", "grin_assume_column_store_for_edge_property", "grin_assume_all_vertex_list_sorted"] +default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_trait_fast_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_trait_const_value_ptr", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_property_table", "grin_enable_vertex_primary_keys", "grin_trait_natural_id_for_vertex_property", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_enable_edge_property_table", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_column_store_for_vertex_property", "grin_assume_column_store_for_edge_property", "grin_assume_all_vertex_list_sorted", "grin_enable_vertex_original_id_of_int64"] grin_assume_has_directed_graph = [] grin_assume_has_undirected_graph = [] grin_assume_has_multi_edge_graph = [] -grin_with_vertex_original_id = [] grin_with_vertex_data = [] grin_with_edge_data = [] grin_enable_vertex_list = [] @@ -45,6 +44,7 @@ grin_trait_select_partition_for_edge_list = [] grin_trait_select_master_neighbor_for_adjacent_list = [] grin_trait_select_neighbor_partition_for_adjacent_list = [] grin_enable_row = [] +grin_trait_const_value_ptr = [] grin_with_vertex_property = [] grin_with_vertex_property_name = [] grin_with_vertex_type_name = [] @@ -52,7 +52,6 @@ grin_trait_natural_id_for_vertex_type = [] grin_enable_vertex_property_table = [] grin_enable_vertex_primary_keys = ["grin_enable_row"] grin_trait_natural_id_for_vertex_property = [] -grin_assume_by_type_vertex_original_id = [] grin_with_edge_property = [] grin_with_edge_property_name = [] grin_with_edge_type_name = [] @@ -76,3 +75,5 @@ grin_assume_column_store_for_edge_property = [] grin_with_vertex_label = [] grin_with_edge_label = [] grin_assume_all_vertex_list_sorted = [] +grin_enable_vertex_original_id_of_int64 = [] +grin_enable_vertex_original_id_of_string = [] diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index 508938492..801d95d69 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -45,7 +45,6 @@ pub type GrinErrorCode = u32; pub type GrinGraph = *mut ::std::os::raw::c_void; pub type GrinVertex = *mut ::std::os::raw::c_void; pub type GrinEdge = *mut ::std::os::raw::c_void; -pub type GrinVertexOriginalId = *mut ::std::os::raw::c_void; pub type GrinVertexList = *mut ::std::os::raw::c_void; pub type GrinVertexListIterator = *mut ::std::os::raw::c_void; pub type GrinAdjacentList = *mut ::std::os::raw::c_void; @@ -167,27 +166,6 @@ extern "C" { #[allow(unused)] pub fn grin_equal_vertex(arg1: GrinGraph, arg2: GrinVertex, arg3: GrinVertex) -> bool; - #[cfg(feature = "grin_with_vertex_original_id")] - #[allow(unused)] - pub fn grin_get_vertex_original_id_data_type(arg1: GrinGraph) -> GrinDatatype; - - #[cfg(feature = "grin_with_vertex_original_id")] - #[allow(unused)] - pub fn grin_get_vertex_original_id_value( - arg1: GrinGraph, - arg2: GrinVertex, - ) -> *const ::std::os::raw::c_void; - - #[allow(unused)] - pub fn grin_destroy_value( - arg1: GrinGraph, - arg2: GrinDatatype, - arg3: *const ::std::os::raw::c_void, - ); - - #[allow(unused)] - pub fn grin_destroy_name(arg1: GrinGraph, arg2: *const ::std::os::raw::c_char); - #[allow(unused)] pub fn grin_destroy_edge(arg1: GrinGraph, arg2: GrinEdge); @@ -500,7 +478,7 @@ extern "C" { #[doc = " @brief get property data type\n @param GrinVertexProperty vertex property"] #[cfg(feature = "grin_with_vertex_property")] #[allow(unused)] - pub fn grin_get_vertex_property_data_type( + pub fn grin_get_vertex_property_datatype( arg1: GrinGraph, arg2: GrinVertexProperty, ) -> GrinDatatype; @@ -529,7 +507,7 @@ extern "C" { #[doc = " @brief get property data type\n @param GrinEdgeProperty edge property"] #[cfg(feature = "grin_with_edge_property")] #[allow(unused)] - pub fn grin_get_edge_property_data_type( + pub fn grin_get_edge_property_datatype( arg1: GrinGraph, arg2: GrinEdgeProperty, ) -> GrinDatatype; @@ -652,19 +630,12 @@ extern "C" { arg3: GrinEdgeProperty, ) -> GrinEdgePropertyId; - #[cfg(feature = "grin_enable_row")] #[allow(unused)] - pub fn grin_destroy_row(arg1: GrinGraph, arg2: GrinRow); + pub fn grin_destroy_string_value(arg1: GrinGraph, arg2: *const ::std::os::raw::c_char); - #[doc = " @brief the value of a property from row by its position in row"] #[cfg(feature = "grin_enable_row")] #[allow(unused)] - pub fn grin_get_value_from_row( - arg1: GrinGraph, - arg2: GrinRow, - arg3: GrinDatatype, - arg4: usize, - ) -> *const ::std::os::raw::c_void; + pub fn grin_destroy_row(arg1: GrinGraph, arg2: GrinRow); #[allow(unused)] pub fn grin_get_int32_from_row( @@ -734,16 +705,6 @@ extern "C" { #[allow(unused)] pub fn grin_create_row(arg1: GrinGraph) -> GrinRow; - #[doc = " @brief insert a value to the end of the row"] - #[cfg(feature = "grin_enable_row")] - #[allow(unused)] - pub fn grin_insert_value_to_row( - arg1: GrinGraph, - arg2: GrinRow, - arg3: GrinDatatype, - arg4: *const ::std::os::raw::c_void, - ) -> bool; - #[cfg(feature = "grin_enable_row")] #[allow(unused)] pub fn grin_insert_int32_to_row( @@ -816,6 +777,16 @@ extern "C" { arg3: i64, ) -> bool; + #[doc = " @brief the value of a property from row by its position in row"] + #[cfg(all(feature = "grin_enable_row", feature = "grin_trait_const_value_ptr"))] + #[allow(unused)] + pub fn grin_get_value_from_row( + arg1: GrinGraph, + arg2: GrinRow, + arg3: GrinDatatype, + arg4: usize, + ) -> *const ::std::os::raw::c_void; + #[doc = " @brief destroy vertex property table\n @param GrinVertexPropertyTable vertex property table"] #[cfg(feature = "grin_enable_vertex_property_table")] #[allow(unused)] @@ -829,16 +800,6 @@ extern "C" { arg2: GrinVertexType, ) -> GrinVertexPropertyTable; - #[doc = " @brief get vertex property value from table\n @param GrinVertexPropertyTable vertex property table\n @param GrinVertex the vertex which is the row index\n @param GrinVertexProperty the vertex property which is the column index\n @return can be casted to the property data type by the caller"] - #[cfg(feature = "grin_enable_vertex_property_table")] - #[allow(unused)] - pub fn grin_get_value_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> *const ::std::os::raw::c_void; - #[allow(unused)] pub fn grin_get_int32_from_vertex_property_table( arg1: GrinGraph, @@ -920,6 +881,16 @@ extern "C" { arg4: GrinVertexProperty, ) -> i64; + #[doc = " @brief get vertex property value from table as a const void*, callers don't have to\n destroy the returned value pointer since they are handled by the storage\n @param GrinVertexPropertyTable vertex property table\n @param GrinVertex the vertex which is the row index\n @param GrinVertexProperty the vertex property which is the column index\n @return can be casted to the property data type by the caller"] + #[cfg(all(feature = "grin_enable_vertex_property_table", feature = "grin_trait_const_value_ptr"))] + #[allow(unused)] + pub fn grin_get_value_from_vertex_property_table( + arg1: GrinGraph, + arg2: GrinVertexPropertyTable, + arg3: GrinVertex, + arg4: GrinVertexProperty, + ) -> *const ::std::os::raw::c_void; + #[doc = " @brief get vertex row from table\n @param GrinVertexPropertyTable vertex property table\n @param GrinVertex the vertex which is the row index\n @param GrinVertexPropertyList the vertex property list as columns"] #[cfg(all(feature = "grin_enable_vertex_property_table", feature = "grin_enable_row"))] #[allow(unused)] @@ -943,16 +914,6 @@ extern "C" { arg2: GrinEdgeType, ) -> GrinEdgePropertyTable; - #[doc = " @brief get edge property value from table\n @param GrinEdgePropertyTable edge property table\n @param GrinEdge the edge which is the row index\n @param GrinEdgeProperty the edge property which is the column index\n @return can be casted to the property data type by the caller"] - #[cfg(feature = "grin_enable_edge_property_table")] - #[allow(unused)] - pub fn grin_get_value_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> *const ::std::os::raw::c_void; - #[allow(unused)] pub fn grin_get_int32_from_edge_property_table( arg1: GrinGraph, @@ -1034,6 +995,16 @@ extern "C" { arg4: GrinEdgeProperty, ) -> i64; + #[doc = " @brief get edge property value from table as a const void*, callers don't have to\n destroy the returned value pointer since they are handled by the storage\n @param GrinEdgePropertyTable edge property table\n @param GrinEdge the edge which is the row index\n @param GrinEdgeProperty the edge property which is the column index\n @return can be casted to the property data type by the caller"] + #[cfg(all(feature = "grin_enable_edge_property_table", feature = "grin_trait_const_value_ptr"))] + #[allow(unused)] + pub fn grin_get_value_from_edge_property_table( + arg1: GrinGraph, + arg2: GrinEdgePropertyTable, + arg3: GrinEdge, + arg4: GrinEdgeProperty, + ) -> *const ::std::os::raw::c_void; + #[doc = " @brief get edge row from table\n @param GrinEdgePropertyTable edge property table\n @param GrinEdge the edge which is the row index\n @param GrinEdgePropertyList the edge property list as columns"] #[cfg(all(feature = "grin_enable_edge_property_table", feature = "grin_enable_row"))] #[allow(unused)] @@ -1052,15 +1023,6 @@ extern "C" { #[allow(unused)] pub fn grin_get_edge_num_by_type(arg1: GrinGraph, arg2: GrinEdgeType) -> usize; - #[cfg(feature = "grin_assume_by_type_vertex_original_id")] - #[allow(unused)] - pub fn grin_get_vertex_by_original_id_by_type( - arg1: GrinGraph, - arg2: GrinVertexType, - arg3: GrinDatatype, - arg4: *const ::std::os::raw::c_void, - ) -> GrinVertex; - #[cfg(feature = "grin_trait_select_type_for_vertex_list")] #[allow(unused)] pub fn grin_select_type_for_vertex_list( diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 08dace76a..daee38b0e 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -131,7 +131,7 @@ GRIN_VERTEX grin_get_neighbor_from_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATO return v; } -GRIN_EDGE grin_get_edge_from_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { +GRIN_EDGE grin_get_edge_from_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { auto _ali = static_cast(ali); auto _nbr = _ali->data.begin() + _ali->current; auto e = new GRIN_EDGE_T(); From e5d179bb8df365ba651dde5e2695948032ad7306 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Tue, 16 May 2023 09:19:49 +0000 Subject: [PATCH 71/85] fix some adjlist bug --- modules/graph/grin/c/test.c | 137 ++++++++++++++++++ modules/graph/grin/include | 2 +- .../graph/grin/src/topology/adjacentlist.cc | 3 +- 3 files changed, 140 insertions(+), 2 deletions(-) diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index e0163bfa1..cc2c2bb48 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -25,6 +25,12 @@ GRIN_GRAPH get_graph(int argc, char** argv) { GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); GRIN_PARTITION partition = grin_get_partition_from_list(pg, local_partitions, 0); + GRIN_PARTITION_ID partition_id = grin_get_partition_id(pg, partition); + GRIN_PARTITION p1 = grin_get_partition_by_id(pg, partition_id); + if (!grin_equal_partition(pg, partition, p1)) { + printf("partition not match\n"); + } + grin_destroy_partition(pg, p1); GRIN_GRAPH g = grin_get_local_graph_by_partition(pg, partition); grin_destroy_partition(pg, partition); grin_destroy_partition_list(pg, local_partitions); @@ -35,6 +41,20 @@ GRIN_GRAPH get_graph(int argc, char** argv) { return g; } + +#ifdef GRIN_ENABLE_GRAPH_PARTITION +GRIN_PARTITION get_partition(int argc, char** argv) { + GRIN_PARTITIONED_GRAPH pg = + grin_get_partitioned_graph_from_storage(argc - 1, &(argv[1])); + GRIN_PARTITION_LIST local_partitions = grin_get_local_partition_list(pg); + GRIN_PARTITION partition = + grin_get_partition_from_list(pg, local_partitions, 0); + grin_destroy_partition_list(pg, local_partitions); + grin_destroy_partitioned_graph(pg); + return partition; +} +#endif + #ifdef GRIN_ENABLE_GRAPH_PARTITION GRIN_PARTITIONED_GRAPH get_partitioend_graph(int argc, char** argv) { GRIN_PARTITIONED_GRAPH pg = @@ -864,7 +884,124 @@ void test_property(int argc, char** argv) { test_error_code(argc, argv); } + +void test_partition_reference(int argc, char** argv) { + printf("+++++++++++++++++++++ Test partition/reference +++++++++++++++++++++\n"); + GRIN_GRAPH g = get_graph(argc, argv); + GRIN_PARTITION p0 = get_partition(argc, argv); + + GRIN_VERTEX_LIST vlist = grin_get_vertex_list(g); + GRIN_VERTEX_LIST_ITERATOR vli = grin_get_vertex_list_begin(g, vlist); + GRIN_VERTEX_LIST mvlist = grin_select_master_for_vertex_list(g, vlist); + grin_destroy_vertex_list(g, vlist); + + size_t cnt = 0; + while (!grin_is_vertex_list_end(g, vli)) { + cnt++; + GRIN_VERTEX v = grin_get_vertex_from_iter(g, vli); + GRIN_VERTEX_REF vref = grin_get_vertex_ref_by_vertex(g, v); +#ifdef GRIN_TRAIT_FAST_VERTEX_REF + long long int sref = grin_serialize_vertex_ref_as_int64(g, vref); + GRIN_VERTEX_REF vref1 = grin_deserialize_int64_to_vertex_ref(g, sref); +#else + const char* sref = grin_serialize_vertex_ref(g, vref); + GRIN_VERTEX_REF vref1 = grin_deserialize_vertex_ref(g, sref); + grin_destroy_string_value(g, sref); +#endif + GRIN_VERTEX v1 = grin_get_vertex_from_vertex_ref(g, vref1); + if (!grin_equal_vertex(g, v, v1)) { + printf("vertex not match\n"); + } + + if (grin_is_master_vertex(g, v) && !grin_is_mirror_vertex(g, v)) { + GRIN_PARTITION p = grin_get_master_partition_from_vertex_ref(g, vref); + if (!grin_equal_partition(g, p, p0)) { + printf("partition not match\n"); + } + } else { + printf("(Wrong) test only has one partition\n"); + } + + grin_destroy_vertex_ref(g, vref); + grin_destroy_vertex(g, v); + grin_get_next_vertex_list_iter(g, vli); + } + printf("num of vertex checked: %zu\n", cnt); + +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY + size_t mvlist_size = grin_get_vertex_list_size(g, mvlist); + if (mvlist_size != cnt) { + printf("(Wrong) master vertex list size not match\n"); + } +#endif + + grin_destroy_vertex_list(g, mvlist); + grin_destroy_graph(g); +} + +void test_partition(int argc, char** argv) { +#ifdef GRIN_ENABLE_GRAPH_PARTITION + test_partition_reference(argc, argv); +#endif +} + + +void test_topology_adjacent_list(int argc, char** argv) { + GRIN_GRAPH g = get_graph(argc, argv); + + GRIN_VERTEX v = get_one_vertex(g); + + GRIN_ADJACENT_LIST al = grin_get_adjacent_list(g, OUT, v); + GRIN_ADJACENT_LIST_ITERATOR ali = grin_get_adjacent_list_begin(g, al); + grin_destroy_adjacent_list(g, al); + size_t cnt = 0; + + while (!grin_is_adjacent_list_end(g, ali)) { + cnt++; + + GRIN_EDGE e = grin_get_edge_from_adjacent_list_iter(g, ali); + GRIN_VERTEX v1 = grin_get_src_vertex_from_edge(g, e); + if (!grin_equal_vertex(g, v, v1)) { + printf("vertex not match\n"); + } + + GRIN_VERTEX v2 = grin_get_dst_vertex_from_edge(g, e); + GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list_iter(g, ali); + if (!grin_equal_vertex(g, v2, u)) { + printf("vertex not match\n"); + } + + grin_destroy_vertex(g, v1); + grin_destroy_vertex(g, v2); + grin_destroy_vertex(g, u); + grin_destroy_edge(g, e); + grin_get_next_adjacent_list_iter(g, ali); + } + + printf("num of edge checked: %zu\n", cnt); + + grin_destroy_adjacent_list_iter(g, ali); + grin_destroy_vertex(g, v); + grin_destroy_graph(g); +} + +void test_topology_structure(int argc, char** argv) { + GRIN_GRAPH g = get_graph(argc, argv); + + printf("vnum: %zu, enum: %zu\n", grin_get_vertex_num(g), grin_get_edge_num(g)); + + grin_destroy_graph(g); +} + + +void test_topology(int argc, char** argv) { + test_topology_structure(argc, argv); + test_topology_adjacent_list(argc, argv); +} + int main(int argc, char** argv) { test_property(argc, argv); + test_partition(argc, argv); + test_topology(argc, argv); return 0; } diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 0d452226a..b6437abb8 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 0d452226a9225669985d303722b0947837c77705 +Subproject commit b6437abb8eefaa8a840b41cf7920fe546dbd4109 diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index daee38b0e..35396fa38 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -111,6 +111,7 @@ void grin_get_next_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR if (_ali->current < _ali->data.size()) break; _ali->etype_current++; _ali->current = 0; + if (_ali->etype_current >= _ali->etype_end) break; if (_ali->dir == GRIN_DIRECTION::IN) { _ali->data = _g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(_ali->vid), _ali->etype_current); } else { @@ -124,7 +125,7 @@ bool grin_is_adjacent_list_end(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { return _ali->etype_current >= _ali->etype_end; } -GRIN_VERTEX grin_get_neighbor_from_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { +GRIN_VERTEX grin_get_neighbor_from_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { auto _ali = static_cast(ali); auto _nbr = _ali->data.begin() + _ali->current; auto v = new GRIN_VERTEX_T(_nbr->vid); From 3c6c180569f4fe4f79f5087076af46a3870ecda2 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Tue, 16 May 2023 10:57:44 +0000 Subject: [PATCH 72/85] fix adjacent list bug --- modules/graph/grin/c/test.c | 91 ++++++++++++------- modules/graph/grin/src/predefine.cc | 16 +++- .../graph/grin/src/topology/adjacentlist.cc | 10 +- modules/graph/grin/src/topology/vertexlist.cc | 14 +-- 4 files changed, 82 insertions(+), 49 deletions(-) diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index cc2c2bb48..54b1d2253 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -946,57 +946,78 @@ void test_partition(int argc, char** argv) { } -void test_topology_adjacent_list(int argc, char** argv) { +void test_topology_structure(int argc, char** argv) { GRIN_GRAPH g = get_graph(argc, argv); - GRIN_VERTEX v = get_one_vertex(g); - - GRIN_ADJACENT_LIST al = grin_get_adjacent_list(g, OUT, v); - GRIN_ADJACENT_LIST_ITERATOR ali = grin_get_adjacent_list_begin(g, al); - grin_destroy_adjacent_list(g, al); - size_t cnt = 0; + printf("vnum: %zu, enum: %zu\n", grin_get_vertex_num(g), grin_get_edge_num(g)); - while (!grin_is_adjacent_list_end(g, ali)) { - cnt++; + grin_destroy_graph(g); +} - GRIN_EDGE e = grin_get_edge_from_adjacent_list_iter(g, ali); - GRIN_VERTEX v1 = grin_get_src_vertex_from_edge(g, e); - if (!grin_equal_vertex(g, v, v1)) { - printf("vertex not match\n"); - } +void test_topology_adjacent_list(int argc, char** argv, GRIN_DIRECTION dir) { + GRIN_GRAPH g = get_graph(argc, argv); - GRIN_VERTEX v2 = grin_get_dst_vertex_from_edge(g, e); - GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list_iter(g, ali); - if (!grin_equal_vertex(g, v2, u)) { - printf("vertex not match\n"); - } + GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); + GRIN_VERTEX_LIST_ITERATOR vli = grin_get_vertex_list_begin(g, vl); + grin_destroy_vertex_list(g, vl); - grin_destroy_vertex(g, v1); - grin_destroy_vertex(g, v2); - grin_destroy_vertex(g, u); - grin_destroy_edge(g, e); - grin_get_next_adjacent_list_iter(g, ali); - } + while (!grin_is_vertex_list_end(g, vli)) { + GRIN_VERTEX v = grin_get_vertex_from_iter(g, vli); + GRIN_ADJACENT_LIST al = grin_get_adjacent_list(g, dir, v); + GRIN_ADJACENT_LIST_ITERATOR ali = grin_get_adjacent_list_begin(g, al); + grin_destroy_adjacent_list(g, al); - printf("num of edge checked: %zu\n", cnt); + size_t cnt = 0; + while (!grin_is_adjacent_list_end(g, ali)) { + cnt++; + GRIN_EDGE e = grin_get_edge_from_adjacent_list_iter(g, ali); + GRIN_VERTEX v1 = grin_get_src_vertex_from_edge(g, e); + GRIN_VERTEX v2 = grin_get_dst_vertex_from_edge(g, e); + GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list_iter(g, ali); - grin_destroy_adjacent_list_iter(g, ali); - grin_destroy_vertex(g, v); - grin_destroy_graph(g); -} + if (dir == OUT) { + if (!grin_equal_vertex(g, v, v1)) { + printf("vertex not match\n"); + } + if (!grin_equal_vertex(g, v2, u)) { + printf("vertex not match\n"); + } + } else { + if (!grin_equal_vertex(g, v, v2)) { + printf("vertex not match\n"); + } + if (!grin_equal_vertex(g, v1, u)) { + printf("vertex not match\n"); + } + } -void test_topology_structure(int argc, char** argv) { - GRIN_GRAPH g = get_graph(argc, argv); + grin_destroy_vertex(g, v1); + grin_destroy_vertex(g, v2); + grin_destroy_vertex(g, u); + grin_destroy_edge(g, e); + grin_get_next_adjacent_list_iter(g, ali); + } +#ifdef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_INT64 + long long int vid = grin_get_vertex_original_id_of_int64(g, v); + if (dir == OUT) { + printf("vertex %lld OUT adjacent list checked num: %zu\n", vid, cnt); + } else { + printf("vertex %lld IN adjacent list checked num: %zu\n", vid, cnt); + } +#endif - printf("vnum: %zu, enum: %zu\n", grin_get_vertex_num(g), grin_get_edge_num(g)); + grin_destroy_adjacent_list_iter(g, ali); + grin_destroy_vertex(g, v); + grin_get_next_vertex_list_iter(g, vli); + } grin_destroy_graph(g); } - void test_topology(int argc, char** argv) { test_topology_structure(argc, argv); - test_topology_adjacent_list(argc, argv); + test_topology_adjacent_list(argc, argv, OUT); + test_topology_adjacent_list(argc, argv, IN); } int main(int argc, char** argv) { diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 3a60dc618..ea8dd5402 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -117,8 +117,12 @@ void __grin_init_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { vr = g->OuterVertices(vtype); } sum += vr.size(); - vl->offsets.push_back(sum); - vl->vrs.push_back(vr); + if (sum == 0) { + vl->type_begin++; + } else { + vl->offsets.push_back(sum); + vl->vrs.push_back(vr); + } } } #endif @@ -137,8 +141,12 @@ void __grin_init_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); } sum += ral.size(); - al->offsets.push_back(sum); - al->data.push_back(ral); + if (sum == 0) { + al->etype_begin++; + } else { + al->offsets.push_back(sum); + al->data.push_back(ral); + } } } #endif diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 35396fa38..dbf2d1552 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -90,10 +90,12 @@ GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH g, GRIN_ADJA ali->etype_end = _al->etype_end; ali->etype_current = _al->etype_begin; ali->current = 0; - if (ali->dir == GRIN_DIRECTION::IN) { - ali->data = _g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); - } else { - ali->data = _g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); + if (ali->etype_current < ali->etype_end) { + if (ali->dir == GRIN_DIRECTION::IN) { + ali->data = _g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); + } else { + ali->data = _g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); + } } return ali; } diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index 552cde391..672c4e7c8 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -61,12 +61,14 @@ GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH g, GRIN_VERTEX_L vli->type_current = _vl->type_begin; vli->current = 0; vli->all_master_mirror = _vl->all_master_mirror; - if (vli->all_master_mirror == 0) { - vli->vr = _g->Vertices(vli->type_current); - } else if (vli->all_master_mirror == 1) { - vli->vr = _g->InnerVertices(vli->type_current); - } else { - vli->vr = _g->OuterVertices(vli->type_current); + if (vli->type_current < vli->type_end) { + if (vli->all_master_mirror == 0) { + vli->vr = _g->Vertices(vli->type_current); + } else if (vli->all_master_mirror == 1) { + vli->vr = _g->InnerVertices(vli->type_current); + } else { + vli->vr = _g->OuterVertices(vli->type_current); + } } return vli; } From 3c0367c046c6ded9fa21a7ad5d1bb9a6725665fd Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Tue, 16 May 2023 11:45:38 +0000 Subject: [PATCH 73/85] fix adjacent bug --- modules/graph/grin/c/test.c | 90 +++++++++++-------- modules/graph/grin/src/predefine.cc | 18 ++-- .../graph/grin/src/topology/adjacentlist.cc | 6 ++ modules/graph/grin/src/topology/vertexlist.cc | 6 ++ 4 files changed, 72 insertions(+), 48 deletions(-) diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index 54b1d2253..cb045ed1a 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -961,52 +961,72 @@ void test_topology_adjacent_list(int argc, char** argv, GRIN_DIRECTION dir) { GRIN_VERTEX_LIST_ITERATOR vli = grin_get_vertex_list_begin(g, vl); grin_destroy_vertex_list(g, vl); + GRIN_EDGE_TYPE_LIST etl = grin_get_edge_type_list(g); + size_t etl_size = grin_get_edge_type_list_size(g, etl); + while (!grin_is_vertex_list_end(g, vli)) { GRIN_VERTEX v = grin_get_vertex_from_iter(g, vli); GRIN_ADJACENT_LIST al = grin_get_adjacent_list(g, dir, v); - GRIN_ADJACENT_LIST_ITERATOR ali = grin_get_adjacent_list_begin(g, al); - grin_destroy_adjacent_list(g, al); - - size_t cnt = 0; - while (!grin_is_adjacent_list_end(g, ali)) { - cnt++; - GRIN_EDGE e = grin_get_edge_from_adjacent_list_iter(g, ali); - GRIN_VERTEX v1 = grin_get_src_vertex_from_edge(g, e); - GRIN_VERTEX v2 = grin_get_dst_vertex_from_edge(g, e); - GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list_iter(g, ali); + for (size_t i = 0; i <= etl_size; ++i) { + GRIN_ADJACENT_LIST al1 = al; + if (i < etl_size) { + GRIN_EDGE_TYPE et = grin_get_edge_type_from_list(g, etl, i); + al1 = grin_select_edge_type_for_adjacent_list(g, et, al); + grin_destroy_edge_type(g, et); + } + + GRIN_ADJACENT_LIST_ITERATOR ali = grin_get_adjacent_list_begin(g, al1); + grin_destroy_adjacent_list(g, al1); + + size_t cnt = 0; + while (!grin_is_adjacent_list_end(g, ali)) { + cnt++; + GRIN_EDGE e = grin_get_edge_from_adjacent_list_iter(g, ali); + GRIN_VERTEX v1 = grin_get_src_vertex_from_edge(g, e); + GRIN_VERTEX v2 = grin_get_dst_vertex_from_edge(g, e); + GRIN_VERTEX u = grin_get_neighbor_from_adjacent_list_iter(g, ali); + + if (dir == OUT) { + if (!grin_equal_vertex(g, v, v1)) { + printf("vertex not match\n"); + } + if (!grin_equal_vertex(g, v2, u)) { + printf("vertex not match\n"); + } + } else { + if (!grin_equal_vertex(g, v, v2)) { + printf("vertex not match\n"); + } + if (!grin_equal_vertex(g, v1, u)) { + printf("vertex not match\n"); + } + } + grin_destroy_vertex(g, v1); + grin_destroy_vertex(g, v2); + grin_destroy_vertex(g, u); + grin_destroy_edge(g, e); + grin_get_next_adjacent_list_iter(g, ali); + } +#ifdef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_INT64 + long long int vid = grin_get_vertex_original_id_of_int64(g, v); if (dir == OUT) { - if (!grin_equal_vertex(g, v, v1)) { - printf("vertex not match\n"); - } - if (!grin_equal_vertex(g, v2, u)) { - printf("vertex not match\n"); + if (i < etl_size) { + printf("vertex %lld OUT adjacent list, edgetype: %zu checked num: %zu\n", vid, i, cnt); + } else { + printf("vertex %lld OUT adjacent list, edgetype: all checked num: %zu\n", vid, cnt); } } else { - if (!grin_equal_vertex(g, v, v2)) { - printf("vertex not match\n"); - } - if (!grin_equal_vertex(g, v1, u)) { - printf("vertex not match\n"); + if (i < etl_size) { + printf("vertex %lld IN adjacent list, edgetype: %zu checked num: %zu\n", vid, i, cnt); + } else { + printf("vertex %lld IN adjacent list, edgetype: all checked num: %zu\n", vid, cnt); } } - - grin_destroy_vertex(g, v1); - grin_destroy_vertex(g, v2); - grin_destroy_vertex(g, u); - grin_destroy_edge(g, e); - grin_get_next_adjacent_list_iter(g, ali); - } -#ifdef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_INT64 - long long int vid = grin_get_vertex_original_id_of_int64(g, v); - if (dir == OUT) { - printf("vertex %lld OUT adjacent list checked num: %zu\n", vid, cnt); - } else { - printf("vertex %lld IN adjacent list checked num: %zu\n", vid, cnt); - } #endif - grin_destroy_adjacent_list_iter(g, ali); + grin_destroy_adjacent_list_iter(g, ali); + } grin_destroy_vertex(g, v); grin_get_next_vertex_list_iter(g, vli); } diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index ea8dd5402..3780621ce 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -117,12 +117,8 @@ void __grin_init_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { vr = g->OuterVertices(vtype); } sum += vr.size(); - if (sum == 0) { - vl->type_begin++; - } else { - vl->offsets.push_back(sum); - vl->vrs.push_back(vr); - } + vl->offsets.push_back(sum); + vl->vrs.push_back(vr); } } #endif @@ -140,13 +136,9 @@ void __grin_init_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { } else { ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); } - sum += ral.size(); - if (sum == 0) { - al->etype_begin++; - } else { - al->offsets.push_back(sum); - al->data.push_back(ral); - } + sum += ral.size(); + al->offsets.push_back(sum); + al->data.push_back(ral); } } #endif diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index dbf2d1552..16605fdc4 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -90,6 +90,12 @@ GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH g, GRIN_ADJA ali->etype_end = _al->etype_end; ali->etype_current = _al->etype_begin; ali->current = 0; + + while (ali->etype_current < ali->etype_end) { + if (_al->offsets[ali->etype_current - ali->etype_begin + 1] > 0) break; + ali->etype_current++; + } + if (ali->etype_current < ali->etype_end) { if (ali->dir == GRIN_DIRECTION::IN) { ali->data = _g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index 672c4e7c8..f383fe483 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -61,6 +61,12 @@ GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH g, GRIN_VERTEX_L vli->type_current = _vl->type_begin; vli->current = 0; vli->all_master_mirror = _vl->all_master_mirror; + + while (vli->type_current < vli->type_end) { + if (_vl->offsets[vli->type_current - vli->type_begin + 1] > 0) break; + vli->type_current++; + } + if (vli->type_current < vli->type_end) { if (vli->all_master_mirror == 0) { vli->vr = _g->Vertices(vli->type_current); From 7dd3cf516662a492d5d5e110b17db5941597e302 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Wed, 17 May 2023 11:25:09 +0000 Subject: [PATCH 74/85] change vertex handler from void* to int64 --- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 4 +-- modules/graph/grin/rust/v6d_all.h | 2 +- modules/graph/grin/src/index/order.cc | 21 +++++--------- modules/graph/grin/src/index/original_id.cc | 9 +++--- modules/graph/grin/src/partition/partition.cc | 4 +-- modules/graph/grin/src/partition/reference.cc | 17 +++++------ modules/graph/grin/src/predefine.cc | 13 ++++----- modules/graph/grin/src/predefine.h | 9 +++--- modules/graph/grin/src/property/primarykey.cc | 29 +++++++------------ modules/graph/grin/src/property/property.cc | 4 +-- .../graph/grin/src/property/propertytable.cc | 9 +++--- modules/graph/grin/src/property/type.cc | 13 ++++----- .../graph/grin/src/topology/adjacentlist.cc | 9 ++---- modules/graph/grin/src/topology/structure.cc | 16 +++------- modules/graph/grin/src/topology/vertexlist.cc | 6 ++-- 16 files changed, 67 insertions(+), 100 deletions(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index b6437abb8..44ee2e923 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit b6437abb8eefaa8a840b41cf7920fe546dbd4109 +Subproject commit 44ee2e923bb9d31d2a8a3eb1a2075f9f970b9a17 diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index e28901564..26bd51146 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -825,7 +825,7 @@ typedef enum { /** @brief Null graph (invalid return value) */ #define GRIN_NULL_GRAPH NULL /** @brief Non-existing vertex (invalid return value) */ -#define GRIN_NULL_VERTEX NULL +#define GRIN_NULL_VERTEX (unsigned long long int)~0 /** @brief Non-existing edge (invalid return value) */ #define GRIN_NULL_EDGE NULL /** @brief Null list of any kind (invalid return value) */ @@ -859,7 +859,7 @@ typedef enum { /* Define the handlers using typedef */ typedef void* GRIN_GRAPH; -typedef void* GRIN_VERTEX; +typedef unsigned long long int GRIN_VERTEX; typedef void* GRIN_EDGE; #ifdef GRIN_WITH_VERTEX_DATA diff --git a/modules/graph/grin/rust/v6d_all.h b/modules/graph/grin/rust/v6d_all.h index 5ba492fd1..f4b284164 100644 --- a/modules/graph/grin/rust/v6d_all.h +++ b/modules/graph/grin/rust/v6d_all.h @@ -19,7 +19,7 @@ /// RUST_KEEP pub const GRIN_NULL_DATATYPE: GrinDatatype = GRIN_DATATYPE_UNDEFINED; /// RUST_KEEP pub const GRIN_NULL_GRAPH: GrinGraph = std::ptr::null_mut(); -/// RUST_KEEP pub const GRIN_NULL_VERTEX: GrinVertex = std::ptr::null_mut(); +/// RUST_KEEP pub const GRIN_NULL_VERTEX: GrinVertex = u64::MAX; /// RUST_KEEP pub const GRIN_NULL_EDGE: GrinEdge = std::ptr::null_mut(); /// RUST_KEEP pub const GRIN_NULL_LIST: *mut ::std::os::raw::c_void = std::ptr::null_mut(); /// RUST_KEEP pub const GRIN_NULL_LIST_ITERATOR: *mut ::std::os::raw::c_void = std::ptr::null_mut(); diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index 3c5e923fd..bc87bbfa3 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -18,25 +18,20 @@ extern "C" { #ifdef GRIN_ASSUME_ALL_VERTEX_LIST_SORTED bool grin_smaller_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { - auto _g = static_cast(g)->g; - auto _v1 = static_cast(v1); - auto _v2 = static_cast(v2); - return _g->Vertex2Gid(*_v1) < _g->Vertex2Gid(*_v2); + return v1 < v2; } #endif #if defined(GRIN_ASSUME_ALL_VERTEX_LIST_SORTED) && defined(GRIN_ENABLE_VERTEX_LIST_ARRAY) size_t grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v) { auto _g = static_cast(g)->g; - auto _v = static_cast(v); auto _vl = static_cast(vl); - return _v->GetValue() - _vl->vrs[0].begin_value(); - // auto vtype = (unsigned)_g->vertex_label(*_v); - // if (vtype < _vl->type_begin || vtype >= _vl->type_end) return GRIN_NULL_SIZE; - // auto offset = _v->GetValue() - _vl->vrs[vtype - _vl->type_begin].begin_value(); - // if (offset < _vl->vrs[vtype - _vl->type_begin].size()) { - // return _vl->offsets[vtype - _vl->type_begin] + offset; - // } - // return GRIN_NULL_SIZE; + auto vtype = (unsigned)_g->vertex_label(_GRIN_VERTEX_T(v)); // TODO: optimize after rebase + if (vtype < _vl->type_begin || vtype >= _vl->type_end) return GRIN_NULL_SIZE; + auto offset = v - _vl->vrs[vtype - _vl->type_begin].begin_value(); + if (offset < _vl->vrs[vtype - _vl->type_begin].size()) { + return _vl->offsets[vtype - _vl->type_begin] + offset; + } + return GRIN_NULL_SIZE; } #endif diff --git a/modules/graph/grin/src/index/original_id.cc b/modules/graph/grin/src/index/original_id.cc index 6f867ecd5..5c1ac8e19 100644 --- a/modules/graph/grin/src/index/original_id.cc +++ b/modules/graph/grin/src/index/original_id.cc @@ -23,18 +23,17 @@ GRIN_DATATYPE grin_get_vertex_original_id_datatype(GRIN_GRAPH g) { #ifdef GRIN_ENABLE_VERTEX_ORIGINAL_ID_OF_INT64 long long int grin_get_vertex_original_id_of_int64(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; - auto _v = static_cast(v); - auto gid = _g->Vertex2Gid(*_v); + auto gid = _g->Vertex2Gid(_GRIN_VERTEX_T(v)); return _g->Gid2Oid(gid); } GRIN_VERTEX grin_get_vertex_by_original_id_of_int64(GRIN_GRAPH g, long long int oid) { auto _g = static_cast(g)->g; _GRIN_GRAPH_T::vid_t gid; - auto v = new GRIN_VERTEX_T(); + _GRIN_VERTEX_T v; if (_g->Oid2Gid(0, oid, gid)) { - if (_g->Gid2Vertex(gid, *v)) { - return v; + if (_g->Gid2Vertex(gid, v)) { + return v.GetValue(); } } return GRIN_NULL_VERTEX; diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index caebbece6..9cca76339 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -35,12 +35,10 @@ GRIN_PARTITIONED_GRAPH grin_get_partitioned_graph_from_storage(int argc, char** for (auto & [fid, location] : pg->pg->FragmentLocations()) { if (location == pg->client.instance_id()) { auto obj_id = pg->pg->Fragments().at(fid); -// std::cout << fid << ": " << obj_id << std::endl; -// auto frag = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(pg->client.GetObject(obj_id)); pg->lgs[fid] = obj_id; } } - return pg; + return pg; } void grin_destroy_partitioned_graph(GRIN_PARTITIONED_GRAPH pg) { diff --git a/modules/graph/grin/src/partition/reference.cc b/modules/graph/grin/src/partition/reference.cc index f3060e15f..dcf307917 100644 --- a/modules/graph/grin/src/partition/reference.cc +++ b/modules/graph/grin/src/partition/reference.cc @@ -21,24 +21,23 @@ extern "C" { #ifdef GRIN_ENABLE_VERTEX_REF GRIN_VERTEX_REF grin_get_vertex_ref_by_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; - auto _v = static_cast(v); - return _g->Vertex2Gid(*_v); + return _g->Vertex2Gid(_GRIN_VERTEX_T(v)); } void grin_destroy_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) {} GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { auto _g = static_cast(g)->g; - auto v = new GRIN_VERTEX_T(); - if (_g->Gid2Vertex(vr, *v)) { - return v; + _GRIN_VERTEX_T v; + if (_g->Gid2Vertex(vr, v)) { + return v.GetValue(); } return GRIN_NULL_VERTEX; } GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { auto _g = static_cast(g)->g; - auto id_parser = vineyard::IdParser(); + auto id_parser = vineyard::IdParser(); //TODO optimize after rebase id_parser.Init(_g->fnum(), _g->vertex_label_num()); return id_parser.GetFid(vr); } @@ -75,14 +74,12 @@ GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH g, const char* msg) { bool grin_is_master_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; - auto _v = static_cast(v); - return _g->IsInnerVertex(*_v); + return _g->IsInnerVertex(_GRIN_VERTEX_T(v)); // TODO } bool grin_is_mirror_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; - auto _v = static_cast(v); - return _g->IsOuterVertex(*_v); + return _g->IsOuterVertex(_GRIN_VERTEX_T(v)); // TODO } #endif diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index 3780621ce..bb60a706f 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -72,14 +72,13 @@ const void* _get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROP grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); - auto _v = static_cast(v); - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - if (vtype != _vpt->vtype || !_vpt->vertices.Contain(*_v)) { + if (v < _vpt->vbegin || v >= _vpt->vend) { grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return NULL; } - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + auto offset = v - _vpt->vbegin; auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); return vineyard::get_arrow_array_data_element(array, offset); } @@ -107,7 +106,7 @@ void __grin_init_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { vl->vrs.clear(); _GRIN_GRAPH_T::vertices_t vr; vl->offsets.push_back(0); - unsigned sum = 0; + size_t sum = 0; for (auto vtype = vl->type_begin; vtype < vl->type_end; ++vtype) { if (vl->all_master_mirror == 0) { vr = g->Vertices(vtype); @@ -129,7 +128,7 @@ void __grin_init_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { al->data.clear(); _GRIN_GRAPH_T::raw_adj_list_t ral; al->offsets.push_back(0); - unsigned sum = 0; + size_t sum = 0; for (auto etype = al->etype_begin; etype < al->etype_end; ++etype) { if (al->dir == GRIN_DIRECTION::IN) { ral = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index fb126f24d..01fc6671d 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -102,7 +102,7 @@ struct GRIN_GRAPH_T { std::shared_ptr<_GRIN_GRAPH_T> _g; _GRIN_GRAPH_T* g; }; -typedef _GRIN_GRAPH_T::vertex_t GRIN_VERTEX_T; +typedef _GRIN_GRAPH_T::vertex_t _GRIN_VERTEX_T; struct GRIN_EDGE_T { _GRIN_GRAPH_T::vid_t src; _GRIN_GRAPH_T::vid_t dst; @@ -116,7 +116,7 @@ struct GRIN_VERTEX_LIST_T { unsigned type_begin; unsigned type_end; unsigned all_master_mirror; - std::vector offsets; + std::vector offsets; std::vector<_GRIN_GRAPH_T::vertices_t> vrs; }; void __grin_init_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl); @@ -139,7 +139,7 @@ struct GRIN_ADJACENT_LIST_T { GRIN_DIRECTION dir; unsigned etype_begin; unsigned etype_end; - std::vector offsets; + std::vector offsets; std::vector<_GRIN_GRAPH_T::raw_adj_list_t> data; }; void __grin_init_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al); @@ -179,7 +179,8 @@ typedef unsigned long long int GRIN_VERTEX_PROPERTY_T; typedef std::vector GRIN_VERTEX_PROPERTY_LIST_T; struct GRIN_VERTEX_PROPERTY_TABLE_T { unsigned vtype; - _GRIN_GRAPH_T::vertices_t vertices; + _GRIN_GRAPH_T::vid_t vbegin; + _GRIN_GRAPH_T::vid_t vend; }; #endif diff --git a/modules/graph/grin/src/property/primarykey.cc b/modules/graph/grin/src/property/primarykey.cc index 7151a952e..538331462 100644 --- a/modules/graph/grin/src/property/primarykey.cc +++ b/modules/graph/grin/src/property/primarykey.cc @@ -56,35 +56,26 @@ GRIN_VERTEX grin_get_vertex_by_primary_keys(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype auto _g = static_cast(g)->g; auto _r = static_cast(r); auto value = (*_r)[0]; +#if 0 for (auto p = 0; p < _g->vertex_property_num(vtype); ++p) { if (_g->schema().GetVertexPropertyName(vtype, p) == "id") { auto arrow_dt = _g->schema().GetVertexPropertyType(vtype, p); auto dt = ArrowToDataType(arrow_dt); - if (dt == GRIN_DATATYPE::Int32) { - auto vid = static_cast(value); - auto _v = new GRIN_VERTEX_T(); - if (!_g->GetVertex(vtype, *vid, *_v)) return GRIN_NULL_VERTEX; - return _v; - } else if (dt == GRIN_DATATYPE::UInt32) { - auto vid = static_cast(value); - auto _v = new GRIN_VERTEX_T(); - if (!_g->GetVertex(vtype, *vid, *_v)) return GRIN_NULL_VERTEX; - return _v; - } else if (dt == GRIN_DATATYPE::Int64) { + if (dt == GRIN_DATATYPE::Int64) { +#endif + _GRIN_VERTEX_T v; auto vid = static_cast(value); - auto _v = new GRIN_VERTEX_T(); - if (!_g->GetVertex(vtype, *vid, *_v)) return GRIN_NULL_VERTEX; - return _v; - } else if (dt == GRIN_DATATYPE::UInt64) { - auto vid = static_cast(value); - auto _v = new GRIN_VERTEX_T(); - if (!_g->GetVertex(vtype, *vid, *_v)) return GRIN_NULL_VERTEX; - return _v; + if (!_g->GetVertex(vtype, *vid, v)) return GRIN_NULL_VERTEX; + return v.GetValue(); +#if 0 + } else { + return GRIN_NULL_VERTEX; } } } return GRIN_NULL_VERTEX; +#endif } #endif diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index a895aafcc..da060a550 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -22,7 +22,7 @@ const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, int len = s.length() + 1; char* out = new char[len]; snprintf(out, len, "%s", s.c_str()); - return out; + return out; // TODO: optimize after rebase, put strings in g. } GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, @@ -59,7 +59,7 @@ const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN int len = s.length() + 1; char* out = new char[len]; snprintf(out, len, "%s", s.c_str()); - return out; + return out; // TODO } GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc index e484fe9c1..43335e515 100644 --- a/modules/graph/grin/src/property/propertytable.cc +++ b/modules/graph/grin/src/property/propertytable.cc @@ -186,7 +186,9 @@ GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, auto _g = static_cast(g)->g; auto vpt = new GRIN_VERTEX_PROPERTY_TABLE_T(); vpt->vtype = vtype; - vpt->vertices = _g->InnerVertices(vtype); + auto vr = _g->InnerVertices(vtype); + vpt->vbegin = vr.begin_value(); + vpt->vend = vr.end_value(); return vpt; } @@ -295,10 +297,9 @@ GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPE GRIN_VERTEX_PROPERTY_LIST vpl) { auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); - auto _v = static_cast(v); auto _vpl = static_cast(vpl); - if (!_vpt->vertices.Contain(*_v)) return NULL; - auto offset = _v->GetValue() - _vpt->vertices.begin_value(); + if (v < _vpt->vbegin || v >= _vpt->vend) return NULL; + auto offset = v - _vpt->vbegin; auto r = new GRIN_ROW_T(); for (auto vp: *_vpl) { diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index f67a55e6c..bb0de2c9e 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -22,8 +22,7 @@ bool grin_equal_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt1, GRIN_VERTEX_TYPE GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; - auto _v = static_cast(v); - return _g->vertex_label(*_v); + return _g->vertex_label(_GRIN_VERTEX_T(v)); // TODO } void grin_destroy_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) {} @@ -71,7 +70,7 @@ const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { int len = s.length() + 1; char* out = new char[len]; snprintf(out, len, "%s", s.c_str()); - return out; + return out; // TODO } GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { @@ -149,7 +148,7 @@ const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { int len = s.length() + 1; char* out = new char[len]; snprintf(out, len, "%s", s.c_str()); - return out; + return out; // TODO } GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { @@ -181,7 +180,7 @@ GRIN_VERTEX_TYPE_LIST grin_get_src_types_by_edge_type(GRIN_GRAPH g, GRIN_EDGE_TY for (auto& pair : entry.relations) { vtl->push_back(GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(pair.first))); } - return vtl; + return vtl; // TODO } GRIN_VERTEX_TYPE_LIST grin_get_dst_types_by_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { @@ -191,7 +190,7 @@ GRIN_VERTEX_TYPE_LIST grin_get_dst_types_by_edge_type(GRIN_GRAPH g, GRIN_EDGE_TY for (auto& pair : entry.relations) { vtl->push_back(GRIN_VERTEX_TYPE_T(_g->schema().GetVertexLabelId(pair.second))); } - return vtl; + return vtl; // TODO } GRIN_EDGE_TYPE_LIST grin_get_edge_types_by_vertex_type_pair(GRIN_GRAPH g, GRIN_VERTEX_TYPE src_vt, @@ -209,6 +208,6 @@ GRIN_EDGE_TYPE_LIST grin_get_edge_types_by_vertex_type_pair(GRIN_GRAPH g, GRIN_V } } } - return etl; + return etl; // TODO } #endif diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 16605fdc4..527279c4c 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -22,9 +22,8 @@ extern "C" { GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_VERTEX v) { if (d == GRIN_DIRECTION::BOTH) return GRIN_NULL_LIST; auto _g = static_cast(g)->g; - auto _v = static_cast(v); auto al = new GRIN_ADJACENT_LIST_T(); - al->vid = _v->GetValue(); + al->vid = v; al->dir = d; al->etype_begin = 0; al->etype_end = _g->edge_label_num(); @@ -48,8 +47,7 @@ GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIS if (idx < _al->offsets[i+1]) { auto _idx = idx - _al->offsets[i]; auto _nbr = _al->data[i].begin() + _idx; - auto v = new GRIN_VERTEX_T(_nbr->vid); - return v; + return _nbr->vid; } } return GRIN_NULL_VERTEX; @@ -136,8 +134,7 @@ bool grin_is_adjacent_list_end(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { GRIN_VERTEX grin_get_neighbor_from_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { auto _ali = static_cast(ali); auto _nbr = _ali->data.begin() + _ali->current; - auto v = new GRIN_VERTEX_T(_nbr->vid); - return v; + return _nbr->vid; } GRIN_EDGE grin_get_edge_from_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 1bf954059..8f8503bb1 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -70,16 +70,10 @@ size_t grin_get_edge_num(GRIN_GRAPH g) { } // Vertex -void grin_destroy_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _v = static_cast(v); - delete _v; -} +void grin_destroy_vertex(GRIN_GRAPH g, GRIN_VERTEX v) {} bool grin_equal_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { - auto _g = static_cast(g)->g; - auto _v1 = static_cast(v1); - auto _v2 = static_cast(v2); - return _g->Vertex2Gid(*_v1) == _g->Vertex2Gid(*_v2); + return v1 == v2; } // Data @@ -97,14 +91,12 @@ void grin_destroy_edge(GRIN_GRAPH g, GRIN_EDGE e) { GRIN_VERTEX grin_get_src_vertex_from_edge(GRIN_GRAPH g, GRIN_EDGE e) { auto _e = static_cast(e); - auto v = new GRIN_VERTEX_T(_e->src); - return v; + return _e->src; } GRIN_VERTEX grin_get_dst_vertex_from_edge(GRIN_GRAPH g, GRIN_EDGE e) { auto _e = static_cast(e); - auto v = new GRIN_VERTEX_T(_e->dst); - return v; + return _e->dst; } #ifdef GRIN_WITH_EDGE_DATA diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index f383fe483..1833c457d 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -43,8 +43,7 @@ GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t for (unsigned i = 0; i < _vl->type_end - _vl->type_begin; ++i) { if (idx < _vl->offsets[i+1]) { auto _idx = idx - _vl->offsets[i]; - auto v = new GRIN_VERTEX_T(_vl->vrs[i].begin_value() + _idx); - return v; + return _vl->vrs[i].begin_value() + _idx; } } return GRIN_NULL_VERTEX; @@ -111,7 +110,6 @@ bool grin_is_vertex_list_end(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { GRIN_VERTEX grin_get_vertex_from_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { auto _vli = static_cast(vli); - auto v = new GRIN_VERTEX_T(_vli->vr.begin_value() + _vli->current); - return v; + return _vli->vr.begin_value() + _vli->current; } #endif From da59a45b2e3edbce9e0d6faf0f9efc1e70ce0d5c Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Thu, 18 May 2023 03:59:12 +0000 Subject: [PATCH 75/85] grin graph cache optimize --- modules/graph/grin/src/index/order.cc | 3 +- modules/graph/grin/src/partition/partition.cc | 1 + modules/graph/grin/src/partition/reference.cc | 9 +++--- modules/graph/grin/src/predefine.cc | 28 +++++++++++++++++-- modules/graph/grin/src/predefine.h | 17 +++++++++-- modules/graph/grin/src/property/property.cc | 16 +++-------- modules/graph/grin/src/property/type.cc | 17 ++++------- modules/graph/grin/src/topology/structure.cc | 2 ++ 8 files changed, 59 insertions(+), 34 deletions(-) diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index bc87bbfa3..ea8a9bc50 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -26,7 +26,8 @@ bool grin_smaller_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { size_t grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v) { auto _g = static_cast(g)->g; auto _vl = static_cast(vl); - auto vtype = (unsigned)_g->vertex_label(_GRIN_VERTEX_T(v)); // TODO: optimize after rebase + auto bg = static_cast(g); + auto vtype = bg->cache->id_parser.GetLabelId(v); if (vtype < _vl->type_begin || vtype >= _vl->type_end) return GRIN_NULL_SIZE; auto offset = v - _vl->vrs[vtype - _vl->type_begin].begin_value(); if (offset < _vl->vrs[vtype - _vl->type_begin].size()) { diff --git a/modules/graph/grin/src/partition/partition.cc b/modules/graph/grin/src/partition/partition.cc index 9cca76339..d291f05d9 100644 --- a/modules/graph/grin/src/partition/partition.cc +++ b/modules/graph/grin/src/partition/partition.cc @@ -105,6 +105,7 @@ GRIN_GRAPH grin_get_local_graph_by_partition(GRIN_PARTITIONED_GRAPH pg, GRIN_PAR g->client.Connect(_pg->socket); g->_g = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(g->client.GetObject(_pg->lgs[p])); g->g = g->_g.get(); + _prepare_cache(g); return g; } #endif diff --git a/modules/graph/grin/src/partition/reference.cc b/modules/graph/grin/src/partition/reference.cc index dcf307917..97d2f7d95 100644 --- a/modules/graph/grin/src/partition/reference.cc +++ b/modules/graph/grin/src/partition/reference.cc @@ -37,9 +37,8 @@ GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { auto _g = static_cast(g)->g; - auto id_parser = vineyard::IdParser(); //TODO optimize after rebase - id_parser.Init(_g->fnum(), _g->vertex_label_num()); - return id_parser.GetFid(vr); + auto bg = static_cast(g); + return bg->cache->id_parser.GetFid(vr); } const char* grin_serialize_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { @@ -74,12 +73,12 @@ GRIN_VERTEX_REF grin_deserialize_to_vertex_ref(GRIN_GRAPH g, const char* msg) { bool grin_is_master_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; - return _g->IsInnerVertex(_GRIN_VERTEX_T(v)); // TODO + return _g->IsInnerVertex(_GRIN_VERTEX_T(v)); } bool grin_is_mirror_vertex(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; - return _g->IsOuterVertex(_GRIN_VERTEX_T(v)); // TODO + return _g->IsOuterVertex(_GRIN_VERTEX_T(v)); } #endif diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index bb60a706f..d1fc2fce6 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -72,11 +72,11 @@ const void* _get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROP grin_error_code = GRIN_ERROR_CODE::NO_ERROR; auto _g = static_cast(g)->g; auto _vpt = static_cast(vpt); - if (v < _vpt->vbegin || v >= _vpt->vend) { + unsigned vtype = _grin_get_type_from_property(vp); + if (v < _vpt->vbegin || v >= _vpt->vend || vtype != _vpt->vtype) { grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return NULL; - } - unsigned vtype = _grin_get_type_from_property(vp); + } unsigned vprop = _grin_get_prop_from_property(vp); auto offset = v - _vpt->vbegin; auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); @@ -153,3 +153,25 @@ unsigned _grin_get_type_from_property(unsigned long long int prop) { unsigned _grin_get_prop_from_property(unsigned long long int prop) { return (unsigned)(prop & 0xffffffff); } + +void _prepare_cache(GRIN_GRAPH_T* g) { + g->cache = new _GRAPH_CACHE(); + g->cache->id_parser = vineyard::IdParser<_GRIN_GRAPH_T::vid_t>(); + g->cache->id_parser.Init(g->g->fnum(), g->g->vertex_label_num()); + + for (int i = 0; i < g->g->vertex_label_num(); ++i) { + g->cache->vtype_names.push_back(g->g->schema().GetVertexLabelName(i)); + g->cache->vprop_names.push_back(std::vector()); + for (int j = 0; j < g->g->vertex_property_num(i); ++j) { + g->cache->vprop_names[i].push_back(g->g->schema().GetVertexPropertyName(i, j)); + } + } + + for (int i = 0; i < g->g->edge_label_num(); ++i) { + g->cache->etype_names.push_back(g->g->schema().GetEdgeLabelName(i)); + g->cache->eprop_names.push_back(std::vector()); + for (int j = 0; j < g->g->edge_property_num(i); ++j) { + g->cache->eprop_names[i].push_back(g->g->schema().GetEdgePropertyName(i, j)); + } + } +} diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 01fc6671d..d446c3d19 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -96,13 +96,26 @@ unsigned _grin_get_prop_from_property(unsigned long long int); #define GRIN_VID_T uint64_t /* The following data types shall be defined through typedef. */ -typedef vineyard::ArrowFragment _GRIN_GRAPH_T; +typedef vineyard::ArrowFragment _GRIN_GRAPH_T; +struct _GRAPH_CACHE { + vineyard::IdParser<_GRIN_GRAPH_T::vid_t> id_parser; + std::vector vtype_names; + std::vector etype_names; + std::vector> vprop_names; + std::vector> eprop_names; +}; + struct GRIN_GRAPH_T { vineyard::Client client; std::shared_ptr<_GRIN_GRAPH_T> _g; _GRIN_GRAPH_T* g; + _GRAPH_CACHE* cache; }; -typedef _GRIN_GRAPH_T::vertex_t _GRIN_VERTEX_T; + +void _prepare_cache(GRIN_GRAPH_T* g); + +typedef _GRIN_GRAPH_T::vertex_t _GRIN_VERTEX_T; + struct GRIN_EDGE_T { _GRIN_GRAPH_T::vid_t src; _GRIN_GRAPH_T::vid_t dst; diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index da060a550..896245c05 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -17,12 +17,8 @@ extern "C" { #ifdef GRIN_WITH_VERTEX_PROPERTY_NAME const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY vp) { - auto _g = static_cast(g)->g; - auto s = _g->schema().GetVertexPropertyName(_grin_get_type_from_property(vp), _grin_get_prop_from_property(vp)); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; // TODO: optimize after rebase, put strings in g. + auto bg = static_cast(g); + return bg->cache->vprop_names[_grin_get_type_from_property(vp)][_grin_get_prop_from_property(vp)].c_str(); } GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, @@ -54,12 +50,8 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const #ifdef GRIN_WITH_EDGE_PROPERTY_NAME const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY ep) { - auto _g = static_cast(g)->g; - auto s = _g->schema().GetEdgePropertyName(_grin_get_type_from_property(ep), _grin_get_prop_from_property(ep)); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; // TODO + auto bg = static_cast(g); + return bg->cache->eprop_names[_grin_get_type_from_property(ep)][_grin_get_prop_from_property(ep)].c_str(); } GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index bb0de2c9e..1a678cce5 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -22,7 +22,8 @@ bool grin_equal_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt1, GRIN_VERTEX_TYPE GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH g, GRIN_VERTEX v) { auto _g = static_cast(g)->g; - return _g->vertex_label(_GRIN_VERTEX_T(v)); // TODO + auto bg = static_cast(g); + return bg->cache->id_parser.GetLabelId(v); } void grin_destroy_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) {} @@ -66,11 +67,8 @@ GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE_L #ifdef GRIN_WITH_VERTEX_TYPE_NAME const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { auto _g = static_cast(g)->g; - auto s = _g->schema().GetVertexLabelName(vtype); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; // TODO + auto bg = static_cast(g); + return bg->cache->vtype_names[vtype].c_str(); } GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { @@ -144,11 +142,8 @@ GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST et #ifdef GRIN_WITH_EDGE_TYPE_NAME const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g)->g; - auto s = _g->schema().GetEdgeLabelName(etype); - int len = s.length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s.c_str()); - return out; // TODO + auto bg = static_cast(g); + return bg->cache->etype_names[etype].c_str(); } GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { diff --git a/modules/graph/grin/src/topology/structure.cc b/modules/graph/grin/src/topology/structure.cc index 8f8503bb1..c29e433a6 100644 --- a/modules/graph/grin/src/topology/structure.cc +++ b/modules/graph/grin/src/topology/structure.cc @@ -33,11 +33,13 @@ GRIN_GRAPH grin_get_graph_from_storage(int argc, char** argv) { g->_g = std::dynamic_pointer_cast<_GRIN_GRAPH_T>(g->client.GetObject(obj_id)); g->g = g->_g.get(); + _prepare_cache(g); return g; } void grin_destroy_graph(GRIN_GRAPH g) { auto _g = static_cast(g); + delete _g->cache; delete _g; } From 301a9233a155a098838e8440de1142fca0c66481 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Fri, 19 May 2023 07:30:36 +0000 Subject: [PATCH 76/85] update codegen rs --- modules/graph/grin/c/test.c | 7 +++++-- modules/graph/grin/rust/grin_v6d.rs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index cb045ed1a..73d25b1dc 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -473,11 +473,14 @@ void test_property_vertex_table(int argc, char** argv) { } const void* rv = grin_get_value_from_row(g, row, dt, j); if (dt == Int64) { - printf("vp_id %u v%zu %s value: %ld %ld\n", id, i, vp_name, + printf("vp_id %u v%zu %s value int64: %ld %ld\n", id, i, vp_name, *((long int*) pv), *((long int*) rv)); } else if (dt == String) { - printf("vp_id %u v%zu %s value: %s %s\n", id, i, vp_name, (char*) pv, + printf("vp_id %u v%zu %s value string: %s %s\n", id, i, vp_name, (char*) pv, (char*) rv); + } else if (dt == Int32) { + printf("vp_id %u v%zu %s value int32: %d %d\n", id, i, vp_name, *((int*)pv), + *((int*)rv)); } // grin_destroy_value(g, dt, pv); // grin_destroy_value(g, dt, rv); diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index 801d95d69..1ed45f06a 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -43,7 +43,7 @@ pub const GRIN_ERROR_CODE_UNKNOWN_DATATYPE: GrinErrorCode = 3; pub type GrinErrorCode = u32; #[doc = "@}"] pub type GrinGraph = *mut ::std::os::raw::c_void; -pub type GrinVertex = *mut ::std::os::raw::c_void; +pub type GrinVertex = u64; pub type GrinEdge = *mut ::std::os::raw::c_void; pub type GrinVertexList = *mut ::std::os::raw::c_void; pub type GrinVertexListIterator = *mut ::std::os::raw::c_void; @@ -1231,7 +1231,7 @@ extern "C" { pub const GRIN_NULL_GRAPH: GrinGraph = std::ptr::null_mut(); - pub const GRIN_NULL_VERTEX: GrinVertex = std::ptr::null_mut(); + pub const GRIN_NULL_VERTEX: GrinVertex = u64::MAX; pub const GRIN_NULL_EDGE: GrinEdge = std::ptr::null_mut(); From 9148ed705084091f01faac6db2455034f53dae94 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Fri, 19 May 2023 09:00:50 +0000 Subject: [PATCH 77/85] is_simple in adjlist --- modules/graph/grin/c/test.c | 2 + modules/graph/grin/src/predefine.cc | 38 ++++++++----- modules/graph/grin/src/predefine.h | 3 ++ .../graph/grin/src/topology/adjacentlist.cc | 54 +++++++++++++------ 4 files changed, 69 insertions(+), 28 deletions(-) diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index 73d25b1dc..bea04d3aa 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -958,6 +958,8 @@ void test_topology_structure(int argc, char** argv) { } void test_topology_adjacent_list(int argc, char** argv, GRIN_DIRECTION dir) { + printf("+++++++++++++++++++++ Test topology/adjacent_list +++++++++++++++++++++\n"); + GRIN_GRAPH g = get_graph(argc, argv); GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc index d1fc2fce6..08d000c82 100644 --- a/modules/graph/grin/src/predefine.cc +++ b/modules/graph/grin/src/predefine.cc @@ -124,21 +124,33 @@ void __grin_init_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { #ifdef GRIN_ENABLE_ADJACENT_LIST void __grin_init_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { - al->offsets.clear(); - al->data.clear(); - _GRIN_GRAPH_T::raw_adj_list_t ral; - al->offsets.push_back(0); - size_t sum = 0; - for (auto etype = al->etype_begin; etype < al->etype_end; ++etype) { + if (al->etype_begin + 1 == al->etype_end) { + al->is_simple = true; + _GRIN_GRAPH_T::raw_adj_list_t ral; if (al->dir == GRIN_DIRECTION::IN) { - ral = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); - } else { - ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); - } - sum += ral.size(); - al->offsets.push_back(sum); - al->data.push_back(ral); + ral = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), al->etype_begin); + } else { + ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), al->etype_begin); + } + al->begin_ = ral.begin(); + al->end_ = ral.end(); } + + al->offsets.clear(); + al->data.clear(); + al->offsets.push_back(0); + _GRIN_GRAPH_T::raw_adj_list_t ral; + size_t sum = 0; + for (auto etype = al->etype_begin; etype < al->etype_end; ++etype) { + if (al->dir == GRIN_DIRECTION::IN) { + ral = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); + } else { + ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); + } + sum += ral.size(); + al->offsets.push_back(sum); + al->data.push_back(ral); + } } #endif diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index d446c3d19..e3825a0a0 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -152,6 +152,9 @@ struct GRIN_ADJACENT_LIST_T { GRIN_DIRECTION dir; unsigned etype_begin; unsigned etype_end; + bool is_simple; + const _GRIN_GRAPH_T::nbr_unit_t* begin_; + const _GRIN_GRAPH_T::nbr_unit_t* end_; std::vector offsets; std::vector<_GRIN_GRAPH_T::raw_adj_list_t> data; }; diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 527279c4c..c8031de33 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -38,39 +38,63 @@ void grin_destroy_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { size_t grin_get_adjacent_list_size(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { auto _al = static_cast(al); + if (_al->is_simple) return _al->end_ - _al->begin_; return _al->offsets[_al->etype_end - _al->etype_begin]; } GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { auto _al = static_cast(al); - for (unsigned i = 0; i < _al->etype_end - _al->etype_begin; ++i) { - if (idx < _al->offsets[i+1]) { - auto _idx = idx - _al->offsets[i]; - auto _nbr = _al->data[i].begin() + _idx; - return _nbr->vid; + if (_al->is_simple) { + auto nbr = _al->begin_ + idx; + if (nbr < _al->end_) return nbr->vid; + } else { + for (unsigned i = 0; i < _al->etype_end - _al->etype_begin; ++i) { + if (idx < _al->offsets[i+1]) { + auto _idx = idx - _al->offsets[i]; + auto _nbr = _al->data[i].begin() + _idx; + return _nbr->vid; + } } } return GRIN_NULL_VERTEX; } GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { - auto _al = static_cast(al); - for (unsigned i = 0; i < _al->etype_end - _al->etype_begin; ++i) { - if (idx < _al->offsets[i+1]) { - auto _idx = idx - _al->offsets[i]; - auto _nbr = _al->data[i].begin() + _idx; + auto _al = static_cast(al); + if (_al->is_simple) { + auto nbr = _al->begin_ + idx; + if (nbr < _al->end_) { auto e = new GRIN_EDGE_T(); e->dir = _al->dir; - e->etype = _al->etype_begin + i; - e->eid = _nbr->eid; + e->etype = _al->etype_begin; + e->eid = nbr->eid; if (_al->dir == GRIN_DIRECTION::OUT) { e->src = _al->vid; - e->dst = _nbr->vid; + e->dst = nbr->vid; } else { - e->src = _nbr->vid; + e->src = nbr->vid; e->dst = _al->vid; } - return e; + return e; + } + } else { + for (unsigned i = 0; i < _al->etype_end - _al->etype_begin; ++i) { + if (idx < _al->offsets[i+1]) { + auto _idx = idx - _al->offsets[i]; + auto _nbr = _al->data[i].begin() + _idx; + auto e = new GRIN_EDGE_T(); + e->dir = _al->dir; + e->etype = _al->etype_begin + i; + e->eid = _nbr->eid; + if (_al->dir == GRIN_DIRECTION::OUT) { + e->src = _al->vid; + e->dst = _nbr->vid; + } else { + e->src = _nbr->vid; + e->dst = _al->vid; + } + return e; + } } } return GRIN_NULL_EDGE; From d3a44f4bac836fff5f63546767c3aa1297e3a041 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Sun, 21 May 2023 08:06:19 +0000 Subject: [PATCH 78/85] optimize vertexlist and adjlist impl --- modules/graph/grin/src/index/order.cc | 15 +- modules/graph/grin/src/partition/reference.cc | 5 +- modules/graph/grin/src/partition/topology.cc | 18 +- modules/graph/grin/src/predefine.cc | 189 ------------- modules/graph/grin/src/predefine.h | 256 +++++++++++++++--- modules/graph/grin/src/property/property.cc | 8 +- modules/graph/grin/src/property/topology.cc | 22 +- modules/graph/grin/src/property/type.cc | 15 +- .../graph/grin/src/topology/adjacentlist.cc | 127 ++++----- modules/graph/grin/src/topology/vertexlist.cc | 83 +++--- 10 files changed, 355 insertions(+), 383 deletions(-) delete mode 100644 modules/graph/grin/src/predefine.cc diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index ea8a9bc50..c7dddf2fc 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -24,15 +24,12 @@ bool grin_smaller_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { #if defined(GRIN_ASSUME_ALL_VERTEX_LIST_SORTED) && defined(GRIN_ENABLE_VERTEX_LIST_ARRAY) size_t grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v) { - auto _g = static_cast(g)->g; auto _vl = static_cast(vl); - auto bg = static_cast(g); - auto vtype = bg->cache->id_parser.GetLabelId(v); - if (vtype < _vl->type_begin || vtype >= _vl->type_end) return GRIN_NULL_SIZE; - auto offset = v - _vl->vrs[vtype - _vl->type_begin].begin_value(); - if (offset < _vl->vrs[vtype - _vl->type_begin].size()) { - return _vl->offsets[vtype - _vl->type_begin] + offset; - } - return GRIN_NULL_SIZE; + if (v < _vl->end_ && v >= _vl->begin_) return v - _vl->begin_; + if (_vl->is_simple) return GRIN_NULL_SIZE; + if (_vl->offsets.empty()) __grin_init_complex_vertex_list(static_cast(g)->g, _vl); + auto _cache = static_cast(g)->cache; + auto vtype = _cache->id_parser.GetLabelId(v); + return v - _vl->offsets[vtype].second + _vl->offsets[vtype].first; } #endif diff --git a/modules/graph/grin/src/partition/reference.cc b/modules/graph/grin/src/partition/reference.cc index 97d2f7d95..a9f9507ce 100644 --- a/modules/graph/grin/src/partition/reference.cc +++ b/modules/graph/grin/src/partition/reference.cc @@ -36,9 +36,8 @@ GRIN_VERTEX grin_get_vertex_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { } GRIN_PARTITION grin_get_master_partition_from_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { - auto _g = static_cast(g)->g; - auto bg = static_cast(g); - return bg->cache->id_parser.GetFid(vr); + auto _cache = static_cast(g)->cache; + return _cache->id_parser.GetFid(vr); } const char* grin_serialize_vertex_ref(GRIN_GRAPH g, GRIN_VERTEX_REF vr) { diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc index 7d964f8b3..6ead708aa 100644 --- a/modules/graph/grin/src/partition/topology.cc +++ b/modules/graph/grin/src/partition/topology.cc @@ -20,28 +20,26 @@ extern "C" { #ifdef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST GRIN_VERTEX_LIST grin_select_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { - auto _g = static_cast(g)->g; auto _vl = static_cast(vl); if (_vl->all_master_mirror > 0) return GRIN_NULL_LIST; - + auto _g = static_cast(g)->g; auto fvl = new GRIN_VERTEX_LIST_T(); - fvl->type_begin = _vl->type_begin; - fvl->type_end = _vl->type_end; fvl->all_master_mirror = 1; - __grin_init_vertex_list(_g, fvl); + fvl->vtype = _vl->vtype; + fvl->is_simple = _vl->is_simple; + if (fvl->is_simple) __grin_init_simple_vertex_list(_g, fvl); return fvl; } GRIN_VERTEX_LIST grin_select_mirror_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { - auto _g = static_cast(g)->g; auto _vl = static_cast(vl); if (_vl->all_master_mirror > 0) return GRIN_NULL_LIST; - + auto _g = static_cast(g)->g; auto fvl = new GRIN_VERTEX_LIST_T(); - fvl->type_begin = _vl->type_begin; - fvl->type_end = _vl->type_end; fvl->all_master_mirror = 2; - __grin_init_vertex_list(_g, fvl); + fvl->vtype = _vl->vtype; + fvl->is_simple = _vl->is_simple; + if (fvl->is_simple) __grin_init_simple_vertex_list(_g, fvl); return fvl; } #endif diff --git a/modules/graph/grin/src/predefine.cc b/modules/graph/grin/src/predefine.cc deleted file mode 100644 index 08d000c82..000000000 --- a/modules/graph/grin/src/predefine.cc +++ /dev/null @@ -1,189 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "graph/grin/src/predefine.h" -extern "C" { -#include "graph/grin/include/common/error.h" -} - -std::string GetDataTypeName(GRIN_DATATYPE type) { - switch (type) { - case GRIN_DATATYPE::Int32: - return "int32"; - case GRIN_DATATYPE::UInt32: - return "uint32"; - case GRIN_DATATYPE::Int64: - return "int64"; - case GRIN_DATATYPE::UInt64: - return "uint64"; - case GRIN_DATATYPE::Float: - return "float"; - case GRIN_DATATYPE::Double: - return "double"; - case GRIN_DATATYPE::String: - return "string"; - case GRIN_DATATYPE::Date32: - return "date32"; - case GRIN_DATATYPE::Time32: - return "time32"; - case GRIN_DATATYPE::Timestamp64: - return "timestamp64"; - default: - return "undefined"; - } -} - -GRIN_DATATYPE ArrowToDataType(std::shared_ptr type) { - if (type == nullptr) { - return GRIN_DATATYPE::Undefined; - } else if (arrow::int32()->Equals(type)) { - return GRIN_DATATYPE::Int32; - } else if (arrow::int64()->Equals(type)) { - return GRIN_DATATYPE::Int64; - } else if (arrow::float32()->Equals(type)) { - return GRIN_DATATYPE::Float; - } else if (arrow::uint32()->Equals(type)) { - return GRIN_DATATYPE::UInt32; - } else if (arrow::uint64()->Equals(type)) { - return GRIN_DATATYPE::UInt64; - } else if (arrow::float64()->Equals(type)) { - return GRIN_DATATYPE::Double; - } else if (arrow::utf8()->Equals(type)) { - return GRIN_DATATYPE::String; - } else if (arrow::large_utf8()->Equals(type)) { - return GRIN_DATATYPE::String; - } - return GRIN_DATATYPE::Undefined; -} - -const void* _get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - unsigned vtype = _grin_get_type_from_property(vp); - if (v < _vpt->vbegin || v >= _vpt->vend || vtype != _vpt->vtype) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return NULL; - } - unsigned vprop = _grin_get_prop_from_property(vp); - auto offset = v - _vpt->vbegin; - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - return vineyard::get_arrow_array_data_element(array, offset); -} - -const void* _get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { - grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; - return NULL; - } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - return vineyard::get_arrow_array_data_element(array, offset); -} - - -#ifdef GRIN_ENABLE_VERTEX_LIST -void __grin_init_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { - vl->offsets.clear(); - vl->vrs.clear(); - _GRIN_GRAPH_T::vertices_t vr; - vl->offsets.push_back(0); - size_t sum = 0; - for (auto vtype = vl->type_begin; vtype < vl->type_end; ++vtype) { - if (vl->all_master_mirror == 0) { - vr = g->Vertices(vtype); - } else if (vl->all_master_mirror == 1) { - vr = g->InnerVertices(vtype); - } else { - vr = g->OuterVertices(vtype); - } - sum += vr.size(); - vl->offsets.push_back(sum); - vl->vrs.push_back(vr); - } -} -#endif - -#ifdef GRIN_ENABLE_ADJACENT_LIST -void __grin_init_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { - if (al->etype_begin + 1 == al->etype_end) { - al->is_simple = true; - _GRIN_GRAPH_T::raw_adj_list_t ral; - if (al->dir == GRIN_DIRECTION::IN) { - ral = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), al->etype_begin); - } else { - ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), al->etype_begin); - } - al->begin_ = ral.begin(); - al->end_ = ral.end(); - } - - al->offsets.clear(); - al->data.clear(); - al->offsets.push_back(0); - _GRIN_GRAPH_T::raw_adj_list_t ral; - size_t sum = 0; - for (auto etype = al->etype_begin; etype < al->etype_end; ++etype) { - if (al->dir == GRIN_DIRECTION::IN) { - ral = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); - } else { - ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), etype); - } - sum += ral.size(); - al->offsets.push_back(sum); - al->data.push_back(ral); - } -} -#endif - -unsigned long long int _grin_create_property(unsigned type, unsigned prop) { - return ((unsigned long long int)type << 32) | prop; -} - -unsigned _grin_get_type_from_property(unsigned long long int prop) { - return (unsigned)(prop >> 32); -} - -unsigned _grin_get_prop_from_property(unsigned long long int prop) { - return (unsigned)(prop & 0xffffffff); -} - -void _prepare_cache(GRIN_GRAPH_T* g) { - g->cache = new _GRAPH_CACHE(); - g->cache->id_parser = vineyard::IdParser<_GRIN_GRAPH_T::vid_t>(); - g->cache->id_parser.Init(g->g->fnum(), g->g->vertex_label_num()); - - for (int i = 0; i < g->g->vertex_label_num(); ++i) { - g->cache->vtype_names.push_back(g->g->schema().GetVertexLabelName(i)); - g->cache->vprop_names.push_back(std::vector()); - for (int j = 0; j < g->g->vertex_property_num(i); ++j) { - g->cache->vprop_names[i].push_back(g->g->schema().GetVertexPropertyName(i, j)); - } - } - - for (int i = 0; i < g->g->edge_label_num(); ++i) { - g->cache->etype_names.push_back(g->g->schema().GetEdgeLabelName(i)); - g->cache->eprop_names.push_back(std::vector()); - for (int j = 0; j < g->g->edge_property_num(i); ++j) { - g->cache->eprop_names[i].push_back(g->g->schema().GetEdgePropertyName(i, j)); - } - } -} diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index e3825a0a0..844145b93 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -18,6 +18,7 @@ limitations under the License. extern "C" { #include "graph/grin/predefine.h" +#include "graph/grin/include/common/error.h" } #include "graph/fragment/arrow_fragment.h" @@ -77,20 +78,55 @@ struct GRIN_DATATYPE_ENUM { static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Timestamp64; }; -std::string GetDataTypeName(GRIN_DATATYPE); - -GRIN_DATATYPE ArrowToDataType(std::shared_ptr); - -const void* _get_value_from_vertex_property_table(GRIN_GRAPH, GRIN_VERTEX_PROPERTY_TABLE, GRIN_VERTEX, GRIN_VERTEX_PROPERTY); - -const void* _get_value_from_edge_property_table(GRIN_GRAPH, GRIN_EDGE_PROPERTY_TABLE, GRIN_EDGE, GRIN_EDGE_PROPERTY); - -unsigned long long int _grin_create_property(unsigned, unsigned); - -unsigned _grin_get_type_from_property(unsigned long long int); - -unsigned _grin_get_prop_from_property(unsigned long long int); +inline std::string GetDataTypeName(GRIN_DATATYPE type) { + switch (type) { + case GRIN_DATATYPE::Int32: + return "int32"; + case GRIN_DATATYPE::UInt32: + return "uint32"; + case GRIN_DATATYPE::Int64: + return "int64"; + case GRIN_DATATYPE::UInt64: + return "uint64"; + case GRIN_DATATYPE::Float: + return "float"; + case GRIN_DATATYPE::Double: + return "double"; + case GRIN_DATATYPE::String: + return "string"; + case GRIN_DATATYPE::Date32: + return "date32"; + case GRIN_DATATYPE::Time32: + return "time32"; + case GRIN_DATATYPE::Timestamp64: + return "timestamp64"; + default: + return "undefined"; + } +} +inline GRIN_DATATYPE ArrowToDataType(std::shared_ptr type) { + if (type == nullptr) { + return GRIN_DATATYPE::Undefined; + } else if (arrow::int32()->Equals(type)) { + return GRIN_DATATYPE::Int32; + } else if (arrow::int64()->Equals(type)) { + return GRIN_DATATYPE::Int64; + } else if (arrow::float32()->Equals(type)) { + return GRIN_DATATYPE::Float; + } else if (arrow::uint32()->Equals(type)) { + return GRIN_DATATYPE::UInt32; + } else if (arrow::uint64()->Equals(type)) { + return GRIN_DATATYPE::UInt64; + } else if (arrow::float64()->Equals(type)) { + return GRIN_DATATYPE::Double; + } else if (arrow::utf8()->Equals(type)) { + return GRIN_DATATYPE::String; + } else if (arrow::large_utf8()->Equals(type)) { + return GRIN_DATATYPE::String; + } + return GRIN_DATATYPE::Undefined; +} #define GRIN_OID_T int64_t #define GRIN_VID_T uint64_t @@ -112,7 +148,28 @@ struct GRIN_GRAPH_T { _GRAPH_CACHE* cache; }; -void _prepare_cache(GRIN_GRAPH_T* g); +inline void _prepare_cache(GRIN_GRAPH_T* g) { + g->cache = new _GRAPH_CACHE(); + g->cache->id_parser = vineyard::IdParser<_GRIN_GRAPH_T::vid_t>(); + g->cache->id_parser.Init(g->g->fnum(), g->g->vertex_label_num()); + + for (int i = 0; i < g->g->vertex_label_num(); ++i) { + g->cache->vtype_names.push_back(g->g->schema().GetVertexLabelName(i)); + g->cache->vprop_names.push_back(std::vector()); + for (int j = 0; j < g->g->vertex_property_num(i); ++j) { + g->cache->vprop_names[i].push_back(g->g->schema().GetVertexPropertyName(i, j)); + } + } + + for (int i = 0; i < g->g->edge_label_num(); ++i) { + g->cache->etype_names.push_back(g->g->schema().GetEdgeLabelName(i)); + g->cache->eprop_names.push_back(std::vector()); + for (int j = 0; j < g->g->edge_property_num(i); ++j) { + g->cache->eprop_names[i].push_back(g->g->schema().GetEdgePropertyName(i, j)); + } + } +} + typedef _GRIN_GRAPH_T::vertex_t _GRIN_VERTEX_T; @@ -126,51 +183,134 @@ struct GRIN_EDGE_T { #ifdef GRIN_ENABLE_VERTEX_LIST struct GRIN_VERTEX_LIST_T { - unsigned type_begin; - unsigned type_end; + _GRIN_GRAPH_T::vid_t begin_ = 0; + _GRIN_GRAPH_T::vid_t end_ = 0; unsigned all_master_mirror; - std::vector offsets; - std::vector<_GRIN_GRAPH_T::vertices_t> vrs; + unsigned vtype; + bool is_simple; + std::vector> offsets; }; -void __grin_init_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl); +inline void __grin_init_simple_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { + _GRIN_GRAPH_T::vertices_t vr; + if (vl->all_master_mirror == 0) { + vr = g->Vertices(vl->vtype); + } else if (vl->all_master_mirror == 1) { + vr = g->InnerVertices(vl->vtype); + } else { + vr = g->OuterVertices(vl->vtype); + } + vl->begin_ = vr.begin_value(); + vl->end_ = vr.end_value(); +} +inline void __grin_init_complex_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { + _GRIN_GRAPH_T::vertices_t vr; + size_t sum = 0; + for (unsigned i = 0; i < vl->vtype; ++i) { + if (vl->all_master_mirror == 0) { + vr = g->Vertices(i); + } else if (vl->all_master_mirror == 1) { + vr = g->InnerVertices(i); + } else { + vr = g->OuterVertices(i); + } + vl->offsets.push_back(std::make_pair(sum, vr.begin_value())); + sum += vr.size(); + } + vl->offsets.push_back(std::make_pair(sum, vr.end_value())); +} #endif #ifdef GRIN_ENABLE_VERTEX_LIST_ITERATOR struct GRIN_VERTEX_LIST_ITERATOR_T { - unsigned type_begin; - unsigned type_end; + _GRIN_GRAPH_T::vid_t end_; + _GRIN_GRAPH_T::vid_t current_; unsigned all_master_mirror; - unsigned type_current; - unsigned current; - _GRIN_GRAPH_T::vertices_t vr; + bool is_simple; + unsigned vtype_current; + unsigned vtype_end; }; +inline void __grin_next_valid_vertex_list_iterator(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_ITERATOR_T* vli) { + _GRIN_GRAPH_T::vertices_t vr; + while (vli->vtype_current < vli->vtype_end) { + if (vli->all_master_mirror == 0) { + vr = g->Vertices(vli->vtype_current); + } else if (vli->all_master_mirror == 1) { + vr = g->InnerVertices(vli->vtype_current); + } else { + vr = g->OuterVertices(vli->vtype_current); + } + if (vr.size() > 0) { + vli->current_ = vr.begin_value(); + vli->end_ = vr.end_value(); + break; + } + vli->vtype_current++; + } +} #endif #ifdef GRIN_ENABLE_ADJACENT_LIST struct GRIN_ADJACENT_LIST_T { + const _GRIN_GRAPH_T::nbr_unit_t* begin_ = nullptr; + const _GRIN_GRAPH_T::nbr_unit_t* end_ = nullptr; _GRIN_GRAPH_T::vid_t vid; GRIN_DIRECTION dir; - unsigned etype_begin; - unsigned etype_end; + unsigned etype; bool is_simple; - const _GRIN_GRAPH_T::nbr_unit_t* begin_; - const _GRIN_GRAPH_T::nbr_unit_t* end_; - std::vector offsets; - std::vector<_GRIN_GRAPH_T::raw_adj_list_t> data; + std::vector> offsets; }; -void __grin_init_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al); +inline void __grin_init_simple_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { + _GRIN_GRAPH_T::raw_adj_list_t ral; + if (al->dir == GRIN_DIRECTION::IN) { + ral = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), al->etype); + } else { + ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), al->etype); + } + al->begin_ = ral.begin(); + al->end_ = ral.end(); +} +inline void __grin_init_complex_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { + _GRIN_GRAPH_T::raw_adj_list_t ral; + size_t sum = 0; + for (unsigned i = 0; i < al->etype; ++i) { + if (al->dir == GRIN_DIRECTION::IN) { + ral = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), i); + } else { + ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), i); + } + al->offsets.push_back(std::make_pair(sum, ral.begin())); + sum += ral.size(); + } + al->offsets.push_back(std::make_pair(sum, ral.end())); +} #endif #ifdef GRIN_ENABLE_ADJACENT_LIST_ITERATOR struct GRIN_ADJACENT_LIST_ITERATOR_T { + const _GRIN_GRAPH_T::nbr_unit_t* end_; + const _GRIN_GRAPH_T::nbr_unit_t* current_; _GRIN_GRAPH_T::vid_t vid; GRIN_DIRECTION dir; - unsigned etype_begin; - unsigned etype_end; + bool is_simple; unsigned etype_current; - unsigned current; - _GRIN_GRAPH_T::raw_adj_list_t data; -}; + unsigned etype_end; +}; +inline void __grin_next_valid_adjacent_list_iterator(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_ITERATOR_T* ali) { + _GRIN_GRAPH_T::raw_adj_list_t raj; + while (ali->etype_current < ali->etype_end) { + if (ali->dir == GRIN_DIRECTION::IN) { + raj = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); + } else { + raj = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); + } + if (raj.size() > 0) { + ali->current_ = raj.begin(); + ali->end_ = raj.end(); + break; + } + ali->etype_current++; + } +} #endif #ifdef GRIN_ENABLE_GRAPH_PARTITION @@ -188,6 +328,19 @@ typedef std::vector GRIN_PARTITION_LIST_T; typedef _GRIN_GRAPH_T::vid_t GRIN_VERTEX_REF_T; #endif +inline unsigned long long int _grin_create_property(unsigned type, unsigned prop) { + return ((unsigned long long int)type << 32) | prop; +} + +inline unsigned _grin_get_type_from_property(unsigned long long int prop) { + return (unsigned)(prop >> 32); +} + +inline unsigned _grin_get_prop_from_property(unsigned long long int prop) { + return (unsigned)(prop & 0xffffffff); +} + + #ifdef GRIN_WITH_VERTEX_PROPERTY typedef unsigned GRIN_VERTEX_TYPE_T; typedef std::vector GRIN_VERTEX_TYPE_LIST_T; @@ -198,6 +351,21 @@ struct GRIN_VERTEX_PROPERTY_TABLE_T { _GRIN_GRAPH_T::vid_t vbegin; _GRIN_GRAPH_T::vid_t vend; }; + +inline const void* _get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; + auto _g = static_cast(g)->g; + auto _vpt = static_cast(vpt); + unsigned vtype = _grin_get_type_from_property(vp); + if (v < _vpt->vbegin || v >= _vpt->vend || vtype != _vpt->vtype) { + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; + return NULL; + } + unsigned vprop = _grin_get_prop_from_property(vp); + auto offset = v - _vpt->vbegin; + auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); + return vineyard::get_arrow_array_data_element(array, offset); +} #endif #ifdef GRIN_WITH_EDGE_PROPERTY @@ -209,6 +377,22 @@ struct GRIN_EDGE_PROPERTY_TABLE_T { unsigned etype; unsigned num; }; + +inline const void* _get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + grin_error_code = GRIN_ERROR_CODE::NO_ERROR; + auto _g = static_cast(g)->g; + auto _ept = static_cast(ept); + auto _e = static_cast(e); + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + if (etype != _ept->etype || _e->eid >= _ept->num) { + grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; + return NULL; + } + auto offset = _e->eid; + auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); + return vineyard::get_arrow_array_data_element(array, offset); +} #endif #ifdef GRIN_ENABLE_ROW diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 896245c05..145a089e0 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -17,8 +17,8 @@ extern "C" { #ifdef GRIN_WITH_VERTEX_PROPERTY_NAME const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY vp) { - auto bg = static_cast(g); - return bg->cache->vprop_names[_grin_get_type_from_property(vp)][_grin_get_prop_from_property(vp)].c_str(); + auto _cache = static_cast(g)->cache; + return _cache->vprop_names[_grin_get_type_from_property(vp)][_grin_get_prop_from_property(vp)].c_str(); } GRIN_VERTEX_PROPERTY grin_get_vertex_property_by_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, @@ -50,8 +50,8 @@ GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_properties_by_name(GRIN_GRAPH g, const #ifdef GRIN_WITH_EDGE_PROPERTY_NAME const char* grin_get_edge_property_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_EDGE_PROPERTY ep) { - auto bg = static_cast(g); - return bg->cache->eprop_names[_grin_get_type_from_property(ep)][_grin_get_prop_from_property(ep)].c_str(); + auto _cache = static_cast(g)->cache; + return _cache->eprop_names[_grin_get_type_from_property(ep)][_grin_get_prop_from_property(ep)].c_str(); } GRIN_EDGE_PROPERTY grin_get_edge_property_by_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index 3ea5737d8..fe727fbe1 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -31,15 +31,15 @@ size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { #ifdef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST GRIN_VERTEX_LIST grin_select_type_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_LIST vl) { - auto _g = static_cast(g)->g; auto _vl = static_cast(vl); - if (_vl->type_begin > vtype || _vl->type_end <= vtype) return GRIN_NULL_LIST; + if (_vl->is_simple && _vl->vtype != vtype) return GRIN_NULL_LIST; + auto _g = static_cast(g)->g; auto fvl = new GRIN_VERTEX_LIST_T(); fvl->all_master_mirror = _vl->all_master_mirror; - fvl->type_begin = vtype; - fvl->type_end = vtype + 1; - __grin_init_vertex_list(_g, fvl); + fvl->vtype = vtype; + fvl->is_simple = true; + __grin_init_simple_vertex_list(_g, fvl); return fvl; } #endif @@ -54,17 +54,15 @@ GRIN_ADJACENT_LIST grin_select_neighbor_type_for_adjacent_list(GRIN_GRAPH, GRIN_ #ifdef GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST GRIN_ADJACENT_LIST grin_select_edge_type_for_adjacent_list(GRIN_GRAPH g, GRIN_EDGE_TYPE etype, GRIN_ADJACENT_LIST al) { - auto _g = static_cast(g)->g; auto _al = static_cast(al); - - if (_al->etype_begin > etype || _al->etype_end <= etype) return GRIN_NULL_LIST; - + if (_al->is_simple && _al->etype != etype) return GRIN_NULL_LIST; + auto _g = static_cast(g)->g; auto fal = new GRIN_ADJACENT_LIST_T(); fal->vid = _al->vid; fal->dir = _al->dir; - fal->etype_begin = etype; - fal->etype_end = etype + 1; - __grin_init_adjacent_list(_g, fal); + fal->etype = etype; + fal->is_simple = true; + __grin_init_simple_adjacent_list(_g, fal); return fal; } #endif \ No newline at end of file diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 1a678cce5..59dffa497 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -21,9 +21,8 @@ bool grin_equal_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt1, GRIN_VERTEX_TYPE } GRIN_VERTEX_TYPE grin_get_vertex_type(GRIN_GRAPH g, GRIN_VERTEX v) { - auto _g = static_cast(g)->g; - auto bg = static_cast(g); - return bg->cache->id_parser.GetLabelId(v); + auto _cache = static_cast(g)->cache; + return _cache->id_parser.GetLabelId(v); } void grin_destroy_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) {} @@ -66,9 +65,8 @@ GRIN_VERTEX_TYPE grin_get_vertex_type_from_list(GRIN_GRAPH g, GRIN_VERTEX_TYPE_L #ifdef GRIN_WITH_VERTEX_TYPE_NAME const char* grin_get_vertex_type_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { - auto _g = static_cast(g)->g; - auto bg = static_cast(g); - return bg->cache->vtype_names[vtype].c_str(); + auto _cache = static_cast(g)->cache; + return _cache->vtype_names[vtype].c_str(); } GRIN_VERTEX_TYPE grin_get_vertex_type_by_name(GRIN_GRAPH g, const char* name) { @@ -141,9 +139,8 @@ GRIN_EDGE_TYPE grin_get_edge_type_from_list(GRIN_GRAPH g, GRIN_EDGE_TYPE_LIST et #ifdef GRIN_WITH_EDGE_TYPE_NAME const char* grin_get_edge_type_name(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { - auto _g = static_cast(g)->g; - auto bg = static_cast(g); - return bg->cache->etype_names[etype].c_str(); + auto _cache = static_cast(g)->cache; + return _cache->etype_names[etype].c_str(); } GRIN_EDGE_TYPE grin_get_edge_type_by_name(GRIN_GRAPH g, const char* name) { diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index c8031de33..040728566 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -25,9 +25,13 @@ GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_V auto al = new GRIN_ADJACENT_LIST_T(); al->vid = v; al->dir = d; - al->etype_begin = 0; - al->etype_end = _g->edge_label_num(); - __grin_init_adjacent_list(_g, al); + al->etype = _g->edge_label_num(); + if (al->etype == 1) { + al->is_simple = true; + __grin_init_simple_adjacent_list(_g, al); + } else { + al->is_simple = false; + } return al; } @@ -39,21 +43,20 @@ void grin_destroy_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { size_t grin_get_adjacent_list_size(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { auto _al = static_cast(al); if (_al->is_simple) return _al->end_ - _al->begin_; - return _al->offsets[_al->etype_end - _al->etype_begin]; + if (_al->offsets.empty()) __grin_init_complex_adjacent_list(static_cast(g)->g, _al); + return _al->offsets[_al->etype].first; } GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { auto _al = static_cast(al); - if (_al->is_simple) { - auto nbr = _al->begin_ + idx; - if (nbr < _al->end_) return nbr->vid; - } else { - for (unsigned i = 0; i < _al->etype_end - _al->etype_begin; ++i) { - if (idx < _al->offsets[i+1]) { - auto _idx = idx - _al->offsets[i]; - auto _nbr = _al->data[i].begin() + _idx; - return _nbr->vid; - } + auto nbr = _al->begin_ + idx; + if (nbr < _al->end_) return nbr->vid; + if (_al->is_simple) return GRIN_NULL_VERTEX; + if (_al->offsets.empty()) __grin_init_complex_adjacent_list(static_cast(g)->g, _al); + for (unsigned i = 0; i < _al->etype; ++i) { + if (idx < _al->offsets[i+1].first) { + nbr = _al->offsets[i].second + idx - _al->offsets[i].first; + return nbr->vid; } } return GRIN_NULL_VERTEX; @@ -61,12 +64,29 @@ GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIS GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { auto _al = static_cast(al); - if (_al->is_simple) { - auto nbr = _al->begin_ + idx; - if (nbr < _al->end_) { + auto nbr = _al->begin_ + idx; + if (nbr < _al->end_) { + auto e = new GRIN_EDGE_T(); + e->dir = _al->dir; + e->etype = _al->etype; + e->eid = nbr->eid; + if (_al->dir == GRIN_DIRECTION::OUT) { + e->src = _al->vid; + e->dst = nbr->vid; + } else { + e->src = nbr->vid; + e->dst = _al->vid; + } + return e; + } + if (_al->is_simple) return GRIN_NULL_EDGE; + if (_al->offsets.empty()) __grin_init_complex_adjacent_list(static_cast(g)->g, _al); + for (unsigned i = 0; i < _al->etype; ++i) { + if (idx < _al->offsets[i+1].first) { + nbr = _al->offsets[i].second + idx - _al->offsets[i].first; auto e = new GRIN_EDGE_T(); e->dir = _al->dir; - e->etype = _al->etype_begin; + e->etype = i; e->eid = nbr->eid; if (_al->dir == GRIN_DIRECTION::OUT) { e->src = _al->vid; @@ -75,26 +95,7 @@ GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, e->src = nbr->vid; e->dst = _al->vid; } - return e; - } - } else { - for (unsigned i = 0; i < _al->etype_end - _al->etype_begin; ++i) { - if (idx < _al->offsets[i+1]) { - auto _idx = idx - _al->offsets[i]; - auto _nbr = _al->data[i].begin() + _idx; - auto e = new GRIN_EDGE_T(); - e->dir = _al->dir; - e->etype = _al->etype_begin + i; - e->eid = _nbr->eid; - if (_al->dir == GRIN_DIRECTION::OUT) { - e->src = _al->vid; - e->dst = _nbr->vid; - } else { - e->src = _nbr->vid; - e->dst = _al->vid; - } - return e; - } + return e; } } return GRIN_NULL_EDGE; @@ -108,23 +109,16 @@ GRIN_ADJACENT_LIST_ITERATOR grin_get_adjacent_list_begin(GRIN_GRAPH g, GRIN_ADJA auto ali = new GRIN_ADJACENT_LIST_ITERATOR_T(); ali->vid = _al->vid; ali->dir = _al->dir; - ali->etype_begin = _al->etype_begin; - ali->etype_end = _al->etype_end; - ali->etype_current = _al->etype_begin; - ali->current = 0; - - while (ali->etype_current < ali->etype_end) { - if (_al->offsets[ali->etype_current - ali->etype_begin + 1] > 0) break; - ali->etype_current++; - } - - if (ali->etype_current < ali->etype_end) { - if (ali->dir == GRIN_DIRECTION::IN) { - ali->data = _g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); - } else { - ali->data = _g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(ali->vid), ali->etype_current); - } + if (_al->is_simple) { + ali->is_simple = true; + ali->etype_current = _al->etype; + ali->etype_end = _al->etype + 1; + } else { + ali->is_simple = false; + ali->etype_current = 0; + ali->etype_end = _al->etype; } + __grin_next_valid_adjacent_list_iterator(_g, ali); return ali; } @@ -134,20 +128,18 @@ void grin_destroy_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR a } void grin_get_next_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { - auto _g = static_cast(g)->g; auto _ali = static_cast(ali); - _ali->current++; - while (_ali->etype_current < _ali->etype_end) { - if (_ali->current < _ali->data.size()) break; + _ali->current_++; + if (_ali->current_ < _ali->end_) return; + if (_ali->is_simple) { _ali->etype_current++; - _ali->current = 0; - if (_ali->etype_current >= _ali->etype_end) break; - if (_ali->dir == GRIN_DIRECTION::IN) { - _ali->data = _g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(_ali->vid), _ali->etype_current); - } else { - _ali->data = _g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(_ali->vid), _ali->etype_current); - } + return; } + + auto _g = static_cast(g)->g; + _GRIN_GRAPH_T::raw_adj_list_t raj; + _ali->etype_current++; + __grin_next_valid_adjacent_list_iterator(_g, _ali); } bool grin_is_adjacent_list_end(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { @@ -157,13 +149,12 @@ bool grin_is_adjacent_list_end(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { GRIN_VERTEX grin_get_neighbor_from_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { auto _ali = static_cast(ali); - auto _nbr = _ali->data.begin() + _ali->current; - return _nbr->vid; + return _ali->current_->vid; } GRIN_EDGE grin_get_edge_from_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR ali) { auto _ali = static_cast(ali); - auto _nbr = _ali->data.begin() + _ali->current; + auto _nbr = _ali->current_; auto e = new GRIN_EDGE_T(); e->dir = _ali->dir; e->etype = _ali->etype_current; diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index 1833c457d..89e6fac14 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -22,9 +22,14 @@ extern "C" { GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g) { auto _g = static_cast(g)->g; auto vl = new GRIN_VERTEX_LIST_T(); - vl->type_begin = 0; - vl->type_end = _g->vertex_label_num(); - __grin_init_vertex_list(_g, vl); + vl->all_master_mirror = 0; + vl->vtype = _g->vertex_label_num(); + if (vl->vtype == 1) { + vl->is_simple = true; + __grin_init_simple_vertex_list(_g, vl); + } else { + vl->is_simple = false; + } return vl; } @@ -35,15 +40,21 @@ void grin_destroy_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { size_t grin_get_vertex_list_size(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _vl = static_cast(vl); - return _vl->offsets[_vl->type_end - _vl->type_begin]; + if (_vl->is_simple) return _vl->end_ - _vl->begin_; + if (_vl->offsets.empty()) __grin_init_complex_vertex_list(static_cast(g)->g, _vl); + return _vl->offsets[_vl->vtype].first; } GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t idx) { auto _vl = static_cast(vl); - for (unsigned i = 0; i < _vl->type_end - _vl->type_begin; ++i) { - if (idx < _vl->offsets[i+1]) { - auto _idx = idx - _vl->offsets[i]; - return _vl->vrs[i].begin_value() + _idx; + auto v = _vl->begin_ + idx; + if (v < _vl->end_) return v; + if (_vl->is_simple) return GRIN_NULL_VERTEX; + if (_vl->offsets.empty()) __grin_init_complex_vertex_list(static_cast(g)->g, _vl); + for (unsigned i = 0; i < _vl->vtype; ++i) { + if (idx < _vl->offsets[i+1].first) { + v = _vl->offsets[i].second + idx - _vl->offsets[i].first; + return v; } } return GRIN_NULL_VERTEX; @@ -55,26 +66,17 @@ GRIN_VERTEX_LIST_ITERATOR grin_get_vertex_list_begin(GRIN_GRAPH g, GRIN_VERTEX_L auto _g = static_cast(g)->g; auto _vl = static_cast(vl); auto vli = new GRIN_VERTEX_LIST_ITERATOR_T(); - vli->type_begin = _vl->type_begin; - vli->type_end = _vl->type_end; - vli->type_current = _vl->type_begin; - vli->current = 0; vli->all_master_mirror = _vl->all_master_mirror; - - while (vli->type_current < vli->type_end) { - if (_vl->offsets[vli->type_current - vli->type_begin + 1] > 0) break; - vli->type_current++; - } - - if (vli->type_current < vli->type_end) { - if (vli->all_master_mirror == 0) { - vli->vr = _g->Vertices(vli->type_current); - } else if (vli->all_master_mirror == 1) { - vli->vr = _g->InnerVertices(vli->type_current); - } else { - vli->vr = _g->OuterVertices(vli->type_current); - } + if (_vl->is_simple) { + vli->is_simple = true; + vli->vtype_current = _vl->vtype; + vli->vtype_end = _vl->vtype + 1; + } else { + vli->is_simple = false; + vli->vtype_current = 0; + vli->vtype_end = _vl->vtype; } + __grin_next_valid_vertex_list_iterator(_g, vli); return vli; } @@ -84,32 +86,27 @@ void grin_destroy_vertex_list_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) } void grin_get_next_vertex_list_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { - auto _g = static_cast(g)->g; auto _vli = static_cast(vli); - _vli->current++; - while (_vli->type_current < _vli->type_end) { - if (_vli->current < _vli->vr.size()) break; - _vli->type_current++; - _vli->current = 0; - if (_vli->type_current < _vli->type_end) { - if (_vli->all_master_mirror == 0) { - _vli->vr = _g->Vertices(_vli->type_current); - } else if (_vli->all_master_mirror == 1) { - _vli->vr = _g->InnerVertices(_vli->type_current); - } else { - _vli->vr = _g->OuterVertices(_vli->type_current); - } - } + _vli->current_++; + if (_vli->current_ < _vli->end_) return; + if (_vli->is_simple) { + _vli->vtype_current++; + return; } + + auto _g = static_cast(g)->g; + _GRIN_GRAPH_T::vertex_range_t vr; + _vli->vtype_current++; + __grin_next_valid_vertex_list_iterator(_g, _vli); } bool grin_is_vertex_list_end(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { auto _vli = static_cast(vli); - return _vli->type_current >= _vli->type_end; + return _vli->vtype_current >= _vli->vtype_end; } GRIN_VERTEX grin_get_vertex_from_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { auto _vli = static_cast(vli); - return _vli->vr.begin_value() + _vli->current; + return _vli->current_; } #endif From 5582d1ba1fcf50b7923dc5fc108f49e805cf22cb Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 22 May 2023 11:35:41 +0000 Subject: [PATCH 79/85] update v6d impl for removing table from property --- modules/graph/grin/c/test.c | 83 ++-- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 23 +- modules/graph/grin/rust/Cargo.toml | 4 +- modules/graph/grin/rust/grin_v6d.rs | 390 ++++++--------- modules/graph/grin/rust/v6d_all.h | 2 +- modules/graph/grin/src/predefine.h | 76 +-- modules/graph/grin/src/property/primarykey.cc | 3 +- modules/graph/grin/src/property/property.cc | 195 ++++++++ .../graph/grin/src/property/propertylist.cc | 47 +- .../graph/grin/src/property/propertytable.cc | 469 ------------------ modules/graph/grin/src/property/row.cc | 215 ++++++++ modules/graph/grin/src/property/topology.cc | 4 +- modules/graph/grin/src/property/type.cc | 6 +- modules/graph/grin/src/proto/message.cc | 8 - 15 files changed, 683 insertions(+), 844 deletions(-) delete mode 100644 modules/graph/grin/src/property/propertytable.cc create mode 100644 modules/graph/grin/src/property/row.cc diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index bea04d3aa..dafa6654d 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -10,7 +10,7 @@ #include "../include/property/primarykey.h" #include "../include/property/property.h" #include "../include/property/propertylist.h" -#include "../include/property/propertytable.h" +#include "../include/property/row.h" #include "../include/property/topology.h" #include "../include/property/type.h" #include "../include/topology/adjacentlist.h" @@ -393,11 +393,10 @@ void test_property_topology(int argc, char** argv) { grin_destroy_graph(g); } -void test_property_vertex_table(int argc, char** argv) { - printf("+++++++++++++++++++++ Test property/table +++++++++++++++++++++\n"); +void test_property_vertex_property_value(int argc, char** argv) { + printf("------------ Test Vertex property value ------------\n"); GRIN_GRAPH g = get_graph(argc, argv); - printf("------------ Vertex property table ------------\n"); GRIN_VERTEX_TYPE_LIST vtl = grin_get_vertex_type_list(g); size_t vtl_size = grin_get_vertex_type_list_size(g, vtl); for (size_t vt_index = 0; vt_index < vtl_size; ++vt_index) { @@ -405,8 +404,6 @@ void test_property_vertex_table(int argc, char** argv) { GRIN_VERTEX_PROPERTY_LIST vpl = grin_get_vertex_property_list_by_type(g, vt); - GRIN_VERTEX_PROPERTY_TABLE vpt = - grin_get_vertex_property_table_by_type(g, vt); #ifdef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST GRIN_VERTEX_LIST all_vl = grin_get_vertex_list(g); @@ -433,7 +430,7 @@ void test_property_vertex_table(int argc, char** argv) { while (grin_is_vertex_list_end(g, vli) == 0) { GRIN_VERTEX v = grin_get_vertex_from_iter(g, vli); #endif - GRIN_ROW row = grin_get_row_from_vertex_property_table(g, vpt, v, vpl); + GRIN_ROW row = grin_get_vertex_row(g, v); for (size_t j = 0; j < vpl_size; ++j) { GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_from_list(g, vpl, j); GRIN_VERTEX_TYPE vt1 = grin_get_vertex_type_from_property(g, vp); @@ -465,7 +462,7 @@ void test_property_vertex_table(int argc, char** argv) { GRIN_DATATYPE dt = grin_get_vertex_property_datatype(g, vp); #ifdef GRIN_TRAIT_CONST_VALUE_PTR const void* pv = - grin_get_value_from_vertex_property_table(g, vpt, v, vp); + grin_get_vertex_property_value(g, v, vp); if (grin_get_last_error_code() == NO_ERROR) { printf("(Correct) no error\n"); } else { @@ -487,7 +484,7 @@ void test_property_vertex_table(int argc, char** argv) { #else if (dt == Int64) { long long int pv = - grin_get_int64_from_vertex_property_table(g, vpt, v, vp); + grin_get_vertex_property_value_of_int64(g, v, vp); if (grin_get_last_error_code() == NO_ERROR) { printf("(Correct) no error\n"); } else { @@ -497,7 +494,7 @@ void test_property_vertex_table(int argc, char** argv) { printf("vp_id %u v%zu %s value: %lld %lld\n", id, i, vp_name, pv, rv); } else if (dt == String) { const char* pv = - grin_get_string_from_vertex_property_table(g, vpt, v, vp); + grin_get_vertex_property_value_of_string(g, v, vp); if (grin_get_last_error_code() == NO_ERROR) { printf("(Correct) no error\n"); } else { @@ -579,14 +576,13 @@ void test_property_vertex_table(int argc, char** argv) { grin_destroy_vertex_list(g, typed_vl); grin_destroy_vertex_list(g, vl); grin_destroy_vertex_property_list(g, vpl); - grin_destroy_vertex_property_table(g, vpt); } grin_destroy_vertex_type_list(g, vtl); grin_destroy_graph(g); } -void test_property_edge_table(int argc, char** argv) { - printf("------------ Edge property table ------------\n"); +void test_property_edge_property_value(int argc, char** argv) { + printf("------------ Test Edge property value ------------\n"); GRIN_GRAPH g = get_graph(argc, argv); // edge GRIN_VERTEX v = get_vertex_marco(g); @@ -602,7 +598,6 @@ void test_property_edge_table(int argc, char** argv) { for (size_t i = 0; i < etl_size; ++i) { GRIN_EDGE_TYPE et = grin_get_edge_type_from_list(g, etl, i); - GRIN_EDGE_PROPERTY_TABLE ept = grin_get_edge_property_table_by_type(g, et); GRIN_EDGE_PROPERTY_LIST epl = grin_get_edge_property_list_by_type(g, et); size_t epl_size = grin_get_edge_property_list_size(g, epl); printf("edge property list size: %zu\n", epl_size); @@ -629,7 +624,7 @@ void test_property_edge_table(int argc, char** argv) { printf("edge type does not match\n"); } - GRIN_ROW row = grin_get_row_from_edge_property_table(g, ept, e, epl); + GRIN_ROW row = grin_get_edge_row(g, e); for (size_t k = 0; k < epl_size; ++k) { GRIN_EDGE_PROPERTY ep = grin_get_edge_property_from_list(g, epl, k); GRIN_EDGE_TYPE et2 = grin_get_edge_type_from_property(g, ep); @@ -653,8 +648,9 @@ void test_property_edge_table(int argc, char** argv) { #endif GRIN_DATATYPE dt = grin_get_edge_property_datatype(g, ep); #ifdef GRIN_TRAIT_CONST_VALUE_PTR - const void* pv = grin_get_value_from_edge_property_table(g, ept, e, ep); + const void* pv = grin_get_edge_property_value(g, e, ep); const void* rv = grin_get_value_from_row(g, row, dt, k); + if (dt == Int64) { printf("ep_id %u e%zu %s value: %ld %ld\n", id, j, ep_name, *((long int*) pv), *((long int*) rv)); @@ -672,22 +668,25 @@ void test_property_edge_table(int argc, char** argv) { #else if (dt == Int64) { long long int pv = - grin_get_int64_from_edge_property_table(g, ept, e, ep); + grin_get_edge_property_value_of_int64(g, ept, e, ep); long long int rv = grin_get_int64_from_row(g, row, k); printf("ep_id %u e%zu %s value: %lld %lld\n", id, j, ep_name, pv, rv); } else if (dt == String) { const char* pv = - grin_get_string_from_edge_property_table(g, ept, e, ep); + grin_get_edge_property_value_of_string(g, ept, e, ep); const char* rv = grin_get_string_from_row(g, row, k); printf("ep_id %u e%zu %s value: %s %s\n", id, j, ep_name, pv, rv); grin_destroy_string_value(g, pv); grin_destroy_string_value(g, rv); } else if (dt == Double) { - double pv = grin_get_double_from_edge_property_table(g, ept, e, ep); + double pv = grin_get_edge_property_value_of_double(g, ept, e, ep); double rv = grin_get_double_from_row(g, row, k); printf("ep_id %u e%zu %s value: %f %f\n", id, j, ep_name, pv, rv); } #endif + // grin_destroy_name(g, ep_name); + // grin_destroy_value(g, dt, pv); + // grin_destroy_value(g, dt, rv); } grin_destroy_row(g, row); @@ -792,6 +791,7 @@ void test_property_edge_table(int argc, char** argv) { grin_destroy_graph(g); } +#ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS void test_property_primary_key(int argc, char** argv) { printf( "+++++++++++++++++++++ Test property/primary key " @@ -854,6 +854,7 @@ void test_property_primary_key(int argc, char** argv) { grin_destroy_vertex_type(g, vt); } } +#endif void test_error_code(int argc, char** argv) { printf("+++++++++++++++++++++ Test error code +++++++++++++++++++++\n"); @@ -862,14 +863,12 @@ void test_error_code(int argc, char** argv) { GRIN_VERTEX_TYPE vt1 = grin_get_vertex_type_by_name(g, "person"); GRIN_VERTEX_TYPE vt2 = grin_get_vertex_type_by_name(g, "software"); GRIN_VERTEX_PROPERTY vp = grin_get_vertex_property_by_name(g, vt2, "lang"); - GRIN_VERTEX_PROPERTY_TABLE vpt = - grin_get_vertex_property_table_by_type(g, vt1); GRIN_VERTEX v = get_one_vertex(g); #ifdef GRIN_TRAIT_CONST_VALUE_PTR - const void* value = grin_get_value_from_vertex_property_table(g, vpt, v, vp); + const void* value = grin_get_vertex_property_value(g, v, vp); #else - const char* value = grin_get_string_from_vertex_property_table(g, vpt, v, vp); + const char* value = grin_get_vertex_property_value_of_string(g, v, vp); #endif if (grin_get_last_error_code() == INVALID_VALUE) { printf("(Correct) invalid value\n"); @@ -881,9 +880,11 @@ void test_error_code(int argc, char** argv) { void test_property(int argc, char** argv) { test_property_type(argc, argv); test_property_topology(argc, argv); - test_property_vertex_table(argc, argv); - test_property_edge_table(argc, argv); + test_property_vertex_property_value(argc, argv); + test_property_edge_property_value(argc, argv); +#ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS test_property_primary_key(argc, argv); +#endif test_error_code(argc, argv); } @@ -893,12 +894,18 @@ void test_partition_reference(int argc, char** argv) { GRIN_GRAPH g = get_graph(argc, argv); GRIN_PARTITION p0 = get_partition(argc, argv); +#ifdef GRIN_TRAIT_SELECT_MASTER_FOR_VERTEX_LIST GRIN_VERTEX_LIST vlist = grin_get_vertex_list(g); - GRIN_VERTEX_LIST_ITERATOR vli = grin_get_vertex_list_begin(g, vlist); GRIN_VERTEX_LIST mvlist = grin_select_master_for_vertex_list(g, vlist); + GRIN_VERTEX_LIST_ITERATOR vli = grin_get_vertex_list_begin(g, mvlist); grin_destroy_vertex_list(g, vlist); +#else + GRIN_VERTEX_LIST mvlist = grin_get_vertex_list(g); + GRIN_VERTEX_LIST_ITERATOR vli = grin_get_vertex_list_begin(g, mvlist); +#endif size_t cnt = 0; + size_t mcnt = 0; while (!grin_is_vertex_list_end(g, vli)) { cnt++; GRIN_VERTEX v = grin_get_vertex_from_iter(g, vli); @@ -916,13 +923,19 @@ void test_partition_reference(int argc, char** argv) { printf("vertex not match\n"); } - if (grin_is_master_vertex(g, v) && !grin_is_mirror_vertex(g, v)) { + if (grin_is_master_vertex(g, v)) { + mcnt++; GRIN_PARTITION p = grin_get_master_partition_from_vertex_ref(g, vref); if (!grin_equal_partition(g, p, p0)) { - printf("partition not match\n"); + printf("(Wrong) partition not match\n"); + } + } else if (grin_is_mirror_vertex(g, v)) { + GRIN_PARTITION p = grin_get_master_partition_from_vertex_ref(g, vref); + if (grin_equal_partition(g, p, p0)) { + printf("(Wrong) partition match\n"); } } else { - printf("(Wrong) test only has one partition\n"); + printf("(Wrong) vertex other than master or mirror\n"); } grin_destroy_vertex_ref(g, vref); @@ -933,8 +946,10 @@ void test_partition_reference(int argc, char** argv) { #ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY size_t mvlist_size = grin_get_vertex_list_size(g, mvlist); - if (mvlist_size != cnt) { + if (mvlist_size != mcnt) { printf("(Wrong) master vertex list size not match\n"); + } else { + printf("Master vertex number: %zu\n", mcnt); } #endif @@ -959,7 +974,6 @@ void test_topology_structure(int argc, char** argv) { void test_topology_adjacent_list(int argc, char** argv, GRIN_DIRECTION dir) { printf("+++++++++++++++++++++ Test topology/adjacent_list +++++++++++++++++++++\n"); - GRIN_GRAPH g = get_graph(argc, argv); GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); @@ -971,6 +985,13 @@ void test_topology_adjacent_list(int argc, char** argv, GRIN_DIRECTION dir) { while (!grin_is_vertex_list_end(g, vli)) { GRIN_VERTEX v = grin_get_vertex_from_iter(g, vli); +#ifdef GRIN_ENABLE_GRAPH_PARTITION + if (!grin_is_master_vertex(g, v)) { + grin_destroy_vertex(g, v); + grin_get_next_vertex_list_iter(g, vli); + continue; + } +#endif GRIN_ADJACENT_LIST al = grin_get_adjacent_list(g, dir, v); for (size_t i = 0; i <= etl_size; ++i) { GRIN_ADJACENT_LIST al1 = al; diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 44ee2e923..5597c5c10 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 44ee2e923bb9d31d2a8a3eb1a2075f9f970b9a17 +Subproject commit 5597c5c10ee2c2844c05d9906081368e48bdb7a0 diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 26bd51146..987129106 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -450,12 +450,13 @@ typedef enum { */ ///@{ /** @ingroup PropertyMacros - * @brief Enable the pure data structure Row, which is used in primary keys and tables. + * @brief Enable the pure data structure Row */ #define GRIN_ENABLE_ROW /** @ingroup PropertyMacros - * @brief Enable the pure data structure Row, which is used in primary keys and tables. + * @brief This trait is used to indicate the storage can return a pointer to the + * value of a property. */ #define GRIN_TRAIT_CONST_VALUE_PTR @@ -484,12 +485,6 @@ typedef enum { */ #define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE -/** @ingroup PropertyMacros - * @brief Enable the vertex property table structure, from where the value of property - * can be fetched using vertex as row index and property as column index. -*/ -#define GRIN_ENABLE_VERTEX_PROPERTY_TABLE - /** @ingroup PropertyMacros * @brief There are primary keys for vertices. Vertex primary keys is * a set of vertex properties whose values can distinguish vertices. When vertices are @@ -536,12 +531,6 @@ typedef enum { */ #define GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE -/** @ingroup PropertyMacros - * @brief Enable the edge property table structure, from where the value of property - * can be fetched using edge as row index and property as column index. -*/ -#define GRIN_ENABLE_EDGE_PROPERTY_TABLE - /** @ingroup PropertyMacros * @brief There are primary keys for edges. Edge primary keys is * a set of edge properties whose values can distinguish edges. When edges are @@ -665,14 +654,12 @@ typedef enum { #undef GRIN_WITH_VERTEX_PROPERTY_NAME #undef GRIN_WITH_VERTEX_TYPE_NAME #undef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE -#undef GRIN_ENABLE_VERTEX_PROPERTY_TABLE #undef GRIN_ENABLE_VERTEX_PRIMARY_KEYS #undef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY #undef GRIN_WITH_EDGE_PROPERTY #undef GRIN_WITH_EDGE_PROPERTY_NAME #undef GRIN_WITH_EDGE_TYPE_NAME #undef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE -#undef GRIN_ENABLE_EDGE_PROPERTY_TABLE #undef GRIN_ENABLE_EDGE_PRIMARY_KEYS #undef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY #undef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST @@ -697,14 +684,12 @@ typedef enum { #define GRIN_WITH_VERTEX_PROPERTY_NAME #define GRIN_WITH_VERTEX_TYPE_NAME #define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE -#define GRIN_ENABLE_VERTEX_PROPERTY_TABLE #define GRIN_ENABLE_VERTEX_PRIMARY_KEYS #define GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_PROPERTY #define GRIN_WITH_EDGE_PROPERTY #define GRIN_WITH_EDGE_PROPERTY_NAME #define GRIN_WITH_EDGE_TYPE_NAME #define GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE -#define GRIN_ENABLE_EDGE_PROPERTY_TABLE #define GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY #define GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST #define GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST @@ -918,7 +903,6 @@ typedef unsigned GRIN_VERTEX_TYPE; typedef void* GRIN_VERTEX_TYPE_LIST; typedef unsigned long long int GRIN_VERTEX_PROPERTY; typedef void* GRIN_VERTEX_PROPERTY_LIST; -typedef void* GRIN_VERTEX_PROPERTY_TABLE; #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_VERTEX_TYPE @@ -936,7 +920,6 @@ typedef void* GRIN_VEV_TYPE; typedef void* GRIN_VEV_TYPE_LIST; typedef unsigned long long int GRIN_EDGE_PROPERTY; typedef void* GRIN_EDGE_PROPERTY_LIST; -typedef void* GRIN_EDGE_PROPERTY_TABLE; #endif #ifdef GRIN_TRAIT_NATURAL_ID_FOR_EDGE_TYPE diff --git a/modules/graph/grin/rust/Cargo.toml b/modules/graph/grin/rust/Cargo.toml index cec24144c..47dc3bd33 100644 --- a/modules/graph/grin/rust/Cargo.toml +++ b/modules/graph/grin/rust/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["dijie"] [features] -default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_trait_fast_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_trait_const_value_ptr", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_property_table", "grin_enable_vertex_primary_keys", "grin_trait_natural_id_for_vertex_property", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_enable_edge_property_table", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_column_store_for_vertex_property", "grin_assume_column_store_for_edge_property", "grin_assume_all_vertex_list_sorted", "grin_enable_vertex_original_id_of_int64"] +default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_trait_fast_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_trait_const_value_ptr", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_primary_keys", "grin_trait_natural_id_for_vertex_property", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_column_store_for_vertex_property", "grin_assume_column_store_for_edge_property", "grin_assume_all_vertex_list_sorted", "grin_enable_vertex_original_id_of_int64"] grin_assume_has_directed_graph = [] grin_assume_has_undirected_graph = [] grin_assume_has_multi_edge_graph = [] @@ -49,14 +49,12 @@ grin_with_vertex_property = [] grin_with_vertex_property_name = [] grin_with_vertex_type_name = [] grin_trait_natural_id_for_vertex_type = [] -grin_enable_vertex_property_table = [] grin_enable_vertex_primary_keys = ["grin_enable_row"] grin_trait_natural_id_for_vertex_property = [] grin_with_edge_property = [] grin_with_edge_property_name = [] grin_with_edge_type_name = [] grin_trait_natural_id_for_edge_type = [] -grin_enable_edge_property_table = [] grin_enable_edge_primary_keys = ["grin_enable_row"] grin_trait_natural_id_for_edge_property = [] grin_trait_select_type_for_vertex_list = [] diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index 1ed45f06a..02a8e35b9 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -58,7 +58,6 @@ pub type GrinVertexType = u32; pub type GrinVertexTypeList = *mut ::std::os::raw::c_void; pub type GrinVertexProperty = u64; pub type GrinVertexPropertyList = *mut ::std::os::raw::c_void; -pub type GrinVertexPropertyTable = *mut ::std::os::raw::c_void; pub type GrinVertexTypeId = u32; pub type GrinVertexPropertyId = u32; pub type GrinEdgeType = u32; @@ -67,7 +66,6 @@ pub type GrinVevType = *mut ::std::os::raw::c_void; pub type GrinVevTypeList = *mut ::std::os::raw::c_void; pub type GrinEdgeProperty = u64; pub type GrinEdgePropertyList = *mut ::std::os::raw::c_void; -pub type GrinEdgePropertyTable = *mut ::std::os::raw::c_void; pub type GrinEdgeTypeId = u32; pub type GrinEdgePropertyId = u32; pub type GrinRow = *mut ::std::os::raw::c_void; @@ -483,6 +481,77 @@ extern "C" { arg2: GrinVertexProperty, ) -> GrinDatatype; + #[allow(unused)] + pub fn grin_get_vertex_property_value_of_int32( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> i32; + + #[allow(unused)] + pub fn grin_get_vertex_property_value_of_uint32( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> u32; + + #[allow(unused)] + pub fn grin_get_vertex_property_value_of_int64( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> i64; + + #[allow(unused)] + pub fn grin_get_vertex_property_value_of_uint64( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> u64; + + #[allow(unused)] + pub fn grin_get_vertex_property_value_of_float( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> f32; + + #[allow(unused)] + pub fn grin_get_vertex_property_value_of_double( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> f64; + + #[cfg(feature = "grin_with_vertex_property")] + #[allow(unused)] + pub fn grin_get_vertex_property_value_of_string( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> *const ::std::os::raw::c_char; + + #[allow(unused)] + pub fn grin_get_vertex_property_value_of_date32( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> i32; + + #[allow(unused)] + pub fn grin_get_vertex_property_value_of_time32( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> i32; + + #[allow(unused)] + pub fn grin_get_vertex_property_value_of_timestamp64( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> i64; + #[doc = " @brief get the vertex type that the property is bound to\n @param GrinVertexProperty vertex property"] #[cfg(feature = "grin_with_vertex_property")] #[allow(unused)] @@ -491,6 +560,14 @@ extern "C" { arg2: GrinVertexProperty, ) -> GrinVertexType; + #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_trait_const_value_ptr"))] + #[allow(unused)] + pub fn grin_get_vertex_property_value( + arg1: GrinGraph, + arg2: GrinVertex, + arg3: GrinVertexProperty, + ) -> *const ::std::os::raw::c_void; + #[cfg(feature = "grin_with_edge_property")] #[allow(unused)] pub fn grin_equal_edge_property( @@ -512,6 +589,77 @@ extern "C" { arg2: GrinEdgeProperty, ) -> GrinDatatype; + #[allow(unused)] + pub fn grin_get_edge_property_value_of_int32( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> i32; + + #[allow(unused)] + pub fn grin_get_edge_property_value_of_uint32( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> u32; + + #[allow(unused)] + pub fn grin_get_edge_property_value_of_int64( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> i64; + + #[allow(unused)] + pub fn grin_get_edge_property_value_of_uint64( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> u64; + + #[allow(unused)] + pub fn grin_get_edge_property_value_of_float( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> f32; + + #[allow(unused)] + pub fn grin_get_edge_property_value_of_double( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> f64; + + #[cfg(feature = "grin_with_edge_property")] + #[allow(unused)] + pub fn grin_get_edge_property_value_of_string( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> *const ::std::os::raw::c_char; + + #[allow(unused)] + pub fn grin_get_edge_property_value_of_date32( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> i32; + + #[allow(unused)] + pub fn grin_get_edge_property_value_of_time32( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> i32; + + #[allow(unused)] + pub fn grin_get_edge_property_value_of_timestamp64( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> i64; + #[doc = " @brief get the edge type that the property is bound to\n @param GrinEdgeProperty edge property"] #[cfg(feature = "grin_with_edge_property")] #[allow(unused)] @@ -520,6 +668,14 @@ extern "C" { arg2: GrinEdgeProperty, ) -> GrinEdgeType; + #[cfg(all(feature = "grin_with_edge_property", feature = "grin_trait_const_value_ptr"))] + #[allow(unused)] + pub fn grin_get_edge_property_value( + arg1: GrinGraph, + arg2: GrinEdge, + arg3: GrinEdgeProperty, + ) -> *const ::std::os::raw::c_void; + #[cfg(feature = "grin_with_vertex_property")] #[allow(unused)] pub fn grin_get_vertex_property_list_by_type( @@ -787,233 +943,15 @@ extern "C" { arg4: usize, ) -> *const ::std::os::raw::c_void; - #[doc = " @brief destroy vertex property table\n @param GrinVertexPropertyTable vertex property table"] - #[cfg(feature = "grin_enable_vertex_property_table")] - #[allow(unused)] - pub fn grin_destroy_vertex_property_table(arg1: GrinGraph, arg2: GrinVertexPropertyTable); - - #[doc = " @brief get the vertex property table of a certain vertex type\n No matter column or row store strategy is used in the storage,\n GRIN recommends to first get the property table of the vertex type,\n and then fetch values(rows) by vertex and property(list). However,\n GRIN does provide direct row fetching API when GrinAssumeColumnStoreForVertexProperty\n is NOT set.\n @param GrinGraph the graph\n @param GrinVertexType the vertex type"] - #[cfg(feature = "grin_enable_vertex_property_table")] - #[allow(unused)] - pub fn grin_get_vertex_property_table_by_type( - arg1: GrinGraph, - arg2: GrinVertexType, - ) -> GrinVertexPropertyTable; - - #[allow(unused)] - pub fn grin_get_int32_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> i32; - - #[allow(unused)] - pub fn grin_get_uint32_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> u32; - - #[allow(unused)] - pub fn grin_get_int64_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> i64; - - #[allow(unused)] - pub fn grin_get_uint64_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> u64; - - #[allow(unused)] - pub fn grin_get_float_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> f32; - - #[allow(unused)] - pub fn grin_get_double_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> f64; - - #[cfg(feature = "grin_enable_vertex_property_table")] - #[allow(unused)] - pub fn grin_get_string_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> *const ::std::os::raw::c_char; - - #[allow(unused)] - pub fn grin_get_date32_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> i32; - - #[allow(unused)] - pub fn grin_get_time32_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> i32; - - #[allow(unused)] - pub fn grin_get_timestamp64_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> i64; - - #[doc = " @brief get vertex property value from table as a const void*, callers don't have to\n destroy the returned value pointer since they are handled by the storage\n @param GrinVertexPropertyTable vertex property table\n @param GrinVertex the vertex which is the row index\n @param GrinVertexProperty the vertex property which is the column index\n @return can be casted to the property data type by the caller"] - #[cfg(all(feature = "grin_enable_vertex_property_table", feature = "grin_trait_const_value_ptr"))] - #[allow(unused)] - pub fn grin_get_value_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexProperty, - ) -> *const ::std::os::raw::c_void; - - #[doc = " @brief get vertex row from table\n @param GrinVertexPropertyTable vertex property table\n @param GrinVertex the vertex which is the row index\n @param GrinVertexPropertyList the vertex property list as columns"] - #[cfg(all(feature = "grin_enable_vertex_property_table", feature = "grin_enable_row"))] - #[allow(unused)] - pub fn grin_get_row_from_vertex_property_table( - arg1: GrinGraph, - arg2: GrinVertexPropertyTable, - arg3: GrinVertex, - arg4: GrinVertexPropertyList, - ) -> GrinRow; - - #[doc = " @brief destroy edge property table\n @param GrinEdgePropertyTable edge property table"] - #[cfg(feature = "grin_enable_edge_property_table")] - #[allow(unused)] - pub fn grin_destroy_edge_property_table(arg1: GrinGraph, arg2: GrinEdgePropertyTable); - - #[doc = " @brief get the edge property table of a certain edge type\n No matter column or row store strategy is used in the storage,\n GRIN recommends to first get the property table of the edge type,\n and then fetch values(rows) by edge and property(list). However,\n GRIN does provide direct row fetching API when GrinAssumeColumnStoreForEdgeProperty\n is NOT set.\n @param GrinGraph the graph\n @param GrinEdgeType the edge type"] - #[cfg(feature = "grin_enable_edge_property_table")] - #[allow(unused)] - pub fn grin_get_edge_property_table_by_type( - arg1: GrinGraph, - arg2: GrinEdgeType, - ) -> GrinEdgePropertyTable; - - #[allow(unused)] - pub fn grin_get_int32_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> i32; - - #[allow(unused)] - pub fn grin_get_uint32_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> u32; - - #[allow(unused)] - pub fn grin_get_int64_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> i64; - - #[allow(unused)] - pub fn grin_get_uint64_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> u64; - - #[allow(unused)] - pub fn grin_get_float_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> f32; - - #[allow(unused)] - pub fn grin_get_double_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> f64; - - #[cfg(feature = "grin_enable_edge_property_table")] - #[allow(unused)] - pub fn grin_get_string_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> *const ::std::os::raw::c_char; - - #[allow(unused)] - pub fn grin_get_date32_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> i32; - - #[allow(unused)] - pub fn grin_get_time32_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> i32; - + #[doc = " @brief get vertex row directly from the graph, this API only works for row store system\n @param GrinGraph the graph\n @param GrinVertex the vertex which is the row index\n @param GrinVertexPropertyList the vertex property list as columns"] + #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_enable_row"))] #[allow(unused)] - pub fn grin_get_timestamp64_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> i64; + pub fn grin_get_vertex_row(arg1: GrinGraph, arg2: GrinVertex) -> GrinRow; - #[doc = " @brief get edge property value from table as a const void*, callers don't have to\n destroy the returned value pointer since they are handled by the storage\n @param GrinEdgePropertyTable edge property table\n @param GrinEdge the edge which is the row index\n @param GrinEdgeProperty the edge property which is the column index\n @return can be casted to the property data type by the caller"] - #[cfg(all(feature = "grin_enable_edge_property_table", feature = "grin_trait_const_value_ptr"))] + #[doc = " @brief get edge row directly from the graph, this API only works for row store system\n @param GrinGraph the graph\n @param GrinEdge the edge which is the row index\n @param GrinEdgePropertyList the edge property list as columns"] + #[cfg(all(feature = "grin_with_edge_property", feature = "grin_enable_row"))] #[allow(unused)] - pub fn grin_get_value_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgeProperty, - ) -> *const ::std::os::raw::c_void; - - #[doc = " @brief get edge row from table\n @param GrinEdgePropertyTable edge property table\n @param GrinEdge the edge which is the row index\n @param GrinEdgePropertyList the edge property list as columns"] - #[cfg(all(feature = "grin_enable_edge_property_table", feature = "grin_enable_row"))] - #[allow(unused)] - pub fn grin_get_row_from_edge_property_table( - arg1: GrinGraph, - arg2: GrinEdgePropertyTable, - arg3: GrinEdge, - arg4: GrinEdgePropertyList, - ) -> GrinRow; + pub fn grin_get_edge_row(arg1: GrinGraph, arg2: GrinEdge) -> GrinRow; #[cfg(feature = "grin_with_vertex_property")] #[allow(unused)] diff --git a/modules/graph/grin/rust/v6d_all.h b/modules/graph/grin/rust/v6d_all.h index f4b284164..95181d29b 100644 --- a/modules/graph/grin/rust/v6d_all.h +++ b/modules/graph/grin/rust/v6d_all.h @@ -9,7 +9,7 @@ #include "../include/property/primarykey.h" #include "../include/property/property.h" #include "../include/property/propertylist.h" -#include "../include/property/propertytable.h" +#include "../include/property/row.h" #include "../include/property/topology.h" #include "../include/property/type.h" #include "../include/index/label.h" diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 844145b93..9c763e5f3 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -139,6 +139,8 @@ struct _GRAPH_CACHE { std::vector etype_names; std::vector> vprop_names; std::vector> eprop_names; + std::vector> vtables; + std::vector> etables; }; struct GRIN_GRAPH_T { @@ -153,19 +155,29 @@ inline void _prepare_cache(GRIN_GRAPH_T* g) { g->cache->id_parser = vineyard::IdParser<_GRIN_GRAPH_T::vid_t>(); g->cache->id_parser.Init(g->g->fnum(), g->g->vertex_label_num()); + g->cache->vtype_names.resize(g->g->vertex_label_num()); + g->cache->vtables.resize(g->g->vertex_label_num()); + g->cache->vprop_names.resize(g->g->vertex_label_num()); + for (int i = 0; i < g->g->vertex_label_num(); ++i) { - g->cache->vtype_names.push_back(g->g->schema().GetVertexLabelName(i)); - g->cache->vprop_names.push_back(std::vector()); + g->cache->vtype_names[i] = g->g->schema().GetVertexLabelName(i); + g->cache->vtables[i] = g->g->vertex_data_table(i); + g->cache->vprop_names[i].resize(g->g->vertex_property_num(i)); for (int j = 0; j < g->g->vertex_property_num(i); ++j) { - g->cache->vprop_names[i].push_back(g->g->schema().GetVertexPropertyName(i, j)); + g->cache->vprop_names[i][j] = g->g->schema().GetVertexPropertyName(i, j); } } + g->cache->etype_names.resize(g->g->edge_label_num()); + g->cache->etables.resize(g->g->edge_label_num()); + g->cache->eprop_names.resize(g->g->edge_label_num()); + for (int i = 0; i < g->g->edge_label_num(); ++i) { - g->cache->etype_names.push_back(g->g->schema().GetEdgeLabelName(i)); - g->cache->eprop_names.push_back(std::vector()); + g->cache->etype_names[i] = g->g->schema().GetEdgeLabelName(i); + g->cache->etables[i] = g->g->edge_data_table(i); + g->cache->eprop_names[i].resize(g->g->edge_property_num(i)); for (int j = 0; j < g->g->edge_property_num(i); ++j) { - g->cache->eprop_names[i].push_back(g->g->schema().GetEdgePropertyName(i, j)); + g->cache->eprop_names[i][j] = g->g->schema().GetEdgePropertyName(i, j); } } } @@ -205,6 +217,7 @@ inline void __grin_init_simple_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* inline void __grin_init_complex_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T* vl) { _GRIN_GRAPH_T::vertices_t vr; size_t sum = 0; + vl->offsets.resize(vl->vtype + 1); for (unsigned i = 0; i < vl->vtype; ++i) { if (vl->all_master_mirror == 0) { vr = g->Vertices(i); @@ -213,10 +226,10 @@ inline void __grin_init_complex_vertex_list(_GRIN_GRAPH_T* g, GRIN_VERTEX_LIST_T } else { vr = g->OuterVertices(i); } - vl->offsets.push_back(std::make_pair(sum, vr.begin_value())); + vl->offsets[i] = std::make_pair(sum, vr.begin_value()); sum += vr.size(); } - vl->offsets.push_back(std::make_pair(sum, vr.end_value())); + vl->offsets[vl->vtype] = std::make_pair(sum, vr.end_value()); } #endif @@ -272,16 +285,17 @@ inline void __grin_init_simple_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIS inline void __grin_init_complex_adjacent_list(_GRIN_GRAPH_T* g, GRIN_ADJACENT_LIST_T* al) { _GRIN_GRAPH_T::raw_adj_list_t ral; size_t sum = 0; + al->offsets.resize(al->etype + 1); for (unsigned i = 0; i < al->etype; ++i) { if (al->dir == GRIN_DIRECTION::IN) { ral = g->GetIncomingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), i); } else { ral = g->GetOutgoingRawAdjList(_GRIN_GRAPH_T::vertex_t(al->vid), i); } - al->offsets.push_back(std::make_pair(sum, ral.begin())); + al->offsets[i] = std::make_pair(sum, ral.begin()); sum += ral.size(); } - al->offsets.push_back(std::make_pair(sum, ral.end())); + al->offsets[al->etype] = std::make_pair(sum, ral.end()); } #endif @@ -346,25 +360,19 @@ typedef unsigned GRIN_VERTEX_TYPE_T; typedef std::vector GRIN_VERTEX_TYPE_LIST_T; typedef unsigned long long int GRIN_VERTEX_PROPERTY_T; typedef std::vector GRIN_VERTEX_PROPERTY_LIST_T; -struct GRIN_VERTEX_PROPERTY_TABLE_T { - unsigned vtype; - _GRIN_GRAPH_T::vid_t vbegin; - _GRIN_GRAPH_T::vid_t vend; -}; -inline const void* _get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { +inline const void* _get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - unsigned vtype = _grin_get_type_from_property(vp); - if (v < _vpt->vbegin || v >= _vpt->vend || vtype != _vpt->vtype) { + auto _cache = static_cast(g)->cache; + unsigned vtype0 = _cache->id_parser.GetLabelId(v); + unsigned vtype1 = _grin_get_type_from_property(vp); + if (vtype0 != vtype1) { grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return NULL; - } + } unsigned vprop = _grin_get_prop_from_property(vp); - auto offset = v - _vpt->vbegin; - auto array = _g->vertex_data_table(vtype)->column(vprop)->chunk(0); - return vineyard::get_arrow_array_data_element(array, offset); + auto array = _cache->vtables[vtype0]->column(vprop)->chunk(0); + return vineyard::get_arrow_array_data_element(array, _cache->id_parser.GetOffset(v)); } #endif @@ -373,25 +381,19 @@ typedef unsigned GRIN_EDGE_TYPE_T; typedef std::vector GRIN_EDGE_TYPE_LIST_T; typedef unsigned long long int GRIN_EDGE_PROPERTY_T; typedef std::vector GRIN_EDGE_PROPERTY_LIST_T; -struct GRIN_EDGE_PROPERTY_TABLE_T { - unsigned etype; - unsigned num; -}; -inline const void* _get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { +inline const void* _get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { grin_error_code = GRIN_ERROR_CODE::NO_ERROR; - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); auto _e = static_cast(e); - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - if (etype != _ept->etype || _e->eid >= _ept->num) { + unsigned etype = _grin_get_type_from_property(ep); + if (_e->etype != etype) { grin_error_code = GRIN_ERROR_CODE::INVALID_VALUE; return NULL; } - auto offset = _e->eid; - auto array = _g->edge_data_table(etype)->column(eprop)->chunk(0); - return vineyard::get_arrow_array_data_element(array, offset); + auto _cache = static_cast(g)->cache; + unsigned eprop = _grin_get_prop_from_property(ep); + auto array = _cache->etables[etype]->column(eprop)->chunk(0); + return vineyard::get_arrow_array_data_element(array, _e->eid); } #endif diff --git a/modules/graph/grin/src/property/primarykey.cc b/modules/graph/grin/src/property/primarykey.cc index 538331462..b9e96f8d2 100644 --- a/modules/graph/grin/src/property/primarykey.cc +++ b/modules/graph/grin/src/property/primarykey.cc @@ -23,8 +23,9 @@ extern "C" { GRIN_VERTEX_TYPE_LIST grin_get_vertex_types_with_primary_keys(GRIN_GRAPH g) { auto _g = static_cast(g)->g; auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); + vtl->resize(_g->vertex_label_num()); for (auto i = 0; i < _g->vertex_label_num(); ++i) { - vtl->push_back(i); + (*vtl)[i] = i; } return vtl; } diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 145a089e0..742de7430 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -95,11 +95,109 @@ GRIN_DATATYPE grin_get_vertex_property_datatype(GRIN_GRAPH g, GRIN_VERTEX_PROPER return ArrowToDataType(dt); } +int grin_get_vertex_property_value_of_int32(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return 0; + return *static_cast(result); +} + +unsigned int grin_get_vertex_property_value_of_uint32(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return 0; + return *static_cast(result); +} + +long long int grin_get_vertex_property_value_of_int64(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return 0; + return *static_cast(result); +} + +unsigned long long int grin_get_vertex_property_value_of_uint64(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return 0; + return *static_cast(result); +} + +float grin_get_vertex_property_value_of_float(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return 0; + return *static_cast(result); +} + +double grin_get_vertex_property_value_of_double(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return 0; + return *static_cast(result); +} + +const char* grin_get_vertex_property_value_of_string(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return NULL; + return static_cast(result); +} + +int grin_get_vertex_property_value_of_date32(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return 0; + return *static_cast(result); +} + +int grin_get_vertex_property_value_of_time32(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return 0; + return *static_cast(result); +} + +long long int grin_get_vertex_property_value_of_timestamp64(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + const void* result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return 0; + return *static_cast(result); +} + + GRIN_VERTEX_TYPE grin_get_vertex_type_from_property(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY vp) { return _grin_get_type_from_property(vp); } #endif +#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_TRAIT_CONST_VALUE_PTR) +const void* grin_get_vertex_property_value(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { + auto result = _get_value_from_vertex_property_table(g, v, vp); + if (result == NULL) return NULL; + auto _g = static_cast(g)->g; + unsigned vtype = _grin_get_type_from_property(vp); + unsigned vprop = _grin_get_prop_from_property(vp); + auto _dt = _g->schema().GetVertexPropertyType(vtype, vprop); + auto dt = ArrowToDataType(_dt); + switch (dt) { + case GRIN_DATATYPE::Int32: + return static_cast(result); + case GRIN_DATATYPE::UInt32: + return static_cast(result); + case GRIN_DATATYPE::Int64: + return static_cast(result); + case GRIN_DATATYPE::UInt64: + return static_cast(result); + case GRIN_DATATYPE::Float: + return static_cast(result); + case GRIN_DATATYPE::Double: + return static_cast(result); + case GRIN_DATATYPE::String: + return static_cast(result)->c_str(); + case GRIN_DATATYPE::Date32: + return new int32_t(*static_cast(result)); + case GRIN_DATATYPE::Time32: + return new int32_t(*static_cast(result)); + case GRIN_DATATYPE::Timestamp64: + return new int64_t(*static_cast(result)); + default: + grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; + return NULL; + } +} +#endif + #ifdef GRIN_WITH_EDGE_PROPERTY bool grin_equal_edge_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep1, GRIN_EDGE_PROPERTY ep2) { @@ -114,7 +212,104 @@ GRIN_DATATYPE grin_get_edge_property_datatype(GRIN_GRAPH g, GRIN_EDGE_PROPERTY e return ArrowToDataType(dt); } +int grin_get_edge_property_value_of_int32(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return 0; + return *static_cast(result); +} + +unsigned int grin_get_edge_property_value_of_uint32(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return 0; + return *static_cast(result); +} + +long long int grin_get_edge_property_value_of_int64(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return 0; + return *static_cast(result); +} + +unsigned long long int grin_get_edge_property_value_of_uint64(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return 0; + return *static_cast(result); +} + +float grin_get_edge_property_value_of_float(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return 0; + return *static_cast(result); +} + +double grin_get_edge_property_value_of_double(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return 0; + return *static_cast(result); +} + +const char* grin_get_edge_property_value_of_string(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return NULL; + return static_cast(result); +} + +int grin_get_edge_property_value_of_date32(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return 0; + return *static_cast(result); +} + +int grin_get_edge_property_value_of_time32(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return 0; + return *static_cast(result); +} + +long long int grin_get_edge_property_value_of_timestamp64(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return 0; + return *static_cast(result); +} + GRIN_EDGE_TYPE grin_get_edge_type_from_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep) { return _grin_get_type_from_property(ep); } #endif + +#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_TRAIT_CONST_VALUE_PTR) +const void* grin_get_edge_property_value(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { + const void* result = _get_value_from_edge_property_table(g, e, ep); + if (result == NULL) return NULL; + auto _g = static_cast(g)->g; + unsigned etype = _grin_get_type_from_property(ep); + unsigned eprop = _grin_get_prop_from_property(ep); + auto _dt = _g->schema().GetEdgePropertyType(etype, eprop); + auto dt = ArrowToDataType(_dt); + switch (dt) { + case GRIN_DATATYPE::Int32: + return static_cast(result); + case GRIN_DATATYPE::UInt32: + return static_cast(result); + case GRIN_DATATYPE::Int64: + return static_cast(result); + case GRIN_DATATYPE::UInt64: + return static_cast(result); + case GRIN_DATATYPE::Float: + return static_cast(result); + case GRIN_DATATYPE::Double: + return static_cast(result); + case GRIN_DATATYPE::String: + return static_cast(result)->c_str(); + case GRIN_DATATYPE::Date32: + return static_cast(result); + case GRIN_DATATYPE::Time32: + return static_cast(result); + case GRIN_DATATYPE::Timestamp64: + return static_cast(result); + default: + grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; + return NULL; + } +} +#endif \ No newline at end of file diff --git a/modules/graph/grin/src/property/propertylist.cc b/modules/graph/grin/src/property/propertylist.cc index eaa6f6c8c..58ff33231 100644 --- a/modules/graph/grin/src/property/propertylist.cc +++ b/modules/graph/grin/src/property/propertylist.cc @@ -19,8 +19,9 @@ extern "C" { GRIN_VERTEX_PROPERTY_LIST grin_get_vertex_property_list_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { auto _g = static_cast(g)->g; auto vpl = new GRIN_VERTEX_PROPERTY_LIST_T(); + vpl->resize(_g->vertex_property_num(vtype)); for (auto p = 0; p < _g->vertex_property_num(vtype); ++p) { - vpl->push_back(_grin_create_property(vtype, p)); + (*vpl)[p] = _grin_create_property(vtype, p); } return vpl; } @@ -71,8 +72,9 @@ GRIN_VERTEX_PROPERTY_ID grin_get_vertex_property_id(GRIN_GRAPH g, GRIN_VERTEX_TY GRIN_EDGE_PROPERTY_LIST grin_get_edge_property_list_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { auto _g = static_cast(g)->g; auto epl = new GRIN_EDGE_PROPERTY_LIST_T(); + epl->resize(_g->edge_property_num(etype) - 1); for (auto p = 1; p < _g->edge_property_num(etype); ++p) { - epl->push_back(_grin_create_property(etype, p)); + (*epl)[p - 1] = _grin_create_property(etype, p); } return epl; } @@ -117,44 +119,3 @@ GRIN_EDGE_PROPERTY_ID grin_get_edge_property_id(GRIN_GRAPH g, GRIN_EDGE_TYPE ety return _grin_get_prop_from_property(ep) - 1; } #endif - - -// #if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY) -// GRIN_GRAPH grin_select_vertex_properties(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_LIST vpl) { -// auto _g = static_cast(g)->g; -// auto _vpl = static_cast(vpl); -// std::map> vertices, edges; -// for (auto& p: *_vpl) { -// int vtype = static_cast(p.first); -// int vp = static_cast(p.second); -// if (vertices.find(vtype) == vertices.end()) { -// vertices[vtype].clear(); -// } -// vertices[vtype].push_back(vp); -// } -// vineyard::Client client; -// client.Connect(); -// auto object_id = _g->Project(client, vertices, edges); -// return get_graph_by_object_id(client, object_id.value()); -// } -// #endif - -// #if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY) -// GRIN_GRAPH grin_select_edge_properteis(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_LIST epl) { -// auto _g = static_cast(g)->g; -// auto _epl = static_cast(epl); -// std::map> vertices, edges; -// for (auto& p: *_epl) { -// int etype = static_cast(p.first); -// int ep = static_cast(p.second); -// if (edges.find(etype) == edges.end()) { -// edges[etype].clear(); -// } -// edges[etype].push_back(ep); -// } -// vineyard::Client client; -// client.Connect(); -// auto object_id = _g->Project(client, vertices, edges); -// return get_graph_by_object_id(client, object_id.value()); -// } -// #endif \ No newline at end of file diff --git a/modules/graph/grin/src/property/propertytable.cc b/modules/graph/grin/src/property/propertytable.cc deleted file mode 100644 index 43335e515..000000000 --- a/modules/graph/grin/src/property/propertytable.cc +++ /dev/null @@ -1,469 +0,0 @@ -/** Copyright 2020 Alibaba Group Holding Limited. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "graph/grin/src/predefine.h" -extern "C" { -#include "graph/grin/include/property/propertytable.h" -#include "graph/grin/include/common/error.h" -} - -void grin_destroy_string_value(GRIN_GRAPH g, const char* value) {} - -#ifdef GRIN_ENABLE_ROW -void grin_destroy_row(GRIN_GRAPH g, GRIN_ROW r) { - auto _r = static_cast(r); - delete _r; -} - -int grin_get_int32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { - auto _r = static_cast(r); - return *static_cast((*_r)[idx]); -} - -unsigned int grin_get_uint32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { - auto _r = static_cast(r); - return *static_cast((*_r)[idx]); -} - -long long int grin_get_int64_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { - auto _r = static_cast(r); - return *static_cast((*_r)[idx]); -} - -unsigned long long int grin_get_uint64_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { - auto _r = static_cast(r); - return *static_cast((*_r)[idx]); -} - -float grin_get_float_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { - auto _r = static_cast(r); - return *static_cast((*_r)[idx]); -} - -double grin_get_double_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { - auto _r = static_cast(r); - return *static_cast((*_r)[idx]); -} - -const char* grin_get_string_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { - auto _r = static_cast(r); - auto s = static_cast((*_r)[idx]); - int len = s->length() + 1; - char* out = new char[len]; - snprintf(out, len, "%s", s->c_str()); - return out; -} - -int grin_get_date32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { - auto _r = static_cast(r); - return *static_cast((*_r)[idx]); -} - -int grin_get_time32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { - auto _r = static_cast(r); - return *static_cast((*_r)[idx]); -} - -long long int grin_get_timestamp64_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { - auto _r = static_cast(r); - return *static_cast((*_r)[idx]); -} - -GRIN_ROW grin_create_row(GRIN_GRAPH g) { - auto r = new GRIN_ROW_T(); - return r; -} - -bool grin_insert_int32_to_row(GRIN_GRAPH g, GRIN_ROW r, int value) { - auto _r = static_cast(r); - _r->push_back(new int32_t(value)); - return true; -} - -bool grin_insert_uint32_to_row(GRIN_GRAPH g, GRIN_ROW r, unsigned int value) { - auto _r = static_cast(r); - _r->push_back(new uint32_t(value)); - return true; -} - -bool grin_insert_int64_to_row(GRIN_GRAPH g, GRIN_ROW r, long long int value) { - auto _r = static_cast(r); - _r->push_back(new int64_t(value)); - return true; -} - -bool grin_insert_uint64_to_row(GRIN_GRAPH g, GRIN_ROW r, unsigned long long int value) { - auto _r = static_cast(r); - _r->push_back(new uint64_t(value)); - return true; -} - -bool grin_insert_float_to_row(GRIN_GRAPH g, GRIN_ROW r, float value) { - auto _r = static_cast(r); - _r->push_back(new float(value)); - return true; -} - -bool grin_insert_double_to_row(GRIN_GRAPH g, GRIN_ROW r, double value) { - auto _r = static_cast(r); - _r->push_back(new double(value)); - return true; -} - -bool grin_insert_string_to_row(GRIN_GRAPH g, GRIN_ROW r, const char* value) { - auto _r = static_cast(r); - _r->push_back(new std::string(value)); - return true; -} - -bool grin_insert_date32_to_row(GRIN_GRAPH g, GRIN_ROW r, int value) { - auto _r = static_cast(r); - _r->push_back(new int32_t(value)); - return true;} - -bool grin_insert_time32_to_row(GRIN_GRAPH g, GRIN_ROW r, int value) { - auto _r = static_cast(r); - _r->push_back(new int32_t(value)); - return true; -} - -bool grin_insert_timestamp64_to_row(GRIN_GRAPH g, GRIN_ROW r, long long int value) { - auto _r = static_cast(r); - _r->push_back(new int64_t(value)); - return true; -} -#endif - -#if defined(GRIN_ENABLE_ROW) && defined(GRIN_TRAIT_CONST_VALUE_PTR) -const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, size_t idx) { - auto _r = static_cast(r); - switch (dt) { - case GRIN_DATATYPE::Int32: - return static_cast((*_r)[idx]); - case GRIN_DATATYPE::UInt32: - return static_cast((*_r)[idx]); - case GRIN_DATATYPE::Int64: - return static_cast((*_r)[idx]); - case GRIN_DATATYPE::UInt64: - return static_cast((*_r)[idx]); - case GRIN_DATATYPE::Float: - return static_cast((*_r)[idx]); - case GRIN_DATATYPE::Double: - return static_cast((*_r)[idx]); - case GRIN_DATATYPE::String: { - auto s = static_cast((*_r)[idx]); - return s->c_str(); - } - case GRIN_DATATYPE::Date32: - return static_cast((*_r)[idx]); - case GRIN_DATATYPE::Time32: - return static_cast((*_r)[idx]); - case GRIN_DATATYPE::Timestamp64: - return static_cast((*_r)[idx]); - default: - return NULL; - } - return NULL; -} -#endif - -#ifdef GRIN_ENABLE_VERTEX_PROPERTY_TABLE -void grin_destroy_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt) { - auto _vpt = static_cast(vpt); - delete _vpt; -} - -GRIN_VERTEX_PROPERTY_TABLE grin_get_vertex_property_table_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { - auto _g = static_cast(g)->g; - auto vpt = new GRIN_VERTEX_PROPERTY_TABLE_T(); - vpt->vtype = vtype; - auto vr = _g->InnerVertices(vtype); - vpt->vbegin = vr.begin_value(); - vpt->vend = vr.end_value(); - return vpt; -} - -int grin_get_int32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return 0; - return *static_cast(result); -} - -unsigned int grin_get_uint32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return 0; - return *static_cast(result); -} - -long long int grin_get_int64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return 0; - return *static_cast(result); -} - -unsigned long long int grin_get_uint64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return 0; - return *static_cast(result); -} - -float grin_get_float_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return 0; - return *static_cast(result); -} - -double grin_get_double_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return 0; - return *static_cast(result); -} - -const char* grin_get_string_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return NULL; - return static_cast(result)->c_str(); -} - -int grin_get_date32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return 0; - return *static_cast(result); -} - -int grin_get_time32_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return 0; - return *static_cast(result); -} - -long long int grin_get_timestamp64_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - const void* result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return 0; - return *static_cast(result); -} -#endif - -#if defined(GRIN_ENABLE_VERTEX_PROPERTY_TABLE) && defined(GRIN_TRAIT_CONST_VALUE_PTR) -const void* grin_get_value_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, - GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - - auto result = _get_value_from_vertex_property_table(g, vpt, v, vp); - if (result == NULL) return NULL; - auto _g = static_cast(g)->g; - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - auto _dt = _g->schema().GetVertexPropertyType(vtype, vprop); - auto dt = ArrowToDataType(_dt); - switch (dt) { - case GRIN_DATATYPE::Int32: - return static_cast(result); - case GRIN_DATATYPE::UInt32: - return static_cast(result); - case GRIN_DATATYPE::Int64: - return static_cast(result); - case GRIN_DATATYPE::UInt64: - return static_cast(result); - case GRIN_DATATYPE::Float: - return static_cast(result); - case GRIN_DATATYPE::Double: - return static_cast(result); - case GRIN_DATATYPE::String: - return static_cast(result)->c_str(); - case GRIN_DATATYPE::Date32: - return new int32_t(*static_cast(result)); - case GRIN_DATATYPE::Time32: - return new int32_t(*static_cast(result)); - case GRIN_DATATYPE::Timestamp64: - return new int64_t(*static_cast(result)); - default: - grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; - return NULL; - } -} -#endif - -#if defined(GRIN_ENABLE_VERTEX_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) -GRIN_ROW grin_get_row_from_vertex_property_table(GRIN_GRAPH g, GRIN_VERTEX_PROPERTY_TABLE vpt, GRIN_VERTEX v, - GRIN_VERTEX_PROPERTY_LIST vpl) { - auto _g = static_cast(g)->g; - auto _vpt = static_cast(vpt); - auto _vpl = static_cast(vpl); - if (v < _vpt->vbegin || v >= _vpt->vend) return NULL; - auto offset = v - _vpt->vbegin; - - auto r = new GRIN_ROW_T(); - for (auto vp: *_vpl) { - unsigned vtype = _grin_get_type_from_property(vp); - if (vtype != _vpt->vtype) return NULL; - auto array = _g->vertex_data_table(vtype)->column(_grin_get_prop_from_property(vp))->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - r->push_back(result); - } - return r; -} -#endif - -#if !defined(GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY) && defined(GRIN_ENABLE_ROW) -/** - * @brief get vertex row directly from the graph, this API only works for row store system - * @param GRIN_GRAPH the graph - * @param GRIN_VERTEX the vertex which is the row index - * @param GRIN_VERTEX_PROPERTY_LIST the vertex property list as columns - */ -GRIN_ROW grin_get_vertex_row(GRIN_GRAPH, GRIN_VERTEX, GRIN_VERTEX_PROPERTY_LIST); -#endif - -#ifdef GRIN_ENABLE_EDGE_PROPERTY_TABLE -void grin_destroy_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept) { - auto _ept = static_cast(ept); - delete _ept; -} - -GRIN_EDGE_PROPERTY_TABLE grin_get_edge_property_table_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { - auto _g = static_cast(g)->g; - auto ept = new GRIN_EDGE_PROPERTY_TABLE_T(); - ept->etype = etype; - ept->num = _g->edge_data_table(etype)->num_rows(); - return ept; -} - -int grin_get_int32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return 0; - return *static_cast(result); -} - -unsigned int grin_get_uint32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return 0; - return *static_cast(result); -} - -long long int grin_get_int64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return 0; - return *static_cast(result); -} - -unsigned long long int grin_get_uint64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return 0; - return *static_cast(result); -} - -float grin_get_float_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return 0; - return *static_cast(result); -} - -double grin_get_double_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return 0; - return *static_cast(result); -} - -const char* grin_get_string_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return NULL; - return static_cast(result)->c_str(); -} - -int grin_get_date32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return 0; - return *static_cast(result); -} - -int grin_get_time32_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return 0; - return *static_cast(result); -} - -long long int grin_get_timestamp64_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return 0; - return *static_cast(result); -} -#endif - -#if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_TRAIT_CONST_VALUE_PTR) -const void* grin_get_value_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, - GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, ept, e, ep); - if (result == NULL) return NULL; - auto _g = static_cast(g)->g; - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - auto _dt = _g->schema().GetEdgePropertyType(etype, eprop); - auto dt = ArrowToDataType(_dt); - switch (dt) { - case GRIN_DATATYPE::Int32: - return static_cast(result); - case GRIN_DATATYPE::UInt32: - return static_cast(result); - case GRIN_DATATYPE::Int64: - return static_cast(result); - case GRIN_DATATYPE::UInt64: - return static_cast(result); - case GRIN_DATATYPE::Float: - return static_cast(result); - case GRIN_DATATYPE::Double: - return static_cast(result); - case GRIN_DATATYPE::String: - return static_cast(result)->c_str(); - case GRIN_DATATYPE::Date32: - return static_cast(result); - case GRIN_DATATYPE::Time32: - return static_cast(result); - case GRIN_DATATYPE::Timestamp64: - return static_cast(result); - default: - grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; - return NULL; - } -} -#endif - - -#if defined(GRIN_ENABLE_EDGE_PROPERTY_TABLE) && defined(GRIN_ENABLE_ROW) -GRIN_ROW grin_get_row_from_edge_property_table(GRIN_GRAPH g, GRIN_EDGE_PROPERTY_TABLE ept, GRIN_EDGE e, - GRIN_EDGE_PROPERTY_LIST epl) { - auto _g = static_cast(g)->g; - auto _ept = static_cast(ept); - auto _e = static_cast(e); - auto _epl = static_cast(epl); - if (_e->eid >= _ept->num) return NULL; - auto offset = _e->eid; - auto r = new GRIN_ROW_T(); - for (auto ep: *_epl) { - unsigned etype = _grin_get_type_from_property(ep); - if (etype != _ept->etype) return NULL; - auto array = _g->edge_data_table(etype)->column(_grin_get_prop_from_property(ep))->chunk(0); - auto result = vineyard::get_arrow_array_data_element(array, offset); - r->push_back(result); - } - return r; -} -#endif - -#if !defined(GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY) && defined(GRIN_ENABLE_ROW) -/** - * @brief get edge row directly from the graph, this API only works for row store system - * @param GRIN_GRAPH the graph - * @param GRIN_EDGE the edge which is the row index - * @param GRIN_EDGE_PROPERTY_LIST the edge property list as columns - */ -GRIN_ROW grin_get_edge_row(GRIN_GRAPH, GRIN_EDGE, GRIN_EDGE_PROPERTY_LIST); -#endif \ No newline at end of file diff --git a/modules/graph/grin/src/property/row.cc b/modules/graph/grin/src/property/row.cc new file mode 100644 index 000000000..ac963edcd --- /dev/null +++ b/modules/graph/grin/src/property/row.cc @@ -0,0 +1,215 @@ +/** Copyright 2020 Alibaba Group Holding Limited. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +#include "graph/grin/src/predefine.h" +extern "C" { +#include "graph/grin/include/property/row.h" +#include "graph/grin/include/common/error.h" +} + +void grin_destroy_string_value(GRIN_GRAPH g, const char* value) {} + +#ifdef GRIN_ENABLE_ROW +void grin_destroy_row(GRIN_GRAPH g, GRIN_ROW r) { + auto _r = static_cast(r); + delete _r; +} + +int grin_get_int32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +unsigned int grin_get_uint32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +long long int grin_get_int64_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +unsigned long long int grin_get_uint64_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +float grin_get_float_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +double grin_get_double_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +const char* grin_get_string_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + auto s = static_cast((*_r)[idx]); + int len = s->length() + 1; + char* out = new char[len]; + snprintf(out, len, "%s", s->c_str()); + return out; +} + +int grin_get_date32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +int grin_get_time32_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +long long int grin_get_timestamp64_from_row(GRIN_GRAPH g, GRIN_ROW r, size_t idx) { + auto _r = static_cast(r); + return *static_cast((*_r)[idx]); +} + +GRIN_ROW grin_create_row(GRIN_GRAPH g) { + auto r = new GRIN_ROW_T(); + return r; +} + +bool grin_insert_int32_to_row(GRIN_GRAPH g, GRIN_ROW r, int value) { + auto _r = static_cast(r); + _r->push_back(new int32_t(value)); + return true; +} + +bool grin_insert_uint32_to_row(GRIN_GRAPH g, GRIN_ROW r, unsigned int value) { + auto _r = static_cast(r); + _r->push_back(new uint32_t(value)); + return true; +} + +bool grin_insert_int64_to_row(GRIN_GRAPH g, GRIN_ROW r, long long int value) { + auto _r = static_cast(r); + _r->push_back(new int64_t(value)); + return true; +} + +bool grin_insert_uint64_to_row(GRIN_GRAPH g, GRIN_ROW r, unsigned long long int value) { + auto _r = static_cast(r); + _r->push_back(new uint64_t(value)); + return true; +} + +bool grin_insert_float_to_row(GRIN_GRAPH g, GRIN_ROW r, float value) { + auto _r = static_cast(r); + _r->push_back(new float(value)); + return true; +} + +bool grin_insert_double_to_row(GRIN_GRAPH g, GRIN_ROW r, double value) { + auto _r = static_cast(r); + _r->push_back(new double(value)); + return true; +} + +bool grin_insert_string_to_row(GRIN_GRAPH g, GRIN_ROW r, const char* value) { + auto _r = static_cast(r); + _r->push_back(new std::string(value)); + return true; +} + +bool grin_insert_date32_to_row(GRIN_GRAPH g, GRIN_ROW r, int value) { + auto _r = static_cast(r); + _r->push_back(new int32_t(value)); + return true;} + +bool grin_insert_time32_to_row(GRIN_GRAPH g, GRIN_ROW r, int value) { + auto _r = static_cast(r); + _r->push_back(new int32_t(value)); + return true; +} + +bool grin_insert_timestamp64_to_row(GRIN_GRAPH g, GRIN_ROW r, long long int value) { + auto _r = static_cast(r); + _r->push_back(new int64_t(value)); + return true; +} +#endif + +#if defined(GRIN_ENABLE_ROW) && defined(GRIN_TRAIT_CONST_VALUE_PTR) +const void* grin_get_value_from_row(GRIN_GRAPH g, GRIN_ROW r, GRIN_DATATYPE dt, size_t idx) { + auto _r = static_cast(r); + switch (dt) { + case GRIN_DATATYPE::Int32: + return static_cast((*_r)[idx]); + case GRIN_DATATYPE::UInt32: + return static_cast((*_r)[idx]); + case GRIN_DATATYPE::Int64: + return static_cast((*_r)[idx]); + case GRIN_DATATYPE::UInt64: + return static_cast((*_r)[idx]); + case GRIN_DATATYPE::Float: + return static_cast((*_r)[idx]); + case GRIN_DATATYPE::Double: + return static_cast((*_r)[idx]); + case GRIN_DATATYPE::String: { + auto s = static_cast((*_r)[idx]); + return s->c_str(); + } + case GRIN_DATATYPE::Date32: + return static_cast((*_r)[idx]); + case GRIN_DATATYPE::Time32: + return static_cast((*_r)[idx]); + case GRIN_DATATYPE::Timestamp64: + return static_cast((*_r)[idx]); + default: + return NULL; + } + return NULL; +} +#endif + + +#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_ENABLE_ROW) +GRIN_ROW grin_get_vertex_row(GRIN_GRAPH g, GRIN_VERTEX v) { + auto _g = static_cast(g)->g; + auto _cache = static_cast(g)->cache; + unsigned vtype = _cache->id_parser.GetLabelId(v); + auto offset = _cache->id_parser.GetOffset(v); + + auto r = new GRIN_ROW_T(); + r->resize(_g->vertex_property_num(vtype)); + for (auto vp = 0; vp < _g->vertex_property_num(vtype); ++vp) { + auto array = _cache->vtables[vtype]->column(vp)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + (*r)[vp] = result; + } + return r; +} +#endif + +#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_ENABLE_ROW) +GRIN_ROW grin_get_edge_row(GRIN_GRAPH g, GRIN_EDGE e) { + auto _g = static_cast(g)->g; + auto _cache = static_cast(g)->cache; + auto _e = static_cast(e); + auto etype = _e->etype; + auto offset = _e->eid; + + auto r = new GRIN_ROW_T(); + r->resize(_g->edge_property_num(etype)); + for (auto ep = 0; ep < _g->edge_property_num(etype); ++ep) { + auto array = _cache->etables[etype]->column(ep)->chunk(0); + auto result = vineyard::get_arrow_array_data_element(array, offset); + (*r)[ep] = result; + } + return r; +} +#endif diff --git a/modules/graph/grin/src/property/topology.cc b/modules/graph/grin/src/property/topology.cc index fe727fbe1..87905dd68 100644 --- a/modules/graph/grin/src/property/topology.cc +++ b/modules/graph/grin/src/property/topology.cc @@ -24,8 +24,8 @@ size_t grin_get_vertex_num_by_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype) { #ifdef GRIN_WITH_EDGE_PROPERTY size_t grin_get_edge_num_by_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) { - auto _g = static_cast(g)->g; - return _g->edge_data_table(etype)->num_rows(); + auto _cache = static_cast(g)->cache; + return _cache->etables[etype]->num_rows(); } #endif diff --git a/modules/graph/grin/src/property/type.cc b/modules/graph/grin/src/property/type.cc index 59dffa497..6dde9f032 100644 --- a/modules/graph/grin/src/property/type.cc +++ b/modules/graph/grin/src/property/type.cc @@ -30,8 +30,9 @@ void grin_destroy_vertex_type(GRIN_GRAPH g, GRIN_VERTEX_TYPE vt) {} GRIN_VERTEX_TYPE_LIST grin_get_vertex_type_list(GRIN_GRAPH g) { auto _g = static_cast(g)->g; auto vtl = new GRIN_VERTEX_TYPE_LIST_T(); + vtl->resize(_g->vertex_label_num()); for (auto i = 0; i < _g->vertex_label_num(); ++i) { - vtl->push_back(i); + (*vtl)[i] = i; } return vtl; } @@ -104,8 +105,9 @@ void grin_destroy_edge_type(GRIN_GRAPH g, GRIN_EDGE_TYPE etype) {} GRIN_EDGE_TYPE_LIST grin_get_edge_type_list(GRIN_GRAPH g) { auto _g = static_cast(g)->g; auto etl = new GRIN_EDGE_TYPE_LIST_T(); + etl->resize(_g->edge_label_num()); for (auto i = 0; i < _g->edge_label_num(); ++i) { - etl->push_back(i); + (*etl)[i] = i; } return etl; } diff --git a/modules/graph/grin/src/proto/message.cc b/modules/graph/grin/src/proto/message.cc index 03e446f39..e4ad22a1d 100644 --- a/modules/graph/grin/src/proto/message.cc +++ b/modules/graph/grin/src/proto/message.cc @@ -227,10 +227,6 @@ const char* grin_get_static_storage_feature_msg() { vfeature->set_grin_with_vertex_type_name(true); #endif -#ifdef GRIN_ENABLE_VERTEX_PROPERTY_TABLE - vfeature->set_grin_enable_vertex_property_table(true); -#endif - #ifdef GRIN_ENABLE_VERTEX_PRIMARY_KEYS vfeature->set_grin_enable_vertex_primary_keys(true); #endif @@ -256,10 +252,6 @@ const char* grin_get_static_storage_feature_msg() { efeature->set_grin_with_edge_type_name(true); #endif -#ifdef GRIN_ENABLE_EDGE_PROPERTY_TABLE - efeature->set_grin_enable_edge_property_table(true); -#endif - #ifdef GRIN_ENABLE_EDGE_PRIMARY_KEYS efeature->set_grin_enable_edge_primary_keys(true); #endif From 6fd60869a2aaa7f5c353fa3928da5c594e591743 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Mon, 22 May 2023 12:38:14 +0000 Subject: [PATCH 80/85] fix for remove column macros --- modules/graph/grin/include | 2 +- modules/graph/grin/predefine.h | 16 ---------------- modules/graph/grin/src/property/property.cc | 2 ++ modules/graph/grin/src/property/row.cc | 2 -- modules/graph/grin/src/proto/message.cc | 8 -------- 5 files changed, 3 insertions(+), 27 deletions(-) diff --git a/modules/graph/grin/include b/modules/graph/grin/include index 5597c5c10..f47f67365 160000 --- a/modules/graph/grin/include +++ b/modules/graph/grin/include @@ -1 +1 @@ -Subproject commit 5597c5c10ee2c2844c05d9906081368e48bdb7a0 +Subproject commit f47f67365a31b9a98212a63a4b112be4ac8e456b diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 987129106..8c9323666 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -632,18 +632,6 @@ typedef enum { * @brief Assume full property values of an edge are split among master and mirror edges. */ #define GRIN_ASSUME_SPLIT_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY - -/** @ingroup PropetyAssumptionMacros - * @brief The storage uses column store for vertex properties. - * This enables efficient property selections for vertices. -*/ -#define GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY - -/** @ingroup PropetyAssumptionMacros - * @brief The storage uses column store for edge properties. - * This enables efficient property selections for edges. -*/ -#define GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY ///@} #ifndef GRIN_DOXYGEN_SKIP @@ -673,8 +661,6 @@ typedef enum { #undef GRIN_ASSUME_MASTER_ONLY_PARTITION_FOR_EDGE_PROPERTY #undef GRIN_ASSUME_REPLICATE_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY #undef GRIN_ASSUME_SPLIT_MASTER_MIRROR_PARTITION_FOR_EDGE_PROPERTY -#undef GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY -#undef GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY // GRIN_END // GRIN_STORAGE_ENABLE @@ -693,8 +679,6 @@ typedef enum { #define GRIN_TRAIT_NATURAL_ID_FOR_EDGE_PROPERTY #define GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST #define GRIN_TRAIT_SELECT_EDGE_TYPE_FOR_ADJACENT_LIST -#define GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY -#define GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY // GRIN_END // GRIN_FEATURE_DEPENDENCY diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 742de7430..947fb2e0b 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -15,6 +15,8 @@ extern "C" { #include "graph/grin/include/property/property.h" } +void grin_destroy_string_value(GRIN_GRAPH g, const char* value) {} + #ifdef GRIN_WITH_VERTEX_PROPERTY_NAME const char* grin_get_vertex_property_name(GRIN_GRAPH g, GRIN_VERTEX_TYPE vtype, GRIN_VERTEX_PROPERTY vp) { auto _cache = static_cast(g)->cache; diff --git a/modules/graph/grin/src/property/row.cc b/modules/graph/grin/src/property/row.cc index ac963edcd..bf025c99f 100644 --- a/modules/graph/grin/src/property/row.cc +++ b/modules/graph/grin/src/property/row.cc @@ -16,8 +16,6 @@ extern "C" { #include "graph/grin/include/common/error.h" } -void grin_destroy_string_value(GRIN_GRAPH g, const char* value) {} - #ifdef GRIN_ENABLE_ROW void grin_destroy_row(GRIN_GRAPH g, GRIN_ROW r) { auto _r = static_cast(r); diff --git a/modules/graph/grin/src/proto/message.cc b/modules/graph/grin/src/proto/message.cc index e4ad22a1d..d76fca18d 100644 --- a/modules/graph/grin/src/proto/message.cc +++ b/modules/graph/grin/src/proto/message.cc @@ -264,14 +264,6 @@ const char* grin_get_static_storage_feature_msg() { efeature->set_grin_trait_natural_id_for_edge_property(true); #endif -#ifdef GRIN_ASSUME_COLUMN_STORE_FOR_VERTEX_PROPERTY - feature->set_grin_assume_column_store_for_vertex_property(true); -#endif - -#ifdef GRIN_ASSUME_COLUMN_STORE_FOR_EDGE_PROPERTY - feature->set_grin_assume_column_store_for_edge_property(true); -#endif - #ifdef GRIN_TRAIT_SELECT_TYPE_FOR_VERTEX_LIST feature->set_grin_trait_select_type_for_vertex_list(true); #endif From 3c6b78389a39aa8d75e28b2c962394435ee01bb8 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Tue, 23 May 2023 07:03:17 +0000 Subject: [PATCH 81/85] fix get string bug --- modules/graph/grin/rust/Cargo.toml | 4 +--- modules/graph/grin/rust/grin_v6d.rs | 10 +++++----- modules/graph/grin/src/property/property.cc | 4 ++-- modules/graph/grin/src/property/row.cc | 4 ++-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/modules/graph/grin/rust/Cargo.toml b/modules/graph/grin/rust/Cargo.toml index 47dc3bd33..11af0eda0 100644 --- a/modules/graph/grin/rust/Cargo.toml +++ b/modules/graph/grin/rust/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["dijie"] [features] -default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_trait_fast_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_trait_const_value_ptr", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_primary_keys", "grin_trait_natural_id_for_vertex_property", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_column_store_for_vertex_property", "grin_assume_column_store_for_edge_property", "grin_assume_all_vertex_list_sorted", "grin_enable_vertex_original_id_of_int64"] +default = ["grin_assume_has_directed_graph", "grin_assume_has_undirected_graph", "grin_assume_has_multi_edge_graph", "grin_enable_vertex_list", "grin_enable_vertex_list_array", "grin_enable_vertex_list_iterator", "grin_enable_adjacent_list", "grin_enable_adjacent_list_array", "grin_enable_adjacent_list_iterator", "grin_enable_graph_partition", "grin_trait_natural_id_for_partition", "grin_enable_vertex_ref", "grin_trait_fast_vertex_ref", "grin_assume_edge_cut_partition", "grin_trait_select_master_for_vertex_list", "grin_enable_row", "grin_trait_const_value_ptr", "grin_with_vertex_property", "grin_with_vertex_property_name", "grin_with_vertex_type_name", "grin_trait_natural_id_for_vertex_type", "grin_enable_vertex_primary_keys", "grin_trait_natural_id_for_vertex_property", "grin_with_edge_property", "grin_with_edge_property_name", "grin_with_edge_type_name", "grin_trait_natural_id_for_edge_type", "grin_trait_natural_id_for_edge_property", "grin_trait_select_type_for_vertex_list", "grin_trait_select_edge_type_for_adjacent_list", "grin_assume_all_vertex_list_sorted", "grin_enable_vertex_original_id_of_int64"] grin_assume_has_directed_graph = [] grin_assume_has_undirected_graph = [] grin_assume_has_multi_edge_graph = [] @@ -68,8 +68,6 @@ grin_assume_split_master_mirror_partition_for_vertex_property = [] grin_assume_master_only_partition_for_edge_property = [] grin_assume_replicate_master_mirror_partition_for_edge_property = [] grin_assume_split_master_mirror_partition_for_edge_property = [] -grin_assume_column_store_for_vertex_property = [] -grin_assume_column_store_for_edge_property = [] grin_with_vertex_label = [] grin_with_edge_label = [] grin_assume_all_vertex_list_sorted = [] diff --git a/modules/graph/grin/rust/grin_v6d.rs b/modules/graph/grin/rust/grin_v6d.rs index 02a8e35b9..813f86e2f 100644 --- a/modules/graph/grin/rust/grin_v6d.rs +++ b/modules/graph/grin/rust/grin_v6d.rs @@ -408,6 +408,9 @@ extern "C" { arg3: GrinRow, ) -> GrinVertex; + #[allow(unused)] + pub fn grin_destroy_string_value(arg1: GrinGraph, arg2: *const ::std::os::raw::c_char); + #[doc = " @brief get the vertex property name\n @param GrinGraph the graph\n @param GrinVertexProperty the vertex property"] #[cfg(feature = "grin_with_vertex_property_name")] #[allow(unused)] @@ -786,9 +789,6 @@ extern "C" { arg3: GrinEdgeProperty, ) -> GrinEdgePropertyId; - #[allow(unused)] - pub fn grin_destroy_string_value(arg1: GrinGraph, arg2: *const ::std::os::raw::c_char); - #[cfg(feature = "grin_enable_row")] #[allow(unused)] pub fn grin_destroy_row(arg1: GrinGraph, arg2: GrinRow); @@ -943,12 +943,12 @@ extern "C" { arg4: usize, ) -> *const ::std::os::raw::c_void; - #[doc = " @brief get vertex row directly from the graph, this API only works for row store system\n @param GrinGraph the graph\n @param GrinVertex the vertex which is the row index\n @param GrinVertexPropertyList the vertex property list as columns"] + #[doc = " @brief get vertex row directly from the graph, this API only works for row store system\n @param GrinGraph the graph\n @param GrinVertex the vertex which is the row index"] #[cfg(all(feature = "grin_with_vertex_property", feature = "grin_enable_row"))] #[allow(unused)] pub fn grin_get_vertex_row(arg1: GrinGraph, arg2: GrinVertex) -> GrinRow; - #[doc = " @brief get edge row directly from the graph, this API only works for row store system\n @param GrinGraph the graph\n @param GrinEdge the edge which is the row index\n @param GrinEdgePropertyList the edge property list as columns"] + #[doc = " @brief get edge row directly from the graph, this API only works for row store system\n @param GrinGraph the graph\n @param GrinEdge the edge which is the row index"] #[cfg(all(feature = "grin_with_edge_property", feature = "grin_enable_row"))] #[allow(unused)] pub fn grin_get_edge_row(arg1: GrinGraph, arg2: GrinEdge) -> GrinRow; diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index 947fb2e0b..ac5e20e5d 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -136,7 +136,7 @@ double grin_get_vertex_property_value_of_double(GRIN_GRAPH g, GRIN_VERTEX v, GRI const char* grin_get_vertex_property_value_of_string(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { const void* result = _get_value_from_vertex_property_table(g, v, vp); if (result == NULL) return NULL; - return static_cast(result); + return static_cast(result)->c_str(); } int grin_get_vertex_property_value_of_date32(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { @@ -253,7 +253,7 @@ double grin_get_edge_property_value_of_double(GRIN_GRAPH g, GRIN_EDGE e, GRIN_ED const char* grin_get_edge_property_value_of_string(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { const void* result = _get_value_from_edge_property_table(g, e, ep); if (result == NULL) return NULL; - return static_cast(result); + return static_cast(result)->c_str(); } int grin_get_edge_property_value_of_date32(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { diff --git a/modules/graph/grin/src/property/row.cc b/modules/graph/grin/src/property/row.cc index bf025c99f..edd1b6ca4 100644 --- a/modules/graph/grin/src/property/row.cc +++ b/modules/graph/grin/src/property/row.cc @@ -203,10 +203,10 @@ GRIN_ROW grin_get_edge_row(GRIN_GRAPH g, GRIN_EDGE e) { auto r = new GRIN_ROW_T(); r->resize(_g->edge_property_num(etype)); - for (auto ep = 0; ep < _g->edge_property_num(etype); ++ep) { + for (auto ep = 1; ep < _g->edge_property_num(etype); ++ep) { auto array = _cache->etables[etype]->column(ep)->chunk(0); auto result = vineyard::get_arrow_array_data_element(array, offset); - (*r)[ep] = result; + (*r)[ep-1] = result; } return r; } From cd3ce9f4e072dd8385c9f86da54285887ebabc47 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Tue, 23 May 2023 09:19:48 +0000 Subject: [PATCH 82/85] remove used code in arrow fragment group --- .../graph/fragment/arrow_fragment_group.cc | 19 +------------------ modules/graph/fragment/arrow_fragment_group.h | 11 +---------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/modules/graph/fragment/arrow_fragment_group.cc b/modules/graph/fragment/arrow_fragment_group.cc index a939ace59..4946009f2 100644 --- a/modules/graph/fragment/arrow_fragment_group.cc +++ b/modules/graph/fragment/arrow_fragment_group.cc @@ -36,24 +36,7 @@ void ArrowFragmentGroup::Construct(const vineyard::ObjectMeta& meta) { meta.GetKeyValue("vertex_label_num"); edge_label_num_ = meta.GetKeyValue("edge_label_num"); - - tot_edge_num_by_type_.resize(edge_label_num_, 0); - tot_edge_num_ = 0; - for (fid_t idx = 0; idx < total_frag_num_; ++idx) { - auto current_fragment_id = meta.GetMemberMeta("frag_object_id_" + std::to_string(idx)).GetId(); - ObjectMeta tmp_meta; - meta.GetClient()->GetMetaData(current_fragment_id, tmp_meta); - - for (size_t __idx = 0; __idx < this->vertex_label_num_; ++__idx) { - for (size_t __idy = 0; __idy < edge_label_num_; ++__idy) { - size_t sz = 0; - tmp_meta.GetMemberMeta("__oe_lists_-" + std::to_string(__idx) + "-" + std::to_string(__idy)).GetKeyValue("length_", sz); - tot_edge_num_by_type_[__idy] += sz; - tot_edge_num_ += sz; - } - } - fragments_.emplace( meta.GetKeyValue("fid_" + std::to_string(idx)), meta.GetMemberMeta("frag_object_id_" + std::to_string(idx)).GetId()); @@ -111,4 +94,4 @@ Status ArrowFragmentGroupBuilder::_Seal( return Status::OK(); } -} // namespace vineyard +} // namespace vineyard \ No newline at end of file diff --git a/modules/graph/fragment/arrow_fragment_group.h b/modules/graph/fragment/arrow_fragment_group.h index 569636b68..180d26c75 100644 --- a/modules/graph/fragment/arrow_fragment_group.h +++ b/modules/graph/fragment/arrow_fragment_group.h @@ -49,13 +49,6 @@ class ArrowFragmentGroup : public Registered, GlobalObject { const std::unordered_map& FragmentLocations() { return fragment_locations_; } - size_t total_edge_num_by_type(property_graph_types::LABEL_ID_TYPE etype) { - return tot_edge_num_by_type_[etype]; - } - - size_t total_edge_num() { - return tot_edge_num_; - } void Construct(const vineyard::ObjectMeta& meta) override; @@ -65,8 +58,6 @@ class ArrowFragmentGroup : public Registered, GlobalObject { property_graph_types::LABEL_ID_TYPE edge_label_num_; std::unordered_map fragments_; std::unordered_map fragment_locations_; - std::vector tot_edge_num_by_type_; - size_t tot_edge_num_; friend ArrowFragmentGroupBuilder; }; @@ -103,4 +94,4 @@ class ArrowFragmentGroupBuilder : public ObjectBuilder { } // namespace vineyard -#endif // MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GROUP_H_ +#endif // MODULES_GRAPH_FRAGMENT_ARROW_FRAGMENT_GROUP_H_ \ No newline at end of file From c5e5b3af19c4348d8381798caee0a99b2ab6b9ae Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Tue, 23 May 2023 12:31:38 +0000 Subject: [PATCH 83/85] fix simple vertex/adj list init bugs --- modules/graph/grin/c/test.c | 13 +++++++++++-- modules/graph/grin/src/topology/adjacentlist.cc | 1 + modules/graph/grin/src/topology/vertexlist.cc | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index dafa6654d..0a381bc84 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -964,11 +964,20 @@ void test_partition(int argc, char** argv) { } -void test_topology_structure(int argc, char** argv) { +void test_topology_vertex_list(int argc, char** argv) { GRIN_GRAPH g = get_graph(argc, argv); printf("vnum: %zu, enum: %zu\n", grin_get_vertex_num(g), grin_get_edge_num(g)); +#ifdef GRIN_ENABLE_GRAPH_PARTITION + GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); + GRIN_VERTEX_TYPE vtype = grin_get_vertex_type_by_name(g, "person"); + GRIN_VERTEX_LIST svl = grin_select_type_for_vertex_list(g, vtype, vl); + GRIN_VERTEX_LIST mvl = grin_select_master_for_vertex_list(g, svl); + size_t mvl_sz = grin_get_vertex_list_size(g, mvl); + printf("master vertex list size: %zu\n", mvl_sz); +#endif + grin_destroy_graph(g); } @@ -1061,7 +1070,7 @@ void test_topology_adjacent_list(int argc, char** argv, GRIN_DIRECTION dir) { } void test_topology(int argc, char** argv) { - test_topology_structure(argc, argv); + test_topology_vertex_list(argc, argv); test_topology_adjacent_list(argc, argv, OUT); test_topology_adjacent_list(argc, argv, IN); } diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 040728566..7ed7f24c9 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -28,6 +28,7 @@ GRIN_ADJACENT_LIST grin_get_adjacent_list(GRIN_GRAPH g, GRIN_DIRECTION d, GRIN_V al->etype = _g->edge_label_num(); if (al->etype == 1) { al->is_simple = true; + al->etype = 0; __grin_init_simple_adjacent_list(_g, al); } else { al->is_simple = false; diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index 89e6fac14..0c5984224 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -26,6 +26,7 @@ GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g) { vl->vtype = _g->vertex_label_num(); if (vl->vtype == 1) { vl->is_simple = true; + vl->vtype = 0; __grin_init_simple_vertex_list(_g, vl); } else { vl->is_simple = false; From a04fc929e5561b8baf036d9a2e4f996dce9f20cc Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Wed, 24 May 2023 19:58:38 +0800 Subject: [PATCH 84/85] optimize if branch using likely --- modules/graph/grin/src/index/order.cc | 6 ++---- modules/graph/grin/src/predefine.h | 17 +++++++++++++++++ .../graph/grin/src/topology/adjacentlist.cc | 18 +++++++++--------- modules/graph/grin/src/topology/vertexlist.cc | 12 +++++------- 4 files changed, 33 insertions(+), 20 deletions(-) diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index c7dddf2fc..64e5e543a 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -25,11 +25,9 @@ bool grin_smaller_vertex(GRIN_GRAPH g, GRIN_VERTEX v1, GRIN_VERTEX v2) { #if defined(GRIN_ASSUME_ALL_VERTEX_LIST_SORTED) && defined(GRIN_ENABLE_VERTEX_LIST_ARRAY) size_t grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, GRIN_VERTEX v) { auto _vl = static_cast(vl); - if (v < _vl->end_ && v >= _vl->begin_) return v - _vl->begin_; - if (_vl->is_simple) return GRIN_NULL_SIZE; - if (_vl->offsets.empty()) __grin_init_complex_vertex_list(static_cast(g)->g, _vl); + if (likely(_vl->is_simple)) return v - _vl->begin_; auto _cache = static_cast(g)->cache; auto vtype = _cache->id_parser.GetLabelId(v); - return v - _vl->offsets[vtype].second + _vl->offsets[vtype].first; + return v - _vl->offsets[vtype].second; } #endif diff --git a/modules/graph/grin/src/predefine.h b/modules/graph/grin/src/predefine.h index 9c763e5f3..ac10a994a 100644 --- a/modules/graph/grin/src/predefine.h +++ b/modules/graph/grin/src/predefine.h @@ -28,6 +28,23 @@ extern "C" { #include "client/client.h" #include "arrow/api.h" +#if (defined(__GNUC__) && (__GNUC__ >= 3)) || defined(__IBMC__) || \ + defined(__INTEL_COMPILER) || defined(__clang__) +#ifndef unlikely +#define unlikely(x_) __builtin_expect(!!(x_), 0) +#endif +#ifndef likely +#define likely(x_) __builtin_expect(!!(x_), 1) +#endif +#else +#ifndef unlikely +#define unlikely(x_) (x_) +#endif +#ifndef likely +#define likely(x_) (x_) +#endif +#endif + template struct GRIN_DATATYPE_ENUM { static constexpr GRIN_DATATYPE value = GRIN_DATATYPE::Undefined; diff --git a/modules/graph/grin/src/topology/adjacentlist.cc b/modules/graph/grin/src/topology/adjacentlist.cc index 7ed7f24c9..670cea013 100644 --- a/modules/graph/grin/src/topology/adjacentlist.cc +++ b/modules/graph/grin/src/topology/adjacentlist.cc @@ -43,17 +43,17 @@ void grin_destroy_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { size_t grin_get_adjacent_list_size(GRIN_GRAPH g, GRIN_ADJACENT_LIST al) { auto _al = static_cast(al); - if (_al->is_simple) return _al->end_ - _al->begin_; - if (_al->offsets.empty()) __grin_init_complex_adjacent_list(static_cast(g)->g, _al); + if (likely(_al->is_simple)) return _al->end_ - _al->begin_; + if (unlikely(_al->offsets.empty())) __grin_init_complex_adjacent_list(static_cast(g)->g, _al); return _al->offsets[_al->etype].first; } GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { auto _al = static_cast(al); auto nbr = _al->begin_ + idx; - if (nbr < _al->end_) return nbr->vid; - if (_al->is_simple) return GRIN_NULL_VERTEX; - if (_al->offsets.empty()) __grin_init_complex_adjacent_list(static_cast(g)->g, _al); + if (likely(nbr < _al->end_)) return nbr->vid; + if (likely(_al->is_simple)) return GRIN_NULL_VERTEX; + if (unlikely(_al->offsets.empty())) __grin_init_complex_adjacent_list(static_cast(g)->g, _al); for (unsigned i = 0; i < _al->etype; ++i) { if (idx < _al->offsets[i+1].first) { nbr = _al->offsets[i].second + idx - _al->offsets[i].first; @@ -66,7 +66,7 @@ GRIN_VERTEX grin_get_neighbor_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIS GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, size_t idx) { auto _al = static_cast(al); auto nbr = _al->begin_ + idx; - if (nbr < _al->end_) { + if (likely(nbr < _al->end_)) { auto e = new GRIN_EDGE_T(); e->dir = _al->dir; e->etype = _al->etype; @@ -80,8 +80,8 @@ GRIN_EDGE grin_get_edge_from_adjacent_list(GRIN_GRAPH g, GRIN_ADJACENT_LIST al, } return e; } - if (_al->is_simple) return GRIN_NULL_EDGE; - if (_al->offsets.empty()) __grin_init_complex_adjacent_list(static_cast(g)->g, _al); + if (likely(_al->is_simple)) return GRIN_NULL_EDGE; + if (unlikely(_al->offsets.empty())) __grin_init_complex_adjacent_list(static_cast(g)->g, _al); for (unsigned i = 0; i < _al->etype; ++i) { if (idx < _al->offsets[i+1].first) { nbr = _al->offsets[i].second + idx - _al->offsets[i].first; @@ -132,7 +132,7 @@ void grin_get_next_adjacent_list_iter(GRIN_GRAPH g, GRIN_ADJACENT_LIST_ITERATOR auto _ali = static_cast(ali); _ali->current_++; if (_ali->current_ < _ali->end_) return; - if (_ali->is_simple) { + if (likely(_ali->is_simple)) { _ali->etype_current++; return; } diff --git a/modules/graph/grin/src/topology/vertexlist.cc b/modules/graph/grin/src/topology/vertexlist.cc index 0c5984224..85e95578d 100644 --- a/modules/graph/grin/src/topology/vertexlist.cc +++ b/modules/graph/grin/src/topology/vertexlist.cc @@ -30,6 +30,7 @@ GRIN_VERTEX_LIST grin_get_vertex_list(GRIN_GRAPH g) { __grin_init_simple_vertex_list(_g, vl); } else { vl->is_simple = false; + __grin_init_complex_vertex_list(_g, vl); } return vl; } @@ -42,16 +43,14 @@ void grin_destroy_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { size_t grin_get_vertex_list_size(GRIN_GRAPH g, GRIN_VERTEX_LIST vl) { auto _vl = static_cast(vl); if (_vl->is_simple) return _vl->end_ - _vl->begin_; - if (_vl->offsets.empty()) __grin_init_complex_vertex_list(static_cast(g)->g, _vl); return _vl->offsets[_vl->vtype].first; } GRIN_VERTEX grin_get_vertex_from_list(GRIN_GRAPH g, GRIN_VERTEX_LIST vl, size_t idx) { auto _vl = static_cast(vl); auto v = _vl->begin_ + idx; - if (v < _vl->end_) return v; - if (_vl->is_simple) return GRIN_NULL_VERTEX; - if (_vl->offsets.empty()) __grin_init_complex_vertex_list(static_cast(g)->g, _vl); + if (likely(v < _vl->end_)) return v; + if (likely(_vl->is_simple)) return GRIN_NULL_VERTEX; for (unsigned i = 0; i < _vl->vtype; ++i) { if (idx < _vl->offsets[i+1].first) { v = _vl->offsets[i].second + idx - _vl->offsets[i].first; @@ -89,12 +88,11 @@ void grin_destroy_vertex_list_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) void grin_get_next_vertex_list_iter(GRIN_GRAPH g, GRIN_VERTEX_LIST_ITERATOR vli) { auto _vli = static_cast(vli); _vli->current_++; - if (_vli->current_ < _vli->end_) return; - if (_vli->is_simple) { + if (likely(_vli->current_ < _vli->end_)) return; + if (likely(_vli->is_simple)) { _vli->vtype_current++; return; } - auto _g = static_cast(g)->g; _GRIN_GRAPH_T::vertex_range_t vr; _vli->vtype_current++; From e35a263723b4e57f7b565769e6f7e2c4cb75ca78 Mon Sep 17 00:00:00 2001 From: Diwen Zhu Date: Thu, 25 May 2023 05:28:38 +0000 Subject: [PATCH 85/85] remove const value ptr support in v6d for inefficiency --- modules/graph/grin/c/test.c | 62 +++++++++++++++- modules/graph/grin/predefine.h | 1 - modules/graph/grin/src/index/order.cc | 2 +- modules/graph/grin/src/partition/topology.cc | 2 + modules/graph/grin/src/property/property.cc | 74 -------------------- 5 files changed, 62 insertions(+), 79 deletions(-) diff --git a/modules/graph/grin/c/test.c b/modules/graph/grin/c/test.c index 0a381bc84..4cef3eeb5 100644 --- a/modules/graph/grin/c/test.c +++ b/modules/graph/grin/c/test.c @@ -668,18 +668,18 @@ void test_property_edge_property_value(int argc, char** argv) { #else if (dt == Int64) { long long int pv = - grin_get_edge_property_value_of_int64(g, ept, e, ep); + grin_get_edge_property_value_of_int64(g, e, ep); long long int rv = grin_get_int64_from_row(g, row, k); printf("ep_id %u e%zu %s value: %lld %lld\n", id, j, ep_name, pv, rv); } else if (dt == String) { const char* pv = - grin_get_edge_property_value_of_string(g, ept, e, ep); + grin_get_edge_property_value_of_string(g, e, ep); const char* rv = grin_get_string_from_row(g, row, k); printf("ep_id %u e%zu %s value: %s %s\n", id, j, ep_name, pv, rv); grin_destroy_string_value(g, pv); grin_destroy_string_value(g, rv); } else if (dt == Double) { - double pv = grin_get_edge_property_value_of_double(g, ept, e, ep); + double pv = grin_get_edge_property_value_of_double(g, e, ep); double rv = grin_get_double_from_row(g, row, k); printf("ep_id %u e%zu %s value: %f %f\n", id, j, ep_name, pv, rv); } @@ -1069,6 +1069,61 @@ void test_topology_adjacent_list(int argc, char** argv, GRIN_DIRECTION dir) { grin_destroy_graph(g); } +void test_index_order(int argc, char** argv) { + printf("+++++++++++++++++++++ Test index/order +++++++++++++++++++++\n"); + GRIN_GRAPH g = get_graph(argc, argv); + + GRIN_VERTEX_LIST vl = grin_get_vertex_list(g); + size_t vl_sz = grin_get_vertex_list_size(g, vl); + for (size_t i = 0; i < vl_sz; ++i) { + GRIN_VERTEX v = grin_get_vertex_from_list(g, vl, i); + size_t p = grin_get_position_of_vertex_from_sorted_list(g, vl, v); + if (p != i) { + printf("vertex position not match\n"); + } + grin_destroy_vertex(g, v); + } + printf("%zu vertices checked\n", vl_sz); + +#ifdef GRIN_ENABLE_GRAPH_PARTITION + GRIN_VERTEX_LIST mvl = grin_select_master_for_vertex_list(g, vl); + size_t mvl_sz = grin_get_vertex_list_size(g, mvl); + for (size_t i = 0; i < mvl_sz; ++i) { + GRIN_VERTEX v = grin_get_vertex_from_list(g, mvl, i); + size_t p = grin_get_position_of_vertex_from_sorted_list(g, mvl, v); + if (p != i) { + printf("vertex position not match\n"); + } + grin_destroy_vertex(g, v); + } + printf("%zu vertices checked\n", mvl_sz); + grin_destroy_vertex_list(g, mvl); +#endif + + GRIN_VERTEX_TYPE vtype = grin_get_vertex_type_by_name(g, "person"); + GRIN_VERTEX_LIST svl = grin_select_type_for_vertex_list(g, vtype, vl); + size_t svl_sz = grin_get_vertex_list_size(g, svl); + for (size_t i = 0; i < svl_sz; ++i) { + GRIN_VERTEX v = grin_get_vertex_from_list(g, svl, i); + size_t p = grin_get_position_of_vertex_from_sorted_list(g, svl, v); + if (p != i) { + printf("vertex position not match\n"); + } + grin_destroy_vertex(g, v); + } + printf("%zu vertices checked\n", svl_sz); + grin_destroy_vertex_list(g, svl); + + grin_destroy_vertex_list(g, vl); + grin_destroy_graph(g); +} + +void test_index(int argc, char** argv) { +#ifdef GRIN_ENABLE_VERTEX_LIST_ARRAY + test_index_order(argc, argv); +#endif +} + void test_topology(int argc, char** argv) { test_topology_vertex_list(argc, argv); test_topology_adjacent_list(argc, argv, OUT); @@ -1079,5 +1134,6 @@ int main(int argc, char** argv) { test_property(argc, argv); test_partition(argc, argv); test_topology(argc, argv); + test_index(argc, argv); return 0; } diff --git a/modules/graph/grin/predefine.h b/modules/graph/grin/predefine.h index 8c9323666..7c45aa367 100644 --- a/modules/graph/grin/predefine.h +++ b/modules/graph/grin/predefine.h @@ -665,7 +665,6 @@ typedef enum { // GRIN_STORAGE_ENABLE #define GRIN_ENABLE_ROW -#define GRIN_TRAIT_CONST_VALUE_PTR #define GRIN_WITH_VERTEX_PROPERTY #define GRIN_WITH_VERTEX_PROPERTY_NAME #define GRIN_WITH_VERTEX_TYPE_NAME diff --git a/modules/graph/grin/src/index/order.cc b/modules/graph/grin/src/index/order.cc index 64e5e543a..37ad946c1 100644 --- a/modules/graph/grin/src/index/order.cc +++ b/modules/graph/grin/src/index/order.cc @@ -28,6 +28,6 @@ size_t grin_get_position_of_vertex_from_sorted_list(GRIN_GRAPH g, GRIN_VERTEX_LI if (likely(_vl->is_simple)) return v - _vl->begin_; auto _cache = static_cast(g)->cache; auto vtype = _cache->id_parser.GetLabelId(v); - return v - _vl->offsets[vtype].second; + return v - _vl->offsets[vtype].second + _vl->offsets[vtype].first; } #endif diff --git a/modules/graph/grin/src/partition/topology.cc b/modules/graph/grin/src/partition/topology.cc index 6ead708aa..a91896cde 100644 --- a/modules/graph/grin/src/partition/topology.cc +++ b/modules/graph/grin/src/partition/topology.cc @@ -28,6 +28,7 @@ GRIN_VERTEX_LIST grin_select_master_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LI fvl->vtype = _vl->vtype; fvl->is_simple = _vl->is_simple; if (fvl->is_simple) __grin_init_simple_vertex_list(_g, fvl); + else __grin_init_complex_vertex_list(_g, fvl); return fvl; } @@ -40,6 +41,7 @@ GRIN_VERTEX_LIST grin_select_mirror_for_vertex_list(GRIN_GRAPH g, GRIN_VERTEX_LI fvl->vtype = _vl->vtype; fvl->is_simple = _vl->is_simple; if (fvl->is_simple) __grin_init_simple_vertex_list(_g, fvl); + else __grin_init_complex_vertex_list(_g, fvl); return fvl; } #endif diff --git a/modules/graph/grin/src/property/property.cc b/modules/graph/grin/src/property/property.cc index ac5e20e5d..dc53be555 100644 --- a/modules/graph/grin/src/property/property.cc +++ b/modules/graph/grin/src/property/property.cc @@ -163,43 +163,6 @@ GRIN_VERTEX_TYPE grin_get_vertex_type_from_property(GRIN_GRAPH g, GRIN_VERTEX_PR } #endif -#if defined(GRIN_WITH_VERTEX_PROPERTY) && defined(GRIN_TRAIT_CONST_VALUE_PTR) -const void* grin_get_vertex_property_value(GRIN_GRAPH g, GRIN_VERTEX v, GRIN_VERTEX_PROPERTY vp) { - auto result = _get_value_from_vertex_property_table(g, v, vp); - if (result == NULL) return NULL; - auto _g = static_cast(g)->g; - unsigned vtype = _grin_get_type_from_property(vp); - unsigned vprop = _grin_get_prop_from_property(vp); - auto _dt = _g->schema().GetVertexPropertyType(vtype, vprop); - auto dt = ArrowToDataType(_dt); - switch (dt) { - case GRIN_DATATYPE::Int32: - return static_cast(result); - case GRIN_DATATYPE::UInt32: - return static_cast(result); - case GRIN_DATATYPE::Int64: - return static_cast(result); - case GRIN_DATATYPE::UInt64: - return static_cast(result); - case GRIN_DATATYPE::Float: - return static_cast(result); - case GRIN_DATATYPE::Double: - return static_cast(result); - case GRIN_DATATYPE::String: - return static_cast(result)->c_str(); - case GRIN_DATATYPE::Date32: - return new int32_t(*static_cast(result)); - case GRIN_DATATYPE::Time32: - return new int32_t(*static_cast(result)); - case GRIN_DATATYPE::Timestamp64: - return new int64_t(*static_cast(result)); - default: - grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; - return NULL; - } -} -#endif - #ifdef GRIN_WITH_EDGE_PROPERTY bool grin_equal_edge_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY ep1, GRIN_EDGE_PROPERTY ep2) { @@ -278,40 +241,3 @@ GRIN_EDGE_TYPE grin_get_edge_type_from_property(GRIN_GRAPH g, GRIN_EDGE_PROPERTY return _grin_get_type_from_property(ep); } #endif - -#if defined(GRIN_WITH_EDGE_PROPERTY) && defined(GRIN_TRAIT_CONST_VALUE_PTR) -const void* grin_get_edge_property_value(GRIN_GRAPH g, GRIN_EDGE e, GRIN_EDGE_PROPERTY ep) { - const void* result = _get_value_from_edge_property_table(g, e, ep); - if (result == NULL) return NULL; - auto _g = static_cast(g)->g; - unsigned etype = _grin_get_type_from_property(ep); - unsigned eprop = _grin_get_prop_from_property(ep); - auto _dt = _g->schema().GetEdgePropertyType(etype, eprop); - auto dt = ArrowToDataType(_dt); - switch (dt) { - case GRIN_DATATYPE::Int32: - return static_cast(result); - case GRIN_DATATYPE::UInt32: - return static_cast(result); - case GRIN_DATATYPE::Int64: - return static_cast(result); - case GRIN_DATATYPE::UInt64: - return static_cast(result); - case GRIN_DATATYPE::Float: - return static_cast(result); - case GRIN_DATATYPE::Double: - return static_cast(result); - case GRIN_DATATYPE::String: - return static_cast(result)->c_str(); - case GRIN_DATATYPE::Date32: - return static_cast(result); - case GRIN_DATATYPE::Time32: - return static_cast(result); - case GRIN_DATATYPE::Timestamp64: - return static_cast(result); - default: - grin_error_code = GRIN_ERROR_CODE::UNKNOWN_DATATYPE; - return NULL; - } -} -#endif \ No newline at end of file