ExecutionEngine initializeEE()
    {
        String hostname = CoreUtils.getHostnameOrAddress();
        HashinatorConfig hashinatorConfig = TheHashinator.getCurrentConfig();
        ExecutionEngine eeTemp = null;
        Deployment deploy = m_context.cluster.getDeployment().get("deployment");
        final int defaultDrBufferSize = Integer.getInteger("DR_DEFAULT_BUFFER_SIZE", 512 * 1024); // 512KB
        int configuredTimeout = Integer.getInteger("MAX_EXPORT_BUFFER_FLUSH_INTERVAL", 4*1000);
        final int exportFlushTimeout = configuredTimeout > 0 ? configuredTimeout : 4*1000;
        int tempTableMaxSize = deploy.getSystemsettings().get("systemsettings").getTemptablemaxsize();
        if (System.getProperty("TEMP_TABLE_MAX_SIZE") != null) {
            // Allow a system property to override the deployment setting
            // for testing purposes.
            tempTableMaxSize = Integer.getInteger("TEMP_TABLE_MAX_SIZE");
        }

        try {
            // NATIVE_EE_JNI and NATIVE_EE_LARGE_JNI
            if (m_backend.isDefaultJNITarget) {
                eeTemp =
                    new ExecutionEngineJNI(
                        m_context.cluster.getRelativeIndex(),
                        m_siteId,
                        m_partitionId,
                        m_context.getNodeSettings().getLocalSitesCount(),
                        CoreUtils.getHostIdFromHSId(m_siteId),
                        hostname,
                        m_context.cluster.getDrclusterid(),
                        defaultDrBufferSize,
                        tempTableMaxSize,
                        hashinatorConfig,
                        m_isLowestSiteId,
                        exportFlushTimeout);
            }
            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,
                        m_context.getNodeSettings().getLocalSitesCount(),
                        CoreUtils.getHostIdFromHSId(m_siteId),
                        hostname,
                        m_context.cluster.getDrclusterid(),
                        defaultDrBufferSize,
                        tempTableMaxSize,
                        hashinatorConfig,
                        m_isLowestSiteId,
                        exportFlushTimeout);
                eeTemp = (ExecutionEngine) spyMethod.invoke(null, internalEE);
            }
            else if (m_backend.isIPC) {
                // set up the EE over IPC
                eeTemp =
                    new ExecutionEngineIPC(
                            m_context.cluster.getRelativeIndex(),
                            m_siteId,
                            m_partitionId,
                            m_context.getNodeSettings().getLocalSitesCount(),
                            CoreUtils.getHostIdFromHSId(m_siteId),
                            hostname,
                            m_context.cluster.getDrclusterid(),
                            defaultDrBufferSize,
                            tempTableMaxSize,
                            m_backend,
                            VoltDB.instance().getConfig().m_ipcPort,
                            hashinatorConfig,
                            m_isLowestSiteId,
                            exportFlushTimeout);
            }
            else {
                /* This seems very bad. */
                throw new VoltAbortException(
                        String.format("Unexpected BackendTarget value %s", m_backend)
                );
            }
            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;
    }
ExecutionEngine initializeEE ( ) { String hostname = CoreUtils . getHostnameOrAddress ( ) ; HashinatorConfig hashinatorConfig = TheHashinator . getCurrentConfig ( ) ; ExecutionEngine eeTemp = null ; Deployment deploy = m_context . cluster . getDeployment ( ) . get ( "deployment" ) ; final int defaultDrBufferSize = Integer . getInteger ( "DR_DEFAULT_BUFFER_SIZE" , 512 * 1024 ) ; int configuredTimeout = Integer . getInteger ( "MAX_EXPORT_BUFFER_FLUSH_INTERVAL" , 4 * 1000 ) ; final int exportFlushTimeout = configuredTimeout > 0 ? configuredTimeout : 4 * 1000 ; int tempTableMaxSize = deploy . getSystemsettings ( ) . get ( "systemsettings" ) . getTemptablemaxsize ( ) ; if ( System . getProperty ( "TEMP_TABLE_MAX_SIZE" ) != null ) { tempTableMaxSize = Integer . getInteger ( "TEMP_TABLE_MAX_SIZE" ) ; } try { if ( m_backend . isDefaultJNITarget ) { eeTemp = new ExecutionEngineJNI ( m_context . cluster . getRelativeIndex ( ) , m_siteId , m_partitionId , m_context . getNodeSettings ( ) . getLocalSitesCount ( ) , CoreUtils . getHostIdFromHSId ( m_siteId ) , hostname , m_context . cluster . getDrclusterid ( ) , defaultDrBufferSize , tempTableMaxSize , hashinatorConfig , m_isLowestSiteId , exportFlushTimeout ) ; } 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 , m_context . getNodeSettings ( ) . getLocalSitesCount ( ) , CoreUtils . getHostIdFromHSId ( m_siteId ) , hostname , m_context . cluster . getDrclusterid ( ) , defaultDrBufferSize , tempTableMaxSize , hashinatorConfig , m_isLowestSiteId , exportFlushTimeout ) ; eeTemp = ( ExecutionEngine ) spyMethod . invoke ( null , internalEE ) ; } else if ( m_backend . isIPC ) { eeTemp = new ExecutionEngineIPC ( m_context . cluster . getRelativeIndex ( ) , m_siteId , m_partitionId , m_context . getNodeSettings ( ) . getLocalSitesCount ( ) , CoreUtils . getHostIdFromHSId ( m_siteId ) , hostname , m_context . cluster . getDrclusterid ( ) , defaultDrBufferSize , tempTableMaxSize , m_backend , VoltDB . instance ( ) . getConfig ( ) . m_ipcPort , hashinatorConfig , m_isLowestSiteId , exportFlushTimeout ) ; } else { throw new VoltAbortException ( String . format ( "Unexpected BackendTarget value %s" , m_backend ) ) ; } eeTemp . loadCatalog ( m_startupConfig . m_timestamp , m_startupConfig . m_serializedCatalog ) ; eeTemp . setBatchTimeout ( m_context . cluster . getDeployment ( ) . get ( "deployment" ) . getSystemsettings ( ) . get ( "systemsettings" ) . getQuerytimeout ( ) ) ; } 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 ; }
Create a native VoltDB execution engine