Codota Logo
AlertStreamEvent.setSeverity
Code IndexAdd Codota to your IDE (free)

How to use
setSeverity
method
in
org.apache.eagle.alert.engine.model.AlertStreamEvent

Best Java code snippets using org.apache.eagle.alert.engine.model.AlertStreamEvent.setSeverity (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: apache/eagle

  /**
   * TODO: Refactor wrapAlertPublishEvent into alertTemplateEngine and remove extraData from AlertStreamEvent.
   */
  @Override
  public AlertStreamEvent filter(AlertStreamEvent event) {
    event.ensureAlertId();
    Map<String, Object> extraData = new HashMap<>();
    List<String> appIds = new ArrayList<>();
    if (alertPublisherBolt.policyDefinitionMap == null || alertPublisherBolt.streamDefinitionMap == null) {
      LOG.warn("policyDefinitions or streamDefinitions in publisher bolt have not been initialized");
    } else {
      PolicyDefinition policyDefinition = alertPublisherBolt.policyDefinitionMap.get(event.getPolicyId());
      if (alertPublisherBolt.policyDefinitionMap != null && policyDefinition != null) {
        for (String inputStreamId : policyDefinition.getInputStreams()) {
          StreamDefinition sd = alertPublisherBolt.streamDefinitionMap.get(inputStreamId);
          if (sd != null) {
            extraData.put(AlertPublishEvent.SITE_ID_KEY, sd.getSiteId());
            appIds.add(sd.getStreamSource());
          }
        }
        extraData.put(AlertPublishEvent.APP_IDS_KEY, appIds);
        extraData.put(AlertPublishEvent.POLICY_VALUE_KEY, policyDefinition.getDefinition().getValue());
        event.setSeverity(policyDefinition.getAlertSeverity());
        event.setCategory(policyDefinition.getAlertCategory());
      }
      event.setContext(extraData);
    }
    return event;
  }
}
origin: apache/eagle

public static AlertStreamEvent createEvent(StreamDefinition stream, PolicyDefinition policy, Object[] data) {
  AlertStreamEvent event = new AlertStreamEvent();
  event.setPolicyId(policy.getName());
  event.setSchema(stream);
  event.setStreamId(stream.getStreamId());
  event.setTimestamp(System.currentTimeMillis());
  event.setCreatedTime(System.currentTimeMillis());
  event.setSubject("Namenode Disk Used 98%");
  event.setBody("Disk Usage of Test cluster's name node (<a href=\"#\">namenode.hostname.domain</a>) is <strong style=\"color: red\">98%</strong> at <strong>2016-11-30 12:30:45</strong>, exceeding alert threshold <strong>90</strong>%");
  event.setData(data);
  event.ensureAlertId();
  event.setSeverity(AlertSeverity.CRITICAL);
  event.setCategory("HDFS");
  event.setContext(new HashMap<String,Object>(){{
    put(AlertPublishEvent.SITE_ID_KEY,"TestCluster");
  }});
  Assert.assertNotNull(event.getAlertId());
  return event;
}
org.apache.eagle.alert.engine.modelAlertStreamEventsetSeverity

Popular methods of AlertStreamEvent

  • ensureAlertId
  • getAlertId
  • getBody
  • getCreatedTime
  • getPolicyId
  • getSubject
  • setData
  • toString
  • <init>
  • getContext
  • getData
  • getDataMap
  • getData,
  • getDataMap,
  • getStreamId,
  • setContext,
  • setCreatedTime,
  • setPolicyId,
  • setSchema,
  • setStreamId,
  • setTimestamp,
  • getCategory

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now