neo4j-core 0.0.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/Gemfile +27 -0
  2. data/README.rdoc +27 -0
  3. data/config/neo4j/config.yml +102 -0
  4. data/lib/db/active_tx_log +1 -0
  5. data/lib/db/index/lucene-store.db +0 -0
  6. data/lib/db/index/lucene.log.1 +0 -0
  7. data/lib/db/index/lucene.log.active +0 -0
  8. data/lib/db/lock +0 -0
  9. data/lib/db/messages.log +530 -0
  10. data/lib/db/neostore +0 -0
  11. data/lib/db/neostore.id +0 -0
  12. data/lib/db/neostore.nodestore.db +0 -0
  13. data/lib/db/neostore.nodestore.db.id +0 -0
  14. data/lib/db/neostore.propertystore.db +0 -0
  15. data/lib/db/neostore.propertystore.db.arrays +0 -0
  16. data/lib/db/neostore.propertystore.db.arrays.id +0 -0
  17. data/lib/db/neostore.propertystore.db.id +0 -0
  18. data/lib/db/neostore.propertystore.db.index +0 -0
  19. data/lib/db/neostore.propertystore.db.index.id +0 -0
  20. data/lib/db/neostore.propertystore.db.index.keys +0 -0
  21. data/lib/db/neostore.propertystore.db.index.keys.id +0 -0
  22. data/lib/db/neostore.propertystore.db.strings +0 -0
  23. data/lib/db/neostore.propertystore.db.strings.id +0 -0
  24. data/lib/db/neostore.relationshipstore.db +0 -0
  25. data/lib/db/neostore.relationshipstore.db.id +0 -0
  26. data/lib/db/neostore.relationshiptypestore.db +0 -0
  27. data/lib/db/neostore.relationshiptypestore.db.id +0 -0
  28. data/lib/db/neostore.relationshiptypestore.db.names +0 -0
  29. data/lib/db/neostore.relationshiptypestore.db.names.id +0 -0
  30. data/lib/db/nioneo_logical.log.2 +0 -0
  31. data/lib/db/nioneo_logical.log.active +0 -0
  32. data/lib/db/tm_tx_log.1 +0 -0
  33. data/lib/neo4j/config.rb +139 -0
  34. data/lib/neo4j/cypher.rb +156 -0
  35. data/lib/neo4j/neo4j.rb +244 -0
  36. data/lib/neo4j/neo4j.rb~ +214 -0
  37. data/lib/neo4j/node.rb +39 -0
  38. data/lib/neo4j/relationship.rb +61 -0
  39. data/lib/neo4j/transaction.rb +86 -0
  40. data/lib/neo4j/type_converters/type_converters.rb +287 -0
  41. data/lib/neo4j-core/cypher/cypher.rb +867 -0
  42. data/lib/neo4j-core/cypher/result_wrapper.rb +39 -0
  43. data/lib/neo4j-core/database.rb +191 -0
  44. data/lib/neo4j-core/equal/equal.rb +23 -0
  45. data/lib/neo4j-core/event_handler.rb +265 -0
  46. data/lib/neo4j-core/index/class_methods.rb +117 -0
  47. data/lib/neo4j-core/index/index.rb +36 -0
  48. data/lib/neo4j-core/index/index_config.rb +112 -0
  49. data/lib/neo4j-core/index/indexer.rb +243 -0
  50. data/lib/neo4j-core/index/indexer_registry.rb +55 -0
  51. data/lib/neo4j-core/index/lucene_query.rb +264 -0
  52. data/lib/neo4j-core/lazy_map.rb +21 -0
  53. data/lib/neo4j-core/node/class_methods.rb +77 -0
  54. data/lib/neo4j-core/node/node.rb +47 -0
  55. data/lib/neo4j-core/property/property.rb +94 -0
  56. data/lib/neo4j-core/relationship/class_methods.rb +80 -0
  57. data/lib/neo4j-core/relationship/relationship.rb +97 -0
  58. data/lib/neo4j-core/relationship_set.rb +61 -0
  59. data/lib/neo4j-core/rels/rels.rb +147 -0
  60. data/lib/neo4j-core/rels/traverser.rb +99 -0
  61. data/lib/neo4j-core/to_java.rb +51 -0
  62. data/lib/neo4j-core/traversal/evaluator.rb +36 -0
  63. data/lib/neo4j-core/traversal/filter_predicate.rb +30 -0
  64. data/lib/neo4j-core/traversal/prune_evaluator.rb +20 -0
  65. data/lib/neo4j-core/traversal/rel_expander.rb +35 -0
  66. data/lib/neo4j-core/traversal/traversal.rb +130 -0
  67. data/lib/neo4j-core/traversal/traverser.rb +295 -0
  68. data/lib/neo4j-core/version.rb +5 -0
  69. data/lib/neo4j-core.rb +64 -0
  70. data/neo4j-core.gemspec +31 -0
  71. metadata +145 -0
data/Gemfile ADDED
@@ -0,0 +1,27 @@
1
+ source :gemcutter
2
+
3
+ gemspec
4
+
5
+ gem 'neo4j-advanced', "1.7.0.alpha.1", :require => false
6
+ gem 'neo4j-enterprise', "1.7.0.alpha.1", :require => false
7
+
8
+ group 'development' do
9
+ gem 'guard'
10
+ gem 'rcov', '0.9.11'
11
+ gem 'ruby_gntp', :require => false # GrowlNotify for Mac
12
+ gem 'rb-inotify', :require => false
13
+ gem 'rb-fsevent', :require => false
14
+ gem 'rb-fchange', :require => false
15
+ gem "guard-rspec"
16
+ gem "horo", ">= 1.0.2" # TODO: Why horo, YARD seems to be much better option?
17
+ #gem 'ruby-debug-base19' if RUBY_VERSION.include? "1.9"
18
+ #gem 'ruby-debug-base' if RUBY_VERSION.include? "1.8"
19
+ #gem "ruby-debug-ide"
20
+ end
21
+
22
+ group 'test' do
23
+ gem "rake", ">= 0.8.7"
24
+ gem "rspec", "~> 2.8"
25
+ gem "its" # its(:with, :arguments) { should be_possible }
26
+ end
27
+
data/README.rdoc ADDED
@@ -0,0 +1,27 @@
1
+ == Neo4j-core {<img src="https://secure.travis-ci.org/andreasronge/neo4j.png" />}[http://travis-ci.org/andreasronge/neo4j]
2
+
3
+ This gem only contains the JRuby mapping of the Neo4j graph database.
4
+ The neo4j.rb gem will be split up into two gems, neo4j-core and neo4j.
5
+ This gem will be included by neo4j 2.0.0 gem.
6
+
7
+ Changes from the neo4j.rb
8
+ * Use of YARD instead of RDoc
9
+ * Some tidy up of the API and code (e.g. Neo4j::Node#rels methods)
10
+ * Change of Ruby module structure.
11
+ * More RSpecs and more use of mocking combined with real testing of the Java layer
12
+ * Make sure that we retrieve relationships and nodes lazy if possible.
13
+ * Cypher Query DSL
14
+
15
+ This gem contains two modules: Neo4j and Neo4j::Core
16
+ The Neo4j module is public and the Neo4j::Core(::*) are private modules.
17
+
18
+ == The public API
19
+
20
+ {Neo4j::Node} The Java Neo4j Node
21
+
22
+ {Neo4j::Relationship} The Java Relationship
23
+
24
+ {Neo4j} The Database
25
+
26
+ {Neo4j::Cypher} Cypher Query Generator, see RSpec spec/neo4j/cypher_spec
27
+
@@ -0,0 +1,102 @@
1
+ #=== Neo4j.rb configuration settings
2
+
3
+ # The folder location of the neo4j and lucene database
4
+ storage_path: db
5
+
6
+ # If enable neo4j.rb will create _all relationship to all instances inheriting from Neo4j::Rails::Model
7
+ # If disabled all custom rules will also be unavailable.
8
+ enable_rules: true
9
+
10
+ # if identity map should be on or not
11
+ # It may impact the performance. Using the identity map will keep all loaded wrapper node/relationship
12
+ # object in memory for each thread and transaction - which may speed up or slow down operations.
13
+ identity_map: false
14
+
15
+ # When using the Neo4j::Model you can let neo4j automatically set timestamps when updating/creating nodes.
16
+ # 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
17
+ # (similar to ActiveRecord).
18
+ timestamps: true
19
+
20
+ # Configuration for lucene
21
+ lucene: { fulltext: { provider: lucene,
22
+ type: fulltext },
23
+ exact: { provider: lucene,
24
+ type: exact}
25
+ }
26
+
27
+ # If migrations should be run in a new thread
28
+ # If set to true it you can use the database while it is migrating.
29
+ migration_thread: false
30
+
31
+ # If online backup should be available, if it is the Online JAR file will be loaded,
32
+ # Notice it must be either 'true' or 'false' as string
33
+ enable_online_backup: 'false'
34
+
35
+ #use the clustered Neo4j GraphDatabase (org.neo4j.kernel.HighlyAvailableGraphDatabase)
36
+ ha.db: false
37
+
38
+ # Example of HA Configuration, see http://wiki.neo4j.org/content/High_Availability_Cluster
39
+ # This is only used when ha.db is set to true
40
+ ha.server_id: 2
41
+ ha.server: 'localhost:6002'
42
+ ha.coordinators: 'localhost:2181,localhost:2182,localhost:2183'
43
+
44
+ # if enabled you can use the bin/neo4j-shell command to access the database
45
+ enable_remote_shell: "port=9332"
46
+
47
+ #===Memory mapped I/O settings===
48
+
49
+ #Each file in the Neo store can use memory mapped I/O for reading/writing.
50
+ #Best performance is achived if the full file can be memory mapped but if
51
+ #there isn't enough memory for that Neo will try and make the best use of
52
+ #the memory it gets (regions of the file that get accessed often will more
53
+ #likley be memory mapped).
54
+
55
+ #For high traversal speed it is important to have the nodestore.db and
56
+ #relationshipstore.db files.
57
+
58
+ neostore.nodestore.db.mapped_memory: 25M
59
+ neostore.relationshipstore.db.mapped_memory: 50M
60
+ neostore.propertystore.db.mapped_memory: 90M
61
+ neostore.propertystore.db.index.mapped_memory: 1M
62
+ neostore.propertystore.db.index.keys.mapped_memory: 1M
63
+ neostore.propertystore.db.strings.mapped_memory: 130M
64
+ neostore.propertystore.db.arrays.mapped_memory: 130M
65
+
66
+
67
+ #: ": ": "Cache settings: ": ": "
68
+
69
+ #use adaptive caches YES|NO. Let Neo try make best use of available heap.
70
+ use_adaptive_cache: YES
71
+
72
+ #heap usage/max heap size ratio. Neo will increase caches while ratio
73
+ #is less and decrease if greater. Default 0.77 seems to be a good over
74
+ #all ratio of heap usage to avoid GC trashing. Larger heaps may allow for
75
+ #a higher ratio while tiny heaps may need even less.
76
+ adaptive_cache_heap_ratio: 0.77
77
+
78
+ #how aggressive Neo will decrease caches once heap ratio reached
79
+ adaptive_cache_manager_decrease_ratio: 1.15
80
+
81
+ #how aggresive Neo will increase caches if ratio isn't yet reached
82
+ adaptive_cache_manager_increase_ratio: 1.1
83
+
84
+ #if no requests are made to Neo this is the amount of time in ms Neo will wait
85
+ #before it checks the heap usage and adapts the caches if needed
86
+ adaptive_cache_worker_sleep_time: 3000
87
+
88
+ #minimum size (number of nodes) of node cache. If adaptive cache is in use
89
+ #node cache will not be decreased under this value
90
+ min_node_cache_size: 0
91
+
92
+ #minimum size (number of relationships) of relationship cache. If adaptive
93
+ #cache is in use relationship cache will not be decreased under this value
94
+ min_relationship_cache_size: 0
95
+
96
+ #maximum size (number of nodes) of node cache. If adaptive cache is not in
97
+ #use the node cache will not be increased above this value
98
+ max_node_cache_size: 1500
99
+
100
+ #maximum size (number of relationship) of node cache. If adaptive cache is
101
+ #not in use the relationship cache will not be increased above this value
102
+ max_relationship_cache_size: 3500
@@ -0,0 +1 @@
1
+ tm_tx_log.1
Binary file
Binary file
Binary file
data/lib/db/lock ADDED
File without changes