Class JsonStreamWriter

java.lang.Object
com.google.cloud.bigquery.storage.v1beta2.JsonStreamWriter
All Implemented Interfaces:
AutoCloseable

@Deprecated public class JsonStreamWriter extends Object implements AutoCloseable
Deprecated.
A StreamWriter that can write JSON data (JSONObjects) to BigQuery tables. The JsonStreamWriter is built on top of a StreamWriter, and it simply converts all JSON data to protobuf messages then calls StreamWriter's append() method to write to BigQuery tables.

This client lib is deprecated, please use v1 instead.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.api.core.ApiFuture<AppendRowsResponse>
    append(org.json.JSONArray jsonArr)
    Deprecated.
    Writes a JSONArray that contains JSONObjects to the BigQuery table by first converting the JSON data to protobuf messages, then using StreamWriter's append() to write the data.
    com.google.api.core.ApiFuture<AppendRowsResponse>
    append(org.json.JSONArray jsonArr, long offset)
    Deprecated.
    Writes a JSONArray that contains JSONObjects to the BigQuery table by first converting the JSON data to protobuf messages, then using StreamWriter's append() to write the data.
    void
    Deprecated.
    Closes the underlying StreamWriter.
    com.google.protobuf.Descriptors.Descriptor
    Deprecated.
    Gets current descriptor
    Deprecated.
    Gets streamName
    newBuilder(String streamOrTableName, TableSchema tableSchema)
    Deprecated.
    newBuilder that constructs a JsonStreamWriter builder with BigQuery client being initialized by StreamWriter by default.
    newBuilder(String streamOrTableName, TableSchema tableSchema, BigQueryWriteClient client)
    Deprecated.
    newBuilder that constructs a JsonStreamWriter builder.

    Methods inherited from class java.lang.Object

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

    • append

      public com.google.api.core.ApiFuture<AppendRowsResponse> append(org.json.JSONArray jsonArr)
      Deprecated.
      Writes a JSONArray that contains JSONObjects to the BigQuery table by first converting the JSON data to protobuf messages, then using StreamWriter's append() to write the data.
      Parameters:
      jsonArr - The JSON array that contains JSONObjects to be written
      Returns:
      ApiFuture<AppendRowsResponse> returns an AppendRowsResponse message wrapped in an ApiFuture
    • append

      public com.google.api.core.ApiFuture<AppendRowsResponse> append(org.json.JSONArray jsonArr, long offset)
      Deprecated.
      Writes a JSONArray that contains JSONObjects to the BigQuery table by first converting the JSON data to protobuf messages, then using StreamWriter's append() to write the data.
      Parameters:
      jsonArr - The JSON array that contains JSONObjects to be written
      offset - Offset for deduplication
      Returns:
      ApiFuture<AppendRowsResponse> returns an AppendRowsResponse message wrapped in an ApiFuture
    • getStreamName

      public String getStreamName()
      Deprecated.
      Gets streamName
      Returns:
      String
    • getDescriptor

      public com.google.protobuf.Descriptors.Descriptor getDescriptor()
      Deprecated.
      Gets current descriptor
      Returns:
      Descriptor
    • newBuilder

      public static JsonStreamWriter.Builder newBuilder(String streamOrTableName, TableSchema tableSchema)
      Deprecated.
      newBuilder that constructs a JsonStreamWriter builder with BigQuery client being initialized by StreamWriter by default.
      Parameters:
      streamOrTableName - name of the stream that must follow "projects/[^/]+/datasets/[^/]+/tables/[^/]+/streams/[^/]+" or table name "projects/[^/]+/datasets/[^/]+/tables/[^/]+"
      tableSchema - The schema of the table when the stream was created, which is passed back through WriteStream
      Returns:
      Builder
    • newBuilder

      public static JsonStreamWriter.Builder newBuilder(String streamOrTableName, TableSchema tableSchema, BigQueryWriteClient client)
      Deprecated.
      newBuilder that constructs a JsonStreamWriter builder.
      Parameters:
      streamOrTableName - name of the stream that must follow "projects/[^/]+/datasets/[^/]+/tables/[^/]+/streams/[^/]+"
      tableSchema - The schema of the table when the stream was created, which is passed back through WriteStream
      client -
      Returns:
      Builder
    • close

      public void close()
      Deprecated.
      Closes the underlying StreamWriter.
      Specified by:
      close in interface AutoCloseable