Search in sources :

Example 1 with ExecutionEngineIPC

use of org.voltdb.jni.ExecutionEngineIPC in project voltdb by VoltDB.

the class Site method initializeEE.

/** Create a native VoltDB execution engine */
ExecutionEngine initializeEE() {
    String hostname = CoreUtils.getHostnameOrAddress();
    HashinatorConfig hashinatorConfig = TheHashinator.getCurrentConfig();
    ExecutionEngine eeTemp = null;
    Deployment deploy = m_context.cluster.getDeployment().get("deployment");
    // 512KB
    final int defaultDrBufferSize = Integer.getInteger("DR_DEFAULT_BUFFER_SIZE", 512 * 1024);
    try {
        if (m_backend == BackendTarget.NATIVE_EE_JNI) {
            eeTemp = new ExecutionEngineJNI(m_context.cluster.getRelativeIndex(), m_siteId, m_partitionId, CoreUtils.getHostIdFromHSId(m_siteId), hostname, m_context.cluster.getDrclusterid(), defaultDrBufferSize, deploy.getSystemsettings().get("systemsettings").getTemptablemaxsize(), hashinatorConfig, m_hasMPDRGateway);
        } else if (m_backend == BackendTarget.NATIVE_EE_SPY_JNI) {
            Class<?> spyClass = Class.forName("org.mockito.Mockito");
            Method spyMethod = spyClass.getDeclaredMethod("spy", Object.class);
            ExecutionEngine internalEE = new ExecutionEngineJNI(m_context.cluster.getRelativeIndex(), m_siteId, m_partitionId, CoreUtils.getHostIdFromHSId(m_siteId), hostname, m_context.cluster.getDrclusterid(), defaultDrBufferSize, m_context.cluster.getDeployment().get("deployment").getSystemsettings().get("systemsettings").getTemptablemaxsize(), hashinatorConfig, m_hasMPDRGateway);
            eeTemp = (ExecutionEngine) spyMethod.invoke(null, internalEE);
        } else {
            // set up the EE over IPC
            eeTemp = new ExecutionEngineIPC(m_context.cluster.getRelativeIndex(), m_siteId, m_partitionId, CoreUtils.getHostIdFromHSId(m_siteId), hostname, m_context.cluster.getDrclusterid(), defaultDrBufferSize, deploy.getSystemsettings().get("systemsettings").getTemptablemaxsize(), m_backend, VoltDB.instance().getConfig().m_ipcPort, hashinatorConfig, m_hasMPDRGateway);
        }
        eeTemp.loadCatalog(m_startupConfig.m_timestamp, m_startupConfig.m_serializedCatalog);
        eeTemp.setBatchTimeout(m_context.cluster.getDeployment().get("deployment").getSystemsettings().get("systemsettings").getQuerytimeout());
    }// just print error info an bail if we run into an error here
     catch (final Exception ex) {
        hostLog.l7dlog(Level.FATAL, LogKeys.host_ExecutionSite_FailedConstruction.name(), new Object[] { m_siteId, m_siteIndex }, ex);
        VoltDB.crashLocalVoltDB(ex.getMessage(), true, ex);
    }
    return eeTemp;
}
Also used : HashinatorConfig(org.voltdb.TheHashinator.HashinatorConfig) MockExecutionEngine(org.voltdb.jni.MockExecutionEngine) ExecutionEngine(org.voltdb.jni.ExecutionEngine) ExecutionEngineJNI(org.voltdb.jni.ExecutionEngineJNI) Deployment(org.voltdb.catalog.Deployment) ExecutionEngineIPC(org.voltdb.jni.ExecutionEngineIPC) Method(java.lang.reflect.Method) EEException(org.voltdb.exceptions.EEException) VoltAbortException(org.voltdb.VoltProcedure.VoltAbortException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 Method (java.lang.reflect.Method)1 HashinatorConfig (org.voltdb.TheHashinator.HashinatorConfig)1 VoltAbortException (org.voltdb.VoltProcedure.VoltAbortException)1 Deployment (org.voltdb.catalog.Deployment)1 EEException (org.voltdb.exceptions.EEException)1 ExecutionEngine (org.voltdb.jni.ExecutionEngine)1 ExecutionEngineIPC (org.voltdb.jni.ExecutionEngineIPC)1 ExecutionEngineJNI (org.voltdb.jni.ExecutionEngineJNI)1 MockExecutionEngine (org.voltdb.jni.MockExecutionEngine)1