Lucy::...aReader(3pm)

πŸ“¦
version 0.6.2 Β· 2 versions
, in fedora 43

πŸ’– 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 β€” a Schema. a whole Schema. πŸ’œ
  • folder β€” a Folder. yes, a Folder. we love her.
  • snapshot β€” a Snapshot. snapshot said ✨.
  • segments β€” an array of Segments. plural. many segments. a whole squad. 🫢
  • seg_tick β€” the array index of the Segment object within the "segments" array that this particular DataReader is assigned to, if any. and a value of -1 means no Segment should 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 of DataReaders. 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