O - type of result produced by this output.public final class BigQueryGoogleCloudStorageStoreOutput<O> extends Output<O,BigQueryStoreResult<GoogleCloudStorageFileSet>>
Output that writes files in Google cloud storage using a format compatible with
bigquery ingestion.| Constructor and Description |
|---|
BigQueryGoogleCloudStorageStoreOutput(BigQueryMarshaller<O> bigQueryMarshaller,
String bucketName,
String fileNamePattern) |
| Modifier and Type | Method and Description |
|---|---|
List<MarshallingOutputWriter<O>> |
createWriters(int numShards)
Returns a list of writers, one for each shard, for this output.
|
BigQueryStoreResult<GoogleCloudStorageFileSet> |
finish(Collection<? extends OutputWriter<O>> writers)
Returns a result to be made available through
MapReduceResult.getOutputResult(). |
getContext, setContextpublic BigQueryGoogleCloudStorageStoreOutput(BigQueryMarshaller<O> bigQueryMarshaller, String bucketName, String fileNamePattern)
bigQueryMarshaller - use for generating the bigquery schema and marshal the data into
newline delimited json.public List<MarshallingOutputWriter<O>> createWriters(int numShards)
OutputcreateWriters in class Output<O,BigQueryStoreResult<GoogleCloudStorageFileSet>>numShards - The number of shards which should be equal to the number of
OutputWriters returned.public BigQueryStoreResult<GoogleCloudStorageFileSet> finish(Collection<? extends OutputWriter<O>> writers) throws IOException
OutputMapReduceResult.getOutputResult().
This method allows the Output to inspect the final state of its OutputWriters
to produce a final result object. For example, if the OutputWriters produce blobs in
blobstore, finish could collect and return a list of blob IDs.
Should return null if no such result makes sense for this kind of output.
Called after all OutputWriters have been closed (with OutputWriter.close()). It
is possible for this method to be called more than once with the same writers
collection. It is also possible for the job to fail after this is invoked.
The writers argument will contain the same writers that Output.createWriters(int) returned
in the same order. Writers may be serialized and deserialized multiple times. typically,
getWriter will have been called in a different JVM.
finish in class Output<O,BigQueryStoreResult<GoogleCloudStorageFileSet>>IOExceptionCopyright © 2015 Google. All rights reserved.