Esempio n. 1
0
  private ResourceMonitorType initializeResourceMonitorType(
      SystemSettingsType systemSettingType,
      org.voltdb.compiler.deploymentfile.ObjectFactory factory) {
    ResourceMonitorType monitorType = systemSettingType.getResourcemonitor();
    if (monitorType == null) {
      monitorType = factory.createResourceMonitorType();
      systemSettingType.setResourcemonitor(monitorType);
    }

    return monitorType;
  }
Esempio n. 2
0
  private SystemSettingsType createSystemSettingsType(
      org.voltdb.compiler.deploymentfile.ObjectFactory factory) {
    SystemSettingsType systemSettingType = factory.createSystemSettingsType();
    Temptables temptables = factory.createSystemSettingsTypeTemptables();
    temptables.setMaxsize(m_maxTempTableMemory);
    systemSettingType.setTemptables(temptables);
    if (m_snapshotPriority != null) {
      SystemSettingsType.Snapshot snapshot = factory.createSystemSettingsTypeSnapshot();
      snapshot.setPriority(m_snapshotPriority);
      systemSettingType.setSnapshot(snapshot);
    }
    if (m_elasticThroughput != null || m_elasticDuration != null) {
      SystemSettingsType.Elastic elastic = factory.createSystemSettingsTypeElastic();
      if (m_elasticThroughput != null) elastic.setThroughput(m_elasticThroughput);
      if (m_elasticDuration != null) elastic.setDuration(m_elasticDuration);
      systemSettingType.setElastic(elastic);
    }
    if (m_queryTimeout != null) {
      SystemSettingsType.Query query = factory.createSystemSettingsTypeQuery();
      query.setTimeout(m_queryTimeout);
      systemSettingType.setQuery(query);
    }
    if (m_rssLimit != null) {
      ResourceMonitorType monitorType = initializeResourceMonitorType(systemSettingType, factory);
      Memorylimit memoryLimit = factory.createResourceMonitorTypeMemorylimit();
      memoryLimit.setSize(m_rssLimit);
      monitorType.setMemorylimit(memoryLimit);
    }

    if (m_resourceCheckInterval != null) {
      ResourceMonitorType monitorType = initializeResourceMonitorType(systemSettingType, factory);
      monitorType.setFrequency(m_resourceCheckInterval);
    }

    setupDiskLimitType(systemSettingType, factory);

    return systemSettingType;
  }