Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <string-search-sse.h>
Public Member Functions | |
StringSearchSSE (const char *needle) | |
StringSearchSSE (const StringValue *needle) | |
StringSearchSSE () | |
int | Search (const StringValue &haystack) const |
Private Attributes | |
const StringValue * | needle_str_val_ |
Only one of these two will be non-null. Both are unowned. More... | |
const char * | needle_cstr_ |
int | needle_len_ |
NOTE: Because this modifies the strings in place, you cannot pass it data that was from the data section (e.g. StringSearchSSE(StringValue("abcd", 4)); TODO: this is still 25% slower than just calling strstr. Look into why TODO: this cannot be used with data containing nulls (I think)
Definition at line 18 of file string-search-sse.h.
|
inline |
Create a search needle for null-terminated strings. This is more efficient for searching and should be used if either the needle already happens to be null terminated or the needle will be reused repeatedly, in which case the copy and null terminate is worth it. The caller owns the memory for the needle.
Definition at line 25 of file string-search-sse.h.
References needle_len_.
|
inline |
Create a search needle from a non-null terminated string. The caller owns the memory for the needle.
Definition at line 32 of file string-search-sse.h.
References impala::StringValue::len, and needle_len_.
|
inline |
Definition at line 37 of file string-search-sse.h.
|
inline |
Search for needle in haystack. Returns the offset into str if the needle exists Returns -1 if the needle is not found str will be temporarily modified for the duration of the function
Definition at line 43 of file string-search-sse.h.
References impala::StringValue::len, LIKELY, needle_cstr_, needle_len_, needle_str_val_, offset, impala::StringValue::ptr, and UNLIKELY.
Referenced by TestImpalaNonNullTerminated(), TestImpalaNullTerminated(), and impala::TestSearch().
|
private |
Definition at line 143 of file string-search-sse.h.
Referenced by Search().
|
private |
Definition at line 145 of file string-search-sse.h.
Referenced by Search(), and StringSearchSSE().
|
private |
Only one of these two will be non-null. Both are unowned.
Definition at line 142 of file string-search-sse.h.
Referenced by Search().