use of uk.gov.gchq.gaffer.federatedstore.operation.handler.impl.FederatedOperationIterableHandler in project Gaffer by gchq.
the class FederatedAddGraphHandlerParent method addGenericHandler.
protected void addGenericHandler(final FederatedStore store, final Graph graph) {
for (final Class<? extends Operation> supportedOperation : graph.getSupportedOperations()) {
// some operations are not suitable for FederatedOperationGenericOutputHandler
if (!store.isSupported(supportedOperation)) {
if (Output.class.isAssignableFrom(supportedOperation)) {
Class<? extends Output> supportedOutputOperation = (Class<? extends Output>) supportedOperation;
Class outputClass;
try {
outputClass = supportedOutputOperation.newInstance().getOutputClass();
} catch (final InstantiationException | IllegalAccessException e) {
LOGGER.warn("Exception occurred while trying to create a newInstance of operation: " + supportedOperation, e);
continue;
}
if (CloseableIterable.class.equals(outputClass)) {
store.addOperationHandler((Class) supportedOutputOperation, new FederatedOperationIterableHandler());
} else {
LOGGER.warn("No generic default handler can be used for an Output operation that does not return CloseableIterable. operation: " + supportedOutputOperation);
}
} else {
store.addOperationHandler(supportedOperation, new FederatedOperationHandler());
}
}
}
}
Aggregations