Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.execution;
public interface TaskManager
{
    
Gets all of the currently tracked tasks. This will included uninitialized, running, and completed tasks.
    List<TaskInfogetAllTaskInfo();

    
Gets the info for the specified task. If the task has not been created yet, an uninitialized task is created and the info is returned. NOTE: this design assumes that only tasks that will eventually exist are queried.
    TaskInfo getTaskInfo(TaskId taskId);

    
Gets future info for the task after the state changes from current state. If the task has not been created yet, an uninitialized task is created and the future is returned. If the task is already in a final state, the info is returned immediately. NOTE: this design assumes that only tasks that will eventually exist are queried.
    ListenableFuture<TaskInfogetTaskInfo(TaskId taskIdTaskState currentState);
    void updateMemoryPoolAssignments(MemoryPoolAssignmentsRequest assignments);

    
Updates the task plan, sources and output buffers. If the task does not already exist, is is created and then updated.
    TaskInfo updateTask(Session sessionTaskId taskIdPlanFragment fragmentList<TaskSourcesourcesOutputBuffers outputBuffers);

    
Cancels a task. If the task does not already exist, is is created and then canceled.
    TaskInfo cancelTask(TaskId taskId);

    
Aborts a task. If the task does not already exist, is is created and then aborted.
    TaskInfo abortTask(TaskId taskId);

    
Gets results from a task either immediately or in the future. If the task or buffer has not been created yet, an uninitialized task is created and a future is returned. NOTE: this design assumes that only tasks and buffers that will eventually exist are queried.
    ListenableFuture<BufferResultgetTaskResults(TaskId taskIdTaskId outputNamelong startingSequenceIdDataSize maxSize);

    
Aborts a result buffer for a task. If the task or buffer has not been created yet, an uninitialized task is created and a the buffer is aborted. NOTE: this design assumes that only tasks and buffers that will eventually exist are queried.
    TaskInfo abortTaskResults(TaskId taskIdTaskId outputId);
New to GrepCode? Check out our FAQ X