| Modifier and Type | Field and Description |
|---|---|
protected Db |
blocks |
protected Db |
files |
protected int |
flags |
protected java.util.Set |
openFiles |
protected DbTxn |
txn |
isOpen, lockFactory| Constructor and Description |
|---|
DbDirectory(DbTxn txn,
Db files,
Db blocks,
int flags)
Instantiate a DbDirectory.
|
DbDirectory(Transaction txn,
Database files,
Database blocks) |
DbDirectory(Transaction txn,
Database files,
Database blocks,
int flags) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the store.
|
IndexOutput |
createOutput(java.lang.String name)
Creates a new, empty file in the directory with the given name.
|
void |
deleteFile(java.lang.String name)
Removes an existing file in the directory.
|
boolean |
fileExists(java.lang.String name)
Returns true iff a file with the given name exists.
|
long |
fileLength(java.lang.String name)
Returns the length of a file in the directory.
|
long |
fileModified(java.lang.String name)
Returns the time the named file was last modified.
|
void |
flush()
Flush the currently open files.
|
java.lang.String[] |
list()
List the files in the directory.
|
Lock |
makeLock(java.lang.String name)
Construct a
Lock. |
IndexInput |
openInput(java.lang.String name)
Returns a stream reading an existing file.
|
void |
renameFile(java.lang.String from,
java.lang.String to)
Renames an existing file in the directory.
|
void |
setTransaction(DbTxn txn)
Once a transaction handle was committed it is no longer valid.
|
void |
setTransaction(Transaction txn)
Once a transaction handle was committed it is no longer valid.
|
void |
touchFile(java.lang.String name)
Set the modified time of an existing file to now.
|
clearLock, copy, ensureOpen, getLockFactory, getLockID, listAll, openInput, setLockFactory, sync, toStringprotected java.util.Set openFiles
protected Db files
protected Db blocks
protected DbTxn txn
protected int flags
public DbDirectory(DbTxn txn,
Db files,
Db blocks,
int flags)
txn - a transaction handle that is going to be used for all db
operations done by this instance. This parameter may be
null.files - a db handle to store file records.blocks - a db handle to store file data blocks.flags - flags used for db read operations.public DbDirectory(Transaction txn,
Database files,
Database blocks,
int flags)
public DbDirectory(Transaction txn,
Database files,
Database blocks)
public void close()
throws java.io.IOException
Directorypublic void flush()
throws java.io.IOException
java.io.IOExceptionsetTransaction(Transaction)public IndexOutput createOutput(java.lang.String name) throws java.io.IOException
DirectorycreateOutput in class Directoryjava.io.IOExceptionpublic void deleteFile(java.lang.String name)
throws java.io.IOException
DirectorydeleteFile in class Directoryjava.io.IOExceptionpublic boolean fileExists(java.lang.String name)
throws java.io.IOException
DirectoryfileExists in class Directoryjava.io.IOExceptionpublic long fileLength(java.lang.String name)
throws java.io.IOException
DirectoryfileLength in class Directoryjava.io.IOExceptionpublic long fileModified(java.lang.String name)
throws java.io.IOException
DirectoryfileModified in class Directoryjava.io.IOExceptionpublic java.lang.String[] list()
throws java.io.IOException
Directorypublic IndexInput openInput(java.lang.String name) throws java.io.IOException
Directorypublic Lock makeLock(java.lang.String name)
DirectoryLock.public void renameFile(java.lang.String from,
java.lang.String to)
throws java.io.IOException
DirectoryrenameFile in class Directoryjava.io.IOExceptionpublic void touchFile(java.lang.String name)
throws java.io.IOException
Directorypublic void setTransaction(Transaction txn)
txn - the new transaction handle to usepublic void setTransaction(DbTxn txn)
txn - the new transaction handle to useCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.