[tracker-miners/wip/carlosg/batches-and-resources: 19/31] libtracker-miner: Move SPARQL buffer limit checks to TrackerMinerFS
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/batches-and-resources: 19/31] libtracker-miner: Move SPARQL buffer limit checks to TrackerMinerFS
- Date: Fri, 11 Dec 2020 10:55:03 +0000 (UTC)
commit 0ac6bb55cf4c6692d69fd4477618afdedac3d009
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Dec 2 12:05:25 2020 +0100
libtracker-miner: Move SPARQL buffer limit checks to TrackerMinerFS
Let the SPARQL be a bit more dumb, and only flush if told.
src/libtracker-miner/tracker-miner-fs.c | 20 +++++++++++++++++++-
src/libtracker-miner/tracker-sparql-buffer.c | 8 --------
2 files changed, 19 insertions(+), 9 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 2732a20a0..2e39047e6 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -1268,6 +1268,12 @@ sparql_buffer_task_finished_cb (GObject *object,
/* Check if we've finished inserting for given prefixes ... */
notify_roots_finished (fs, TRUE);
}
+ } else if (tracker_task_pool_limit_reached (TRACKER_TASK_POOL (object))) {
+ tracker_sparql_buffer_flush (TRACKER_SPARQL_BUFFER (object),
+ "SPARQL buffer limit reached");
+
+ /* Check if we've finished inserting for given prefixes ... */
+ notify_roots_finished (fs, TRUE);
} else {
item_queue_handlers_set_up (fs);
}
@@ -1300,6 +1306,12 @@ push_sparql_task (TrackerMinerFS *fs,
if (item_queue_is_blocked_by_file (fs, file)) {
tracker_sparql_buffer_flush (fs->priv->sparql_buffer, "Current file is blocking item
queue");
+ /* Check if we've finished inserting for given prefixes ... */
+ notify_roots_finished (fs, TRUE);
+ } else if (tracker_task_pool_limit_reached (TRACKER_TASK_POOL (fs->priv->sparql_buffer))) {
+ tracker_sparql_buffer_flush (fs->priv->sparql_buffer,
+ "SPARQL buffer limit reached");
+
/* Check if we've finished inserting for given prefixes ... */
notify_roots_finished (fs, TRUE);
}
@@ -1776,7 +1788,13 @@ miner_handle_next_item (TrackerMinerFS *fs)
}
}
- if (!tracker_task_pool_limit_reached (TRACKER_TASK_POOL (fs->priv->sparql_buffer))) {
+ if (tracker_task_pool_limit_reached (TRACKER_TASK_POOL (fs->priv->sparql_buffer))) {
+ tracker_sparql_buffer_flush (fs->priv->sparql_buffer,
+ "SPARQL buffer limit reached");
+
+ /* Check if we've finished inserting for given prefixes ... */
+ notify_roots_finished (fs, TRUE);
+ } else {
item_queue_handlers_set_up (fs);
}
diff --git a/src/libtracker-miner/tracker-sparql-buffer.c b/src/libtracker-miner/tracker-sparql-buffer.c
index f7d89fc87..4418f3a71 100644
--- a/src/libtracker-miner/tracker-sparql-buffer.c
+++ b/src/libtracker-miner/tracker-sparql-buffer.c
@@ -228,10 +228,6 @@ tracker_sparql_buffer_update_array_cb (GObject *object,
if (error) {
g_error_free (error);
}
-
- if (tracker_task_pool_limit_reached (TRACKER_TASK_POOL (buffer))) {
- tracker_sparql_buffer_flush (buffer, "SPARQL buffer limit reached (after flush)");
- }
}
gboolean
@@ -309,10 +305,6 @@ sparql_buffer_push_to_pool (TrackerSparqlBuffer *buffer,
/* We add a reference here because we unref when removed from
* the GPtrArray. */
g_ptr_array_add (priv->tasks, tracker_task_ref (task));
-
- if (tracker_task_pool_limit_reached (TRACKER_TASK_POOL (buffer))) {
- tracker_sparql_buffer_flush (buffer, "SPARQL buffer limit reached");
- }
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]