logstash-input-sls 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2a8e6695f8cf69c82eb4e84689fc0f89c7fda3119b5b6dfbdbf88adf2c5f9e4
4
- data.tar.gz: cef6c6d769c53e5324b81f1a496313cdc04ddd9764ad81578fa145c72545ef59
3
+ metadata.gz: c1506f164f61b678ba0b725eaea73835b1d3fbfcd4c7cb6214dc5c1d8330e403
4
+ data.tar.gz: 317cb1d5c66921f4b118931004e4d14e511ed0b694877baf594b7c5a5dd759e2
5
5
  SHA512:
6
- metadata.gz: 5cdca931fecd03db3801789913a16976d0a629debee8b2beed7baf7eb8350ee4f2f4234c3ba796154b34b024f34fed58ad7d511895d27c606a9bfd00b7ce64a3
7
- data.tar.gz: 26e58129b322a360a9c01d72f977ce1e150eda8ca30ccc2e60a3cf52c80dd6acbf8e3d2ad9ec2fd123bd8b7bba6a7cb1345bdf12e7ffd79050600ca9e49a65b4
6
+ metadata.gz: 5e5ef91e46893fd8fba30fad9cc917164b77020fecbc6983e7ffd2c6dd66256d8738d435b881bb9162bd967818053fdbbf42f54f10d3767232d7da9f3312939c
7
+ data.tar.gz: b3814d76424b61261a99b8a1ed9751d4166652f894f55f4ac031cfca3bef1f505f7b9487a25a338c9282a31fb62ed837fe93cdc748c23a80afdd055dd20fd831
data/Gemfile CHANGED
@@ -1,2 +1,2 @@
1
- source 'https://gems.ruby-china.com'
1
+ source 'https://rubygems.org/'
2
2
  gemspec
@@ -13,7 +13,7 @@ java_import 'com.aliyun.log.logstash.LogHubStarter'
13
13
  java_import 'com.aliyun.log.logstash.LogstashLogHubProcessor'
14
14
 
15
15
  class LogStash::Inputs::LogService < LogStash::Inputs::Base
16
- attr_accessor :worker
16
+ # attr_accessor :worker
17
17
  def initialize(*args)
18
18
  super(*args)
19
19
  end
@@ -43,7 +43,7 @@ class LogStash::Inputs::LogService < LogStash::Inputs::Base
43
43
 
44
44
  config :fetch_interval_millis, :validate => :number, :default => 200
45
45
 
46
- Processor = com.aliyun.log.logstash
46
+ # Processor = com.aliyun.log.logstash
47
47
  public
48
48
  def register
49
49
  @logger.info("Init logstash-input-logservice", :endpoint => @endpoint, :project => @project, :logstore => @logstore,
@@ -58,10 +58,14 @@ class LogStash::Inputs::LogService < LogStash::Inputs::Base
58
58
  @ip_suffix = '_' + @local_address
59
59
  end
60
60
  @process_pid = "_#{Process.pid}"
61
- @logger.info("Running logstash-input-logservice",:local_address => @local_address)
61
+ @logger.info("Running logstash-input-logservice", :endpoint => @endpoint, :project => @project,
62
+ :logstore => @logstore, :consumer_group => @consumer_group, :consumer_name => @consumer_name,
63
+ :position => @position, :checkpoint_second => @checkpoint_second, :include_meta => @include_meta,
64
+ :consumer_name_with_ip => @consumer_name_with_ip, :local_address => @local_address)
62
65
  @blockingQueue = java.util.concurrent.LinkedBlockingQueue.new(1000)
63
- LogHubStarter.startWorker(@endpoint, @access_id, @access_key, @project, @logstore, @consumer_group, @consumer_name + @ip_suffix + @process_pid, @position, @checkpoint_second, @include_meta, @blockingQueue, @proxy_host, @proxy_port, @proxy_username, @proxy_password, @proxy_domain, @proxy_workstation, @fetch_interval_millis)
64
-
66
+ @logHubStarter = LogHubStarter.new()
67
+ @logHubStarter.startWorker(@endpoint, @access_id, @access_key, @project, @logstore, @consumer_group, @consumer_name + @ip_suffix + @process_pid, @position, @checkpoint_second, @include_meta, @blockingQueue, @proxy_host, @proxy_port, @proxy_username, @proxy_password, @proxy_domain, @proxy_workstation, @fetch_interval_millis)
68
+
65
69
  consume(queue)
66
70
 
67
71
  rescue Exception => e
@@ -70,7 +74,7 @@ class LogStash::Inputs::LogService < LogStash::Inputs::Base
70
74
  :checkpoint_second => @checkpoint_second, :include_meta => @include_meta, :consumer_name_with_ip => @consumer_name_with_ip, :exception => e)
71
75
 
72
76
  end
73
-
77
+
74
78
  def consume(queue)
75
79
  while !stop?
76
80
  while !@blockingQueue.isEmpty
@@ -86,17 +90,12 @@ class LogStash::Inputs::LogService < LogStash::Inputs::Base
86
90
  retry
87
91
  end
88
92
  end
89
- Stud.stoppable_sleep(@checkpoint_second) { stop? }
93
+ sleep(0.01)
90
94
  end # loop
91
95
 
92
- end
93
-
96
+ end
94
97
  def stop
95
- # nothing to do in this case so it is not necessary to define stop
96
- # examples of common "stop" tasks:
97
- # * close sockets (unblocking blocking reads/accepts)
98
- # * cleanup temporary files
99
- # * terminate spawned threads
98
+ @logHubStarter.stopWorker()
100
99
  end
101
100
 
102
101
  def teardown
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-sls'
3
- s.version = '0.0.14'
3
+ s.version = '0.0.16'
4
4
  s.licenses = ['MIT']
5
5
  s.summary = "This sls input streams a string at a definable interval."
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-sls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - lichao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-22 00:00:00.000000000 Z
11
+ date: 2023-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api