public class HdfsDirectoryFactory extends CachingDirectoryFactory implements SolrCoreAware, SolrMetricProducer
CachingDirectoryFactory.CacheValue, CachingDirectoryFactory.CloseListenerDirectoryFactory.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 | CACHE_MERGES | 
| static String | CACHE_READONCE | 
| 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, removeEntriescoreContainer, 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() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | cleanupOldIndexDirectories(String dataDir,
                          String currentIndexDir,
                          boolean afterReload) | 
| 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 in the underlying (stable) storage and 
 contains at least one file. | 
| org.apache.hadoop.conf.Configuration | getConf() | 
| String | getConfDir() | 
| String | getDataHome(CoreDescriptor cd)Get the data home folder. | 
| void | inform(SolrCore core) | 
| void | init(NamedList args) | 
| void | initializeMetrics(SolrMetricManager manager,
                 String registry,
                 String tag,
                 String scope)Initializes metrics specific to this producer. | 
| boolean | isAbsolute(String path) | 
| boolean | isPersistent() | 
| boolean | isSharedStorage() | 
| void | move(Directory fromDir,
    Directory toDir,
    String fileName,
    IOContext ioContext)Override for more efficient moves. | 
| protected void | removeDirectory(CachingDirectoryFactory.CacheValue cacheValue) | 
| void | renameWithOverwrite(Directory dir,
                   String fileName,
                   String toName) | 
| 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). | 
| long | size(Directory directory) | 
| long | size(String path) | 
addCloseListener, deleteOldIndexDirectory, doneWithDirectory, get, getLivePaths, getPath, incRef, normalize, release, remove, remove, remove, remove, stripTrailingSlashempty, getBaseDir, initCoreContainer, sizeOf, sizeOfDirectoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeMetricspublic 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
DirectoryFactoryclose in interface Closeableclose in interface AutoCloseableclose in class CachingDirectoryFactoryIOException - If there is a low-level I/O error.public void init(NamedList args)
init in interface NamedListInitializedPlugininit in class CachingDirectoryFactoryprotected LockFactory createLockFactory(String rawLockType) throws IOException
DirectoryFactorycreateLockFactory in class DirectoryFactoryrawLockType - 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
DirectoryFactorycreate in class DirectoryFactoryIOException - If there is a low-level I/O error.public boolean exists(String path)
DirectoryFactoryDirectory 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 CachingDirectoryFactorypublic org.apache.hadoop.conf.Configuration getConf()
protected void removeDirectory(CachingDirectoryFactory.CacheValue cacheValue) throws IOException
removeDirectory in class CachingDirectoryFactoryIOExceptionpublic boolean isAbsolute(String path)
isAbsolute in class DirectoryFactorypath - the path to checkpublic boolean isPersistent()
isPersistent in class DirectoryFactorypublic boolean isSharedStorage()
isSharedStorage in class DirectoryFactorypublic boolean searchersReserveCommitPoints()
DirectoryFactorysearchersReserveCommitPoints in class DirectoryFactorypublic String getDataHome(CoreDescriptor cd) throws IOException
DirectoryFactorygetDataHome in class DirectoryFactorycd - core descriptor instanceIOExceptionpublic long size(Directory directory) throws IOException
size in class DirectoryFactorydirectory - to calculate size ofIOException - on low level IO errorpublic long size(String path) throws IOException
size in class DirectoryFactorypath - to calculate size ofIOException - on low level IO errorpublic String getConfDir()
public void initializeMetrics(SolrMetricManager manager, String registry, String tag, String scope)
SolrMetricProducerNote: for back-compatibility this method by default calls SolrMetricProducer.initializeMetrics(SolrMetricManager, String, String).
initializeMetrics in interface SolrMetricProducermanager - an instance of SolrMetricManagerregistry - registry name where metrics are registeredtag - symbolic tag that represents a group of related instances that
 have the same life-cycle. Parent component can use the tag when
 calling SolrMetricManager.unregisterGauges(String, String)
 to unregister metrics created by this instance of the producer.scope - scope of the metrics (eg. handler name) to separate metrics of
              instances of the same component executing in different contextspublic void inform(SolrCore core)
inform in interface SolrCoreAwarepublic void cleanupOldIndexDirectories(String dataDir, String currentIndexDir, boolean afterReload)
cleanupOldIndexDirectories in class DirectoryFactorypublic void renameWithOverwrite(Directory dir, String fileName, String toName) throws IOException
renameWithOverwrite in class DirectoryFactoryIOExceptionpublic void move(Directory fromDir, Directory toDir, String fileName, IOContext ioContext) throws IOException
DirectoryFactorymove in class DirectoryFactoryIOException - If there is a low-level I/O error.Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.