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 Writer
IOException
public final void sync() throws IOException
sync
in interface Writer
IOException
public final void close() throws IOException
close
in interface Writer
IOException
public boolean needsRotation()
needsRotation
in interface Writer
public org.apache.hadoop.fs.Path getFilePath()
getFilePath
in interface Writer
protected abstract void doWrite(Tuple tuple) throws IOException
IOException
protected abstract void doSync() throws IOException
IOException
protected abstract void doClose() throws IOException
IOException
Copyright © 2022 The Apache Software Foundation. All rights reserved.