Set TTL for vertex

Can i set TTL for vertex after running janusgraph about 4 months?
Solution:
From https://docs.janusgraph.org/schema/advschema/#vertex-ttl :
mgmt = graph.openManagement()
tweet = mgmt.makeVertexLabel('tweet').setStatic().make()
mgmt.setTTL(tweet, Duration.ofHours(36))
mgmt.commit()
mgmt = graph.openManagement()
tweet = mgmt.makeVertexLabel('tweet').setStatic().make()
mgmt.setTTL(tweet, Duration.ofHours(36))
mgmt.commit()
...
Jump to solution
6 Replies
Solution
Volker
Volker2y ago
From https://docs.janusgraph.org/schema/advschema/#vertex-ttl :
mgmt = graph.openManagement()
tweet = mgmt.makeVertexLabel('tweet').setStatic().make()
mgmt.setTTL(tweet, Duration.ofHours(36))
mgmt.commit()
mgmt = graph.openManagement()
tweet = mgmt.makeVertexLabel('tweet').setStatic().make()
mgmt.setTTL(tweet, Duration.ofHours(36))
mgmt.commit()
Dinh Phu
Dinh PhuOP2y ago
if that vertexlabel already exists, what to do
Volker
Volker2y ago
mgmt.getVertexLabel('tweet').setTTL(...)
mgmt.getVertexLabel('tweet').setTTL(...)
Dinh Phu
Dinh PhuOP2y ago
thank
Volker
Volker2y ago
you are welcome, but keep in mind that it can take some time to actually propagate the TTL changes in janusgraph and only
CQL, HBase and BerkeleyDB
CQL, HBase and BerkeleyDB
support TTL atm
Dinh Phu
Dinh PhuOP2y ago
yes, fortunately i' m using Hbase
Want results from more Discord servers?
Add your server