Permalink
Browse files

fixed bugs calling sysproc

  • Loading branch information...
Rebecca Taft
Rebecca Taft committed Apr 16, 2014
1 parent a5b93db commit bd4fe0938006afeee0c52b194caa289fb1849364
@@ -109,7 +109,7 @@
public String procName;
public int procStartTime;
public Object[] params;
public String[] params;
public final Map<String, String> clientParameters = new TreeMap<String, String>();
public final Map<String, String> siteParameters = new TreeMap<String, String>();
@@ -232,7 +232,7 @@ public BenchmarkConfig(
String dumpDatabaseDir,
String procName,
int procStartTime,
Object[] params
String[] params
) {
this.projectBuilderClass = benchmarkClient;
@@ -120,6 +120,7 @@
import edu.brown.catalog.CatalogUtil;
import edu.brown.hstore.HStoreConstants;
import edu.brown.hstore.HStoreThreadManager;
import edu.brown.hstore.VoltProcedureInvoker;
import edu.brown.hstore.Hstoreservice.Status;
import edu.brown.hstore.conf.HStoreConf;
import edu.brown.logging.LoggerUtil;
@@ -280,9 +281,9 @@ public void update(EventObservable<String> o, String msg) {
public final int waitTime;
public final Client client;
public final String procName;
public final Object[] params;
public final String[] params;
public RunSysProc(int waitTime, Client client, String procName, Object[] params) {
public RunSysProc(int waitTime, Client client, String procName, String[] params) {
this.waitTime = waitTime;
this.client = client;
this.procName = procName;
@@ -306,9 +307,10 @@ public void run() {
// run sysproc
ClientResponse cr = null;
try {
cr = client.callProcedure(procName, params);
} catch (Exception ex) {
LOG.error("Failed to execute sysproc " + procName, ex);
cr = VoltProcedureInvoker.invoke(getCatalog(), client, procName, params);
}
catch(Exception ex) {
LOG.error("Failed to execute sysproc " + procName, ex);
}
if(cr != null) {
@@ -1253,9 +1255,9 @@ public void runBenchmark() throws Exception {
//
if(m_config.procName != null) {
Object[] params = m_config.params;
String[] params = m_config.params;
if(params == null) {
params = new Object[]{};
params = new String[]{};
}
RunSysProc runSysProc = new RunSysProc(m_config.procStartTime, local_client, m_config.procName, params);
runSysProc.start();
@@ -1850,7 +1852,7 @@ public static void main(final String[] vargs) throws Exception {
String dumpDatabaseDir = null;
String procName = null;
Object[] params = null;
String[] params = null;
int procStartTime = 0;
// List of SiteIds that we won't start because they'll be started by the profiler
@@ -2097,10 +2099,10 @@ else if (parts[0].equalsIgnoreCase("NOSITES") || parts[0].equalsIgnoreCase("NOST
} else if (parts[0].equalsIgnoreCase("PROCSTARTTIME")) {
procStartTime = Integer.parseInt(parts[1]);
} else if (parts[0].equalsIgnoreCase("PARAMS")) {
params = new Object[]{ parts[1] };
params = new String[]{ parts[1] };
} else if (parts[0].matches("(?i)PARAM[0-9]")) {
if(params == null) {
params = new Object[10];
params = new String[10];
}
int paramIndex = Integer.parseInt(parts[0].substring(5));
params[paramIndex] = parts[1];
@@ -2113,13 +2115,13 @@ else if (parts[0].equalsIgnoreCase("NOSITES") || parts[0].equalsIgnoreCase("NOST
}
if(params != null) {
ArrayList<Object> paramsList = new ArrayList<Object>();
for(Object param : params) {
ArrayList<String> paramsList = new ArrayList<String>();
for(String param : params) {
if(param != null) {
paramsList.add(param);
}
}
params = paramsList.toArray();
params = paramsList.toArray(new String[]{});
}
// Initialize HStoreConf

0 comments on commit bd4fe09

Please sign in to comment.