[tracker/wip/carlosg/tracker-3.0-api-breaks: 7/79] libtracker-sparql: Drop journal argument from direct connection constructor



commit bfba7c2f1097ccdb71284112dbf5b83f626c3e8a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Aug 18 12:46:17 2019 +0200

    libtracker-sparql: Drop journal argument from direct connection constructor
    
    This is unused underneath, and we're in the API break business right now.

 src/libtracker-direct/tracker-direct.c             | 22 ----------------------
 src/libtracker-direct/tracker-direct.h             |  1 -
 src/libtracker-direct/tracker-direct.vapi          |  2 +-
 src/libtracker-sparql-backend/tracker-backend.vala |  9 ++++-----
 src/libtracker-sparql/tracker-connection.vala      | 21 +++++++--------------
 src/tracker-store/tracker-main.vala                |  1 -
 tests/libtracker-fts/tracker-fts-test.c            |  2 +-
 7 files changed, 13 insertions(+), 45 deletions(-)
---
diff --git a/src/libtracker-direct/tracker-direct.c b/src/libtracker-direct/tracker-direct.c
index 542bfc0a1..85a176805 100644
--- a/src/libtracker-direct/tracker-direct.c
+++ b/src/libtracker-direct/tracker-direct.c
@@ -33,7 +33,6 @@ struct _TrackerDirectConnectionPrivate
 {
        TrackerSparqlConnectionFlags flags;
        GFile *store;
-       GFile *journal;
        GFile *ontology;
 
        TrackerNamespaceManager *namespace_manager;
@@ -50,7 +49,6 @@ enum {
        PROP_0,
        PROP_FLAGS,
        PROP_STORE_LOCATION,
-       PROP_JOURNAL_LOCATION,
        PROP_ONTOLOGY_LOCATION,
        N_PROPS
 };
@@ -223,9 +221,6 @@ tracker_direct_connection_initable_init (GInitable     *initable,
        if (priv->flags & TRACKER_SPARQL_CONNECTION_FLAGS_READONLY)
                db_flags |= TRACKER_DB_MANAGER_READONLY;
 
-       if (!priv->journal)
-               priv->journal = g_object_ref (priv->store);
-
        if (!priv->ontology) {
                gchar *filename;
 
@@ -332,7 +327,6 @@ tracker_direct_connection_finalize (GObject *object)
        }
 
        g_clear_object (&priv->store);
-       g_clear_object (&priv->journal);
        g_clear_object (&priv->ontology);
        g_clear_object (&priv->namespace_manager);
 
@@ -358,9 +352,6 @@ tracker_direct_connection_set_property (GObject      *object,
        case PROP_STORE_LOCATION:
                priv->store = g_value_dup_object (value);
                break;
-       case PROP_JOURNAL_LOCATION:
-               priv->journal = g_value_dup_object (value);
-               break;
        case PROP_ONTOLOGY_LOCATION:
                priv->ontology = g_value_dup_object (value);
                break;
@@ -389,9 +380,6 @@ tracker_direct_connection_get_property (GObject    *object,
        case PROP_STORE_LOCATION:
                g_value_set_object (value, priv->store);
                break;
-       case PROP_JOURNAL_LOCATION:
-               g_value_set_object (value, priv->journal);
-               break;
        case PROP_ONTOLOGY_LOCATION:
                g_value_set_object (value, priv->ontology);
                break;
@@ -715,13 +703,6 @@ tracker_direct_connection_class_init (TrackerDirectConnectionClass *klass)
                                     G_TYPE_FILE,
                                     G_PARAM_READWRITE |
                                     G_PARAM_CONSTRUCT_ONLY);
-       props[PROP_JOURNAL_LOCATION] =
-               g_param_spec_object ("journal-location",
-                                    "Journal location",
-                                    "Journal location",
-                                    G_TYPE_FILE,
-                                    G_PARAM_READWRITE |
-                                    G_PARAM_CONSTRUCT_ONLY);
        props[PROP_ONTOLOGY_LOCATION] =
                g_param_spec_object ("ontology-location",
                                     "Ontology location",
@@ -736,19 +717,16 @@ tracker_direct_connection_class_init (TrackerDirectConnectionClass *klass)
 TrackerDirectConnection *
 tracker_direct_connection_new (TrackerSparqlConnectionFlags   flags,
                               GFile                         *store,
-                              GFile                         *journal,
                                GFile                         *ontology,
                                GError                       **error)
 {
        g_return_val_if_fail (G_IS_FILE (store), NULL);
-       g_return_val_if_fail (!journal || G_IS_FILE (journal), NULL);
        g_return_val_if_fail (!ontology || G_IS_FILE (ontology), NULL);
        g_return_val_if_fail (!error || !*error, NULL);
 
        return g_object_new (TRACKER_TYPE_DIRECT_CONNECTION,
                             "flags", flags,
                             "store-location", store,
-                            "journal-location", journal,
                             "ontology-location", ontology,
                             NULL);
 }
diff --git a/src/libtracker-direct/tracker-direct.h b/src/libtracker-direct/tracker-direct.h
index 950db3975..b1c06ee9d 100644
--- a/src/libtracker-direct/tracker-direct.h
+++ b/src/libtracker-direct/tracker-direct.h
@@ -48,7 +48,6 @@ GType tracker_direct_connection_get_type (void) G_GNUC_CONST;
 
 TrackerDirectConnection *tracker_direct_connection_new (TrackerSparqlConnectionFlags   flags,
                                                         GFile                         *store,
-                                                        GFile                         *journal,
                                                         GFile                         *ontology,
                                                         GError                       **error);
 
diff --git a/src/libtracker-direct/tracker-direct.vapi b/src/libtracker-direct/tracker-direct.vapi
index 8839eafae..cf5e3b452 100644
--- a/src/libtracker-direct/tracker-direct.vapi
+++ b/src/libtracker-direct/tracker-direct.vapi
@@ -3,7 +3,7 @@ namespace Tracker {
         namespace Direct {
                 [CCode (cheader_filename = "libtracker-direct/tracker-direct.h")]
                 public class Connection : Tracker.Sparql.Connection, GLib.Initable, GLib.AsyncInitable {
-                        public Connection (Tracker.Sparql.ConnectionFlags connection_flags, GLib.File loc, 
GLib.File? journal, GLib.File? ontology) throws Tracker.Sparql.Error, GLib.IOError, GLib.DBusError;
+                        public Connection (Tracker.Sparql.ConnectionFlags connection_flags, GLib.File loc, 
GLib.File? ontology) throws Tracker.Sparql.Error, GLib.IOError, GLib.DBusError;
                         public unowned Tracker.Data.Manager get_data_manager ();
                        public void sync ();
                        public static void set_default_flags (Tracker.DBManagerFlags flags);
diff --git a/src/libtracker-sparql-backend/tracker-backend.vala 
b/src/libtracker-sparql-backend/tracker-backend.vala
index 0dc974d75..f98dc677e 100644
--- a/src/libtracker-sparql-backend/tracker-backend.vala
+++ b/src/libtracker-sparql-backend/tracker-backend.vala
@@ -140,7 +140,6 @@ class Tracker.Sparql.Backend : Connection {
        private Connection create_readonly_direct () throws GLib.Error, Sparql.Error, IOError, DBusError {
                var conn = new Tracker.Direct.Connection (Tracker.Sparql.ConnectionFlags.READONLY,
                                                          domain_ontology.get_cache (),
-                                                         domain_ontology.get_journal (),
                                                          domain_ontology.get_ontology ());
                conn.init ();
                return conn;
@@ -328,14 +327,14 @@ public static Tracker.Sparql.Connection tracker_sparql_connection_bus_new (strin
        return new Tracker.Bus.Connection (service, conn, true);
 }
 
-public static Tracker.Sparql.Connection tracker_sparql_connection_local_new (Tracker.Sparql.ConnectionFlags 
flags, File store, File? journal, File? ontology, Cancellable? cancellable = null) throws GLib.Error, 
Tracker.Sparql.Error, IOError {
-       var conn = new Tracker.Direct.Connection (flags, store, journal, ontology);
+public static Tracker.Sparql.Connection tracker_sparql_connection_local_new (Tracker.Sparql.ConnectionFlags 
flags, File store, File? ontology, Cancellable? cancellable = null) throws GLib.Error, Tracker.Sparql.Error, 
IOError {
+       var conn = new Tracker.Direct.Connection (flags, store, ontology);
        conn.init (cancellable);
        return conn;
 }
 
-public static async Tracker.Sparql.Connection tracker_sparql_connection_local_new_async 
(Tracker.Sparql.ConnectionFlags flags, File store, File? journal, File? ontology, Cancellable? cancellable = 
null) throws GLib.Error, Tracker.Sparql.Error, IOError {
-       var conn = new Tracker.Direct.Connection (flags, store, journal, ontology);
+public static async Tracker.Sparql.Connection tracker_sparql_connection_local_new_async 
(Tracker.Sparql.ConnectionFlags flags, File store, File? ontology, Cancellable? cancellable = null) throws 
GLib.Error, Tracker.Sparql.Error, IOError {
+       var conn = new Tracker.Direct.Connection (flags, store, ontology);
        conn.init_async.begin (Priority.DEFAULT, cancellable);
        yield;
        return conn;
diff --git a/src/libtracker-sparql/tracker-connection.vala b/src/libtracker-sparql/tracker-connection.vala
index da6480155..95c9d546c 100644
--- a/src/libtracker-sparql/tracker-connection.vala
+++ b/src/libtracker-sparql/tracker-connection.vala
@@ -147,9 +147,7 @@ public abstract class Tracker.Sparql.Connection : Object {
         * All backends will call the D-Bus tracker-store API Wait() to make sure
         * the store and databases are in the right state before any user based
         * requests can proceed. There may be a small delay during this call if the
-        * databases weren't shutdown cleanly and need to be checked on start up. If
-        * the journal needs to be replayed in such an event, the delay may be
-        * substantial while data is restored as best as possible.
+        * databases weren't shutdown cleanly and need to be checked on start up.
         *
         * Returns: a new #TrackerSparqlConnection. Call g_object_unref() on the
         * object when no longer used.
@@ -173,22 +171,18 @@ public abstract class Tracker.Sparql.Connection : Object {
         * tracker_sparql_connection_local_new:
         * @flags: Flags to define connection behavior
         * @store: Location for the database
-        * @journal: Location for the operation journal, or %NULL
         * @ontology: Location of the ontology used for this connection, or %NULL
         * @cancellable: A #GCancellable
         * @error: The error which occurred or %NULL
         *
         * Returns: a new local #TrackerSparqlConnection using the specified
-        * @cache/@journal locations, and the ontology specified in the @ontology
+        * @cache location, and the ontology specified in the @ontology
         * directory. Call g_object_unref() on the object when no longer used.
         *
         * This database connection is considered entirely private to the calling
-        * process, if multiple processes use the same journal/cache locations,
+        * process, if multiple processes use the same cache location,
         * the results are unpredictable.
         *
-        * The @journal is used to rebuild the database in case of data corruption,
-        * if %NULL is provided, the same location than @store will be assumed.
-        *
         * The caller is entirely free to define an ontology or reuse Nepomuk for
         * its purposes. For the former see the "Defining ontologies" section in
         * this library docs. For the latter pass a %NULL @ontology.
@@ -197,18 +191,17 @@ public abstract class Tracker.Sparql.Connection : Object {
         * must be provided, all children .ontology and .description files will
         * be read.
         *
-        * The @store and @journal arguments expect directories, and those are
+        * The @store argument expects a directory, and it is
         * assumed to be entirely private to Tracker.
         *
         * Since: 2.0
         */
-       public extern static new Connection local_new (Tracker.Sparql.ConnectionFlags flags, File store, 
File? journal, File? ontology, Cancellable? cancellable = null) throws Sparql.Error, IOError;
+       public extern static new Connection local_new (Tracker.Sparql.ConnectionFlags flags, File store, 
File? ontology, Cancellable? cancellable = null) throws Sparql.Error, IOError;
 
        /**
         * tracker_sparql_connection_local_new_async:
         * @flags: Flags to define connection behavior
         * @store: Location for the database
-        * @journal: Location for the operation journal, or %NULL
         * @ontology: Location of the ontology used for this connection, or %NULL
         * @cancellable: A #GCancellable
         * @_callback_: user-defined #GAsyncReadyCallback to be called when
@@ -216,7 +209,7 @@ public abstract class Tracker.Sparql.Connection : Object {
         * @_user_data_: user-defined data to be passed to @_callback_
         *
         * Returns: a new local #TrackerSparqlConnection using the specified
-        * @cache/@journal locations, and the ontology specified in the @ontology
+        * @cache location, and the ontology specified in the @ontology
         * directory. Call g_object_unref() on the object when no longer used.
         *
         * See tracker_sparql_connection_local_new() for more details.
@@ -237,7 +230,7 @@ public abstract class Tracker.Sparql.Connection : Object {
         *
         * Since: 2.0
         */
-       public extern async static new Connection local_new_async (Tracker.Sparql.ConnectionFlags flags, File 
store, File? journal, File? ontology, Cancellable? cancellable = null) throws Sparql.Error, IOError;
+       public extern async static new Connection local_new_async (Tracker.Sparql.ConnectionFlags flags, File 
store, File? ontology, Cancellable? cancellable = null) throws Sparql.Error, IOError;
 
        public extern static new Connection bus_new (string service_name, DBusConnection? dbus_connection = 
null) throws Sparql.Error, IOError, DBusError, GLib.Error;
 
diff --git a/src/tracker-store/tracker-main.vala b/src/tracker-store/tracker-main.vala
index eac6788c0..96860f8ef 100644
--- a/src/tracker-store/tracker-main.vala
+++ b/src/tracker-store/tracker-main.vala
@@ -304,7 +304,6 @@ License which can be viewed at:
                try {
                        connection = new Tracker.Direct.Connection (Sparql.ConnectionFlags.NONE,
                                                                    cache_location,
-                                                                   data_location,
                                                                    ontology_location);
                        connection.init (null);
                } catch (GLib.Error e) {
diff --git a/tests/libtracker-fts/tracker-fts-test.c b/tests/libtracker-fts/tracker-fts-test.c
index b389c281b..0eb246b13 100644
--- a/tests/libtracker-fts/tracker-fts-test.c
+++ b/tests/libtracker-fts/tracker-fts-test.c
@@ -75,7 +75,7 @@ test_sparql_query (gconstpointer test_data)
        data_location = g_file_new_for_path (datadir);
 
        conn = tracker_sparql_connection_local_new (TRACKER_SPARQL_CONNECTION_FLAGS_NONE,
-                                                   data_location, data_location, ontology,
+                                                   data_location, ontology,
                                                    NULL, &error);
        g_assert_no_error (error);
 


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