public class S3PersistWriter extends Object implements StreamsPersistWriter, DatumStatusCountable
Modifier and Type | Field and Description |
---|---|
protected LineReadWriteUtil |
lineWriterUtil |
static String |
STREAMS_ID |
Constructor and Description |
---|
S3PersistWriter() |
S3PersistWriter(com.amazonaws.services.s3.AmazonS3Client amazonS3Client,
S3WriterConfiguration s3WriterConfiguration)
Instantiator with a pre-existing amazonS3Client, this is used to help with re-use.
|
S3PersistWriter(S3WriterConfiguration s3WriterConfiguration) |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp() |
com.amazonaws.services.s3.AmazonS3Client |
getAmazonS3Client() |
DatumStatusCounter |
getDatumStatusCounter() |
String |
getId() |
com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
Map<String,String> |
getObjectMetaData() |
S3WriterConfiguration |
getS3WriterConfiguration() |
List<String> |
getWrittenFiles() |
void |
prepare(Object configurationObject) |
OutputStreamWriter |
resetFile()
Reset File when it's time to create a new file.
|
void |
setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper) |
void |
setObjectMetaData(Map<String,String> val) |
void |
write(StreamsDatum streamsDatum) |
public static final String STREAMS_ID
protected LineReadWriteUtil lineWriterUtil
public S3PersistWriter()
public S3PersistWriter(S3WriterConfiguration s3WriterConfiguration)
public S3PersistWriter(com.amazonaws.services.s3.AmazonS3Client amazonS3Client, S3WriterConfiguration s3WriterConfiguration)
amazonS3Client
- If you have an existing amazonS3Client, it wont' bother to create another ones3WriterConfiguration
- Configuration of the write paths and instructions are still required.public com.amazonaws.services.s3.AmazonS3Client getAmazonS3Client()
public S3WriterConfiguration getS3WriterConfiguration()
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
public String getId()
getId
in interface StreamsOperation
public void write(StreamsDatum streamsDatum)
write
in interface StreamsPersistWriter
public OutputStreamWriter resetFile() throws Exception
Exception
- Exceptionpublic void prepare(Object configurationObject)
prepare
in interface StreamsOperation
public void cleanUp()
cleanUp
in interface StreamsOperation
public DatumStatusCounter getDatumStatusCounter()
getDatumStatusCounter
in interface DatumStatusCountable
Copyright © 2018 The Apache Software Foundation. All rights reserved.