Search in sources :

Example 16 with TPCCProjectBuilder

use of org.voltdb.benchmark.tpcc.TPCCProjectBuilder in project voltdb by VoltDB.

the class TestExecutionEngine method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    VoltDB.instance().readBuildInfo("Test");
    sourceEngine = new ExecutionEngineJNI(CLUSTER_ID, NODE_ID, 0, 0, "", 0, 64 * 1024, 100, new HashinatorConfig(HashinatorType.LEGACY, LegacyHashinator.getConfigureBytes(1), 0, 0), false);
    m_project = new TPCCProjectBuilder();
    m_catalog = m_project.createTPCCSchemaCatalog();
}
Also used : HashinatorConfig(org.voltdb.TheHashinator.HashinatorConfig) TPCCProjectBuilder(org.voltdb.benchmark.tpcc.TPCCProjectBuilder)

Example 17 with TPCCProjectBuilder

use of org.voltdb.benchmark.tpcc.TPCCProjectBuilder in project voltdb by VoltDB.

the class TestCatalogUpdateAutoUpgradeSuite method suite.

public static Test suite() throws Exception {
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestCatalogUpdateAutoUpgradeSuite.class);
    TPCCProjectBuilder project = new TPCCProjectBuilder();
    project.addDefaultSchema();
    // Add an import of an exact class match here to trigger ENG-6611 on auto-catalog-recompile
    project.addLiteralSchema("import class org.voltdb_testprocs.fullddlfeatures.NoMeaningClass;");
    project.addDefaultPartitioning();
    project.addProcedures(BASEPROCS);
    upgradeCatalogBasePath = Configuration.getPathToCatalogForTest("catalogupdate-for-upgrade");
    upgradeCatalogXMLPath = upgradeCatalogBasePath + ".xml";
    upgradeCatalogJarPath = upgradeCatalogBasePath + ".jar";
    HashMap<String, String> env = new HashMap<String, String>();
    // If we are doing something special with a stored procedure it will be on HostId 0
    env.put("__VOLTDB_TARGET_CLUSTER_HOSTID__", "0");
    LocalCluster config = new LocalCluster("catalogupdate-for-upgrade.jar", SITES_PER_HOST, HOSTS, K, BackendTarget.NATIVE_EE_JNI, env);
    boolean compile = config.compile(project);
    assertTrue(compile);
    config.setHasLocalServer(false);
    builder.addServerConfig(config);
    MiscUtils.copyFile(project.getPathToDeployment(), upgradeCatalogXMLPath);
    return builder;
}
Also used : HashMap(java.util.HashMap) TPCCProjectBuilder(org.voltdb.benchmark.tpcc.TPCCProjectBuilder)

Example 18 with TPCCProjectBuilder

use of org.voltdb.benchmark.tpcc.TPCCProjectBuilder in project voltdb by VoltDB.

the class TPCCServer method main.

public static void main(String[] args) throws InterruptedException {
    VoltDB.Configuration config = new VoltDB.Configuration();
    config.setPathToCatalogForTest("tpcc.jar");
    int partitions = 1;
    boolean doCompile = true;
    if (args.length > 3) {
        System.err.println("TPCCServer [partitions=1] [compile=true]");
        System.exit(1);
    }
    if (args.length >= 1) {
        partitions = Integer.parseInt(args[0]);
    }
    if (args.length >= 2) {
        doCompile = args[1].equals("true");
    }
    if (doCompile) {
        TPCCProjectBuilder project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultProcedures();
        project.addDefaultPartitioning();
        project.setCompilerDebugPrintStream(System.out);
        if (!project.compile(config.m_pathToCatalog, partitions, 0)) {
            System.out.println("Compilation failed");
            System.exit(-1);
        }
    }
    VoltDB.initialize(config);
    VoltDB.instance().run();
}
Also used : TPCCProjectBuilder(org.voltdb.benchmark.tpcc.TPCCProjectBuilder)

Example 19 with TPCCProjectBuilder

use of org.voltdb.benchmark.tpcc.TPCCProjectBuilder in project voltdb by VoltDB.

the class TestPlannerTool method testSimple.

public void testSimple() throws IOException {
    TPCCProjectBuilder builder = new TPCCProjectBuilder();
    builder.addAllDefaults();
    final File jar = new File("tpcc-oop.jar");
    jar.deleteOnExit();
    //long start = System.nanoTime();
    //for (int i = 0; i < 10000; i++) {
    builder.compile("tpcc-oop.jar");
    /*    long end = System.nanoTime();
            System.err.printf("Took %.3f seconds to compile.\n",
                    (end - start) / 1000000000.0);
            start = end;
        }*/
    byte[] bytes = MiscUtils.fileToBytes(new File("tpcc-oop.jar"));
    String serializedCatalog = CatalogUtil.getSerializedCatalogStringFromJar(CatalogUtil.loadAndUpgradeCatalogFromJar(bytes, false).getFirst());
    Catalog catalog = new Catalog();
    catalog.execute(serializedCatalog);
    DbSettings settings = new DbSettings(ClusterSettings.create().asSupplier(), NodeSettings.create());
    CatalogContext context = new CatalogContext(0, 0, catalog, settings, bytes, null, new byte[] {}, 0, mock(HostMessenger.class));
    m_pt = new PlannerTool(context.database, context.getCatalogHash());
    AdHocPlannedStatement result = null;
    result = m_pt.planSqlForTest("select * from warehouse;");
    System.out.println(result);
    // try many tables joins
    try {
        result = m_pt.planSqlForTest("select * from WAREHOUSE, DISTRICT, CUSTOMER, CUSTOMER_NAME, HISTORY, STOCK, ORDERS, NEW_ORDER, ORDER_LINE where " + "WAREHOUSE.W_ID = DISTRICT.D_W_ID and " + "WAREHOUSE.W_ID = CUSTOMER.C_W_ID and " + "WAREHOUSE.W_ID = CUSTOMER_NAME.C_W_ID and " + "WAREHOUSE.W_ID = HISTORY.H_W_ID and " + "WAREHOUSE.W_ID = STOCK.S_W_ID and " + "WAREHOUSE.W_ID = ORDERS.O_W_ID and " + "WAREHOUSE.W_ID = NEW_ORDER.NO_W_ID and " + "WAREHOUSE.W_ID = ORDER_LINE.OL_W_ID and " + "WAREHOUSE.W_ID = 0");
    } catch (Exception e) {
        // V4.5 supports multiple table joins
        fail();
    }
    // try just the right amount of tables
    try {
        result = m_pt.planSqlForTest("select * from CUSTOMER, STOCK, ORDERS, ORDER_LINE, NEW_ORDER where " + "CUSTOMER.C_W_ID = CUSTOMER.C_W_ID and " + "CUSTOMER.C_W_ID = STOCK.S_W_ID and " + "CUSTOMER.C_W_ID = ORDERS.O_W_ID and " + "CUSTOMER.C_W_ID = ORDER_LINE.OL_W_ID and " + "CUSTOMER.C_W_ID = NEW_ORDER.NO_W_ID and " + "CUSTOMER.C_W_ID = 0");
    } catch (Exception e) {
        e.printStackTrace();
        fail();
    }
    // try garbage
    try {
        result = m_pt.planSqlForTest("ryan likes the yankees");
        fail();
    } catch (Exception e) {
    }
    try {
        Thread.sleep(500);
    } catch (InterruptedException e1) {
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
    try {
        result = m_pt.planSqlForTest("ryan likes the yankees");
        fail();
    } catch (Exception e) {
    }
    result = m_pt.planSqlForTest("select * from warehouse;");
    System.out.println(result);
}
Also used : DbSettings(org.voltdb.settings.DbSettings) PlannerTool(org.voltdb.compiler.PlannerTool) AdHocPlannedStatement(org.voltdb.compiler.AdHocPlannedStatement) HostMessenger(org.voltcore.messaging.HostMessenger) TPCCProjectBuilder(org.voltdb.benchmark.tpcc.TPCCProjectBuilder) File(java.io.File) Catalog(org.voltdb.catalog.Catalog) CatalogContext(org.voltdb.CatalogContext) IOException(java.io.IOException)

Example 20 with TPCCProjectBuilder

use of org.voltdb.benchmark.tpcc.TPCCProjectBuilder in project voltdb by VoltDB.

the class TestPasswordMaskSuite method suite.

/**
     * Build a list of the tests that will be run when TestSecuritySuite gets run by JUnit.
     * Use helper classes that are part of the RegressionSuite framework.
     * This particular class runs all tests on the the local JNI backend with both
     * one and two partition configurations, as well as on the hsql backend.
     *
     * @return The TestSuite containing all the tests to be run.
     */
public static Test suite() {
    VoltServerConfig config = null;
    // the suite made here will all be using the tests from this class
    MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestPasswordMaskSuite.class);
    // build up a project builder for the workload
    TPCCProjectBuilder project = new TPCCProjectBuilder();
    project.addDefaultSchema();
    project.addDefaultPartitioning();
    UserInfo[] users = new UserInfo[] { new UserInfo("admin", "D033E22AE348AEB5660FC2140AEC35850C4DA9978C6976E5B5410415BDE908BD4DEE15DFB167A9C873FC4BB8A81F6F2AB448A918", new String[] { "administrator" }, false) };
    project.addUsers(users);
    // suite defines its own ADMINISTRATOR user
    project.setSecurityEnabled(true, false);
    /////////////////////////////////////////////////////////////
    // CONFIG #1: 1 Local Site/Partitions running on JNI backend
    /////////////////////////////////////////////////////////////
    // get a server config for the native backend with one sites/partitions
    config = new LocalCluster("passwordmask-onesite.jar", 1, 1, 0, BackendTarget.NATIVE_EE_JNI);
    // build the jarfile
    if (!config.compile(project))
        fail();
    // add this config to the set of tests to run
    builder.addServerConfig(config);
    return builder;
}
Also used : UserInfo(org.voltdb.compiler.VoltProjectBuilder.UserInfo) TPCCProjectBuilder(org.voltdb.benchmark.tpcc.TPCCProjectBuilder)

Aggregations

TPCCProjectBuilder (org.voltdb.benchmark.tpcc.TPCCProjectBuilder)23 File (java.io.File)6 Catalog (org.voltdb.catalog.Catalog)4 UserInfo (org.voltdb.compiler.VoltProjectBuilder.UserInfo)4 IOException (java.io.IOException)3 HashinatorConfig (org.voltdb.TheHashinator.HashinatorConfig)3 RoleInfo (org.voltdb.compiler.VoltProjectBuilder.RoleInfo)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 ServerThread (org.voltdb.ServerThread)2 Procedure (org.voltdb.catalog.Procedure)2 Client (org.voltdb.client.Client)2 ClientConfig (org.voltdb.client.ClientConfig)2 ProcedureInfo (org.voltdb.compiler.VoltProjectBuilder.ProcedureInfo)2 InMemoryJarfile (org.voltdb.utils.InMemoryJarfile)2 Date (java.util.Date)1 Properties (java.util.Properties)1 Callable (java.util.concurrent.Callable)1 CyclicBarrier (java.util.concurrent.CyclicBarrier)1 ExecutorService (java.util.concurrent.ExecutorService)1