public class IndexService extends AbstractIndexComponent implements IndicesClusterStateService.AllocatedIndex<IndexShard>
| Modifier and Type | Class and Description |
|---|---|
static interface |
IndexService.ShardStoreDeleter |
deprecationLogger, logger| Constructor and Description |
|---|
IndexService(IndexSettings indexSettings,
NodeEnvironment nodeEnv,
NamedXContentRegistry xContentRegistry,
SimilarityService similarityService,
IndexService.ShardStoreDeleter shardStoreDeleter,
AnalysisRegistry registry,
EngineFactory engineFactory,
CircuitBreakerService circuitBreakerService,
BigArrays bigArrays,
ThreadPool threadPool,
ScriptService scriptService,
Client client,
QueryCache queryCache,
IndexStore indexStore,
IndexEventListener eventListener,
IndexModule.IndexSearcherWrapperFactory wrapperFactory,
MapperRegistry mapperRegistry,
IndicesFieldDataCache indicesFieldDataCache,
java.util.List<SearchOperationListener> searchOperationListeners,
java.util.List<IndexingOperationListener> indexingOperationListeners) |
| Modifier and Type | Method and Description |
|---|---|
IndexCache |
cache() |
void |
close(java.lang.String reason,
boolean delete) |
IndexShard |
createShard(ShardRouting routing) |
IndexFieldDataService |
fieldData() |
BigArrays |
getBigArrays()
The
BigArrays to use for this index. |
IndexAnalyzers |
getIndexAnalyzers() |
IndexEventListener |
getIndexEventListener() |
IndexSettings |
getIndexSettings()
Returns the index settings of this index.
|
java.util.function.Supplier<org.apache.lucene.search.Sort> |
getIndexSortSupplier() |
IndexMetaData |
getMetaData() |
ScriptService |
getScriptService()
The
ScriptService to use for this index. |
IndexShard |
getShard(int shardId)
Return the shard with the provided id, or throw an exception if it doesn't exist.
|
IndexShard |
getShardOrNull(int shardId)
Return the shard with the provided id, or null if there is no such shard.
|
ThreadPool |
getThreadPool()
The
ThreadPool to use for this index. |
boolean |
hasShard(int shardId) |
java.lang.String |
indexUUID() |
java.util.Iterator<IndexShard> |
iterator() |
MapperService |
mapperService() |
QueryShardContext |
newQueryShardContext(int shardId,
org.apache.lucene.index.IndexReader indexReader,
java.util.function.LongSupplier nowInMillis)
Creates a new QueryShardContext.
|
int |
numberOfShards() |
void |
removeShard(int shardId,
java.lang.String reason)
Removes shard with given id.
|
java.util.Set<java.lang.Integer> |
shardIds() |
SimilarityService |
similarityService() |
boolean |
updateMapping(IndexMetaData indexMetaData)
Checks if index requires refresh from master.
|
void |
updateMetaData(IndexMetaData metadata)
Updates the meta data of this index.
|
NamedXContentRegistry |
xContentRegistry() |
indexclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitindexpublic IndexService(IndexSettings indexSettings, NodeEnvironment nodeEnv, NamedXContentRegistry xContentRegistry, SimilarityService similarityService, IndexService.ShardStoreDeleter shardStoreDeleter, AnalysisRegistry registry, @Nullable EngineFactory engineFactory, CircuitBreakerService circuitBreakerService, BigArrays bigArrays, ThreadPool threadPool, ScriptService scriptService, Client client, QueryCache queryCache, IndexStore indexStore, IndexEventListener eventListener, IndexModule.IndexSearcherWrapperFactory wrapperFactory, MapperRegistry mapperRegistry, IndicesFieldDataCache indicesFieldDataCache, java.util.List<SearchOperationListener> searchOperationListeners, java.util.List<IndexingOperationListener> indexingOperationListeners) throws java.io.IOException
java.io.IOExceptionpublic int numberOfShards()
public IndexEventListener getIndexEventListener()
public java.util.Iterator<IndexShard> iterator()
iterator in interface java.lang.Iterable<IndexShard>public boolean hasShard(int shardId)
@Nullable public IndexShard getShardOrNull(int shardId)
getShardOrNull in interface IndicesClusterStateService.AllocatedIndex<IndexShard>public IndexShard getShard(int shardId)
public java.util.Set<java.lang.Integer> shardIds()
public IndexCache cache()
public IndexFieldDataService fieldData()
public IndexAnalyzers getIndexAnalyzers()
public MapperService mapperService()
public NamedXContentRegistry xContentRegistry()
public SimilarityService similarityService()
public java.util.function.Supplier<org.apache.lucene.search.Sort> getIndexSortSupplier()
public void close(java.lang.String reason,
boolean delete)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String indexUUID()
public IndexShard createShard(ShardRouting routing) throws java.io.IOException
java.io.IOExceptionpublic void removeShard(int shardId,
java.lang.String reason)
IndicesClusterStateService.AllocatedIndexremoveShard in interface IndicesClusterStateService.AllocatedIndex<IndexShard>public IndexSettings getIndexSettings()
IndicesClusterStateService.AllocatedIndexgetIndexSettings in interface IndicesClusterStateService.AllocatedIndex<IndexShard>getIndexSettings in class AbstractIndexComponentpublic QueryShardContext newQueryShardContext(int shardId, org.apache.lucene.index.IndexReader indexReader, java.util.function.LongSupplier nowInMillis)
QueryShardContext.setTypes(String...).
Passing a null IndexReader will return a valid context, however it won't be able to make
IndexReader-specific optimizations, such as rewriting containing range queries.public ThreadPool getThreadPool()
ThreadPool to use for this index.public ScriptService getScriptService()
ScriptService to use for this index.public boolean updateMapping(IndexMetaData indexMetaData) throws java.io.IOException
IndicesClusterStateService.AllocatedIndexupdateMapping in interface IndicesClusterStateService.AllocatedIndex<IndexShard>java.io.IOExceptionpublic IndexMetaData getMetaData()
public void updateMetaData(IndexMetaData metadata)
IndicesClusterStateService.AllocatedIndexIndicesClusterStateService.AllocatedIndex.getIndexSettings()updateMetaData in interface IndicesClusterStateService.AllocatedIndex<IndexShard>