1Lucy::Index::Snapshot(3U)ser Contributed Perl DocumentatiLouncy::Index::Snapshot(3)
2
3
4
6 Lucy::Index::Snapshot - Point-in-time index file list.
7
9 my $snapshot = Lucy::Index::Snapshot->new;
10 $snapshot->read_file( folder => $folder ); # load most recent snapshot
11 my $files = $snapshot->list;
12 print "$_\n" for @$files;
13
15 A Snapshot is list of index files and folders. Because index files,
16 once written, are never modified, a Snapshot defines a point-in-time
17 view of the data in an index.
18
19 IndexReader objects interpret the data associated with a single
20 Snapshot.
21
23 new
24 my $snapshot = Lucy::Index::Snapshot->new;
25
26 Constructor. Takes no arguments.
27
29 list
30 my $arrayref = $snapshot->list();
31
32 Return an array of all entries.
33
34 num_entries
35 my $int = $snapshot->num_entries();
36
37 Return the number of entries (including directories).
38
39 add_entry
40 $snapshot->add_entry($entry);
41
42 Add a filepath to the snapshot.
43
44 delete_entry
45 my $bool = $snapshot->delete_entry($entry);
46
47 Delete a filepath from the snapshot.
48
49 Returns: true if the entry existed and was successfully deleted, false
50 otherwise.
51
52 read_file
53 my $result = $snapshot->read_file(
54 folder => $folder, # required
55 path => $path, # default: undef
56 );
57
58 Decode a snapshot file and initialize the object to reflect its
59 contents.
60
61 • folder - A Folder.
62
63 • path - The location of the snapshot file. If not supplied, the
64 most recent snapshot file in the base directory will be chosen.
65
66 Returns: the Snapshot object itself
67
68 write_file
69 $snapshot->write_file(
70 folder => $folder, # required
71 path => $path, # default: undef
72 );
73
74 Write a snapshot file. The caller must lock the index while this
75 operation takes place, and the operation will fail if the snapshot file
76 already exists.
77
78 • folder - A Folder.
79
80 • path - The path of the file to write. If undef, a file name will
81 be chosen which supersedes the latest snapshot file in the index
82 folder.
83
84 set_path
85 $snapshot->set_path($path);
86
87 Set the path to the file that the Snapshot object serves as a proxy
88 for.
89
90 get_path
91 my $string = $snapshot->get_path();
92
93 Get the path to the snapshot file. Initially undef; updated by
94 read_file(), write_file(), and set_path().
95
97 Lucy::Index::Snapshot isa Clownfish::Obj.
98
99
100
101perl v5.34.0 2021-07-22 Lucy::Index::Snapshot(3)