|
A few example Faunus jobs are provided below. The final job on line 9 generates an in-degree distribution. The in-degree of a vertex is defined as the number of incoming edges to the vertex.
The outputted result states how many vertices (second column) have a particular in-degree (first column). For example, 167,050 vertices have only 1 incoming edge.- The provided titan-hbase.properties file should be updated withhbase.zookeeper.quorum=10.12.27.208 instead of localhost. The IP address 10.12.27.208 is provided by ~/.whirr/agc/instances on agc-master. Finally, the Gremlin console is started.
- 01.ubuntu@ip-10-12-27-208:~$ wget <a href="https://github.com/downloads/thinkaurelius/faunus/faunus-0.1-alpha.zip">https://github.com/downloads/thinkaurelius/faunus/faunus-0.1-alpha.zip</a>
- 02.ubuntu@ip-10-12-27-208:~$ unzip faunus-0.1-alpha.zip
- 03.ubuntu@ip-10-12-27-208:~$ cd faunus-0.1-alpha/
- 04.ubuntu@ip-10-12-27-208:~/faunus-0.1-alpha$ vi bin/titan-hbase.properties
- 05.ubuntu@ip-10-12-27-208:~/faunus-0.1-alpha$ bin/gremlin.sh
- 06.
- 07.\,,,/
- 08.(o o)
- 09.-----oOOo-(_)-oOOo-----
- 10.gremlin>
- A few example Faunus jobs are provided below. The final job on line 9 generates an in-degree distribution. The in-degree of a vertex is defined as the number of incoming edges to the vertex. The outputted result states how many vertices (second column) have a particular in-degree (first column). For example, 167,050 vertices have only 1 incoming edge.
- 01.gremlin> g = FaunusFactory.open('bin/titan-hbase.properties')
- 02.==>faunusgraph[titanhbaseinputformat]
- 03.gremlin> g.V.count() // how many vertices in the graph?
- 04.==>1000001
- 05.gremlin> g.E.count() // how many edges in the graph?
- 06.==>1000000
- 07.gremlin> g.V.out.out.out.count() // how many length 3 paths are in the graph?
- 08.==>988780
- 09.gremlin> g.V.sideEffect('{it.degree = it.inE.count()}').degree.groupCount// what is the graph's in-degree distribution?
- 10.==>1 167050
- 11.==>10 2305
- 12.==>100 6
- 13.==>108 3
- 14.==>119 3
- 15.==>122 3
- 16.==>133 1
- 17.==>144 2
- 18.==>155 1
- 19.==>166 2
- 20.==>18 471
- 21.==>188 1
- 22.==>21 306
- 23.==>232 1
- 24.==>254 1
- 25.==>...
- 26.gremlin>
复制代码 |
|