ldb

package
v3.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGraph added in v3.0.6

func GetGraph(cli *rawkv.Client, startTime, endTime string)

func LdbGet

func LdbGet(dbName, flowID string) (value []string, err error)

Get(FlowID): 根据FlowID获取对应流数据的 KV 对

func LdbListFile

func LdbListFile(dirName string) (files []string)

读取目录下的所有文件名

func LdbLoadLSM

func LdbLoadLSM(cli *rawkv.Client, dbName, startTime, endTime string, IDKeyIpv4 []int, IDKeyIpv6 []int)

LoadLSM 取两个时间戳区间内的所有 KV 对,并以流 ID (给出组成流ID的下标)为 key 重新生成键值存储 以字典实现,分批次读取数据,每次最多从tikv中读取limit(10000)个以时间戳为key的<k,v> 字典记录key,<k,v>写入数据库中,当有新数据时,若key不存在,直接写入,key存在就先读出再拼接写入

func LdbLoadTXT

func LdbLoadTXT(cli *rawkv.Client, fileName, startTime, endTime string, limit int)

导出数据库中的所有文件的ip, limit为每次scan的长度,区间[startTime,endTime]

func LdbScan

func LdbScan(dbName, startFlowID, endFlowID string) (key []string, value []string, err error)

Scan( FlowID _start, FlowID _end): 获取两个流 ID 区间内(字母序)的所有流数据

func LdbWriteFile

func LdbWriteFile(cli *rawkv.Client, files []string)

将所有文件写入数据库

func ParseStr added in v3.1.1

func ParseStr(keyPart, valPart [][]byte, IDnum [][]int) (mapIP map[string]string)

Types

type Product added in v3.1.1

type Product struct {
	// contains filtered or unexported fields
}

type Tm added in v3.1.1

type Tm struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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