java.lang.Object
org.elasticsearch.dlm.DataStreamLifecycleErrorStore
Provides a store for the errors the data stream lifecycle encounters.
It offers the functionality to record, retrieve, and clear errors for a specified target.
This class is thread safe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThis setting controls how often we signal that an index is in the error state when it comes to its data stream lifecycle progression.static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearRecordedError(ProjectId projectId, String indexName) Clears the recorded error for the provided index (if any exists)voidClears all the errors recorded in the store.getAllIndices(ProjectId projectId) Return an immutable view (a snapshot) of the tracked indices at the moment this method is called.Retrieves the recorded error for the provided index.getErrorsInfo(Predicate<ErrorEntry> errorEntryPredicate, int limit) Retrieve the error entries in the error store that satisfy the provided predicate.intGet the total number of error entries in the storevoidrecordAndLogError(ProjectId projectId, String targetIndex, Exception e, String logMessage, int signallingErrorRetryThreshold) Records the provided error for the index in the error store and logs the error message at `ERROR` level if the error for the index is different to what's already in the error store or if the same error was in the error store for a number of retries divisible by the provided signallingErrorRetryThreshold (i.e.recordError(ProjectId projectId, String indexName, Exception e) Records a string representation of the provided exception for the provided index.
-
Field Details
-
DATA_STREAM_SIGNALLING_ERROR_RETRY_INTERVAL_SETTING
This setting controls how often we signal that an index is in the error state when it comes to its data stream lifecycle progression. The signalling is currently logging at the `error` level but in the future it can signify other types of signalling. -
MAX_ERROR_MESSAGE_LENGTH
public static final int MAX_ERROR_MESSAGE_LENGTH- See Also:
-
-
Constructor Details
-
DataStreamLifecycleErrorStore
-
-
Method Details
-
recordError
Records a string representation of the provided exception for the provided index. If an error was already recorded for the provided index this will override that error. Returns the previously recorded error for the provided index, or null otherwise. -
clearRecordedError
Clears the recorded error for the provided index (if any exists) -
clearStore
public void clearStore()Clears all the errors recorded in the store. -
getError
Retrieves the recorded error for the provided index. -
getAllIndices
Return an immutable view (a snapshot) of the tracked indices at the moment this method is called. -
getErrorsInfo
Retrieve the error entries in the error store that satisfy the provided predicate. This will return the error entries information (a subset of all the fields anErrorEntryholds) sorted by the number of retries DSL attempted (descending order) and the number of entries will be limited according to the provided limit parameter. Returns empty list if no entries are present in the error store or none satisfy the predicate. -
getTotalErrorEntries
public int getTotalErrorEntries()Get the total number of error entries in the store -
recordAndLogError
public void recordAndLogError(ProjectId projectId, String targetIndex, Exception e, String logMessage, int signallingErrorRetryThreshold) Records the provided error for the index in the error store and logs the error message at `ERROR` level if the error for the index is different to what's already in the error store or if the same error was in the error store for a number of retries divisible by the provided signallingErrorRetryThreshold (i.e. we log to level `error` every signallingErrorRetryThreshold retries, if the error stays the same) This allows us to not spam the logs, but signal to the logs if DSL is not making progress.
-