Search in sources :

Example 21 with ProcessingDetailsImpl

use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.

the class SortedQueryMonitor method interruptRemainingSources.

private void interruptRemainingSources(Set<ProcessingDetails> processingDetails, InterruptedException interruptedException) {
    for (QueryRequest interruptedSource : futures.values()) {
        if (interruptedSource != null) {
            String sourceId = getSourceIdFromRequest(interruptedSource);
            LOGGER.info("Search interrupted for {}", sourceId);
            processingDetails.add(new ProcessingDetailsImpl(sourceId, interruptedException));
        }
    }
}
Also used : QueryRequest(ddf.catalog.operation.QueryRequest) ProcessingDetailsImpl(ddf.catalog.operation.impl.ProcessingDetailsImpl)

Example 22 with ProcessingDetailsImpl

use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.

the class SortedQueryMonitor method executePostFederationQueryPluginsWithSourceError.

private void executePostFederationQueryPluginsWithSourceError(QueryRequest queryRequest, String sourceId, Exception e, Set<ProcessingDetails> processingDetails) {
    ProcessingDetails processingDetail = new ProcessingDetailsImpl(sourceId, e);
    SourceResponse sourceResponse = new SourceResponseImpl(queryRequest, new ArrayList<>());
    sourceResponse.getProcessingErrors().add(processingDetail);
    processingDetails.add(processingDetail);
    executePostFederationQueryPlugins(sourceResponse, queryRequest);
}
Also used : ProcessingDetails(ddf.catalog.operation.ProcessingDetails) SourceResponse(ddf.catalog.operation.SourceResponse) SourceResponseImpl(ddf.catalog.operation.impl.SourceResponseImpl) ProcessingDetailsImpl(ddf.catalog.operation.impl.ProcessingDetailsImpl)

Example 23 with ProcessingDetailsImpl

use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.

the class SolrCacheSource method query.

@Override
public SourceResponse query(QueryRequest request) throws UnsupportedQueryException {
    final QueryResponseImpl queryResponse = new QueryResponseImpl(request);
    try {
        SourceResponse result = cache.query(request);
        queryResponse.setHits(result.getHits());
        queryResponse.setProperties(result.getProperties());
        queryResponse.addResults(result.getResults(), true);
    } catch (UnsupportedQueryException e) {
        queryResponse.getProcessingDetails().add(new ProcessingDetailsImpl(getId(), e));
        queryResponse.closeResultQueue();
    }
    return queryResponse;
}
Also used : QueryResponseImpl(ddf.catalog.operation.impl.QueryResponseImpl) SourceResponse(ddf.catalog.operation.SourceResponse) UnsupportedQueryException(ddf.catalog.source.UnsupportedQueryException) ProcessingDetailsImpl(ddf.catalog.operation.impl.ProcessingDetailsImpl)

Example 24 with ProcessingDetailsImpl

use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.

the class Search method failSource.

public synchronized void failSource(String sourceId, Exception cause) {
    QueryResponseImpl failedResponse = new QueryResponseImpl(null);
    failedResponse.closeResultQueue();
    failedResponse.setHits(0);
    failedResponse.getProcessingDetails().add(new ProcessingDetailsImpl(sourceId, cause));
    failedResponse.getProperties().put("elapsed", -1L);
    updateStatus(sourceId, failedResponse);
}
Also used : QueryResponseImpl(ddf.catalog.operation.impl.QueryResponseImpl) ProcessingDetailsImpl(ddf.catalog.operation.impl.ProcessingDetailsImpl)

Example 25 with ProcessingDetailsImpl

use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.

the class QueryOperations method createUnavailableProcessingDetails.

private ProcessingDetailsImpl createUnavailableProcessingDetails(Source source) {
    ProcessingDetailsImpl exception = new ProcessingDetailsImpl();
    SourceUnavailableException sue = new SourceUnavailableException("Source \"" + source.getId() + "\" is unavailable and will not be queried");
    exception.setException(sue);
    exception.setSourceId(source.getId());
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("Source Unavailable", sue);
    }
    return exception;
}
Also used : SourceUnavailableException(ddf.catalog.source.SourceUnavailableException) ProcessingDetailsImpl(ddf.catalog.operation.impl.ProcessingDetailsImpl)

Aggregations

ProcessingDetailsImpl (ddf.catalog.operation.impl.ProcessingDetailsImpl)37 Test (org.junit.Test)19 UnsupportedQueryException (ddf.catalog.source.UnsupportedQueryException)18 ProcessingDetails (ddf.catalog.operation.ProcessingDetails)13 QueryResponseImpl (ddf.catalog.operation.impl.QueryResponseImpl)8 IngestException (ddf.catalog.source.IngestException)8 HashSet (java.util.HashSet)8 QueryRequest (ddf.catalog.operation.QueryRequest)7 SourceResponse (ddf.catalog.operation.SourceResponse)6 Serializable (java.io.Serializable)6 HashMap (java.util.HashMap)6 Tag (io.micrometer.core.instrument.Tag)5 ArrayList (java.util.ArrayList)5 Metacard (ddf.catalog.data.Metacard)4 QueryResponse (ddf.catalog.operation.QueryResponse)4 QueryRequestImpl (ddf.catalog.operation.impl.QueryRequestImpl)4 CatalogStore (ddf.catalog.source.CatalogStore)3 SourceUnavailableException (ddf.catalog.source.SourceUnavailableException)3 ExecutionException (java.util.concurrent.ExecutionException)3 TimeoutException (java.util.concurrent.TimeoutException)3