BangDB Transaction provides a mechanism to bundle a set of operations in a transaction to ensure atomicity for all the bundled operations. BangDB implements Optimistic Concurrency Control (OCC) to implement the transaction.
To create Table Env object
To get PersistType
To set PersistType
void setDbType ( PersistType db_type ) ;
PersistType is an enum with following options:
INMEM_ONLY INMEM_PERSIST PERSIST_ONLY
Please see bangdb common for more info.
To get index type for the table
To set index type for a table
void setIdxType ( IndexType idx_type ) ;
IndexType is an enum with following options:
HASH, EXTHASH BTREE, HEAP
Please see bangdb common for more info.
To get logType for a table
LogType getTableLogType ( ) ;
To set logType for a table
void setTableLogType ( LogType table_log_type ) ;
LogType is an enum with following options:
SHARED_LOG, PRIVATE_LOG, INVALID_LOG
Please see bangdb common for more info.
To get the table type
TableType getTableType ( ) ;
To set the table type
void setTableType ( TableType table_type ) ;
TableType is an enum with following options:
NORMAL_TABLE WIDE_TABLE INDEX_TABLE PRIMITIVE_INT PRIMITIVE_TABLE_LONG PRIMITIVE_TABLE_STRING LARGE_TABLE
Please see bangdb common for more info.
To get the key type
To set the key type for a table
void setKeyType ( KeyType key_type ) ;
KeyType is an enum with following options:
NORMAL_KEY = 1 COMPOSITE_KEY = 3 NORMAL_KEY_LONG = 10
Please see bangdb common for more info.
To get the sorting method for a table
SortMethod getSortMethod ( ) ;
To set the sorting method for a table
void setSortMethod ( SortMethod sort_method ) ;
SortMethod is an enum with following options:
LEXICOGRAPH = 1, QUASI_LEXICOGRAPH = 2, SORT_METHOD_INVALID = 100
Please see bangdb common for more info.
To get the sorting direction set for a table
SortDirection getSortDirection ( ) ;
To set the sprint direction for a table
void setSortDirection ( SortDirection sort_direction ) ;
SortDirection is an enum with following options:
SORT_ASCENDING = 3, SORT_DESCENDING = 4
Please see bangdb common for more info.
To get table subtype
TableSubType getTblSubType ( ) ;
To get table subtype
void setTblSubType ( TableSubType tbl_sub_type ) ;
TableSubType is an enum with following options:
BANGDB_SW_TABLE BANGDB_TOPK_TABLE NON_ANALYTICAL_TABLE INDEXBTREE_TABLE DUPLINDEX_TABLE_NOLOG
Please see bangdb common for more info.
To get PrimitiveDataType for a table
PrimitiveDataType getPrimDataType ( ) ;
To set value for PrimitiveDataType for a table
void setPrimDataType ( PrimitiveDataType prim_data_type ) ;
PrimitiveDataType is an enum with following options:
PRIMITIVE_INT PRIMITIVE_LONG PRIMITIVE_STRING, PRIMITIVE_INVALID
Please see bangdb common for more info.
To get the version
VersionType getVersionType ( ) ;
To set the version
void setVersionType ( VersionType version_type ) ;
VersionType is an enum with following options:
BANGDB_DATA_VERSION_OFF BANGDB_DATA_VERSION_ON
Please see bangdb common for more info.
To get the sizehint of a table
TableSizeHint getTableSizeHint ( ) ;
To set the sizehint of a table
void setTableSizeHint ( TableSizeHint table_sz_hint ) ;
TableSizeHint is an enum with following options:
TINY_TABLE_SIZE SMALL_TABLE_SIZE NORMAL_TABLE_SIZE, BIG_TABLE_SIZE, TABLE_SIZE_INVALID
Please see bangdb common for more info.
To get key size for a table
To set key size for a table
void setKeySize ( int key_sz ) ;
To get LogSize in Mb
To set LogSize in Mb
void setLogSizeMb ( int log_sz_mb ) ;
To get status of WalEnabled
To set WalEnabled
void setWalEnabled ( bool wal_enabled ) ;
To get status for auto commit
To enable auto commit for single operation
void setAutocommit ( bool autocommit ) ;
To check whether Duplicate keys are allowed
bool getAllowDuplicate ( ) ;
To set whether Duplicate keys are allowed in a table
void setAllowDuplicate ( bool allow_duplicate ) ;
To check if RevIdx is enabled
To set whether RevIdx is allowed or not
void setAllowRevIdx ( bool allow_rev_idx ) ;
To get value for Ttlsec
To set value for Ttlsec
void setTtlsec ( int ttlsec ) ;
To delete Table Env object
Creating TableEnv object
To get the PersistType set
public PersistType getDbType ( )
To set the PersistType for DB
public void setDbType ( PersistType db_type )
This set type of db, in-memory or persistent. Default is persistent.
PersistType is an enum with following values:
INMEM_ONLY INMEM_PERSIST PERSIST_ONLY
Please see more on this at bangdb common
To get the IndexType set
public IndexType getIdxType ( )
To set the IndexType for a table
public void setIdxType ( IndexType idx_type )
IndexType is an enum with following values:
HASH, EXTHASH BTREE, HEAP
Please see more on this at bangdb common
To get LogType set
public LogType getTableLogType ( )
To set LogType
public void setTableLogType ( LogType table_log_type )
BangDB can create write ahead log in shared and in private mode.
LogType is an enum with following values:
SHARED_LOG, PRIVATE_LOG, INVALID_LOG,
Please see more on this at bangdb common
To get TableType for a table
public TableType getTableType ( )
To set TableType
public void setTableType ( TableType table_type )
TableType is an enum with following values:
NORMAL_TABLE, WIDE_TABLE, INDEX_TABLE, PRIMITIVE_INT PRIMITIVE_TABLE_LONG PRIMITIVE_TABLE_STRING LARGE_TABLE
Please see more on this at bangdb common
To get KeyType set for a table
public KeyType getKeyType ( )
To set KeyType set for a table
public void setKeyType ( KeyType key_type )
KeyType is an enum with following values:
NORMAL_KEY COMPOSITE_KEY NORMAL_KEY_LONG
Please see more on this at bangdb common
To get the Sorting method set for a table
public SortMethod getSortMethod ( )
To set the Sorting method set for a table
public void setSortMethod ( SortMethod sort_method )
SortMethod is an enum with following values:
LEXICOGRAPH, QUASI_LEXICOGRAPH
Please see more on this at bangdb common
To get Sorting Direction set for a table
public SortDirection getSortDirection ( )
To set Sorting Direction set for a table
public void setSortDirection ( SortDirection sort_direction )
SortDirection is an enum with following values:
SORT_ASCENDING, SORT_DESCENDING
Please see more on this at bangdb common
To get the Table subtype
public TableSubType getTblSubType ( )
To set the subtype for a table
public void setTblSubType ( TableSubType tbl_sub_type )
TableSubType is an enum with following values:
BANGDB_SW_TABLE BANGDB_TOPK_TABLE NON_ANALYTICAL_TABLE INDEXBTREE_TABLE DUPLINDEX_TABLE_NOLOG
Please see more on this at bangdb common
To get the Primitive Data Type set
public PrimitiveDataType getPrimDataType ( )
To set the Primitive Data Type set
public void setPrimDataType ( PrimitiveDataType prim_data_type )
PrimitiveDataType is an enum with following values:
PRIMITIVE_INT PRIMITIVE_LONG PRIMITIVE_STRING
Please see more on this at bangdb common
To get Version type set
public VersionType getVersionType ( )
To set Version type
public void setVersionType ( VersionType version_type )
VersionType is an enum with following values:
BANGDB_DATA_VERSION_INVALID BANGDB_DATA_VERSION_VALID
Please see more on this at bangdb common
To get Table Size hint set select for a table
public TableSizeHint getTableSizeHint ( )
To set the TableSizeHint for a table
public void setTableSizeHint ( TableSizeHint table_sz_hint )
TableSizeHint is an enum with following values:
TINY_TABLE_SIZE SMALL_TABLE_SIZE NORMAL_TABLE_SIZE, BIG_TABLE_SIZE
Please see more on this at bangdb common
To get the size of key value
To set the size of a key
public void setKeySize ( int key_sz )
To get the value for Log size in Mb
public int getLogSizeMb ( )
To set the Log size in Mb
public void setLogSizeMb ( int log_sz_mb )
To check WalEnabled status
public int getWalEnabled ( )
To set WalEnabled
public void setWalEnabled ( int wal_enabled )
To check if Duplicates are allowed or not for a table
public int getAllowDuplicate ( )
To set whether duplicates should be allowed or not for a table
public void setAllowDuplicate ( int allow_duplicate )
To check whether RevIdx
is enabled or not
public int getAllowRevIdx ( )
To set whether RevIdx
is allowed or not
public void setAllowRevIdx ( int allow_rev_idx )
To allow reverse indexing
Note: It can only be done for WIDE_TABLE To get Ttlsec value set.To set the Ttlsec
public void setTtlsec ( int ttlsec )
This is to set whether to use SSL/TLS based secure channel or not.