@google-cloud/bigquery-storage
Advanced tools
Comparing version 2.8.0 to 3.0.0
@@ -36,3 +36,3 @@ import * as gax from 'google-gax'; | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
@@ -60,7 +60,6 @@ * @param {object} [options.credentials] - Credentials object. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. | ||
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC. | ||
* For more information, please check the | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
*/ | ||
@@ -138,7 +137,9 @@ constructor(opts?: ClientOptions); | ||
* non-negative. The number of streams may be lower than the requested number, | ||
* depending on the amount parallelism that is reasonable for the table. Error | ||
* will be returned if the max count is greater than the current system | ||
* max limit of 1,000. | ||
* depending on the amount parallelism that is reasonable for the table. | ||
* There is a default system max limit of 1,000. | ||
* | ||
* Streams must be read starting from offset 0. | ||
* This must be greater than or equal to preferred_min_stream_count. | ||
* Typically, clients should either leave this unset to let the system to | ||
* determine an upper bound OR set this a size for the maximum "units of work" | ||
* it can gracefully handle. | ||
* @param {object} [options] | ||
@@ -154,3 +155,7 @@ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
*/ | ||
createReadSession(request?: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1.IReadSession, (protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | undefined), {} | undefined]>; | ||
createReadSession(request?: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, options?: CallOptions): Promise<[ | ||
protos.google.cloud.bigquery.storage.v1.IReadSession, | ||
(protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | undefined), | ||
{} | undefined | ||
]>; | ||
createReadSession(request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1.IReadSession, protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -194,3 +199,7 @@ createReadSession(request: protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1.IReadSession, protos.google.cloud.bigquery.storage.v1.ICreateReadSessionRequest | null | undefined, {} | null | undefined>): void; | ||
*/ | ||
splitReadStream(request?: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, (protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | undefined), {} | undefined]>; | ||
splitReadStream(request?: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, options?: CallOptions): Promise<[ | ||
protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, | ||
(protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | undefined), | ||
{} | undefined | ||
]>; | ||
splitReadStream(request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -197,0 +206,0 @@ splitReadStream(request: protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1.ISplitReadStreamResponse, protos.google.cloud.bigquery.storage.v1.ISplitReadStreamRequest | null | undefined, {} | null | undefined>): void; |
"use strict"; | ||
// Copyright 2021 Google LLC | ||
// Copyright 2022 Google LLC | ||
// | ||
@@ -23,2 +23,4 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
const gax = require("google-gax"); | ||
const google_gax_1 = require("google-gax"); | ||
const stream_1 = require("stream"); | ||
const jsonProtos = require("../../protos/protos.json"); | ||
@@ -45,3 +47,3 @@ /** | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
@@ -69,7 +71,6 @@ * @param {object} [options.credentials] - Credentials object. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. | ||
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC. | ||
* For more information, please check the | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
*/ | ||
@@ -145,3 +146,3 @@ constructor(opts) { | ||
this.descriptors.stream = { | ||
readRows: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING), | ||
readRows: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING, opts.fallback === 'rest'), | ||
}; | ||
@@ -189,2 +190,9 @@ // Put together the default options sent with requests. | ||
if (this._terminated) { | ||
if (methodName in this.descriptors.stream) { | ||
const stream = new stream_1.PassThrough(); | ||
setImmediate(() => { | ||
stream.emit('error', new google_gax_1.GoogleError('The client has already been closed.')); | ||
}); | ||
return stream; | ||
} | ||
return Promise.reject('The client has already been closed.'); | ||
@@ -233,3 +241,2 @@ } | ||
'https://www.googleapis.com/auth/bigquery', | ||
'https://www.googleapis.com/auth/bigquery.readonly', | ||
'https://www.googleapis.com/auth/cloud-platform', | ||
@@ -574,4 +581,3 @@ ]; | ||
close() { | ||
this.initialize(); | ||
if (!this._terminated) { | ||
if (this.bigQueryReadStub && !this._terminated) { | ||
return this.bigQueryReadStub.then(stub => { | ||
@@ -578,0 +584,0 @@ this._terminated = true; |
@@ -10,2 +10,7 @@ { | ||
], | ||
"deadline_exceeded_resource_exhausted_unavailable": [ | ||
"DEADLINE_EXCEEDED", | ||
"RESOURCE_EXHAUSTED", | ||
"UNAVAILABLE" | ||
], | ||
"unavailable": [ | ||
@@ -24,2 +29,11 @@ "UNAVAILABLE" | ||
"total_timeout_millis": 600000 | ||
}, | ||
"ec82364a95d03873ac5f61710bb6b9b42e40f31d": { | ||
"initial_retry_delay_millis": 10000, | ||
"retry_delay_multiplier": 1.3, | ||
"max_retry_delay_millis": 120000, | ||
"initial_rpc_timeout_millis": 60000, | ||
"rpc_timeout_multiplier": 1, | ||
"max_rpc_timeout_millis": 60000, | ||
"total_timeout_millis": 600000 | ||
} | ||
@@ -29,5 +43,5 @@ }, | ||
"CreateWriteStream": { | ||
"timeout_millis": 600000, | ||
"retry_codes_name": "idempotent", | ||
"retry_params_name": "default" | ||
"timeout_millis": 1200000, | ||
"retry_codes_name": "deadline_exceeded_resource_exhausted_unavailable", | ||
"retry_params_name": "ec82364a95d03873ac5f61710bb6b9b42e40f31d" | ||
}, | ||
@@ -34,0 +48,0 @@ "AppendRows": { |
@@ -39,3 +39,3 @@ import * as gax from 'google-gax'; | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
@@ -63,7 +63,6 @@ * @param {object} [options.credentials] - Credentials object. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. | ||
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC. | ||
* For more information, please check the | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
*/ | ||
@@ -134,3 +133,7 @@ constructor(opts?: ClientOptions); | ||
*/ | ||
createWriteStream(request?: protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1.IWriteStream, (protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest | undefined), {} | undefined]>; | ||
createWriteStream(request?: protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, options?: CallOptions): Promise<[ | ||
protos.google.cloud.bigquery.storage.v1.IWriteStream, | ||
(protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest | undefined), | ||
{} | undefined | ||
]>; | ||
createWriteStream(request: protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1.IWriteStream, protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -156,3 +159,7 @@ createWriteStream(request: protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1.IWriteStream, protos.google.cloud.bigquery.storage.v1.ICreateWriteStreamRequest | null | undefined, {} | null | undefined>): void; | ||
*/ | ||
getWriteStream(request?: protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1.IWriteStream, (protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest | undefined), {} | undefined]>; | ||
getWriteStream(request?: protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, options?: CallOptions): Promise<[ | ||
protos.google.cloud.bigquery.storage.v1.IWriteStream, | ||
(protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest | undefined), | ||
{} | undefined | ||
]>; | ||
getWriteStream(request: protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1.IWriteStream, protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -179,3 +186,7 @@ getWriteStream(request: protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1.IWriteStream, protos.google.cloud.bigquery.storage.v1.IGetWriteStreamRequest | null | undefined, {} | null | undefined>): void; | ||
*/ | ||
finalizeWriteStream(request?: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, (protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest | undefined), {} | undefined]>; | ||
finalizeWriteStream(request?: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, options?: CallOptions): Promise<[ | ||
protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, | ||
(protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest | undefined), | ||
{} | undefined | ||
]>; | ||
finalizeWriteStream(request: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -208,3 +219,7 @@ finalizeWriteStream(request: protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamResponse, protos.google.cloud.bigquery.storage.v1.IFinalizeWriteStreamRequest | null | undefined, {} | null | undefined>): void; | ||
*/ | ||
batchCommitWriteStreams(request?: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, (protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest | undefined), {} | undefined]>; | ||
batchCommitWriteStreams(request?: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, options?: CallOptions): Promise<[ | ||
protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, | ||
(protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest | undefined), | ||
{} | undefined | ||
]>; | ||
batchCommitWriteStreams(request: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -239,3 +254,7 @@ batchCommitWriteStreams(request: protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsResponse, protos.google.cloud.bigquery.storage.v1.IBatchCommitWriteStreamsRequest | null | undefined, {} | null | undefined>): void; | ||
*/ | ||
flushRows(request?: protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse, protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest | undefined, {} | undefined]>; | ||
flushRows(request?: protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest, options?: CallOptions): Promise<[ | ||
protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse, | ||
protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest | undefined, | ||
{} | undefined | ||
]>; | ||
flushRows(request: protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse, protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -276,2 +295,9 @@ flushRows(request: protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1.IFlushRowsResponse, protos.google.cloud.bigquery.storage.v1.IFlushRowsRequest | null | undefined, {} | null | undefined>): void; | ||
* | ||
* Note: For users coding against the gRPC api directly, it may be | ||
* necessary to supply the x-goog-request-params system parameter | ||
* with `write_stream=<full_write_stream_name>`. | ||
* | ||
* More information about system parameters: | ||
* https://cloud.google.com/apis/docs/system-parameters | ||
* | ||
* @param {object} [options] | ||
@@ -278,0 +304,0 @@ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. |
"use strict"; | ||
// Copyright 2021 Google LLC | ||
// Copyright 2022 Google LLC | ||
// | ||
@@ -23,2 +23,4 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
const gax = require("google-gax"); | ||
const google_gax_1 = require("google-gax"); | ||
const stream_1 = require("stream"); | ||
const jsonProtos = require("../../protos/protos.json"); | ||
@@ -48,3 +50,3 @@ /** | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
@@ -72,7 +74,6 @@ * @param {object} [options.credentials] - Credentials object. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. | ||
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC. | ||
* For more information, please check the | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
*/ | ||
@@ -148,3 +149,3 @@ constructor(opts) { | ||
this.descriptors.stream = { | ||
appendRows: new this._gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING), | ||
appendRows: new this._gaxModule.StreamDescriptor(gax.StreamType.BIDI_STREAMING, opts.fallback === 'rest'), | ||
}; | ||
@@ -195,2 +196,9 @@ // Put together the default options sent with requests. | ||
if (this._terminated) { | ||
if (methodName in this.descriptors.stream) { | ||
const stream = new stream_1.PassThrough(); | ||
setImmediate(() => { | ||
stream.emit('error', new google_gax_1.GoogleError('The client has already been closed.')); | ||
}); | ||
return stream; | ||
} | ||
return Promise.reject('The client has already been closed.'); | ||
@@ -387,2 +395,9 @@ } | ||
* | ||
* Note: For users coding against the gRPC api directly, it may be | ||
* necessary to supply the x-goog-request-params system parameter | ||
* with `write_stream=<full_write_stream_name>`. | ||
* | ||
* More information about system parameters: | ||
* https://cloud.google.com/apis/docs/system-parameters | ||
* | ||
* @param {object} [options] | ||
@@ -402,3 +417,3 @@ * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. | ||
this.initialize(); | ||
return this.innerApiCalls.appendRows(options); | ||
return this.innerApiCalls.appendRows(null, options); | ||
} | ||
@@ -651,4 +666,3 @@ // -------------------- | ||
close() { | ||
this.initialize(); | ||
if (!this._terminated) { | ||
if (this.bigQueryWriteStub && !this._terminated) { | ||
return this.bigQueryWriteStub.then(stub => { | ||
@@ -655,0 +669,0 @@ this._terminated = true; |
"use strict"; | ||
// Copyright 2021 Google LLC | ||
// Copyright 2022 Google LLC | ||
// | ||
@@ -20,2 +20,3 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BigQueryWriteClient = exports.BigQueryReadClient = void 0; | ||
var big_query_read_client_1 = require("./big_query_read_client"); | ||
@@ -22,0 +23,0 @@ Object.defineProperty(exports, "BigQueryReadClient", { enumerable: true, get: function () { return big_query_read_client_1.BigQueryReadClient; } }); |
@@ -36,3 +36,3 @@ import * as gax from 'google-gax'; | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
@@ -60,7 +60,6 @@ * @param {object} [options.credentials] - Credentials object. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. | ||
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC. | ||
* For more information, please check the | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
*/ | ||
@@ -155,3 +154,7 @@ constructor(opts?: ClientOptions); | ||
*/ | ||
createReadSession(request?: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1beta1.IReadSession, (protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest | undefined), {} | undefined]>; | ||
createReadSession(request?: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, options?: CallOptions): Promise<[ | ||
protos.google.cloud.bigquery.storage.v1beta1.IReadSession, | ||
(protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest | undefined), | ||
{} | undefined | ||
]>; | ||
createReadSession(request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1beta1.IReadSession, protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -183,3 +186,7 @@ createReadSession(request: protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1beta1.IReadSession, protos.google.cloud.bigquery.storage.v1beta1.ICreateReadSessionRequest | null | undefined, {} | null | undefined>): void; | ||
*/ | ||
batchCreateReadSessionStreams(request?: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, (protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest | undefined), {} | undefined]>; | ||
batchCreateReadSessionStreams(request?: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, options?: CallOptions): Promise<[ | ||
protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, | ||
(protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest | undefined), | ||
{} | undefined | ||
]>; | ||
batchCreateReadSessionStreams(request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -217,3 +224,7 @@ batchCreateReadSessionStreams(request: protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsResponse, protos.google.cloud.bigquery.storage.v1beta1.IBatchCreateReadSessionStreamsRequest | null | undefined, {} | null | undefined>): void; | ||
*/ | ||
finalizeStream(request?: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, options?: CallOptions): Promise<[protos.google.protobuf.IEmpty, (protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest | undefined), {} | undefined]>; | ||
finalizeStream(request?: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, options?: CallOptions): Promise<[ | ||
protos.google.protobuf.IEmpty, | ||
(protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest | undefined), | ||
{} | undefined | ||
]>; | ||
finalizeStream(request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -258,3 +269,7 @@ finalizeStream(request: protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.storage.v1beta1.IFinalizeStreamRequest | null | undefined, {} | null | undefined>): void; | ||
*/ | ||
splitReadStream(request?: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, options?: CallOptions): Promise<[protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, (protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest | undefined), {} | undefined]>; | ||
splitReadStream(request?: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, options?: CallOptions): Promise<[ | ||
protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, | ||
(protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest | undefined), | ||
{} | undefined | ||
]>; | ||
splitReadStream(request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest | null | undefined, {} | null | undefined>): void; | ||
@@ -261,0 +276,0 @@ splitReadStream(request: protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest, callback: Callback<protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamResponse, protos.google.cloud.bigquery.storage.v1beta1.ISplitReadStreamRequest | null | undefined, {} | null | undefined>): void; |
"use strict"; | ||
// Copyright 2021 Google LLC | ||
// Copyright 2022 Google LLC | ||
// | ||
@@ -23,2 +23,4 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
const gax = require("google-gax"); | ||
const google_gax_1 = require("google-gax"); | ||
const stream_1 = require("stream"); | ||
const jsonProtos = require("../../protos/protos.json"); | ||
@@ -45,3 +47,3 @@ /** | ||
* The options accepted by the constructor are described in detail | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). | ||
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). | ||
* The common options are: | ||
@@ -69,7 +71,6 @@ * @param {object} [options.credentials] - Credentials object. | ||
* Follows the structure of {@link gapicConfig}. | ||
* @param {boolean} [options.fallback] - Use HTTP fallback mode. | ||
* In fallback mode, a special browser-compatible transport implementation is used | ||
* instead of gRPC transport. In browser context (if the `window` object is defined) | ||
* the fallback mode is enabled automatically; set `options.fallback` to `false` | ||
* if you need to override this behavior. | ||
* @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. | ||
* Pass "rest" to use HTTP/1.1 REST API instead of gRPC. | ||
* For more information, please check the | ||
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. | ||
*/ | ||
@@ -143,3 +144,3 @@ constructor(opts) { | ||
this.descriptors.stream = { | ||
readRows: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING), | ||
readRows: new this._gaxModule.StreamDescriptor(gax.StreamType.SERVER_STREAMING, opts.fallback === 'rest'), | ||
}; | ||
@@ -190,2 +191,9 @@ // Put together the default options sent with requests. | ||
if (this._terminated) { | ||
if (methodName in this.descriptors.stream) { | ||
const stream = new stream_1.PassThrough(); | ||
setImmediate(() => { | ||
stream.emit('error', new google_gax_1.GoogleError('The client has already been closed.')); | ||
}); | ||
return stream; | ||
} | ||
return Promise.reject('The client has already been closed.'); | ||
@@ -234,3 +242,2 @@ } | ||
'https://www.googleapis.com/auth/bigquery', | ||
'https://www.googleapis.com/auth/bigquery.readonly', | ||
'https://www.googleapis.com/auth/cloud-platform', | ||
@@ -494,4 +501,3 @@ ]; | ||
close() { | ||
this.initialize(); | ||
if (!this._terminated) { | ||
if (this.bigQueryStorageStub && !this._terminated) { | ||
return this.bigQueryStorageStub.then(stub => { | ||
@@ -498,0 +504,0 @@ this._terminated = true; |
"use strict"; | ||
// Copyright 2021 Google LLC | ||
// Copyright 2022 Google LLC | ||
// | ||
@@ -20,4 +20,5 @@ // Licensed under the Apache License, Version 2.0 (the "License"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BigQueryStorageClient = void 0; | ||
var big_query_storage_client_1 = require("./big_query_storage_client"); | ||
Object.defineProperty(exports, "BigQueryStorageClient", { enumerable: true, get: function () { return big_query_storage_client_1.BigQueryStorageClient; } }); | ||
//# sourceMappingURL=index.js.map |
# Changelog | ||
## [3.0.0](https://github.com/googleapis/nodejs-bigquery-storage/compare/v2.8.0...v3.0.0) (2022-06-29) | ||
### ⚠ BREAKING CHANGES | ||
* update library to use Node 12 (#272) | ||
### Features | ||
* Deprecate format specific `row_count` field in Read API ([#249](https://github.com/googleapis/nodejs-bigquery-storage/issues/249)) ([fb8acf1](https://github.com/googleapis/nodejs-bigquery-storage/commit/fb8acf1f4eab7823132159bcf5927c9eda6374e2)) | ||
### Bug Fixes | ||
* fixes for dynamic routing and streaming descriptors ([#274](https://github.com/googleapis/nodejs-bigquery-storage/issues/274)) ([4271ea0](https://github.com/googleapis/nodejs-bigquery-storage/commit/4271ea0aaa98286696eb6822d0bef82a655a5811)) | ||
* Modify client lib retry policy for CreateWriteStream with longer backoff, more error code and longer overall time ([#279](https://github.com/googleapis/nodejs-bigquery-storage/issues/279)) ([849cc23](https://github.com/googleapis/nodejs-bigquery-storage/commit/849cc237081e63a585264a62d49e9407d2f14450)) | ||
### Build System | ||
* update library to use Node 12 ([#272](https://github.com/googleapis/nodejs-bigquery-storage/issues/272)) ([5e774e6](https://github.com/googleapis/nodejs-bigquery-storage/commit/5e774e614132f189362d56c502960d87200a11a0)) | ||
## [2.8.0](https://www.github.com/googleapis/nodejs-bigquery-storage/compare/v2.7.0...v2.8.0) (2021-12-30) | ||
@@ -4,0 +26,0 @@ |
{ | ||
"name": "@google-cloud/bigquery-storage", | ||
"version": "2.8.0", | ||
"version": "3.0.0", | ||
"description": "Client for the BigQuery Storage API", | ||
@@ -30,20 +30,20 @@ "repository": "googleapis/nodejs-bigquery-storage", | ||
"dependencies": { | ||
"google-gax": "^2.24.1" | ||
"google-gax": "^3.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/mocha": "^8.0.0", | ||
"@types/mocha": "^9.0.0", | ||
"@types/node": "^16.0.0", | ||
"@types/sinon": "^10.0.0", | ||
"c8": "^7.1.0", | ||
"gts": "^2.0.0", | ||
"gts": "^3.1.0", | ||
"jsdoc": "^3.6.3", | ||
"jsdoc-fresh": "^1.0.2", | ||
"jsdoc-region-tag": "^1.0.4", | ||
"jsdoc-fresh": "^2.0.0", | ||
"jsdoc-region-tag": "^2.0.0", | ||
"linkinator": "^2.0.1", | ||
"mocha": "^8.0.0", | ||
"mocha": "^9.2.2", | ||
"null-loader": "^4.0.0", | ||
"pack-n-play": "^1.0.0-2", | ||
"sinon": "^12.0.0", | ||
"sinon": "^14.0.0", | ||
"ts-loader": "^9.0.0", | ||
"typescript": "^3.8.3", | ||
"typescript": "^4.6.4", | ||
"webpack": "^5.0.0", | ||
@@ -53,4 +53,4 @@ "webpack-cli": "^4.0.0" | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=12.0.0" | ||
} | ||
} |
@@ -7,5 +7,4 @@ [//]: # "This README.md file is auto-generated, all changes to this file will be lost." | ||
[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) | ||
[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) | ||
[![npm version](https://img.shields.io/npm/v/@google-cloud/bigquery-storage.svg)](https://www.npmjs.org/package/@google-cloud/bigquery-storage) | ||
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-bigquery-storage/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-bigquery-storage) | ||
@@ -190,3 +189,7 @@ | ||
| --------------------------- | --------------------------------- | ------ | | ||
| Append_rows_pending | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/append_rows_pending.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/append_rows_pending.js,samples/README.md) | | ||
| Append_rows_proto2 | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/append_rows_proto2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/append_rows_proto2.js,samples/README.md) | | ||
| Customer_record_pb | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/customer_record_pb.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/customer_record_pb.js,samples/README.md) | | ||
| BigQuery Storage Quickstart | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | | ||
| Sample_data_pb2 | [source code](https://github.com/googleapis/nodejs-bigquery-storage/blob/main/samples/sample_data_pb2.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-bigquery-storage&page=editor&open_in_editor=samples/sample_data_pb2.js,samples/README.md) | | ||
@@ -203,18 +206,18 @@ | ||
Node.js. | ||
If you are using an end-of-life version of Node.js, we recommend that you update | ||
as soon as possible to an actively supported LTS version. | ||
Google's client libraries support legacy versions of Node.js runtimes on a | ||
best-efforts basis with the following warnings: | ||
* Legacy versions are not tested in continuous integration. | ||
* Some security patches and features cannot be backported. | ||
* Dependencies cannot be kept up-to-date. | ||
Client libraries targeting some end-of-life versions of Node.js are available, and | ||
can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). | ||
can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). | ||
The dist-tags follow the naming convention `legacy-(version)`. | ||
For example, `npm install @google-cloud/bigquery-storage@legacy-8` installs client libraries | ||
for versions compatible with Node.js 8. | ||
_Legacy Node.js versions are supported as a best effort:_ | ||
* Legacy versions will not be tested in continuous integration. | ||
* Some security patches may not be able to be backported. | ||
* Dependencies will not be kept up-to-date, and features will not be backported. | ||
#### Legacy tags available | ||
* `legacy-8`: install client libraries from this dist-tag for versions | ||
compatible with Node.js 8. | ||
## Versioning | ||
@@ -225,6 +228,6 @@ | ||
This library is considered to be **General Availability (GA)**. This means it | ||
is stable; the code surface will not change in backwards-incompatible ways | ||
This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways | ||
unless absolutely necessary (e.g. because of critical security issues) or with | ||
an extensive deprecation period. Issues and requests against **GA** libraries | ||
an extensive deprecation period. Issues and requests against **stable** libraries | ||
are addressed with the highest priority. | ||
@@ -237,3 +240,2 @@ | ||
More Information: [Google Cloud Platform Launch Stages][launch_stages] | ||
@@ -240,0 +242,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2671189
40974
263
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/parser@7.26.7(transitive)
+ Added@babel/types@7.26.7(transitive)
+ Added@grpc/grpc-js@1.8.22(transitive)
+ Added@jsdoc/salty@0.2.9(transitive)
+ Added@types/glob@8.1.0(transitive)
+ Added@types/linkify-it@5.0.0(transitive)
+ Added@types/markdown-it@14.1.2(transitive)
+ Added@types/mdurl@2.0.0(transitive)
+ Added@types/minimatch@5.1.2(transitive)
+ Added@types/rimraf@3.0.2(transitive)
+ Addedacorn@8.14.0(transitive)
+ Addedacorn-jsx@5.3.2(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcatharsis@0.9.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedescape-string-regexp@2.0.0(transitive)
+ Addedescodegen@1.14.3(transitive)
+ Addedeslint-visitor-keys@3.4.3(transitive)
+ Addedespree@9.6.1(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedestraverse@4.3.05.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedgaxios@5.1.3(transitive)
+ Addedgcp-metadata@5.3.0(transitive)
+ Addedglob@8.1.0(transitive)
+ Addedgoogle-auth-library@8.9.0(transitive)
+ Addedgoogle-gax@3.6.1(transitive)
+ Addedgoogle-p12-pem@4.0.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedgtoken@6.1.2(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedjs2xmlparser@4.0.2(transitive)
+ Addedjsdoc@4.0.4(transitive)
+ Addedklaw@3.0.0(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedlinkify-it@5.0.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmarkdown-it@14.1.0(transitive)
+ Addedmarkdown-it-anchor@8.6.7(transitive)
+ Addedmarked@4.3.0(transitive)
+ Addedmdurl@2.0.0(transitive)
+ Addedminimatch@5.1.6(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedproto3-json-serializer@1.1.1(transitive)
+ Addedprotobufjs@7.2.4(transitive)
+ Addedprotobufjs-cli@1.1.1(transitive)
+ Addedpunycode.js@2.3.1(transitive)
+ Addedrequizzle@0.2.4(transitive)
+ Addedretry-request@5.0.2(transitive)
+ Addedsemver@7.7.1(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedstrip-json-comments@3.1.1(transitive)
+ Addedsupports-color@7.2.0(transitive)
+ Addedtmp@0.2.3(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addeduc.micro@2.1.0(transitive)
+ Addeduglify-js@3.19.3(transitive)
+ Addedunderscore@1.13.7(transitive)
+ Addedword-wrap@1.2.5(transitive)
+ Addedxmlcreate@2.0.4(transitive)
- Removed@grpc/grpc-js@1.6.12(transitive)
- Removed@grpc/proto-loader@0.6.13(transitive)
- Removedcliui@7.0.4(transitive)
- Removedgaxios@4.3.3(transitive)
- Removedgcp-metadata@4.3.1(transitive)
- Removedgoogle-auth-library@7.14.1(transitive)
- Removedgoogle-gax@2.30.5(transitive)
- Removedgoogle-p12-pem@3.1.4(transitive)
- Removedgtoken@5.3.2(transitive)
- Removedlong@4.0.0(transitive)
- Removedproto3-json-serializer@0.1.9(transitive)
- Removedprotobufjs@6.11.3(transitive)
- Removedretry-request@4.2.2(transitive)
- Removedyargs@16.2.0(transitive)
- Removedyargs-parser@20.2.9(transitive)
Updatedgoogle-gax@^3.0.1