Applications can subscribe for new files being indexed
by baloo via the dbus interface of fileindexer. However,
currently only the start and finishedIndexing signals are
exported. The latter does only indicate that the file has
been indexed, but not yet committed to the database.
Rename the newBatchTime to better reflect that the
batch has been committed to the database and export
it so that it is possible to know when the transaction
has been committed and thus is safe to query the
database for metadata.
Details
- Reviewers
bruns - Group Reviewers
Baloo - Commits
- R293:19e71b3e4a5f: rename and export newBatchTime signal in filecontentindexer
Diff Detail
- Repository
- R293 Baloo
- Branch
- exportSignal
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 24952 Build 24970: arc lint + arc unit
In general fine for me.
How will Elisa deal with the indexer maybe crashing inbetween? Do we also need a signal for a batch start?
Do you mean slow for picking up changes in files? Then yes. This happens when a track is modified when Elisa is running and listens for finishedIndexingFile signal. It then immediately queries baloo database, which still has the old values.
Only after the done signal the transaction to baloo's database is complete.
From my (limited) understanding, the finishedIndexingFile will no be emitted when an indexers crashes, does it? Then I think it is fine without an additional signal as long as the done() signal is still emitted as it is possible to reset the applications' internal list. Or will it retry some files of the current batch?
It will not be emitted for the file it crashed on, but for the earlier files. So you may have the following for the files 'a, b, c, d':
- S:a, F:a
- S:b, F:b
- S:c <crash>
- S:a, F:a
- S:b, F:b
- done
- S:c, <crash>
- S:d, F:d
- done
So when you only listen to finished and done, you should keep the files in a set, but after the done the earlier files should be committed.
Then it's fine from my application point of view. I can add a corresponding start signal for convenience, though. Your call.
Regarding API, done is a little bit vague.
Can you rename it to finishedBatch (or come up with a better name).
How about committedBatch so that it's clear that they have been committed to the database?
src/file/filecontentindexer.cpp | ||
---|---|---|
111 ↗ | (On Diff #79751) | Sorry, seems I got a little bit confused, the commitedBatch has to go here. And when I look at it, you can piggy-back on newBatchTime, which is emitted on each batch. For your use case, just ignore the values. So new proposal, rename newBatchTime(elapsed, batchSize) to committedBatch(elapsed, batchSize) and export it. Keep done as is. |
114 ↗ | (On Diff #79751) | This has to stay as is, as it means everythingdone |