Package org.apache.tika.pipes.api
Record Class PipesResult
java.lang.Object
java.lang.Record
org.apache.tika.pipes.api.PipesResult
- All Implemented Interfaces:
Serializable
public record PipesResult(PipesResult.RESULT_STATUS status, EmitData emitData, String message)
extends Record
implements Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHigh-level categorization of result statuses.static enum -
Constructor Summary
ConstructorsConstructorDescriptionPipesResult(PipesResult.RESULT_STATUS status) PipesResult(PipesResult.RESULT_STATUS status, String message) PipesResult(PipesResult.RESULT_STATUS status, EmitData emitData) PipesResult(PipesResult.RESULT_STATUS status, EmitData emitData, String message) Creates an instance of aPipesResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionemitData()Returns the value of theemitDatarecord component.final booleanIndicates whether some other object is "equal to" this one.Gets the high-level category for this result.final inthashCode()Returns a hash code value for this object.booleanisFatal()Checks if this result represents a fatal error.booleanChecks if this result represents an initialization failure.booleanChecks if this result represents a process crash (OOM, timeout, etc.).booleanChecks if this result represents successful processing.booleanChecks if this result represents a task-level exception.message()Returns the value of themessagerecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PipesResult
-
PipesResult
-
PipesResult
-
PipesResult
Creates an instance of aPipesResultrecord class.- Parameters:
status- the value for thestatusrecord componentemitData- the value for theemitDatarecord componentmessage- the value for themessagerecord component
-
-
Method Details
-
getCategory
Gets the high-level category for this result.- Returns:
- the category (FATAL, INITIALIZATION_FAILURE, TASK_EXCEPTION, PROCESS_CRASH, or SUCCESS)
-
isFatal
public boolean isFatal()Checks if this result represents a fatal error.Fatal errors mean the system cannot continue and must be fixed and restarted.
- Returns:
- true if this is a fatal error
-
isInitializationFailure
public boolean isInitializationFailure()Checks if this result represents an initialization failure.Initialization failures occur when a component (fetcher, emitter, client) fails to start. These might be transient (e.g., network issues) or require configuration fixes.
- Returns:
- true if a component failed to initialize
-
isTaskException
public boolean isTaskException()Checks if this result represents a task-level exception.Task exceptions indicate this specific task failed, but other tasks may succeed. Processing can continue with the next task.
- Returns:
- true if this task failed
-
isProcessCrash
public boolean isProcessCrash()Checks if this result represents a process crash (OOM, timeout, etc.).Process crashes are system-level failures where the forked process terminated abnormally. The process will be auto-restarted and processing can continue.
- Returns:
- true if the forked process crashed
-
isSuccess
public boolean isSuccess()Checks if this result represents successful processing.Success includes normal completion as well as cases where processing completed with warnings (e.g., PARSE_SUCCESS_WITH_EXCEPTION).
- Returns:
- true if processing completed successfully (possibly with warnings)
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
emitData
Returns the value of theemitDatarecord component.- Returns:
- the value of the
emitDatarecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-