@Test public void testCloseBeforeInitialization() throws TeiidComponentException { BufferManager bufferMgr = BufferManagerFactory.getStandaloneBufferManager(); FakeDataManager dataManager = new FakeDataManager(); CommandContext context = new CommandContext("pid", "group", null, null, 1); QueryProcessor processor = new QueryProcessor(null, context, bufferMgr, dataManager); processor.closeProcessing(); }
public void closeProcessing() { if (processorClosed) { return; } if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "QueryProcessor: closing processor"); } this.context.getTupleSourceCache().close(); this.bufferMgr.releaseBuffers(reserved); reserved = 0; processorClosed = true; if (initialized) { try { processPlan.close(); } catch (TeiidComponentException e1){ LogManager.logDetail(LogConstants.CTX_DQP, e1, "Error closing processor"); } } }
QueryProcessor implements BatchProducer { public void closeProcessing() { if (processorClosed) { return; } if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "QueryProcessor: closing processor"); } this.context.getTupleSourceCache().close(); this.bufferMgr.releaseBuffers(reserved); reserved = 0; processorClosed = true; if (initialized) { try { processPlan.close(); } catch (TeiidComponentException e1){ LogManager.logDetail(LogConstants.CTX_DQP, e1, "Error closing processor"); } } } }
QueryProcessor implements BatchProducer { public void closeProcessing() { if (processorClosed) { return; } if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "QueryProcessor: closing processor"); } this.context.getTupleSourceCache().close(); this.bufferMgr.releaseBuffers(reserved); reserved = 0; processorClosed = true; if (initialized) { try { processPlan.close(); } catch (TeiidComponentException e1){ LogManager.logDetail(LogConstants.CTX_DQP, e1, "Error closing processor"); } } } QueryProcessor(ProcessorPlan plan, CommandContext context, BufferManager bufferMgr, final ProcessorDataManager dataMgr); }
QueryProcessor implements BatchProducer { public void closeProcessing() { if (processorClosed) { return; } if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "QueryProcessor: closing processor"); } this.context.getTupleSourceCache().close(); this.bufferMgr.releaseBuffers(reserved); reserved = 0; processorClosed = true; if (initialized) { try { processPlan.close(); } catch (TeiidComponentException e1){ LogManager.logDetail(LogConstants.CTX_DQP, e1, "Error closing processor"); } } } QueryProcessor(ProcessorPlan plan, CommandContext context, BufferManager bufferMgr, final ProcessorDataManager dataMgr); CommandContext getContext(); ProcessorPlan getProcessorPlan(); TupleBatch nextBatch(); void init(); void closeProcessing(); @Override List getOutputElements(); List<Exception> getAndClearWarnings(); void requestCanceled(); BatchCollector createBatchCollector(); void setNonBlocking(boolean nonBlocking); @Override TupleBuffer getBuffer(int maxRows); @Override boolean hasBuffer(); BufferManager getBufferManager(); void setContinuous(PreparedPlan prepPlan, String query); @Override void close(); ProcessorDataManager getProcessorDataManager(); }
QueryProcessor implements BatchProducer { public void closeProcessing() { if (processorClosed) { return; } if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_DQP, "QueryProcessor: closing processor"); } this.context.getTupleSourceCache().close(); this.bufferMgr.releaseBuffers(reserved); reserved = 0; processorClosed = true; if (initialized) { try { processPlan.close(); } catch (TeiidComponentException e1){ LogManager.logDetail(LogConstants.CTX_DQP, e1, "Error closing processor"); } } } QueryProcessor(ProcessorPlan plan, CommandContext context, BufferManager bufferMgr, final ProcessorDataManager dataMgr); CommandContext getContext(); ProcessorPlan getProcessorPlan(); TupleBatch nextBatch(); void init(); void closeProcessing(); @Override List getOutputElements(); List<Exception> getAndClearWarnings(); void requestCanceled(); BatchCollector createBatchCollector(); void setNonBlocking(boolean nonBlocking); @Override TupleBuffer getBuffer(int maxRows); @Override boolean hasBuffer(); BufferManager getBufferManager(); void setContinuous(PreparedPlan prepPlan, String query); @Override void close(); ProcessorDataManager getProcessorDataManager();  }