pacer 2.0.14-java → 2.0.15-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 516ac17e78965aa3d2e83cd8abcdd698a6a65df2
4
- data.tar.gz: 42d4eec909e091059251f379296f5b4c118f008f
3
+ metadata.gz: 32dc8612daf75176bf7044acf5326aaadcdbc7bf
4
+ data.tar.gz: ff810146984c86e20d9d735ce6a06b659df5a144
5
5
  SHA512:
6
- metadata.gz: 1e2ed8eb71d0e19d61adc9e324b6405c75b0aa710944f4e4fa41e542075673584ec63f618149c93f973325a8bc5b04ff8751b4e19de3fe457a65e61e745e5e1d
7
- data.tar.gz: 6c6ecde3e79970241e660108de1bb4bdb8055df7f94a84a152902273ed4f36521e7dd861e98510875b5de4cc95088e691a49f12b04a84f257e3316ecb28d6266
6
+ metadata.gz: 5fd3033c91b8d587c23153b4c8b04c0da953d286da0273b938c6f3101b9a341bf781efd18bf96ed852ced15de9ba48e466541ffac71ab008be9b10452ff84535
7
+ data.tar.gz: 6a02115444a5803a9f2e9032aefaa1a7de891bdc0ab879392df2bbf569394497ff4b9f800fe8ffd4caa920964bca25d9baaef6f27438e3a2ba226209092db3b9
data/README.md CHANGED
@@ -16,13 +16,11 @@ all processing is done in pure Java, so when it comes the usual Ruby
16
16
  expressiveness vs. speed problem, you can have your cake and eat it too,
17
17
  it's very fast!
18
18
 
19
- ## Mailing List
20
-
21
- Pacer has a [google group](http://groups.google.com/group/pacer-users?lnk=gcimv)! Join and feel free to ask questions and discuss about Pacer or graphs in general.
22
-
23
19
  ## Documentation
24
20
 
25
- Check out the [wiki](https://github.com/pangloss/pacer/wiki) for detailed explanations of many of Pacer's features. Please contribute to it or open issues against it if there is anything missing that you want to see.
21
+ Check out the [Pacer docs](http://xnlogic.github.io/pacer/) for detailed explanations of many of Pacer's features.
22
+
23
+ Feel free to contribute to it, by submitting a pull-request to the `gh-pages` branch of this repo, or by opening issues.
26
24
 
27
25
  Pacer is also documented with a comprehensive RSpec test suite and with a
28
26
  thorough YARD documentation. [Dig in!](http://www.rubydoc.info/github/pangloss/pacer/master)
@@ -34,85 +32,26 @@ If you like, you can also use the documentation locally via
34
32
  yard server
35
33
  ```
36
34
 
37
- ## JRuby 1.7 Required
38
-
39
- As of Pacer 1.0.0, [JRuby](http://jruby.org/) 1.7 is required because it is both faster and
40
- fixes some problems that I previously had to work around in Pacer.
41
-
42
- The easiest way (ie. the way I do it) to get the most recent version of
43
- JRuby is to use [RVM](https://rvm.io/)
44
-
45
35
  ## Installation
46
36
 
47
- The easiest way to get Pacer is `gem install pacer`.
48
-
49
- If you want to hack on Pacer, you'll need to have
50
- [maven](http://maven.apache.org/) installed (I recommend `brew install
51
- maven`), then use `rake jar` to set up maven's pom.xml file and run the
52
- maven build script. Then `rake gemfile_devel` to set up a default
53
- Gemfile that you can customize as needed to include dependencies
54
- to the various pacer-... graphs you want the test suite to run against.
55
-
56
- ## Graph Database Support
57
-
58
- The Tinkerpop suite supports a number of graph data stores. They are all
59
- compatible with Pacer, but I have not yet implemented the simple
60
- adapters Pacer needs to use them yet. Here is the list of what's
61
- supported so far:
62
-
63
- | Graph | Info | Gem Required | Gem address |
64
- |------------------------------------------------|------------------------------------------|---------------------------|-----------------------------------------------------------------|
65
- | TinkerGraph | In-memory graph db. Included with Pacer. | | |
66
- | [OrientDB](http://orientdb.com) | A powerful and feature rich graph / document hybrid database. | `gem install --pre pacer-orient` | [pangloss/pacer-orient](https://github.com/pangloss/pacer-orient) |
67
- | [Neo4J](http://neo4j.org) | The industry-leading graph db. | `gem install pacer-neo4j` | [pangloss/pacer-neo4j](https://github.com/pangloss/pacer-neo4j) |
68
- | [Dex](http://sparsity-technologies.com) | A very fast, relatively new graph db. | `gem install pacer-dex` | [pangloss/pacer-dex](https://github.com/pangloss/pacer-dex) |
69
- | [Titan](http://thinkaurelius.github.io/titan/) | Built on top of a pluggable nosql backend store | `gem install pacer-titan` | [pacer-titan](https://github.com/mrbotch/pacer-titan) |
70
-
71
-
37
+ Install dependencies:
72
38
 
73
- You can run any or all of the above graph databases. Pacer supports
74
- running them simultaneuosly and even supports having many of any given
75
- type open at once.
39
+ * [JRuby 1.7.x](http://jruby.org/)
40
+ __Recommended:__ Use [RVM](https://rvm.io/) to install and manage all Ruby (and JRuby) versions on your machine.
41
+ * [RubyGems](https://rubygems.org/)
76
42
 
77
- ### Using Pacer with Neo4j
43
+ Install Pacer:
78
44
 
79
- All you need is the [pacer-neo4j](https://github.com/pangloss/pacer-neo4j) gem.
80
-
81
- ```ruby
82
- require 'pacer-neo4j'
83
- graph = Pacer.neo4j("path/to/graph")
84
45
  ```
85
-
86
- See the gem repository for more details on Neo4j-specific features and functionality.
87
-
88
- #### (optional) Interoperation with the neo4j gem
89
-
90
- Pacer can work together with other Ruby GraphDB libraries, too. The
91
- first functioning example is with theo neo4j gem. Hopefully more will
92
- follow soon as I find out about them or get requests to support them.
93
-
94
- To use Pacer together with the neo4j gem, get your Pacer graph instance
95
- as follows:
96
-
97
- ```ruby
98
- require 'neo4j'
99
- require 'pacer-neo4j'
100
- # start neo4j via the external gem rather than using pacer-neo4j
101
- Neo4j.db.start
102
- graph = Pacer.neo4j(Neo4j.db.graph)
46
+ gem install pacer
103
47
  ```
104
48
 
105
- After that, you can continue to use the graph as normal with *both*
106
- gems. Any update that's committed with one gem will be visible
107
- immediately to the other because they are now both pointing to the same
108
- Java graphdb instance.
49
+ ## Graph Database Support
50
+
51
+ Pacer can work with any Blueprints-enabled graph, such as Neo4j, OrientDB, TinkerGraph and more.
109
52
 
110
- ### A note on safely exiting
53
+ [See the docs](http://pangloss.github.io/pacer/suppoted_graph_databases/) for more details.
111
54
 
112
- Some databases need to be shutdown cleanly when the program exits. You
113
- can shut a database down anytime by calling `graph.shutdown`, but you
114
- don't need to worry about it much. Pacer uses Ruby's `at_exit` hook to
115
- automatically shut down all open databases!
116
55
 
117
56
  ## Example traversals
118
57
 
@@ -135,66 +74,7 @@ or to take it one step further:
135
74
  person.recommended_friends
136
75
  ```
137
76
 
138
- ## Create and populate a graph
139
-
140
- To get started, you need to know just a few methods. First, open up a graph (if one doesn't exist it will be automatically created) and add some vertices to it:
141
-
142
- ```ruby
143
- dex = Pacer.dex '/tmp/dex_demo'
144
- dex.transaction do
145
- pangloss = dex.create_vertex :name => 'pangloss', :type => 'user'
146
- okram = dex.create_vertex :name => 'okram', :type => 'user'
147
- group = dex.create_vertex :name => 'Tinkerpop', :type => 'group'
148
- end
149
- ```
150
-
151
- Now, let's see what we've got:
152
-
153
- ```ruby
154
- dex.v
155
- ```
156
-
157
- produces:
158
-
159
- ```ruby
160
- #<V[1024]> #<V[1025]> #<V[1026]>
161
- Total: 3
162
- => #<GraphV>
163
- ```
164
-
165
- There are our vertices. Let's look their properties:
166
-
167
- ```ruby
168
- dex.v.properties
169
-
170
- {"name"=>"pangloss", "type"=>"user"} {"name"=>"okram", "type"=>"user"}
171
- {"name"=>"Tinkerpop", "type"=>"group"}
172
- Total: 3
173
- => #<GraphV -> Obj-Map>
174
- ```
175
-
176
- Now let's put an edge between them:
177
-
178
- ```ruby
179
- dex.transaction do
180
- dex.create_edge okram, pangloss, :inspired
181
- end
182
- => #<E[2048]:1025-inspired-1024>
183
- ```
184
-
185
- That's great for creating an edge but what if I've got lots to create? Try this method instead which can add edges to the cross product of all vertices in one route with all vertices in the other:
186
-
187
- ```ruby
188
- dex.transaction do
189
- group.add_edges_to :member, dex.v(:type => 'user')
190
- end
191
-
192
- #<E[4097]:1026-member-1024> #<E[4098]:1026-member-1025>
193
- Total: 2
194
- => #<Obj 2 ids -> lookup>
195
- ```
196
-
197
- There is plenty more to see as well! Please dig into the code and the spec suite to find loads of examples and edge cases. And if you think of a case that I've missed, I'll greatly appreciate your contributions!
77
+ You can use the [Quick Start guide](http://pangloss.github.io/pacer/quick_start/) to get a feel for how Pacer queries (aka traversals) work.
198
78
 
199
79
  ## Design Philosophy
200
80
 
@@ -53,6 +53,7 @@ module Pacer
53
53
  end
54
54
  self
55
55
  end
56
+ alias drop offset
56
57
 
57
58
  def offset=(n)
58
59
  offset n
@@ -65,6 +65,7 @@ module Pacer
65
65
  read_tx_depth = tgi[:read_tx_depth] ||= 0
66
66
  tgi[:read_tx_depth] += 1
67
67
  # Blueprints auto-starts the transaction
68
+ reopen_read_transaction
68
69
  yield
69
70
  ensure
70
71
  rtd = tgi[:read_tx_depth] -= 1
@@ -1,5 +1,5 @@
1
1
  module Pacer
2
- VERSION = "2.0.14"
2
+ VERSION = "2.0.15"
3
3
  # Clients may optionally define the following constants in the Pacer namespace:
4
4
  # - LOAD_JARS : set to false to manage jar loading in the client. Be sure to load the jars defined in JARFILES.
5
5
  # - LOCKJAR_LOCK_OPTS : set some options to be passed to LockJar.lock (ie. :lockfile, :download_artifacts, :local_repo)
@@ -37,30 +37,37 @@ module Pacer::Wrappers
37
37
 
38
38
  def route_conditions(graph)
39
39
  return @route_conditions if defined? @route_conditions
40
- @route_conditions = extensions.inject({}) do |h, ext|
41
- if ext.respond_to? :route_conditions
42
- h.merge! ext.route_conditions(graph)
43
- else
44
- h
45
- end
46
- end
47
- @route_conditions
40
+ @route_conditions = extensions.inject({}, &reduce_extensions(graph, :route_conditions))
48
41
  end
49
42
 
50
43
  def lookup(graph)
51
44
  return @lookup if defined? @lookup
52
- @lookup = extensions.inject({}) do |h, ext|
53
- if ext.respond_to? :lookup
54
- h.merge! ext.lookup(graph)
45
+ @lookup = extensions.inject({}, &reduce_extensions(graph, :lookup))
46
+ end
47
+
48
+ protected
49
+
50
+ def reduce_extensions(graph, method)
51
+ proc do |h, ext|
52
+ if ext.respond_to? method
53
+ conds = ext.send(method, graph)
54
+ if conds.is_a? Hash
55
+ h.merge! conds
56
+ elsif conds.is_a? Array
57
+ if h.is_a? Array
58
+ conds + h
59
+ else
60
+ conds + [h]
61
+ end
62
+ else
63
+ h
64
+ end
55
65
  else
56
66
  h
57
67
  end
58
68
  end
59
- @lookup
60
69
  end
61
70
 
62
- protected
63
-
64
71
  def build_extension_wrapper(exts, mod_names, superclass)
65
72
  sc_name = superclass.to_s.split(/::/).last
66
73
  exts = exts.uniq unless exts.is_a? Set
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
  s.files = `git ls-files`.split("\n") + ['lib/pacer-ext.jar']
17
17
  s.test_files = `git ls-files -- spec/*`.split("\n")
18
18
  s.require_paths = ['lib']
19
- s.add_dependency "lock_jar", "~> 0.10.2"
19
+ s.add_dependency "lock_jar", "~> 0.12.0"
20
20
  s.add_development_dependency 'xn_gem_release_tasks'
21
21
  s.add_development_dependency "rake-compiler", "~> 0.9.2"
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pacer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.14
4
+ version: 2.0.15
5
5
  platform: java
6
6
  authors:
7
7
  - Darrick Wiebe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-04 00:00:00.000000000 Z
11
+ date: 2015-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lock_jar
@@ -16,12 +16,12 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: 0.10.2
19
+ version: 0.12.0
20
20
  requirement: !ruby/object:Gem::Requirement
21
21
  requirements:
22
22
  - - ~>
23
23
  - !ruby/object:Gem::Version
24
- version: 0.10.2
24
+ version: 0.12.0
25
25
  prerelease: false
26
26
  type: :runtime
27
27
  - !ruby/object:Gem::Dependency