Search in sources :

Example 21 with Cluster

use of org.voltdb.catalog.Cluster in project voltdb by VoltDB.

the class TestCatalogUtil method testClusterSchemaSetting.

public void testClusterSchemaSetting() throws Exception {
    final String defSchema = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + "<deployment>" + "   <cluster hostcount='3' kfactor='1' sitesperhost='2'/>" + "</deployment>";
    final String catalogSchema = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + "<deployment>" + "   <cluster hostcount='3' kfactor='1' sitesperhost='2' schema='catalog'/>" + "</deployment>";
    final String adhocSchema = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + "<deployment>" + "   <cluster hostcount='3' kfactor='1' sitesperhost='2' schema='ddl'/>" + "</deployment>";
    final File tmpDefSchema = VoltProjectBuilder.writeStringToTempFile(defSchema);
    CatalogUtil.compileDeployment(catalog, tmpDefSchema.getPath(), false);
    Cluster cluster = catalog.getClusters().get("cluster");
    assertTrue(cluster.getUseddlschema());
    setUp();
    final File tmpCatalogSchema = VoltProjectBuilder.writeStringToTempFile(catalogSchema);
    CatalogUtil.compileDeployment(catalog, tmpCatalogSchema.getPath(), false);
    cluster = catalog.getClusters().get("cluster");
    assertFalse(cluster.getUseddlschema());
    setUp();
    final File tmpAdhocSchema = VoltProjectBuilder.writeStringToTempFile(adhocSchema);
    CatalogUtil.compileDeployment(catalog, tmpAdhocSchema.getPath(), false);
    cluster = catalog.getClusters().get("cluster");
    assertTrue(cluster.getUseddlschema());
}
Also used : Cluster(org.voltdb.catalog.Cluster) File(java.io.File)

Aggregations

Cluster (org.voltdb.catalog.Cluster)21 Database (org.voltdb.catalog.Database)10 File (java.io.File)9 IOException (java.io.IOException)4 Catalog (org.voltdb.catalog.Catalog)4 Constraint (org.voltdb.catalog.Constraint)4 VoltTable (org.voltdb.VoltTable)3 Table (org.voltdb.catalog.Table)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 ArrayList (java.util.ArrayList)2 Connector (org.voltdb.catalog.Connector)2 Procedure (org.voltdb.catalog.Procedure)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 FileWriter (java.io.FileWriter)1 SocketException (java.net.SocketException)1 URL (java.net.URL)1 DateFormat (java.text.DateFormat)1 Date (java.util.Date)1 Properties (java.util.Properties)1