use of org.teiid.dqp.message.AtomicRequestMessage in project teiid by teiid.
the class TestDQPCoreRequestHandling method testRemoveConnectorInfo.
public void testRemoveConnectorInfo() {
DQPCore rm = new DQPCore();
rm.setTransactionService(new FakeTransactionService());
// $NON-NLS-1$
RequestMessage r0 = new RequestMessage("foo");
RequestID requestID = new RequestID(SESSION_STRING, 1);
RequestWorkItem workItem = addRequest(rm, r0, requestID, null, null);
AtomicRequestMessage atomicReq = new AtomicRequestMessage(workItem.requestMsg, workItem.getDqpWorkContext(), 1);
DataTierTupleSource info = Mockito.mock(DataTierTupleSource.class);
workItem.addConnectorRequest(atomicReq.getAtomicRequestID(), info);
workItem.closeAtomicRequest(atomicReq.getAtomicRequestID());
DataTierTupleSource arInfo = workItem.getConnectorRequest(atomicReq.getAtomicRequestID());
assertNull(arInfo);
}
use of org.teiid.dqp.message.AtomicRequestMessage in project teiid by teiid.
the class TestDQPCoreRequestHandling method testGetConnectorInfo.
public void testGetConnectorInfo() {
DQPCore rm = new DQPCore();
rm.setTransactionService(new FakeTransactionService());
// $NON-NLS-1$
RequestMessage r0 = new RequestMessage("foo");
RequestID requestID = new RequestID(SESSION_STRING, 1);
RequestWorkItem workItem = addRequest(rm, r0, requestID, null, null);
AtomicRequestMessage atomicReq = new AtomicRequestMessage(workItem.requestMsg, workItem.getDqpWorkContext(), 1);
DataTierTupleSource info = Mockito.mock(DataTierTupleSource.class);
workItem.addConnectorRequest(atomicReq.getAtomicRequestID(), info);
DataTierTupleSource arInfo = workItem.getConnectorRequest(atomicReq.getAtomicRequestID());
assertTrue(arInfo == info);
}
use of org.teiid.dqp.message.AtomicRequestMessage in project teiid by teiid.
the class TestDataTierManager method testCheckForUpdatesWithBatched.
@Test
public void testCheckForUpdatesWithBatched() throws Exception {
helpSetupDataTierManager();
QueryMetadataInterface metadata = RealMetadataFactory.exampleBQTCached();
AtomicRequestMessage request = helpSetupRequest("delete from bqt1.smalla", 1, metadata);
Command command = helpGetCommand("insert into bqt1.smalla (stringkey) values ('1')", metadata);
BatchedUpdateCommand bac = new BatchedUpdateCommand(Arrays.asList(request.getCommand(), command));
request.setCommand(bac);
DataTierTupleSource dtts = new DataTierTupleSource(request, workItem, connectorManager.registerRequest(request), dtm, limit);
pullTuples(dtts, 2);
}
use of org.teiid.dqp.message.AtomicRequestMessage in project teiid by teiid.
the class TestDataTierManager method helpSetup.
private DataTierTupleSource helpSetup(String sql, int nodeId) throws Exception {
helpSetupDataTierManager();
AtomicRequestMessage request = helpSetupRequest(sql, nodeId, RealMetadataFactory.exampleBQTCached());
request.setSerial(serial);
return new DataTierTupleSource(request, workItem, connectorManager.registerRequest(request), dtm, limit);
}
use of org.teiid.dqp.message.AtomicRequestMessage in project teiid by teiid.
the class TestConnectorWorkItem method testSourcHints.
@Test
public void testSourcHints() throws Exception {
// $NON-NLS-1$
Command command = helpGetCommand("update bqt1.smalla set stringkey = 1 where stringkey = 2", EXAMPLE_BQT);
command.setSourceHint(new SourceHint());
AtomicRequestMessage arm = createNewAtomicRequestMessage(1, 1);
arm.setCommand(command);
ConnectorManager cm = TestConnectorManager.getConnectorManager();
cm.registerRequest(arm);
}
Aggregations