@InterfaceAudience.Private @InterfaceStability.Evolving public abstract class AbstractHDFSWriter extends Object implements HDFSWriter
Constructor and Description |
---|
AbstractHDFSWriter() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Context context)
Request the implementing class to (re)configure itself.
|
int |
getFsDesiredReplication() |
int |
getNumCurrentReplicas()
This method gets the datanode replication count for the current open file.
|
protected void |
hflushOrSync(org.apache.hadoop.fs.FSDataOutputStream os)
If hflush is available in this version of HDFS, then this method calls
hflush, else it calls sync.
|
protected boolean |
isFileAppendable(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem hdfs,
org.apache.hadoop.fs.Path dstPath) |
boolean |
isUnderReplicated()
Contract for subclasses: Call registerCurrentStream() on open,
unregisterCurrentStream() on close, and the base class takes care of the
rest.
|
protected void |
registerCurrentStream(org.apache.hadoop.fs.FSDataOutputStream outputStream,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path destPath) |
protected void |
unregisterCurrentStream() |
public void configure(Context context)
Configurable
Request the implementing class to (re)configure itself.
When configuration parameters are changed, they must be reflected by the component asap.
There are no thread safety guarantees on when configure might be called.
configure
in interface Configurable
public boolean isUnderReplicated()
isUnderReplicated
in interface HDFSWriter
protected void registerCurrentStream(org.apache.hadoop.fs.FSDataOutputStream outputStream, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path destPath)
protected void unregisterCurrentStream()
public int getFsDesiredReplication()
public int getNumCurrentReplicas() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
protected void hflushOrSync(org.apache.hadoop.fs.FSDataOutputStream os) throws IOException
os
- - The stream to flush/syncIOException
protected boolean isFileAppendable(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem hdfs, org.apache.hadoop.fs.Path dstPath) throws IOException
IOException
Copyright © 2009–2019 Apache Software Foundation. All rights reserved.