kinesis_client_facade.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 #pragma once
16 
17 #include <aws/core/utils/Outcome.h>
18 #include <aws/kinesis/KinesisClient.h>
19 #include <aws/kinesis/model/GetRecordsRequest.h>
20 #include <aws/kinesis/model/GetRecordsResult.h>
22 
23 namespace Aws {
24 namespace Kinesis {
25 
29 class KinesisClientFacade : public KinesisClient, Client::ThrottlingManager
30 {
31 public:
32  KinesisClientFacade(Aws::Client::ClientConfiguration config)
33  : KinesisClient(config), Client::ThrottlingManager()
34  {
36  "GetRecords",
37  5.0); /* Default of 5 calls GetRecords per second assuming a single shard iterator. */
38  }
43  Model::GetRecordsOutcome GetRecords(const Model::GetRecordsRequest & request) const override
44  {
45  auto get_records_base =
46  [this](const Model::GetRecordsRequest & request) -> Model::GetRecordsOutcome {
47  return this->KinesisClient::GetRecords(request);
48  };
49  return MakeCall<Model::GetRecordsOutcome, Model::GetRecordsRequest, KinesisErrors>(
50  get_records_base, request, __func__, KinesisErrors::PROVISIONED_THROUGHPUT_EXCEEDED, true);
51  }
56 };
57 } // namespace Kinesis
58 } // namespace Aws
Model::GetRecordsOutcome GetRecords(const Model::GetRecordsRequest &request) const override
KinesisClientFacade(Aws::Client::ClientConfiguration config)
void SetMaxApiTps(const std::string &api, double tps)


kinesis_manager
Author(s): AWS RoboMaker
autogenerated on Thu Mar 4 2021 03:28:41