Class FederatedOperationHandler<P extends Operation>
- java.lang.Object
-
- uk.gov.gchq.gaffer.federated.simple.operation.handler.FederatedOperationHandler<P>
-
- All Implemented Interfaces:
OperationHandler<P>
- Direct Known Subclasses:
FederatedOutputHandler
,SeparateOutputHandler
public class FederatedOperationHandler<P extends Operation> extends Object implements OperationHandler<P>
Main default handler for federated operations. Handles delegation to selected graphs and will sub class the operation to aFederatedOutputHandler
if provided operation has output so that it is merged.
-
-
Field Summary
Fields Modifier and Type Field Description static String
OPT_AGGREGATE_ELEMENTS
The boolean operation option to specify if element merging should be applied or not.static String
OPT_EXCLUDE_GRAPH_IDS
Graph IDs to exclude from the execution.static String
OPT_GRAPH_IDS
The operation option for the Graph IDs that an operation should be executed on, will take preference over the short variant of this option.static String
OPT_SEPARATE_RESULTS
A boolean option to specify if the results from each graph should be kept separate.static String
OPT_SHORT_GRAPH_IDS
The short version of the operation option for the Graph IDs that an operation should be executed on.static String
OPT_SKIP_FAILED_EXECUTE
A boolean option to specify if a graph should be skipped if execution fails on it e.g.static String
OPT_USE_DFLT_GRAPH_IDS
A boolean option to specify to use the default graph IDs.
-
Constructor Summary
Constructors Constructor Description FederatedOperationHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
doOperation(P operation, Context context, Store store)
Execute the givenOperation
.
-
-
-
Field Detail
-
OPT_GRAPH_IDS
public static final String OPT_GRAPH_IDS
The operation option for the Graph IDs that an operation should be executed on, will take preference over the short variant of this option.- See Also:
- Constant Field Values
-
OPT_SHORT_GRAPH_IDS
public static final String OPT_SHORT_GRAPH_IDS
The short version of the operation option for the Graph IDs that an operation should be executed on.- See Also:
- Constant Field Values
-
OPT_EXCLUDE_GRAPH_IDS
public static final String OPT_EXCLUDE_GRAPH_IDS
Graph IDs to exclude from the execution. If this option is set all graphs except the ones specified are executed on.- See Also:
- Constant Field Values
-
OPT_USE_DFLT_GRAPH_IDS
public static final String OPT_USE_DFLT_GRAPH_IDS
A boolean option to specify to use the default graph IDs. The option is not specifically required as default graph IDs will be used as a fallback, but if set the whole chain will be forwarded rather than each individual operation so can speed things up.- See Also:
- Constant Field Values
-
OPT_AGGREGATE_ELEMENTS
public static final String OPT_AGGREGATE_ELEMENTS
The boolean operation option to specify if element merging should be applied or not.- See Also:
- Constant Field Values
-
OPT_SKIP_FAILED_EXECUTE
public static final String OPT_SKIP_FAILED_EXECUTE
A boolean option to specify if a graph should be skipped if execution fails on it e.g. continue executing on the rest of the graphs- See Also:
- Constant Field Values
-
OPT_SEPARATE_RESULTS
public static final String OPT_SEPARATE_RESULTS
A boolean option to specify if the results from each graph should be kept separate. If set this will return a map where each key value is the graph ID and its respective result.- See Also:
- Constant Field Values
-
-
Method Detail
-
doOperation
public Object doOperation(P operation, Context context, Store store) throws OperationException
Description copied from interface:OperationHandler
Execute the givenOperation
.- Specified by:
doOperation
in interfaceOperationHandler<P extends Operation>
- Parameters:
operation
- theOperation
to be executedcontext
- the operation chain context, containing the user who executed the operationstore
- theStore
the operation should be run on- Returns:
- the output for the operation or null.
- Throws:
OperationException
- thrown if the operation fails
-
-