Ticket #1082 (closed task: fixed)
[API] hashtable should be created without filesystem interface access
| Reported by: | dgollub | Owned by: | dgollub |
|---|---|---|---|
| Priority: | highest | Milestone: | OpenSync 0.39 |
| Component: | OpenSync: Plugin API | Version: | 0.38 |
| Severity: | blocker | Keywords: | |
| Cc: |
Description
The current hashtable API requires/allows to specify a custom path. This makes updates and mainteancne a nightmare. Also moving to different database backends make this problematically for future releases.
We need to break the API before 0.39. Like the API change of the OSyncAnchor, we need to implement a "request" hashtable function which places the hashtable to a fixed location (this location is set internally in the engine $configdir/$member/hashtable.db).
-OSYNC_EXPORT OSyncHashTable *osync_hashtable_new(const char *path, const char *objtype, OSyncError **error);
Change History
comment:3 Changed 3 years ago by dgollub
(In [5371]) Dropped following interfaces: osync_hashtable_new osync_hashtable_ref osync_hashtable_unref osync_hashtable_load osync_hashtable_save
This affects all plugins using hashtables!
Short Porting instruction:
- Drop osync_hashtable_{un,}ref() calls (no replacement required)
- Drop osync_hashtable_new() (no replacement required)
- Drop calls like osync_plugin_info_get_configdir() if they were used to create a hashtable path (obsolete now)
- Drop calls of osync_hashtable_save() (no replacement required)
- Call osync_objtype_sink_enable_hashtable(OSyncObjTypeSink *sink, TRUE); in plugin init function for each ObjTypeSink?
- Hashtable will be initilaized and loaded by the Engine right after the plugin init function. Don't expect to get a HashTable? pointer in the init function!
- You can get an valid OSyncHashTable pointer by calling inside Plugin Sink Functions (e.g. connect, get_changes, commit, sync_done, ...):
OSyncHashTable *hashtable = osync_objtype_sink_get_hashtable(sink);
- Hashtable get stored after the sync_done() plugin call. No call by plugin required.
