Package org.apache.solr.core
Class HdfsDirectoryFactory
- java.lang.Object
-
- org.apache.solr.core.DirectoryFactory
-
- org.apache.solr.core.CachingDirectoryFactory
-
- org.apache.solr.core.HdfsDirectoryFactory
-
- All Implemented Interfaces:
Closeable,AutoCloseable,SolrMetricProducer,NamedListInitializedPlugin,SolrCoreAware
@Deprecated public class HdfsDirectoryFactory extends CachingDirectoryFactory implements SolrCoreAware, SolrMetricProducer
Deprecated.since 8.6
-
-
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 StringBLOCKCACHE_DIRECT_MEMORY_ALLOCATIONDeprecated.static StringBLOCKCACHE_ENABLEDDeprecated.static StringBLOCKCACHE_GLOBALDeprecated.static StringBLOCKCACHE_READ_ENABLEDDeprecated.static StringBLOCKCACHE_SLAB_COUNTDeprecated.static StringBLOCKCACHE_WRITE_ENABLEDDeprecated.static StringCACHE_MERGESDeprecated.static StringCACHE_READONCEDeprecated.static StringCONFIG_DIRECTORYDeprecated.static StringHDFS_HOMEDeprecated.static StringKERBEROS_ENABLEDDeprecated.static StringKERBEROS_KEYTABDeprecated.static StringKERBEROS_PRINCIPALDeprecated.static StringLOCALITYMETRICS_ENABLEDDeprecated.static MetricsmetricsDeprecated.static StringNRTCACHINGDIRECTORY_ENABLEDeprecated.static StringNRTCACHINGDIRECTORY_MAXCACHEMBDeprecated.static StringNRTCACHINGDIRECTORY_MAXMERGESIZEMBDeprecated.static StringNUMBEROFBLOCKSPERBANKDeprecated.-
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_HDFS, LOCK_TYPE_NATIVE, LOCK_TYPE_NONE, LOCK_TYPE_SIMPLE, LOCK_TYPE_SINGLE
-
-
Constructor Summary
Constructors Constructor Description HdfsDirectoryFactory()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcleanupOldIndexDirectories(String dataDir, String currentIndexDir, boolean afterReload)Deprecated.voidclose()Deprecated.Close the this and all of the Directories it contains.protected org.apache.lucene.store.Directorycreate(String path, org.apache.lucene.store.LockFactory lockFactory, DirectoryFactory.DirContext dirContext)Deprecated.Creates a new Directory for a given path.protected org.apache.lucene.store.LockFactorycreateLockFactory(String rawLockType)Deprecated.Creates a new LockFactory for a given path.booleanexists(String path)Deprecated.Returns true if a Directory exists for a given path in the underlying (stable) storage and contains at least one file.org.apache.hadoop.conf.ConfigurationgetConf(org.apache.hadoop.fs.Path path)Deprecated.StringgetConfDir()Deprecated.StringgetDataHome(CoreDescriptor cd)Deprecated.Get the data home folder.voidinform(SolrCore core)Deprecated.voidinit(NamedList args)Deprecated.voidinitializeMetrics(SolrMetricsContext parentContext, String scope)Deprecated.Initialize metrics specific to this producer.booleanisAbsolute(String path)Deprecated.booleanisPersistent()Deprecated.booleanisSharedStorage()Deprecated.voidmove(org.apache.lucene.store.Directory fromDir, org.apache.lucene.store.Directory toDir, String fileName, org.apache.lucene.store.IOContext ioContext)Deprecated.Override for more efficient moves.protected voidremoveDirectory(CachingDirectoryFactory.CacheValue cacheValue)Deprecated.voidrenameWithOverwrite(org.apache.lucene.store.Directory dir, String fileName, String toName)Deprecated.booleansearchersReserveCommitPoints()Deprecated.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).longsize(String path)Deprecated.longsize(org.apache.lucene.store.Directory directory)Deprecated.-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.metrics.SolrMetricProducer
getSolrMetricsContext, initializeMetrics
-
-
-
-
Field Detail
-
BLOCKCACHE_SLAB_COUNT
public static final String BLOCKCACHE_SLAB_COUNT
Deprecated.- See Also:
- Constant Field Values
-
BLOCKCACHE_DIRECT_MEMORY_ALLOCATION
public static final String BLOCKCACHE_DIRECT_MEMORY_ALLOCATION
Deprecated.- See Also:
- Constant Field Values
-
BLOCKCACHE_ENABLED
public static final String BLOCKCACHE_ENABLED
Deprecated.- See Also:
- Constant Field Values
-
BLOCKCACHE_GLOBAL
public static final String BLOCKCACHE_GLOBAL
Deprecated.- See Also:
- Constant Field Values
-
BLOCKCACHE_READ_ENABLED
public static final String BLOCKCACHE_READ_ENABLED
Deprecated.- See Also:
- Constant Field Values
-
BLOCKCACHE_WRITE_ENABLED
public static final String BLOCKCACHE_WRITE_ENABLED
Deprecated.- See Also:
- Constant Field Values
-
NRTCACHINGDIRECTORY_ENABLE
public static final String NRTCACHINGDIRECTORY_ENABLE
Deprecated.- See Also:
- Constant Field Values
-
NRTCACHINGDIRECTORY_MAXMERGESIZEMB
public static final String NRTCACHINGDIRECTORY_MAXMERGESIZEMB
Deprecated.- See Also:
- Constant Field Values
-
NRTCACHINGDIRECTORY_MAXCACHEMB
public static final String NRTCACHINGDIRECTORY_MAXCACHEMB
Deprecated.- See Also:
- Constant Field Values
-
NUMBEROFBLOCKSPERBANK
public static final String NUMBEROFBLOCKSPERBANK
Deprecated.- See Also:
- Constant Field Values
-
LOCALITYMETRICS_ENABLED
public static final String LOCALITYMETRICS_ENABLED
Deprecated.- See Also:
- Constant Field Values
-
KERBEROS_ENABLED
public static final String KERBEROS_ENABLED
Deprecated.- See Also:
- Constant Field Values
-
KERBEROS_KEYTAB
public static final String KERBEROS_KEYTAB
Deprecated.- See Also:
- Constant Field Values
-
KERBEROS_PRINCIPAL
public static final String KERBEROS_PRINCIPAL
Deprecated.- See Also:
- Constant Field Values
-
HDFS_HOME
public static final String HDFS_HOME
Deprecated.- See Also:
- Constant Field Values
-
CONFIG_DIRECTORY
public static final String CONFIG_DIRECTORY
Deprecated.- See Also:
- Constant Field Values
-
CACHE_MERGES
public static final String CACHE_MERGES
Deprecated.- See Also:
- Constant Field Values
-
CACHE_READONCE
public static final String CACHE_READONCE
Deprecated.- See Also:
- Constant Field Values
-
metrics
public static Metrics metrics
Deprecated.
-
-
Method Detail
-
close
public void close() throws IOExceptionDeprecated.Description copied from class:DirectoryFactoryClose the this and all of the Directories it contains.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSolrMetricProducer- Overrides:
closein classCachingDirectoryFactory- Throws:
IOException- If there is a low-level I/O error.
-
init
public void init(NamedList args)
Deprecated.- Specified by:
initin interfaceNamedListInitializedPlugin- Overrides:
initin classCachingDirectoryFactory
-
createLockFactory
protected org.apache.lucene.store.LockFactory createLockFactory(String rawLockType) throws IOException
Deprecated.Description copied from class:DirectoryFactoryCreates a new LockFactory for a given path.- Specified by:
createLockFactoryin classDirectoryFactory- Parameters:
rawLockType- A string value as passed in config. Every factory should at least support 'none' to disable locking.- Throws:
IOException- If there is a low-level I/O error.
-
create
protected org.apache.lucene.store.Directory create(String path, org.apache.lucene.store.LockFactory lockFactory, DirectoryFactory.DirContext dirContext) throws IOException
Deprecated.Description copied from class:DirectoryFactoryCreates a new Directory for a given path.- Specified by:
createin classDirectoryFactory- Throws:
IOException- If there is a low-level I/O error.
-
exists
public boolean exists(String path)
Deprecated.Description copied from class:DirectoryFactoryReturns true if a Directory exists for a given path in the underlying (stable) storage and contains at least one file. Note that the existence of aDirectoryObject as returned by a previous call to theDirectoryFactory.get(java.lang.String, org.apache.solr.core.DirectoryFactory.DirContext, java.lang.String)method (on the specifiedpath) is not enough to cause this method to return true. Some prior user of that Directory must have written & synced at least one file to that Directory (and at least one file must still exist)- Overrides:
existsin classCachingDirectoryFactory
-
getConf
public org.apache.hadoop.conf.Configuration getConf(org.apache.hadoop.fs.Path path)
Deprecated.
-
removeDirectory
protected void removeDirectory(CachingDirectoryFactory.CacheValue cacheValue)
Deprecated.- Overrides:
removeDirectoryin classCachingDirectoryFactory
-
isAbsolute
public boolean isAbsolute(String path)
Deprecated.- Overrides:
isAbsolutein classDirectoryFactory- Parameters:
path- the path to check- Returns:
- true if absolute, as in not relative
-
isPersistent
public boolean isPersistent()
Deprecated.- Specified by:
isPersistentin classDirectoryFactory- Returns:
- true if data is kept after close.
-
isSharedStorage
public boolean isSharedStorage()
Deprecated.- Overrides:
isSharedStoragein classDirectoryFactory- Returns:
- true if storage is shared.
-
searchersReserveCommitPoints
public boolean searchersReserveCommitPoints()
Deprecated.Description copied from class:DirectoryFactoryIf 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). Otherwise, return true. Defaults to returning false.- Overrides:
searchersReserveCommitPointsin classDirectoryFactory- Returns:
- true if factory impl requires that Searcher's explicitly reserve commit points.
-
getDataHome
public String getDataHome(CoreDescriptor cd) throws IOException
Deprecated.Description copied from class:DirectoryFactoryGet the data home folder. If solr.data.home is set, that is used, else base on instanceDir- Overrides:
getDataHomein classDirectoryFactory- Parameters:
cd- core descriptor instance- Returns:
- a String with absolute path to data direcotry
- Throws:
IOException
-
size
public long size(org.apache.lucene.store.Directory directory) throws IOExceptionDeprecated.- Overrides:
sizein 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
Deprecated.- Overrides:
sizein classDirectoryFactory- Parameters:
path- to calculate size of- Returns:
- size in bytes
- Throws:
IOException- on low level IO error
-
getConfDir
public String getConfDir()
Deprecated.
-
initializeMetrics
public void initializeMetrics(SolrMetricsContext parentContext, String scope)
Deprecated.Description copied from interface:SolrMetricProducerInitialize metrics specific to this producer.- Specified by:
initializeMetricsin interfaceSolrMetricProducer- Parameters:
parentContext- parent metrics context. If this component has the same life-cycle as the parent it can simply use the parent context, otherwise it should obtain a child context usingSolrMetricsContext.getChildContext(Object)passingthisas the child.scope- component scope
-
inform
public void inform(SolrCore core)
Deprecated.- Specified by:
informin interfaceSolrCoreAware
-
cleanupOldIndexDirectories
public void cleanupOldIndexDirectories(String dataDir, String currentIndexDir, boolean afterReload)
Deprecated.- Overrides:
cleanupOldIndexDirectoriesin classDirectoryFactory
-
renameWithOverwrite
public void renameWithOverwrite(org.apache.lucene.store.Directory dir, String fileName, String toName) throws IOExceptionDeprecated.- Overrides:
renameWithOverwritein 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 IOExceptionDeprecated.Description copied from class:DirectoryFactoryOverride for more efficient moves. Intended for use with replication - use carefully - some Directory wrappers will cache files for example.- Overrides:
movein classDirectoryFactory- Throws:
IOException- If there is a low-level I/O error.
-
-