minor fixes

This commit is contained in:
Marian Novotny
2022-11-02 11:44:29 +00:00
parent c41e208df8
commit 14dee31d73
9 changed files with 18 additions and 17 deletions

View File

@@ -15,7 +15,7 @@ import java.util.List;
import static uk.co.gresearch.siembol.alerts.common.AlertingResult.StatusCode.OK;
/**
* An object that validates, test and compiles alerting rules
* An object that validates, tests and compiles alerting rules
*
* <p>This interface provides functionality for validating, testing and compiling alerting rules.
* Moreover, it computes and provides json schema for alerting rules.
@@ -86,7 +86,7 @@ public interface AlertingCompiler {
String wrapRuleToRules(String rule) throws IOException;
/**
* Compiles rules into alerting engine and evaluate an event using the engine
* Compiles rules into alerting engine and evaluates an event using the engine
*
* @param rules json string with alerting rules
* @param event string json for evaluation
@@ -96,7 +96,7 @@ public interface AlertingCompiler {
AlertingResult testRules(String rules, String event);
/**
* Compiles a rule into alerting engine and evaluate an event using the engine
* Compiles a rule into alerting engine and evaluates an event using the engine
*
* @param rule json string with an alerting rule
* @param event string json for evaluation

View File

@@ -4,9 +4,9 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* An object that represents alerts context stored in alerting counters
* An object that represents an alert context stored in alerting counters
*
* <p>This object stores the context of the alert used in alerting counters.
* <p>This object stores the context of the alert used by alerting counters.
* It stores timestamp and field values that will be included after triggering the rule.
* It implements Comparable interface by comparing timestamps.
*

View File

@@ -12,7 +12,7 @@ import java.util.stream.Collectors;
import static uk.co.gresearch.siembol.alerts.common.AlertingTags.CORRELATION_KEY_TAG_NAME;
/**
* An object for correlation alerting rule
* An object for representing correlation alerting rule
*
* <p>This derived class of AbstractRule is implementing a correlation alerting rule
*
@@ -53,7 +53,7 @@ public class CorrelationRule extends AbstractRule {
}
/**
* Evaluates the rule by correlating teh alert with other alerts based on the correlation key.
* Evaluates the rule by correlating the alert with other alerts based on the correlation key.
* It uses alert counters to count alerts with thresholds specified in the alert counter metadata.
* It includes the matching result with attributes in alerting result.
* It includes correlated alerts into the attributes after triggering the rule.

View File

@@ -61,7 +61,7 @@ public abstract class AbstractRule {
}
/**
* Putting into event metadata about the rule that can be added after matching the rule
* Puts metadata about the rule into the event
*
* @param event the metadata will be put in the event map
*/
@@ -108,7 +108,7 @@ public abstract class AbstractRule {
/**
* Builds the alerting rule
*
* @return alerting rule built from the builder state and calling buildInternally method
* @return alerting rule built from the builder state and by calling buildInternally method
* @throws IllegalArgumentException in case of wrong arguments
*/
public T build() {
@@ -157,7 +157,7 @@ public abstract class AbstractRule {
/**
* Sets the tags - list of key value pairs
*
* @param tags list of key value pairs. Values can include variables for substitution
* @param tags list of key value pairs. Values can include variables for substitution.
* @return this builder
*/
public Builder<T> tags(List<Pair<String, String>> tags) {
@@ -179,7 +179,7 @@ public abstract class AbstractRule {
/**
* Sets the testing logger
*
* @param logger testign logger with debugging information about matching
* @param logger testing logger with debugging information about matching
* @return this builder
* @see TestingLogger
*/

View File

@@ -35,7 +35,7 @@ public class AlertingEngineImpl implements AlertingEngine {
}
/**
* Evaluate event using alerting rules and returns alerting result with
* Evaluates event using alerting rules and returns alerting result with
* a matching result and additional attributes such as matching events or exceptions.
* It returns matches of all rules.
*

View File

@@ -136,7 +136,7 @@ public class CompositeMatcher implements Matcher {
}
/**
* Sets the list of underlying matchers that shoudl be created in advance
* Sets the list of underlying matchers that should be created in advance
*
* @param matchers the list fo underlying matchers
* @return this builder

View File

@@ -8,7 +8,7 @@ import java.util.Map;
* An object for matching an event
*
* <p>This interface for matching an event and providing metadata for a caller such us
* the matcher is negated, or it can modify the event.
* the matcher is negated, or whether it can modify the event.
*
*
* @author Marian Novotny

View File

@@ -33,7 +33,8 @@ public class Rule extends AbstractRule {
}
/**
* Evaluates the rule by calling underlying matchers - all matchers need to match.
* Evaluates the rule by calling underlying matchers - all matchers are required to match for
* returning MATCH result.
* It includes the matching result with attributes in alerting result.
* It creates a copy of the event if the rule can modify the event during the evaluation.
*

View File

@@ -11,7 +11,7 @@ import java.util.stream.Collectors;
*
* <p>This class implements Serializable interface.
* It uses initialised AlertingSparkEngine instance to evaluate
* resilient distributed dataset (RDD) of json string of events using the MapReduce technique.
* resilient distributed dataset (RDD) of json strings of events using the MapReduce technique.
* AlertingSparkEngine, RDD of events and a Spark context are provided by the builder in the constructor.
*
* @author Marian Novotny
@@ -42,7 +42,7 @@ public class AlertingSparkJob implements Serializable {
}
/**
* An object for construction AlertingSParkJob instance
* An object for construction AlertingSparkJob instance
*
* <p>This class uses Builder pattern.
* It initialises AlertingSparkEngine from rules, RDD of events from files paths and a Spark context.