@@ -125,7 +125,7 @@ public AllocateUnassignedDecision makeAllocationDecision(
125
125
return decision ;
126
126
}
127
127
final FetchResult <NodeGatewayStartedShards > shardState = fetchData (unassignedShard , allocation );
128
- List <NodeGatewayStartedShards > nodeShardStates = adaptToNodeShardStates (shardState );
128
+ List <NodeGatewayStartedShards > nodeShardStates = adaptToNodeStartedShardList (shardState );
129
129
return getAllocationDecision (unassignedShard , allocation , nodeShardStates , logger );
130
130
}
131
131
@@ -135,7 +135,7 @@ public AllocateUnassignedDecision makeAllocationDecision(
135
135
*
136
136
* @param shardsState {@link FetchResult<NodeGatewayStartedShards>}
137
137
* */
138
- private static List <NodeGatewayStartedShards > adaptToNodeShardStates (FetchResult <NodeGatewayStartedShards > shardsState ) {
138
+ private static List <NodeGatewayStartedShards > adaptToNodeStartedShardList (FetchResult <NodeGatewayStartedShards > shardsState ) {
139
139
if (!shardsState .hasData ()) {
140
140
return null ;
141
141
}
@@ -150,15 +150,15 @@ protected AllocateUnassignedDecision getAllocationDecision(
150
150
List <NodeGatewayStartedShards > shardState ,
151
151
Logger logger
152
152
) {
153
+ final boolean explain = allocation .debugDecision ();
153
154
if (shardState == null ) {
154
155
allocation .setHasPendingAsyncFetch ();
155
156
List <NodeAllocationResult > nodeDecisions = null ;
156
- if (allocation . debugDecision () ) {
157
+ if (explain ) {
157
158
nodeDecisions = buildDecisionsForAllNodes (unassignedShard , allocation );
158
159
}
159
160
return AllocateUnassignedDecision .no (AllocationStatus .FETCHING_SHARD_DATA , nodeDecisions );
160
161
}
161
- final boolean explain = allocation .debugDecision ();
162
162
// don't create a new IndexSetting object for every shard as this could cause a lot of garbage
163
163
// on cluster restart if we allocate a boat load of shards
164
164
final IndexMetadata indexMetadata = allocation .metadata ().getIndexSafe (unassignedShard .index ());
0 commit comments