DESCRIPTION

BTree index on disk

Bug: 315883

Change-Id: I91be77339535a2379f4d48ab9d6e66894afb95ac
Signed-off-by: Alivia Ritter xxx@xxx.xxx


COMMENTS

author: Kaeden Tapia
date: 2013-09-29 03:37:36.000000000

Uploaded patch set 11.

-------------------------------------
author: Kaeden Tapia
date: 2013-09-29 03:38:04.000000000

Patch Set 11:

Fixed a trailing white space!

-------------------------------------
author: Brenden Conley
date: 2013-09-29 04:09:18.000000000

Patch Set 11:

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

-------------------------------------
author: Brenden Conley
date: 2013-09-29 04:41:18.000000000

Patch Set 11: Verified+1

Build Successful 

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

-------------------------------------
author: Braxton Mccarthy
date: 2013-09-30 23:09:19.000000000

Patch Set 11:

(49 comments)

Line:50, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/BTree.java -> can be final

Line:93, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/BTree.java -> why use super.version here? isn't the version number only determined in the extended class?

If you really need two version numbers perhaps they should be two separate variables.

Line:39, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/BTreeTest.java -> You can override xxx@xxx.xxx classes too:

@Override
@Before
public void setUp() {
  super.setUp();
  /* Do your test-specific init here */
}

So you can set the ICheckpointCollection from the super class directly in here.

This should also make it easier to consolidate some of the tests in here, there it still a bunch of redundant stuff.

Line:40, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/BTreeTest.java -> space after cast

Line:26, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/TmfFlatArrayTraceIndex.java -> ctrl+shift+f

You can put the Note: on a separate paragraph if you want it on a different line.

Line:34, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/TmfFlatArrayTraceIndex.java -> is it really worth it, since it's used only once?

Line:49, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/TmfFlatArrayTraceIndex.java -> the dir should always exist now

Line:61, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/signal/TmfTraceUpdatedSignal.java -> it's xxx@xxx.xxx 2.0. Probably will be 3.0, but you can just not put any annotation for now.

Line:63, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/signal/TmfTraceUpdatedSignal.java -> is this separate constructor needed? The only place it's called, it gets the parameter value from trace.getNbEvents() too.

Line:637, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfExperiment.java -> space after cast

Line:659, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfExperiment.java -> space after cast

Line:33, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/FlatArrayTest.java -> see comments in previous file

Line:26, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/IBTreeVisitor.java -> ctrl+shift+f

Line:202, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java -> With this, we could now remove the already-existing setIndexer() method. (who thought it was a good idea to swap indexers at any time??)

Line:30, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/FlatArray.java -> I just noticed you should add xxx@xxx.xxx line here. Applies to other files too.

Line:36, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/FlatArray.java -> public static final

Line:142, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/FlatArray.java -> here too, see how the different versions can be handled

Line:97, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfTimestampDeltaTest.java -> Since this is now handled by JUnit4, it's a tad cleaner to do:

 xxx@xxx.xxx
  public void testThingy() {
   /* Thing to make it throw the exception */
  }

The test will fail if the exception is not received.

Line:95, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfTimestampDeltaTest.java -> space after (cast)

Line:104, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfTimestampTest.java -> same comment as previous file

Line:102, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfTimestampTest.java -> space here too

Line:49, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/ICheckpointCollection.java -> this is a more a debugging-like method, maybe this shouldn't be in the interface (you can always downcast in test/benchmark programs)

Line:96, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/ICheckpointCollection.java -> what is the difference between delete() and dispose()? Perhaps there's a need for both, but the Javadoc should clarify it.

Line:48, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java -> add empty line below

Line:54, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java -> You can use the brand-new TmfTestTrace.A_TEST_10K enum

Line:233, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java -> I personally don't see the point in using a message, it just makes the lines wider, and we can double-click to get the exact line that failed anyway .

Line:250, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java -> assertEquals would be more appropriate here

Line:251, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java -> ... but here == is fine (you're testing the compareTo method, not the equals(). I guess)

Line:23, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/ITmfPersistentlyIndexable.java -> add empty line below

Line:45, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/BTreeNodeCache.java -> initialize to 0

Line:61, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/BTreeNode.java -> the 6 above can be final, except fNumEntries and isDirty

Line:73, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/BTreeNode.java -> don't use" this.", to be consistent with the other lines

Line:56, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/TmfCheckpoint.java -> Specify that this is the "checkpoint rank", and not the event rank

Also, ctrl+shift+f

Line:70, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/TmfCheckpoint.java -> ctrl+shift+f

Line:13, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTraceIndex.java -> maybe this should go in the trace.indexer package

Line:50, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> I think it'd make more sense to make these methods public. The class visibility is the important here. It probably doesn't matter much.

Line:131, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> <sonar>should be private with protected getter</sonar>

Line:134, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> could be final? The setter is only used by the constructor (and the dispose, where it doesn't matter, I guess?)

Line:148, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> private with getters for these too

Line:188, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> Is it fine to create a new object every time this is called? Should it be cached and lazily init'ed? Or created statically?

Line:260, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> add .clear()

Line:268, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> .clear()

Line:323, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> Do you need a straight setter here? Or just an 'increment' would be enough/suitable?

Line:73, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/TmfBTreeTraceIndex.java -> the directory returned from TmfTraceManager.getSupplmentaryFileDir() should always exist now, both if it's a real directory in the workspace or a temp directory.

Line:51, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/TmfStringLocation.java -> You brought up a good point, that we expect all checkpoints to be of the same fixed size. In this case, variable-length locations should be prohibited. Perhaps this class can be deleted completely then?

Line:464, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java -> This could be done only once, and the result cached in a local (static) variable. Either lazily (the first time the method is called), or in a static initializer block.

Line:32, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfBTreeIndexTest.java -> ctrl+shift+f

Line:41, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java -> remove the public

Line:68, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java -> remove public

-------------------------------------
author: Kaeden Tapia
date: 2013-10-01 21:58:36.000000000

Patch Set 11:

(49 comments)

Line:50, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/BTree.java -> Done

Line:93, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/BTree.java -> I added a "sub version".

Line:39, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/BTreeTest.java -> createCollection is also used outside of fixture so I don't think it's necessary to xxx@xxx.xxx I consolidated much more code, though!

Line:40, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/BTreeTest.java -> Done

Line:26, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/TmfFlatArrayTraceIndex.java -> Done

Line:34, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/TmfFlatArrayTraceIndex.java -> Done

Line:49, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/TmfFlatArrayTraceIndex.java -> Done

Line:61, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/signal/TmfTraceUpdatedSignal.java -> Done

Line:63, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/signal/TmfTraceUpdatedSignal.java -> no it gets it from the index, fTraceIndex.getNbEvents. I can remove the other one maybe?

Line:637, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfExperiment.java -> Done

Line:659, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfExperiment.java -> Done

Line:33, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/FlatArrayTest.java -> Done

Line:26, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/IBTreeVisitor.java -> Done

Line:202, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/TmfTrace.java -> We'll do it as a separate patch.

Line:30, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/FlatArray.java -> Done

Line:36, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/FlatArray.java -> Done

Line:142, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/FlatArray.java -> Done

Line:97, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfTimestampDeltaTest.java -> Done

Line:95, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfTimestampDeltaTest.java -> Done

Line:104, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfTimestampTest.java -> Done

Line:102, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/event/TmfTimestampTest.java -> Done

Line:49, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/ICheckpointCollection.java -> Done

Line:96, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/ICheckpointCollection.java -> Done

Line:48, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java -> Done

Line:54, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java -> Done

Line:233, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java -> This code was all moved from TmfCheckpointIndexTest, but I don't mind.

Line:250, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java -> Done

Line:251, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/AbstractIndexTest.java -> I guess, I didn't write it ;)

Line:23, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/ITmfPersistentlyIndexable.java -> Done

Line:45, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/BTreeNodeCache.java -> Done

Line:61, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/BTreeNode.java -> Done

Line:73, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/BTreeNode.java -> Done

Line:56, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/TmfCheckpoint.java -> Done

Line:70, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/TmfCheckpoint.java -> Done

Line:13, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/ITmfTraceIndex.java -> It was renamed to ITmfCheckpointIndex in a later patch and moved to trace.indexer.checkpoint

Line:50, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> Done

Line:131, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> Done

Line:134, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> the one in dispose matters. When it fails to restore, it sets it back to "created from scractch"

Line:148, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> Done

Line:188, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> I think so? You can have multiple indexes opened at the same time with different header instances.

Line:260, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> Done

Line:268, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> Done

Line:323, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> Done

Line:73, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/TmfBTreeTraceIndex.java -> That's much better now, thanks!

Line:51, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/location/TmfStringLocation.java -> I think that would make sense. I'll remove it in a separate patch.

Line:464, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java -> Done lazily.

Line:32, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/trace/indexer/checkpoint/TmfBTreeIndexTest.java -> Done

Line:41, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java -> Done

Line:68, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/checkpoint/ITmfCheckpoint.java -> Done

-------------------------------------
author: Braxton Mccarthy
date: 2013-10-03 17:29:50.000000000

Patch Set 11:

(4 comments)

Line:63, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/signal/TmfTraceUpdatedSignal.java -> So we're keeping both constructors? It'd be fine, just making sure.

Line:23, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/ITmfPersistentlyIndexable.java -> you sure? ;)

Line:188, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> Yeah, perhaps not a static field (since each instance needs its own header), but it could be lazy-init'ed to a local field. Or even better, at the constructor.

The header of a given "checkpoint collection" won't change after it's been created, right?

Line:464, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java -> I feel like it would be 'cleaner' if the method was synchronized. In the end it doesn't matter, but you could do extra calculations for nothing...

-------------------------------------
author: Kaeden Tapia
date: 2013-10-03 21:08:47.000000000

Patch Set 11:

(4 comments)

Line:63, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/signal/TmfTraceUpdatedSignal.java -> I removed the other one.

Line:23, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/trace/indexer/ITmfPersistentlyIndexable.java -> err, I don't know what happened here. Fixed now.

Line:188, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/trace/indexer/AbstractFileCheckpointCollection.java -> it's in a field already but I managed to make it final too!

Line:464, lttng/org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/tmf/core/ctfadaptor/CtfTmfTrace.java -> Done

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