public MemoryTrackingContext newMemoryTrackingContext() { return new MemoryTrackingContext( userAggregateMemoryContext.newAggregatedMemoryContext(), revocableAggregateMemoryContext.newAggregatedMemoryContext(), systemAggregateMemoryContext.newAggregatedMemoryContext()); }
public LegacyQueryContext( QueryId queryId, DataSize maxMemory, MemoryPool memoryPool, MemoryPool systemMemoryPool, GcMonitor gcMonitor, Executor notificationExecutor, ScheduledExecutorService yieldExecutor, DataSize maxSpill, SpillSpaceTracker spillSpaceTracker) { this.queryId = requireNonNull(queryId, "queryId is null"); this.maxMemory = requireNonNull(maxMemory, "maxMemory is null").toBytes(); this.memoryPool = requireNonNull(memoryPool, "memoryPool is null"); this.systemMemoryPool = requireNonNull(systemMemoryPool, "systemMemoryPool is null"); this.gcMonitor = requireNonNull(gcMonitor, "gcMonitor is null"); this.notificationExecutor = requireNonNull(notificationExecutor, "notificationExecutor is null"); this.yieldExecutor = requireNonNull(yieldExecutor, "yieldExecutor is null"); this.maxSpill = requireNonNull(maxSpill, "maxSpill is null").toBytes(); this.spillSpaceTracker = requireNonNull(spillSpaceTracker, "spillSpaceTracker is null"); this.queryMemoryContext = new MemoryTrackingContext( newRootAggregatedMemoryContext(new QueryMemoryReservationHandler(this::updateUserMemory, this::tryUpdateUserMemory), GUARANTEED_MEMORY), newRootAggregatedMemoryContext(new QueryMemoryReservationHandler(this::updateRevocableMemory, this::tryReserveMemoryNotSupported), 0L), newRootAggregatedMemoryContext(new QueryMemoryReservationHandler(this::updateSystemMemory, this::tryReserveMemoryNotSupported), 0L)); }
public QueryContext( QueryId queryId, DataSize maxUserMemory, DataSize maxTotalMemory, MemoryPool memoryPool, GcMonitor gcMonitor, Executor notificationExecutor, ScheduledExecutorService yieldExecutor, DataSize maxSpill, SpillSpaceTracker spillSpaceTracker) { this.queryId = requireNonNull(queryId, "queryId is null"); this.maxUserMemory = requireNonNull(maxUserMemory, "maxUserMemory is null").toBytes(); this.maxTotalMemory = requireNonNull(maxTotalMemory, "maxTotalMemory is null").toBytes(); this.memoryPool = requireNonNull(memoryPool, "memoryPool is null"); this.gcMonitor = requireNonNull(gcMonitor, "gcMonitor is null"); this.notificationExecutor = requireNonNull(notificationExecutor, "notificationExecutor is null"); this.yieldExecutor = requireNonNull(yieldExecutor, "yieldExecutor is null"); this.maxSpill = requireNonNull(maxSpill, "maxSpill is null").toBytes(); this.spillSpaceTracker = requireNonNull(spillSpaceTracker, "spillSpaceTracker is null"); this.queryMemoryContext = new MemoryTrackingContext( newRootAggregatedMemoryContext(new QueryMemoryReservationHandler(this::updateUserMemory, this::tryUpdateUserMemory), GUARANTEED_MEMORY), newRootAggregatedMemoryContext(new QueryMemoryReservationHandler(this::updateRevocableMemory, this::tryReserveMemoryNotSupported), 0L), newRootAggregatedMemoryContext(new QueryMemoryReservationHandler(this::updateSystemMemory, this::tryReserveMemoryNotSupported), 0L)); }
public DefaultQueryContext( QueryId queryId, DataSize maxUserMemory, DataSize maxTotalMemory, MemoryPool memoryPool, GcMonitor gcMonitor, Executor notificationExecutor, ScheduledExecutorService yieldExecutor, DataSize maxSpill, SpillSpaceTracker spillSpaceTracker) { this.queryId = requireNonNull(queryId, "queryId is null"); this.maxUserMemory = requireNonNull(maxUserMemory, "maxUserMemory is null").toBytes(); this.maxTotalMemory = requireNonNull(maxTotalMemory, "maxTotalMemory is null").toBytes(); this.memoryPool = requireNonNull(memoryPool, "memoryPool is null"); this.gcMonitor = requireNonNull(gcMonitor, "gcMonitor is null"); this.notificationExecutor = requireNonNull(notificationExecutor, "notificationExecutor is null"); this.yieldExecutor = requireNonNull(yieldExecutor, "yieldExecutor is null"); this.maxSpill = requireNonNull(maxSpill, "maxSpill is null").toBytes(); this.spillSpaceTracker = requireNonNull(spillSpaceTracker, "spillSpaceTracker is null"); this.queryMemoryContext = new MemoryTrackingContext( newRootAggregatedMemoryContext(new QueryMemoryReservationHandler(this::updateUserMemory, this::tryUpdateUserMemory), GUARANTEED_MEMORY), newRootAggregatedMemoryContext(new QueryMemoryReservationHandler(this::updateRevocableMemory, this::tryReserveMemoryNotSupported), 0L), newRootAggregatedMemoryContext(new QueryMemoryReservationHandler(this::updateSystemMemory, this::tryReserveMemoryNotSupported), 0L)); }
public static OperatorContext create(ScheduledExecutorService scheduledExecutor) { Executor executor = MoreExecutors.directExecutor(); TaskContext taskContext = TestingTaskContext.createTaskContext( executor, scheduledExecutor, TestingSession.testSessionBuilder().build()); MemoryTrackingContext pipelineMemoryContext = new MemoryTrackingContext(newSimpleAggregatedMemoryContext(), newSimpleAggregatedMemoryContext(), newSimpleAggregatedMemoryContext()); PipelineContext pipelineContext = new PipelineContext( 1, taskContext, executor, scheduledExecutor, pipelineMemoryContext, false, false, false); DriverContext driverContext = new DriverContext( pipelineContext, executor, scheduledExecutor, pipelineMemoryContext, Lifespan.taskWide()); OperatorContext operatorContext = driverContext.addOperatorContext( 1, new PlanNodeId("test"), "operator type"); return operatorContext; }
public static OperatorContext create(ScheduledExecutorService scheduledExecutor) { Executor executor = MoreExecutors.directExecutor(); TaskContext taskContext = TestingTaskContext.createTaskContext( executor, scheduledExecutor, TestingSession.testSessionBuilder().build()); MemoryTrackingContext pipelineMemoryContext = new MemoryTrackingContext(newSimpleAggregatedMemoryContext(), newSimpleAggregatedMemoryContext(), newSimpleAggregatedMemoryContext()); PipelineContext pipelineContext = new PipelineContext( 1, taskContext, executor, scheduledExecutor, pipelineMemoryContext, false, false, false); DriverContext driverContext = new DriverContext( pipelineContext, executor, scheduledExecutor, pipelineMemoryContext, Lifespan.taskWide()); OperatorContext operatorContext = driverContext.addOperatorContext( 1, new PlanNodeId("test"), "operator type"); return operatorContext; }