Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <url-parser.h>
Public Types | |
enum | UrlPart { INVALID, AUTHORITY, FILE, HOST, PATH, PROTOCOL, QUERY, REF, USERINFO } |
Parts of a URL that can be requested. More... | |
Static Public Member Functions | |
static bool | ParseUrl (const StringValue &url, UrlPart part, StringValue *result) |
static bool | ParseUrlKey (const StringValue &url, UrlPart part, const StringValue &key, StringValue *result) |
static UrlPart | GetUrlPart (const StringValue &part) |
Static Private Attributes | |
static const StringValue | url_authority |
static const StringValue | url_file |
static const StringValue | url_host |
static const StringValue | url_path |
static const StringValue | url_protocol |
static const StringValue | url_query |
static const StringValue | url_ref |
static const StringValue | url_userinfo |
static const StringValue | protocol |
static const StringValue | at |
static const StringValue | slash |
static const StringValue | colon |
static const StringValue | question |
static const StringValue | hash |
static const StringSearch | protocol_search |
static const StringSearch | at_search |
static const StringSearch | slash_search |
static const StringSearch | colon_search |
static const StringSearch | question_search |
static const StringSearch | hash_search |
TODO: For now, our parse_url may not behave exactly like Hive when given malformed URLs. If necessary, we can closely follow Java's URL implementation to behave exactly like Hive. Example for explaining URL parts: http://user:pass@example.com:80/docs/books/tutorial/index.html?name=networking#DOWNLOADING PROTOCOL = http AUTHORITY = example.com:80 HOST = example.com PATH = /docs/books/tutorial/index.html QUERY = name=networking FILENAME = /docs/books/tutorial/index.html?name=networking REF = DOWNLOADING USERINFO = user:pass More details on what exactly the URL parts mean can be found here: http://docs.oracle.com/javase/tutorial/networking/urls/urlInfo.html
Definition at line 41 of file url-parser.h.
Parts of a URL that can be requested.
Enumerator | |
---|---|
INVALID | |
AUTHORITY | |
FILE | |
HOST | |
PATH | |
PROTOCOL | |
QUERY | |
REF | |
USERINFO |
Definition at line 44 of file url-parser.h.
|
static |
Compares part against url_authority, url_file, url_host, etc., and returns the corresponding enum. If part did not match any of the url part constants, returns INVALID.
Definition at line 214 of file url-parser.cc.
References AUTHORITY, impala::StringValue::Eq(), FILE, HOST, INVALID, PATH, PROTOCOL, impala::StringValue::ptr, QUERY, REF, url_authority, url_file, url_host, url_path, url_protocol, url_query, url_ref, url_userinfo, and USERINFO.
|
static |
Tries to parse the part from url. Places the result in result. Returns false if the URL is malformed or if part is invalid. True otherwise. If false is returned the contents of results are undefined.
Definition at line 43 of file url-parser.cc.
References at, at_search, AUTHORITY, colon_search, FILE, hash, hash_search, HOST, INVALID, impala::StringValue::len, PATH, PROTOCOL, protocol, protocol_search, impala::StringValue::ptr, QUERY, question, question_search, REF, impala::StringSearch::Search(), slash_search, impala::StringValue::Substring(), impala::StringValue::Trim(), and USERINFO.
|
static |
Tries to parse key from url. Places the result in result. Returns false if the URL is malformed or if part is invalid. True otherwise. If false is returned the contents of results are undefined.
Definition at line 160 of file url-parser.cc.
References impala::StringValue::len, impala::StringValue::ptr, QUERY, impala::StringSearch::Search(), impala::StringValue::Substring(), and impala::StringValue::Trim().
|
staticprivate |
Definition at line 84 of file url-parser.h.
Referenced by ParseUrl().
|
staticprivate |
Definition at line 90 of file url-parser.h.
Referenced by ParseUrl().
|
staticprivate |
Definition at line 86 of file url-parser.h.
|
staticprivate |
Definition at line 92 of file url-parser.h.
Referenced by ParseUrl().
|
staticprivate |
Definition at line 88 of file url-parser.h.
Referenced by ParseUrl().
|
staticprivate |
Definition at line 94 of file url-parser.h.
Referenced by ParseUrl().
|
staticprivate |
Definition at line 83 of file url-parser.h.
Referenced by ParseUrl().
|
staticprivate |
Definition at line 89 of file url-parser.h.
Referenced by ParseUrl().
|
staticprivate |
Definition at line 87 of file url-parser.h.
Referenced by ParseUrl().
|
staticprivate |
Definition at line 93 of file url-parser.h.
Referenced by ParseUrl().
|
staticprivate |
Definition at line 85 of file url-parser.h.
|
staticprivate |
Definition at line 91 of file url-parser.h.
Referenced by ParseUrl().
|
staticprivate |
Definition at line 74 of file url-parser.h.
Referenced by GetUrlPart().
|
staticprivate |
Definition at line 75 of file url-parser.h.
Referenced by GetUrlPart().
|
staticprivate |
Definition at line 76 of file url-parser.h.
Referenced by GetUrlPart().
|
staticprivate |
Definition at line 77 of file url-parser.h.
Referenced by GetUrlPart().
|
staticprivate |
Definition at line 78 of file url-parser.h.
Referenced by GetUrlPart().
|
staticprivate |
Definition at line 79 of file url-parser.h.
Referenced by GetUrlPart().
|
staticprivate |
Definition at line 80 of file url-parser.h.
Referenced by GetUrlPart().
|
staticprivate |
Definition at line 81 of file url-parser.h.
Referenced by GetUrlPart().