[ 
https://issues.apache.org/jira/browse/HADOOP-3628?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Steve Loughran updated HADOOP-3628:
-----------------------------------

    Attachment: AbstractHadoopComponent.java

OK, an abstract class like the one attached is easily done.

Some thoughts.

1. should the terminate() operation return a list of throwables that were 
caught during termination? That way, rather than just log problems on shutdown, 
whatever initiates the shutdown can deal with them by logging/rethrowing, etc.

2. Is the set of states right? do we want a STARTING state that components 
enter until they consider themselves live? 

3. The class is a base class of Configurable. I plan to move the code that 
reads in the configuration from the constructors into init(); that way 
subclasses can do tricks such as manipulate the configuration before it is 
read. 

4. Should the base methods be synchronized? The alternative is to leave that to 
the subclasses, as appropriate. In our experience, having the terminate() 
option non-synchronized is good to avoid deadlocks; for the others, 
synchronized is generally good.

5. The base class can verify the system is in the right state, throwing 
exceptions if not. 

6. I'll add a HadoopException that extends IOException too.

7. is org.apache.hadoop.conf the right package? 

Test-wise, we can add tests that check this, with a mock object that can be 
configured to fail in any of the method calls, so as to stress any container

> Add a lifecycle interface for Hadoop components: namenodes, job clients, etc.
> -----------------------------------------------------------------------------
>
>                 Key: HADOOP-3628
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3628
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs, mapred
>    Affects Versions: 0.19.0
>            Reporter: Steve Loughran
>         Attachments: AbstractHadoopComponent.java
>
>
> I'd like to propose we have a standard interface for hadoop components, the 
> things that get started or stopped when you bring up a namenode. currently, 
> some of these classes have a stop() or shutdown() method, with no standard 
> name/interface, but no way of seeing if they are live, checking their health 
> of shutting them down reliably. Indeed, there is a tendency for the spawned 
> threads to not want to die; to require the entire process to be killed to 
> stop the workers. 
> Having a standard interface would make it easier for 
>  * management tools to manage the different things
>  * monitoring the state of things
>  * subclassing
> The latter is interesting as right now TaskTracker and JobTracker start up 
> threads in their constructor; that's very dangerous as subclasses may have 
> their methods called before they are full initialised. Adding this interface 
> would be the right time to clean up the startup process so that subclassing 
> is less risky.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to