Class: Arv::Collection::StreamManifest

Inherits:
Object
  • Object
show all
Defined in:
lib/arvados/collection.rb

Instance Method Summary collapse

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.



482
483
484
485
486
487
# File 'lib/arvados/collection.rb', line 482

def initialize(name)
  @name = name
  @loc_ranges = []
  @loc_range_start = 0
  @file_specs = []
end

Instance Method Details

#add_file(coll_file) ⇒ Object



489
490
491
492
493
# File 'lib/arvados/collection.rb', line 489

def add_file(coll_file)
  coll_file.each_segment do |segment|
    extend_file_specs(coll_file.name, segment)
  end
end

#to_sObject



495
496
497
498
499
500
501
502
503
# File 'lib/arvados/collection.rb', line 495

def to_s
  if @file_specs.empty?
    ""
  else
    "%s %s %s\n" % [escape_name(@name),
                    @loc_ranges.collect(&:locator).join(" "),
                    @file_specs.join(" ")]
  end
end