Interface IndexEventListener

    • Method Detail

      • shardRoutingChanged

        default void shardRoutingChanged​(IndexShard indexShard,
                                         @Nullable
                                         ShardRouting oldRouting,
                                         ShardRouting newRouting)
        Called when the shard routing has changed state.
        Parameters:
        indexShard - The index shard
        oldRouting - The old routing state (can be null)
        newRouting - The new routing state
      • afterIndexShardCreated

        default void afterIndexShardCreated​(IndexShard indexShard)
        Called after the index shard has been created.
      • afterIndexShardStarted

        default void afterIndexShardStarted​(IndexShard indexShard)
        Called after the index shard has been started.
      • beforeIndexShardClosed

        default void beforeIndexShardClosed​(ShardId shardId,
                                            @Nullable
                                            IndexShard indexShard,
                                            Settings indexSettings)
        Called before the index shard gets closed.
        Parameters:
        indexShard - The index shard
      • afterIndexShardClosed

        default void afterIndexShardClosed​(ShardId shardId,
                                           @Nullable
                                           IndexShard indexShard,
                                           Settings indexSettings)
        Called after the index shard has been closed.
        Parameters:
        shardId - The shard id
      • indexShardStateChanged

        default void indexShardStateChanged​(IndexShard indexShard,
                                            @Nullable
                                            IndexShardState previousState,
                                            IndexShardState currentState,
                                            @Nullable
                                            java.lang.String reason)
        Called after a shard's IndexShardState changes. The order of concurrent events is preserved. The execution must be lightweight.
        Parameters:
        indexShard - the shard the new state was applied to
        previousState - the previous index shard state if there was one, null otherwise
        currentState - the new shard state
        reason - the reason for the state change if there is one, null otherwise
      • onShardInactive

        default void onShardInactive​(IndexShard indexShard)
        Called when a shard is marked as inactive
        Parameters:
        indexShard - The shard that was marked inactive
      • beforeIndexCreated

        default void beforeIndexCreated​(Index index,
                                        Settings indexSettings)
        Called before the index gets created. Note that this is also called when the index is created on data nodes
      • afterIndexCreated

        default void afterIndexCreated​(IndexService indexService)
        Called after the index has been created.
      • beforeIndexShardCreated

        default void beforeIndexShardCreated​(ShardId shardId,
                                             Settings indexSettings)
        Called before the index shard gets created.
      • beforeIndexShardDeleted

        default void beforeIndexShardDeleted​(ShardId shardId,
                                             Settings indexSettings)
        Called before the index shard gets deleted from disk Note: this method is only executed on the first attempt of deleting the shard. Retries are will not invoke this method.
        Parameters:
        shardId - The shard id
        indexSettings - the shards index settings
      • afterIndexShardDeleted

        default void afterIndexShardDeleted​(ShardId shardId,
                                            Settings indexSettings)
        Called after the index shard has been deleted from disk. Note: this method is only called if the deletion of the shard did finish without an exception
        Parameters:
        shardId - The shard id
        indexSettings - the shards index settings
      • beforeIndexAddedToCluster

        default void beforeIndexAddedToCluster​(Index index,
                                               Settings indexSettings)
        Called on the Master node only before the IndexService instances is created to simulate an index creation. This happens right before the index and it's metadata is registered in the cluster state
      • onStoreClosed

        default void onStoreClosed​(ShardId shardId)
        Called when the given shards store is closed. The store is closed once all resource have been released on the store. This implies that all index readers are closed and no recoveries are running.
        Parameters:
        shardId - the shard ID the store belongs to