Search in sources :

Example 6 with VoltTrace

use of org.voltdb.utils.VoltTrace in project voltdb by VoltDB.

the class ExecutionEngine method executePlanFragments.

/** Run multiple plan fragments */
public FastDeserializer executePlanFragments(int numFragmentIds, long[] planFragmentIds, long[] inputDepIds, Object[] parameterSets, DeterminismHash determinismHash, String[] sqlTexts, boolean[] isWriteFrags, int[] sqlCRCs, long txnId, long spHandle, long lastCommittedSpHandle, long uniqueId, long undoQuantumToken, boolean traceOn) throws EEException {
    try {
        // For now, re-transform undoQuantumToken to readOnly. Redundancy work in site.executePlanFragments()
        m_fragmentContext = (undoQuantumToken == Long.MAX_VALUE) ? FragmentContext.RO_BATCH : FragmentContext.RW_BATCH;
        // reset context for progress updates
        m_startTime = 0;
        m_logDuration = INITIAL_LOG_DURATION;
        m_sqlTexts = sqlTexts;
        if (traceOn) {
            final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.SPSITE);
            if (traceLog != null) {
                traceLog.add(() -> VoltTrace.beginDuration("execplanfragment", "txnId", TxnEgo.txnIdToString(txnId), "partition", Integer.toString(m_partitionId)));
            }
        }
        FastDeserializer results = coreExecutePlanFragments(m_currentBatchIndex, numFragmentIds, planFragmentIds, inputDepIds, parameterSets, determinismHash, isWriteFrags, sqlCRCs, txnId, spHandle, lastCommittedSpHandle, uniqueId, undoQuantumToken, traceOn);
        if (traceOn) {
            final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.SPSITE);
            if (traceLog != null) {
                traceLog.add(VoltTrace::endDuration);
            }
        }
        m_plannerStats.updateEECacheStats(m_eeCacheSize, numFragmentIds - m_cacheMisses, m_cacheMisses, m_partitionId);
        return results;
    } finally {
        // don't count any cache misses when there's an exception. This is a lie and they
        // will still be used to estimate the cache size, but it's hard to count cache hits
        // during an exception, so we don't count cache misses either to get the right ratio.
        m_cacheMisses = 0;
        m_sqlTexts = null;
        m_fragmentContext = FragmentContext.UNKNOWN;
    }
}
Also used : VoltTrace(org.voltdb.utils.VoltTrace) FastDeserializer(org.voltdb.messaging.FastDeserializer)

Aggregations

VoltTrace (org.voltdb.utils.VoltTrace)6 FragmentResponseMessage (org.voltdb.messaging.FragmentResponseMessage)2 InitiateResponseMessage (org.voltdb.messaging.InitiateResponseMessage)2 ClientResponseImpl (org.voltdb.ClientResponseImpl)1 DependencyPair (org.voltdb.DependencyPair)1 ParameterSet (org.voltdb.ParameterSet)1 VoltAbortException (org.voltdb.VoltProcedure.VoltAbortException)1 VoltTable (org.voltdb.VoltTable)1 EEException (org.voltdb.exceptions.EEException)1 SQLException (org.voltdb.exceptions.SQLException)1 SerializableException (org.voltdb.exceptions.SerializableException)1 SpecifiedException (org.voltdb.exceptions.SpecifiedException)1 CompleteTransactionMessage (org.voltdb.messaging.CompleteTransactionMessage)1 CompleteTransactionResponseMessage (org.voltdb.messaging.CompleteTransactionResponseMessage)1 FastDeserializer (org.voltdb.messaging.FastDeserializer)1