/** Create an ee and load the volt shared library */ public ExecutionEngine(long siteId, int partitionId) { m_partitionId = partitionId; org.voltdb.EELibraryLoader.loadExecutionEngineLibrary(true); // In mock test environments there may be no stats agent. final StatsAgent statsAgent = VoltDB.instance().getStatsAgent(); if (statsAgent != null) { m_plannerStats = new PlannerStatsCollector(siteId); statsAgent.registerStatsSource(SysProcSelector.PLANNER, siteId, m_plannerStats); } }
/** Create a new execution site and the corresponding EE */ public Site( SiteTaskerQueue scheduler, long siteId, BackendTarget backend, CatalogContext context, String serializedCatalog, long txnId, int partitionId, int numPartitions, VoltDB.START_ACTION startAction, int snapshotPriority, InitiatorMailbox initiatorMailbox, StatsAgent agent, MemoryStats memStats) { m_siteId = siteId; m_context = context; m_partitionId = partitionId; m_numberOfPartitions = numPartitions; m_scheduler = scheduler; m_backend = backend; m_startAction = startAction; m_rejoinState = VoltDB.createForRejoin(startAction) ? kStateRejoining : kStateRunning; m_snapshotPriority = snapshotPriority; // need this later when running in the final thread. m_startupConfig = new StartupConfig(serializedCatalog, context.m_timestamp); m_lastCommittedTxnId = TxnEgo.makeZero(partitionId).getTxnId(); m_lastCommittedSpHandle = TxnEgo.makeZero(partitionId).getTxnId(); m_currentTxnId = Long.MIN_VALUE; m_initiatorMailbox = initiatorMailbox; if (agent != null) { m_tableStats = new TableStats(m_siteId); agent.registerStatsSource(SysProcSelector.TABLE, m_siteId, m_tableStats); m_indexStats = new IndexStats(m_siteId); agent.registerStatsSource(SysProcSelector.INDEX, m_siteId, m_indexStats); m_memStats = memStats; } else { // MPI doesn't need to track these stats m_tableStats = null; m_indexStats = null; m_memStats = null; } }