0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
Hypertable::Lib::ScanSpecBuilder Class Reference

Helper class for building a ScanSpec. More...

#include <ScanSpec.h>

Inheritance diagram for Hypertable::Lib::ScanSpecBuilder:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::Lib::ScanSpecBuilder:
Collaboration graph
[legend]

Public Member Functions

 ScanSpecBuilder (size_t page_size=8192)
 Constructor. More...
 
 ScanSpecBuilder (const ScanSpec &ss, size_t page_size=8192)
 Copy constructor from a ScanSpec. More...
 
ScanSpecBuilderoperator= (const ScanSpec &ss)
 
void set_row_limit (int32_t n)
 Sets the maximum number of rows to return in the scan. More...
 
void set_cell_limit (int32_t n)
 Sets the maximum number of cells to return. More...
 
void set_cell_limit_per_family (int32_t n)
 Sets the maximum number of cells to return per column family. More...
 
void set_row_offset (int32_t n)
 Sets the number of rows to be skipped at the beginning of the query. More...
 
void set_cell_offset (int32_t n)
 Sets the number of cells to be skipped at the beginning of the query. More...
 
void set_max_versions (uint32_t n)
 Sets the maximum number of revisions of each cell to return in the scan. More...
 
void set_row_regexp (const char *regexp)
 Sets the regexp to filter rows by. More...
 
void set_value_regexp (const char *regexp)
 Sets the regexp to filter cell values by. More...
 
void add_column (const string &str)
 Adds a column family to be returned by the scan. More...
 
void reserve_columns (size_t s)
 
void add_column_predicate (const string &column_family, const char *column_qualifier, uint32_t operation, const char *value, uint32_t value_len=0)
 Adds a column predicate to the scan. More...
 
void reserve_column_predicates (size_t s)
 
void add_row (const string &str)
 Adds a row to be returned in the scan. More...
 
void reserve_rows (size_t s)
 
void add_row_interval (const string &start, bool start_inclusive, const string &end, bool end_inclusive)
 Adds a row interval to be returned in the scan. More...
 
void add_cell (const string &row, const string &column)
 Adds a cell to be returned in the scan. More...
 
void reserve_cells (size_t s)
 
void add_cell_interval (const string &start_row, const string &start_column, bool start_inclusive, const string &end_row, const string &end_column, bool end_inclusive)
 Adds a cell interval to be returned in the scan. More...
 
void set_time_interval (int64_t start, int64_t end)
 Sets the time interval of the scan. More...
 
void set_start_time (int64_t start)
 
void set_end_time (int64_t end)
 
void set_keys_only (bool val)
 Return only keys (no values) More...
 
void set_return_deletes (bool val)
 Internal use only. More...
 
void set_scan_and_filter_rows (bool val)
 Scan and filter rows. More...
 
void set_do_not_cache (bool val)
 Don't cache. More...
 
void set_rebuild_indices (TableParts parts)
 Rebuild indices. More...
 
void set_and_column_predicates (bool val)
 AND together the column predicates. More...
 
void clear ()
 Clears the state. More...
 
ScanSpecget ()
 Returns the built ScanSpec object. More...
 

Private Attributes

CharArena m_arena
 
ScanSpec m_scan_spec
 

Detailed Description

Helper class for building a ScanSpec.

This class manages the allocation of all string members.

Definition at line 318 of file ScanSpec.h.

Constructor & Destructor Documentation

Hypertable::Lib::ScanSpecBuilder::ScanSpecBuilder ( size_t  page_size = 8192)
inline

Constructor.

Parameters
page_sizePage size for memory arena

Definition at line 323 of file ScanSpec.h.

Hypertable::Lib::ScanSpecBuilder::ScanSpecBuilder ( const ScanSpec ss,
size_t  page_size = 8192 
)
inline

Copy constructor from a ScanSpec.

Parameters
ssScanSpec to copy
page_sizePage size for memory arena

Definition at line 329 of file ScanSpec.h.

Member Function Documentation

void Hypertable::Lib::ScanSpecBuilder::add_cell ( const string &  row,
const string &  column 
)
inline

Adds a cell to be returned in the scan.

Parameters
rowrow key
columncolumn spec of the form <family>[:<qualifier>]

Definition at line 467 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::add_cell_interval ( const string &  start_row,
const string &  start_column,
bool  start_inclusive,
const string &  end_row,
const string &  end_column,
bool  end_inclusive 
)
inline

Adds a cell interval to be returned in the scan.

Parameters
start_rowstart row
start_columnstart column spec of the form <family>[:<qualifier>]
start_inclusivetrue if interval should include start row
end_rowend row
end_columnend column spec of the form <family>[:<qualifier>]
end_inclusivetrue if interval should include end row

Definition at line 485 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::add_column ( const string &  str)
inline

Adds a column family to be returned by the scan.

Parameters
strcolumn family name

Definition at line 408 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::add_column_predicate ( const string &  column_family,
const char *  column_qualifier,
uint32_t  operation,
const char *  value,
uint32_t  value_len = 0 
)
inline

Adds a column predicate to the scan.

Parameters
column_familythe column family
column_qualifierColumn qualifier
operationthe operation (e.g. ColumnPredicate::EXACT_MATCH or ColumnPredicate::PREFIX_MATCH)
valuethe cell value
value_lenthe length of the value, in bytes. If 0 then the length will automatically be assigned using strlen(value)

Definition at line 426 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::add_row ( const string &  str)
inline

Adds a row to be returned in the scan.

Parameters
strrow key

Definition at line 441 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::add_row_interval ( const string &  start,
bool  start_inclusive,
const string &  end,
bool  end_inclusive 
)
inline

Adds a row interval to be returned in the scan.

Parameters
startstart row
start_inclusivetrue if interval should include start row
endend row
end_inclusivetrue if interval should include end row

Definition at line 455 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::clear ( )
inline

Clears the state.

Definition at line 555 of file ScanSpec.h.

ScanSpec& Hypertable::Lib::ScanSpecBuilder::get ( )
inline

Returns the built ScanSpec object.

Returns
reference to built ScanSpec object

Definition at line 566 of file ScanSpec.h.

ScanSpecBuilder& Hypertable::Lib::ScanSpecBuilder::operator= ( const ScanSpec ss)
inline

Definition at line 332 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::reserve_cells ( size_t  s)
inline

Definition at line 471 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::reserve_column_predicates ( size_t  s)
inline

Definition at line 433 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::reserve_columns ( size_t  s)
inline

Definition at line 412 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::reserve_rows ( size_t  s)
inline

Definition at line 445 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_and_column_predicates ( bool  val)
inline

AND together the column predicates.

Definition at line 548 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_cell_limit ( int32_t  n)
inline

Sets the maximum number of cells to return.

Parameters
ncell limit

Definition at line 349 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_cell_limit_per_family ( int32_t  n)
inline

Sets the maximum number of cells to return per column family.

Parameters
ncell limit per column family

Definition at line 356 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_cell_offset ( int32_t  n)
inline

Sets the number of cells to be skipped at the beginning of the query.

Parameters
ncell offset

Definition at line 375 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_do_not_cache ( bool  val)
inline

Don't cache.

Definition at line 535 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_end_time ( int64_t  end)
inline

Definition at line 507 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_keys_only ( bool  val)
inline

Return only keys (no values)

Definition at line 514 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_max_versions ( uint32_t  n)
inline

Sets the maximum number of revisions of each cell to return in the scan.

Parameters
nmaximum revisions

Definition at line 387 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_rebuild_indices ( TableParts  parts)
inline

Rebuild indices.

Parameters
partsDescribes which indices to rebuild

Definition at line 541 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_return_deletes ( bool  val)
inline

Internal use only.

Definition at line 521 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_row_limit ( int32_t  n)
inline

Sets the maximum number of rows to return in the scan.

Parameters
nrow limit

Definition at line 342 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_row_offset ( int32_t  n)
inline

Sets the number of rows to be skipped at the beginning of the query.

Parameters
nrow offset

Definition at line 363 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_row_regexp ( const char *  regexp)
inline

Sets the regexp to filter rows by.

Parameters
regexprow regexp

Definition at line 394 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_scan_and_filter_rows ( bool  val)
inline

Scan and filter rows.

Definition at line 528 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_start_time ( int64_t  start)
inline

Definition at line 503 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_time_interval ( int64_t  start,
int64_t  end 
)
inline

Sets the time interval of the scan.

Time values represent number of nanoseconds from 1970-01-00 00:00:00.000000000.

Parameters
startstart time in nanoseconds
endend time in nanoseconds

Definition at line 499 of file ScanSpec.h.

void Hypertable::Lib::ScanSpecBuilder::set_value_regexp ( const char *  regexp)
inline

Sets the regexp to filter cell values by.

Parameters
regexpvalue regexp

Definition at line 401 of file ScanSpec.h.

Member Data Documentation

CharArena Hypertable::Lib::ScanSpecBuilder::m_arena
private

Definition at line 569 of file ScanSpec.h.

ScanSpec Hypertable::Lib::ScanSpecBuilder::m_scan_spec
private

Definition at line 570 of file ScanSpec.h.


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