Search in sources :

Example 21 with TmfCoalescedEventRequest

use of org.eclipse.tracecompass.internal.tmf.core.request.TmfCoalescedEventRequest in project tracecompass by tracecompass.

the class TmfEventProvider method fireRequest.

private void fireRequest(boolean isTimeout) {
    synchronized (fLock) {
        if (fRequestPendingCounter > 0) {
            return;
        }
        if (!fPendingCoalescedRequests.isEmpty()) {
            Iterator<TmfCoalescedEventRequest> iter = fPendingCoalescedRequests.iterator();
            while (iter.hasNext()) {
                ExecutionType type = (isTimeout ? ExecutionType.BACKGROUND : ExecutionType.FOREGROUND);
                ITmfEventRequest request = iter.next();
                if (type == request.getExecType()) {
                    queueRequest(request);
                    iter.remove();
                }
            }
        }
    }
}
Also used : ExecutionType(org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest.ExecutionType) TmfCoalescedEventRequest(org.eclipse.tracecompass.internal.tmf.core.request.TmfCoalescedEventRequest) ITmfEventRequest(org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest)

Example 22 with TmfCoalescedEventRequest

use of org.eclipse.tracecompass.internal.tmf.core.request.TmfCoalescedEventRequest in project tracecompass by tracecompass.

the class TmfEventProvider method newCoalescedEventRequest.

// ------------------------------------------------------------------------
// Coalescing
// ------------------------------------------------------------------------
/**
 * Create a new request from an existing one, and add it to the coalesced
 * requests
 *
 * @param request
 *            The request to copy
 */
protected void newCoalescedEventRequest(ITmfEventRequest request) {
    synchronized (fLock) {
        TmfCoalescedEventRequest coalescedRequest = new TmfCoalescedEventRequest(request.getDataType(), request.getRange(), request.getIndex(), request.getNbRequested(), request.getExecType(), request.getDependencyLevel());
        coalescedRequest.addRequest(request);
        coalescedRequest.setProviderFilter(this);
        if (TmfCoreTracer.isRequestTraced()) {
            // $NON-NLS-1$
            TmfCoreTracer.traceRequest(request.getRequestId(), "COALESCED with " + coalescedRequest.getRequestId());
            // $NON-NLS-1$
            TmfCoreTracer.traceRequest(coalescedRequest.getRequestId(), "now contains " + coalescedRequest.getSubRequestIds());
        }
        coalesceChildrenRequests(coalescedRequest);
        fPendingCoalescedRequests.add(coalescedRequest);
    }
}
Also used : TmfCoalescedEventRequest(org.eclipse.tracecompass.internal.tmf.core.request.TmfCoalescedEventRequest)

Aggregations

TmfCoalescedEventRequest (org.eclipse.tracecompass.internal.tmf.core.request.TmfCoalescedEventRequest)22 Test (org.junit.Test)14 TmfEventRequest (org.eclipse.tracecompass.tmf.core.request.TmfEventRequest)8 TmfEventRequestStub (org.eclipse.tracecompass.tmf.tests.stubs.request.TmfEventRequestStub)8 ITmfEvent (org.eclipse.tracecompass.tmf.core.event.ITmfEvent)3 Method (java.lang.reflect.Method)2 LinkedList (java.util.LinkedList)2 IllformedLocaleException (java.util.IllformedLocaleException)1 NonNull (org.eclipse.jdt.annotation.NonNull)1 ITmfEventRequest (org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest)1 ExecutionType (org.eclipse.tracecompass.tmf.core.request.ITmfEventRequest.ExecutionType)1 ITmfTrace (org.eclipse.tracecompass.tmf.core.trace.ITmfTrace)1 TmfTrace (org.eclipse.tracecompass.tmf.core.trace.TmfTrace)1 Before (org.junit.Before)1