Veil
|
A bitmap hashes is a hash table of identically-ranged bitmaps, indexed by a text key.
Typically bitmap hashes are used for sparse collections of privileges.
Note that bitmap hashes may not be stored in shared variables as hashes in shared memory are insufficiently dynamic.
The following functions comprise the Veil bitmap hashes API:
init_bitmap_hash(bmhash text, range text)
clear_bitmap_hash(bmhash text)
bitmap_hash_key_exists(bmhash text, key text)
bitmap_from_hash(bmref text, bmhash text, key text)
bitmap_hash_testbit(bmhash text, key text, bitno int4)
bitmap_hash_setbit(bmhash text, kay text, bitno int4)
bitmap_hash_clearbit(bmhash text, key text, bitno int4)
union_into_bitmap_hash(bmhash text, key text, bitmap text)
union_from_bitmap_hash(bmhash text, key text, bitmap text)
intersect_from_bitmap_hash(bitmap text, bmhash text, key text)
bitmap_hash_bits(bmhash text, key text)
bitmap_hash_range(bmhash text)
bitmap_hash_entries(bmhash text)
function veil.init_bitmap_hash(bmhash text, range text) returns bool
Creates, or resets, a bitmap hash. Implemented by C function veil_init_bitmap_hash().
function veil.clear_bitmap_hash(bmhash text) returns bool
Clear all bits in all bitmaps of a bitmap hash. Implemented by C function veil_clear_bitmap_hash(). Implemented by C function veil_clear_bitmap_hash().
function veil.bitmap_hash_key_exists(bmhash text, key text) returns bool
Determine whether a given key exists in the hash (contains a bitmap). Implemented by C function veil_bitmap_hash_key_exists().
function veil.bitmap_from_hash(bmref text, bmhash text, key text) returns text
Generate a reference to a specific bitmap in a bitmap hash. Implemented by C function veil_bitmap_from_hash().
function veil.bitmap_hash_testbit(bmhash text, key text, bitno int4) returns bool
Test a specific bit in a bitmap hash. Implemented by C function veil_bitmap_hash_testbit().
function veil.bitmap_hash_setbit(bmhash text, key text, bitno int4) returns bool
Set a specific bit in a bitmap hash. Implemented by C function veil_bitmap_hash_setbit().
function veil.bitmap_hash_clearbit(bmhash text, key text, bitno int4) returns bool
Clear a specific bit in a bitmap hash. Implemented by C function veil_bitmap_hash_clearbit().
function veil.union_into_bitmap_hash(bmhash text, key text, bitmap text) returns bool
Union a specified bitmap from a hash with a bitmap, with the result in the bitmap hash. Implemented by C function veil_union_into_bitmap_hash(). This is a faster shortcut for the following logical construction:
veil.bitmap_union(veil.bitmap_from_hash(<bitmap_hash>, <key>), <bitmap>)
function veil.union_from_bitmap_hash(bmhash text, key text, bitmap text) returns bool
Union a bitmap with a specified bitmap from a hash, with the result in the bitmap. Implemented by C function veil_union_from_bitmap_hash(). This is a faster shortcut for the following logical construction:
veil.bitmap_union(<bitmap>, veil.bitmap_from_hash(<bitmap_array>, <key>))
function veil.intersect_from_bitmap_hash(bitmap text, bmhash text, key text) returns bool
Intersect a bitmap with a specified bitmap from a hash, with the result in the bitmap. Implemented by C function veil_intersect_from_bitmap_hash(). This is a faster shortcut for the following logical construction:
veil.bitmap_intersect(<bitmap>, veil.bitmap_from_hash(<bitmap_array>, <key>))
function veil.bitmap_hash_bits(bmhash text, key text) returns setof int4
Show all bits in the specific bitmap within a hash. This is primarily intended for interactive use when developing and debugging Veil-based systems. Implemented by C function veil_bitmap_hash_bits().
function veil.bitmap_hash_range(bmhash text) returns veil_range_t
Show the range, as a veil_range_t, of all bitmaps in the hash. Primarily intended for interactive use. Implemented by C function veil_bitmap_hash_range().
function veil.bitmap_hash_entries(bmhash text) returns setof text
Show every key in the hash. Primarily intended for interactive use. Implemented by C function veil_bitmap_hash_entries().
Next: Integer Arrays