Class RetryState
-
- All Implemented Interfaces:
-
java.io.Externalizable
,java.io.Serializable
,java.lang.Comparable
,org.apache.avro.generic.GenericContainer
,org.apache.avro.generic.GenericRecord
,org.apache.avro.generic.IndexedRecord
,org.apache.avro.specific.SpecificRecord
public class RetryState extends SpecificRecordBase implements SpecificRecord
The Retry State records the need to retry a failed event on the flow Checkpoint
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
RetryState.Builder
RecordBuilder for RetryState instances.
-
Field Summary
Fields Modifier and Type Field Description public final static Schema
SCHEMA$
public int
retryCount
public FlowEvent
failedEvent
public ExceptionEnvelope
error
public Instant
firstFailureTimestamp
public Instant
lastFailureTimestamp
-
Constructor Summary
Constructors Constructor Description RetryState()
Default constructor. RetryState(Integer retryCount, FlowEvent failedEvent, ExceptionEnvelope error, Instant firstFailureTimestamp, Instant lastFailureTimestamp)
All-args constructor.
-
Method Summary
Modifier and Type Method Description int
getRetryCount()
Gets the value of the 'retryCount' field. void
setRetryCount(int value)
Sets the value of the 'retryCount' field. FlowEvent
getFailedEvent()
Gets the value of the 'failedEvent' field. void
setFailedEvent(FlowEvent value)
Sets the value of the 'failedEvent' field. ExceptionEnvelope
getError()
Gets the value of the 'error' field. void
setError(ExceptionEnvelope value)
Sets the value of the 'error' field. Instant
getFirstFailureTimestamp()
Gets the value of the 'firstFailureTimestamp' field. void
setFirstFailureTimestamp(Instant value)
Sets the value of the 'firstFailureTimestamp' field. Instant
getLastFailureTimestamp()
Gets the value of the 'lastFailureTimestamp' field. void
setLastFailureTimestamp(Instant value)
Sets the value of the 'lastFailureTimestamp' field. static Schema
getClassSchema()
static BinaryMessageEncoder<RetryState>
getEncoder()
Return the BinaryMessageEncoder instance used by this class. static BinaryMessageDecoder<RetryState>
getDecoder()
Return the BinaryMessageDecoder instance used by this class. static BinaryMessageDecoder<RetryState>
createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore. ByteBuffer
toByteBuffer()
Serializes this RetryState to a ByteBuffer. static RetryState
fromByteBuffer(ByteBuffer b)
Deserializes a RetryState from a ByteBuffer. SpecificData
getSpecificData()
Schema
getSchema()
Object
get(int field$)
Conversion<out Object>
getConversion(int field)
void
put(int field$, Object value$)
static RetryState.Builder
newBuilder()
Creates a new RetryState RecordBuilder. static RetryState.Builder
newBuilder(RetryState.Builder other)
Creates a new RetryState RecordBuilder by copying an existing Builder. static RetryState.Builder
newBuilder(RetryState other)
Creates a new RetryState RecordBuilder by copying an existing RetryState instance. void
writeExternal(ObjectOutput out)
void
readExternal(ObjectInput in)
-
Methods inherited from class org.apache.avro.specific.SpecificRecordBase
compareTo, customDecode, customEncode, equals, hashCode, toString
-
Methods inherited from class org.apache.avro.generic.GenericRecord
hasField
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
RetryState
RetryState()
Default constructor.
-
RetryState
RetryState(Integer retryCount, FlowEvent failedEvent, ExceptionEnvelope error, Instant firstFailureTimestamp, Instant lastFailureTimestamp)
All-args constructor.- Parameters:
retryCount
- The current retry count, set to 0 for the initial failurefailedEvent
- Copy of the event that caused the failureerror
- The original error that caused the retryfirstFailureTimestamp
- The timestamp of when the first exception occurred that triggered a retrylastFailureTimestamp
- The timestamp of when the last exception occurred that triggered a retry (this will be the same as firstRetryTimestamp for a first time failure
-
-
Method Detail
-
getRetryCount
int getRetryCount()
Gets the value of the 'retryCount' field.
-
setRetryCount
void setRetryCount(int value)
Sets the value of the 'retryCount' field. The current retry count, set to 0 for the initial failure
- Parameters:
value
- the value to set.
-
getFailedEvent
FlowEvent getFailedEvent()
Gets the value of the 'failedEvent' field.
-
setFailedEvent
void setFailedEvent(FlowEvent value)
Sets the value of the 'failedEvent' field. Copy of the event that caused the failure
- Parameters:
value
- the value to set.
-
getError
ExceptionEnvelope getError()
Gets the value of the 'error' field.
-
setError
void setError(ExceptionEnvelope value)
Sets the value of the 'error' field. The original error that caused the retry
- Parameters:
value
- the value to set.
-
getFirstFailureTimestamp
Instant getFirstFailureTimestamp()
Gets the value of the 'firstFailureTimestamp' field.
-
setFirstFailureTimestamp
void setFirstFailureTimestamp(Instant value)
Sets the value of the 'firstFailureTimestamp' field. The timestamp of when the first exception occurred that triggered a retry
- Parameters:
value
- the value to set.
-
getLastFailureTimestamp
Instant getLastFailureTimestamp()
Gets the value of the 'lastFailureTimestamp' field.
-
setLastFailureTimestamp
void setLastFailureTimestamp(Instant value)
Sets the value of the 'lastFailureTimestamp' field. The timestamp of when the last exception occurred that triggered a retry (this will be the same as firstRetryTimestamp for a first time failure
- Parameters:
value
- the value to set.
-
getClassSchema
static Schema getClassSchema()
-
getEncoder
static BinaryMessageEncoder<RetryState> getEncoder()
Return the BinaryMessageEncoder instance used by this class.
-
getDecoder
static BinaryMessageDecoder<RetryState> getDecoder()
Return the BinaryMessageDecoder instance used by this class.
-
createDecoder
static BinaryMessageDecoder<RetryState> createDecoder(SchemaStore resolver)
Create a new BinaryMessageDecoder instance for this class that uses the specified SchemaStore.
- Parameters:
resolver
- a SchemaStore used to find schemas by fingerprint
-
toByteBuffer
ByteBuffer toByteBuffer()
Serializes this RetryState to a ByteBuffer.
-
fromByteBuffer
static RetryState fromByteBuffer(ByteBuffer b)
Deserializes a RetryState from a ByteBuffer.
- Parameters:
b
- a byte buffer holding serialized data for an instance of this class
-
getSpecificData
SpecificData getSpecificData()
-
getSchema
Schema getSchema()
-
getConversion
Conversion<out Object> getConversion(int field)
-
newBuilder
static RetryState.Builder newBuilder()
Creates a new RetryState RecordBuilder.
-
newBuilder
static RetryState.Builder newBuilder(RetryState.Builder other)
Creates a new RetryState RecordBuilder by copying an existing Builder.
- Parameters:
other
- The existing builder to copy.
-
newBuilder
static RetryState.Builder newBuilder(RetryState other)
Creates a new RetryState RecordBuilder by copying an existing RetryState instance.
- Parameters:
other
- The existing instance to copy.
-
writeExternal
void writeExternal(ObjectOutput out)
-
readExternal
void readExternal(ObjectInput in)
-
-
-
-