* make mag-msg-store a configurable parameter; refactor the setting of the

xapian batch size
This commit is contained in:
Dirk-Jan C. Binnema
2011-01-15 13:27:41 +02:00
parent 62acc7739d
commit c76af05a7a
11 changed files with 145 additions and 71 deletions

View File

@ -41,7 +41,7 @@ typedef struct _MuStore MuStore;
*
* @return a new MuStore object, or NULL in case of error
*/
MuStore* mu_store_new (const char *path, guint batchsize, GError **err)
MuStore* mu_store_new (const char *path, GError **err)
G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;
@ -53,6 +53,20 @@ MuStore* mu_store_new (const char *path, guint batchsize, GError **err)
void mu_store_destroy (MuStore *store);
/**
* set the Xapian batch size for this store. Normally, there's no need
* to use this function as the default is good enough; however, if you
* use mu in a very memory-constrained environment, you can set the
* batchsize to e.g. 1000 at the cost of significant slow-down.
*
* @param store a valid store object
* @param batchsize the new batch size; or 0 to reset to
* the default batch size
*/
void mu_store_set_batch_size (MuStore *store, guint batchsize);
/**
* get the numbers of documents in the database
*
@ -104,8 +118,7 @@ MuResult mu_store_store (MuStore *store, MuMsg *msg);
*
* @return TRUE if it succeeded, FALSE otherwise
*/
MuResult mu_store_remove (MuStore *store,
const char* msgpath);
gboolean mu_store_remove (MuStore *store, const char* msgpath);
/**
@ -114,10 +127,9 @@ MuResult mu_store_remove (MuStore *store,
* @param store a store
* @param path the message path
*
* @return
* @return TRUE if the message exists, FALSE otherwise
*/
gboolean mu_store_contains_message (MuStore *store,
const char* path);
gboolean mu_store_contains_message (MuStore *store, const char* path);
/**
* store a timestamp for a directory