Class BigQueryServicesImpl.WriteStreamServiceImpl
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.bigquery.BigQueryServicesImpl.WriteStreamServiceImpl
-
- All Implemented Interfaces:
java.lang.AutoCloseable,BigQueryServices.WriteStreamService
- Enclosing class:
- BigQueryServicesImpl
public static class BigQueryServicesImpl.WriteStreamServiceImpl extends java.lang.Object implements BigQueryServices.WriteStreamService
-
-
Constructor Summary
Constructors Constructor Description WriteStreamServiceImpl(BigQueryOptions bqOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()com.google.api.core.ApiFuture<com.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse>commitWriteStreams(java.lang.String tableUrn, java.lang.Iterable<java.lang.String> writeStreamNames)Commit write streams of type PENDING.com.google.cloud.bigquery.storage.v1.WriteStreamcreateWriteStream(java.lang.String tableUrn, com.google.cloud.bigquery.storage.v1.WriteStream.Type type)Create a Write Stream for use with the Storage Write API.com.google.api.core.ApiFuture<com.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse>finalizeWriteStream(java.lang.String streamName)Finalize a write stream.com.google.api.core.ApiFuture<com.google.cloud.bigquery.storage.v1.FlushRowsResponse>flush(java.lang.String streamName, long flushOffset)Flush a given stream up to the given offset.BigQueryServices.StreamAppendClientgetStreamAppendClient(java.lang.String streamName, com.google.protobuf.DescriptorProtos.DescriptorProto descriptor, boolean useConnectionPool, com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation missingValueInterpretation)Create an append client for a given Storage API write stream.@Nullable com.google.cloud.bigquery.storage.v1.TableSchemagetWriteStreamSchema(java.lang.String writeStream)
-
-
-
Constructor Detail
-
WriteStreamServiceImpl
public WriteStreamServiceImpl(BigQueryOptions bqOptions)
-
-
Method Detail
-
createWriteStream
public com.google.cloud.bigquery.storage.v1.WriteStream createWriteStream(java.lang.String tableUrn, com.google.cloud.bigquery.storage.v1.WriteStream.Type type) throws java.io.IOExceptionDescription copied from interface:BigQueryServices.WriteStreamServiceCreate a Write Stream for use with the Storage Write API.- Specified by:
createWriteStreamin interfaceBigQueryServices.WriteStreamService- Throws:
java.io.IOException
-
getWriteStreamSchema
public @Nullable com.google.cloud.bigquery.storage.v1.TableSchema getWriteStreamSchema(java.lang.String writeStream)
- Specified by:
getWriteStreamSchemain interfaceBigQueryServices.WriteStreamService
-
getStreamAppendClient
public BigQueryServices.StreamAppendClient getStreamAppendClient(java.lang.String streamName, com.google.protobuf.DescriptorProtos.DescriptorProto descriptor, boolean useConnectionPool, com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation missingValueInterpretation) throws java.lang.Exception
Description copied from interface:BigQueryServices.WriteStreamServiceCreate an append client for a given Storage API write stream. The stream must be created first.- Specified by:
getStreamAppendClientin interfaceBigQueryServices.WriteStreamService- Throws:
java.lang.Exception
-
flush
public com.google.api.core.ApiFuture<com.google.cloud.bigquery.storage.v1.FlushRowsResponse> flush(java.lang.String streamName, long flushOffset) throws java.io.IOException, java.lang.InterruptedExceptionDescription copied from interface:BigQueryServices.WriteStreamServiceFlush a given stream up to the given offset. The stream must have type BUFFERED.- Specified by:
flushin interfaceBigQueryServices.WriteStreamService- Throws:
java.io.IOExceptionjava.lang.InterruptedException
-
finalizeWriteStream
public com.google.api.core.ApiFuture<com.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse> finalizeWriteStream(java.lang.String streamName)
Description copied from interface:BigQueryServices.WriteStreamServiceFinalize a write stream. After finalization, no more records can be appended to the stream.- Specified by:
finalizeWriteStreamin interfaceBigQueryServices.WriteStreamService
-
commitWriteStreams
public com.google.api.core.ApiFuture<com.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse> commitWriteStreams(java.lang.String tableUrn, java.lang.Iterable<java.lang.String> writeStreamNames)Description copied from interface:BigQueryServices.WriteStreamServiceCommit write streams of type PENDING. The streams must be finalized before committing.- Specified by:
commitWriteStreamsin interfaceBigQueryServices.WriteStreamService
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
-