diff --git a/src/kudu/server/server_base.cc b/src/kudu/server/server_base.cc index ae049548c9..c993f659ed 100644 --- a/src/kudu/server/server_base.cc +++ b/src/kudu/server/server_base.cc @@ -12,6 +12,7 @@ #include "kudu/common/wire_protocol.pb.h" #include "kudu/fs/fs_manager.h" #include "kudu/gutil/strings/strcat.h" +#include "kudu/gutil/strings/substitute.h" #include "kudu/gutil/walltime.h" #include "kudu/rpc/messenger.h" #include "kudu/server/default-path-handlers.h" @@ -46,6 +47,7 @@ DECLARE_bool(use_hybrid_clock); using std::string; using std::stringstream; using std::vector; +using strings::Substitute; namespace kudu { namespace server { @@ -269,6 +271,12 @@ void ServerBase::MetricsLoggingThread() { WARN_NOT_OK(log.Close(), "Unable to close metric log"); } +std::string ServerBase::FooterHtml() const { + return Substitute("
$0\nserver uuid $1
", + VersionInfo::GetShortVersionString(), + instance_pb_->permanent_uuid()); +} + Status ServerBase::Start() { GenerateInstanceID(); @@ -281,6 +289,7 @@ Status ServerBase::Start() { AddRpczPathHandlers(messenger_, web_server_.get()); RegisterMetricsJsonHandler(web_server_.get(), metric_registry_.get()); TracingPathHandlers::RegisterHandlers(web_server_.get()); + web_server_->set_footer_html(FooterHtml()); RETURN_NOT_OK(web_server_->Start()); if (!options_.dump_info_path.empty()) { diff --git a/src/kudu/server/server_base.h b/src/kudu/server/server_base.h index bdf6bbbaa5..25f41daf19 100644 --- a/src/kudu/server/server_base.h +++ b/src/kudu/server/server_base.h @@ -106,6 +106,7 @@ class ServerBase { const std::string& format) const; Status StartMetricsLogging(); void MetricsLoggingThread(); + std::string FooterHtml() const; ServerBaseOptions options_; diff --git a/src/kudu/server/webserver.cc b/src/kudu/server/webserver.cc index 8ccbf6b58e..ed4fb15661 100644 --- a/src/kudu/server/webserver.cc +++ b/src/kudu/server/webserver.cc @@ -260,7 +260,7 @@ int Webserver::BeginRequestCallback(struct sq_connection* connection, struct sq_request_info* request_info) { PathHandler* handler; { - boost::shared_lock lock(path_handlers_lock_); + boost::shared_lock lock(lock_); PathHandlerMap::const_iterator it = path_handlers_.find(request_info->uri); if (it == path_handlers_.end()) { // Let Mongoose deal with this request; returning NULL will fall through @@ -359,7 +359,7 @@ int Webserver::RunPathHandler(const PathHandler& handler, void Webserver::RegisterPathHandler(const string& path, const string& alias, const PathHandlerCallback& callback, bool is_styled, bool is_on_nav_bar) { - boost::lock_guard lock(path_handlers_lock_); + boost::lock_guard lock(lock_); PathHandlerMap::iterator it = path_handlers_.find(path); if (it == path_handlers_.end()) { it = path_handlers_.insert( @@ -371,17 +371,11 @@ void Webserver::RegisterPathHandler(const string& path, const string& alias, const char* const PAGE_HEADER = "" " " " Cloudera Kudu" -" " -" " +" " +" " " " " "; -static const char* const PAGE_FOOTER = ""; - static const char* const NAVIGATION_BAR_PREFIX = "