// Run the benchmark for the requested duration.
System.out.println("\n\nInserting into table " + systemStr + " materialized view...\n");
if (config.group > 0) {
for (int i=0; i<config.txn; i++){
client.callProcedure(new NullCallback(),
procStr + "_insert",
i,
grp,
i);
if (grp == config.group) {
grp = 1;
} else {
grp++;
}
}
} else {
for (int i=0; i<config.txn; i++){
client.callProcedure(new NullCallback(),
procStr + "_insert",
i,
i,
i);
}
}
timer.cancel();
client.drain();
if ((config.statsfile == null) || (config.statsfile.length() == 0)) {
printResults(procStr + "_insert");
} else {
printResults(procStr + "_insert", fw, "Insert " + csvStr + " MV");
}
System.out.print(HORIZONTAL_RULE);
if (!matView.equals("minMatView")) {
// grp is initialized to 2 for updating the grouping column to (grouping column = grouping column + 1)
grp = 2;
fullStatsContext.fetchAndResetBaseline();
periodicStatsContext.fetchAndResetBaseline();
benchmarkStartTS = System.currentTimeMillis();
schedulePeriodicStats();
System.out.println("\n\nUpdating grouping column in table " + systemStr + " materialized view...\n");
if (config.group > 0) {
for (int i=0; i<config.txn; i++){
client.callProcedure(new NullCallback(),
procStr + "_group_id_update",
grp,
i);
if (grp == (config.group + 1)) {
grp = 2;
} else {
grp++;
}
}
} else {
for (int i=0; i<config.txn; i++){
client.callProcedure(new NullCallback(),
procStr + "_group_id_update",
(i + 1),
i);
}
}
timer.cancel();
client.drain();
if ((config.statsfile == null) || (config.statsfile.length() == 0)) {
printResults(procStr + "_group_id_update");
} else {
printResults(procStr + "_group_id_update", fw, "Update Grp " + csvStr + " MV");
}
System.out.print(HORIZONTAL_RULE);
fullStatsContext.fetchAndResetBaseline();
periodicStatsContext.fetchAndResetBaseline();
benchmarkStartTS = System.currentTimeMillis();
schedulePeriodicStats();
System.out.println("\n\nUpdating aggregated column in table " + systemStr + " materialized view...\n");
for (int i=0; i<config.txn; i++){
client.callProcedure(new NullCallback(),
procStr + "_value_update",
(i + 1),
i);
}
timer.cancel();
client.drain();
if ((config.statsfile == null) || (config.statsfile.length() == 0)) {
printResults(procStr + "_value_update");
} else {
printResults(procStr + "_value_update", fw, "Update Sum " + csvStr + " MV");
}
System.out.print(HORIZONTAL_RULE);
}
fullStatsContext.fetchAndResetBaseline();
periodicStatsContext.fetchAndResetBaseline();
benchmarkStartTS = System.currentTimeMillis();
schedulePeriodicStats();
System.out.println("\n\nDeleting from table " + systemStr + " materialized view...\n");
for (int i=0; i<config.txn; i++){
client.callProcedure(new NullCallback(),
procStr + "_delete",
i);
}
timer.cancel();
client.drain();