From b79ae5d93d71f14a052ce4e54d0215a74a4b4266 Mon Sep 17 00:00:00 2001 From: James Clampffer Date: Thu, 7 Jun 2018 14:16:17 -0400 Subject: [PATCH] HDFS-13534. libhdfs++: Fix GCC7 build. Contributed by James Clampffer. --- .../src/main/native/libhdfspp/include/hdfspp/ioservice.h | 1 + .../src/main/native/libhdfspp/lib/reader/datatransfer.h | 2 +- .../src/main/native/libhdfspp/tests/mock_connection.h | 2 +- .../src/main/native/libhdfspp/tests/remote_block_reader_test.cc | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/ioservice.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/ioservice.h index 9805bad1c0..a6ec97ad49 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/ioservice.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/include/hdfspp/ioservice.h @@ -58,6 +58,7 @@ #ifndef INCLUDE_HDFSPP_IOSERVICE_H_ #define INCLUDE_HDFSPP_IOSERVICE_H_ +#include #include // forward decl diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/reader/datatransfer.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/reader/datatransfer.h index 2b36f590b4..ea176532f2 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/reader/datatransfer.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/reader/datatransfer.h @@ -59,7 +59,7 @@ public: void Connect(std::function dn)> handler) override {(void)handler; /*TODO: Handshaking goes here*/}; - void Cancel(); + void Cancel() override; private: DataTransferSaslStream(const DataTransferSaslStream &) = delete; DataTransferSaslStream &operator=(const DataTransferSaslStream &) = delete; diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/mock_connection.h b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/mock_connection.h index de234efd8d..82db760421 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/mock_connection.h +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/mock_connection.h @@ -87,7 +87,7 @@ public: virtual void cancel() {} virtual void close() {} protected: - virtual ProducerResult Produce() = 0; + ProducerResult Produce() override = 0; ::asio::io_service *io_service_; private: diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/remote_block_reader_test.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/remote_block_reader_test.cc index 4b909b2394..3997e64be5 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/remote_block_reader_test.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/remote_block_reader_test.cc @@ -82,7 +82,7 @@ public: this->MockConnectionBase::async_write_some(buf, handler); } - void Cancel() { + void Cancel() override { /* no-op, declared pure virtual */ } };