Class: Redshifter::Util::S3ManifestWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/redshifter/util/s3_manifest_writer.rb

Instance Method Summary collapse

Constructor Details

#initialize(file_name:, file_urls:, s3_util:) ⇒ S3ManifestWriter

Returns a new instance of S3ManifestWriter.



4
5
6
7
8
# File 'lib/redshifter/util/s3_manifest_writer.rb', line 4

def initialize(file_name:, file_urls:, s3_util:)
  @file_name = file_name
  @file_urls = file_urls
  @s3_util = s3_util
end

Instance Method Details

#runObject

Uploads a s3 manifest file that requires all files be processed with mandatory: true attribute per file. Returns internal s3 URL for the manifest



13
14
15
16
17
18
19
# File 'lib/redshifter/util/s3_manifest_writer.rb', line 13

def run
  s3_util.upload_file(
    file_name: file_name,
    body: JSON.generate(manifest),
    gzip: false
  )
end