From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 697131F9F9 for ; Sat, 15 Jun 2019 08:47:22 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 06/20] v2writable: count_partitions => count_shards Date: Sat, 15 Jun 2019 08:47:02 +0000 Message-Id: <20190615084716.3075-7-e@80x24.org> In-Reply-To: <20190615084716.3075-1-e@80x24.org> References: <20190615084716.3075-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Another step towards becoming consistent with Xapian terminology --- lib/PublicInbox/V2Writable.pm | 6 +++--- lib/PublicInbox/Xapcmd.pm | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index db905f9..03e6e95 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -52,7 +52,7 @@ sub nproc_parts ($) { $n < 1 ? 1 : $n; } -sub count_partitions ($) { +sub count_shards ($) { my ($self) = @_; my $nparts = 0; my $xpfx = $self->{xpfx}; @@ -103,7 +103,7 @@ sub new { rotate_bytes => int((1024 * 1024 * 1024) / $PACKING_FACTOR), last_commit => [], # git repo -> commit }; - $self->{partitions} = count_partitions($self) || nproc_parts($creat); + $self->{partitions} = count_shards($self) || nproc_parts($creat); bless $self, $class; } @@ -289,7 +289,7 @@ sub idx_init { $over->create; # xcpdb can change shard count while -watch is idle - my $nparts = count_partitions($self); + my $nparts = count_shards($self); if ($nparts && $nparts != $self->{partitions}) { $self->{partitions} = $nparts; } diff --git a/lib/PublicInbox/Xapcmd.pm b/lib/PublicInbox/Xapcmd.pm index e303da9..89bacc5 100644 --- a/lib/PublicInbox/Xapcmd.pm +++ b/lib/PublicInbox/Xapcmd.pm @@ -63,9 +63,9 @@ sub commit_changes ($$$) { if (!$opt->{-coarse_lock}) { $opt->{-skip_lock} = 1; - if ($im->can('count_partitions')) { + if ($im->can('count_shards')) { my $pr = $opt->{-progress}; - my $n = $im->count_partitions; + my $n = $im->count_shards; if (defined $new_parts && $n != $new_parts) { die "BUG: counted $n shards after resharding to $new_parts"; -- EW