InfiniSQL  v0.1.2-alpha
Massive Scale Transaction Processing
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Schema Class Reference

Schema object. More...

#include <Schema.h>

Public Member Functions

 Schema (int64_t domainidarg)
 
virtual ~Schema ()
 
int64_t getnexttableid ()
 acquire ever-increasing and unique table identifiers More...
 
int createTable (int64_t id)
 CREATE TABLE. More...
 

Public Attributes

int64_t domainid
 
int64_t nexttableid
 
boost::unordered_map< int64_t,
class Table * > 
tables
 
boost::unordered_map
< std::string, int64_t > 
tableNameToId
 
boost::unordered_map< int64_t,
boost::unordered_map
< std::string, int64_t > > 
fieldNameToId
 

Friends

class ApiInterface
 
class TransactionAgent
 
class Engine
 
class Transaction
 
class SubTransaction
 
class UserSchemaMgr
 

Detailed Description

Schema object.

1 schema per domain. holds tables and indices

Parameters
int64_tdomainid

Definition at line 42 of file Schema.h.

Constructor & Destructor Documentation

Schema::Schema ( int64_t  domainidarg)

Definition at line 32 of file Schema.cc.

32  : domainid(domainidarg), nexttableid(0)
33 {
34 }
Schema::~Schema ( )
virtual

Definition at line 36 of file Schema.cc.

37 {
38 }

Member Function Documentation

int Schema::createTable ( int64_t  id)

CREATE TABLE.

Parameters
idtableid
Returns

Definition at line 42 of file Schema.cc.

References BUILTIN_STATUS_NOTOK, BUILTIN_STATUS_OK, and tables.

Referenced by UserSchemaMgr::createtable().

43 {
44  if (tables.count(id)) // tableid exists
45  {
46  return BUILTIN_STATUS_NOTOK;
47  }
48 
49  tables[id] = new Table(id);
50  return BUILTIN_STATUS_OK;
51 }

Here is the caller graph for this function:

int64_t Schema::getnexttableid ( )

acquire ever-increasing and unique table identifiers

Returns
next tableid

Definition at line 53 of file Schema.cc.

References nexttableid.

Referenced by UserSchemaMgr::createtable().

54 {
55  return ++nexttableid;
56 }

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class ApiInterface
friend

Definition at line 48 of file Schema.h.

friend class Engine
friend

Definition at line 50 of file Schema.h.

friend class SubTransaction
friend

Definition at line 52 of file Schema.h.

friend class Transaction
friend

Definition at line 51 of file Schema.h.

friend class TransactionAgent
friend

Definition at line 49 of file Schema.h.

friend class UserSchemaMgr
friend

Definition at line 53 of file Schema.h.

Member Data Documentation

int64_t Schema::domainid

Definition at line 72 of file Schema.h.

Referenced by Statement::branchtotype(), and createSchema().

boost::unordered_map< int64_t, boost::unordered_map<std::string, int64_t> > Schema::fieldNameToId

Definition at line 78 of file Schema.h.

Referenced by Statement::getfieldid().

int64_t Schema::nexttableid

Definition at line 73 of file Schema.h.

Referenced by getnexttableid().

boost::unordered_map< std::string, int64_t > Schema::tableNameToId

Definition at line 75 of file Schema.h.

Referenced by UserSchemaMgr::createtable(), and Statement::resolveTableFields2().


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