lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-0.8.2 vs lib/fluent/plugin/out_s3.rb in fluent-plugin-s3-0.8.3

- old
+ new

@@ -120,10 +120,12 @@ config_param :compute_checksums, :bool, :default => nil # use nil to follow SDK default configuration desc "Signature version for API Request (s3,v4)" config_param :signature_version, :string, :default => nil # use nil to follow SDK default configuration desc "Given a threshold to treat events as delay, output warning logs if delayed events were put into s3" config_param :warn_for_delay, :time, :default => nil + desc "Directory for temporary files, instead of system temp directory." + config_param :tmp_dir, :string, :default => nil attr_reader :bucket MAX_HEX_RANDOM_LENGTH = 16 @@ -251,11 +253,11 @@ s3path = @s3_object_key_format.gsub(%r(%{[^}]+})) { |expr| values_for_s3_object_key[expr[2...expr.size-1]] } end - tmp = Tempfile.new("s3-") + tmp = Tempfile.new("s3-", @tmp_dir) tmp.binmode begin @compressor.compress(chunk, tmp) tmp.rewind log.debug { "out_s3: write chunk: {key:#{chunk.key},tsuffix:#{tsuffix(chunk)}} to s3://#{@s3_bucket}/#{s3path}" } @@ -400,9 +402,11 @@ options end class Compressor include Configurable + + config_param :tmp_dir, :string, :default => nil def initialize(opts = {}) super() @buffer_type = opts[:buffer_type] @log = opts[:log]