use of org.teiid.dqp.message.RequestID in project teiid by teiid.
the class TestDQPCoreRequestHandling method addRequest.
private RequestID addRequest(DQPCore rm, String sessionId, int executionId) {
// $NON-NLS-1$
RequestMessage r0 = new RequestMessage("test command");
RequestID id = new RequestID(sessionId, executionId);
addRequest(rm, r0, id, null, null);
return id;
}
use of org.teiid.dqp.message.RequestID in project teiid by teiid.
the class TestDataTierManager method helpSetupRequest.
private AtomicRequestMessage helpSetupRequest(String sql, int nodeId, QueryMetadataInterface metadata) throws Exception {
DQPWorkContext workContext = RealMetadataFactory.buildWorkContext(metadata, vdb);
Command command = helpGetCommand(sql, metadata);
RequestMessage original = new RequestMessage();
original.setExecutionId(id++);
original.setPartialResults(true);
RequestID requestID = workContext.getRequestID(original.getExecutionId());
context = new CommandContext();
context.setSession(workContext.getSession());
// $NON-NLS-1$
context.setVdbName("test");
context.setVdbVersion(1);
context.setQueryProcessorFactory(new QueryProcessorFactoryImpl(dtm.getBufferManager(), dtm, new DefaultCapabilitiesFinder(), null, metadata));
workItem = TestDQPCoreRequestHandling.addRequest(rm, original, requestID, null, workContext);
context.setWorkItem(workItem);
AtomicRequestMessage request = new AtomicRequestMessage(original, workContext, nodeId);
request.setCommand(command);
// $NON-NLS-1$
request.setConnectorName("FakeConnectorID");
request.setCommandContext(context);
return request;
}
use of org.teiid.dqp.message.RequestID in project teiid by teiid.
the class TestMetaDataProcessor method helpGetMetadata.
public Map[] helpGetMetadata(String sql, QueryMetadataInterface metadata, VDBMetaData vdb) throws Exception {
// Prepare sql
Command command = QueryParser.getQueryParser().parseCommand(sql);
QueryResolver.resolveCommand(command, metadata);
// Create components
SessionAwareCache<PreparedPlan> prepPlanCache = new SessionAwareCache<PreparedPlan>("preparedplan", new DefaultCacheFactory(new CacheConfiguration()), SessionAwareCache.Type.PREPAREDPLAN, 0);
DQPCore requestMgr = new DQPCore();
requestMgr.setTransactionService(new FakeTransactionService());
DQPWorkContext workContext = RealMetadataFactory.buildWorkContext(metadata, vdb);
// Initialize components
RequestID requestID = workContext.getRequestID(1);
RequestMessage requestMsg = new RequestMessage(sql);
TestDQPCoreRequestHandling.addRequest(requestMgr, requestMsg, requestID, command, null);
MetaDataProcessor mdProc = new MetaDataProcessor(requestMgr, prepPlanCache, "MyVDB", 1);
return mdProc.processMessage(requestID, workContext, null, true).getColumnMetadata();
}
use of org.teiid.dqp.message.RequestID in project teiid by teiid.
the class TestRequestID method testEquivalence3.
public void testEquivalence3() {
// $NON-NLS-1$
RequestID r1 = new RequestID("101", 200);
// $NON-NLS-1$
RequestID r2 = new RequestID("100", 200);
UnitTestUtil.helpTestEquivalence(1, r1, r2);
}
use of org.teiid.dqp.message.RequestID in project teiid by teiid.
the class TestRequestID method testEquivalence1.
public void testEquivalence1() {
// $NON-NLS-1$
RequestID r1 = new RequestID("100", 200);
UnitTestUtil.helpTestEquivalence(0, r1, r1);
}
Aggregations