Unable to drop Remote JanusGraph

54 views
Skip to first unread message

Dipen Jain

unread,
Jul 14, 2020, 6:44:36 PM7/14/20
to JanusGraph users
Hi,

I'm looking to drop a graph, but the JanusgraphFactory.drop(graph) doesn't work for me. I'm using JAVA to connect to the remote server and load/remove data.

Using the below properties file  for remote-properties gremlin.remote.remoteConnectionClass=org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection
gremlin.remote.driver.clusterFile=conf/remote-objects.yaml
gremlin.remote.driver.sourceName=g

Below file for remote-objects - 

hosts: [hostname]
port: 8182
serializer: {
className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0,
config: {
ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry]
}
}
Using this to open the graph - 
conf = new PropertiesConfiguration(propFileName);

// using the remote graph for queries
graph = JanusGraphFactory.open("inmemory");
g = graph.traversal().withRemote(conf);
return g;

Using this to drop the graph:
if (graph != null) {
LOGGER.info("Dropping janusgraph function");
JanusGraphFactory.drop(getJanusGraph());
}

Any help would be appreciated.
Thanks!

Nicolas Trangosi

unread,
Jul 15, 2020, 3:43:13 PM7/15/20
to JanusGraph users
Hi,
I am able to drop remotely  the graph using the script:
JanusGraphFactory.drop(graph);[]

After the script, I need to restart janusGraph in order to re-create the graph.
Could you sent the janusgraph logs with the stack trace ?

Also, instead of  JanusGraphFactory.drop(getJanusGraph());  , could you try with JanusGraphFactory.drop(graph);

Kind regards,
Nicolas

Ce message et ses pièces jointes peuvent contenir des informations confidentielles ou privilégiées et ne doivent donc pas être diffusés, exploités ou copiés sans autorisation. 
Si vous avez reçu ce message par erreur, veuillez le signaler a l'expéditeur et le détruire ainsi que les pièces jointes. 
Les messages électroniques étant susceptibles d'altération, DCbrain décline toute responsabilité si ce message a été altéré, déformé ou falsifié. Merci. 

This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, DCbrain is not liable for messages that have been modified, changed or falsified. Thank you.

Dipen Jain

unread,
Jul 16, 2020, 8:53:03 AM7/16/20
to JanusGraph users
Hi Nicolas,

How do we know if the graph has been dropped? You said you have to restart the server after doing that. I am doing the same, but I don't want to. Is there any way of clearing all the data, the schema without restarting the server.

Also, JanusGraphFactory.drop(getJanusGraph()) is the same as JanusGraphFactory.drop(graph) - because that function passes the same object and it still doesn't work. I don't want to restart the server as it's a remote server. How do I achieve that?

Nicolas Trangosi

unread,
Jul 21, 2020, 2:50:19 AM7/21/20
to JanusGraph users
Hi,
> How do we know if the graph has been dropped?   
As I am using Cassandra and ES as backend, I can see that data as been dropped by doing a direct request to these components.

>   Is there any way of clearing all the data, the schema without restarting the server. 
I have found any yet but I do not look into the gremlin server code.  I do not have this requirement, so I do search for it. May be using a proxy design pattern on graph object may do the trick.

Nicolas

sparshneel chanchlani

unread,
Jul 21, 2020, 8:21:08 AM7/21/20
to janusgra...@googlegroups.com
Try ./janusgraph.sh clean

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/ab1d0d52-ce84-4eeb-ad24-e3e189eb4ed5n%40googlegroups.com.

Dipen Jain

unread,
Jul 21, 2020, 11:37:47 AM7/21/20
to JanusGraph users
Hi,

I want to do it programmatically like how I mentioned in the post - something which is a gremlin query equivalent.


On Tuesday, July 21, 2020 at 8:21:08 AM UTC-4, sparshneel chanchlani wrote:
Try ./janusgraph.sh clean

To unsubscribe from this group and stop receiving emails from it, send an email to janusgra...@googlegroups.com.

Dipen Jain

unread,
Jul 21, 2020, 11:39:38 AM7/21/20
to JanusGraph users
Hi,

I was using a remote server and using inmemory backend for the remote server - I was still able to query the data, Even after dropping it - the data didn't get removed and I had to restart it.

Nicolas Trangosi

unread,
Jul 23, 2020, 9:46:36 AM7/23/20
to JanusGraph users
Hi,
Have you tried instead of drop the graph, to do a g.V().drop().iterate()
Please note, that in this case janusGraph schema would still exist and depending on the backend, this solution can be much longer.

Another solution would be to drop the graph, then replace in global bindings, the graph and the g reference. 
The global bindings are set in org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor and are initialized in org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager.getAsBindings(). As the implementation of GraphManager is configurable, it should be possible to develop an extension that allows you to retrieve the global bindings and then replace the  graph and the g reference.   

Reply all
Reply to author
Forward
0 new messages