private Page recordProcessedInput(Page page) { operatorContext.recordProcessedInput(0, page.getPositionCount()); // account processed bytes from lazy blocks only when they are loaded Block[] blocks = new Block[page.getChannelCount()]; for (int i = 0; i < page.getChannelCount(); ++i) { Block block = page.getBlock(i); if (block instanceof LazyBlock) { LazyBlock delegateLazyBlock = (LazyBlock) block; blocks[i] = new LazyBlock(page.getPositionCount(), lazyBlock -> { Block loadedBlock = delegateLazyBlock.getLoadedBlock(); operatorContext.recordProcessedInput(loadedBlock.getSizeInBytes(), 0L); lazyBlock.setBlock(loadedBlock); }); } else { operatorContext.recordProcessedInput(block.getSizeInBytes(), 0L); blocks[i] = block; } } return new Page(page.getPositionCount(), blocks); }
private Page recordProcessedInput(Page page) { operatorContext.recordProcessedInput(0, page.getPositionCount()); // account processed bytes from lazy blocks only when they are loaded Block[] blocks = new Block[page.getChannelCount()]; for (int i = 0; i < page.getChannelCount(); ++i) { Block block = page.getBlock(i); if (block instanceof LazyBlock) { LazyBlock delegateLazyBlock = (LazyBlock) block; blocks[i] = new LazyBlock(page.getPositionCount(), lazyBlock -> { Block loadedBlock = delegateLazyBlock.getLoadedBlock(); operatorContext.recordProcessedInput(loadedBlock.getSizeInBytes(), 0L); lazyBlock.setBlock(loadedBlock); }); } else { operatorContext.recordProcessedInput(block.getSizeInBytes(), 0L); blocks[i] = block; } } return new Page(page.getPositionCount(), blocks); }