tracker r1900 - in branches/indexer-split: . src/trackerd
- From: mr svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1900 - in branches/indexer-split: . src/trackerd
- Date: Tue, 22 Jul 2008 11:00:05 +0000 (UTC)
Author: mr
Date: Tue Jul 22 11:00:05 2008
New Revision: 1900
URL: http://svn.gnome.org/viewvc/tracker?rev=1900&view=rev
Log:
* src/trackerd/tracker-processor.c: (item_queue_handlers_cb),
(crawler_finished_cb): Make it clear which module we are sending
items for and also fixed the cut and paste bug I introduced which
was using the _files_delete() API for new and updated files. Plus
now we have some main context iteration code in the tight loop
where we get back all files from the crawler. Being unresponsive
for 10 seconds while the processor adds 100k items into a queue
and create strings for each of them is not acceptable.
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/trackerd/tracker-processor.c
Modified: branches/indexer-split/src/trackerd/tracker-processor.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-processor.c (original)
+++ branches/indexer-split/src/trackerd/tracker-processor.c Tue Jul 22 11:00:05 2008
@@ -416,10 +416,10 @@
queue = get_next_queue_with_data (priv->items_deleted_queues, &module_name);
if (queue && g_queue_get_length (queue) > 0) {
- /* First do the deleted queue */
files = tracker_dbus_queue_str_to_strv (queue, ITEMS_QUEUE_PROCESS_MAX);
- g_message ("Queue for deleted items processed, sending first %d to the indexer",
+ g_message ("Queue for module:'%s' deleted items processed, sending first %d to the indexer",
+ module_name,
g_strv_length (files));
priv->sent_type = SENT_TYPE_DELETED;
@@ -435,44 +435,44 @@
return TRUE;
}
- /* Process the deleted items first */
+ /* Process the created items first */
queue = get_next_queue_with_data (priv->items_created_queues, &module_name);
if (queue && g_queue_get_length (queue) > 0) {
- /* First do the deleted queue */
files = tracker_dbus_queue_str_to_strv (queue, ITEMS_QUEUE_PROCESS_MAX);
- g_message ("Queue for created items processed, sending first %d to the indexer",
+ g_message ("Queue for module:'%s' created items processed, sending first %d to the indexer",
+ module_name,
g_strv_length (files));
priv->sent_type = SENT_TYPE_CREATED;
priv->sent_module_name = module_name;
priv->sent_items = files;
- org_freedesktop_Tracker_Indexer_files_delete_async (priv->indexer_proxy,
- module_name,
- (const gchar **) files,
- item_queue_processed_cb,
- processor);
+ org_freedesktop_Tracker_Indexer_files_check_async (priv->indexer_proxy,
+ module_name,
+ (const gchar **) files,
+ item_queue_processed_cb,
+ processor);
return TRUE;
}
- /* Process the deleted items first */
+ /* Process the updated items first */
queue = get_next_queue_with_data (priv->items_updated_queues, &module_name);
if (queue && g_queue_get_length (queue) > 0) {
- /* First do the deleted queue */
files = tracker_dbus_queue_str_to_strv (queue, ITEMS_QUEUE_PROCESS_MAX);
- g_message ("Queue for updated items processed, sending first %d to the indexer",
+ g_message ("Queue for module:'%s' updated items processed, sending first %d to the indexer",
+ module_name,
g_strv_length (files));
priv->sent_type = SENT_TYPE_UPDATED;
priv->sent_module_name = module_name;
priv->sent_items = files;
- org_freedesktop_Tracker_Indexer_files_delete_async (priv->indexer_proxy,
+ org_freedesktop_Tracker_Indexer_files_update_async (priv->indexer_proxy,
module_name,
(const gchar **) files,
item_queue_processed_cb,
@@ -781,6 +781,11 @@
path = g_file_get_path (file);
g_queue_push_tail (queue, path);
g_object_unref (file);
+
+ /* This is a tight loop, we should eleviate this */
+ while (g_main_context_pending (NULL)) {
+ g_main_context_iteration (NULL, FALSE);
+ }
}
/* Proceed to next module */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]