-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
71 lines (63 loc) · 1.75 KB
/
main.go
File metadata and controls
71 lines (63 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package main
import (
"GoGraphDb/db/db_model"
"fmt"
)
func main(){
//sl := model.NewVertexSkipList()
/*node := model.Vertex{
Idntifier: 1128,
VertexType: 1,
OutE: map[model.EdgeIdentifier]bool{22:true},
InE: map[model.EdgeIdentifier]bool{11:true},
Properties: map[string]string{"name\ntest":"test"},
}
bytes, err := json.Marshal(node)
if err != nil {
log.CtxError(context.Background(), "test error: %+v", node)
}
fmt.Println(node)
fmt.Println(string(bytes))
fmt.Println(time.Now().UnixNano())
err = node.Flush(conf.Modify_Create)
node2 := model.Vertex{}
err = json.Unmarshal(bytes, &node2)
fmt.Println(node2)
fmt.Println(err)
*/
/*
fmt.Println(*memory_cache.VertexTree.Get(1128))
con := context.Background()
fmt.Println(con.Value(1))
log.CtxInfo(con,"test 1: %+v, 2: %+v", 1, 2)
fmt.Println(fmt.Sprintf("test 1: %+v, 2: %+v", 1, 2))
*/
/*
ctx := context.WithValue(context.Background(), 1, "ddddd")
log.CtxInfo(ctx, "test")
fmt.Println(ctx)
fmt.Println(ctx.Value(1))
fmt.Println(utils.CtxToString(ctx))
*/
/*
memory_cache.CreateVertex(utils.GenTimeStamp())
//time.Sleep(time.Nanosecond)
memory_cache.CreateVertex(utils.GenTimeStamp())
//time.Sleep(time.Nanosecond)
memory_cache.CreateVertex(utils.GenTimeStamp())
//time.Sleep(time.Nanosecond)
memory_cache.CreateVertex(utils.GenTimeStamp())
//time.Sleep(time.Nanosecond)
memory_cache.CreateVertex(utils.GenTimeStamp())
//time.Sleep(time.Nanosecond)
memory_cache.CreateVertex(utils.GenTimeStamp())
//time.Sleep(time.Nanosecond)
memory_cache.CreateVertex(utils.GenTimeStamp())
//time.Sleep(time.Nanosecond)
memory_cache.CreateVertex(utils.GenTimeStamp())
memory_cache.VertexTree.Print()
//manager.Flush()
*/
v := db_model.Vertex{}
fmt.Println(v.Idntifier)
}