[tracker/journal-compression] rename config key, squash
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/journal-compression] rename config key, squash
- Date: Thu, 6 May 2010 09:17:30 +0000 (UTC)
commit 410f48caca4e645be94a24cc6f18d118e815711a
Author: Philip Van Hoof <philip codeminded be>
Date: Thu May 6 11:16:13 2010 +0200
rename config key, squash
src/libtracker-data/tracker-data-backup.c | 8 ++--
src/libtracker-data/tracker-data-manager.c | 8 ++--
src/libtracker-data/tracker-data-manager.h | 2 +-
src/libtracker-data/tracker-data-update.c | 6 ++--
src/libtracker-db/tracker-db-journal.c | 16 ++++----
src/libtracker-db/tracker-db-journal.h | 4 +-
src/tracker-store/tracker-config.c | 50 +++++++++++++++-------------
src/tracker-store/tracker-config.h | 4 +-
src/tracker-store/tracker-main.c | 2 +-
9 files changed, 52 insertions(+), 48 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-backup.c b/src/libtracker-data/tracker-data-backup.c
index e3b91c7..3c5c2f5 100644
--- a/src/libtracker-data/tracker-data-backup.c
+++ b/src/libtracker-data/tracker-data-backup.c
@@ -143,7 +143,7 @@ tracker_data_backup_restore (GFile *journal,
if (g_file_query_exists (info->journal, NULL)) {
TrackerDBManagerFlags flags = tracker_db_manager_get_flags ();
gboolean is_first;
- gsize max_chunk_size = 0;
+ gsize chunk_size = 0;
gboolean do_rotating = FALSE;
tracker_db_manager_move_to_temp ();
@@ -158,8 +158,8 @@ tracker_data_backup_restore (GFile *journal,
&info->error);
tracker_db_manager_init_locations ();
- tracker_db_journal_get_rotating (&do_rotating, &max_chunk_size);
- tracker_db_journal_init (NULL, FALSE, do_rotating, max_chunk_size);
+ tracker_db_journal_get_rotating (&do_rotating, &chunk_size);
+ tracker_db_journal_init (NULL, FALSE, do_rotating, chunk_size);
if (info->error) {
tracker_db_manager_restore_from_temp ();
@@ -169,7 +169,7 @@ tracker_data_backup_restore (GFile *journal,
tracker_db_journal_shutdown ();
- tracker_data_manager_init (flags, do_rotating, max_chunk_size,
+ tracker_data_manager_init (flags, do_rotating, chunk_size,
test_schemas, &is_first, TRUE,
busy_callback, busy_user_data,
"Restoring backup");
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index ee4c3a1..ddc5ea6 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -2029,7 +2029,7 @@ get_new_service_id (TrackerDBInterface *iface)
gboolean
tracker_data_manager_init (TrackerDBManagerFlags flags,
gboolean do_journal_rotating,
- gsize max_chunk_size,
+ gsize chunk_size,
const gchar **test_schemas,
gboolean *first_time,
gboolean journal_check,
@@ -2121,7 +2121,7 @@ tracker_data_manager_init (TrackerDBManagerFlags flags,
in_journal_replay = FALSE;
/* open journal for writing */
- tracker_db_journal_init (NULL, FALSE, do_journal_rotating, max_chunk_size);
+ tracker_db_journal_init (NULL, FALSE, do_journal_rotating, chunk_size);
check_ontology = TRUE;
@@ -2134,7 +2134,7 @@ tracker_data_manager_init (TrackerDBManagerFlags flags,
/* Truncate journal as it does not even contain a single valid transaction
* or is explicitly ignored (journal_check == FALSE, only for test cases) */
- tracker_db_journal_init (NULL, TRUE, do_journal_rotating, max_chunk_size);
+ tracker_db_journal_init (NULL, TRUE, do_journal_rotating, chunk_size);
/* load ontology from files into memory (max_id starts at zero: first-time) */
@@ -2195,7 +2195,7 @@ tracker_data_manager_init (TrackerDBManagerFlags flags,
/* First time, no need to check ontology */
check_ontology = FALSE;
} else {
- tracker_db_journal_init (NULL, FALSE, do_journal_rotating, max_chunk_size);
+ tracker_db_journal_init (NULL, FALSE, do_journal_rotating, chunk_size);
/* Load ontology from database into memory */
db_get_static_data (iface);
diff --git a/src/libtracker-data/tracker-data-manager.h b/src/libtracker-data/tracker-data-manager.h
index 393775b..e8876fb 100644
--- a/src/libtracker-data/tracker-data-manager.h
+++ b/src/libtracker-data/tracker-data-manager.h
@@ -41,7 +41,7 @@ G_BEGIN_DECLS
gboolean tracker_data_manager_init (TrackerDBManagerFlags flags,
gboolean do_journal_rotating,
- gsize max_chunk_size,
+ gsize chunk_size,
const gchar **test_schema,
gboolean *first_time,
gboolean journal_check,
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index a2fadce..485eed6 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2798,15 +2798,15 @@ tracker_data_replay_journal (GHashTable *classes,
if (journal_error) {
gsize size;
- gsize max_chunk_size = 0;
+ gsize chunk_size = 0;
gboolean do_rotating = FALSE;
size = tracker_db_journal_reader_get_size_of_correct ();
tracker_db_journal_reader_shutdown ();
- tracker_db_journal_get_rotating (&do_rotating, &max_chunk_size);
+ tracker_db_journal_get_rotating (&do_rotating, &chunk_size);
- tracker_db_journal_init (NULL, FALSE, do_rotating, max_chunk_size);
+ tracker_db_journal_init (NULL, FALSE, do_rotating, chunk_size);
tracker_db_journal_truncate (size);
tracker_db_journal_shutdown ();
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index b59392c..bea0559 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -96,7 +96,7 @@ static struct {
gchar *cur_block;
guint cur_entry_amount;
guint cur_pos;
- gsize max_chunk_size;
+ gsize chunk_size;
gboolean do_rotating;
} writer;
@@ -276,7 +276,7 @@ gboolean
tracker_db_journal_init (const gchar *filename,
gboolean truncate,
gboolean do_rotating,
- gsize max_chunk_size)
+ gsize chunk_size)
{
gchar *directory;
int mode;
@@ -299,8 +299,8 @@ tracker_db_journal_init (const gchar *filename,
mode = S_IRWXU | S_IRWXG | S_IRWXO;
if (g_mkdir_with_parents (directory, mode)) {
g_critical ("tracker data directory does not exist and "
- "could not be created: %s",
- g_strerror (errno));
+ "could not be created: %s",
+ g_strerror (errno));
g_free (directory);
g_free (writer.journal_filename);
@@ -312,7 +312,7 @@ tracker_db_journal_init (const gchar *filename,
g_free (directory);
writer.do_rotating = do_rotating;
- writer.max_chunk_size = max_chunk_size;
+ writer.chunk_size = chunk_size;
return tracker_db_journal_init_file (truncate);
}
@@ -625,10 +625,10 @@ tracker_db_journal_truncate (gsize new_size)
void
tracker_db_journal_get_rotating (gboolean *do_rotating,
- gsize *max_chunk_size)
+ gsize *chunk_size)
{
*do_rotating = writer.do_rotating;
- *max_chunk_size = writer.max_chunk_size;
+ *chunk_size = writer.chunk_size;
}
static gboolean
@@ -734,7 +734,7 @@ tracker_db_journal_commit_db_transaction (void)
/* Clean up for next transaction */
cur_block_kill ();
- if (writer.do_rotating && (writer.cur_size > writer.max_chunk_size)) {
+ if (writer.do_rotating && (writer.cur_size > writer.chunk_size)) {
if (!tracker_db_journal_rotate ()) {
g_critical ("Could not rotate journal, %s", g_strerror (errno));
return FALSE;
diff --git a/src/libtracker-db/tracker-db-journal.h b/src/libtracker-db/tracker-db-journal.h
index 1caf312..4ef0ca5 100644
--- a/src/libtracker-db/tracker-db-journal.h
+++ b/src/libtracker-db/tracker-db-journal.h
@@ -50,13 +50,13 @@ GQuark tracker_db_journal_error_quark (void);
gboolean tracker_db_journal_init (const gchar *filename,
gboolean truncate,
gboolean do_rotating,
- gsize max_chunk_size);
+ gsize chunk_size);
gboolean tracker_db_journal_shutdown (void);
const gchar* tracker_db_journal_get_filename (void);
gsize tracker_db_journal_get_size (void);
void tracker_db_journal_get_rotating (gboolean *do_rotating,
- gsize *max_chunk_size);
+ gsize *chunk_size);
gboolean tracker_db_journal_start_transaction (time_t time);
gboolean tracker_db_journal_start_ontology_transaction (time_t time);
diff --git a/src/tracker-store/tracker-config.c b/src/tracker-store/tracker-config.c
index 24100fe..c98472a 100644
--- a/src/tracker-store/tracker-config.c
+++ b/src/tracker-store/tracker-config.c
@@ -33,10 +33,11 @@
/* GKeyFile defines */
#define GROUP_GENERAL "General"
+#define GROUP_JOURNAL "Journal"
/* Default values */
#define DEFAULT_VERBOSITY 2
-#define DEFAULT_MAX_JOURNAL_CHUNK_SIZE 10
+#define DEFAULT_JOURNAL_CHUNK_SIZE 10
#define DEFAULT_ENABLE_JOURNAL_ROTATING TRUE
/* typedef struct TrackerConfigPrivate TrackerConfigPrivate; */
@@ -44,7 +45,8 @@
typedef struct {
/* General */
gint verbosity;
- gsize max_journal_chunk_size;
+ /* Journal */
+ gsize journal_chunk_size;
gboolean enable_journal_rotating;
} TrackerConfigPrivate;
@@ -75,14 +77,15 @@ enum {
/* General */
PROP_VERBOSITY,
- PROP_MAX_JOURNAL_CHUNK_SIZE,
+ /* Journal */
+ PROP_JOURNAL_CHUNK_SIZE,
PROP_ENABLE_JOURNAL_ROTATING
};
static ObjectToKeyFile conversions[] = {
{ G_TYPE_INT, "verbosity", GROUP_GENERAL, "Verbosity" },
- { G_TYPE_BOOLEAN, "enable-journal-rotating", GROUP_GENERAL, "EnableJournalRotating" },
- { G_TYPE_UINT64, "max-journal-chunk-size", GROUP_GENERAL, "MaxJournalChunkSize" },
+ { G_TYPE_BOOLEAN, "enable-journal-rotating", GROUP_JOURNAL, "EnableJournalRotating" },
+ { G_TYPE_UINT64, "journal-chunk-size", GROUP_JOURNAL, "JournalChunkSize" },
};
G_DEFINE_TYPE (TrackerConfig, tracker_config, TRACKER_TYPE_CONFIG_FILE);
@@ -109,13 +112,13 @@ tracker_config_class_init (TrackerConfigClass *klass)
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class,
- PROP_MAX_JOURNAL_CHUNK_SIZE,
- g_param_spec_uint64 ("max-journal-chunk-size",
- "Max journal chunk size",
- " Maximum size of a journal-chunk before rotation",
+ PROP_JOURNAL_CHUNK_SIZE,
+ g_param_spec_uint64 ("journal-chunk-size",
+ "Journal chunk size",
+ " Size of a journal-chunk before rotation",
0,
G_MAXSIZE,
- DEFAULT_MAX_JOURNAL_CHUNK_SIZE,
+ DEFAULT_JOURNAL_CHUNK_SIZE,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class,
@@ -146,9 +149,10 @@ config_set_property (GObject *object,
tracker_config_set_verbosity (TRACKER_CONFIG (object),
g_value_get_int (value));
break;
- case PROP_MAX_JOURNAL_CHUNK_SIZE:
- tracker_config_set_max_journal_chunk_size (TRACKER_CONFIG (object),
- (gsize) g_value_get_uint64 (value));
+ /* Journal */
+ case PROP_JOURNAL_CHUNK_SIZE:
+ tracker_config_set_journal_chunk_size (TRACKER_CONFIG (object),
+ (gsize) g_value_get_uint64 (value));
break;
case PROP_ENABLE_JOURNAL_ROTATING:
tracker_config_set_enable_journal_rotating (TRACKER_CONFIG (object),
@@ -175,8 +179,8 @@ config_get_property (GObject *object,
case PROP_VERBOSITY:
g_value_set_int (value, priv->verbosity);
break;
- case PROP_MAX_JOURNAL_CHUNK_SIZE:
- g_value_set_uint64 (value, (guint64) priv->max_journal_chunk_size);
+ case PROP_JOURNAL_CHUNK_SIZE:
+ g_value_set_uint64 (value, (guint64) priv->journal_chunk_size);
break;
case PROP_ENABLE_JOURNAL_ROTATING:
g_value_set_boolean (value, priv->enable_journal_rotating);
@@ -403,15 +407,15 @@ tracker_config_get_enable_journal_rotating (TrackerConfig *config)
}
gsize
-tracker_config_get_max_journal_chunk_size (TrackerConfig *config)
+tracker_config_get_journal_chunk_size (TrackerConfig *config)
{
TrackerConfigPrivate *priv;
- g_return_val_if_fail (TRACKER_IS_CONFIG (config), DEFAULT_MAX_JOURNAL_CHUNK_SIZE);
+ g_return_val_if_fail (TRACKER_IS_CONFIG (config), DEFAULT_JOURNAL_CHUNK_SIZE);
priv = TRACKER_CONFIG_GET_PRIVATE (config);
- return priv->max_journal_chunk_size;
+ return priv->journal_chunk_size;
}
void
@@ -429,21 +433,21 @@ tracker_config_set_enable_journal_rotating (TrackerConfig *config,
}
void
-tracker_config_set_max_journal_chunk_size (TrackerConfig *config,
- gsize value)
+tracker_config_set_journal_chunk_size (TrackerConfig *config,
+ gsize value)
{
TrackerConfigPrivate *priv;
g_return_if_fail (TRACKER_IS_CONFIG (config));
- if (!tracker_keyfile_object_validate_uint64 (config, "max-journal-chunk-size", (guint64) value)) {
+ if (!tracker_keyfile_object_validate_uint64 (config, "journal-chunk-size", (guint64) value)) {
return;
}
priv = TRACKER_CONFIG_GET_PRIVATE (config);
- priv->max_journal_chunk_size = value;
- g_object_notify (G_OBJECT (config), "max-journal-chunk-size");
+ priv->journal_chunk_size = value;
+ g_object_notify (G_OBJECT (config), "journal-chunk-size");
}
void
diff --git a/src/tracker-store/tracker-config.h b/src/tracker-store/tracker-config.h
index faf5a23..27f0695 100644
--- a/src/tracker-store/tracker-config.h
+++ b/src/tracker-store/tracker-config.h
@@ -50,13 +50,13 @@ TrackerConfig *tracker_config_new (void);
gboolean tracker_config_save (TrackerConfig *config);
gint tracker_config_get_verbosity (TrackerConfig *config);
gboolean tracker_config_get_enable_journal_rotating (TrackerConfig *config);
-gsize tracker_config_get_max_journal_chunk_size (TrackerConfig *config);
+gsize tracker_config_get_journal_chunk_size (TrackerConfig *config);
void tracker_config_set_verbosity (TrackerConfig *config,
gint value);
void tracker_config_set_enable_journal_rotating (TrackerConfig *config,
gboolean value);
-void tracker_config_set_max_journal_chunk_size (TrackerConfig *config,
+void tracker_config_set_journal_chunk_size (TrackerConfig *config,
gsize value);
G_END_DECLS
diff --git a/src/tracker-store/tracker-main.c b/src/tracker-store/tracker-main.c
index d754c09..b98d5cb 100644
--- a/src/tracker-store/tracker-main.c
+++ b/src/tracker-store/tracker-main.c
@@ -439,7 +439,7 @@ main (gint argc, gchar *argv[])
if (!tracker_data_manager_init (flags,
tracker_config_get_enable_journal_rotating (config),
- tracker_config_get_max_journal_chunk_size (config),
+ tracker_config_get_journal_chunk_size (config),
NULL,
&is_first_time_index,
TRUE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]