| 55 | } |
| 56 | |
| 57 | func GenerateRecords(count int) []*core.Record { |
| 58 | rand.Seed(time.Now().UnixNano()) |
| 59 | records := make([]*core.Record, count) |
| 60 | for i := 0; i < count; i++ { |
| 61 | key := GetTestBytes(i) |
| 62 | val := GetRandomBytes(24) |
| 63 | |
| 64 | record := &core.Record{ |
| 65 | Key: key, |
| 66 | Value: val, |
| 67 | FileID: int64(i), |
| 68 | DataPos: uint64(rand.Uint32()), |
| 69 | ValueSize: uint32(len(val)), |
| 70 | Timestamp: uint64(time.Now().Unix()), |
| 71 | TTL: uint32(rand.Intn(3600)), |
| 72 | TxID: uint64(rand.Intn(1000)), |
| 73 | } |
| 74 | records[i] = record |
| 75 | } |
| 76 | return records |
| 77 | } |