Naveen Raj
Naveen Raj

Reputation: 125

Cannot update edgeTTL in JanusGraph

I'm using JanusGraph-1.0.0 with Cassandra-4.1.3. By using JanusGraphManagement, I am able to set edge TTL. However, I cannot update the edge TTL later.

I have created an edge label and with mgmt.printEdgeLabels(), I get the below output.

------------------------------------------------------------------------------------------------
Edge Label Name                | Directed    | Unidirected | Multiplicity                         |
---------------------------------------------------------------------------------------------------
ML_EDGE                        | true        | false       | MULTI                                |
---------------------------------------------------------------------------------------------------

I cannot find specific API to update edge TTL. So I used mgmt.setTTL() method to set and update TTL.

Below is the code,

JanusGraphManagement management = graph.openManagement();
management.setTTL(management.getEdgeLabel("ML_EDGE"), Duration.ofHours(72));
management.commit();

When setting edgeTTL for the first time, it is set as expected. However, updating edgeTTL later using the same code throws exception.

Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.janusgraph.graphdb.database.management.ModifierType.<clinit>(ModifierType.java:23)
    at org.janusgraph.graphdb.database.management.ManagementSystem.setTTL(ManagementSystem.java:1373)
    at causalai.janusgraph.JGClient.main(JGClient.java:32)
Caused by: java.lang.NullPointerException
    at org.janusgraph.graphdb.database.management.ModifierType.values(ModifierType.java:22)
    at org.janusgraph.graphdb.types.TypeDefinitionCategory.<clinit>(TypeDefinitionCategory.java:84)
    ... 3 more

Is there something that I am missing? Or is there some other way to do this?

Thanks in advance.

Upvotes: 1

Views: 38

Answers (0)

Related Questions