@Override public void open() throws TeiidComponentException, TeiidProcessingException { RegisterRequestParameter parameterObject = new RegisterRequestParameter(); ts = dataMgr.registerRequest(getContext(), command, schema, parameterObject); }
@Override public void open() throws TeiidComponentException, TeiidProcessingException { RegisterRequestParameter parameterObject = new RegisterRequestParameter(); ts = dataMgr.registerRequest(getContext(), command, schema, parameterObject); }
@Override public void open() throws TeiidComponentException, TeiidProcessingException { RegisterRequestParameter parameterObject = new RegisterRequestParameter(); ts = dataMgr.registerRequest(getContext(), command, schema, parameterObject); }
public TupleSource getSharedTupleSource(CommandContext context, Command command, String modelName, RegisterRequestParameter parameterObject, BufferManager bufferMgr, ProcessorDataManager pdm) throws TeiidComponentException, TeiidProcessingException { if (sharedStates == null) { sharedStates = new HashMap<Integer, SharedState>(); } SharedState state = sharedStates.get(parameterObject.info.id); if (state == null) { state = new SharedState(); state.expectedReaders = parameterObject.info.sharingCount; RegisterRequestParameter param = new RegisterRequestParameter(parameterObject.connectorBindingId, parameterObject.nodeID, -1); param.fetchSize = parameterObject.fetchSize; param.copyStreamingLobs = true; state.ts = pdm.registerRequest(context, command, modelName, param); if (param.doNotCache) { return state.ts; } state.tb = bufferMgr.createTupleBuffer(command.getProjectedSymbols(), context.getConnectionId(), TupleSourceType.PROCESSOR); state.id = parameterObject.info.id; sharedStates.put(parameterObject.info.id, state); } return new SharedTupleSource(state); }
public TupleSource getSharedTupleSource(CommandContext context, Command command, String modelName, RegisterRequestParameter parameterObject, BufferManager bufferMgr, ProcessorDataManager pdm) throws TeiidComponentException, TeiidProcessingException { if (sharedStates == null) { sharedStates = new HashMap<Integer, SharedState>(); } SharedState state = sharedStates.get(parameterObject.info.id); if (state == null) { state = new SharedState(); state.expectedReaders = parameterObject.info.sharingCount; RegisterRequestParameter param = new RegisterRequestParameter(parameterObject.connectorBindingId, parameterObject.nodeID, -1); param.fetchSize = parameterObject.fetchSize; state.ts = pdm.registerRequest(context, command, modelName, param); if (param.doNotCache) { return state.ts; } state.tb = bufferMgr.createTupleBuffer(command.getProjectedSymbols(), context.getConnectionId(), TupleSourceType.PROCESSOR); state.id = parameterObject.info.id; sharedStates.put(parameterObject.info.id, state); } return new SharedTupleSource(state); }
private void registerRequest(Command command) throws TeiidComponentException, TeiidProcessingException { tupleSource = getDataManager().registerRequest(getContext(), command, this.modelName, new RegisterRequestParameter(null, getID(), -1)); }
public TupleSource getSharedTupleSource(CommandContext context, Command command, String modelName, RegisterRequestParameter parameterObject, BufferManager bufferMgr, ProcessorDataManager pdm) throws TeiidComponentException, TeiidProcessingException { if (sharedStates == null) { sharedStates = new HashMap<Integer, SharedState>(); } SharedState state = sharedStates.get(parameterObject.info.id); if (state == null) { state = new SharedState(); state.expectedReaders = parameterObject.info.sharingCount; RegisterRequestParameter param = new RegisterRequestParameter(parameterObject.connectorBindingId, parameterObject.nodeID, -1); param.fetchSize = parameterObject.fetchSize; param.copyStreamingLobs = true; state.ts = pdm.registerRequest(context, command, modelName, param); if (param.doNotCache) { return state.ts; } state.tb = bufferMgr.createTupleBuffer(command.getProjectedSymbols(), context.getConnectionId(), TupleSourceType.PROCESSOR); state.id = parameterObject.info.id; sharedStates.put(parameterObject.info.id, state); } return new SharedTupleSource(state); }
private void registerRequest(Command command) throws TeiidComponentException, TeiidProcessingException { tupleSource = getDataManager().registerRequest(getContext(), command, this.modelName, new RegisterRequestParameter(null, getID(), -1)); }
private void registerRequest(Command command) throws TeiidComponentException, TeiidProcessingException { tupleSource = getDataManager().registerRequest(getContext(), command, this.modelName, new RegisterRequestParameter(null, getID(), -1)); }
BatchedUpdateCommand command = new BatchedUpdateCommand(commandsToExecute); RowBasedSecurityHelper.checkConstraints(command, getEvaluator(Collections.emptyMap())); tupleSource = getDataManager().registerRequest(getContext(), command, modelName, new RegisterRequestParameter(null, getID(), -1));
BatchedUpdateCommand command = new BatchedUpdateCommand(commandsToExecute); RowBasedSecurityHelper.checkConstraints(command, getEvaluator(Collections.emptyMap())); tupleSource = getDataManager().registerRequest(getContext(), command, modelName, new RegisterRequestParameter(null, getID(), -1));
BatchedUpdateCommand command = new BatchedUpdateCommand(commandsToExecute); RowBasedSecurityHelper.checkConstraints(command, getEvaluator(Collections.emptyMap())); tupleSource = getDataManager().registerRequest(getContext(), command, modelName, new RegisterRequestParameter(null, getID(), -1));
private void registerRequest(Command atomicCommand) throws TeiidComponentException, TeiidProcessingException { if (shouldEvaluate) { projection = null; minimizeProject(atomicCommand); } int limit = -1; if (getParent() instanceof LimitNode) { LimitNode parent = (LimitNode)getParent(); if (parent.getLimit() > 0) { limit = parent.getLimit() + parent.getOffset(); } } RegisterRequestParameter param = new RegisterRequestParameter(connectorBindingId, getID(), limit); param.info = info; param.fetchSize = this.getBatchSize(); RowBasedSecurityHelper.checkConstraints(atomicCommand, getEvaluator(Collections.emptyMap())); tupleSources.add(getDataManager().registerRequest(getContext(), atomicCommand, modelName, param)); if (tupleSources.size() > 1) { reserved += getBufferManager().reserveBuffers(schemaSize, BufferReserveMode.FORCE); } }
private void registerRequest(Command atomicCommand) throws TeiidComponentException, TeiidProcessingException { if (shouldEvaluate) { projection = null; minimizeProject(atomicCommand); } int limit = -1; if (getParent() instanceof LimitNode) { LimitNode parent = (LimitNode)getParent(); if (parent.getLimit() > 0) { limit = parent.getLimit() + parent.getOffset(); } } RegisterRequestParameter param = new RegisterRequestParameter(connectorBindingId, getID(), limit); param.info = info; param.fetchSize = this.getBatchSize(); RowBasedSecurityHelper.checkConstraints(atomicCommand, getEvaluator(Collections.emptyMap())); tupleSources.add(getDataManager().registerRequest(getContext(), atomicCommand, modelName, param)); if (tupleSources.size() > 1) { reserved += getBufferManager().reserveBuffers(schemaSize, BufferReserveMode.FORCE); } }
private void registerRequest(Command atomicCommand) throws TeiidComponentException, TeiidProcessingException { if (shouldEvaluate) { projection = null; minimizeProject(atomicCommand); } int limit = -1; if (getParent() instanceof LimitNode) { LimitNode parent = (LimitNode)getParent(); if (parent.getLimit() > 0) { limit = parent.getLimit() + parent.getOffset(); } } RegisterRequestParameter param = new RegisterRequestParameter(connectorBindingId, getID(), limit); param.info = info; param.fetchSize = this.getBatchSize(); RowBasedSecurityHelper.checkConstraints(atomicCommand, getEvaluator(Collections.emptyMap())); tupleSources.add(getDataManager().registerRequest(getContext(), atomicCommand, modelName, param)); if (tupleSources.size() > 1) { reserved += getBufferManager().reserveBuffers(schemaSize, BufferReserveMode.FORCE); } }
TupleSource result = this.dataManager.registerRequest(this.internalProcessor.getContext(), insert, TempMetadataAdapter.TEMP_MODEL.getName(), new RegisterRequestParameter()); result.nextTuple(); doneLoading = true; AlterTempTable att = new AlterTempTable(tempTable); this.dataManager.registerRequest(this.internalProcessor.getContext(), att, TempMetadataAdapter.TEMP_MODEL.getName(), new RegisterRequestParameter()); this.tupleSource = this.dataManager.registerRequest(this.internalProcessor.getContext(), this.resultInfo.getTempSelect(), TempMetadataAdapter.TEMP_MODEL.getName(), new RegisterRequestParameter()); this.dataManager.registerRequest(this.internalProcessor.getContext(), att, TempMetadataAdapter.TEMP_MODEL.getName(), new RegisterRequestParameter());
/** * Close the executor and release all the resources. */ public void close() throws TeiidComponentException { this.internalProcessor.closeProcessing(); if (this.tupleSource != null) { this.tupleSource.closeSource(); } String rsTempTable = this.resultInfo.getTempTable(); if (rsTempTable != null) { LogManager.logDetail(LogConstants.CTX_XML_PLAN, "Unloading result set temp table", rsTempTable); //$NON-NLS-1$ internalProcessor.closeProcessing(); try { this.tupleSource = this.dataManager.registerRequest(this.internalProcessor.getContext(), this.resultInfo.getTempDrop(), TempMetadataAdapter.TEMP_MODEL.getName(), new RegisterRequestParameter()); } catch (TeiidProcessingException e) { LogManager.logDetail(org.teiid.logging.LogConstants.CTX_XML_PLAN, e, "Error dropping result set temp table", rsTempTable); //$NON-NLS-1$ } } LogManager.logTrace(org.teiid.logging.LogConstants.CTX_XML_PLAN, new Object[]{"closed executor", resultInfo.getResultSetName()}); //$NON-NLS-1$ }
/** * @see org.teiid.query.processor.xml.ProcessorInstruction#process(org.teiid.query.processor.xml.XMLProcessorEnvironment, org.teiid.query.processor.xml.XMLContext) */ public XMLContext process(XMLProcessorEnvironment env, XMLContext context) throws BlockedException, TeiidComponentException, TeiidProcessingException { if (!env.isStagingTableLoaded(this.resultSetName)) { super.execute(env, context); env.markStagingTableAsLoaded(this.resultSetName); if (!info.isAutoStaged() && info.getTempTable() == null && info.getCommand() instanceof Insert) { //TODO: should consolidate with the other temp logic in RelationalPlanExecutor AlterTempTable att = new AlterTempTable(XMLQueryPlanner.getTempTableName(this.resultSetName)); att.setIndexColumns(this.info.getFkColumns()); //mark the temp table as non-updatable env.getDataManager().registerRequest(env.getProcessorContext(), att, TempMetadataAdapter.TEMP_MODEL.getName(), new RegisterRequestParameter()); } // now that we done executing the plan; remove the plan from context context.removeResultExecutor(resultSetName); } env.incrementCurrentProgramCounter(); return context; }
@Test public void testNodeId() throws Exception { TupleSourceCache tsc = new TupleSourceCache(); HardcodedDataManager pdm = new HardcodedDataManager() { @Override public TupleSource registerRequest(CommandContext context, Command command, String modelName, RegisterRequestParameter parameterObject) throws TeiidComponentException { assertEquals(1, parameterObject.nodeID); return Mockito.mock(TupleSource.class); } }; CommandContext context = TestProcessor.createCommandContext(); BufferManagerImpl bufferMgr = BufferManagerFactory.createBufferManager(); Command command = new Insert(); RegisterRequestParameter parameterObject = new RegisterRequestParameter("z", 1, 1); parameterObject.info = new RegisterRequestParameter.SharedAccessInfo(); tsc.getSharedTupleSource(context, command, "x", parameterObject, bufferMgr, pdm); }
@Test public void testCancelWithCaching() throws Exception { QueryMetadataInterface metadata = RealMetadataFactory.exampleBQTCached(); CacheDirective cd = new CacheDirective(); this.connectorManager.cacheDirective = cd; helpSetupDataTierManager(); Command command = helpSetupRequest("SELECT stringkey from bqt1.smalla", 1, metadata).getCommand(); this.context.getSession().setSessionId("different"); RegisterRequestParameter rrp = new RegisterRequestParameter(); rrp.connectorBindingId = "x"; TupleSource ts = dtm.registerRequest(context, command, "foo", rrp); assertTrue(ts instanceof CachingTupleSource); assertEquals(4, pullTuples(ts, 4)); ((CachingTupleSource)ts).item.requestCancel(""); assertEquals(1, connectorManager.getExecuteCount().get()); assertFalse(rrp.doNotCache); ts.closeSource(); //should force read all assertFalse(((CachingTupleSource)ts).dtts.errored); assertNull(((CachingTupleSource)ts).dtts.scope); assertEquals(0, this.rm.getRsCache().getCachePutCount()); }