public abstract class CompoundDirectory extends Directory
Directory
that consists of a view over a compound file.CompoundFormat
Modifier | Constructor and Description |
---|---|
protected |
CompoundDirectory()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
checkIntegrity()
Checks consistency of 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)
Not implemented
|
Lock |
obtainLock(String name)
Acquires and returns a
Lock for a file with the given name. |
void |
rename(String from,
String to)
Not implemented
|
void |
sync(Collection<String> names)
Ensures that any writes to these files are moved to
stable storage (made durable).
|
void |
syncMetaData()
Ensures that directory metadata, such as recent file renames, are moved to stable
storage.
|
close, copyFrom, ensureOpen, fileLength, getPendingDeletions, getTempFileName, listAll, openChecksumInput, openInput, toString
public abstract void checkIntegrity() throws IOException
Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.
IOException
public final void deleteFile(String name)
deleteFile
in class Directory
name
- the name of an existing file.UnsupportedOperationException
- always: not supported by CFSpublic final void rename(String from, String to)
rename
in class Directory
UnsupportedOperationException
- always: not supported by CFSpublic final void syncMetaData()
Directory
syncMetaData
in class Directory
Directory.sync(Collection)
public final 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 Directory
name
- the name of the file to create.IOException
- in case of I/O errorpublic final 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 Directory
IOException
public final void sync(Collection<String> names)
Directory
sync
in class Directory
Directory.syncMetaData()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.