public final class TrackingDirectoryWrapper extends FilterDirectory
in
Constructor and Description |
---|
TrackingDirectoryWrapper(Directory in) |
Modifier and Type | Method and Description |
---|---|
void |
clearCreatedFiles() |
void |
copyFrom(Directory from,
String src,
String dest,
IOContext context)
Copies an existing
src file from directory from
to a non-existent file dest in this directory. |
IndexOutput |
createOutput(String name,
IOContext context)
Creates a new, empty file in the directory and returns an
IndexOutput
instance for appending data to this file. |
IndexOutput |
createTempOutput(String prefix,
String suffix,
IOContext context)
Creates a new, empty, temporary file in the directory and returns an
IndexOutput
instance for appending data to this file. |
void |
deleteFile(String name)
Removes an existing file in the directory.
|
Set<String> |
getCreatedFiles()
NOTE: returns a copy of the created files.
|
void |
rename(String source,
String dest)
Renames
source file to dest file where
dest must not already exist in the directory. |
close, fileLength, getDelegate, getPendingDeletions, listAll, obtainLock, openInput, sync, syncMetaData, toString, unwrap
ensureOpen, getTempFileName, openChecksumInput
public TrackingDirectoryWrapper(Directory in)
public void deleteFile(String name) throws IOException
Directory
NoSuchFileException
or FileNotFoundException
if name
points to a non-existing file.deleteFile
in class FilterDirectory
name
- the name of an existing file.IOException
- in case of I/O errorpublic IndexOutput createOutput(String name, IOContext context) throws IOException
Directory
IndexOutput
instance for appending data to this file.
This method must throw FileAlreadyExistsException
if the file
already exists.createOutput
in class FilterDirectory
name
- the name of the file to create.IOException
- in case of I/O errorpublic IndexOutput createTempOutput(String prefix, String suffix, IOContext context) throws IOException
Directory
IndexOutput
instance for appending data to this file.
The temporary file name (accessible via IndexOutput.getName()
) will start with
prefix
, end with suffix
and have a reserved file extension .tmp
.createTempOutput
in class FilterDirectory
IOException
public void copyFrom(Directory from, String src, String dest, IOContext context) throws IOException
Directory
src
file from directory from
to a non-existent file dest
in this directory.copyFrom
in class Directory
IOException
public void rename(String source, String dest) throws IOException
Directory
source
file to dest
file where
dest
must not already exist in the directory.
It is permitted for this operation to not be truly atomic, for example
both source
and dest
can be visible temporarily in Directory.listAll()
.
However, the implementation of this method must ensure the content of
dest
appears as the entire source
atomically. So once
dest
is visible for readers, the entire content of previous source
is visible.
This method is used by IndexWriter to publish commits.rename
in class FilterDirectory
IOException
public void clearCreatedFiles()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.