org.apache.lucene.store.je

Class JEDirectory

public class JEDirectory extends Directory

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 com.sleepycat.je.Database Db database handles, one for storing file records and another for storing file data blocks.

Author: Aaron Donovan

Field Summary
protected Databaseblocks
protected Databasefiles
protected intflags
protected SetopenFiles
protected Transactiontxn
Constructor Summary
JEDirectory(Transaction txn, Database files, Database blocks, int flags)
Instantiate a DbDirectory.
JEDirectory(Transaction txn, Database files, Database blocks)
Method Summary
voidclose()
IndexOutputcreateOutput(String name)
voiddeleteFile(String name)
booleanfileExists(String name)
longfileLength(String name)
longfileModified(String name)
voidflush()
Flush the currently open files.
String[]list()
LockmakeLock(String name)
IndexInputopenInput(String name)
voidrenameFile(String from, String to)
voidsetTransaction(Transaction txn)
Once a transaction handle was committed it is no longer valid.
voidtouchFile(String name)

Field Detail

blocks

protected Database blocks

files

protected Database files

flags

protected int flags

openFiles

protected Set openFiles

txn

protected Transaction txn

Constructor Detail

JEDirectory

public JEDirectory(Transaction txn, Database files, Database blocks, int flags)
Instantiate a DbDirectory. The same threading rules that apply to Berkeley DB handles apply to instances of DbDirectory.

Parameters: 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.

JEDirectory

public JEDirectory(Transaction txn, Database files, Database blocks)

Method Detail

close

public void close()

createOutput

public IndexOutput createOutput(String name)

deleteFile

public void deleteFile(String name)

fileExists

public boolean fileExists(String name)

fileLength

public long fileLength(String name)

fileModified

public long fileModified(String name)

flush

public void flush()
Flush the currently open files. After they have been flushed it is safe to commit the transaction without closing this DbDirectory instance first.

See Also: JEDirectory

list

public String[] list()

makeLock

public Lock makeLock(String name)

openInput

public IndexInput openInput(String name)

renameFile

public void renameFile(String from, String to)

setTransaction

public void setTransaction(Transaction txn)
Once a transaction handle was committed it is no longer valid. In order to continue using this JEDirectory instance after a commit, the transaction handle has to be replaced.

Parameters: txn the new transaction handle to use

touchFile

public void touchFile(String name)
Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.