Package org.pipecraft.pipes.terminal
Class StorageTxtFileWriterPipe
- java.lang.Object
-
- org.pipecraft.pipes.terminal.TerminalPipe
-
- org.pipecraft.pipes.terminal.StorageTxtFileWriterPipe
-
- All Implemented Interfaces:
Closeable,AutoCloseable,BasePipe
public class StorageTxtFileWriterPipe extends TerminalPipe
A terminal pipe writing text lines from the input pipe into a remote cloud storage file. Supports compression. Note that this class makes use of upload using IO streams, which is an optional feature ofBucketclass. Therefore, some types ofStoragewon't be supported here.- Author:
- Eyal Schneider
-
-
Constructor Summary
Constructors Constructor Description StorageTxtFileWriterPipe(Pipe<String> input, Storage<?,?> storage, String bucket, String path)Constructor Uses default write options and chunk size, and assumes UTF8StorageTxtFileWriterPipe(Pipe<String> input, Storage<?,?> gs, String bucket, String path, Charset charset)Constructor Uses the default write options and chunk sizeStorageTxtFileWriterPipe(Pipe<String> input, Storage<?,?> storage, String bucket, String path, Charset charset, int chunkSize, FileWriteOptions options)ConstructorStorageTxtFileWriterPipe(Pipe<String> input, Storage<?,?> storage, String bucket, String path, FileWriteOptions options)Constructor Uses default chunk size and UTF8
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidstart()Performs pre-processing prior to item flow throw the pipe.-
Methods inherited from class org.pipecraft.pipes.terminal.TerminalPipe
getProgress
-
-
-
-
Constructor Detail
-
StorageTxtFileWriterPipe
public StorageTxtFileWriterPipe(Pipe<String> input, Storage<?,?> storage, String bucket, String path, Charset charset, int chunkSize, FileWriteOptions options)
Constructor- Parameters:
input- The input pipestorage- The cloud storage connectorbucket- The bucket to write topath- The full path (excluding the bucket) of the target filechunkSize- The size (in bytes) of each chunk written to GS at once, or 0 for using the default one.charset- The charset to useoptions- The file writing options. Note that append and temp aren't supported by GS, so these flag are ignored.
-
StorageTxtFileWriterPipe
public StorageTxtFileWriterPipe(Pipe<String> input, Storage<?,?> gs, String bucket, String path, Charset charset)
Constructor Uses the default write options and chunk size- Parameters:
input- The input pipegs- The cloud storage connectorbucket- The bucket to write topath- The full path (excluding the bucket) of the target filecharset- The charset to use
-
StorageTxtFileWriterPipe
public StorageTxtFileWriterPipe(Pipe<String> input, Storage<?,?> storage, String bucket, String path, FileWriteOptions options)
Constructor Uses default chunk size and UTF8- Parameters:
input- The input pipestorage- The cloud storage connectorbucket- The bucket to write topath- The full path (excluding the bucket) of the target fileoptions- The file writing options. Note that append isn't supported by GS, so this flag is ignored.
-
StorageTxtFileWriterPipe
public StorageTxtFileWriterPipe(Pipe<String> input, Storage<?,?> storage, String bucket, String path)
Constructor Uses default write options and chunk size, and assumes UTF8- Parameters:
input- The input pipestorage- The cloud storage connectorbucket- The bucket to write topath- The full path (excluding the bucket) of the target file
-
-
Method Detail
-
start
public void start() throws PipeException, InterruptedExceptionDescription copied from interface:BasePipePerforms pre-processing prior to item flow throw the pipe. Implementations must call the same method for all their input pipes before accessing their items. This is typically done here.- Throws:
PipeException- In case of pipe errors in this pipe or somewhere up-stream.InterruptedException- In case that the operation has been interrupted by another thread.
-
close
public void close() throws IOException- Throws:
IOException
-
-