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-23793]. MySQL Connector JAR distribution is broken (amagyar) #1219
Conversation
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
retest this please |
Refer to this link for build results (access rights to CI server needed): |
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import org.apache.commons.lang3.SystemUtils; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong import (lang3)?
|
||
package org.apache.ambari.server.events; | ||
|
||
public class AmbariPropertiesChangedEvent extends AmbariEvent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JavaDoc
} | ||
|
||
private void notifyListener(Path path) { | ||
LOG.info(path + " changed. Sending notification."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use {} for log statements
/** | ||
* Watchdog that notifies a listener on a file content change. | ||
*/ | ||
public class SingleFileWatch implements Runnable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the WatchService can only watch directories, should this class instead spawn a single thread per directory (not file)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need that functionality at this moment. This is intended to watch a single file, but it's implemented in way to watch the parent directory of that file because of the limitations of WatchService. From usability standpoint this is simpler than watching a directory and doing the filtering outside or registering multiple listeners per each file.
Refer to this link for build results (access rights to CI server needed): |
Please check the feasibility of using commons |
FileAlterationMonitor, FileWatchDog and other 3rd party watchers use periodic polling to check file changes. WatchService uses the operating system specific event driven primitives if available and falls backs to polling if it's not available (for example on OSX). I'll check the CPU usage. |
retest this please |
Refer to this link for build results (access rights to CI server needed): |
I discovered some problems with WatchService (duplicated events, works slightly differently on some platforms), so a replaced it with an apache watchdog. Please review again. |
Refer to this link for build results (access rights to CI server needed): |
What changes were proposed in this pull request?
After running ambari-server setup --jdbc-db=mysql ambari.properties file changes, but these changes are not visible in ambariLevelParams of command jsons. Amabari agent still sees a cached version of these parameters.
This fix triggers an event which invalidates the cache when ambari.properties file changes.
How was this patch tested?
I ran the following command
and inspected ambariLevel params of /var/lib/ambari-agent/data/command-XXX.json