java.lang.Object
org.elasticsearch.indices.IndexingMemoryController
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- IndexingOperationListener
public class IndexingMemoryController
extends Object
implements IndexingOperationListener, Closeable
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.elasticsearch.index.shard.IndexingOperationListenerIndexingOperationListener.CompositeListener
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Setting<ByteSizeValue>How much heap (% or bytes) we will share across all actively indexing shards on this node (default: 10%).static final Setting<ByteSizeValue>Only applies whenindices.memory.index_buffer_sizeis a %, to set a ceiling on the actual size in bytes (default: not set).static final Setting<ByteSizeValue>Only applies whenindices.memory.index_buffer_sizeis a %, to set a floor on the actual size in bytes (default: 48 MB).If we see no indexing operations after this much time for a given shard, we consider that shard inactive (default: 5 minutes).How frequently we check indexing memory usage (default: 5 seconds).
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidactivateThrottling(IndexShard shard) Asks this shard to throttle indexing to one threadprotected List<IndexShard>protected voidcheckIdle(IndexShard shard, long inactiveTimeNS) ask this shard to check now whether it is inactive, and reduces its indexing buffer if so.voidclose()protected voiddeactivateThrottling(IndexShard shard) Asks this shard to stop throttling indexing to one threadprotected longreturns how much heap this shard is using for its indexing bufferprotected longgetShardWritingBytes(IndexShard shard) returns how many bytes this shard is currently writing to diskvoidpostDelete(ShardId shardId, Engine.Delete delete, Engine.DeleteResult result) Called after the delete operation occurred.voidpostIndex(ShardId shardId, Engine.Index index, Engine.IndexResult result) Called after the indexing operation occurred.protected Scheduler.CancellablescheduleTask(ThreadPool threadPool) protected voidask this shard to refresh, in the background, to free up heapMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.index.shard.IndexingOperationListenerpostDelete, postIndex, preDelete, preIndex
- 
Field Details- 
INDEX_BUFFER_SIZE_SETTINGHow much heap (% or bytes) we will share across all actively indexing shards on this node (default: 10%).
- 
MIN_INDEX_BUFFER_SIZE_SETTINGOnly applies whenindices.memory.index_buffer_sizeis a %, to set a floor on the actual size in bytes (default: 48 MB).
- 
MAX_INDEX_BUFFER_SIZE_SETTINGOnly applies whenindices.memory.index_buffer_sizeis a %, to set a ceiling on the actual size in bytes (default: not set).
- 
SHARD_INACTIVE_TIME_SETTINGIf we see no indexing operations after this much time for a given shard, we consider that shard inactive (default: 5 minutes).
- 
SHARD_MEMORY_INTERVAL_TIME_SETTINGHow frequently we check indexing memory usage (default: 5 seconds).
 
- 
- 
Method Details- 
scheduleTask
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
- 
availableShards
- 
getIndexBufferRAMBytesUsedreturns how much heap this shard is using for its indexing buffer
- 
getShardWritingBytesreturns how many bytes this shard is currently writing to disk
- 
writeIndexingBufferAsyncask this shard to refresh, in the background, to free up heap
- 
activateThrottlingAsks this shard to throttle indexing to one thread
- 
deactivateThrottlingAsks this shard to stop throttling indexing to one thread
- 
postIndexDescription copied from interface:IndexingOperationListenerCalled after the indexing operation occurred. Note that this is also called when indexing a document did not succeed due to document related failures. SeeIndexingOperationListener.postIndex(ShardId, Engine.Index, Exception)for engine level failures- Specified by:
- postIndexin interface- IndexingOperationListener
 
- 
postDeleteDescription copied from interface:IndexingOperationListenerCalled after the delete operation occurred. Note that this is also called when deleting a document did not succeed due to document related failures. SeeIndexingOperationListener.postDelete(ShardId, Engine.Delete, Exception)for engine level failures- Specified by:
- postDeletein interface- IndexingOperationListener
 
- 
checkIdleask this shard to check now whether it is inactive, and reduces its indexing buffer if so.
 
-