[tracker/miner-fs-refactor-multi-insert: 10/16] libtracker-miner: Use tracker prefix in the processing pool



commit 8d2b52cd909f5359659764a765edca825883a856
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Wed Oct 20 15:41:13 2010 +0200

    libtracker-miner: Use tracker prefix in the processing pool

 .../tracker-miner-fs-processing-pool.c             |  320 ++++++++++----------
 .../tracker-miner-fs-processing-pool.h             |   92 +++---
 src/libtracker-miner/tracker-miner-fs.c            |  192 ++++++------
 3 files changed, 308 insertions(+), 296 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs-processing-pool.c b/src/libtracker-miner/tracker-miner-fs-processing-pool.c
index a30540c..891f494 100644
--- a/src/libtracker-miner/tracker-miner-fs-processing-pool.c
+++ b/src/libtracker-miner/tracker-miner-fs-processing-pool.c
@@ -43,20 +43,20 @@
  *        like this:
  *         - processing_task_new() to create a new task
  *         - processing_task_set_sparql() to set the full SPARQL in the task.
- *         - processing_pool_push_ready_task() to push the newly created task
- *           into the processing pool as a "READY" task.
+ *         - tracker_processing_pool_push_ready_task() to push the newly created
+ *           task into the processing pool as a "READY" task.
  *
  *   2.2. The full SPARQL is still not available, as the upper layers need to
  *        process the file (like extracting metadata using tracker-extract
  *        in the case of TrackerMinerFiles). This case would correspond to
  *        CREATED or UPDATED events:
  *         - processing_task_new() to create a new task
- *         - processing_pool_push_wait_task() to push the newly created task
- *           into the processing pool as a "WAIT" task.
+ *         - tracker_processing_pool_push_wait_task() to push the newly created
+ *           task into the processing pool as a "WAIT" task.
  *         - processing_task_set_sparql() to set the full SPARQL in the task
  *           (when the upper layers finished building it).
- *         - processing_pool_push_ready_task() to push the newly created task
- *           into the processing pool as a "READY" task.
+ *         - tracker_processing_pool_push_ready_task() to push the newly created
+ *           task into the processing pool as a "READY" task.
  *
  *   2.3. Note that "PROCESSING" tasks are an internal status of the pool, the
  *        user of the processing pool cannot push a task with this status.
@@ -79,11 +79,11 @@
  * 5. When a task is pushed to the pool as a "READY" task, the pool will be in
  *    charge of executing the SPARQL update into the store.
  *
- * 6. If buffering was requested when processing_pool_push_ready_task() was used
- *    to push the new task in the pool as a "READY" task, this task will be
- *    added internally into a SPARQL buffer. This SPARQL buffer will be flushed
- *    (pushing all collected SPARQL updates into the store) if one of these
- *    conditions is met:
+ * 6. If buffering was requested when tracker_processing_pool_push_ready_task()
+ *    was used to push the new task in the pool as a "READY" task, this task
+ *    will be added internally into a SPARQL buffer. This SPARQL buffer will be
+ *    flushed (pushing all collected SPARQL updates into the store) if one of
+ *    these conditions is met:
  *      (a) The file corresponding to the task pushed doesn't have a parent.
  *      (b) The parent of the file corresponding to the task pushed is different
  *          to the parent of the last file pushed to the buffer.
@@ -97,12 +97,13 @@
  *    converted to "PROCESSING" state, until the reply from the store is
  *    received.
  *
- * 7. If buffering is not requested when processing_pool_push_ready_task() is
- *    called, first the previous buffer is flushed (if any) and then the current
- *    task is updated in the store, so this task goes directly from "READY" to
- *    "PROCESSING" state without going through the intermediate buffer.
+ * 7. If buffering is not requested when
+ *    tracker_processing_pool_push_ready_task() is called, first the previous
+ *    buffer is flushed (if any) and then the current task is updated in the
+ *    store, so this task goes directly from "READY" to "PROCESSING" state
+ *    without going through the intermediate buffer.
  *
- * 8. May the gods be with you if you need to fix a bug in here.
+ * 8. May the gods be with you if you need to fix a bug in here. So say we all.
  *
  */
 
@@ -112,17 +113,15 @@
 /* Maximum time (seconds) before forcing a sparql buffer flush */
 #define MAX_SPARQL_BUFFER_TIME  15
 
-/*------------------- PROCESSING TASK ----------------------*/
-
 typedef enum {
-	PROCESSING_TASK_STATUS_NO_POOL,
-	PROCESSING_TASK_STATUS_WAIT = 0,
-	PROCESSING_TASK_STATUS_READY,
-	PROCESSING_TASK_STATUS_PROCESSING,
-	PROCESSING_TASK_STATUS_LAST
-} ProcessingTaskStatus;
-
-struct _ProcessingTask {
+	TRACKER_PROCESSING_TASK_STATUS_NO_POOL,
+	TRACKER_PROCESSING_TASK_STATUS_WAIT = 0,
+	TRACKER_PROCESSING_TASK_STATUS_READY,
+	TRACKER_PROCESSING_TASK_STATUS_PROCESSING,
+	TRACKER_PROCESSING_TASK_STATUS_LAST
+} TrackerProcessingTaskStatus;
+
+struct _TrackerProcessingTask {
 	/* The file being processed */
 	GFile *file;
 	/* File URI, useful for logs */
@@ -135,29 +134,46 @@ struct _ProcessingTask {
 	GFreeFunc context_free_func;
 
 	/* Internal status of the task */
-	ProcessingTaskStatus status;
+	TrackerProcessingTaskStatus status;
 	/* The pool where the task was added */
-	ProcessingPool *pool;
+	TrackerProcessingPool *pool;
 
 	/* Handler and user_data to use when task is fully processed */
-	ProcessingPoolTaskFinishedCallback finished_handler;
-	gpointer                           finished_user_data;
+	TrackerProcessingPoolTaskFinishedCallback finished_handler;
+	gpointer finished_user_data;
+};
+
+struct _TrackerProcessingPool {
+	/* Connection to the Store */
+	TrackerSparqlConnection *connection;
+
+	/* The tasks currently in WAIT or PROCESS status */
+	GQueue *tasks[TRACKER_PROCESSING_TASK_STATUS_LAST];
+	/* The processing pool limits */
+	guint  limit[TRACKER_PROCESSING_TASK_STATUS_LAST];
+
+	/* SPARQL buffer to pile up several UPDATEs */
+	GPtrArray      *sparql_buffer;
+	GFile          *sparql_buffer_current_parent;
+	time_t          sparql_buffer_start_time;
 };
 
-ProcessingTask *
-processing_task_new (GFile *file)
+/*------------------- PROCESSING TASK ----------------------*/
+
+TrackerProcessingTask *
+tracker_processing_task_new (GFile *file)
 {
-	ProcessingTask *task;
+	TrackerProcessingTask *task;
 
-	task = g_slice_new0 (ProcessingTask);
+	task = g_slice_new0 (TrackerProcessingTask);
 	task->file = g_object_ref (file);
 	task->file_uri = g_file_get_uri (task->file);
-	task->status = PROCESSING_TASK_STATUS_NO_POOL;
+	task->status = TRACKER_PROCESSING_TASK_STATUS_NO_POOL;
 	return task;
 }
 
 void
-processing_task_free (ProcessingTask *task)
+tracker_processing_task_free (TrackerProcessingTask *task)
 {
 	if (!task)
 		return;
@@ -170,25 +186,25 @@ processing_task_free (ProcessingTask *task)
 	g_free (task->sparql);
 	g_free (task->file_uri);
 	g_object_unref (task->file);
-	g_slice_free (ProcessingTask, task);
+	g_slice_free (TrackerProcessingTask, task);
 }
 
 GFile *
-processing_task_get_file (ProcessingTask *task)
+tracker_processing_task_get_file (TrackerProcessingTask *task)
 {
 	return task->file;
 }
 
 gpointer
-processing_task_get_context (ProcessingTask *task)
+tracker_processing_task_get_context (TrackerProcessingTask *task)
 {
 	return task->context;
 }
 
 void
-processing_task_set_context (ProcessingTask *task,
-                             gpointer        context,
-                             GFreeFunc       context_free_func)
+tracker_processing_task_set_context (TrackerProcessingTask *task,
+                                     gpointer               context,
+                                     GFreeFunc              context_free_func)
 {
 	/* Free previous context if any and if requested to do so */
 	if (task->context &&
@@ -201,8 +217,8 @@ processing_task_set_context (ProcessingTask *task,
 }
 
 void
-processing_task_set_sparql (ProcessingTask *task,
-                            gchar          *sparql)
+tracker_processing_task_set_sparql (TrackerProcessingTask *task,
+                                    gchar                 *sparql)
 {
 	g_free (task->sparql);
 	task->sparql = g_strdup (sparql);
@@ -211,21 +227,6 @@ processing_task_set_sparql (ProcessingTask *task,
 
 /*------------------- PROCESSING POOL ----------------------*/
 
-struct _ProcessingPool {
-	/* Connection to the Store */
-	TrackerSparqlConnection *connection;
-
-	/* The tasks currently in WAIT or PROCESS status */
-	GQueue *tasks[PROCESSING_TASK_STATUS_LAST];
-	/* The processing pool limits */
-	guint  limit[PROCESSING_TASK_STATUS_LAST];
-
-	/* SPARQL buffer to pile up several UPDATEs */
-	GPtrArray      *sparql_buffer;
-	GFile          *sparql_buffer_current_parent;
-	time_t          sparql_buffer_start_time;
-};
-
 static void
 pool_queue_free_foreach (gpointer data,
                          gpointer user_data)
@@ -235,12 +236,12 @@ pool_queue_free_foreach (gpointer data,
 	/* If found in the SPARQL buffer, remove it (will call task_free itself) */
 	if (!g_ptr_array_remove (sparql_buffer, data)) {
 		/* If not removed from the array, free it ourselves */
-		processing_task_free (data);
+		tracker_processing_task_free (data);
 	}
 }
 
 void
-processing_pool_free (ProcessingPool *pool)
+tracker_processing_pool_free (TrackerProcessingPool *pool)
 {
 	guint i;
 
@@ -249,8 +250,8 @@ processing_pool_free (ProcessingPool *pool)
 
 	/* Free any pending task here... shouldn't really
 	 * be any */
-	for (i = PROCESSING_TASK_STATUS_WAIT;
-	     i < PROCESSING_TASK_STATUS_LAST;
+	for (i = TRACKER_PROCESSING_TASK_STATUS_WAIT;
+	     i < TRACKER_PROCESSING_TASK_STATUS_LAST;
 	     i++) {
 		g_queue_foreach (pool->tasks[i],
 		                 pool_queue_free_foreach,
@@ -270,24 +271,24 @@ processing_pool_free (ProcessingPool *pool)
 	g_free (pool);
 }
 
-ProcessingPool *
-processing_pool_new (TrackerSparqlConnection *connection,
-                     guint                    limit_wait,
-                     guint                    limit_ready)
+TrackerProcessingPool *
+tracker_processing_pool_new (TrackerSparqlConnection *connection,
+                             guint                    limit_wait,
+                             guint                    limit_ready)
 {
-	ProcessingPool *pool;
+	TrackerProcessingPool *pool;
 
-	pool = g_new0 (ProcessingPool, 1);
+	pool = g_new0 (TrackerProcessingPool, 1);
 
 	pool->connection = g_object_ref (connection);
-	pool->limit[PROCESSING_TASK_STATUS_WAIT] = limit_wait;
-	pool->limit[PROCESSING_TASK_STATUS_READY] = limit_ready;
+	pool->limit[TRACKER_PROCESSING_TASK_STATUS_WAIT] = limit_wait;
+	pool->limit[TRACKER_PROCESSING_TASK_STATUS_READY] = limit_ready;
 	/* convenience limit, not really used currently */
-	pool->limit[PROCESSING_TASK_STATUS_PROCESSING] = G_MAXUINT;
+	pool->limit[TRACKER_PROCESSING_TASK_STATUS_PROCESSING] = G_MAXUINT;
 
-	pool->tasks[PROCESSING_TASK_STATUS_WAIT] = g_queue_new ();
-	pool->tasks[PROCESSING_TASK_STATUS_READY] = g_queue_new ();
-	pool->tasks[PROCESSING_TASK_STATUS_PROCESSING] = g_queue_new ();
+	pool->tasks[TRACKER_PROCESSING_TASK_STATUS_WAIT] = g_queue_new ();
+	pool->tasks[TRACKER_PROCESSING_TASK_STATUS_READY] = g_queue_new ();
+	pool->tasks[TRACKER_PROCESSING_TASK_STATUS_PROCESSING] = g_queue_new ();
 
 	g_debug ("Processing pool created with a limit of "
 	         "%u tasks in WAIT status and "
@@ -299,63 +300,63 @@ processing_pool_new (TrackerSparqlConnection *connection,
 }
 
 void
-processing_pool_set_wait_limit (ProcessingPool *pool,
-                                guint           limit)
+tracker_processing_pool_set_wait_limit (TrackerProcessingPool *pool,
+                                        guint                  limit)
 {
 	g_message ("Processing pool limit for WAIT tasks set to %u", limit);
-	pool->limit[PROCESSING_TASK_STATUS_WAIT] = limit;
+	pool->limit[TRACKER_PROCESSING_TASK_STATUS_WAIT] = limit;
 }
 
 void
-processing_pool_set_ready_limit (ProcessingPool *pool,
-                                 guint           limit)
+tracker_processing_pool_set_ready_limit (TrackerProcessingPool *pool,
+                                         guint                  limit)
 {
 	g_message ("Processing pool limit for READY tasks set to %u", limit);
-	pool->limit[PROCESSING_TASK_STATUS_READY] = limit;
+	pool->limit[TRACKER_PROCESSING_TASK_STATUS_READY] = limit;
 }
 
 guint
-processing_pool_get_wait_limit (ProcessingPool *pool)
+tracker_processing_pool_get_wait_limit (TrackerProcessingPool *pool)
 {
-	return pool->limit[PROCESSING_TASK_STATUS_WAIT];
+	return pool->limit[TRACKER_PROCESSING_TASK_STATUS_WAIT];
 }
 
 guint
-processing_pool_get_ready_limit (ProcessingPool *pool)
+tracker_processing_pool_get_ready_limit (TrackerProcessingPool *pool)
 {
-	return pool->limit[PROCESSING_TASK_STATUS_READY];
+	return pool->limit[TRACKER_PROCESSING_TASK_STATUS_READY];
 }
 
 gboolean
-processing_pool_wait_limit_reached (ProcessingPool *pool)
+tracker_processing_pool_wait_limit_reached (TrackerProcessingPool *pool)
 {
-	return ((g_queue_get_length (pool->tasks[PROCESSING_TASK_STATUS_WAIT]) >=
-	         pool->limit[PROCESSING_TASK_STATUS_WAIT]) ?
+	return ((g_queue_get_length (pool->tasks[TRACKER_PROCESSING_TASK_STATUS_WAIT]) >=
+	         pool->limit[TRACKER_PROCESSING_TASK_STATUS_WAIT]) ?
 	        TRUE : FALSE);
 }
 
 gboolean
-processing_pool_ready_limit_reached (ProcessingPool *pool)
+tracker_processing_pool_ready_limit_reached (TrackerProcessingPool *pool)
 {
-	return ((g_queue_get_length (pool->tasks[PROCESSING_TASK_STATUS_READY]) >=
-	         pool->limit[PROCESSING_TASK_STATUS_READY]) ?
+	return ((g_queue_get_length (pool->tasks[TRACKER_PROCESSING_TASK_STATUS_READY]) >=
+	         pool->limit[TRACKER_PROCESSING_TASK_STATUS_READY]) ?
 	        TRUE : FALSE);
 }
 
-ProcessingTask *
-processing_pool_find_task (ProcessingPool *pool,
-                           GFile          *file,
-                           gboolean        path_search)
+TrackerProcessingTask *
+tracker_processing_pool_find_task (TrackerProcessingPool *pool,
+                                   GFile                 *file,
+                                   gboolean               path_search)
 {
 	guint i;
 
-	for (i = PROCESSING_TASK_STATUS_WAIT;
-	     i < PROCESSING_TASK_STATUS_LAST;
+	for (i = TRACKER_PROCESSING_TASK_STATUS_WAIT;
+	     i < TRACKER_PROCESSING_TASK_STATUS_LAST;
 	     i++) {
 		GList *l;
 
 		for (l = pool->tasks[i]->head; l; l = g_list_next (l)) {
-			ProcessingTask *task = l->data;
+			TrackerProcessingTask *task = l->data;
 
 			if (!path_search) {
 				/* Different operations for the same file URI could be
@@ -383,29 +384,29 @@ processing_pool_find_task (ProcessingPool *pool,
 }
 
 void
-processing_pool_push_wait_task (ProcessingPool *pool,
-                                ProcessingTask *task)
+tracker_processing_pool_push_wait_task (TrackerProcessingPool *pool,
+                                        TrackerProcessingTask *task)
 {
-	g_assert (task->status == PROCESSING_TASK_STATUS_NO_POOL);
+	g_assert (task->status == TRACKER_PROCESSING_TASK_STATUS_NO_POOL);
 
 	/* Set status of the task as WAIT */
-	task->status = PROCESSING_TASK_STATUS_WAIT;
+	task->status = TRACKER_PROCESSING_TASK_STATUS_WAIT;
 
 	g_debug ("(Processing Pool) Pushed WAIT task %p for file '%s'",
 	         task, task->file_uri);
 
 	/* Push a new task in WAIT status (so just add it to the tasks queue,
 	 * and don't process it. */
-	g_queue_push_head (pool->tasks[PROCESSING_TASK_STATUS_WAIT], task);
+	g_queue_push_head (pool->tasks[TRACKER_PROCESSING_TASK_STATUS_WAIT], task);
 	task->pool = pool;
 }
 
 static void
-processing_pool_sparql_update_cb (GObject      *object,
-                                  GAsyncResult *result,
-                                  gpointer      user_data)
+tracker_processing_pool_sparql_update_cb (GObject      *object,
+                                          GAsyncResult *result,
+                                          gpointer      user_data)
 {
-	ProcessingTask *task;
+	TrackerProcessingTask *task;
 	GError *error = NULL;
 
 	tracker_sparql_connection_update_finish (TRACKER_SPARQL_CONNECTION (object), result, &error);
@@ -421,20 +422,20 @@ processing_pool_sparql_update_cb (GObject      *object,
 
 	/* Before calling user-provided callback, REMOVE the task from the pool;
 	 * as the user-provided callback may actually modify the pool again */
-	processing_pool_remove_task (task->pool, task);
+	tracker_processing_pool_remove_task (task->pool, task);
 
 	/* Call finished handler with the error, if any */
 	task->finished_handler (task, task->finished_user_data, error);
 
 	/* Deallocate unneeded stuff */
-	processing_task_free (task);
+	tracker_processing_task_free (task);
 	g_clear_error (&error);
 }
 
 static void
-processing_pool_sparql_update_array_cb (GObject      *object,
-                                        GAsyncResult *result,
-                                        gpointer      user_data)
+tracker_processing_pool_sparql_update_array_cb (GObject      *object,
+                                                GAsyncResult *result,
+                                                gpointer      user_data)
 {
 	GError *global_error = NULL;
 	GPtrArray *sparql_array_errors;
@@ -459,13 +460,13 @@ processing_pool_sparql_update_array_cb (GObject      *object,
 
 	/* Report status on each task of the batch update */
 	for (i = 0; i < sparql_array->len; i++) {
-		ProcessingTask *task;
+		TrackerProcessingTask *task;
 
 		task = g_ptr_array_index (sparql_array, i);
 
 		/* Before calling user-provided callback, REMOVE the task from the pool;
 		 * as the user-provided callback may actually modify the pool again */
-		processing_pool_remove_task (task->pool, task);
+		tracker_processing_pool_remove_task (task->pool, task);
 
 		/* Call finished handler with the error, if any */
 		task->finished_handler (task, task->finished_user_data,
@@ -486,7 +487,7 @@ processing_pool_sparql_update_array_cb (GObject      *object,
 }
 
 void
-processing_pool_buffer_flush (ProcessingPool *pool)
+tracker_processing_pool_buffer_flush (TrackerProcessingPool *pool)
 {
 	guint i;
 	gchar **sparql_array;
@@ -497,19 +498,19 @@ processing_pool_buffer_flush (ProcessingPool *pool)
 	/* Loop buffer and construct array of strings */
 	sparql_array = g_new (gchar *, pool->sparql_buffer->len);
 	for (i = 0; i < pool->sparql_buffer->len; i++) {
-		ProcessingTask *task;
+		TrackerProcessingTask *task;
 
 		task = g_ptr_array_index (pool->sparql_buffer, i);
 
 		/* Make sure it was a READY task */
-		g_assert (task->status == PROCESSING_TASK_STATUS_READY);
+		g_assert (task->status == TRACKER_PROCESSING_TASK_STATUS_READY);
 
 		/* Remove the task from the READY queue and add it to the
 		 * PROCESSING one. */
-		processing_pool_remove_task (pool, task);
-		task->status = PROCESSING_TASK_STATUS_PROCESSING;
+		tracker_processing_pool_remove_task (pool, task);
+		task->status = TRACKER_PROCESSING_TASK_STATUS_PROCESSING;
 		task->pool = pool;
-		g_queue_push_head (pool->tasks[PROCESSING_TASK_STATUS_PROCESSING], task);
+		g_queue_push_head (pool->tasks[TRACKER_PROCESSING_TASK_STATUS_PROCESSING], task);
 
 		/* Add original string, not a duplicate */
 		sparql_array[i] = task->sparql;
@@ -523,7 +524,7 @@ processing_pool_buffer_flush (ProcessingPool *pool)
 	                                              pool->sparql_buffer->len,
 	                                              G_PRIORITY_DEFAULT,
 	                                              NULL,
-	                                              processing_pool_sparql_update_array_cb,
+	                                              tracker_processing_pool_sparql_update_array_cb,
 	                                              pool->sparql_buffer);
 
 	/* Clear current parent */
@@ -541,11 +542,11 @@ processing_pool_buffer_flush (ProcessingPool *pool)
 }
 
 gboolean
-processing_pool_push_ready_task (ProcessingPool                     *pool,
-                                 ProcessingTask                     *task,
-                                 gboolean                            buffer,
-                                 ProcessingPoolTaskFinishedCallback  finished_handler,
-                                 gpointer                            user_data)
+tracker_processing_pool_push_ready_task (TrackerProcessingPool                     *pool,
+                                         TrackerProcessingTask                     *task,
+                                         gboolean                                   buffer,
+                                         TrackerProcessingPoolTaskFinishedCallback  finished_handler,
+                                         gpointer                                   user_data)
 {
 	GList *previous;
 
@@ -553,12 +554,12 @@ processing_pool_push_ready_task (ProcessingPool                     *pool,
 	g_assert (task->sparql != NULL);
 
 	/* First, check if the task was already added as being WAITING */
-	previous = g_queue_find (pool->tasks[PROCESSING_TASK_STATUS_WAIT], task);
+	previous = g_queue_find (pool->tasks[TRACKER_PROCESSING_TASK_STATUS_WAIT], task);
 	if (previous) {
 		/* Make sure it was a WAIT task */
-		g_assert (task->status == PROCESSING_TASK_STATUS_WAIT);
+		g_assert (task->status == TRACKER_PROCESSING_TASK_STATUS_WAIT);
 		/* Remove task from WAIT queue */
-		g_queue_delete_link (pool->tasks[PROCESSING_TASK_STATUS_WAIT], previous);
+		g_queue_delete_link (pool->tasks[TRACKER_PROCESSING_TASK_STATUS_WAIT], previous);
 	} else {
 		/* Set pool */
 		task->pool = pool;
@@ -569,23 +570,23 @@ processing_pool_push_ready_task (ProcessingPool                     *pool,
 
 	/* If buffering not requested, OR the limit of READY tasks is actually 1,
 	 * flush previous buffer (if any) and then the new update */
-	if (!buffer || pool->limit[PROCESSING_TASK_STATUS_READY] == 1) {
+	if (!buffer || pool->limit[TRACKER_PROCESSING_TASK_STATUS_READY] == 1) {
 		g_debug ("(Processing Pool) Pushed READY/PROCESSING task %p for file '%s'",
 		         task, task->file_uri);
 
 		/* Flush previous */
-		processing_pool_buffer_flush (pool);
+		tracker_processing_pool_buffer_flush (pool);
 
 		/* Set status of the task as PROCESSING (No READY status here!) */
-		task->status = PROCESSING_TASK_STATUS_PROCESSING;
-		g_queue_push_head (pool->tasks[PROCESSING_TASK_STATUS_PROCESSING], task);
+		task->status = TRACKER_PROCESSING_TASK_STATUS_PROCESSING;
+		g_queue_push_head (pool->tasks[TRACKER_PROCESSING_TASK_STATUS_PROCESSING], task);
 
 		/* And update the new one */
 		tracker_sparql_connection_update_async (pool->connection,
 		                                        task->sparql,
 		                                        G_PRIORITY_DEFAULT,
 		                                        NULL,
-		                                        processing_pool_sparql_update_cb,
+		                                        tracker_processing_pool_sparql_update_cb,
 		                                        task);
 
 		return TRUE;
@@ -594,15 +595,16 @@ processing_pool_push_ready_task (ProcessingPool                     *pool,
 		gboolean flushed = FALSE;
 
 		/* Set status of the task as READY */
-		task->status = PROCESSING_TASK_STATUS_READY;
-		g_queue_push_head (pool->tasks[PROCESSING_TASK_STATUS_READY], task);
+		task->status = TRACKER_PROCESSING_TASK_STATUS_READY;
+		g_queue_push_head (pool->tasks[TRACKER_PROCESSING_TASK_STATUS_READY], task);
 
 		/* Get parent of this file we're updating/creating */
 		parent = g_file_get_parent (task->file);
 
 		/* Start buffer if not already done */
 		if (!pool->sparql_buffer) {
-			pool->sparql_buffer = g_ptr_array_new_with_free_func ((GDestroyNotify) processing_task_free);
+			pool->sparql_buffer =
+				g_ptr_array_new_with_free_func ((GDestroyNotify) tracker_processing_task_free);
 			pool->sparql_buffer_start_time = time (NULL);
 		}
 
@@ -625,10 +627,10 @@ processing_pool_push_ready_task (ProcessingPool                     *pool,
 		 */
 		if (!parent ||
 		    !g_file_equal (parent, pool->sparql_buffer_current_parent) ||
-		    processing_pool_ready_limit_reached (pool) ||
+		    tracker_processing_pool_ready_limit_reached (pool) ||
 		    (time (NULL) - pool->sparql_buffer_start_time > MAX_SPARQL_BUFFER_TIME)) {
 			/* Flush! */
-			processing_pool_buffer_flush (pool);
+			tracker_processing_pool_buffer_flush (pool);
 			flushed = TRUE;
 		}
 
@@ -640,8 +642,8 @@ processing_pool_push_ready_task (ProcessingPool                     *pool,
 }
 
 void
-processing_pool_remove_task (ProcessingPool *pool,
-                             ProcessingTask *task)
+tracker_processing_pool_remove_task (TrackerProcessingPool *pool,
+                                     TrackerProcessingTask *task)
 {
 	/* Remove from pool without freeing it */
 	GList *in_pool;
@@ -654,44 +656,44 @@ processing_pool_remove_task (ProcessingPool *pool,
 
 	g_queue_delete_link (pool->tasks[task->status], in_pool);
 	task->pool = NULL;
-	task->status = PROCESSING_TASK_STATUS_NO_POOL;
+	task->status = TRACKER_PROCESSING_TASK_STATUS_NO_POOL;
 }
 
 guint
-processing_pool_get_wait_task_count (ProcessingPool *pool)
+tracker_processing_pool_get_wait_task_count (TrackerProcessingPool *pool)
 {
-	return g_queue_get_length (pool->tasks[PROCESSING_TASK_STATUS_WAIT]);
+	return g_queue_get_length (pool->tasks[TRACKER_PROCESSING_TASK_STATUS_WAIT]);
 }
 
 guint
-processing_pool_get_ready_task_count (ProcessingPool *pool)
+tracker_processing_pool_get_ready_task_count (TrackerProcessingPool *pool)
 {
-	return g_queue_get_length (pool->tasks[PROCESSING_TASK_STATUS_READY]);
+	return g_queue_get_length (pool->tasks[TRACKER_PROCESSING_TASK_STATUS_READY]);
 }
 
 guint
-processing_pool_get_total_task_count (ProcessingPool *pool)
+tracker_processing_pool_get_total_task_count (TrackerProcessingPool *pool)
 {
 	guint total = 0;
 	guint i;
 
-	for (i = PROCESSING_TASK_STATUS_WAIT;
-	     i < PROCESSING_TASK_STATUS_LAST;
+	for (i = TRACKER_PROCESSING_TASK_STATUS_WAIT;
+	     i < TRACKER_PROCESSING_TASK_STATUS_LAST;
 	     i++) {
 		total += g_queue_get_length (pool->tasks[i]);
 	}
 	return total;
 }
 
-ProcessingTask *
-processing_pool_get_last_wait (ProcessingPool *pool)
+TrackerProcessingTask *
+tracker_processing_pool_get_last_wait (TrackerProcessingPool *pool)
 {
 	GList *li;
 
-	for (li = pool->tasks[PROCESSING_TASK_STATUS_WAIT]->tail; li; li = g_list_previous (li)) {
-		ProcessingTask *task = li->data;
+	for (li = pool->tasks[TRACKER_PROCESSING_TASK_STATUS_WAIT]->tail; li; li = g_list_previous (li)) {
+		TrackerProcessingTask *task = li->data;
 
-		if (task->status == PROCESSING_TASK_STATUS_WAIT) {
+		if (task->status == TRACKER_PROCESSING_TASK_STATUS_WAIT) {
 			return task;
 		}
 	}
@@ -699,14 +701,14 @@ processing_pool_get_last_wait (ProcessingPool *pool)
 }
 
 void
-processing_pool_foreach (ProcessingPool *pool,
-                         GFunc           func,
-                         gpointer        user_data)
+tracker_processing_pool_foreach (TrackerProcessingPool *pool,
+                                 GFunc                  func,
+                                 gpointer               user_data)
 {
 	guint i;
 
-	for (i = PROCESSING_TASK_STATUS_WAIT;
-	     i < PROCESSING_TASK_STATUS_LAST;
+	for (i = TRACKER_PROCESSING_TASK_STATUS_WAIT;
+	     i < TRACKER_PROCESSING_TASK_STATUS_LAST;
 	     i++) {
 		g_queue_foreach (pool->tasks[i], func, user_data);
 	}
diff --git a/src/libtracker-miner/tracker-miner-fs-processing-pool.h b/src/libtracker-miner/tracker-miner-fs-processing-pool.h
index 939d526..8b3503a 100644
--- a/src/libtracker-miner/tracker-miner-fs-processing-pool.h
+++ b/src/libtracker-miner/tracker-miner-fs-processing-pool.h
@@ -29,57 +29,57 @@
 G_BEGIN_DECLS
 
 
-typedef struct _ProcessingTask ProcessingTask;
-typedef struct _ProcessingPool ProcessingPool;
-typedef void  (* ProcessingPoolTaskFinishedCallback) (ProcessingTask *task,
-                                                      gpointer        user_data,
-                                                      const GError   *error);
+typedef struct _TrackerProcessingTask TrackerProcessingTask;
+typedef struct _TrackerProcessingPool TrackerProcessingPool;
+typedef void  (* TrackerProcessingPoolTaskFinishedCallback) (TrackerProcessingTask *task,
+                                                             gpointer               user_data,
+                                                             const GError          *error);
 
 
-ProcessingTask *processing_task_new         (GFile          *file);
-void            processing_task_free        (ProcessingTask *task);
-GFile          *processing_task_get_file    (ProcessingTask *task);
-gpointer        processing_task_get_context (ProcessingTask *task);
-void            processing_task_set_context (ProcessingTask *task,
-                                             gpointer        context,
-                                             GFreeFunc       context_free_func);
-void            processing_task_set_sparql  (ProcessingTask *task,
-                                             gchar          *sparql);
+TrackerProcessingTask *tracker_processing_task_new         (GFile          *file);
+void                   tracker_processing_task_free        (TrackerProcessingTask *task);
+GFile                 *tracker_processing_task_get_file    (TrackerProcessingTask *task);
+gpointer               tracker_processing_task_get_context (TrackerProcessingTask *task);
+void                   tracker_processing_task_set_context (TrackerProcessingTask *task,
+                                                            gpointer               context,
+                                                            GFreeFunc              context_free_func);
+void                   tracker_processing_task_set_sparql  (TrackerProcessingTask *task,
+                                                            gchar                 *sparql);
 
 
-ProcessingPool *processing_pool_new                   (TrackerSparqlConnection *connection,
-                                                       guint                    limit_wait,
-                                                       guint                    limit_process);
-void            processing_pool_free                  (ProcessingPool          *pool);
-void            processing_pool_set_wait_limit        (ProcessingPool          *pool,
-                                                       guint                    limit);
-void            processing_pool_set_ready_limit       (ProcessingPool          *pool,
-                                                       guint                    limit);
-guint           processing_pool_get_wait_limit        (ProcessingPool          *pool);
-guint           processing_pool_get_ready_limit       (ProcessingPool          *pool);
-ProcessingTask *processing_pool_find_task             (ProcessingPool          *pool,
-                                                       GFile                   *file,
-                                                       gboolean                 path_search);
-gboolean        processing_pool_wait_limit_reached    (ProcessingPool          *pool);
-gboolean        processing_pool_ready_limit_reached   (ProcessingPool          *pool);
+TrackerProcessingPool *tracker_processing_pool_new                   (TrackerSparqlConnection *connection,
+                                                                      guint                    limit_wait,
+                                                                      guint                    limit_process);
+void                   tracker_processing_pool_free                  (TrackerProcessingPool   *pool);
+void                   tracker_processing_pool_set_wait_limit        (TrackerProcessingPool   *pool,
+                                                                      guint                    limit);
+void                   tracker_processing_pool_set_ready_limit       (TrackerProcessingPool   *pool,
+                                                                      guint                    limit);
+guint                  tracker_processing_pool_get_wait_limit        (TrackerProcessingPool   *pool);
+guint                  tracker_processing_pool_get_ready_limit       (TrackerProcessingPool   *pool);
+TrackerProcessingTask *tracker_processing_pool_find_task             (TrackerProcessingPool   *pool,
+                                                                      GFile                   *file,
+                                                                      gboolean                 path_search);
+gboolean               tracker_processing_pool_wait_limit_reached    (TrackerProcessingPool   *pool);
+gboolean               tracker_processing_pool_ready_limit_reached   (TrackerProcessingPool   *pool);
 
-void            processing_pool_remove_task           (ProcessingPool          *pool,
-                                                       ProcessingTask          *task);
-void            processing_pool_push_wait_task        (ProcessingPool          *pool,
-                                                       ProcessingTask          *task);
-gboolean        processing_pool_push_ready_task       (ProcessingPool          *pool,
-                                                       ProcessingTask          *task,
-                                                       gboolean                 buffer,
-                                                       ProcessingPoolTaskFinishedCallback  finished_handler,
-                                                       gpointer                 user_data);
-guint           processing_pool_get_wait_task_count    (ProcessingPool         *pool);
-guint           processing_pool_get_ready_task_count   (ProcessingPool         *pool);
-guint           processing_pool_get_total_task_count   (ProcessingPool         *pool);
-ProcessingTask *processing_pool_get_last_wait          (ProcessingPool         *pool);
-void            processing_pool_foreach                (ProcessingPool         *pool,
-                                                        GFunc                   func,
-                                                        gpointer                user_data);
-void            processing_pool_buffer_flush           (ProcessingPool         *pool);
+void                   tracker_processing_pool_remove_task           (TrackerProcessingPool   *pool,
+                                                                      TrackerProcessingTask   *task);
+void                   tracker_processing_pool_push_wait_task        (TrackerProcessingPool   *pool,
+                                                                      TrackerProcessingTask   *task);
+gboolean               tracker_processing_pool_push_ready_task       (TrackerProcessingPool   *pool,
+                                                                      TrackerProcessingTask   *task,
+                                                                      gboolean                 buffer,
+                                                                      TrackerProcessingPoolTaskFinishedCallback finished_handler,
+                                                                      gpointer                 user_data);
+guint                  tracker_processing_pool_get_wait_task_count   (TrackerProcessingPool   *pool);
+guint                  tracker_processing_pool_get_ready_task_count  (TrackerProcessingPool   *pool);
+guint                  tracker_processing_pool_get_total_task_count  (TrackerProcessingPool   *pool);
+TrackerProcessingTask *tracker_processing_pool_get_last_wait         (TrackerProcessingPool   *pool);
+void                   tracker_processing_pool_foreach               (TrackerProcessingPool   *pool,
+                                                                      GFunc                    func,
+                                                                      gpointer                 user_data);
+void                   tracker_processing_pool_buffer_flush          (TrackerProcessingPool   *pool);
 
 G_END_DECLS
 
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 39e95ec..5ad8033 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -130,7 +130,7 @@ struct _TrackerMinerFSPrivate {
 
 	gdouble         throttle;
 
-	ProcessingPool *processing_pool;
+	TrackerProcessingPool *processing_pool;
 
 	/* URI mtime cache */
 	GFile          *current_mtime_cache_parent;
@@ -577,9 +577,9 @@ tracker_miner_fs_init (TrackerMinerFS *object)
 	                                                        (GDestroyNotify) NULL);
 
 	/* Create processing pool */
-	priv->processing_pool = processing_pool_new (tracker_miner_get_connection (TRACKER_MINER (object)),
-	                                             DEFAULT_WAIT_POOL_LIMIT,
-	                                             DEFAULT_READY_POOL_LIMIT);
+	priv->processing_pool = tracker_processing_pool_new (tracker_miner_get_connection (TRACKER_MINER (object)),
+                                                             DEFAULT_WAIT_POOL_LIMIT,
+                                                             DEFAULT_READY_POOL_LIMIT);
 
 	/* Set up the crawlers now we have config and hal */
 	priv->crawler = tracker_crawler_new ();
@@ -677,7 +677,7 @@ fs_finalize (GObject *object)
 	g_queue_foreach (priv->crawled_directories, (GFunc) crawled_directory_data_free, NULL);
 	g_queue_free (priv->crawled_directories);
 
-	processing_pool_free (priv->processing_pool);
+	tracker_processing_pool_free (priv->processing_pool);
 
 	g_queue_foreach (priv->items_moved, (GFunc) item_moved_data_free, NULL);
 	g_queue_free (priv->items_moved);
@@ -725,12 +725,12 @@ fs_set_property (GObject      *object,
 		                               g_value_get_double (value));
 		break;
 	case PROP_WAIT_POOL_LIMIT:
-		processing_pool_set_wait_limit (fs->private->processing_pool,
-		                                g_value_get_uint (value));
+		tracker_processing_pool_set_wait_limit (fs->private->processing_pool,
+                                                        g_value_get_uint (value));
 		break;
 	case PROP_READY_POOL_LIMIT:
-		processing_pool_set_ready_limit (fs->private->processing_pool,
-		                                 g_value_get_uint (value));
+		tracker_processing_pool_set_ready_limit (fs->private->processing_pool,
+                                                         g_value_get_uint (value));
 		break;
 	case PROP_MTIME_CHECKING:
 		fs->private->mtime_checking = g_value_get_boolean (value);
@@ -760,11 +760,11 @@ fs_get_property (GObject    *object,
 		break;
 	case PROP_WAIT_POOL_LIMIT:
 		g_value_set_uint (value,
-		                  processing_pool_get_wait_limit (fs->private->processing_pool));
+		                  tracker_processing_pool_get_wait_limit (fs->private->processing_pool));
 		break;
 	case PROP_READY_POOL_LIMIT:
 		g_value_set_uint (value,
-		                  processing_pool_get_ready_limit (fs->private->processing_pool));
+		                  tracker_processing_pool_get_ready_limit (fs->private->processing_pool));
 		break;
 	case PROP_MTIME_CHECKING:
 		g_value_set_boolean (value, fs->private->mtime_checking);
@@ -996,9 +996,9 @@ item_moved_data_free (ItemMovedData *data)
 }
 
 static void
-processing_pool_task_finished_cb (ProcessingTask *task,
-                                  gpointer        user_data,
-                                  const GError   *error)
+processing_pool_task_finished_cb (TrackerProcessingTask *task,
+                                  gpointer               user_data,
+                                  const GError          *error)
 {
 	TrackerMinerFS *fs;
 	TrackerMinerFSPrivate *priv;
@@ -1014,7 +1014,7 @@ processing_pool_task_finished_cb (ProcessingTask *task,
 			GFile *parent;
 			GFile *task_file;
 
-			task_file = processing_task_get_file (task);
+			task_file = tracker_processing_task_get_file (task);
 
 			/* Note: parent may be NULL if the file represents
 			 * the root directory of the file system (applies to
@@ -1400,11 +1400,11 @@ iri_cache_invalidate (TrackerMinerFS *fs,
 }
 
 static UpdateProcessingTaskContext *
-update_process_task_context_new (TrackerMiner         *miner,
-                                 const gchar          *urn,
-                                 const gchar          *parent_urn,
-                                 GCancellable         *cancellable,
-                                 TrackerSparqlBuilder *builder)
+update_processing_task_context_new (TrackerMiner         *miner,
+                                    const gchar          *urn,
+                                    const gchar          *parent_urn,
+                                    GCancellable         *cancellable,
+                                    TrackerSparqlBuilder *builder)
 {
 	UpdateProcessingTaskContext *ctxt;
 
@@ -1425,7 +1425,7 @@ update_process_task_context_new (TrackerMiner         *miner,
 }
 
 static void
-update_process_task_context_free (UpdateProcessingTaskContext *ctxt)
+update_processing_task_context_free (UpdateProcessingTaskContext *ctxt)
 {
 	g_free (ctxt->urn);
 	g_free (ctxt->parent_urn);
@@ -1442,8 +1442,8 @@ update_process_task_context_free (UpdateProcessingTaskContext *ctxt)
 }
 
 static gboolean
-do_process_file (TrackerMinerFS *fs,
-                 ProcessingTask *task)
+do_process_file (TrackerMinerFS        *fs,
+                 TrackerProcessingTask *task)
 {
 	TrackerMinerFSPrivate *priv;
 	gboolean processing;
@@ -1452,8 +1452,8 @@ do_process_file (TrackerMinerFS *fs,
 	GFile *task_file;
 	UpdateProcessingTaskContext *ctxt;
 
-	ctxt = processing_task_get_context (task);
-	task_file = processing_task_get_file (task);
+	ctxt = tracker_processing_task_get_context (task);
+	task_file = tracker_processing_task_get_file (task);
 	uri = g_file_get_uri (task_file);
 	priv = fs->private;
 
@@ -1480,7 +1480,7 @@ do_process_file (TrackerMinerFS *fs,
 		/* Re-fetch data, since it might have been
 		 * removed in broken implementations
 		 */
-		task = processing_pool_find_task (priv->processing_pool, task_file, FALSE);
+		task = tracker_processing_pool_find_task (priv->processing_pool, task_file, FALSE);
 
 		g_message ("%s refused to process '%s'", G_OBJECT_TYPE_NAME (fs), uri);
 
@@ -1490,8 +1490,8 @@ do_process_file (TrackerMinerFS *fs,
 			            "tracker_miner_fs_file_notify(), this is an "
 			            "implementation error", G_OBJECT_TYPE_NAME (fs), uri);
 		} else {
-			processing_pool_remove_task (priv->processing_pool, task);
-			processing_task_free (task);
+			tracker_processing_pool_remove_task (priv->processing_pool, task);
+			tracker_processing_task_free (task);
 		}
 	}
 
@@ -1501,22 +1501,22 @@ do_process_file (TrackerMinerFS *fs,
 }
 
 static void
-item_add_or_update_cb (TrackerMinerFS *fs,
-                       ProcessingTask *task,
-                       const GError   *error)
+item_add_or_update_cb (TrackerMinerFS        *fs,
+                       TrackerProcessingTask *task,
+                       const GError          *error)
 {
 	UpdateProcessingTaskContext *ctxt;
 	GFile *task_file;
 	gchar *uri;
 
-	ctxt = processing_task_get_context (task);
-	task_file = processing_task_get_file (task);
+	ctxt = tracker_processing_task_get_context (task);
+	task_file = tracker_processing_task_get_file (task);
 	uri = g_file_get_uri (task_file);
 
 	if (error) {
-		ProcessingTask *first_item_task;
+		TrackerProcessingTask *first_item_task;
 
-		first_item_task = processing_pool_get_last_wait (fs->private->processing_pool);
+		first_item_task = tracker_processing_pool_get_last_wait (fs->private->processing_pool);
 
 		/* Perhaps this is too specific to TrackerMinerFiles, if the extractor
 		 * is choking on some file, the miner will get a timeout for all files
@@ -1540,8 +1540,8 @@ item_add_or_update_cb (TrackerMinerFS *fs,
 
 			fs->private->total_files_notified_error++;
 
-			processing_pool_remove_task (fs->private->processing_pool, task);
-			processing_task_free (task);
+			tracker_processing_pool_remove_task (fs->private->processing_pool, task);
+			tracker_processing_task_free (task);
 
 			item_queue_handlers_set_up (fs);
 		}
@@ -1581,14 +1581,14 @@ item_add_or_update_cb (TrackerMinerFS *fs,
 			full_sparql = g_strdup (tracker_sparql_builder_get_result (ctxt->builder));
 		}
 
-		processing_task_set_sparql (task, full_sparql);
+		tracker_processing_task_set_sparql (task, full_sparql);
 		/* If push_ready_task() returns FALSE, it means the actual db update was delayed,
 		 * and in this case we need to setup queue handlers again */
-		if (!processing_pool_push_ready_task (fs->private->processing_pool,
-		                                      task,
-		                                      TRUE, /* buffer! */
-		                                      processing_pool_task_finished_cb,
-		                                      fs)) {
+		if (!tracker_processing_pool_push_ready_task (fs->private->processing_pool,
+                                                              task,
+                                                              TRUE, /* buffer! */
+                                                              processing_pool_task_finished_cb,
+                                                              fs)) {
 			item_queue_handlers_set_up (fs);
 		}
 		g_free (full_sparql);
@@ -1605,7 +1605,7 @@ item_add_or_update (TrackerMinerFS *fs,
 	TrackerSparqlBuilder *sparql;
 	GCancellable *cancellable;
 	gboolean retval;
-	ProcessingTask *task;
+	TrackerProcessingTask *task;
 	GFile *parent;
 	const gchar *urn;
 	const gchar *parent_urn = NULL;
@@ -1656,20 +1656,20 @@ item_add_or_update (TrackerMinerFS *fs,
 
 	/* Create task and add it to the pool as a WAIT task (we need to extract
 	 * the file metadata and such) */
-	task = processing_task_new (file);
-	processing_task_set_context (task,
-	                             update_process_task_context_new (TRACKER_MINER (fs),
-	                                                              urn,
-	                                                              parent_urn,
-	                                                              cancellable,
-	                                                              sparql),
-	                             (GFreeFunc) update_process_task_context_free);
-	processing_pool_push_wait_task (priv->processing_pool, task);
+	task = tracker_processing_task_new (file);
+	tracker_processing_task_set_context (task,
+                                             update_processing_task_context_new (TRACKER_MINER (fs),
+                                                                                 urn,
+                                                                                 parent_urn,
+                                                                                 cancellable,
+                                                                                 sparql),
+                                             (GFreeFunc) update_processing_task_context_free);
+	tracker_processing_pool_push_wait_task (priv->processing_pool, task);
 
 	if (do_process_file (fs, task)) {
 		fs->private->total_files_processed++;
 
-		if (processing_pool_wait_limit_reached (priv->processing_pool)) {
+		if (tracker_processing_pool_wait_limit_reached (priv->processing_pool)) {
 			retval = FALSE;
 		}
 	}
@@ -1688,7 +1688,7 @@ item_remove (TrackerMinerFS *fs,
 	GString *sparql;
 	gchar *uri;
 	gchar *mime = NULL;
-	ProcessingTask *task;
+	TrackerProcessingTask *task;
 
 	iri_cache_invalidate (fs, file);
 	uri = g_file_get_uri (file);
@@ -1729,15 +1729,15 @@ item_remove (TrackerMinerFS *fs,
 	                        uri);
 
 	/* Add new task to processing pool */
-	task = processing_task_new (file);
-	processing_task_set_sparql (task, sparql->str);
+	task = tracker_processing_task_new (file);
+	tracker_processing_task_set_sparql (task, sparql->str);
 	/* If push_ready_task() returns FALSE, it means the actual db update was delayed,
 	 * and in this case we need to setup queue handlers again */
-	if (!processing_pool_push_ready_task (fs->private->processing_pool,
-	                                      task,
-	                                      FALSE,
-	                                      processing_pool_task_finished_cb,
-	                                      fs)) {
+	if (!tracker_processing_pool_push_ready_task (fs->private->processing_pool,
+                                                      task,
+                                                      FALSE,
+                                                      processing_pool_task_finished_cb,
+                                                      fs)) {
 		item_queue_handlers_set_up (fs);
 	}
 
@@ -1932,7 +1932,7 @@ item_move (TrackerMinerFS *fs,
 	GFileInfo *file_info;
 	GString   *sparql;
 	RecursiveMoveData move_data;
-	ProcessingTask *task;
+	TrackerProcessingTask *task;
 	gchar *source_iri;
 	gchar *display_name;
 	gboolean source_exists;
@@ -2050,15 +2050,15 @@ item_move (TrackerMinerFS *fs,
 	g_main_loop_unref (move_data.main_loop);
 
 	/* Add new task to processing pool */
-	task = processing_task_new (file);
-	processing_task_set_sparql (task, sparql->str);
+	task = tracker_processing_task_new (file);
+	tracker_processing_task_set_sparql (task, sparql->str);
 	/* If push_ready_task() returns FALSE, it means the actual db update was delayed,
 	 * and in this case we need to setup queue handlers again */
-	if (!processing_pool_push_ready_task (fs->private->processing_pool,
-	                                      task,
-	                                      FALSE,
-	                                      processing_pool_task_finished_cb,
-	                                      fs)) {
+	if (!tracker_processing_pool_push_ready_task (fs->private->processing_pool,
+                                                      task,
+                                                      FALSE,
+                                                      processing_pool_task_finished_cb,
+                                                      fs)) {
 		item_queue_handlers_set_up (fs);
 	}
 
@@ -2166,7 +2166,9 @@ should_wait (TrackerMinerFS *fs,
 	GFile *parent;
 
 	/* Is the item already being processed? */
-	if (processing_pool_find_task (fs->private->processing_pool, file, TRUE)) {
+	if (tracker_processing_pool_find_task (fs->private->processing_pool,
+                                               file,
+                                               TRUE)) {
 		/* Yes, a previous event on same item currently
 		 * being processed */
 		return TRUE;
@@ -2175,7 +2177,9 @@ should_wait (TrackerMinerFS *fs,
 	/* Is the item's parent being processed right now? */
 	parent = g_file_get_parent (file);
 	if (parent) {
-		if (processing_pool_find_task (fs->private->processing_pool, parent, TRUE)) {
+		if (tracker_processing_pool_find_task (fs->private->processing_pool,
+                                                       parent,
+                                                       TRUE)) {
 			/* Yes, a previous event on the parent of this item
 			 * currently being processed */
 			g_object_unref (parent);
@@ -2227,7 +2231,7 @@ item_queue_get_next_file (TrackerMinerFS  *fs,
 		 * info is inserted to the store before the children are
 		 * inspected.
 		 */
-		if (processing_pool_get_wait_task_count (fs->private->processing_pool) > 0) {
+		if (tracker_processing_pool_get_wait_task_count (fs->private->processing_pool) > 0) {
 			/* Items still being processed */
 			*file = NULL;
 			*source_file = NULL;
@@ -2395,7 +2399,7 @@ item_queue_handlers_cb (gpointer user_data)
 		 * if there was a previous task on the same file we want to
 		 * process now, we want it to get finished before we can go
 		 * on with the queues... */
-		processing_pool_buffer_flush (fs->private->processing_pool);
+		tracker_processing_pool_buffer_flush (fs->private->processing_pool);
 
 		return FALSE;
 	}
@@ -2465,12 +2469,12 @@ item_queue_handlers_cb (gpointer user_data)
 	case QUEUE_NONE:
 		/* Print stats and signal finished */
 		if (!fs->private->is_crawling &&
-		    processing_pool_get_total_task_count (fs->private->processing_pool) == 0) {
+		    tracker_processing_pool_get_total_task_count (fs->private->processing_pool) == 0) {
 			process_stop (fs);
 		}
 
 		/* Flush any possible pending update here */
-		processing_pool_buffer_flush (fs->private->processing_pool);
+		tracker_processing_pool_buffer_flush (fs->private->processing_pool);
 
 		tracker_thumbnailer_send ();
 		/* No more files left to process */
@@ -2538,7 +2542,7 @@ item_queue_handlers_set_up (TrackerMinerFS *fs)
 		return;
 	}
 
-	if (processing_pool_wait_limit_reached (fs->private->processing_pool)) {
+	if (tracker_processing_pool_wait_limit_reached (fs->private->processing_pool)) {
 		/* There is no room in the pool for more files */
 		return;
 	}
@@ -3636,13 +3640,13 @@ static void
 processing_pool_cancel_foreach (gpointer data,
                                 gpointer user_data)
 {
-	ProcessingTask *task = data;
+	TrackerProcessingTask *task = data;
 	GFile *file = user_data;
 	GFile *task_file;
 	UpdateProcessingTaskContext *ctxt;
 
-	task_file = processing_task_get_file (task);
-	ctxt = processing_task_get_context (task);
+	task_file = tracker_processing_task_get_file (task);
+	ctxt = tracker_processing_task_get_context (task);
 
 	if (ctxt &&
 	    ctxt->cancellable &&
@@ -3727,9 +3731,9 @@ tracker_miner_fs_directory_remove (TrackerMinerFS *fs,
 	check_files_removal (priv->items_created, file);
 
 	/* Cancel all pending tasks on files inside the path given by file */
-	processing_pool_foreach (fs->private->processing_pool,
-	                         processing_pool_cancel_foreach,
-	                         file);
+	tracker_processing_pool_foreach (fs->private->processing_pool,
+                                         processing_pool_cancel_foreach,
+                                         file);
 
 	/* Remove all monitors */
 	tracker_monitor_remove_recursively (fs->private->monitor, file);
@@ -3913,14 +3917,16 @@ tracker_miner_fs_file_notify (TrackerMinerFS *fs,
                               GFile          *file,
                               const GError   *error)
 {
-	ProcessingTask *task;
+	TrackerProcessingTask *task;
 
 	g_return_if_fail (TRACKER_IS_MINER_FS (fs));
 	g_return_if_fail (G_IS_FILE (file));
 
 	fs->private->total_files_notified++;
 
-	task = processing_pool_find_task (fs->private->processing_pool, file, FALSE);
+	task = tracker_processing_pool_find_task (fs->private->processing_pool,
+                                                  file,
+                                                  FALSE);
 
 	if (!task) {
 		gchar *uri;
@@ -4017,13 +4023,15 @@ G_CONST_RETURN gchar *
 tracker_miner_fs_get_urn (TrackerMinerFS *fs,
                           GFile          *file)
 {
-	ProcessingTask *task;
+	TrackerProcessingTask *task;
 
 	g_return_val_if_fail (TRACKER_IS_MINER_FS (fs), NULL);
 	g_return_val_if_fail (G_IS_FILE (file), NULL);
 
 	/* Check if found in currently processed data */
-	task = processing_pool_find_task (fs->private->processing_pool, file, FALSE);
+	task = tracker_processing_pool_find_task (fs->private->processing_pool,
+                                                  file,
+                                                  FALSE);
 
 	if (!task) {
 		gchar *uri;
@@ -4039,7 +4047,7 @@ tracker_miner_fs_get_urn (TrackerMinerFS *fs,
 		UpdateProcessingTaskContext *ctxt;
 
 		/* We are only storing the URN in the created/updated tasks */
-		ctxt = processing_task_get_context (task);
+		ctxt = tracker_processing_task_get_context (task);
 		if (!ctxt) {
 			gchar *uri;
 
@@ -4105,13 +4113,15 @@ G_CONST_RETURN gchar *
 tracker_miner_fs_get_parent_urn (TrackerMinerFS *fs,
                                  GFile          *file)
 {
-	ProcessingTask *task;
+	TrackerProcessingTask *task;
 
 	g_return_val_if_fail (TRACKER_IS_MINER_FS (fs), NULL);
 	g_return_val_if_fail (G_IS_FILE (file), NULL);
 
 	/* Check if found in currently processed data */
-	task = processing_pool_find_task (fs->private->processing_pool, file, FALSE);
+	task = tracker_processing_pool_find_task (fs->private->processing_pool,
+                                                  file,
+                                                  FALSE);
 
 	if (!task) {
 		gchar *uri;
@@ -4127,7 +4137,7 @@ tracker_miner_fs_get_parent_urn (TrackerMinerFS *fs,
 		UpdateProcessingTaskContext *ctxt;
 
 		/* We are only storing the URN in the created/updated tasks */
-		ctxt = processing_task_get_context (task);
+		ctxt = tracker_processing_task_get_context (task);
 		if (!ctxt) {
 			gchar *uri;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]