public interface GraphComputeService extends VitamCache<String,org.bson.Document>, VitamAutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static String |
$_SET |
static Integer |
concurrencyLevel |
static ExecutorService |
executor |
static int |
START_DEPTH |
| Modifier and Type | Method and Description |
|---|---|
void |
bulkElasticsearch(MetadataCollections metaDaCollection,
List<org.bson.Document> collection)
Bulk save in elasticsearch
|
void |
bulkElasticsearch(MetadataCollections metaDaCollection,
Set<String> collection)
Bulk save in elasticsearch
|
void |
bulkUpdateMongo(MetadataCollections metaDaCollection,
List<com.mongodb.client.model.WriteModel<org.bson.Document>> collection)
Bulk write in mongodb
|
GraphComputeResponse |
computeGraph(com.fasterxml.jackson.databind.JsonNode queryDSL)
If workflow of compute graph in progress, do not execute this method
Should be exposed in the API
|
default void |
computeGraph(MetadataCollections metadataCollections,
List<org.bson.Document> documents)
Generic method to calculate graph for unit and object group
|
GraphComputeResponse |
computeGraph(MetadataCollections metadataCollections,
Set<String> unitsId,
boolean computeObjectGroupGraph)
Compute graph for unit/got from all parents
|
default com.mongodb.client.model.UpdateOneModel<org.bson.Document> |
computeObjectGroupGraph(org.bson.Document document)
Create update model for ObjectGroup
|
default void |
computeObjectGroupGraph(Set<String> originatingAgencies,
Set<String> unitParents,
List<String> up)
For ObjectGroup, we only get graph data (sps) from only unit represents (up)
We do not loop over all parent of parent until root units
As not concurrence expected, no problem of inconsistency,
Else, if parallel compute is needed, then, we have to loop over all units (until root units) or to implements optimistic lock on _glpd
|
default com.mongodb.client.model.UpdateOneModel<org.bson.Document> |
computeUnitGraph(org.bson.Document document)
Create update model for Unit
|
default void |
computeUnitGraphUsingDirectParents(List<GraphRelation> graphRels,
String unitId,
List<String> up,
int currentDepth)
Recursive method that compute graph using only _up
With global (by reference variable graphRels, we get all needed informations from all parent of the given unit unitId.
|
boolean |
isInProgress() |
default void |
preLoadCache(List<org.bson.Document> documents)
Get data from database and pre-populate unitCache
|
getCacheclosestatic final String $_SET
static final int START_DEPTH
static final Integer concurrencyLevel
static final ExecutorService executor
GraphComputeResponse computeGraph(com.fasterxml.jackson.databind.JsonNode queryDSL) throws MetaDataException
MetaDataExceptionGraphComputeResponse computeGraph(MetadataCollections metadataCollections, Set<String> unitsId, boolean computeObjectGroupGraph)
metadataCollections - the collection concerned by the build of the graphunitsId - the collection of units subject of computing graphcomputeObjectGroupGraph - true mean compute graphdefault void preLoadCache(List<org.bson.Document> documents) throws MetaDataException
documents - MetaDataExceptiondefault void computeGraph(MetadataCollections metadataCollections, List<org.bson.Document> documents) throws MetaDataException
metadataCollections - the type the collection (Unit or ObjectGroup)documents - the concerning collection of documentsMetaDataExceptiondefault com.mongodb.client.model.UpdateOneModel<org.bson.Document> computeUnitGraph(org.bson.Document document)
throws VitamRuntimeException
document - MetaDataExceptionVitamRuntimeExceptiondefault com.mongodb.client.model.UpdateOneModel<org.bson.Document> computeObjectGroupGraph(org.bson.Document document)
throws VitamRuntimeException
document - MetaDataExceptionVitamRuntimeExceptiondefault void computeUnitGraphUsingDirectParents(List<GraphRelation> graphRels, String unitId, List<String> up, int currentDepth) throws VitamRuntimeException
graphRels - unitId - up - currentDepth - the current depth, initially equals to 1ExecutionExceptionVitamRuntimeExceptiondefault void computeObjectGroupGraph(Set<String> originatingAgencies, Set<String> unitParents, List<String> up) throws VitamRuntimeException
originatingAgencies - unitParents - up - VitamRuntimeExceptionvoid bulkUpdateMongo(MetadataCollections metaDaCollection, List<com.mongodb.client.model.WriteModel<org.bson.Document>> collection) throws DatabaseException
metaDaCollection - collection - DatabaseExceptionvoid bulkElasticsearch(MetadataCollections metaDaCollection, Set<String> collection) throws DatabaseException
metaDaCollection - collection - of id of documentsDatabaseExceptionvoid bulkElasticsearch(MetadataCollections metaDaCollection, List<org.bson.Document> collection) throws DatabaseException
metaDaCollection - collection - of documentsDatabaseExceptionboolean isInProgress()
Copyright © 2018 Vitam. All rights reserved.