luigi.contrib.hdfs.format module

exception luigi.contrib.hdfs.format.HdfsAtomicWriteError[source]

Bases: OSError

class luigi.contrib.hdfs.format.HdfsReadPipe(path)[source]

Bases: InputPipeProcessWrapper

Initializes a InputPipeProcessWrapper instance.

Parameters:

command – a subprocess.Popen instance with stdin=input_pipe and stdout=subprocess.PIPE. Alternatively, just its args argument as a convenience.

class luigi.contrib.hdfs.format.HdfsAtomicWritePipe(path)[source]

Bases: OutputPipeProcessWrapper

File like object for writing to HDFS

The referenced file is first written to a temporary location and then renamed to final location on close(). If close() isn’t called the temporary file will be cleaned up when this object is garbage collected

TODO: if this is buggy, change it so it first writes to a local temporary file and then uploads it on completion

abort()[source]
close()[source]
class luigi.contrib.hdfs.format.HdfsAtomicWriteDirPipe(path, data_extension='')[source]

Bases: OutputPipeProcessWrapper

Writes a data<data_extension> file to a directory at <path>.

abort()[source]
close()[source]
class luigi.contrib.hdfs.format.PlainFormat[source]

Bases: Format

input = 'bytes'
output = 'hdfs'
hdfs_writer(path)[source]
hdfs_reader(path)[source]
pipe_reader(path)[source]
pipe_writer(output_pipe)[source]
class luigi.contrib.hdfs.format.PlainDirFormat[source]

Bases: Format

input = 'bytes'
output = 'hdfs'
hdfs_writer(path)[source]
hdfs_reader(path)[source]
pipe_reader(path)[source]
pipe_writer(path)[source]
class luigi.contrib.hdfs.format.CompatibleHdfsFormat(writer, reader, input=None)[source]

Bases: Format

output = 'hdfs'
pipe_writer(output)[source]
pipe_reader(input)[source]
hdfs_writer(output)[source]
hdfs_reader(input)[source]