Robert Nettleton created AMBARI-19217:
-----------------------------------------

             Summary: Ambari LogSearch data retrieval class should only use one 
instance of factory
                 Key: AMBARI-19217
                 URL: https://issues.apache.org/jira/browse/AMBARI-19217
             Project: Ambari
          Issue Type: Task
          Components: ambari-server
    Affects Versions: 2.5.0
            Reporter: Robert Nettleton
            Assignee: Robert Nettleton
             Fix For: 3.0.0


This issue came up during a review for AMBARI-19105.

The following class in the Ambari LogSearch integration code:

org.apache.ambari.server.controller.logging.LogSearchDataRetrievalService

uses multiple instances of the {code}LoggingRequestHelperFactory{code} 
interface.  

This is due to the fact that some methods are handled on the main request 
thread, and these instances use the injected factory instance.  In some other 
cases, requests are handled on a separate thread, and so new factory instances 
are created with the Google Guice Injector. 

This is somewhat confusing in terms of the design, and this should be 
refactored for a simpler design.

The most straightforward way to handle this would be to ensure that the 
{code}LoggingRequestHelperFactory{code} is thread-safe, which would allow a 
single instance of this factory to be injected into the retrieval service, as 
well as into the separate runnables to handle helper creation from multiple 
threads.

This issue tracks the work involved in investigating this, and implementing a 
refactoring of this class, such that a single injected factory implementation 
can be used by this class, and by any threads launched by this class.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to