Beispiel #1
0
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)
	}
}
Beispiel #2
0
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")
}