org.elasticsearch.common.compress
Class CompressedDirectory
java.lang.Object
org.apache.lucene.store.Directory
org.elasticsearch.common.compress.CompressedDirectory
- All Implemented Interfaces:
- Closeable, ForceSyncDirectory
public class CompressedDirectory
- extends org.apache.lucene.store.Directory
- implements ForceSyncDirectory
Fields inherited from class org.apache.lucene.store.Directory |
isOpen, lockFactory |
Methods inherited from class org.apache.lucene.store.Directory |
copy, copy, ensureOpen |
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)
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.