org.getopt.luke.plugins
Class FsDirectory

java.lang.Object
  extended by org.apache.lucene.store.Directory
      extended by org.getopt.luke.plugins.FsDirectory
All Implemented Interfaces:
java.io.Closeable

public class FsDirectory
extends org.apache.lucene.store.Directory

Reads a Lucene index stored in DFS. This is a modified version of a class with the same purpose found in org.apache.nutch.indexer.


Nested Class Summary
static class FsDirectory.NullReporter
           
 
Field Summary
static IOReporter NULL_REPORTER
           
 
Fields inherited from class org.apache.lucene.store.Directory
isOpen, lockFactory
 
Constructor Summary
FsDirectory(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path directory, boolean create, org.apache.hadoop.conf.Configuration conf, IOReporter reporter, int bufSize)
           
 
Method Summary
 void close()
           
 org.apache.lucene.store.IndexOutput createOutput(java.lang.String name)
           
 void deleteFile(java.lang.String name)
           
 boolean fileExists(java.lang.String name)
           
 long fileLength(java.lang.String name)
           
 long fileModified(java.lang.String name)
           
 java.lang.String[] listAll()
           
 org.apache.lucene.store.Lock makeLock(java.lang.String name)
           
 org.apache.lucene.store.IndexInput openInput(java.lang.String name)
           
 void renameFile(java.lang.String from, java.lang.String to)
           
 java.lang.String toString()
           
 void touchFile(java.lang.String name)
           
 
Methods inherited from class org.apache.lucene.store.Directory
clearLock, copy, ensureOpen, getLockFactory, getLockID, openInput, setLockFactory, sync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_REPORTER

public static final IOReporter NULL_REPORTER
Constructor Detail

FsDirectory

public FsDirectory(org.apache.hadoop.fs.FileSystem fs,
                   org.apache.hadoop.fs.Path directory,
                   boolean create,
                   org.apache.hadoop.conf.Configuration conf,
                   IOReporter reporter,
                   int bufSize)
            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

listAll

public java.lang.String[] listAll()
                           throws java.io.IOException
Specified by:
listAll in class org.apache.lucene.store.Directory
Throws:
java.io.IOException

fileExists

public boolean fileExists(java.lang.String name)
                   throws java.io.IOException
Specified by:
fileExists in class org.apache.lucene.store.Directory
Throws:
java.io.IOException

fileModified

public long fileModified(java.lang.String name)
                  throws java.io.IOException
Specified by:
fileModified in class org.apache.lucene.store.Directory
Throws:
java.io.IOException

touchFile

public void touchFile(java.lang.String name)
Specified by:
touchFile in class org.apache.lucene.store.Directory

fileLength

public long fileLength(java.lang.String name)
                throws java.io.IOException
Specified by:
fileLength in class org.apache.lucene.store.Directory
Throws:
java.io.IOException

deleteFile

public void deleteFile(java.lang.String name)
                throws java.io.IOException
Specified by:
deleteFile in class org.apache.lucene.store.Directory
Throws:
java.io.IOException

renameFile

public void renameFile(java.lang.String from,
                       java.lang.String to)
                throws java.io.IOException
Throws:
java.io.IOException

createOutput

public org.apache.lucene.store.IndexOutput createOutput(java.lang.String name)
                                                 throws java.io.IOException
Specified by:
createOutput in class org.apache.lucene.store.Directory
Throws:
java.io.IOException

openInput

public org.apache.lucene.store.IndexInput openInput(java.lang.String name)
                                             throws java.io.IOException
Specified by:
openInput in class org.apache.lucene.store.Directory
Throws:
java.io.IOException

makeLock

public org.apache.lucene.store.Lock makeLock(java.lang.String name)
Overrides:
makeLock in class org.apache.lucene.store.Directory

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Specified by:
close in class org.apache.lucene.store.Directory
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class org.apache.lucene.store.Directory