[PATCH 2/3] Produce status messages during compacting
authorBen Gamari <bgamari.foss@gmail.com>
Mon, 20 Aug 2012 15:31:43 +0000 (11:31 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:10 +0000 (09:49 -0800)
33/0ae9adcd8f2ebb705cdec428f24809ed9b74e1 [new file with mode: 0644]

diff --git a/33/0ae9adcd8f2ebb705cdec428f24809ed9b74e1 b/33/0ae9adcd8f2ebb705cdec428f24809ed9b74e1
new file mode 100644 (file)
index 0000000..f199570
--- /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 4C375431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 20 Aug 2012 08:31:55 -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 Vl2KMM2EP8Qm for <notmuch@notmuchmail.org>;\r
+       Mon, 20 Aug 2012 08:31:54 -0700 (PDT)\r
+Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com\r
+       [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 8A9AA431FBF\r
+       for <notmuch@notmuchmail.org>; Mon, 20 Aug 2012 08:31:54 -0700 (PDT)\r
+Received: by mail-vc0-f181.google.com with SMTP id fl17so5583555vcb.26\r
+       for <notmuch@notmuchmail.org>; Mon, 20 Aug 2012 08:31:54 -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=az9Qwv40Z2OqKEgdkXyvezeHVtvJ8Qnzwp2JAfrcJ9U=;\r
+       b=mHGdxyopN8xF7p0yJGpxNMVHKc6LCu4QPUVMVQu9aBMPqxYNJ2SlEEOkUXUI+NgZWK\r
+       HAHiNlZ5rCI8Mtm0KD5fGyvUHHPOMOPwY1nFzTu6ZZLGltstoD7QJpEgsjWH5FooEpvC\r
+       E0LdkB7F5r3qj8SWrLBP9DtIvByBTxhOU8aVTWYlZresvG+F9yU8PBPE2a4aDY1KxJXU\r
+       1M7LcjJObjaxru6oj3baGX0IPhIqn2MLBNP2kwvz/E5Nzj/bGGDnrYmyckSoXvbWCKaD\r
+       pmzlxD95FrseiDmSduusUTXcUKIBk4TSGE6dKpKsXBuX6kcZKNcUzdwn0Qmxz5SpY9TI\r
+       N3ZQ==\r
+Received: by 10.220.204.197 with SMTP id fn5mr10480519vcb.71.1345476714281;\r
+       Mon, 20 Aug 2012 08:31:54 -0700 (PDT)\r
+Received: from localhost.localdomain\r
+       (pool-108-8-230-85.spfdma.east.verizon.net. [108.8.230.85])\r
+       by mx.google.com with ESMTPS id g10sm5430786vdk.2.2012.08.20.08.31.53\r
+       (version=SSLv3 cipher=OTHER); Mon, 20 Aug 2012 08:31:53 -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: Mon, 20 Aug 2012 11:31:43 -0400\r
+Message-Id: <1345476704-17091-3-git-send-email-bgamari.foss@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.5\r
+In-Reply-To: <1345476704-17091-1-git-send-email-bgamari.foss@gmail.com>\r
+References: <1345476704-17091-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: Mon, 20 Aug 2012 15:31:55 -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.9.5\r
+\r