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 Details

  • Constructor Details

  • 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 the Classifier 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 from FPC, if contains Anomaly, get anomalies from FPC, 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 - The Classifierss 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 from FPC, if contains Anomaly, get anomalies from FPC, 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 - The Classifierss to be used.
      oids - The Set 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 - The Classifier 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 - The Classifier to be used.
      cls - The type (class) of SourcesOfInterest Vertex. It will be created if not yet exists.
      objectId - The objectId of the new Source Vertex. 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 - The Classifier to be used.
      cls - The type (class) of SourcesOfInterest Vertex. It will be created if not yet exists.
      objectId - The objectId of the new Source Vertex. 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 - The Classifier 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 - The Classifier 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 - The Classifier 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

      public void cleanSourcesOfInterest(Classifiers classifier, String cls) throws LomikelException
      Clean tree under SourcesOfInterest. Drop alerts. Alerts are dropped even if they have other Edges.
      Parameters:
      classifier - The Classifier to be used.
      cls - The type (class) of SourcesOfInterest.
      Throws:
      LomikelException - If anything goes wrong.
    • assembleAlertsOfInterest

      public void assembleAlertsOfInterest(Classifiers classifier)
      Assemble AlertsOfInterest from all existing alerts.
      Parameters:
      classifier - The Classifier to be used.
    • assembleAlertsOfInterest

      public void assembleAlertsOfInterest(Classifiers classifier, Vertex alert)
      Assemble AlertsOfInterest from an alert.
      Parameters:
      classifier - The Classifier to be used.
      alert - The existing alert.
    • generateCorrelations

      public void generateCorrelations(Classifiers... classifiers)
      Generate overlaps Edges between AlertsOfInterest and SourcesOfInterest. Possibly between two Classifiers.
      Parameters:
      classifiers - The Classifiers to be used.
    • fhclient

      public FinkHBaseClient fhclient(String hbaseUrl) throws LomikelException
      Create a new FinkHBaseClient. 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 existing FinkHBaseClient.
      Returns:
      The corresponding FinkHBaseClient.
      Throws:
      LomikelException - If not yet created.
    • hbaseUrl

      public String hbaseUrl()
      Give HBase url.
      Returns:
      The HBase url as ip:port:table[:schema].