11#ifndef __BE_ARCHIVERECSTORE_H__
12#define __BE_ARCHIVERECSTORE_H__
65 const std::string &pathname,
66 const std::string &description);
83 const std::string &pathname,
105 const std::string &key,
106 const void *
const data,
111 const std::string &key)
115 const std::string &key)
const override;
118 const std::string &key)
const override;
121 const std::string &key)
const override;
133 const std::string &key)
137 const std::string &pathname)
145 const std::string &description)
override;
175 const std::string &pathname);
192 const std::string &pathname);
223 std::unique_ptr<ArchiveRecordStore::Impl> pimpl;
This class implements the IO::RecordStore interface by storing data items in single file,...
unsigned int getCount() const override
Obtain the number of items in the RecordStore.
void changeDescription(const std::string &description) override
Change the description of the RecordStore.
void move(const std::string &pathname) override
Move the RecordStore.
static const long OFFSET_RECORD_REMOVED
Offset placeholder indicating a removed record.
static const std::string ARCHIVE_FILE_NAME
Name of the archive file on disk.
void insert(const std::string &key, const void *const data, const uint64_t size) override
Insert a record into the store.
~ArchiveRecordStore()
Destructor.
static void vacuum(const std::string &pathname)
Remove deleted entries from the manifest and archive files to save space on disk.
ArchiveRecordStore(const std::string &pathname, IO::Mode mode=IO::Mode::ReadOnly)
Open an existing ArchiveRecordStore.
uint64_t getSpaceUsed() const override
Obtain real storage utilization.
void sync() const override
Synchronize the entire record store to persistent storage.
void setCursorAtKey(const std::string &key) override
Set the sequence cursor to an arbitrary position within the RecordStore, starting at key.
ArchiveRecordStore(const std::string &pathname, const std::string &description)
Create a new ArchiveRecordStore, read/write mode.
std::string sequenceKey(int cursor=BE_RECSTORE_SEQ_NEXT) override
Sequence through a RecordStore, returning the key.
ArchiveRecordStore(const ArchiveRecordStore &)=delete
std::string getPathname() const override
Return the path name of the RecordStore.
static const std::string MANIFEST_FILE_NAME
Name of the manifest file on disk.
std::string getDescription() const override
Obtain a textual description of the RecordStore.
std::string getManifestName() const
Obtain the name of the file storing the manifest data data for this store.
void flush(const std::string &key) const override
Commit the record's data to storage.
ArchiveRecordStore & operator=(const ArchiveRecordStore &)=delete
std::string getArchiveName() const
Obtain the name of the file storing the data for this store.
void remove(const std::string &key) override
Remove a record from the store.
RecordStore::Record sequence(int cursor=BE_RECSTORE_SEQ_NEXT) override
Sequence through a RecordStore, returning the key/data pairs.
bool needsVacuum()
See if the ArchiveRecordStore would benefit from calling vacuum() to remove deleted entries,...
Memory::uint8Array read(const std::string &key) const override
Read a complete record from a store.
uint64_t length(const std::string &key) const override
Return the length of a record.
static bool needsVacuum(const std::string &pathname)
See if the ArchiveRecordStore would benefit from calling vacuum() to remove deleted entries,...
A class to represent a data storage mechanism.
virtual void insert(const std::string &key, const Memory::uint8Array &data)
Insert a record into the store.
static const int BE_RECSTORE_SEQ_NEXT
Tell sequence to sequence from current position.
virtual void replace(const std::string &key, const Memory::uint8Array &data)
Replace a complete record in a RecordStore.
Mode
Accessibility of object.
@ ReadOnly
Constant indicating the state of an object that manages some underlying file is accessible for readin...
This software was developed at the National Institute of Standards and Technology (NIST) by employees...