arvados 1.4.1.20190320201707 → 1.4.1.20191121213920
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arvados/collection.rb +37 -41
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15d77091d345a4654eddc8ae00a34ddf693b42fb
|
4
|
+
data.tar.gz: 978f05f368380307ee5152edbb23c224791d0b4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7f48920c909fd7806db28313977002ccc75dece4ee97e9fdf8971387e9472ba8d7391cbc40e3dd84ec3d2ac5904938af09342130cda756f18fbbf4a0927aac2
|
7
|
+
data.tar.gz: 7ee63c14697c6276fd6d33ff982b552e869e4459dbe702173324911b7892dc352aa079d658effcd58810ebdc058ae136b008c2d5073314a9c651db5f1ccaa895
|
data/lib/arvados/collection.rb
CHANGED
@@ -207,7 +207,7 @@ module Arv
|
|
207
207
|
loop do
|
208
208
|
ii = (lo + hi) / 2
|
209
209
|
range = @ranges[ii]
|
210
|
-
if range.include?(target)
|
210
|
+
if range.include?(target) && (target < range.end || ii == hi-1)
|
211
211
|
return ii
|
212
212
|
elsif ii == lo
|
213
213
|
raise RangeError.new("%i not in segment" % target)
|
@@ -481,14 +481,13 @@ module Arv
|
|
481
481
|
|
482
482
|
def initialize(name)
|
483
483
|
@name = name
|
484
|
-
@loc_ranges =
|
484
|
+
@loc_ranges = []
|
485
485
|
@loc_range_start = 0
|
486
486
|
@file_specs = []
|
487
487
|
end
|
488
488
|
|
489
489
|
def add_file(coll_file)
|
490
490
|
coll_file.each_segment do |segment|
|
491
|
-
extend_locator_ranges(segment.locators)
|
492
491
|
extend_file_specs(coll_file.name, segment)
|
493
492
|
end
|
494
493
|
end
|
@@ -498,48 +497,51 @@ module Arv
|
|
498
497
|
""
|
499
498
|
else
|
500
499
|
"%s %s %s\n" % [escape_name(@name),
|
501
|
-
@loc_ranges.
|
500
|
+
@loc_ranges.collect(&:locator).join(" "),
|
502
501
|
@file_specs.join(" ")]
|
503
502
|
end
|
504
503
|
end
|
505
504
|
|
506
505
|
private
|
507
506
|
|
508
|
-
def
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
507
|
+
def extend_file_specs(filename, segment)
|
508
|
+
found_overlap = false
|
509
|
+
# Find the longest prefix of segment.locators that's a suffix
|
510
|
+
# of the existing @loc_ranges. If we find one, drop those
|
511
|
+
# locators (they'll be added back below, when we're handling
|
512
|
+
# the normal/no-overlap case).
|
513
|
+
(1..segment.locators.length).each do |overlap|
|
514
|
+
if @loc_ranges.length >= overlap && @loc_ranges[-overlap..-1].collect(&:locator) == segment.locators[0..overlap-1]
|
515
|
+
(1..overlap).each do
|
516
|
+
discarded = @loc_ranges.pop
|
517
|
+
@loc_range_start -= (discarded.end - discarded.begin)
|
518
|
+
end
|
519
|
+
found_overlap = true
|
520
|
+
break
|
521
|
+
end
|
514
522
|
end
|
515
|
-
end
|
516
523
|
|
517
|
-
|
518
|
-
#
|
519
|
-
#
|
520
|
-
#
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
segment.locators[1..-1].each do |loc_s|
|
529
|
-
range = @loc_ranges[loc_s]
|
530
|
-
if range.begin != @loc_ranges[prev_loc].end
|
531
|
-
range_start, range_length =
|
532
|
-
start_and_length_at(start_loc, prev_loc, start_pos, length)
|
533
|
-
@file_specs << "#{range_start}:#{range_length}:#{filename}"
|
534
|
-
start_pos = 0
|
535
|
-
length -= range_length
|
536
|
-
start_loc = loc_s
|
524
|
+
# If there was no overlap at the end of our existing
|
525
|
+
# @loc_ranges, check whether the full set of segment.locators
|
526
|
+
# appears earlier in @loc_ranges. If so, use those instead of
|
527
|
+
# appending the same locators again.
|
528
|
+
if !found_overlap && segment.locators.length < @loc_ranges.length
|
529
|
+
segment_start = 0
|
530
|
+
(0..@loc_ranges.length-1).each do |ri|
|
531
|
+
if @loc_ranges[ri..ri+segment.locators.length-1].collect(&:locator) == segment.locators
|
532
|
+
@file_specs << "#{segment.start_pos + @loc_ranges[ri].begin}:#{segment.length}:#{escape_name(filename)}"
|
533
|
+
return
|
534
|
+
end
|
537
535
|
end
|
538
|
-
prev_loc = loc_s
|
539
536
|
end
|
540
|
-
|
541
|
-
|
542
|
-
|
537
|
+
|
538
|
+
segment_start = @loc_range_start
|
539
|
+
segment.locators.each do |loc_s|
|
540
|
+
r = LocatorRange.new(loc_s, @loc_range_start)
|
541
|
+
@loc_ranges << r
|
542
|
+
@loc_range_start = r.end
|
543
|
+
end
|
544
|
+
@file_specs << "#{segment.start_pos + segment_start}:#{segment.length}:#{escape_name(filename)}"
|
543
545
|
end
|
544
546
|
|
545
547
|
def escape_name(name)
|
@@ -547,12 +549,6 @@ module Arv
|
|
547
549
|
s.each_byte.map { |c| "\\%03o" % c }.join("")
|
548
550
|
end
|
549
551
|
end
|
550
|
-
|
551
|
-
def start_and_length_at(start_key, end_key, start_pos, length)
|
552
|
-
range_begin = @loc_ranges[start_key].begin + start_pos
|
553
|
-
range_length = [@loc_ranges[end_key].end - range_begin, length].min
|
554
|
-
[range_begin, range_length]
|
555
|
-
end
|
556
552
|
end
|
557
553
|
end
|
558
554
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arvados
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.1.
|
4
|
+
version: 1.4.1.20191121213920
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arvados Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -98,6 +98,20 @@ dependencies:
|
|
98
98
|
- - "<"
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '3'
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: faraday
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - "<"
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0.16'
|
108
|
+
type: :runtime
|
109
|
+
prerelease: false
|
110
|
+
version_requirements: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - "<"
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0.16'
|
101
115
|
- !ruby/object:Gem::Dependency
|
102
116
|
name: jwt
|
103
117
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,7 +132,7 @@ dependencies:
|
|
118
132
|
- - ">="
|
119
133
|
- !ruby/object:Gem::Version
|
120
134
|
version: 0.1.5
|
121
|
-
description: Arvados client library, git commit
|
135
|
+
description: Arvados client library, git commit 40eb23ae00935f93310051e659201f9f7738c0a0
|
122
136
|
email: gem-dev@curoverse.com
|
123
137
|
executables: []
|
124
138
|
extensions: []
|