pacer-orient 2.2.2.pre-java → 2.3.1.pre-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile +4 -0
- data/Jarfile +2 -0
- data/Rakefile +0 -33
- data/lib/pacer-orient/db_listener.rb +51 -13
- data/lib/pacer-orient/graph.rb +3 -1
- data/lib/pacer-orient/tx_data_wrapper.rb +26 -2
- data/lib/pacer-orient/version.rb +2 -6
- data/lib/pacer-orient.rb +8 -1
- data/pacer-orient.gemspec +2 -1
- metadata +19 -7
- data/lib/pacer-orient-2.2.2.pre-standalone.jar +0 -0
- data/pom/standalone.xml +0 -22
- data/pom.xml +0 -101
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e5f2cb6dda6c9d808b6fb784d111112ab42e43e
|
4
|
+
data.tar.gz: a06875f2955c6c26f5f7e92d325cf4abb03543fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6d551402eb429220089ad2bb8c15775c6ee63d81f7a647791534b218dc040fb896cb119769a9631c649835caed20e45bbb5f373ecd125028cfbf23ab4caf487
|
7
|
+
data.tar.gz: bb9b6a42833218fcfb65dae960f656eb7587a2b2905b2d4464ce888df42faa9655fd8fcbace9ca01bd6e336e76085065687196963ca1189a834bf651d6b1a2dd
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -2,3 +2,7 @@ source "http://rubygems.org"
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in pacer-graph.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
# Gemfile-custom is .gitignored, but eval'd here so you can add
|
7
|
+
# whatever dev tools you like to use to your local environment.
|
8
|
+
eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')
|
data/Jarfile
ADDED
data/Rakefile
CHANGED
@@ -1,35 +1,2 @@
|
|
1
1
|
require 'bundler'
|
2
2
|
Bundler::GemHelper.install_tasks
|
3
|
-
|
4
|
-
file 'pom.xml' => 'lib/pacer-orient/version.rb' do
|
5
|
-
pom = File.read 'pom.xml'
|
6
|
-
when_writing('Update pom.xml version number') do
|
7
|
-
open 'pom.xml', 'w' do |f|
|
8
|
-
pom.each_line do |line|
|
9
|
-
line.sub!(%r{<gem.version>.*</gem.version>}, "<gem.version>#{ Pacer::Orient::VERSION }</gem.version>")
|
10
|
-
line.sub!(%r{<orient.version>.*</orient.version>}, "<orient.version>#{ Pacer::Orient::ORIENT_VERSION }</orient.version>")
|
11
|
-
line.sub!(%r{<pipes.version>.*</pipes.version>}, "<pipes.version>#{ Pacer::Orient::PIPES_VERSION }</pipes.version>")
|
12
|
-
f << line
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
file Pacer::Orient::JAR_PATH => 'pom.xml' do
|
19
|
-
when_writing("Execute 'mvn package' task") do
|
20
|
-
system('mvn clean package')
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
task :note do
|
25
|
-
puts "NOTE: touch lib/pacer-orient/version.rb (or rake touch) to force everything to rebuild"
|
26
|
-
end
|
27
|
-
|
28
|
-
task :build => [:note, Pacer::Orient::JAR_PATH]
|
29
|
-
task :install => [:note, Pacer::Orient::JAR_PATH]
|
30
|
-
|
31
|
-
desc 'Touch version.rb so that the jar rebuilds'
|
32
|
-
task :touch do
|
33
|
-
system 'touch', 'lib/pacer-orient/version.rb'
|
34
|
-
end
|
35
|
-
|
@@ -5,13 +5,21 @@ module Pacer
|
|
5
5
|
class DbListener
|
6
6
|
include ODatabaseListener
|
7
7
|
|
8
|
-
attr_reader :graph
|
8
|
+
attr_reader :graph, :ident
|
9
9
|
|
10
10
|
def initialize(graph)
|
11
|
-
|
11
|
+
@ident = :"listener#{rand}"
|
12
12
|
@graph = graph
|
13
13
|
end
|
14
14
|
|
15
|
+
def data=(x)
|
16
|
+
Thread.current[ident] = x
|
17
|
+
end
|
18
|
+
|
19
|
+
def data
|
20
|
+
Thread.current[ident]
|
21
|
+
end
|
22
|
+
|
15
23
|
def onCreate(db)
|
16
24
|
end
|
17
25
|
|
@@ -31,17 +39,6 @@ module Pacer
|
|
31
39
|
end
|
32
40
|
|
33
41
|
def onBeforeTxCommit(db)
|
34
|
-
data = TxDataWrapper.new db, graph
|
35
|
-
pp transaction: { getAllRecordEntries: data.entries,
|
36
|
-
length: data.entries.length,
|
37
|
-
contents: data.entries.to_a }
|
38
|
-
pp created_v: data.created_v
|
39
|
-
pp created_e: data.created_e
|
40
|
-
pp changed_v: data.changed_v
|
41
|
-
pp changed_e: data.changed_e
|
42
|
-
pp deleted_v: data.deleted_v
|
43
|
-
pp deleted_e: data.deleted_e
|
44
|
-
|
45
42
|
end
|
46
43
|
|
47
44
|
def onAfterTxCommit(db)
|
@@ -55,6 +52,47 @@ module Pacer
|
|
55
52
|
end
|
56
53
|
end
|
57
54
|
|
55
|
+
class DbCommitListener < DbListener
|
56
|
+
attr_reader :on_commit
|
57
|
+
|
58
|
+
def initialize(graph, on_commit)
|
59
|
+
@on_commit = on_commit
|
60
|
+
super graph
|
61
|
+
end
|
62
|
+
|
63
|
+
def onBeforeTxCommit(db)
|
64
|
+
self.data = d = CachedTxDataWrapper.new db, graph
|
65
|
+
#on_commit.call d
|
66
|
+
pp transaction: { getAllRecordEntries: d.entries,
|
67
|
+
length: d.entries.length,
|
68
|
+
contents: d.entries.to_a }
|
69
|
+
pp created_v: d.created_v
|
70
|
+
pp created_e: d.created_e
|
71
|
+
pp changed_v: d.changed_v
|
72
|
+
pp changed_e: d.changed_e
|
73
|
+
pp deleted_v: d.deleted_v
|
74
|
+
pp deleted_e: d.deleted_e
|
75
|
+
rescue Exception => e
|
76
|
+
puts "Exception: #{ e.message }"
|
77
|
+
pp e.backtrace
|
78
|
+
nil
|
79
|
+
end
|
80
|
+
|
81
|
+
def onAfterTxCommit(db)
|
82
|
+
puts "-----------------------------------------------------------"
|
83
|
+
d = self.data
|
84
|
+
pp created_v: d.created_v
|
85
|
+
pp created_e: d.created_e
|
86
|
+
pp changed_v: d.changed_v
|
87
|
+
pp changed_e: d.changed_e
|
88
|
+
pp deleted_v: d.deleted_v
|
89
|
+
pp deleted_e: d.deleted_e
|
90
|
+
rescue Exception => e
|
91
|
+
puts "Exception: #{ e.message }"
|
92
|
+
pp e.backtrace
|
93
|
+
nil
|
94
|
+
end
|
95
|
+
end
|
58
96
|
end
|
59
97
|
end
|
60
98
|
|
data/lib/pacer-orient/graph.rb
CHANGED
@@ -6,6 +6,8 @@ require 'pacer-orient/encoder'
|
|
6
6
|
require 'pacer-orient/record_id'
|
7
7
|
require 'pacer-orient/factory_container'
|
8
8
|
require 'pacer-orient/sql_filter'
|
9
|
+
require 'pacer-orient/db_listener'
|
10
|
+
require 'pacer-orient/tx_data_wrapper'
|
9
11
|
|
10
12
|
module Pacer
|
11
13
|
module Orient
|
@@ -96,7 +98,7 @@ module Pacer
|
|
96
98
|
|
97
99
|
def on_commit(&block)
|
98
100
|
return unless block
|
99
|
-
|
101
|
+
orient_graph.registerListener(DbCommitListener.new(self, block))
|
100
102
|
end
|
101
103
|
|
102
104
|
def on_commit_failed(&block)
|
@@ -1,5 +1,20 @@
|
|
1
1
|
module Pacer
|
2
2
|
module Orient
|
3
|
+
class CachedTxDataWrapper
|
4
|
+
attr_reader :created_v, :deleted_v, :changed_v, :created_e, :deleted_e, :changed_e, :entries
|
5
|
+
|
6
|
+
def initialize(db, graph)
|
7
|
+
w = TxDataWrapper.new(db, graph)
|
8
|
+
@created_v = w.created_v
|
9
|
+
@deleted_v = w.deleted_v
|
10
|
+
@changed_v = w.changed_v
|
11
|
+
@created_e = w.created_e
|
12
|
+
@deleted_e = w.deleted_e
|
13
|
+
@changed_e = w.changed_e
|
14
|
+
@entries = w.entries
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
3
18
|
class TxDataWrapper
|
4
19
|
import com.orientechnologies.orient.core.db.record.ORecordOperation
|
5
20
|
|
@@ -73,8 +88,17 @@ module Pacer
|
|
73
88
|
def keep(op, klass)
|
74
89
|
return unless entries
|
75
90
|
entries.map do |e|
|
76
|
-
if e.type == op
|
77
|
-
|
91
|
+
if e.type == op
|
92
|
+
sc = e.getRecord.getSchemaClass
|
93
|
+
if sc
|
94
|
+
if sc.isSubClassOf(klass)
|
95
|
+
yield e.getRecord
|
96
|
+
end
|
97
|
+
else
|
98
|
+
if klass == v_base
|
99
|
+
yield e.getRecord
|
100
|
+
end
|
101
|
+
end
|
78
102
|
end
|
79
103
|
end.compact
|
80
104
|
end
|
data/lib/pacer-orient/version.rb
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
module Pacer
|
2
2
|
module Orient
|
3
|
-
VERSION = "2.
|
4
|
-
|
5
|
-
JAR_PATH = "lib/#{ JAR }"
|
6
|
-
ORIENT_VERSION = "2.0-M2"
|
7
|
-
PIPES_VERSION = "2.6.0"
|
8
|
-
PACER_REQ = ">= 1.5.4"
|
3
|
+
VERSION = "2.3.1.pre"
|
4
|
+
PACER_REQ = ">= 2.0.0.pre"
|
9
5
|
end
|
10
6
|
end
|
data/lib/pacer-orient.rb
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
require 'pacer' unless defined? Pacer
|
2
2
|
|
3
|
+
java.lang.System.setProperty("java.awt.headless", "true") unless ENV['PACER_ORIENT_HEAD']
|
4
|
+
|
3
5
|
lib_path = File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
|
4
6
|
$:.unshift lib_path unless $:.any? { |path| path == lib_path }
|
5
7
|
|
6
8
|
require 'pacer-orient/version'
|
7
9
|
|
8
|
-
require
|
10
|
+
require 'lock_jar'
|
11
|
+
LockJar.lock(File.join(File.dirname(__FILE__), "..", "Jarfile"))
|
12
|
+
LockJar.load
|
13
|
+
|
14
|
+
# Orient will kill you at the drop of a hat if you don't do this!
|
15
|
+
com.orientechnologies.orient.core.Orient.instance.removeShutdownHook
|
9
16
|
|
10
17
|
require 'pacer-orient/graph'
|
11
18
|
require 'pacer-orient/tx_data_wrapper'
|
data/pacer-orient.gemspec
CHANGED
@@ -13,10 +13,11 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.description = s.summary
|
14
14
|
|
15
15
|
s.add_dependency 'pacer', Pacer::Orient::PACER_REQ
|
16
|
+
s.add_dependency "lock_jar", "~> 0.10.0"
|
16
17
|
|
17
18
|
s.rubyforge_project = "pacer-orient"
|
18
19
|
|
19
|
-
s.files = `git ls-files`.split("\n")
|
20
|
+
s.files = `git ls-files`.split("\n")
|
20
21
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
21
22
|
s.require_paths = ["lib"]
|
22
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pacer-orient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.1.pre
|
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-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pacer
|
@@ -16,12 +16,26 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.0.pre
|
20
20
|
requirement: !ruby/object:Gem::Requirement
|
21
21
|
requirements:
|
22
22
|
- - '>='
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version:
|
24
|
+
version: 2.0.0.pre
|
25
|
+
prerelease: false
|
26
|
+
type: :runtime
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: lock_jar
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.10.0
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ~>
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: 0.10.0
|
25
39
|
prerelease: false
|
26
40
|
type: :runtime
|
27
41
|
description: Orient jars and related code for Pacer
|
@@ -33,6 +47,7 @@ extra_rdoc_files: []
|
|
33
47
|
files:
|
34
48
|
- .gitignore
|
35
49
|
- Gemfile
|
50
|
+
- Jarfile
|
36
51
|
- README.md
|
37
52
|
- Rakefile
|
38
53
|
- lib/pacer-orient.rb
|
@@ -48,9 +63,6 @@ files:
|
|
48
63
|
- lib/pacer-orient/tx_data_wrapper.rb
|
49
64
|
- lib/pacer-orient/version.rb
|
50
65
|
- pacer-orient.gemspec
|
51
|
-
- pom.xml
|
52
|
-
- pom/standalone.xml
|
53
|
-
- lib/pacer-orient-2.2.2.pre-standalone.jar
|
54
66
|
homepage: http://orientechnologies.com
|
55
67
|
licenses: []
|
56
68
|
metadata: {}
|
Binary file
|
data/pom/standalone.xml
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
<assembly>
|
2
|
-
<id>standalone</id>
|
3
|
-
<formats>
|
4
|
-
<format>jar</format>
|
5
|
-
</formats>
|
6
|
-
<includeBaseDirectory>false</includeBaseDirectory>
|
7
|
-
|
8
|
-
<fileSets>
|
9
|
-
<fileSet>
|
10
|
-
<directory>target/classes</directory>
|
11
|
-
<outputDirectory>/</outputDirectory>
|
12
|
-
</fileSet>
|
13
|
-
</fileSets>
|
14
|
-
|
15
|
-
<dependencySets>
|
16
|
-
<dependencySet>
|
17
|
-
<outputDirectory>/</outputDirectory>
|
18
|
-
<unpack>true</unpack>
|
19
|
-
<scope>runtime</scope>
|
20
|
-
</dependencySet>
|
21
|
-
</dependencySets>
|
22
|
-
</assembly>
|
data/pom.xml
DELETED
@@ -1,101 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
3
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
5
|
-
<modelVersion>4.0.0</modelVersion>
|
6
|
-
<groupId>com.xnlogic.pacer</groupId>
|
7
|
-
<artifactId>pacer-orient</artifactId>
|
8
|
-
<!-- NOTE: the following properties are automatically updated based on the values in lib/pacer-orient/version.rb -->
|
9
|
-
<properties>
|
10
|
-
<orient.version>2.0-M2</orient.version>
|
11
|
-
<gem.version>2.2.2.pre</gem.version>
|
12
|
-
<pipes.version>2.6.0</pipes.version>
|
13
|
-
</properties>
|
14
|
-
<!-- NOTE: the following properties are automatically updated based on the values in lib/pacer-orient/version.rb -->
|
15
|
-
<version>${gem.version}</version>
|
16
|
-
<packaging>pom</packaging>
|
17
|
-
<url>https://github.com/pangloss/pacer</url>
|
18
|
-
<name>Pacer Orient dependencies and related code.</name>
|
19
|
-
<description>
|
20
|
-
</description>
|
21
|
-
<inceptionYear>2011</inceptionYear>
|
22
|
-
<developers>
|
23
|
-
<developer>
|
24
|
-
<name>Darrick Wiebe</name>
|
25
|
-
<email>darrick@innatesoftware.com</email>
|
26
|
-
<url>http://github.com/pangloss</url>
|
27
|
-
</developer>
|
28
|
-
</developers>
|
29
|
-
<dependencies>
|
30
|
-
<dependency>
|
31
|
-
<groupId>com.orientechnologies</groupId>
|
32
|
-
<artifactId>orientdb-core</artifactId>
|
33
|
-
<version>${orient.version}</version>
|
34
|
-
</dependency>
|
35
|
-
<dependency>
|
36
|
-
<groupId>com.orientechnologies</groupId>
|
37
|
-
<artifactId>orientdb-graphdb</artifactId>
|
38
|
-
<version>${orient.version}</version>
|
39
|
-
</dependency>
|
40
|
-
</dependencies>
|
41
|
-
|
42
|
-
<build>
|
43
|
-
<directory>${basedir}/target</directory>
|
44
|
-
<finalName>${project.artifactId}-${project.version}</finalName>
|
45
|
-
<resources>
|
46
|
-
<resource>
|
47
|
-
<directory>${basedir}/src/main/resources
|
48
|
-
</directory>
|
49
|
-
</resource>
|
50
|
-
</resources>
|
51
|
-
<testResources>
|
52
|
-
<testResource>
|
53
|
-
<directory>${basedir}/src/test/resources
|
54
|
-
</directory>
|
55
|
-
</testResource>
|
56
|
-
</testResources>
|
57
|
-
<plugins>
|
58
|
-
<plugin>
|
59
|
-
<artifactId>maven-compiler-plugin</artifactId>
|
60
|
-
<configuration>
|
61
|
-
<source>1.6</source>
|
62
|
-
<target>1.6</target>
|
63
|
-
</configuration>
|
64
|
-
</plugin>
|
65
|
-
<plugin>
|
66
|
-
<artifactId>maven-assembly-plugin</artifactId>
|
67
|
-
<version>2.2-beta-4</version>
|
68
|
-
<executions>
|
69
|
-
<execution>
|
70
|
-
<phase>package</phase>
|
71
|
-
<goals>
|
72
|
-
<goal>attached</goal>
|
73
|
-
</goals>
|
74
|
-
</execution>
|
75
|
-
</executions>
|
76
|
-
<configuration>
|
77
|
-
<descriptors>
|
78
|
-
<descriptor>pom/standalone.xml</descriptor>
|
79
|
-
</descriptors>
|
80
|
-
<finalName>${project.artifactId}-${project.version}</finalName>
|
81
|
-
<outputDirectory>lib</outputDirectory>
|
82
|
-
<workDirectory>target/assembly/work</workDirectory>
|
83
|
-
<tarLongFileMode>warn</tarLongFileMode>
|
84
|
-
</configuration>
|
85
|
-
</plugin>
|
86
|
-
<plugin>
|
87
|
-
<groupId>org.apache.maven.plugins</groupId>
|
88
|
-
<artifactId>maven-javadoc-plugin</artifactId>
|
89
|
-
<version>2.6.1</version>
|
90
|
-
</plugin>
|
91
|
-
</plugins>
|
92
|
-
<extensions>
|
93
|
-
<extension>
|
94
|
-
<groupId>org.apache.maven.wagon</groupId>
|
95
|
-
<artifactId>wagon-ftp</artifactId>
|
96
|
-
<version>1.0-alpha-6</version>
|
97
|
-
</extension>
|
98
|
-
</extensions>
|
99
|
-
</build>
|
100
|
-
|
101
|
-
</project>
|