Class BigQueryServicesImpl.WriteStreamServiceImpl
java.lang.Object
org.apache.beam.sdk.io.gcp.bigquery.BigQueryServicesImpl.WriteStreamServiceImpl
- All Implemented Interfaces:
AutoCloseable
,BigQueryServices.WriteStreamService
- Enclosing class:
BigQueryServicesImpl
public static class BigQueryServicesImpl.WriteStreamServiceImpl
extends Object
implements BigQueryServices.WriteStreamService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
com.google.api.core.ApiFuture
<com.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse> commitWriteStreams
(String tableUrn, Iterable<String> writeStreamNames) Commit write streams of type PENDING.com.google.cloud.bigquery.storage.v1.WriteStream
createWriteStream
(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
(String streamName) Finalize a write stream.com.google.api.core.ApiFuture
<com.google.cloud.bigquery.storage.v1.FlushRowsResponse> Flush a given stream up to the given offset.getStreamAppendClient
(String streamName, 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.TableSchema
getWriteStreamSchema
(String writeStream)
-
Constructor Details
-
WriteStreamServiceImpl
-
-
Method Details
-
createWriteStream
public com.google.cloud.bigquery.storage.v1.WriteStream createWriteStream(String tableUrn, com.google.cloud.bigquery.storage.v1.WriteStream.Type type) throws IOException Description copied from interface:BigQueryServices.WriteStreamService
Create a Write Stream for use with the Storage Write API.- Specified by:
createWriteStream
in interfaceBigQueryServices.WriteStreamService
- Throws:
IOException
-
getWriteStreamSchema
public @Nullable com.google.cloud.bigquery.storage.v1.TableSchema getWriteStreamSchema(String writeStream) - Specified by:
getWriteStreamSchema
in interfaceBigQueryServices.WriteStreamService
-
getStreamAppendClient
public BigQueryServices.StreamAppendClient getStreamAppendClient(String streamName, DescriptorProtos.DescriptorProto descriptor, boolean useConnectionPool, com.google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation missingValueInterpretation) throws Exception Description copied from interface:BigQueryServices.WriteStreamService
Create an append client for a given Storage API write stream. The stream must be created first.- Specified by:
getStreamAppendClient
in interfaceBigQueryServices.WriteStreamService
- Throws:
Exception
-
flush
public com.google.api.core.ApiFuture<com.google.cloud.bigquery.storage.v1.FlushRowsResponse> flush(String streamName, long flushOffset) throws IOException, InterruptedException Description copied from interface:BigQueryServices.WriteStreamService
Flush a given stream up to the given offset. The stream must have type BUFFERED.- Specified by:
flush
in interfaceBigQueryServices.WriteStreamService
- Throws:
IOException
InterruptedException
-
finalizeWriteStream
public com.google.api.core.ApiFuture<com.google.cloud.bigquery.storage.v1.FinalizeWriteStreamResponse> finalizeWriteStream(String streamName) Description copied from interface:BigQueryServices.WriteStreamService
Finalize a write stream. After finalization, no more records can be appended to the stream.- Specified by:
finalizeWriteStream
in interfaceBigQueryServices.WriteStreamService
-
commitWriteStreams
public com.google.api.core.ApiFuture<com.google.cloud.bigquery.storage.v1.BatchCommitWriteStreamsResponse> commitWriteStreams(String tableUrn, Iterable<String> writeStreamNames) Description copied from interface:BigQueryServices.WriteStreamService
Commit write streams of type PENDING. The streams must be finalized before committing.- Specified by:
commitWriteStreams
in interfaceBigQueryServices.WriteStreamService
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-