Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMBARI-25993: logsearch-logfeeder cannot startup due to lake of configuration #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ public String getText() {
}

public static LogFeederMode fromString(String text) {
for (LogFeederMode mode : LogFeederMode.values()) {
if (mode.text.equalsIgnoreCase(text)) {
return mode;
try {
for (LogFeederMode mode : LogFeederMode.values()) {
if (mode.text.equalsIgnoreCase(text)) {
return mode;
}
}
} catch (IllegalArgumentException e) {
return LogFeederMode.DEFAULT;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rzuo Can we add some logging here to indicate this configuration exception and the fallback to using the default configuration? This would help users troubleshoot issues more easily.

}
throw new IllegalArgumentException(String.format("String '%s' cannot be converted to LogFeederMode enum", text));
return LogFeederMode.DEFAULT;
}

public static boolean isCloudStorage(LogFeederMode mode) {
Expand Down