|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.store.Directory
org.compass.needle.terracotta.TerracottaDirectory
public class TerracottaDirectory
A Terracota based directory based on Lucene RAM directory improved to support better concurrency.
Basically, the direcotry stores TerracottaFile
which are broken into one or more byte arrays. The size of the byte array can be configured
but should not be changed once the index created.
| Field Summary | |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
|
static int |
DEFAULT_CHM_CONCURRENCY_LEVEL
|
static int |
DEFAULT_CHM_INITIAL_CAPACITY
|
static float |
DEFAULT_CHM_LOAD_FACTOR
|
static int |
DEFAULT_FLUSH_RATE
|
static TerracottaFile |
EMPTY_FILE
|
| Fields inherited from class org.apache.lucene.store.Directory |
|---|
lockFactory |
| Constructor Summary | |
|---|---|
TerracottaDirectory()
|
|
TerracottaDirectory(Directory dir)
|
|
TerracottaDirectory(File dir)
|
|
TerracottaDirectory(int bufferSize,
int flushRate)
|
|
TerracottaDirectory(int bufferSize,
int flushRate,
int chmInitialCapacity,
float chmLoadFactor,
int chmConcurrencyLevel)
Constructs an empty Directory. |
|
TerracottaDirectory(String dir)
|
|
| Method Summary | |
|---|---|
(package private) void |
addFile(String name,
TerracottaFile file)
|
void |
close()
Closes the store to future operations, releasing associated memory. |
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 the named file exists in this directory. |
long |
fileLength(String name)
Returns the length in bytes of a file in the directory. |
long |
fileModified(String name)
Returns the time the named file was last modified. |
(package private) int |
getBufferSize()
|
(package private) int |
getFlushRate()
|
LockFactory |
getLockFactory()
|
String[] |
list()
Returns an array of strings, one for each file in the directory. |
IndexInput |
openInput(String name)
Returns a stream reading an existing file. |
void |
renameFile(String from,
String to)
Deprecated. |
void |
setLockFactory(LockFactory lockFactory)
|
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, ensureOpen, getLockID, makeLock, openInput, sync |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final transient TerracottaFile EMPTY_FILE
public static final transient int DEFAULT_BUFFER_SIZE
public static final transient int DEFAULT_FLUSH_RATE
public static final transient int DEFAULT_CHM_CONCURRENCY_LEVEL
public static final transient float DEFAULT_CHM_LOAD_FACTOR
public static final transient int DEFAULT_CHM_INITIAL_CAPACITY
| Constructor Detail |
|---|
public TerracottaDirectory()
public TerracottaDirectory(int bufferSize,
int flushRate)
public TerracottaDirectory(int bufferSize,
int flushRate,
int chmInitialCapacity,
float chmLoadFactor,
int chmConcurrencyLevel)
Directory.
public TerracottaDirectory(Directory dir)
throws IOException
IOException
public TerracottaDirectory(File dir)
throws IOException
IOException
public TerracottaDirectory(String dir)
throws IOException
IOException| Method Detail |
|---|
public void setLockFactory(LockFactory lockFactory)
setLockFactory in class Directorypublic LockFactory getLockFactory()
getLockFactory in class Directorypublic final String[] list()
list in class Directorypublic final boolean fileExists(String name)
fileExists in class Directory
public final long fileModified(String name)
throws IOException
fileModified in class DirectoryIOException - if the file does not exist
public void touchFile(String name)
throws IOException
touchFile in class DirectoryIOException - if the file does not exist
public final long fileLength(String name)
throws IOException
fileLength in class DirectoryIOException - if the file does not exist
public void deleteFile(String name)
throws IOException
deleteFile in class DirectoryIOException - if the file does not exist
public final void renameFile(String from,
String to)
throws IOException
renameFile in class DirectoryFileNotFoundException - if from does not exist
IOException
public IndexOutput createOutput(String name)
throws IOException
createOutput in class DirectoryIOException
public IndexInput openInput(String name)
throws IOException
openInput in class DirectoryIOException
void addFile(String name,
TerracottaFile file)
int getBufferSize()
int getFlushRate()
public void close()
close in class Directory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||