Hi Michael, using arrays to store the properties solved the performance issues as you suggested. The application is completing 10x faster easily
BUT it creates another problem. From the pseudo-code below I see the following behaviour:
- when the array lcm contains 16 test values (all -1.0f) the application runs at performance and I can open the db (via neo4j-shell) and see the relationship have 16 x -1.0fs stored in a property array
- when lcm contains real and different values (e.g. 16 random floats) the application runs at performance BUT the .db won't open in neo4j-shell - it fails with the exception show below
- if i limit the size of the lcm array to 2 or 4 real/random floats then it works
I am guessing the property stores are compressed or something?
Regards, John.
public class ScoredLink {
long id;
float[] lcm = new float[16];
..........etc
public static void main(String[] args)
// ...do the math and score the 200M links local, in-memory
// open the neo4j db
// create batches of 500 relationships/links to write back
// push the batches into a thread pool
// for each thread....
try ( Transaction tx = db.beginTx() ) {
for (int i=start; i<=end; i++) { // i.e. start-end=500
ScoredLink sl = scoredLinks.get(i);
Relationship l = db.getRelationshipById(sl.id);
l.setProperty("lwa_lcm", sl.lcm); //all 16 lcm vals
}
ubuntu@ip-172-31-3-11:/opt/RAI/bin$ sudo neo4j-shell -v -path /opt/neo4j/data/graph.db/
ERROR (-v for expanded information):
Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /opt/neo4j/data/graph.db
java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /opt/neo4j/data/graph.db
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:143)
at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:43)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:129)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:117)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:185)
at org.neo4j.shell.kernel.GraphDatabaseShellServer.instantiateGraphDb(GraphDatabaseShellServer.java:203)
at org.neo4j.shell.kernel.GraphDatabaseShellServer.<init>(GraphDatabaseShellServer.java:66)
at org.neo4j.shell.StartClient.getGraphDatabaseShellServer(StartClient.java:282)
at org.neo4j.shell.StartClient.tryStartLocalServerAndClient(StartClient.java:259)
at org.neo4j.shell.StartClient.startLocal(StartClient.java:247)
at org.neo4j.shell.StartClient.start(StartClient.java:180)
at org.neo4j.shell.StartClient.main(StartClient.java:135)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.recovery.Recovery@10c38489' failed to initialize. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:434)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:66)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:102)
at org.neo4j.kernel.NeoStoreDataSource.start(NeoStoreDataSource.java:600)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start(DataSourceManager.java:112)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139)
... 12 more
Caused by: java.lang.IllegalArgumentException: Unknown entry type 7 for version 0. At position LogPosition{logVersion=170, byteOffset=16} and entry version V1_9
at org.neo4j.kernel.impl.transaction.log.entry.LogEntryVersion.entryParser(LogEntryVersion.java:207)
at org.neo4j.kernel.impl.transaction.log.entry.VersionAwareLogEntryReader.readLogEntry(VersionAwareLogEntryReader.java:92)
at org.neo4j.kernel.impl.transaction.log.LogEntryCursor.next(LogEntryCursor.java:54)
at org.neo4j.kernel.recovery.LatestCheckPointFinder.find(LatestCheckPointFinder.java:77)
at org.neo4j.kernel.recovery.PositionToRecoverFrom.apply(PositionToRecoverFrom.java:53)
at org.neo4j.kernel.recovery.DefaultRecoverySPI.getPositionToRecoverFrom(DefaultRecoverySPI.java:135)
at org.neo4j.kernel.recovery.Recovery.init(Recovery.java:72)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:424)
... 21 more
-host Domain name or IP of host to connect to (default: localhost)
-port Port of host to connect to (default: 1337)
-name RMI name, i.e. rmi://<host>:<port>/<name> (default: shell)
-pid Process ID to connect to
-c Command line to execute. After executing it the shell exits
-file File containing commands to execute, or '-' to read from stdin. After executing it the shell exits
-readonly Connect in readonly mode (only for connecting with -path)
-path Points to a neo4j db path so that a local server can be started there
-config Points to a config file when starting a local server
Example arguments for remote:
-port 1337
-host 192.168.1.234 -port 1337 -name shell
-host localhost -readonly
...or no arguments for default values
Example arguments for local:
-path /path/to/db
-path /path/to/db -config /path/to/neo4j.config
-path /path/to/db -readonly