neo4j 1.0.0.beta.26-java → 1.0.0.beta.27-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. data/bin/neo4j-shell +107 -0
  2. data/bin/neo4j-shell~ +108 -0
  3. data/config/locales/en.yml +5 -0
  4. data/config/neo4j/config.yml +89 -0
  5. data/lib/Gemfile~ +3 -0
  6. data/lib/config2.yml~ +86 -0
  7. data/lib/neo4j.rb +34 -8
  8. data/lib/neo4j/config.rb +41 -12
  9. data/lib/neo4j/database.rb +34 -13
  10. data/lib/neo4j/index/class_methods.rb +1 -1
  11. data/lib/neo4j/index/lucene_query.rb +4 -2
  12. data/lib/neo4j/jars/{geronimo-jta_1.1_spec-1.1.1.jar → core/geronimo-jta_1.1_spec-1.1.1.jar} +0 -0
  13. data/lib/neo4j/jars/{lucene-core-3.0.2.jar → core/lucene-core-3.0.3.jar} +0 -0
  14. data/lib/neo4j/jars/core/neo4j-graph-algo-0.8-SNAPSHOT.jar +0 -0
  15. data/lib/neo4j/jars/core/neo4j-index-1.3-SNAPSHOT.jar +0 -0
  16. data/lib/neo4j/jars/core/neo4j-kernel-1.3-SNAPSHOT.jar +0 -0
  17. data/lib/neo4j/jars/core/neo4j-lucene-index-0.5-SNAPSHOT.jar +0 -0
  18. data/lib/neo4j/jars/ha/log4j-1.2.16.jar +0 -0
  19. data/lib/neo4j/jars/ha/neo4j-ha-0.6-SNAPSHOT.jar +0 -0
  20. data/lib/neo4j/jars/ha/neo4j-management-1.3-SNAPSHOT.jar +0 -0
  21. data/lib/neo4j/jars/ha/neo4j-shell-1.3-SNAPSHOT.jar +0 -0
  22. data/lib/neo4j/jars/ha/netty-3.2.1.Final.jar +0 -0
  23. data/lib/neo4j/jars/ha/org.apache.servicemix.bundles.jline-0.9.94_1.jar +0 -0
  24. data/lib/neo4j/jars/ha/org.apache.servicemix.bundles.lucene-3.0.1_2.jar +0 -0
  25. data/lib/neo4j/jars/ha/zookeeper-3.3.2.jar +0 -0
  26. data/lib/neo4j/mapping/class_methods/relationship.rb +1 -2
  27. data/lib/neo4j/mapping/class_methods/rule.rb +35 -3
  28. data/lib/neo4j/mapping/decl_relationship_dsl.rb +1 -1
  29. data/lib/neo4j/mapping/has_n.rb +4 -1
  30. data/lib/neo4j/mapping/node_mixin.rb +1 -1
  31. data/lib/neo4j/mapping/rule.rb +9 -6
  32. data/lib/neo4j/mapping/rule_node.rb +0 -1
  33. data/lib/neo4j/migrations.rb +12 -0
  34. data/lib/neo4j/migrations/extensions.rb +57 -0
  35. data/lib/neo4j/migrations/global_migration.rb +29 -0
  36. data/lib/neo4j/migrations/lazy_migration_mixin.rb +47 -0
  37. data/lib/neo4j/migrations/migration.rb +109 -0
  38. data/lib/neo4j/migrations/migration_mixin.rb +78 -0
  39. data/lib/neo4j/migrations/migrations.rb +100 -0
  40. data/lib/neo4j/neo4j.rb +33 -9
  41. data/lib/neo4j/node_relationship.rb +2 -4
  42. data/lib/neo4j/node_traverser.rb +5 -0
  43. data/lib/neo4j/rails/finders.rb +10 -3
  44. data/lib/neo4j/rails/lucene_connection_closer.rb +1 -2
  45. data/lib/neo4j/rails/mapping/property.rb +1 -1
  46. data/lib/neo4j/rails/model.rb +1 -1
  47. data/lib/neo4j/rails/persistence.rb +1 -5
  48. data/lib/neo4j/rails/relationships/relationships.rb +13 -10
  49. data/lib/neo4j/version.rb +1 -1
  50. data/lib/perf.rb~ +36 -0
  51. data/neo4j.gemspec +4 -2
  52. metadata +40 -78
  53. data/lib/neo4j/jars/neo4j-graph-algo-0.7-1.2.jar +0 -0
  54. data/lib/neo4j/jars/neo4j-index-1.2-1.2.jar +0 -0
  55. data/lib/neo4j/jars/neo4j-kernel-1.2-1.2.jar +0 -0
  56. data/lib/neo4j/jars/neo4j-lucene-index-0.2-1.2.jar +0 -0
  57. data/lib/tmp/neo4j/active_tx_log +0 -1
  58. data/lib/tmp/neo4j/index.db +0 -0
  59. data/lib/tmp/neo4j/index/lucene-store.db +0 -0
  60. data/lib/tmp/neo4j/index/lucene.log.active +0 -0
  61. data/lib/tmp/neo4j/index/lucene/node/Network-exact/_0.cfs +0 -0
  62. data/lib/tmp/neo4j/index/lucene/node/Network-exact/segments.gen +0 -0
  63. data/lib/tmp/neo4j/index/lucene/node/Network-exact/segments_2 +0 -0
  64. data/lib/tmp/neo4j/lucene-fulltext/lucene-store.db +0 -0
  65. data/lib/tmp/neo4j/lucene-fulltext/lucene.log.active +0 -0
  66. data/lib/tmp/neo4j/lucene/lucene-store.db +0 -0
  67. data/lib/tmp/neo4j/lucene/lucene.log.active +0 -0
  68. data/lib/tmp/neo4j/messages.log +0 -85
  69. data/lib/tmp/neo4j/neostore +0 -0
  70. data/lib/tmp/neo4j/neostore.id +0 -0
  71. data/lib/tmp/neo4j/neostore.nodestore.db +0 -0
  72. data/lib/tmp/neo4j/neostore.nodestore.db.id +0 -0
  73. data/lib/tmp/neo4j/neostore.propertystore.db +0 -0
  74. data/lib/tmp/neo4j/neostore.propertystore.db.arrays +0 -0
  75. data/lib/tmp/neo4j/neostore.propertystore.db.arrays.id +0 -0
  76. data/lib/tmp/neo4j/neostore.propertystore.db.id +0 -0
  77. data/lib/tmp/neo4j/neostore.propertystore.db.index +0 -0
  78. data/lib/tmp/neo4j/neostore.propertystore.db.index.id +0 -0
  79. data/lib/tmp/neo4j/neostore.propertystore.db.index.keys +0 -0
  80. data/lib/tmp/neo4j/neostore.propertystore.db.index.keys.id +0 -0
  81. data/lib/tmp/neo4j/neostore.propertystore.db.strings +0 -0
  82. data/lib/tmp/neo4j/neostore.propertystore.db.strings.id +0 -0
  83. data/lib/tmp/neo4j/neostore.relationshipstore.db +0 -0
  84. data/lib/tmp/neo4j/neostore.relationshipstore.db.id +0 -0
  85. data/lib/tmp/neo4j/neostore.relationshiptypestore.db +0 -0
  86. data/lib/tmp/neo4j/neostore.relationshiptypestore.db.id +0 -0
  87. data/lib/tmp/neo4j/neostore.relationshiptypestore.db.names +0 -0
  88. data/lib/tmp/neo4j/neostore.relationshiptypestore.db.names.id +0 -0
  89. data/lib/tmp/neo4j/nioneo_logical.log.active +0 -0
  90. data/lib/tmp/neo4j/tm_tx_log.1 +0 -0
data/bin/neo4j-shell ADDED
@@ -0,0 +1,107 @@
1
+ #!/bin/sh
2
+ # ----------------------------------------------------------------------------
3
+ # Copyright 2001-2006 The Apache Software Foundation.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ # ----------------------------------------------------------------------------
17
+
18
+ # Copyright (c) 2001-2002 The Apache Software Foundation. All rights
19
+ # reserved.
20
+
21
+ BASEDIR=`dirname $0`/..
22
+ BASEDIR=`(cd "$BASEDIR"; pwd)`
23
+
24
+
25
+
26
+ # OS specific support. $var _must_ be set to either true or false.
27
+ cygwin=false;
28
+ darwin=false;
29
+ case "`uname`" in
30
+ CYGWIN*) cygwin=true ;;
31
+ Darwin*) darwin=true
32
+ if [ -z "$JAVA_VERSION" ] ; then
33
+ JAVA_VERSION="CurrentJDK"
34
+ else
35
+ echo "Using Java version: $JAVA_VERSION"
36
+ fi
37
+ if [ -z "$JAVA_HOME" ] ; then
38
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
39
+ fi
40
+ ;;
41
+ esac
42
+
43
+ if [ -z "$JAVA_HOME" ] ; then
44
+ if [ -r /etc/gentoo-release ] ; then
45
+ JAVA_HOME=`java-config --jre-home`
46
+ fi
47
+ fi
48
+
49
+ # For Cygwin, ensure paths are in UNIX format before anything is touched
50
+ if $cygwin ; then
51
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
52
+ [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
53
+ fi
54
+
55
+ # If a specific java binary isn't specified search for the standard 'java' binary
56
+ if [ -z "$JAVACMD" ] ; then
57
+ if [ -n "$JAVA_HOME" ] ; then
58
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
59
+ # IBM's JDK on AIX uses strange locations for the executables
60
+ JAVACMD="$JAVA_HOME/jre/sh/java"
61
+ else
62
+ JAVACMD="$JAVA_HOME/bin/java"
63
+ fi
64
+ else
65
+ JAVACMD=`which java`
66
+ fi
67
+ fi
68
+
69
+ if [ ! -x "$JAVACMD" ] ; then
70
+ echo "Error: JAVA_HOME is not defined correctly."
71
+ echo " We cannot execute $JAVACMD"
72
+ exit 1
73
+ fi
74
+
75
+ if [ -z "$REPO" ]
76
+ then
77
+ REPO="$BASEDIR"/lib/neo4j/jars
78
+ fi
79
+
80
+ LIBRARY_JARS=""
81
+ for jar in $(find $REPO -iname "*.jar")
82
+ do
83
+ LIBRARY_JARS=${LIBRARY_JARS}:$jar
84
+ done
85
+
86
+ CLASSPATH=$CLASSPATH_PREFIX${LIBRARY_JARS}
87
+
88
+ EXTRA_JVM_ARGUMENTS=""
89
+
90
+ # For Cygwin, switch paths to Windows format before running java
91
+ if $cygwin; then
92
+ [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
93
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
94
+ [ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"`
95
+ [ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"`
96
+ [ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"`
97
+ fi
98
+
99
+ exec "$JAVACMD" $JAVA_OPTS \
100
+ $EXTRA_JVM_ARGUMENTS \
101
+ -classpath "$CLASSPATH" \
102
+ -Dapp.name="neo4j-shell" \
103
+ -Dapp.pid="$$" \
104
+ -Dapp.repo="$REPO" \
105
+ -Dbasedir="$BASEDIR" \
106
+ org.neo4j.shell.StartClient \
107
+ "$@"
data/bin/neo4j-shell~ ADDED
@@ -0,0 +1,108 @@
1
+ #!/bin/sh
2
+ # ----------------------------------------------------------------------------
3
+ # Copyright 2001-2006 The Apache Software Foundation.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ # ----------------------------------------------------------------------------
17
+
18
+ # Copyright (c) 2001-2002 The Apache Software Foundation. All rights
19
+ # reserved.
20
+
21
+ BASEDIR=`dirname $0`/..
22
+ BASEDIR=`(cd "$BASEDIR"; pwd)`
23
+
24
+
25
+
26
+ # OS specific support. $var _must_ be set to either true or false.
27
+ cygwin=false;
28
+ darwin=false;
29
+ case "`uname`" in
30
+ CYGWIN*) cygwin=true ;;
31
+ Darwin*) darwin=true
32
+ if [ -z "$JAVA_VERSION" ] ; then
33
+ JAVA_VERSION="CurrentJDK"
34
+ else
35
+ echo "Using Java version: $JAVA_VERSION"
36
+ fi
37
+ if [ -z "$JAVA_HOME" ] ; then
38
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
39
+ fi
40
+ ;;
41
+ esac
42
+
43
+ if [ -z "$JAVA_HOME" ] ; then
44
+ if [ -r /etc/gentoo-release ] ; then
45
+ JAVA_HOME=`java-config --jre-home`
46
+ fi
47
+ fi
48
+
49
+ # For Cygwin, ensure paths are in UNIX format before anything is touched
50
+ if $cygwin ; then
51
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
52
+ [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
53
+ fi
54
+
55
+ # If a specific java binary isn't specified search for the standard 'java' binary
56
+ if [ -z "$JAVACMD" ] ; then
57
+ if [ -n "$JAVA_HOME" ] ; then
58
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
59
+ # IBM's JDK on AIX uses strange locations for the executables
60
+ JAVACMD="$JAVA_HOME/jre/sh/java"
61
+ else
62
+ JAVACMD="$JAVA_HOME/bin/java"
63
+ fi
64
+ else
65
+ JAVACMD=`which java`
66
+ fi
67
+ fi
68
+
69
+ if [ ! -x "$JAVACMD" ] ; then
70
+ echo "Error: JAVA_HOME is not defined correctly."
71
+ echo " We cannot execute $JAVACMD"
72
+ exit 1
73
+ fi
74
+
75
+ if [ -z "$REPO" ]
76
+ then
77
+ REPO="$BASEDIR"/lib
78
+ fi
79
+
80
+ LIBRARY_JARS=""
81
+ for jar in ${REPO}/*.jar
82
+ do
83
+ LIBRARY_JARS=${LIBRARY_JARS}:$jar
84
+ done
85
+ echo $LIBRARY_JARS
86
+
87
+ CLASSPATH=$CLASSPATH_PREFIX${LIBRARY_JARS}
88
+
89
+ EXTRA_JVM_ARGUMENTS=""
90
+
91
+ # For Cygwin, switch paths to Windows format before running java
92
+ if $cygwin; then
93
+ [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
94
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
95
+ [ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"`
96
+ [ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"`
97
+ [ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"`
98
+ fi
99
+
100
+ exec "$JAVACMD" $JAVA_OPTS \
101
+ $EXTRA_JVM_ARGUMENTS \
102
+ -classpath "$CLASSPATH" \
103
+ -Dapp.name="neo4j-shell" \
104
+ -Dapp.pid="$$" \
105
+ -Dapp.repo="$REPO" \
106
+ -Dbasedir="$BASEDIR" \
107
+ org.neo4j.shell.StartClient \
108
+ "$@"
@@ -0,0 +1,5 @@
1
+ en:
2
+ errors:
3
+ messages:
4
+ nil: "can't be nil"
5
+ taken: "has already been taken"
@@ -0,0 +1,89 @@
1
+ #=== Neo4j.rb configuration settings
2
+
3
+ # The folder location of the neo4j and lucene database
4
+ storage_path: db
5
+
6
+ # When using the Neo4j::Model you can let neo4j automatically set timestamps when updating/creating nodes.
7
+ # If set to true neo4j.rb automatically timestamps create and update operations if the model has properties named created_at/created_on or updated_at/updated_on
8
+ # (similar to ActiveRecord).
9
+ timestamps: true
10
+
11
+ # Configuration for lucene
12
+ lucene: { fulltext: { provider: lucene,
13
+ type: fulltext },
14
+ exact: { provider: lucene,
15
+ type: exact}
16
+ }
17
+
18
+ # If migrations should be run in a new thread
19
+ # If set to true it you can use the database while it is migrating.
20
+ migration_thread: false
21
+
22
+ #use the clustered Neo4j GraphDatabase (org.neo4j.kernel.HighlyAvailableGraphDatabase)
23
+ ha.db: false
24
+
25
+ # Example of HA Configuration, see http://wiki.neo4j.org/content/High_Availability_Cluster
26
+ # This is only used when ha.db is set to true
27
+ ha.machine_id: 2
28
+ ha.server: 'localhost:6002'
29
+ ha.zoo_keeper_servers: 'localhost:2181,localhost:2182,localhost:2183'
30
+
31
+ # if enabled you can use the bin/neo4j-shell command to access the database
32
+ enable_remote_shell: "port=9332"
33
+
34
+ #===Memory mapped I/O settings===
35
+
36
+ #Each file in the Neo store can use memory mapped I/O for reading/writing.
37
+ #Best performance is achived if the full file can be memory mapped but if
38
+ #there isn't enough memory for that Neo will try and make the best use of
39
+ #the memory it gets (regions of the file that get accessed often will more
40
+ #likley be memory mapped).
41
+
42
+ #For high traversal speed it is important to have the nodestore.db and
43
+ #relationshipstore.db files.
44
+
45
+ neostore.nodestore.db.mapped_memory: 25M
46
+ neostore.relationshipstore.db.mapped_memory: 50M
47
+ neostore.propertystore.db.mapped_memory: 90M
48
+ neostore.propertystore.db.index.mapped_memory: 1M
49
+ neostore.propertystore.db.index.keys.mapped_memory: 1M
50
+ neostore.propertystore.db.strings.mapped_memory: 130M
51
+ neostore.propertystore.db.arrays.mapped_memory: 130M
52
+
53
+
54
+ #: ": ": "Cache settings: ": ": "
55
+
56
+ #use adaptive caches YES|NO. Let Neo try make best use of available heap.
57
+ use_adaptive_cache: YES
58
+
59
+ #heap usage/max heap size ratio. Neo will increase caches while ratio
60
+ #is less and decrease if greater. Default 0.77 seems to be a good over
61
+ #all ratio of heap usage to avoid GC trashing. Larger heaps may allow for
62
+ #a higher ratio while tiny heaps may need even less.
63
+ adaptive_cache_heap_ratio: 0.77
64
+
65
+ #how aggressive Neo will decrease caches once heap ratio reached
66
+ adaptive_cache_manager_decrease_ratio: 1.15
67
+
68
+ #how aggresive Neo will increase caches if ratio isn't yet reached
69
+ adaptive_cache_manager_increase_ratio: 1.1
70
+
71
+ #if no requests are made to Neo this is the amount of time in ms Neo will wait
72
+ #before it checks the heap usage and adapts the caches if needed
73
+ adaptive_cache_worker_sleep_time: 3000
74
+
75
+ #minimum size (number of nodes) of node cache. If adaptive cache is in use
76
+ #node cache will not be decreased under this value
77
+ min_node_cache_size: 0
78
+
79
+ #minimum size (number of relationships) of relationship cache. If adaptive
80
+ #cache is in use relationship cache will not be decreased under this value
81
+ min_relationship_cache_size: 0
82
+
83
+ #maximum size (number of nodes) of node cache. If adaptive cache is not in
84
+ #use the node cache will not be increased above this value
85
+ max_node_cache_size: 1500
86
+
87
+ #maximum size (number of relationship) of node cache. If adaptive cache is
88
+ #not in use the relationship cache will not be increased above this value
89
+ max_relationship_cache_size: 3500
data/lib/Gemfile~ ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'neo4j', :path => "../.."
data/lib/config2.yml~ ADDED
@@ -0,0 +1,86 @@
1
+ #=== Neo4j.rb configuration settings
2
+
3
+ # The location of the neo4j and lucene database
4
+ storage_path: db/ha2
5
+
6
+
7
+ # When using the Neo4j::Model you can let neo4j automatically set timestamps when updating/creating nodes.
8
+ # If set to true neo4j.rb automatically timestamps create and update operations if the model has properties named created_at/created_on or updated_at/updated_on
9
+ # (similar to ActiveRecord).
10
+ timestamps: true
11
+
12
+ # Configuration for lucene
13
+ lucene: { fulltext: { provider: lucene,
14
+ type: fulltext },
15
+ exact: { provider: lucene,
16
+ type: exact}
17
+ }
18
+
19
+
20
+ #use the clustered Neo4j GraphDatabase (org.neo4j.kernel.HighlyAvailableGraphDatabase)
21
+ ha.db: true
22
+ ha.create_empty_db: false
23
+
24
+ #ha-server2.conf
25
+ ha.machine_id: 2
26
+ ha.server: "localhost:6002"
27
+ ha.zoo_keeper_servers: "localhost:2181,localhost:2182,localhost:2183"
28
+
29
+ enable_remote_shell: "port=1332"
30
+
31
+ #===Memory mapped I/O settings===
32
+
33
+ #Each file in the Neo store can use memory mapped I/O for reading/writing.
34
+ #Best performance is achived if the full file can be memory mapped but if
35
+ #there isn't enough memory for that Neo will try and make the best use of
36
+ #the memory it gets (regions of the file that get accessed often will more
37
+ #likley be memory mapped).
38
+
39
+ #For high traversal speed it is important to have the nodestore.db and
40
+ #relationshipstore.db files.
41
+
42
+ neostore.nodestore.db.mapped_memory: 25M
43
+ neostore.relationshipstore.db.mapped_memory: 50M
44
+ neostore.propertystore.db.mapped_memory: 90M
45
+ neostore.propertystore.db.index.mapped_memory: 1M
46
+ neostore.propertystore.db.index.keys.mapped_memory: 1M
47
+ neostore.propertystore.db.strings.mapped_memory: 130M
48
+ neostore.propertystore.db.arrays.mapped_memory: 130M
49
+
50
+
51
+ #: ": ": "Cache settings: ": ": "
52
+
53
+ #use adaptive caches YES|NO. Let Neo try make best use of available heap.
54
+ use_adaptive_cache: YES
55
+
56
+ #heap usage/max heap size ratio. Neo will increase caches while ratio
57
+ #is less and decrease if greater. Default 0.77 seems to be a good over
58
+ #all ratio of heap usage to avoid GC trashing. Larger heaps may allow for
59
+ #a higher ratio while tiny heaps may need even less.
60
+ adaptive_cache_heap_ratio: 0.77
61
+
62
+ #how aggressive Neo will decrease caches once heap ratio reached
63
+ adaptive_cache_manager_decrease_ratio: 1.15
64
+
65
+ #how aggresive Neo will increase caches if ratio isn't yet reached
66
+ adaptive_cache_manager_increase_ratio: 1.1
67
+
68
+ #if no requests are made to Neo this is the amount of time in ms Neo will wait
69
+ #before it checks the heap usage and adapts the caches if needed
70
+ adaptive_cache_worker_sleep_time: 3000
71
+
72
+ #minimum size (number of nodes) of node cache. If adaptive cache is in use
73
+ #node cache will not be decreased under this value
74
+ min_node_cache_size: 0
75
+
76
+ #minimum size (number of relationships) of relationship cache. If adaptive
77
+ #cache is in use relationship cache will not be decreased under this value
78
+ min_relationship_cache_size: 0
79
+
80
+ #maximum size (number of nodes) of node cache. If adaptive cache is not in
81
+ #use the node cache will not be increased above this value
82
+ max_node_cache_size: 1500
83
+
84
+ #maximum size (number of relationship) of node cache. If adaptive cache is
85
+ #not in use the relationship cache will not be increased above this value
86
+ max_relationship_cache_size: 3500
data/lib/neo4j.rb CHANGED
@@ -4,16 +4,41 @@ require 'enumerator'
4
4
  require 'forwardable'
5
5
  require 'time'
6
6
  require 'date'
7
+ require 'tmpdir'
7
8
 
8
- require 'neo4j/jars/neo4j-index-1.2-1.2.jar'
9
- require 'neo4j/jars/neo4j-kernel-1.2-1.2.jar'
10
- require 'neo4j/jars/neo4j-lucene-index-0.2-1.2.jar'
11
- require 'neo4j/jars/geronimo-jta_1.1_spec-1.1.1.jar'
12
- require 'neo4j/jars/lucene-core-3.0.2.jar'
13
- require 'neo4j/jars/neo4j-graph-algo-0.7-1.2'
9
+ # Rails
10
+ require 'rails/railtie'
11
+ require 'active_model'
14
12
 
15
13
  require 'will_paginate/collection'
16
14
  require 'will_paginate/finders/base'
15
+
16
+ require 'neo4j/jars/core/geronimo-jta_1.1_spec-1.1.1.jar'
17
+ require 'neo4j/jars/core/lucene-core-3.0.3.jar'
18
+ require 'neo4j/jars/core/neo4j-lucene-index-0.5-SNAPSHOT.jar'
19
+ require 'neo4j/jars/core/neo4j-graph-algo-0.8-SNAPSHOT.jar'
20
+ require 'neo4j/jars/core/neo4j-kernel-1.3-SNAPSHOT.jar'
21
+
22
+ module Neo4j
23
+
24
+ def self.load_local_jars
25
+ # This is a temporary fix since the HA does not yet work with this JAR
26
+ # It will be solved in a future version of the Java Neo4j library.
27
+ require 'neo4j/jars/core/neo4j-index-1.3-SNAPSHOT.jar'
28
+ end
29
+
30
+ def self.load_ha_jars
31
+ require 'neo4j/jars/ha/log4j-1.2.16.jar'
32
+ require 'neo4j/jars/ha/neo4j-ha-0.6-SNAPSHOT.jar'
33
+ require 'neo4j/jars/ha/neo4j-management-1.3-SNAPSHOT.jar'
34
+ require 'neo4j/jars/ha/neo4j-shell-1.3-SNAPSHOT.jar'
35
+ require 'neo4j/jars/ha/netty-3.2.1.Final.jar'
36
+ require 'neo4j/jars/ha/org.apache.servicemix.bundles.jline-0.9.94_1.jar'
37
+ require 'neo4j/jars/ha/org.apache.servicemix.bundles.lucene-3.0.1_2.jar'
38
+ require 'neo4j/jars/ha/zookeeper-3.3.2.jar'
39
+ end
40
+ end
41
+
17
42
  require 'neo4j/to_java'
18
43
  require 'neo4j/version'
19
44
  require 'neo4j/equal'
@@ -29,6 +54,7 @@ require "neo4j/functions/count"
29
54
  require "neo4j/functions/sum"
30
55
 
31
56
 
57
+
32
58
  require 'neo4j/index/index'
33
59
  require 'neo4j/index/class_methods'
34
60
  require 'neo4j/index/indexer_registry'
@@ -54,14 +80,14 @@ require 'neo4j/mapping/node_mixin'
54
80
  require 'neo4j/mapping/relationship_mixin'
55
81
  require 'neo4j/mapping/rule'
56
82
  require 'neo4j/mapping/rule_node'
83
+
57
84
  require 'neo4j/node_mixin'
58
85
  require 'neo4j/relationship_mixin'
59
86
  require 'neo4j/mapping/class_methods/rule'
60
87
  require 'neo4j/algo'
88
+ require 'neo4j/migrations'
61
89
 
62
90
  # rails
63
- require 'rails/railtie'
64
- require 'active_model'
65
91
  require 'neo4j/rails/tx_methods'
66
92
  require 'neo4j/rails/transaction'
67
93
  require 'neo4j/rails/railtie'