[PATCH 2/3] Produce status messages during compacting
authorBen Gamari <bgamari.foss@gmail.com>
Wed, 17 Oct 2012 15:28:56 +0000 (11:28 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:49 +0000 (09:49 -0800)
20/397d15937f08d5ca438b0b575a4ab2cb4a63fc [new file with mode: 0644]

diff --git a/20/397d15937f08d5ca438b0b575a4ab2cb4a63fc b/20/397d15937f08d5ca438b0b575a4ab2cb4a63fc
new file mode 100644 (file)
index 0000000..e428a94
--- /dev/null
@@ -0,0 +1,98 @@
+Return-Path: <bgamari.foss@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 26370431FC4\r
+       for <notmuch@notmuchmail.org>; Wed, 17 Oct 2012 08:29:40 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id bfShYsbAkPOn for <notmuch@notmuchmail.org>;\r
+       Wed, 17 Oct 2012 08:29:39 -0700 (PDT)\r
+Received: from mail-qa0-f46.google.com (mail-qa0-f46.google.com\r
+       [209.85.216.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 881F4431FB6\r
+       for <notmuch@notmuchmail.org>; Wed, 17 Oct 2012 08:29:39 -0700 (PDT)\r
+Received: by mail-qa0-f46.google.com with SMTP id c26so637242qad.5\r
+       for <notmuch@notmuchmail.org>; Wed, 17 Oct 2012 08:29:39 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=D1KJeMANvVeI1envwO2kMhZeS29daCLoE2IYrWHYoSg=;\r
+       b=ARr7rQC6h7dpsgfD2NI6ZHD+V3WD1H4fvg2wyOo3esJmd80Mimbp7vCnqLFb9nLzxY\r
+       jym1aLkk4gd1oL3LjPAx48YtKJQ63FB/8l9fztJCJs7BU6/hTs9SjMOtBmtNs1yq3tg0\r
+       S0o6Bvaqdd/wx79pE+CFFfn6XBLAWNGY6/r4d55IdzKOax/p6IbFMXzcPLr6V4Aas64i\r
+       fzafwBAiS9ZYwvOBuOnCRtbLJihcqfjnPvXynJ5Jg8ThZhDrnZw8kkxddkDPl24TlOQR\r
+       PwyOQj44LiJ8YQZvwXYQ3TANaAAPq0VDA9oxA3GqQt/iKHZNQ5NJyfsTLlH4xuNbqxMw\r
+       XaKA==\r
+Received: by 10.49.85.194 with SMTP id j2mr43115507qez.54.1350487778961;\r
+       Wed, 17 Oct 2012 08:29:38 -0700 (PDT)\r
+Received: from ben-laptop.hasb.physics.cns (physicsnat56.physics.umass.edu.\r
+       [128.119.50.38])\r
+       by mx.google.com with ESMTPS id eq10sm13366039qab.0.2012.10.17.08.29.38\r
+       (version=SSLv3 cipher=OTHER); Wed, 17 Oct 2012 08:29:38 -0700 (PDT)\r
+From: Ben Gamari <bgamari.foss@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/3] Produce status messages during compacting\r
+Date: Wed, 17 Oct 2012 11:28:56 -0400\r
+Message-Id: <1350487737-32058-3-git-send-email-bgamari.foss@gmail.com>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1350487737-32058-1-git-send-email-bgamari.foss@gmail.com>\r
+References: <1350487737-32058-1-git-send-email-bgamari.foss@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 17 Oct 2012 15:29:40 -0000\r
+\r
+---\r
+ lib/database.cc |   15 ++++++++++++++-\r
+ 1 file changed, 14 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/lib/database.cc b/lib/database.cc\r
+index 6e83a61..49aa36d 100644\r
+--- a/lib/database.cc\r
++++ b/lib/database.cc\r
+@@ -780,11 +780,24 @@ notmuch_database_close (notmuch_database_t *notmuch)\r
+     notmuch->value_range_processor = NULL;\r
+ }\r
\r
++class NotmuchCompactor : public Xapian::Compactor\r
++{\r
++public:\r
++    virtual void\r
++    set_status (const std::string &table, const std::string &status)\r
++    {\r
++      if (status.length() == 0)\r
++          fprintf (stderr, "compacting table %s:\n", table.c_str());\r
++      else\r
++          fprintf (stderr, "     %s\n", status.c_str());\r
++    }\r
++};\r
++\r
+ void\r
+ notmuch_database_close_compact (notmuch_database_t *notmuch)\r
+ {\r
+     void *local = talloc_new (NULL);\r
+-    Xapian::Compactor compactor;\r
++    NotmuchCompactor compactor;\r
+     char *notmuch_path, *xapian_path, *compact_xapian_path, *old_xapian_path;\r
\r
+ #if HAVE_XAPIAN_COMPACT\r
+-- \r
+1.7.10.4\r
+\r