pacer 1.4.0-java → 1.4.1-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: b1719e006a5a547e01b900999a76df5df6ada73c
4
- data.tar.gz: 9ef6e2292108bd5b4f817bca04fb8747a9e64581
3
+ metadata.gz: 1227123a1e6e9957a23724feab5952a05bc27fd8
4
+ data.tar.gz: e72165240fe2961187842c97597b92d92668f397
5
5
  SHA512:
6
- metadata.gz: 3084c5a67393a3a6ed28d1ba4239ea030bce9ae540a975721cf88d2dddccab927328e4f34ee44c9f9919e7080ebc96eff77d9d1157954564b33646e8a1880d39
7
- data.tar.gz: e2388b84181c61a15d09af7d02b802ab59842ffdc208a538d0358a5320e5b1d2ca3cb8d105b18f3527ef330d579a9d9fc5a7acbcf62ebcaa53c99bff592c9d79
6
+ metadata.gz: 6ef46e1d94316c7f343d94e2a04bf30421e8af1ed1e9babca31c1ea72e4dd0fe4b813e04f4368990e6b57cf41d161d57e242b2ed676c901f5b3ab14dd0634b72
7
+ data.tar.gz: af542cfc0232adb1dfafa916fccc7bee775b901a5a7da4bf1fd4e97d623b508376f8452ada5d9632292c0bf939e3984a887124cee910290b22126c3d10fc3ff2
data/README.md CHANGED
@@ -125,9 +125,11 @@ To get started, you need to know just a few methods. First, open up a graph (if
125
125
 
126
126
  ```ruby
127
127
  dex = Pacer.dex '/tmp/dex_demo'
128
- pangloss = dex.create_vertex :name => 'pangloss', :type => 'user'
129
- okram = dex.create_vertex :name => 'okram', :type => 'user'
130
- group = dex.create_vertex :name => 'Tinkerpop', :type => 'group'
128
+ dex.transaction do
129
+ pangloss = dex.create_vertex :name => 'pangloss', :type => 'user'
130
+ okram = dex.create_vertex :name => 'okram', :type => 'user'
131
+ group = dex.create_vertex :name => 'Tinkerpop', :type => 'group'
132
+ end
131
133
  ```
132
134
 
133
135
  Now, let's see what we've got:
@@ -158,14 +160,18 @@ There are our vertices. Let's look their properties:
158
160
  Now let's put an edge between them:
159
161
 
160
162
  ```ruby
161
- dex.create_edge okram, pangloss, :inspired
163
+ dex.transaction do
164
+ dex.create_edge okram, pangloss, :inspired
165
+ end
162
166
  => #<E[2048]:1025-inspired-1024>
163
167
  ```
164
168
 
165
169
  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:
166
170
 
167
171
  ```ruby
168
- group.add_edges_to :member, dex.v(:type => 'user')
172
+ dex.transaction do
173
+ group.add_edges_to :member, dex.v(:type => 'user')
174
+ end
169
175
 
170
176
  #<E[4097]:1026-member-1024> #<E[4098]:1026-member-1025>
171
177
  Total: 2
@@ -1,11 +1,17 @@
1
1
  module Pacer
2
2
  module Routes
3
3
  module RouteOperations
4
+ import com.tinkerpop.pipes.filter.DuplicateFilterPipe
5
+ import com.tinkerpop.pipes.filter.CyclicPathFilterPipe
6
+
4
7
  # Do not return duplicate elements.
5
- def uniq(*filters, &block)
6
- Pacer::Route.property_filter_before(self, filters, block) do |r|
7
- chain_route :pipe_class => Pacer::Pipes::DuplicateFilterPipe, :route_name => 'uniq'
8
- end
8
+ def uniq
9
+ chain_route :pipe_class => DuplicateFilterPipe, :route_name => 'uniq'
10
+ end
11
+
12
+ # Filter out any element where its path would contain the same element twice.
13
+ def unique_path
14
+ chain_route :pipe_class => CyclicPathFilterPipe, :route_name => 'unique_path'
9
15
  end
10
16
  end
11
17
  end
@@ -227,6 +227,12 @@ module Pacer
227
227
  build_comparison(a, b, '==')
228
228
  end
229
229
 
230
+ def visitConstDeclNode(node)
231
+ a = Pipe.new PropertyPipe, node.name
232
+ b = node.value_node.accept(self)
233
+ build_comparison(a, b, '==')
234
+ end
235
+
230
236
  def visitLocalVarNode(node)
231
237
  Pipe.new PropertyPipe, node.name
232
238
  end
@@ -285,6 +291,10 @@ module Pacer
285
291
  Pipe.new PropertyPipe, node.name
286
292
  end
287
293
 
294
+ def visitConstNode(node)
295
+ Pipe.new PropertyPipe, node.name
296
+ end
297
+
288
298
  def visitXStrNode(node)
289
299
  Pipe.new PropertyPipe, node.value
290
300
  end
data/lib/pacer/pipes.rb CHANGED
@@ -8,7 +8,6 @@ module Pacer
8
8
  import com.tinkerpop.pipes.util.PipeHelper
9
9
 
10
10
  import com.tinkerpop.pipes.filter.RandomFilterPipe
11
- import com.tinkerpop.pipes.filter.DuplicateFilterPipe
12
11
  import com.tinkerpop.pipes.filter.RangeFilterPipe
13
12
  import com.tinkerpop.pipes.filter.FilterPipe
14
13
 
@@ -17,7 +17,7 @@ module Pacer::Routes
17
17
  # Iterates over each element in the route, controlling
18
18
  # transactions so that they are only committed once every
19
19
  # +size+ records.
20
- def bulk_job(size = nil, target_graph = nil)
20
+ def bulk_job(size = nil, target_graph = nil, pre_commit = nil)
21
21
  target_graph ||= graph
22
22
  if target_graph and not target_graph.in_bulk_job?
23
23
  begin
@@ -32,6 +32,7 @@ module Pacer::Routes
32
32
  slice.each do |element|
33
33
  yield element
34
34
  end
35
+ pre_commit.call if pre_commit
35
36
  commit.call
36
37
  end
37
38
  end
@@ -81,7 +81,7 @@ module Pacer
81
81
 
82
82
  def add_block!(&block)
83
83
  will_clone = false
84
- branch = block.call(Pacer::Route.empty(self))
84
+ branch = block.call(Pacer::Route.empty(back))
85
85
  branches.push branch
86
86
  conf = {}
87
87
 
data/lib/pacer/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Pacer
2
2
  unless const_defined? :VERSION
3
- VERSION = "1.4.0"
3
+ VERSION = "1.4.1"
4
4
 
5
5
  JAR = "pacer-#{ VERSION }-standalone.jar"
6
6
  JAR_PATH = "lib/#{ JAR }"
data/pom.xml CHANGED
@@ -8,7 +8,7 @@
8
8
  <!-- NOTE: the following properties are automatically updated based on the values in lib/pacer-neo4j/version.rb -->
9
9
  <properties>
10
10
  <blueprints.version>2.3.0</blueprints.version>
11
- <gem.version>1.4.0</gem.version>
11
+ <gem.version>1.4.1</gem.version>
12
12
  <pipes.version>2.3.0</pipes.version>
13
13
  <gremlin.version>2.3.0</gremlin.version>
14
14
  </properties>
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: 1.4.0
4
+ version: 1.4.1
5
5
  platform: java
6
6
  authors:
7
7
  - Darrick Wiebe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-09 00:00:00.000000000 Z
11
+ date: 2013-11-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Pacer defines routes through a graph and then traverses them very quickly.
14
14
  email: darrick@innatesoftware.com
@@ -220,7 +220,7 @@ files:
220
220
  - spec/support/use_transactions.rb
221
221
  - spec/tackle/simple_mixin.rb
222
222
  - spec/tackle/tinkerpop_graph_mixins.rb
223
- - lib/pacer-1.4.0-standalone.jar
223
+ - lib/pacer-1.4.1-standalone.jar
224
224
  homepage: http://github.com/pangloss/pacer
225
225
  licenses:
226
226
  - MIT