GENIE
genie::table::inv_compr_table Class Reference

#include <inv_compr_table.h>

Inheritance diagram for genie::table::inv_compr_table:
genie::table::inv_table

Public Member Functions

 inv_compr_table ()
 Default constructor of the inv_compr_table. More...
 
virtual ~inv_compr_table ()
 
genie::compression::COMPRESSION_TYPE getCompression () const
 
void setCompression (genie::compression::COMPRESSION_TYPE compression)
 
size_t getUncompressedPostingListMaxLength () const
 
void setUncompressedPostingListMaxLength (size_t length)
 
virtual std::vector< int > * inv ()
 
std::vector< uint32_t > * compressedInv ()
 
std::vector< int > * uncompressedInv ()
 
virtual std::vector< int > * inv_pos ()
 
std::vector< int > * compressedInvPos ()
 
std::vector< int > * uncompressedInvPos ()
 
uint32_t * deviceCompressedInv () const
 
double getCompressionRatio ()
 
virtual void build (size_t max_length, bool use_load_balance)
 Build the inv_table. More...
 
bool cpy_data_to_gpu ()
 Copy vector _inv to gpu memory which is referenced by d_inv_p. More...
 
void clear_gpu_mem ()
 clear the corresponding gpu memory referenced by d_inv_p More...
 
void clear ()
 
template<class Archive >
void load (Archive &ar, const unsigned int version)
 
template<class Archive >
void save (Archive &ar, const unsigned int version) const
 
- Public Member Functions inherited from genie::table::inv_table
 inv_table ()
 Default constructor of the inv_table. More...
 
virtual ~inv_table ()
 The Destructor of the inv_table. It will also clear the related gpu memory. More...
 
std::unordered_map< int, int > * get_distinct_map (int dim)
 
void append_sequence (inv_list &inv)
 append inv_list for sequence search More...
 
void set_table_index (int attr_index)
 Set the table_index to 'index'. More...
 
void set_total_num_of_table (int num)
 Set the total_num_of_table to 'num'. More...
 
int get_table_index () const
 return the index of this inv_table. More...
 
int get_total_num_of_table () const
 return the total_num_of_table. More...
 
bool cpy_data_to_gpu ()
 Copy vector _inv to gpu memory which is referenced by d_inv_p. More...
 
void clear_gpu_mem ()
 clear the corresponding gpu memory referenced by d_inv_p More...
 
void clear ()
 Clear the inv_table. More...
 
bool empty ()
 Check whether the inv_table is empty. More...
 
int m_size ()
 
int i_size ()
 
int shifter ()
 
unsigned int _shift_bits_subsequence ()
 
void append (inv_list &inv)
 Append an inv_list to the inv_table. More...
 
void append (inv_list *inv)
 Append an inv_list to the inv_table. More...
 
status build_status ()
 
std::vector< inv_list > * inv_lists ()
 
virtual std::vector< int > * ck ()
 
std::unordered_map< size_t, int > * inv_index_map ()
 
int get_upperbound_of_list (int attr_index)
 
int get_lowerbound_of_list (int attr_index)
 
int get_posting_list_size (int attr_index, int value)
 
bool list_contain (int attr_index, int value)
 Test whether a value is possible for an specific attribute. More...
 
void set_min_value_sequence (int min_value)
 Used in sequence search. To set the min_value for all sequences' element. More...
 
int get_min_value_sequence ()
 Get the min value for sequences' elements in this inv_table. More...
 
void set_max_value_sequence (int max_value)
 Set the max value for all sequence. Compare to set_min_value_sequence() More...
 
int get_max_value_sequence ()
 Get the max value. More...
 
void set_gram_length_sequence (int gram_length)
 Set length of each gram. More...
 
int get_gram_length_sequence ()
 Get the gram length. More...
 
template<class Archive >
void load (Archive &ar, const unsigned int version)
 
template<class Archive >
void save (Archive &ar, const unsigned int version) const
 

Protected Attributes

bool m_isCompressed
 
std::vector< uint32_t > m_comprInv
 
std::vector< int > m_comprInvPos
 
genie::compression::COMPRESSION_TYPE m_compression
 
uint32_t * m_d_compr_inv_p
 
size_t m_uncompressedInvListsMaxLength
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Public Types inherited from genie::table::inv_table
enum  status { not_builded, builded }
 This enum var defines two statuses for a inv_table object, which is either builded or not_builded. More...
 
- Public Attributes inherited from genie::table::inv_table
int * d_inv_p = NULL
 d_inv_p points to the start location for posting list array in GPU memory. More...
 
bool is_stored_in_gpu
 is_stored_in_gpu tell whether inverted index structure is pre-stored inside gpu memory More...
 
int shift_bits_sequence
 This variable is used to tell the number of bits shifted for recording gram in different position. More...
 
- Static Public Attributes inherited from genie::table::inv_table
static int max_inv_size = 0
 

Detailed Description

Definition at line 27 of file inv_compr_table.h.

Constructor & Destructor Documentation

◆ inv_compr_table()

genie::table::inv_compr_table::inv_compr_table ( )
inline

Default constructor of the inv_compr_table.

Definition at line 48 of file inv_compr_table.h.

◆ ~inv_compr_table()

genie::table::inv_compr_table::~inv_compr_table ( )
virtual

Definition at line 24 of file inv_compr_table.cu.

Member Function Documentation

◆ build()

void genie::table::inv_compr_table::build ( size_t  max_length,
bool  use_load_balance 
)
virtual

Build the inv_table.

Parameters
max_lengthThe maximum length of one segment in posting list array
use_load_balanceThe flag to determine whether to do load balance

This method will merge all inv_lists to two vector _ck and _inv and set the _build_status to builded. Any query should only be done after the inv_table has been builded. If use_load_balance is true, the max_length will be used to divide posting list which is longer than max_length suggests. if use_load_balance is false, the max_length will be set to positive infinity before it is used

Reimplemented from genie::table::inv_table.

Definition at line 27 of file inv_compr_table.cu.

◆ clear()

void genie::table::inv_compr_table::clear ( )

◆ clear_gpu_mem()

void genie::table::inv_compr_table::clear_gpu_mem ( )

clear the corresponding gpu memory referenced by d_inv_p

◆ compressedInv()

std::vector<uint32_t>* genie::table::inv_compr_table::compressedInv ( )

◆ compressedInvPos()

std::vector<int>* genie::table::inv_compr_table::compressedInvPos ( )

◆ cpy_data_to_gpu()

bool genie::table::inv_compr_table::cpy_data_to_gpu ( )

Copy vector _inv to gpu memory which is referenced by d_inv_p.

Returns
True if transferring is successful.

◆ deviceCompressedInv()

uint32_t* genie::table::inv_compr_table::deviceCompressedInv ( ) const

◆ getCompression()

genie::compression::COMPRESSION_TYPE genie::table::inv_compr_table::getCompression ( ) const

◆ getCompressionRatio()

double genie::table::inv_compr_table::getCompressionRatio ( )

Returns the compression ratio in bits per integer

◆ getUncompressedPostingListMaxLength()

size_t genie::table::inv_compr_table::getUncompressedPostingListMaxLength ( ) const

◆ inv()

std::vector< int > * genie::table::inv_compr_table::inv ( )
virtual
Returns
The pointer points to _inv vector.

Reimplemented from genie::table::inv_table.

Definition at line 25 of file inv_compr_table.cu.

◆ inv_pos()

std::vector< int > * genie::table::inv_compr_table::inv_pos ( )
virtual
Returns
The pointer points to _inv_pos vector.

Reimplemented from genie::table::inv_table.

Definition at line 26 of file inv_compr_table.cu.

◆ load()

template<class Archive >
void genie::table::inv_compr_table::load ( Archive &  ar,
const unsigned int  version 
)

Definition at line 122 of file serialization.cc.

◆ save()

template<class Archive >
void genie::table::inv_compr_table::save ( Archive &  ar,
const unsigned int  version 
) const

Definition at line 136 of file serialization.cc.

◆ setCompression()

void genie::table::inv_compr_table::setCompression ( genie::compression::COMPRESSION_TYPE  compression)

◆ setUncompressedPostingListMaxLength()

void genie::table::inv_compr_table::setUncompressedPostingListMaxLength ( size_t  length)

◆ uncompressedInv()

std::vector<int>* genie::table::inv_compr_table::uncompressedInv ( )

◆ uncompressedInvPos()

std::vector<int>* genie::table::inv_compr_table::uncompressedInvPos ( )

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 164 of file inv_compr_table.h.

Member Data Documentation

◆ m_compression

genie::compression::COMPRESSION_TYPE genie::table::inv_compr_table::m_compression
protected

Definition at line 37 of file inv_compr_table.h.

◆ m_comprInv

std::vector<uint32_t> genie::table::inv_compr_table::m_comprInv
protected

Definition at line 33 of file inv_compr_table.h.

◆ m_comprInvPos

std::vector<int> genie::table::inv_compr_table::m_comprInvPos
protected

Definition at line 35 of file inv_compr_table.h.

◆ m_d_compr_inv_p

uint32_t* genie::table::inv_compr_table::m_d_compr_inv_p
protected

Definition at line 39 of file inv_compr_table.h.

◆ m_isCompressed

bool genie::table::inv_compr_table::m_isCompressed
protected

Definition at line 31 of file inv_compr_table.h.

◆ m_uncompressedInvListsMaxLength

size_t genie::table::inv_compr_table::m_uncompressedInvListsMaxLength
protected

Definition at line 41 of file inv_compr_table.h.


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