Skip to content

Commit b217e7d

Browse files
r-barnesfacebook-github-bot
authored andcommitted
Enable -Wheader-hygiene for github/PACKAGE +1 (prestodb#23575)
Summary: Pull Request resolved: prestodb#23575 Per title #buildmore - Be thorough #buildsonlynotests - No runtime effects! - If you approve of this diff, please use the "Accept & Ship" button no-ig-test - Doesn't require Instagram testing. (1 file modified.) Reviewed By: dmm-fb Differential Revision: D56538909
1 parent fce4ddf commit b217e7d

File tree

5 files changed

+41
-31
lines changed

5 files changed

+41
-31
lines changed

presto-native-execution/presto_cpp/main/PrestoServer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
#include <sched.h>
7272
#endif
7373

74+
using namespace facebook::velox;
75+
7476
namespace facebook::presto {
7577
namespace {
7678

presto-native-execution/presto_cpp/main/http/tests/HttpTest.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
*/
1414
#include "presto_cpp/main/http/tests/HttpTestBase.h"
1515

16+
using namespace facebook::presto;
17+
using namespace facebook::velox;
18+
1619
int main(int argc, char** argv) {
1720
testing::InitGoogleTest(&argc, argv);
1821
folly::Init init{&argc, &argv};

presto-native-execution/presto_cpp/main/http/tests/HttpTestBase.h

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525

2626
namespace fs = boost::filesystem;
2727

28-
using namespace facebook::presto;
29-
using namespace facebook::velox;
30-
using namespace facebook::velox::memory;
31-
3228
std::string getCertsPath(const std::string& fileName) {
3329
std::string currentPath = fs::current_path().c_str();
3430
if (boost::algorithm::ends_with(currentPath, "fbcode")) {
@@ -65,7 +61,8 @@ inline folly::SSLContextPtr makeSslContext() {
6561

6662
class HttpServerWrapper {
6763
public:
68-
explicit HttpServerWrapper(std::unique_ptr<http::HttpServer> server)
64+
explicit HttpServerWrapper(
65+
std::unique_ptr<facebook::presto::http::HttpServer> server)
6966
: server_(std::move(server)) {}
7067

7168
~HttpServerWrapper() {
@@ -100,7 +97,7 @@ class HttpServerWrapper {
10097
}
10198

10299
private:
103-
std::unique_ptr<http::HttpServer> server_;
100+
std::unique_ptr<facebook::presto::http::HttpServer> server_;
104101
std::unique_ptr<std::thread> serverThread_;
105102
folly::Promise<folly::SocketAddress> promise_;
106103
std::vector<std::unique_ptr<proxygen::RequestHandlerFactory>> filters_ = {};
@@ -136,15 +133,19 @@ void ping(
136133
proxygen::HTTPMessage* /*message*/,
137134
std::vector<std::unique_ptr<folly::IOBuf>>& /*body*/,
138135
proxygen::ResponseHandler* downstream) {
139-
proxygen::ResponseBuilder(downstream).status(http::kHttpOk, "").sendWithEOM();
136+
proxygen::ResponseBuilder(downstream)
137+
.status(facebook::presto::http::kHttpOk, "")
138+
.sendWithEOM();
140139
}
141140

142141
void blackhole(
143142
proxygen::HTTPMessage* /*message*/,
144143
std::vector<std::unique_ptr<folly::IOBuf>>& /*body*/,
145144
proxygen::ResponseHandler* downstream) {}
146145

147-
std::string bodyAsString(http::HttpResponse& response, MemoryPool* pool) {
146+
std::string bodyAsString(
147+
facebook::presto::http::HttpResponse& response,
148+
facebook::velox::memory::MemoryPool* pool) {
148149
EXPECT_FALSE(response.hasError());
149150
std::ostringstream oss;
150151
auto iobufs = response.consumeBody();
@@ -170,15 +171,15 @@ void echo(
170171
proxygen::ResponseHandler* downstream) {
171172
if (body.empty()) {
172173
proxygen::ResponseBuilder(downstream)
173-
.status(http::kHttpOk, "")
174+
.status(facebook::presto::http::kHttpOk, "")
174175
.body(folly::IOBuf::wrapBuffer(
175176
message->getURL().c_str(), message->getURL().size()))
176177
.sendWithEOM();
177178
return;
178179
}
179180

180181
proxygen::ResponseBuilder(downstream)
181-
.status(http::kHttpOk, "")
182+
.status(facebook::presto::http::kHttpOk, "")
182183
.header(proxygen::HTTP_HEADER_CONTENT_TYPE, "text/plain")
183184
.body(toString(body))
184185
.sendWithEOM();
@@ -196,14 +197,14 @@ class HttpClientFactory {
196197
eventBaseThread_->join();
197198
}
198199

199-
std::shared_ptr<http::HttpClient> newClient(
200+
std::shared_ptr<facebook::presto::http::HttpClient> newClient(
200201
const folly::SocketAddress& address,
201202
const std::chrono::milliseconds& transactionTimeout,
202203
const std::chrono::milliseconds& connectTimeout,
203204
bool useHttps,
204-
std::shared_ptr<MemoryPool> pool,
205+
std::shared_ptr<facebook::velox::memory::MemoryPool> pool,
205206
std::function<void(int)>&& reportOnBodyStatsFunc = nullptr) {
206-
return std::make_shared<http::HttpClient>(
207+
return std::make_shared<facebook::presto::http::HttpClient>(
207208
eventBase_.get(),
208209
nullptr,
209210
proxygen::Endpoint(
@@ -221,32 +222,33 @@ class HttpClientFactory {
221222
std::unique_ptr<std::thread> eventBaseThread_;
222223
};
223224

224-
folly::SemiFuture<std::unique_ptr<http::HttpResponse>> sendGet(
225-
http::HttpClient* client,
225+
folly::SemiFuture<std::unique_ptr<facebook::presto::http::HttpResponse>>
226+
sendGet(
227+
facebook::presto::http::HttpClient* client,
226228
const std::string& url,
227229
const uint64_t sendDelay = 0,
228230
const std::string body = "") {
229-
return http::RequestBuilder()
231+
return facebook::presto::http::RequestBuilder()
230232
.method(proxygen::HTTPMethod::GET)
231233
.url(url)
232234
.send(client, body, sendDelay);
233235
}
234236

235-
static std::unique_ptr<http::HttpServer> getHttpServer(
237+
static std::unique_ptr<facebook::presto::http::HttpServer> getHttpServer(
236238
bool useHttps,
237239
const std::shared_ptr<folly::IOThreadPoolExecutor>& httpIOExecutor) {
238240
if (useHttps) {
239241
const std::string certPath = getCertsPath("test_cert1.pem");
240242
const std::string keyPath = getCertsPath("test_key1.pem");
241243
const std::string ciphers = "AES128-SHA,AES128-SHA256,AES256-GCM-SHA384";
242-
auto httpsConfig = std::make_unique<http::HttpsConfig>(
244+
auto httpsConfig = std::make_unique<facebook::presto::http::HttpsConfig>(
243245
folly::SocketAddress("127.0.0.1", 0), certPath, keyPath, ciphers);
244-
return std::make_unique<http::HttpServer>(
246+
return std::make_unique<facebook::presto::http::HttpServer>(
245247
httpIOExecutor, nullptr, std::move(httpsConfig));
246248
} else {
247-
return std::make_unique<http::HttpServer>(
249+
return std::make_unique<facebook::presto::http::HttpServer>(
248250
httpIOExecutor,
249-
std::make_unique<http::HttpConfig>(
251+
std::make_unique<facebook::presto::http::HttpConfig>(
250252
folly::SocketAddress("127.0.0.1", 0)),
251253
nullptr);
252254
}
@@ -268,17 +270,18 @@ struct AsyncMsgRequestState {
268270
std::function<void()> customFunc;
269271
};
270272

271-
http::EndpointRequestHandlerFactory asyncMsg(
273+
facebook::presto::http::EndpointRequestHandlerFactory asyncMsg(
272274
std::shared_ptr<AsyncMsgRequestState> request) {
273275
return [request](
274276
proxygen::HTTPMessage* /* message */,
275277
const std::vector<std::string>& /* args */) {
276-
return new http::CallbackRequestHandler(
278+
return new facebook::presto::http::CallbackRequestHandler(
277279
[request](
278280
proxygen::HTTPMessage* /*message*/,
279281
const std::vector<std::unique_ptr<folly::IOBuf>>& /*body*/,
280282
proxygen::ResponseHandler* downstream,
281-
std::shared_ptr<http::CallbackRequestHandlerState> handlerState) {
283+
std::shared_ptr<facebook::presto::http::CallbackRequestHandlerState>
284+
handlerState) {
282285
auto [promise, future] = folly::makePromiseContract<std::string>();
283286
auto eventBase = folly::EventBaseManager::get()->getEventBase();
284287
auto maxWaitMillis = request->maxWaitMillis;
@@ -297,7 +300,7 @@ http::EndpointRequestHandlerFactory asyncMsg(
297300
if (!handlerState->requestExpired()) {
298301
request->requestStatus = kStatusValid;
299302
proxygen::ResponseBuilder(downstream)
300-
.status(http::kHttpOk, "")
303+
.status(facebook::presto::http::kHttpOk, "")
301304
.header(proxygen::HTTP_HEADER_CONTENT_TYPE, "text/plain")
302305
.body(msg)
303306
.sendWithEOM();
@@ -311,7 +314,9 @@ http::EndpointRequestHandlerFactory asyncMsg(
311314
if (!handlerState->requestExpired()) {
312315
request->requestStatus = kStatusValid;
313316
proxygen::ResponseBuilder(downstream)
314-
.status(http::kHttpInternalServerError, "")
317+
.status(
318+
facebook::presto::http::kHttpInternalServerError,
319+
"")
315320
.header(
316321
proxygen::HTTP_HEADER_CONTENT_TYPE, "text/plain")
317322
.body(e.what())

presto-native-execution/presto_cpp/main/operators/BroadcastExchangeSource.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "presto_cpp/main/common/Configs.h"
1818
#include "presto_cpp/main/operators/BroadcastExchangeSource.h"
1919

20+
using namespace facebook::velox;
21+
2022
namespace facebook::presto::operators {
2123

2224
namespace {

presto-native-execution/presto_cpp/main/operators/BroadcastFactory.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include "velox/vector/ComplexVector.h"
1919
#include "velox/vector/VectorStream.h"
2020

21-
using namespace facebook::velox;
22-
2321
namespace facebook::presto::operators {
2422

2523
/// Struct for single broadcast file info.]
@@ -48,7 +46,7 @@ class BroadcastFileWriter {
4846
virtual ~BroadcastFileWriter() = default;
4947

5048
/// Write to file.
51-
void collect(const RowVectorPtr& input);
49+
void collect(const velox::RowVectorPtr& input);
5250

5351
/// Flush the data.
5452
void noMoreData();
@@ -110,8 +108,8 @@ class BroadcastFactory {
110108
virtual ~BroadcastFactory() = default;
111109

112110
std::unique_ptr<BroadcastFileWriter> createWriter(
113-
memory::MemoryPool* pool,
114-
const RowTypePtr& inputType);
111+
velox::memory::MemoryPool* pool,
112+
const velox::RowTypePtr& inputType);
115113

116114
std::shared_ptr<BroadcastFileReader> createReader(
117115
const std::unique_ptr<BroadcastFileInfo> fileInfo,

0 commit comments

Comments
 (0)