From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 85E561FA3D for ; Mon, 13 Nov 2023 13:15:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1699881356; bh=0Utp5GFfo+xEvmHDndq9KaNd+aG87vqeuk243gOc++8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EleY0mqIblGUL6LXige88cx7UfuFp770n4v0KlWmbe/TFNki/VQwgMuXAG06W72K2 fHxiwZaucc7E+LFtF0Y5SSOXpxD5TkAp58fOjE6IThuowTUMqzGFMQc4qewXAUe50m EIP0jIOFJhxGkjFUh3LlBZbIE4OH6X+HuqWdItec= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 17/18] cindex: rename associate-max => window Date: Mon, 13 Nov 2023 13:15:50 +0000 Message-Id: <20231113131551.843230-18-e@80x24.org> In-Reply-To: <20231113131551.843230-1-e@80x24.org> References: <20231113131551.843230-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: "window" is probably a better term since it's an inexact thing to match on. --- lib/PublicInbox/CodeSearchIdx.pm | 10 +++++----- script/public-inbox-cindex | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm index 8e6b921d..54ddb68e 100644 --- a/lib/PublicInbox/CodeSearchIdx.pm +++ b/lib/PublicInbox/CodeSearchIdx.pm @@ -97,7 +97,7 @@ our ( our $SEEN_MAX = 100000; # window for commits/emails to determine a inbox <-> coderepo association -my $ASSOC_MAX = 50000; +my $ASSOC_WINDOW = 50000; our @PRUNE_BATCH = qw(git _ cat-file --batch-all-objects --batch-check); @@ -501,10 +501,10 @@ sub shard_commit { # via wq_io_do send($op_p, "shard_done $self->{shard}", 0); } -sub assoc_max_args ($) { +sub assoc_window_args ($) { my ($self) = @_; - my $max = $self->{-opt}->{'associate-max'} // $ASSOC_MAX; - $max <= 0 ? () : ('-m', $max); + my $n = $self->{-opt}->{'associate-window'} // $ASSOC_WINDOW; + $n <= 0 ? () : ('-m', $n); } sub start_xhc () { @@ -537,7 +537,7 @@ sub dump_roots_start { run_await(\@sort, $CMD_ENV, $sort_opt, \&cmd_done, $associate); run_await(\@UNIQ_FOLD, $fold_env, $fold_opt, \&cmd_done, $associate); my @arg = ((map { ('-A', $_) } @ASSOC_PFX), '-c', - assoc_max_args($self), $root2id, $QRY_STR); + assoc_window_args($self), $root2id, $QRY_STR); for my $d ($self->shard_dirs) { pipe(my $err_r, my $err_w); $XHC->mkreq([$sort_w, $err_w], qw(dump_roots -d), $d, @arg); diff --git a/script/public-inbox-cindex b/script/public-inbox-cindex index b5fe9cf8..b8133806 100755 --- a/script/public-inbox-cindex +++ b/script/public-inbox-cindex @@ -26,7 +26,7 @@ See public-inbox-cindex(1) man page for full documentation. EOF my $opt = { fsync => 1, scan => 1 }; # --no-scan is hidden GetOptions($opt, qw(quiet|q verbose|v+ reindex jobs|j=i fsync|sync! dangerous - indexlevel|index-level|L=s associate associate-max=i + indexlevel|index-level|L=s associate associate-window=i associate-date-range=s associate-prefixes=s@ batch_size|batch-size=s max_size|max-size=s include|I=s@ only=s@ all show-roots