Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigTable createReadStream error handling #1758

Closed
arbesfeld opened this issue Oct 30, 2016 · 1 comment
Closed

BigTable createReadStream error handling #1758

arbesfeld opened this issue Oct 30, 2016 · 1 comment
Assignees
Labels
api: bigtable Issues related to the Bigtable API.

Comments

@arbesfeld
Copy link
Contributor

Hi, I am using BigTable createReadStream and it seems to be hanging on errors from BigTable.
I am using through2.obj as recommended in #1715:

Perhaps I'm using the API incorrectly? I couldn't find any examples of this in the documentation.

    eventsTable
      .createReadStream({
        decode: true,
        start: rowKey,
        end: `${appID}|${recordingID}||`,
        filter: [{
          family: 'metadata',
          column: {
            cellLimit: 1,
          },
        }],
      })
      .pipe(through2.obj(async (row, _, next) => {
          await doWork();
      }))
      .on('data', () => {
        // For some reason we need to have a data block in order for 'end' to be called.
      })
      .on('error', reject)
      .on('end', async () => {
        resolve();
      });
@jgeewax jgeewax added the api: bigtable Issues related to the Bigtable API. label Oct 31, 2016
@callmehiphop
Copy link
Contributor

callmehiphop commented Oct 31, 2016

@arbesfeld I'm going to update the example in that issue, but the stream emits a finish event not end in this particular instance.

eventsTable
  .createReadStream({
    decode: true,
    start: rowKey,
    end: `${appID}|${recordingID}||`,
    filter: [{
      family: 'metadata',
      column: {
        cellLimit: 1,
      },
    }],
  })
  .pipe(through2.obj(async (row, _, next) => {
      await doWork();
      next();
  }))
  .on('error', reject)
  .on('finish', async () => {
    resolve();
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the Bigtable API.
Projects
None yet
Development

No branches or pull requests

3 participants