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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73b5792b368e7fd7337c32ccceeb591ed47ab3a8
4
- data.tar.gz: cb32f1e5e53c44accced47e77ee7fe6177eafeb4
3
+ metadata.gz: 68c8b58f48b477c95dc1e6c900bf08da80757ab5
4
+ data.tar.gz: c2be8f1ed37cf34e6094be7dc1b5281bcce5fb67
5
5
  SHA512:
6
- metadata.gz: 3eb2c7a98df23b0cce4a79343e601363970bb3a96deb4c4d50982daab3f683ce4d97cd7a957475b8df6ecd6fde41756383bf3fa9c5fef70ad1efd08a44944c01
7
- data.tar.gz: aff44e7a64e456465a5e15fe093ed04410d7139f63213bdecddf1ae265cf6cd4fdab1fbcbba25d26b67d20453f3b60e79d2c31479845e795c24cf86895a0e16d
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.stopTransaction TransactionalGraph::Conclusion::FAILURE
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.stopTransaction TransactionalGraph::Conclusion::FAILURE
102
+ blueprints_graph.rollback
103
103
  end
104
104
 
105
105
  def commit_implicit_transaction
106
- blueprints_graph.stopTransaction TransactionalGraph::Conclusion::SUCCESS
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.stopTransaction TransactionalGraph::Conclusion::SUCCESS
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.stopTransaction TransactionalGraph::Conclusion::FAILURE
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, Time, Date
25
- value.strftime ' time %Y-%m-%d %H:%M:%S.%L %z'
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
- if value[1, 4] == 'time'
67
+ marker = value[1, 4]
68
+ if marker == 'utcT'
59
69
  # FIXME: we lose the milliseconds here...
60
- Time.parse value[6..-1]
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
- while true
22
+ each do |e|
29
23
  hs.add e.send(method, *args)
30
- e = iter.next
31
24
  end
32
25
  else
33
- while true
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
 
@@ -1,8 +1,14 @@
1
1
  class Hash
2
2
  def to_hash_map
3
3
  hm = java.util.HashMap.new
4
- each do |key, value|
5
- hm.put key, value
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
@@ -1,6 +1,6 @@
1
1
  module Pacer
2
2
  unless const_defined? :VERSION
3
- VERSION = "1.5.1"
3
+ VERSION = "1.5.2"
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.6.0-SNAPSHOT</blueprints.version>
11
- <gem.version>1.5.1</gem.version>
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) { graph.vertex v0.element_id }
174
- let(:to) { graph.vertex v1.element_id }
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
- context 'invalid' do
274
- subject { graph.load_edges [e0.element_id, nil, e0.element_id, 'missing'] }
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
 
@@ -39,7 +39,7 @@ describe Pacer::YamlEncoder do
39
39
  end
40
40
 
41
41
  specify 'dates are custom to enable range queries' do
42
- subject[:time].should =~ /^ time \d/
42
+ subject[:time].should =~ /^ utcT \d/
43
43
  end
44
44
 
45
45
  specify 'everything else should be yaml' do
@@ -16,10 +16,10 @@ Run.all do
16
16
  it { should be_nil }
17
17
  end
18
18
 
19
- describe '#iterator' do
19
+ describe '#pipe' do
20
20
  use_simple_graph_data
21
21
  before { setup_data }
22
- subject { graph.v.send(:iterator) }
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: 'hello!!'
134
- new_e.label.should == 'hello!!'
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.transaction(nesting: true) { graph.create_vertex :name => 'eliza' } }
43
- let(:v1) { graph.transaction(nesting: true) { graph.create_vertex :name => 'darrick' } }
44
- let(:e0) { graph.transaction(nesting: true) { graph.create_edge nil, v0, v1, :links } }
45
- let(:e1) { graph.transaction(nesting: true) { graph.create_edge nil, v0, v1, :relinks } }
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.1
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-08-22 00:00:00.000000000 Z
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.1-standalone.jar
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