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

[PoC] feat: add Endpoint Discovery #2339

Closed
wants to merge 48 commits into from

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented May 3, 2021

Issue

PoC for #2211

Description

PoC for Endpoint Discovery in AWS SDK for JavaScript (v3)

Testing

Tested with the following code:

import { TimestreamQuery } from "../aws-sdk-js-v3/clients/client-timestream-query/dist/cjs/index.js";

const region = "us-west-2";
const client = new TimestreamQuery({ region, logger: console });

const DatabaseName = `Database1619998684282`;
const TableName = `Table1619998684282`;
const QueryString = `SELECT * FROM ${DatabaseName}.${TableName} ORDER BY time`;

await Promise.all([
  client.query({ QueryString }),
  client.query({ QueryString: `${QueryString} LIMIT 2` }),
  client.query({ QueryString: `${QueryString} LIMIT 5` }),
]);

Verified that discovery endpoint operation (i.e. DescribeEndpoints) is called only once although there are three parallel query calls.

{
  clientName: 'TimestreamQueryClient',
  commandName: 'DescribeEndpointsCommand',
  input: { Operation: 'Query', Identifiers: undefined },
  output: { Endpoints: [ [Object] ] },
  metadata: {
    httpStatusCode: 200,
    requestId: '32384c2d-e075-492e-8d9a-02d4cd21fe69',
    extendedRequestId: undefined,
    cfId: undefined,
    attempts: 1,
    totalRetryDelay: 0
  }
}
{
  clientName: 'TimestreamQueryClient',
  commandName: 'QueryCommand',
  input: { QueryString: '***SensitiveInformation***' },
  output: {
    ColumnInfo: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
    NextToken: undefined,
    QueryId: 'AEDACAM4AC55UWHUXUYJ4JBU7VT76KSI5RM47JCDJYSIAN5VXANLIJG3QK24XEY',
    QueryStatus: {
      CumulativeBytesMetered: 10000000,
      CumulativeBytesScanned: 1048,
      ProgressPercentage: 100
    },
    Rows: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object]
    ]
  },
  metadata: {
    httpStatusCode: 200,
    requestId: 'K6W27XSYKRL7HD36HOW5WTWTUE',
    extendedRequestId: undefined,
    cfId: undefined,
    attempts: 1,
    totalRetryDelay: 0
  }
}
{
  clientName: 'TimestreamQueryClient',
  commandName: 'QueryCommand',
  input: { QueryString: '***SensitiveInformation***' },
  output: {
    ColumnInfo: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
    NextToken: undefined,
    QueryId: 'AEDACAM4AC5YR3ZREISR2NVE723ZZENOCEU4HKFCT4REEANXSZ5ITP7RCD47PGI',
    QueryStatus: {
      CumulativeBytesMetered: 10000000,
      CumulativeBytesScanned: 1048,
      ProgressPercentage: 100
    },
    Rows: [ [Object], [Object] ]
  },
  metadata: {
    httpStatusCode: 200,
    requestId: 'AJSTGRM3WS4UTI7CDAQYPQF5WE',
    extendedRequestId: undefined,
    cfId: undefined,
    attempts: 1,
    totalRetryDelay: 0
  }
}
{
  clientName: 'TimestreamQueryClient',
  commandName: 'QueryCommand',
  input: { QueryString: '***SensitiveInformation***' },
  output: {
    ColumnInfo: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
    NextToken: undefined,
    QueryId: 'AEDACAM4AC5RFCPYGQPYPGWSOSAR7A54WJ2FBWOEZ2EQIAHOOXGYGUXX6EJS6NA',
    QueryStatus: {
      CumulativeBytesMetered: 10000000,
      CumulativeBytesScanned: 1048,
      ProgressPercentage: 100
    },
    Rows: [ [Object], [Object], [Object], [Object], [Object] ]
  },
  metadata: {
    httpStatusCode: 200,
    requestId: '73SI4DZ4R2KESFKBFJL6KKEE4Y',
    extendedRequestId: undefined,
    cfId: undefined,
    attempts: 1,
    totalRetryDelay: 0
  }
}

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr marked this pull request as draft May 3, 2021 06:38
@codecov-commenter
Copy link

codecov-commenter commented May 3, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@2165d4a). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 0147d41 differs from pull request most recent head 9048c5e. Consider uploading reports for the commit 9048c5e to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2339   +/-   ##
=======================================
  Coverage        ?   60.19%           
=======================================
  Files           ?      479           
  Lines           ?    24994           
  Branches        ?     5915           
=======================================
  Hits            ?    15046           
  Misses          ?     9948           
  Partials        ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2165d4a...9048c5e. Read the comment docs.

@trivikr
Copy link
Member Author

trivikr commented May 14, 2021

The final PR was posted and merged at #2395

@trivikr trivikr closed this May 14, 2021
@trivikr trivikr deleted the endpoint-discovery-test branch May 14, 2021 17:59
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants