The public interface of bundles. More...
#include <bundle.h>
Public Member Functions | |
virtual void * | columnArray (uint32_t) const |
Return the pointer to the underlying array used to store the jth column of the bundle. More... | |
virtual const ibis::column * | columnPointer (uint32_t) const |
Column pointer. | |
virtual ibis::TYPE_T | columnType (uint32_t) const |
Return the type used to store the values of the jth column of the bundle. More... | |
const ibis::RIDSet * | getRIDs (uint32_t ind) const |
Return the RIDs of the ind th bundle. | |
const ibis::RIDSet * | getRIDs () const |
Return the pointer to all RIDs. | |
const ibis::array_t< uint32_t > * | getStarts () const |
Return the pointer to array starts. | |
uint32_t | numRowsInBundle (uint32_t ind) const |
Compute the number of rows in bundle ind . | |
virtual void | print (std::ostream &out) const =0 |
Print the bundle values to the specified output stream. | |
virtual void | printAll (std::ostream &out) const =0 |
Print the bundle values along with the RIDs. | |
virtual void | printColumnNames (std::ostream &out) const =0 |
Print column names. | |
virtual void | reorder (const char *)=0 |
Re-order the bundles according to the new keys. | |
uint32_t | rowCounts (array_t< uint32_t > &cnt) const |
Compute the number of rows in each group(bundle). More... | |
virtual uint32_t | size () const |
Return the number of bundles. | |
void | sortRIDs (uint32_t i, uint32_t j) |
Sort RIDs in the range of [i, j) | |
void | swapRIDs (uint32_t i, uint32_t j) |
virtual long | truncate (uint32_t keep)=0 |
Truncate the list of bundles. | |
virtual long | truncate (uint32_t keep, uint32_t start)=0 |
Truncate the list of bundles. | |
virtual long | truncate (const char *names, uint32_t keep)=0 |
Truncate the list of bundle based on specified keys. | |
virtual uint32_t | width () const |
Return the width of the bundles. | |
virtual void | write (const ibis::query &q) const =0 |
Write the bundle to the directory for the query q . | |
virtual int32_t | getInt (uint32_t, uint32_t) const |
Retrieve a single value. More... | |
virtual uint32_t | getUInt (uint32_t, uint32_t) const |
Return the maximal unsigned int value. | |
virtual int64_t | getLong (uint32_t, uint32_t) const |
Return the maximal int value. | |
virtual uint64_t | getULong (uint32_t, uint32_t) const |
Return the maximal unsigned int value. | |
virtual float | getFloat (uint32_t, uint32_t) const |
Return the maximal float value. | |
virtual double | getDouble (uint32_t, uint32_t) const |
Return the maximum double value. | |
virtual std::string | getString (uint32_t, uint32_t) const |
Retrieve a string value. More... | |
Static Public Member Functions | |
static bundle * | create (const ibis::query &, int=0) |
Create new bundle from a query object. More... | |
static bundle * | create (const ibis::query &, const ibis::bitvector &, int=0) |
Create a new bundle from previously stored information. | |
static bundle * | create (const ibis::part &, const ibis::selectClause &, int=0) |
Create a bundle using the all values of the partition. | |
static const ibis::RIDSet * | readRIDs (const char *dir, const uint32_t i) |
Return the RIDs related to the ith bundle. More... | |
Protected Member Functions | |
bundle (const ibis::selectClause &c) | |
bundle (const ibis::query &q) | |
bundle (const ibis::query &q, const ibis::bitvector &hits) | |
bundle (const ibis::part &t, const ibis::selectClause &s) | |
Protected Attributes | |
const ibis::selectClause & | comps |
const char * | id |
bool | infile |
ibis::RIDSet * | rids |
array_t< uint32_t > * | starts |
The public interface of bundles.
This is an incore implementation, that is, it stores all relevant values in memory. It is intended to be used only to sort the selected values and immediately write out the content to files.
Given a select clause, its terms are logically re-ordered so that the plain column names are placed before all the functions, such as, "SELECT variable1, variable2, ..., aggregation1, aggregation2, ..." where the relative order of the plain column names are preserved as they appeared on input. The rows/records of the query results are ordered according to the values of the plain columns.
|
inlinevirtual |
Return the pointer to the underlying array used to store the jth column of the bundle.
Reimplemented in ibis::bundles, and ibis::bundle1.
|
inlinevirtual |
Return the type used to store the values of the jth column of the bundle.
Reimplemented in ibis::bundles, and ibis::bundle1.
References ibis::UNKNOWN_TYPE.
|
static |
Create new bundle from a query object.
Write info to q.dir().
dir |
|
References ibis::selectClause::aggSize(), ibis::query::components(), ibis::horometer::CPUTime(), ibis::selectClause::empty(), ibis::query::logMessage(), ibis::horometer::realTime(), ibis::horometer::start(), and ibis::horometer::stop().
Referenced by ibis::query::evaluate(), ibis::query::getRIDsInBundle(), ibis::bord::groupbya(), ibis::query::limit(), ibis::query::orderby(), ibis::query::printSelected(), ibis::query::printSelectedWithRID(), and ibis::bord::xgroupby().
|
virtual |
Retrieve a single value.
Return the maximal int value.
Numerical values will be casted into the return type.
Reimplemented in ibis::bundles, and ibis::bundle1.
|
virtual |
Retrieve a string value.
Return an empty string.
It converts all data types to its string representation through the string stream library.
Could have thrown an exception, but that seemed to be a little too heavy handed.
Reimplemented in ibis::bundles, and ibis::bundle1.
|
static |
Return the RIDs related to the ith bundle.
Read the RIDs related to the ith bundle.
References ibis::fileManager::storage::beginUse(), ibis::fileManager::storage::bytes(), ibis::fileManager::storage::endUse(), ibis::fileManager::getFile(), ibis::fileManager::instance(), ibis::fileManager::recordPages(), ibis::array_t< T >::resize(), and UnixOpen.
Referenced by ibis::query::getRIDsInBundle().
uint32_t ibis::bundle::rowCounts | ( | array_t< uint32_t > & | cnt | ) | const |
Compute the number of rows in each group(bundle).
Return the number of bundles.
References ibis::array_t< T >::clear(), and ibis::array_t< T >::resize().