Package org.apache.solr.hdfs
Class HdfsDirectoryFactory
- java.lang.Object
-
- org.apache.solr.core.DirectoryFactory
-
- org.apache.solr.core.CachingDirectoryFactory
-
- org.apache.solr.hdfs.HdfsDirectoryFactory
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,SolrMetricProducer
,NamedListInitializedPlugin
,SolrCoreAware
public class HdfsDirectoryFactory extends CachingDirectoryFactory implements SolrCoreAware, SolrMetricProducer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.core.CachingDirectoryFactory
CachingDirectoryFactory.CacheValue, CachingDirectoryFactory.CloseListener
-
Nested classes/interfaces inherited from class org.apache.solr.core.DirectoryFactory
DirectoryFactory.DirContext
-
-
Field Summary
Fields Modifier and Type Field 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
CACHE_MERGES
static String
CACHE_READONCE
static String
CONFIG_DIRECTORY
static String
HDFS_HOME
static String
HDFS_UPDATE_LOG_CLASS_NAME
static String
KERBEROS_ENABLED
static String
KERBEROS_KEYTAB
static String
KERBEROS_PRINCIPAL
static String
LOCALITYMETRICS_ENABLED
static String
LOCK_TYPE_HDFS
static Metrics
metrics
static String
NRTCACHINGDIRECTORY_ENABLE
static String
NRTCACHINGDIRECTORY_MAXCACHEMB
static String
NRTCACHINGDIRECTORY_MAXMERGESIZEMB
static String
NUMBEROFBLOCKSPERBANK
-
Fields inherited from class org.apache.solr.core.CachingDirectoryFactory
byDirectoryCache, byPathCache, closeListeners, removeEntries
-
Fields inherited from class org.apache.solr.core.DirectoryFactory
coreContainer, dataHomePath, INDEX_W_TIMESTAMP_REGEX, IOCONTEXT_NO_CACHE, LOCK_TYPE_NATIVE, LOCK_TYPE_NONE, LOCK_TYPE_SIMPLE, LOCK_TYPE_SINGLE
-
-
Constructor Summary
Constructors Constructor Description HdfsDirectoryFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanupOldIndexDirectories(String dataDir, String currentIndexDir, boolean afterReload)
void
close()
protected org.apache.lucene.store.Directory
create(String path, org.apache.lucene.store.LockFactory lockFactory, DirectoryFactory.DirContext dirContext)
protected org.apache.lucene.store.LockFactory
createLockFactory(String rawLockType)
boolean
exists(String path)
org.apache.hadoop.conf.Configuration
getConf(org.apache.hadoop.fs.Path path)
String
getConfDir()
String
getDataHome(CoreDescriptor cd)
SolrMetricsContext
getSolrMetricsContext()
void
inform(SolrCore core)
void
init(org.apache.solr.common.util.NamedList<?> args)
void
initializeMetrics(SolrMetricsContext parentContext, String scope)
boolean
isAbsolute(String path)
boolean
isPersistent()
boolean
isSharedStorage()
void
move(org.apache.lucene.store.Directory fromDir, org.apache.lucene.store.Directory toDir, String fileName, org.apache.lucene.store.IOContext ioContext)
UpdateLog
newDefaultUpdateLog()
protected void
removeDirectory(CachingDirectoryFactory.CacheValue cacheValue)
void
renameWithOverwrite(org.apache.lucene.store.Directory dir, String fileName, String toName)
boolean
searchersReserveCommitPoints()
long
size(String path)
long
size(org.apache.lucene.store.Directory directory)
-
Methods inherited from class org.apache.solr.core.CachingDirectoryFactory
addCloseListener, deleteOldIndexDirectory, doneWithDirectory, get, getLivePaths, getPath, incRef, normalize, release, remove, remove, remove, remove, stripTrailingSlash
-
Methods inherited from class org.apache.solr.core.DirectoryFactory
empty, getBaseDir, initCoreContainer, sizeOf, sizeOfDirectory
-
-
-
-
Field Detail
-
LOCK_TYPE_HDFS
public static final String LOCK_TYPE_HDFS
- See Also:
- Constant Field Values
-
BLOCKCACHE_SLAB_COUNT
public static final String BLOCKCACHE_SLAB_COUNT
- See Also:
- Constant Field Values
-
BLOCKCACHE_DIRECT_MEMORY_ALLOCATION
public static final String BLOCKCACHE_DIRECT_MEMORY_ALLOCATION
- See Also:
- Constant Field Values
-
BLOCKCACHE_ENABLED
public static final String BLOCKCACHE_ENABLED
- See Also:
- Constant Field Values
-
BLOCKCACHE_GLOBAL
public static final String BLOCKCACHE_GLOBAL
- See Also:
- Constant Field Values
-
BLOCKCACHE_READ_ENABLED
public static final String BLOCKCACHE_READ_ENABLED
- See Also:
- Constant Field Values
-
BLOCKCACHE_WRITE_ENABLED
public static final String BLOCKCACHE_WRITE_ENABLED
- See Also:
- Constant Field Values
-
NRTCACHINGDIRECTORY_ENABLE
public static final String NRTCACHINGDIRECTORY_ENABLE
- See Also:
- Constant Field Values
-
NRTCACHINGDIRECTORY_MAXMERGESIZEMB
public static final String NRTCACHINGDIRECTORY_MAXMERGESIZEMB
- See Also:
- Constant Field Values
-
NRTCACHINGDIRECTORY_MAXCACHEMB
public static final String NRTCACHINGDIRECTORY_MAXCACHEMB
- See Also:
- Constant Field Values
-
NUMBEROFBLOCKSPERBANK
public static final String NUMBEROFBLOCKSPERBANK
- See Also:
- Constant Field Values
-
LOCALITYMETRICS_ENABLED
public static final String LOCALITYMETRICS_ENABLED
- See Also:
- Constant Field Values
-
KERBEROS_ENABLED
public static final String KERBEROS_ENABLED
- See Also:
- Constant Field Values
-
KERBEROS_KEYTAB
public static final String KERBEROS_KEYTAB
- See Also:
- Constant Field Values
-
KERBEROS_PRINCIPAL
public static final String KERBEROS_PRINCIPAL
- See Also:
- Constant Field Values
-
HDFS_HOME
public static final String HDFS_HOME
- See Also:
- Constant Field Values
-
CONFIG_DIRECTORY
public static final String CONFIG_DIRECTORY
- See Also:
- Constant Field Values
-
CACHE_MERGES
public static final String CACHE_MERGES
- See Also:
- Constant Field Values
-
CACHE_READONCE
public static final String CACHE_READONCE
- See Also:
- Constant Field Values
-
HDFS_UPDATE_LOG_CLASS_NAME
public static final String HDFS_UPDATE_LOG_CLASS_NAME
- See Also:
- Constant Field Values
-
metrics
public static Metrics metrics
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceSolrMetricProducer
- Overrides:
close
in classCachingDirectoryFactory
- Throws:
IOException
-
init
public void init(org.apache.solr.common.util.NamedList<?> args)
- Specified by:
init
in interfaceNamedListInitializedPlugin
- Overrides:
init
in classCachingDirectoryFactory
-
createLockFactory
protected org.apache.lucene.store.LockFactory createLockFactory(String rawLockType) throws IOException
- Specified by:
createLockFactory
in classDirectoryFactory
- Throws:
IOException
-
create
protected org.apache.lucene.store.Directory create(String path, org.apache.lucene.store.LockFactory lockFactory, DirectoryFactory.DirContext dirContext) throws IOException
- Specified by:
create
in classDirectoryFactory
- Throws:
IOException
-
exists
public boolean exists(String path)
- Overrides:
exists
in classCachingDirectoryFactory
-
getConf
public org.apache.hadoop.conf.Configuration getConf(org.apache.hadoop.fs.Path path)
-
removeDirectory
protected void removeDirectory(CachingDirectoryFactory.CacheValue cacheValue)
- Overrides:
removeDirectory
in classCachingDirectoryFactory
-
isAbsolute
public boolean isAbsolute(String path)
- Overrides:
isAbsolute
in classDirectoryFactory
-
isPersistent
public boolean isPersistent()
- Specified by:
isPersistent
in classDirectoryFactory
-
isSharedStorage
public boolean isSharedStorage()
- Overrides:
isSharedStorage
in classDirectoryFactory
-
searchersReserveCommitPoints
public boolean searchersReserveCommitPoints()
- Overrides:
searchersReserveCommitPoints
in classDirectoryFactory
-
getDataHome
public String getDataHome(CoreDescriptor cd) throws IOException
- Overrides:
getDataHome
in classDirectoryFactory
- Throws:
IOException
-
size
public long size(org.apache.lucene.store.Directory directory) throws IOException
- Overrides:
size
in classDirectoryFactory
- Parameters:
directory
- to calculate size of- Returns:
- size in bytes
- Throws:
IOException
- on low level IO error
-
size
public long size(String path) throws IOException
- Overrides:
size
in classDirectoryFactory
- Parameters:
path
- to calculate size of- Returns:
- size in bytes
- Throws:
IOException
- on low level IO error
-
getConfDir
public String getConfDir()
-
initializeMetrics
public void initializeMetrics(SolrMetricsContext parentContext, String scope)
- Specified by:
initializeMetrics
in interfaceSolrMetricProducer
-
getSolrMetricsContext
public SolrMetricsContext getSolrMetricsContext()
- Specified by:
getSolrMetricsContext
in interfaceSolrMetricProducer
-
inform
public void inform(SolrCore core)
- Specified by:
inform
in interfaceSolrCoreAware
-
cleanupOldIndexDirectories
public void cleanupOldIndexDirectories(String dataDir, String currentIndexDir, boolean afterReload)
- Overrides:
cleanupOldIndexDirectories
in classDirectoryFactory
-
renameWithOverwrite
public void renameWithOverwrite(org.apache.lucene.store.Directory dir, String fileName, String toName) throws IOException
- Overrides:
renameWithOverwrite
in classDirectoryFactory
- Throws:
IOException
-
move
public void move(org.apache.lucene.store.Directory fromDir, org.apache.lucene.store.Directory toDir, String fileName, org.apache.lucene.store.IOContext ioContext) throws IOException
- Overrides:
move
in classDirectoryFactory
- Throws:
IOException
-
newDefaultUpdateLog
public UpdateLog newDefaultUpdateLog()
- Overrides:
newDefaultUpdateLog
in classDirectoryFactory
-
-