tracker r2342 - in trunk: . src/libtracker-db src/tracker-indexer src/trackerd



Author: pvanhoof
Date: Thu Oct  9 12:02:51 2008
New Revision: 2342
URL: http://svn.gnome.org/viewvc/tracker?rev=2342&view=rev

Log:
2008-10-09  Philip Van Hoof  <philip codeminded be>

	* src/libtracker-db/tracker-db-interface-sqlite.c
	* src/libtracker-db/tracker-db-interface-sqlite.h
	* src/libtracker-db/tracker-db-manager.c
	* src/libtracker-db/tracker-db-manager.h
	* src/trackerd/tracker-main.c
	* src/tracker-indexer/tracker-main.c: utilizing SQLite's shared cache 
	feature in the daemon.



Modified:
   trunk/ChangeLog
   trunk/src/libtracker-db/tracker-db-interface-sqlite.c
   trunk/src/libtracker-db/tracker-db-interface-sqlite.h
   trunk/src/libtracker-db/tracker-db-manager.c
   trunk/src/libtracker-db/tracker-db-manager.h
   trunk/src/tracker-indexer/tracker-main.c
   trunk/src/trackerd/tracker-main.c

Modified: trunk/src/libtracker-db/tracker-db-interface-sqlite.c
==============================================================================
--- trunk/src/libtracker-db/tracker-db-interface-sqlite.c	(original)
+++ trunk/src/libtracker-db/tracker-db-interface-sqlite.c	Thu Oct  9 12:02:51 2008
@@ -56,6 +56,12 @@
 			 G_IMPLEMENT_INTERFACE (TRACKER_TYPE_DB_INTERFACE,
 						tracker_db_interface_sqlite_iface_init))
 
+void 
+tracker_db_interface_sqlite_enable_shared_cache (void) 
+{
+	sqlite3_enable_shared_cache (1);
+}
+
 static GObject *
 tracker_db_interface_sqlite_constructor (GType			type,
 					 guint			n_construct_properties,

Modified: trunk/src/libtracker-db/tracker-db-interface-sqlite.h
==============================================================================
--- trunk/src/libtracker-db/tracker-db-interface-sqlite.h	(original)
+++ trunk/src/libtracker-db/tracker-db-interface-sqlite.h	Thu Oct  9 12:02:51 2008
@@ -65,6 +65,7 @@
 
 gint64		     tracker_db_interface_sqlite_get_last_insert_id	(TrackerDBInterfaceSqlite *interface);
 
+void		     tracker_db_interface_sqlite_enable_shared_cache (void);
 
 G_END_DECLS
 

Modified: trunk/src/libtracker-db/tracker-db-manager.c
==============================================================================
--- trunk/src/libtracker-db/tracker-db-manager.c	(original)
+++ trunk/src/libtracker-db/tracker-db-manager.c	Thu Oct  9 12:02:51 2008
@@ -2379,7 +2379,8 @@
 
 void
 tracker_db_manager_init (TrackerDBManagerFlags	flags,
-			 gboolean	       *first_time)
+			 gboolean	       *first_time,
+			 gboolean	        shared_cache)
 {
 	GType		    etype;
 	TrackerDBVersion    version;
@@ -2396,6 +2397,9 @@
 		return;
 	}
 
+	if (shared_cache)
+		tracker_db_interface_sqlite_enable_shared_cache ();
+
 	need_reindex = FALSE;
 
 	/* Since we don't reference this enum anywhere, we do

Modified: trunk/src/libtracker-db/tracker-db-manager.h
==============================================================================
--- trunk/src/libtracker-db/tracker-db-manager.h	(original)
+++ trunk/src/libtracker-db/tracker-db-manager.h	Thu Oct  9 12:02:51 2008
@@ -59,7 +59,8 @@
 GType	     tracker_db_get_type			    (void) G_GNUC_CONST;
 
 void	     tracker_db_manager_init			    (TrackerDBManagerFlags  flags,
-							     gboolean		   *first_time);
+							     gboolean		   *first_time,
+							     gboolean 		    shared_cache);
 void	     tracker_db_manager_shutdown		    (void);
 
 void	     tracker_db_manager_remove_all		    (void);

Modified: trunk/src/tracker-indexer/tracker-main.c
==============================================================================
--- trunk/src/tracker-indexer/tracker-main.c	(original)
+++ trunk/src/tracker-indexer/tracker-main.c	Thu Oct  9 12:02:51 2008
@@ -316,7 +316,7 @@
 		flags |= TRACKER_DB_MANAGER_LOW_MEMORY_MODE;
 	}
 
-	tracker_db_manager_init (flags, NULL);
+	tracker_db_manager_init (flags, NULL, FALSE);
 	if (!tracker_db_index_manager_init (0,
 					    tracker_config_get_min_bucket_count (config),
 					    tracker_config_get_max_bucket_count (config))) {

Modified: trunk/src/trackerd/tracker-main.c
==============================================================================
--- trunk/src/trackerd/tracker-main.c	(original)
+++ trunk/src/trackerd/tracker-main.c	Thu Oct  9 12:02:51 2008
@@ -817,7 +817,7 @@
 		flags |= TRACKER_DB_MANAGER_LOW_MEMORY_MODE;
 	}
 
-	tracker_db_manager_init (flags, &is_first_time_index);
+	tracker_db_manager_init (flags, &is_first_time_index, TRUE);
 	tracker_status_set_is_first_time_index (is_first_time_index);
 
 	if (!tracker_db_index_manager_init (index_flags,



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