public final class AvroFileWriter extends Object implements Closeable, Flushable
| Modifier and Type | Class and Description |
|---|---|
class |
AvroFileWriter.AvroFile
Represents an Avro file.
|
| Constructor and Description |
|---|
AvroFileWriter(FileMetaDataManager fileMetaDataManager,
CConfiguration cConf,
Location rootDir,
String logBaseDir,
Schema schema,
long maxFileSize,
int syncIntervalBytes,
long inactiveIntervalMs)
Constructs an AvroFileWriter object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(List<? extends LogWriteEvent> events)
Appends a log event to an appropriate Avro file based on LoggingContext.
|
void |
close() |
void |
flush() |
public AvroFileWriter(FileMetaDataManager fileMetaDataManager, CConfiguration cConf, Location rootDir, String logBaseDir, Schema schema, long maxFileSize, int syncIntervalBytes, long inactiveIntervalMs)
fileMetaDataManager - used to store file meta data.cConf - the CDAP configurationrootDir - the CDAP root dir on the filesystemlogBaseDir - the basedirectory for logs as defined in configurationschema - schema of the Avro data to be written.maxFileSize - Avro files greater than maxFileSize will get rotated.syncIntervalBytes - the approximate number of uncompressed bytes to write in each block.inactiveIntervalMs - files that have no data written for more than inactiveIntervalMs will be closed.public void append(List<? extends LogWriteEvent> events) throws Exception
events - Log eventIOExceptionExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void flush()
throws IOException
flush in interface FlushableIOExceptionCopyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.