Jump to content

Frameworks/Akonadi: Difference between revisions

From KDE Community Wiki
Dvratil (talk | contribs)
Akonadi repo structure: Add tests directories
Dvratil (talk | contribs)
Add tasks
Line 12: Line 12:
  /src/akonadictl (akonadictl utility)
  /src/akonadictl (akonadictl utility)
  /src/asapcat (asapcat utility)
  /src/asapcat (asapcat utility)
  /src/common (libKF5AkonadiCommon.so - classes shared between server, core and widgets libraries and other utilities)
  /src/common (libKF5AkonadiCommon.so - classes shared between server, core and widgets libraries and other utilities. Does NOT install any (or most of its) public headers)
  /src/control (akonadi_control utility)
  /src/control (akonadi_control utility)
  /src/core (libKF5AkonadiCore.so - non-UI classes, only Jobs, models, Monitor etc.)
  /src/core (libKF5AkonadiCore.so - non-UI classes, only Jobs, models, Monitor etc.)
Line 30: Line 30:


= Client libraries =
= Client libraries =
== API/ABI changes ==
{| class="sortable" border="1" cellpadding="5" cellspacing="0" style="border: gray solid 1px; border-collapse: collapse; text-align: left; width:100%;"
{| class="sortable" border="1" cellpadding="5" cellspacing="0" style="border: gray solid 1px; border-collapse: collapse; text-align: left; width:100%;"
|- style="background: #ececec; white-space:nowrap;"
|- style="background: #ececec; white-space:nowrap;"
Line 36: Line 37:
! width=300 | Action
! width=300 | Action
! width=500 | Comment
! width=500 | Comment
|- {{ FrameworkTodo | AgentBase | Merge ObserverV* into Observer | There should be "Observer" and "BatchObserver" (not inheriting from each other). BatchObserver would enable the same behavior as ObserverV3 currently }}
! Branch
|- {{ FrameworkTodo | AgentSearchInterface | Remove addSearch() and removeSearch() methods | Search is managed on server now, so we only need search() method to get results. add/removeSearch() are no longer used }}
! Assignee
|- {{ FrameworkTodo | AgentBase | Merge ObserversV* into Observer | There should be "Observer" and "BatchObserver" (not inheriting from each other). BatchObserver would enable the same behavior as ObserverV3 currently }}
|- {{ FrameworksTodo | AgentBase | Merge ObserverV* into Observer | There should be "Observer" and "BatchObserver" (not inheriting from each other). BatchObserver would enable the same behavior as ObserverV3 currently | | frameworks | }}
|- {{ FrameworkTodo | ChangeMediator | Remove | ChangeMediator is only used by ItemModifyJob and CollectionModifyJob to invalidate entries in Monitor's EntityCache. Maybe we can find another way to do it. This class was supposed to more, but it was never finished and I don't see other use for it except for the two cases above. }}
|- {{ FrameworksTodo | AgentSearchInterface | Remove addSearch() and removeSearch() methods | Search is managed on server now, so we only need search() method to get results. add/removeSearch() are no longer used | frameworks | }}
|- {{ FrameworkTodo | Collection | Remove deprecated methods | }}
|- {{ FrameworksTodo | AgentBase | Merge ObserversV* into Observer | There should be "Observer" and "BatchObserver" (not inheriting from each other). BatchObserver would enable the same behavior as ObserverV3 currently | frameworks | }}
|- {{ FrameworkTodo | CollectionFetchJob | Remove deprecated methods | }}
|- {{ FrameworksTodo | ChangeMediator | Remove | ChangeMediator is only used by ItemModifyJob and CollectionModifyJob to invalidate entries in Monitor's EntityCache. Maybe we can find another way to do it. This class was supposed to more, but it was never finished and I don't see other use for it except for the two cases above. | master | }}
|- {{ FrameworkTodo | CollectionFetchScope | Remove deprecated methods | }}
|- {{ FrameworksTodo | Collection | Remove deprecated methods | frameworks | | }}
|- {{ FrameworkTodo | CollectionModel | Remove | }}
|- {{ FrameworksTodo | CollectionFetchJob | Remove deprecated methods | frameworks | | }}
|- {{ FrameworkTodo | CollectionSelectJob | Remove? | Performs SELECT before FETCH, STORE, APPEND, ... commands. This mimics IMAP behavior, but since we have diverged from IMAP quite a lot by now, we could just change syntax of the commands to include a "COLLECTION" parameter. This could speed up  FETCH operation a little  }}
|- {{ FrameworksTodo | CollectionFetchScope | Remove deprecated methods | frameworks | | }}
|- {{ FrameworkTodo | CollectionStatisticsModel | Remove | }}
|- {{ FrameworksTodo | CollectionModel | Remove | frameworks | | }}
|- {{ FrameworkTodo | CollectionView | Remove deprecated methods | }}
|- {{ FrameworksTodo | CollectionSelectJob | Remove? | Performs SELECT before FETCH, STORE, APPEND, ... commands. This mimics IMAP behavior, but since we have diverged from IMAP quite a lot by now, we could just change syntax of the commands to include a "COLLECTION" parameter. This could speed up  FETCH operation a little | master? | }}
|- {{ FrameworkTodo | DBusConnectionPool | Remove | }}
|- {{ FrameworksTodo | CollectionStatisticsModel | Remove | frameworks | | }}
|- {{ FrameworkTodo | Entity | Make it a subclass of AttributeEntity | AttributeEntity was introduced to allow sharing code between Tags and Entities. }}
|- {{ FrameworksTodo | CollectionView | Remove deprecated methods | frameworks | | }}
|- {{ FrameworkTodo | Entity | Remove AKONADI_DECLARE_PRIVATE | }}
|- {{ FrameworksTodo | DBusConnectionPool | Remove | master? | | }}
|- {{ FrameworkTodo | EntityTreeViewStateSaver | Remove | }}
|- {{ FrameworksTodo | Entity | Make it a subclass of AttributeEntity | AttributeEntity was introduced to allow sharing code between Tags and Entities. | frameworks | }}
|- {{ FrameworkTodo | IndexPolicyAttribute | Remove if Baloo Indexer decides to ignore it | }}
|- {{ FrameworksTodo | Entity | Remove AKONADI_DECLARE_PRIVATE | | frameworks | }}
|- {{ FrameworkTodo | ItemFetchScope | Normalize setter/getter names | }}
|- {{ FrameworksTodo | EntityTreeViewStateSaver | Remove | | frameworks | }}
|- {{ FrameworkTodo | ItemModel | Remove | }}
|- {{ FrameworksTodo | IndexPolicyAttribute | Remove if Baloo Indexer decides to ignore it | | frameworks | }}
|- {{ FrameworkTodo | ItemSearchJob | Remove deprecated methods | }}
|- {{ FrameworksTodo | ItemFetchScope | Normalize setter/getter names | | frameworks | }}
|- {{ FrameworkTodo | ItemSync | Make private? | Does not seem to be used anywhere  }}
|- {{ FrameworksTodo | ItemModel | Remove | | frameworks | }}
|- {{ FrameworkTodo | ItemView | Remove deprecated methods | }}
|- {{ FrameworkTodo | ItemSearchJob | Remove deprecated methods | | frameworks | }}
|- {{ FrameworkTodo | KDSignalBlocker | Remove? | }}
|- {{ FrameworkTodo | ItemSync | Make private? | Does not seem to be used anywhere | frameworks | }}
|- {{ FrameworkTodo | metatypes.h | Remove | }}
|- {{ FrameworkTodo | ItemView | Remove deprecated methods | | frameworks | }}
|- {{ FrameworkTodo | MimeTypeChecker | Maybe remove | This class is able to compare mime types, handling aliases, inheritance, etc. AFAIK Volker once told me this should be in Qt 5, so check whether it's there. Might be worth upstreaming, too }}
|- {{ FrameworkTodo | KDSignalBlocker | Remove? | | frameworks | }}
|- {{ FrameworkTodo | PersistentSearchAttribute | Remove deprecated methods | }}
|- {{ FrameworkTodo | metatypes.h | Remove | | master? | }}
|- {{ FrameworkTodo | PluginLoader | Remove if Qt 5 plugin system is powerful enough | }}
|- {{ FrameworkTodo | MimeTypeChecker | Maybe remove | This class is able to compare mime types, handling aliases, inheritance, etc. AFAIK Volker once told me this should be in Qt 5, so check whether it's there. Might be worth upstreaming, too | frameworks | }}
|- {{ FrameworkTodo | ProtocolHelper | Share with Server | See the Other Plans section below }}
|- {{ FrameworkTodo | PersistentSearchAttribute | Remove deprecated methods | | frameworks | }}
|- {{ FrameworkTodo | RecursiveItemFetchJob | Optimize | Emit itemsReceived() signal from underlaying fetch jobs }}
|- {{ FrameworkTodo | PluginLoader | Remove if Qt 5 plugin system is powerful enough | | frameworks | }}
|- {{ FrameworkTodo | RenameFavoriteDialog | Make private? | }}
|- {{ FrameworkTodo | ProtocolHelper | Share with Server | See the Other Plans section below | frameworks | }}
|- {{ FrameworkTodo | ResourceSettings | Remove? | }}
|- {{ FrameworkTodo | RecursiveItemFetchJob | Optimize | Emit itemsReceived() signal from underlaying fetch jobs | master | }}
|- {{ FrameworkTodo | SearchCreateJob | Remove deprecated methods | }}
|- {{ FrameworkTodo | RenameFavoriteDialog | Make private? | | frameworks | }}
|- {{ FrameworkTodo | SelfTestDialog | Make a standalone application | SelfTestDialog is the only user of QtSQL in client libraries. By making it a stand-alone app, we can get rid of one dependency from libKF5AkonadiCore.so }}
|- {{ FrameworkTodo | ResourceSettings | Remove? | | frameworks | }}
|- {{ FrameworkTodo | StatisticsProxyModel | Remove | }}
|- {{ FrameworkTodo | SearchCreateJob | Remove deprecated methods | | frameworks | }}
|- {{ FrameworkTodo | SubscriptionJob | Split to CollectionSubscribeJob and CollectionUnsubscribeJob? | Keep the naming consistent }}
|- {{ FrameworkTodo | SelfTestDialog | Make a standalone application | SelfTestDialog is the only user of QtSQL in client libraries. By making it a stand-alone app, we can get rid of one dependency from libKF5AkonadiCore.so | master | }}
|- {{ FrameworkTodo | TrashFilterProxyModel | Remove? | Does not seem to be used anywhere }}
|- {{ FrameworkTodo | StatisticsProxyModel | Remove | | frameworks | }}
|- {{ FrameworkTodo | SubscriptionJob | Split to CollectionSubscribeJob and CollectionUnsubscribeJob? | Keep the naming consistent | frameworks | }}
|- {{ FrameworkTodo | TrashFilterProxyModel | Remove? | Does not seem to be used anywhere | frameworks | }}
|}
 
== Features ==
Features can mostly be implemented already now in master, but they are something I'd totally love to see in Frameworks.
 
{| class="sortable" border="1" cellpadding="5" cellspacing="0" style="border: gray solid 1px; border-collapse: collapse; text-align: left; width:100%;"
|- style="background: #ececec; white-space:nowrap;"
! Status
! Action
! width=500 | Comment
|- {{ FeatureTodo | Use ImapStreamParser in client jobs | Will improve performance and memory consumption on client side. Also it's easier to use :) }}
|- {{ FeatureTodo | (IF POSSIBLE) Share external payload parts helper  | Concentrate external parts support into one place for easier maintanence and less code duplication }}
|- {{ FeatureTodo | Direct streaming of external payload parts  | For parts bigger than 4KB, the server can instead of asking client to provide the data send back a file descriptor that client will use to write the data directly to the file. Server can either verify that sizes match, or rely on client library telling the truth. Memory--, performance++ }}
|}
 
= Server =
{| class="sortable" border="1" cellpadding="5" cellspacing="0" style="border: gray solid 1px; border-collapse: collapse; text-align: left; width:100%;"
|- style="background: #ececec; white-space:nowrap;"
! Status
! Action
! width=500 | Comment
|- {{ FeatureTodo | Upstream QSQLITE3 driver | I managed to figure out what the actual changes we have in our fork are. They are not implemented optimally, a proper implementation will be more complicated, but generally should ensure better performance.  Then we can try to upstream those changes and get rid of the driver for good. }}
|- {{ FeatureTodo | Remove APPEND command | APPEND has been superseded by AK-APPEND. Other option is to rename AK-APPEND to APPEND and remove AK-APPEND. }
|- {{ FeatureTodo | Remove Nepomuk support | We have Baloo now, we don't need Nepomuk anymore }}
|- {{ FeatureTodo | Remove SELECT command | See comment at CollectionSelectJob in the table above }}
|- {{ FeatureTodo | Remove backward-compatibility with older protocol versions | Some of the handlers still have several paths for supporting older client libraries. We don't even know whether they still work, so just get rid of them. }}
|- {{ FeatureTodo | Merge NotificationMessages | Merge NotificationMessageV2 and V3 to NotificationMessage }}
|- {{ FeatureTodo | Remove legacy client support from NotificationManager | Don't use the broadcast notify() signal anymore, only support notification subscribers. }}
|- {{ FeatureTodo | Refactor DB access | Try to do as much DB interaction as possible in DataStore, so that it can be easily replaced by a FakeDataStore for testing purposes. }}
|- {{ FeatureTodo |  Document ASAP | Properly document all ASAP commands and responses. Ideally should be part of doxygen documentation rather than a plaintext file. }}
|- {{ FeatureTodo | Optimize CacheCleaner | Right now the CacheCleaner requests all collections every minute and checks their cache policies. Instead we should use some form of scheduling queue.  }}
|}
|}



Revision as of 12:06, 20 February 2014

This is a list of things I want to do in kdepimlibs/akonadi for Frameworks 5.

Akonadi repo structure

Merge client libraries and server into one repository. Main advantage is that we will be able to share more code between server and libraries.

Proposed structure:

/autotests
/doc
/src
/src/agentbase (libKF5AkonadiAgentBase.so - AgentBase, ResourceBase and other classes related to agents. Needs a better name)
/src/agentserver (do we actually use it anywhere? Should it just die?)
/src/akonadictl (akonadictl utility)
/src/asapcat (asapcat utility)
/src/common (libKF5AkonadiCommon.so - classes shared between server, core and widgets libraries and other utilities. Does NOT install any (or most of its) public headers)
/src/control (akonadi_control utility)
/src/core (libKF5AkonadiCore.so - non-UI classes, only Jobs, models, Monitor etc.)
/src/core/jobs 
/src/core/models
/src/interfaces (DBus interfaces)
/src/qsqlite (Qt's QSQLITE driver fork - better try to upstream it)
/src/selftest (based on SelfTestDialog class)
/src/server (akonadiserver)
/src/widgets (libKF5AkonadiWidgets.so - UI classes, depends on core)
/src/widgets/views
/src/xml (akonadi/xml library)
/tests/akonaditest (akonaditest utility)
/tests/fake (fake classes to be used for testing)
/tests/searchplugin (akonadi_testsearch_plugin)
/tests/testresource (akonadi_knut_resource)

Client libraries

API/ABI changes

Status Class Action Comment Branch Assignee
TODO ItemSearchJob Remove deprecated methods frameworks
TODO ItemSync Make private? Does not seem to be used anywhere frameworks
TODO ItemView Remove deprecated methods frameworks
TODO KDSignalBlocker Remove? frameworks
TODO metatypes.h Remove master?
TODO MimeTypeChecker Maybe remove This class is able to compare mime types, handling aliases, inheritance, etc. AFAIK Volker once told me this should be in Qt 5, so check whether it's there. Might be worth upstreaming, too frameworks
TODO PersistentSearchAttribute Remove deprecated methods frameworks
TODO PluginLoader Remove if Qt 5 plugin system is powerful enough frameworks
TODO ProtocolHelper Share with Server See the Other Plans section below frameworks
TODO RecursiveItemFetchJob Optimize Emit itemsReceived() signal from underlaying fetch jobs master
TODO RenameFavoriteDialog Make private? frameworks
TODO ResourceSettings Remove? frameworks
TODO SearchCreateJob Remove deprecated methods frameworks
TODO SelfTestDialog Make a standalone application SelfTestDialog is the only user of QtSQL in client libraries. By making it a stand-alone app, we can get rid of one dependency from libKF5AkonadiCore.so master
TODO StatisticsProxyModel Remove frameworks
TODO SubscriptionJob Split to CollectionSubscribeJob and CollectionUnsubscribeJob? Keep the naming consistent frameworks
TODO TrashFilterProxyModel Remove? Does not seem to be used anywhere frameworks

Features

Features can mostly be implemented already now in master, but they are something I'd totally love to see in Frameworks.

Status Action Comment
TO DO Use ImapStreamParser in client jobs Will improve performance and memory consumption on client side. Also it's easier to use :) <{{{3}}}>
TO DO (IF POSSIBLE) Share external payload parts helper Concentrate external parts support into one place for easier maintanence and less code duplication <{{{3}}}>
TO DO Direct streaming of external payload parts For parts bigger than 4KB, the server can instead of asking client to provide the data send back a file descriptor that client will use to write the data directly to the file. Server can either verify that sizes match, or rely on client library telling the truth. Memory--, performance++ <{{{3}}}>

Server

Status Action Comment
TO DO Upstream QSQLITE3 driver I managed to figure out what the actual changes we have in our fork are. They are not implemented optimally, a proper implementation will be more complicated, but generally should ensure better performance. Then we can try to upstream those changes and get rid of the driver for good. <{{{3}}}>
TO DO Remove Nepomuk support We have Baloo now, we don't need Nepomuk anymore <{{{3}}}>
TO DO Remove SELECT command See comment at CollectionSelectJob in the table above <{{{3}}}>
TO DO Remove backward-compatibility with older protocol versions Some of the handlers still have several paths for supporting older client libraries. We don't even know whether they still work, so just get rid of them. <{{{3}}}>
TO DO Merge NotificationMessages Merge NotificationMessageV2 and V3 to NotificationMessage <{{{3}}}>
TO DO Remove legacy client support from NotificationManager Don't use the broadcast notify() signal anymore, only support notification subscribers. <{{{3}}}>
TO DO Refactor DB access Try to do as much DB interaction as possible in DataStore, so that it can be easily replaced by a FakeDataStore for testing purposes. <{{{3}}}>
TO DO Document ASAP Properly document all ASAP commands and responses. Ideally should be part of doxygen documentation rather than a plaintext file. <{{{3}}}>
TO DO Optimize CacheCleaner Right now the CacheCleaner requests all collections every minute and checks their cache policies. Instead we should use some form of scheduling queue. <{{{3}}}>

Other Plans

Testable Handlers

Does not really depend on Frameworks, can be done at any time. I 'want' to have it done in Frameworks though. Currently we have no way to test Handlers on the server. This would require having a fake DataStore, fake NotificationCollector, fake AkonadiConnection and somehow fake backend for Entities. However, as a result we should be able to send various commands to the handlers and observe whether correct data are stored in database and correct signals are emitted. Big problem with external payload parts, would require a fake ExternalPartManager too.

Shared protocol helper

In a perfect world, we would have Handlers in a shared library and the Handler would be able to parse the command into entities and vice versa. But since the server is using different entities than the client libraries (Akonadi::Server::Collection vs. Akonadi::Collection), this probably won't be possible. However we still should try to share code for handling ImapSets, parsing attributes, payload parts, etc. The first step toward this is to have client jobs use ImapStreamParser.