Skip to content

Commit dbff78c

Browse files
committed
Update references
Change references to opensearch in comments, documentation and other places. Signed-off-by: Vijayan Balasubramanian <[email protected]>
1 parent 7de04ba commit dbff78c

File tree

12 files changed

+22
-23
lines changed

12 files changed

+22
-23
lines changed

lib/logstash/outputs/opensearch/http_client/pool.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ def sniff!
168168
update_urls(check_sniff)
169169
end
170170

171-
ES1_SNIFF_RE_URL = /\[([^\/]*)?\/?([^:]*):([0-9]+)\]/
172-
ES2_AND_ABOVE_SNIFF_RE_URL = /([^\/]*)?\/?([^:]*):([0-9]+)/
171+
SNIFF_RE_URL = /([^\/]*)?\/?([^:]*):([0-9]+)/
173172
# Sniffs and returns the results. Does not update internal URLs!
174173
def check_sniff
175174
_, url_meta, resp = perform_request(:get, @sniffing_path)
@@ -197,7 +196,7 @@ def sniff(nodes)
197196
end
198197

199198
def address_str_to_uri(addr_str)
200-
matches = addr_str.match(ES1_SNIFF_RE_URL) || addr_str.match(ES2_AND_ABOVE_SNIFF_RE_URL)
199+
matches = addr_str.match(SNIFF_RE_URL)
201200
if matches
202201
host = matches[1].empty? ? matches[2] : matches[1]
203202
::LogStash::Util::SafeURI.new("#{host}:#{matches[3]}")
@@ -221,7 +220,7 @@ def start_resurrectionist
221220
end
222221

223222
def health_check_request(url)
224-
logger.debug("Running health check to see if an ES connection is working", url: url.sanitized.to_s, path: @healthcheck_path)
223+
logger.debug("Running health check to see if an OpenSearch connection is working", url: url.sanitized.to_s, path: @healthcheck_path)
225224
perform_request_to_url(url, :head, @healthcheck_path)
226225
end
227226

@@ -231,16 +230,16 @@ def healthcheck!
231230
begin
232231
health_check_request(url)
233232
# If no exception was raised it must have succeeded!
234-
logger.warn("Restored connection to ES instance", url: url.sanitized.to_s)
235-
# We reconnected to this node, check its ES version
233+
logger.warn("Restored connection to OpenSearch instance", url: url.sanitized.to_s)
234+
# We reconnected to this node, check its version
236235
version = get_version(url)
237236
@state_mutex.synchronize do
238237
meta[:version] = version
239238
set_last_version(version, url)
240239
meta[:state] = :alive
241240
end
242241
rescue HostUnreachableError, BadResponseCodeError => e
243-
logger.warn("Attempted to resurrect connection to dead ES instance, but got an error", url: url.sanitized.to_s, exception: e.class, message: e.message)
242+
logger.warn("Attempted to resurrect connection to dead OpenSearch instance, but got an error", url: url.sanitized.to_s, exception: e.class, message: e.message)
244243
end
245244
end
246245
end
@@ -312,7 +311,7 @@ def update_urls(new_urls)
312311
logger.info? && logger.info("OpenSearch pool URLs updated", :changes => state_changes)
313312
end
314313

315-
# Run an inline healthcheck anytime URLs are updated
314+
# Run an inline health check anytime URLs are updated
316315
# This guarantees that during startup / post-startup
317316
# sniffing we don't have idle periods waiting for the
318317
# periodic sniffer to allow new hosts to come online

lib/logstash/plugin_mixins/opensearch/common.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module Common
2121
DOC_SUCCESS_CODES = [200, 201]
2222
DOC_CONFLICT_CODE = 409
2323

24-
# Perform some ES options validations and Build the HttpClient.
24+
# Perform some OpenSearch options validations and Build the HttpClient.
2525
# Note that this methods may sets the @user, @password, @hosts and @client ivars as a side effect.
2626
# @return [HttpClient] the new http client
2727
def build_client
@@ -53,7 +53,7 @@ def hosts_default?(hosts)
5353
private :hosts_default?
5454

5555

56-
# Plugin initialization extension point (after a successful ES connection).
56+
# Plugin initialization extension point (after a successful OpenSearch connection).
5757
def finish_register
5858
end
5959
protected :finish_register
@@ -70,7 +70,7 @@ def successful_connection?
7070
!!maximum_seen_major_version
7171
end
7272

73-
# launch a thread that waits for an initial successful connection to the ES cluster to call the given block
73+
# launch a thread that waits for an initial successful connection to the OpenSearch cluster to call the given block
7474
# @param block [Proc] the block to execute upon initial successful connection
7575
# @return [Thread] the successful connection wait thread
7676
def after_successful_connection(&block)
@@ -253,7 +253,7 @@ def safe_bulk(actions)
253253
message = "Encountered a retryable error (will retry with exponential backoff)"
254254

255255
# We treat 429s as a special case because these really aren't errors, but
256-
# rather just ES telling us to back off a bit, which we do.
256+
# rather just OpenSearch telling us to back off a bit, which we do.
257257
# The other retryable code is 503, which are true errors
258258
# Even though we retry the user should be made aware of these
259259
if e.response_code == 429

spec/integration/outputs/create_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_es_output(action, id, version=nil, version_type=nil)
2929
before :each do
3030
@es = get_client
3131
# Delete all templates first.
32-
# Clean ES of data before we start.
32+
# Clean OpenSearch of data before we start.
3333
@es.indices.delete_template(:name => "*")
3434
# This can fail if there are no indexes, ignore failure.
3535
@es.indices.delete(:index => "*") rescue nil

spec/integration/outputs/index_version_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
before :each do
1919
# Delete all templates first.
20-
# Clean ES of data before we start.
20+
# Clean OpenSearch of data before we start.
2121
es.indices.delete_template(:name => "*")
2222
# This can fail if there are no indexes, ignore failure.
2323
es.indices.delete(:index => "*") rescue nil
@@ -44,7 +44,7 @@
4444
}
4545
end
4646

47-
it "should default to ES version" do
47+
it "should default to OpenSearch version" do
4848
subject.multi_receive([LogStash::Event.new("my_id" => "123", "message" => "foo")])
4949
r = es.get(:index => 'logstash-index', :type => doc_type, :id => "123", :refresh => true)
5050
expect(r["_version"]).to eq(1)

spec/integration/outputs/ingest_pipeline_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# Delete all templates first.
4040
require "elasticsearch"
4141

42-
# Clean ES of data before we start.
42+
# Clean OpenSearch of data before we start.
4343
@es = get_client
4444
@es.indices.delete_template(:name => "*")
4545

spec/integration/outputs/metrics_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
before :each do
2727
require "elasticsearch"
2828

29-
# Clean ES of data before we start.
29+
# Clean OpenSearch of data before we start.
3030
@es = get_client
3131
clean(@es)
3232
subject.register

spec/integration/outputs/no_opensearch_on_startup_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
require "elasticsearch"
3131
allow(Stud).to receive(:stoppable_sleep)
3232

33-
# Clean ES of data before we start.
33+
# Clean OpenSearch of data before we start.
3434
@es = get_client
3535
@es.indices.delete_template(:name => "*")
3636
@es.indices.delete(:index => "*")

spec/integration/outputs/painless_update_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_es_output( options={} )
2626
before :each do
2727
@es = get_client
2828
# Delete all templates first.
29-
# Clean ES of data before we start.
29+
# Clean OpenSearch of data before we start.
3030
@es.indices.delete_template(:name => "*")
3131
# This can fail if there are no indexes, ignore failure.
3232
@es.indices.delete(:index => "*") rescue nil

spec/integration/outputs/retry_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def mock_actions_with_response(*resp)
5656
require "elasticsearch"
5757
allow(Stud).to receive(:stoppable_sleep)
5858

59-
# Clean ES of data before we start.
59+
# Clean OpenSearch of data before we start.
6060
@es = get_client
6161
@es.indices.delete_template(:name => "*")
6262
@es.indices.delete(:index => "*")

spec/integration/outputs/templates_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Delete all templates first.
2525
require "elasticsearch"
2626

27-
# Clean ES of data before we start.
27+
# Clean OpenSearch of data before we start.
2828
@es = get_client
2929
@es.indices.delete_template(:name => "*")
3030

0 commit comments

Comments
 (0)