tracker r1374 - in branches/indexer-split: . src/trackerd



Author: mr
Date: Thu May  8 12:17:12 2008
New Revision: 1374
URL: http://svn.gnome.org/viewvc/tracker?rev=1374&view=rev

Log:
	* src/trackerd/tracker-cache.c:
	* src/trackerd/tracker-db-sqlite.c:
	* src/trackerd/tracker-db.[ch]: 
	* src/trackerd/tracker-dbus-daemon.c:
	* src/trackerd/tracker-main.[ch]: 
	* src/trackerd/tracker-process-files.c: Cleaned up the Tracker
	structure by removing members which are not used. Also removed the
	structures in the tracker-main.h file which are not used.


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/trackerd/tracker-cache.c
   branches/indexer-split/src/trackerd/tracker-db-sqlite.c
   branches/indexer-split/src/trackerd/tracker-db.c
   branches/indexer-split/src/trackerd/tracker-db.h
   branches/indexer-split/src/trackerd/tracker-dbus-daemon.c
   branches/indexer-split/src/trackerd/tracker-main.c
   branches/indexer-split/src/trackerd/tracker-main.h
   branches/indexer-split/src/trackerd/tracker-process-files.c

Modified: branches/indexer-split/src/trackerd/tracker-cache.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-cache.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-cache.c	Thu May  8 12:17:12 2008
@@ -209,7 +209,6 @@
 
 	tracker->word_detail_count = 0;
 	tracker->word_count = 0;
-	tracker->flush_count = 0;
 	tracker->word_update_count = 0;
 }
 

Modified: branches/indexer-split/src/trackerd/tracker-db-sqlite.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db-sqlite.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-db-sqlite.c	Thu May  8 12:17:12 2008
@@ -63,11 +63,12 @@
 #include "tracker-xesam.h"
 #include "tracker-main.h"
 
-#define MAX_TEXT_BUFFER     65567
-#define MAX_COMPRESS_BUFFER 65565
-#define ZLIBBUFSIZ          8192
+#define MAX_INDEX_TEXT_LENGTH 1048576
+#define MAX_TEXT_BUFFER       65567
+#define MAX_COMPRESS_BUFFER   65565
+#define ZLIBBUFSIZ            8192
 
-#define DB_PAGE_SIZE_DEFAULT 4096
+#define DB_PAGE_SIZE_DEFAULT  4096
 #define DB_PAGE_SIZE_DONT_SET -1
 
 extern Tracker *tracker;
@@ -1720,7 +1721,7 @@
             	strm.next_out = (unsigned char *) out;
 			
 		/* set upper limit on text we read in */
-		if (finished || bytes_read >= tracker->max_index_text_length) {
+		if (finished || bytes_read >= MAX_INDEX_TEXT_LENGTH) {
 			finished = TRUE;
 			flush = Z_FINISH;
 		} else {

Modified: branches/indexer-split/src/trackerd/tracker-db.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-db.c	Thu May  8 12:17:12 2008
@@ -577,19 +577,19 @@
 static void
 refresh_file_change_queue (gpointer data, gpointer user_data)
 {
-	FileChange *change = (FileChange*)data;
-	int *current = (int *)user_data;
+	TrackerDBFileChange *change = (TrackerDBFileChange*) data;
+	gint *current = (gint *)user_data;
 
 	if ((*current - change->first_change_time) > MAX_DURATION) {
 		g_queue_remove_all (tracker->file_change_queue, data);
-		free_file_change (&change);
+		tracker_db_file_change_free (&change);
 	}
 }
 
 static gint
 uri_comp (gconstpointer a, gconstpointer b)
 {
-	FileChange *change = (FileChange *)a;
+	TrackerDBFileChange *change = (TrackerDBFileChange *) a;
 	char *valuea = change->uri;
 	char *valueb = (char *)b;
 
@@ -599,9 +599,9 @@
 static gint
 file_change_sort_comp (gconstpointer a, gconstpointer b, gpointer user_data)
 {
-	FileChange *changea, *changeb;
-	changea = (FileChange *)a;
-	changeb = (FileChange *)b;
+	TrackerDBFileChange *changea, *changeb;
+	changea = (TrackerDBFileChange *)a;
+	changeb = (TrackerDBFileChange *)b;
 
 	if ((changea->num_of_change - changeb->num_of_change) == 0) {
 		return changea->first_change_time - changeb->first_change_time;
@@ -611,18 +611,18 @@
 }
 
 static void
-print_file_change_queue ()
+print_file_change_queue (void)
 {
-	GList *head, *l;
-	FileChange *change;
-	gint count;
+	GList               *head, *l;
+	TrackerDBFileChange *change;
+	gint                 count;
 
 	head = g_queue_peek_head_link (tracker->file_change_queue);
 
 	tracker_log ("File Change queue is:");
 	count = 1;
 	for (l = g_list_first (head); l != NULL; l = g_list_next (l)) {
-		change = (FileChange*)l->data;
+		change = (TrackerDBFileChange*) l->data;
 		tracker_info ("%d\t%s\t%d\t%d",
 			 count++, change->uri,
 			 change->first_change_time,
@@ -675,9 +675,9 @@
 static gboolean
 check_uri_changed_frequently (const char *uri)
 {
-	GList *find;
-	FileChange *change;
-	time_t current;
+	GList               *find;
+	TrackerDBFileChange *change;
+	time_t               current;
 
 	if (!tracker->file_change_queue) {
 		/* init queue */
@@ -694,21 +694,20 @@
 	if (!find) {
 		/* not found, add to in the queue */
 				
-		change = g_new0 (FileChange, 1);
+		change = g_new0 (TrackerDBFileChange, 1);
 		change->uri = g_strdup (uri);
 		change->first_change_time = current;
 		change->num_of_change = 1;
 		if (g_queue_get_length (tracker->file_change_queue) == STACK_SIZE) {
-			FileChange *tmp = (FileChange*) g_queue_pop_head (
-						tracker->file_change_queue);
-			free_file_change (&tmp);
+			TrackerDBFileChange *tmp = g_queue_pop_head (tracker->file_change_queue);
+			tracker_db_file_change_free (&tmp);
 		}
 		g_queue_insert_sorted (tracker->file_change_queue, change,
 					file_change_sort_comp, NULL);
 		print_file_change_queue ();
 		return FALSE;
 	} else {
-		change = (FileChange *) find->data;
+		change = (TrackerDBFileChange *) find->data;
 		(change->num_of_change)++;
 		g_queue_sort (tracker->file_change_queue,
 			file_change_sort_comp, NULL);
@@ -730,7 +729,7 @@
 			}
 			
 			g_queue_remove_all (tracker->file_change_queue, change);
-			free_file_change (&change);
+			tracker_db_file_change_free (&change);
 			
 			return TRUE;
 		}
@@ -1308,3 +1307,12 @@
 	tracker_db_index_file (db_con, info, NULL, "WebHistory");
 }
 
+void
+tracker_db_file_change_free (TrackerDBFileChange **change)
+{
+	g_return_if_fail (change != NULL);
+
+	g_free ((*change)->uri);
+	(*change)->uri = NULL;
+	*change = NULL;
+}

Modified: branches/indexer-split/src/trackerd/tracker-db.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db.h	(original)
+++ branches/indexer-split/src/trackerd/tracker-db.h	Thu May  8 12:17:12 2008
@@ -32,61 +32,68 @@
 
 G_BEGIN_DECLS
 
-gboolean           tracker_db_is_file_up_to_date   (DBConnection      *db_con,
-                                                    const gchar       *uri,
-                                                    guint32           *id);
-TrackerDBFileInfo *tracker_db_get_file_info        (DBConnection      *db_con,
-                                                    TrackerDBFileInfo *info);
-gboolean           tracker_is_valid_service        (DBConnection      *db_con,
-                                                    const gchar       *service);
-gchar *            tracker_db_get_id               (DBConnection      *db_con,
-                                                    const gchar       *service,
-                                                    const gchar       *uri);
-GHashTable *       tracker_db_save_metadata        (DBConnection      *db_con,
-                                                    GHashTable        *table,
-                                                    GHashTable        *index_table,
-                                                    const gchar       *service,
-                                                    guint32            file_id,
-                                                    gboolean           new_file);
-void               tracker_db_save_thumbs          (DBConnection      *db_con,
-                                                    const gchar       *small_thumb,
-                                                    const gchar       *large_thumb,
-                                                    guint32            file_id);
-gchar **           tracker_db_get_files_in_folder  (DBConnection      *db_con,
-                                                    const gchar       *folder_uri);
-FieldDef *         tracker_db_get_field_def        (const gchar       *field_name);
-void               tracker_db_free_field_def       (FieldDef          *def);
-gboolean           tracker_metadata_is_date        (DBConnection      *db_con,
-                                                    const gchar       *meta);
-TrackerDBFileInfo *tracker_db_get_pending_file     (DBConnection      *db_con,
-                                                    const gchar       *uri);
-void               tracker_db_update_pending_file  (DBConnection      *db_con,
-                                                    const gchar       *uri,
-                                                    gint               counter,
-                                                    TrackerDBAction    action);
-void               tracker_db_add_to_extract_queue (DBConnection      *db_con,
-                                                    TrackerDBFileInfo *info);
-gboolean           tracker_db_has_pending_files    (DBConnection      *db_con);
-gboolean           tracker_db_has_pending_metadata (DBConnection      *db_con);
-void               tracker_db_index_service        (DBConnection      *db_con,
-                                                    TrackerDBFileInfo *info,
-                                                    const gchar       *service,
-                                                    GHashTable        *meta_table,
-                                                    const gchar       *attachment_uri,
-                                                    const gchar       *attachment_service,
-                                                    gboolean           get_embedded,
-                                                    gboolean           get_full_text,
-                                                    gboolean           get_thumbs);
-void               tracker_db_index_file           (DBConnection      *db_con,
-                                                    TrackerDBFileInfo *info,
-                                                    const gchar       *attachment_uri,
-                                                    const gchar       *attachment_service);
-void               tracker_db_index_conversation   (DBConnection      *db_con,
-                                                    TrackerDBFileInfo *info);
-void               tracker_db_index_application    (DBConnection      *db_con,
-                                                    TrackerDBFileInfo *info);
-void               tracker_db_index_webhistory     (DBConnection      *db_con,
-                                                    TrackerDBFileInfo *info);
+typedef struct {
+	gchar  *uri;
+	time_t	first_change_time;
+	gint    num_of_change;
+} TrackerDBFileChange;
+
+gboolean           tracker_db_is_file_up_to_date   (DBConnection         *db_con,
+						    const gchar          *uri,
+						    guint32              *id);
+TrackerDBFileInfo *tracker_db_get_file_info        (DBConnection         *db_con,
+						    TrackerDBFileInfo    *info);
+gboolean           tracker_is_valid_service        (DBConnection         *db_con,
+						    const gchar          *service);
+gchar *            tracker_db_get_id               (DBConnection         *db_con,
+						    const gchar          *service,
+						    const gchar          *uri);
+GHashTable *       tracker_db_save_metadata        (DBConnection         *db_con,
+						    GHashTable           *table,
+						    GHashTable           *index_table,
+						    const gchar          *service,
+						    guint32               file_id,
+						    gboolean              new_file);
+void               tracker_db_save_thumbs          (DBConnection         *db_con,
+						    const gchar          *small_thumb,
+						    const gchar          *large_thumb,
+						    guint32               file_id);
+gchar **           tracker_db_get_files_in_folder  (DBConnection         *db_con,
+						    const gchar          *folder_uri);
+FieldDef *         tracker_db_get_field_def        (const gchar          *field_name);
+void               tracker_db_free_field_def       (FieldDef             *def);
+gboolean           tracker_metadata_is_date        (DBConnection         *db_con,
+						    const gchar          *meta);
+TrackerDBFileInfo *tracker_db_get_pending_file     (DBConnection         *db_con,
+						    const gchar          *uri);
+void               tracker_db_update_pending_file  (DBConnection         *db_con,
+						    const gchar          *uri,
+						    gint                  counter,
+						    TrackerDBAction       action);
+void               tracker_db_add_to_extract_queue (DBConnection         *db_con,
+						    TrackerDBFileInfo    *info);
+gboolean           tracker_db_has_pending_files    (DBConnection         *db_con);
+gboolean           tracker_db_has_pending_metadata (DBConnection         *db_con);
+void               tracker_db_index_service        (DBConnection         *db_con,
+						    TrackerDBFileInfo    *info,
+						    const gchar          *service,
+						    GHashTable           *meta_table,
+						    const gchar          *attachment_uri,
+						    const gchar          *attachment_service,
+						    gboolean              get_embedded,
+						    gboolean              get_full_text,
+						    gboolean              get_thumbs);
+void               tracker_db_index_file           (DBConnection         *db_con,
+						    TrackerDBFileInfo    *info,
+						    const gchar          *attachment_uri,
+						    const gchar          *attachment_service);
+void               tracker_db_index_conversation   (DBConnection         *db_con,
+						    TrackerDBFileInfo    *info);
+void               tracker_db_index_application    (DBConnection         *db_con,
+						    TrackerDBFileInfo    *info);
+void               tracker_db_index_webhistory     (DBConnection         *db_con,
+						    TrackerDBFileInfo    *info);
+void               tracker_db_file_change_free     (TrackerDBFileChange **change);
 
 G_END_DECLS
 

Modified: branches/indexer-split/src/trackerd/tracker-dbus-daemon.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-dbus-daemon.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-dbus-daemon.c	Thu May  8 12:17:12 2008
@@ -21,6 +21,7 @@
 
 #include <config.h>
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -271,16 +272,24 @@
 				 gint               *version,
 				 GError            **error)
 {
-	guint request_id;
+	guint  request_id;
+	gint   major = 0;
+	gint   minor = 0;
+	gint   revision = 0;
+	gchar *str;
 
-	request_id = tracker_dbus_get_next_request_id ();
+ 	request_id = tracker_dbus_get_next_request_id ();
 
 	tracker_dbus_return_val_if_fail (version != NULL, FALSE, error);
 
         tracker_dbus_request_new (request_id,
 				  "DBus request to get daemon version");
 
-	*version = TRACKER_VERSION_INT;
+	
+	sscanf (VERSION, "%d.%d.%d", &major, &minor, &revision);
+	str = g_strdup_printf ("%d%d%d", major, minor, revision);
+	*version = atoi (str);
+	g_free (str);
 
 	tracker_dbus_request_success (request_id);
 

Modified: branches/indexer-split/src/trackerd/tracker-main.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-main.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-main.c	Thu May  8 12:17:12 2008
@@ -23,8 +23,6 @@
 #define DBUS_API_SUBJECT_TO_CHANGE
 #endif
 
-#define I_AM_MAIN
-
 #include "config.h"
 
 #include <signal.h>
@@ -63,6 +61,17 @@
 #include "mingw-compat.h"
 #endif
 
+#define ABOUT								  \
+	"Tracker " VERSION "\n"						  \
+	"Copyright (c) 2005-2008 Jamie McCracken (jamiemcc gnome org)\n" 
+
+#define LICENSE								  \
+	"This program is free software and comes without any warranty.\n" \
+	"It is licensed under version 2 or later of the General Public "  \
+	"License which can be viewed at:\n"                               \
+        "\n"							          \
+	"  http://www.gnu.org/licenses/gpl.txt\n"; 
+
 typedef struct {
 	gchar	*uri;
 	gint	mtime;
@@ -157,30 +166,19 @@
 }
 
 gboolean
-tracker_die ()
+tracker_die (void)
 {
 	tracker_error ("trackerd has failed to exit on time - terminating...");
 	exit (EXIT_FAILURE);
 }
 
-
-void
-free_file_change (FileChange **user_data)
-{
-	FileChange *change = *user_data;
-	g_free (change->uri);
-	change->uri = NULL;
-	change = NULL;
-}
-
 static void
 free_file_change_queue (gpointer data, gpointer user_data)
 {
-	FileChange *change = (FileChange *)data;
-	free_file_change (&change);
+	TrackerDBFileChange *change = (TrackerDBFileChange *) data;
+	tracker_db_file_change_free (&change);
 }
 
-
 static void
 reset_blacklist_file (char *uri)
 {
@@ -212,7 +210,6 @@
         GSList *black_list;
 
 	tracker->shutdown = TRUE;
-	tracker->in_flush = TRUE;
 
 	tracker_status_set (TRACKER_STATUS_SHUTDOWN);
 
@@ -390,8 +387,6 @@
 	tracker->reindex = FALSE;
 	tracker->in_merge = FALSE;
 
-	tracker->merge_limit = MERGE_LIMIT;
-
 	tracker->index_status = INDEX_CONFIG;
 
 	tracker->black_list_timer_active = FALSE;	
@@ -403,21 +398,13 @@
 	tracker->use_nfs_safe_locking = FALSE;
 
 	tracker->watch_limit = 0;
-	tracker->index_counter = 0;
 	tracker->index_count = 0;
 	tracker->update_count = 0;
 
-	tracker->max_index_text_length = MAX_INDEX_TEXT_LENGTH;
 	tracker->max_process_queue_size = MAX_PROCESS_QUEUE_SIZE;
 	tracker->max_extract_queue_size = MAX_EXTRACT_QUEUE_SIZE;
 
-	tracker->flush_count = 0;
-
-	tracker->index_numbers = FALSE;
 	tracker->index_number_min_length = 6;
-	tracker->strip_accents = TRUE;
-
-	tracker->first_flush = TRUE;
 
 	tracker->services_dir = g_build_filename (SHAREDIR, "tracker", "services", NULL);
 
@@ -498,26 +485,11 @@
 	
 		tracker->max_process_queue_size = 5000;
 		tracker->max_extract_queue_size = 5000;
-
-		tracker->word_detail_limit = 2000000;
-		tracker->word_detail_min = 0;
-		tracker->word_count_limit = 500000;
-		tracker->word_count_min = 0;
 	} else {
 		tracker->memory_limit = 8192 * 1024;
 
 		tracker->max_process_queue_size = 500;
 		tracker->max_extract_queue_size = 500;
-
-		tracker->word_detail_limit = 50000;
-		tracker->word_detail_min = 20000;
-		tracker->word_count_limit = 5000;
-		tracker->word_count_min = 500;
-	}
-
-        if (tracker->battery_udi) {
-                /* Default is 0 */
-                tracker_config_set_throttle (tracker->config, 5);
 	}
 
 	log_option_list (watch_directory_roots, "Watching directory roots");
@@ -626,9 +598,7 @@
 	g_option_context_free (context);
 	g_free (example);
 
-	g_print ("\n\nTracker version %s Copyright (c) 2005-2007 by Jamie McCracken (jamiemcc gnome org)\n\n", TRACKER_VERSION);
-	g_print ("This program is free software and comes without any warranty.\nIt is licensed under version 2 or later of the General Public License which can be viewed at http://www.gnu.org/licenses/gpl.txt\n\n";);
-
+	g_print ("\n" ABOUT "\n" LICENSE "\n");
 	g_print ("Initialising tracker...\n");
 
 #ifndef OS_WIN32
@@ -785,8 +755,6 @@
 	/* deal with config options with defaults, config file and option params */
 	set_defaults ();
 
-	tracker->battery_udi = NULL;
-
 	if (error) {
 		g_printerr ("invalid arguments: %s\n", error->message);
 		return 1;
@@ -828,8 +796,6 @@
 		tracker_config_set_initial_sleep (tracker->config, initial_sleep);
 	}
 
-	tracker->fatal_errors = fatal_errors;
-
 	sanity_check_option_values ();
 
         /* Initialize the service manager */

Modified: branches/indexer-split/src/trackerd/tracker-main.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-main.h	(original)
+++ branches/indexer-split/src/trackerd/tracker-main.h	Thu May  8 12:17:12 2008
@@ -20,16 +20,8 @@
  * Boston, MA  02110-1301, USA. 
  */  
 
-#ifndef __TRACKERD_H__
-#define __TRACKERD_H__
-
-extern char *type_array[];
-extern char *implemented_services[];
-extern char *file_service_array[] ;
-extern char *serice_index_array[];
-extern char *service_table_names[];
-extern char *service_metadata_table_names[];
-extern char *service_metadata_join_names[];
+#ifndef __TRACKERD_MAIN_H__
+#define __TRACKERD_MAIN_H__
 
 #include "config.h"
 
@@ -42,31 +34,12 @@
 #include "tracker-parser.h"
 #include "tracker-indexer.h"
 
-/* set merge limit default to 64MB */
-#define MERGE_LIMIT                     671088649
-
-/* max default file pause time in ms  = FILE_PAUSE_PERIOD * FILE_SCHEDULE_PERIOD */
-#define FILE_PAUSE_PERIOD		1
-#define FILE_SCHEDULE_PERIOD		300
-
-#define TRACKER_DB_VERSION_REQUIRED	13
-#define TRACKER_VERSION			VERSION
-#define TRACKER_VERSION_INT		604
-
 /* default performance options */
-#define MAX_INDEX_TEXT_LENGTH		1048576
-#define MAX_PROCESS_QUEUE_SIZE		100
-#define MAX_EXTRACT_QUEUE_SIZE		500
-#define OPTIMIZATION_COUNT		10000
-#define MAX_WORDS_TO_INDEX		10000
+#define MAX_PROCESS_QUEUE_SIZE 100
+#define MAX_EXTRACT_QUEUE_SIZE 500
 
 G_BEGIN_DECLS
 
-typedef struct {                         
-	int	 	id;              /* word ID of the cached word */
-	int 		count;     	 /* cummulative count of the cached word */
-} CacheWord;
-
 typedef enum {
 	INDEX_CONFIG,
 	INDEX_APPLICATIONS,
@@ -79,176 +52,111 @@
 	INDEX_FINISHED
 } IndexStatus;
 
-
-typedef struct {
-	char 		*name;
-	char		*type;
-} ServiceInfo;
-
-
-typedef enum {
-	EVENT_NOTHING,
-	EVENT_SHUTDOWN,
-	EVENT_DISABLE,
-	EVENT_PAUSE,
-	EVENT_CACHE_FLUSHED
-} LoopEvent;
-
-
-typedef struct {
-	gchar	*uri;
-	time_t	first_change_time;
-	gint    num_of_change;
-} FileChange;
-
-
 typedef struct {
+	GMainLoop   *loop; 
 
-	gboolean	readonly;
-
-	int		pid; 
-
-	gpointer	hal;
-
-	gboolean	reindex;
-
-        gpointer        config;
-        gpointer        language;
+ 	gboolean     is_running; 
+	gboolean     readonly;
 
-	/* config options */
-	guint32		watch_limit;
+	gint         pid; 
 
-	gboolean	fatal_errors;
+	gpointer     hal;
+	gboolean     reindex;
+        gpointer     config;
+        gpointer     language;
+
+	/* Config options */
+	guint32      watch_limit; 
+	gpointer     index_db;
+
+	/* Data directories */
+	gchar       *data_dir;
+	gchar       *config_dir;
+	gchar       *root_dir;
+	gchar       *user_data_dir;
+	gchar       *sys_tmp_root_dir;
+        gchar       *email_attachements_dir;
+	gchar       *services_dir;
+	gchar       *xesam_dir;
+
+	/* Performance and memory usage options */
+	gint         max_process_queue_size;
+	gint         max_extract_queue_size;
+	gint         memory_limit;
+
+	/* Pause/shutdown */
+	gboolean     shutdown;
+	gboolean     pause_manual;
+	gboolean     pause_battery;
+	gboolean     pause_io;
+
+	/* Indexing options */
+        Indexer     *file_index;
+        Indexer     *file_update_index;
+        Indexer     *email_index;
+
+	/* Table of stop words that are to be ignored by the parser */
+	GHashTable  *stop_words;
+	gint         index_number_min_length;
 
-	gpointer	index_db;
-
-	/* data directories */
-	char 		*data_dir;
-	char		*config_dir;
-	char 		*root_dir;
-	char		*user_data_dir;
-	char		*sys_tmp_root_dir;
-        char            *email_attachements_dir;
-	char 		*services_dir;
-
-	/* performance and memory usage options */
-	int		max_index_text_length; /* max size of file's text contents to index */
-	int		max_process_queue_size;
-	int		max_extract_queue_size;
-	int 		memory_limit;
-	int 		thread_stack_size;
-
-	/* HAL battery */
-	char		*battery_udi;
-
-	/* pause/shutdown vars */
-	gboolean	shutdown;
-	gboolean	pause_manual;
-	gboolean	pause_battery;
-	gboolean	pause_io;
-
-	/* indexing options */
-        Indexer         *file_index;
-        Indexer	        *file_update_index;
-        Indexer   	*email_index;
-
-	guint32		merge_limit; 		/* size of index in MBs when merging is triggered -1 == no merging*/
-	gboolean	active_file_merge;
-	gboolean	active_email_merge;
-
-	GHashTable	*stop_words;	  	/* table of stop words that are to be ignored by the parser */
-
-	gboolean	index_numbers;
-	int		index_number_min_length;
-	gboolean	strip_accents;
-
-	gboolean	first_time_index;
-	gboolean	first_flush;
-	gboolean	do_optimize;
+	gboolean     first_time_index; 
 	
-	time_t		index_time_start;
-	int		folders_count;
-	int		folders_processed;
-	int		mbox_count;
-	int		mbox_processed;
+	time_t       index_time_start; 
+	gint         folders_count;  
+	gint         folders_processed;
+	gint         mbox_count; 
+	gint         mbox_processed;
+
+	IndexStatus  index_status; 
+
+	gint	     grace_period; 
+	gboolean     request_waiting;
+
+	/* Lookup tables for service and metadata IDs */
+	GHashTable  *metadata_table; 
+
+	/* Email config options */
+	gint         email_service_min;
+	gint         email_service_max; 
 
-
-	const char	*current_uri;
-	
-	IndexStatus	index_status;
-
-	int		grace_period;
-	gboolean	request_waiting;
-
-	char *		xesam_dir;
-
-	/* lookup tables for service and metadata IDs */
-	GHashTable	*metadata_table;
-
-	/* email config options */
-	GSList		*additional_mboxes_to_index;
-
-	int		email_service_min;
-	int		email_service_max;
-
-	/* nfs options */
-	gboolean	use_nfs_safe_locking; /* use safer but much slower external lock file when users home dir is on an nfs systems */
+	/* NFS options */
+	gboolean     use_nfs_safe_locking;
 
 	/* Queue for recorad file changes */
-	GQueue		*file_change_queue;
-	gboolean	black_list_timer_active;
+	GQueue      *file_change_queue; 
+	gboolean     black_list_timer_active;
 	
-	/* progress info for merges */
-	int		merge_count;
-	int		merge_processed;
+	/* Progress info for merges */
+	gboolean     in_merge; 
+	gint         merge_count; 
+	gint         merge_processed;
 	
+	/* Application run time values */
+	gint         index_count; 
+	gint	     update_count; 
+
+	/* Cache words before saving to word index */
+	GHashTable  *file_word_table;
+	GHashTable  *file_update_word_table;
+	GHashTable  *email_word_table;
+
+	gint         word_detail_count; 
+	gint         word_count;
+	gint         word_update_count; 
+
+	GAsyncQueue *file_process_queue;
+	GAsyncQueue *file_metadata_queue; 
+	GAsyncQueue *dir_queue;
+
+	GMutex      *files_check_mutex;
+	GMutex      *files_signal_mutex;
+	GCond       *files_signal_cond;
+
+	GMutex      *metadata_check_mutex;
+	GMutex      *metadata_signal_mutex;
+	GCond       *metadata_signal_cond;
 
-	/* application run time values */
-	gboolean	is_indexing;
-	gboolean	in_flush;
-	gboolean	in_merge;
-	int		index_count;
-	int		index_counter;
-	int		update_count;
-
-	/* cache words before saving to word index */
-	GHashTable	*file_word_table;
-	GHashTable	*file_update_word_table;
-	GHashTable	*email_word_table;
-
-	int		word_detail_limit;
-	int		word_detail_count;
-	int		word_detail_min;
-	int		word_count;
-	int		word_update_count;
-	int		word_count_limit;
-	int		word_count_min;
-	int		flush_count;
-
-	int		file_update_count;
-	int		email_update_count;
-
- 	gboolean 	is_running;
-	gboolean	is_dir_scan;
-	GMainLoop 	*loop;
-
-	GMutex 		*log_access_mutex;
-	char	 	*log_file;
-
-	GAsyncQueue 	*file_process_queue;
-	GAsyncQueue 	*file_metadata_queue;
-
-	GAsyncQueue 	*dir_queue;
-
-	GMutex		*files_check_mutex;
-	GMutex		*files_signal_mutex;
-	GCond 		*files_signal_cond;
-
-	GMutex		*metadata_check_mutex;
-	GMutex		*metadata_signal_mutex;
-	GCond 		*metadata_signal_cond;
-
-	GHashTable	*xesam_sessions;
+	GHashTable  *xesam_sessions; 
 } Tracker;
 
 GSList * tracker_get_watch_root_dirs        (void);
@@ -259,8 +167,7 @@
 gboolean tracker_do_cleanup                 (const gchar  *sig_msg);
 gboolean tracker_watch_dir                  (const gchar  *uri);
 void     tracker_scan_directory             (const gchar  *uri);
-void     free_file_change                   (FileChange  **user_data);
 
 G_END_DECLS
 
-#endif /* __TRACKERD_H__ */
+#endif /* __TRACKERD_MAIN_H__ */

Modified: branches/indexer-split/src/trackerd/tracker-process-files.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-process-files.c	(original)
+++ branches/indexer-split/src/trackerd/tracker-process-files.c	Thu May  8 12:17:12 2008
@@ -1179,7 +1179,6 @@
                 gint time_taken;
 
                 tracker_status_set (TRACKER_STATUS_OPTIMIZING);
-                tracker->do_optimize = FALSE;
                 
                 tracker->first_time_index = FALSE;
 		



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