Flex  0.17.9
read_transaction.h
Go to the documentation of this file.
1 
16 #ifndef GRAPHSCOPE_DATABASE_READ_TRANSACTION_H_
17 #define GRAPHSCOPE_DATABASE_READ_TRANSACTION_H_
18 
19 #include <limits>
20 #include <utility>
21 
25 
26 namespace gs {
27 
28 class MutablePropertyFragment;
29 class GraphDBSession;
30 class VersionManager;
31 template <typename EDATA_T>
32 class AdjListView {
33  class nbr_iterator {
36 
37  public:
39  timestamp_t timestamp)
40  : ptr_(ptr), end_(end), timestamp_(timestamp) {
41  while (ptr_ != end_ && ptr_->get_timestamp() > timestamp_) {
42  ++ptr_;
43  }
44  }
45 
46  const_nbr_t& operator*() const { return *ptr_; }
47 
48  const_nbr_ptr_t operator->() const { return ptr_; }
49 
51  ++ptr_;
52  while (ptr_ != end_ && ptr_->get_timestamp() > timestamp_) {
53  ++ptr_;
54  }
55  return *this;
56  }
57 
58  bool operator==(const nbr_iterator& rhs) const {
59  return (ptr_ == rhs.ptr_);
60  }
61 
62  bool operator!=(const nbr_iterator& rhs) const {
63  return (ptr_ != rhs.ptr_);
64  }
65 
66  private:
70  };
71 
72  public:
74 
75  AdjListView(const slice_t& slice, timestamp_t timestamp)
76  : edges_(slice), timestamp_(timestamp) {}
77 
78  nbr_iterator begin() const {
80  }
81  nbr_iterator end() const {
83  }
84 
85  int estimated_degree() const { return edges_.size(); }
86 
87  private:
90 };
91 
92 template <typename EDATA_T>
93 class GraphView {
94  public:
95  GraphView(const MutableCsr<EDATA_T>& csr, timestamp_t timestamp)
96  : csr_(csr),
97  timestamp_(timestamp),
98  unsorted_since_(csr.unsorted_since()) {}
99 
101  return AdjListView<EDATA_T>(csr_.get_edges(v), timestamp_);
102  }
103 
104  // iterate edges with data in [min_value, max_value)
105  template <typename FUNC_T>
106  void foreach_edges_between(vid_t v, EDATA_T& min_value, EDATA_T& max_value,
107  const FUNC_T& func) const {
108  const auto& edges = csr_.get_edges(v);
109  auto ptr = edges.end() - 1;
110  auto end = edges.begin() - 1;
111  while (ptr != end) {
112  if (ptr->timestamp > timestamp_) {
113  --ptr;
114  continue;
115  }
116  if (ptr->timestamp < unsorted_since_) {
117  break;
118  }
119  if (!(ptr->data < min_value) && (ptr->data < max_value)) {
120  func(*ptr, min_value, max_value);
121  }
122  --ptr;
123  }
124  if (ptr == end) {
125  return;
126  }
127  ptr = std::upper_bound(end + 1, ptr + 1, max_value,
128  [](const EDATA_T& a, const MutableNbr<EDATA_T>& b) {
129  return a < b.data;
130  }) -
131  1;
132  while (ptr != end) {
133  if (ptr->data < min_value) {
134  break;
135  }
136  func(*ptr, min_value, max_value);
137  --ptr;
138  }
139  }
140 
141  // iterate edges with data in (min_value, +inf)
142  template <typename FUNC_T>
143  void foreach_edges_gt(vid_t v, EDATA_T& min_value, const FUNC_T& func) const {
144  const auto& edges = csr_.get_edges(v);
145  auto ptr = edges.end() - 1;
146  auto end = edges.begin() - 1;
147  while (ptr != end) {
148  if (ptr->timestamp > timestamp_) {
149  --ptr;
150  continue;
151  }
152  if (ptr->timestamp < unsorted_since_) {
153  break;
154  }
155  if (min_value < ptr->data) {
156  func(*ptr, min_value);
157  }
158  --ptr;
159  }
160  while (ptr != end) {
161  if (!(min_value < ptr->data)) {
162  break;
163  }
164  func(*ptr, min_value);
165  --ptr;
166  }
167  }
168 
169  // iterate edges with data in [min_value, +inf)
170  template <typename FUNC_T>
171  void foreach_edges_ge(vid_t v, EDATA_T& min_value, const FUNC_T& func) const {
172  const auto& edges = csr_.get_edges(v);
173  auto ptr = edges.end() - 1;
174  auto end = edges.begin() - 1;
175  while (ptr != end) {
176  if (ptr->timestamp > timestamp_) {
177  --ptr;
178  continue;
179  }
180  if (ptr->timestamp < unsorted_since_) {
181  break;
182  }
183  if (!(ptr->data < min_value)) {
184  func(*ptr, min_value);
185  }
186  --ptr;
187  }
188  while (ptr != end) {
189  if (ptr->data < min_value) {
190  break;
191  }
192  func(*ptr, min_value);
193  --ptr;
194  }
195  }
196 
197  private:
201 };
202 
203 template <typename EDATA_T>
205  public:
207  : csr_(csr), timestamp_(timestamp) {}
208 
209  bool exist(vid_t v) const {
210  return (csr_.get_edge(v).timestamp.load() <= timestamp_);
211  }
212 
214  return csr_.get_edge(v);
215  }
216 
217  private:
220 };
221 
222 template <>
223 class SingleGraphView<std::string_view> {
224  public:
226  timestamp_t timestamp)
227  : csr_(csr), timestamp_(timestamp) {}
228 
229  bool exist(vid_t v) const {
230  return (csr_.get_edge(v).timestamp.load() <= timestamp_);
231  }
232 
234  return csr_.get_edge(v);
235  }
236 
237  private:
240 };
241 
242 template <typename EDATA_T>
244  public:
246  : csr_(csr) {}
247 
248  bool exist(vid_t v) const {
249  return (csr_.get_edge(v).neighbor != std::numeric_limits<vid_t>::max());
250  }
251 
253  return csr_.get_edge(v);
254  }
255 
256  private:
258 };
259 
260 template <>
261 class SingleImmutableGraphView<std::string_view> {
262  public:
264  : csr_(csr) {}
265 
266  bool exist(vid_t v) const {
267  return (csr_.get_edge(v).neighbor != std::numeric_limits<vid_t>::max());
268  }
269 
271  return csr_.get_edge(v);
272  }
273 
274  private:
276 };
277 
279  public:
280  ReadTransaction(const GraphDBSession& session,
284 
285  timestamp_t timestamp() const;
286 
287  void Commit();
288 
289  void Abort();
290 
291  const MutablePropertyFragment& graph() const;
292 
293  /*
294  * @brief Get the handle of the vertex property column, only for non-primary
295  * key columns.
296  */
297  const std::shared_ptr<ColumnBase> get_vertex_property_column(
298  uint8_t label, const std::string& col_name) const {
299  return graph_.get_vertex_table(label).get_column(col_name);
300  }
301 
309  template <typename T>
310  const std::shared_ptr<TypedRefColumn<T>> get_vertex_ref_property_column(
311  uint8_t label, const std::string& col_name) const {
312  auto pk = graph_.schema().get_vertex_primary_key(label);
313  CHECK(pk.size() == 1) << "Only support single primary key";
314  if (col_name == std::get<1>(pk[0])) {
315  return std::dynamic_pointer_cast<TypedRefColumn<T>>(
317  } else {
318  auto ptr = graph_.get_vertex_table(label).get_column(col_name);
319  if (ptr) {
320  return std::dynamic_pointer_cast<TypedRefColumn<T>>(
321  CreateRefColumn(ptr));
322  } else {
323  return nullptr;
324  }
325  }
326  }
327 
329  public:
330  vertex_iterator(label_t label, vid_t cur, vid_t num,
333 
334  bool IsValid() const;
335  void Next();
336  void Goto(vid_t target);
337 
338  Any GetId() const;
339  vid_t GetIndex() const;
340 
341  Any GetField(int col_id) const;
342  int FieldNum() const;
343 
344  private:
349  };
350 
352  public:
353  edge_iterator(label_t neighbor_label, label_t edge_label,
354  std::shared_ptr<CsrConstEdgeIterBase> iter);
355  ~edge_iterator();
356 
357  Any GetData() const;
358 
359  bool IsValid() const;
360 
361  void Next();
362 
363  vid_t GetNeighbor() const;
364 
365  label_t GetNeighborLabel() const;
366 
367  label_t GetEdgeLabel() const;
368 
369  private:
372 
373  std::shared_ptr<CsrConstEdgeIterBase> iter_;
374  };
375 
377 
378  vertex_iterator FindVertex(label_t label, const Any& id) const;
379 
380  bool GetVertexIndex(label_t label, const Any& id, vid_t& index) const;
381 
382  vid_t GetVertexNum(label_t label) const;
383 
384  Any GetVertexId(label_t label, vid_t index) const;
385 
387  label_t neighbor_label,
388  label_t edge_label) const;
389 
391  label_t neighbor_label,
392  label_t edge_label) const;
393 
394  template <typename EDATA_T>
396  label_t neighbor_label,
397  label_t edge_label) const {
398  auto csr = dynamic_cast<const TypedMutableCsrBase<EDATA_T>*>(
399  graph_.get_oe_csr(v_label, neighbor_label, edge_label));
400  return AdjListView<EDATA_T>(csr->get_edges(v), timestamp_);
401  }
402 
403  template <typename EDATA_T>
405  label_t neighbor_label,
406  label_t edge_label) const {
407  auto csr = dynamic_cast<const TypedMutableCsrBase<EDATA_T>*>(
408  graph_.get_ie_csr(v_label, neighbor_label, edge_label));
409  return AdjListView<EDATA_T>(csr->get_edges(v), timestamp_);
410  }
411 
412  const Schema& schema() const;
413 
414  template <typename EDATA_T>
416  label_t neighbor_label,
417  label_t edge_label) const {
418  auto csr = dynamic_cast<const MutableCsr<EDATA_T>*>(
419  graph_.get_oe_csr(v_label, neighbor_label, edge_label));
420  return GraphView<EDATA_T>(*csr, timestamp_);
421  }
422 
423  template <typename EDATA_T>
425  label_t neighbor_label,
426  label_t edge_label) const {
427  auto csr = dynamic_cast<const MutableCsr<EDATA_T>*>(
428  graph_.get_ie_csr(v_label, neighbor_label, edge_label));
429  return GraphView<EDATA_T>(*csr, timestamp_);
430  }
431 
432  template <typename EDATA_T>
434  label_t v_label, label_t neighbor_label, label_t edge_label) const {
435  auto csr = dynamic_cast<const SingleMutableCsr<EDATA_T>*>(
436  graph_.get_oe_csr(v_label, neighbor_label, edge_label));
437  return SingleGraphView<EDATA_T>(*csr, timestamp_);
438  }
439 
440  template <typename EDATA_T>
442  label_t v_label, label_t neighbor_label, label_t edge_label) const {
443  auto csr = dynamic_cast<const SingleMutableCsr<EDATA_T>*>(
444  graph_.get_ie_csr(v_label, neighbor_label, edge_label));
445  return SingleGraphView<EDATA_T>(*csr, timestamp_);
446  }
447 
448  template <typename EDATA_T>
450  label_t v_label, label_t neighbor_label, label_t edge_label) const {
451  auto csr = dynamic_cast<const SingleImmutableCsr<EDATA_T>*>(
452  graph_.get_oe_csr(v_label, neighbor_label, edge_label));
454  }
455 
456  template <typename EDATA_T>
458  label_t v_label, label_t neighbor_label, label_t edge_label) const {
459  auto csr = dynamic_cast<const SingleImmutableCsr<EDATA_T>*>(
460  graph_.get_ie_csr(v_label, neighbor_label, edge_label));
462  }
463 
464  const GraphDBSession& GetSession() const;
465 
466  private:
467  void release();
468 
473 };
474 
475 } // namespace gs
476 
477 #endif // GRAPHSCOPE_DATABASE_READ_TRANSACTION_H_
gs::ReadTransaction::FindVertex
vertex_iterator FindVertex(label_t label, const Any &id) const
Definition: read_transaction.cc:95
gs::ReadTransaction::vertex_iterator
Definition: read_transaction.h:328
gs::SingleGraphView< std::string_view >::SingleGraphView
SingleGraphView(const SingleMutableCsr< std::string_view > &csr, timestamp_t timestamp)
Definition: read_transaction.h:225
gs::AdjListView::edges_
slice_t edges_
Definition: read_transaction.h:88
gs::ReadTransaction::GetVertexIndex
bool GetVertexIndex(label_t label, const Any &id, vid_t &index) const
Definition: read_transaction.cc:105
gs::ReadTransaction::edge_iterator::GetNeighbor
vid_t GetNeighbor() const
Definition: read_transaction.cc:78
gs::AdjListView::nbr_iterator::ptr_
const_nbr_ptr_t ptr_
Definition: read_transaction.h:67
gs::Any
Definition: types.h:383
gs::AdjListView::end
nbr_iterator end() const
Definition: read_transaction.h:81
gs::SingleGraphView::exist
bool exist(vid_t v) const
Definition: read_transaction.h:209
gs::ReadTransaction::vm_
VersionManager & vm_
Definition: read_transaction.h:471
gs::ReadTransaction::GetVertexId
Any GetVertexId(label_t label, vid_t index) const
Definition: read_transaction.cc:114
gs::ReadTransaction::vertex_iterator::FieldNum
int FieldNum() const
Definition: read_transaction.cc:56
gs::timestamp_t
uint32_t timestamp_t
Definition: types.h:30
gs::SingleImmutableGraphView::SingleImmutableGraphView
SingleImmutableGraphView(const SingleImmutableCsr< EDATA_T > &csr)
Definition: read_transaction.h:245
gs::MutablePropertyFragment::schema
const Schema & schema() const
Definition: mutable_property_fragment.cc:388
gs::ReadTransaction::GetSession
const GraphDBSession & GetSession() const
Definition: read_transaction.cc:139
gs::ReadTransaction::vertex_iterator::GetId
Any GetId() const
Definition: read_transaction.cc:47
gs::SingleGraphView
Definition: read_transaction.h:204
gs::ReadTransaction::vertex_iterator::GetIndex
vid_t GetIndex() const
Definition: read_transaction.cc:50
gs::ReadTransaction::GetIncomingEdges
AdjListView< EDATA_T > GetIncomingEdges(label_t v_label, vid_t v, label_t neighbor_label, label_t edge_label) const
Definition: read_transaction.h:404
gs::vid_t
uint32_t vid_t
Definition: types.h:31
gs::SingleImmutableGraphView< std::string_view >::csr_
const SingleImmutableCsr< std::string_view > & csr_
Definition: read_transaction.h:275
gs::SingleImmutableGraphView< std::string_view >::get_edge
ImmutableNbr< std::string_view > get_edge(vid_t v) const
Definition: read_transaction.h:270
gs::ReadTransaction::timestamp
timestamp_t timestamp() const
Definition: read_transaction.cc:28
gs::SingleGraphView::get_edge
const MutableNbr< EDATA_T > & get_edge(vid_t v) const
Definition: read_transaction.h:213
gs::SingleImmutableGraphView::get_edge
const ImmutableNbr< EDATA_T > & get_edge(vid_t v) const
Definition: read_transaction.h:252
gs::GraphView::foreach_edges_gt
void foreach_edges_gt(vid_t v, EDATA_T &min_value, const FUNC_T &func) const
Definition: read_transaction.h:143
gs::ReadTransaction::release
void release()
Definition: read_transaction.cc:132
gs::ReadTransaction::edge_iterator
Definition: read_transaction.h:351
gs
Definition: adj_list.h:23
gs::ReadTransaction::get_vertex_ref_property_column
const std::shared_ptr< TypedRefColumn< T > > get_vertex_ref_property_column(uint8_t label, const std::string &col_name) const
Get the handle of the vertex property column, including the primary key.
Definition: read_transaction.h:310
gs::ReadTransaction::vertex_iterator::label_
label_t label_
Definition: read_transaction.h:345
gs::AdjListView::nbr_iterator::operator->
const_nbr_ptr_t operator->() const
Definition: read_transaction.h:48
gs::ReadTransaction::edge_iterator::iter_
std::shared_ptr< CsrConstEdgeIterBase > iter_
Definition: read_transaction.h:373
gs::MutableNbrSlice::begin
const_nbr_ptr_t begin() const
Definition: nbr.h:267
gs::GraphView::foreach_edges_between
void foreach_edges_between(vid_t v, EDATA_T &min_value, EDATA_T &max_value, const FUNC_T &func) const
Definition: read_transaction.h:106
gs::MutableNbr
Definition: nbr.h:193
gs::AdjListView::nbr_iterator::operator==
bool operator==(const nbr_iterator &rhs) const
Definition: read_transaction.h:58
gs::GraphView::unsorted_since_
timestamp_t unsorted_since_
Definition: read_transaction.h:200
gs::ReadTransaction::GetInEdgeIterator
edge_iterator GetInEdgeIterator(label_t label, vid_t u, label_t neighbor_label, label_t edge_label) const
Definition: read_transaction.cc:124
gs::CreateRefColumn
std::shared_ptr< RefColumnBase > CreateRefColumn(std::shared_ptr< ColumnBase > column)
Definition: column.cc:187
gs::ReadTransaction::vertex_iterator::GetField
Any GetField(int col_id) const
Definition: read_transaction.cc:52
gs::SingleImmutableGraphView< std::string_view >::exist
bool exist(vid_t v) const
Definition: read_transaction.h:266
mutable_property_fragment.h
gs::ReadTransaction::session_
const GraphDBSession & session_
Definition: read_transaction.h:469
gs::AdjListView::nbr_iterator
Definition: read_transaction.h:33
gs::MutablePropertyFragment::get_vertex_id_column
std::shared_ptr< RefColumnBase > get_vertex_id_column(uint8_t label) const
Definition: mutable_property_fragment.cc:504
gs::AdjListView::begin
nbr_iterator begin() const
Definition: read_transaction.h:78
gs::ReadTransaction::vertex_iterator::~vertex_iterator
~vertex_iterator()
gs::MutablePropertyFragment
Definition: mutable_property_fragment.h:37
gs::ReadTransaction::timestamp_
timestamp_t timestamp_
Definition: read_transaction.h:472
gs::ReadTransaction::vertex_iterator::Goto
void Goto(vid_t target)
Definition: read_transaction.cc:43
gs::GraphView::csr_
const MutableCsr< EDATA_T > & csr_
Definition: read_transaction.h:198
gs::AdjListView
Definition: read_transaction.h:32
gs::AdjListView::nbr_iterator::timestamp_
timestamp_t timestamp_
Definition: read_transaction.h:69
gs::MutablePropertyFragment::get_ie_csr
CsrBase * get_ie_csr(label_t label, label_t neighbor_label, label_t edge_label)
Definition: mutable_property_fragment.cc:483
gs::AdjListView::nbr_iterator::end_
const_nbr_ptr_t end_
Definition: read_transaction.h:68
gs::MutableNbrSlice::end
const_nbr_ptr_t end() const
Definition: nbr.h:268
gs::MutableNbr::data
EDATA_T data
Definition: nbr.h:221
gs::ReadTransaction::vertex_iterator::vertex_iterator
vertex_iterator(label_t label, vid_t cur, vid_t num, const MutablePropertyFragment &graph)
Definition: read_transaction.cc:36
gs::SingleGraphView::csr_
const SingleMutableCsr< EDATA_T > & csr_
Definition: read_transaction.h:218
gs::GraphView::get_edges
AdjListView< EDATA_T > get_edges(vid_t v) const
Definition: read_transaction.h:100
gs::Schema
Definition: schema.h:29
gs::AdjListView::nbr_iterator::operator*
const_nbr_t & operator*() const
Definition: read_transaction.h:46
gs::GraphView::foreach_edges_ge
void foreach_edges_ge(vid_t v, EDATA_T &min_value, const FUNC_T &func) const
Definition: read_transaction.h:171
gs::GraphView::GraphView
GraphView(const MutableCsr< EDATA_T > &csr, timestamp_t timestamp)
Definition: read_transaction.h:95
gs::GraphDBSession
Definition: graph_db_session.h:36
gs::ReadTransaction::edge_iterator::Next
void Next()
Definition: read_transaction.cc:76
gs::SingleImmutableGraphView::exist
bool exist(vid_t v) const
Definition: read_transaction.h:248
gs::ReadTransaction::GetVertexIterator
vertex_iterator GetVertexIterator(label_t label) const
Definition: read_transaction.cc:90
gs::ReadTransaction::vertex_iterator::IsValid
bool IsValid() const
Definition: read_transaction.cc:41
gs::SingleImmutableCsr
Definition: immutable_csr.h:326
gs::ReadTransaction::GetIncomingGraphView
GraphView< EDATA_T > GetIncomingGraphView(label_t v_label, label_t neighbor_label, label_t edge_label) const
Definition: read_transaction.h:424
gs::VersionManager
Definition: version_manager.h:34
gs::MutableCsr
Definition: mutable_csr.h:183
gs::AdjListView::nbr_iterator::const_nbr_ptr_t
typename MutableNbrSlice< EDATA_T >::const_nbr_ptr_t const_nbr_ptr_t
Definition: read_transaction.h:35
gs::SingleImmutableGraphView
Definition: read_transaction.h:243
gs::ReadTransaction::schema
const Schema & schema() const
Definition: read_transaction.cc:130
gs::ReadTransaction::GetOutgoingEdges
AdjListView< EDATA_T > GetOutgoingEdges(label_t v_label, vid_t v, label_t neighbor_label, label_t edge_label) const
Definition: read_transaction.h:395
gs::ReadTransaction::edge_iterator::edge_label_
label_t edge_label_
Definition: read_transaction.h:371
gs::ReadTransaction
Definition: read_transaction.h:278
gs::SingleImmutableCsr< std::string_view >
Definition: immutable_csr.h:512
gs::TypedMutableCsrBase
Definition: csr_base.h:135
gs::ReadTransaction::GetVertexNum
vid_t GetVertexNum(label_t label) const
Definition: read_transaction.cc:110
gs::ReadTransaction::GetIncomingSingleGraphView
SingleGraphView< EDATA_T > GetIncomingSingleGraphView(label_t v_label, label_t neighbor_label, label_t edge_label) const
Definition: read_transaction.h:441
gs::AdjListView::AdjListView
AdjListView(const slice_t &slice, timestamp_t timestamp)
Definition: read_transaction.h:75
gs::ReadTransaction::vertex_iterator::Next
void Next()
Definition: read_transaction.cc:42
gs::ReadTransaction::vertex_iterator::graph_
const MutablePropertyFragment & graph_
Definition: read_transaction.h:348
gs::AdjListView::nbr_iterator::const_nbr_t
typename MutableNbrSlice< EDATA_T >::const_nbr_t const_nbr_t
Definition: read_transaction.h:34
types.h
gs::MutablePropertyFragment::get_oe_csr
CsrBase * get_oe_csr(label_t label, label_t neighbor_label, label_t edge_label)
Definition: mutable_property_fragment.cc:467
gs::SingleGraphView::SingleGraphView
SingleGraphView(const SingleMutableCsr< EDATA_T > &csr, timestamp_t timestamp)
Definition: read_transaction.h:206
gs::ReadTransaction::edge_iterator::GetEdgeLabel
label_t GetEdgeLabel() const
Definition: read_transaction.cc:86
gs::ReadTransaction::GetIncomingSingleImmutableGraphView
SingleImmutableGraphView< EDATA_T > GetIncomingSingleImmutableGraphView(label_t v_label, label_t neighbor_label, label_t edge_label) const
Definition: read_transaction.h:457
gs::ReadTransaction::edge_iterator::neighbor_label_
label_t neighbor_label_
Definition: read_transaction.h:370
std
Definition: loading_config.h:232
gs::SingleMutableCsr
Definition: mutable_csr.h:745
gs::ReadTransaction::edge_iterator::edge_iterator
edge_iterator(label_t neighbor_label, label_t edge_label, std::shared_ptr< CsrConstEdgeIterBase > iter)
Definition: read_transaction.cc:60
gs::SingleImmutableGraphView< std::string_view >::SingleImmutableGraphView
SingleImmutableGraphView(const SingleImmutableCsr< std::string_view > &csr)
Definition: read_transaction.h:263
gs::ReadTransaction::GetOutgoingGraphView
GraphView< EDATA_T > GetOutgoingGraphView(label_t v_label, label_t neighbor_label, label_t edge_label) const
Definition: read_transaction.h:415
gs::SingleGraphView< std::string_view >::csr_
const SingleMutableCsr< std::string_view > & csr_
Definition: read_transaction.h:238
gs::ReadTransaction::edge_iterator::IsValid
bool IsValid() const
Definition: read_transaction.cc:72
gs::AdjListView::nbr_iterator::nbr_iterator
nbr_iterator(const_nbr_ptr_t ptr, const_nbr_ptr_t end, timestamp_t timestamp)
Definition: read_transaction.h:38
gs::GraphView
Definition: read_transaction.h:93
gs::ReadTransaction::GetOutEdgeIterator
edge_iterator GetOutEdgeIterator(label_t label, vid_t u, label_t neighbor_label, label_t edge_label) const
Definition: read_transaction.cc:118
gs::ReadTransaction::ReadTransaction
ReadTransaction(const GraphDBSession &session, const MutablePropertyFragment &graph, VersionManager &vm, timestamp_t timestamp)
Definition: read_transaction.cc:22
gs::GraphView::timestamp_
timestamp_t timestamp_
Definition: read_transaction.h:199
gs::SingleGraphView< std::string_view >::timestamp_
timestamp_t timestamp_
Definition: read_transaction.h:239
gs::ReadTransaction::~ReadTransaction
~ReadTransaction()
Definition: read_transaction.cc:26
gs::ReadTransaction::edge_iterator::GetData
Any GetData() const
Definition: read_transaction.cc:68
gs::ImmutableNbr
Definition: nbr.h:29
gs::ReadTransaction::edge_iterator::GetNeighborLabel
label_t GetNeighborLabel() const
Definition: read_transaction.cc:82
gs::ReadTransaction::graph
const MutablePropertyFragment & graph() const
Definition: read_transaction.cc:34
mutable_csr.h
gs::ReadTransaction::get_vertex_property_column
const std::shared_ptr< ColumnBase > get_vertex_property_column(uint8_t label, const std::string &col_name) const
Definition: read_transaction.h:297
gs::AdjListView::nbr_iterator::operator++
nbr_iterator & operator++()
Definition: read_transaction.h:50
gs::ReadTransaction::edge_iterator::~edge_iterator
~edge_iterator()
gs::ReadTransaction::vertex_iterator::num_
vid_t num_
Definition: read_transaction.h:347
gs::AdjListView::nbr_iterator::operator!=
bool operator!=(const nbr_iterator &rhs) const
Definition: read_transaction.h:62
gs::SingleGraphView< std::string_view >::get_edge
MutableNbr< std::string_view > get_edge(vid_t v) const
Definition: read_transaction.h:233
gs::ReadTransaction::vertex_iterator::cur_
vid_t cur_
Definition: read_transaction.h:346
gs::ReadTransaction::Abort
void Abort()
Definition: read_transaction.cc:32
gs::SingleMutableCsr< std::string_view >
Definition: mutable_csr.h:954
gs::MutableNbrSlice::size
int size() const
Definition: nbr.h:263
gs::SingleImmutableGraphView::csr_
const SingleImmutableCsr< EDATA_T > & csr_
Definition: read_transaction.h:257
gs::AdjListView::estimated_degree
int estimated_degree() const
Definition: read_transaction.h:85
gs::AdjListView::timestamp_
timestamp_t timestamp_
Definition: read_transaction.h:89
gs::SingleGraphView< std::string_view >::exist
bool exist(vid_t v) const
Definition: read_transaction.h:229
gs::SingleGraphView::timestamp_
timestamp_t timestamp_
Definition: read_transaction.h:219
gs::MutablePropertyFragment::get_vertex_table
Table & get_vertex_table(label_t vertex_label)
Definition: mutable_property_fragment.cc:392
gs::ReadTransaction::GetOutgoingSingleGraphView
SingleGraphView< EDATA_T > GetOutgoingSingleGraphView(label_t v_label, label_t neighbor_label, label_t edge_label) const
Definition: read_transaction.h:433
gs::label_t
uint8_t label_t
Definition: types.h:32
gs::MutableNbrSlice
Definition: nbr.h:253
gs::Table::get_column
std::shared_ptr< ColumnBase > get_column(const std::string &name)
Definition: table.cc:171
gs::Schema::get_vertex_primary_key
const std::vector< std::tuple< PropertyType, std::string, size_t > > & get_vertex_primary_key(label_t index) const
Definition: schema.cc:376
gs::ReadTransaction::Commit
void Commit()
Definition: read_transaction.cc:30
gs::ReadTransaction::graph_
const MutablePropertyFragment & graph_
Definition: read_transaction.h:470
gs::ReadTransaction::GetOutgoingSingleImmutableGraphView
SingleImmutableGraphView< EDATA_T > GetOutgoingSingleImmutableGraphView(label_t v_label, label_t neighbor_label, label_t edge_label) const
Definition: read_transaction.h:449