Class GSTxtFileFetcherReaderPipe
- java.lang.Object
-
- org.pipecraft.pipes.sync.inter.CompoundPipe<String>
-
- org.pipecraft.pipes.sync.source.StorageTxtFileFetcherReaderPipe
-
- org.pipecraft.pipes.source.google_cs.GSTxtFileFetcherReaderPipe
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.pipecraft.pipes.BasePipe,org.pipecraft.pipes.sync.Pipe<String>
public class GSTxtFileFetcherReaderPipe extends org.pipecraft.pipes.sync.source.StorageTxtFileFetcherReaderPipeA source pipe providing the lines of a text file from Google-Storage. Supports decompression. In contrast to the streaming nature ofGSTxtFileReaderPipe, this implementation downloads the file completely first. This approach may be much faster for large files, since the download is optimized (sliced) and reading from local disk is usually faster than network read.- Author:
- Eyal Schneider
-
-
Constructor Summary
Constructors Constructor Description GSTxtFileFetcherReaderPipe(GoogleStorage gs, String bucket, String path, File tempFolder)Constructor Uses the default read chunk size and default read options, and assumes UTF8GSTxtFileFetcherReaderPipe(GoogleStorage gs, String bucket, String path, Charset charset, int chunkSize, org.pipecraft.infra.io.FileReadOptions options, File tempFolder)ConstructorGSTxtFileFetcherReaderPipe(GoogleStorage gs, String bucket, String path, Charset charset, File tempFolder)Constructor Uses the default read chunk size and default read optionsGSTxtFileFetcherReaderPipe(GoogleStorage gs, String bucket, String path, org.pipecraft.infra.io.FileReadOptions options, File tempFolder)Constructor Uses the default read chunk size and assumes UTF8
-
-
-
Constructor Detail
-
GSTxtFileFetcherReaderPipe
public GSTxtFileFetcherReaderPipe(GoogleStorage gs, String bucket, String path, Charset charset, int chunkSize, org.pipecraft.infra.io.FileReadOptions options, File tempFolder)
Constructor- Parameters:
gs- The Google-Storage connectorbucket- The bucket to read the file frompath- The full path of the text file inside the bucketcharset- The charset usedchunkSize- The size (in bytes) of each chunk read from GS at once, or 0 for using the default one.options- The file read optionstempFolder- A folder where to place the temporary file for the download. The file is deleted by the pipe at the end of work.
-
GSTxtFileFetcherReaderPipe
public GSTxtFileFetcherReaderPipe(GoogleStorage gs, String bucket, String path, Charset charset, File tempFolder)
Constructor Uses the default read chunk size and default read options- Parameters:
gs- The Google-Storage connectorbucket- The bucket to read the file frompath- The full path of the text file inside the bucketcharset- The charset usedtempFolder- A folder where to place the temporary file for the download. The file is deleted by the pipe at the end of work.
-
GSTxtFileFetcherReaderPipe
public GSTxtFileFetcherReaderPipe(GoogleStorage gs, String bucket, String path, File tempFolder)
Constructor Uses the default read chunk size and default read options, and assumes UTF8- Parameters:
gs- The Google-Storage connectorbucket- The bucket to read the file frompath- The full path of the text file inside the bucket. The file is assumed to be UTF8.tempFolder- A folder where to place the temporary file for the download. The file is deleted by the pipe at the end of work.
-
GSTxtFileFetcherReaderPipe
public GSTxtFileFetcherReaderPipe(GoogleStorage gs, String bucket, String path, org.pipecraft.infra.io.FileReadOptions options, File tempFolder)
Constructor Uses the default read chunk size and assumes UTF8- Parameters:
gs- The Google-Storage connectorbucket- The bucket to read the file frompath- The full path of the text file inside the bucket. The file is assumed to be UTF8.options- The file read optionstempFolder- A folder where to place the temporary file for the download. The file is deleted by the pipe at the end of work.
-
-