Lucy::...aReader(3pm)
π Lucy::...aReader π
okay bestie, gather round, because we're reading the docs for Lucy::...aReader from the User Contributed Perl Documentation, and it's giving β¨abstract base classβ¨ realness. it's 3pm energy, it's index internals, it's lowkey iconic. let's go π«Ά
β¨ NAME β¨
Lucy::Index::DataReader β the abstract base class for reading index data. periodt. π
πΈ SYNOPSIS πΈ
# Abstract base class.
that's it. that's the synopsis. it's abstract, she doesn't do anything on her own, she's a concept. main character energy but make it inheritance. π
π¦ DESCRIPTION π¦
so DataReader is the companion class to DataWriter. they're a matched set, like, destined. every single index component is gonna implement one of each β one writer, one reader, that's the vibe check. no cap. π
π CONSTRUCTORS π
π new
my $reader = MyDataReader->new(
schema => $seg_reader->get_schema, # default undef
folder => $seg_reader->get_folder, # default undef
snapshot => $seg_reader->get_snapshot, # default undef
segments => $seg_reader->get_segments, # default undef
seg_tick => $seg_reader->get_seg_tick, # default -1
);
this is the abstract constructor, bestie. you don't call her directly, you build your own subclass and let her shine through. π
schemaβ aSchema. a whole Schema. πfolderβ aFolder. yes, a Folder. we love her.snapshotβ aSnapshot. snapshot said β¨.segmentsβ an array ofSegments. plural. many segments. a whole squad. π«Άseg_tickβ the array index of theSegmentobject within the"segments"array that this particular DataReader is assigned to, if any. and a value of-1means noSegmentshould be assigned at all, like, she's unassigned, she's free, she's solo. π
π ABSTRACT METHODS π
β aggregator
my $result = $data_reader->aggregator(
readers => $readers, # required
offsets => $offsets, # required
);
create a reader that aggregates the output of several lower level readers β like a group chat for readers, they all report in and you get one combined result. return undef if such a reader is not valid. no reader, no result, moving on. π
readersβ an array ofDataReaders. the whole friend group.offsetsβ doc id start offsets for each reader. everybody gets a number, everybody knows their place. π₯
π METHODS π
πΈ get_schema
my $schema = $data_reader->get_schema();
accessor for the "schema" member var. just hands you the schema. that's the whole job. she ate. π
πΈ get_folder
my $folder = $data_reader->get_folder();
accessor for the "folder" member var. folder incoming. π
πΈ get_snapshot
my $snapshot = $data_reader->get_snapshot();
accessor for the "snapshot" member var. πΈ
πΈ get_segments
my $arrayref = $data_reader->get_segments();
accessor for the "segments" member var. note: you get an arrayref back, not a list, ok bestie, don't come for me. π«Ά
πΈ get_segment
my $segment = $data_reader->get_segment();
accessor for the "segment" member var. singular. one (1) segment. β
πΈ get_seg_tick
my $int = $data_reader->get_seg_tick();
accessor for the "seg_tick" member var. and yes, she's an int. π
π§ INHERITANCE π§
Lucy::Index::DataReader isa Clownfish::Obj. so she's got a whole family tree, she's not doing this alone. π¦
okay so that's the whole page bestie, every option, every accessor, every default, nothing skipped, nothing invented. iykyk π
and finally, the cute little sign-off at the bottom of the original: this was perl v5.42.0, dated 2025-07-25, filed under Lucy::...aReader(3pm). slay, stay abstract, don't instantiate me directly. πβ¨ππ
π¦ where this page comes from
- fedora 43: perl-Lucy 0.6.2-26.fc43 Β· Apache-2.0 AND MIT AND Unicode-DFS-2015
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms