From 3f77c57667a52e25b1903d088769c252424410af Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Wed, 17 Oct 2012 21:59:16 +0300 Subject: [PATCH] Re: [PATCH 2/3] Produce status messages during compacting --- 9d/ba289677ba06bd8d0700bf3d50eed3f58d65cf | 120 ++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 9d/ba289677ba06bd8d0700bf3d50eed3f58d65cf diff --git a/9d/ba289677ba06bd8d0700bf3d50eed3f58d65cf b/9d/ba289677ba06bd8d0700bf3d50eed3f58d65cf new file mode 100644 index 000000000..0eb84b166 --- /dev/null +++ b/9d/ba289677ba06bd8d0700bf3d50eed3f58d65cf @@ -0,0 +1,120 @@ +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 F1901431FBD + for ; Wed, 17 Oct 2012 11:59:21 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[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 tF3dlUF1wrY2 for ; + Wed, 17 Oct 2012 11:59:21 -0700 (PDT) +Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com + [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 5277C431FB6 + for ; Wed, 17 Oct 2012 11:59:21 -0700 (PDT) +Received: by mail-lb0-f181.google.com with SMTP id gg6so5834698lbb.26 + for ; Wed, 17 Oct 2012 11:59:19 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=from:to:subject:in-reply-to:references:user-agent:date:message-id + :mime-version:content-type:x-gm-message-state; + bh=XztTrX+hvQxfXSIpdwOGFwWGruwRzFsl6JRBTe0KJ6Y=; + b=MLz5+TN99l8htqavTr5pZqL/Al56pR5+c2qcTw6PCgttMu7e6xPZIK7hKYJLmg/2ep + PCfD8GGhyukQcxeU2pzero7s92is4iFK1rpRVavmynuX0UqF+o90KKYPjtaWb8gQVjx0 + OaENz3Q1jAGi870loAAAidUmrXboJw8ZNyrtjTxP+BpCgzv++8WZVzW8Fh8fHafmnkKD + GfJz8g1ZmrzHa8rdGJy7EwuY/4cvZ2iXUJjCX9lnfzuWX+74Sq8QHZj5uo76tn8CDJPN + +tcoYCgwHDKPNXkiQs1hMHfVVvVyM+W9xCus8TT97P6i9+Nle4rRI62IhQ4vgXp7CzMz + 9eIQ== +Received: by 10.152.124.180 with SMTP id mj20mr16578515lab.43.1350500359583; + Wed, 17 Oct 2012 11:59:19 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi. + [80.223.81.27]) + by mx.google.com with ESMTPS id fe5sm4414122lbb.6.2012.10.17.11.59.17 + (version=SSLv3 cipher=OTHER); Wed, 17 Oct 2012 11:59:18 -0700 (PDT) +From: Jani Nikula +To: Ben Gamari , notmuch@notmuchmail.org +Subject: Re: [PATCH 2/3] Produce status messages during compacting +In-Reply-To: <1350487737-32058-3-git-send-email-bgamari.foss@gmail.com> +References: <1350487737-32058-1-git-send-email-bgamari.foss@gmail.com> + <1350487737-32058-3-git-send-email-bgamari.foss@gmail.com> +User-Agent: Notmuch/0.14+46~g272a1f1 (http://notmuchmail.org) Emacs/23.3.1 + (i686-pc-linux-gnu) +Date: Wed, 17 Oct 2012 21:59:16 +0300 +Message-ID: <871ugw3oxn.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Gm-Message-State: + ALoCoQlS1ZlpqmLdoxxNIZw7z+p35fziKjQDgZd8d56qutNPEayb5tJ5XL58+rW22YM94l5uNSmZ +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: Wed, 17 Oct 2012 18:59:22 -0000 + + +Again, a commit message saying *why* having a flood of status messages +is a good idea would be appreciated. I'm not sure it is a good idea. + +On Wed, 17 Oct 2012, Ben Gamari wrote: +> --- +> 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()); + +It's not an error, so stderr seems wrong. + +BR, +Jani. + +> + 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.10.4 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2