1

Is there a way to load gremlin methods into the rexster/Titan on bootup?

This way I don't have to resend these methods each time I want to use them via rexpro. Currently I do stuff like this (trivial example):

rexpro_client.execute("def some_method(a){a.outE.count()}\n some_method("+some_variables+");")
rexpro_client.execute("def some_method(a){a.outE.count()}\n some_method("+some_variables2+");")
....

Which is obviously not efficient when executing this multiple times.

For extra clarification: I would obviously like to have my some_method pre-defined so I could simply do this in stead:

rexpro_client.execute("some_method("+some_variables+");")
rexpro_client.execute("some_method("+some_variables2+");")
Automatico
  • 12,420
  • 9
  • 82
  • 110

1 Answers1

4

See Rexster Configuation.

The <init-scripts> element defines one or more comma-separated script files that gets executed at the initialization of a Gremlin Script Engine. The initialization allows for the creation of user-defined steps and functions to be made available.

Cheers, Daniel

Daniel Kuppitz
  • 10,846
  • 1
  • 25
  • 34
  • Great! Do you know what the relative path of the init-scripts is? When it says `config/some_script.groovy`, is that relative to the xml-file, the rexster ssh, the terminal starting the server ..? – Automatico Apr 10 '14 at 12:43
  • I mean "rextser sh script", not ssh. – Automatico Apr 10 '14 at 13:17