question: public ShardIterator onlyNodeSelectorActiveInitializingShardsIt ( String nodeAttribute , DiscoveryNodes discoveryNodes ) { ArrayList < ShardRouting > ordered = new ArrayList < > ( activeShards . size ( ) + allInitializingShards . size ( ) ) ; Set < String > selectedNodes = Sets . newHashSet ( discoveryNodes . resolveNodesIds ( nodeAttribute ) ) ; for ( ShardRouting shardRouting : activeShards ) { if ( selectedNodes . contains ( shardRouting . currentNodeId ( ) ) ) { ordered . add ( shardRouting ) ; } } for ( ShardRouting shardRouting : allInitializingShards ) { if ( selectedNodes . contains ( shardRouting . currentNodeId ( ) ) ) { ordered . add ( shardRouting ) ; } } if ( ordered . isEmpty ( ) ) { throw new IllegalArgumentException ( "No data node with critera [" + nodeAttribute + "] found" ) ; } return new PlainShardIterator ( shardId , ordered ) ; }
target:  Returns shards based on nodeAttributes given  such as node name , node attribute, node IP Supports node specifications in cluster API