uricp 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/Gemfile.lock +1 -8
- data/Jenkinsfile +27 -0
- data/Rakefile +19 -36
- data/bionic/Dockerfile +2 -2
- data/centos7/Dockerfile +2 -2
- data/features/step_definitions/orbit_steps.rb +11 -4
- data/lib/segment_upload.rb +20 -22
- data/lib/uricp.rb +3 -3
- data/lib/uricp/curl_primitives.rb +31 -33
- data/lib/uricp/orbit_auth.rb +23 -27
- data/lib/uricp/segmenter.rb +12 -16
- data/lib/uricp/strategy/cache_common.rb +11 -11
- data/lib/uricp/strategy/cached_get.rb +14 -20
- data/lib/uricp/strategy/cleaner.rb +2 -8
- data/lib/uricp/strategy/common.rb +25 -18
- data/lib/uricp/strategy/local_convert.rb +9 -16
- data/lib/uricp/strategy/local_link.rb +10 -8
- data/lib/uricp/strategy/piped_cache.rb +7 -13
- data/lib/uricp/strategy/piped_cache_convert.rb +14 -18
- data/lib/uricp/strategy/piped_compress.rb +3 -8
- data/lib/uricp/strategy/piped_decompress.rb +7 -11
- data/lib/uricp/strategy/piped_local_compress.rb +0 -4
- data/lib/uricp/strategy/piped_local_decompress.rb +10 -16
- data/lib/uricp/strategy/piped_local_get.rb +0 -5
- data/lib/uricp/strategy/piped_local_put.rb +3 -9
- data/lib/uricp/strategy/piped_rbd_get.rb +44 -0
- data/lib/uricp/strategy/piped_remote_get.rb +20 -20
- data/lib/uricp/strategy/rbd_remote_put.rb +36 -0
- data/lib/uricp/strategy/rbd_sweeper.rb +22 -0
- data/lib/uricp/strategy/remote_put.rb +11 -17
- data/lib/uricp/strategy/segmented_remote_put.rb +16 -28
- data/lib/uricp/strategy/sweeper.rb +2 -8
- data/lib/uricp/uri_strategy.rb +14 -13
- data/lib/uricp/version.rb +2 -2
- data/trusty/Dockerfile +2 -2
- data/uricp.gemspec +0 -1
- data/xenial/Dockerfile +2 -2
- metadata +7 -20
- data/spec/something_spec.rb +0 -5
@@ -1,13 +1,10 @@
|
|
1
1
|
module Uricp::Strategy
|
2
|
-
|
3
2
|
class Sweeper
|
4
|
-
|
5
3
|
include Uricp::Strategy::Common
|
6
4
|
|
7
5
|
def appropriate?
|
8
|
-
if options['sweep'] && sequence_complete?
|
9
|
-
|
10
|
-
end
|
6
|
+
return proposal if options['sweep'] && sequence_complete?
|
7
|
+
|
11
8
|
debug "#{self.class.name}: not appropriate"
|
12
9
|
false
|
13
10
|
end
|
@@ -21,8 +18,5 @@ module Uricp::Strategy
|
|
21
18
|
@proposed_options.delete('sweep')
|
22
19
|
self
|
23
20
|
end
|
24
|
-
|
25
21
|
end
|
26
|
-
|
27
22
|
end
|
28
|
-
|
data/lib/uricp/uri_strategy.rb
CHANGED
@@ -1,20 +1,21 @@
|
|
1
1
|
require 'uri'
|
2
2
|
|
3
3
|
module Uricp
|
4
|
-
|
5
4
|
class UriStrategy
|
6
|
-
|
7
5
|
include Methadone::CLILogging
|
8
6
|
|
9
7
|
def self.choose_strategy(options)
|
10
|
-
current = options.reject {|k,
|
8
|
+
current = options.reject { |k, _v| k.is_a? Symbol }
|
11
9
|
strategy_list = []
|
12
|
-
while STRATEGIES.detect {|klass| @strategy = klass.new(current).appropriate? }
|
13
|
-
|
10
|
+
while STRATEGIES.detect { |klass| @strategy = klass.new(current).appropriate? }
|
11
|
+
debug "#{name}: Selected strategy #{@strategy.class.name}"
|
14
12
|
strategy_list << @strategy
|
15
|
-
|
13
|
+
current = @strategy.proposed_options
|
14
|
+
end
|
15
|
+
if incomplete_strategy?(strategy_list)
|
16
|
+
raise Uricp::UnsupportedURLtype, "Unsupported transfer from #{options['from_uri']} to #{options['to_uri']}"
|
16
17
|
end
|
17
|
-
|
18
|
+
|
18
19
|
strategy_list
|
19
20
|
end
|
20
21
|
|
@@ -22,12 +23,11 @@ module Uricp
|
|
22
23
|
list.empty?
|
23
24
|
end
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
#This is an ordered list from the most specific to the most general
|
26
|
+
# This is an ordered list from the most specific to the most general
|
28
27
|
STRATEGIES = [
|
29
28
|
Strategy::CachedGet,
|
30
29
|
Strategy::PipedRemoteGet,
|
30
|
+
Strategy::PipedRbdGet,
|
31
31
|
Strategy::PipedCacheConvert,
|
32
32
|
Strategy::PipedCache,
|
33
33
|
Strategy::PipedLocalDecompress,
|
@@ -35,14 +35,15 @@ module Uricp
|
|
35
35
|
Strategy::LocalConvert,
|
36
36
|
Strategy::LocalLink,
|
37
37
|
Strategy::PipedCompress,
|
38
|
+
Strategy::RbdRemotePut,
|
38
39
|
Strategy::SegmentedRemotePut,
|
39
40
|
Strategy::RemotePut,
|
40
41
|
Strategy::PipedLocalCompress,
|
41
42
|
Strategy::PipedLocalGet,
|
42
43
|
Strategy::PipedLocalPut,
|
43
44
|
Strategy::Cleaner,
|
44
|
-
Strategy::
|
45
|
-
|
46
|
-
|
45
|
+
Strategy::RbdSweeper,
|
46
|
+
Strategy::Sweeper
|
47
|
+
].freeze
|
47
48
|
end
|
48
49
|
end
|
data/lib/uricp/version.rb
CHANGED
data/trusty/Dockerfile
CHANGED
@@ -13,8 +13,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
|
|
13
13
|
curl \
|
14
14
|
ruby1.9.3 \
|
15
15
|
ruby-dev \
|
16
|
-
python-swiftclient
|
16
|
+
python-swiftclient \
|
17
|
+
ruby-bundler
|
17
18
|
|
18
19
|
RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
|
19
|
-
RUN gem install bundler
|
20
20
|
|
data/uricp.gemspec
CHANGED
@@ -27,6 +27,5 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_dependency('open4', '~> 1.3.0')
|
28
28
|
spec.add_dependency('filesize', '= 0.0.2')
|
29
29
|
spec.add_dependency('sendfile', '~> 1.2.0')
|
30
|
-
spec.add_development_dependency('rspec', '~> 2.99')
|
31
30
|
spec.add_development_dependency('inifile', '~> 1.1')
|
32
31
|
end
|
data/xenial/Dockerfile
CHANGED
@@ -13,8 +13,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
|
|
13
13
|
curl \
|
14
14
|
ruby \
|
15
15
|
ruby-dev \
|
16
|
-
python-swiftclient
|
16
|
+
python-swiftclient \
|
17
|
+
ruby-bundler
|
17
18
|
|
18
19
|
RUN echo "gem: --no-ri --no-rdoc" >> "$HOME/.gemrc"
|
19
|
-
RUN gem install bundler
|
20
20
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uricp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neil Wilson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -136,20 +136,6 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 1.2.0
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: rspec
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '2.99'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - "~>"
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '2.99'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: inifile
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,6 +160,7 @@ extensions: []
|
|
174
160
|
extra_rdoc_files: []
|
175
161
|
files:
|
176
162
|
- ".gitignore"
|
163
|
+
- ".rubocop.yml"
|
177
164
|
- Gemfile
|
178
165
|
- Gemfile.lock
|
179
166
|
- Jenkinsfile
|
@@ -215,13 +202,15 @@ files:
|
|
215
202
|
- lib/uricp/strategy/piped_local_decompress.rb
|
216
203
|
- lib/uricp/strategy/piped_local_get.rb
|
217
204
|
- lib/uricp/strategy/piped_local_put.rb
|
205
|
+
- lib/uricp/strategy/piped_rbd_get.rb
|
218
206
|
- lib/uricp/strategy/piped_remote_get.rb
|
207
|
+
- lib/uricp/strategy/rbd_remote_put.rb
|
208
|
+
- lib/uricp/strategy/rbd_sweeper.rb
|
219
209
|
- lib/uricp/strategy/remote_put.rb
|
220
210
|
- lib/uricp/strategy/segmented_remote_put.rb
|
221
211
|
- lib/uricp/strategy/sweeper.rb
|
222
212
|
- lib/uricp/uri_strategy.rb
|
223
213
|
- lib/uricp/version.rb
|
224
|
-
- spec/something_spec.rb
|
225
214
|
- trusty/Dockerfile
|
226
215
|
- uricp.gemspec
|
227
216
|
- xenial/Dockerfile
|
@@ -244,8 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
233
|
- !ruby/object:Gem::Version
|
245
234
|
version: '0'
|
246
235
|
requirements: []
|
247
|
-
|
248
|
-
rubygems_version: 2.7.6
|
236
|
+
rubygems_version: 3.1.2
|
249
237
|
signing_key:
|
250
238
|
specification_version: 4
|
251
239
|
summary: Copy one URL to another with optional cacheing
|
@@ -261,4 +249,3 @@ test_files:
|
|
261
249
|
- features/step_definitions/uricp_steps.rb
|
262
250
|
- features/support/env.rb
|
263
251
|
- features/userid_download.feature
|
264
|
-
- spec/something_spec.rb
|