pacer 1.5.1-java → 1.5.2-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.
- checksums.yaml +4 -4
- data/lib/pacer/graph/graph_transactions_mixin.rb +5 -5
- data/lib/pacer/graph/yaml_encoder.rb +18 -4
- data/lib/pacer/support/enumerable.rb +2 -11
- data/lib/pacer/support/hash.rb +8 -2
- data/lib/pacer/version.rb +1 -1
- data/lib/{pacer-1.5.1-standalone.jar → pacer-1.5.2-standalone.jar} +0 -0
- data/pom.xml +1 -1
- data/spec/pacer/graph/pacer_graph_spec.rb +8 -10
- data/spec/pacer/graph/yaml_encoder_spec.rb +1 -1
- data/spec/pacer/route/mixin/base_spec.rb +2 -2
- data/spec/pacer/wrapper/edge_wrapper_spec.rb +2 -2
- data/spec/pacer/wrapper/vertex_wrapper_spec.rb +4 -1
- data/spec/spec_helper.rb +4 -4
- data/spec/support/graph_runner.rb +1 -1
- metadata +3 -11
- data/spec/pacer/pipe/block_filter_pipe_spec.rb +0 -0
- data/spec/pacer/pipe/labels_filter_pipe_spec.rb +0 -0
- data/spec/pacer/pipe/ruby_pipe_spec.rb +0 -0
- data/spec/pacer/pipe/type_filter_pipe_spec.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68c8b58f48b477c95dc1e6c900bf08da80757ab5
|
4
|
+
data.tar.gz: c2be8f1ed37cf34e6094be7dc1b5281bcce5fb67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e124987bdd52b1168c9c59094367594619e1393fe5ce5306217088ab30fc62eb0a8131e258214d04b53b34bfcd84c43f235cfee8be20535ee615bbd0eac3c8b9
|
7
|
+
data.tar.gz: 3c4f4227638b57ba0c0e733d2c4433e3c00bfa3ed9911c680f048221d0cd46debbf68441f49ecf052bb4c30bea336263ecbfd2d6fd0519f98634eabcdf81d965
|
@@ -61,7 +61,7 @@ module Pacer
|
|
61
61
|
rtd = tgi[:read_tx_depth] -= 1
|
62
62
|
if rtd == 0 and tgi[:tx_depth] == 0 and blueprints_graph.is_a? TransactionalGraph
|
63
63
|
# rollback after the bottom read transaction (no changes outside a real transaction block should have been possible)
|
64
|
-
blueprints_graph.
|
64
|
+
blueprints_graph.rollback
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
@@ -99,11 +99,11 @@ module Pacer
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def rollback_implicit_transaction
|
102
|
-
blueprints_graph.
|
102
|
+
blueprints_graph.rollback
|
103
103
|
end
|
104
104
|
|
105
105
|
def commit_implicit_transaction
|
106
|
-
blueprints_graph.
|
106
|
+
blueprints_graph.commit
|
107
107
|
end
|
108
108
|
|
109
109
|
attr_reader :on_commit_block
|
@@ -158,13 +158,13 @@ module Pacer
|
|
158
158
|
fail InternalError, 'Can not commit transaction outside its original block'
|
159
159
|
end
|
160
160
|
puts "transaction committed" if Pacer.verbose == :very
|
161
|
-
blueprints_graph.
|
161
|
+
blueprints_graph.commit
|
162
162
|
reopen_read_transaction
|
163
163
|
on_commit_block.call if on_commit_block
|
164
164
|
end
|
165
165
|
rollback = ->(message = nil) do
|
166
166
|
puts ["transaction rolled back", message].compact.join(': ') if Pacer.verbose == :very
|
167
|
-
blueprints_graph.
|
167
|
+
blueprints_graph.rollback
|
168
168
|
reopen_read_transaction
|
169
169
|
end
|
170
170
|
[commit, rollback]
|
@@ -21,8 +21,17 @@ module Pacer
|
|
21
21
|
end
|
22
22
|
when true, false
|
23
23
|
value.to_java
|
24
|
-
when DateTime
|
25
|
-
|
24
|
+
when DateTime
|
25
|
+
# rfc3339 drops the millisecond
|
26
|
+
value.new_offset(0).strftime ' utcT %Y-%m-%d %H:%M:%S.%L'
|
27
|
+
when Time
|
28
|
+
if value.utc?
|
29
|
+
value.getutc.strftime ' utcT %Y-%m-%d %H:%M:%S.%L'
|
30
|
+
else
|
31
|
+
value.strftime ' time %Y-%m-%d %H:%M:%S.%L %z'
|
32
|
+
end
|
33
|
+
when Date
|
34
|
+
value.strftime ' date %Y-%m-%d'
|
26
35
|
when Array
|
27
36
|
if value.length == 0
|
28
37
|
value_type = Fixnum
|
@@ -55,9 +64,14 @@ module Pacer
|
|
55
64
|
|
56
65
|
def self.decode_property(value)
|
57
66
|
if value.is_a? String and value[0, 1] == ' '
|
58
|
-
|
67
|
+
marker = value[1, 4]
|
68
|
+
if marker == 'utcT'
|
59
69
|
# FIXME: we lose the milliseconds here...
|
60
|
-
|
70
|
+
DateTime.parse(value[6..-1]).to_time.utc
|
71
|
+
elsif marker == 'time'
|
72
|
+
DateTime.parse(value[6..-1]).to_time
|
73
|
+
elsif marker == 'date'
|
74
|
+
Date.parse(value[6..-1])
|
61
75
|
else
|
62
76
|
YAML.load(value[1..-1])
|
63
77
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# Extend the built-in Enumerable module:
|
2
2
|
module Enumerable
|
3
|
-
|
4
3
|
def one?
|
5
4
|
counter = 0
|
6
5
|
each do
|
@@ -19,23 +18,15 @@ module Enumerable
|
|
19
18
|
def to_hashset(method = nil, *args)
|
20
19
|
return self if self.is_a? java.util.HashSet and not method
|
21
20
|
hs = java.util.HashSet.new
|
22
|
-
iter = self.each rescue nil
|
23
|
-
if not iter and respond_to? :iterator
|
24
|
-
iter = self.iterator
|
25
|
-
end
|
26
|
-
e = iter.next
|
27
21
|
if method
|
28
|
-
|
22
|
+
each do |e|
|
29
23
|
hs.add e.send(method, *args)
|
30
|
-
e = iter.next
|
31
24
|
end
|
32
25
|
else
|
33
|
-
|
26
|
+
each do |e|
|
34
27
|
hs.add e
|
35
|
-
e = iter.next
|
36
28
|
end
|
37
29
|
end
|
38
|
-
rescue StopIteration, Pacer::EmptyPipe, java.util.NoSuchElementException
|
39
30
|
hs
|
40
31
|
end
|
41
32
|
|
data/lib/pacer/support/hash.rb
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
class Hash
|
2
2
|
def to_hash_map
|
3
3
|
hm = java.util.HashMap.new
|
4
|
-
|
5
|
-
|
4
|
+
if block_given?
|
5
|
+
each do |key, value|
|
6
|
+
hm.put(*yield(key, value))
|
7
|
+
end
|
8
|
+
else
|
9
|
+
each do |key, value|
|
10
|
+
hm.put key, value
|
11
|
+
end
|
6
12
|
end
|
7
13
|
hm
|
8
14
|
end
|
data/lib/pacer/version.rb
CHANGED
Binary file
|
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.6.0-SNAPSHOT</blueprints.version>
|
11
|
-
<gem.version>1.5.
|
11
|
+
<gem.version>1.5.2</gem.version>
|
12
12
|
<pipes.version>2.5.0</pipes.version>
|
13
13
|
</properties>
|
14
14
|
<!-- NOTE: the following properties are automatically updated based on the values in lib/pacer-neo4j/version.rb -->
|
@@ -170,14 +170,18 @@ Run.all :read_write do
|
|
170
170
|
|
171
171
|
describe '#create_edge' do
|
172
172
|
let(:use_id) { rand 1000000 }
|
173
|
-
let(:from) {
|
174
|
-
let(:to) {
|
173
|
+
let(:from) { v0 }
|
174
|
+
let(:to) { v1 }
|
175
175
|
|
176
176
|
before do
|
177
177
|
c = example.metadata[:graph_commit]
|
178
178
|
c.call if c
|
179
179
|
end
|
180
180
|
|
181
|
+
it 'should find the vertex' do
|
182
|
+
graph.vertex(v0.element_id).should == v0
|
183
|
+
end
|
184
|
+
|
181
185
|
context 'existing' do
|
182
186
|
it 'should raise an exception' do
|
183
187
|
if not graph.features.ignoresSuppliedIds
|
@@ -270,14 +274,8 @@ Run.all :read_write do
|
|
270
274
|
c = example.metadata[:graph_commit]
|
271
275
|
c.call if c
|
272
276
|
end
|
273
|
-
|
274
|
-
|
275
|
-
it { should == [e0, e0] }
|
276
|
-
end
|
277
|
-
|
278
|
-
context 'valid' do
|
279
|
-
subject { graph.load_edges [e0.element_id] }
|
280
|
-
it { should == [e0] }
|
277
|
+
it 'should only find valid edges' do
|
278
|
+
graph.load_edges([e0.element_id.to_s, nil, e0.element_id, 'missing']).should == [e0, e0]
|
281
279
|
end
|
282
280
|
end
|
283
281
|
|
@@ -16,10 +16,10 @@ Run.all do
|
|
16
16
|
it { should be_nil }
|
17
17
|
end
|
18
18
|
|
19
|
-
describe '#
|
19
|
+
describe '#pipe' do
|
20
20
|
use_simple_graph_data
|
21
21
|
before { setup_data }
|
22
|
-
subject { graph.v.
|
22
|
+
subject { graph.v.pipe }
|
23
23
|
its(:next) { should_not be_nil }
|
24
24
|
end
|
25
25
|
end
|
@@ -130,8 +130,8 @@ describe Pacer::Wrappers::EdgeWrapper do
|
|
130
130
|
end
|
131
131
|
|
132
132
|
it 'should change the label' do
|
133
|
-
new_e = e0.reverse! label: '
|
134
|
-
new_e.label.should == '
|
133
|
+
new_e = e0.reverse! label: 'hello_there'
|
134
|
+
new_e.label.should == 'hello_there'
|
135
135
|
end
|
136
136
|
|
137
137
|
it 'should reuse the element id' do
|
@@ -178,6 +178,9 @@ shared_examples_for Pacer::Wrappers::VertexWrapper do
|
|
178
178
|
before { pending 'support temporary hash indices for clone/copy' unless graph.features.supportsIndices }
|
179
179
|
let(:dest) { graph2 }
|
180
180
|
}) do
|
181
|
+
before do
|
182
|
+
graph.transaction(nesting: true) { setup_data }
|
183
|
+
end
|
181
184
|
describe '#clone_into', :transactions => false, read_transaction: true do
|
182
185
|
subject { dest.transaction { v0.clone_into(dest) } }
|
183
186
|
its(:properties) { should == { 'name' => 'eliza' } }
|
@@ -192,7 +195,7 @@ shared_examples_for Pacer::Wrappers::VertexWrapper do
|
|
192
195
|
end
|
193
196
|
end
|
194
197
|
|
195
|
-
subject { v0 }
|
198
|
+
subject { graph.transaction(nesting: true) { setup_data; v0 } }
|
196
199
|
its(:graph) { should equal(graph) }
|
197
200
|
its(:display_name) { should be_nil }
|
198
201
|
its(:inspect) { should =~ /#<[VM]\[#{Regexp.quote v0.element_id.to_s }\]>/ }
|
data/spec/spec_helper.rb
CHANGED
@@ -39,10 +39,10 @@ Run = RSpec::GraphRunner.new ENV['GRAPHS']
|
|
39
39
|
|
40
40
|
def use_simple_graph_data
|
41
41
|
let(:setup_data) { e0; e1 }
|
42
|
-
let(:v0) { graph.
|
43
|
-
let(:v1) { graph.
|
44
|
-
let(:e0) { graph.
|
45
|
-
let(:e1) { graph.
|
42
|
+
let(:v0) { graph.create_vertex :name => 'eliza' }
|
43
|
+
let(:v1) { graph.create_vertex :name => 'darrick' }
|
44
|
+
let(:e0) { graph.create_edge nil, v0, v1, :links }
|
45
|
+
let(:e1) { graph.create_edge nil, v0, v1, :relinks }
|
46
46
|
end
|
47
47
|
|
48
48
|
def use_pacer_graphml_data(usage_style = :read_write)
|
@@ -130,7 +130,7 @@ protected
|
|
130
130
|
end
|
131
131
|
begin
|
132
132
|
g2_rollback.call #rescue nil
|
133
|
-
rescue Pacer::NestedTransactionRollback, Pacer::NestedMockTransactionRollback
|
133
|
+
rescue Pacer::MockTransactionRollback, Pacer::NestedTransactionRollback, Pacer::NestedMockTransactionRollback
|
134
134
|
end
|
135
135
|
end
|
136
136
|
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: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Darrick Wiebe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-18 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
|
@@ -194,10 +194,6 @@ files:
|
|
194
194
|
- spec/pacer/graph/pacer_graph_spec.rb
|
195
195
|
- spec/pacer/graph/simple_encoder_spec.rb
|
196
196
|
- spec/pacer/graph/yaml_encoder_spec.rb
|
197
|
-
- spec/pacer/pipe/block_filter_pipe_spec.rb
|
198
|
-
- spec/pacer/pipe/labels_filter_pipe_spec.rb
|
199
|
-
- spec/pacer/pipe/ruby_pipe_spec.rb
|
200
|
-
- spec/pacer/pipe/type_filter_pipe_spec.rb
|
201
197
|
- spec/pacer/route/mixin/base_spec.rb
|
202
198
|
- spec/pacer/route/mixin/bulk_operations_spec.rb
|
203
199
|
- spec/pacer/route/mixin/route_operations_spec.rb
|
@@ -222,7 +218,7 @@ files:
|
|
222
218
|
- spec/support/use_transactions.rb
|
223
219
|
- spec/tackle/simple_mixin.rb
|
224
220
|
- spec/tackle/tinkerpop_graph_mixins.rb
|
225
|
-
- lib/pacer-1.5.
|
221
|
+
- lib/pacer-1.5.2-standalone.jar
|
226
222
|
homepage: http://github.com/pangloss/pacer
|
227
223
|
licenses:
|
228
224
|
- MIT
|
@@ -274,10 +270,6 @@ test_files:
|
|
274
270
|
- spec/pacer/graph/pacer_graph_spec.rb
|
275
271
|
- spec/pacer/graph/simple_encoder_spec.rb
|
276
272
|
- spec/pacer/graph/yaml_encoder_spec.rb
|
277
|
-
- spec/pacer/pipe/block_filter_pipe_spec.rb
|
278
|
-
- spec/pacer/pipe/labels_filter_pipe_spec.rb
|
279
|
-
- spec/pacer/pipe/ruby_pipe_spec.rb
|
280
|
-
- spec/pacer/pipe/type_filter_pipe_spec.rb
|
281
273
|
- spec/pacer/route/mixin/base_spec.rb
|
282
274
|
- spec/pacer/route/mixin/bulk_operations_spec.rb
|
283
275
|
- spec/pacer/route/mixin/route_operations_spec.rb
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|