]> Sergey Matveev's repositories - public-inbox.git/commitdiff
v2writable: count_partitions => count_shards
authorEric Wong <e@80x24.org>
Fri, 14 Jun 2019 07:56:58 +0000 (07:56 +0000)
committerEric Wong <e@80x24.org>
Fri, 14 Jun 2019 21:56:40 +0000 (21:56 +0000)
Another step towards becoming consistent with Xapian terminology

lib/PublicInbox/V2Writable.pm
lib/PublicInbox/Xapcmd.pm

index db905f924879e78e61e8bf1c4d06405cd09d19bd..03e6e9515c68033608001c5c5b233e6f23f40ec1 100644 (file)
@@ -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;
                }
index e303da9e8ccd339381614e8a85c5f813b93c129e..89bacc5007ea93f3de5c78da26de1e4a893347e7 100644 (file)
@@ -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";