public class SimpleStringWriter extends org.apache.gobblin.writer.FsDataWriter<String>
allOutputFilesPropName, blockSize, branchId, bufferSize, closer, dirPermission, fileContext, fileName, filePermission, fs, FS_WRITER_METRICS_KEY, group, id, numBranches, outputFile, partitionKey, properties, replicationFactor, shouldIncludeRecordCountInFileName, stagingFile, WRITER_INCLUDE_RECORD_COUNT_IN_FILE_NAMES, writerAttemptIdOptional
Constructor and Description |
---|
SimpleStringWriter(SimpleStringWriterBuilder builder,
org.apache.gobblin.configuration.State properties) |
Modifier and Type | Method and Description |
---|---|
long |
bytesWritten()
Get the number of bytes written.
|
void |
flush()
Flush the staging file.
|
boolean |
isSpeculativeAttemptSafe() |
long |
recordsWritten()
Get the number of records written.
|
void |
write(String rec)
Write a source record to the staging file.
|
cleanup, close, commit, createStagingFileOutputStream, getDataDescriptor, getDefaultMetadata, getEncoders, getFinalState, getFullyQualifiedOutputFilePath, getOutputFilePath, setStagingFileGroup
public SimpleStringWriter(SimpleStringWriterBuilder builder, org.apache.gobblin.configuration.State properties) throws IOException
IOException
public void write(String rec) throws IOException
rec
- data record to writeIOException
- if there is anything wrong writing the recordpublic long recordsWritten()
public long bytesWritten() throws IOException
bytesWritten
in interface org.apache.gobblin.writer.DataWriter<String>
bytesWritten
in class org.apache.gobblin.writer.FsDataWriter<String>
IOException
public boolean isSpeculativeAttemptSafe()
isSpeculativeAttemptSafe
in interface org.apache.gobblin.commit.SpeculativeAttemptAwareConstruct
isSpeculativeAttemptSafe
in class org.apache.gobblin.writer.FsDataWriter<String>
public void flush() throws IOException
IOException
Copyright © 2021. All rights reserved.