Documentation
¶
Overview ¶
Package tidesdb_go Copyright (C) TidesDB
Original Author: Alex Gaetano Padula
Licensed under the Mozilla Public License, v. 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.mozilla.org/en-US/MPL/2.0/
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type ColumnFamilyConfig
- type ColumnFamilySSTableStat
- type ColumnFamilyStat
- type Cursor
- type TidesDB
- func (db *TidesDB) BeginTxn(columnFamily string) (*Transaction, error)
- func (db *TidesDB) Close() error
- func (db *TidesDB) CompactSSTables(columnFamilyName string, maxThreads int) error
- func (db *TidesDB) CreateColumnFamily(name string, flushThreshold, maxLevel int, probability float32, ...) error
- func (db *TidesDB) CursorInit(columnFamily string) (*Cursor, error)
- func (db *TidesDB) Delete(columnFamilyName string, key []byte) error
- func (db *TidesDB) DeleteByRange(columnFamilyName string, startKey, endKey []byte) error
- func (db *TidesDB) DropColumnFamily(name string) error
- func (db *TidesDB) Get(columnFamilyName string, key []byte) ([]byte, error)
- func (db *TidesDB) GetColumnFamilyStat(columnFamilyName string) (*ColumnFamilyStat, error)
- func (db *TidesDB) ListColumnFamilies() (string, error)
- func (db *TidesDB) Put(columnFamilyName string, key, value []byte, ttl int64) error
- func (db *TidesDB) Range(columnFamilyName string, startKey, endKey []byte) ([][2][]byte, error)
- func (db *TidesDB) StartIncrementalMerge(columnFamilyName string, seconds, minSSTables int) error
- type TidesDBCompressionAlgo
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColumnFamilyConfig ¶ added in v0.3.0
type ColumnFamilyConfig struct {
Name string
FlushThreshold int32
MaxLevel int32
Probability float32
Compressed bool
CompressAlgo TidesDBCompressionAlgo
BloomFilter bool
}
ColumnFamilyConfig represents the configuration for a column family.
type ColumnFamilySSTableStat ¶ added in v0.3.0
ColumnFamilySSTableStat represents statistics about an SSTable in a column family.
type ColumnFamilyStat ¶ added in v0.3.0
type ColumnFamilyStat struct {
Config ColumnFamilyConfig
Name string
NumSSTables int
MemtableSize int64
MemtableEntryCount int64
IncrementalMerging bool
SSTableStats []*ColumnFamilySSTableStat
}
ColumnFamilyStat represents statistics about a column family.
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
Cursor represents a TidesDB cursor.
type TidesDB ¶
type TidesDB struct {
// contains filtered or unexported fields
}
TidesDB represents a TidesDB instance.
func (*TidesDB) BeginTxn ¶
func (db *TidesDB) BeginTxn(columnFamily string) (*Transaction, error)
BeginTxn begins a transaction.
func (*TidesDB) CompactSSTables ¶
CompactSSTables pairs and merges SSTables in a column family.
func (*TidesDB) CreateColumnFamily ¶
func (db *TidesDB) CreateColumnFamily(name string, flushThreshold, maxLevel int, probability float32, compressed bool, compressAlgo int, bloomFilter bool) error
CreateColumnFamily creates a new column family.
func (*TidesDB) CursorInit ¶
CursorInit initializes a new TidesDB cursor.
func (*TidesDB) DeleteByRange ¶
DeleteByRange deletes all key-value pairs within a specified range atomically.
func (*TidesDB) DropColumnFamily ¶
DropColumnFamily drops a column family and all associated data.
func (*TidesDB) GetColumnFamilyStat ¶ added in v0.3.0
func (db *TidesDB) GetColumnFamilyStat(columnFamilyName string) (*ColumnFamilyStat, error)
GetColumnFamilyStat retrieves statistics about a column family.
func (*TidesDB) ListColumnFamilies ¶
ListColumnFamilies lists the column families in TidesDB.
func (*TidesDB) StartIncrementalMerge ¶
StartIncrementalMerge starts a background incremental merges for a column family. Will run in background until db closure. Will merge pairs incrementally and only once min sstables are has been reached.
type TidesDBCompressionAlgo ¶
type TidesDBCompressionAlgo int
TidesDBCompressionAlgo represents the compression algorithm type.
const ( TDB_NO_COMPRESSION TidesDBCompressionAlgo = iota TDB_COMPRESS_SNAPPY TDB_COMPRESS_LZ4 TDB_COMPRESS_ZSTD )
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction represents a TidesDB transaction.
func (*Transaction) Delete ¶
func (txn *Transaction) Delete(key []byte) error
Delete removes a key-value pair from the transaction.
func (*Transaction) Free ¶
func (txn *Transaction) Free() error
Free frees the transaction and its operations.
func (*Transaction) Get ¶
func (txn *Transaction) Get(key []byte) ([]byte, error)
Get gets a value in the transaction.
func (*Transaction) Put ¶
func (txn *Transaction) Put(key, value []byte, ttl int64) error
Put adds a key-value pair to the transaction.
func (*Transaction) Rollback ¶
func (txn *Transaction) Rollback() error
Rollback rolls back the transaction.