throws TeiidProcessingException, TeiidComponentException {
RequestWorkItem workItem = requestMgr.getRequestWorkItem((RequestID)processorId);
RequestMessage request = workItem.requestMsg;
// build the atomic request based on original request + context info
AtomicRequestMessage aqr = new AtomicRequestMessage(request, workItem.getDqpWorkContext(), nodeID);
aqr.setCommand(command);
aqr.setModelName(modelName);
aqr.setMaxResultRows(requestMgr.getMaxSourceRows());
aqr.setExceptionOnMaxRows(requestMgr.isExceptionOnMaxSourceRows());
aqr.setPartialResults(request.supportsPartialResults());
aqr.setSerial(requestMgr.getUserRequestSourceConcurrency() == 1);
if (nodeID >= 0) {
aqr.setTransactionContext(workItem.getTransactionContext());
}
aqr.setFetchSize(this.bufferService.getBufferManager().getConnectorBatchSize());
if (connectorBindingId == null) {
VDBMetaData vdb = workItem.getDqpWorkContext().getVDB();
ModelMetaData model = vdb.getModel(modelName);
List<String> bindings = model.getSourceNames();
if (bindings == null || bindings.size() != 1) {
// this should not happen, but it did occur when setting up the SystemAdmin models
throw new TeiidComponentException(QueryPlugin.Util.getString("DataTierManager.could_not_obtain_connector_binding", new Object[]{modelName, workItem.getDqpWorkContext().getVdbName(), workItem.getDqpWorkContext().getVdbVersion() })); //$NON-NLS-1$
}
connectorBindingId = bindings.get(0);
Assertion.isNotNull(connectorBindingId, "could not obtain connector id"); //$NON-NLS-1$
}
aqr.setConnectorName(connectorBindingId);
return aqr;
}