public class HdfsDirectoryFactory extends CachingDirectoryFactory implements SolrCoreAware
CachingDirectoryFactory.CacheValue, CachingDirectoryFactory.CloseListener
DirectoryFactory.DirContext
Modifier and Type | Field and Description |
---|---|
static String |
BLOCKCACHE_DIRECT_MEMORY_ALLOCATION |
static String |
BLOCKCACHE_ENABLED |
static String |
BLOCKCACHE_GLOBAL |
static String |
BLOCKCACHE_READ_ENABLED |
static String |
BLOCKCACHE_SLAB_COUNT |
static String |
BLOCKCACHE_WRITE_ENABLED |
static String |
CONFIG_DIRECTORY |
static String |
HDFS_HOME |
static String |
KERBEROS_ENABLED |
static String |
KERBEROS_KEYTAB |
static String |
KERBEROS_PRINCIPAL |
static String |
LOCALITYMETRICS_ENABLED |
static Metrics |
metrics |
static String |
NRTCACHINGDIRECTORY_ENABLE |
static String |
NRTCACHINGDIRECTORY_MAXCACHEMB |
static String |
NRTCACHINGDIRECTORY_MAXMERGESIZEMB |
static String |
NUMBEROFBLOCKSPERBANK |
byDirectoryCache, byPathCache, closeListeners, removeEntries
INDEX_W_TIMESTAMP_REGEX, IOCONTEXT_NO_CACHE, LOCK_TYPE_HDFS, LOCK_TYPE_NATIVE, LOCK_TYPE_NONE, LOCK_TYPE_SIMPLE, LOCK_TYPE_SINGLE
Constructor and Description |
---|
HdfsDirectoryFactory() |
Modifier and Type | Method and Description |
---|---|
void |
cleanupOldIndexDirectories(String dataDir,
String currentIndexDir) |
void |
close()
Close the this and all of the Directories it contains.
|
protected Directory |
create(String path,
LockFactory lockFactory,
DirectoryFactory.DirContext dirContext)
Creates a new Directory for a given path.
|
protected LockFactory |
createLockFactory(String rawLockType)
Creates a new LockFactory for a given path.
|
boolean |
exists(String path)
Returns true if a Directory exists for a given path.
|
String |
getConfDir() |
String |
getDataHome(CoreDescriptor cd) |
void |
inform(SolrCore core) |
void |
init(NamedList args) |
boolean |
isAbsolute(String path) |
boolean |
isPersistent() |
boolean |
isSharedStorage() |
Collection<SolrInfoMBean> |
offerMBeans()
Optionally allow the DirectoryFactory to request registration of some MBeans.
|
protected void |
removeDirectory(CachingDirectoryFactory.CacheValue cacheValue) |
boolean |
searchersReserveCommitPoints()
If your implementation can count on delete-on-last-close semantics
or throws an exception when trying to remove a file in use, return
false (eg NFS).
|
addCloseListener, deleteOldIndexDirectory, doneWithDirectory, get, getLivePaths, incRef, normalize, release, remove, remove, remove, remove, stripTrailingSlash
empty, move, sizeOf, sizeOfDirectory
public static final String BLOCKCACHE_SLAB_COUNT
public static final String BLOCKCACHE_DIRECT_MEMORY_ALLOCATION
public static final String BLOCKCACHE_ENABLED
public static final String BLOCKCACHE_GLOBAL
public static final String BLOCKCACHE_READ_ENABLED
public static final String BLOCKCACHE_WRITE_ENABLED
public static final String NRTCACHINGDIRECTORY_ENABLE
public static final String NRTCACHINGDIRECTORY_MAXMERGESIZEMB
public static final String NRTCACHINGDIRECTORY_MAXCACHEMB
public static final String NUMBEROFBLOCKSPERBANK
public static final String LOCALITYMETRICS_ENABLED
public static final String KERBEROS_ENABLED
public static final String KERBEROS_KEYTAB
public static final String KERBEROS_PRINCIPAL
public static final String HDFS_HOME
public static final String CONFIG_DIRECTORY
public static Metrics metrics
public void close() throws IOException
DirectoryFactory
close
in interface Closeable
close
in interface AutoCloseable
close
in class CachingDirectoryFactory
IOException
- If there is a low-level I/O error.public void init(NamedList args)
init
in interface NamedListInitializedPlugin
init
in class CachingDirectoryFactory
protected LockFactory createLockFactory(String rawLockType) throws IOException
DirectoryFactory
createLockFactory
in class DirectoryFactory
rawLockType
- A string value as passed in config. Every factory should at least support 'none' to disable locking.IOException
- If there is a low-level I/O error.protected Directory create(String path, LockFactory lockFactory, DirectoryFactory.DirContext dirContext) throws IOException
DirectoryFactory
create
in class DirectoryFactory
IOException
- If there is a low-level I/O error.public boolean exists(String path)
DirectoryFactory
exists
in class CachingDirectoryFactory
protected void removeDirectory(CachingDirectoryFactory.CacheValue cacheValue) throws IOException
removeDirectory
in class CachingDirectoryFactory
IOException
public boolean isAbsolute(String path)
isAbsolute
in class DirectoryFactory
path
- the path to checkpublic boolean isPersistent()
isPersistent
in class DirectoryFactory
public boolean isSharedStorage()
isSharedStorage
in class DirectoryFactory
public boolean searchersReserveCommitPoints()
DirectoryFactory
searchersReserveCommitPoints
in class DirectoryFactory
public String getDataHome(CoreDescriptor cd) throws IOException
getDataHome
in class DirectoryFactory
IOException
public String getConfDir()
public Collection<SolrInfoMBean> offerMBeans()
DirectoryFactory
offerMBeans
in class DirectoryFactory
public void inform(SolrCore core)
inform
in interface SolrCoreAware
public void cleanupOldIndexDirectories(String dataDir, String currentIndexDir)
cleanupOldIndexDirectories
in class DirectoryFactory
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.