How does JanusGraph/Titan Database interact with cassandra?

704 views
Skip to first unread message

i...@zju.edu.cn

unread,
Dec 2, 2017, 10:52:38 AM12/2/17
to JanusGraph users
I'm trying to understand how JanusGraph/Titan interact with Cassandra. Specifically, I want to know what Cassandra tables does JanusGraph/Titan create, what contents are in them and what happens to them when I mutate the graph, e.g. adding a vertex, adding an edge, create an index...

After connecting to Cassandra using code below, I notice that there're 9 tables under 'titan' keyspace in Cassandra (I'm experimenting using Titan):

g=TitanFactory.build().set("storage.backend", "cassandra").set("storage.hostname","127.0.0.1").open();


Those tables are:

titan_ids
edgestore
edgestore_lock_
system_properties
system_properties_lock_
graphindex
graphindex_lock_
txlog
systemlog

I added a vertex:

john=g.addVertex("John");



And then I notice that titan_ids contains 5 new rows, and each time I add another vertex, 2 more rows appear. No other tables are affected. But if I drop any of the vertices, the rows does not disappear.

I want to know the content of those new rows, but 
select * from titan_ids;
gives:

 key                | column1
               | value
--------------------+-----------------------------------------------------------
---------------+-------
 0x0000000000000003 | 0xfffffffffffec77f00055f5c22db84f8643232303931343031323230
302d6972697331 |    0x
 0x5000000000000000 | 0xffffffffffffd8ef00055f5c22e1b300643232303931343031323230
302d6972697331 |    0x
 0x0000000000000004 | 0xffffffffffffff9b00055f5c22d658c0643232303931343031323230
302d6972697331 |    0x
 0x0000000000000004 | 0xffffffffffffffcd00055f5c22d11518643232303931343031323230
302d6972697331 |    0x
 0xe800000000000000 | 0xffffffffffffd8ef00055f5c6c828bb0643232303931343031323230
302d6972697331 |    0x
 0x5000000000000003 | 0xfffffffffffec77f00055f5c22e6df38643232303931343031323230
302d6972697331 |    0x
 0xe800000000000003 | 0xfffffffffffec77f00055f5c6c87b400643232303931343031323230
302d6972697331 |    0x
 0xa000000000000000 | 0xffffffffffffd8ef00055f5c6381f708643232303931343031323230
302d6972697331 |    0x
 0xa000000000000003 | 0xfffffffffffec77f00055f5c63872340643232303931343031323230
302d6972697331 |    0x

(9 rows)

which is not for human to read, so I have no idea what JanusGraph/Titan ask Cassandra to store. I expect to see some literals like "John".

So my question is, what do those 9 tables store? Is there any documentation about it? How can I read the contents in them so that when I experiment with Cassandra, I can understand what's going on for each table?

Ankur Goel

unread,
Dec 4, 2017, 12:14:57 AM12/4/17
to JanusGraph users
Right now deep detail is missing in doc, only information only thing available is http://docs.janusgraph.org/latest/data-model.html
 Which only talk about graph storage at high concept level  more on adjacency list concept.

Other way is to look source code.


~

i...@zju.edu.cn

unread,
Dec 5, 2017, 3:28:14 AM12/5/17
to JanusGraph users
Thanks for your reply, I'm referring to source code now.

在 2017年12月4日星期一 UTC+8下午1:14:57,Ankur Goel写道:

Ankur Goel

unread,
Dec 5, 2017, 7:39:11 AM12/5/17
to i...@zju.edu.cn, JanusGraph users
Don't forgot to share your findings here.

~


--
You received this message because you are subscribed to a topic in the Google Groups "JanusGraph users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/janusgraph-users/dzT5TEJfqGI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/056bc2c9-bd12-4282-b90a-dcbe05cfc188%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

shivanjal arora

unread,
Jun 21, 2018, 12:01:24 PM6/21/18
to JanusGraph users
Hi,
I was able to decode the edge store table data.
I have written a java code for decoding the edge store table.
The code basically connects to Cassandra Database and also creates opens a Janusgraph Instance.
Details for Cassandra server(hostname, port and keyspace) are hard coded in the file CassandraReadEdgeStoreTable.java.
Janusgraph properties are stored in a properties file and the path has to be provided at run time via command line argument.
Note:If there are partitioned vertices in your graph, this code may not work.

I have used snippets from JanusGraphVertexDeserializer class from Janusgraph project.

I have attached two files:
1. CassandraReadEdgeStoreTable.java
2. test.properties

Hope It helps!

On Saturday, December 2, 2017 at 9:22:38 PM UTC+5:30, i...@zju.edu.cn wrote:
CassandraReadEdgeStoreTable.java
test.properties

dengzim...@gmail.com

unread,
Jul 8, 2018, 3:16:50 AM7/8/18
to JanusGraph users
you are great!
so can you give more code for decoding the graph index table and janusgraph_ids table.

learnin...@gmail.com

unread,
Apr 4, 2019, 7:58:22 AM4/4/19
to JanusGraph users
I too am interested for having a plain text visibility toggle. Is this something that must not be exposed for app developers? Am not sure or can't find good supporting information.


On Saturday, December 2, 2017 at 9:22:38 PM UTC+5:30, i...@zju.edu.cn wrote:
Reply all
Reply to author
Forward
0 new messages