Skip to content

Commit

Permalink
remove h2
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener committed Jan 13, 2022
1 parent fdb4cdc commit f20110d
Show file tree
Hide file tree
Showing 17 changed files with 6 additions and 40 deletions.
2 changes: 0 additions & 2 deletions conf/nebula-graphd.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@
--ws_ip=0.0.0.0
# HTTP service port
--ws_http_port=19669
# HTTP2 service port
--ws_h2_port=19670
# storage client timeout
--storage_client_timeout_ms=60000
# Port to listen on Meta with HTTP protocol, it corresponds to ws_http_port in metad's configuration file
Expand Down
2 changes: 0 additions & 2 deletions conf/nebula-graphd.conf.production
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
--ws_ip=0.0.0.0
# HTTP service port
--ws_http_port=19669
# HTTP2 service port
--ws_h2_port=19670
# storage client timeout
--storage_client_timeout_ms=60000
# Port to listen on Meta with HTTP protocol, it corresponds to ws_http_port in metad's configuration file
Expand Down
2 changes: 0 additions & 2 deletions conf/nebula-metad.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
--ws_ip=0.0.0.0
# HTTP service port
--ws_http_port=19559
# HTTP2 service port
--ws_h2_port=19560
# Port to listen on Storage with HTTP protocol, it corresponds to ws_http_port in storage's configuration file
--ws_storage_http_port=19779

Expand Down
2 changes: 0 additions & 2 deletions conf/nebula-metad.conf.production
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
--ws_ip=0.0.0.0
# HTTP service port
--ws_http_port=19559
# HTTP2 service port
--ws_h2_port=19560
# Port to listen on Storage with HTTP protocol, it corresponds to ws_http_port in storage's configuration file
--ws_storage_http_port=19779

Expand Down
4 changes: 0 additions & 4 deletions conf/nebula-standalone.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,12 @@
--ws_ip=0.0.0.0
# HTTP service port
--ws_http_port=19669
# HTTP2 service port
--ws_h2_port=19670
# storage client timeout
--storage_client_timeout_ms=60000
# Port to listen on Meta with HTTP protocol, it corresponds to ws_http_port in metad's configuration file
--ws_meta_http_port=19559
# HTTP service port
--ws_storage_http_port=19779
# HTTP2 service port
--ws_storage_h2_port=19780
# heartbeat with meta service
--heartbeat_interval_secs=10

Expand Down
2 changes: 0 additions & 2 deletions conf/nebula-storaged-listener.conf.production
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
--ws_ip=192.168.2.4
# HTTP service port
--ws_http_port=19789
# HTTP2 service port
--ws_h2_port=19790
# heartbeat with meta service
--heartbeat_interval_secs=10

Expand Down
2 changes: 0 additions & 2 deletions conf/nebula-storaged.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
--ws_ip=0.0.0.0
# HTTP service port
--ws_http_port=19779
# HTTP2 service port
--ws_h2_port=19780
# heartbeat with meta service
--heartbeat_interval_secs=10

Expand Down
2 changes: 0 additions & 2 deletions conf/nebula-storaged.conf.production
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
--ws_ip=0.0.0.0
# HTTP service port
--ws_http_port=19779
# HTTP2 service port
--ws_h2_port=19780
# heartbeat with meta service
--heartbeat_interval_secs=10

Expand Down
1 change: 0 additions & 1 deletion src/common/http/test/HttpClientTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class HttpClientTestEnv : public ::testing::Environment {
void SetUp() override {
FLAGS_ws_ip = "127.0.0.1";
FLAGS_ws_http_port = 0;
FLAGS_ws_h2_port = 0;
LOG(INFO) << "Starting web service...";
webSvc_ = std::make_unique<WebService>();

Expand Down
1 change: 0 additions & 1 deletion src/meta/http/test/MetaHttpDownloadHandlerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class MetaHttpDownloadHandlerTestEnv : public ::testing::Environment {
void SetUp() override {
FLAGS_ws_ip = "127.0.0.1";
FLAGS_ws_http_port = 0;
FLAGS_ws_h2_port = 0;
VLOG(1) << "Starting web service...";

rootPath_ = std::make_unique<fs::TempDir>("/tmp/MetaHttpDownloadHandler.XXXXXX");
Expand Down
1 change: 0 additions & 1 deletion src/meta/http/test/MetaHttpIngestHandlerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class MetaHttpIngestHandlerTestEnv : public ::testing::Environment {
void SetUp() override {
FLAGS_ws_ip = "127.0.0.1";
FLAGS_ws_http_port = 0;
FLAGS_ws_h2_port = 0;
VLOG(1) << "Starting web service...";

rootPath_ = std::make_unique<fs::TempDir>("/tmp/MetaHttpIngestHandler.XXXXXX");
Expand Down
12 changes: 3 additions & 9 deletions src/webservice/WebService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "webservice/StatusHandler.h"

DEFINE_int32(ws_http_port, 11000, "Port to listen on with HTTP protocol");
DEFINE_int32(ws_h2_port, 11002, "Port to listen on with HTTP/2 protocol");
DEFINE_string(ws_ip, "0.0.0.0", "IP/Hostname to bind to");
DEFINE_int32(ws_threads, 4, "Number of threads for the web service.");

Expand Down Expand Up @@ -61,7 +60,7 @@ WebService::~WebService() {
wsThread_->join();
}

Status WebService::start(uint16_t httpPort, uint16_t h2Port) {
Status WebService::start(uint16_t httpPort) {
if (started_) {
LOG(INFO) << "Web service has been started.";
return Status::OK();
Expand Down Expand Up @@ -92,7 +91,6 @@ Status WebService::start(uint16_t httpPort, uint16_t h2Port) {

std::vector<HTTPServer::IPConfig> ips = {
{SocketAddress(FLAGS_ws_ip, httpPort, true), HTTPServer::Protocol::HTTP},
{SocketAddress(FLAGS_ws_ip, h2Port, true), HTTPServer::Protocol::HTTP2},
};

CHECK_GT(FLAGS_ws_threads, 0) << "The number of webservice threads must be greater than zero";
Expand All @@ -118,16 +116,12 @@ Status WebService::start(uint16_t httpPort, uint16_t h2Port) {
server_->start(
[&]() {
auto addresses = server_->addresses();
CHECK_EQ(addresses.size(), 2UL);
CHECK_EQ(addresses.size(), 1UL);
if (FLAGS_ws_http_port == 0) {
FLAGS_ws_http_port = addresses[0].address.getPort();
}
if (FLAGS_ws_h2_port == 0) {
FLAGS_ws_h2_port = addresses[1].address.getPort();
}
LOG(INFO) << "Web service started on "
<< "HTTP[" << FLAGS_ws_http_port << "], "
<< "HTTP2[" << FLAGS_ws_h2_port << "]";
<< "HTTP[" << FLAGS_ws_http_port << "], ";
{
std::lock_guard<std::mutex> g(mut);
serverStartedDone = true;
Expand Down
9 changes: 3 additions & 6 deletions src/webservice/WebService.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
#include "common/base/Status.h"

DECLARE_int32(ws_http_port);
DECLARE_int32(ws_h2_port);
DECLARE_string(ws_ip);
DECLARE_int32(ws_threads);

#ifdef BUILD_STANDALONE
DECLARE_int32(ws_storage_http_port);
DECLARE_int32(ws_storage_h2_port);
DECLARE_int32(ws_storage_threads);
#endif

Expand Down Expand Up @@ -44,11 +42,10 @@ class WebService final {
}

// To start the global web server.
// Two ports would be bound, one for HTTP, another one for HTTP2.
// If FLAGS_ws_http_port or FLAGS_ws_h2_port is zero, an ephemeral port
// Two ports would be bound, one for HTTP.
// If FLAGS_ws_http_port is zero, an ephemeral port
// would be assigned and set back to the gflag, respectively.
NG_MUST_USE_RESULT Status start(uint16_t httpPort = FLAGS_ws_http_port,
uint16_t h2Port = FLAGS_ws_h2_port);
NG_MUST_USE_RESULT Status start(uint16_t httpPort = FLAGS_ws_http_port);

// Check whether web service is started
bool started() const {
Expand Down
1 change: 0 additions & 1 deletion src/webservice/test/FlagsAccessTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class FlagsAccessTestEnv : public ::testing::Environment {
public:
void SetUp() override {
FLAGS_ws_http_port = 0;
FLAGS_ws_h2_port = 0;
VLOG(1) << "Starting web service...";
webSvc_ = std::make_unique<WebService>();
auto status = webSvc_->start();
Expand Down
1 change: 0 additions & 1 deletion src/webservice/test/StatsReaderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class StatsReaderTestEnv : public ::testing::Environment {
public:
void SetUp() override {
FLAGS_ws_http_port = 0;
FLAGS_ws_h2_port = 0;
VLOG(1) << "Starting web service...";
webSvc_ = std::make_unique<WebService>();
auto status = webSvc_->start();
Expand Down
1 change: 0 additions & 1 deletion src/webservice/test/StatusHandlerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class StatusHandlerTestEnv : public ::testing::Environment {
public:
void SetUp() override {
FLAGS_ws_http_port = 0;
FLAGS_ws_h2_port = 0;
VLOG(1) << "Starting web service...";

webSvc_ = std::make_unique<WebService>();
Expand Down
1 change: 0 additions & 1 deletion tests/common/nebula_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def _format_nebula_command(self):
'pid_file': 'pids{}/nebula-{}.pid'.format(self.suffix_index, self.name),
'port': self.tcp_port,
'ws_http_port': self.http_port,
'ws_h2_port': self.https_port,
}
# data path
if self.name.upper() != 'GRAPHD':
Expand Down

0 comments on commit f20110d

Please sign in to comment.