voltDB探索工具
来源:互联网 发布:js浏览器定位 编辑:程序博客网 时间:2024/06/06 17:07
package org.voltdb.regressionsuites;import java.io.IOException;import org.voltdb.BackendTarget;import org.voltdb.client.Client;import org.voltdb.client.ClientResponse;import org.voltdb.compiler.VoltProjectBuilder;public class TestByTestSuite extends RegressionSuite { public TestByTestSuite(String name) { super(name); } static private String generateSchema() { StringBuilder sb = new StringBuilder(); sb.append("CREATE TABLE testtable0 (id integer not null primary key," + "name0 varchar(100));" + "partition table testtable0 on column id;"); return sb.toString(); } public static void main(String[] args) throws IOException { String simpleSchema = "CREATE TABLE testtable0 (id integer not null primary key," + "name0 varchar(100));" + "partition table testtable0 on column id;"; VoltProjectBuilder builder = new VoltProjectBuilder(); builder.addLiteralSchema(simpleSchema); LocalCluster cluster = new LocalCluster("crash.jar", 1, 2, 0, BackendTarget.HSQLDB_BACKEND); cluster.setHasLocalServer(true); boolean success = cluster.compile(builder); assert (success); cluster.startUp(true); } static public junit.framework.Test suite() { VoltServerConfig config = null; final MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder( TestByTestSuite.class); final VoltProjectBuilder project = new VoltProjectBuilder(); try { project.addLiteralSchema(generateSchema()); } catch (IOException error) { fail(error.getMessage()); } boolean success; config = new LocalCluster("iisf-hsql.jar", 2, 2, 0, BackendTarget.HSQLDB_BACKEND); success = config.compile(project); assert (success); builder.addServerConfig(config); return builder; } private static void clearTables(Client client) throws Exception { ClientResponse resp = client.callProcedure("@AdHoc", "delete from testtable0"); assertEquals(ClientResponse.SUCCESS, resp.getStatus()); } private static void initializeTables(Client client) throws Exception { ClientResponse resp = null; clearTables(client); for (int i = 0; i < 10; i++) { resp = client .callProcedure("@AdHoc", "insert into testtable0 values(" + i + ",'aaaaa" + i + "')"); // resp = client.callProcedure("testtable0.insert", i, "aaaaa" + i); assertEquals(ClientResponse.SUCCESS, resp.getStatus()); } } public void test0() throws Exception { final Client client = getClient(); initializeTables(client); }}
0 0
- voltDB探索工具
- voltDB简介
- VoltDB架构
- VoltDB概念
- voltDB性能
- voltDB链接
- VoltDB 简介
- VoltDB介绍
- VoltDB 实战
- Linux awk 工具探索
- 自我探索工具
- 探索EDA工具
- Linux awk 工具探索(转)
- Linux awk 工具探索(转)
- 2.内核探索工具集
- Android原型设计工具探索
- 探索 DDS 和 EDA 工具
- 分布式内存数据库--Voltdb
- Android 人脸特征点检测(主动形状模型) ASM Demo (Active Shape Model on Android)
- hdu 4741——Save Labman No.004
- android的消息处理机制(图+源码分析)——Looper,Handler,Message
- window.location.href后面的url带多个参数
- LeetCode—— Binary Tree Traversal
- voltDB探索工具
- Java设计模式(一) 之 详解单例模式
- Codeforces Round #280 (Div. 2) D. Vanya and Computer Game 数学+预处理
- Android INSTALL_FAILED_UID_CHANGED
- ATL/COM----IDL和MIDL之详解
- iphone的系统信息使用[UIDevice currentDevice]
- hdu5305Friends dfs
- mysql进阶(四)mysql中select
- HttpUtil的小错误