public class GraphUpdaterManager extends Object
GraphUpdaterManager updaterManager = graph.getUpdaterManager();Each updater will run in its own thread. When changes to the graph have to be made by these updaters, this should be done via the execute method of this manager to prevent race conditions between graph write operations.
Constructor and Description |
---|
GraphUpdaterManager(Graph graph)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addUpdater(GraphUpdater updater)
Adds an updater to the manager and runs it immediately in its own thread.
|
void |
execute(GraphWriterRunnable runnable)
This is the method to use to modify the graph from the updaters.
|
GraphUpdater |
getUpdater(int id)
Just an example of fetching status information from the graph updater manager to expose it in a web service.
|
Map<Integer,String> |
getUpdaterDescriptions()
Just an example of fetching status information from the graph updater manager to expose it in a web service.
|
int |
size() |
void |
startUpdaters()
This should be called only once at startup to kick off every updater in its own thread, and only after all
the updaters have had their setup methods called.
|
void |
stop() |
public GraphUpdaterManager(Graph graph)
graph
- is the Graph that will be updated.public void stop()
public void addUpdater(GraphUpdater updater)
updater
- is the updater to add and runpublic void execute(GraphWriterRunnable runnable)
runnable
- is a graph writer runnablepublic int size()
public void startUpdaters()
public Map<Integer,String> getUpdaterDescriptions()
public GraphUpdater getUpdater(int id)
Copyright © 2018. All rights reserved.