Search in sources :

Example 1 with MemoryPoolAssignment

use of com.facebook.presto.memory.MemoryPoolAssignment in project presto by prestodb.

the class SqlTaskManager method updateMemoryPoolAssignments.

@Override
public synchronized void updateMemoryPoolAssignments(MemoryPoolAssignmentsRequest assignments) {
    if (coordinatorId != null && coordinatorId.equals(assignments.getCoordinatorId()) && assignments.getVersion() <= currentMemoryPoolAssignmentVersion) {
        return;
    }
    currentMemoryPoolAssignmentVersion = assignments.getVersion();
    if (coordinatorId != null && !coordinatorId.equals(assignments.getCoordinatorId())) {
        log.warn("Switching coordinator affinity from " + coordinatorId + " to " + assignments.getCoordinatorId());
    }
    coordinatorId = assignments.getCoordinatorId();
    for (MemoryPoolAssignment assignment : assignments.getAssignments()) {
        queryContexts.getUnchecked(assignment.getQueryId()).setMemoryPool(localMemoryManager.getPool(assignment.getPoolId()));
    }
}
Also used : MemoryPoolAssignment(com.facebook.presto.memory.MemoryPoolAssignment)

Aggregations

MemoryPoolAssignment (com.facebook.presto.memory.MemoryPoolAssignment)1