traject_horizon 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/traject/horizon_reader.rb +5 -16
- data/lib/traject_horizon/version.rb +1 -1
- data/traject_horizon.gemspec +1 -0
- metadata +45 -29
@@ -123,15 +123,6 @@ module Traject
|
|
123
123
|
# [jtds.jar_path] Normally we'll use a distribution of jtds bundled with this gem.
|
124
124
|
# But specify a filepath of a directory containing jtds jar(s),
|
125
125
|
# and all jars in that dir will be loaded instead of our bundled jtds.
|
126
|
-
#
|
127
|
-
#
|
128
|
-
# Note: Could probably make this even faster by using a thread pool -- the bottleneck
|
129
|
-
# is probably processing into MARC, not the database query and streaming. But it's a
|
130
|
-
# bit tricky to refactor for concurrency there. Perhaps pull all the raw
|
131
|
-
# row values out and batch them in groups by bib#, then feed those lists
|
132
|
-
# to a threadpool. And then we'd just be fighting for CPU time with the
|
133
|
-
# threadpool for mapping, not sure if overall throughput increase would happen, would
|
134
|
-
# depend on exact environment.
|
135
126
|
class HorizonReader
|
136
127
|
attr_reader :settings
|
137
128
|
attr_reader :things_to_close
|
@@ -145,7 +136,11 @@ module Traject
|
|
145
136
|
|
146
137
|
require_jars!
|
147
138
|
|
148
|
-
|
139
|
+
pool_size = settings["horizon.thread_pool"].to_i
|
140
|
+
|
141
|
+
logger.debug("HorizonReader with thread pool size #{pool_size}")
|
142
|
+
|
143
|
+
@thread_pool = Traject::ThreadPool.new( pool_size )
|
149
144
|
end
|
150
145
|
|
151
146
|
# Requires marc4j and jtds, and java_import's some classes.
|
@@ -309,8 +304,6 @@ module Traject
|
|
309
304
|
@thread_pool.maybe_in_thread_pool(batch) do |batch|
|
310
305
|
enhance_batch!(extra_connection, batch)
|
311
306
|
batch.each do |r|
|
312
|
-
# set current_bib_id for error logging
|
313
|
-
current_bib_id = r['001'].value
|
314
307
|
yield r
|
315
308
|
end
|
316
309
|
end
|
@@ -428,10 +421,6 @@ module Traject
|
|
428
421
|
logger.info("HorizonReader: Closed JDBC objects")
|
429
422
|
end
|
430
423
|
|
431
|
-
def process_batch(batch)
|
432
|
-
|
433
|
-
end
|
434
|
-
|
435
424
|
# Pass in an array of MARC::Records', adds fields for copy and item
|
436
425
|
# info if so configured. Returns record_batch so you can chain if you want.
|
437
426
|
def enhance_batch!(conn, record_batch)
|
data/traject_horizon.gemspec
CHANGED
metadata
CHANGED
@@ -1,65 +1,81 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traject_horizon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
4
|
+
version: 0.10.1
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jonathan Rochkind
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
date: 2013-09-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: traject
|
16
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
17
18
|
requirements:
|
18
|
-
- - '>='
|
19
|
+
- - ! '>='
|
19
20
|
- !ruby/object:Gem::Version
|
20
21
|
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
25
|
none: false
|
22
|
-
requirement: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - '>='
|
27
|
+
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '0'
|
27
|
-
none: false
|
28
|
-
prerelease: false
|
29
|
-
type: :runtime
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: bundler
|
32
|
-
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
33
34
|
requirements:
|
34
35
|
- - ~>
|
35
36
|
- !ruby/object:Gem::Version
|
36
37
|
version: '1.3'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
41
|
none: false
|
38
|
-
requirement: !ruby/object:Gem::Requirement
|
39
42
|
requirements:
|
40
43
|
- - ~>
|
41
44
|
- !ruby/object:Gem::Version
|
42
45
|
version: '1.3'
|
43
|
-
none: false
|
44
|
-
prerelease: false
|
45
|
-
type: :development
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
47
|
name: rake
|
48
|
-
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
49
50
|
requirements:
|
50
|
-
- - '>='
|
51
|
+
- - ! '>='
|
51
52
|
- !ruby/object:Gem::Version
|
52
53
|
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
57
|
none: false
|
54
|
-
requirement: !ruby/object:Gem::Requirement
|
55
58
|
requirements:
|
56
|
-
- - '>='
|
59
|
+
- - ! '>='
|
57
60
|
- !ruby/object:Gem::Version
|
58
61
|
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: minitest
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
59
65
|
none: false
|
60
|
-
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
61
70
|
type: :development
|
62
|
-
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description:
|
63
79
|
email:
|
64
80
|
- jonathan@dnil.net
|
65
81
|
executables: []
|
@@ -83,26 +99,26 @@ files:
|
|
83
99
|
homepage: http://github.com/jrochkind/traject_horizon
|
84
100
|
licenses:
|
85
101
|
- MIT
|
86
|
-
post_install_message:
|
102
|
+
post_install_message:
|
87
103
|
rdoc_options: []
|
88
104
|
require_paths:
|
89
105
|
- lib
|
90
106
|
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
91
108
|
requirements:
|
92
|
-
- - '>='
|
109
|
+
- - ! '>='
|
93
110
|
- !ruby/object:Gem::Version
|
94
111
|
version: '0'
|
95
|
-
none: false
|
96
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
97
114
|
requirements:
|
98
|
-
- - '>='
|
115
|
+
- - ! '>='
|
99
116
|
- !ruby/object:Gem::Version
|
100
117
|
version: '0'
|
101
|
-
none: false
|
102
118
|
requirements: []
|
103
|
-
rubyforge_project:
|
104
|
-
rubygems_version: 1.8.
|
105
|
-
signing_key:
|
119
|
+
rubyforge_project:
|
120
|
+
rubygems_version: 1.8.23
|
121
|
+
signing_key:
|
106
122
|
specification_version: 3
|
107
123
|
summary: Horizon ILS MARC Exporter, a plugin for the traject tool
|
108
124
|
test_files:
|