tl.lin.lucene
Class FileSystemDirectory

java.lang.Object
  extended by org.apache.lucene.store.Directory
      extended by tl.lin.lucene.FileSystemDirectory
All Implemented Interfaces:
Closeable

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

This class implements a Lucene Directory on top of a general FileSystem. Currently it does not support locking.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.store.Directory
org.apache.lucene.store.Directory.IndexInputSlicer
 
Field Summary
 
Fields inherited from class org.apache.lucene.store.Directory
isOpen, lockFactory
 
Constructor Summary
FileSystemDirectory(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path directory, boolean create, org.apache.hadoop.conf.Configuration conf)
          Constructor
 
Method Summary
 void close()
           
 org.apache.lucene.store.IndexOutput createOutput(String name)
           
 org.apache.lucene.store.IndexOutput createOutput(String arg0, org.apache.lucene.store.IOContext arg1)
           
 void deleteFile(String name)
           
 boolean fileExists(String name)
           
 long fileLength(String name)
           
 long fileModified(String name)
           
 String[] list()
           
 String[] listAll()
           
 org.apache.lucene.store.Lock makeLock(String name)
           
 org.apache.lucene.store.IndexInput openInput(String name)
           
 org.apache.lucene.store.IndexInput openInput(String name, int bufferSize)
           
 org.apache.lucene.store.IndexInput openInput(String arg0, org.apache.lucene.store.IOContext arg1)
           
 void renameFile(String from, String to)
           
 void sync(Collection<String> arg0)
           
 String toString()
           
 void touchFile(String name)
           
 
Methods inherited from class org.apache.lucene.store.Directory
clearLock, copy, createSlicer, ensureOpen, getLockFactory, getLockID, setLockFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileSystemDirectory

public FileSystemDirectory(org.apache.hadoop.fs.FileSystem fs,
                           org.apache.hadoop.fs.Path directory,
                           boolean create,
                           org.apache.hadoop.conf.Configuration conf)
                    throws IOException
Constructor

Parameters:
fs -
directory -
create -
conf -
Throws:
IOException
Method Detail

list

public String[] list()
              throws IOException
Throws:
IOException

fileExists

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

fileModified

public long fileModified(String name)

touchFile

public void touchFile(String name)

fileLength

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

deleteFile

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

renameFile

public void renameFile(String from,
                       String to)
                throws IOException
Throws:
IOException

createOutput

public org.apache.lucene.store.IndexOutput createOutput(String name)
                                                 throws IOException
Throws:
IOException

openInput

public org.apache.lucene.store.IndexInput openInput(String name)
                                             throws IOException
Throws:
IOException

openInput

public org.apache.lucene.store.IndexInput openInput(String name,
                                                    int bufferSize)
                                             throws IOException
Throws:
IOException

makeLock

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

close

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

toString

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

createOutput

public org.apache.lucene.store.IndexOutput createOutput(String arg0,
                                                        org.apache.lucene.store.IOContext arg1)
                                                 throws IOException
Specified by:
createOutput in class org.apache.lucene.store.Directory
Throws:
IOException

listAll

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

openInput

public org.apache.lucene.store.IndexInput openInput(String arg0,
                                                    org.apache.lucene.store.IOContext arg1)
                                             throws IOException
Specified by:
openInput in class org.apache.lucene.store.Directory
Throws:
IOException

sync

public void sync(Collection<String> arg0)
          throws IOException
Specified by:
sync in class org.apache.lucene.store.Directory
Throws:
IOException


Copyright © 2013. All Rights Reserved.