示例#1
0
文件: big.go 项目: ngaut/ddtxn
func (b *Big) Populate(s *ddtxn.Store, ex *ddtxn.ETransaction) {
	for i := 0; i < int(b.ni); i++ {
		k := ddtxn.BidKey(uint64(i))
		s.CreateKey(k, int32(0), ddtxn.SUM)
	}
	for i := 0; i < b.np; i++ {
		k := ddtxn.ProductKey(i)
		s.CreateKey(k, int32(0), ddtxn.SUM)
	}
}
示例#2
0
文件: buy.go 项目: ngaut/ddtxn
func (b *Buy) Populate(s *ddtxn.Store, ex *ddtxn.ETransaction) {
	for i := 0; i < b.nbidders; i++ {
		k := ddtxn.ProductKey(i)
		s.CreateKey(k, int32(0), ddtxn.SUM)
	}
	dlog.Printf("Created %v products; np: %v\n", b.nbidders, b.nproducts)
	for i := 0; i < b.nbidders; i++ {
		k := ddtxn.UserKey(uint64(i))
		s.CreateKey(k, "x", ddtxn.WRITE)
	}
	dlog.Printf("Created %v bidders\n", b.nbidders)
	dlog.Printf("Done with Populate")
}