* [PATCH 5/5] shard_add_eidx_info: pass $eidx_key instead of $ibx object
2020-12-07 7:40 5% [PATCH 0/5] extindex: random cleanups Eric Wong
@ 2020-12-07 7:40 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-12-07 7:40 UTC (permalink / raw)
To: meta
This improves consistency with sibling methods such as
->shard_remove_eidx_info and ->add_xref3. Passing the
$eidx_key scalar is preferable to the entire $ibx object
for IPC-friendliness.
---
lib/PublicInbox/ExtSearchIdx.pm | 2 +-
lib/PublicInbox/SearchIdxShard.pm | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/PublicInbox/ExtSearchIdx.pm b/lib/PublicInbox/ExtSearchIdx.pm
index c06b25a9..c82d1633 100644
--- a/lib/PublicInbox/ExtSearchIdx.pm
+++ b/lib/PublicInbox/ExtSearchIdx.pm
@@ -125,7 +125,7 @@ sub do_xpost ($$) {
if (my $new_smsg = $req->{new_smsg}) { # 'm' on cross-posted message
my $xnum = $req->{xnum};
$self->{oidx}->add_xref3($docid, $xnum, $oid, $eidx_key);
- $idx->shard_add_eidx_info($docid, $xibx, $eml);
+ $idx->shard_add_eidx_info($docid, $eidx_key, $eml);
check_batch_limit($req);
} else { # 'd'
my $rm_eidx_info;
diff --git a/lib/PublicInbox/SearchIdxShard.pm b/lib/PublicInbox/SearchIdxShard.pm
index 182bbde2..579ed196 100644
--- a/lib/PublicInbox/SearchIdxShard.pm
+++ b/lib/PublicInbox/SearchIdxShard.pm
@@ -144,8 +144,7 @@ sub index_raw {
}
sub shard_add_eidx_info {
- my ($self, $docid, $xibx, $eml) = @_;
- my $eidx_key = $xibx->eidx_key;
+ my ($self, $docid, $eidx_key, $eml) = @_;
if (my $w = $self->{w}) {
my $hdr = $eml->header_obj->as_string;
my $len = length($hdr);
^ permalink raw reply related [relevance 7%]
* [PATCH 0/5] extindex: random cleanups
@ 2020-12-07 7:40 5% Eric Wong
2020-12-07 7:40 7% ` [PATCH 5/5] shard_add_eidx_info: pass $eidx_key instead of $ibx object Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-12-07 7:40 UTC (permalink / raw)
To: meta
Still working on --reindex, but found a bunch of cleanups
and tweaks which are worth doing in any case.
Eric Wong (5):
over: gracefully show invalid ibx_id
overidx: wrap eidx_key => ibx_id mapping
extsearchidx: remove needless SHA-1 check
searchidx: remove $oid parameter from most calls
shard_add_eidx_info: pass $eidx_key instead of $ibx object
lib/PublicInbox/ExtSearchIdx.pm | 27 +++++-----------------
lib/PublicInbox/Over.pm | 1 +
lib/PublicInbox/OverIdx.pm | 10 +++++---
lib/PublicInbox/SearchIdx.pm | 38 +++++++++++++------------------
lib/PublicInbox/SearchIdxShard.pm | 38 ++++++++++++++-----------------
lib/PublicInbox/V2Writable.pm | 2 +-
6 files changed, 48 insertions(+), 68 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-12-07 7:40 5% [PATCH 0/5] extindex: random cleanups Eric Wong
2020-12-07 7:40 7% ` [PATCH 5/5] shard_add_eidx_info: pass $eidx_key instead of $ibx object Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).