org.elasticsearch.common.compress
Class CompressedDirectory

java.lang.Object
  extended by org.apache.lucene.store.Directory
      extended by org.elasticsearch.common.compress.CompressedDirectory
All Implemented Interfaces:
Closeable, ForceSyncDirectory

public class CompressedDirectory
extends org.apache.lucene.store.Directory
implements ForceSyncDirectory


Field Summary
 
Fields inherited from class org.apache.lucene.store.Directory
isOpen, lockFactory
 
Constructor Summary
CompressedDirectory(org.apache.lucene.store.Directory dir, Compressor compressor, boolean actualLength, String... extensions)
           
CompressedDirectory(org.apache.lucene.store.Directory dir, Compressor compressor, boolean actualLength, String[] compressExtensions, String[] decompressExtensions)
           
 
Method Summary
 void clearLock(String name)
           
 void close()
           
 org.apache.lucene.store.IndexOutput createOutput(String name)
           
 void deleteFile(String name)
           
 boolean fileExists(String name)
           
 long fileLength(String name)
          Returns the actual file size, so will work with compound file format when compressed.
 long fileModified(String name)
           
 void forceSync(String name)
          Similar to Directory.sync(String) but forces it even if its disabled.
static String getExtension(String name)
          Utility method to return a file's extension.
 org.apache.lucene.store.LockFactory getLockFactory()
           
 String getLockID()
           
 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)
           
 void setCompress(boolean compress)
           
 void setLockFactory(org.apache.lucene.store.LockFactory lockFactory)
           
 void sync(Collection<String> names)
           
 void sync(String name)
           
 String toString()
           
 void touchFile(String name)
           
 
Methods inherited from class org.apache.lucene.store.Directory
copy, copy, ensureOpen
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompressedDirectory

public CompressedDirectory(org.apache.lucene.store.Directory dir,
                           Compressor compressor,
                           boolean actualLength,
                           String... extensions)

CompressedDirectory

public CompressedDirectory(org.apache.lucene.store.Directory dir,
                           Compressor compressor,
                           boolean actualLength,
                           String[] compressExtensions,
                           String[] decompressExtensions)
Method Detail

listAll

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

setCompress

public void setCompress(boolean compress)

getExtension

public static String getExtension(String name)
Utility method to return a file's extension.


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)
                  throws IOException
Specified by:
fileModified in class org.apache.lucene.store.Directory
Throws:
IOException

touchFile

public void touchFile(String name)
               throws IOException
Specified by:
touchFile 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

fileLength

public long fileLength(String name)
                throws IOException
Returns the actual file size, so will work with compound file format when compressed. Its the only one that really uses it for offsets...

Specified by:
fileLength in class org.apache.lucene.store.Directory
Throws:
IOException

sync

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

sync

public void sync(String name)
          throws IOException
Overrides:
sync in class org.apache.lucene.store.Directory
Throws:
IOException

forceSync

public void forceSync(String name)
               throws IOException
Description copied from interface: ForceSyncDirectory
Similar to Directory.sync(String) but forces it even if its disabled.

Specified by:
forceSync in interface ForceSyncDirectory
Throws:
IOException

openInput

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

openInput

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

createOutput

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

close

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

setLockFactory

public void setLockFactory(org.apache.lucene.store.LockFactory lockFactory)
                    throws IOException
Overrides:
setLockFactory in class org.apache.lucene.store.Directory
Throws:
IOException

getLockFactory

public org.apache.lucene.store.LockFactory getLockFactory()
Overrides:
getLockFactory in class org.apache.lucene.store.Directory

getLockID

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

makeLock

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

clearLock

public void clearLock(String name)
               throws IOException
Overrides:
clearLock in class org.apache.lucene.store.Directory
Throws:
IOException

toString

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


Copyright © 2009-2012. All Rights Reserved.