use of io.prestosql.operator.TaskLocation in project hetu-core by openlookeng.
the class Query method setQueryOutputInfo.
private synchronized void setQueryOutputInfo(QueryExecution.QueryOutputInfo outputInfo) {
// if first callback, set column names
if (columns == null) {
List<String> columnNames = outputInfo.getColumnNames();
List<Type> columnTypes = outputInfo.getColumnTypes();
checkArgument(columnNames.size() == columnTypes.size(), "Column names and types size mismatch");
ImmutableList.Builder<Column> list = ImmutableList.builder();
for (int i = 0; i < columnNames.size(); i++) {
list.add(createColumn(columnNames.get(i), columnTypes.get(i)));
}
columns = list.build();
types = outputInfo.getColumnTypes();
}
for (TaskLocation outputLocation : outputInfo.getBufferLocations()) {
exchangeClient.addLocation(outputLocation);
}
if (outputInfo.isNoMoreBufferLocations()) {
exchangeClient.noMoreLocations();
}
}
use of io.prestosql.operator.TaskLocation in project hetu-core by openlookeng.
the class SqlQueryScheduler method updateQueryOutputLocations.
private static void updateQueryOutputLocations(QueryStateMachine queryStateMachine, OutputBufferId rootBufferId, Set<RemoteTask> tasks, boolean noMoreExchangeLocations) {
Set<TaskLocation> bufferLocations = tasks.stream().map(task -> {
URI uri = task.getTaskStatus().getSelf();
String instanceId = task.getInstanceId();
URI newUri = uriBuilderFrom(uri).appendPath("results").appendPath(rootBufferId.toString()).build();
return new TaskLocation(newUri, instanceId);
}).collect(toImmutableSet());
queryStateMachine.updateOutputLocations(bufferLocations, noMoreExchangeLocations);
}
use of io.prestosql.operator.TaskLocation in project boostkit-bigdata by kunpengcompute.
the class MergeOmniOperator method addSplit.
@Override
public Supplier<Optional<UpdatablePageSource>> addSplit(Split split) {
requireNonNull(split, "split is null");
checkArgument(split.getConnectorSplit() instanceof RemoteSplit, "split is not a remote split");
checkState(!blockedOnSplits.isDone(), "noMoreSplits has been called already");
URI location = ((RemoteSplit) split.getConnectorSplit()).getLocation();
String instanceId = ((RemoteSplit) split.getConnectorSplit()).getInstanceId();
ExchangeClient exchangeClient = closer.register(exchangeClientSupplier.get(operatorContext.localSystemMemoryContext()));
exchangeClient.addTarget(id);
exchangeClient.noMoreTargets();
exchangeClient.addLocation(new TaskLocation(location, instanceId));
exchangeClient.noMoreLocations();
pageProducers.add(exchangeClient);
return Optional::empty;
}
Aggregations