Skip to content

feat(clients): enable Endpoint Discovery #2390

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

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented May 13, 2021

Issue

Fixes: #2211

Description

Enables Endpoint Discovery on clients which have clientEndpointDiscovery smithy trait set.
The base branch for this PR would be changed to main after #2369 is merged.

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 13, 2021 03:27
@codecov-commenter
Copy link

codecov-commenter commented May 13, 2021

Codecov Report

❗ No coverage uploaded for pull request base (client-endpoint-discovery-base@1751775). Click here to learn what that means.
The diff coverage is n/a.

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

@@                        Coverage Diff                        @@
##             client-endpoint-discovery-base    #2390   +/-   ##
=================================================================
  Coverage                                  ?   59.10%           
=================================================================
  Files                                     ?      490           
  Lines                                     ?    26146           
  Branches                                  ?     6198           
=================================================================
  Hits                                      ?    15454           
  Misses                                    ?    10692           
  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 1751775...e04eecf. Read the comment docs.

@trivikr trivikr force-pushed the client-endpoint-discovery branch 5 times, most recently from eaa729f to e04eecf Compare May 13, 2021 23:04
@trivikr trivikr force-pushed the client-endpoint-discovery branch from e04eecf to ba65753 Compare May 14, 2021 03:30
@trivikr
Copy link
Member Author

trivikr commented May 14, 2021

Superceded by #2395

@trivikr trivikr closed this May 14, 2021
@trivikr trivikr deleted the client-endpoint-discovery 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.

2 participants