|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.store.Directory org.apache.lucene.store.je.JEDirectory
public class JEDirectory
Port of Andi Vajda's DbDirectory to to Java Edition of Berkeley Database
A JEDirectory is a Berkeley DB JE based implementation of
Directory
. It uses two
Db
database handles, one for storing file
records and another for storing file data blocks.
Field Summary | |
---|---|
protected com.sleepycat.je.Database |
blocks
|
protected com.sleepycat.je.Database |
files
|
protected int |
flags
|
protected Set<JEIndexOutput> |
openFiles
|
protected com.sleepycat.je.Transaction |
txn
|
Fields inherited from class org.apache.lucene.store.Directory |
---|
isOpen, lockFactory |
Constructor Summary | |
---|---|
JEDirectory(com.sleepycat.je.Transaction txn,
com.sleepycat.je.Database files,
com.sleepycat.je.Database blocks)
|
|
JEDirectory(com.sleepycat.je.Transaction txn,
com.sleepycat.je.Database files,
com.sleepycat.je.Database blocks,
int flags)
Instantiate a DbDirectory. |
Method Summary | |
---|---|
void |
close()
Closes the store. |
IndexOutput |
createOutput(String name)
Creates a new, empty file in the directory with the given name. |
void |
deleteFile(String name)
Removes an existing file in the directory. |
boolean |
fileExists(String name)
Returns true iff a file with the given name exists. |
long |
fileLength(String name)
Returns the length of a file in the directory. |
long |
fileModified(String name)
Returns the time the named file was last modified. |
void |
flush()
Flush the currently open files. |
String[] |
listAll()
Returns an array of strings, one for each file in the directory. |
Lock |
makeLock(String name)
Construct a Lock . |
IndexInput |
openInput(String name)
Returns a stream reading an existing file. |
void |
setTransaction(com.sleepycat.je.Transaction txn)
Once a transaction handle was committed it is no longer valid. |
void |
touchFile(String name)
Set the modified time of an existing file to now. |
Methods inherited from class org.apache.lucene.store.Directory |
---|
clearLock, copy, copy, ensureOpen, getLockFactory, getLockID, openInput, setLockFactory, sync, sync, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Set<JEIndexOutput> openFiles
protected com.sleepycat.je.Database files
protected com.sleepycat.je.Database blocks
protected com.sleepycat.je.Transaction txn
protected int flags
Constructor Detail |
---|
public JEDirectory(com.sleepycat.je.Transaction txn, com.sleepycat.je.Database files, com.sleepycat.je.Database 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 JEDirectory(com.sleepycat.je.Transaction txn, com.sleepycat.je.Database files, com.sleepycat.je.Database blocks)
Method Detail |
---|
public void close() throws IOException
Directory
close
in interface Closeable
close
in class Directory
IOException
public void flush() throws IOException
IOException
setTransaction(com.sleepycat.je.Transaction)
public IndexOutput createOutput(String name) throws IOException
Directory
createOutput
in class Directory
IOException
public void deleteFile(String name) throws IOException
Directory
deleteFile
in class Directory
IOException
public boolean fileExists(String name) throws IOException
Directory
fileExists
in class Directory
IOException
public long fileLength(String name) throws IOException
Directory
FileNotFoundException
if the file does not exist
fileLength
in class Directory
name
- the name of the file for which to return the length.
FileNotFoundException
- if the file does not exist.
IOException
- if there was an IO error while retrieving the file's
length.public long fileModified(String name) throws IOException
Directory
fileModified
in class Directory
IOException
public String[] listAll() throws IOException
Directory
listAll
in class Directory
NoSuchDirectoryException
- if the directory is not prepared for any
write operations (such as Directory.createOutput(String)
).
IOException
- in case of other IO errorspublic IndexInput openInput(String name) throws IOException
Directory
openInput
in class Directory
IOException
public Lock makeLock(String name)
Directory
Lock
.
makeLock
in class Directory
name
- the name of the lock filepublic void touchFile(String name) throws IOException
Directory
touchFile
in class Directory
IOException
public void setTransaction(com.sleepycat.je.Transaction txn)
txn
- the new transaction handle to use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |