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;
}
Aggregations