Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all partitions in gremlin?

Tags:

gremlin

Is there anyway to list all partition keys with gremlin API? I knew that I can create a PartitionStrategy while creating a graph. However, how can I know which partitions already have in a graph?

like image 889
Xianyi Ye Avatar asked Sep 03 '25 10:09

Xianyi Ye


1 Answers

In the context of PartitionStrategy, there are only two ways to know what partitions are in the graph:

  1. You know and keep track of the various partitions yourself as they are created.
  2. You query the graph for the partitions by getting the unique list of partition names in the partition key: g.V().values("nameOfYourPartitionKey").dedup()

Obviously, the second approach listed above could be very expensive since it is a global traversal. For especially large graphs you may need to use an OLAP-style traversal with SparkGraphComputer.

like image 192
stephen mallette Avatar answered Sep 05 '25 16:09

stephen mallette