[tracker/tracker-store-queue] Removed TTL importer from the indexer
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Subject: [tracker/tracker-store-queue] Removed TTL importer from the indexer
- Date: Thu, 21 May 2009 08:51:09 -0400 (EDT)
commit 0a0d7610c0b83ced289d5784df9b942e43f3d749
Author: Philip Van Hoof <philip codeminded be>
Date: Thu May 21 14:48:02 2009 +0200
Removed TTL importer from the indexer
---
data/dbus/tracker-indexer.xml | 5 --
src/tracker-indexer/tracker-indexer.c | 100 +--------------------------------
src/tracker-indexer/tracker-indexer.h | 5 +-
3 files changed, 2 insertions(+), 108 deletions(-)
diff --git a/data/dbus/tracker-indexer.xml b/data/dbus/tracker-indexer.xml
index 101980a..2e85b8c 100644
--- a/data/dbus/tracker-indexer.xml
+++ b/data/dbus/tracker-indexer.xml
@@ -11,11 +11,6 @@
<node name="/">
<interface name="org.freedesktop.Tracker.Indexer">
- <method name="TurtleAdd">
- <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
- <arg type="s" name="file" direction="in" />
- </method>
-
<method name="FilesCheck">
<annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
<arg type="s" name="module" direction="in" />
diff --git a/src/tracker-indexer/tracker-indexer.c b/src/tracker-indexer/tracker-indexer.c
index 1298d6c..43fe3eb 100644
--- a/src/tracker-indexer/tracker-indexer.c
+++ b/src/tracker-indexer/tracker-indexer.c
@@ -21,11 +21,6 @@
/* The indexer works as a state machine, there are 3 different queues:
*
- * * The update queue: the highest priority one, turtle files waiting for
- * import and single statements waiting for insertion or deleation are
- * taken one by one in order to be processed, when this queue is
- * empty, a single token from the next queue is processed.
- *
* * The files queue: second highest priority, individual files are
* stored here, waiting for metadata extraction, etc... files are
* taken one by one in order to be processed, when this queue is
@@ -75,7 +70,6 @@
#include <libtracker-data/tracker-data-manager.h>
#include <libtracker-data/tracker-data-query.h>
#include <libtracker-data/tracker-data-update.h>
-#include <libtracker-data/tracker-turtle.h>
#include <libtracker-data/tracker-data-backup.h>
#include <libtracker/tracker.h>
@@ -161,7 +155,6 @@ struct TrackerIndexerPrivate {
guint in_process : 1;
guint interrupted : 1;
- gboolean turtle_import_in_progress;
guint state;
};
@@ -933,17 +926,6 @@ tracker_indexer_init (TrackerIndexer *indexer)
}
static void
-add_turtle_file (TrackerIndexer *indexer,
- const gchar *file)
-{
- g_queue_push_tail (indexer->private->import_queue,
- g_strdup (file));
-
- /* Make sure we are still running */
- check_started (indexer);
-}
-
-static void
add_file (TrackerIndexer *indexer,
PathInfo *info)
{
@@ -1609,51 +1591,11 @@ process_module (TrackerIndexer *indexer,
g_list_free (dirs);
}
-static void
-process_turtle_file_part (TrackerIndexer *indexer)
-{
- int i;
-
- /* process 100 statements at once before returning to main loop */
-
- i = 0;
-
- while (tracker_turtle_reader_next ()) {
- /* insert statement */
- tracker_data_insert_statement (
- tracker_turtle_reader_get_subject (),
- tracker_turtle_reader_get_predicate (),
- tracker_turtle_reader_get_object ());
-
- indexer->private->items_processed++;
- indexer->private->items_to_index++;
- i++;
- if (i >= 100) {
- /* return to main loop */
- return;
- }
- }
-
- indexer->private->turtle_import_in_progress = FALSE;
-}
-
-static void
-process_turtle_file (TrackerIndexer *indexer,
- const gchar *file)
-{
- indexer->private->turtle_import_in_progress = TRUE;
-
- tracker_turtle_reader_init (file, NULL);
-
- process_turtle_file_part (indexer);
-}
-
static gboolean
process_func (gpointer data)
{
TrackerIndexer *indexer;
PathInfo *path;
- gchar *file;
indexer = TRACKER_INDEXER (data);
@@ -1663,13 +1605,7 @@ process_func (gpointer data)
start_transaction (indexer);
}
- if (indexer->private->turtle_import_in_progress) {
- process_turtle_file_part (indexer);
- } else if ((file = g_queue_pop_head (indexer->private->import_queue)) != NULL) {
- /* Import file */
- process_turtle_file (indexer, file);
- g_free (file);
- } else if ((path = g_queue_peek_head (indexer->private->file_queue)) != NULL) {
+ if ((path = g_queue_peek_head (indexer->private->file_queue)) != NULL) {
/* Process file */
if (process_file (indexer, path)) {
indexer->private->subelements_processed = 0;
@@ -2043,29 +1979,6 @@ tracker_indexer_process_modules (TrackerIndexer *indexer,
}
}
-void
-tracker_indexer_turtle_add (TrackerIndexer *indexer,
- const gchar *file,
- DBusGMethodInvocation *context,
- GError **error)
-{
- guint request_id;
-
- request_id = tracker_dbus_get_next_request_id ();
-
- tracker_dbus_async_return_if_fail (TRACKER_IS_INDEXER (indexer), context);
- tracker_dbus_async_return_if_fail (file != NULL, context);
-
- tracker_dbus_request_new (request_id,
- "DBus request to check TTL file %s",
- file);
-
- add_turtle_file (indexer, file);
-
- dbus_g_method_return (context);
- tracker_dbus_request_success (request_id);
-}
-
void
tracker_indexer_files_check (TrackerIndexer *indexer,
@@ -2239,20 +2152,9 @@ tracker_indexer_volume_update_state (TrackerIndexer *indexer,
tracker_data_update_disable_volume (volume_uuid);
}
- /* tracker_turtle_process_ttl will be spinning the mainloop, therefore
- we can already return the DBus method */
-
dbus_g_method_return (context);
tracker_dbus_request_success (request_id);
-
- /* tracker_turtle_process_ttl will be spinning the mainloop, therefore
- we can already return the DBus method */
-
- if (enabled) {
- tracker_removable_device_load (indexer, path);
- }
-
}
static void
diff --git a/src/tracker-indexer/tracker-indexer.h b/src/tracker-indexer/tracker-indexer.h
index 23ebfdf..b000369 100644
--- a/src/tracker-indexer/tracker-indexer.h
+++ b/src/tracker-indexer/tracker-indexer.h
@@ -103,10 +103,7 @@ void tracker_indexer_pause_for_duration (TrackerIndexer *ind
void tracker_indexer_continue (TrackerIndexer *indexer,
DBusGMethodInvocation *context,
GError **error);
-void tracker_indexer_turtle_add (TrackerIndexer *indexer,
- const gchar *file,
- DBusGMethodInvocation *context,
- GError **error);
+
void tracker_indexer_files_check (TrackerIndexer *indexer,
const gchar *module,
GStrv files,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]