Public Member Functions | Protected Member Functions
ibis::fuge Class Reference

A two-level index. More...

#include <ibin.h>

Inheritance diagram for ibis::fuge:
ibis::bin ibis::index

List of all members.

Public Member Functions

virtual void adjustLength (uint32_t nrows)
 Fill the bitmaps to the specified size.
virtual long append (const char *dt, const char *df, uint32_t nnew)
 Create index for the data in df and append the result to the index in dt.
long append (const ibis::fuge &tail)
virtual void estimate (const ibis::qContinuousRange &expr, ibis::bitvector &lower, ibis::bitvector &upper) const
 Provide an estimation based on the current index.
virtual long evaluate (const ibis::qContinuousRange &expr, ibis::bitvector &hits) const
 To evaluate the exact hits.
virtual long evaluate (const ibis::qDiscreteRange &expr, ibis::bitvector &hits) const
 To evaluate the exact hits.
 fuge (const ibis::column *c, ibis::fileManager::storage *st, size_t offset=8)
 Reconstruct from content of a file.
 fuge (const ibis::column *, const char *)
 fuge (const ibis::bin &rhs)
virtual const char * name () const
 Returns the name of the index, similar to the function type, but returns a string instead.
virtual void print (std::ostream &out) const
 Prints human readable information.
virtual int read (const char *idxfile)
 Read the content of the named file.
virtual int read (ibis::fileManager::storage *st)
 Read an index from the storage object.
virtual INDEX_TYPE type () const
 Returns an index type identifier.
virtual int write (const char *dt) const
 Write the index to the named directory or file.

Protected Member Functions

virtual void clear ()
 Clear the existing content.
virtual size_t getSerialSize () const throw ()
 Estimate the size of the serialized version of the index.

Detailed Description

A two-level index.

The top (coarse) level uses the interval encoding and the bottom (fine) level uses the equality encoding. Similar to class ibis::fuzz, the fine level bitmaps are kept together as in ibis::bin and the coarse level bitmaps are placed at the end of the index file.


Constructor & Destructor Documentation

ibis::fuge::fuge ( const ibis::column c,
ibis::fileManager::storage st,
size_t  start = 8 
)

Reconstruct from content of a file.

The leading portion of the index file is the same as ibis::bin, which allows the constructor of the base class to work properly. The content following the last bitvector in ibis::bin is as follows,

See also:
ibis::fuge::writeCoarse.
   nc      (uint32_t)                   -- number of coarse bins.
   cbounds (unsigned[nc+1])             -- boundaries of the coarse bins.
   coffsets([nc-ceil(nc/2)+2])          -- starting positions (32/64-bit).
   cbits   (bitvector[nc-ceil(nc/2)+1]) -- bitvectors.

References ibis::fileManager::storage::begin(), ibis::array_t< T >::clear(), clear(), ibis::index::col, ibis::gVerbose, ibis::fileManager::storage::isFileMap(), ibis::part::name(), ibis::column::name(), ibis::bin::nobs, ibis::index::nrows, ibis::index::offset32, ibis::index::offset64, print(), ibis::array_t< T >::resize(), ibis::fileManager::storage::size(), and ibis::array_t< T >::swap().


Member Function Documentation

void ibis::fuge::adjustLength ( uint32_t  nr) [virtual]

Fill the bitmaps to the specified size.

Fill the bitvectors with zeros so that they all contain nrows bits.

Truncate the bitvectors if they have more bits.

Reimplemented from ibis::bin.

References ibis::bin::adjustLength().

virtual void ibis::fuge::clear ( ) [inline, protected, virtual]

Clear the existing content.

Free the objectes pointed to by the pointers.

Reimplemented from ibis::bin.

References ibis::bin::clear().

Referenced by fuge().

void ibis::fuge::estimate ( const ibis::qContinuousRange expr,
ibis::bitvector lower,
ibis::bitvector upper 
) const [virtual]

Provide an estimation based on the current index.

Set bits in lower are hits for certain, set bits in upper are candidates. Set bits in (upper - lower) should be checked to verifies which ones are actually hits. If the bitvector upper contain less bits than bitvector lower, the content of upper is assumed to be the same as lower.

Note:
This function will not do anything if the estimated cost is high.

Reimplemented from ibis::bin.

References ibis::bitvector::clear(), ibis::bitvector::copy(), ibis::gVerbose, and ibis::bitvector::set().

long ibis::fuge::evaluate ( const ibis::qContinuousRange expr,
ibis::bitvector hits 
) const [virtual]

To evaluate the exact hits.

On success, return the number of hits, otherwise a negative value is returned.

Reimplemented from ibis::bin.

References ibis::bitvector::cnt(), and ibis::bitvector::size().

virtual long ibis::fuge::evaluate ( const ibis::qDiscreteRange ,
ibis::bitvector  
) const [inline, virtual]

To evaluate the exact hits.

On success, return the number of hits, otherwise a negative value is returned.

Reimplemented from ibis::bin.

References ibis::range::evaluate().

size_t ibis::fuge::getSerialSize ( ) const throw () [protected, virtual]

Estimate the size of the serialized version of the index.

Return the size in bytes.

Reimplemented from ibis::bin.

References ibis::bitvector::size().

virtual const char* ibis::fuge::name ( ) const [inline, virtual]

Returns the name of the index, similar to the function type, but returns a string instead.

Reimplemented from ibis::bin.

void ibis::fuge::print ( std::ostream &  out) const [virtual]

Prints human readable information.

Outputs information about the index as text to the specified output stream.

Reimplemented from ibis::bin.

References ibis::gVerbose.

Referenced by fuge().


The documentation for this class was generated from the following files:

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive