48
48
import org .elasticsearch .index .shard .recovery .RecoveryStatus ;
49
49
import org .elasticsearch .index .store .Store ;
50
50
import org .elasticsearch .index .translog .Translog ;
51
+ import org .elasticsearch .indices .IndicesLifecycle ;
52
+ import org .elasticsearch .indices .InternalIndicesLifecycle ;
51
53
import org .elasticsearch .threadpool .ThreadPool ;
52
54
53
55
import javax .annotation .Nullable ;
@@ -72,6 +74,8 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I
72
74
73
75
private final IndexCache indexCache ;
74
76
77
+ private final InternalIndicesLifecycle indicesLifecycle ;
78
+
75
79
private final Store store ;
76
80
77
81
private final Engine engine ;
@@ -91,9 +95,10 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I
91
95
92
96
private RecoveryStatus peerRecoveryStatus ;
93
97
94
- @ Inject public InternalIndexShard (ShardId shardId , @ IndexSettings Settings indexSettings , Store store , Engine engine , Translog translog ,
98
+ @ Inject public InternalIndexShard (ShardId shardId , @ IndexSettings Settings indexSettings , IndicesLifecycle indicesLifecycle , Store store , Engine engine , Translog translog ,
95
99
ThreadPool threadPool , MapperService mapperService , IndexQueryParserService queryParserService , IndexCache indexCache ) {
96
100
super (shardId , indexSettings );
101
+ this .indicesLifecycle = (InternalIndicesLifecycle ) indicesLifecycle ;
97
102
this .store = store ;
98
103
this .engine = engine ;
99
104
this .translog = translog ;
@@ -191,6 +196,7 @@ public InternalIndexShard start(String reason) throws IndexShardStartedException
191
196
logger .debug ("state: [{}]->[{}], reason [{}]" , state , IndexShardState .STARTED , reason );
192
197
state = IndexShardState .STARTED ;
193
198
}
199
+ indicesLifecycle .afterIndexShardStarted (this );
194
200
return this ;
195
201
}
196
202
@@ -435,6 +441,7 @@ public void performRecoveryFinalization(boolean withFlush) throws ElasticSearchE
435
441
436
442
// clear unreferenced files
437
443
translog .clearUnreferenced ();
444
+ indicesLifecycle .afterIndexShardStarted (this );
438
445
}
439
446
440
447
public void performRecoveryOperation (Translog .Operation operation ) throws ElasticSearchException {
0 commit comments