}
// Extract the stuff we need to figure out whether this guy belongs at our site
// We don't need to create a StoredProcedureInvocation anymore in order to
// extract out the data that we need in this request
final FastDeserializer incomingDeserializer = this.incomingDeserializers.get();
incomingDeserializer.setBuffer(buffer);
final long client_handle = StoredProcedureInvocation.getClientHandle(buffer);
final int procId = StoredProcedureInvocation.getProcedureId(buffer);
int base_partition = StoredProcedureInvocation.getBasePartition(buffer);
if (debug.val)
LOG.debug(String.format("Raw Request: clientHandle=%d / basePartition=%d / procId=%d / procName=%s",
client_handle, base_partition,
procId, StoredProcedureInvocation.getProcedureName(incomingDeserializer)));
// Optimization: We can get the Procedure catalog handle from its procId
Procedure catalog_proc = catalogContext.getProcedureById(procId);
// Otherwise, we have to get the procedure name and do a look up with that.
if (catalog_proc == null) {
String procName = StoredProcedureInvocation.getProcedureName(incomingDeserializer);
catalog_proc = this.catalogContext.procedures.getIgnoreCase(procName);
if (catalog_proc == null) {
String msg = "Unknown procedure '" + procName + "'";
this.responseError(client_handle,
Status.ABORT_UNEXPECTED,
msg,
clientCallback,
timestamp);
return;
}
}
boolean sysproc = catalog_proc.getSystemproc();
// -------------------------------
// PARAMETERSET INITIALIZATION
// -------------------------------
// Extract just the ParameterSet from the StoredProcedureInvocation
// We will deserialize the rest of it later
ParameterSet procParams = new ParameterSet();
try {
StoredProcedureInvocation.seekToParameterSet(buffer);
incomingDeserializer.setBuffer(buffer);
procParams.readExternal(incomingDeserializer);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
assert(procParams != null) :