Search in sources :

Example 1 with Systemsettings

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

the class TestCatalogUtil method testSystemSettingsQueryTimeout.

public void testSystemSettingsQueryTimeout() throws Exception {
    final String depOff = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + "<deployment>" + "   <cluster hostcount='3' kfactor='1' sitesperhost='2'/>" + "   <paths><voltdbroot path=\"/tmp/" + System.getProperty("user.name") + "\" /></paths>" + "   <snapshot frequency=\"5s\" retain=\"10\" prefix=\"pref2\" enabled=\"false\"/>" + "</deployment>";
    final String depOn = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + "<deployment>" + "   <cluster hostcount='3' kfactor='1' sitesperhost='2'/>" + "   <paths><voltdbroot path=\"/tmp/" + System.getProperty("user.name") + "\" /></paths>" + "   <snapshot frequency=\"5s\" retain=\"10\" prefix=\"pref2\" enabled=\"true\"/>" + "   <systemsettings>" + "      <query timeout=\"200\"/>" + "   </systemsettings>" + "</deployment>";
    final File tmpDepOff = VoltProjectBuilder.writeStringToTempFile(depOff);
    String msg = CatalogUtil.compileDeployment(catalog, tmpDepOff.getPath(), false);
    assertTrue(msg == null);
    Systemsettings sysset = catalog.getClusters().get("cluster").getDeployment().get("deployment").getSystemsettings().get("systemsettings");
    assertEquals(10000, sysset.getQuerytimeout());
    setUp();
    final File tmpDepOn = VoltProjectBuilder.writeStringToTempFile(depOn);
    msg = CatalogUtil.compileDeployment(catalog, tmpDepOn.getPath(), false);
    assertTrue(msg == null);
    sysset = catalog.getClusters().get("cluster").getDeployment().get("deployment").getSystemsettings().get("systemsettings");
    assertEquals(200, sysset.getQuerytimeout());
}
Also used : Systemsettings(org.voltdb.catalog.Systemsettings) File(java.io.File)

Example 2 with Systemsettings

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

the class CatalogUtil method setSystemSettings.

private static void setSystemSettings(DeploymentType deployment, Deployment catDeployment) {
    // Create catalog Systemsettings
    Systemsettings syssettings = catDeployment.getSystemsettings().add("systemsettings");
    syssettings.setTemptablemaxsize(deployment.getSystemsettings().getTemptables().getMaxsize());
    syssettings.setSnapshotpriority(deployment.getSystemsettings().getSnapshot().getPriority());
    syssettings.setElasticduration(deployment.getSystemsettings().getElastic().getDuration());
    syssettings.setElasticthroughput(deployment.getSystemsettings().getElastic().getThroughput());
    syssettings.setQuerytimeout(deployment.getSystemsettings().getQuery().getTimeout());
}
Also used : Systemsettings(org.voltdb.catalog.Systemsettings)

Example 3 with Systemsettings

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

the class SystemInformation method populateDeploymentProperties.

public static VoltTable populateDeploymentProperties(Cluster cluster, Database database, ClusterSettings clusterSettings, NodeSettings nodeSettings) {
    VoltTable results = new VoltTable(clusterInfoSchema);
    // it would be awesome if these property names could come
    // from the RestApiDescription.xml (or the equivalent thereof) someday --izzy
    results.addRow("voltdbroot", VoltDB.instance().getVoltDBRootPath());
    Deployment deploy = cluster.getDeployment().get("deployment");
    results.addRow("hostcount", Integer.toString(clusterSettings.hostcount()));
    results.addRow("kfactor", Integer.toString(deploy.getKfactor()));
    results.addRow("sitesperhost", Integer.toString(nodeSettings.getLocalSitesCount()));
    String http_enabled = "false";
    int http_port = VoltDB.instance().getConfig().m_httpPort;
    if (http_port != -1 && http_port != Integer.MAX_VALUE) {
        http_enabled = "true";
        results.addRow("httpport", Integer.toString(http_port));
    }
    results.addRow("httpenabled", http_enabled);
    String json_enabled = "false";
    if (cluster.getJsonapi()) {
        json_enabled = "true";
    }
    results.addRow("jsonenabled", json_enabled);
    SnapshotSchedule snaps = database.getSnapshotschedule().get("default");
    String snap_enabled = "false";
    if (snaps != null && snaps.getEnabled()) {
        snap_enabled = "true";
        String snap_freq = Integer.toString(snaps.getFrequencyvalue()) + snaps.getFrequencyunit();
        results.addRow("snapshotpath", VoltDB.instance().getSnapshotPath());
        results.addRow("snapshotprefix", snaps.getPrefix());
        results.addRow("snapshotfrequency", snap_freq);
        results.addRow("snapshotretain", Integer.toString(snaps.getRetain()));
    }
    results.addRow("snapshotenabled", snap_enabled);
    for (Connector export_conn : database.getConnectors()) {
        if (export_conn != null && export_conn.getEnabled()) {
            results.addRow("exportoverflowpath", VoltDB.instance().getExportOverflowPath());
            break;
        }
    }
    results.addRow("export", Boolean.toString(CatalogUtil.isExportEnabled()));
    String partition_detect_enabled = "false";
    if (cluster.getNetworkpartition()) {
        partition_detect_enabled = "true";
    }
    results.addRow("partitiondetection", partition_detect_enabled);
    results.addRow("heartbeattimeout", Integer.toString(cluster.getHeartbeattimeout()));
    results.addRow("adminport", Integer.toString(VoltDB.instance().getConfig().m_adminPort));
    String command_log_enabled = "false";
    // log name is MAGIC, you knoooow
    CommandLog command_log = cluster.getLogconfig().get("log");
    if (command_log.getEnabled()) {
        command_log_enabled = "true";
        String command_log_mode = "async";
        if (command_log.getSynchronous()) {
            command_log_mode = "sync";
        }
        String command_log_path = VoltDB.instance().getCommandLogPath();
        String command_log_snaps = VoltDB.instance().getCommandLogSnapshotPath();
        String command_log_fsync_interval = Integer.toString(command_log.getFsyncinterval());
        String command_log_max_txns = Integer.toString(command_log.getMaxtxns());
        results.addRow("commandlogmode", command_log_mode);
        results.addRow("commandlogfreqtime", command_log_fsync_interval);
        results.addRow("commandlogfreqtxns", command_log_max_txns);
        results.addRow("commandlogpath", command_log_path);
        results.addRow("commandlogsnapshotpath", command_log_snaps);
    }
    results.addRow("commandlogenabled", command_log_enabled);
    String users = "";
    for (User user : database.getUsers()) {
        users += addEscapes(user.getTypeName());
        if (user.getGroups() != null && user.getGroups().size() > 0) {
            users += ":";
            for (GroupRef gref : user.getGroups()) {
                users += addEscapes(gref.getGroup().getTypeName());
                users += ",";
            }
            users = users.substring(0, users.length() - 1);
        }
        users += ";";
    }
    results.addRow("users", users);
    // Add system setting information also
    // the attribute names follows the above naming rule
    Systemsettings sysSettings = deploy.getSystemsettings().get("systemsettings");
    results.addRow("elasticduration", Integer.toString(sysSettings.getElasticduration()));
    results.addRow("elasticthroughput", Integer.toString(sysSettings.getElasticthroughput()));
    results.addRow("snapshotpriority", Integer.toString(sysSettings.getSnapshotpriority()));
    results.addRow("temptablesmaxsize", Integer.toString(sysSettings.getTemptablemaxsize()));
    results.addRow("querytimeout", Integer.toString(sysSettings.getQuerytimeout()));
    return results;
}
Also used : Connector(org.voltdb.catalog.Connector) User(org.voltdb.catalog.User) Systemsettings(org.voltdb.catalog.Systemsettings) CommandLog(org.voltdb.catalog.CommandLog) Deployment(org.voltdb.catalog.Deployment) SnapshotSchedule(org.voltdb.catalog.SnapshotSchedule) GroupRef(org.voltdb.catalog.GroupRef) VoltTable(org.voltdb.VoltTable)

Example 4 with Systemsettings

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

the class RealVoltDB method logSystemSettingFromCatalogContext.

void logSystemSettingFromCatalogContext() {
    if (m_catalogContext == null) {
        return;
    }
    Deployment deploy = m_catalogContext.cluster.getDeployment().get("deployment");
    Systemsettings sysSettings = deploy.getSystemsettings().get("systemsettings");
    if (sysSettings == null) {
        return;
    }
    hostLog.info("Elastic duration set to " + sysSettings.getElasticduration() + " milliseconds");
    hostLog.info("Elastic throughput set to " + sysSettings.getElasticthroughput() + " mb/s");
    hostLog.info("Max temptable size set to " + sysSettings.getTemptablemaxsize() + " mb");
    hostLog.info("Snapshot priority set to " + sysSettings.getSnapshotpriority() + " [0 - 10]");
    if (sysSettings.getQuerytimeout() > 0) {
        hostLog.info("Query timeout set to " + sysSettings.getQuerytimeout() + " milliseconds");
        m_config.m_queryTimeout = sysSettings.getQuerytimeout();
    } else if (sysSettings.getQuerytimeout() == 0) {
        hostLog.info("Query timeout set to unlimited");
        m_config.m_queryTimeout = 0;
    }
}
Also used : Systemsettings(org.voltdb.catalog.Systemsettings) Deployment(org.voltdb.catalog.Deployment)

Example 5 with Systemsettings

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

the class TestCatalogUtil method testSystemSettingsMaxTempTableSize.

public void testSystemSettingsMaxTempTableSize() throws Exception {
    final String depOff = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + "<deployment>" + "   <cluster hostcount='3' kfactor='1' sitesperhost='2'/>" + "   <paths><voltdbroot path=\"/tmp/" + System.getProperty("user.name") + "\" /></paths>" + "   <snapshot frequency=\"5s\" retain=\"10\" prefix=\"pref2\" enabled=\"false\"/>" + "</deployment>";
    final String depOn = "<?xml version='1.0' encoding='UTF-8' standalone='no'?>" + "<deployment>" + "   <cluster hostcount='3' kfactor='1' sitesperhost='2'/>" + "   <paths><voltdbroot path=\"/tmp/" + System.getProperty("user.name") + "\" /></paths>" + "   <snapshot frequency=\"5s\" retain=\"10\" prefix=\"pref2\" enabled=\"true\"/>" + "   <systemsettings>" + "      <temptables maxsize=\"200\"/>" + "   </systemsettings>" + "</deployment>";
    final File tmpDepOff = VoltProjectBuilder.writeStringToTempFile(depOff);
    String msg = CatalogUtil.compileDeployment(catalog, tmpDepOff.getPath(), false);
    assertTrue(msg == null);
    Systemsettings sysset = catalog.getClusters().get("cluster").getDeployment().get("deployment").getSystemsettings().get("systemsettings");
    assertEquals(100, sysset.getTemptablemaxsize());
    setUp();
    final File tmpDepOn = VoltProjectBuilder.writeStringToTempFile(depOn);
    msg = CatalogUtil.compileDeployment(catalog, tmpDepOn.getPath(), false);
    assertTrue(msg == null);
    sysset = catalog.getClusters().get("cluster").getDeployment().get("deployment").getSystemsettings().get("systemsettings");
    assertEquals(200, sysset.getTemptablemaxsize());
}
Also used : Systemsettings(org.voltdb.catalog.Systemsettings) File(java.io.File)

Aggregations

Systemsettings (org.voltdb.catalog.Systemsettings)5 File (java.io.File)2 Deployment (org.voltdb.catalog.Deployment)2 VoltTable (org.voltdb.VoltTable)1 CommandLog (org.voltdb.catalog.CommandLog)1 Connector (org.voltdb.catalog.Connector)1 GroupRef (org.voltdb.catalog.GroupRef)1 SnapshotSchedule (org.voltdb.catalog.SnapshotSchedule)1 User (org.voltdb.catalog.User)1