From 4dc218b6eed55739dae28a23fda06b2c9e4828b6 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 21 Aug 2012 11:31:43 +2000 Subject: [PATCH] [PATCH 2/3] Produce status messages during compacting --- 33/0ae9adcd8f2ebb705cdec428f24809ed9b74e1 | 98 +++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 33/0ae9adcd8f2ebb705cdec428f24809ed9b74e1 diff --git a/33/0ae9adcd8f2ebb705cdec428f24809ed9b74e1 b/33/0ae9adcd8f2ebb705cdec428f24809ed9b74e1 new file mode 100644 index 000000000..f19957097 --- /dev/null +++ b/33/0ae9adcd8f2ebb705cdec428f24809ed9b74e1 @@ -0,0 +1,98 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 4C375431FAE + for ; Mon, 20 Aug 2012 08:31:55 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id Vl2KMM2EP8Qm for ; + Mon, 20 Aug 2012 08:31:54 -0700 (PDT) +Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com + [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8A9AA431FBF + for ; Mon, 20 Aug 2012 08:31:54 -0700 (PDT) +Received: by mail-vc0-f181.google.com with SMTP id fl17so5583555vcb.26 + for ; Mon, 20 Aug 2012 08:31:54 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=az9Qwv40Z2OqKEgdkXyvezeHVtvJ8Qnzwp2JAfrcJ9U=; + b=mHGdxyopN8xF7p0yJGpxNMVHKc6LCu4QPUVMVQu9aBMPqxYNJ2SlEEOkUXUI+NgZWK + HAHiNlZ5rCI8Mtm0KD5fGyvUHHPOMOPwY1nFzTu6ZZLGltstoD7QJpEgsjWH5FooEpvC + E0LdkB7F5r3qj8SWrLBP9DtIvByBTxhOU8aVTWYlZresvG+F9yU8PBPE2a4aDY1KxJXU + 1M7LcjJObjaxru6oj3baGX0IPhIqn2MLBNP2kwvz/E5Nzj/bGGDnrYmyckSoXvbWCKaD + pmzlxD95FrseiDmSduusUTXcUKIBk4TSGE6dKpKsXBuX6kcZKNcUzdwn0Qmxz5SpY9TI + N3ZQ== +Received: by 10.220.204.197 with SMTP id fn5mr10480519vcb.71.1345476714281; + Mon, 20 Aug 2012 08:31:54 -0700 (PDT) +Received: from localhost.localdomain + (pool-108-8-230-85.spfdma.east.verizon.net. [108.8.230.85]) + by mx.google.com with ESMTPS id g10sm5430786vdk.2.2012.08.20.08.31.53 + (version=SSLv3 cipher=OTHER); Mon, 20 Aug 2012 08:31:53 -0700 (PDT) +From: Ben Gamari +To: notmuch@notmuchmail.org +Subject: [PATCH 2/3] Produce status messages during compacting +Date: Mon, 20 Aug 2012 11:31:43 -0400 +Message-Id: <1345476704-17091-3-git-send-email-bgamari.foss@gmail.com> +X-Mailer: git-send-email 1.7.9.5 +In-Reply-To: <1345476704-17091-1-git-send-email-bgamari.foss@gmail.com> +References: <1345476704-17091-1-git-send-email-bgamari.foss@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 20 Aug 2012 15:31:55 -0000 + +--- + lib/database.cc | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/lib/database.cc b/lib/database.cc +index 6e83a61..49aa36d 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -780,11 +780,24 @@ notmuch_database_close (notmuch_database_t *notmuch) + notmuch->value_range_processor = NULL; + } + ++class NotmuchCompactor : public Xapian::Compactor ++{ ++public: ++ virtual void ++ set_status (const std::string &table, const std::string &status) ++ { ++ if (status.length() == 0) ++ fprintf (stderr, "compacting table %s:\n", table.c_str()); ++ else ++ fprintf (stderr, " %s\n", status.c_str()); ++ } ++}; ++ + void + notmuch_database_close_compact (notmuch_database_t *notmuch) + { + void *local = talloc_new (NULL); +- Xapian::Compactor compactor; ++ NotmuchCompactor compactor; + char *notmuch_path, *xapian_path, *compact_xapian_path, *old_xapian_path; + + #if HAVE_XAPIAN_COMPACT +-- +1.7.9.5 + -- 2.26.2