本文整理汇总了Java中org.voltdb.utils.VoltTableUtil.csv方法的典型用法代码示例。如果您正苦于以下问题:Java VoltTableUtil.csv方法的具体用法?Java VoltTableUtil.csv怎么用?Java VoltTableUtil.csv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.voltdb.utils.VoltTableUtil
的用法示例。
在下文中一共展示了VoltTableUtil.csv方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: formatFinalResults
import org.voltdb.utils.VoltTableUtil; //导入方法依赖的package包/类
@Override
public String formatFinalResults(BenchmarkResults br) {
if (this.stop) return (null);
VoltTable vt = new VoltTable(COLUMNS);
for (Object row[] : this.results) {
vt.addRow(row);
}
try {
FileWriter writer = new FileWriter(this.outputPath);
VoltTableUtil.csv(writer, vt, true);
writer.close();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
LOG.info("Wrote CSV table stats periodically to '" + this.outputPath.getAbsolutePath() + "'");
return (null);
}
示例2: formatFinalResults
import org.voltdb.utils.VoltTableUtil; //导入方法依赖的package包/类
@Override
public String formatFinalResults(BenchmarkResults br) {
if (this.stop) return (null);
VoltTable vt = new VoltTable(COLUMNS);
for (Object row[] : this.results) {
vt.addRow(row);
}
try {
FileWriter writer = new FileWriter(this.outputPath);
VoltTableUtil.csv(writer, vt, true);
writer.close();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
LOG.info("Wrote CSV results to '" + this.outputPath.getAbsolutePath() + "'");
return (null);
}
示例3: formatFinalResults
import org.voltdb.utils.VoltTableUtil; //导入方法依赖的package包/类
@Override
public String formatFinalResults(BenchmarkResults br) {
if (this.stop) return (null);
VoltTable vt = new VoltTable(this.columns);
for (Object row[] : this.results) {
vt.addRow(row);
}
try {
FileWriter writer = new FileWriter(this.outputPath);
VoltTableUtil.csv(writer, vt, true);
writer.close();
} catch (IOException ex) {
throw new RuntimeException(ex);
}
LOG.info("Wrote CSV memory stats to '" + this.outputPath.getAbsolutePath() + "'");
return (null);
}
示例4: formatResult
import org.voltdb.utils.VoltTableUtil; //导入方法依赖的package包/类
private String formatResult(ClientResponse cr) {
final VoltTable results[] = cr.getResults();
final int num_results = results.length;
StringBuilder sb = new StringBuilder();
if (this.enable_debug) {
sb.append(cr.toString());
}
else {
// MAIN BODY
if (this.enable_csv) {
StringWriter out = new StringWriter();
for (int i = 0; i < num_results; i++) {
if (i > 0) out.write("\n\n");
VoltTableUtil.csv(out, results[i], true);
} // FOR
sb.append(out.toString());
} else {
sb.append(VoltTableUtil.format(results));
}
// FOOTER
String footer = "";
if (this.enable_csv == false) {
if (num_results == 1) {
int row_count = results[0].getRowCount();
footer = String.format("%d row%s in set", row_count, (row_count > 1 ? "s" : ""));
}
else if (num_results == 0) {
footer = "No results returned";
}
else {
footer = num_results + " tables returned";
}
sb.append(String.format("\n%s (%.2f sec)\n", footer, (cr.getClientRoundtrip() / 1000d)));
}
}
return (sb.toString());
}