java.lang.Iterable<IndexShard>
, IndexComponent
, IndicesClusterStateService.AllocatedIndex<IndexShard>
public class IndexService extends AbstractIndexComponent implements IndicesClusterStateService.AllocatedIndex<IndexShard>
Modifier and Type | Class | Description |
---|---|---|
static interface |
IndexService.ShardStoreDeleter |
Modifier and Type | Field | Description |
---|---|---|
static Setting<TimeValue> |
GLOBAL_CHECKPOINT_SYNC_INTERVAL_SETTING |
deprecationLogger, logger
Constructor | 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,
NamedWriteableRegistry namedWriteableRegistry) |
Modifier and Type | Method | Description |
---|---|---|
IndexCache |
cache() |
|
boolean |
clearCaches(boolean queryCache,
boolean fieldDataCache,
java.lang.String... fields) |
Clears the caches for the given shard id if the shard is still allocated on this node
|
void |
close(java.lang.String reason,
boolean delete) |
|
IndexShard |
createShard(ShardRouting routing,
java.util.function.Consumer<ShardId> globalCheckpointSyncer) |
|
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,
java.lang.String clusterAlias) |
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() |
index
index
public 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, NamedWriteableRegistry namedWriteableRegistry) throws java.io.IOException
java.io.IOException
public 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 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.IOException
public java.lang.String indexUUID()
public IndexShard createShard(ShardRouting routing, java.util.function.Consumer<ShardId> globalCheckpointSyncer) throws java.io.IOException
java.io.IOException
public void removeShard(int shardId, java.lang.String reason)
IndicesClusterStateService.AllocatedIndex
removeShard
in interface IndicesClusterStateService.AllocatedIndex<IndexShard>
public IndexSettings getIndexSettings()
IndicesClusterStateService.AllocatedIndex
getIndexSettings
in interface IndicesClusterStateService.AllocatedIndex<IndexShard>
getIndexSettings
in class AbstractIndexComponent
public QueryShardContext newQueryShardContext(int shardId, org.apache.lucene.index.IndexReader indexReader, java.util.function.LongSupplier nowInMillis, java.lang.String clusterAlias)
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.AllocatedIndex
updateMapping
in interface IndicesClusterStateService.AllocatedIndex<IndexShard>
java.io.IOException
public IndexMetaData getMetaData()
public void updateMetaData(IndexMetaData metadata)
IndicesClusterStateService.AllocatedIndex
IndicesClusterStateService.AllocatedIndex.getIndexSettings()
updateMetaData
in interface IndicesClusterStateService.AllocatedIndex<IndexShard>
public boolean clearCaches(boolean queryCache, boolean fieldDataCache, java.lang.String... fields)