Documentation ¶
Index ¶
- Constants
- Variables
- func BufferLen(ctx context.Context, tableID int, tableName string) int
- func FailedCheck(ctx context.Context) error
- func HandleBatchFailed(ctx context.Context, name, params string, seq int32) error
- func Insert(ctx context.Context, tableInfo *obj.TblTable, subIntervals map[string]int)
- func InsertHandle(ctx context.Context) error
- func PushBatchInsert(ctx context.Context, nameSrv string, tableID int, table string, ...) (n int, err error)
- type BatchItems
- type Cron
- type Filter
- type InsertItem
Constants ¶
View Source
const ( FlushOpen = 1 //开 FlushClose = 0 //关 )
View Source
const ( ReadPriority = 0 WritePriority = 1 )
View Source
const ( PreBatchInsertBuff = "BatchBuff" //批量插入缓冲区 PreBatchExchange = "BatchEx" //交换缓冲区 PreBatchMutex = "BatchMutex" //缓冲区处理互斥 PreBatchInsertFailBuff = "BatchFailBuff" //批量插入失败缓冲区 )
View Source
const ( RetBatchInsert = 101 // 批量插入异常 RetBatchDataUnMarshal = 102 // 批量结果解压缩失败 RetHasBatchFailed = 103 // 有异常待处理批量插入记录 RetBatchFailedHandle = 104 // 批量插入异常处理失败 RetFormatDataError = 105 // 格式化数据 error )
View Source
const BufferRedis = "buffer" //BufferRedis 批量插入缓冲区
View Source
const (
InsertPopMax = 70000
)
Variables ¶
Functions ¶
func HandleBatchFailed ¶
HandleBatchFailed 处理批量插入失败数据
Types ¶
type BatchItems ¶
type BatchItems []*InsertItem
func (BatchItems) Len ¶
func (s BatchItems) Len() int
func (BatchItems) Less ¶
func (s BatchItems) Less(i, j int) bool
func (BatchItems) Swap ¶
func (s BatchItems) Swap(i, j int)
type InsertItem ¶
type InsertItem struct { Rand int `json:"rand,omitempty"` Time int64 `json:"time,omitempty"` Table string `json:"proto,omitempty"` Retry int `json:"retry,omitempty"` Data map[string]interface{} `json:"data,omitempty"` Datas []map[string]interface{} `json:"datas,omitempty"` DataType map[string]int8 `json:"data_type,omitempty"` Errors map[int]string `json:"errors,omitempty"` }
Click to show internal directories.
Click to hide internal directories.