Class TableDataWriteChannel

java.lang.Object
com.google.cloud.BaseWriteChannel<BigQueryOptions,WriteChannelConfiguration>
com.google.cloud.bigquery.TableDataWriteChannel
All Implemented Interfaces:
com.google.cloud.Restorable<com.google.cloud.WriteChannel>, com.google.cloud.WriteChannel, Closeable, AutoCloseable, Channel, WritableByteChannel

public class TableDataWriteChannel extends com.google.cloud.BaseWriteChannel<BigQueryOptions,WriteChannelConfiguration>
WriteChannel implementation to stream data into a BigQuery table. Use getJob() to get the job used to insert streamed data. Please notice that getJob() returns null until the channel is closed.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.google.cloud.BaseWriteChannel

    com.google.cloud.BaseWriteChannel.BaseState<ServiceOptionsT extends com.google.cloud.ServiceOptions<?,ServiceOptionsT>,EntityT extends Serializable>
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    flushBuffer(int length, boolean last)
     
    Returns the Job created to insert the rows.
    protected com.google.cloud.bigquery.TableDataWriteChannel.StateImpl.Builder
     

    Methods inherited from class com.google.cloud.BaseWriteChannel

    capture, close, getBuffer, getChunkSize, getDefaultChunkSize, getEntity, getLimit, getMinChunkSize, getOptions, getPosition, getUploadId, isOpen, restore, setChunkSize, write

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • flushBuffer

      protected void flushBuffer(int length, boolean last)
      Specified by:
      flushBuffer in class com.google.cloud.BaseWriteChannel<BigQueryOptions,WriteChannelConfiguration>
    • stateBuilder

      protected com.google.cloud.bigquery.TableDataWriteChannel.StateImpl.Builder stateBuilder()
      Specified by:
      stateBuilder in class com.google.cloud.BaseWriteChannel<BigQueryOptions,WriteChannelConfiguration>
    • getJob

      public Job getJob()
      Returns the Job created to insert the rows. The job is available only once the upload finished and the channel was closed, returns null otherwise.