dynamically add graph to gremlin server?

87 views
Skip to first unread message

D. Lam

unread,
Aug 23, 2016, 11:53:17 AM8/23/16
to Gremlin-users
I understand Gremlin Server can serve up multiple graphs if configured in gremlin-server.yaml. Is there a way to dynamically and programmatically add a new graph to be served up by the server?

Stephen Mallette

unread,
Aug 24, 2016, 3:23:48 PM8/24/16
to Gremlin-users
You could use a session and create an instance programmatically in the session - that would work. I can't think of a way to do that with sessionless communication short of a custom OpProcessor.   When you implement OpProcessor you have to implement this method:

public ThrowingConsumer<Context> select(final Context ctx) throws OpProcessorException;

The Context gives you access to the GraphManager which lets you access the Map of Graph and TraversalSource instances Gremlin Server has access to. You OpProcessor could allow you to receive custom request messages that you could use to do what you want to do.

Not sure what the implications of exposing a feature like that would mean. I guess the main thing to worry about is multiple requests trying to add the same graph or something like that. If you could sort that out it might be a nice feature to Gremlin Server itself if you feel like offering a pull request for it. 



On Tue, Aug 23, 2016 at 11:13 AM, D. Lam <dna...@gmail.com> wrote:
I understand Gremlin Server can serve up multiple graphs if configured in gremlin-server.yaml. Is there a way to dynamically and programmatically add a new graph to be served up by the server?

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/80c8fc5f-3e22-44c4-855c-d79c0bce9ef8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages