@JsonCreator public static TaskId valueOf(String taskId) { return new TaskId(taskId); }
@Override public TaskInfo updateTask(Session session, TaskId taskId, Optional<PlanFragment> fragment, List<TaskSource> sources, OutputBuffers outputBuffers, OptionalInt totalPartitions) { requireNonNull(session, "session is null"); requireNonNull(taskId, "taskId is null"); requireNonNull(fragment, "fragment is null"); requireNonNull(sources, "sources is null"); requireNonNull(outputBuffers, "outputBuffers is null"); if (resourceOvercommit(session)) { // TODO: This should have been done when the QueryContext was created. However, the session isn't available at that point. queryContexts.getUnchecked(taskId.getQueryId()).setResourceOvercommit(); } SqlTask sqlTask = tasks.getUnchecked(taskId); sqlTask.recordHeartbeat(); return sqlTask.updateTask(session, fragment, sources, outputBuffers, totalPartitions); }
@Override public String toString() { return taskId.toString(); }
public AssignUniqueIdOperator(OperatorContext operatorContext, AtomicLong rowIdPool) { this.operatorContext = requireNonNull(operatorContext, "operatorContext is null"); this.rowIdPool = requireNonNull(rowIdPool, "rowIdPool is null"); TaskId fullTaskId = operatorContext.getDriverContext().getTaskId(); uniqueValueMask = (((long) fullTaskId.getStageId().getId()) << 54) | (((long) fullTaskId.getId()) << 40); requestValues(); }
eventListenerManager.splitCompleted( new SplitCompletedEvent( taskId.getQueryId().toString(), taskId.getStageId().toString(), Integer.toString(taskId.getId()), driverStats.getCreateTime().toDate().toInstant(), Optional.ofNullable(driverStats.getStartTime()).map(startTime -> startTime.toDate().toInstant()),
nodeId, taskStatus.getTaskId().toString(), taskStatus.getTaskId().getStageId().toString(), taskStatus.getTaskId().getQueryId().toString(), taskStatus.getState().toString(),
public StageId getStageId() { return taskContext.getTaskId().getStageId(); }
.map(task -> new OutputBufferId(task.getTaskId().getId())) .collect(toImmutableList()); for (OutputBufferManager child : childOutputBufferManagers) {
TaskStateMachine taskStateMachine = new TaskStateMachine(TaskId.valueOf("task-id"), taskNotificationExecutor); PartitionedOutputBuffer outputBuffer = newTestingOutputBuffer(taskNotificationExecutor); OutputBufferConsumer outputBufferConsumer = new OutputBufferConsumer(outputBuffer, OUTPUT_BUFFER_ID);
nodeId, taskStatus.getTaskId().toString(), taskStatus.getTaskId().getStageId().toString(), taskStatus.getTaskId().getQueryId().toString(), taskStatus.getState().toString(),
eventListenerManager.splitCompleted( new SplitCompletedEvent( taskId.getQueryId().toString(), taskId.getStageId().toString(), Integer.toString(taskId.getId()), driverStats.getCreateTime().toDate().toInstant(), Optional.ofNullable(driverStats.getStartTime()).map(startTime -> startTime.toDate().toInstant()),
public AssignUniqueIdOperator(OperatorContext operatorContext, AtomicLong rowIdPool) { this.operatorContext = requireNonNull(operatorContext, "operatorContext is null"); this.rowIdPool = requireNonNull(rowIdPool, "rowIdPool is null"); TaskId fullTaskId = operatorContext.getDriverContext().getTaskId(); uniqueValueMask = (((long) fullTaskId.getStageId().getId()) << 54) | (((long) fullTaskId.getId()) << 40); requestValues(); }
public StageId getStageId() { return taskContext.getTaskId().getStageId(); }
.map(task -> new OutputBufferId(task.getTaskId().getId())) .collect(toImmutableList()); for (OutputBufferManager child : childOutputBufferManagers) {
TaskStateMachine taskStateMachine = new TaskStateMachine(TaskId.valueOf("task-id"), taskNotificationExecutor); PartitionedOutputBuffer outputBuffer = newTestingOutputBuffer(taskNotificationExecutor); OutputBufferConsumer outputBufferConsumer = new OutputBufferConsumer(outputBuffer, OUTPUT_BUFFER_ID);
@JsonCreator public static TaskId valueOf(String taskId) { return new TaskId(taskId); }
@Override public TaskInfo updateTask(Session session, TaskId taskId, Optional<PlanFragment> fragment, List<TaskSource> sources, OutputBuffers outputBuffers, OptionalInt totalPartitions) { requireNonNull(session, "session is null"); requireNonNull(taskId, "taskId is null"); requireNonNull(fragment, "fragment is null"); requireNonNull(sources, "sources is null"); requireNonNull(outputBuffers, "outputBuffers is null"); if (resourceOvercommit(session)) { // TODO: This should have been done when the QueryContext was created. However, the session isn't available at that point. queryContexts.getUnchecked(taskId.getQueryId()).setResourceOvercommit(); } SqlTask sqlTask = tasks.getUnchecked(taskId); sqlTask.recordHeartbeat(); return sqlTask.updateTask(session, fragment, sources, outputBuffers, totalPartitions); }
@Override public String toString() { return taskId.toString(); }
private boolean isFinalStageInfo(StageInfo stageInfo) { List<StageInfo> subStages = getSubStagesOf(operatorContext.getDriverContext().getTaskId().getStageId(), stageInfo); return subStages.stream().allMatch(StageInfo::isFinalStageInfo); }
private static Split createRemoteSplitFor(TaskId taskId, URI taskLocation) { // Fetch the results from the buffer assigned to the task based on id URI splitLocation = uriBuilderFrom(taskLocation).appendPath("results").appendPath(String.valueOf(taskId.getId())).build(); return new Split(REMOTE_CONNECTOR_ID, new RemoteTransactionHandle(), new RemoteSplit(splitLocation)); }