Class GetWalksHandler
- java.lang.Object
-
- uk.gov.gchq.gaffer.store.operation.handler.GetWalksHandler
-
- All Implemented Interfaces:
OperationHandler<GetWalks>
,OutputOperationHandler<GetWalks,Iterable<Walk>>
public class GetWalksHandler extends Object implements OutputOperationHandler<GetWalks,Iterable<Walk>>
An operation handler forGetWalks
operations.The handler executes each
GetElements
operation in the parent GetWalks operation in turn and incrementally creates an in-memory representation of the resulting graph. Once all GetElements operations have been executed, a recursive depth-first search algorithm is used to construct all of theWalk
s that exist in the temporary graph.The default handler has two settings which can be overridden by system administrators:
- maxHops - prevent users from executing GetWalks operations that contain more than a set number of hops.
- prune - toggle pruning for the in-memory graph representation. Enabling pruning instructs the in-memory graph representation to discard any edges from the previous GetElements operation which do not join up with any edges in the current GetElements operation (orphaned edges). This reduces the memory footprint of the in-memory graph representation, but requires some additional processing while constructing the in-memory graph.
The maxHops setting is not set by default (i.e. there is no limit to the number of hops that a user can request). The prune flag is enabled by default (for applications where performance is paramount and any issues arising from excessive memory usage can be mitigated, this flag can be disabled).
This operation handler can be modified by supplying an operationDeclarations.json file in order to limit the maximum number of hops permitted or to enable/disable the pruning feature.
Currently the handler only supports creating
Walk
s which containEdge
s.
-
-
Constructor Summary
Constructors Constructor Description GetWalksHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<Walk>
doOperation(GetWalks getWalks, Context context, Store store)
Execute the givenOutput
operation.Integer
getMaxHops()
Boolean
getPrune()
void
setMaxHops(Integer maxHops)
void
setPrune(Boolean prune)
-
-
-
Method Detail
-
doOperation
public Iterable<Walk> doOperation(GetWalks getWalks, Context context, Store store) throws OperationException
Description copied from interface:OutputOperationHandler
Execute the givenOutput
operation.- Specified by:
doOperation
in interfaceOperationHandler<GetWalks>
- Specified by:
doOperation
in interfaceOutputOperationHandler<GetWalks,Iterable<Walk>>
- Parameters:
getWalks
- theOutput
operation 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.
- Throws:
OperationException
- thrown if the operation fails
-
getMaxHops
public Integer getMaxHops()
-
setMaxHops
public void setMaxHops(Integer maxHops)
-
getPrune
public Boolean getPrune()
-
setPrune
public void setPrune(Boolean prune)
-
-