Package org.voltdb.benchmark.tpcc

Examples of org.voltdb.benchmark.tpcc.TPCCProjectBuilder


        }
    }

    public void testAutoUpgradeWithGroovyProc() throws Exception
    {
        TPCCProjectBuilder project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        project.addDefaultProcedures();

        String testDir = BuildDirectoryUtils.getBuildDirectoryPath();
        String jarName = "compile-deployment.jar";
        String catalogJar = testDir + File.separator + jarName;
        assertTrue("Project failed to compile", project.compile(catalogJar));

        // Load the catalog to an in-memory jar and tweak the version.
        byte[] bytes = MiscUtils.fileToBytes(new File(catalogJar));
        InMemoryJarfile memCatalog = CatalogUpgradeTools.loadCatalog(bytes, false);
        CatalogUpgradeTools.dorkVersion(memCatalog);
View Full Code Here


    };

    public static void main(String[] args) throws Exception {
        int siteCount = 1;

        TPCCProjectBuilder pb = new TPCCProjectBuilder();
        pb.addDefaultSchema();
        pb.addDefaultPartitioning();
        pb.addProcedures(EmptyProcedure.class, MultivariateEmptyProcedure.class);

        pb.compile("procedureCallMicrobench.jar", siteCount, 0);

        ServerThread server = new ServerThread("procedureCallMicrobench.jar",
                BackendTarget.NATIVE_EE_JNI);
        server.start();
        server.waitForInitialization();
View Full Code Here

        }
    }

    public void testNullAnnotation() throws IOException {

        Catalog catalog  = new TPCCProjectBuilder().createTPCCSchemaCatalog();
        Database catalog_db = catalog.getClusters().get("cluster").getDatabases().get("database");

        for(Table t : catalog_db.getTables()) {
            assertNotNull(((TableAnnotation)t.getAnnotation()).ddl);
        }
View Full Code Here

    // The message substring we expect to find from an upgrade failure.
    private static String UPGRADE_ERROR_MESSAGE_SUBSTRING = "Catalog upgrade failed";

    public void testCatalogAutoUpgrade() throws Exception
    {
        TPCCProjectBuilder project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        project.addDefaultProcedures();

        String testDir = BuildDirectoryUtils.getBuildDirectoryPath();
        String jarName = "compile-deployment.jar";
        String catalogJar = testDir + File.separator + jarName;
        assertTrue("Project failed to compile", project.compile(catalogJar));

        // Load the catalog to an in-memory jar and tweak the version.
        byte[] bytes = MiscUtils.fileToBytes(new File(catalogJar));
        InMemoryJarfile memCatalog = CatalogUpgradeTools.loadCatalog(bytes, false);
        CatalogUpgradeTools.dorkVersion(memCatalog);
View Full Code Here

    static public Test suite() {
        // the suite made here will all be using the tests from this class
        MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestMaliciousClientSuite.class);

        // build up a project builder for the workload
        TPCCProjectBuilder project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        project.addProcedures(PROCEDURES);

        boolean success;

        /////////////////////////////////////////////////////////////
        // CONFIG #1: 1 Local Site/Partitions running on JNI backend
View Full Code Here

                new VoltTable.ColumnInfo("I_IM_ID", VoltType.INTEGER),
                new VoltTable.ColumnInfo("I_NAME", VoltType.STRING),
                new VoltTable.ColumnInfo("I_PRICE", VoltType.FLOAT),
                new VoltTable.ColumnInfo("I_DATA", VoltType.STRING)
                );
        TPCCProjectBuilder builder = new TPCCProjectBuilder();
        m_catalog = builder.createTPCCSchemaCatalog();
        Cluster cluster = m_catalog.getClusters().get("cluster");
        WAREHOUSE_TABLEID = m_catalog.getClusters().get("cluster").getDatabases().
                get("database").getTables().get("WAREHOUSE").getRelativeIndex();
        ITEM_TABLEID = m_catalog.getClusters().get("cluster").getDatabases().
                get("database").getTables().get("ITEM").getRelativeIndex();
View Full Code Here

public class TestPlannerTool extends TestCase {

    PlannerTool m_pt = null;

    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;
        }*/
 
View Full Code Here

        // Catalog upgrade test(s) sporadically fail if there's a local server because
        // a file pipe isn't available for grepping local server output.
        ((LocalCluster) config).setHasLocalServer(true);

        // build up a project builder for the workload
        TPCCProjectBuilder project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        project.addProcedures(BASEPROCS);
        // build the jarfile
        boolean basecompile = config.compile(project);
        assertTrue(basecompile);
        MiscUtils.copyFile(project.getPathToDeployment(), Configuration.getPathToCatalogForTest("catalogupdate-cluster-base.xml"));

        // add this config to the set of tests to run
        builder.addServerConfig(config);

        /////////////////////////////////////////////////////////////
        // DELTA CATALOGS FOR TESTING
        /////////////////////////////////////////////////////////////

        // Generate a catalog that adds a table and a deployment file that changes the dead host timeout.
        config = new LocalCluster("catalogupdate-cluster-addtable.jar", SITES_PER_HOST, HOSTS, K, BackendTarget.NATIVE_EE_JNI);
        project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        project.addLiteralSchema("CREATE TABLE NEWTABLE (A1 INTEGER, PRIMARY KEY (A1));");
        project.setDeadHostTimeout(6);
        boolean compile = config.compile(project);
        assertTrue(compile);
        MiscUtils.copyFile(project.getPathToDeployment(), Configuration.getPathToCatalogForTest("catalogupdate-cluster-addtable.xml"));

        // A catalog change that enables snapshots
        config = new LocalCluster("catalogupdate-cluster-enable_snapshot.jar", SITES_PER_HOST, HOSTS, K, BackendTarget.NATIVE_EE_JNI);
        project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        project.addProcedures(BASEPROCS);
        project.setSnapshotSettings( "1s", 3, "/tmp/snapshotdir1", "foo1");
        // build the jarfile
        compile = config.compile(project);
        assertTrue(compile);
        MiscUtils.copyFile(project.getPathToDeployment(), Configuration.getPathToCatalogForTest("catalogupdate-cluster-enable_snapshot.xml"));

        //Another catalog change to modify the schedule
        config = new LocalCluster("catalogupdate-cluster-change_snapshot.jar", SITES_PER_HOST, HOSTS, K, BackendTarget.NATIVE_EE_JNI);
        project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        project.addProcedures(BASEPROCS);
        project.setSnapshotSettings( "1s", 3, "/tmp/snapshotdir2", "foo2");
        // build the jarfile
        compile = config.compile(project);
        assertTrue(compile);
        MiscUtils.copyFile(project.getPathToDeployment(), Configuration.getPathToCatalogForTest("catalogupdate-cluster-change_snapshot.xml"));

        //Another catalog change to modify the schedule
        config = new LocalCluster("catalogupdate-cluster-change_snapshot_dir_not_exist.jar", SITES_PER_HOST, HOSTS, K, BackendTarget.NATIVE_EE_JNI);
        project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        project.addProcedures(BASEPROCS);
        project.setSnapshotSettings( "1s", 3, "/tmp/snapshotdirasda2", "foo2");
        // build the jarfile
        compile = config.compile(project);
        assertTrue(compile);
        MiscUtils.copyFile(project.getPathToDeployment(), Configuration.getPathToCatalogForTest("catalogupdate-cluster-change_snapshot_dir_not_exist.xml"));

        // A deployment change that changes the schema change mechanism
        config = new LocalCluster("catalogupdate-cluster-change_schema_update.jar", SITES_PER_HOST, HOSTS, K, BackendTarget.NATIVE_EE_JNI);
        project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        project.addProcedures(BASEPROCS);
        project.setUseDDLSchema(true);
        // build the jarfile
        compile = config.compile(project);
        assertTrue(compile);
        MiscUtils.copyFile(project.getPathToDeployment(), Configuration.getPathToCatalogForTest("catalogupdate-cluster-change_schema_update.xml"));

        // A deployment change that changes the schema change mechanism
        config = new LocalCluster("catalogupdate-security-no-users.jar", SITES_PER_HOST, HOSTS, K, BackendTarget.NATIVE_EE_JNI);
        project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        project.addProcedures(BASEPROCS);
        project.setSecurityEnabled(true);
        // build the jarfile
        compile = config.compile(project);
        assertTrue(compile);
        MiscUtils.copyFile(project.getPathToDeployment(), Configuration.getPathToCatalogForTest("catalogupdate-security-no-users.xml"));

        return builder;
    }
View Full Code Here

        // the suite made here will all be using the tests from this class
        MultiConfigSuiteBuilder builder = new MultiConfigSuiteBuilder(TestSecuritySuite.class);

        // build up a project builder for the workload
        TPCCProjectBuilder project = new TPCCProjectBuilder();
        project.addDefaultSchema();
        project.addDefaultPartitioning();
        ArrayList<ProcedureInfo> procedures = new ArrayList<ProcedureInfo>();
        procedures.add(new ProcedureInfo(new String[0], PROCEDURES[0]));
        procedures.add(new ProcedureInfo(new String[] {"group1"}, PROCEDURES[1]));
        procedures.add(new ProcedureInfo(new String[] {"group1", "group2"}, PROCEDURES[2]));
        project.addProcedures(procedures);

        UserInfo users[] = new UserInfo[] {
                new UserInfo("user1", "password", new String[] {"grouP1"}),
                new UserInfo("user2", "password", new String[] {"grouP2"}),
                new UserInfo("user3", "password", new String[] {"grouP3"}),
                new UserInfo("user4", "password", new String[] {"AdMINISTRATOR"}),
                new UserInfo("userWithDefaultUserPerm", "password", new String[] {"User"}),
                new UserInfo("userWithAllProc", "password", new String[] {"GroupWithAllProcPerm"}),
                new UserInfo("userWithDefaultProcPerm", "password", new String[] {"groupWithDefaultProcPerm"}),
                new UserInfo("userWithoutDefaultProcPerm", "password", new String[] {"groupWiThoutDefaultProcPerm"}),
                new UserInfo("userWithDefaultProcReadPerm", "password", new String[] {"groupWiThDefaultProcReadPerm"})
        };
        project.addUsers(users);

        GroupInfo groups[] = new GroupInfo[] {
                new GroupInfo("Group1", false, false, false, false, false, false),
                new GroupInfo("Group2", true, false, false, false, false, false),
                new GroupInfo("Group3", true, false, false, false, false, false),
                new GroupInfo("GroupWithDefaultUserPerm", true, false, false, false, false, true),
                new GroupInfo("GroupWithAllProcPerm", false, false, false, false, false, true),
                new GroupInfo("GroupWithDefaultProcPerm", false, false, false, true, false, false),
                new GroupInfo("GroupWithoutDefaultProcPerm", false, false, false, false, false, false),
                new GroupInfo("GroupWithDefaultProcReadPerm", false, false, false, false, true, false)
        };
        project.addGroups(groups);
        project.setSecurityEnabled(true);

        // export disabled in community
        if (MiscUtils.isPro()) {
            project.addExport(true /*enabled*/);
        }

        /////////////////////////////////////////////////////////////
        // CONFIG #1: 1 Local Site/Partitions running on JNI backend
        /////////////////////////////////////////////////////////////
View Full Code Here

    }

    static public 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;
    }
View Full Code Here

TOP

Related Classes of org.voltdb.benchmark.tpcc.TPCCProjectBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.