]> Sergey Matveev's repositories - public-inbox.git/commitdiff
xapcmd: update comments referencing "partitions"
authorEric Wong <e@80x24.org>
Fri, 14 Jun 2019 17:38:01 +0000 (17:38 +0000)
committerEric Wong <e@80x24.org>
Fri, 14 Jun 2019 21:56:40 +0000 (21:56 +0000)
Don't confuse future readers of our code.

lib/PublicInbox/Xapcmd.pm

index 322d827a697f34a9be4402241fe4944ed97fa1bd..5e4ac87e87d5d1eabd8ea49b1001ade9623eb8e7 100644 (file)
@@ -40,7 +40,7 @@ sub commit_changes ($$$) {
                        $over = undef;
                }
 
-               if (!defined($new)) { # culled partition
+               if (!defined($new)) { # culled shard
                        push @old_part, $old;
                        next;
                }
@@ -359,7 +359,7 @@ sub cpdb ($$) {
                $new_parts = $opt->{reshard};
                defined $new_parts or die 'BUG: got array src w/o --reshard';
 
-               # repartitioning, M:N copy means have full read access
+               # resharding, M:N copy means have full read access
                foreach (@$old) {
                        if ($src) {
                                my $sub = Search::Xapian::Database->new($_);
@@ -397,7 +397,7 @@ sub cpdb ($$) {
                        my $lc = $src->get_metadata('last_commit');
                        $dst->set_metadata('last_commit', $lc) if $lc;
 
-                       # only the first xapian partition (0) gets 'indexlevel'
+                       # only the first xapian shard (0) gets 'indexlevel'
                        if ($new =~ m!(?:xapian[0-9]+|xap[0-9]+/0)\b!) {
                                my $l = $src->get_metadata('indexlevel');
                                if ($l eq 'medium') {
@@ -407,7 +407,7 @@ sub cpdb ($$) {
                        if ($pr_data) {
                                my $tot = $src->get_doccount;
 
-                               # we can only estimate when repartitioning,
+                               # we can only estimate when resharding,
                                # because removed spam causes slight imbalance
                                my $est = '';
                                if (defined $cur_part && $new_parts > 1) {
@@ -459,7 +459,7 @@ sub new {
        # http://www.tldp.org/LDP/abs/html/exitcodes.html
        $SIG{INT} = sub { exit(130) };
        $SIG{HUP} = $SIG{PIPE} = $SIG{TERM} = sub { exit(1) };
-       my $self = bless {}, $_[0]; # old partition => new (tmp) partition
+       my $self = bless {}, $_[0]; # old shard => new (WIP) shard
        $owner{"$self"} = $$;
        $self;
 }
@@ -481,7 +481,7 @@ sub DESTROY {
        my $owner_pid = delete $owner{"$self"} or return;
        return if $owner_pid != $$;
        foreach my $new (values %$self) {
-               defined $new or next; # may be undef if repartitioning
+               defined $new or next; # may be undef if resharding
                remove_tree($new) unless -d "$new/old";
        }
        done($self);