MCPcopy Create free account
hub / github.com/apache/impala / FindSyncBlock

Method FindSyncBlock

be/src/exec/base-sequence-scanner.cc:251–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251int BaseSequenceScanner::FindSyncBlock(const uint8_t* buffer, int buffer_len,
252 const uint8_t* sync, int sync_len) {
253 char* sync_str = reinterpret_cast<char*>(const_cast<uint8_t*>(sync));
254 StringValue needle = StringValue(sync_str, sync_len);
255
256 StringValue haystack(
257 const_cast<char*>(reinterpret_cast<const char*>(buffer)), buffer_len);
258
259 StringSearch search(&needle);
260 int offset = search.Search(&haystack);
261
262 if (offset != -1) {
263 // Advance offset past sync
264 offset += sync_len;
265 }
266 return offset;
267}
268
269Status BaseSequenceScanner::SkipToSync(const uint8_t* sync, int sync_size) {
270 // offset into current buffer of end of sync (once found, -1 until then)

Callers

nothing calls this directly

Calls 2

StringValueClass · 0.70
SearchMethod · 0.45

Tested by

no test coverage detected