DESCRIPTION

tmf: Consolidate all state systems in ITmfTrace

In the initial design, a trace would have only one single
state system. ITmfTrace.getStateSystem() would do the job.

Then, the need for different state systems for different trace
types arose. Up until now, we've used a hybrid approach, where
we keep the interface method the same, but a given user/view
could access a specific state system by casting the trace
in the specific type. So far so good.

But now, we are reaching the point where we can need to define
*many* state systems for a single trace type (ie, Matthew's
CPU usage view). I think we now need to centralize all of a
trace's state systems in the ITmfTrace interface itself.

This patch changes ITmfTrace's getStateSystem() to add the
state's ID as parameter (state systems already define a unique
ID, so we can reuse that one). It also adds a listStateSystems()
method to list the current registered ones for this trace.

The implementation in TmfTrace uses a HashMap. It's very simple,
and gives a maximum amount of flexibility ; sub-classes can
decide to overwrite a superclass' state history, decide to run
them or not, etc.

Change-Id: I6c819ad8987767015543dc54b613ec3cdc6ea50d
Signed-off-by: Braxton Mccarthy xxx@xxx.xxx


COMMENTS

author: Braxton Mccarthy
date: 2012-11-23 21:53:09.000000000

Uploaded patch set 2.

-------------------------------------
author: Braxton Mccarthy
date: 2012-11-23 21:53:28.000000000

Patch Set 2:

Straightforward rebase

-------------------------------------
author: Brenden Conley
date: 2012-11-23 22:12:40.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/sandbox/job/linuxtools/646/ 

-------------------------------------
author: Brenden Conley
date: 2012-11-23 22:30:42.000000000

Patch Set 2: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/linuxtools/646/ : SUCCESS

-------------------------------------
author: Ivy Mitchell
date: 2012-11-28 15:51:41.000000000

Patch Set 2: Verified; Looks good to me, approved; IP review completed



-------------------------------------
author: Ricky Reeves
date: 2012-11-29 13:58:09.000000000

Patch Set 2:

The TmfExperiment extends TmfTrace. What should be the behaviour of getStateSystem()/listStateSystems() on the experiment level. Do we need to consider all contained traces? Or is it enough to consider only experiment specific state systems (which we don't have currently)? I'm not clear about that.

It would be good to add some test cases for the new methods of TmfTrace on the trace level, and on experiment level if TmfExperiment overwrites the new methods

-------------------------------------
author: Braxton Mccarthy
date: 2012-12-03 16:29:17.000000000

Patch Set 2:

We don't use experiment-level state systems at the moment. I don't we ever will, but who knows... For now, I was thinking of having it re-use TmfTrace's implementation, so it simply returns an empty list. (the statistics only get build for traces that have a resource, so not for experiments.)

Good point about unit tests, I will do a rebase and add unit tests in the next version.

-------------------------------------
