For IntelliJ IDEA,
Android Studio or Eclipse



@Override public R visitQueryContext(QueryContext queryContext, C visitContext) { return mergeResults(queryContext.acceptChildren(this, visitContext)); }
private static TaskContext createTaskContext(QueryContext queryContext, Session session, TaskStateMachine taskStateMachine) { return queryContext.addTaskContext( taskStateMachine, session, true, true); }
private synchronized ListenableFuture<?> updateRevocableMemory(long delta) { if (delta >= 0) { return memoryPool.reserveRevocable(queryId, delta); } memoryPool.freeRevocable(queryId, -delta); return NOT_BLOCKED; }
private boolean memoryRevokingNeeded(MemoryPool memoryPool) { return memoryPool.getReservedRevocableBytes() > 0 && memoryPool.getFreeBytes() <= memoryPool.getMaxBytes() * (1.0 - memoryRevokingThreshold); }
public synchronized void setResourceOvercommit() { // Allow the query to use the entire pool. This way the worker will kill the query, if it uses the entire local general pool. // The coordinator will kill the query if the cluster runs out of memory. maxMemory = memoryPool.getMaxBytes(); }
@Override public VersionedMemoryPoolId getMemoryPool() { return new VersionedMemoryPoolId(GENERAL_POOL, 0); }
public <C, R> R accept(QueryContextVisitor<C, R> visitor, C context) { return visitor.visitQueryContext(this, context); }
public <C, R> R accept(QueryContextVisitor<C, R> visitor, C context) { return visitor.visitPipelineContext(this, context); }
public <C, R> R accept(QueryContextVisitor<C, R> visitor, C context) { return visitor.visitTaskContext(this, context); }
public <C, R> R accept(QueryContextVisitor<C, R> visitor, C context) { return visitor.visitOperatorContext(this, context); }
public <C, R> R accept(QueryContextVisitor<C, R> visitor, C context) { return visitor.visitDriverContext(this, context); }
@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())); } }
public TestSqlTaskManager() { localMemoryManager = new LocalMemoryManager(new NodeMemoryConfig(), new ReservedSystemMemoryConfig()); localSpillManager = new LocalSpillManager(new NodeSpillConfig()); taskExecutor = new TaskExecutor(8, 16); taskExecutor.start(); taskManagementExecutor = new TaskManagementExecutor(); }