-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/53494/
-----------------------------------------------------------
(Updated Nov. 4, 2016, 6:46 p.m.)
Review request for Ambari, Jonathan Hurley, Miklos Gergely, and Oliver Szabo.
Changes
-------
Uploading second version of patch, including a fix for the issue found by
jhurley.
Bugs: AMBARI-17529
https://issues.apache.org/jira/browse/AMBARI-17529
Repository: ambari
Description
-------
This patch resolves AMBARI-17529.
In the initial implementation of the LogSearch integration layer in Ambari, in
Ambari 2.4.0, it was possible that multiple requests for a given host/comopnent
for logging information be queued and sent to the LogSearch Portal Server.
While these requests are idempotent, it is a slight performance issue to allow
these requests to occur multiple times. This is particularly an issue when the
LogSearch-related PropertyProvider might be called during various Ambari REST
calls, even if the LogSearch information is not required.
This patch uses an approach similar to that found in:
org.apache.ambari.server.state.services.MetricsRetrievalService
This patch implements the following:
1. Implements a request cache, to keep track of the current pending requests on
a host/component basis, and to ensure that only one request for log file
information occurs on a host/component basis.
2. Refactors the Runnable implementation used by LogSearch to execute these log
file information requests, in order to facilitate simpler unit testing.
3. Adds some DEBUG-level log statements, in order to debug any problems that
might arise in the caching layer in the future.
4. Adds new unit tests to verify these changes.
Diffs (updated)
-----
ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalService.java
4929747
ambari-server/src/test/java/org/apache/ambari/server/controller/logging/LogSearchDataRetrievalServiceTest.java
97c59f8
Diff: https://reviews.apache.org/r/53494/diff/
Testing
-------
1. Ran the ambari-server unit test suite ("mvn clean test"), with all tests
passing.
2. Tested this change in a cluster deployment on top of the recent trunk code,
and verified that the LogSearch integration UI in Ambari still functions as
expected with this change applied.
Thanks,
Robert Nettleton