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

Method RandomBitmap

be/src/kudu/util/bitmap-test.cc:74–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72
73struct RandomBitmap {
74 RandomBitmap(int n_bits, double set_ratio) {
75 bm.resize(BitmapSize(n_bits));
76 Random r(GetRandomSeed32());
77 for (int i = 0; i < n_bits; i++) {
78 bool set = r.NextDoubleFraction() < set_ratio;
79 BitmapChange(bm.data(), i, set);
80 if (set) {
81 set_bits.insert(i);
82 }
83 }
84 }
85
86 faststring bm;
87 std::set<int> set_bits;

Callers

nothing calls this directly

Calls 7

BitmapSizeFunction · 0.85
GetRandomSeed32Function · 0.85
BitmapChangeFunction · 0.85
resizeMethod · 0.80
NextDoubleFractionMethod · 0.45
dataMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected