public class AvroItemWriter<T> extends AbstractItemStreamItemWriter<T>
ItemWriter that serializes data to an WritableResource using Avro.
This does not support restart on failure.| Constructor and Description |
|---|
AvroItemWriter(org.springframework.core.io.WritableResource resource,
java.lang.Class<T> clazz)
This constructor will create an ItemWriter that does not embedded Avro schema.
|
AvroItemWriter(org.springframework.core.io.WritableResource resource,
org.springframework.core.io.Resource schema,
java.lang.Class<T> clazz) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
No-op.
|
void |
open(ExecutionContext executionContext)
No-op.
|
void |
write(java.util.List<? extends T> items)
Process the supplied data element.
|
getExecutionContextKey, setExecutionContextName, setName, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupdatepublic AvroItemWriter(org.springframework.core.io.WritableResource resource,
org.springframework.core.io.Resource schema,
java.lang.Class<T> clazz)
resource - a WritableResource to which the objects will be serialized.schema - a Resource containing the Avro schema.clazz - the data type to be serialized.public AvroItemWriter(org.springframework.core.io.WritableResource resource,
java.lang.Class<T> clazz)
resource - a WritableResource to which the objects will be serialized.clazz - the data type to be serialized.public void write(java.util.List<? extends T> items) throws java.lang.Exception
ItemWriteritems - items to be writtenjava.lang.Exception - if there are errors. The framework will catch the
exception and convert or rethrow it as appropriate.public void open(ExecutionContext executionContext)
ItemStreamSupportopen in interface ItemStreamopen in class ItemStreamSupportexecutionContext - current step's ExecutionContext. Will be the
executionContext from the last run of the step on a restart.ItemStream.open(ExecutionContext)public void close()
ItemStreamSupportclose in interface ItemStreamclose in class ItemStreamSupportItemStream.close()