当前位置: 首页>>代码示例>>Java>>正文


Java VoltTableUtil.csv方法代码示例

本文整理汇总了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);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:20,代码来源:TableStatsPrinter.java

示例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);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:20,代码来源:CSVResultsPrinter.java

示例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);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:20,代码来源:MemoryStatsPrinter.java

示例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());
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:40,代码来源:SStoreTerminal.java


注:本文中的org.voltdb.utils.VoltTableUtil.csv方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。