sys

package
v0.0.0-...-b22f859 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

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

View Source
const (
	GB = 1 << 30
	MB = 1 << 20
)
View Source
const VERSION = "0.0.3" //program version

Variables

View Source
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
)
View Source
var ADDR string //local address
View Source
var ADMINCRT string //admin crt文件地址
View Source
var ADMINKEY string //admin key文件地址
View Source
var ADMINTLS bool //web admin是否使用tls
View Source
var BACKLOGNAME = "back" //back log file name
View Source
var BINLOGNAME = "binlog.tdb" //bin log file name
View Source
var BINLOGSIZE int64 //size of binlog file
View Source
var BatchMode int8 = 1 //A ,B mode
View Source
var CACHELOGNAME = "cache" //cache log file name
View Source
var CLIADDR string //client服务地址
View Source
var CLICRT string //cli crt文件地址
View Source
var CLIKEY string //cli key文件地址
View Source
var CLITLS bool //客户端传输是否使用tls
View Source
var CLUSTER_NUM int //minimum number of nodes in a cluster
View Source
var CLUSTER_NUM_FINAL bool //fixed number of nodes ,minimum number of nodes in a cluster
View Source
var CMD bool

////////////////////////////////////////////

View Source
var COCURRENT_GET int64
View Source
var COCURRENT_PUT int64

////////////////////////////////////////////

View Source
var ConnectTimeout = 10 * time.Second
View Source
var DATAZLIB bool
View Source
var DBBUFFER int64 //
View Source
var DBFILEDIR string //db file dir
View Source
var DBMode = 1 //1table mode  2loose mode
View Source
var DBSTOREMODE int8 = 1 //storage mode 1hubbed 2sequencing
View Source
var DEBUGADDR string //debug pprof
View Source
var FREELOCKTIME int64 //maximum retention time of an idle lock
View Source
var GOGC int
View Source
var GOMAXLIMIT int64
View Source
var INIT bool
View Source
var LOGON bool //log on
View Source
var MAXDELSEQ int64 // max del seq
View Source
var MAXDELSEQCURSOR int64 // max del seq cursor
View Source
var MEGERCLUSACK = true
View Source
var MEMLIMIT int64
View Source
var MERGETIME int64
View Source
var MQADDR string //mq服务地址
View Source
var MQCRT string //mq crt文件地址
View Source
var MQKEY string //mq  key文件地址
View Source
var MQTLS bool //MQ是否使用tls
View Source
var NAMESPACE string //db namespace
View Source
var PRIVATEKEY string
View Source
var PUBLICKEY string
View Source
var REDOCONN = 1000
View Source
var ROOTPATHLOG string //log
View Source
var ReadTimeout = 10 * time.Second
View Source
var STARTTIME = time.Now() //Node startup time (Local time)
View Source
var STATLOGNAME = "stat" //stat log file name
View Source
var STATSEQ int64 // stat seq
View Source
var STORENODENUM = 1 //number of storage data nodes in the cluster
View Source
var SYNC bool //log on
View Source
var SYS_STAT = READY
View Source
var Service = NewSortMap[int, stub.Server]()

///////////////////////////////////////////

View Source
var SocketTimeout = 15 * time.Second
View Source
var TIME_DEVIATION int64 //time deviation
View Source
var TIME_DEVIATION_LIST = make([]int64, 0)
View Source
var TLDBJSON string
View Source
var TLDB_SYS_LOG = "tldb_sys.log" //system log
View Source
var TZLIB bool = true
View Source
var TransTimeout = 30 * time.Second
View Source
var UUID int64 //local UUID
View Source
var WEBADMINADDR string //web管理平台
View Source
var WSORIGIN string //mq websocket origin
View Source
var WaitTimeout = 30 * time.Second

////////////////////////////////////////////

View Source
var ZLV int // zlib compress level  0-9

Functions

func BlankLine

func BlankLine()

func Flag

func Flag()

////////////////////////////////////////////

func FmtLog

func FmtLog(v ...any)

func IsPROXY

func IsPROXY() bool

func IsREADY

func IsREADY() bool

func IsRUN

func IsRUN() bool

func IsStandAlone

func IsStandAlone() bool

func SetStat

func SetStat(stat STATTYPE, timenano time.Duration)

func Start

func Start()

func Stop

func Stop()

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

func (*Exception) Error

func (this *Exception) Error() (err error)

func (*Exception) Map

func (this *Exception) Map() *Map[int64, int8]

func (*Exception) Put

func (this *Exception) Put(uuid int64)

type STATTYPE

type STATTYPE int8

///////////////////////////////////////////

const (
	READY STATTYPE = 0
	PROXY STATTYPE = 1
	RUN   STATTYPE = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL