}
// Convert parameters to the proper type
Object parameters[] = new Object[expectedParams];
for (int i = 0; i < expectedParams; i++) {
ProcParameter catalog_param = catalog_proc.getParameters().get(i);
assert(catalog_param != null) : String.format("Null %s parameter at %d", catalog_proc.getName(), i);
VoltType vt = VoltType.get(catalog_param.getType());
try {
// Split into array
if (catalog_param.getIsarray()) {
List<String> arr = (List<String>)CollectionUtil.addAll(new ArrayList<String>(),
params[i].split(","));
Object inner[] = new Object[arr.size()];
for (int ii = 0, cnt = arr.size(); ii < cnt; ii++) {
inner[ii] = VoltTypeUtil.getObjectFromString(vt, arr.get(ii));
} // FOR
parameters[i] = inner;
// Scalar Paramter
} else {
parameters[i] = VoltTypeUtil.getObjectFromString(vt, params[i]);
}
} catch (ParseException ex) {
LOG.error("Invalid parameter #" + i + ": " + params[i], ex);
return (null);
}
if (LOG.isDebugEnabled())
LOG.debug(String.format("%s: %s [%s / %s]", catalog_param.fullName(),
(catalog_param.getIsarray() ? Arrays.toString((Object[])parameters[i]) : parameters[i]),
vt, parameters[i].getClass()));
} // FOR
LOG.info(String.format("Invoking %s [params=%s]",
catalog_proc.getName(), Arrays.toString(parameters)));