tracker r1359 - in branches/indexer-split: . src/trackerd
- From: ifrade svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r1359 - in branches/indexer-split: . src/trackerd
- Date: Tue, 6 May 2008 16:36:20 +0100 (BST)
Author: ifrade
Date: Tue May 6 15:36:19 2008
New Revision: 1359
URL: http://svn.gnome.org/viewvc/tracker?rev=1359&view=rev
Log:
Using Indexer instead of gpointer in Tracker struct
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/trackerd/tracker-db-sqlite.c
branches/indexer-split/src/trackerd/tracker-db-sqlite.h
branches/indexer-split/src/trackerd/tracker-indexer.c
branches/indexer-split/src/trackerd/tracker-indexer.h
branches/indexer-split/src/trackerd/tracker-parser.c
branches/indexer-split/src/trackerd/tracker-utils.h
branches/indexer-split/src/trackerd/trackerd.c
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 Tue May 6 15:36:19 2008
@@ -563,26 +563,21 @@
/* convenience function for process files thread */
DBConnection *
-tracker_db_connect_all (gboolean indexer_process)
+tracker_db_connect_all ()
{
DBConnection *db_con;
DBConnection *blob_db_con = NULL;
- DBConnection *word_index_db_con = NULL;
+ Indexer *word_index_db_con = NULL;
DBConnection *common_db_con = NULL;
DBConnection *emails_blob_db_con = NULL;
DBConnection *emails_db_con= NULL;
- DBConnection *email_word_index_db_con= NULL;
+ Indexer *email_word_index_db_con= NULL;
- if (!indexer_process) {
- db_con = tracker_db_connect ();
- emails_db_con = tracker_db_connect_emails ();
- } else {
- db_con = tracker_db_connect_file_meta ();
- emails_db_con = tracker_db_connect_email_meta ();
- }
+ db_con = tracker_db_connect_file_meta ();
+ emails_db_con = tracker_db_connect_email_meta ();
blob_db_con = tracker_db_connect_file_content ();
emails_blob_db_con = tracker_db_connect_email_content ();
Modified: branches/indexer-split/src/trackerd/tracker-db-sqlite.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-db-sqlite.h (original)
+++ branches/indexer-split/src/trackerd/tracker-db-sqlite.h Tue May 6 15:36:19 2008
@@ -41,7 +41,7 @@
DBConnection *emails;
DBConnection *blob;
DBConnection *cache;
- gpointer word_index;
+ Indexer *word_index;
};
gboolean tracker_db_needs_setup (void);
@@ -59,7 +59,7 @@
DBConnection * tracker_db_connect_emails (void);
DBConnection * tracker_db_connect_email_meta (void);
DBConnection * tracker_db_connect_file_meta (void);
-DBConnection * tracker_db_connect_all (gboolean indexer_process);
+DBConnection * tracker_db_connect_all (void);
void tracker_db_close_all (DBConnection *db_con);
void tracker_db_refresh_all (DBConnection *db_con);
void tracker_db_refresh_email (DBConnection *db_con);
Modified: branches/indexer-split/src/trackerd/tracker-indexer.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-indexer.c (original)
+++ branches/indexer-split/src/trackerd/tracker-indexer.c Tue May 6 15:36:19 2008
@@ -67,8 +67,6 @@
DEPOT *word_index; /* file hashtable handle for the word -> {serviceID, ServiceTypeID, Score} */
GMutex *word_mutex;
char *name;
- gpointer emails; /* pointer to email indexer */
- gpointer data; /* pointer to file indexer */
gboolean main_index;
gboolean needs_merge; /* should new stuff be added directly or merged later on from a new index */
};
Modified: branches/indexer-split/src/trackerd/tracker-indexer.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-indexer.h (original)
+++ branches/indexer-split/src/trackerd/tracker-indexer.h Tue May 6 15:36:19 2008
@@ -28,7 +28,6 @@
#include <libtracker-db/tracker-db-interface.h>
-#include "tracker-utils.h"
typedef struct { /* type of structure for an element of search result */
guint32 id; /* Service ID number of the document */
Modified: branches/indexer-split/src/trackerd/tracker-parser.c
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-parser.c (original)
+++ branches/indexer-split/src/trackerd/tracker-parser.c Tue May 6 15:36:19 2008
@@ -59,11 +59,11 @@
WORD_ALPHA,
WORD_ALPHA_NUM,
WORD_IGNORE
-} WordType;
+} TrackerParserWordType;
-static inline WordType
+static inline TrackerParserWordType
get_word_type (gunichar c)
{
/* fast ascii handling */
@@ -181,13 +181,13 @@
gboolean do_strip = FALSE, is_valid = TRUE;
int length = 0;
glong bytes = 0;
- WordType word_type = WORD_IGNORE;
+ TrackerParserWordType word_type = WORD_IGNORE;
for (p = text; *p; p = g_utf8_next_char (p)) {
gunichar c = g_utf8_get_char (p);
- WordType type = get_word_type (c);
+ TrackerParserWordType type = get_word_type (c);
if (type == WORD_IGNORE || (delimit_hyphen && (type == WORD_HYPHEN || type == WORD_UNDERSCORE))) {
Modified: branches/indexer-split/src/trackerd/tracker-utils.h
==============================================================================
--- branches/indexer-split/src/trackerd/tracker-utils.h (original)
+++ branches/indexer-split/src/trackerd/tracker-utils.h Tue May 6 15:36:19 2008
@@ -37,6 +37,7 @@
#include <libtracker-db/tracker-db-action.h>
#include "tracker-parser.h"
+#include "tracker-indexer.h"
#define MAX_HITS_FOR_WORD 30000
@@ -197,9 +198,9 @@
gboolean pause_io;
/* indexing options */
- gpointer file_index;
- gpointer file_update_index;
- gpointer email_index;
+ 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;
Modified: branches/indexer-split/src/trackerd/trackerd.c
==============================================================================
--- branches/indexer-split/src/trackerd/trackerd.c (original)
+++ branches/indexer-split/src/trackerd/trackerd.c Tue May 6 15:36:19 2008
@@ -967,7 +967,7 @@
/* this var is used to tell the threads when to quit */
tracker->is_running = TRUE;
- tracker->index_db = tracker_db_connect_all (TRUE);
+ tracker->index_db = tracker_db_connect_all ();
/* If we are already running, this should return some
* indication.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]