for (int i = 0; i < numSplits; i++) { final LocatedSegmentDescriptor locatedSD = segmentDescriptors.get(i); final String[] hosts = new String[locatedSD.getLocations().size() + 1]; for (int j = 0; j < locatedSD.getLocations().size(); j++) { hosts[j] = locatedSD.getLocations().get(j).getHost(); hosts[locatedSD.getLocations().size()] = address; new SegmentDescriptor(locatedSD.getInterval(), locatedSD.getVersion(), locatedSD.getPartitionNumber()); final Query partialQuery = query.withQuerySegmentSpec(new MultipleSpecificSegmentSpec(Lists.newArrayList(newSD))); splits[i] =
public static List<LocatedSegmentDescriptor> getTargetLocations( TimelineServerView serverView, DataSource datasource, List<Interval> intervals, int numCandidates ) { TimelineLookup<String, ServerSelector> timeline = serverView.getTimeline(datasource); if (timeline == null) { return Collections.emptyList(); } List<LocatedSegmentDescriptor> located = Lists.newArrayList(); for (Interval interval : intervals) { for (TimelineObjectHolder<String, ServerSelector> holder : timeline.lookup(interval)) { for (PartitionChunk<ServerSelector> chunk : holder.getObject()) { ServerSelector selector = chunk.getObject(); final SegmentDescriptor descriptor = new SegmentDescriptor( holder.getInterval(), holder.getVersion(), chunk.getChunkNumber() ); long size = selector.getSegment().getSize(); List<DruidServerMetadata> candidates = selector.getCandidates(numCandidates); located.add(new LocatedSegmentDescriptor(descriptor, size, candidates)); } } } return located; } }
for (int i = 0; i < numSplits; i++) { final LocatedSegmentDescriptor locatedSD = segmentDescriptors.get(i); final String[] hosts = new String[locatedSD.getLocations().size()]; for (int j = 0; j < locatedSD.getLocations().size(); j++) { hosts[j] = locatedSD.getLocations().get(j).getHost(); new SegmentDescriptor(locatedSD.getInterval(), locatedSD.getVersion(), locatedSD.getPartitionNumber());