logstash-output-qingstor 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fe51f69908599f882c6ac6b6a9afc08e0770b8bffda5679ab83ac5e5acf94dc
4
- data.tar.gz: 0d499a3d20bf83f0a39d22663077cf13a92d0bfb8281d8aca848914665c07a21
3
+ metadata.gz: 46170bdbbd13271afd875490c56b4d77dc2bed5dac63a63030b69dff5895f78d
4
+ data.tar.gz: 8b7d9bd379b57980e61fd2b20475bc12181d7154c701de0d4f5af224e2defc47
5
5
  SHA512:
6
- metadata.gz: 9c1959265a7e30b3777e09135c69013f1e70332e8772893d1d142f7fc7f0a4fb03a1f5f6409b0585766129c39617bb544f79997869dea7f9a77ec83c3e082f4d
7
- data.tar.gz: '058d9cb15d999c055fe5cb8b1333dc59064861923b4f15a865fc43ceaf7f4fb6f798ceb8f3956fb6f07e46801da8eade2b2fd1c67688d7ca0ab4156af33244fb'
6
+ metadata.gz: 171d450378ab1852dddb0815e01d9d4f0c964a8fd81c5974cb17bfbd152fbe9fe7ebcb439c9491f598c7cfa9eb4e2ff329cd5404932e7ae3320ca070775635e1
7
+ data.tar.gz: b8a50149df4fd8e6e3b526eb99188559a4cca0c3f1c96a65bbb1578b2b4c3d5f11d2c108edee81f82e557f4d98c385fa7d74109eb105e018bc983ab79195ea40
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.2.7
2
+ - Fix: filter empty file and large file while restoring
3
+
1
4
  ## 0.2.6
2
5
  - Fix: swap uuid and date of the file name for sorting
3
6
 
@@ -256,13 +256,21 @@ class LogStash::Outputs::Qingstor < LogStash::Outputs::Base
256
256
  .each do |file|
257
257
  temp_file = TemporaryFile.create_from_existing_file(file,
258
258
  temp_folder_path)
259
- @logger.debug('Recoving from crash and uploading',
259
+
260
+ # Restoring too large file would cause java heap out of memory
261
+ if temp_file.size > 0 && temp_file.size < 100 * 1024 * 1024
262
+ @logger.debug('Recoving from crash and uploading',
263
+ :file => temp_file.path)
264
+ @crash_uploader.upload_async(
265
+ temp_file,
266
+ :on_complete => method(:clean_temporary_file),
267
+ :upload_options => upload_options
268
+ )
269
+ elsif temp_file.size == 0
270
+ @logger.debug('Recoving from crash, delete empty files',
260
271
  :file => temp_file.path)
261
- @crash_uploader.upload_async(
262
- temp_file,
263
- :on_complete => method(:clean_temporary_file),
264
- :upload_options => upload_options
265
- )
272
+ temp_file.delete!
273
+ end
266
274
  end
267
275
  end
268
276
  end # class LogStash::Outputs::Qingstor
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-output-qingstor'
3
- s.version = '0.2.6'
3
+ s.version = '0.2.7'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = 'logstash output plugin for qingstor'
6
6
  s.description = 'Collect the outputs of logstash and store into QingStor'
@@ -44,12 +44,11 @@ describe LogStash::Outputs::Qingstor do
44
44
  end
45
45
 
46
46
  it 'upload existing file if turn on restore function' do
47
- unless File.exist?(File.join(tmpdir, 'uuid_dir'))
48
- FileUtils.mkdir_p(File.join(tmpdir, 'uuid_dir'))
49
- end
50
- f = File.open(File.join(tmpdir, 'uuid_dir/temp'), 'w')
51
- f.write(event_encoded * 10)
52
- f.close
47
+ non_empty_file = File.open(File.join(tmpdir, 'non-empty-file'), 'w')
48
+ non_empty_file.write(event_encoded * 10)
49
+ non_empty_file.close
50
+ empty_file = File.open(File.join(tmpdir, 'empty-file'), 'w')
51
+ empty_file.close
53
52
  fetch_event(options.merge('restore' => true, 'tmpdir' => tmpdir),
54
53
  events_and_encoded)
55
54
  expect(list_remote_file.size).to eq(2)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-qingstor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Zhao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-01 00:00:00.000000000 Z
11
+ date: 2017-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement