DESCRIPTION

Proposed fix for synchronized trace and experiment seeking bug. Will be amended.

Change-Id: I6c59ac7ba52d80ab4bab597da93ea7adb950158d


COMMENTS

author: Ivy Mitchell
date: 2012-07-17 15:20:14.000000000

Patch Set 1: I would prefer that you didn't submit this

(1 inline comment)

This code needs comments and test cases

Line:2, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> Needs comments... LOTS of comments

-------------------------------------
author: Braxton Mccarthy
date: 2012-07-17 15:41:17.000000000

Patch Set 1: IP review completed

(6 inline comments)

Some inline comments, haven't tested the functionality yet.

Line:68, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java -> This getting removed makes me happy inside.

Line:7, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> The class could be static too.

Line:10, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> Pedantic mode again, you should do "public static synchronized". Or maybe "public synchronized static". The API visibility is the most important modifier.

Line:24, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> Perhaps use "TraceManager" and "GlobalManager"  as names to make it clear what they do.

Line:35, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> Why not put this in the constructor and use "private final" fields?

Line:63, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> You don't need Javadoc for private  methods, especially not stub one, it will just clutter the code.

-------------------------------------
author: Ivy Mitchell
date: 2012-07-17 15:46:47.000000000

Patch Set 1: (3 inline comments)

Added replies

Line:35, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> +1

Line:63, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> I don't see this cluttering the code too much, and it contains some algorithmic stuff I feel needs to be explained

Line:39, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfLightweightContext.java -> Remove me

-------------------------------------
author: Simeon Moses
date: 2012-07-17 17:26:26.000000000

Patch Set 1: Looks good to me, but someone else must approve

Looks faster to me.

-------------------------------------
author: Simeon Moses
date: 2012-07-17 17:27:17.000000000

Patch Set 1:

Looks A LOT faster to me!

-------------------------------------
author: Luciana Barry
date: 2012-07-17 19:21:41.000000000

Patch Set 1: (9 inline comments)



Line:87, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java -> Why store it as a field variable (and if so, then it should be renamed)?

Line:89, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java -> Could you simply use the above context and seek?

Line:153, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java -> Could you use a local context instead?

Line:208, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java -> This seek is inconsistent with the ratio in getLocationRatio, which is based on time stamp.

Line:7, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> xxx@xxx.xxx tag

Line:16, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> should be renamed to addTrace

Line:18, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfIteratorManager.java -> Might need a removeTrace, perhaps called at trace dispose. Otherwise the trace would never get garbage collected (reference stored in the CtfIteratorViceManager).

Line:58, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfLightweightContext.java -> Might as well remove these fields if they are not used.
Perhaps just call the other constructor with:
this(iters.get(0).getCtfTmfTrace());

Line:67, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfLightweightContext.java -> xxx@xxx.xxx tag

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