|
The code above first iterates through every node, brings up its properties, then calls up the relationships that node has. The code then iterates through every relationship, brings up its properties, then calls up the nodes it connects.
The sequence above effectively warms up your caches. If your graph fits in memory, this will prime the database. If your graph doesn’t fit in memory maybe you want to specify a certain set of nodes or relationships to warm up.
Either way you probably don’t want to run this over and over again or expose it to your end users. Remember what I said about being responsible with what you do here.
You’ll have to stop Neo4j, recompile it, copy the new jar file over the existing one, restart Neo4j, and run the command.- 1.rake neo4j:stop
- 2.mvn clean package
- 3.cp target/unmanaged-extension-template-1.0.jar neo4j/plugins/
- 4.rake neo4j:start
- 5.curl <a href="http://localhost:7474/example/service/warmup">http://localhost:7474/example/service/warmup</a>
复制代码 |
|