Class TinkerFactoryDataLoader
java.lang.Object
org.apache.tinkerpop.gremlin.server.util.TinkerFactoryDataLoader
- All Implemented Interfaces:
LifeCycleHook
A
LifeCycleHook that loads TinkerFactory sample datasets into a graph during server startup.
Replaces the Groovy init scripts (e.g. generate-modern.groovy) for default server configurations.
Configuration parameters (via config in YAML):
graph— name of the graph (as defined ingraphs:config) to load data intodataset— which dataset to load: modern, classic, crew, grateful, sink, airroutes, zoo
Example YAML usage:
lifecycleHooks:
- className: org.apache.tinkerpop.gremlin.server.util.TinkerFactoryDataLoader
config: {graph: graph, dataset: modern}
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.server.util.LifeCycleHook
LifeCycleHook.Context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled once after instantiation to pass configuration from thelifecycleHooksYAML section.voidCalled when the server is shutdown.voidCalled when the server starts up.
-
Constructor Details
-
TinkerFactoryDataLoader
public TinkerFactoryDataLoader()
-
-
Method Details
-
init
Description copied from interface:LifeCycleHookCalled once after instantiation to pass configuration from thelifecycleHooksYAML section. Implementations that require configuration should override this method. The default implementation is a no-op so that existing hooks are not forced to implement it.If this method throws an exception, the hook is skipped and the server continues to start without it.
- Specified by:
initin interfaceLifeCycleHook- Parameters:
config- the key/value pairs from theconfigblock in the YAML entry
-
onStartUp
Description copied from interface:LifeCycleHookCalled when the server starts up. The graph collection will have been initialized at this point and all initialization scripts will have been executed when this callback is called.If this method throws an exception (other than
UnsupportedOperationException), the server will fail to start.- Specified by:
onStartUpin interfaceLifeCycleHook
-
onShutDown
Description copied from interface:LifeCycleHookCalled when the server is shutdown.If this method throws an exception, remaining shutdown hooks and graph cleanup may be skipped.
- Specified by:
onShutDownin interfaceLifeCycleHook
-