public class HdfsDirectoryFactory extends CachingDirectoryFactory implements SolrCoreAware, SolrMetricProducer
CachingDirectoryFactory.CacheValue, CachingDirectoryFactory.CloseListener
DirectoryFactory.DirContext
Modifier and Type | Field and Description |
---|---|
static String |
BLOCKCACHE_DIRECT_MEMORY_ALLOCATION
Deprecated.
|
static String |
BLOCKCACHE_ENABLED
Deprecated.
|
static String |
BLOCKCACHE_GLOBAL
Deprecated.
|
static String |
BLOCKCACHE_READ_ENABLED
Deprecated.
|
static String |
BLOCKCACHE_SLAB_COUNT
Deprecated.
|
static String |
BLOCKCACHE_WRITE_ENABLED
Deprecated.
|
static String |
CACHE_MERGES
Deprecated.
|
static String |
CACHE_READONCE
Deprecated.
|
static String |
CONFIG_DIRECTORY
Deprecated.
|
static String |
HDFS_HOME
Deprecated.
|
static String |
KERBEROS_ENABLED
Deprecated.
|
static String |
KERBEROS_KEYTAB
Deprecated.
|
static String |
KERBEROS_PRINCIPAL
Deprecated.
|
static String |
LOCALITYMETRICS_ENABLED
Deprecated.
|
static Metrics |
metrics
Deprecated.
|
static String |
NRTCACHINGDIRECTORY_ENABLE
Deprecated.
|
static String |
NRTCACHINGDIRECTORY_MAXCACHEMB
Deprecated.
|
static String |
NRTCACHINGDIRECTORY_MAXMERGESIZEMB
Deprecated.
|
static String |
NUMBEROFBLOCKSPERBANK
Deprecated.
|
byDirectoryCache, byPathCache, closeListeners, removeEntries
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 and Description |
---|
HdfsDirectoryFactory()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanupOldIndexDirectories(String dataDir,
String currentIndexDir,
boolean afterReload)
Deprecated.
|
void |
close()
Deprecated.
Close the this and all of the Directories it contains.
|
protected Directory |
create(String path,
LockFactory lockFactory,
DirectoryFactory.DirContext dirContext)
Deprecated.
Creates a new Directory for a given path.
|
protected LockFactory |
createLockFactory(String rawLockType)
Deprecated.
Creates a new LockFactory for a given path.
|
boolean |
exists(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.Configuration |
getConf(org.apache.hadoop.fs.Path path)
Deprecated.
|
String |
getConfDir()
Deprecated.
|
String |
getDataHome(CoreDescriptor cd)
Deprecated.
Get the data home folder.
|
void |
inform(SolrCore core)
Deprecated.
|
void |
init(NamedList args)
Deprecated.
|
void |
initializeMetrics(SolrMetricsContext parentContext,
String scope)
Deprecated.
Initialize metrics specific to this producer.
|
boolean |
isAbsolute(String path)
Deprecated.
|
boolean |
isPersistent()
Deprecated.
|
boolean |
isSharedStorage()
Deprecated.
|
void |
move(Directory fromDir,
Directory toDir,
String fileName,
IOContext ioContext)
Deprecated.
Override for more efficient moves.
|
protected void |
removeDirectory(CachingDirectoryFactory.CacheValue cacheValue)
Deprecated.
|
void |
renameWithOverwrite(Directory dir,
String fileName,
String toName)
Deprecated.
|
boolean |
searchersReserveCommitPoints()
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).
|
long |
size(Directory directory)
Deprecated.
|
long |
size(String path)
Deprecated.
|
addCloseListener, deleteOldIndexDirectory, doneWithDirectory, get, getLivePaths, getPath, incRef, normalize, release, remove, remove, remove, remove, stripTrailingSlash
empty, getBaseDir, initCoreContainer, sizeOf, sizeOfDirectory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSolrMetricsContext, getUniqueMetricTag, initializeMetrics
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 final String CACHE_MERGES
public static final String CACHE_READONCE
public static Metrics metrics
public void close() throws IOException
DirectoryFactory
close
in interface Closeable
close
in interface AutoCloseable
close
in interface SolrMetricProducer
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
Directory
Object as returned by a previous call to the
DirectoryFactory.get(java.lang.String, org.apache.solr.core.DirectoryFactory.DirContext, java.lang.String)
method (on the specified path
) 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)exists
in class CachingDirectoryFactory
public org.apache.hadoop.conf.Configuration getConf(org.apache.hadoop.fs.Path path)
protected void removeDirectory(CachingDirectoryFactory.CacheValue cacheValue)
removeDirectory
in class CachingDirectoryFactory
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
DirectoryFactory
getDataHome
in class DirectoryFactory
cd
- core descriptor instanceIOException
public long size(Directory directory) throws IOException
size
in class DirectoryFactory
directory
- to calculate size ofIOException
- on low level IO errorpublic long size(String path) throws IOException
size
in class DirectoryFactory
path
- to calculate size ofIOException
- on low level IO errorpublic String getConfDir()
public void initializeMetrics(SolrMetricsContext parentContext, String scope)
SolrMetricProducer
initializeMetrics
in interface SolrMetricProducer
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
using SolrMetricsContext.getChildContext(Object)
passing this
as the child.scope
- component scopepublic void inform(SolrCore core)
inform
in interface SolrCoreAware
public void cleanupOldIndexDirectories(String dataDir, String currentIndexDir, boolean afterReload)
cleanupOldIndexDirectories
in class DirectoryFactory
public void renameWithOverwrite(Directory dir, String fileName, String toName) throws IOException
renameWithOverwrite
in class DirectoryFactory
IOException
public void move(Directory fromDir, Directory toDir, String fileName, IOContext ioContext) throws IOException
DirectoryFactory
move
in class DirectoryFactory
IOException
- If there is a low-level I/O error.Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.