[SHARD] make assert less strict to ensure local node is not null

This commit is contained in:
Simon Willnauer 2015-03-12 12:08:26 -07:00
parent 55f2a547d0
commit 8b4f6e0111
1 changed files with 1 additions and 1 deletions

View File

@ -222,7 +222,7 @@ public class IndexShard extends AbstractIndexShardComponent {
this.codecService = codecService; this.codecService = codecService;
this.shardSuggestService = shardSuggestService; this.shardSuggestService = shardSuggestService;
this.shardBitsetFilterCache = shardBitsetFilterCache; this.shardBitsetFilterCache = shardBitsetFilterCache;
assert clusterService.lifecycleState() == Lifecycle.State.STARTED : "expected lifecycle to be started but was: " + clusterService.lifecycleState() ; // otherwise localNode is still none; assert clusterService.localNode() != null : "Local node is null lifecycle state is: " + clusterService.lifecycleState();
this.localNode = clusterService.localNode(); this.localNode = clusterService.localNode();
state = IndexShardState.CREATED; state = IndexShardState.CREATED;
this.refreshInterval = indexSettings.getAsTime(INDEX_REFRESH_INTERVAL, EngineConfig.DEFAULT_REFRESH_INTERVAL); this.refreshInterval = indexSettings.getAsTime(INDEX_REFRESH_INTERVAL, EngineConfig.DEFAULT_REFRESH_INTERVAL);