Package com.wavefront.agent.queueing
Class RetryTaskConverter<T extends DataSubmissionTask<T>>
- java.lang.Object
-
- com.wavefront.agent.queueing.RetryTaskConverter<T>
-
- Type Parameters:
T
- task type
- All Implemented Interfaces:
TaskConverter<T>
public class RetryTaskConverter<T extends DataSubmissionTask<T>> extends Object implements TaskConverter<T>
A serializer + deserializer ofDataSubmissionTask
objects for storage.- Author:
- [email protected]
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.wavefront.agent.queueing.TaskConverter
TaskConverter.CompressionType
-
-
Constructor Summary
Constructors Constructor Description RetryTaskConverter(String handle, TaskConverter.CompressionType compressionType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
fromBytes(byte[] bytes)
De-serializes an object from a byte array.Integer
getWeight(byte[] bytes)
Attempts to retrieve task weight from abyte[]
, without de-serializing the object, if at all possible.void
serializeToStream(T t, OutputStream bytes)
Serializesvalue
to bytes written to the specified stream.
-
-
-
Constructor Detail
-
RetryTaskConverter
public RetryTaskConverter(String handle, TaskConverter.CompressionType compressionType)
- Parameters:
handle
- Handle (usually port number) of the pipeline where the data came from.compressionType
- compression type to use for storing tasks.
-
-
Method Detail
-
fromBytes
@Nullable public T fromBytes(@Nonnull byte[] bytes)
Description copied from interface:TaskConverter
De-serializes an object from a byte array.- Specified by:
fromBytes
in interfaceTaskConverter<T extends DataSubmissionTask<T>>
- Returns:
- de-serialized object.
-
serializeToStream
public void serializeToStream(@Nonnull T t, @Nonnull OutputStream bytes) throws IOException
Description copied from interface:TaskConverter
Serializesvalue
to bytes written to the specified stream.- Specified by:
serializeToStream
in interfaceTaskConverter<T extends DataSubmissionTask<T>>
- Parameters:
t
- value to serialize.bytes
- output stream to write abyte[]
to.- Throws:
IOException
-
getWeight
@Nullable public Integer getWeight(@Nonnull byte[] bytes)
Description copied from interface:TaskConverter
Attempts to retrieve task weight from abyte[]
, without de-serializing the object, if at all possible.- Specified by:
getWeight
in interfaceTaskConverter<T extends DataSubmissionTask<T>>
- Returns:
- task weight or null if not applicable.
-
-