MCPcopy Create free account
hub / github.com/apache/arrow / Init

Method Init

cpp/src/parquet/bloom_filter.cc:106–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 compression_strategy_(CompressionStrategy::UNCOMPRESSED) {}
105
106void BlockSplitBloomFilter::Init(uint32_t num_bytes) {
107 if (num_bytes < kMinimumBloomFilterBytes) {
108 num_bytes = kMinimumBloomFilterBytes;
109 }
110
111 // Get next power of 2 if it is not power of 2.
112 if ((num_bytes & (num_bytes - 1)) != 0) {
113 num_bytes = static_cast<uint32_t>(::arrow::bit_util::NextPower2(num_bytes));
114 }
115
116 if (num_bytes > kMaximumBloomFilterBytes) {
117 num_bytes = kMaximumBloomFilterBytes;
118 }
119
120 num_bytes_ = num_bytes;
121 PARQUET_ASSIGN_OR_THROW(data_, ::arrow::AllocateBuffer(num_bytes_, pool_));
122 memset(data_->mutable_data(), 0, num_bytes_);
123
124 this->hasher_ = std::make_unique<XxHasher>();
125}
126
127void BlockSplitBloomFilter::Init(const uint8_t* bitset, uint32_t num_bytes) {
128 DCHECK(bitset != nullptr);

Callers 2

DeserializeMethod · 0.45

Calls 4

NextPower2Function · 0.85
ParquetExceptionFunction · 0.85
AllocateBufferFunction · 0.70
mutable_dataMethod · 0.45

Tested by

no test coverage detected