public abstract class AbstractHDFSWriter extends Object implements Writer
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.fs.Path |
filePath |
protected long |
lastUsedTime |
protected boolean |
needsRotation |
protected long |
offset |
protected FileRotationPolicy |
rotationPolicy |
| Constructor and Description |
|---|
AbstractHDFSWriter(FileRotationPolicy policy,
org.apache.hadoop.fs.Path path) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract void |
doClose() |
protected abstract void |
doSync() |
protected abstract void |
doWrite(Tuple tuple) |
org.apache.hadoop.fs.Path |
getFilePath() |
boolean |
needsRotation() |
void |
sync() |
long |
write(Tuple tuple) |
protected final org.apache.hadoop.fs.Path filePath
protected final FileRotationPolicy rotationPolicy
protected long lastUsedTime
protected long offset
protected boolean needsRotation
public AbstractHDFSWriter(FileRotationPolicy policy, org.apache.hadoop.fs.Path path)
public final long write(Tuple tuple) throws IOException
write in interface WriterIOExceptionpublic final void sync()
throws IOException
sync in interface WriterIOExceptionpublic final void close()
throws IOException
close in interface WriterIOExceptionpublic boolean needsRotation()
needsRotation in interface Writerpublic org.apache.hadoop.fs.Path getFilePath()
getFilePath in interface Writerprotected abstract void doWrite(Tuple tuple) throws IOException
IOExceptionprotected abstract void doSync()
throws IOException
IOExceptionprotected abstract void doClose()
throws IOException
IOExceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.