public class BlockDirectory extends Directory
| Modifier and Type | Field and Description |
|---|---|
static long |
BLOCK_MOD |
static long |
BLOCK_SHIFT |
static int |
BLOCK_SIZE |
static org.slf4j.Logger |
LOG |
static Cache |
NO_CACHE |
| Constructor and Description |
|---|
BlockDirectory(String dirName,
Directory directory,
Cache cache,
Set<String> blockCacheFileTypes,
boolean blockCacheReadEnabled,
boolean blockCacheWriteEnabled) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearLock(String name) |
void |
close() |
void |
copy(Directory to,
String src,
String dest,
IOContext context) |
IndexOutput |
createOutput(String name,
IOContext context) |
void |
deleteFile(String name) |
boolean |
fileExists(String name) |
long |
fileLength(String name) |
static long |
getBlock(long pos) |
Cache |
getCache()
Expert: mostly for tests
|
Directory |
getDirectory() |
LockFactory |
getLockFactory() |
String |
getLockID() |
static long |
getPosition(long pos) |
static long |
getRealPosition(long block,
long positionInBlock) |
boolean |
isBlockCacheReadEnabled() |
boolean |
isBlockCacheWriteEnabled() |
String[] |
listAll() |
Lock |
makeLock(String name) |
IndexInput |
openInput(String name,
IOContext context) |
void |
setLockFactory(LockFactory lockFactory) |
void |
sync(Collection<String> names) |
String |
toString() |
ensureOpen, openChecksumInputpublic static org.slf4j.Logger LOG
public static final long BLOCK_SHIFT
public static final long BLOCK_MOD
public static final int BLOCK_SIZE
public static Cache NO_CACHE
public BlockDirectory(String dirName, Directory directory, Cache cache, Set<String> blockCacheFileTypes, boolean blockCacheReadEnabled, boolean blockCacheWriteEnabled) throws IOException
IOExceptionpublic static long getBlock(long pos)
public static long getPosition(long pos)
public static long getRealPosition(long block,
long positionInBlock)
public IndexInput openInput(String name, IOContext context) throws IOException
openInput in class DirectoryIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class DirectoryIOExceptionpublic void clearLock(String name) throws IOException
clearLock in class DirectoryIOExceptionpublic Cache getCache()
public void copy(Directory to, String src, String dest, IOContext context) throws IOException
copy in class DirectoryIOExceptionpublic LockFactory getLockFactory()
getLockFactory in class Directorypublic void setLockFactory(LockFactory lockFactory) throws IOException
setLockFactory in class DirectoryIOExceptionpublic void sync(Collection<String> names) throws IOException
sync in class DirectoryIOExceptionpublic IndexOutput createOutput(String name, IOContext context) throws IOException
createOutput in class DirectoryIOExceptionpublic void deleteFile(String name) throws IOException
deleteFile in class DirectoryIOExceptionpublic boolean fileExists(String name) throws IOException
fileExists in class DirectoryIOExceptionpublic long fileLength(String name) throws IOException
fileLength in class DirectoryIOExceptionpublic String[] listAll() throws IOException
listAll in class DirectoryIOExceptionpublic Directory getDirectory()
public boolean isBlockCacheReadEnabled()
public boolean isBlockCacheWriteEnabled()
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.