public TupleSource registerRequest( CommandContext context, Command command, String modelName, RegisterRequestParameter parameterObject) throws TeiidComponentException, TeiidProcessingException { if (parameterObject.info != null) { TupleSourceCache tsc = context.getTupleSourceCache(); if (tsc != null) { return tsc.getSharedTupleSource(context, command, modelName, parameterObject, bufferManager, this); } } TempTableStore tempTableStore = context.getTempTableStore(); if(tempTableStore != null) { try { TupleSource result = registerRequest(context, modelName, command); if (result != null) { return result; } } catch (BlockedException e) { throw new AssertionError("blocked is not expected"); //$NON-NLS-1$ } } return this.processorDataManager.registerRequest(context, command, modelName, parameterObject); }
public TupleSource registerRequest( CommandContext context, Command command, String modelName, RegisterRequestParameter parameterObject) throws TeiidComponentException, TeiidProcessingException { if (parameterObject.info != null) { TupleSourceCache tsc = context.getTupleSourceCache(); if (tsc != null) { return tsc.getSharedTupleSource(context, command, modelName, parameterObject, bufferManager, this); } } TempTableStore tempTableStore = context.getTempTableStore(); if(tempTableStore != null) { try { TupleSource result = registerRequest(context, modelName, command); if (result != null) { return result; } } catch (BlockedException e) { throw new AssertionError("blocked is not expected"); //$NON-NLS-1$ } } return this.processorDataManager.registerRequest(context, command, modelName, parameterObject); }
public TupleSource registerRequest( CommandContext context, Command command, String modelName, RegisterRequestParameter parameterObject) throws TeiidComponentException, TeiidProcessingException { if (parameterObject.info != null) { TupleSourceCache tsc = context.getTupleSourceCache(); if (tsc != null) { return tsc.getSharedTupleSource(context, command, modelName, parameterObject, bufferManager, this); } } TempTableStore tempTableStore = context.getTempTableStore(); if(tempTableStore != null) { try { TupleSource result = registerRequest(context, modelName, command); if (result != null) { return result; } } catch (BlockedException e) { throw new AssertionError("blocked is not expected"); //$NON-NLS-1$ } } return this.processorDataManager.registerRequest(context, command, modelName, parameterObject); }
@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); }