Class FederatedStoreUtil
- java.lang.Object
-
- uk.gov.gchq.gaffer.federatedstore.util.FederatedStoreUtil
-
public final class FederatedStoreUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FederatedStoreUtil.SerialisableConfiguredMergeFunctionsMap
-
Field Summary
Fields Modifier and Type Field Description static String
DEPRECATED_GRAPHIDS_OPTION
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <INPUT,OUTPUT>
FederatedOperation.BuilderParent<INPUT,OUTPUT>addDeprecatedGraphIds(Operation operation, FederatedOperation.BuilderParent<INPUT,OUTPUT> builder)
Deprecated.static String
createOperationErrorMsg(Operation operation, String graphId, Exception e)
static List<String>
getCleanStrings(String value)
static BiFunction
getDefaultMergeFunction()
static String
getDeprecatedGraphIds(Operation operation)
Deprecated.static <INPUT> FederatedOperation<INPUT,Void>
getFederatedOperation(Input<INPUT> operation)
static <INPUT,OUTPUT extends Iterable<?>>
FederatedOperation<INPUT,OUTPUT>getFederatedOperation(InputOutput<INPUT,OUTPUT> operation)
Defaulted with a iterableConcatstatic <OUTPUT extends Iterable<?>>
FederatedOperation<Void,OUTPUT>getFederatedOperation(Output<OUTPUT> operation)
static <INPUT> FederatedOperation<INPUT,Void>
getFederatedOperation(Operation operation)
static BiFunction
getStoreConfiguredMergeFunction(Operation payload, Context context, List graphIds, FederatedStore store)
static List<String>
loadStoreConfiguredGraphIdsListFrom(String pathStr)
static Map<String,BiFunction>
loadStoreConfiguredMergeFunctionMapFrom(String pathStr)
static BiFunction
processIfFunctionIsContextSpecific(BiFunction mergeFunction, Operation payload, Context operationContext, List<String> graphIds, FederatedStore federatedStore)
static Operation
shallowCloneWithDeepOptions(Operation op)
Return a clone of the given operations with a deep clone of options.static <OP extends Operation>
OPupdateOperationForGraph(OP operation, Graph graph, Context context)
Within FederatedStore anOperation
is executed against a collection of many graphs.
-
-
-
Field Detail
-
DEPRECATED_GRAPHIDS_OPTION
@Deprecated public static final String DEPRECATED_GRAPHIDS_OPTION
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
createOperationErrorMsg
public static String createOperationErrorMsg(Operation operation, String graphId, Exception e)
-
updateOperationForGraph
public static <OP extends Operation> OP updateOperationForGraph(OP operation, Graph graph, Context context)
Within FederatedStore an
Operation
is executed against a collection of many graphs.Problem: When an Operation contains View information about an Element which is not known by the Graph; It will fail validation when executed.
Solution: For each operation, remove all elements from the View that is unknown to the graph. This method will also update AddElements operations to allow elements to be added to various federated graphs with different schemas at the same time without causing validation errors.
- Type Parameters:
OP
- Operation type- Parameters:
operation
- current operationgraph
- current graphcontext
- current context, used for getSchema operation- Returns:
- cloned operation with modified View for the given graph.
-
getFederatedOperation
public static <INPUT,OUTPUT extends Iterable<?>> FederatedOperation<INPUT,OUTPUT> getFederatedOperation(InputOutput<INPUT,OUTPUT> operation)
Defaulted with a iterableConcat- Type Parameters:
INPUT
- payload input typeOUTPUT
- merge function output type- Parameters:
operation
- operation to be wrapped in FederatedOperation- Returns:
- the wrapped operation
-
getFederatedOperation
public static <INPUT> FederatedOperation<INPUT,Void> getFederatedOperation(Input<INPUT> operation)
-
getFederatedOperation
public static <OUTPUT extends Iterable<?>> FederatedOperation<Void,OUTPUT> getFederatedOperation(Output<OUTPUT> operation)
-
getDefaultMergeFunction
public static BiFunction getDefaultMergeFunction()
-
getFederatedOperation
public static <INPUT> FederatedOperation<INPUT,Void> getFederatedOperation(Operation operation)
-
addDeprecatedGraphIds
@Deprecated public static <INPUT,OUTPUT> FederatedOperation.BuilderParent<INPUT,OUTPUT> addDeprecatedGraphIds(Operation operation, FederatedOperation.BuilderParent<INPUT,OUTPUT> builder)
Deprecated.
-
getDeprecatedGraphIds
@Deprecated public static String getDeprecatedGraphIds(Operation operation) throws GafferRuntimeException
Deprecated.- Throws:
GafferRuntimeException
-
shallowCloneWithDeepOptions
public static Operation shallowCloneWithDeepOptions(Operation op)
Return a clone of the given operations with a deep clone of options.Because payloadOperation.shallowClone() is used it can't be guaranteed that original options won't be modified. So a deep clone of the options is made for the shallow clone of the operation.
- Parameters:
op
- the operation to clone- Returns:
- a clone of the operation with a deep clone of options.
-
processIfFunctionIsContextSpecific
public static BiFunction processIfFunctionIsContextSpecific(BiFunction mergeFunction, Operation payload, Context operationContext, List<String> graphIds, FederatedStore federatedStore)
-
getStoreConfiguredMergeFunction
public static BiFunction getStoreConfiguredMergeFunction(Operation payload, Context context, List graphIds, FederatedStore store) throws GafferCheckedException
- Throws:
GafferCheckedException
-
loadStoreConfiguredGraphIdsListFrom
public static List<String> loadStoreConfiguredGraphIdsListFrom(String pathStr) throws IOException
- Throws:
IOException
-
loadStoreConfiguredMergeFunctionMapFrom
public static Map<String,BiFunction> loadStoreConfiguredMergeFunctionMapFrom(String pathStr) throws IOException
- Throws:
IOException
-
-