[tracker/journal: 8/13] libtracker-data: Do not write ontology into data journal
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/journal: 8/13] libtracker-data: Do not write ontology into data journal
- Date: Tue, 12 Oct 2010 10:17:07 +0000 (UTC)
commit 52baca137de35dac9a0e8f4132dd73565302d36d
Author: Jürg Billeter <j bitron ch>
Date: Wed Oct 6 15:09:30 2010 +0200
libtracker-data: Do not write ontology into data journal
src/libtracker-data/tracker-db-journal.c | 45 ++++++++++++++++++++---------
1 files changed, 31 insertions(+), 14 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-journal.c b/src/libtracker-data/tracker-db-journal.c
index 8fb0a48..bcb168e 100644
--- a/src/libtracker-data/tracker-db-journal.c
+++ b/src/libtracker-data/tracker-db-journal.c
@@ -719,6 +719,10 @@ tracker_db_journal_append_delete_statement (gint g_id,
gint p_id,
const gchar *object)
{
+ if (current_transaction_format == TRANSACTION_FORMAT_ONTOLOGY) {
+ return TRUE;
+ }
+
return db_journal_writer_append_delete_statement (&writer,
g_id, s_id, p_id, object);
}
@@ -769,6 +773,10 @@ tracker_db_journal_append_delete_statement_id (gint g_id,
gint p_id,
gint o_id)
{
+ if (current_transaction_format == TRANSACTION_FORMAT_ONTOLOGY) {
+ return TRUE;
+ }
+
return db_journal_writer_append_delete_statement_id (&writer,
g_id, s_id, p_id, o_id);
}
@@ -821,6 +829,10 @@ tracker_db_journal_append_insert_statement (gint g_id,
gint p_id,
const gchar *object)
{
+ if (current_transaction_format == TRANSACTION_FORMAT_ONTOLOGY) {
+ return TRUE;
+ }
+
return db_journal_writer_append_insert_statement (&writer,
g_id, s_id, p_id, object);
}
@@ -871,6 +883,10 @@ tracker_db_journal_append_insert_statement_id (gint g_id,
gint p_id,
gint o_id)
{
+ if (current_transaction_format == TRANSACTION_FORMAT_ONTOLOGY) {
+ return TRUE;
+ }
+
return db_journal_writer_append_insert_statement_id (&writer,
g_id, s_id, p_id, o_id);
}
@@ -910,10 +926,11 @@ tracker_db_journal_append_resource (gint s_id,
g_return_val_if_fail (current_transaction_format != TRANSACTION_FORMAT_NONE, FALSE);
- ret = db_journal_writer_append_resource (&writer, s_id, uri);
if (current_transaction_format == TRANSACTION_FORMAT_ONTOLOGY) {
- db_journal_writer_append_resource (&ontology_writer, s_id, uri);
+ ret = db_journal_writer_append_resource (&ontology_writer, s_id, uri);
+ } else {
+ ret = db_journal_writer_append_resource (&writer, s_id, uri);
}
return ret;
@@ -1000,25 +1017,25 @@ tracker_db_journal_commit_db_transaction (void)
g_return_val_if_fail (current_transaction_format != TRANSACTION_FORMAT_NONE, FALSE);
- ret = db_journal_writer_commit_db_transaction (&writer);
-
if (current_transaction_format == TRANSACTION_FORMAT_ONTOLOGY) {
- db_journal_writer_commit_db_transaction (&ontology_writer);
+ ret = db_journal_writer_commit_db_transaction (&ontology_writer);
db_journal_writer_shutdown (&ontology_writer);
- }
-
- current_transaction_format = TRANSACTION_FORMAT_NONE;
+ } else {
+ ret = db_journal_writer_commit_db_transaction (&writer);
#if GLIB_CHECK_VERSION (2, 24, 2)
- if (ret) {
- if (rotating_settings.do_rotating && (writer.cur_size > rotating_settings.chunk_size)) {
- if (!tracker_db_journal_rotate ()) {
- g_critical ("Could not rotate journal, %s", g_strerror (errno));
- ret = FALSE;
+ if (ret) {
+ if (rotating_settings.do_rotating && (writer.cur_size > rotating_settings.chunk_size)) {
+ if (!tracker_db_journal_rotate ()) {
+ g_critical ("Could not rotate journal, %s", g_strerror (errno));
+ ret = FALSE;
+ }
}
}
- }
#endif /* GLib check */
+ }
+
+ current_transaction_format = TRANSACTION_FORMAT_NONE;
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]