Documentation ¶
Overview ¶
Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
github.com/donnie4w/tldb
Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
github.com/donnie4w/tldb
Copyright (c) 2023, donnie <donnie4w@gmail.com> All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
github.com/donnie4w/tldb
Index ¶
Constants ¶
const ( GB = 1 << 30 MB = 1 << 20 )
const VERSION = "0.0.3" //program version
Variables ¶
var ( IsClusRun func() bool GetRemoteNode func() []*stub.RemoteNode GetRunUUID func() []int64 SyncCount func() int64 TryRunToProxy func() error TryProxyToReady func() error ReSetStoreNodeNumber func(int32) error LoadData2TLDB func([]byte, string) error ForcedCoverageData2TLDB func([]byte, string, int64) error Export func(string) (bytes.Buffer, error) Level0Put func(string, []byte) error Level0Get func(string) ([]byte, error) Client2Serve func(string) error BroadRmNode func() error ForceUnLock func(string) Lock func(int64, string) ReqToken func(int64, string) error TryLock func(string) (string, bool) UnLock func(string, string) bool CcGet func() int64 CcPut func() int64 CountPut func() int64 CountGet func() int64 Cmd func() Log func() *logging.Logging )
var ADDR string //local address
var ADMINCRT string //admin crt文件地址
var ADMINKEY string //admin key文件地址
var ADMINTLS bool //web admin是否使用tls
var BACKLOGNAME = "back" //back log file name
var BINLOGNAME = "binlog.tdb" //bin log file name
var BINLOGSIZE int64 //size of binlog file
var BatchMode int8 = 1 //A ,B mode
var CACHELOGNAME = "cache" //cache log file name
var CLIADDR string //client服务地址
var CLICRT string //cli crt文件地址
var CLIKEY string //cli key文件地址
var CLITLS bool //客户端传输是否使用tls
var CLUSTER_NUM int //minimum number of nodes in a cluster
var CLUSTER_NUM_FINAL bool //fixed number of nodes ,minimum number of nodes in a cluster
var CMD bool
////////////////////////////////////////////
var COCURRENT_GET int64
var COCURRENT_PUT int64
////////////////////////////////////////////
var ConnectTimeout = 10 * time.Second
var DATAZLIB bool
var DBBUFFER int64 //
var DBFILEDIR string //db file dir
var DBMode = 1 //1table mode 2loose mode
var DBSTOREMODE int8 = 1 //storage mode 1hubbed 2sequencing
var DEBUGADDR string //debug pprof
var FREELOCKTIME int64 //maximum retention time of an idle lock
var GOGC int
var GOMAXLIMIT int64
var INIT bool
var LOGON bool //log on
var MAXDELSEQ int64 // max del seq
var MAXDELSEQCURSOR int64 // max del seq cursor
var MEGERCLUSACK = true
var MEMLIMIT int64
var MERGETIME int64
var MQADDR string //mq服务地址
var MQCRT string //mq crt文件地址
var MQKEY string //mq key文件地址
var MQTLS bool //MQ是否使用tls
var NAMESPACE string //db namespace
var PRIVATEKEY string
var PUBLICKEY string
var PWD string
var REDOCONN = 1000
var ROOTPATHLOG string //log
var ReadTimeout = 10 * time.Second
var STARTTIME = time.Now() //Node startup time (Local time)
var STATLOGNAME = "stat" //stat log file name
var STATSEQ int64 // stat seq
var STORENODENUM = 1 //number of storage data nodes in the cluster
var SYNC bool //log on
var SYS_STAT = READY
var Service = NewSortMap[int, stub.Server]()
///////////////////////////////////////////
var SocketTimeout = 15 * time.Second
var TIME_DEVIATION int64 //time deviation
var TIME_DEVIATION_LIST = make([]int64, 0)
var TLDBJSON string
var TLDB_SYS_LOG = "tldb_sys.log" //system log
var TZLIB bool = true
var TransTimeout = 30 * time.Second
var UUID int64 //local UUID
var WEBADMINADDR string //web管理平台
var WSORIGIN string //mq websocket origin
var WaitTimeout = 30 * time.Second
////////////////////////////////////////////
var ZLV int // zlib compress level 0-9
Functions ¶
func IsStandAlone ¶
func IsStandAlone() bool
Types ¶
type ConfBean ¶
type ConfBean struct { PWD *string `json:"pwd"` PUBLICKEY *string `json:"publickey"` PRIVATEKEY *string `json:"privatekey"` NAMESPACE *string `json:"namespace"` DBFILEDIR *string `json:"dir"` ROOTPATHLOG *string `json:"logdir"` BINLOGSIZE int64 `json:"binsize"` CLUSTER_NUM_FINAL bool `json:"clus_final"` CLUSTER_NUM int `json:"clus"` GOGC *int `json:"gc"` STORENODENUM int `json:"store"` MEMLIMIT int64 `json:"memlimit"` CLITLS bool `json:"clitls"` ADMINTLS bool `json:"admintls"` MQTLS bool `json:"mqtls"` WSORIGIN *string `json:"origin"` CLICRT *string `json:"clicrt"` CLIKEY *string `json:"clikey"` MQCRT *string `json:"mqcrt"` MQKEY *string `json:"mqkey"` ADMINCRT *string `json:"admincrt"` CLIADDR *string `json:"cli"` MQADDR *string `json:"mq"` ADDR *string `json:"cs"` WEBADMINADDR *string `json:"admin"` }
var Conf *ConfBean
type ErrCodeType ¶
type ErrCodeType int16
var ERR_AUTH_NOPASS ErrCodeType = 1301
*******************************************
var ERR_BATCHFAIL ErrCodeType = 512
batch fail
var ERR_BROADCAST ErrCodeType = 518
broadcast error
var ERR_CLUS_NOMATCH ErrCodeType = 505
the cluster nodes do not match
var ERR_COLUMNTYPE ErrCodeType = 419
column type error
var ERR_COLUMN_NOEXIST ErrCodeType = 412
column not exist
var ERR_DATA_NOEXIST ErrCodeType = 410
data no exist
var ERR_EPERM ErrCodeType = 521
Disallowed operation
var ERR_FILENOTEXIST ErrCodeType = 201
file not exist
var ERR_GETDATA ErrCodeType = 517
get data error
var ERR_IDX_NOEXIST ErrCodeType = 413
index not exist
var ERR_INCR_SEQ ErrCodeType = 503
incr seq error
var ERR_LOADLOG ErrCodeType = 522
load log error
var ERR_NODE_NOFOUND ErrCodeType = 504
node not find
var ERR_NO_CLUSTER ErrCodeType = 502
no clus stat
var ERR_NO_MATCH_PARAM ErrCodeType = 401
******************************************* the input parameters are incorrect
var ERR_NO_RUNSTAT ErrCodeType = 501
no run stat
var ERR_PROXY ErrCodeType = 520
var ERR_RESEND ErrCodeType = 513
repetition send
var ERR_SETSTAT ErrCodeType = 519
re set stat failed
var ERR_SYNCDATA ErrCodeType = 516
sync data error
var ERR_TABLE_EXIST ErrCodeType = 409
table exist
var ERR_TABLE_FEILD_EXIST ErrCodeType = 408
table field error
var ERR_TABLE_NOEXIST ErrCodeType = 411
table not exist
var ERR_TIMEOUT ErrCodeType = 506
over time
var ERR_TIMEOUT_1 ErrCodeType = 414
select over time
var ERR_TIMEOUT_2 ErrCodeType = 415
update over time
var ERR_TIMEOUT_3 ErrCodeType = 416
insert over time
var ERR_TIMEOUT_4 ErrCodeType = 417
create over time
var ERR_TIMEOUT_5 ErrCodeType = 418
truncate over time
var ERR_TXOVER ErrCodeType = 514
tx is over
var ERR_UNDEFINED ErrCodeType = 500
undefined
var ERR_UUID_REUSE ErrCodeType = 515
uuid re use
type Exception ¶
type Exception struct { Code ErrCodeType // contains filtered or unexported fields }
*******************************************
func NewException ¶
func NewException() *Exception