Exemplo n.º 1
0
//存储堆排序结果
func StoreSortingResult(h *sorting.Heap, taskId string) {
	for h.Len() > 0 {
		element := heap.Pop(h).(sorting.Element)
		b, err := json.Marshal(element)
		if err != nil {
			logs.Log("json marshal error in StoreValueTypeStat : " + err.Error())
			return
		}
		dbutil.Store(string(b), "2", taskId)
	}
}
Exemplo n.º 2
0
func StoreValueLengthFilter(list *list.List, fileId string) {

	for e := list.Front(); e != nil; e = e.Next() {
		str, ok := e.Value.(string)
		if ok {
			dbutil.Store(str, "2", fileId)
		} else {
			logs.Log("list element error in StoreValueLengthFilter list element is not string!")
			continue
		}
	}
}
Exemplo n.º 3
0
func StoreValueTypeStat(resultMap map[string]int, fileId string) {
	for k, v := range resultMap {
		var value ValueTypeStat
		value.ValueType = k
		value.Num = v
		b, err := json.Marshal(value)
		if err != nil {
			logs.Log("json marshal error in StoreValueTypeStat : " + err.Error())
			return
		}
		dbutil.Store(string(b), "1", fileId)
	}
}
Exemplo n.º 4
0
//输出过滤的key
func StoreKeyFiltResult(keyMap map[string]int, taskId string) {

	for key, valueL := range keyMap {
		var value ValueLengthFilterData
		value.Key = key
		value.ValueLength = valueL
		b, err := json.Marshal(value)

		if err != nil {
			logs.Log("json marshal error in valueLengthFilter : " + err.Error())
			continue
		}
		dbutil.Store(string(b), "3", taskId)
	}
}