Class: Arv::Collection::StreamManifest
- Inherits:
-
Object
- Object
- Arv::Collection::StreamManifest
- Defined in:
- lib/arvados/collection.rb
Instance Method Summary collapse
- #add_file(coll_file) ⇒ Object
-
#initialize(name) ⇒ StreamManifest
constructor
Build a manifest text for a single stream, without substreams.
- #to_s ⇒ Object
Constructor Details
#initialize(name) ⇒ StreamManifest
Build a manifest text for a single stream, without substreams. The manifest includes files in the order they're added. If you want a normalized manifest, add files in lexical order by name.
470 471 472 473 474 475 |
# File 'lib/arvados/collection.rb', line 470 def initialize(name) @name = name @loc_ranges = {} @loc_range_start = 0 @file_specs = [] end |
Instance Method Details
#add_file(coll_file) ⇒ Object
477 478 479 480 481 482 |
# File 'lib/arvados/collection.rb', line 477 def add_file(coll_file) coll_file.each_segment do |segment| extend_locator_ranges(segment.locators) extend_file_specs(coll_file.name, segment) end end |
#to_s ⇒ Object
484 485 486 487 488 489 490 491 492 |
# File 'lib/arvados/collection.rb', line 484 def to_s if @file_specs.empty? "" else "%s %s %s\n" % [escape_name(@name), @loc_ranges.keys.join(" "), @file_specs.join(" ")] end end |