Lucy::Index::Snapshot – Point-in-time index file list.
A Snapshot is list of index files and folders. Because index files, once written, are never modified, a Snapshot defines a point-in-time view of the data in an index.
IndexReader objects interpret the data associated with a single Snapshot.
lucy_Snapshot* // incremented lucy_Snapshot_new(void);
Constructor. Takes no arguments.
lucy_Snapshot* lucy_Snapshot_init( lucy_Snapshot *self );
Initialize a Snapshot.
cfish_Vector* // incremented lucy_Snapshot_List( lucy_Snapshot *self );
Return an array of all entries.
uint32_t lucy_Snapshot_Num_Entries( lucy_Snapshot *self );
Return the number of entries (including directories).
void lucy_Snapshot_Add_Entry( lucy_Snapshot *self, cfish_String *entry );
Add a filepath to the snapshot.
bool lucy_Snapshot_Delete_Entry( lucy_Snapshot *self, cfish_String *entry );
Delete a filepath from the snapshot.
Returns: true if the entry existed and was successfully deleted, false otherwise.
lucy_Snapshot* lucy_Snapshot_Read_File( lucy_Snapshot *self, lucy_Folder *folder, cfish_String *path );
Decode a snapshot file and initialize the object to reflect its contents.
The location of the snapshot file. If not supplied, the most recent snapshot file in the base directory will be chosen.
Returns: the Snapshot object itself
Write a snapshot file. The caller must lock the index while this operation takes place, and the operation will fail if the snapshot file already exists.
The path of the file to write. If NULL, a file name will be chosen which supersedes the latest snapshot file in the index folder.
void lucy_Snapshot_Set_Path( lucy_Snapshot *self, cfish_String *path );
Set the path to the file that the Snapshot object serves as a proxy for.
cfish_String* lucy_Snapshot_Get_Path( lucy_Snapshot *self );
Lucy::Index::Snapshot is a Clownfish::Obj.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.