Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
webserver.cc File Reference
#include "util/webserver.h"
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/mem_fn.hpp>
#include <boost/thread/locks.hpp>
#include <gutil/strings/substitute.h>
#include <map>
#include <fstream>
#include <stdio.h>
#include <signal.h>
#include <string>
#include <mustache/mustache.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/prettywriter.h>
#include "common/logging.h"
#include "util/cpu-info.h"
#include "util/disk-info.h"
#include "util/mem-info.h"
#include "util/os-info.h"
#include "util/process-state-info.h"
#include "util/url-coding.h"
#include "util/debug-util.h"
#include "util/pretty-printer.h"
#include "util/stopwatch.h"
#include "rpc/thrift-util.h"
#include "common/names.h"
Include dependency graph for webserver.cc:

Go to the source code of this file.

Namespaces

 impala
 This file contains type definitions that are used throughout the code base.
 

Enumerations

enum  impala::ResponseCode { impala::OK = 200, impala::NOT_FOUND = 404 }
 
enum  impala::ContentType { impala::HTML, impala::PLAIN }
 

Functions

const char * GetDefaultDocumentRoot ()
 
 DEFINE_int32 (webserver_port, 25000,"Port to start debug webserver on")
 
 DEFINE_string (webserver_interface,"","Interface to start debug webserver on. If blank, webserver binds to 0.0.0.0")
 
 DEFINE_string (webserver_doc_root, GetDefaultDocumentRoot(),"Files under <webserver_doc_root>/www are accessible via the debug webserver. ""Defaults to $IMPALA_HOME, or if $IMPALA_HOME is not set, disables the document ""root")
 
 DEFINE_bool (enable_webserver_doc_root, true,"If true, webserver may serve static files from the webserver_doc_root")
 
 DEFINE_string (webserver_certificate_file,"","The location of the debug webserver's SSL certificate file, in .pem format. If ""empty, webserver SSL support is not enabled")
 
 DEFINE_string (webserver_authentication_domain,"","Domain used for debug webserver authentication")
 
 DEFINE_string (webserver_password_file,"","(Optional) Location of .htpasswd file containing user names and hashed passwords for"" debug webserver authentication")
 
string impala::BuildHeaderString (ResponseCode response, ContentType content_type)
 

Variables

static const char * DOC_FOLDER = "/www/"
 
static const int DOC_FOLDER_LEN = strlen(DOC_FOLDER)
 
static const uint32_t PROCESSING_COMPLETE = 1
 
static const uint32_t NOT_PROCESSED = 0
 
static const char * COMMON_JSON_KEY = "__common__"
 
static const char * ERROR_KEY = "__error_msg__"
 

Function Documentation

DEFINE_bool ( enable_webserver_doc_root  ,
true  ,
"If  true,
webserver may serve static files from the webserver_doc_root"   
)
DEFINE_int32 ( webserver_port  ,
25000  ,
"Port to start debug webserver on"   
)
DEFINE_string ( webserver_interface  ,
""  ,
"Interface to start debug webserver on. If  blank,
webserver binds to 0.0.0.0"   
)
DEFINE_string ( webserver_doc_root  ,
GetDefaultDocumentRoot()  ,
"Files under <webserver_doc_root>/www are accessible via the debug webserver. ""Defaults to  $IMPALA_HOME,
or if $IMPALA_HOME is not  set,
disables the document""root"   
)
DEFINE_string ( webserver_certificate_file  ,
""  ,
"The location of the debug webserver's SSL certificate  file,
in.pem format.If""  empty,
webserver SSL support is not enabled"   
)
DEFINE_string ( webserver_authentication_domain  ,
""  ,
"Domain used for debug webserver authentication"   
)
DEFINE_string ( webserver_password_file  ,
""  ,
"(Optional) Location of .htpasswd file containing user names and hashed passwords for"" debug webserver authentication"   
)
const char * GetDefaultDocumentRoot ( )

Definition at line 95 of file webserver.cc.

Variable Documentation

const char* COMMON_JSON_KEY = "__common__"
static

Definition at line 88 of file webserver.cc.

Referenced by impala::Webserver::GetCommonJson().

const char* DOC_FOLDER = "/www/"
static

Definition at line 79 of file webserver.cc.

Referenced by impala::Webserver::BeginRequestCallback().

const int DOC_FOLDER_LEN = strlen(DOC_FOLDER)
static

Definition at line 80 of file webserver.cc.

Referenced by impala::Webserver::BeginRequestCallback().

const char* ERROR_KEY = "__error_msg__"
static
const uint32_t NOT_PROCESSED = 0
static

Definition at line 84 of file webserver.cc.

Referenced by impala::Webserver::BeginRequestCallback().

const uint32_t PROCESSING_COMPLETE = 1
static