use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.
the class ProcessingDetailsImplTest method testEqualityOfHashCodes.
@Test
public void testEqualityOfHashCodes() {
Exception exception = new UnsupportedQueryException("We do not support this query");
ProcessingDetails processingDetails = new ProcessingDetailsImpl("test source", exception, "warning");
ProcessingDetails identicalProcessingDetails = new ProcessingDetailsImpl("test source", exception, "warning");
assertThat("\nThe hashCodes of ProcessingDetails with equal sourceIds, equal\n" + "exceptions, and equal warnings should have been equal, but were not.\n", processingDetails.hashCode(), is(identicalProcessingDetails.hashCode()));
}
use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.
the class ProcessingDetailsImplTest method testEqualityOfHashCodesForNullSourceIds.
@Test
public void testEqualityOfHashCodesForNullSourceIds() {
List<String> warnings = Collections.singletonList("warning");
Exception exception = new UnsupportedQueryException("We do not support this query");
ProcessingDetails processingDetails = new ProcessingDetailsImpl(null, exception, warnings);
ProcessingDetails identicalProcessingDetails = new ProcessingDetailsImpl(null, exception, warnings);
assertThat("\nThe hashCodes of ProcessingDetails with null sourceIds, equal\n" + "exceptions, and equal warnings should have been equal, but were not.\n", processingDetails.hashCode(), is(identicalProcessingDetails.hashCode()));
}
use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.
the class SortedQueryMonitor method timeoutRemainingSources.
private void timeoutRemainingSources(Set<ProcessingDetails> processingDetails) {
for (QueryRequest expiredSource : futures.values()) {
if (expiredSource != null) {
String sourceId = getSourceIdFromRequest(expiredSource);
LOGGER.info("Search timed out for {}", sourceId);
processingDetails.add(new ProcessingDetailsImpl(sourceId, new TimeoutException()));
}
}
}
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));
}
}
}
use of ddf.catalog.operation.impl.ProcessingDetailsImpl in project ddf by codice.
the class CreateOperations method doRemoteCreate.
private CreateResponse doRemoteCreate(CreateRequest createRequest) {
HashSet<ProcessingDetails> exceptions = new HashSet<>();
Map<String, Serializable> properties = new HashMap<>();
List<CatalogStore> stores = opsCatStoreSupport.getCatalogStoresForRequest(createRequest, exceptions);
for (CatalogStore store : stores) {
try {
if (!store.isAvailable()) {
exceptions.add(new ProcessingDetailsImpl(store.getId(), null, "CatalogStore is not available"));
} else {
CreateResponse response = store.create(createRequest);
properties.put(store.getId(), new ArrayList<>(response.getCreatedMetacards()));
}
} catch (IngestException e) {
INGEST_LOGGER.error("Error creating metacards for CatalogStore {}", store.getId(), e);
exceptions.add(new ProcessingDetailsImpl(store.getId(), e));
}
}
return new CreateResponseImpl(createRequest, properties, createRequest.getMetacards(), exceptions);
}
Aggregations