7#ifndef FILESWITCHDIRECTORY_H
8#define FILESWITCHDIRECTORY_H
72 virtual void sync(
const String& name);
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
A Directory is a flat list of files. Files may be written once, when they are created....
Definition Directory.h:18
A Directory instance that switches files between two other Directory instances.
Definition FileSwitchDirectory.h:21
DirectoryPtr primaryDir
Definition FileSwitchDirectory.h:30
virtual void touchFile(const String &name)
Set the modified time of an existing file to now.
HashSet< String > primaryExtensions
Definition FileSwitchDirectory.h:29
virtual HashSet< String > listAll()
Returns an array of strings, one for each file in the directory.
DirectoryPtr getDirectory(const String &name)
virtual void close()
Closes the store.
virtual uint64_t fileModified(const String &name)
Returns the time the named file was last modified.
DirectoryPtr getSecondaryDir()
Return the secondary directory.
virtual void sync(const String &name)
Ensure that any writes to this file are moved to stable storage. Lucene uses this to properly commit ...
DirectoryPtr getPrimaryDir()
Return the primary directory.
virtual void deleteFile(const String &name)
Removes an existing file in the directory.
virtual int64_t fileLength(const String &name)
Returns the length of a file in the directory.
bool doClose
Definition FileSwitchDirectory.h:32
DirectoryPtr secondaryDir
Definition FileSwitchDirectory.h:31
virtual bool fileExists(const String &name)
Returns true if a file with the given name exists.
virtual ~FileSwitchDirectory()
virtual IndexInputPtr openInput(const String &name)
Returns a stream reading an existing file, with the specified read buffer size. The particular Direct...
virtual IndexOutputPtr createOutput(const String &name)
Creates a new, empty file in the directory with the given name. Returns a stream writing this file.
FileSwitchDirectory(HashSet< String > primaryExtensions, const DirectoryPtr &primaryDir, const DirectoryPtr &secondaryDir, bool doClose)
static String getExtension(const String &name)
Utility method to return a file's extension.
Utility template class to handle hash set collections that can be safely copied and shared.
Definition HashSet.h:17
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< IndexInput > IndexInputPtr
Definition LuceneTypes.h:493
boost::shared_ptr< Directory > DirectoryPtr
Definition LuceneTypes.h:489
boost::shared_ptr< IndexOutput > IndexOutputPtr
Definition LuceneTypes.h:494