]> Sergey Matveev's repositories - public-inbox.git/commitdiff
treewide: s/sequential_shard/sequential-shard/g
authorEric Wong <e@80x24.org>
Tue, 27 Jul 2021 10:44:29 +0000 (10:44 +0000)
committerEric Wong <e@80x24.org>
Wed, 28 Jul 2021 05:16:19 +0000 (05:16 +0000)
The underscore variant was never documented and maintaining
the difference between the command-line and internal hash
is not worth it.

lib/PublicInbox/Admin.pm
lib/PublicInbox/LEI.pm
lib/PublicInbox/V2Writable.pm
script/public-inbox-convert
script/public-inbox-index
script/public-inbox-xcpdb

index b21fb2418699d5ac26e838928e279b83566b4b8d..eb38dd8fd384e73ab3de4425258e065a2e1e4873 100644 (file)
@@ -327,9 +327,9 @@ sub index_prepare ($$) {
        $opt->{batch_size} and
                $env = { XAPIAN_FLUSH_THRESHOLD => '4294967295' };
 
-       for my $k (qw(sequential_shard)) {
+       for my $k (qw(sequential-shard)) {
                my $git_key = "publicInbox.index".ucfirst($k);
-               $git_key =~ s/_([a-z])/\U$1/g;
+               $git_key =~ s/-([a-z])/\U$1/g;
                defined(my $s = $opt->{$k} // $cfg->{lc($git_key)}) or next;
                defined(my $v = $cfg->git_bool($s))
                                        or die "`$git_key=$s' not boolean\n";
index 191a0790e0c6f64c4327af4178ba2b514990a373..0e6e92660c9b8c5112b954e0d033f4776149b8d7 100644 (file)
@@ -134,7 +134,7 @@ sub ale {
 sub index_opt {
        # TODO: drop underscore variants everywhere, they're undocumented
        qw(fsync|sync! jobs|j=i indexlevel|L=s compact
-       max_size|max-size=s sequential_shard|sequential-shard
+       max_size|max-size=s sequential-shard
        batch_size|batch-size=s skip-docdata)
 }
 
@@ -371,7 +371,7 @@ my %OPTDESC = (
        'do not index messages larger than SIZE (default: infinity)' ],
 'batch_size|batch-size=s' => [ 'SIZE',
        'flush changes to OS after given number of bytes (default: 1m)' ],
-'sequential_shard|sequential-shard' =>
+'sequential-shard' =>
        'index Xapian shards sequentially for slow storage',
 'skip-docdata' =>
        'drop compatibility w/ public-inbox <1.6 to save ~1.5% space',
index 4c1accbbdf096da74995dfe7026baa1e4859603f..025487d2155c70fdafbc4b86a4e277739532901e 100644 (file)
@@ -1279,7 +1279,7 @@ sub index_todo ($$$) {
 
 sub xapian_only {
        my ($self, $opt, $sync, $art_beg) = @_;
-       my $seq = $opt->{sequential_shard};
+       my $seq = $opt->{'sequential-shard'};
        $art_beg //= 0;
        local $self->{parallel} = 0 if $seq;
        $self->idx_init($opt); # acquire lock
@@ -1329,7 +1329,7 @@ sub index_sync {
        }
 
        my $pr = $opt->{-progress};
-       my $seq = $opt->{sequential_shard};
+       my $seq = $opt->{'sequential-shard'};
        my $art_beg; # the NNTP article number we start xapian_only at
        my $idxlevel = $self->{ibx}->{indexlevel};
        local $self->{ibx}->{indexlevel} = 'basic' if $seq;
index 3c627b793638cd30bc23f42bcbef1ebfe3ad8cf0..fec6b624207c1779d64f352a4198ef2ca8316936 100755 (executable)
@@ -38,7 +38,7 @@ GetOptions($opt, qw(jobs|j=i index! help|h),
                qw(verbose|v+ rethread compact|c+ fsync|sync!
                indexlevel|index-level|L=s max_size|max-size=s
                batch_size|batch-size=s
-               sequential_shard|sequential-shard|seq-shard
+               sequential-shard|seq-shard
                )) or die $help;
 if ($opt->{help}) { print $help; exit 0 };
 my $old_dir = shift(@ARGV) // '';
index 33169bd01039b1fe6a45aea5860954583d24ca2f..0034d44cbd36b69cbe16d9c3dd344b6bcb245d84 100755 (executable)
@@ -40,7 +40,7 @@ GetOptions($opt, qw(verbose|v+ reindex rethread compact|c+ jobs|j=i prune
                fsync|sync! xapian_only|xapian-only
                indexlevel|index-level|L=s max_size|max-size=s
                batch_size|batch-size=s
-               sequential_shard|seq-shard|sequential-shard
+               sequential-shard|seq-shard
                no-update-extindex update-extindex|E=s@
                fast-noop|F skip-docdata all help|h))
        or die $help;
@@ -129,12 +129,12 @@ for my $ibx (@ibxs) {
                defined(my $v = $cfg->git_bool($s)) or die <<EOL;
 publicInbox.$ibx->{name}.indexSequentialShard not boolean
 EOL
-               $ibx_opt = { %$opt, sequential_shard => $v };
+               $ibx_opt = { %$opt, 'sequential-shard' => $v };
        }
        my $nidx = PublicInbox::Admin::index_inbox($ibx, undef, $ibx_opt);
        last if $ibx_opt->{quit};
        if (my $copt = $opt->{compact_opt}) {
-               local $copt->{jobs} = 0 if $ibx_opt->{sequential_shard};
+               local $copt->{jobs} = 0 if $ibx_opt->{'sequential-shard'};
                PublicInbox::Xapcmd::run($ibx, 'compact', $copt);
        }
        last if $ibx_opt->{quit};
index 3c99fde844467f25688e0ee9bb845390506d0c79..768dc2badb75f7e3f017dbda7aadac53f6a0f15e 100755 (executable)
@@ -30,7 +30,7 @@ my $opt = { quiet => -1, compact => 0, fsync => 1 };
 GetOptions($opt, qw(
        fsync|sync! compact|c reshard|R=i
        max_size|max-size=s batch_size|batch-size=s
-       sequential_shard|seq-shard|sequential-shard
+       sequential-shard|seq-shard
        jobs|j=i quiet|q verbose|v
        blocksize|b=s no-full|n fuller|F
        all help|h)) or die $help;
@@ -49,7 +49,7 @@ my $idx_env = PublicInbox::Admin::index_prepare($opt, $cfg);
 # know sizes, only doccounts
 $opt->{-idx_env} = $idx_env;
 
-if ($opt->{sequential_shard} && ($opt->{jobs} // 1) > 1) {
+if ($opt->{'sequential-shard'} && ($opt->{jobs} // 1) > 1) {
        warn "W: --jobs=$opt->{jobs} ignored with --sequential-shard\n";
        $opt->{jobs} = 0;
 }