-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support automatic DNS lookup for kafka bootstrap servers (#3379)
* feat: Support automatic DNS lookup for kafka bootstrap servers * Revert "feat: Support automatic DNS lookup for kafka bootstrap servers" This reverts commit 5baed7b. * feat: Support automatic DNS lookup for Kafka broker * fix: resolve broker endpoint in client manager * fix: apply clippy lints * refactor: slimplify the code with clippy hint * refactor: move resolve_broker_endpoint to common/wal/src/lib.rs * test: add mock test for resolver_broker_endpoint * refactor: accept niebayes's advice * refactor: rename EndpointIpNotFound to EndpointIPV4NotFound * refactor: remove mock test and simplify the implementation * docs: add comments about test_vallid_host_ipv6 * Apply suggestions from code review Co-authored-by: niebayes <[email protected]> * move more common code Signed-off-by: tison <[email protected]> --------- Signed-off-by: tison <[email protected]> Co-authored-by: tison <[email protected]> Co-authored-by: niebayes <[email protected]>
- Loading branch information
1 parent
a3533c4
commit a500252
Showing
8 changed files
with
117 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2023 Greptime Team | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use common_macro::stack_trace_debug; | ||
use snafu::Snafu; | ||
|
||
#[derive(Snafu)] | ||
#[snafu(visibility(pub))] | ||
#[stack_trace_debug] | ||
pub enum Error { | ||
#[snafu(display("Failed to resolve endpoint {:?}", broker_endpoint))] | ||
ResolveEndpoint { | ||
broker_endpoint: String, | ||
#[snafu(source)] | ||
error: std::io::Error, | ||
}, | ||
|
||
#[snafu(display("Failed to find ipv4 endpoint: {:?}", broker_endpoint))] | ||
EndpointIPV4NotFound { broker_endpoint: String }, | ||
} | ||
|
||
pub type Result<T> = std::result::Result<T, Error>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters