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 aFederatedOutputHandlerif provided operation has output so that it is merged.
-
-
Field Summary
Fields Modifier and Type Field Description static intDFLT_FIX_OP_LIMITDefault depth limit for fixing an operation chain.static StringOPT_AGGREGATE_ELEMENTSThe boolean operation option to specify if element merging should be applied or not.static StringOPT_EXCLUDE_GRAPH_IDSGraph IDs to exclude from the execution.static StringOPT_FIX_OP_LIMITDepth should go to when making an operation chain relevant to specified graphs e.g.static StringOPT_GRAPH_IDSThe operation option for the Graph IDs that an operation should be executed on, will take preference over the short variant of this option.static StringOPT_SEPARATE_RESULTSA boolean option to specify if the results from each graph should be kept separate.static StringOPT_SHORT_GRAPH_IDSThe short version of the operation option for the Graph IDs that an operation should be executed on.static StringOPT_SKIP_FAILED_EXECUTEA boolean option to specify if a graph should be skipped if execution fails on it e.g.static StringOPT_USE_DFLT_GRAPH_IDSA 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 ObjectdoOperation(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
-
OPT_FIX_OP_LIMIT
public static final String OPT_FIX_OP_LIMIT
Depth should go to when making an operation chain relevant to specified graphs e.g. fix the View.- See Also:
- Constant Field Values
-
DFLT_FIX_OP_LIMIT
public static final int DFLT_FIX_OP_LIMIT
Default depth limit for fixing an operation chain.- See Also:
- Constant Field Values
-
-
Method Detail
-
doOperation
public Object doOperation(P operation, Context context, Store store) throws OperationException
Description copied from interface:OperationHandlerExecute the givenOperation.- Specified by:
doOperationin interfaceOperationHandler<P extends Operation>- Parameters:
operation- theOperationto be executedcontext- the operation chain context, containing the user who executed the operationstore- theStorethe operation should be run on- Returns:
- the output for the operation or null.
- Throws:
OperationException- thrown if the operation fails
-
-