java.lang.Object
org.elasticsearch.compute.operator.Warnings
Utilities to collect warnings for running an executor.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic WarningscreateOnlyWarnings(DriverContext.WarningsMode warningsMode, WarningSourceLocation source) Create a new warnings object based on the given mode which warns that evaluation resulted in warnings.static WarningscreateWarnings(DriverContext.WarningsMode warningsMode, WarningSourceLocation source) Create a new warnings object based on the given modestatic WarningscreateWarningsTreatedAsFalse(DriverContext.WarningsMode warningsMode, WarningSourceLocation source) Create a new warnings object based on the given mode which warns that it treats the result asfalse.voidregisterException(Class<? extends Exception> exceptionClass, String message) Register an exception to be included in the warnings.voidregisterException(Exception exception) voidregisterWarning(String message) Register a custom warning message (not tied to an exception).
-
Field Details
-
NOOP_WARNINGS
-
-
Method Details
-
createWarnings
public static Warnings createWarnings(DriverContext.WarningsMode warningsMode, WarningSourceLocation source) Create a new warnings object based on the given mode- Parameters:
warningsMode- The warnings collection strategy to usesource- The source location information for warnings- Returns:
- A warnings collector object
-
createWarningsTreatedAsFalse
public static Warnings createWarningsTreatedAsFalse(DriverContext.WarningsMode warningsMode, WarningSourceLocation source) Create a new warnings object based on the given mode which warns that it treats the result asfalse.- Parameters:
warningsMode- The warnings collection strategy to usesource- The source location information for warnings- Returns:
- A warnings collector object
-
createOnlyWarnings
public static Warnings createOnlyWarnings(DriverContext.WarningsMode warningsMode, WarningSourceLocation source) Create a new warnings object based on the given mode which warns that evaluation resulted in warnings.- Parameters:
warningsMode- The warnings collection strategy to usesource- The source location information for warnings- Returns:
- A warnings collector object
-
registerException
-
registerException
Register an exception to be included in the warnings.This overload avoids the need to instantiate the exception, which can be expensive. Instead, it asks only the required pieces to build the warning.
-
registerWarning
Register a custom warning message (not tied to an exception). Even if the very same warning is registered multiple times, it will only be emitted once. This method therefore caches the emitted message and should not be called with non-constant messages!
-