Class FinkGremlinRecipies
java.lang.Object
com.Lomikel.Januser.GremlinRecipies
com.astrolabsoftware.FinkBrowser.Januser.FinkGremlinRecipies
Fink-specific graph mutation and lifecycle recipes.
The package documentation defines the graph model, label-mirror invariant, and transaction ownership shared by this class and the Groovy traversal recipes.
- Author:
- J.Hrivnac
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ThreadLocal<Map<String,Vertex>> Objects already selected or created by this thread's classification transaction.private ThreadLocal<Boolean>Whether this thread's registration participates in a classification transaction.private FinkHBaseClientprivate Stringprivate static Stringprivate static Stringprivate static Stringprivate static org.apache.logging.log4j.LoggerLogging . -
Constructor Summary
ConstructorsConstructorDescriptionCreate and attach toModifyingGremlinClient.Create and attach toGraphTraversalSource. -
Method Summary
Modifier and TypeMethodDescriptionvoidclassifySource(Classifier classifier, String objectId) Classify object.voidclassifySource(Classifier classifier, String objectId, String hbaseUrl) Classify object.voidclassifySources(Classifier[] classifiers, Set<String> oids, String hbaseUrl) Classify object .voidcleanOCol(Classifier classifier, String cls) Clean tree under OCol.private static StringcorrelationScope(String survey, String classifier, String flavor) Build an unambiguous identity for a correlation-generation scope.private EdgeCreate a complete registration edge or remove its partial state on failure.fhclient()Get existingFinkHBaseClient.Create a newFinkHBaseClient.protected VertexFind the endpoint selected by the existing indexed OCol lookup.voidgenerateCorrelations(Classifier... classifiers) Generate overlaps Edges between OCol.private voidgenerateCorrelationsInTransaction(Classifier... classifiers) Generate correlations inside one caller-owned transaction.hbaseUrl()Give HBase url.voidregisterOCol(Classifier classifier, String cls, String objectId, double weight, String instancesS, String weightsS) Register object in OCol.voidregisterOCol(Classifier classifier, String cls, String objectId, double weight, List<String> instances, List<Double> weights) Register object in OCol.voidregisterOCol(Classifier classifier, String cls, String objectId, Map<String, ?> attributes, boolean replace) Register object in OCol.private voidReplace all parallel registrations with one fully prepared edge.private static voidvalidateWeight(double weight, String description) Validate scientific registration weights before graph mutation.Methods inherited from class com.Lomikel.Januser.GremlinRecipies
addEdge, addEdge, addEdge, addEdge, allV, attachDataLink, checkEdge, client, commit, created, createMetaSchema, drop, g, getEdge, getOrCreate, getOrCreate, gimme, graph, rollback, supportsTransactions
-
Field Details
-
_fhclient
-
_fhclientUrl
-
_classificationTransaction
Whether this thread's registration participates in a classification transaction. -
_classificationObjects
Objects already selected or created by this thread's classification transaction. -
FINK_OBJECTS_WS
-
FINK_LATESTS_WS
-
FINK_ANOMALY_WS
-
log
Logging .
-
-
Constructor Details
-
FinkGremlinRecipies
Create and attach toGraphTraversalSource.- Parameters:
g- The attachedGraphTraversalSource.
-
FinkGremlinRecipies
Create and attach toModifyingGremlinClient.- Parameters:
client- The attachedModifyingGremlinClient.
-
-
Method Details
-
classifySources
public void classifySources(Classifier[] classifiers, Set<String> oids, String hbaseUrl) throws LomikelException Classify object .- Parameters:
classifiers- TheClassifiers to be used.oids- TheSetofobjectIds of object to be added.hbaseUrl- The url of HBase with alerts asip:port:table:schema.- Throws:
LomikelException- If anything fails.
-
classifySource
public void classifySource(Classifier classifier, String objectId, String hbaseUrl) throws LomikelException Classify object.- Parameters:
classifier- TheClassifierto be used.objectId- TheobjectIdof object to be added.hbaseUrl- The url of HBase with alerts asip:port:table:schema.- Throws:
LomikelException- If anything fails.
-
classifySource
Classify object.- Parameters:
classifier- TheClassifierto be used.objectId- TheobjectIdof object to be added.- Throws:
LomikelException- If anything fails.
-
registerOCol
public void registerOCol(Classifier classifier, String cls, String objectId, double weight, String instancesS, String weightsS) Register object in OCol.- Parameters:
classifier- TheClassifierto be used.cls- The type (class) of OColVertex. It will be created if not yet exists.objectId- The objectId of the new SourceVertex. It will be created if not yet exists.weight- The weight of the connection. Usualy the number of Alerts of this type.instancesS- The jd of related Alerts as strings separated by comma. Potential square brackets are removed. May benullor empty.weightsS- The corresponding per-alert weights, separated by comma.
-
registerOCol
public void registerOCol(Classifier classifier, String cls, String objectId, double weight, List<String> instances, List<Double> weights) Register object in OCol. Replace possible existing registration.- Parameters:
classifier- TheClassifierto be used.cls- The type (class) of OColVertex. It will be created if not yet exists.objectId- The objectId of the new SourceVertex. It will be created if not yet exists.weight- The total weight of the connection. Usualy the number of Alerts of this type.instances- The jd of related Alerts.weights- The weights of related Alerts.
-
registerOCol
public void registerOCol(Classifier classifier, String cls, String objectId, Map<String, ?> attributes, boolean replace) Register object in OCol.- Parameters:
classifier- TheClassifierto be used.cls- The type (class) of OColVertex. It will be created if not yet exists.objectId- The objectId of the new SourceVertex. It will be created if not yet exists.attributes- The additionalEdgeattributes.replace- Whether to replace existing resistration.
-
replaceRegistrationEdge
Replace all parallel registrations with one fully prepared edge. -
createRegistrationEdge
Create a complete registration edge or remove its partial state on failure. -
validateWeight
Validate scientific registration weights before graph mutation. -
cleanOCol
Clean tree under OCol. Drop alerts. Alerts are dropped even if they have otherEdges.- Parameters:
classifier- TheClassifierto be used. All its flavors are handled.cls- The type (class) of OCol.- Throws:
LomikelException- If anything goes wrong.
-
generateCorrelations
Generate overlaps Edges between OCol. Possibly between twoClassifiers.- Parameters:
classifiers- TheClassifiers to be used.
-
generateCorrelationsInTransaction
Generate correlations inside one caller-owned transaction. -
findOCol
Find the endpoint selected by the existing indexed OCol lookup.- Parameters:
cls- The logical OCol identity.- Returns:
- The first matching physical OCol endpoint.
-
fhclient
Create a newFinkHBaseClient. Singleton when url unchanged.- Parameters:
hbaseUrl- The HBase url asip:port:table[:schema].- Returns:
- The corresponding
FinkHBaseClient, created and initialised if needed. - Throws:
LomikelException- If cannot be created.
-
fhclient
Get existingFinkHBaseClient.- Returns:
- The corresponding
FinkHBaseClient. - Throws:
LomikelException- If not yet created.
-
hbaseUrl
Give HBase url.- Returns:
- The HBase url as
ip:port:table[:schema].
-
correlationScope
Build an unambiguous identity for a correlation-generation scope.
-