return new FetchResult<>(shardId, null, emptySet()); } else { reroute(shardId, "nodes failed [" + failedNodes.size() + "], ignored [" + allIgnoreNodes.size() + "]"); return new FetchResult<>(shardId, fetchData, allIgnoreNodes);
return new FetchResult<>(shardId, null, emptySet()); } else { reroute(shardId, "nodes failed [" + failedNodes.size() + "], ignored [" + allIgnoreNodes.size() + "]"); return new FetchResult<>(shardId, fetchData, allIgnoreNodes);
return new FetchResult<>(shardId, null, emptySet()); } else { reroute(shardId, "nodes failed [" + failedNodes.size() + "], ignored [" + allIgnoreNodes.size() + "]"); return new FetchResult<>(shardId, fetchData, allIgnoreNodes);
return new FetchResult<>(shardId, null, ImmutableSet.<String>of(), ImmutableSet.<String>of()); } else { reroute(shardId, "nodes failed [" + failedNodes.size() + "], ignored [" + allIgnoreNodes.size() + "]"); return new FetchResult<>(shardId, fetchData, failedNodes, allIgnoreNodes);
return new FetchResult<>(shardId, null, emptySet()); } else { reroute(shardId, "nodes failed [" + failedNodes.size() + "], ignored [" + allIgnoreNodes.size() + "]"); return new FetchResult<>(shardId, fetchData, allIgnoreNodes);
@Override protected AsyncShardFetch.FetchResult<NodeGatewayStartedShards> fetchData(ShardRouting shard, RoutingAllocation allocation) { // for now always return immediately what we know final ShardId shardId = shard.shardId(); final Set<String> ignoreNodes = allocation.getIgnoreNodes(shardId); Map<DiscoveryNode, NodeGatewayStartedShards> foundShards = knownAllocations.values().stream() .flatMap(shardMap -> shardMap.values().stream()) .filter(ks -> ks.shardId().equals(shardId)) .filter(ks -> ignoreNodes.contains(ks.currentNodeId()) == false) .filter(ks -> currentNodes.nodeExists(ks.currentNodeId())) .collect(Collectors.toMap( routing -> currentNodes.get(routing.currentNodeId()), routing -> new NodeGatewayStartedShards( currentNodes.get(routing.currentNodeId()), routing.allocationId().getId(), routing.primary()))); return new AsyncShardFetch.FetchResult<>(shardId, foundShards, ignoreNodes); } };
@Override protected AsyncShardFetch.FetchResult<NodeStoreFilesMetaData> fetchData(ShardRouting shard, RoutingAllocation allocation) { // for now, just pretend no node has data final ShardId shardId = shard.shardId(); return new AsyncShardFetch.FetchResult<>(shardId, Collections.emptyMap(), allocation.getIgnoreNodes(shardId)); }