tracker r1846 - in branches/indexer-split: . src/libtracker-common src/tracker-indexer src/trackerd



Author: mr
Date: Thu Jul  3 11:38:54 2008
New Revision: 1846
URL: http://svn.gnome.org/viewvc/tracker?rev=1846&view=rev

Log:
	* src/tracker-indexer/tracker-main.c:
	* src/trackerd/tracker-main.c: Improved startup option sanity
	check output so we only show daemon or indexer options, not
	everything.


Modified:
   branches/indexer-split/ChangeLog
   branches/indexer-split/src/libtracker-common/tracker-config.c
   branches/indexer-split/src/libtracker-common/tracker-config.h
   branches/indexer-split/src/tracker-indexer/tracker-main.c
   branches/indexer-split/src/trackerd/tracker-main.c

Modified: branches/indexer-split/src/libtracker-common/tracker-config.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-config.c	(original)
+++ branches/indexer-split/src/libtracker-common/tracker-config.c	Thu Jul  3 11:38:54 2008
@@ -72,7 +72,6 @@
 #define KEY_DIVISIONS				 "Divisions"
 #define KEY_BUCKET_RATIO			 "BucketRatio"
 #define KEY_PADDING				 "Padding"
-#define KEY_THREAD_STACK_SIZE			 "ThreadStackSize"
 
 #define GROUP_SERVICES				 "Services"
 #define KEY_ENABLE_XESAM			 "EnableXesam"
@@ -105,7 +104,6 @@
 #define DEFAULT_DIVISIONS			 4	  /* 1->64 */
 #define DEFAULT_BUCKET_RATIO			 1	  /* 0=50%, 1=100%, 2=200%, 3=300%, 4=400% */
 #define DEFAULT_PADDING				 2	  /* 1->8 */
-#define DEFAULT_THREAD_STACK_SIZE		 0	  /* 0 is the default for the platform */
 
 /*typedef struct _ConfigLanguages	  ConfigLanguages;*/
 typedef struct _TrackerConfigPriv TrackerConfigPriv;
@@ -152,7 +150,6 @@
 	gint	  divisions;
 	gint	  bucket_ratio;
 	gint	  padding;
-	gint	  thread_stack_size;
 
 	/* Services*/
 	gboolean  enable_xesam;
@@ -210,7 +207,6 @@
 	PROP_DIVISIONS,
 	PROP_BUCKET_RATIO,
 	PROP_PADDING,
-	PROP_THREAD_STACK_SIZE,
 
 	/* Services*/
 	PROP_ENABLE_XESAM
@@ -501,16 +497,6 @@
 							   8,
 							   DEFAULT_PADDING,
 							   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
-	g_object_class_install_property (object_class,
-					 PROP_THREAD_STACK_SIZE,
-					 g_param_spec_int ("thread-stack-size",
-							   "Thread stack size",
-							   "Thread stack size to use inside tracker. "
-							   "Use this carefully, as it may lead to misterious crashes. "
-							   "The default is 0, which uses the default for the platform.",
-							   0, G_MAXINT,
-							   DEFAULT_THREAD_STACK_SIZE,
-							   G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
 
 	/* Services */
 	g_object_class_install_property (object_class,
@@ -672,9 +658,6 @@
 	case PROP_PADDING:
 		g_value_set_int (value, priv->padding);
 		break;
-	case PROP_THREAD_STACK_SIZE:
-		g_value_set_int (value, priv->thread_stack_size);
-		break;
 
 	/* Services */
 	case PROP_ENABLE_XESAM:
@@ -819,10 +802,6 @@
 		tracker_config_set_padding (TRACKER_CONFIG (object),
 					    g_value_get_int (value));
 		break;
-	case PROP_THREAD_STACK_SIZE:
-		tracker_config_set_thread_stack_size (TRACKER_CONFIG (object),
-						      g_value_get_int (value));
-		break;
 
 	/* Services */
 	case PROP_ENABLE_XESAM:
@@ -1111,12 +1090,6 @@
 				" Higher values improve indexing speed but waste more disk space.\n"
 				" Values should be between 1 and 8.",
 				NULL);
-	g_key_file_set_integer (key_file, GROUP_PERFORMANCE, KEY_THREAD_STACK_SIZE, DEFAULT_THREAD_STACK_SIZE);
-	g_key_file_set_comment (key_file, GROUP_PERFORMANCE, KEY_THREAD_STACK_SIZE,
-				" Stack size to use in threads inside Tracker.\n"
-				" Use this carefully, or expect misterious crashes.\n"
-				" 0 uses the default stack size for this platform",
-				NULL);
 
 	/* Services */
 	g_key_file_set_boolean (key_file, GROUP_SERVICES, KEY_ENABLE_XESAM, DEFAULT_ENABLE_XESAM);
@@ -1409,7 +1382,6 @@
 	config_load_int (config, "divisions", key_file, GROUP_PERFORMANCE, KEY_DIVISIONS);
 	config_load_int (config, "bucket-ratio", key_file, GROUP_PERFORMANCE, KEY_BUCKET_RATIO);
 	config_load_int (config, "padding", key_file, GROUP_PERFORMANCE, KEY_PADDING);
-	config_load_int (config, "thread-stack-size", key_file, GROUP_PERFORMANCE, KEY_THREAD_STACK_SIZE);
 
 	/* Services */
 	config_load_boolean (config, "enable-xesam", key_file, GROUP_SERVICES, KEY_ENABLE_XESAM);
@@ -1837,18 +1809,6 @@
 	return priv->padding;
 }
 
-gint
-tracker_config_get_thread_stack_size (TrackerConfig *config)
-{
-	TrackerConfigPriv *priv;
-
-	g_return_val_if_fail (TRACKER_IS_CONFIG (config), DEFAULT_THREAD_STACK_SIZE);
-
-	priv = GET_PRIV (config);
-
-	return priv->thread_stack_size;
-}
-
 void
 tracker_config_set_verbosity (TrackerConfig *config,
 			      gint	     value)
@@ -2312,24 +2272,6 @@
 }
 
 void
-tracker_config_set_thread_stack_size (TrackerConfig *config,
-				      gint	     value)
-{
-	TrackerConfigPriv *priv;
-
-	g_return_if_fail (TRACKER_IS_CONFIG (config));
-
-	if (!config_int_validate (config, "thread-stack-size", value)) {
-		return;
-	}
-
-	priv = GET_PRIV (config);
-
-	priv->thread_stack_size = value;
-	g_object_notify (G_OBJECT (config), "thread-stack-size");
-}
-
-void
 tracker_config_add_watch_directory_roots (TrackerConfig	 *config,
 					  gchar * const	 *roots)
 {

Modified: branches/indexer-split/src/libtracker-common/tracker-config.h
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-config.h	(original)
+++ branches/indexer-split/src/libtracker-common/tracker-config.h	Thu Jul  3 11:38:54 2008
@@ -82,7 +82,6 @@
 gint           tracker_config_get_divisions                        (TrackerConfig *config);
 gint           tracker_config_get_bucket_ratio                     (TrackerConfig *config);
 gint           tracker_config_get_padding                          (TrackerConfig *config);
-gint           tracker_config_get_thread_stack_size                (TrackerConfig *config);
 void           tracker_config_set_verbosity                        (TrackerConfig *config,
 								    gint           value);
 void           tracker_config_set_initial_sleep                    (TrackerConfig *config,
@@ -139,8 +138,6 @@
 								    gint           value);
 void           tracker_config_set_padding                          (TrackerConfig *config,
 								    gint           value);
-void           tracker_config_set_thread_stack_size                (TrackerConfig *config,
-								    gint           value);
 
 /* Directory root APIs*/
 void           tracker_config_add_watch_directory_roots            (TrackerConfig *config,

Modified: branches/indexer-split/src/tracker-indexer/tracker-main.c
==============================================================================
--- branches/indexer-split/src/tracker-indexer/tracker-main.c	(original)
+++ branches/indexer-split/src/tracker-indexer/tracker-main.c	Thu Jul  3 11:38:54 2008
@@ -77,6 +77,59 @@
 };
 
 static void
+sanity_check_option_values (TrackerConfig *config)
+{
+	g_message ("General options:");
+	g_message ("  Verbosity  ............................  %d", 
+		   tracker_config_get_verbosity (config));
+ 	g_message ("  Low memory mode  ......................  %s", 
+		   tracker_config_get_low_memory_mode (config) ? "yes" : "no");
+
+	g_message ("Indexer options:");
+	g_message ("  Throttle level  .......................  %d",
+		   tracker_config_get_throttle (config));
+ 	g_message ("  File content indexing enabled  ........  %s", 
+		   tracker_config_get_enable_content_indexing (config) ? "yes" : "no");
+	g_message ("  Thumbnail indexing enabled  ...........  %s", 
+		   tracker_config_get_enable_thumbnails (config) ? "yes" : "no");
+	g_message ("  Indexer language code  ................  %s", 
+		   tracker_config_get_language (config));
+	g_message ("  Stemmer enabled  ......................  %s", 
+		   tracker_config_get_enable_stemmer (config) ? "yes" : "no");
+	g_message ("  Fast merges enabled  ..................  %s", 
+		   tracker_config_get_fast_merges (config) ? "yes" : "no");
+	g_message ("  Disable indexing on battery  ..........  %s (initially = %s)", 
+		   tracker_config_get_disable_indexing_on_battery (config) ? "yes" : "no",
+		   tracker_config_get_disable_indexing_on_battery_init (config) ? "yes" : "no");
+
+	if (tracker_config_get_low_disk_space_limit (config) == -1) { 
+		g_message ("  Low disk space limit  .................  Disabled");
+	} else {
+		g_message ("  Low disk space limit  .................  %d%%",
+			   tracker_config_get_low_disk_space_limit (config));
+	}
+
+	g_message ("  Minimum index word length  ............  %d",
+		   tracker_config_get_min_word_length (config));
+	g_message ("  Maximum index word length  ............  %d",
+		   tracker_config_get_max_word_length (config));
+	g_message ("  Maximum text to index  ................  %d",
+		   tracker_config_get_max_text_to_index (config));
+	g_message ("  Maximum words to index  ...............  %d",
+		   tracker_config_get_max_words_to_index (config));
+	g_message ("  Maximum bucket count  .................  %d",
+		   tracker_config_get_max_bucket_count (config));
+	g_message ("  Minimum bucket count  .................  %d",
+		   tracker_config_get_min_bucket_count (config));
+	g_message ("  Divisions  ............................  %d",
+		   tracker_config_get_divisions (config));
+	g_message ("  Padding  ..............................  %d",
+		   tracker_config_get_padding (config));
+	g_message ("  Optimization sweep count  .............  %d",
+		   tracker_config_get_optimization_sweep_count (config));
+}
+
+static void
 signal_handler (gint signo)
 {
 	static gboolean in_loop = FALSE;
@@ -273,6 +326,8 @@
                 return EXIT_FAILURE;
         }
 
+	sanity_check_option_values (config);
+
 	initialize_indexer ();
 
 #ifdef HAVE_IOPRIO

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 Jul  3 11:38:54 2008
@@ -245,72 +245,30 @@
 }
 
 static void
-sanity_check_option_values (void)
+sanity_check_option_values (TrackerConfig *config)
 {
-	g_message ("Tracker configuration options:");
+	g_message ("General options:");
 	g_message ("  Initial sleep  ........................  %d (seconds)", 
-		   tracker_config_get_initial_sleep (tracker->config));
+		   tracker_config_get_initial_sleep (config));
 	g_message ("  Verbosity  ............................  %d", 
-		   tracker_config_get_verbosity (tracker->config));
+		   tracker_config_get_verbosity (config));
  	g_message ("  Low memory mode  ......................  %s", 
-		   tracker_config_get_low_memory_mode (tracker->config) ? "yes" : "no");
+		   tracker_config_get_low_memory_mode (config) ? "yes" : "no");
+
+	
+	g_message ("Daemon options:");
  	g_message ("  Indexing enabled  .....................  %s", 
-		   tracker_config_get_enable_indexing (tracker->config) ? "yes" : "no");
+		   tracker_config_get_enable_indexing (config) ? "yes" : "no");
  	g_message ("  Monitoring enabled  ...................  %s", 
-		   tracker_config_get_enable_watches (tracker->config) ? "yes" : "no");
- 	g_message ("  File content indexing enabled  ........  %s", 
-		   tracker_config_get_enable_content_indexing (tracker->config) ? "yes" : "no");
-	g_message ("  Thumbnailing enabled  .................  %s", 
-		   tracker_config_get_enable_thumbnails (tracker->config) ? "yes" : "no");
-
-	g_message ("Tracker indexer parameters:");
-	g_message ("  Indexer language code  ................  %s", 
-		   tracker_config_get_language (tracker->config));
-	g_message ("  Stemmer enabled  ......................  %s", 
-		   tracker_config_get_enable_stemmer (tracker->config) ? "yes" : "no");
-	g_message ("  Fast merges enabled  ..................  %s", 
-		   tracker_config_get_fast_merges (tracker->config) ? "yes" : "no");
-	g_message ("  Disable indexing on battery  ..........  %s (initially = %s)", 
-		   tracker_config_get_disable_indexing_on_battery (tracker->config) ? "yes" : "no",
-		   tracker_config_get_disable_indexing_on_battery_init (tracker->config) ? "yes" : "no");
-
-	if (tracker_config_get_low_disk_space_limit (tracker->config) == -1) { 
-		g_message ("  Low disk space limit  .................  Disabled");
-	} else {
-		g_message ("  Low disk space limit  .................  %d%%",
-			   tracker_config_get_low_disk_space_limit (tracker->config));
-	}
-
-	g_message ("  Minimum index word length  ............  %d",
-		   tracker_config_get_min_word_length (tracker->config));
-	g_message ("  Maximum index word length  ............  %d",
-		   tracker_config_get_max_word_length (tracker->config));
-	g_message ("  Maximum text to index  ................  %d",
-		   tracker_config_get_max_text_to_index (tracker->config));
-	g_message ("  Maximum words to index  ...............  %d",
-		   tracker_config_get_max_words_to_index (tracker->config));
-	g_message ("  Maximum bucket count  .................  %d",
-		   tracker_config_get_max_bucket_count (tracker->config));
-	g_message ("  Minimum bucket count  .................  %d",
-		   tracker_config_get_min_bucket_count (tracker->config));
-	g_message ("  Divisions  ............................  %d",
-		   tracker_config_get_divisions (tracker->config));
-	g_message ("  Padding  ..............................  %d",
-		   tracker_config_get_padding (tracker->config));
-	g_message ("  Optimization sweep count  .............  %d",
-		   tracker_config_get_optimization_sweep_count (tracker->config));
-	g_message ("  Thread stack size  ....................  %d",
-		   tracker_config_get_thread_stack_size (tracker->config));
-	g_message ("  Throttle level  .......................  %d",
-		   tracker_config_get_throttle (tracker->config));
+		   tracker_config_get_enable_watches (config) ? "yes" : "no");
 
-	log_option_list (tracker_config_get_watch_directory_roots (tracker->config),
+	log_option_list (tracker_config_get_watch_directory_roots (config),
 			 "Monitor directories included");
-	log_option_list (tracker_config_get_no_watch_directory_roots (tracker->config),
+	log_option_list (tracker_config_get_no_watch_directory_roots (config),
 			 "Monitor directories excluded");
-	log_option_list (tracker_config_get_crawl_directory_roots (tracker->config),
+	log_option_list (tracker_config_get_crawl_directory_roots (config),
 			 "Crawling directories");
-	log_option_list (tracker_config_get_no_index_file_types (tracker->config),
+	log_option_list (tracker_config_get_no_index_file_types (config),
 			 "File types excluded from indexing");
 }
 
@@ -788,7 +746,7 @@
 		return EXIT_FAILURE;
 	} 
 
-	sanity_check_option_values ();
+	sanity_check_option_values (tracker->config);
 
 	tracker_nfs_lock_init (tracker_config_get_nfs_locking (tracker->config));
 



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