DESCRIPTION

Add 2D queries support in the HistoryTreeBackend.

We allow to make automatic range 2D queries in the History Tree.
For the standard HistoryTree, it means that we query the complete branch that intersects a time.
The result is a TmfStateIntervalList that contains the intervals list, the begin and the end time of this query.

2D query will populate the view by asking the backend a list of intervals that suits its.
This method is a thread safe adaptation of "dynamic cache" implements in the patch : https://git.eclipse.org/r/#/c/19330/.
For the history tree backend, the range is the size of the leaf for the query's time.

Change-Id: Ifc104d70c472fe6e878780ff19f277145b8a2429
Signed-off-by: Ayanna Reed xxx@xxx.xxx


COMMENTS

author: Ayanna Reed
date: 2013-12-09 17:19:14.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2013-12-09 17:22:17.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4509/

-------------------------------------
author: Brenden Conley
date: 2013-12-09 18:08:32.000000000

Patch Set 3: Verified-1

Build Failed 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4509/ : FAILURE

-------------------------------------
author: Brenden Conley
date: 2013-12-09 18:22:38.000000000

Patch Set 3: -Verified

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4511/

-------------------------------------
author: Bradyn Guerra
date: 2013-12-09 18:27:07.000000000

Patch Set 3:

(4 comments)

Thanks for you answers Florian. Here are a few more comments.

Line:28, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> Should be "The start timestamp of the intersection of all the intervals in the list."

Line:33, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> Should be "The end timestamp of the intersection of all the intervals in the list."

Line:65, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> end = Math.min(end, interval.get***End***Time());

Line:78, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> Now that I understand what is the correct value of |start| and |end|, I'm not sure that this condition is right. Is it correct to make a query with a time which is outside of the intersection of all intervals in the list, but still intersects the one we want to retrieve? I think the answer is no according to the comment in ITmfStateIntervalList.java

If no, interval.intersects(time) below is always true and this condition is correct.

If yes, this condition should be removed.

-------------------------------------
author: Jordon Obrien
date: 2013-12-09 18:39:11.000000000

Patch Set 3:

(15 comments)

handful of nits

Line:44, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/ITmfStateIntervalList.java -> Add*

Stay consistant. Start you sentence with uppercase (or all in lower case) and don't mixed them.

Line:47, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/ITmfStateIntervalList.java -> list -> intervals list.

Line:52, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/ITmfStateIntervalList.java -> ditto

Line:55, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/ITmfStateIntervalList.java -> list -> intervals list.

Line:19, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> the *main* object? Something else is returned?

Line:20, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> What is the main characteristic of intervals in this data-structure  "after" the query?

Line:65, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> +1
Otherwise, provide useful comment for any read why this is not a copy paste error.

Line:81, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/InMemoryBackend.java -> size in bytes? in elements?

maybe:
Maximum number of returned elements for a 2D Query.

Line:254, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java -> Please?

Replace by:

A full query must be used instead.

Line:216, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTreeBackend.java -> We? ditto

Line:220, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTreeBackend.java -> We? ditto

Line:226, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTreeBackend.java -> We? ditto

Line:163, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/IStateHistoryBackend.java -> Break the paragraph and add a blank line  after "endTime."

Line:164, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/IStateHistoryBackend.java -> 'new'  -> instanciate

Line:325, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HTNode.java -> A common mistake: don't use "we". You are not doing the work.
The code, the algorithm etc... is doing the job.

This method adds all intervals ....

-------------------------------------
author: Brenden Conley
date: 2013-12-09 18:59:58.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4511/ : SUCCESS

-------------------------------------
author: Ayanna Reed
date: 2013-12-09 20:27:07.000000000

Patch Set 3:

(18 comments)

Fix some mistakes.

Line:44, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/ITmfStateIntervalList.java -> Done

Line:47, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/ITmfStateIntervalList.java -> Done

Line:52, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/ITmfStateIntervalList.java -> Done

Line:55, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/ITmfStateIntervalList.java -> Done

Line:19, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> Done

Line:20, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> Done

Line:28, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> Done

Line:33, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> Done

Line:65, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> Done. Sorry :(

Line:78, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/interval/TmfStateIntervalList.java -> I made ??a mistake. If there are more than one interval to the same attribute, we want to have the union of the time intervals for validity. It is complex to maintain such a list only with the add method. I added setStartTime setEndTime and because it is easier to set the interval with the backend (it's the begin and the end of the leaf node).

Otherwise I choose to throw a TimeRangeException in the method get.

Line:81, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/InMemoryBackend.java -> Done

Line:254, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/partial/PartialHistoryBackend.java -> Done

Line:216, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTreeBackend.java -> Done

Line:220, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTreeBackend.java -> Done

Line:226, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HistoryTreeBackend.java -> Done

Line:163, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/IStateHistoryBackend.java -> Done

Line:164, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/IStateHistoryBackend.java -> Done

Line:325, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/backends/historytree/HTNode.java -> Done

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