Class FinkGremlinRecipies
java.lang.Object
com.Lomikel.Januser.GremlinRecipies
com.astrolabsoftware.FinkBrowser.Januser.FinkGremlinRecipies
FinkGremlinRecipies
provides various recipies to handle
and modify Gremlin Graphs for Fink.- Author:
- J.Hrivnac
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate and attach toModifyingGremlinClient
.Create and attach toGraphTraversalSource
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
assembleAlertsOfInterest
(Classifiers classifier) Assemble AlertsOfInterest from all existing alerts.void
assembleAlertsOfInterest
(Classifiers classifier, Vertex alert) Assemble AlertsOfInterest from an alert.void
classifySource
(Classifiers classifier, String objectId, String hbaseUrl, boolean enhance, String columns) Classify source and expand them to alerts (if requested).void
classifySources
(Classifiers[] classifiers, Set<String> oids, String hbaseUrl, boolean enhance, String columns) Classify source and expand them to alerts (if requested).void
cleanSourcesOfInterest
(Classifiers classifier, String cls) Clean tree under SourcesOfInterest.void
enhanceSource
(Classifiers classifier, Vertex source, String[] jds, String columns) Expand tree under source with alerts filled with requested HBase columns.void
enhanceSourcesOfInterest
(Classifiers classifier, String columns) Expand tree under all SourcesOfInterest with alerts filled with requested HBase columns.void
enhanceSourcesOfInterest
(Classifiers classifier, String cls, String columns) Expand tree under SourcesOfInterest with alerts filled with requested HBase columns.fhclient()
Get existingFinkHBaseClient
.Create a newFinkHBaseClient
.void
fillSourcesOfInterest
(Classifiers[] classifiers, String filter, String hbaseUrl, int nLimit, int timeLimit, String[] clss, boolean enhance, String columns) Fill graph with SourcesOfInterest and expand them to alerts (if requested).void
generateCorrelations
(Classifiers... classifiers) Generate overlaps Edges between AlertsOfInterest and SourcesOfInterest.hbaseUrl()
Give HBase url.void
processSourcesOfInterest
(String[] classifierNames, String filter, String hbaseUrl, int nLimit, int timeLimit, String[] clss, boolean enhance, String columns) Execute full chain of new sources correlations analyses.void
registerSourcesOfInterest
(Classifiers classifier, String cls, String objectId, double weight, String instancesS, boolean enhance, String columns) Register source in SourcesOfInterest.void
registerSourcesOfInterest
(Classifiers classifier, String cls, String objectId, double weight, Set<Double> instances, boolean enhance, String columns) Register source in SourcesOfInterest.Methods inherited from class com.Lomikel.Januser.GremlinRecipies
addEdge, addEdge, addEdge, allV, attachDataLink, checkEdge, client, commit, created, createMetaSchema, drop, g, getEdge, getOrCreate, getOrCreate, gimme, graph
-
Field Details
-
_fhclient
-
_fhclientUrl
-
_now
-
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
-
processSourcesOfInterest
public void processSourcesOfInterest(String[] classifierNames, String filter, String hbaseUrl, int nLimit, int timeLimit, String[] clss, boolean enhance, String columns) throws LomikelException Execute full chain of new sources correlations analyses.- Parameters:
classifierNames
- The names of theClassifier
to be used.filter
- The HBase evaluation formula to be applied. Ignored if clss are specified.hbaseUrl
- The url of HBase with alerts as ip:port:table:schema.nLimit
- The maximal number of alerts getting from HBase or Fink Portal. 0 means no limit.timeLimit
- How far into the past the search should search (in minutes).clss
- An array of classes taken fromFPC
, if contains Anomaly, get anomalies fromFPC
, if null, analyse sources from HBase database.enhance
- Whether expand tree under all SourcesOfInterest with alerts possibly filled with requested HBase columns.columns
- HBase columns to be copied into graph alerts. May be null.- Throws:
LomikelException
- If anything fails.
-
fillSourcesOfInterest
public void fillSourcesOfInterest(Classifiers[] classifiers, String filter, String hbaseUrl, int nLimit, int timeLimit, String[] clss, boolean enhance, String columns) throws LomikelException Fill graph with SourcesOfInterest and expand them to alerts (if requested).- Parameters:
classifiers
- TheClassifiers
s to be used.filter
- The HBase evaluation formula to be applied. Ignored if clss are specified.hbaseUrl
- The url of HBase with alerts as ip:port:table:schema.nLimit
- The maximal number of alerts getting from HBase or Fink Portal. 0 means no limit.timeLimit
- How far into the past the search should search (in minutes).clss
- An array of classes taken fromFPC
, if contains Anomaly, get anomalies fromFPC
, if null, analyse sources from HBase database.enhance
- Whether expand tree under all SourcesOfInterest with alerts possibly filled with requested HBase columns.columns
- The HBase columns to be copied into graph alerts. May be null.- Throws:
LomikelException
- If anything fails.
-
classifySources
public void classifySources(Classifiers[] classifiers, Set<String> oids, String hbaseUrl, boolean enhance, String columns) throws LomikelException Classify source and expand them to alerts (if requested).- Parameters:
classifiers
- TheClassifiers
s to be used.oids
- TheSet
of objectIds of source to be added.hbaseUrl
- The url of HBase with alerts as ip:port:table:schema.enhance
- Whether expand tree under all SourcesOfInterest with alerts possibly filled with requested HBase columns.columns
- The HBase columns to be copied into graph alerts. May be null.- Throws:
LomikelException
- If anything fails.
-
classifySource
public void classifySource(Classifiers classifier, String objectId, String hbaseUrl, boolean enhance, String columns) throws LomikelException Classify source and expand them to alerts (if requested).- Parameters:
classifier
- TheClassifier
to be used.objectId
- The objectId of source to be added.hbaseUrl
- The url of HBase with alerts as ip:port:table:schema.enhance
- Whether expand tree under all SourcesOfInterest with alerts possibly filled with requested HBase columns.columns
- The HBase columns to be copied into graph alerts. May be null.- Throws:
LomikelException
- If anything fails.
-
registerSourcesOfInterest
public void registerSourcesOfInterest(Classifiers classifier, String cls, String objectId, double weight, String instancesS, boolean enhance, String columns) Register source in SourcesOfInterest.- Parameters:
classifier
- TheClassifier
to be used.cls
- The type (class) of SourcesOfInterestVertex
. 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.instanceS
- The jd of related Alerts as strings separated by comma. Potential square brackets are removed. May be null or empty.enhance
- Whether expand tree under all SourcesOfInterest with alerts possibly filled with requested HBase columns.columns
- The HBase columns to be filled into alerts. May be null. Ignored if enhancement not requested.
-
registerSourcesOfInterest
public void registerSourcesOfInterest(Classifiers classifier, String cls, String objectId, double weight, Set<Double> instances, boolean enhance, String columns) Register source in SourcesOfInterest.- Parameters:
classifier
- TheClassifier
to be used.cls
- The type (class) of SourcesOfInterestVertex
. 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.instances
- The jd of related Alerts.enhance
- Whether expand tree under all SourcesOfInterest with alerts filled with requested HBase columns.columns
- The HBase columns to be filled into alerts. May be null. Ignored if enhancement not requested.
-
enhanceSourcesOfInterest
public void enhanceSourcesOfInterest(Classifiers classifier, String columns) throws LomikelException Expand tree under all SourcesOfInterest with alerts filled with requested HBase columns.- Parameters:
classifier
- TheClassifier
to be used.columns
- The HBase columns to be filled into alerts. May be null.- Throws:
LomikelException
- If anything goes wrong.
-
enhanceSourcesOfInterest
public void enhanceSourcesOfInterest(Classifiers classifier, String cls, String columns) throws LomikelException Expand tree under SourcesOfInterest with alerts filled with requested HBase columns.- Parameters:
classifier
- TheClassifier
to be used.cls
- The type (class) of SourcesOfInterest.columns
- The HBase columns to be filled into alerts. May be null.- Throws:
LomikelException
- If anything goes wrong.
-
enhanceSource
public void enhanceSource(Classifiers classifier, Vertex source, String[] jds, String columns) throws LomikelException Expand tree under source with alerts filled with requested HBase columns. It also assembles related AlertsOfInterest.- Parameters:
classifier
- TheClassifier
to be used.source
- The source.jds
- The jd of related Alerts.columns
- The HBase columns to be filled into alerts. May be null.- Throws:
LomikelException
- If anything goes wrong.
-
cleanSourcesOfInterest
Clean tree under SourcesOfInterest. Drop alerts. Alerts are dropped even if they have otherEdge
s.- Parameters:
classifier
- TheClassifier
to be used.cls
- The type (class) of SourcesOfInterest.- Throws:
LomikelException
- If anything goes wrong.
-
assembleAlertsOfInterest
Assemble AlertsOfInterest from all existing alerts.- Parameters:
classifier
- TheClassifier
to be used.
-
assembleAlertsOfInterest
Assemble AlertsOfInterest from an alert.- Parameters:
classifier
- TheClassifier
to be used.alert
- The existing alert.
-
generateCorrelations
Generate overlaps Edges between AlertsOfInterest and SourcesOfInterest. Possibly between twoClassifier
s.- Parameters:
classifiers
- TheClassifier
s to be used.
-
fhclient
Create a newFinkHBaseClient
. Singleton when url unchanged.- Parameters:
hbaseUrl
- The HBase url as ip: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].
-